Parcourir la source

修改部分页面排序功能

newStyle
douzhuo il y a 2 ans
Parent
révision
87e6e97d0d
5 fichiers modifiés avec 156 ajouts et 72 suppressions
  1. +9
    -0
      src/api/modules/api.js
  2. +33
    -9
      src/views/Statistics/BuildingContrast.vue
  3. +27
    -12
      src/views/Statistics/ConsultantBrand.vue
  4. +85
    -50
      src/views/Statistics/ReceptionStatistical.vue
  5. +2
    -1
      src/views/admin/role/index.vue

+ 9
- 0
src/api/modules/api.js Voir le fichier

@@ -1230,4 +1230,13 @@ export function insertSelective(data) {
method: 'post',
data: data
})
}

// 修改角色权限
export function updateMessageType(data) {
return request({
url: '/admin/role/updateMessageType',
method: 'post',
data: data
})
}

+ 33
- 9
src/views/Statistics/BuildingContrast.vue Voir le fichier

@@ -67,7 +67,7 @@

<!-- 表格 -->
<div class="cen-tab">
<el-table :header-cell-style="{background:'#F5F7FA',color:'#333333'}" :data="tableData" stripe style="width: 100%">
<el-table :header-cell-style="{background:'#F5F7FA',color:'#333333'}" :data="tableData" stripe style="width: 100%" @sort-change="customTabLast">
<el-table-column prop="batchId" label="序号" align="center">
<template slot-scope="scope">
{{
@@ -86,26 +86,26 @@
}}
</template>
</el-table-column>
<el-table-column prop="fraction" label="平均执行率" align="center" width="110" sortable>
<el-table-column prop="fraction" label="平均执行率" align="center" width="110" sortable="custom">
<template slot-scope="{ row }"> {{ row.fraction }}% </template>
</el-table-column>
<el-table-column prop="accountNum" label="顾问数" align="center" sortable>
<el-table-column prop="accountNum" label="顾问数" align="center" sortable="custom">
</el-table-column>
<el-table-column prop="receptionCount" label="接待量" align="center" sortable>
<el-table-column prop="receptionCount" label="接待量" align="center" sortable="custom">
</el-table-column>
<el-table-column prop="activeCustomer" label="有效接待" align="center" width="100" sortable>
<el-table-column prop="activeCustomer" label="有效接待" align="center" width="100" sortable="custom">
</el-table-column>
<el-table-column prop="prohibitedCustomer" label="违禁接待次数" align="center" sortable width="140">
<el-table-column prop="prohibitedCustomer" label="违禁接待次数" align="center" sortable="custom" width="140">
</el-table-column>
<el-table-column prop="sumDuration" label="接待时长(分钟)" align="center" sortable width="140">
<el-table-column prop="sumDuration" label="接待时长(分钟)" align="center" sortable="custom" width="140">
<template slot-scope="scope">
{{ Math.floor(scope.row.sumDuration / 60) || 0 }}
</template>
</el-table-column>
<el-table-column prop="prohibitedZb" label="违禁接待占比" align="center" sortable width="140">
<el-table-column prop="prohibitedZb" label="违禁接待占比" align="center" sortable="custom" width="140">
<template slot-scope="{ row }"> {{ row.prohibitedZb }}% </template>
</el-table-column>
<el-table-column prop="addtodigestCount" label="优秀案例数" align="center" sortable width="140"></el-table-column>
<el-table-column prop="addtodigestCount" label="优秀案例数" align="center" sortable="custom" width="140"></el-table-column>
</el-table>
<div style="display: flex; justify-content: flex-end; margin-top: 10px">
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="page"
@@ -389,6 +389,30 @@ export default {

},
methods: {

// 排序触发
customTabLast(e) {
console.log(e);
if (e.order == "ascending") {
this.tableData.sort((a, b) => {
return a[e.prop] - b[e.prop];
});
}
if (e.order == "descending") {
this.tableData.sort((a, b) => {
return b[e.prop] - a[e.prop];
});
}
console.log(this.tableData);
let index = this.tableData.findIndex((item) => {
return item.houseName == this.total;
});
if (index != -1) {
let obj = this.tableData.splice(index, 1);
this.tableData.push(obj[0]);
}
},

getSummaries(param) {
const { columns, data } = param;
const sums = [];


+ 27
- 12
src/views/Statistics/ConsultantBrand.vue Voir le fichier

@@ -94,9 +94,9 @@
<el-table
:header-cell-style="{ background: '#F5F7FA', color: '#333333' }"
:data="tableData"
@sort-change="customTabLast"
stripe
style="width: 100%"
@sort-change="customTabLast"
>
<el-table-column prop="batchId" width="120" label="序号" align="center">
<template slot-scope="scope">
@@ -115,7 +115,7 @@
prop="activeCustomer"
label="接待量"
align="center"
sortable
sortable="custom"
>
<template slot-scope="{ row }"> {{ row.activeCustomer }}次 </template>
</el-table-column>
@@ -125,7 +125,7 @@
label="未标顾问"
align="center"
width="100"
sortable
sortable="custom"
>
<template slot-scope="{ row }"> {{ row.unTagCustomer }}个 </template>
</el-table-column>
@@ -135,7 +135,7 @@
label="违禁接待次数"
width="120"
align="center"
sortable
sortable="custom"
>
<template slot-scope="{ row }">
{{ row.prohibitedCustomer }}次
@@ -147,16 +147,16 @@
label="违禁接待占比"
align="center"
width="120"
sortable
sortable="custom"
>
<template slot-scope="{ row }"> {{ row.prohibitedZb }}% </template>
</el-table-column>
<el-table-column
v-if="tabFlag == 0"
prop="realityEquipmentCount"
prop="sumDuration"
label="接待时长"
align="center"
sortable
sortable="custom"
width="110"
>
<template slot-scope="{ row }">
@@ -168,7 +168,7 @@
prop="fraction"
label="销讲执行率"
align="center"
sortable
sortable="custom"
width="120"
>
<template slot-scope="{ row }" style="text-align: center">
@@ -992,10 +992,25 @@ export default {
methods: {
// 排序触发
customTabLast(e) {
console.log(e, "触发了");
let index = this.tableData.findIndex((item) => item.accountName == "");
let obj = this.tableData.splice(index, 1);
this.tableData.push(obj);
console.log(e);
if (e.order == "ascending") {
this.tableData.sort((a, b) => {
return a[e.prop] - b[e.prop];
});
}
if (e.order == "descending") {
this.tableData.sort((a, b) => {
return b[e.prop] - a[e.prop];
});
}
console.log(this.tableData);
let index = this.tableData.findIndex((item) => {
return item.accountName == null;
});
if (index != -1) {
let obj = this.tableData.splice(index, 1);
this.tableData.push(obj[0]);
}
},
// 排名颜色
topThreeColor(index) {


+ 85
- 50
src/views/Statistics/ReceptionStatistical.vue Voir le fichier

@@ -85,18 +85,25 @@
</el-option>
</el-select>
</div>
</div>
<div class="app-titel" style="margin-top: 15px">
<div style="margin-left: 30px">
<div style="margin-left: 30px">
<el-button type="primary" size="small" @click="screen()"
>筛选</el-button
>
<el-button type="text" size="small" @click="reset()"
>清空筛选条件</el-button
>
<el-button style="margin-left:10px;" @click="isSystoleForm" type="text">{{isOpen?'收起':'展开'}}<i style="margin-left:5px;" :class="isOpen?'el-icon-arrow-up':'el-icon-arrow-down'"></i></el-button>

<el-button
style="margin-left: 10px"
@click="isSystoleForm"
type="text"
>{{ isOpen ? "收起" : "展开"
}}<i
style="margin-left: 5px"
:class="isOpen ? 'el-icon-arrow-up' : 'el-icon-arrow-down'"
></i
></el-button>
</div>
<div
style="margin-left: auto; margin-right: 10px"
@@ -105,11 +112,15 @@
<el-button @click="downLoad" icon="el-icon-download">导出</el-button>
</div>
</div>
</div>
<!-- 表格 -->
<div class="cen-tab">
<el-table :header-cell-style="{background:'#F5F7FA',color:'#333333'}" :data="tableData" style="width: 100%">
<el-table
:header-cell-style="{ background: '#F5F7FA', color: '#333333' }"
:data="tableData"
style="width: 100%"
@sort-change="customTabLast"
>
<el-table-column prop="batchId" width="120" label="序号" align="center">
<template slot-scope="scope">
{{
@@ -121,10 +132,10 @@
</el-table-column>
<el-table-column
width="120"
prop="accountName"
prop="statDate"
label="日期"
align="center"
sortable
sortable="custom"
>
<template slot-scope="scope">
{{
@@ -139,7 +150,7 @@
label="平均执行率"
align="center"
width="110"
sortable
sortable="custom"
>
<template slot-scope="{ row }"> {{ row.fraction }}% </template>
</el-table-column>
@@ -147,7 +158,7 @@
prop="receptionCount"
label="接待量"
align="center"
sortable
sortable="custom"
>
<template slot-scope="{ row }"> {{ row.receptionCount }}次 </template>
</el-table-column>
@@ -155,7 +166,7 @@
prop="accountNum"
label="接待顾问"
align="center"
sortable
sortable="custom"
width="100"
>
</el-table-column>
@@ -163,7 +174,7 @@
prop="activeCustomer"
label="有效接待"
align="center"
sortable
sortable="custom"
width="100"
>
<template slot-scope="{ row }"> {{ row.activeCustomer }}次 </template>
@@ -172,7 +183,7 @@
prop="prohibitedCustomer"
label="违禁接待次数"
align="center"
sortable
sortable="custom"
width="120"
>
</el-table-column>
@@ -180,7 +191,7 @@
prop="sumDurationMinutes"
label="接待时长(分)"
align="center"
sortable
sortable="custom"
width="120"
>
<template slot-scope="{ row }">
@@ -192,18 +203,18 @@
label="违禁接待占比"
align="center"
width="150"
sortable
sortable="custom"
>
<template slot-scope="{ row }"> {{ row.prohibitedZb }}% </template>
</el-table-column>
<el-table-column
v-for="(item, idx) in tablist"
:key="idx"
:prop="item.props"
:label="item.label"
align="center"
sortable
sortable="custom"
width="100"
>
<template slot-scope="{ row }"> {{ row[item.props] }}% </template>
@@ -236,11 +247,7 @@

<el-dialog title="详情" :visible.sync="dialogVisible" width="80%">
<div class="cen-tab">
<el-table
:data="detailData"
stripe
style="width: 100%"
>
<el-table :data="detailData" stripe style="width: 100%">
<el-table-column prop="batchId" label="序号" align="center">
<template slot-scope="scope">
{{
@@ -254,29 +261,26 @@
</el-table-column>
<el-table-column prop="deptName" label="归属团队" align="center">
</el-table-column>
<el-table-column prop="fraction" label="平均执行率" align="center" >
<el-table-column prop="fraction" label="平均执行率" align="center">
</el-table-column>
<el-table-column prop="receptionCount" label="接待量" align="center" >
<el-table-column prop="receptionCount" label="接待量" align="center">
</el-table-column>
<el-table-column
prop="activeCustomer"
label="有效接待"
align="center"
>
</el-table-column>
<el-table-column
prop="prohibitedCustomer"
label="违禁接待次数"
align="center"
>
</el-table-column>
<el-table-column
prop="sumDurationMinutes"
label="接待时长(分)"
align="center"
>
<template slot-scope="{ row }">
{{ Math.floor(row.sumDurationMinutes) }}
@@ -286,10 +290,9 @@
prop="prohibitedZb"
label="违禁接待占比"
align="center"
>
</el-table-column>
<el-table-column
v-for="(item, idx) in tablist1"
:key="idx"
@@ -322,7 +325,7 @@ import { exportMethodPost } from "@/util/util";
export default {
data() {
return {
isOpen:false,
isOpen: false,
houseId: "",
buildingoptions: [],
houseList: [],
@@ -377,8 +380,41 @@ export default {
}
},
methods: {
isSystoleForm(){
this.isOpen = !this.isOpen
// 排序触发
customTabLast(e) {
console.log(e);
if (e.prop == "statDate") {
this.tableData.sort((a, b) => {
let timeA = a[e.prop] == null ? null : new Date(a[e.prop].replace(/-/g, "/")).getTime();
let timeB = b[e.prop] == null ? null : new Date(b[e.prop].replace(/-/g, "/")).getTime();
if (e.order == "ascending") {
return timeA - timeB;
}
if (e.order == "descending") {
return timeB - timeA;
}
});
} else {
this.tableData.sort((a, b) => {
if (e.order == "ascending") {
return a[e.prop] - b[e.prop];
}
if (e.order == "descending") {
return b[e.prop] - a[e.prop];
}
});
}
let index = this.tableData.findIndex((item) => {
return item.statDate == null;
});
if (index != -1) {
let obj = this.tableData.splice(index, 1);
this.tableData.push(obj[0]);
}
},

isSystoleForm() {
this.isOpen = !this.isOpen;
},
downLoad() {
let obj = {
@@ -594,7 +630,7 @@ export default {
this.statDateEnd = "";
this.dateType = index;
this.customtime = [];
//给时间选择器赋值
let num = 24 * 3600 * 1000;
// 获取当前时间戳转换为日期格式
@@ -627,7 +663,6 @@ export default {
return arr;
},

timestampToTime(timestamp) {
var date = new Date(timestamp); //时间戳为10位需*1000,时间戳为13位的话不需乘1000
var yyyy = date.getFullYear() + "-";
@@ -734,8 +769,8 @@ export default {
font-weight: 500;
font-size: 16px;
color: #333333;
display: flex;
align-items: center;
display: flex;
align-items: center;
}
.text2 {
flex: 1;
@@ -763,8 +798,8 @@ export default {
font-weight: 500;
font-size: 16px;
color: #333333;
display: flex;
align-items: center;
display: flex;
align-items: center;
}
.text2 {
flex: 1;
@@ -846,27 +881,27 @@ export default {
margin-left: 15px;
min-width: 40px;
}
/deep/ .el-table__header-wrapper{
thead{
tr{
th{
background: #F5F7FA;
/deep/ .el-table__header-wrapper {
thead {
tr {
th {
background: #f5f7fa;
color: #333333;
}
}
}
}
/deep/ .el-dialog--center{
/deep/ .el-dialog--center {
border-radius: 8px;
.el-dialog__title{
.el-dialog__title {
font-weight: bold;
}
}
/deep/ .el-button--primary{
background: #2671E2 !important;
border: 1px solid #2671E2 !important;
/deep/ .el-button--primary {
background: #2671e2 !important;
border: 1px solid #2671e2 !important;
}
/deep/ .el-button--text{
color: #2671E2;
/deep/ .el-button--text {
color: #2671e2;
}
</style>

+ 2
- 1
src/views/admin/role/index.vue Voir le fichier

@@ -456,6 +456,7 @@ export default {
if (row.messageType) {
console.log(row.messageType, "这里是messagetype");
this.checkList = row.messageType.split(',')
this.$forceUpdate() // 某些浏览器上无法更新
}
},

@@ -473,7 +474,7 @@ export default {
} else {
this.form.messageType = ''
}
putObj(this.form).then((res) => {
this.$api.api.updateMessageType(this.form).then((res) => {
console.log(res);
this.cancelAddPush();
if (res.code == 0) {


Chargement…
Annuler
Enregistrer