You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

1123 lines
33 KiB

  1. <template>
  2. <view class="box">
  3. <view class="boxtittab">
  4. <view class="tabbox">
  5. <view :class="{ activecllasscet: activeTotal == 4 }" @click="tabtimetap(4)">近七天</view>
  6. </view>
  7. <view class="tabbox">
  8. <view :class="{ activecllasscet: activeTotal == 5 }" @click="tabtimetap(5)">近15天</view>
  9. </view>
  10. <view class="tabbox">
  11. <view :class="{ activecllasscet: activeTotal == 6 }" @click="tabtimetap(6)">近30天</view>
  12. </view>
  13. <view class="tabbox">
  14. <view :class="{ activecllasscet: activeTotal == 3 }" @click="tabtimetap(3)">自定义</view>
  15. </view>
  16. </view>
  17. <view class="timepick">
  18. <view class="timepicktime" @click="chiocStaff(0)">
  19. <view>{{staff1.label}}</view>
  20. <view>
  21. <image class="Underimg" src="../../../static/images/Underimg.png" mode=""></image>
  22. </view>
  23. </view>
  24. <view class="timepickpick" v-if="staff1.value">
  25. <view @click="checkboxChange()" style="width: 40rpx;height:40rpx;border: 1rpx solid #E0E0E0;">
  26. <image v-if="timepickpickisshow" style="width: 40rpx;height: 40rpx;" src="../../../static/images/xuanzhong.png" mode=""></image>
  27. </view>
  28. <view style="font-size:26rpx;text-indent: 12rpx;">对比</view>
  29. </view>
  30. <view class="timepicktime" v-if="timepickpickisshow" @click="chiocStaff(1)">
  31. <view>{{staff2.label}}</view>
  32. <view>
  33. <image class="Underimg" src="../../../static/images/Underimg.png" mode=""></image>
  34. </view>
  35. </view>
  36. </view>
  37. <view style="width: 100%;height: 20rpx;background: #FAFAFA;"></view>
  38. <view class="single">
  39. <view class="title">
  40. <view class="title1" style="flex: 1;">接待量</view>
  41. <view class="title3" style="flex: 1;">
  42. <view class="title3-box" @click="tabtimetap1(0)">
  43. <view style="height: 42rpx;" :class="{ activecltab: eharTab.active1 == 0 }">排名</view>
  44. </view>
  45. <view class="title3-box" @click="tabtimetap1(1)">
  46. <view style="height: 42rpx;" :class="{ activecltab: eharTab.active1 == 1 }">趋势</view>
  47. </view>
  48. <!-- <view class="title3-box">
  49. <view style="height: 42rpx;" :class="{ activecltab: activeTotal2 == 2 }">表格</view>
  50. </view> -->
  51. </view>
  52. </view>
  53. <view class="hejibox">
  54. <view class="heji">{{!staff1.value?'团队总数':staff1.label}}:{{newTeam1||0}}</view>
  55. <view class="heji">{{!staff2.value?'团队平均':staff2.label}}:{{newAvg1||0}}</view>
  56. </view>
  57. <view class="" v-if=" eharTab.active1 == 1 ">
  58. <view class="danwei">接待量</view>
  59. <view class="uchaserbox">
  60. <qiun-data-charts
  61. type="line"
  62. :chartData="lineOptsect1"
  63. background="none"
  64. :ontouch="true"
  65. canvasId="wangxiaohuaerlingeryilingwuyibbb"
  66. :canvas2d="true"
  67. />
  68. </view>
  69. </view>
  70. <view class="jindu" v-if=" eharTab.active1 == 0 ">
  71. <view class="jindu-box" v-for="(item,index) in newlisttabinfo1" :key="index">
  72. <view class="jindu-boxche">
  73. <view class="jindu-name">{{item.name.substring(0, 4)}}</view>
  74. <view style="width: 440rpx;margin-left: 10rpx;">
  75. <u-line-progress height="24" :show-percent="false" active-color="#FBA448" :percent="item.zxl1"></u-line-progress>
  76. </view>
  77. <view class="jindu-zxl">{{item.zxl==null?0:item.zxl}}</view>
  78. </view>
  79. </view>
  80. </view>
  81. </view>
  82. <view style="width: 100%;height: 20rpx;background: #FAFAFA;"></view>
  83. <view class="single">
  84. <view class="title">
  85. <view class="title1" style="flex: 1;">接待时长</view>
  86. <view class="title3" style="flex: 1;">
  87. <view class="title3-box" @click="tabtimetap2(0)">
  88. <view style="height: 42rpx;" :class="{ activecltab: eharTab.active2 == 0 }">排名</view>
  89. </view>
  90. <view class="title3-box" @click="tabtimetap2(1)">
  91. <view style="height: 42rpx;" :class="{ activecltab: eharTab.active2 == 1 }">趋势</view>
  92. </view>
  93. <!-- <view class="title3-box">
  94. <view style="height: 42rpx;" :class="{ activecltab: activeTotal2 == 2 }">表格</view>
  95. </view> -->
  96. </view>
  97. </view>
  98. <view class="hejibox">
  99. <view class="heji">{{!staff1.value?'团队总数':staff1.label}}:{{newTeam2||0}}</view>
  100. <view class="heji">{{!staff2.value?'团队平均':staff2.label}}:{{newAvg2||0}}</view>
  101. </view>
  102. <view class="" v-if=" eharTab.active2 == 1 ">
  103. <view class="danwei">录音时长</view>
  104. <view class="uchaserbox">
  105. <qiun-data-charts
  106. type="line"
  107. :chartData="lineOptsect2"
  108. background="none"
  109. :ontouch="true"
  110. canvasId="wangxiaohuaerlingeryilingwuyibb"
  111. :canvas2d="true"
  112. />
  113. </view>
  114. </view>
  115. <view class="jindu" v-if=" eharTab.active2 == 0 ">
  116. <view class="jindu-box" v-for="(item,index) in newlisttabinfo2" :key="index">
  117. <view class="jindu-boxche">
  118. <view class="jindu-name">{{item.name.substring(0, 4)}}</view>
  119. <view style="width: 440rpx;margin-left: 10rpx;">
  120. <u-line-progress height="24" :show-percent="false" active-color="#FBA448" :percent="item.zxl1"></u-line-progress>
  121. </view>
  122. <view class="jindu-zxl">{{item.zxl==null?0:item.zxl}}</view>
  123. </view>
  124. </view>
  125. </view>
  126. </view>
  127. <view style="width: 100%;height: 20rpx;background: #FAFAFA;"></view>
  128. <view class="single">
  129. <view class="title">
  130. <view class="title1" style="flex: 1;">销讲执行率</view>
  131. <view class="title3" style="flex: 1;">
  132. <view class="title3-box" @click="tabtimetap3(0)">
  133. <view style="height: 42rpx;" :class="{ activecltab: eharTab.active3 == 0 }">排名</view>
  134. </view>
  135. <view class="title3-box" @click="tabtimetap3(1)">
  136. <view style="height: 42rpx;" :class="{ activecltab: eharTab.active3 == 1 }">趋势</view>
  137. </view>
  138. <!-- <view class="title3-box">
  139. <view style="height: 42rpx;" :class="{ activecltab: activeTotal2 == 2 }">表格</view>
  140. </view> -->
  141. </view>
  142. </view>
  143. <!-- <view class="hejibox">
  144. <view class="heji">{{!staff1.value?'团队总数':staff1.label}}:{{newTeam3||0}}</view>
  145. <view class="heji">{{!staff2.value?'团队平均':staff2.label}}:{{newAvg3||0}}</view>
  146. </view> -->
  147. <view class="" v-if=" eharTab.active3 == 1 ">
  148. <view class="danwei">执行率</view>
  149. <view class="uchaserbox">
  150. <qiun-data-charts
  151. type="line"
  152. :chartData="lineOptsect3"
  153. background="none"
  154. :ontouch="true"
  155. canvasId="wangxiaohuaerlingeryilingwuyib"
  156. :canvas2d="true"
  157. />
  158. </view>
  159. </view>
  160. <view class="jindu" v-if=" eharTab.active3 == 0 ">
  161. <view class="jindu-box" v-for="(item,index) in newlisttabinfo3" :key="index">
  162. <view class="jindu-boxche">
  163. <view class="jindu-name">{{item.name.substring(0, 4)}}</view>
  164. <view style="width: 440rpx;margin-left: 10rpx;">
  165. <u-line-progress height="24" :show-percent="false" active-color="#FBA448" :percent="item.zxl1"></u-line-progress>
  166. </view>
  167. <view class="jindu-zxl">{{item.zxl==null?0:item.zxl}}%</view>
  168. </view>
  169. </view>
  170. </view>
  171. </view>
  172. <view style="width: 100%;height: 20rpx;background: #FAFAFA;"></view>
  173. <!-- <view class="single">
  174. <view class="title">
  175. <view class="title1" style="flex: 1;">顾问排名(TOP10)</view>
  176. <view class="title3" style="flex: 1;">
  177. <view class="title3-box">
  178. <view style="height: 42rpx;" :class="{ activecltab: activeTotal2 == 0 }">执行率</view>
  179. </view>
  180. <view class="title3-box">
  181. <view style="height: 42rpx;" :class="{ activecltab: activeTotal2 == 1 }">得分</view>
  182. </view>
  183. </view>
  184. </view>
  185. <view class="hejibox">
  186. <view class="heji">合计:50</view>
  187. <view class="heji">均值:25</view>
  188. </view>
  189. <view class="jindu">
  190. <view class="jindu-box" v-for="(item,index) in newlisttabinfo" :key="index">
  191. <view class="jindu-boxche">
  192. <view class="jindu-name">{{item.name.substring(0, 4)}}</view>
  193. <view style="width: 440rpx;margin-left: 10rpx;">
  194. <u-line-progress height="24" :show-percent="false" active-color="#9B6BDF" :percent="item.zxl"></u-line-progress>
  195. </view>
  196. <view class="jindu-zxl">{{item.zxl==null?0:item.zxl}}</view>
  197. </view>
  198. </view>
  199. </view>
  200. </view> -->
  201. <view style="width: 100%;height: 20rpx;background: #FAFAFA;"></view>
  202. <view class="single">
  203. <view class="title" style="padding-right: 30rpx;">
  204. <view class="title1" style="flex: 1;">销讲能力</view>
  205. <view class="title2" style="flex: 1;justify-content: flex-end;" @click="goTeam">
  206. <view class="title2-che">团队
  207. <image class="righttochoose" src="../../../static/images/righttochoose.png" mode=""></image>
  208. </view>
  209. </view>
  210. </view>
  211. <view class="uchaserbox uchaserboxs">
  212. <qiun-data-charts
  213. type="radar"
  214. :opts="opts"
  215. :chartData="chartData1"
  216. :canvas2d="true"
  217. canvasId="wangxiaohuaerlingeryilingwuyib88"
  218. background="none"
  219. />
  220. </view>
  221. </view>
  222. <view style="width: 100%;height: 20rpx;background: #FAFAFA;"></view>
  223. <!-- <view class="single">
  224. <view class="title">
  225. <view class="title1" style="flex: 1;">禁忌执行率</view>
  226. <view class="title3" style="flex: 1;">
  227. <view class="title3-box" @click="tabtimetap4(0)">
  228. <view style="height: 42rpx;" :class="{ activecltab: eharTab.active4 == 0 }">排名</view>
  229. </view>
  230. <view class="title3-box" @click="tabtimetap4(1)">
  231. <view style="height: 42rpx;" :class="{ activecltab: eharTab.active4 == 1 }">趋势</view>
  232. </view>
  233. <view class="title3-box">
  234. <view style="height: 42rpx;" :class="{ activecltab: activeTotal2 == 2 }">表格</view>
  235. </view>
  236. </view>
  237. </view>
  238. <view class="hejibox">
  239. <view class="heji">{{!staff1.value?'团队':staff1.label}}:{{newTeam4||0}}</view>
  240. <view class="heji">{{!staff2.value?'均值':staff2.label}}:{{newAvg4||0}}</view>
  241. </view>
  242. <view class="" v-if=" eharTab.active4 == 1 ">
  243. <view class="danwei">来访(人)</view>
  244. <view class="uchaserbox">
  245. <qiun-data-charts
  246. type="line"
  247. :chartData="lineOptsect4"
  248. background="none"
  249. :ontouch="true"
  250. canvasId="wangxiaohuaerlingeryilingwuyi"
  251. :canvas2d="true"
  252. />
  253. </view>
  254. </view>
  255. <view class="jindu" v-if=" eharTab.active4 == 0 ">
  256. <view class="jindu-box" v-for="(item,index) in newlisttabinfo4" :key="index">
  257. <view class="jindu-boxche">
  258. <view class="jindu-name">{{item.name.substring(0, 4)}}</view>
  259. <view style="width: 440rpx;margin-left: 10rpx;">
  260. <u-line-progress height="24" :show-percent="false" active-color="#FBA448" :percent="item.zxl"></u-line-progress>
  261. </view>
  262. <view class="jindu-zxl">{{item.zxl==null?0:item.zxl}}</view>
  263. </view>
  264. </view>
  265. </view>
  266. </view> -->
  267. <!-- <view style="width: 100%;height: 20rpx;background: #FAFAFA;"></view> -->
  268. <!-- <view class="single">
  269. <view class="title" style="padding-right: 30rpx;">
  270. <view class="title1" style="flex: 1;">违禁能力(TOP10)</view>
  271. <view class="title2" style="flex: 1;justify-content: flex-end;">
  272. <view class="title2-che">项目
  273. <image class="righttochoose" src="../../../static/images/righttochoose.png" mode=""></image>
  274. </view>
  275. </view>
  276. </view>
  277. <view class="hejibox">
  278. <view class="heji">合计:50</view>
  279. <view class="heji">均值:25</view>
  280. </view>
  281. <view class="uchaserbox">
  282. <qiun-data-charts
  283. type="radar"
  284. :chartData="chartData"
  285. :canvas2d="true"
  286. canvasId="wangxiaohuaerlingeryilingwuyib89"
  287. background="none"
  288. />
  289. </view>
  290. </view> -->
  291. <u-calendar v-model="totalTimeShow" mode="range" @change="totalTimeChange"></u-calendar>
  292. <!-- 选择部门的选择框 -->
  293. <u-select v-model="staffShow" :list="staffList" @confirm="staffSelectCallback" :default-value='selindex'></u-select>
  294. <u-select v-model="staffShow1" :list="staffList1" @confirm="staffSelectCallback" :default-value='selindex'></u-select>
  295. </view>
  296. </template>
  297. <script>
  298. var app = getApp();
  299. var util = require("../../../utils/util.js");
  300. var config = require("../../../config");
  301. export default {
  302. data() {
  303. return {
  304. activeTotal: 4,
  305. eharTab:{
  306. active1: 0,
  307. active2:0,
  308. active3:0,
  309. active4:0,
  310. },
  311. deptids:'',
  312. bocindex:0,
  313. timepickpickisshow:false,
  314. totalTimeShow: false,
  315. // 项目id
  316. houseId:'',
  317. staffList:[],
  318. staffList1:[],
  319. staffShow:false,
  320. staffShow1:false,
  321. staff1:{
  322. value:'',
  323. label:''
  324. },
  325. staff2:{
  326. value:'',
  327. label:'平均'
  328. },
  329. lastStartDate:'',
  330. lastEndDate :'',
  331. selindex:[0],
  332. choseStaffFlag:false,
  333. lineOptsect1:{
  334. "categories": ["2016","2017","2018","2019","2020","2021"],
  335. "series": [
  336. {
  337. "name": "成交量1",
  338. "data": [35,8,25,37,4,20]
  339. },
  340. {
  341. "name": "成交量2",
  342. "data": [40,18,45,44,10,60]
  343. }
  344. ]
  345. },
  346. lineOptsect2:{
  347. "categories": ["2016","2017","2018","2019","2020","2021"],
  348. "series": [
  349. {
  350. "name": "成交量1",
  351. "data": [35,8,25,37,4,20]
  352. },
  353. {
  354. "name": "成交量2",
  355. "data": [40,18,45,44,10,60]
  356. }
  357. ]
  358. },
  359. lineOptsect3:{
  360. "categories": ["2016","2017","2018","2019","2020","2021"],
  361. "series": [
  362. {
  363. "name": "成交量1",
  364. "data": [35,8,25,37,4,20]
  365. },
  366. {
  367. "name": "成交量2",
  368. "data": [40,18,45,44,10,60]
  369. }
  370. ]
  371. },
  372. lineOptsect4:{
  373. "categories": ["2016","2017","2018","2019","2020","2021"],
  374. "series": [
  375. {
  376. "name": "成交量1",
  377. "data": [35,8,25,37,4,20]
  378. },
  379. {
  380. "name": "成交量2",
  381. "data": [40,18,45,44,10,60]
  382. }
  383. ]
  384. },
  385. newlisttabinfo1:[
  386. {name:'接待量',zxl:'10'},
  387. {name:'平均执行率',zxl:'50'},
  388. {name:'接待客户',zxl:'80'},
  389. ],
  390. newlisttabinfo2:[
  391. {name:'接待量',zxl:'10'},
  392. {name:'平均执行率',zxl:'50'},
  393. {name:'接待客户',zxl:'80'},
  394. ],
  395. newlisttabinfo3:[
  396. {name:'接待量',zxl:'10'},
  397. {name:'平均执行率',zxl:'50'},
  398. {name:'接待客户',zxl:'80'},
  399. ],
  400. newlisttabinfo4:[
  401. {name:'接待量',zxl:'10'},
  402. {name:'平均执行率',zxl:'50'},
  403. {name:'接待客户',zxl:'80'},
  404. ],
  405. newTeam1:'',
  406. newAvg1:'',
  407. newTeam2:'',
  408. newAvg2:'',
  409. newTeam3:'',
  410. newAvg3:'',
  411. newTeam4:'',
  412. newAvg4:'',
  413. chartData1:{
  414. "categories": ["维度1","维度2","维度3","维度4","维度5","维度6"],
  415. "series": [
  416. {
  417. "name": "成交量",
  418. "data": [90,110,165,195,187,172]
  419. }
  420. ]
  421. },
  422. chartData2:{
  423. "categories": ["维度1","维度2","维度3","维度4","维度5","维度6"],
  424. "series": [
  425. {
  426. "name": "成交量",
  427. "data": [90,110,165,195,187,172]
  428. }
  429. ]
  430. },
  431. opts: {
  432. fontSize: 10,
  433. extra: {
  434. radar: {
  435. max: ''
  436. }
  437. }
  438. }
  439. };
  440. },
  441. onLoad() {
  442. let that=this
  443. uni.$on('update',function(data){
  444. // console.log(data)
  445. that.deptids=data.arr.join(',')
  446. // 获取销奖能力
  447. that.getPowerList()
  448. })
  449. // 获取项目id
  450. this.houseId = uni.getStorageSync('buildingID').id;
  451. // this.buildingname = uni.getStorageSync('buildingID').name;
  452. // 请求接口获取所有置业顾问员工的列表
  453. this.getSectionList()
  454. },
  455. onPullDownRefresh() {
  456. let that=this
  457. uni.$on('update',function(data){
  458. // console.log(data)
  459. that.deptids=data.arr.join(',')
  460. // 获取销奖能力
  461. that.getPowerList()
  462. })
  463. // 获取项目id
  464. this.houseId = uni.getStorageSync('buildingID').id;
  465. // this.buildingname = uni.getStorageSync('buildingID').name;
  466. // 请求接口获取所有置业顾问员工的列表
  467. this.getSectionList()
  468. setTimeout(function () {
  469. uni.stopPullDownRefresh();
  470. }, 1000);
  471. },
  472. methods: {
  473. //是否对比
  474. checkboxChange(){
  475. this.timepickpickisshow=!this.timepickpickisshow;
  476. this.staff2.label='平均'
  477. this.staff2.value=''
  478. // 团队对比接待量
  479. this.receptionCountList(this.eharTab.active1,1,'/cusLvStatistics/teamAnalysisReception')
  480. // 团队对比接待时长
  481. this.receptionCountList(this.eharTab.active2,2,'/cusLvStatistics/teamAnalysisReceptionTime')
  482. /* 销奖执行率 */
  483. this.receptionCountList(this.eharTab.active3,3,'/cusLvStatistics/teamAnalysisExecutionRate')
  484. // 获取销奖能力
  485. this.getPowerList()
  486. },
  487. // 获取部门列表
  488. getSectionList(){
  489. this.$u.post('/cusLvStatistics/findAllDeptIdByHouseId',{houseId:this.houseId})
  490. .then(res=>{
  491. this.staffList=[]
  492. this.staffList1=[]
  493. res.map(item=>{
  494. let obj={}
  495. obj.value=item.deptId
  496. obj.label=item.deptName
  497. this.staffList.push(obj)
  498. })
  499. this.staffList1=[...this.staffList]
  500. this.staffList.unshift({
  501. value:'',
  502. label:'全部'
  503. })
  504. this.staffList1.unshift({
  505. value:'',
  506. label:'平均'
  507. })
  508. this.staff1=this.staffList[0]
  509. // 团队对比接待量
  510. this.receptionCountList(0,1,'/cusLvStatistics/teamAnalysisReception')
  511. // 团队对比接待时长
  512. this.receptionCountList(0,2,'/cusLvStatistics/teamAnalysisReceptionTime')
  513. /* 销奖执行率 */
  514. this.receptionCountList(0,3,'/cusLvStatistics/teamAnalysisExecutionRate')
  515. // 获取销奖能力
  516. this.getPowerList()
  517. })
  518. },
  519. // 点击部门对比
  520. chiocStaff(idx){
  521. if(idx==0){
  522. // 当选择了第一个的时候
  523. this.choseStaffFlag=false
  524. this.staffShow=true
  525. }else{
  526. this.choseStaffFlag=true
  527. this.staffShow1=true
  528. }
  529. },
  530. //时间切换
  531. tabtimetap(index) {
  532. if (index == 3) {
  533. this.totalTimeShow = true;
  534. } else {
  535. this.activeTotal = index;
  536. this.lastEndDate=''
  537. this.lastStartDate=''
  538. // 获取数据
  539. // 团队对比接待量
  540. this.receptionCountList(this.eharTab.active1,1,'/cusLvStatistics/teamAnalysisReception')
  541. // 团队对比接待时长
  542. this.receptionCountList(this.eharTab.active2,2,'/cusLvStatistics/teamAnalysisReceptionTime')
  543. /* 销奖执行率 */
  544. this.receptionCountList(this.eharTab.active3,3,'/cusLvStatistics/teamAnalysisExecutionRate')
  545. // 获取销奖能力
  546. this.getPowerList()
  547. }
  548. },
  549. // 接待量
  550. tabtimetap1(idx){
  551. this.eharTab.active1=idx
  552. // 调用方法
  553. this.receptionCountList(idx,1,'/cusLvStatistics/teamAnalysisReception')
  554. },
  555. // 接待时长
  556. tabtimetap2(idx){
  557. this.eharTab.active2=idx
  558. // 调用方法
  559. this.receptionCountList(idx,2,'/cusLvStatistics/teamAnalysisReceptionTime')
  560. },
  561. tabtimetap3(idx){
  562. this.eharTab.active3=idx
  563. // 调用方法
  564. this.receptionCountList(idx,3,'/cusLvStatistics/teamAnalysisExecutionRate')
  565. },
  566. tabtimetap4(idx){
  567. this.eharTab.active4=idx
  568. // 调用方法
  569. // this.getRecordList()
  570. },
  571. //自定义时间
  572. totalTimeChange(e) {
  573. console.log(e.startDate, e.endDate)
  574. this.activeTotal=3;
  575. this.lastEndDate=e.endDate
  576. this.lastStartDate=e.startDate
  577. // 获取数据
  578. // 团队对比接待量
  579. this.receptionCountList(this.eharTab.active1,1,'/cusLvStatistics/teamAnalysisReception')
  580. // 团队对比接待时长
  581. this.receptionCountList(this.eharTab.active2,2,'/cusLvStatistics/teamAnalysisReceptionTime')
  582. /* 销奖执行率 */
  583. this.receptionCountList(this.eharTab.active3,3,'/cusLvStatistics/teamAnalysisExecutionRate')
  584. // 获取销奖能力
  585. this.getPowerList()
  586. },
  587. //指标执行率分析tab
  588. tapspagek2(index) {
  589. this.bocindex = index;
  590. },
  591. //集团对比
  592. Groupcontrast(){
  593. uni.navigateTo({
  594. url: '/pages/center/Piabodata/Groupcontrast'
  595. });
  596. },
  597. // 去选择团队
  598. goTeam(){
  599. uni.navigateTo({
  600. url:`/pages/center/Piabodata/selectTeam?ids=${this.deptids}`
  601. })
  602. },
  603. staffSelectCallback(e){
  604. if(this.choseStaffFlag){
  605. // 第二个客户
  606. // console.log(e,'第二个')
  607. this.staff2=e[0]
  608. }else{
  609. // 第一个客户
  610. // console.log(e,'第一个')
  611. // 当选择全部时
  612. if(!e.value){
  613. this.timepickpickisshow=false
  614. this.staff2.label='平均'
  615. this.staff2.value=''
  616. }
  617. this.staff1=e[0]
  618. }
  619. if(this.staff1.label==this.staff2.label){
  620. uni.showToast({
  621. title:'请勿选择重复',
  622. icon:'none'
  623. })
  624. this.staff2.label='请选择'
  625. // this.staff2.label='平均'
  626. // this.staff2.value=''
  627. return
  628. }else{
  629. // 获取数据
  630. // 团队对比接待量
  631. this.receptionCountList(this.eharTab.active1,1,'/cusLvStatistics/teamAnalysisReception')
  632. // 团队对比接待时长
  633. this.receptionCountList(this.eharTab.active2,2,'/cusLvStatistics/teamAnalysisReceptionTime')
  634. /* 销奖执行率 */
  635. this.receptionCountList(this.eharTab.active3,3,'/cusLvStatistics/teamAnalysisExecutionRate')
  636. // 获取销奖能力
  637. this.getPowerList()
  638. }
  639. },
  640. // 团队对比接待量
  641. // receptionCountList(idx){
  642. // this.$u.post('/cusLvStatistics/teamAnalysisReception',{
  643. // // userA:this.staff1.value,
  644. // // userB:this.staff2.value,
  645. // deptIds:[this.staff1.value,this.staff2.value].filter(item=>item).join(','),
  646. // showRank:idx,
  647. // houseId:this.houseId,
  648. // timeType:this.lastEndDate?null:this.activeTotal+'',
  649. // lastEndDate:this.lastEndDate,
  650. // lastStartDate:this.lastStartDate
  651. // })
  652. // .then(res=>{
  653. // // console.log(res)
  654. // let result=res.result
  655. // this.newTeam=res.avg[0]
  656. // this.newAvg=res.avg[1]
  657. // if(idx==0){
  658. // // 当选择的是牌名时
  659. // // 处理数据
  660. // // 先处理牌名数据,需要进行判断全部还是单个
  661. // // 当为全部时
  662. // this.newlisttabinfo=[]
  663. // // 当选择全部时
  664. // if(!this.staff1.value&&!this.staff2.value){
  665. // // console.log(1)
  666. // result[0].map(item=>{
  667. // let obj={}
  668. // obj.name=item.deptName
  669. // obj.zxl=item.receptionCount
  670. // this.newlisttabinfo.push(obj)
  671. // })
  672. // }
  673. // // 当选择只有一个时
  674. // else if(this.staff1.value&&!this.staff2.value){
  675. // // console.log(2)
  676. // result[0].map(item=>{
  677. // let obj={}
  678. // obj.name=item.deptName
  679. // obj.zxl=item.receptionCount
  680. // this.newlisttabinfo.push(obj)
  681. // })
  682. // // 判断是否显示平均
  683. // // 如果显示对比
  684. // if(this.timepickpickisshow){
  685. // result[1].map(item=>{
  686. // let obj={}
  687. // obj.name='平均'
  688. // obj.zxl=item.receptionCount
  689. // this.newlisttabinfo.push(obj)
  690. // })
  691. // }
  692. // }else{
  693. // // console.log(3)
  694. // // 当两个都选择的时候
  695. // result[0].map(item=>{
  696. // let obj={}
  697. // obj.name=item.deptName
  698. // obj.zxl=item.receptionCount
  699. // this.newlisttabinfo.push(obj)
  700. // })
  701. // result[1].map(item=>{
  702. // let obj={}
  703. // obj.name=item.deptName
  704. // obj.zxl=item.receptionCount
  705. // this.newlisttabinfo.push(obj)
  706. // })
  707. // }
  708. // }else{
  709. // // 当选择趋势时
  710. // // this.lineOptsect={
  711. // // categories:[],
  712. // // series:[]
  713. // // }
  714. // let allobj={
  715. // categories:[],
  716. // series:[]
  717. // }
  718. // // 先处理时间
  719. // // 当选择全部时
  720. // if(!this.staff1.value&&!this.staff2.value){
  721. // // console.log(1)
  722. // result.map((item,idx)=>{
  723. // let obj={}
  724. // obj.name=item[0].deptName
  725. // obj.data=[]
  726. // item.map(item1=>{
  727. // // 时间的处理
  728. // if(idx==0){
  729. // allobj.categories.push(item1.statDate.slice(5,10))
  730. // }
  731. // obj.data.push(item1.receptionCount)
  732. // })
  733. // allobj.series.push(obj)
  734. // })
  735. // }
  736. // // 当选择只有一个时
  737. // else if(this.staff1.value&&!this.staff2.value){
  738. // // console.log(2)
  739. // let obj={}
  740. // obj.data=[]
  741. // obj.name=result[0][0].deptName
  742. // result[0].map(item=>{
  743. // allobj.categories.push(item.statDate.slice(5,10))
  744. // obj.data.push(item.receptionCount)
  745. // })
  746. // allobj.series.push(obj)
  747. // // 判断是否显示平均
  748. // // 如果显示对比
  749. // if(this.timepickpickisshow){
  750. // let obj={}
  751. // obj.data=[]
  752. // obj.name='平均'
  753. // result[1].map(item=>{
  754. // obj.data.push(item.receptionCount)
  755. // })
  756. // allobj.series.push(obj)
  757. // }
  758. // }else{
  759. // // console.log(3)
  760. // // 当两个都选择的时候
  761. // let obj={}
  762. // let obj1={}
  763. // obj.data=[]
  764. // obj1.data=[]
  765. // obj.name=result[0][0].deptName
  766. // obj1.name=result[1][0].deptName
  767. // result[0].map(item=>{
  768. // allobj.categories.push(item.statDate.slice(5,10))
  769. // obj.data.push(item.receptionCount)
  770. // })
  771. // result[1].map(item=>{
  772. // obj1.data.push(item.receptionCount)
  773. // })
  774. // allobj.series.push(obj)
  775. // allobj.series.push(obj1)
  776. // }
  777. // this.lineOptsect=allobj
  778. // }
  779. // })
  780. // },
  781. // 接待时长
  782. receptionCountList(idx,index,url){
  783. this.$u.post(url,{
  784. // userA:this.staff1.value,
  785. // userB:this.staff2.value,
  786. deptIds:[this.staff1.value,this.staff2.value].filter(item=>item).join(','),
  787. showRank:idx,
  788. houseId:this.houseId,
  789. timeType:this.lastEndDate?null:this.activeTotal+'',
  790. lastEndDate:this.lastEndDate,
  791. lastStartDate:this.lastStartDate
  792. })
  793. .then(res=>{
  794. // console.log(res)
  795. let result=res.result
  796. this['newTeam'+index]=res.avg[0]
  797. this['newAvg'+index]=res.avg[1]
  798. if(idx==0){
  799. // 当选择的是牌名时
  800. // 处理数据
  801. // 先处理牌名数据,需要进行判断全部还是单个
  802. // 当为全部时
  803. this['newlisttabinfo'+index]=[]
  804. let arr=[]
  805. // 当选择全部时
  806. if(!this.staff1.value&&!this.staff2.value){
  807. // console.log(1)
  808. result[0].map(item=>{
  809. let obj={}
  810. obj.name=item.deptName
  811. obj.zxl=item.data
  812. arr.push(obj)
  813. })
  814. arr=this.dealData(arr)
  815. this['newlisttabinfo'+index]=arr
  816. }
  817. // 当选择只有一个时
  818. else if(this.staff1.value&&!this.staff2.value){
  819. // console.log(2)
  820. result[0].map(item=>{
  821. let obj={}
  822. obj.name=item.deptName
  823. obj.zxl=item.data
  824. arr.push(obj)
  825. })
  826. // 判断是否显示平均
  827. // 如果显示对比
  828. if(this.timepickpickisshow){
  829. result[1].map(item=>{
  830. let obj={}
  831. obj.name='平均'
  832. obj.zxl=item.data
  833. arr.push(obj)
  834. })
  835. }
  836. arr=this.dealData(arr)
  837. this['newlisttabinfo'+index]=arr
  838. }else{
  839. // console.log(3)
  840. // 当两个都选择的时候
  841. result[0].map(item=>{
  842. let obj={}
  843. obj.name=item.deptName
  844. obj.zxl=item.data
  845. arr.push(obj)
  846. })
  847. result[1].map(item=>{
  848. let obj={}
  849. obj.name=item.deptName
  850. obj.zxl=item.data
  851. arr.push(obj)
  852. })
  853. arr=this.dealData(arr)
  854. this['newlisttabinfo'+index]=arr
  855. }
  856. }else{
  857. // 当选择趋势时
  858. this['lineOptsect'+index]={}
  859. let allobj={
  860. categories:[],
  861. series:[]
  862. }
  863. // 先处理时间
  864. // 当选择全部时
  865. if(!this.staff1.value&&!this.staff2.value){
  866. result.map((item,idx)=>{
  867. let obj={}
  868. obj.name=item[0].deptName
  869. obj.data=[]
  870. item.map(item1=>{
  871. // 时间的处理
  872. if(idx==0){
  873. allobj.categories.push(item1.statDate.slice(5,10))
  874. }
  875. obj.data.push(item1.data)
  876. })
  877. allobj.series.push(obj)
  878. })
  879. }
  880. // 当选择只有一个时
  881. else if(this.staff1.value&&!this.staff2.value){
  882. // console.log(2)
  883. let obj={}
  884. obj.data=[]
  885. obj.name=result[0][0].deptName
  886. result[0].map(item=>{
  887. allobj.categories.push(item.statDate.slice(5,10))
  888. obj.data.push(item.data)
  889. })
  890. allobj.series.push(obj)
  891. // 判断是否显示平均
  892. // 如果显示对比
  893. if(this.timepickpickisshow){
  894. let obj={}
  895. obj.data=[]
  896. obj.name='平均'
  897. result[1].map(item=>{
  898. obj.data.push(item.data)
  899. })
  900. allobj.series.push(obj)
  901. }
  902. }else{
  903. // console.log(3)
  904. // 当两个都选择的时候
  905. let obj={}
  906. let obj1={}
  907. obj.data=[]
  908. obj1.data=[]
  909. obj.name=result[0][0].deptName
  910. obj1.name=result[1][0].deptName
  911. result[0].map(item=>{
  912. allobj.categories.push(item.statDate.slice(5,10))
  913. obj.data.push(item.data)
  914. })
  915. result[1].map(item=>{
  916. obj1.data.push(item.data)
  917. })
  918. allobj.series.push(obj)
  919. allobj.series.push(obj1)
  920. }
  921. // console.log(allobj)
  922. // return
  923. // this.lineOptsect1=allobj
  924. this['lineOptsect'+index]=allobj
  925. // this['lineOptsect'+index].series=allobj.series
  926. // this['lineOptsect'+index].categories=allobj.categories
  927. }
  928. })
  929. },
  930. // 获取销奖能力
  931. getPowerList(){
  932. this.$u.post('/cusLvStatistics/teamAnalysisMarketingAbility',{
  933. deptIds:this.deptids||[this.staff1.value,this.staff2.value].filter(item=>item).join(','),
  934. houseId:this.houseId,
  935. timeType:this.lastEndDate?null:this.activeTotal+'',
  936. lastEndDate:this.lastEndDate,
  937. lastStartDate:this.lastStartDate
  938. })
  939. .then(res=>{
  940. // console.log(res)
  941. // 处理数据
  942. this.chartData1={
  943. categories:[],
  944. series:[]
  945. }
  946. let allobj={
  947. categories:[],
  948. series:[]
  949. }
  950. let max = 0;
  951. // 当选择全部时
  952. if(!this.staff1.value&&!this.staff2.value){
  953. // let first=res.first
  954. res.first.map((item,index)=>{
  955. let obj={
  956. name:item[0].deptName,
  957. data:[]
  958. }
  959. item.map((item1)=>{
  960. if(index==0){
  961. allobj.categories.push(item1.name)
  962. }
  963. obj.data.push(item1.avgExecutionRate)
  964. if (max < item1.avgExecutionRate) max = item1.avgExecutionRate;
  965. })
  966. allobj.series.push(obj)
  967. })
  968. }
  969. // 当选择只有一个时
  970. else if(this.staff1.value&&!this.staff2.value){
  971. res.first.map((item,index)=>{
  972. let obj={
  973. name:item[0].deptName,
  974. data:[]
  975. }
  976. item.map((item1)=>{
  977. if(index==0){
  978. allobj.categories.push(item1.name)
  979. }
  980. obj.data.push(item1.avgExecutionRate)
  981. if (max < item1.avgExecutionRate) max = item1.avgExecutionRate;
  982. })
  983. allobj.series.push(obj)
  984. })
  985. // 判断是否显示平均
  986. // 如果显示对比
  987. if(this.timepickpickisshow){
  988. res.second.map((item,index)=>{
  989. let obj={
  990. name:'平均',
  991. data:[]
  992. }
  993. item.map((item1)=>{
  994. obj.data.push(item1.avgExecutionRate)
  995. })
  996. allobj.series.push(obj)
  997. })
  998. }
  999. }else{
  1000. // console.log(3)
  1001. // 当两个都选择的时候
  1002. res.first.map((item,index)=>{
  1003. let obj={
  1004. name:item[0].deptName,
  1005. data:[]
  1006. }
  1007. item.map((item1)=>{
  1008. if(index==0){
  1009. allobj.categories.push(item1.name)
  1010. }
  1011. obj.data.push(item1.avgExecutionRate)
  1012. if (max < item1.avgExecutionRate) max = item1.avgExecutionRate;
  1013. })
  1014. allobj.series.push(obj)
  1015. })
  1016. }
  1017. this.opts.extra.radar.max = max +25
  1018. // console.log(allobj)
  1019. this.chartData1=allobj
  1020. this.$forceUpdate()
  1021. })
  1022. },
  1023. // 定义一个公共方法对数据进行处理
  1024. dealData(arr){
  1025. // 获取最大值
  1026. let num=Math.max.apply(Math, arr.map(function (o) { return o.zxl })) //结果:3
  1027. // console.log(num)
  1028. if(num>100){
  1029. // 获取最大值的下标
  1030. // let idx=arr.findIndex(item=>item.zxl==num)
  1031. // console.log(idx,123)
  1032. arr.map(item=>{
  1033. item.zxl1=Math.floor(item.zxl/num*100)
  1034. })
  1035. // console.log(arr)
  1036. return arr
  1037. }else{
  1038. arr.map(item=>{
  1039. item.zxl1=item.zxl
  1040. })
  1041. return arr
  1042. }
  1043. },
  1044. }
  1045. };
  1046. </script>
  1047. <style lang="scss" scoped>
  1048. .uchaserboxs {
  1049. width: 100%;
  1050. height: 70vh;
  1051. }
  1052. .box {
  1053. width: 100%;
  1054. height: 100%;
  1055. background: #FAFAFA;
  1056. padding-bottom: 60rpx;
  1057. }
  1058. // 对比时间切换
  1059. .timepick{
  1060. width: 100%;
  1061. height: 90rpx;
  1062. display: flex;
  1063. align-items: center;
  1064. background: #FAFAFA;
  1065. }
  1066. .timepicktime{
  1067. width: 260rpx;
  1068. height: 50rpx;
  1069. border: 1rpx solid #E0E0E0;
  1070. margin-left: 30rpx;
  1071. display: flex;
  1072. background: #FFFFFF;
  1073. }
  1074. .timepicktime>view:nth-of-type(1){
  1075. width: 210rpx;
  1076. height: 100%;
  1077. line-height: 50rpx;
  1078. font-size: 26rpx;
  1079. font-weight: 400;
  1080. text-align: center;
  1081. }
  1082. .timepicktime>view:nth-of-type(2){
  1083. width: 49rpx;
  1084. height: 100%;
  1085. // border-left: 1px solid #E0E0E0;
  1086. }
  1087. .timepickpick{
  1088. width: 110rpx;
  1089. height: 50rpx;
  1090. margin-left: 30rpx;
  1091. display: flex;
  1092. align-items: center;
  1093. }
  1094. .Underimg{
  1095. width: 50rpx;
  1096. height:50rpx;
  1097. margin-top: -2rpx;
  1098. }
  1099. </style>