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.
 
 
 
 

451 lines
13 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;height: 360rpx;overflow: auto;">
  37. <view v-if="newlisttabinfo1.result.length!=0" 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="height: 360rpx;overflow: auto;">
  75. <view v-if="newlisttabinfo3.result.length!=0" class="jindu-box" v-for="(item,index) in newlisttabinfo3.result" :key="index">
  76. <view class="jindu-boxche">
  77. <view class="jindu-name" v-if="item.name">{{item.name.substring(0,4)}}</view>
  78. <view class="progress-cus">
  79. <view class="color" :style="'width:'+ item.zxl||0 + '%'" ></view>
  80. </view>
  81. <view class="jindu-zxl">{{item.zxl==null?0:item.zxl}}%</view>
  82. </view>
  83. </view>
  84. <view v-if="newlisttabinfo3.result.length==0" style="width: 100%;text-align: center;margin-top: 60rpx;">
  85. 暂无数据
  86. </view>
  87. </view>
  88. </view>
  89. <view style="width: 100%;height: 20rpx;background: #FAFAFA;"></view>
  90. <view class="single">
  91. <view class="title">
  92. <view class="title1" style="flex: 1;">录音时长(TOP10)</view>
  93. </view>
  94. <view class="hejisan">
  95. <view class="sanbox1" >
  96. <view class="text1-2">{{newlisttabinfo2.total}}</view>
  97. <view class="text1-1">合计时长/分钟</view>
  98. </view>
  99. <view class="sanbox1">
  100. <view class="text1-2">{{newlisttabinfo2.count}}</view>
  101. <view class="text1-1">顾问人数</view>
  102. </view>
  103. <view class="sanbox1" >
  104. <view class="text1-2">{{newlisttabinfo2.avg}}</view>
  105. <view class="text1-1">人均录音时长/分钟</view>
  106. </view>
  107. </view>
  108. <view class="jindu" style="height: 360rpx;overflow: auto;">
  109. <view v-if="newlisttabinfo2.result.length!=0" class="jindu-box" v-for="(item,index) in newlisttabinfo2.result" :key="index">
  110. <view class="jindu-boxche">
  111. <view class="jindu-name" v-if="item.name">{{item.name.substring(0,4)}}</view>
  112. <view class="progress-cus">
  113. <view class="color" :style="'width:'+ item.zxl||0 + '%'" ></view>
  114. </view>
  115. <view class="jindu-zxl u-line-1">{{item.zxl==null?0:item.zxl}}分钟</view>
  116. </view>
  117. </view>
  118. <view v-if="newlisttabinfo2.result.length==0" style="width: 100%;text-align: center;margin-top: 60rpx;">
  119. 暂无数据
  120. </view>
  121. </view>
  122. </view>
  123. <view style="width: 100%;height: 20rpx;background: #FAFAFA;"></view>
  124. <view class="single">
  125. <view class="title">
  126. <view class="title1" style="flex: 1;">违禁次数排名(TOP10)</view>
  127. </view>
  128. <view class="hejisan">
  129. <view class="sanbox1">
  130. <view class="text1-2">{{newlisttabinfo4.total}}</view>
  131. <view class="text1-1">合计次数</view>
  132. </view>
  133. <view class="sanbox1">
  134. <view class="text1-2">{{newlisttabinfo4.count}}人</view>
  135. <view class="text1-1">顾问人数</view>
  136. </view>
  137. <view class="sanbox1">
  138. <view class="text1-2">{{newlisttabinfo4.avg}}</view>
  139. <view class="text1-1">人均违禁次数</view>
  140. </view>
  141. </view>
  142. <view class="jindu" style="height: 360rpx;overflow: auto;">
  143. <view v-if="newlisttabinfo4.result.length" class="jindu-box" v-for="(item,index) in newlisttabinfo4.result" :key="index">
  144. <view class="jindu-boxche">
  145. <view class="jindu-name u-flex" style='width: 170rpx' v-if="item.name">
  146. <image v-if="index==0" class="sort-img" src="/static/images/top1.png" mode="" />
  147. <image v-if="index==1" class="sort-img" src="/static/images/top2.png" mode="" />
  148. <image v-if="index==2" class="sort-img" src="/static/images/top3.png" mode="" />
  149. <view class="sort-number" v-if="index>2">{{index+1}}</view>
  150. {{item.name.substring(0,4)}}</view>
  151. <view class="progress-cus">
  152. <view class="color1" v-if="index==0" :style="'width:'+ item.zxl||0 + '%'" ></view>
  153. <view class="color2" v-if="index==1" :style="'width:'+ item.zxl||0 + '%'" ></view>
  154. <view class="color3" v-if="index==2" :style="'width:'+ item.zxl||0 + '%'" ></view>
  155. <view class="color4" v-if="index>2" :style="'width:'+ item.zxl||0 + '%'" ></view>
  156. </view>
  157. <view class="jindu-zxl" >{{item.zxl==null?0:item.zxl}}次</view>
  158. </view>
  159. </view>
  160. <view v-if="newlisttabinfo4.result.length==0" style="width: 100%;text-align: center;margin-top: 60rpx;">
  161. 暂无数据
  162. </view>
  163. </view>
  164. </view>
  165. <u-calendar v-model="totalTimeShow" mode="range" @change="totalTimeChange"></u-calendar>
  166. </view>
  167. </template>
  168. <script>
  169. var app = getApp();
  170. var util = require("../../../utils/util.js");
  171. var config = require("../../../config");
  172. export default {
  173. data() {
  174. return {
  175. activeTotal: 4,
  176. totalTimeShow: false,
  177. // 项目id
  178. houseId:'',
  179. lastEndDate:'',
  180. lastStartDate:'',
  181. newlisttabinfo1:{
  182. avg:'',
  183. count:'',
  184. total:'',
  185. result:[],
  186. },
  187. newlisttabinfo2:{
  188. avg:'',
  189. count:'',
  190. total:'',
  191. result:[],
  192. },
  193. newlisttabinfo3:{
  194. avg:'',
  195. count:'',
  196. total:'',
  197. result:[],
  198. },
  199. newlisttabinfo4:{
  200. avg:'',
  201. count:'',
  202. total:'',
  203. result:[],
  204. },
  205. };
  206. },
  207. onLoad() {
  208. // 获取项目id
  209. this.houseId = uni.getStorageSync('buildingID').id;
  210. this.init()
  211. },
  212. onPullDownRefresh(){
  213. this.init()
  214. setTimeout(function () {
  215. uni.stopPullDownRefresh();
  216. }, 1000);
  217. },
  218. methods: {
  219. init(){
  220. this.newlisttabinfo1={
  221. avg:'',
  222. count:'',
  223. total:'',
  224. result:[],
  225. },
  226. this.newlisttabinfo2={
  227. avg:'',
  228. count:'',
  229. total:'',
  230. result:[],
  231. },
  232. this.newlisttabinfo3={
  233. avg:'',
  234. count:'',
  235. total:'',
  236. result:[],
  237. },
  238. this.newlisttabinfo4={
  239. avg:'',
  240. count:'',
  241. total:'',
  242. result:[],
  243. }
  244. var activeTotal=0;
  245. if(this.activeTotal==3){
  246. activeTotal=null;
  247. }else{
  248. activeTotal=this.activeTotal;
  249. this.lastEndDate='';
  250. this.lastStartDate='';
  251. }
  252. var promse={
  253. timeType:activeTotal,
  254. lastStartDate:this.lastStartDate,
  255. lastEndDate:this.lastEndDate,
  256. houseId:this.houseId
  257. }
  258. this.staffStatisticsReceptionTop10(promse)
  259. this.staffStatisticsRecordingTimTop10(promse)
  260. this.staffStatisticsExecutionRateTop10(promse)
  261. this.staffStatisticsProhibitedTop10(promse)
  262. },
  263. //接待量排名
  264. staffStatisticsReceptionTop10(promse){
  265. this.$u.post('/cusLvStatistics/staffStatisticsReceptionTop10',promse).then(res=>{
  266. res.result.forEach(item=>{
  267. item.zxl=item.data
  268. item.name=item.accountName
  269. })
  270. res.result=this.dealData(res.result)
  271. this.newlisttabinfo1=res;
  272. })
  273. },
  274. //录音时长
  275. staffStatisticsRecordingTimTop10(promse){
  276. this.$u.post('/cusLvStatistics/staffStatisticsRecordingTimTop10',promse).then(res=>{
  277. res.result.forEach(item=>{
  278. item.zxl=item.data
  279. item.name=item.accountName
  280. })
  281. res.result=this.dealData(res.result)
  282. this.newlisttabinfo2=res;
  283. })
  284. },
  285. //销讲
  286. staffStatisticsExecutionRateTop10(promse){
  287. this.$u.post('/cusLvStatistics/staffStatisticsExecutionRateTop10',promse).then(res=>{
  288. res.result.forEach(item=>{
  289. item.zxl=item.data;
  290. item.zxl1=item.data;
  291. item.name=item.accountName
  292. })
  293. this.newlisttabinfo3=res;
  294. })
  295. },
  296. //j禁忌
  297. staffStatisticsProhibitedTop10(promse){
  298. this.$u.post('/cusLvStatistics/staffStatisticsProhibitedTop10',promse).then(res=>{
  299. res.result.forEach(item=>{
  300. item.zxl=item.data
  301. item.name=item.accountName
  302. })
  303. res.result=this.dealData(res.result)
  304. this.newlisttabinfo4=res;
  305. })
  306. },
  307. //自定义时间
  308. totalTimeChange(e) {
  309. console.log(e.startDate, e.endDate)
  310. this.activeTotal=3;
  311. this.lastEndDate=e.endDate
  312. this.lastStartDate=e.startDate
  313. this.init()
  314. },
  315. //时间切换
  316. tabtimetap(index) {
  317. this.activeTotal = index;
  318. if (index == 3) {
  319. this.totalTimeShow = true;
  320. } else {
  321. this.lastEndDate='';
  322. this.lastStartDate='';
  323. this.init()
  324. }
  325. },
  326. // 定义一个公共方法对数据进行处理
  327. dealData(arr){
  328. // 获取最大值
  329. let num=Math.max.apply(Math, arr.map(function (o) { return o.zxl })) //结果:3
  330. // console.log(num)
  331. // if(num>100){
  332. // // 获取最大值的下标
  333. // // let idx=arr.findIndex(item=>item.zxl==num)
  334. // // console.log(idx,123)
  335. // arr.map(item=>{
  336. // item.zxl1=Math.floor(item.zxl/num*100)
  337. // })
  338. // // console.log(arr)
  339. // return arr
  340. // }else{
  341. // arr.map(item=>{
  342. // item.zxl1=item.zxl
  343. // })
  344. // return arr
  345. // }
  346. arr.map(item=>{
  347. item.zxl1=Math.floor(item.zxl/num*100)
  348. })
  349. return arr
  350. },
  351. }
  352. };
  353. </script>
  354. <style lang="scss" scoped>
  355. .box {
  356. width: 100%;
  357. height: 100%;
  358. background: #FAFAFA;
  359. padding-bottom: 60rpx;
  360. }
  361. .boxtittab {
  362. position: sticky;
  363. top: var(--window-top);
  364. z-index: 999;
  365. }
  366. .hejisan{
  367. width: 92%;
  368. margin: 0 auto;
  369. display: flex;
  370. padding-top: 20rpx;
  371. padding-bottom:20rpx;
  372. .sanbox1{
  373. flex: 1;
  374. display: flex;
  375. flex-direction: column;
  376. justify-content: center;
  377. align-items: center;
  378. position: relative;
  379. &::after{
  380. position: absolute;
  381. content: '';
  382. width: 1rpx;
  383. height: 86rpx;
  384. background: #E0E0E0;
  385. right: 0;
  386. top: 0;
  387. }
  388. &:last-child::after {
  389. position: absolute;
  390. content: '';
  391. width: 1rpx;
  392. height: 86rpx;
  393. right: 0;
  394. top: 0;
  395. background: #fff;
  396. }
  397. }
  398. .text1-1{
  399. font-size: 24rpx;
  400. font-family: PingFangSC-Regular, PingFang SC;
  401. font-weight: 400;
  402. color: #333333;
  403. line-height: 32rpx;
  404. }
  405. .text1-2{
  406. color: #333333;
  407. font-size: 40rpx;
  408. line-height: 46rpx;
  409. font-family: PingFangSC-Regular, PingFang SC;
  410. margin-bottom: 10rpx;
  411. }
  412. }
  413. .progress-cus{
  414. }
  415. .jindu-name{
  416. width: 180rpx;
  417. margin-left: 15rpx;
  418. }
  419. .sort-img{
  420. width: 44rpx;
  421. height: 44rpx;
  422. margin-right: 15rpx;
  423. }
  424. .sort-number{
  425. width: 40rpx;
  426. height: 40rpx;
  427. background: #E5F0FF;
  428. border-radius: 50%;
  429. font-size: 24rpx;
  430. font-family: PingFangSC-Regular, PingFang SC;
  431. font-weight: 400;
  432. color: #333333;
  433. text-align: center;
  434. line-height: 40rpx;
  435. margin-right: 15rpx;
  436. }
  437. </style>