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