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.
 
 
 
 

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