From ebfe962ebe0f38d71ce8886dab19088c64e4505b Mon Sep 17 00:00:00 2001 From: mengxiaolong Date: Tue, 11 Aug 2020 10:14:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=9A=E7=BB=A9=E5=BF=AB=E6=8A=A5=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E9=99=A9=E7=A7=8D=E5=90=8D=E7=A7=B0=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/ebiz/report/reportDetail.vue | 273 +++++++++++++++++++------ src/views/ebiz/report/reportList.vue | 9 +- 2 files changed, 214 insertions(+), 68 deletions(-) diff --git a/src/views/ebiz/report/reportDetail.vue b/src/views/ebiz/report/reportDetail.vue index 35d1d4596..0c9d6e041 100644 --- a/src/views/ebiz/report/reportDetail.vue +++ b/src/views/ebiz/report/reportDetail.vue @@ -1,39 +1,80 @@ @@ -56,7 +97,9 @@ export default { data() { return { reportList: [], - title: '' + title: '', + special: false, + company: null } }, beforeRouteLeave(to, from, next) { @@ -64,41 +107,68 @@ export default { next() }, mounted() { - document.body.style.backgroundColor = '#fff' - this.reportList = JSON.parse(localStorage.reportList) - if (localStorage.title == '团险') { - this.title = '健康险' - } else if (localStorage.title == '银代') { - if (localStorage.name) { - this.title = localStorage.name - document.title = '银保渠道' - return - } else { - this.title = '银保' + let special = localStorage.getItem('special') + if (special) { + this.special = special + // 获取所有公司名称 + let companyName = new Set() + let dataList = JSON.parse(localStorage.reportList) + for (let data of dataList) { + companyName.add(data.salechnlName) } - } else if (localStorage.title == '个险') { - if (localStorage.name) { - this.title = localStorage.name - document.title = '个险渠道' - return - } else { - this.title = '个险' + let company = [] + for (let name of companyName) { + company.push({ + name: name, + data: [] + }) } + + for (let data of dataList) { + for (let c of company) { + if (data.salechnlName === c.name) { + c.data.push(data) + } + } + } + this.company = company } else { - this.title = localStorage.title - } - this.reportList.map((item, index) => { - if (item.sellTypeName == null) { - item.sellTypeName = '其他' + document.body.style.backgroundColor = '#fff' + this.reportList = JSON.parse(localStorage.reportList) + if (localStorage.title == '团险') { + this.title = '健康险' + } else if (localStorage.title == '银代') { + if (localStorage.name) { + this.title = localStorage.name + document.title = '银保渠道' + return + } else { + this.title = '银保' + } + } else if (localStorage.title == '个险') { + if (localStorage.name) { + this.title = localStorage.name + document.title = '个险渠道' + return + } else { + this.title = '个险' + } + } else { + this.title = localStorage.title } - // if (localStorage.name) { - // if (item.manageComName == null) { - // item.manageComName = '其他' - // } - // } - }) - // 筛选按钮的点击事件 - document.title = this.title + '渠道' + this.reportList.map((item, index) => { + if (item.sellTypeName == null) { + item.sellTypeName = '其他' + } + // if (localStorage.name) { + // if (item.manageComName == null) { + // item.manageComName = '其他' + // } + // } + }) + // 筛选按钮的点击事件 + document.title = this.title + '渠道' + } }, filters: { filterTitle: function(value) { @@ -132,6 +202,77 @@ export default { }