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.
 
 
 

406 lignes
12 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" style="width: 35%;">
  24. <view class="text1-1">合计</view>
  25. <view class="text1-2">{{newlisttabinfo1.total}}</view>
  26. </view>
  27. <view class="sanbox1" style="width: 40%;">
  28. <view class="text1-1">顾问</view>
  29. <view class="text1-2">{{newlisttabinfo1.count}}</view>
  30. </view>
  31. <view class="sanbox1" style="width: 25%;">
  32. <view class="text1-1">人均接待量</view>
  33. <view class="text1-2">{{newlisttabinfo1.avg}}</view>
  34. </view>
  35. </view>
  36. <view class="jindu" style="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" v-if="item.name">{{item.name.substring(0,4)}}</view>
  40. <view style="width: 440rpx;margin-left: 10rpx;">
  41. <u-line-progress height="24" :show-percent="false" active-color="#FBA448" :percent="item.zxl1"></u-line-progress>
  42. </view>
  43. <view class="jindu-zxl">{{item.zxl==null?0:item.zxl}}</view>
  44. </view>
  45. </view>
  46. <view v-if="newlisttabinfo1.result.length==0" style="width: 100%;text-align: center;margin-top: 60rpx;">
  47. 暂无数据
  48. </view>
  49. </view>
  50. </view>
  51. <view style="width: 100%;height: 20rpx;background: #FAFAFA;"></view>
  52. <view class="single">
  53. <view class="title">
  54. <view class="title1" style="flex: 1;">销讲执行率排行(TOP10)</view>
  55. </view>
  56. <view class="hejisan">
  57. <view class="sanbox1" style="width: 40%;">
  58. <view class="text1-1">顾问</view>
  59. <view class="text1-2">{{newlisttabinfo3.count}}</view>
  60. </view>
  61. <view class="sanbox1" style="width: 25%;">
  62. <view class="text1-1">人均执行率</view>
  63. <view class="text1-2">{{newlisttabinfo3.avg}}</view>
  64. </view>
  65. </view>
  66. <view class="jindu" style="height: 360rpx;overflow: auto;">
  67. <view v-if="newlisttabinfo3.result.length!=0" class="jindu-box" v-for="(item,index) in newlisttabinfo3.result" :key="index">
  68. <view class="jindu-boxche">
  69. <view class="jindu-name" v-if="item.name">{{item.name.substring(0,4)}}</view>
  70. <view style="width: 440rpx;margin-left: 10rpx;">
  71. <u-line-progress height="24" :show-percent="false" active-color="#FBA448" :percent="item.zxl1"></u-line-progress>
  72. </view>
  73. <view class="jindu-zxl">{{item.zxl==null?0:item.zxl}}</view>
  74. </view>
  75. </view>
  76. <view v-if="newlisttabinfo3.result.length==0" style="width: 100%;text-align: center;margin-top: 60rpx;">
  77. 暂无数据
  78. </view>
  79. </view>
  80. </view>
  81. <view style="width: 100%;height: 20rpx;background: #FAFAFA;"></view>
  82. <view class="single">
  83. <view class="title">
  84. <view class="title1" style="flex: 1;">录音时长(TOP10)</view>
  85. </view>
  86. <view class="hejisan">
  87. <view class="sanbox1" style="width: 35%;">
  88. <view class="text1-1">合计</view>
  89. <view class="text1-2">{{newlisttabinfo2.total}}</view>
  90. </view>
  91. <view class="sanbox1" style="width: 40%;">
  92. <view class="text1-1">顾问</view>
  93. <view class="text1-2">{{newlisttabinfo2.count}}</view>
  94. </view>
  95. <view class="sanbox1" style="width: 25%;">
  96. <view class="text1-1">人均录音时长</view>
  97. <view class="text1-2">{{newlisttabinfo2.avg}}</view>
  98. </view>
  99. </view>
  100. <view class="jindu" style="height: 360rpx;overflow: auto;">
  101. <view v-if="newlisttabinfo2.result.length!=0" class="jindu-box" v-for="(item,index) in newlisttabinfo2.result" :key="index">
  102. <view class="jindu-boxche">
  103. <view class="jindu-name" v-if="item.name">{{item.name.substring(0,4)}}</view>
  104. <view style="width: 440rpx;margin-left: 10rpx;">
  105. <u-line-progress height="24" :show-percent="false" active-color="#FBA448" :percent="item.zxl1"></u-line-progress>
  106. </view>
  107. <view class="jindu-zxl">{{item.zxl==null?0:item.zxl}}</view>
  108. </view>
  109. </view>
  110. <view v-if="newlisttabinfo2.result.length==0" style="width: 100%;text-align: center;margin-top: 60rpx;">
  111. 暂无数据
  112. </view>
  113. </view>
  114. </view>
  115. <view style="width: 100%;height: 20rpx;background: #FAFAFA;"></view>
  116. <view class="single">
  117. <view class="title">
  118. <view class="title1" style="flex: 1;">违禁次数排名(TOP10)</view>
  119. </view>
  120. <view class="hejisan">
  121. <view class="sanbox1" style="width: 35%;">
  122. <view class="text1-1">合计</view>
  123. <view class="text1-2">{{newlisttabinfo4.total}}</view>
  124. </view>
  125. <view class="sanbox1" style="width: 40%;">
  126. <view class="text1-1">顾问</view>
  127. <view class="text1-2">{{newlisttabinfo4.count}}</view>
  128. </view>
  129. <view class="sanbox1" style="width: 25%;">
  130. <view class="text1-1">人均违禁次数</view>
  131. <view class="text1-2">{{newlisttabinfo4.avg}}</view>
  132. </view>
  133. </view>
  134. <view class="jindu" style="height: 360rpx;overflow: auto;">
  135. <view v-if="newlisttabinfo4.result.length!=0" class="jindu-box" v-for="(item,index) in newlisttabinfo4.result" :key="index">
  136. <view class="jindu-boxche">
  137. <view class="jindu-name" v-if="item.name">{{item.name.substring(0,4)}}</view>
  138. <view style="width: 440rpx;margin-left: 10rpx;">
  139. <u-line-progress height="24" :show-percent="false" active-color="#FBA448" :percent="item.zxl1"></u-line-progress>
  140. </view>
  141. <view class="jindu-zxl">{{item.zxl==null?0:item.zxl}}</view>
  142. </view>
  143. </view>
  144. <view v-if="newlisttabinfo4.result.length==0" style="width: 100%;text-align: center;margin-top: 60rpx;">
  145. 暂无数据
  146. </view>
  147. </view>
  148. </view>
  149. <view v-if="false" style="width: 100%;height: 20rpx;background: #FAFAFA;"></view>
  150. <view class="single" v-if="false">
  151. <view class="title">
  152. <view class="title1" style="flex: 1;">接待未标顾问(TOP10)</view>
  153. </view>
  154. <view class="hejisan">
  155. <view class="sanbox1" style="width: 35%;">
  156. <view class="text1-1">合计</view>
  157. <view class="text1-2">{{newlisttabinfo4.total}}</view>
  158. </view>
  159. <view class="sanbox1" style="width: 40%;">
  160. <view class="text1-1">顾问</view>
  161. <view class="text1-2">{{newlisttabinfo4.count}}</view>
  162. </view>
  163. <view class="sanbox1" style="width: 25%;">
  164. <view class="text1-1">人均违禁次数</view>
  165. <view class="text1-2">{{newlisttabinfo4.avg}}</view>
  166. </view>
  167. </view>
  168. <view class="jindu" style="height: 360rpx;overflow: auto;">
  169. <view v-if="newlisttabinfo4.result.length!=0" class="jindu-box" v-for="(item,index) in newlisttabinfo4.result" :key="index">
  170. <view class="jindu-boxche">
  171. <view class="jindu-name" v-if="item.name">{{item.name.substring(0,4)}}</view>
  172. <view style="width: 440rpx;margin-left: 10rpx;">
  173. <u-line-progress height="24" :show-percent="false" active-color="#FBA448" :percent="item.zxl1"></u-line-progress>
  174. </view>
  175. <view class="jindu-zxl">{{item.zxl==null?0:item.zxl}}</view>
  176. </view>
  177. </view>
  178. <view v-if="newlisttabinfo4.result.length==0" style="width: 100%;text-align: center;margin-top: 60rpx;">
  179. 暂无数据
  180. </view>
  181. </view>
  182. </view>
  183. <u-calendar v-model="totalTimeShow" mode="range" @change="totalTimeChange"></u-calendar>
  184. </view>
  185. </template>
  186. <script>
  187. var app = getApp();
  188. var util = require("../../../utils/util.js");
  189. var config = require("../../../config");
  190. export default {
  191. data() {
  192. return {
  193. activeTotal: 4,
  194. totalTimeShow: false,
  195. // 项目id
  196. houseId:'',
  197. lastEndDate:'',
  198. lastStartDate:'',
  199. newlisttabinfo1:{
  200. avg:'',
  201. count:'',
  202. total:'',
  203. result:[],
  204. },
  205. newlisttabinfo2:{
  206. avg:'',
  207. count:'',
  208. total:'',
  209. result:[],
  210. },
  211. newlisttabinfo3:{
  212. avg:'',
  213. count:'',
  214. total:'',
  215. result:[],
  216. },
  217. newlisttabinfo4:{
  218. avg:'',
  219. count:'',
  220. total:'',
  221. result:[],
  222. },
  223. };
  224. },
  225. onLoad() {
  226. // 获取项目id
  227. this.houseId = uni.getStorageSync('buildingID').id;
  228. this.init()
  229. },
  230. onPullDownRefresh() {
  231. this.init()
  232. setTimeout(function () {
  233. uni.stopPullDownRefresh();
  234. }, 1000);
  235. },
  236. methods: {
  237. init(){
  238. this.newlisttabinfo1={
  239. avg:'',
  240. count:'',
  241. total:'',
  242. result:[],
  243. },
  244. this.newlisttabinfo2={
  245. avg:'',
  246. count:'',
  247. total:'',
  248. result:[],
  249. },
  250. this.newlisttabinfo3={
  251. avg:'',
  252. count:'',
  253. total:'',
  254. result:[],
  255. },
  256. this.newlisttabinfo4={
  257. avg:'',
  258. count:'',
  259. total:'',
  260. result:[],
  261. }
  262. var activeTotal=0;
  263. if(this.activeTotal==3){
  264. activeTotal=null;
  265. }else{
  266. activeTotal=this.activeTotal;
  267. this.lastEndDate='';
  268. this.lastStartDate='';
  269. }
  270. var promse={
  271. timeType:activeTotal,
  272. lastStartDate:this.lastStartDate,
  273. lastEndDate:this.lastEndDate,
  274. houseId:this.houseId
  275. }
  276. this.staffStatisticsReceptionTop10(promse)
  277. this.staffStatisticsRecordingTimTop10(promse)
  278. this.staffStatisticsExecutionRateTop10(promse)
  279. this.staffStatisticsProhibitedTop10(promse)
  280. },
  281. //接待量排名
  282. staffStatisticsReceptionTop10(promse){
  283. this.$u.post('/cusLvStatistics/staffStatisticsReceptionTop10',promse).then(res=>{
  284. res.result.forEach(item=>{
  285. item.zxl=item.data
  286. item.name=item.accountName
  287. })
  288. res.result=this.dealData(res.result)
  289. this.newlisttabinfo1=res;
  290. })
  291. },
  292. //录音时长
  293. staffStatisticsRecordingTimTop10(promse){
  294. this.$u.post('/cusLvStatistics/staffStatisticsRecordingTimTop10',promse).then(res=>{
  295. res.result.forEach(item=>{
  296. item.zxl=item.data
  297. item.name=item.accountName
  298. })
  299. res.result=this.dealData(res.result)
  300. this.newlisttabinfo2=res;
  301. })
  302. },
  303. //销讲
  304. staffStatisticsExecutionRateTop10(promse){
  305. this.$u.post('/cusLvStatistics/staffStatisticsExecutionRateTop10',promse).then(res=>{
  306. res.result.forEach(item=>{
  307. item.zxl=item.data;
  308. item.zxl1=item.data;
  309. item.name=item.accountName
  310. })
  311. this.newlisttabinfo3=res;
  312. })
  313. },
  314. //j禁忌
  315. staffStatisticsProhibitedTop10(promse){
  316. this.$u.post('/cusLvStatistics/staffStatisticsProhibitedTop10',promse).then(res=>{
  317. res.result.forEach(item=>{
  318. item.zxl=item.data
  319. item.name=item.accountName
  320. })
  321. res.result=this.dealData(res.result)
  322. this.newlisttabinfo4=res;
  323. })
  324. },
  325. //自定义时间
  326. totalTimeChange(e) {
  327. console.log(e.startDate, e.endDate)
  328. this.activeTotal=3;
  329. this.lastEndDate=e.endDate
  330. this.lastStartDate=e.startDate
  331. this.init()
  332. },
  333. //时间切换
  334. tabtimetap(index) {
  335. if (index == 3) {
  336. this.totalTimeShow = true;
  337. } else {
  338. this.activeTotal = index;
  339. this.lastEndDate='';
  340. this.lastStartDate='';
  341. this.init()
  342. }
  343. },
  344. // 定义一个公共方法对数据进行处理
  345. dealData(arr){
  346. // 获取最大值
  347. let num=Math.max.apply(Math, arr.map(function (o) { return o.zxl })) //结果:3
  348. // console.log(num)
  349. // if(num>100){
  350. // // 获取最大值的下标
  351. // // let idx=arr.findIndex(item=>item.zxl==num)
  352. // // console.log(idx,123)
  353. // arr.map(item=>{
  354. // item.zxl1=Math.floor(item.zxl/num*100)
  355. // })
  356. // // console.log(arr)
  357. // return arr
  358. // }else{
  359. // arr.map(item=>{
  360. // item.zxl1=item.zxl
  361. // })
  362. // return arr
  363. // }
  364. arr.map(item=>{
  365. item.zxl1=Math.floor(item.zxl/num*100)
  366. })
  367. return arr
  368. },
  369. }
  370. };
  371. </script>
  372. <style lang="scss" scoped>
  373. .box {
  374. width: 100%;
  375. height: 100%;
  376. background: #FAFAFA;
  377. padding-bottom: 60rpx;
  378. }
  379. .hejisan{
  380. width: 92%;
  381. margin: 0 auto;
  382. display: flex;
  383. padding-top: 20rpx;
  384. padding-bottom:20rpx;
  385. .text1-1{
  386. color: #666666;
  387. }
  388. .text1-2{
  389. color: #333333;
  390. margin-top: 10rpx;
  391. }
  392. }
  393. </style>