From d96cb1f276f293c957a88d0861162c6316d232f9 Mon Sep 17 00:00:00 2001 From: lancer <1905818361@qq.com> Date: Mon, 23 Aug 2021 11:06:56 +0800 Subject: [PATCH] init --- config.js | 4 +- manifest.json | 2 +- pages/center/Piabodata/Groupcontrast.vue | 96 +++++++-- pages/center/Piabodata/Theteamcompared.vue | 224 ++++++++++++++++----- pages/center/Piabodata/selectGroup.vue | 150 ++++++++++++++ pages/center/Piabodata/selectTeam.vue | 92 +++++++-- pages/mine/consultanonduty/index.vue | 137 ++++++++----- utils/http.js | 4 +- 8 files changed, 570 insertions(+), 139 deletions(-) create mode 100644 pages/center/Piabodata/selectGroup.vue diff --git a/config.js b/config.js index 4dbf857..8eedb6b 100644 --- a/config.js +++ b/config.js @@ -2,9 +2,9 @@ * 小程序配置文件 */ // 此处主机域名修改成腾讯云解决方案分配的域名 -// var host = 'http://121.42.63.138:9091/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://192.168.31.128:8080/autoSR/api'; // 佳豪 // var host = 'http://10.2.1.104:8081/autoSR/api'; // 刘敏 // var host = 'https://zkgj.quhouse.com/api'; // 质控正式 // var host = 'https://hfju.com/api'; // 数智正式 diff --git a/manifest.json b/manifest.json index 774ae5d..317a17a 100644 --- a/manifest.json +++ b/manifest.json @@ -91,7 +91,7 @@ }, "quickapp" : {}, "mp-weixin" : { - "appid" : "wxb6493c296350b9db", + "appid" : "wx8f883dca5ecc5510", "setting" : { "urlCheck" : false, "es6" : true, diff --git a/pages/center/Piabodata/Groupcontrast.vue b/pages/center/Piabodata/Groupcontrast.vue index ef5e556..8dd23f8 100644 --- a/pages/center/Piabodata/Groupcontrast.vue +++ b/pages/center/Piabodata/Groupcontrast.vue @@ -2,13 +2,13 @@ - 今日 + 近七天 - 昨日 + 近15天 - 近一周 + 近30天 自定义 @@ -26,7 +26,7 @@ 均值:25 - + {{item.name.substring(0, 4)}} @@ -48,7 +48,7 @@ 均值:25 - + {{item.name.substring(0, 4)}} @@ -79,7 +79,7 @@ 均值:25 - + {{item.name.substring(0, 4)}} @@ -110,7 +110,7 @@ 均值:25 - + {{item.name.substring(0, 4)}} @@ -125,7 +125,7 @@ - 违禁能力(TOP10) + 销奖能力(TOP10) 楼盘 @@ -150,7 +150,7 @@ - + - + @@ -212,7 +212,26 @@ activeTotal2: 0, bocindex:0, totalTimeShow: false, - newlisttabinfo:[ + // 楼盘id + houseId:'', + lastStartDate:'', + lastEndDate :'', + newlisttabinfo1:[ + {name:'接待量',zxl:'10'}, + {name:'平均执行率',zxl:'50'}, + {name:'接待客户',zxl:'80'}, + ], + newlisttabinfo2:[ + {name:'接待量',zxl:'10'}, + {name:'平均执行率',zxl:'50'}, + {name:'接待客户',zxl:'80'}, + ], + newlisttabinfo3:[ + {name:'接待量',zxl:'10'}, + {name:'平均执行率',zxl:'50'}, + {name:'接待客户',zxl:'80'}, + ], + newlisttabinfo4:[ {name:'接待量',zxl:'10'}, {name:'平均执行率',zxl:'50'}, {name:'接待客户',zxl:'80'}, @@ -230,7 +249,16 @@ }; }, onLoad() { - + let that=this + uni.$on('updateGroup',function(data){ + // console.log(data) + that.deptids=data.arr.join(',') + // 获取销奖能力 + that.getPowerList() + }) + // this.buildingname = uni.getStorageSync('buildingID').name; + // 请求接口获取接待量 + this.receptionCountList('1','/cusLvStatistics/groupComparisonReception') }, methods: { //指标执行率分析tab @@ -238,13 +266,53 @@ this.bocindex = index; }, //时间切换 + //时间切换 tabtimetap(index) { if (index == 3) { this.totalTimeShow = true; } else { this.activeTotal = index; + this.lastEndDate='' + this.lastStartDate='' + // // 获取数据 + // // 团队对比接待量 + // this.receptionCountList(0,1,'/cusLvStatistics/teamAnalysisReception') + // // 团队对比接待时长 + // this.receptionCountList(0,2,'/cusLvStatistics/teamAnalysisReceptionTime') + // /* 销奖执行率 */ + // this.receptionCountList(0,3,'/cusLvStatistics/teamAnalysisExecutionRate') + // // 获取销奖能力 + // this.getPowerList() } }, + // 接待时长 + receptionCountList(index,url){ + this.$u.post(url,{ + timeType:this.lastEndDate?null:this.activeTotal+'', + lastEndDate:this.lastEndDate, + lastStartDate:this.lastStartDate + }) + .then(res=>{ + console.log(res) + let result=res.result + this['newTeam'+index]=res.avg[0] + this['newAvg'+index]=res.avg[1] + // return + // 处理数据 + // 先处理牌名数据,需要进行判断全部还是单个 + // 当为全部时 + this['newlisttabinfo'+index]=[] + // 当选择全部时 + + // 当两个都选择的时候 + result.map(item=>{ + let obj={} + obj.name=item.houseName + obj.zxl=item.data + this['newlisttabinfo'+index].push(obj) + }) + }) + }, //自定义时间 totalTimeChange(e) { console.log(e.startDate, e.endDate) diff --git a/pages/center/Piabodata/Theteamcompared.vue b/pages/center/Piabodata/Theteamcompared.vue index c7cc384..99b7d54 100644 --- a/pages/center/Piabodata/Theteamcompared.vue +++ b/pages/center/Piabodata/Theteamcompared.vue @@ -57,7 +57,7 @@ {{!staff2.value?'均值':staff2.label}}:{{newAvg1||0}} - 来访(人) + 接待量 {{!staff2.value?'均值':staff2.label}}:{{newAvg2||0}} - 来访(人) + 录音时长 {{!staff2.value?'均值':staff2.label}}:{{newAvg3||0}} - 来访(人) + 执行率 - 违禁能力(TOP10) + 销奖能力 楼盘 - - 合计:50 - 均值:25 - + - + + @@ -277,10 +274,10 @@ - + --> - - + + @@ -326,6 +323,7 @@ active3:0, active4:0, }, + deptids:'', bocindex:0, timepickpickisshow:false, totalTimeShow: false, @@ -427,7 +425,7 @@ newAvg3:'', newTeam4:'', newAvg4:'', - chartData:{ + chartData1:{ "categories": ["维度1","维度2","维度3","维度4","维度5","维度6"], "series": [ { @@ -449,11 +447,19 @@ }; }, onLoad() { + let that=this + uni.$on('update',function(data){ + // console.log(data) + that.deptids=data.arr.join(',') + // 获取销奖能力 + that.getPowerList() + }) // 获取楼盘id this.houseId = uni.getStorageSync('buildingID').id; // this.buildingname = uni.getStorageSync('buildingID').name; // 请求接口获取所有置业顾问员工的列表 this.getSectionList() + }, methods: { //是否对比 @@ -461,15 +467,19 @@ this.timepickpickisshow=!this.timepickpickisshow; this.staff2.label='平均' this.staff2.value='' - // this.getreception() - // this.getRecordList() - // this.getAwardList() + // 团队对比接待量 + this.receptionCountList(0,1,'/cusLvStatistics/teamAnalysisReception') + // 团队对比接待时长 + this.receptionCountList(0,2,'/cusLvStatistics/teamAnalysisReceptionTime') + /* 销奖执行率 */ + this.receptionCountList(0,3,'/cusLvStatistics/teamAnalysisExecutionRate') + // 获取销奖能力 + this.getPowerList() }, // 获取部门列表 getSectionList(){ this.$u.post('/cusLvStatistics/findAllDeptIdByHouseId',{houseId:this.houseId}) .then(res=>{ - // console.log(res,'123') this.staffList=[] this.staffList1=[] res.map(item=>{ @@ -489,7 +499,14 @@ }) this.staff1=this.staffList[0] // 团队对比接待量 - this.receptionCountList(0,1) + this.receptionCountList(0,1,'/cusLvStatistics/teamAnalysisReception') + // 团队对比接待时长 + this.receptionCountList(0,2,'/cusLvStatistics/teamAnalysisReceptionTime') + /* 销奖执行率 */ + this.receptionCountList(0,3,'/cusLvStatistics/teamAnalysisExecutionRate') + // 获取销奖能力 + this.getPowerList() + }) }, // 点击部门对比 @@ -513,33 +530,34 @@ this.lastEndDate='' this.lastStartDate='' // 获取数据 - // this.getreception() - // this.getRecordList() - // this.getAwardList() + // 团队对比接待量 + this.receptionCountList(0,1,'/cusLvStatistics/teamAnalysisReception') + // 团队对比接待时长 + this.receptionCountList(0,2,'/cusLvStatistics/teamAnalysisReceptionTime') + /* 销奖执行率 */ + this.receptionCountList(0,3,'/cusLvStatistics/teamAnalysisExecutionRate') + // 获取销奖能力 + this.getPowerList() } }, // 接待量 tabtimetap1(idx){ this.eharTab.active1=idx // 调用方法 - this.receptionCountList(idx,1) - // this.getRecordList() + this.receptionCountList(idx,1,'/cusLvStatistics/teamAnalysisReception') }, // 接待时长 tabtimetap2(idx){ this.eharTab.active2=idx - console.log(2,idx) // 调用方法 - // this.getRecordList() + this.receptionCountList(idx,2,'/cusLvStatistics/teamAnalysisReceptionTime') }, tabtimetap3(idx){ this.eharTab.active3=idx - console.log(3,idx) // 调用方法 - // this.getRecordList() + this.receptionCountList(idx,3,'/cusLvStatistics/teamAnalysisExecutionRate') }, tabtimetap4(idx){ - console.log(4,idx) this.eharTab.active4=idx // 调用方法 // this.getRecordList() @@ -551,9 +569,14 @@ this.lastEndDate=e.endDate this.lastStartDate=e.startDate // 获取数据 - // this.getreception() - // this.getRecordList() - // this.getAwardList() + // 团队对比接待量 + this.receptionCountList(0,1,'/cusLvStatistics/teamAnalysisReception') + // 团队对比接待时长 + this.receptionCountList(0,2,'/cusLvStatistics/teamAnalysisReceptionTime') + /* 销奖执行率 */ + this.receptionCountList(0,3,'/cusLvStatistics/teamAnalysisExecutionRate') + // 获取销奖能力 + this.getPowerList() }, //指标执行率分析tab tapspagek2(index) { @@ -568,7 +591,7 @@ // 去选择团队 goTeam(){ uni.navigateTo({ - url:'/pages/center/Piabodata/selectTeam' + url:`/pages/center/Piabodata/selectTeam?ids=${this.deptids}` }) }, staffSelectCallback(e){ @@ -598,9 +621,14 @@ return }else{ // 获取数据 - // this.getreception() - // this.getRecordList() - // this.getAwardList() + // 团队对比接待量 + this.receptionCountList(0,1,'/cusLvStatistics/teamAnalysisReception') + // 团队对比接待时长 + this.receptionCountList(0,2,'/cusLvStatistics/teamAnalysisReceptionTime') + /* 销奖执行率 */ + this.receptionCountList(0,3,'/cusLvStatistics/teamAnalysisExecutionRate') + // 获取销奖能力 + this.getPowerList() } }, // 团队对比接待量 @@ -745,8 +773,8 @@ // }) // }, // 接待时长 - receptionCountList(idx,index){ - this.$u.post('/cusLvStatistics/teamAnalysisReception',{ + receptionCountList(idx,index,url){ + this.$u.post(url,{ // userA:this.staff1.value, // userB:this.staff2.value, deptIds:[this.staff1.value,this.staff2.value].filter(item=>item).join(','), @@ -815,10 +843,6 @@ }else{ // 当选择趋势时 this['lineOptsect'+index]={} - // this.lineOptsect={ - // categories:[], - // series:[] - // } let allobj={ categories:[], series:[] @@ -826,7 +850,6 @@ // 先处理时间 // 当选择全部时 if(!this.staff1.value&&!this.staff2.value){ - // console.log(1) result.map((item,idx)=>{ let obj={} obj.name=item[0].deptName @@ -836,7 +859,7 @@ if(idx==0){ allobj.categories.push(item1.statDate.slice(5,10)) } - obj.data.push(item1.receptionCount) + obj.data.push(item1.data) }) allobj.series.push(obj) }) @@ -849,7 +872,7 @@ obj.name=result[0][0].deptName result[0].map(item=>{ allobj.categories.push(item.statDate.slice(5,10)) - obj.data.push(item.receptionCount) + obj.data.push(item.data) }) allobj.series.push(obj) // 判断是否显示平均 @@ -859,7 +882,7 @@ obj.data=[] obj.name='平均' result[1].map(item=>{ - obj.data.push(item.receptionCount) + obj.data.push(item.data) }) allobj.series.push(obj) } @@ -874,21 +897,112 @@ obj1.name=result[1][0].deptName result[0].map(item=>{ allobj.categories.push(item.statDate.slice(5,10)) - obj.data.push(item.receptionCount) + obj.data.push(item.data) }) result[1].map(item=>{ - obj1.data.push(item.receptionCount) + obj1.data.push(item.data) }) allobj.series.push(obj) allobj.series.push(obj1) } - console.log(allobj) + // console.log(allobj) // return - this['lineOptsect'+index].series=allobj.series - this['lineOptsect'+index].categories=allobj.categories + // this.lineOptsect1=allobj + this['lineOptsect'+index]=allobj + // this['lineOptsect'+index].series=allobj.series + // this['lineOptsect'+index].categories=allobj.categories + } + }) + }, + // 获取销奖能力 + getPowerList(){ + this.$u.post('/cusLvStatistics/teamAnalysisMarketingAbility',{ + deptIds:this.deptids||[this.staff1.value,this.staff2.value].filter(item=>item).join(','), + houseId:this.houseId, + timeType:this.lastEndDate?null:this.activeTotal+'', + lastEndDate:this.lastEndDate, + lastStartDate:this.lastStartDate + }) + .then(res=>{ + // console.log(res) + // 处理数据 + this.chartData1={ + categories:[], + series:[] + } + let allobj={ + categories:[], + series:[] + } + // 当选择全部时 + if(!this.staff1.value&&!this.staff2.value){ + // let first=res.first + res.first.map((item,index)=>{ + let obj={ + name:item[0].deptName, + data:[] + } + item.map((item1)=>{ + if(index==0){ + allobj.categories.push(item1.name) + } + obj.data.push(item1.avgExecutionRate) + }) + allobj.series.push(obj) + }) } + // 当选择只有一个时 + else if(this.staff1.value&&!this.staff2.value){ + res.first.map((item,index)=>{ + let obj={ + name:item[0].deptName, + data:[] + } + item.map((item1)=>{ + if(index==0){ + allobj.categories.push(item1.name) + } + obj.data.push(item1.avgExecutionRate) + }) + allobj.series.push(obj) + }) + // 判断是否显示平均 + // 如果显示对比 + if(this.timepickpickisshow){ + res.second.map((item,index)=>{ + let obj={ + name:'平均', + data:[] + } + item.map((item1)=>{ + obj.data.push(item1.avgExecutionRate) + }) + allobj.series.push(obj) + }) + } + }else{ + // console.log(3) + // 当两个都选择的时候 + res.first.map((item,index)=>{ + let obj={ + name:item[0].deptName, + data:[] + } + item.map((item1)=>{ + if(index==0){ + allobj.categories.push(item1.name) + } + obj.data.push(item1.avgExecutionRate) + }) + allobj.series.push(obj) + }) + } + // console.log(allobj) + this.chartData1=allobj + this.$forceUpdate() }) }, + } }; diff --git a/pages/center/Piabodata/selectGroup.vue b/pages/center/Piabodata/selectGroup.vue new file mode 100644 index 0000000..5ca3244 --- /dev/null +++ b/pages/center/Piabodata/selectGroup.vue @@ -0,0 +1,150 @@ + + + + + diff --git a/pages/center/Piabodata/selectTeam.vue b/pages/center/Piabodata/selectTeam.vue index 7bd5020..5029672 100644 --- a/pages/center/Piabodata/selectTeam.vue +++ b/pages/center/Piabodata/selectTeam.vue @@ -5,19 +5,25 @@ 最多选择五项 + - {{item.name}} + {{item.deptName}} - + + + + + 确定 + @@ -27,28 +33,62 @@ data(){ return{ value:[], - items:[ - { - name:'销售一部', - value:'0', - checked:false - }, - { - name:'销售二部', - value:'1', - checked:false - }, - ] + items:[], + ids:'' } }, + onLoad(e) { + // 获取楼盘id + // console.log(e) + this.ids=e.ids + this.houseId = uni.getStorageSync('buildingID').id; + this.getSectionList() + }, methods:{ checkboxChange (e) { - console.log(e) + // console.log(e) }, - addclick(index){ + // 获取部门列表 + getSectionList(){ + this.$u.post('/cusLvStatistics/findAllDeptIdByHouseId',{houseId:this.houseId}) + .then(res=>{ + console.log(res) + res.map((item,index)=>{ + if(index<5){ + item.checked=true + }else{ + item.checked=false + } + }) + this.items=res + if(this.ids){ + let arr=this.ids.split(',') + this.items.map((item,index)=>{ + let idx=arr.findIndex(item1=>item1==item.deptId) + if(idx!=-1){ + item.checked=true + }else{ + item.checked=false + } + }) + } + }) + }, + addclick(index){ this.items[index].checked=!this.items[index].checked - } + }, + goback(){ + // 循环遍历所有选定的内容 + let arr=[] + this.items.map(item=>{ + if(item.checked){ + arr.push(item.deptId) + } + }) + uni.$emit('update',{arr}) + uni.navigateBack() + }, } } @@ -88,5 +128,23 @@ margin: 24rpx 0; } } + .btn{ + width: 690rpx; + height: 88rpx; + background: #2671E2; + border-radius: 8rpx; + font-size: 32rpx; + font-weight: 400; + color: #FFFFFF; + line-height: 88rpx; + text-align: center; + position: fixed; + left: 30rpx; + bottom: 80rpx; + } + .zhedang{ + height: 168rpx; + opacity: 0; + } } diff --git a/pages/mine/consultanonduty/index.vue b/pages/mine/consultanonduty/index.vue index c618772..54bf8ed 100644 --- a/pages/mine/consultanonduty/index.vue +++ b/pages/mine/consultanonduty/index.vue @@ -2,12 +2,12 @@ - 下一位接待顾问:毛丫丫 + 下一位接待顾问:{{agentList[0].name||'没有下一位了'}} - + 正在接待 @@ -16,53 +16,36 @@ - - - - - 宋 + + + + + + + {{item.name.slice(0,1)}} + + + {{item.name}} + + + + + {{activeTotal==1?'接待中':'空闲'}} + - - 宋幸运 + + + 今日接待:{{item.receiveNum||0}} + + + {{activeTotal==1?'暂停':'恢复'}} + - - - 接待中 - - - - - 今日接待:4 - - - 暂停 - - - - - - 宋 - - - 宋幸运 - - - - - 暂停接待 - - - - - 今日接待:4 - - - 恢复 - - + + 暂无数据 @@ -73,14 +56,66 @@ data(){ return{ value:"", - activeTotal: 0, + activeTotal: 1, + agentList:[], + pausedAgentList:[], + houseId:'' } }, + onLoad() { + this.houseId = uni.getStorageSync('buildingID').id; + this.changeAgentListShow() + this.changePausedAgentListShow() + }, + computed: { + activeAgentList() { + return this.activeTotal == 1 ? this.agentList : this.pausedAgentList + }, + }, methods:{ tabtimetap(idx){ - console.log(idx) + // console.log(idx) this.activeTotal=idx - } + + }, + changeAgentListShow() { + this.$u.get("/zkAgentPool/nextFreeAgent?itemId="+this.houseId).then(res => { + this.agentList = res; + }) + }, + // 获取暂停的经纪人列表 + changePausedAgentListShow() { + this.$u.get("/zkAgentPool/stopAgentList?itemId="+this.houseId).then(res => { + this.pausedAgentList = res; + }) + }, + changeAgentStatus(id) { + let content = ""; + if (this.activeTotal == 1) { + content = "确定当前顾问暂停接待?"; + } else { + content = "确定取消暂停?"; + } + uni.showModal({ + content, + cancelColor: "#999999", + success: res => { + if (res.confirm) { + this.$u.get("/zkAgentPool/update", { + agentId: id, + status: this.activeTotal == 1 ? 2 : 0 + }).then(res => { + uni.showToast({ + icon: "none", + title: "操作成功", + }) + this.changeAgentListShow() + this.changePausedAgentListShow() + }) + } + }, + }) + }, } } @@ -188,4 +223,10 @@ } } + .nolist{ + text-align: center; + height: 300rpx; + color: #CCCCCC; + line-height: 300rpx; + } diff --git a/utils/http.js b/utils/http.js index 2efe5b0..9f3828f 100644 --- a/utils/http.js +++ b/utils/http.js @@ -1,6 +1,6 @@ // const baseUrl = 'http://121.42.63.138:9091/autoSR/api';// 测试站 -// const baseUrl = 'http://192.168.31.161:8080/autoSR/api'; // 长龙 -const baseUrl = 'http://192.168.31.128:8080/autoSR/api'; // 佳豪 +const baseUrl = 'http://192.168.31.161:8080/autoSR/api'; // 长龙 +// const baseUrl = 'http://192.168.31.128:8080/autoSR/api'; // 佳豪 // const baseUrl = 'http://10.2.1.104:8081/autoSR/api'; // 刘敏 // const baseUrl = 'https://zkgj.quhouse.com/api'; // 质控正式 // const baseUrl = 'https://hfju.com/api'; // 数智正式