From e88d5c69364aab1fe0cf204f17e49f4457c1f154 Mon Sep 17 00:00:00 2001 From: lancer <1905818361@qq.com> Date: Tue, 24 Aug 2021 18:57:17 +0800 Subject: [PATCH 1/2] init --- pages/center/Piabodata/TrendAnalysis.vue | 107 ++++++++++++------ .../js_sdk/u-charts/config-ucharts.js | 2 +- 2 files changed, 74 insertions(+), 35 deletions(-) diff --git a/pages/center/Piabodata/TrendAnalysis.vue b/pages/center/Piabodata/TrendAnalysis.vue index 5c6671a..63268e7 100644 --- a/pages/center/Piabodata/TrendAnalysis.vue +++ b/pages/center/Piabodata/TrendAnalysis.vue @@ -45,9 +45,17 @@ 简报 - - {{item.name}} - {{item.num}} + + {{item.name}} + + + {{item.num}} + + + 对比:{{item.num1}} + {{item.num2}} + + @@ -72,11 +80,11 @@ - + 选择顾问 @@ -151,7 +159,7 @@ - + 对比报表 @@ -162,29 +170,13 @@ 时段2 变化 - - 06-20 VS 06-10 - 500 - 60 - +500(+19.83%) - - - 06-20 VS 06-10 - 500 - 60 - +500(+19.83%) - - - 06-20 VS 06-10 - 500 - 60 - +500(+19.83%) - - - 06-20 VS 06-10 - 500 - 60 - +500(+19.83%) + + + {{item.time}} + {{item.time1}} + {{item.time2}} + {{item.compare}} + @@ -216,10 +208,11 @@ export default { data() { return { + compareFlag:false, numlist:[ - {name:'接待量',num:'10'}, - {name:'平均执行率',num:'10'}, - {name:'接待客户',num:'10'}, + {name:'接待量',num:'10',num1:'0',num2:'0'}, + {name:'平均执行率',num:'10',num1:'0',num2:'0'}, + {name:'接待时长',num:'10',num1:'0',num2:'0'}, ], activeTotal: 0, //时间下标 newactiveTotal: 0, //tab下标 @@ -285,7 +278,33 @@ timepickpickisshow: false, sheartime1: "", sheartime2: "", - intervaltime: 0 + intervaltime: 0, + tableDate:[ + { + time:'06-20 VS 06-10', + time1:'500', + time2:'60', + compare:'+500(+19.83%)' + }, + { + time:'06-20 VS 06-10', + time1:'500', + time2:'60', + compare:'+500(+19.83%)' + }, + { + time:'06-20 VS 06-10', + time1:'500', + time2:'60', + compare:'+500(+19.83%)' + }, + { + time:'06-20 VS 06-10', + time1:'500', + time2:'60', + compare:'+500(+19.83%)' + }, + ] }; }, @@ -354,7 +373,21 @@ this.$u.post("/cusLvStatistics/lyAndcp", this.pamect).then(data => { this.pamect.lastStartDate = data.lastStartDate; this.pamect.lastEndDate = data.lastEndDate; - + this.numlist[0].num=data.startSumCustomer + this.numlist[1].num=data.startFraction; + this.numlist[2].num=data.startSumDuration; + if(data.endSumDuration!=null){ + this.compareFlag=true + // return + this.numlist[0].num1=data.endSumCustomer + this.numlist[1].num1=data.endFraction; + this.numlist[2].num1=data.endSumDuration; + this.numlist[0].num2=data.contrastSumCustomer + this.numlist[1].num2=data.contrastFraction +'%'; + this.numlist[2].num2=data.contrastSumDuration; + }else{ + this.compareFlag=false + } this.sheartime1 = data.lastStartDate.substring(5, 10) + "--" + data.lastEndDate.substring(5, 10); this.sheartime2 = '请选择'; @@ -1195,4 +1228,10 @@ margin-top: 10rpx; } } + .comparesize{ + flex: 1; + font-size: 24rpx; + color: #666666; + margin-top: 10rpx; + } diff --git a/uni_modules/qiun-data-charts/js_sdk/u-charts/config-ucharts.js b/uni_modules/qiun-data-charts/js_sdk/u-charts/config-ucharts.js index 954275c..6ce72c5 100644 --- a/uni_modules/qiun-data-charts/js_sdk/u-charts/config-ucharts.js +++ b/uni_modules/qiun-data-charts/js_sdk/u-charts/config-ucharts.js @@ -310,7 +310,7 @@ module.exports = { "fontColor": "#666666", "fontSize": 13, "rotateLabel": false, - "itemCount": 7, + "itemCount": 3, "boundaryGap": "center", "disableGrid": true, "gridColor": "#CCCCCC", From 51f6c72b72ea3eea254bc73324308ade685f389d Mon Sep 17 00:00:00 2001 From: lancer <1905818361@qq.com> Date: Wed, 25 Aug 2021 15:43:01 +0800 Subject: [PATCH 2/2] init --- config.js | 4 +- pages/center/Piabodata/StaffAnalysis.vue | 6 +- pages/center/Piabodata/TrendAnalysis.vue | 181 +++++++++++++++-------- pages/center/Piabodata/index.vue | 26 ++-- utils/http.js | 4 +- 5 files changed, 141 insertions(+), 80 deletions(-) diff --git a/config.js b/config.js index be10eb6..e5ae0d4 100644 --- a/config.js +++ b/config.js @@ -2,8 +2,8 @@ * 小程序配置文件 */ // 此处主机域名修改成腾讯云解决方案分配的域名 -var host = 'http://121.42.63.138:9091/autoSR/api'; // 测试站 -// var host = 'http://192.168.31.163:8080/autoSR/api'; // 长龙 +// var host = 'http://121.42.63.138:9091/autoSR/api'; // 测试站 +var host = 'http://192.168.31.163:8080/autoSR/api'; // 长龙 // var host = 'http://192.168.31.128:8080/autoSR/api'; // 佳豪 // var host = 'http://10.2.1.104:8081/autoSR/api'; // 刘敏 // var host = 'https://zkgj.quhouse.com/api'; // 质控正式 diff --git a/pages/center/Piabodata/StaffAnalysis.vue b/pages/center/Piabodata/StaffAnalysis.vue index 8de6c25..8805828 100644 --- a/pages/center/Piabodata/StaffAnalysis.vue +++ b/pages/center/Piabodata/StaffAnalysis.vue @@ -316,7 +316,7 @@ ] first.map(item=>{ this.lineOptsect.categories.push(item.statDate.slice(5,10)) - this.lineOptsect.series[0].data.push(item.sumCustomer||0) + this.lineOptsect.series[0].data.push(item.receptionCount||0) }) }else{ this.lineOptsect.series=[ @@ -331,10 +331,10 @@ ] first.map(item=>{ this.lineOptsect.categories.push(item.statDate.slice(5,10)) - this.lineOptsect.series[0].data.push(item.sumCustomer) + this.lineOptsect.series[0].data.push(item.receptionCount) }) second.map(item=>{ - this.lineOptsect.series[1].data.push(item.sumCustomer) + this.lineOptsect.series[1].data.push(item.receptionCount) }) } // console.log(this.lineOptsect,'1') diff --git a/pages/center/Piabodata/TrendAnalysis.vue b/pages/center/Piabodata/TrendAnalysis.vue index 63268e7..4d48fd6 100644 --- a/pages/center/Piabodata/TrendAnalysis.vue +++ b/pages/center/Piabodata/TrendAnalysis.vue @@ -86,8 +86,8 @@ --> - - 选择顾问 + + {{lopanobj.name}} + {{Selecttuanduiobj.name}} + @@ -163,22 +166,30 @@ 对比报表 - - - 时间 - 时段1 - 时段2 - 变化 + + + + + {{item1}} + {{item1==0?'--':item1+'%'}} + + + - - - {{item.time}} - {{item.time1}} - {{item.time2}} - {{item.compare}} + + + + + + {{item1==0?'--':item1+'%'}} + {{item1+'%'}} + {{item1}} + + + + - - + @@ -279,32 +290,8 @@ sheartime1: "", sheartime2: "", intervaltime: 0, - tableDate:[ - { - time:'06-20 VS 06-10', - time1:'500', - time2:'60', - compare:'+500(+19.83%)' - }, - { - time:'06-20 VS 06-10', - time1:'500', - time2:'60', - compare:'+500(+19.83%)' - }, - { - time:'06-20 VS 06-10', - time1:'500', - time2:'60', - compare:'+500(+19.83%)' - }, - { - time:'06-20 VS 06-10', - time1:'500', - time2:'60', - compare:'+500(+19.83%)' - }, - ] + tableDate:[], + guwenFlag:false }; }, @@ -610,6 +597,28 @@ }) that.lineOptsect.series[1].data = data.firstValue.map(item => item.fraction); that.lineOptsect.series[0].data = data.lastValue.map(item => item.fraction) + that.guwenFlag=false + // // 处理表格数据 + let arr=[ + ['时间','时段一','时段二','变化'] + // { + // time:'时间', + // time1:'时段一', + // time2:'时段二', + // compare:'变化' + // }, + ] + that.lineOptsect.categories.map((item,index)=>{ + let newarr=[item,data.firstValue[index].fraction,data.lastValue[index].fraction,data.contrast[index].data] + // obj.time=item + // obj.time1=data.firstValue[index].fraction + // obj.time2=data.lastValue[index].fraction + // obj.compare=data.contrast[index].data + // arr.push(obj) + arr.push(newarr) + }) + // console.log(arr) + that.tableDate=arr } }); }, @@ -620,46 +629,59 @@ categories: [], series: [] }; - this.linetype = "line"; - this.$u.post("/cusLvStatistics/teamOrOneValueShow", this.pamect).then(data => { + this.linetype = "radar"; + this.$u.post("/cusLvStatistics/accFirstLevelContrast", this.pamect).then(data => { + // return if (this.pamect.showStatus == 0) { that.lineOptsect = { categories: [], series: [{ - name: '起始时间', + name: '时段一', data: [], color: '#7ED3F4' }] } - data.lastValue.forEach((item, sdf) => { - that.lineOptsect.categories.push(item.statDate.substring(5, 10)) + data.firstList.forEach((item, sdf) => { + that.lineOptsect.categories.push(item.name) + that.lineOptsect.series[0].data.push(data.headerList[sdf].total) }) - that.lineOptsect.series[0].data = data.lastValue.map(item => item.fraction); + // that.lineOptsect.series[0].data = data.lastValue.map(item => item.fraction); } else { + // 当有对比的时候 that.lineOptsect = { categories: [], series: [{ - name: '起始时间', + name: '时段一', data: [], color: '#7ED3F4' }, { - name: '对比时间', + name: '时段二', data: [], color: '#FF7070' }, ] } - data.firstValue.forEach((item, sdf) => { - data.lastValue.forEach((child, zxc) => { - if (sdf == zxc) { - that.lineOptsect.categories.push(item.statDate.substring(5, - 10) + 'vs' + child.statDate.substring(5, 10)) - } - }) + data.headerList.forEach((item, sdf) => { + that.lineOptsect.categories.push(item.name) + that.lineOptsect.series[0].data.push(data.firstList[sdf].total) + that.lineOptsect.series[1].data.push(data.secondList[sdf].total) }) - that.lineOptsect.series[1].data = data.firstValue.map(item => item.fraction); - that.lineOptsect.series[0].data = data.lastValue.map(item => item.fraction) + // return + // // 处理表格数据 + that.guwenFlag=true + let arr=[] + arr[0]=['时间',...that.lineOptsect.categories] + arr[1]=['变化'] + arr[2]=['时段一'] + arr[3]=['时段二'] + // console.log(arr) + data.firstList.map((item,index)=>{ + arr[1].push(item.total) + arr[2].push(data.secondList[index].total) + arr[3].push(data.thirdList[index].total) + }) + that.tableDate=arr } }); }, @@ -778,6 +800,18 @@ }) this.lineOptsect.series[1].data = data.firstList.map(item => item.avgExecutionRate); this.lineOptsect.series[0].data = data.lastList.map(item => item.avgExecutionRate) + let that=this + this.guwenFlag=false + // // 处理表格数据 + let arr=[ + ['时间','时段一','时段二','变化'] + ] + that.lineOptsect.categories.map((item,index)=>{ + let newarr=[item,data.firstList[index].avgExecutionRate,data.lastList[index].avgExecutionRate,data.contrast[index].data] + arr.push(newarr) + }) + // console.log(arr) + that.tableDate=arr } }) }, @@ -994,6 +1028,29 @@ .fraction); that.lineOptsect.series[0].data = data.lastValue.receptionStatList.map(item => item .fraction) + that.guwenFlag=false + // 团队处理数据 + // // 处理表格数据 + let arr=[ + ['时间',data.firstValue.deptName,data.lastValue.deptName,'变化'] + // { + // time:'时间', + // time1:'时段一', + // time2:'时段二', + // compare:'变化' + // }, + ] + that.lineOptsect.categories.map((item,index)=>{ + let newarr=[item,data.firstValue.receptionStatList[index].fraction,data.lastValue.receptionStatList[index].fraction,data.contrast.receptionStatList[index].data] + // obj.time=item + // obj.time1=data.firstValue[index].fraction + // obj.time2=data.lastValue[index].fraction + // obj.compare=data.contrast[index].data + // arr.push(obj) + arr.push(newarr) + }) + // console.log(arr) + that.tableDate=arr } } }); diff --git a/pages/center/Piabodata/index.vue b/pages/center/Piabodata/index.vue index 69680cf..43371e9 100644 --- a/pages/center/Piabodata/index.vue +++ b/pages/center/Piabodata/index.vue @@ -68,7 +68,7 @@ + inactive-color="#b1b1b1" active-color="#008ef2" :list="newlistoj1" :is-scroll="true">