AI销管
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 

594 lignes
19 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="newlisttabinfo5.result.length!=0" class="jindu-box"
  206. v-for="(item,index) in newlisttabinfo5.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,5)+ '%'" ></view>
  217. <view class="color3" v-if="index==2" :style="'width:'+ getPercent(item.zxl,5) + '%'" ></view>
  218. <view class="color4" v-if="index>2" :style="'width:'+ getPercent(item.zxl,5)+ '%'" ></view>
  219. </view>
  220. <view class="jindu-zxl" >{{item.zxl==null?0:item.zxl}}次</view>
  221. </view>
  222. </view>
  223. <view v-if="newlisttabinfo5.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 if(this.newlisttabinfo5.result&&this.newlisttabinfo5.result.length&&type==5){
  310. let index0 = this.newlisttabinfo5.result[0]
  311. let percent = num/(index0.zxl) * 100
  312. return percent.toFixed(2)
  313. }else{
  314. return 0
  315. }
  316. },
  317. getPercent1(num){
  318. console.log(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. res.result.forEach(item => {
  438. item.zxl = item.tagCustomer
  439. item.name = item.accountName
  440. })
  441. res.result = this.dealData(res.result)
  442. this.newlisttabinfo5 = res;
  443. })
  444. },
  445. //自定义时间
  446. totalTimeChange(e) {
  447. console.log(e.startDate, e.endDate)
  448. this.activeTotal = 3;
  449. this.lastEndDate = e.endDate
  450. this.lastStartDate = e.startDate
  451. this.init()
  452. },
  453. //时间切换
  454. tabtimetap(index) {
  455. this.activeTotal = index;
  456. if (index == 3) {
  457. this.totalTimeShow = true;
  458. } else {
  459. this.lastEndDate='';
  460. this.lastStartDate='';
  461. this.init()
  462. }
  463. },
  464. // 定义一个公共方法对数据进行处理
  465. dealData(arr) {
  466. // 获取最大值
  467. let num = Math.max.apply(Math, arr.map(function(o) {
  468. return o.zxl
  469. })) //结果:3
  470. // console.log(num)
  471. // if(num>100){
  472. // // 获取最大值的下标
  473. // // let idx=arr.findIndex(item=>item.zxl==num)
  474. // // console.log(idx,123)
  475. // arr.map(item=>{
  476. // item.zxl1=Math.floor(item.zxl/num*100)
  477. // })
  478. // // console.log(arr)
  479. // return arr
  480. // }else{
  481. // arr.map(item=>{
  482. // item.zxl1=item.zxl
  483. // })
  484. // return arr
  485. // }
  486. arr.map(item => {
  487. item.zxl1 = Math.floor(item.zxl / num * 100)
  488. })
  489. return arr
  490. },
  491. }
  492. };
  493. </script>
  494. <style lang="scss" scoped>
  495. .box {
  496. width: 100%;
  497. height: 100%;
  498. background: #FAFAFA;
  499. padding-bottom: 60rpx;
  500. }
  501. .boxtittab {
  502. position: sticky;
  503. top: var(--window-top);
  504. z-index: 999;
  505. }
  506. .hejisan {
  507. width: 92%;
  508. margin: 0 auto;
  509. display: flex;
  510. padding-top: 20rpx;
  511. padding-bottom:20rpx;
  512. .sanbox1{
  513. flex: 1;
  514. display: flex;
  515. flex-direction: column;
  516. justify-content: center;
  517. align-items: center;
  518. position: relative;
  519. &::after{
  520. position: absolute;
  521. content: '';
  522. width: 1rpx;
  523. height: 86rpx;
  524. background: #E0E0E0;
  525. right: 0;
  526. top: 0;
  527. }
  528. &:last-child::after {
  529. position: absolute;
  530. content: '';
  531. width: 1rpx;
  532. height: 86rpx;
  533. right: 0;
  534. top: 0;
  535. background: #fff;
  536. }
  537. }
  538. .text1-1{
  539. font-size: 24rpx;
  540. font-family: PingFangSC-Regular, PingFang SC;
  541. font-weight: 400;
  542. color: #333333;
  543. line-height: 32rpx;
  544. }
  545. .text1-2 {
  546. color: #333333;
  547. font-size: 40rpx;
  548. line-height: 46rpx;
  549. font-family: PingFangSC-Regular, PingFang SC;
  550. margin-bottom: 10rpx;
  551. }
  552. }
  553. .jindu-name{
  554. width: 180rpx;
  555. margin-left: 15rpx;
  556. }
  557. .sort-img{
  558. width: 44rpx;
  559. height: 44rpx;
  560. margin-right: 15rpx;
  561. }
  562. .sort-number{
  563. width: 40rpx;
  564. height: 40rpx;
  565. background: #E5F0FF;
  566. border-radius: 50%;
  567. font-size: 24rpx;
  568. font-family: PingFangSC-Regular, PingFang SC;
  569. font-weight: 400;
  570. color: #333333;
  571. text-align: center;
  572. line-height: 40rpx;
  573. margin-right: 15rpx;
  574. }
  575. </style>