|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085 |
- <template>
- <view class="box">
- <view class="boxtittab">
- <view class="tabbox">
- <view :class="{ activecllasscet: activeTotal == 4 }" @click="tabtimetap(4)">近七天</view>
- </view>
- <view class="tabbox">
- <view :class="{ activecllasscet: activeTotal == 5 }" @click="tabtimetap(5)">近15天</view>
- </view>
- <view class="tabbox">
- <view :class="{ activecllasscet: activeTotal == 6 }" @click="tabtimetap(6)">近30天</view>
- </view>
- <view class="tabbox">
- <view :class="{ activecllasscet: activeTotal == 3 }" @click="tabtimetap(3)">自定义</view>
- </view>
- </view>
-
- <view class="timepick">
- <view class="timepicktime" @click="chiocStaff(0)">
- <view>{{staff1.label}}</view>
- <view>
- <image class="Underimg" src="../../../static/images/Underimg.png" mode=""></image>
- </view>
- </view>
- <view class="timepickpick" v-if="staff1.value">
- <view @click="checkboxChange()" style="width: 40rpx;height:40rpx;border: 1rpx solid #E0E0E0;">
- <image v-if="timepickpickisshow" style="width: 40rpx;height: 40rpx;" src="../../../static/images/xuanzhong.png" mode=""></image>
- </view>
- <view style="font-size:26rpx;text-indent: 12rpx;">对比</view>
- </view>
- <view class="timepicktime" v-if="timepickpickisshow" @click="chiocStaff(1)">
- <view>{{staff2.label}}</view>
- <view>
- <image class="Underimg" src="../../../static/images/Underimg.png" mode=""></image>
- </view>
- </view>
- </view>
-
- <view style="width: 100%;height: 20rpx;background: #FAFAFA;"></view>
- <view class="single">
- <view class="title">
- <view class="title1" style="flex: 1;">接待量</view>
- <view class="title3" style="flex: 1;">
- <view class="title3-box" @click="tabtimetap1(0)">
- <view style="height: 42rpx;" :class="{ activecltab: eharTab.active1 == 0 }">排名</view>
- </view>
- <view class="title3-box" @click="tabtimetap1(1)">
- <view style="height: 42rpx;" :class="{ activecltab: eharTab.active1 == 1 }">趋势</view>
- </view>
- <!-- <view class="title3-box">
- <view style="height: 42rpx;" :class="{ activecltab: activeTotal2 == 2 }">表格</view>
- </view> -->
- </view>
- </view>
- <view class="hejibox">
- <view class="heji">{{!staff1.value?'团队总数':staff1.label}}:{{newTeam1||0}}</view>
- <view class="heji">{{!staff2.value?'团队平均':staff2.label}}:{{newAvg1||0}}</view>
- </view>
- <view class="" v-if=" eharTab.active1 == 1 ">
- <view class="danwei">接待量</view>
- <view class="uchaserbox">
- <qiun-data-charts
- type="line"
- :chartData="lineOptsect1"
- background="none"
- :ontouch="true"
- canvasId="wangxiaohuaerlingeryilingwuyibbb"
- :canvas2d="true"
- />
- </view>
- </view>
- <view class="jindu" v-if=" eharTab.active1 == 0 ">
- <view class="jindu-box" v-for="(item,index) in newlisttabinfo1" :key="index">
- <view class="jindu-boxche">
- <view class="jindu-name">{{item.name.substring(0, 4)}}</view>
- <view style="width: 440rpx;margin-left: 10rpx;">
- <u-line-progress height="24" :show-percent="false" active-color="#FBA448" :percent="item.zxl1"></u-line-progress>
- </view>
- <view class="jindu-zxl">{{item.zxl==null?0:item.zxl}}</view>
- </view>
- </view>
- </view>
- </view>
-
- <view style="width: 100%;height: 20rpx;background: #FAFAFA;"></view>
- <view class="single">
- <view class="title">
- <view class="title1" style="flex: 1;">接待时长</view>
- <view class="title3" style="flex: 1;">
- <view class="title3-box" @click="tabtimetap2(0)">
- <view style="height: 42rpx;" :class="{ activecltab: eharTab.active2 == 0 }">排名</view>
- </view>
- <view class="title3-box" @click="tabtimetap2(1)">
- <view style="height: 42rpx;" :class="{ activecltab: eharTab.active2 == 1 }">趋势</view>
- </view>
- <!-- <view class="title3-box">
- <view style="height: 42rpx;" :class="{ activecltab: activeTotal2 == 2 }">表格</view>
- </view> -->
- </view>
- </view>
- <view class="hejibox">
- <view class="heji">{{!staff1.value?'团队总数':staff1.label}}:{{newTeam2||0}}</view>
- <view class="heji">{{!staff2.value?'团队平均':staff2.label}}:{{newAvg2||0}}</view>
- </view>
- <view class="" v-if=" eharTab.active2 == 1 ">
- <view class="danwei">录音时长</view>
- <view class="uchaserbox">
- <qiun-data-charts
- type="line"
- :chartData="lineOptsect2"
- background="none"
- :ontouch="true"
- canvasId="wangxiaohuaerlingeryilingwuyibb"
- :canvas2d="true"
- />
- </view>
- </view>
- <view class="jindu" v-if=" eharTab.active2 == 0 ">
- <view class="jindu-box" v-for="(item,index) in newlisttabinfo2" :key="index">
- <view class="jindu-boxche">
- <view class="jindu-name">{{item.name.substring(0, 4)}}</view>
- <view style="width: 440rpx;margin-left: 10rpx;">
- <u-line-progress height="24" :show-percent="false" active-color="#FBA448" :percent="item.zxl1"></u-line-progress>
- </view>
- <view class="jindu-zxl">{{item.zxl==null?0:item.zxl}}</view>
- </view>
- </view>
- </view>
- </view>
-
- <view style="width: 100%;height: 20rpx;background: #FAFAFA;"></view>
- <view class="single">
- <view class="title">
- <view class="title1" style="flex: 1;">销讲执行率</view>
- <view class="title3" style="flex: 1;">
- <view class="title3-box" @click="tabtimetap3(0)">
- <view style="height: 42rpx;" :class="{ activecltab: eharTab.active3 == 0 }">排名</view>
- </view>
- <view class="title3-box" @click="tabtimetap3(1)">
- <view style="height: 42rpx;" :class="{ activecltab: eharTab.active3 == 1 }">趋势</view>
- </view>
- <!-- <view class="title3-box">
- <view style="height: 42rpx;" :class="{ activecltab: activeTotal2 == 2 }">表格</view>
- </view> -->
- </view>
- </view>
- <!-- <view class="hejibox">
- <view class="heji">{{!staff1.value?'团队总数':staff1.label}}:{{newTeam3||0}}</view>
- <view class="heji">{{!staff2.value?'团队平均':staff2.label}}:{{newAvg3||0}}</view>
- </view> -->
- <view class="" v-if=" eharTab.active3 == 1 ">
- <view class="danwei">执行率</view>
- <view class="uchaserbox">
- <qiun-data-charts
- type="line"
- :chartData="lineOptsect3"
- background="none"
- :ontouch="true"
- canvasId="wangxiaohuaerlingeryilingwuyib"
- :canvas2d="true"
- />
- </view>
- </view>
- <view class="jindu" v-if=" eharTab.active3 == 0 ">
- <view class="jindu-box" v-for="(item,index) in newlisttabinfo3" :key="index">
- <view class="jindu-boxche">
- <view class="jindu-name">{{item.name.substring(0, 4)}}</view>
- <view style="width: 440rpx;margin-left: 10rpx;">
- <u-line-progress height="24" :show-percent="false" active-color="#FBA448" :percent="item.zxl1"></u-line-progress>
- </view>
- <view class="jindu-zxl">{{item.zxl==null?0:item.zxl}}</view>
- </view>
- </view>
- </view>
- </view>
-
- <view style="width: 100%;height: 20rpx;background: #FAFAFA;"></view>
- <!-- <view class="single">
- <view class="title">
- <view class="title1" style="flex: 1;">顾问排名(TOP10)</view>
- <view class="title3" style="flex: 1;">
- <view class="title3-box">
- <view style="height: 42rpx;" :class="{ activecltab: activeTotal2 == 0 }">执行率</view>
- </view>
- <view class="title3-box">
- <view style="height: 42rpx;" :class="{ activecltab: activeTotal2 == 1 }">得分</view>
- </view>
- </view>
- </view>
-
- <view class="hejibox">
- <view class="heji">合计:50</view>
- <view class="heji">均值:25</view>
- </view>
- <view class="jindu">
- <view class="jindu-box" v-for="(item,index) in newlisttabinfo" :key="index">
- <view class="jindu-boxche">
- <view class="jindu-name">{{item.name.substring(0, 4)}}</view>
- <view style="width: 440rpx;margin-left: 10rpx;">
- <u-line-progress height="24" :show-percent="false" active-color="#9B6BDF" :percent="item.zxl"></u-line-progress>
- </view>
- <view class="jindu-zxl">{{item.zxl==null?0:item.zxl}}</view>
- </view>
- </view>
- </view>
- </view> -->
-
- <view style="width: 100%;height: 20rpx;background: #FAFAFA;"></view>
- <view class="single">
- <view class="title" style="padding-right: 30rpx;">
- <view class="title1" style="flex: 1;">销讲能力</view>
- <view class="title2" style="flex: 1;justify-content: flex-end;" @click="goTeam">
- <view class="title2-che">团队
- <image class="righttochoose" src="../../../static/images/righttochoose.png" mode=""></image>
- </view>
- </view>
- </view>
-
- <view class="uchaserbox">
- <qiun-data-charts
- type="radar"
- :chartData="chartData1"
- :canvas2d="true"
- canvasId="wangxiaohuaerlingeryilingwuyib88"
- background="none"
- />
- </view>
- </view>
-
-
-
-
- <view style="width: 100%;height: 20rpx;background: #FAFAFA;"></view>
- <!-- <view class="single">
- <view class="title">
- <view class="title1" style="flex: 1;">禁忌执行率</view>
- <view class="title3" style="flex: 1;">
- <view class="title3-box" @click="tabtimetap4(0)">
- <view style="height: 42rpx;" :class="{ activecltab: eharTab.active4 == 0 }">排名</view>
- </view>
- <view class="title3-box" @click="tabtimetap4(1)">
- <view style="height: 42rpx;" :class="{ activecltab: eharTab.active4 == 1 }">趋势</view>
- </view>
- <view class="title3-box">
- <view style="height: 42rpx;" :class="{ activecltab: activeTotal2 == 2 }">表格</view>
- </view>
- </view>
- </view>
- <view class="hejibox">
- <view class="heji">{{!staff1.value?'团队':staff1.label}}:{{newTeam4||0}}</view>
- <view class="heji">{{!staff2.value?'均值':staff2.label}}:{{newAvg4||0}}</view>
- </view>
- <view class="" v-if=" eharTab.active4 == 1 ">
- <view class="danwei">来访(人)</view>
- <view class="uchaserbox">
- <qiun-data-charts
- type="line"
- :chartData="lineOptsect4"
- background="none"
- :ontouch="true"
- canvasId="wangxiaohuaerlingeryilingwuyi"
- :canvas2d="true"
- />
- </view>
- </view>
- <view class="jindu" v-if=" eharTab.active4 == 0 ">
- <view class="jindu-box" v-for="(item,index) in newlisttabinfo4" :key="index">
- <view class="jindu-boxche">
- <view class="jindu-name">{{item.name.substring(0, 4)}}</view>
- <view style="width: 440rpx;margin-left: 10rpx;">
- <u-line-progress height="24" :show-percent="false" active-color="#FBA448" :percent="item.zxl"></u-line-progress>
- </view>
- <view class="jindu-zxl">{{item.zxl==null?0:item.zxl}}</view>
- </view>
- </view>
- </view>
- </view> -->
-
- <!-- <view style="width: 100%;height: 20rpx;background: #FAFAFA;"></view> -->
- <!-- <view class="single">
- <view class="title" style="padding-right: 30rpx;">
- <view class="title1" style="flex: 1;">违禁能力(TOP10)</view>
- <view class="title2" style="flex: 1;justify-content: flex-end;">
- <view class="title2-che">楼盘
- <image class="righttochoose" src="../../../static/images/righttochoose.png" mode=""></image>
- </view>
- </view>
- </view>
- <view class="hejibox">
- <view class="heji">合计:50</view>
- <view class="heji">均值:25</view>
- </view>
- <view class="uchaserbox">
- <qiun-data-charts
- type="radar"
- :chartData="chartData"
- :canvas2d="true"
- canvasId="wangxiaohuaerlingeryilingwuyib89"
- background="none"
- />
- </view>
- </view> -->
-
- <u-calendar v-model="totalTimeShow" mode="range" @change="totalTimeChange"></u-calendar>
-
- <!-- 选择部门的选择框 -->
- <u-select v-model="staffShow" :list="staffList" @confirm="staffSelectCallback" :default-value='selindex'></u-select>
- <u-select v-model="staffShow1" :list="staffList1" @confirm="staffSelectCallback" :default-value='selindex'></u-select>
- </view>
- </template>
-
- <script>
- var app = getApp();
- var util = require("../../../utils/util.js");
- var config = require("../../../config");
- export default {
- data() {
- return {
- activeTotal: 4,
- eharTab:{
- active1: 0,
- active2:0,
- active3:0,
- active4:0,
- },
- deptids:'',
- bocindex:0,
- timepickpickisshow:false,
- totalTimeShow: false,
- // 楼盘id
- houseId:'',
- staffList:[],
- staffList1:[],
- staffShow:false,
- staffShow1:false,
- staff1:{
- value:'',
- label:''
- },
- staff2:{
- value:'',
- label:'平均'
- },
- lastStartDate:'',
- lastEndDate :'',
- selindex:[0],
- choseStaffFlag:false,
- lineOptsect1:{
- "categories": ["2016","2017","2018","2019","2020","2021"],
- "series": [
- {
- "name": "成交量1",
- "data": [35,8,25,37,4,20]
- },
- {
- "name": "成交量2",
- "data": [40,18,45,44,10,60]
- }
- ]
- },
- lineOptsect2:{
- "categories": ["2016","2017","2018","2019","2020","2021"],
- "series": [
- {
- "name": "成交量1",
- "data": [35,8,25,37,4,20]
- },
- {
- "name": "成交量2",
- "data": [40,18,45,44,10,60]
- }
- ]
- },
- lineOptsect3:{
- "categories": ["2016","2017","2018","2019","2020","2021"],
- "series": [
- {
- "name": "成交量1",
- "data": [35,8,25,37,4,20]
- },
- {
- "name": "成交量2",
- "data": [40,18,45,44,10,60]
- }
- ]
- },
- lineOptsect4:{
- "categories": ["2016","2017","2018","2019","2020","2021"],
- "series": [
- {
- "name": "成交量1",
- "data": [35,8,25,37,4,20]
- },
- {
- "name": "成交量2",
- "data": [40,18,45,44,10,60]
- }
- ]
- },
- 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'},
- ],
- newTeam1:'',
- newAvg1:'',
- newTeam2:'',
- newAvg2:'',
- newTeam3:'',
- newAvg3:'',
- newTeam4:'',
- newAvg4:'',
- chartData1:{
- "categories": ["维度1","维度2","维度3","维度4","维度5","维度6"],
- "series": [
- {
- "name": "成交量",
- "data": [90,110,165,195,187,172]
- }
- ]
- },
- chartData2:{
- "categories": ["维度1","维度2","维度3","维度4","维度5","维度6"],
- "series": [
- {
- "name": "成交量",
- "data": [90,110,165,195,187,172]
- }
- ]
- }
-
- };
- },
- 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: {
- //是否对比
- checkboxChange(){
- this.timepickpickisshow=!this.timepickpickisshow;
- this.staff2.label='平均'
- this.staff2.value=''
- // 团队对比接待量
- this.receptionCountList(this.eharTab.active1,1,'/cusLvStatistics/teamAnalysisReception')
- // 团队对比接待时长
- this.receptionCountList(this.eharTab.active2,2,'/cusLvStatistics/teamAnalysisReceptionTime')
- /* 销奖执行率 */
- this.receptionCountList(this.eharTab.active3,3,'/cusLvStatistics/teamAnalysisExecutionRate')
- // 获取销奖能力
- this.getPowerList()
- },
- // 获取部门列表
- getSectionList(){
- this.$u.post('/cusLvStatistics/findAllDeptIdByHouseId',{houseId:this.houseId})
- .then(res=>{
- this.staffList=[]
- this.staffList1=[]
- res.map(item=>{
- let obj={}
- obj.value=item.deptId
- obj.label=item.deptName
- this.staffList.push(obj)
- })
- this.staffList1=[...this.staffList]
- this.staffList.unshift({
- value:'',
- label:'全部'
- })
- this.staffList1.unshift({
- value:'',
- label:'平均'
- })
- this.staff1=this.staffList[0]
- // 团队对比接待量
- this.receptionCountList(0,1,'/cusLvStatistics/teamAnalysisReception')
- // 团队对比接待时长
- this.receptionCountList(0,2,'/cusLvStatistics/teamAnalysisReceptionTime')
- /* 销奖执行率 */
- this.receptionCountList(0,3,'/cusLvStatistics/teamAnalysisExecutionRate')
- // 获取销奖能力
- this.getPowerList()
-
- })
- },
- // 点击部门对比
- chiocStaff(idx){
- if(idx==0){
- // 当选择了第一个的时候
- this.choseStaffFlag=false
- this.staffShow=true
- }else{
- this.choseStaffFlag=true
- this.staffShow1=true
- }
-
- },
- //时间切换
- tabtimetap(index) {
- if (index == 3) {
- this.totalTimeShow = true;
- } else {
- this.activeTotal = index;
- this.lastEndDate=''
- this.lastStartDate=''
- // 获取数据
- // 团队对比接待量
- this.receptionCountList(this.eharTab.active1,1,'/cusLvStatistics/teamAnalysisReception')
- // 团队对比接待时长
- this.receptionCountList(this.eharTab.active2,2,'/cusLvStatistics/teamAnalysisReceptionTime')
- /* 销奖执行率 */
- this.receptionCountList(this.eharTab.active3,3,'/cusLvStatistics/teamAnalysisExecutionRate')
- // 获取销奖能力
- this.getPowerList()
- }
- },
- // 接待量
- tabtimetap1(idx){
- this.eharTab.active1=idx
- // 调用方法
- this.receptionCountList(idx,1,'/cusLvStatistics/teamAnalysisReception')
- },
- // 接待时长
- tabtimetap2(idx){
- this.eharTab.active2=idx
- // 调用方法
- this.receptionCountList(idx,2,'/cusLvStatistics/teamAnalysisReceptionTime')
- },
- tabtimetap3(idx){
- this.eharTab.active3=idx
- // 调用方法
- this.receptionCountList(idx,3,'/cusLvStatistics/teamAnalysisExecutionRate')
- },
- tabtimetap4(idx){
- this.eharTab.active4=idx
- // 调用方法
- // this.getRecordList()
- },
- //自定义时间
- totalTimeChange(e) {
- console.log(e.startDate, e.endDate)
- this.activeTotal=3;
- this.lastEndDate=e.endDate
- this.lastStartDate=e.startDate
- // 获取数据
- // 团队对比接待量
- this.receptionCountList(this.eharTab.active1,1,'/cusLvStatistics/teamAnalysisReception')
- // 团队对比接待时长
- this.receptionCountList(this.eharTab.active2,2,'/cusLvStatistics/teamAnalysisReceptionTime')
- /* 销奖执行率 */
- this.receptionCountList(this.eharTab.active3,3,'/cusLvStatistics/teamAnalysisExecutionRate')
- // 获取销奖能力
- this.getPowerList()
- },
- //指标执行率分析tab
- tapspagek2(index) {
- this.bocindex = index;
- },
- //集团对比
- Groupcontrast(){
- uni.navigateTo({
- url: '/pages/center/Piabodata/Groupcontrast'
- });
- },
- // 去选择团队
- goTeam(){
- uni.navigateTo({
- url:`/pages/center/Piabodata/selectTeam?ids=${this.deptids}`
- })
- },
- staffSelectCallback(e){
- if(this.choseStaffFlag){
- // 第二个客户
- // console.log(e,'第二个')
- this.staff2=e[0]
- }else{
- // 第一个客户
- // console.log(e,'第一个')
- // 当选择全部时
- if(!e.value){
- this.timepickpickisshow=false
- this.staff2.label='平均'
- this.staff2.value=''
- }
- this.staff1=e[0]
- }
- if(this.staff1.label==this.staff2.label){
- uni.showToast({
- title:'请勿选择重复',
- icon:'none'
- })
- this.staff2.label='请选择'
- // this.staff2.label='平均'
- // this.staff2.value=''
- return
- }else{
- // 获取数据
- // 团队对比接待量
- this.receptionCountList(this.eharTab.active1,1,'/cusLvStatistics/teamAnalysisReception')
- // 团队对比接待时长
- this.receptionCountList(this.eharTab.active2,2,'/cusLvStatistics/teamAnalysisReceptionTime')
- /* 销奖执行率 */
- this.receptionCountList(this.eharTab.active3,3,'/cusLvStatistics/teamAnalysisExecutionRate')
- // 获取销奖能力
- this.getPowerList()
- }
- },
- // 团队对比接待量
- // receptionCountList(idx){
- // this.$u.post('/cusLvStatistics/teamAnalysisReception',{
- // // userA:this.staff1.value,
- // // userB:this.staff2.value,
- // deptIds:[this.staff1.value,this.staff2.value].filter(item=>item).join(','),
- // showRank:idx,
- // houseId:this.houseId,
- // timeType:this.lastEndDate?null:this.activeTotal+'',
- // lastEndDate:this.lastEndDate,
- // lastStartDate:this.lastStartDate
- // })
- // .then(res=>{
- // // console.log(res)
- // let result=res.result
- // this.newTeam=res.avg[0]
- // this.newAvg=res.avg[1]
- // if(idx==0){
- // // 当选择的是牌名时
- // // 处理数据
- // // 先处理牌名数据,需要进行判断全部还是单个
- // // 当为全部时
- // this.newlisttabinfo=[]
- // // 当选择全部时
- // if(!this.staff1.value&&!this.staff2.value){
- // // console.log(1)
- // result[0].map(item=>{
- // let obj={}
- // obj.name=item.deptName
- // obj.zxl=item.receptionCount
- // this.newlisttabinfo.push(obj)
- // })
- // }
- // // 当选择只有一个时
- // else if(this.staff1.value&&!this.staff2.value){
- // // console.log(2)
- // result[0].map(item=>{
- // let obj={}
- // obj.name=item.deptName
- // obj.zxl=item.receptionCount
- // this.newlisttabinfo.push(obj)
- // })
- // // 判断是否显示平均
- // // 如果显示对比
- // if(this.timepickpickisshow){
- // result[1].map(item=>{
- // let obj={}
- // obj.name='平均'
- // obj.zxl=item.receptionCount
- // this.newlisttabinfo.push(obj)
- // })
- // }
- // }else{
- // // console.log(3)
- // // 当两个都选择的时候
- // result[0].map(item=>{
- // let obj={}
- // obj.name=item.deptName
- // obj.zxl=item.receptionCount
- // this.newlisttabinfo.push(obj)
- // })
- // result[1].map(item=>{
- // let obj={}
- // obj.name=item.deptName
- // obj.zxl=item.receptionCount
- // this.newlisttabinfo.push(obj)
- // })
- // }
- // }else{
- // // 当选择趋势时
- // // this.lineOptsect={
- // // categories:[],
- // // series:[]
- // // }
- // let allobj={
- // categories:[],
- // series:[]
- // }
- // // 先处理时间
- // // 当选择全部时
- // if(!this.staff1.value&&!this.staff2.value){
- // // console.log(1)
- // result.map((item,idx)=>{
- // let obj={}
- // obj.name=item[0].deptName
- // obj.data=[]
- // item.map(item1=>{
- // // 时间的处理
- // if(idx==0){
- // allobj.categories.push(item1.statDate.slice(5,10))
- // }
- // obj.data.push(item1.receptionCount)
- // })
- // allobj.series.push(obj)
- // })
- // }
- // // 当选择只有一个时
- // else if(this.staff1.value&&!this.staff2.value){
- // // console.log(2)
- // let obj={}
- // obj.data=[]
- // obj.name=result[0][0].deptName
- // result[0].map(item=>{
- // allobj.categories.push(item.statDate.slice(5,10))
- // obj.data.push(item.receptionCount)
- // })
- // allobj.series.push(obj)
- // // 判断是否显示平均
- // // 如果显示对比
- // if(this.timepickpickisshow){
- // let obj={}
- // obj.data=[]
- // obj.name='平均'
- // result[1].map(item=>{
- // obj.data.push(item.receptionCount)
- // })
- // allobj.series.push(obj)
- // }
- // }else{
- // // console.log(3)
- // // 当两个都选择的时候
- // let obj={}
- // let obj1={}
- // obj.data=[]
- // obj1.data=[]
- // obj.name=result[0][0].deptName
- // obj1.name=result[1][0].deptName
- // result[0].map(item=>{
- // allobj.categories.push(item.statDate.slice(5,10))
- // obj.data.push(item.receptionCount)
- // })
- // result[1].map(item=>{
- // obj1.data.push(item.receptionCount)
- // })
- // allobj.series.push(obj)
- // allobj.series.push(obj1)
- // }
- // this.lineOptsect=allobj
- // }
- // })
- // },
- // 接待时长
- 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(','),
- showRank:idx,
- houseId:this.houseId,
- 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]
- if(idx==0){
- // 当选择的是牌名时
- // 处理数据
- // 先处理牌名数据,需要进行判断全部还是单个
- // 当为全部时
- this['newlisttabinfo'+index]=[]
- let arr=[]
- // 当选择全部时
- if(!this.staff1.value&&!this.staff2.value){
- // console.log(1)
- result[0].map(item=>{
- let obj={}
- obj.name=item.deptName
- obj.zxl=item.data
- arr.push(obj)
-
- })
- arr=this.dealData(arr)
- this['newlisttabinfo'+index]=arr
- }
- // 当选择只有一个时
- else if(this.staff1.value&&!this.staff2.value){
- // console.log(2)
- result[0].map(item=>{
- let obj={}
- obj.name=item.deptName
- obj.zxl=item.data
- arr.push(obj)
- })
- // 判断是否显示平均
- // 如果显示对比
- if(this.timepickpickisshow){
- result[1].map(item=>{
- let obj={}
- obj.name='平均'
- obj.zxl=item.data
- arr.push(obj)
- })
- }
- arr=this.dealData(arr)
- this['newlisttabinfo'+index]=arr
- }else{
- // console.log(3)
- // 当两个都选择的时候
- result[0].map(item=>{
- let obj={}
- obj.name=item.deptName
- obj.zxl=item.data
- arr.push(obj)
- })
- result[1].map(item=>{
- let obj={}
- obj.name=item.deptName
- obj.zxl=item.data
- arr.push(obj)
- })
- arr=this.dealData(arr)
- this['newlisttabinfo'+index]=arr
- }
- }else{
- // 当选择趋势时
- this['lineOptsect'+index]={}
- let allobj={
- categories:[],
- series:[]
- }
- // 先处理时间
- // 当选择全部时
- if(!this.staff1.value&&!this.staff2.value){
- result.map((item,idx)=>{
- let obj={}
- obj.name=item[0].deptName
- obj.data=[]
- item.map(item1=>{
- // 时间的处理
- if(idx==0){
- allobj.categories.push(item1.statDate.slice(5,10))
- }
- obj.data.push(item1.data)
- })
- allobj.series.push(obj)
- })
- }
- // 当选择只有一个时
- else if(this.staff1.value&&!this.staff2.value){
- // console.log(2)
- let obj={}
- obj.data=[]
- obj.name=result[0][0].deptName
- result[0].map(item=>{
- allobj.categories.push(item.statDate.slice(5,10))
- obj.data.push(item.data)
- })
- allobj.series.push(obj)
- // 判断是否显示平均
- // 如果显示对比
- if(this.timepickpickisshow){
- let obj={}
- obj.data=[]
- obj.name='平均'
- result[1].map(item=>{
- obj.data.push(item.data)
- })
- allobj.series.push(obj)
- }
- }else{
- // console.log(3)
- // 当两个都选择的时候
- let obj={}
- let obj1={}
- obj.data=[]
- obj1.data=[]
- obj.name=result[0][0].deptName
- obj1.name=result[1][0].deptName
- result[0].map(item=>{
- allobj.categories.push(item.statDate.slice(5,10))
- obj.data.push(item.data)
- })
- result[1].map(item=>{
- obj1.data.push(item.data)
- })
- allobj.series.push(obj)
- allobj.series.push(obj1)
- }
- // console.log(allobj)
- // return
- // 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()
- })
- },
- // 定义一个公共方法对数据进行处理
- dealData(arr){
- // 获取最大值
- let num=Math.max.apply(Math, arr.map(function (o) { return o.zxl })) //结果:3
- // console.log(num)
- 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)
- })
- // console.log(arr)
- return arr
- }else{
- arr.map(item=>{
- item.zxl1=item.zxl
- })
- return arr
- }
- },
- }
- };
- </script>
- <style lang="scss" scoped>
- .box {
- width: 100%;
- height: 100%;
- background: #FAFAFA;
- padding-bottom: 60rpx;
- }
- // 对比时间切换
- .timepick{
- width: 100%;
- height: 90rpx;
- display: flex;
- align-items: center;
- background: #FAFAFA;
- }
- .timepicktime{
- width: 260rpx;
- height: 50rpx;
- border: 1rpx solid #E0E0E0;
- margin-left: 30rpx;
- display: flex;
- background: #FFFFFF;
- }
- .timepicktime>view:nth-of-type(1){
- width: 210rpx;
- height: 100%;
- line-height: 50rpx;
- font-size: 26rpx;
- font-weight: 400;
- text-align: center;
- }
- .timepicktime>view:nth-of-type(2){
- width: 50rpx;
- height: 100%;
- border-left: 1px solid #E0E0E0;
- }
- .timepickpick{
- width: 110rpx;
- height: 50rpx;
- margin-left: 30rpx;
- display: flex;
- align-items: center;
- }
- .Underimg{
- width: 50rpx;
- height:50rpx;
- margin-top: -2rpx;
- }
- </style>
|