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.
 
 
 
 

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