diff --git a/src/views/ebiz/report/reportDetail.vue b/src/views/ebiz/report/reportDetail.vue index 35d1d4596..b273df077 100644 --- a/src/views/ebiz/report/reportDetail.vue +++ b/src/views/ebiz/report/reportDetail.vue @@ -1,39 +1,85 @@ @@ -56,7 +102,9 @@ export default { data() { return { reportList: [], - title: '' + title: '', + special: false, + company: null } }, beforeRouteLeave(to, from, next) { @@ -64,41 +112,69 @@ 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) { + document.title = '中介渠道' + 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 +208,74 @@ export default { }