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.
 
 
 
 

475 lines
15 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. <u-calendar v-model="totalTimeShow" mode="range" @change="totalTimeChange"></u-calendar>
  190. </view>
  191. </template>
  192. <script>
  193. var app = getApp();
  194. var util = require("../../../utils/util.js");
  195. var config = require("../../../config");
  196. export default {
  197. data() {
  198. return {
  199. activeTotal: 4,
  200. totalTimeShow: false,
  201. // 项目id
  202. houseId:'',
  203. lastEndDate:'',
  204. lastStartDate:'',
  205. newlisttabinfo1:{
  206. avg:'',
  207. count:'',
  208. total:'',
  209. result:[],
  210. },
  211. newlisttabinfo2:{
  212. avg:'',
  213. count:'',
  214. total:'',
  215. result:[],
  216. },
  217. newlisttabinfo3:{
  218. avg:'',
  219. count:'',
  220. total:'',
  221. result:[],
  222. },
  223. newlisttabinfo4:{
  224. avg:'',
  225. count:'',
  226. total:'',
  227. result:[],
  228. },
  229. };
  230. },
  231. onLoad() {
  232. // 获取项目id
  233. this.houseId = uni.getStorageSync('buildingID').id;
  234. this.init()
  235. },
  236. onPullDownRefresh(){
  237. this.init()
  238. setTimeout(function () {
  239. uni.stopPullDownRefresh();
  240. }, 1000);
  241. },
  242. methods: {
  243. init(){
  244. this.newlisttabinfo1={
  245. avg:'',
  246. count:'',
  247. total:'',
  248. result:[],
  249. },
  250. this.newlisttabinfo2={
  251. avg:'',
  252. count:'',
  253. total:'',
  254. result:[],
  255. },
  256. this.newlisttabinfo3={
  257. avg:'',
  258. count:'',
  259. total:'',
  260. result:[],
  261. },
  262. this.newlisttabinfo4={
  263. avg:'',
  264. count:'',
  265. total:'',
  266. result:[],
  267. }
  268. var activeTotal=0;
  269. if(this.activeTotal==3){
  270. activeTotal=null;
  271. }else{
  272. activeTotal=this.activeTotal;
  273. this.lastEndDate='';
  274. this.lastStartDate='';
  275. }
  276. var promse={
  277. timeType:activeTotal,
  278. lastStartDate:this.lastStartDate,
  279. lastEndDate:this.lastEndDate,
  280. houseId:this.houseId
  281. }
  282. this.staffStatisticsReceptionTop10(promse)
  283. this.staffStatisticsRecordingTimTop10(promse)
  284. this.staffStatisticsExecutionRateTop10(promse)
  285. this.staffStatisticsProhibitedTop10(promse)
  286. },
  287. //接待量排名
  288. staffStatisticsReceptionTop10(promse){
  289. this.$u.post('/cusLvStatistics/staffStatisticsReceptionTop10',promse).then(res=>{
  290. res.result.forEach(item=>{
  291. item.zxl=item.data
  292. item.name=item.accountName
  293. })
  294. res.result=this.dealData(res.result)
  295. this.newlisttabinfo1=res;
  296. })
  297. },
  298. //录音时长
  299. staffStatisticsRecordingTimTop10(promse){
  300. this.$u.post('/cusLvStatistics/staffStatisticsRecordingTimTop10',promse).then(res=>{
  301. res.result.forEach(item=>{
  302. item.zxl=item.data
  303. item.name=item.accountName
  304. })
  305. res.result=this.dealData(res.result)
  306. this.newlisttabinfo2=res;
  307. })
  308. },
  309. //销讲
  310. staffStatisticsExecutionRateTop10(promse){
  311. this.$u.post('/cusLvStatistics/staffStatisticsExecutionRateTop10',promse).then(res=>{
  312. res.result.forEach(item=>{
  313. item.zxl=item.data;
  314. item.zxl1=item.data;
  315. item.name=item.accountName
  316. })
  317. this.newlisttabinfo3=res;
  318. })
  319. },
  320. //j禁忌
  321. staffStatisticsProhibitedTop10(promse){
  322. this.$u.post('/cusLvStatistics/staffStatisticsProhibitedTop10',promse).then(res=>{
  323. res.result.forEach(item=>{
  324. item.zxl=item.data
  325. item.name=item.accountName
  326. })
  327. res.result=this.dealData(res.result)
  328. this.newlisttabinfo4=res;
  329. })
  330. },
  331. //自定义时间
  332. totalTimeChange(e) {
  333. console.log(e.startDate, e.endDate)
  334. this.activeTotal=3;
  335. this.lastEndDate=e.endDate
  336. this.lastStartDate=e.startDate
  337. this.init()
  338. },
  339. //时间切换
  340. tabtimetap(index) {
  341. this.activeTotal = index;
  342. if (index == 3) {
  343. this.totalTimeShow = true;
  344. } else {
  345. this.lastEndDate='';
  346. this.lastStartDate='';
  347. this.init()
  348. }
  349. },
  350. // 定义一个公共方法对数据进行处理
  351. dealData(arr){
  352. // 获取最大值
  353. let num=Math.max.apply(Math, arr.map(function (o) { return o.zxl })) //结果:3
  354. // console.log(num)
  355. // if(num>100){
  356. // // 获取最大值的下标
  357. // // let idx=arr.findIndex(item=>item.zxl==num)
  358. // // console.log(idx,123)
  359. // arr.map(item=>{
  360. // item.zxl1=Math.floor(item.zxl/num*100)
  361. // })
  362. // // console.log(arr)
  363. // return arr
  364. // }else{
  365. // arr.map(item=>{
  366. // item.zxl1=item.zxl
  367. // })
  368. // return arr
  369. // }
  370. arr.map(item=>{
  371. item.zxl1=Math.floor(item.zxl/num*100)
  372. })
  373. return arr
  374. },
  375. }
  376. };
  377. </script>
  378. <style lang="scss" scoped>
  379. .box {
  380. width: 100%;
  381. height: 100%;
  382. background: #FAFAFA;
  383. padding-bottom: 60rpx;
  384. }
  385. .boxtittab {
  386. position: sticky;
  387. top: var(--window-top);
  388. z-index: 999;
  389. }
  390. .hejisan{
  391. width: 92%;
  392. margin: 0 auto;
  393. display: flex;
  394. padding-top: 20rpx;
  395. padding-bottom:20rpx;
  396. .sanbox1{
  397. flex: 1;
  398. display: flex;
  399. flex-direction: column;
  400. justify-content: center;
  401. align-items: center;
  402. position: relative;
  403. &::after{
  404. position: absolute;
  405. content: '';
  406. width: 1rpx;
  407. height: 86rpx;
  408. background: #E0E0E0;
  409. right: 0;
  410. top: 0;
  411. }
  412. &:last-child::after {
  413. position: absolute;
  414. content: '';
  415. width: 1rpx;
  416. height: 86rpx;
  417. right: 0;
  418. top: 0;
  419. background: #fff;
  420. }
  421. }
  422. .text1-1{
  423. font-size: 24rpx;
  424. font-family: PingFangSC-Regular, PingFang SC;
  425. font-weight: 400;
  426. color: #333333;
  427. line-height: 32rpx;
  428. }
  429. .text1-2{
  430. color: #333333;
  431. font-size: 40rpx;
  432. line-height: 46rpx;
  433. font-family: PingFangSC-Regular, PingFang SC;
  434. margin-bottom: 10rpx;
  435. }
  436. }
  437. .progress-cus{
  438. }
  439. .jindu-name{
  440. width: 180rpx;
  441. margin-left: 15rpx;
  442. }
  443. .sort-img{
  444. width: 44rpx;
  445. height: 44rpx;
  446. margin-right: 15rpx;
  447. }
  448. .sort-number{
  449. width: 40rpx;
  450. height: 40rpx;
  451. background: #E5F0FF;
  452. border-radius: 50%;
  453. font-size: 24rpx;
  454. font-family: PingFangSC-Regular, PingFang SC;
  455. font-weight: 400;
  456. color: #333333;
  457. text-align: center;
  458. line-height: 40rpx;
  459. margin-right: 15rpx;
  460. }
  461. </style>