AI营销辅助 普强使用
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.
 
 
 

1121 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" style="height: 70vh;">
  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. // this.buildingname = uni.getStorageSync('buildingID').name;
  464. // 请求接口获取所有置业顾问员工的列表
  465. this.getSectionList()
  466. setTimeout(function () {
  467. uni.stopPullDownRefresh();
  468. }, 1000);
  469. },
  470. methods: {
  471. //是否对比
  472. checkboxChange(){
  473. this.timepickpickisshow=!this.timepickpickisshow;
  474. this.staff2.label='平均'
  475. this.staff2.value=''
  476. // 团队对比接待量
  477. this.receptionCountList(this.eharTab.active1,1,'/cusLvStatistics/teamAnalysisReception')
  478. // 团队对比接待时长
  479. this.receptionCountList(this.eharTab.active2,2,'/cusLvStatistics/teamAnalysisReceptionTime')
  480. /* 销奖执行率 */
  481. this.receptionCountList(this.eharTab.active3,3,'/cusLvStatistics/teamAnalysisExecutionRate')
  482. // 获取销奖能力
  483. this.getPowerList()
  484. },
  485. // 获取部门列表
  486. getSectionList(){
  487. this.$u.post('/cusLvStatistics/findAllDeptIdByHouseId',{houseId:this.houseId})
  488. .then(res=>{
  489. this.staffList=[]
  490. this.staffList1=[]
  491. res.map(item=>{
  492. let obj={}
  493. obj.value=item.deptId
  494. obj.label=item.deptName
  495. this.staffList.push(obj)
  496. })
  497. this.staffList1=[...this.staffList]
  498. this.staffList.unshift({
  499. value:'',
  500. label:'全部'
  501. })
  502. this.staffList1.unshift({
  503. value:'',
  504. label:'平均'
  505. })
  506. this.staff1=this.staffList[0]
  507. // 团队对比接待量
  508. this.receptionCountList(0,1,'/cusLvStatistics/teamAnalysisReception')
  509. // 团队对比接待时长
  510. this.receptionCountList(0,2,'/cusLvStatistics/teamAnalysisReceptionTime')
  511. /* 销奖执行率 */
  512. this.receptionCountList(0,3,'/cusLvStatistics/teamAnalysisExecutionRate')
  513. // 获取销奖能力
  514. this.getPowerList()
  515. })
  516. },
  517. // 点击部门对比
  518. chiocStaff(idx){
  519. if(idx==0){
  520. // 当选择了第一个的时候
  521. this.choseStaffFlag=false
  522. this.staffShow=true
  523. }else{
  524. this.choseStaffFlag=true
  525. this.staffShow1=true
  526. }
  527. },
  528. //时间切换
  529. tabtimetap(index) {
  530. if (index == 3) {
  531. this.totalTimeShow = true;
  532. } else {
  533. this.activeTotal = index;
  534. this.lastEndDate=''
  535. this.lastStartDate=''
  536. // 获取数据
  537. // 团队对比接待量
  538. this.receptionCountList(this.eharTab.active1,1,'/cusLvStatistics/teamAnalysisReception')
  539. // 团队对比接待时长
  540. this.receptionCountList(this.eharTab.active2,2,'/cusLvStatistics/teamAnalysisReceptionTime')
  541. /* 销奖执行率 */
  542. this.receptionCountList(this.eharTab.active3,3,'/cusLvStatistics/teamAnalysisExecutionRate')
  543. // 获取销奖能力
  544. this.getPowerList()
  545. }
  546. },
  547. // 接待量
  548. tabtimetap1(idx){
  549. this.eharTab.active1=idx
  550. // 调用方法
  551. this.receptionCountList(idx,1,'/cusLvStatistics/teamAnalysisReception')
  552. },
  553. // 接待时长
  554. tabtimetap2(idx){
  555. this.eharTab.active2=idx
  556. // 调用方法
  557. this.receptionCountList(idx,2,'/cusLvStatistics/teamAnalysisReceptionTime')
  558. },
  559. tabtimetap3(idx){
  560. this.eharTab.active3=idx
  561. // 调用方法
  562. this.receptionCountList(idx,3,'/cusLvStatistics/teamAnalysisExecutionRate')
  563. },
  564. tabtimetap4(idx){
  565. this.eharTab.active4=idx
  566. // 调用方法
  567. // this.getRecordList()
  568. },
  569. //自定义时间
  570. totalTimeChange(e) {
  571. console.log(e.startDate, e.endDate)
  572. this.activeTotal=3;
  573. this.lastEndDate=e.endDate
  574. this.lastStartDate=e.startDate
  575. // 获取数据
  576. // 团队对比接待量
  577. this.receptionCountList(this.eharTab.active1,1,'/cusLvStatistics/teamAnalysisReception')
  578. // 团队对比接待时长
  579. this.receptionCountList(this.eharTab.active2,2,'/cusLvStatistics/teamAnalysisReceptionTime')
  580. /* 销奖执行率 */
  581. this.receptionCountList(this.eharTab.active3,3,'/cusLvStatistics/teamAnalysisExecutionRate')
  582. // 获取销奖能力
  583. this.getPowerList()
  584. },
  585. //指标执行率分析tab
  586. tapspagek2(index) {
  587. this.bocindex = index;
  588. },
  589. //集团对比
  590. Groupcontrast(){
  591. uni.navigateTo({
  592. url: '/pages/center/Piabodata/Groupcontrast'
  593. });
  594. },
  595. // 去选择团队
  596. goTeam(){
  597. uni.navigateTo({
  598. url:`/pages/center/Piabodata/selectTeam?ids=${this.deptids}`
  599. })
  600. },
  601. staffSelectCallback(e){
  602. if(this.choseStaffFlag){
  603. // 第二个客户
  604. // console.log(e,'第二个')
  605. this.staff2=e[0]
  606. }else{
  607. // 第一个客户
  608. // console.log(e,'第一个')
  609. // 当选择全部时
  610. if(!e.value){
  611. this.timepickpickisshow=false
  612. this.staff2.label='平均'
  613. this.staff2.value=''
  614. }
  615. this.staff1=e[0]
  616. }
  617. if(this.staff1.label==this.staff2.label){
  618. uni.showToast({
  619. title:'请勿选择重复',
  620. icon:'none'
  621. })
  622. this.staff2.label='请选择'
  623. // this.staff2.label='平均'
  624. // this.staff2.value=''
  625. return
  626. }else{
  627. // 获取数据
  628. // 团队对比接待量
  629. this.receptionCountList(this.eharTab.active1,1,'/cusLvStatistics/teamAnalysisReception')
  630. // 团队对比接待时长
  631. this.receptionCountList(this.eharTab.active2,2,'/cusLvStatistics/teamAnalysisReceptionTime')
  632. /* 销奖执行率 */
  633. this.receptionCountList(this.eharTab.active3,3,'/cusLvStatistics/teamAnalysisExecutionRate')
  634. // 获取销奖能力
  635. this.getPowerList()
  636. }
  637. },
  638. // 团队对比接待量
  639. // receptionCountList(idx){
  640. // this.$u.post('/cusLvStatistics/teamAnalysisReception',{
  641. // // userA:this.staff1.value,
  642. // // userB:this.staff2.value,
  643. // deptIds:[this.staff1.value,this.staff2.value].filter(item=>item).join(','),
  644. // showRank:idx,
  645. // houseId:this.houseId,
  646. // timeType:this.lastEndDate?null:this.activeTotal+'',
  647. // lastEndDate:this.lastEndDate,
  648. // lastStartDate:this.lastStartDate
  649. // })
  650. // .then(res=>{
  651. // // console.log(res)
  652. // let result=res.result
  653. // this.newTeam=res.avg[0]
  654. // this.newAvg=res.avg[1]
  655. // if(idx==0){
  656. // // 当选择的是牌名时
  657. // // 处理数据
  658. // // 先处理牌名数据,需要进行判断全部还是单个
  659. // // 当为全部时
  660. // this.newlisttabinfo=[]
  661. // // 当选择全部时
  662. // if(!this.staff1.value&&!this.staff2.value){
  663. // // console.log(1)
  664. // result[0].map(item=>{
  665. // let obj={}
  666. // obj.name=item.deptName
  667. // obj.zxl=item.receptionCount
  668. // this.newlisttabinfo.push(obj)
  669. // })
  670. // }
  671. // // 当选择只有一个时
  672. // else if(this.staff1.value&&!this.staff2.value){
  673. // // console.log(2)
  674. // result[0].map(item=>{
  675. // let obj={}
  676. // obj.name=item.deptName
  677. // obj.zxl=item.receptionCount
  678. // this.newlisttabinfo.push(obj)
  679. // })
  680. // // 判断是否显示平均
  681. // // 如果显示对比
  682. // if(this.timepickpickisshow){
  683. // result[1].map(item=>{
  684. // let obj={}
  685. // obj.name='平均'
  686. // obj.zxl=item.receptionCount
  687. // this.newlisttabinfo.push(obj)
  688. // })
  689. // }
  690. // }else{
  691. // // console.log(3)
  692. // // 当两个都选择的时候
  693. // result[0].map(item=>{
  694. // let obj={}
  695. // obj.name=item.deptName
  696. // obj.zxl=item.receptionCount
  697. // this.newlisttabinfo.push(obj)
  698. // })
  699. // result[1].map(item=>{
  700. // let obj={}
  701. // obj.name=item.deptName
  702. // obj.zxl=item.receptionCount
  703. // this.newlisttabinfo.push(obj)
  704. // })
  705. // }
  706. // }else{
  707. // // 当选择趋势时
  708. // // this.lineOptsect={
  709. // // categories:[],
  710. // // series:[]
  711. // // }
  712. // let allobj={
  713. // categories:[],
  714. // series:[]
  715. // }
  716. // // 先处理时间
  717. // // 当选择全部时
  718. // if(!this.staff1.value&&!this.staff2.value){
  719. // // console.log(1)
  720. // result.map((item,idx)=>{
  721. // let obj={}
  722. // obj.name=item[0].deptName
  723. // obj.data=[]
  724. // item.map(item1=>{
  725. // // 时间的处理
  726. // if(idx==0){
  727. // allobj.categories.push(item1.statDate.slice(5,10))
  728. // }
  729. // obj.data.push(item1.receptionCount)
  730. // })
  731. // allobj.series.push(obj)
  732. // })
  733. // }
  734. // // 当选择只有一个时
  735. // else if(this.staff1.value&&!this.staff2.value){
  736. // // console.log(2)
  737. // let obj={}
  738. // obj.data=[]
  739. // obj.name=result[0][0].deptName
  740. // result[0].map(item=>{
  741. // allobj.categories.push(item.statDate.slice(5,10))
  742. // obj.data.push(item.receptionCount)
  743. // })
  744. // allobj.series.push(obj)
  745. // // 判断是否显示平均
  746. // // 如果显示对比
  747. // if(this.timepickpickisshow){
  748. // let obj={}
  749. // obj.data=[]
  750. // obj.name='平均'
  751. // result[1].map(item=>{
  752. // obj.data.push(item.receptionCount)
  753. // })
  754. // allobj.series.push(obj)
  755. // }
  756. // }else{
  757. // // console.log(3)
  758. // // 当两个都选择的时候
  759. // let obj={}
  760. // let obj1={}
  761. // obj.data=[]
  762. // obj1.data=[]
  763. // obj.name=result[0][0].deptName
  764. // obj1.name=result[1][0].deptName
  765. // result[0].map(item=>{
  766. // allobj.categories.push(item.statDate.slice(5,10))
  767. // obj.data.push(item.receptionCount)
  768. // })
  769. // result[1].map(item=>{
  770. // obj1.data.push(item.receptionCount)
  771. // })
  772. // allobj.series.push(obj)
  773. // allobj.series.push(obj1)
  774. // }
  775. // this.lineOptsect=allobj
  776. // }
  777. // })
  778. // },
  779. // 接待时长
  780. receptionCountList(idx,index,url){
  781. this.$u.post(url,{
  782. // userA:this.staff1.value,
  783. // userB:this.staff2.value,
  784. deptIds:[this.staff1.value,this.staff2.value].filter(item=>item).join(','),
  785. showRank:idx,
  786. houseId:this.houseId,
  787. timeType:this.lastEndDate?null:this.activeTotal+'',
  788. lastEndDate:this.lastEndDate,
  789. lastStartDate:this.lastStartDate
  790. })
  791. .then(res=>{
  792. // console.log(res)
  793. let result=res.result
  794. this['newTeam'+index]=res.avg[0]
  795. this['newAvg'+index]=res.avg[1]
  796. if(idx==0){
  797. // 当选择的是牌名时
  798. // 处理数据
  799. // 先处理牌名数据,需要进行判断全部还是单个
  800. // 当为全部时
  801. this['newlisttabinfo'+index]=[]
  802. let arr=[]
  803. // 当选择全部时
  804. if(!this.staff1.value&&!this.staff2.value){
  805. // console.log(1)
  806. result[0].map(item=>{
  807. let obj={}
  808. obj.name=item.deptName
  809. obj.zxl=item.data
  810. arr.push(obj)
  811. })
  812. arr=this.dealData(arr)
  813. this['newlisttabinfo'+index]=arr
  814. }
  815. // 当选择只有一个时
  816. else if(this.staff1.value&&!this.staff2.value){
  817. // console.log(2)
  818. result[0].map(item=>{
  819. let obj={}
  820. obj.name=item.deptName
  821. obj.zxl=item.data
  822. arr.push(obj)
  823. })
  824. // 判断是否显示平均
  825. // 如果显示对比
  826. if(this.timepickpickisshow){
  827. result[1].map(item=>{
  828. let obj={}
  829. obj.name='平均'
  830. obj.zxl=item.data
  831. arr.push(obj)
  832. })
  833. }
  834. arr=this.dealData(arr)
  835. this['newlisttabinfo'+index]=arr
  836. }else{
  837. // console.log(3)
  838. // 当两个都选择的时候
  839. result[0].map(item=>{
  840. let obj={}
  841. obj.name=item.deptName
  842. obj.zxl=item.data
  843. arr.push(obj)
  844. })
  845. result[1].map(item=>{
  846. let obj={}
  847. obj.name=item.deptName
  848. obj.zxl=item.data
  849. arr.push(obj)
  850. })
  851. arr=this.dealData(arr)
  852. this['newlisttabinfo'+index]=arr
  853. }
  854. }else{
  855. // 当选择趋势时
  856. this['lineOptsect'+index]={}
  857. let allobj={
  858. categories:[],
  859. series:[]
  860. }
  861. // 先处理时间
  862. // 当选择全部时
  863. if(!this.staff1.value&&!this.staff2.value){
  864. result.map((item,idx)=>{
  865. let obj={}
  866. obj.name=item[0].deptName
  867. obj.data=[]
  868. item.map(item1=>{
  869. // 时间的处理
  870. if(idx==0){
  871. allobj.categories.push(item1.statDate.slice(5,10))
  872. }
  873. obj.data.push(item1.data)
  874. })
  875. allobj.series.push(obj)
  876. })
  877. }
  878. // 当选择只有一个时
  879. else if(this.staff1.value&&!this.staff2.value){
  880. // console.log(2)
  881. let obj={}
  882. obj.data=[]
  883. obj.name=result[0][0].deptName
  884. result[0].map(item=>{
  885. allobj.categories.push(item.statDate.slice(5,10))
  886. obj.data.push(item.data)
  887. })
  888. allobj.series.push(obj)
  889. // 判断是否显示平均
  890. // 如果显示对比
  891. if(this.timepickpickisshow){
  892. let obj={}
  893. obj.data=[]
  894. obj.name='平均'
  895. result[1].map(item=>{
  896. obj.data.push(item.data)
  897. })
  898. allobj.series.push(obj)
  899. }
  900. }else{
  901. // console.log(3)
  902. // 当两个都选择的时候
  903. let obj={}
  904. let obj1={}
  905. obj.data=[]
  906. obj1.data=[]
  907. obj.name=result[0][0].deptName
  908. obj1.name=result[1][0].deptName
  909. result[0].map(item=>{
  910. allobj.categories.push(item.statDate.slice(5,10))
  911. obj.data.push(item.data)
  912. })
  913. result[1].map(item=>{
  914. obj1.data.push(item.data)
  915. })
  916. allobj.series.push(obj)
  917. allobj.series.push(obj1)
  918. }
  919. // console.log(allobj)
  920. // return
  921. // this.lineOptsect1=allobj
  922. this['lineOptsect'+index]=allobj
  923. // this['lineOptsect'+index].series=allobj.series
  924. // this['lineOptsect'+index].categories=allobj.categories
  925. }
  926. })
  927. },
  928. // 获取销奖能力
  929. getPowerList(){
  930. this.$u.post('/cusLvStatistics/teamAnalysisMarketingAbility',{
  931. deptIds:this.deptids||[this.staff1.value,this.staff2.value].filter(item=>item).join(','),
  932. houseId:this.houseId,
  933. timeType:this.lastEndDate?null:this.activeTotal+'',
  934. lastEndDate:this.lastEndDate,
  935. lastStartDate:this.lastStartDate
  936. })
  937. .then(res=>{
  938. // console.log(res)
  939. // 处理数据
  940. this.chartData1={
  941. categories:[],
  942. series:[]
  943. }
  944. let allobj={
  945. categories:[],
  946. series:[]
  947. }
  948. let max = 0;
  949. // 当选择全部时
  950. if(!this.staff1.value&&!this.staff2.value){
  951. // let first=res.first
  952. res.first.map((item,index)=>{
  953. let obj={
  954. name:item[0].deptName,
  955. data:[]
  956. }
  957. item.map((item1)=>{
  958. if(index==0){
  959. allobj.categories.push(item1.name)
  960. }
  961. obj.data.push(item1.avgExecutionRate)
  962. if (max < item1.avgExecutionRate) max = item1.avgExecutionRate;
  963. })
  964. allobj.series.push(obj)
  965. })
  966. }
  967. // 当选择只有一个时
  968. else if(this.staff1.value&&!this.staff2.value){
  969. res.first.map((item,index)=>{
  970. let obj={
  971. name:item[0].deptName,
  972. data:[]
  973. }
  974. item.map((item1)=>{
  975. if(index==0){
  976. allobj.categories.push(item1.name)
  977. }
  978. obj.data.push(item1.avgExecutionRate)
  979. if (max < item1.avgExecutionRate) max = item1.avgExecutionRate;
  980. })
  981. allobj.series.push(obj)
  982. })
  983. // 判断是否显示平均
  984. // 如果显示对比
  985. if(this.timepickpickisshow){
  986. res.second.map((item,index)=>{
  987. let obj={
  988. name:'平均',
  989. data:[]
  990. }
  991. item.map((item1)=>{
  992. obj.data.push(item1.avgExecutionRate)
  993. })
  994. allobj.series.push(obj)
  995. })
  996. }
  997. }else{
  998. // console.log(3)
  999. // 当两个都选择的时候
  1000. res.first.map((item,index)=>{
  1001. let obj={
  1002. name:item[0].deptName,
  1003. data:[]
  1004. }
  1005. item.map((item1)=>{
  1006. if(index==0){
  1007. allobj.categories.push(item1.name)
  1008. }
  1009. obj.data.push(item1.avgExecutionRate)
  1010. if (max < item1.avgExecutionRate) max = item1.avgExecutionRate;
  1011. })
  1012. allobj.series.push(obj)
  1013. })
  1014. }
  1015. this.opts.extra.radar.max = max +25
  1016. // console.log(allobj)
  1017. this.chartData1=allobj
  1018. this.$forceUpdate()
  1019. })
  1020. },
  1021. // 定义一个公共方法对数据进行处理
  1022. dealData(arr){
  1023. // 获取最大值
  1024. let num=Math.max.apply(Math, arr.map(function (o) { return o.zxl })) //结果:3
  1025. // console.log(num)
  1026. if(num>100){
  1027. // 获取最大值的下标
  1028. // let idx=arr.findIndex(item=>item.zxl==num)
  1029. // console.log(idx,123)
  1030. arr.map(item=>{
  1031. item.zxl1=Math.floor(item.zxl/num*100)
  1032. })
  1033. // console.log(arr)
  1034. return arr
  1035. }else{
  1036. arr.map(item=>{
  1037. item.zxl1=item.zxl
  1038. })
  1039. return arr
  1040. }
  1041. },
  1042. }
  1043. };
  1044. </script>
  1045. <style lang="scss" scoped>
  1046. .uchaserboxs {
  1047. width: 100%;
  1048. height: 70vh;
  1049. }
  1050. .box {
  1051. width: 100%;
  1052. height: 100%;
  1053. background: #FAFAFA;
  1054. padding-bottom: 60rpx;
  1055. }
  1056. // 对比时间切换
  1057. .timepick{
  1058. width: 100%;
  1059. height: 90rpx;
  1060. display: flex;
  1061. align-items: center;
  1062. background: #FAFAFA;
  1063. }
  1064. .timepicktime{
  1065. width: 260rpx;
  1066. height: 50rpx;
  1067. border: 1rpx solid #E0E0E0;
  1068. margin-left: 30rpx;
  1069. display: flex;
  1070. background: #FFFFFF;
  1071. }
  1072. .timepicktime>view:nth-of-type(1){
  1073. width: 210rpx;
  1074. height: 100%;
  1075. line-height: 50rpx;
  1076. font-size: 26rpx;
  1077. font-weight: 400;
  1078. text-align: center;
  1079. }
  1080. .timepicktime>view:nth-of-type(2){
  1081. width: 49rpx;
  1082. height: 100%;
  1083. // border-left: 1px solid #E0E0E0;
  1084. }
  1085. .timepickpick{
  1086. width: 110rpx;
  1087. height: 50rpx;
  1088. margin-left: 30rpx;
  1089. display: flex;
  1090. align-items: center;
  1091. }
  1092. .Underimg{
  1093. width: 50rpx;
  1094. height:50rpx;
  1095. margin-top: -2rpx;
  1096. }
  1097. </style>