Browse Source

修改部分页面排序功能

newStyle
douzhuo 2 years ago
parent
commit
87e6e97d0d
5 changed files with 156 additions and 72 deletions
  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 View File

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

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

+ 33
- 9
src/views/Statistics/BuildingContrast.vue View File

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


<!-- 表格 --> <!-- 表格 -->
<div class="cen-tab"> <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"> <el-table-column prop="batchId" label="序号" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ {{
@@ -86,26 +86,26 @@
}} }}
</template> </template>
</el-table-column> </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> <template slot-scope="{ row }"> {{ row.fraction }}% </template>
</el-table-column> </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>
<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>
<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>
<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>
<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"> <template slot-scope="scope">
{{ Math.floor(scope.row.sumDuration / 60) || 0 }} {{ Math.floor(scope.row.sumDuration / 60) || 0 }}
</template> </template>
</el-table-column> </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> <template slot-scope="{ row }"> {{ row.prohibitedZb }}% </template>
</el-table-column> </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> </el-table>
<div style="display: flex; justify-content: flex-end; margin-top: 10px"> <div style="display: flex; justify-content: flex-end; margin-top: 10px">
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="page" <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="page"
@@ -389,6 +389,30 @@ export default {


}, },
methods: { 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) { getSummaries(param) {
const { columns, data } = param; const { columns, data } = param;
const sums = []; const sums = [];


+ 27
- 12
src/views/Statistics/ConsultantBrand.vue View File

@@ -94,9 +94,9 @@
<el-table <el-table
:header-cell-style="{ background: '#F5F7FA', color: '#333333' }" :header-cell-style="{ background: '#F5F7FA', color: '#333333' }"
:data="tableData" :data="tableData"
@sort-change="customTabLast"
stripe stripe
style="width: 100%" style="width: 100%"
@sort-change="customTabLast"
> >
<el-table-column prop="batchId" width="120" label="序号" align="center"> <el-table-column prop="batchId" width="120" label="序号" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
@@ -115,7 +115,7 @@
prop="activeCustomer" prop="activeCustomer"
label="接待量" label="接待量"
align="center" align="center"
sortable
sortable="custom"
> >
<template slot-scope="{ row }"> {{ row.activeCustomer }}次 </template> <template slot-scope="{ row }"> {{ row.activeCustomer }}次 </template>
</el-table-column> </el-table-column>
@@ -125,7 +125,7 @@
label="未标顾问" label="未标顾问"
align="center" align="center"
width="100" width="100"
sortable
sortable="custom"
> >
<template slot-scope="{ row }"> {{ row.unTagCustomer }}个 </template> <template slot-scope="{ row }"> {{ row.unTagCustomer }}个 </template>
</el-table-column> </el-table-column>
@@ -135,7 +135,7 @@
label="违禁接待次数" label="违禁接待次数"
width="120" width="120"
align="center" align="center"
sortable
sortable="custom"
> >
<template slot-scope="{ row }"> <template slot-scope="{ row }">
{{ row.prohibitedCustomer }}次 {{ row.prohibitedCustomer }}次
@@ -147,16 +147,16 @@
label="违禁接待占比" label="违禁接待占比"
align="center" align="center"
width="120" width="120"
sortable
sortable="custom"
> >
<template slot-scope="{ row }"> {{ row.prohibitedZb }}% </template> <template slot-scope="{ row }"> {{ row.prohibitedZb }}% </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
v-if="tabFlag == 0" v-if="tabFlag == 0"
prop="realityEquipmentCount"
prop="sumDuration"
label="接待时长" label="接待时长"
align="center" align="center"
sortable
sortable="custom"
width="110" width="110"
> >
<template slot-scope="{ row }"> <template slot-scope="{ row }">
@@ -168,7 +168,7 @@
prop="fraction" prop="fraction"
label="销讲执行率" label="销讲执行率"
align="center" align="center"
sortable
sortable="custom"
width="120" width="120"
> >
<template slot-scope="{ row }" style="text-align: center"> <template slot-scope="{ row }" style="text-align: center">
@@ -992,10 +992,25 @@ export default {
methods: { methods: {
// 排序触发 // 排序触发
customTabLast(e) { 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) { topThreeColor(index) {


+ 85
- 50
src/views/Statistics/ReceptionStatistical.vue View File

@@ -85,18 +85,25 @@
</el-option> </el-option>
</el-select> </el-select>
</div> </div>
</div> </div>
<div class="app-titel" style="margin-top: 15px"> <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 type="primary" size="small" @click="screen()"
>筛选</el-button >筛选</el-button
> >
<el-button type="text" size="small" @click="reset()" <el-button type="text" size="small" @click="reset()"
>清空筛选条件</el-button >清空筛选条件</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>
<div <div
style="margin-left: auto; margin-right: 10px" style="margin-left: auto; margin-right: 10px"
@@ -105,11 +112,15 @@
<el-button @click="downLoad" icon="el-icon-download">导出</el-button> <el-button @click="downLoad" icon="el-icon-download">导出</el-button>
</div> </div>
</div> </div>
</div> </div>
<!-- 表格 --> <!-- 表格 -->
<div class="cen-tab"> <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"> <el-table-column prop="batchId" width="120" label="序号" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ {{
@@ -121,10 +132,10 @@
</el-table-column> </el-table-column>
<el-table-column <el-table-column
width="120" width="120"
prop="accountName"
prop="statDate"
label="日期" label="日期"
align="center" align="center"
sortable
sortable="custom"
> >
<template slot-scope="scope"> <template slot-scope="scope">
{{ {{
@@ -139,7 +150,7 @@
label="平均执行率" label="平均执行率"
align="center" align="center"
width="110" width="110"
sortable
sortable="custom"
> >
<template slot-scope="{ row }"> {{ row.fraction }}% </template> <template slot-scope="{ row }"> {{ row.fraction }}% </template>
</el-table-column> </el-table-column>
@@ -147,7 +158,7 @@
prop="receptionCount" prop="receptionCount"
label="接待量" label="接待量"
align="center" align="center"
sortable
sortable="custom"
> >
<template slot-scope="{ row }"> {{ row.receptionCount }}次 </template> <template slot-scope="{ row }"> {{ row.receptionCount }}次 </template>
</el-table-column> </el-table-column>
@@ -155,7 +166,7 @@
prop="accountNum" prop="accountNum"
label="接待顾问" label="接待顾问"
align="center" align="center"
sortable
sortable="custom"
width="100" width="100"
> >
</el-table-column> </el-table-column>
@@ -163,7 +174,7 @@
prop="activeCustomer" prop="activeCustomer"
label="有效接待" label="有效接待"
align="center" align="center"
sortable
sortable="custom"
width="100" width="100"
> >
<template slot-scope="{ row }"> {{ row.activeCustomer }}次 </template> <template slot-scope="{ row }"> {{ row.activeCustomer }}次 </template>
@@ -172,7 +183,7 @@
prop="prohibitedCustomer" prop="prohibitedCustomer"
label="违禁接待次数" label="违禁接待次数"
align="center" align="center"
sortable
sortable="custom"
width="120" width="120"
> >
</el-table-column> </el-table-column>
@@ -180,7 +191,7 @@
prop="sumDurationMinutes" prop="sumDurationMinutes"
label="接待时长(分)" label="接待时长(分)"
align="center" align="center"
sortable
sortable="custom"
width="120" width="120"
> >
<template slot-scope="{ row }"> <template slot-scope="{ row }">
@@ -192,18 +203,18 @@
label="违禁接待占比" label="违禁接待占比"
align="center" align="center"
width="150" width="150"
sortable
sortable="custom"
> >
<template slot-scope="{ row }"> {{ row.prohibitedZb }}% </template> <template slot-scope="{ row }"> {{ row.prohibitedZb }}% </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
v-for="(item, idx) in tablist" v-for="(item, idx) in tablist"
:key="idx" :key="idx"
:prop="item.props" :prop="item.props"
:label="item.label" :label="item.label"
align="center" align="center"
sortable
sortable="custom"
width="100" width="100"
> >
<template slot-scope="{ row }"> {{ row[item.props] }}% </template> <template slot-scope="{ row }"> {{ row[item.props] }}% </template>
@@ -236,11 +247,7 @@


<el-dialog title="详情" :visible.sync="dialogVisible" width="80%"> <el-dialog title="详情" :visible.sync="dialogVisible" width="80%">
<div class="cen-tab"> <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"> <el-table-column prop="batchId" label="序号" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ {{
@@ -254,29 +261,26 @@
</el-table-column> </el-table-column>
<el-table-column prop="deptName" label="归属团队" align="center"> <el-table-column prop="deptName" label="归属团队" align="center">
</el-table-column> </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>
<el-table-column prop="receptionCount" label="接待量" align="center" >
<el-table-column prop="receptionCount" label="接待量" align="center">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="activeCustomer" prop="activeCustomer"
label="有效接待" label="有效接待"
align="center" align="center"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="prohibitedCustomer" prop="prohibitedCustomer"
label="违禁接待次数" label="违禁接待次数"
align="center" align="center"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="sumDurationMinutes" prop="sumDurationMinutes"
label="接待时长(分)" label="接待时长(分)"
align="center" align="center"
> >
<template slot-scope="{ row }"> <template slot-scope="{ row }">
{{ Math.floor(row.sumDurationMinutes) }} {{ Math.floor(row.sumDurationMinutes) }}
@@ -286,10 +290,9 @@
prop="prohibitedZb" prop="prohibitedZb"
label="违禁接待占比" label="违禁接待占比"
align="center" align="center"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
v-for="(item, idx) in tablist1" v-for="(item, idx) in tablist1"
:key="idx" :key="idx"
@@ -322,7 +325,7 @@ import { exportMethodPost } from "@/util/util";
export default { export default {
data() { data() {
return { return {
isOpen:false,
isOpen: false,
houseId: "", houseId: "",
buildingoptions: [], buildingoptions: [],
houseList: [], houseList: [],
@@ -377,8 +380,41 @@ export default {
} }
}, },
methods: { 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() { downLoad() {
let obj = { let obj = {
@@ -594,7 +630,7 @@ export default {
this.statDateEnd = ""; this.statDateEnd = "";
this.dateType = index; this.dateType = index;
this.customtime = []; this.customtime = [];
//给时间选择器赋值 //给时间选择器赋值
let num = 24 * 3600 * 1000; let num = 24 * 3600 * 1000;
// 获取当前时间戳转换为日期格式 // 获取当前时间戳转换为日期格式
@@ -627,7 +663,6 @@ export default {
return arr; return arr;
}, },


timestampToTime(timestamp) { timestampToTime(timestamp) {
var date = new Date(timestamp); //时间戳为10位需*1000,时间戳为13位的话不需乘1000 var date = new Date(timestamp); //时间戳为10位需*1000,时间戳为13位的话不需乘1000
var yyyy = date.getFullYear() + "-"; var yyyy = date.getFullYear() + "-";
@@ -734,8 +769,8 @@ export default {
font-weight: 500; font-weight: 500;
font-size: 16px; font-size: 16px;
color: #333333; color: #333333;
display: flex;
align-items: center;
display: flex;
align-items: center;
} }
.text2 { .text2 {
flex: 1; flex: 1;
@@ -763,8 +798,8 @@ export default {
font-weight: 500; font-weight: 500;
font-size: 16px; font-size: 16px;
color: #333333; color: #333333;
display: flex;
align-items: center;
display: flex;
align-items: center;
} }
.text2 { .text2 {
flex: 1; flex: 1;
@@ -846,27 +881,27 @@ export default {
margin-left: 15px; margin-left: 15px;
min-width: 40px; 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; color: #333333;
} }
} }
} }
} }
/deep/ .el-dialog--center{
/deep/ .el-dialog--center {
border-radius: 8px; border-radius: 8px;
.el-dialog__title{
.el-dialog__title {
font-weight: bold; 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> </style>

+ 2
- 1
src/views/admin/role/index.vue View File

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


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


Loading…
Cancel
Save