AI销管
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 

592 satır
18 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="single">
  18. <view class="title">
  19. <view class="title1" style="flex: 1;">接待量排名(TOP10)</view>
  20. </view>
  21. <view class="hejisan">
  22. <view class="sanbox1">
  23. <view class="text1-2">{{newlisttabinfo1.total}}</view>
  24. <view class="text1-1">合计接待次数</view>
  25. </view>
  26. <view class="sanbox1">
  27. <view class="text1-2">{{newlisttabinfo1.count}}</view>
  28. <view class="text1-1">顾问人数</view>
  29. </view>
  30. <view class="sanbox1">
  31. <view class="text1-2">{{newlisttabinfo1.avg}}</view>
  32. <view class="text1-1">人均接待次数</view>
  33. </view>
  34. </view>
  35. <view class="jindu" style="margin-top: 20rpx;">
  36. <view v-if="newlisttabinfo1.result.length" class="jindu-box"
  37. v-for="(item,index) in newlisttabinfo1.result" :key="index">
  38. <view class="jindu-boxche">
  39. <view class="jindu-name u-flex" style='width: 170rpx' v-if="item.name">
  40. <image v-if="index==0" class="sort-img" src="/static/images/top1.png" mode="" />
  41. <image v-if="index==1" class="sort-img" src="/static/images/top2.png" mode="" />
  42. <image v-if="index==2" class="sort-img" src="/static/images/top3.png" mode="" />
  43. <view class="sort-number" v-if="index>2">{{index+1}}</view>
  44. {{item.name.substring(0,4)}}
  45. </view>
  46. <view class="progress-cus">
  47. <view class="color1" v-if="index==0" :style="'width:'+ item.zxl||0 + '%'"></view>
  48. <view class="color2" v-if="index==1" :style="'width:'+ getPercent(item.zxl,1) + '%'"></view>
  49. <view class="color3" v-if="index==2" :style="'width:'+ getPercent(item.zxl,1) + '%'"></view>
  50. <view class="color4" v-if="index>2" :style="'width:'+ getPercent(item.zxl,1) + '%'"></view>
  51. </view>
  52. <view class="jindu-zxl">{{item.zxl==null?0:item.zxl}}次</view>
  53. </view>
  54. </view>
  55. <view v-if="newlisttabinfo1.result.length==0" style="width: 100%;text-align: center;margin-top: 60rpx;">
  56. 暂无数据
  57. </view>
  58. </view>
  59. </view>
  60. <view class="single">
  61. <view class="title">
  62. <view class="title1" style="flex: 1;">平均执行率排行(TOP10)</view>
  63. </view>
  64. <view class="hejisan">
  65. <view class="sanbox1" style="width: 40%;">
  66. <view class="text1-2">{{newlisttabinfo3.count}}</view>
  67. <view class="text1-1">顾问人数</view>
  68. </view>
  69. <view class="sanbox1" style="width: 25%;">
  70. <view class="text1-2">{{newlisttabinfo3.avg}}%</view>
  71. <view class="text1-1">人均执行率</view>
  72. </view>
  73. </view>
  74. <view class="jindu" style="margin-top: 20rpx;">
  75. <view v-if="newlisttabinfo3.result.length" class="jindu-box"
  76. v-for="(item,index) in newlisttabinfo3.result" :key="index">
  77. <view class="jindu-boxche">
  78. <view class="jindu-name u-flex" style='width: 170rpx' v-if="item.name">
  79. <image v-if="index==0" class="sort-img" src="/static/images/top1.png" mode="" />
  80. <image v-if="index==1" class="sort-img" src="/static/images/top2.png" mode="" />
  81. <image v-if="index==2" class="sort-img" src="/static/images/top3.png" mode="" />
  82. <view class="sort-number" v-if="index>2">{{index+1}}</view>
  83. {{item.name.substring(0,4)}}
  84. </view>
  85. <!-- <view class="jindu-name" v-if="item.name">{{item.name.substring(0,4)}}</view> -->
  86. <!-- <view class="progress-cus">
  87. <view class="color" :style="'width:'+ item.zxl||0 + '%'" ></view>
  88. </view> -->
  89. <view class="progress-cus">
  90. <view class="color1" v-if="index==0" :style="'width:'+ getPercent1(item.zxl) + '%'"></view>
  91. <view class="color2" v-if="index==1" :style="'width:'+ getPercent1(item.zxl) + '%'"></view>
  92. <view class="color3" v-if="index==2" :style="'width:'+ getPercent1(item.zxl) + '%'"></view>
  93. <view class="color4" v-if="index>2" :style="'width:'+ getPercent1(item.zxl) + '%'"></view>
  94. </view>
  95. <view class="jindu-zxl">{{item.zxl==null?0:item.zxl}}%</view>
  96. </view>
  97. </view>
  98. <view v-if="newlisttabinfo3.result.length==0" style="width: 100%;text-align: center;margin-top: 60rpx;">
  99. 暂无数据
  100. </view>
  101. </view>
  102. </view>
  103. <view class="single">
  104. <view class="title">
  105. <view class="title1" style="flex: 1;">录音时长(TOP10)</view>
  106. </view>
  107. <view class="hejisan">
  108. <view class="sanbox1">
  109. <view class="text1-2">{{newlisttabinfo2.total}}</view>
  110. <view class="text1-1">合计时长/分钟</view>
  111. </view>
  112. <view class="sanbox1">
  113. <view class="text1-2">{{newlisttabinfo2.count}}</view>
  114. <view class="text1-1">顾问人数</view>
  115. </view>
  116. <view class="sanbox1">
  117. <view class="text1-2">{{newlisttabinfo2.avg}}</view>
  118. <view class="text1-1">人均录音时长/分钟</view>
  119. </view>
  120. </view>
  121. <view class="jindu" style="margin-top: 20rpx;">
  122. <view v-if="newlisttabinfo2.result.length" class="jindu-box"
  123. v-for="(item,index) in newlisttabinfo2.result" :key="index">
  124. <view class="jindu-boxche">
  125. <view class="jindu-name u-flex" style='width: 170rpx' v-if="item.name">
  126. <image v-if="index==0" class="sort-img" src="/static/images/top1.png" mode="" />
  127. <image v-if="index==1" class="sort-img" src="/static/images/top2.png" mode="" />
  128. <image v-if="index==2" class="sort-img" src="/static/images/top3.png" mode="" />
  129. <view class="sort-number" v-if="index>2">{{index+1}}</view>
  130. {{item.name.substring(0,4)}}
  131. </view>
  132. <view class="progress-cus">
  133. <view class="color1" v-if="index==0" :style="'width:'+ item.zxl||0 + '%'"></view>
  134. <view class="color2" v-if="index==1" :style="'width:'+ getPercent(item.zxl,2)+ '%'"></view>
  135. <view class="color3" v-if="index==2" :style="'width:'+ getPercent(item.zxl,2)+ '%'"></view>
  136. <view class="color4" v-if="index>2" :style="'width:'+ getPercent(item.zxl,2)+ '%'"></view>
  137. </view>
  138. <view class="jindu-zxl u-line-1">{{item.zxl==null?0:item.zxl}}分钟</view>
  139. </view>
  140. </view>
  141. <view v-if="newlisttabinfo2.result.length==0" style="width: 100%;text-align: center;margin-top: 60rpx;">
  142. 暂无数据
  143. </view>
  144. </view>
  145. </view>
  146. <view class="single">
  147. <view class="title">
  148. <view class="title1" style="flex: 1;">违禁次数排名(TOP10)</view>
  149. </view>
  150. <view class="hejisan">
  151. <view class="sanbox1">
  152. <view class="text1-2">{{newlisttabinfo4.total}}</view>
  153. <view class="text1-1">合计次数</view>
  154. </view>
  155. <view class="sanbox1">
  156. <view class="text1-2">{{newlisttabinfo4.count}}人</view>
  157. <view class="text1-1">顾问人数</view>
  158. </view>
  159. <view class="sanbox1">
  160. <view class="text1-2">{{newlisttabinfo4.avg}}</view>
  161. <view class="text1-1">人均违禁次数</view>
  162. </view>
  163. </view>
  164. <view class="jindu" style="margin-top: 20rpx;min-height: 300rpx">
  165. <view v-if="newlisttabinfo4.result.length" class="jindu-box"
  166. v-for="(item,index) in newlisttabinfo4.result" :key="index">
  167. <view class="jindu-boxche">
  168. <view class="jindu-name u-flex" style='width: 170rpx' v-if="item.name">
  169. <image v-if="index==0" class="sort-img" src="/static/images/top1.png" mode="" />
  170. <image v-if="index==1" class="sort-img" src="/static/images/top2.png" mode="" />
  171. <image v-if="index==2" class="sort-img" src="/static/images/top3.png" mode="" />
  172. <view class="sort-number" v-if="index>2">{{index+1}}</view>
  173. {{item.name.substring(0,4)}}
  174. </view>
  175. <view class="progress-cus">
  176. <view class="color1" v-if="index==0" :style="'width:'+ item.zxl||0 + '%'"></view>
  177. <view class="color2" v-if="index==1" :style="'width:'+ getPercent(item.zxl,4)+ '%'"></view>
  178. <view class="color3" v-if="index==2" :style="'width:'+ getPercent(item.zxl,4) + '%'"></view>
  179. <view class="color4" v-if="index>2" :style="'width:'+ getPercent(item.zxl,4)+ '%'"></view>
  180. </view>
  181. <view class="jindu-zxl">{{item.zxl==null?0:item.zxl}}次</view>
  182. </view>
  183. </view>
  184. <view v-if="newlisttabinfo4.result.length==0" style="width: 100%;text-align: center;margin-top: 60rpx;">
  185. 暂无数据
  186. </view>
  187. </view>
  188. </view>
  189. <view class="single">
  190. <view class="title">
  191. <view class="title1" style="flex: 1;">接待未标顾问排名(TOP10)</view>
  192. </view>
  193. <view class="hejisan">
  194. <view class="sanbox1">
  195. <view class="text1-2">{{newlisttabinfo5.total||0}}</view>
  196. <view class="text1-1">合计</view>
  197. </view>
  198. <view class="sanbox1">
  199. <view class="text1-2">{{newlisttabinfo5.count||0}}人</view>
  200. <view class="text1-1">顾问</view>
  201. </view>
  202. <view class="sanbox1">
  203. <view class="text1-2">{{newlisttabinfo5.avg||0}}</view>
  204. <view class="text1-1">均值</view>
  205. </view>
  206. </view>
  207. <view class="jindu" style="margin-top: 20rpx;min-height: 300rpx">
  208. <view v-if="newlisttabinfo5.result.length!=0" class="jindu-box"
  209. v-for="(item,index) in newlisttabinfo5.result" :key="index">
  210. <view class="jindu-boxche">
  211. <view class="jindu-name u-flex" style='width: 170rpx' v-if="item.name">
  212. <image v-if="index==0" class="sort-img" src="/static/images/top1.png" mode="" />
  213. <image v-if="index==1" class="sort-img" src="/static/images/top2.png" mode="" />
  214. <image v-if="index==2" class="sort-img" src="/static/images/top3.png" mode="" />
  215. <view class="sort-number" v-if="index>2">{{index+1}}</view>
  216. {{item.name.substring(0,4)}}
  217. </view>
  218. <view class="progress-cus">
  219. <view class="color1" v-if="index==0" :style="'width:'+ item.zxl||0 + '%'"></view>
  220. <view class="color2" v-if="index==1" :style="'width:'+ getPercent(item.zxl,5)+ '%'"></view>
  221. <view class="color3" v-if="index==2" :style="'width:'+ getPercent(item.zxl,5) + '%'"></view>
  222. <view class="color4" v-if="index>2" :style="'width:'+ getPercent(item.zxl,5)+ '%'"></view>
  223. </view>
  224. <view class="jindu-zxl">{{item.zxl==null?0:item.zxl}}次</view>
  225. </view>
  226. </view>
  227. <view v-if="newlisttabinfo5.result.length==0" style="width: 100%;text-align: center;margin-top: 60rpx;">
  228. 暂无数据
  229. </view>
  230. </view>
  231. </view>
  232. <u-calendar v-model="totalTimeShow" mode="range" @change="totalTimeChange"></u-calendar>
  233. <!-- 加载组件 -->
  234. <u-loadings v-model="LOADING"></u-loadings>
  235. </view>
  236. </template>
  237. <script>
  238. var app = getApp();
  239. var util = require("../../../utils/util.js");
  240. var config = require("../../../config");
  241. export default {
  242. data() {
  243. return {
  244. activeTotal: 4,
  245. totalTimeShow: false,
  246. // 项目id
  247. houseId: '',
  248. lastEndDate: '',
  249. lastStartDate: '',
  250. newlisttabinfo1: {
  251. avg: '',
  252. count: '',
  253. total: '',
  254. result: [],
  255. },
  256. newlisttabinfo2: {
  257. avg: '',
  258. count: '',
  259. total: '',
  260. result: [],
  261. },
  262. newlisttabinfo3: {
  263. avg: '',
  264. count: '',
  265. total: '',
  266. result: [],
  267. },
  268. newlisttabinfo4: {
  269. avg: '',
  270. count: '',
  271. total: '',
  272. result: [],
  273. },
  274. newlisttabinfo5: {
  275. avg: '',
  276. count: '',
  277. total: '',
  278. result: [],
  279. },
  280. };
  281. },
  282. onLoad() {
  283. this.LOADING = true
  284. // 获取项目id
  285. this.houseId = uni.getStorageSync('buildingID').id;
  286. this.init()
  287. },
  288. computed: {
  289. },
  290. onPullDownRefresh() {
  291. this.init()
  292. setTimeout(function() {
  293. uni.stopPullDownRefresh();
  294. }, 1000);
  295. },
  296. methods: {
  297. getPercent(num, type) {
  298. if (this.newlisttabinfo1.result && this.newlisttabinfo1.result.length && type == 1) {
  299. let index0 = this.newlisttabinfo1.result[0]
  300. let percent = num / (index0.zxl == 0 ? 1 : index0.zxl) * 100
  301. return percent.toFixed(2)
  302. } else if (this.newlisttabinfo2.result && this.newlisttabinfo2.result.length && type == 2) {
  303. let index0 = this.newlisttabinfo2.result[0]
  304. let percent = num / (index0.zxl == 0 ? 1 : index0.zxl) * 100
  305. return percent.toFixed(2)
  306. } else if (this.newlisttabinfo4.result && this.newlisttabinfo4.result.length && type == 4) {
  307. let index0 = this.newlisttabinfo4.result[0]
  308. let percent = num / (index0.zxl == 0 ? 1 : index0.zxl) * 100
  309. return percent.toFixed(2)
  310. } else if (this.newlisttabinfo5.result && this.newlisttabinfo5.result.length && type == 5) {
  311. let index0 = this.newlisttabinfo5.result[0]
  312. let percent = num / (index0.zxl == 0 ? 1 : index0.zxl) * 100
  313. return percent.toFixed(2)
  314. } else {
  315. return 0
  316. }
  317. },
  318. getPercent1(num) {
  319. return num || 0
  320. },
  321. init() {
  322. this.newlisttabinfo1 = {
  323. avg: '',
  324. count: '',
  325. total: '',
  326. result: [],
  327. },
  328. this.newlisttabinfo2 = {
  329. avg: '',
  330. count: '',
  331. total: '',
  332. result: [],
  333. },
  334. this.newlisttabinfo3 = {
  335. avg: '',
  336. count: '',
  337. total: '',
  338. result: [],
  339. },
  340. this.newlisttabinfo4 = {
  341. avg: '',
  342. count: '',
  343. total: '',
  344. result: [],
  345. }
  346. this.newlisttabinfo2 = {
  347. avg: '',
  348. count: '',
  349. total: '',
  350. result: [],
  351. }
  352. this.newlisttabinfo3 = {
  353. avg: '',
  354. count: '',
  355. total: '',
  356. result: [],
  357. }
  358. this.newlisttabinfo4 = {
  359. avg: '',
  360. count: '',
  361. total: '',
  362. result: [],
  363. }
  364. this.newlisttabinfo5 = {
  365. avg: '',
  366. count: '',
  367. total: '',
  368. result: [],
  369. }
  370. var activeTotal = 0;
  371. if (this.activeTotal == 3) {
  372. activeTotal = null;
  373. } else {
  374. activeTotal = this.activeTotal;
  375. this.lastEndDate = '';
  376. this.lastStartDate = '';
  377. }
  378. var promse = {
  379. timeType: activeTotal,
  380. lastStartDate: this.lastStartDate,
  381. lastEndDate: this.lastEndDate,
  382. houseId: this.houseId
  383. }
  384. this.staffStatisticsReceptionTop10(promse)
  385. this.staffStatisticsRecordingTimTop10(promse)
  386. this.staffStatisticsExecutionRateTop10(promse)
  387. this.staffStatisticsProhibitedTop10(promse)
  388. this.staffStatisticsUnlabeledTop10(promse)
  389. },
  390. //接待量排名
  391. staffStatisticsReceptionTop10(promse) {
  392. this.$u.post('/cusLvStatistics/staffStatisticsReceptionTop10', promse).then(res => {
  393. res.result.forEach(item => {
  394. item.zxl = item.data
  395. item.name = item.accountName
  396. })
  397. res.result = this.dealData(res.result)
  398. this.newlisttabinfo1 = res;
  399. })
  400. },
  401. //录音时长
  402. staffStatisticsRecordingTimTop10(promse) {
  403. this.$u.post('/cusLvStatistics/staffStatisticsRecordingTimTop10', promse).then(res => {
  404. res.result.forEach(item => {
  405. item.zxl = item.data
  406. item.name = item.accountName
  407. })
  408. res.result = this.dealData(res.result)
  409. this.newlisttabinfo2 = res;
  410. })
  411. },
  412. //销讲
  413. staffStatisticsExecutionRateTop10(promse) {
  414. this.$u.post('/cusLvStatistics/staffStatisticsExecutionRateTop10', promse).then(res => {
  415. res.result.forEach(item => {
  416. item.zxl = item.data;
  417. item.zxl1 = item.data;
  418. item.name = item.accountName
  419. })
  420. this.newlisttabinfo3 = res;
  421. })
  422. },
  423. //j禁忌
  424. staffStatisticsProhibitedTop10(promse) {
  425. this.$u.post('/cusLvStatistics/staffStatisticsProhibitedTop10', promse).then(res => {
  426. res.result.forEach(item => {
  427. item.zxl = item.data
  428. item.name = item.accountName
  429. })
  430. res.result = this.dealData(res.result)
  431. this.newlisttabinfo4 = res;
  432. })
  433. },
  434. //未标记客户数量排名,
  435. staffStatisticsUnlabeledTop10(promse) {
  436. this.$u.post('/cusLvStatistics/staffStatisticsUnlabeledTop', promse).then(res => {
  437. this.LOADING = false
  438. res.result.forEach(item => {
  439. item.zxl = item.tagCustomer
  440. item.name = item.accountName
  441. })
  442. res.result = this.dealData(res.result)
  443. this.newlisttabinfo5 = res;
  444. }).catch(e => {
  445. this.LOADING = false
  446. })
  447. },
  448. //自定义时间
  449. totalTimeChange(e) {
  450. this.activeTotal = 3;
  451. this.lastEndDate = e.endDate
  452. this.lastStartDate = e.startDate
  453. this.init()
  454. },
  455. //时间切换
  456. tabtimetap(index) {
  457. this.activeTotal = index;
  458. if (index == 3) {
  459. this.totalTimeShow = true;
  460. } else {
  461. this.lastEndDate = '';
  462. this.lastStartDate = '';
  463. this.init()
  464. }
  465. },
  466. // 定义一个公共方法对数据进行处理
  467. dealData(arr) {
  468. // 获取最大值
  469. let num = Math.max.apply(Math, arr.map(function(o) {
  470. return o.zxl
  471. })) //结果:3
  472. arr.map(item => {
  473. item.zxl1 = Math.floor(item.zxl / num * 100)
  474. })
  475. return arr
  476. },
  477. }
  478. };
  479. </script>
  480. <style lang="scss" scoped>
  481. .box {
  482. width: 100%;
  483. height: 100%;
  484. background: #FAFAFA;
  485. }
  486. .single {
  487. padding-bottom: 20rpx;
  488. margin-top: 20rpx;
  489. }
  490. .boxtittab {
  491. position: sticky;
  492. top: var(--window-top);
  493. z-index: 999;
  494. }
  495. .hejisan {
  496. width: 92%;
  497. margin: 0 auto;
  498. display: flex;
  499. padding-top: 20rpx;
  500. padding-bottom: 20rpx;
  501. .sanbox1 {
  502. flex: 1;
  503. display: flex;
  504. flex-direction: column;
  505. justify-content: center;
  506. align-items: center;
  507. position: relative;
  508. &::after {
  509. position: absolute;
  510. content: '';
  511. width: 1rpx;
  512. height: 86rpx;
  513. background: #E0E0E0;
  514. right: 0;
  515. top: 0;
  516. }
  517. &:last-child::after {
  518. position: absolute;
  519. content: '';
  520. width: 1rpx;
  521. height: 86rpx;
  522. right: 0;
  523. top: 0;
  524. background: #fff;
  525. }
  526. }
  527. .text1-1 {
  528. font-size: 24rpx;
  529. font-family: PingFangSC-Regular, PingFang SC;
  530. font-weight: 400;
  531. color: #333333;
  532. line-height: 32rpx;
  533. }
  534. .text1-2 {
  535. color: #333333;
  536. font-size: 40rpx;
  537. line-height: 46rpx;
  538. font-family: PingFangSC-Regular, PingFang SC;
  539. margin-bottom: 10rpx;
  540. }
  541. }
  542. .jindu-name {
  543. width: 180rpx;
  544. margin-left: 15rpx;
  545. }
  546. .sort-img {
  547. width: 44rpx;
  548. height: 44rpx;
  549. margin-right: 15rpx;
  550. }
  551. .sort-number {
  552. width: 40rpx;
  553. height: 40rpx;
  554. background: #E5F0FF;
  555. border-radius: 50%;
  556. font-size: 24rpx;
  557. font-family: PingFangSC-Regular, PingFang SC;
  558. font-weight: 400;
  559. color: #333333;
  560. text-align: center;
  561. line-height: 40rpx;
  562. margin-right: 15rpx;
  563. }
  564. </style>