diff --git a/pages/center/Piabodata/Employeesstatistics.vue b/pages/center/Piabodata/Employeesstatistics.vue index 2c9166c..31d2e73 100644 --- a/pages/center/Piabodata/Employeesstatistics.vue +++ b/pages/center/Piabodata/Employeesstatistics.vue @@ -14,180 +14,195 @@ 自定义 + + - 接待量排名(TOP10) + 接待量排名(TOP10) 合计 {{newlisttabinfo1.total}} - + 顾问 {{newlisttabinfo1.count}} - + 人均接待量 {{newlisttabinfo1.avg}} - - - - + + + + {{item.name.substring(0,4)}} - + {{item.zxl==null?0:item.zxl}} - + 暂无数据 - + + - 销讲执行率排行(TOP10) + 销讲执行率排行(TOP10) - + 顾问 {{newlisttabinfo3.count}} - + 人均执行率 {{newlisttabinfo3.avg}} - - - + + + {{item.name.substring(0,4)}} - + {{item.zxl==null?0:item.zxl}} - + 暂无数据 - - + + - 录音时长(TOP10) + 录音时长(TOP10) 合计 {{newlisttabinfo2.total}} - + 顾问 {{newlisttabinfo2.count}} - + 人均录音时长 {{newlisttabinfo2.avg}} - - - + + + {{item.name.substring(0,4)}} - + {{item.zxl==null?0:item.zxl}} - + 暂无数据 - + + - 违禁次数排名(TOP10) + 违禁次数排名(TOP10) 合计 {{newlisttabinfo4.total}} - + 顾问 {{newlisttabinfo4.count}} - + 人均违禁次数 {{newlisttabinfo4.avg}} - - - + + + {{item.name.substring(0,4)}} - + {{item.zxl==null?0:item.zxl}} - + 暂无数据 - - - + + + + - 接待未标顾问(TOP10) + 接待未标顾问(TOP10) 合计 - {{newlisttabinfo4.total}} + {{newlisttabinfo5.total}} - + 顾问 - {{newlisttabinfo4.count}} + {{newlisttabinfo5.count}} - - 人均违禁次数 - {{newlisttabinfo4.avg}} + + 均值 + {{newlisttabinfo5.avg}} - - - + + + {{item.name.substring(0,4)}} - + {{item.zxl==null?0:item.zxl}} - + 暂无数据 - - + + @@ -202,143 +217,165 @@ activeTotal: 4, totalTimeShow: false, // 项目id - houseId:'', - lastEndDate:'', - lastStartDate:'', - newlisttabinfo1:{ - avg:'', - count:'', - total:'', - result:[], + houseId: '', + lastEndDate: '', + lastStartDate: '', + newlisttabinfo1: { + avg: '', + count: '', + total: '', + result: [], }, - newlisttabinfo2:{ - avg:'', - count:'', - total:'', - result:[], + newlisttabinfo2: { + avg: '', + count: '', + total: '', + result: [], }, - newlisttabinfo3:{ - avg:'', - count:'', - total:'', - result:[], + newlisttabinfo3: { + avg: '', + count: '', + total: '', + result: [], }, - newlisttabinfo4:{ - avg:'', - count:'', - total:'', - result:[], + newlisttabinfo4: { + avg: '', + count: '', + total: '', + result: [], + }, + newlisttabinfo5: { + avg: '', + count: '', + total: '', + result: [], }, }; }, - onLoad() { + onLoad(option) { // 获取项目id this.houseId = uni.getStorageSync('buildingID').id; this.init() + if (option.type == 1) { + this.totalTimeChange({startDate: option.staTime, endDate: option.endtime}) + } }, onPullDownRefresh() { this.init() - setTimeout(function () { - uni.stopPullDownRefresh(); + setTimeout(function() { + uni.stopPullDownRefresh(); }, 1000); }, methods: { - init(){ - this.newlisttabinfo1={ - avg:'', - count:'', - total:'', - result:[], - }, - this.newlisttabinfo2={ - avg:'', - count:'', - total:'', - result:[], - }, - this.newlisttabinfo3={ - avg:'', - count:'', - total:'', - result:[], - }, - this.newlisttabinfo4={ - avg:'', - count:'', - total:'', - result:[], + init() { + this.newlisttabinfo1 = { + avg: '', + count: '', + total: '', + result: [], + } + this.newlisttabinfo2 = { + avg: '', + count: '', + total: '', + result: [], } - - var activeTotal=0; - if(this.activeTotal==3){ - activeTotal=null; - }else{ - activeTotal=this.activeTotal; - this.lastEndDate=''; - this.lastStartDate=''; + this.newlisttabinfo3 = { + avg: '', + count: '', + total: '', + result: [], } - var promse={ - timeType:activeTotal, - lastStartDate:this.lastStartDate, - lastEndDate:this.lastEndDate, - houseId:this.houseId + this.newlisttabinfo4 = { + avg: '', + count: '', + total: '', + result: [], + } + + var activeTotal = 0; + if (this.activeTotal == 3) { + activeTotal = null; + } else { + activeTotal = this.activeTotal; + this.lastEndDate = ''; + this.lastStartDate = ''; + } + var promse = { + timeType: activeTotal, + lastStartDate: this.lastStartDate, + lastEndDate: this.lastEndDate, + houseId: this.houseId } this.staffStatisticsReceptionTop10(promse) this.staffStatisticsRecordingTimTop10(promse) this.staffStatisticsExecutionRateTop10(promse) this.staffStatisticsProhibitedTop10(promse) + this.staffStatisticsUnlabeledTop10(promse) }, //接待量排名 - staffStatisticsReceptionTop10(promse){ - this.$u.post('/cusLvStatistics/staffStatisticsReceptionTop10',promse).then(res=>{ - res.result.forEach(item=>{ - item.zxl=item.data - item.name=item.accountName + staffStatisticsReceptionTop10(promse) { + this.$u.post('/cusLvStatistics/staffStatisticsReceptionTop10', promse).then(res => { + res.result.forEach(item => { + item.zxl = item.data + item.name = item.accountName }) - res.result=this.dealData(res.result) - this.newlisttabinfo1=res; + res.result = this.dealData(res.result) + this.newlisttabinfo1 = res; }) }, //录音时长 - staffStatisticsRecordingTimTop10(promse){ - this.$u.post('/cusLvStatistics/staffStatisticsRecordingTimTop10',promse).then(res=>{ - res.result.forEach(item=>{ - item.zxl=item.data - item.name=item.accountName + staffStatisticsRecordingTimTop10(promse) { + this.$u.post('/cusLvStatistics/staffStatisticsRecordingTimTop10', promse).then(res => { + res.result.forEach(item => { + item.zxl = item.data + item.name = item.accountName }) - res.result=this.dealData(res.result) - this.newlisttabinfo2=res; + res.result = this.dealData(res.result) + this.newlisttabinfo2 = res; }) }, //销讲 - staffStatisticsExecutionRateTop10(promse){ - this.$u.post('/cusLvStatistics/staffStatisticsExecutionRateTop10',promse).then(res=>{ - res.result.forEach(item=>{ - item.zxl=item.data; - item.zxl1=item.data; - item.name=item.accountName + staffStatisticsExecutionRateTop10(promse) { + this.$u.post('/cusLvStatistics/staffStatisticsExecutionRateTop10', promse).then(res => { + res.result.forEach(item => { + item.zxl = item.data; + item.zxl1 = item.data; + item.name = item.accountName }) - this.newlisttabinfo3=res; + this.newlisttabinfo3 = res; }) }, - //j禁忌 - staffStatisticsProhibitedTop10(promse){ - this.$u.post('/cusLvStatistics/staffStatisticsProhibitedTop10',promse).then(res=>{ - res.result.forEach(item=>{ - item.zxl=item.data - item.name=item.accountName + // j禁忌 + staffStatisticsProhibitedTop10(promse) { + this.$u.post('/cusLvStatistics/staffStatisticsProhibitedTop10', promse).then(res => { + res.result.forEach(item => { + item.zxl = item.data + item.name = item.accountName }) - res.result=this.dealData(res.result) - this.newlisttabinfo4=res; + res.result = this.dealData(res.result) + this.newlisttabinfo4 = res; }) }, - + + // 未标记客户数量排名 + staffStatisticsUnlabeledTop10(promse) { + this.$u.post('/cusLvStatistics/staffStatisticsUnlabeledTop', promse).then(res => { + res.result.forEach(item => { + item.zxl = item.tagCustomer + item.name = item.accountName + }) + res.result = this.dealData(res.result) + this.newlisttabinfo5 = res; + }) + }, + //自定义时间 totalTimeChange(e) { console.log(e.startDate, e.endDate) - this.activeTotal=3; - this.lastEndDate=e.endDate - this.lastStartDate=e.startDate + this.activeTotal = 3; + this.lastEndDate = e.endDate + this.lastStartDate = e.startDate this.init() }, //时间切换 @@ -347,15 +384,17 @@ this.totalTimeShow = true; } else { this.activeTotal = index; - this.lastEndDate=''; - this.lastStartDate=''; + this.lastEndDate = ''; + this.lastStartDate = ''; this.init() } }, // 定义一个公共方法对数据进行处理 - dealData(arr){ + dealData(arr) { // 获取最大值 - let num=Math.max.apply(Math, arr.map(function (o) { return o.zxl })) //结果:3 + let num = Math.max.apply(Math, arr.map(function(o) { + return o.zxl + })) //结果:3 // console.log(num) // if(num>100){ // // 获取最大值的下标 @@ -372,11 +411,11 @@ // }) // return arr // } - arr.map(item=>{ - item.zxl1=Math.floor(item.zxl/num*100) + arr.map(item => { + item.zxl1 = Math.floor(item.zxl / num * 100) }) return arr - + }, } }; @@ -388,16 +427,28 @@ background: #FAFAFA; padding-bottom: 60rpx; } - .hejisan{ + + .single { + min-height: 500rpx; + + .jindu { + height: auto; + min-height: 360rpx; + } + } + + .hejisan { width: 92%; margin: 0 auto; display: flex; padding-top: 20rpx; - padding-bottom:20rpx; - .text1-1{ + padding-bottom: 20rpx; + + .text1-1 { color: #666666; } - .text1-2{ + + .text1-2 { color: #333333; margin-top: 10rpx; } diff --git a/pages/center/Piabodata/Groupcontrast.vue b/pages/center/Piabodata/Groupcontrast.vue index 26d0b3e..4b95049 100644 --- a/pages/center/Piabodata/Groupcontrast.vue +++ b/pages/center/Piabodata/Groupcontrast.vue @@ -14,8 +14,8 @@ 自定义 - - + + @@ -26,21 +26,20 @@ 均值:{{newAvg1||0}} - - - - - {{item.name.substring(0, 4)}} - - - - {{item.zxl==null?0:item.zxl}} + + + + {{item.name.substring(0, 4)}} + + + {{item.zxl==null?0:item.zxl}} - + - + @@ -51,20 +50,19 @@ 均值:{{newAvg2||0}} - - - - {{item.name.substring(0, 4)}} - - - - {{item.zxl==null?0:item.zxl}} + + + {{item.name.substring(0, 4)}} + + + {{item.zxl==null?0:item.zxl}} - + - + @@ -78,26 +76,25 @@ --> - + 项目:{{newTeam3||0}} 均值:{{newAvg3||0}}% - - - - {{item.name.substring(0, 4)}} - - - - {{item.zxl==null?0:item.zxl}}% + + + {{item.name.substring(0, 4)}} + + + {{item.zxl==null?0:item.zxl}}% - + - + @@ -111,62 +108,56 @@ --> - - - - - - - {{item.name.substring(0, 4)}} - - - - {{item.zxl==null?0:item.zxl}}% + + + + {{item.name.substring(0, 4)}} + + + {{item.zxl==null?0:item.zxl}}% - + - + 销讲能力 - - {{staff.label}} + {{staff.label}} - - + - - - - - - + - + - + + @@ -228,56 +220,86 @@ return { activeTotal: 4, activeTotal2: 0, - bocindex:0, + bocindex: 0, totalTimeShow: false, // 项目id - houseId:'', - staffShow:false, - staffList:[], - lastStartDate:'', - lastEndDate :'', - newTeam1:'', - newAvg1:'', - newTeam2:'', - newAvg2:'', - newTeam3:'', - newAvg3:'', - newTeam4:'', - newAvg4:'', - staff:{ - value:'', - label:'' + houseId: '', + staffShow: false, + staffList: [], + lastStartDate: '', + lastEndDate: '', + newTeam1: '', + newAvg1: '', + newTeam2: '', + newAvg2: '', + newTeam3: '', + newAvg3: '', + newTeam4: '', + newAvg4: '', + staff: { + value: '', + label: '' }, - newlisttabinfo1:[ - {name:'接待量',zxl:'10'}, - {name:'平均执行率',zxl:'50'}, - {name:'接待客户',zxl:'80'}, + newlisttabinfo1: [{ + name: '接待量', + zxl: '10' + }, + { + name: '平均执行率', + zxl: '50' + }, + { + name: '接待客户', + zxl: '80' + }, ], - newlisttabinfo2:[ - {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'}, + newlisttabinfo3: [{ + name: '接待量', + zxl: '10' + }, + { + name: '平均执行率', + zxl: '50' + }, + { + name: '接待客户', + zxl: '80' + }, ], - newlisttabinfo4:[ - {name:'接待量',zxl:'10'}, - {name:'平均执行率',zxl:'50'}, - {name:'接待客户',zxl:'80'}, + newlisttabinfo4: [{ + name: '接待量', + zxl: '10' + }, + { + name: '平均执行率', + zxl: '50' + }, + { + name: '接待客户', + zxl: '80' + }, ], - chartData:{ - "categories": ["维度1","维度2","维度3","维度4","维度5","维度6"], - "series": [ - { - "name": "成交量", - "data": [90,110,165,195,187,172] - } - ] + chartData: { + "categories": ["维度1", "维度2", "维度3", "维度4", "维度5", "维度6"], + "series": [{ + "name": "成交量", + "data": [90, 110, 165, 195, 187, 172] + }] }, - + opts: { fontSize: 10, extra: { @@ -286,72 +308,72 @@ } } } - + }; }, onLoad() { - let that=this - uni.$on('updateGroup',function(data){ + let that = this + uni.$on('updateGroup', function(data) { console.log(data) - that.houseId=data.arr.join(',') + that.houseId = data.arr.join(',') // 获取销奖能力 that.getPowerList() }) this.getSectionList() - - + + }, - onPullDownRefresh(){ - let that=this - uni.$on('updateGroup',function(data){ + onPullDownRefresh() { + let that = this + uni.$on('updateGroup', function(data) { console.log(data) - that.houseId=data.arr.join(',') + that.houseId = data.arr.join(',') // 获取销奖能力 that.getPowerList() }) this.getSectionList() - setTimeout(function () { - uni.stopPullDownRefresh(); + setTimeout(function() { + uni.stopPullDownRefresh(); }, 1000); }, methods: { // 获取部门列表 - getSectionList(){ - this.$u.post('/user/getHouseByToken',) - .then(res=>{ - // console.log(res) - this.staffList=[] - res.map((item,index)=>{ - let obj={} - obj.value=item.id - obj.label=item.propertyName + getSectionList() { + this.$u.post('/user/getHouseByToken', ) + .then(res => { + // console.log(res) + this.staffList = [] + res.map((item, index) => { + let obj = {} + obj.value = item.id + obj.label = item.propertyName this.staffList.push(obj) + }) + this.houseId = this.staffList[0].value + this.staff = this.staffList[0] + this.getdata() + // console.log(this.staffList,this.staffList,this.houseId) }) - this.houseId=this.staffList[0].value - this.staff=this.staffList[0] - this.getdata() - // console.log(this.staffList,this.staffList,this.houseId) - }) - + }, //指标执行率分析tab tapspagek2(index) { this.bocindex = index; }, - staffSelectCallback(e){ - this.staff=e[0] - this.houseId=e[0].value + staffSelectCallback(e) { + this.staff = e[0] + this.houseId = e[0].value this.getPowerList() }, - getdata(){ + getdata() { // 请求接口获取接待量 - this.receptionCountList('1','/cusLvStatistics/groupComparisonReception') + this.receptionCountList('1', '/cusLvStatistics/groupComparisonReception') // 接待时长 - this.receptionCountList('2','/cusLvStatistics/groupComparisonReceptionTime') + this.receptionCountList('2', '/cusLvStatistics/groupComparisonReceptionTime') // 小将排名 - this.receptionCountList('3','/cusLvStatistics/groupComparisonTalkRank') + this.receptionCountList('3', '/cusLvStatistics/groupComparisonTalkRank') // 顾问牌名 - this.receptionCountList('4','/cusLvStatistics/groupComparisonTalkRankByConsultant') + this.receptionCountList('4', '/cusLvStatistics/groupComparisonTalkRankByConsultant') // 销奖能力 this.getPowerList() }, @@ -361,8 +383,8 @@ this.totalTimeShow = true; } else { this.activeTotal = index; - this.lastEndDate='' - this.lastStartDate='' + this.lastEndDate = '' + this.lastStartDate = '' this.getdata() // // 获取数据 // // 团队对比接待量 @@ -376,108 +398,110 @@ } }, // 接待时长 - 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 + 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]=[] + this['newlisttabinfo' + index] = [] // 当选择全部时 - let arr=[] - // 当两个都选择的时候 - result.map(item=>{ - let obj={} - obj.name=item.houseName - obj.zxl=item.data - arr.push(obj) - - }) - arr=this.dealData(arr) - this['newlisttabinfo'+index]=arr - }) + let arr = [] + // 当两个都选择的时候 + result.map(item => { + let obj = {} + obj.name = item.houseName + obj.zxl = item.data + arr.push(obj) + + }) + arr = this.dealData(arr) + this['newlisttabinfo' + index] = arr + }) }, // 获取销奖能力 - getPowerList(){ - this.$u.post('/cusLvStatistics/groupComparisonMarketingAbility',{ - houseIds:this.houseId, - timeType:this.lastEndDate?null:this.activeTotal+'', - lastEndDate:this.lastEndDate, - lastStartDate:this.lastStartDate - }) - .then(res=>{ - // console.log(res,123) - // 处理数据 - // return - this.chartData={ - categories:[], - series:[] - } - let allobj={ - categories:[], - series:[] - } - let max = 0; - res.result.map((item,index)=>{ - let obj={ - name:item[0].houseName, - data:[] + getPowerList() { + this.$u.post('/cusLvStatistics/groupComparisonMarketingAbility', { + houseIds: this.houseId, + timeType: this.lastEndDate ? null : this.activeTotal + '', + lastEndDate: this.lastEndDate, + lastStartDate: this.lastStartDate + }) + .then(res => { + // console.log(res,123) + // 处理数据 + // return + this.chartData = { + categories: [], + series: [] } - item.map(item1=>{ - if(index==0){ - allobj.categories.push(item1.name) + let allobj = { + categories: [], + series: [] + } + let max = 0; + res.result.map((item, index) => { + let obj = { + name: item[0].houseName, + data: [] } - obj.data.push(item1.avgExecutionRate) - if (max < item1.avgExecutionRate) max = item1.avgExecutionRate; + item.map(item1 => { + if (index == 0) { + allobj.categories.push(item1.name) + } + obj.data.push(item1.avgExecutionRate) + if (max < item1.avgExecutionRate) max = item1.avgExecutionRate; + }) + allobj.series.push(obj) }) - allobj.series.push(obj) + // console.log(allobj) + this.opts.extra.radar.max = max + 25 + this.chartData = allobj + this.$forceUpdate() }) - // console.log(allobj) - this.opts.extra.radar.max = max + 25 - this.chartData=allobj - this.$forceUpdate() - }) }, //自定义时间 totalTimeChange(e) { console.log(e.startDate, e.endDate) - this.activeTotal=3; - this.lastEndDate=e.endDate - this.lastStartDate=e.startDate + this.activeTotal = 3; + this.lastEndDate = e.endDate + this.lastStartDate = e.startDate this.getdata() }, //集团对比 - Groupcontrast(){ + Groupcontrast() { uni.navigateTo({ - url: `/pages/center/Piabodata/selectGroup?ids=${this.houseId}` + url: `/pages/center/Piabodata/selectGroup?ids=${this.houseId}` }); }, // 定义一个公共方法对数据进行处理 - dealData(arr){ + dealData(arr) { // 获取最大值 - let num=Math.max.apply(Math, arr.map(function (o) { return o.zxl })) //结果:3 + let num = Math.max.apply(Math, arr.map(function(o) { + return o.zxl + })) //结果:3 // console.log(num) - if(num>100){ + if (num > 100) { // 获取最大值的下标 // let idx=arr.findIndex(item=>item.zxl==num) // console.log(idx,123) - arr.map(item=>{ - item.zxl1=Math.floor(item.zxl/num*100) + arr.map(item => { + item.zxl1 = Math.floor(item.zxl / num * 100) }) // console.log(arr) return arr - }else{ - arr.map(item=>{ - item.zxl1=item.zxl + } else { + arr.map(item => { + item.zxl1 = item.zxl }) return arr } @@ -492,4 +516,10 @@ background: #FAFAFA; padding-bottom: 60rpx; } + + .jindu { + padding: 0 0 30rpx; + height: auto; + min-height: 300rpx; + } diff --git a/pages/center/Piabodata/StaffAnalysis.vue b/pages/center/Piabodata/StaffAnalysis.vue index a713cb1..cf3cedf 100644 --- a/pages/center/Piabodata/StaffAnalysis.vue +++ b/pages/center/Piabodata/StaffAnalysis.vue @@ -14,7 +14,7 @@ 自定义 - + {{staff1.label}} @@ -23,10 +23,11 @@ - - - - 对比 + + + + 对比 {{staff2.label}} @@ -35,7 +36,7 @@ - + @@ -47,23 +48,17 @@ 来访(人) - + - + 录音时长 - - - - - {{staff1.label}}:{{newTeam3||0}} - {{staff2.label}}:{{newAvg3||0}} - - - - - - + + + {{staff1.label}}:{{newTeam3||0}} + {{staff2.label}}:{{newAvg3||0}} + + + + + + + 销讲能力 - + - + - + - - + + + + diff --git a/pages/center/Piabodata/Theteamcompared.vue b/pages/center/Piabodata/Theteamcompared.vue index df7bc64..0f6cd41 100644 --- a/pages/center/Piabodata/Theteamcompared.vue +++ b/pages/center/Piabodata/Theteamcompared.vue @@ -16,9 +16,10 @@ - - {{staff1.label}} - + + + {{staff1.label}} + @@ -425,21 +426,19 @@ } } }, - + lineOpts: { yAxis: { - data: [ - { - max: 100, - min: 0, - } - ] + data: [{ + max: 100, + min: 0, + }] } }, }; }, - + computed: { showLineOptsect1() { return this.lineOptsect1.series.length > 0 @@ -454,7 +453,7 @@ return this.chartData1.series.length > 0 }, }, - + onLoad() { let that = this uni.$on('update', function(data) { @@ -1128,4 +1127,10 @@ height: 50rpx; margin-top: -2rpx; } - \ No newline at end of file + + .heji { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + diff --git a/pages/center/Piabodata/TrendAnalysis.vue b/pages/center/Piabodata/TrendAnalysis.vue index 97484c5..f11f45c 100644 --- a/pages/center/Piabodata/TrendAnalysis.vue +++ b/pages/center/Piabodata/TrendAnalysis.vue @@ -325,9 +325,22 @@ components: { newcalendar }, - onLoad: function(options) { + onLoad(option) { this.pamect.houseId = uni.getStorageSync('buildingID').id; this.init() + + if (option.type == 1) { + this.timepickpickisshow = true + this.pamect.firstStartDate = option.staTime + this.pamect.firstEndDate = option.endtime + this.pamect.lastStartDate = option.staTime1 + this.pamect.lastEndDate = option.endtime1 + this.pamect.timeType = '' + this.sheartime1 = `${this.fomatDate(this.pamect.firstStartDate)}-${this.fomatDate(this.pamect.firstEndDate)}` + this.sheartime2 = `${this.fomatDate(this.pamect.lastStartDate)}-${this.fomatDate(this.pamect.lastEndDate)}` + this.tabxuanxiangtap(3) + this.$forceUpdate() + } }, onPullDownRefresh() { this.init() @@ -360,6 +373,14 @@ }, }, methods: { + // 时间格式转换 + fomatDate(date) { + if (!date) return '--' + let arr = date.split(' ') + let str = arr[0] + let result = str.split('-') + return `${result[1]}-${result[2]}` + }, //是否对比 checkboxChange() { if (this.newactiveTotal == 3) { @@ -486,7 +507,8 @@ }, //对比时间 totalTimeChange2(e) { - var d = new Date(e.result); + console.log(e) + var d = new Date(e.result.replace(/\-/g, '/')); d.setDate(d.getDate() + this.intervaltime); var year = d.getFullYear(); var month = d.getMonth() + 1; @@ -676,6 +698,7 @@ if (max < data.firstList[i]) max = data.firstList[i]; } this.opts = { + ...this.opts, fontSize: 10, extra: { radar: { @@ -810,6 +833,7 @@ return item.avgExecutionRate }); this.opts = { + ...this.opts, fontSize: 10, extra: { radar: { @@ -1147,9 +1171,9 @@ DateDiff(sDate1, sDate2) { var aDate, oDate1, oDate2, iDays; aDate = sDate1.split("-"); - oDate1 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0]); //转换为yyyy-MM-dd格式 + oDate1 = new Date(aDate[1] + '/' + aDate[2] + '/' + aDate[0]); //转换为yyyy-MM-dd格式 aDate = sDate2.split("-"); - oDate2 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0]); + oDate2 = new Date(aDate[1] + '/' + aDate[2] + '/' + aDate[0]); iDays = parseInt(Math.abs(oDate1 - oDate2) / 1000 / 60 / 60 / 24); //把相差的毫秒数转换为天数 return iDays + 1; //返回相差天数 }, diff --git a/pages/center/Piabodata/Userinsightinto.vue b/pages/center/Piabodata/Userinsightinto.vue index 5cea6b3..973c684 100644 --- a/pages/center/Piabodata/Userinsightinto.vue +++ b/pages/center/Piabodata/Userinsightinto.vue @@ -102,8 +102,18 @@ onPageScroll(e) { this.scrollTop = e.scrollTop; }, - onLoad() { + onLoad(e) { this.buildingID=uni.getStorageSync('buildingID').id; + if (e.activeTotal) { + this.activeTotal = e.activeTotal + } + + if (e.staTime) { + this.timeobj = { + statDateStart: e.staTime, + statDateEnd: e.endtime + } + } this.gitinit() }, onPullDownRefresh() { diff --git a/pages/center/Piabodata/index.vue b/pages/center/Piabodata/index.vue index 6d3665c..d9b31e0 100644 --- a/pages/center/Piabodata/index.vue +++ b/pages/center/Piabodata/index.vue @@ -96,8 +96,9 @@ 团队接待趋势 - {{team.label}} - + + {{team.label}} + diff --git a/pages/center/prohibited/index.vue b/pages/center/prohibited/index.vue index f6ee2e0..a30d7e0 100644 --- a/pages/center/prohibited/index.vue +++ b/pages/center/prohibited/index.vue @@ -180,8 +180,12 @@ if (options.staTime) { this.staTime = options.staTime; this.endtime = options.endtime; + this.timeText = `${options.staTime}-${options.endtime}` + } + if (options.violatedStatus) { + this.violatedStatus = options.violatedStatus + this.weijinTag = this.identList[options.violatedStatus].label } - if (options.violatedStatus) this.violatedStatus = options.violatedStatus }, onShow() { this.userInfo = uni.getStorageSync('weapp_session_userInfo_data'); diff --git a/pages/center/records/index.vue b/pages/center/records/index.vue index c0b8ee3..b1b79e1 100644 --- a/pages/center/records/index.vue +++ b/pages/center/records/index.vue @@ -88,7 +88,7 @@ - + @@ -101,7 +101,7 @@ - + @@ -585,7 +585,7 @@ dateType: dateType, recDurationInterval: recDurationInterval, orderBy: orderBy, - validInvalid: this.screen.validInvalid == 2 ? null : this.screen.validInvalid, + validInvalid: this.screen.validInvalid, clientStage: this.screen.clientStage, recording: this.screen.validInvalid == 2 ? 0 : null } @@ -625,7 +625,7 @@ }, actionSelectCallback(e) { this.screen.agentId = e[0].value; - this.screenShow = false; + this.screen.counselorName = e[0].label; this.recordList = []; this.nextPage = 1; this.isRefresh = false; diff --git a/pages/index/index.vue b/pages/index/index.vue index ed372c4..c237af6 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -111,11 +111,11 @@ - + {{realtimeobj.avgDuration|| 0}} 平均接待时长 - + {{realtimeobj.fraction || 0}}% 平均执行率 @@ -151,13 +151,13 @@ {{Thisweekobj.activeCustomer|| 0}} 有效接待 - + {{Thisweekobj.fraction || 0}}% 平均执行率 - + {{Thisweekobj.avgDuration|| 0}} 平均接待时长 @@ -207,7 +207,6 @@ @cancel="cancel" @confirm="confirm"> - @@ -224,6 +223,9 @@ + + + @@ -682,6 +684,10 @@ uni.navigateTo({ url: '/pages/center/records/index?refresh='+'refresh'+'&activeTotal='+'0' }); + } else if (i == 'auth') { + uni.navigateTo({ + url: '/pages/center/records/index?refresh='+'refresh'+'&activeTotal='+'0'+'&validInvalid=0' + }); }else if(i==2){ uni.switchTab({ url: '/pages/index/customer' @@ -701,6 +707,36 @@ }); } + }else if(i==333){ + if(this.zhixingcenterindex==2){ + uni.navigateTo({ + url: '/pages/center/records/index?refresh='+'refresh'+'&activeTotal='+'2'+'&validInvalid=0' + }); + }else if(this.zhixingcenterindex==6){ + uni.navigateTo({ + url: '/pages/center/records/index?refresh='+'refresh'+'&activeTotal='+'3'+'&validInvalid=0' + }); + }else{ + uni.navigateTo({ + url: '/pages/center/records/index?refresh='+'refresh'+'&activeTotal='+'4'+'&staTime='+this.statDateStart+'&endtime='+this.statDateEnd+'&validInvalid=0' + }); + } + + }else if(i==3){ + if(this.zhixingcenterindex==2){ + uni.navigateTo({ + url: '/pages/center/records/index?refresh='+'refresh'+'&activeTotal='+'2' + }); + }else if(this.zhixingcenterindex==6){ + uni.navigateTo({ + url: '/pages/center/records/index?refresh='+'refresh'+'&activeTotal='+'3' + }); + }else{ + uni.navigateTo({ + url: '/pages/center/records/index?refresh='+'refresh'+'&activeTotal='+'4'+'&staTime='+this.statDateStart+'&endtime='+this.statDateEnd + }); + } + }else if(i==6){ uni.navigateTo({ url: '/pages/center/records/index?refresh='+'refresh'+'&activeTotal='+'0'+'&validInvalid=0' @@ -719,6 +755,10 @@ url: '/pages/center/records/index?refresh='+'refresh'+'&activeTotal='+'4'+'&staTime='+this.statDateStart+'&endtime='+this.statDateEnd+'&validInvalid=0' }); } + }else if (i == 4) { + uni.navigateTo({ + url: '/pages/center/records/index?refresh='+'refresh'+'&activeTotal=0'+'&markAdvisor=0'+'&validInvalid=0' + }); }else{ uni.navigateTo({ url: '/pages/center/records/index?refresh='+'refresh'+'&activeTotal=0'+'&markAdvisor=0' diff --git a/pages/mine/messageList.vue b/pages/mine/messageList.vue index 4d3f527..97d608d 100644 --- a/pages/mine/messageList.vue +++ b/pages/mine/messageList.vue @@ -194,7 +194,8 @@ if (this.pageNum != 1) { this.updateAnnList = [...this.updateAnnList, ...res.data.data.list.results]; } else { - this.updateAnnList = res.data.data.list.results + + this.updateAnnList = res.data.data.list.results || [] } } diff --git a/pages/reportExcel/dayReport.vue b/pages/reportExcel/dayReport.vue index 9176079..d27d60e 100644 --- a/pages/reportExcel/dayReport.vue +++ b/pages/reportExcel/dayReport.vue @@ -25,7 +25,6 @@ 接待量: - 接待量{{ weekObj.receptionCount || 0 }} @@ -40,7 +39,6 @@ - @@ -50,11 +48,11 @@ - 销讲执行率: + 平均执行率: - 销讲执行率{{ weekObj.fraction || 0 }}% + 平均执行率{{ weekObj.fraction || 0 }}% 对比昨天{{ weekObj.fractionPK > 0 ? '+' : '' }}{{ weekObj.fractionPK || 0 }}% @@ -112,7 +110,7 @@ - + 5 @@ -213,7 +211,7 @@ - 执行率最低的顾问: + 平均执行率最低的顾问: @@ -280,9 +278,18 @@ - + + + 回到管理端 + + + + 复制内容 + + + @@ -320,6 +327,12 @@ }, methods: { + // 跳转首页 + toHome() { + uni.navigateTo({ + url: '/pages/index/guide' + }) + }, // 获取日报详情 getMessage() { this.$u.get('/zkMessage/findByProjectId', { @@ -339,7 +352,69 @@ }, copy() { - let str = `` + let str = ` + ${this.projectName}数智工牌日报 + + 生成时间:${this.weekObj.createTime || '--'} + + + 1、接待量:${this.weekObj.receptionCount || 0 } + + 2、有效接待:${this.weekObj.activeCustomer || 0} + + 3、有效接待率:${this.weekObj.validReceptionRate || 0}% + 对比昨天:${ this.weekObj.validReceptionRatePK > 0 ? '+' : '' }${ this.weekObj.validReceptionRatePK || 0 }% + + 4、平均执行率:${ this.weekObj.fraction || 0 }% + 对比昨天:${ this.weekObj.fractionPK > 0 ? '+' : '' }${ this.weekObj.fractionPK || 0 }% + + 5、平均接待时长:${ this.weekObj.avgDuration || 0 }min + 对比昨天:${this.weekObj.avgDurationPK > 0 ? '+' : '' }${ this.weekObj.avgDurationPK || 0 }min` + if (this.carryOutTop.length > 0) { + str += ` + + 6、销讲维度执行前三:` + this.carryOutTop.map((item, index) => { + str += ` + top${index+1}.${item.title || '--'}${item.value||'0'}%` + }) + } + + if (this.carryOutLast.length > 0) { + str += ` + + 7、销讲维度执行弱项前三:` + this.carryOutLast.map((item, index) => { str += ` + top${index+1}.${item.title || '--'}${item.value||'0'}%` + }) + } + if (this.consultant.length > 0) { + str += ` + + 8、置业顾问平均执行率排名:` + this.consultant.map((item, index) => { + str += ` + top${index+1}.${item.title || '--'}${item.value||'0'}%` + }) + } + if (this.recording.length > 0) { + str += ` + + 9、平均执行率最低的顾问:` + this.recording.map((item, index) => { + str += ` + top${index+1}.${item.title || '--'}${item.value||'0'}min` + }) + } + str += ` + + 10、客户画像触达:${this.weekObj.reachSum || 0}次 + + 11、未标记接待数:${ this.weekObj.unlabelledReceptionNum || 0 }条 + + 12、设备情况: + 在线${this.weekObj.equipmentInfo.onlineNum || 0} + 离线:${this.weekObj.equipmentInfo.offlineNum || 0}` uni.setClipboardData({ data: str @@ -586,14 +661,14 @@ .nav-footer { position: sticky; bottom: 0; - padding: 32rpx 0; + padding: 32rpx; width: 100%; display: flex; justify-content: center; background: #fff; .footer-item { - width: 686rpx; + flex: 1; height: 88rpx; display: flex; justify-content: center; @@ -609,10 +684,14 @@ color: #fff; .fulls { + box-sizing: border-box; width: 100%; height: 100%; background: transparent; color: #fff; + font-size: 32rpx; + font-weight: normal; + line-height: 88rpx; } } } diff --git a/pages/reportExcel/weekReport.vue b/pages/reportExcel/weekReport.vue index 758d40a..994c8bb 100644 --- a/pages/reportExcel/weekReport.vue +++ b/pages/reportExcel/weekReport.vue @@ -23,7 +23,7 @@ - + {{ data.name }} @@ -69,7 +69,7 @@ - + {{ percent.title }} @@ -125,7 +125,7 @@ - + {{ data.name }} @@ -148,7 +148,7 @@ - + 顾问销讲执行率排名(TOP10) @@ -157,11 +157,11 @@ - + {{ percent.title }} + inactive-color="#F2F2F2" :show-percent="false" :percent="percent.values"> {{ percent.value || '0' }} % @@ -177,7 +177,7 @@ - + 顾问接待量排名(TOP10) @@ -187,11 +187,11 @@ - + {{ percent.title }} + inactive-color="#F2F2F2" :show-percent="false" :percent="percent.values"> {{ percent.value || '0' }} @@ -220,9 +220,14 @@ - + + + 回到管理端 + + + @@ -282,6 +287,9 @@ percentName: 'receptionCountPK', preNum: '', // 上周数量 preNumName: 'receptionCount2', // + path: '/pages/center/records/index', + pathParms: '?activeTotal=4&refresh=refresh', // 参数 + auth: '接待记录', // }, { name: '有效接待 (次)', @@ -291,6 +299,9 @@ percentName: 'activeCustomerPK', preNum: '', // 上周数量 preNumName: 'activeCustomer2', // + path: '/pages/center/records/index', + pathParms: '?activeTotal=4&refresh=refresh&validInvalid=0', // 参数 + auth: '接待记录', // }, { name: '平均执行率(%)', @@ -300,6 +311,9 @@ percentName: 'fractionPK', preNum: '', // 上周数量 preNumName: 'fraction2', // + path: '/pages/center/records/index', + pathParms: '?activeTotal=4&refresh=refresh&validInvalid=0', // 参数 + auth: '接待记录', // }, { name: '平均接待时长(分)', @@ -309,6 +323,9 @@ percentName: 'avgDurationPK', preNum: '', // 上周数量 preNumName: 'avgDuration2', // + path: '/pages/center/records/index', + pathParms: '?activeTotal=4&refresh=refresh&validInvalid=0', // 参数 + auth: '接待记录', // }, { name: '违禁接待 (次)', @@ -319,6 +336,9 @@ preNum: '', // 上周数量 preNumName: 'prohibitedNum2', // class: 'down', + path: '/pages/center/prohibited/index', + pathParms: '?activeTotal=4&violatedStatus=1&refresh=refresh', // 参数 + auth: '违禁记录', }, { name: '客户画像触达 (次)', @@ -328,6 +348,9 @@ percentName: 'reachSumPK', preNum: '', // 上周数量 preNumName: 'reachSum2', // + path: '/pages/center/Piabodata/Userinsightinto', + pathParms: '?activeTotal=3', // 参数 + auth: '销讲数据', }, { name: '已标记', @@ -337,6 +360,9 @@ percentName: 'labelledReceptionNumPK', preNum: '', // 上周数量 preNumName: 'labelledReceptionNum2', // + path: '/pages/center/records/index', + pathParms: '?activeTotal=4&refresh=refresh&markAdvisor=1', // 参数 + auth: '接待记录', // }, { name: '未标记', @@ -347,6 +373,9 @@ preNum: '', // 上周数量 preNumName: 'unlabelledReceptionNum2', // class: 'down', + path: '/pages/center/records/index', + pathParms: '?activeTotal=4&refresh=refresh&markAdvisor=0', // 参数 + auth: '接待记录', // }, ], @@ -358,6 +387,10 @@ computed: { + // 获取本地存储的权限列表 + menuList() { + return uni.getStorageSync('weapp_session_Menu_data') + }, // 排名最高与最低 rankTop() { @@ -407,7 +440,7 @@ } } }, - + // 接待统计 isShowStatistics() { // return this.rankTop('ranktype') && this.rankTop('class') && this.rankTop('people') && this.rankTop('topName') && this.rankTop('topPk') && this.rankTop('lastName') && this.rankTop('lastPk') && this.weekObj.customerInfo1 && this.weekObj.customerInfo1.length > 0 @@ -426,8 +459,6 @@ isShowJDLTopList() { return this.weekObj.JDLTopList && this.weekObj.JDLTopList.length > 0 }, - - }, onLoad(option) { @@ -444,7 +475,96 @@ }, methods: { + // 趋势分析 + toTrendAnalysis(name) { + return + let date = this.weekObj.weekDate.split('~') + let [t1, t2] = [date[0], date[1]] + let time1 = new Date(t1.replace(/-/g, '/')) + let time2 = new Date(t2.replace(/-/g, '/')) + time1.setDate(time1.getDate() - 7) + time2.setDate(time2.getDate() - 7) + let res1 = `${time1.getFullYear()}-${time1.getMonth() + 1}-${time1.getDate()}` + let res2 = `${time2.getFullYear()}-${time2.getMonth() + 1}-${time2.getDate()}` + if (this.isPassWatch(name)) { + uni.navigateTo({ + url: `/pages/center/Piabodata/TrendAnalysis?type=1&staTime=${date[0]}&endtime=${date[1]}&staTime1=${res1}&endtime1=${res2}` + }) + } else { + uni.showToast({ + title: '暂无权限', + icon: "none" + }) + } + }, + + // 顾问排名 + toEmployeesstatistics(name) { + let date = this.weekObj.weekDate.split('~') + let [t1, t2] = [date[0], date[1]] + if (this.isPassWatch(name)) { + uni.navigateTo({ + url: `/pages/center/Piabodata/Employeesstatistics?type=1&staTime=${date[0]}&endtime=${date[1]}` + }) + } else { + uni.showToast({ + title: '暂无权限', + icon: "none" + }) + } + }, + // 员工分析 + toStaffAnalysis(name, data) { + let obj = this.weekObj.customerInfo1.find(item => {return item.name == data.title}) + console.log(obj) + let time = this.weekObj.weekDate.split('~') + if (this.isPassWatch(name)) { + uni.navigateTo({ + url: `/pages/center/Piabodata/StaffAnalysis?type=1&id=${obj.id}&startDate=${time[0]}&endDate=${time[1]}` + }); + } else { + uni.showToast({ + title: '暂无权限', + icon: "none" + }) + } + }, + + // 跳转对应页面 + toAuthPage(data) { + if (!uni.getStorageSync('weapp_session_login_data').token) { + this.toHome() + return + } + if (this.isPassWatch(data.auth)) { + let time = this.weekObj.weekDate.split('~') + data.pathParms = `${data.pathParms}&staTime=${time[0]}&endtime=${time[1]}` + uni.navigateTo({ + url: `${data.path}${data.pathParms}` + }) + } else { + uni.showToast({ + title: '暂无权限', + icon: "none" + }) + } + }, + + + // 是否有权限观看 + isPassWatch(name) { + return this.menuList.findIndex(item => { + return item.name == name + }) == -1 ? false : true + }, + + // 跳转首页 + toHome() { + uni.navigateTo({ + url: '/pages/index/guide' + }) + }, // 获取周报详情 getMessage() { this.$u.get('/zkMessage/findByProjectId', { @@ -480,7 +600,6 @@ }).catch(e => { console.log(e) }) - }, @@ -506,6 +625,7 @@ this.needList.forEach(item => { if (this.weekObj[item + 'List']) { this.bubbleSort(this.weekObj[item + 'List']) + this.weekObj[item + 'List'] = this.dealData(this.weekObj[item + 'List']) } }) @@ -536,7 +656,18 @@ } } }, + // 定义一个公共方法对数据进行处理 + dealData(arr) { + // 获取最大值 + let num = Math.max.apply(Math, arr.map((o) => { + return o.value + })) + arr.map(item => { + item.values = Math.floor(item.value / num * 100) + }) + return arr + }, // 转换时间 getTimeLine(date, type = 1) { @@ -558,7 +689,7 @@ } return resu }, - + // 转换时间 getTimeLines(date) { if (!date) return '' @@ -568,8 +699,8 @@ return `${str0[1]}月${str0[2]}日~${str1[1]}月${str1[2]}日` }, - - + + }, filters: { @@ -983,14 +1114,14 @@ .nav-footer { position: sticky; bottom: 0; - padding: 32rpx 0; + padding: 32rpx; width: 100%; display: flex; justify-content: center; background: #fff; .footer-item { - width: 686rpx; + flex: 1; height: 88rpx; display: flex; justify-content: center; @@ -1006,10 +1137,14 @@ color: #fff; .fulls { + box-sizing: border-box; width: 100%; height: 100%; background: transparent; color: #fff; + font-size: 32rpx; + font-weight: normal; + line-height: 88rpx; } } } diff --git a/utils/domain.js b/utils/domain.js index d56c7d4..41effac 100644 --- a/utils/domain.js +++ b/utils/domain.js @@ -1,7 +1,8 @@ // http.js使用域名 -// const baseUrl = 'http://81.70.55.170:9090/autoSR/api';// 最新测试 +const baseUrl = 'http://81.70.55.170:9090/autoSR/api';// 最新测试 +// const baseUrl = 'http://192.168.31.211:8080/api';// 泽明 // const baseUrl = 'http://localhost:8080/autoSR/api'; // 本地 -const baseUrl = 'https://zkgj.quhouse.com/api'; // 质控正式 +// const baseUrl = 'https://zkgj.quhouse.com/api'; // 质控正式 // const baseUrl = 'https://hfju.com/api'; // 数智正式