Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 

359 строки
11 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: 35%;">
  58. <view class="text1-1">合计</view>
  59. <view class="text1-2">{{newlisttabinfo2.total}}</view>
  60. </view>
  61. <view class="sanbox1" style="width: 40%;">
  62. <view class="text1-1">顾问</view>
  63. <view class="text1-2">{{newlisttabinfo2.count}}</view>
  64. </view>
  65. <view class="sanbox1" style="width: 25%;">
  66. <view class="text1-1">人均录音时长</view>
  67. <view class="text1-2">{{newlisttabinfo2.avg}}</view>
  68. </view>
  69. </view>
  70. <view class="jindu" style="height: 360rpx;overflow: auto;">
  71. <view v-if="newlisttabinfo2.result.length!=0" class="jindu-box" v-for="(item,index) in newlisttabinfo2.result" :key="index">
  72. <view class="jindu-boxche">
  73. <view class="jindu-name" v-if="item.name">{{item.name.substring(0,4)}}</view>
  74. <view style="width: 440rpx;margin-left: 10rpx;">
  75. <u-line-progress height="24" :show-percent="false" active-color="#FBA448" :percent="item.zxl1"></u-line-progress>
  76. </view>
  77. <view class="jindu-zxl">{{item.zxl==null?0:item.zxl}}</view>
  78. </view>
  79. </view>
  80. <view v-if="newlisttabinfo2.result.length==0" style="width: 100%;text-align: center;margin-top: 60rpx;">
  81. 暂无数据
  82. </view>
  83. </view>
  84. </view>
  85. <view style="width: 100%;height: 20rpx;background: #FAFAFA;"></view>
  86. <view class="single">
  87. <view class="title">
  88. <view class="title1" style="flex: 1;">销讲执行率排行(TOP10)</view>
  89. </view>
  90. <view class="hejisan">
  91. <view class="sanbox1" style="width: 40%;">
  92. <view class="text1-1">顾问</view>
  93. <view class="text1-2">{{newlisttabinfo3.count}}</view>
  94. </view>
  95. <view class="sanbox1" style="width: 25%;">
  96. <view class="text1-1">人均执行率</view>
  97. <view class="text1-2">{{newlisttabinfo3.avg}}</view>
  98. </view>
  99. </view>
  100. <view class="jindu" style="height: 360rpx;overflow: auto;">
  101. <view v-if="newlisttabinfo3.result.length!=0" class="jindu-box" v-for="(item,index) in newlisttabinfo3.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="newlisttabinfo3.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. <u-calendar v-model="totalTimeShow" mode="range" @change="totalTimeChange"></u-calendar>
  150. </view>
  151. </template>
  152. <script>
  153. var app = getApp();
  154. var util = require("../../../utils/util.js");
  155. var config = require("../../../config");
  156. export default {
  157. data() {
  158. return {
  159. activeTotal: 4,
  160. totalTimeShow: false,
  161. // 楼盘id
  162. houseId:'',
  163. lastEndDate:'',
  164. lastStartDate:'',
  165. newlisttabinfo1:{
  166. avg:'',
  167. count:'',
  168. total:'',
  169. result:[],
  170. },
  171. newlisttabinfo2:{
  172. avg:'',
  173. count:'',
  174. total:'',
  175. result:[],
  176. },
  177. newlisttabinfo3:{
  178. avg:'',
  179. count:'',
  180. total:'',
  181. result:[],
  182. },
  183. newlisttabinfo4:{
  184. avg:'',
  185. count:'',
  186. total:'',
  187. result:[],
  188. },
  189. };
  190. },
  191. onLoad() {
  192. // 获取楼盘id
  193. this.houseId = uni.getStorageSync('buildingID').id;
  194. this.init()
  195. },
  196. methods: {
  197. init(){
  198. this.newlisttabinfo1={
  199. avg:'',
  200. count:'',
  201. total:'',
  202. result:[],
  203. },
  204. this.newlisttabinfo2={
  205. avg:'',
  206. count:'',
  207. total:'',
  208. result:[],
  209. },
  210. this.newlisttabinfo3={
  211. avg:'',
  212. count:'',
  213. total:'',
  214. result:[],
  215. },
  216. this.newlisttabinfo4={
  217. avg:'',
  218. count:'',
  219. total:'',
  220. result:[],
  221. }
  222. var activeTotal=0;
  223. if(this.activeTotal==3){
  224. activeTotal=null;
  225. }else{
  226. activeTotal=this.activeTotal;
  227. this.lastEndDate='';
  228. this.lastStartDate='';
  229. }
  230. var promse={
  231. timeType:activeTotal,
  232. lastStartDate:this.lastStartDate,
  233. lastEndDate:this.lastEndDate,
  234. houseId:this.houseId
  235. }
  236. this.staffStatisticsReceptionTop10(promse)
  237. this.staffStatisticsRecordingTimTop10(promse)
  238. this.staffStatisticsExecutionRateTop10(promse)
  239. this.staffStatisticsProhibitedTop10(promse)
  240. },
  241. //接待量排名
  242. staffStatisticsReceptionTop10(promse){
  243. this.$u.post('/cusLvStatistics/staffStatisticsReceptionTop10',promse).then(res=>{
  244. res.result.forEach(item=>{
  245. item.zxl=item.data
  246. item.name=item.accountName
  247. })
  248. res.result=this.dealData(res.result)
  249. this.newlisttabinfo1=res;
  250. })
  251. },
  252. //录音时长
  253. staffStatisticsRecordingTimTop10(promse){
  254. this.$u.post('/cusLvStatistics/staffStatisticsRecordingTimTop10',promse).then(res=>{
  255. res.result.forEach(item=>{
  256. item.zxl=item.data
  257. item.name=item.accountName
  258. })
  259. res.result=this.dealData(res.result)
  260. this.newlisttabinfo2=res;
  261. })
  262. },
  263. //销讲
  264. staffStatisticsExecutionRateTop10(promse){
  265. this.$u.post('/cusLvStatistics/staffStatisticsExecutionRateTop10',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.newlisttabinfo3=res;
  272. })
  273. },
  274. //j禁忌
  275. staffStatisticsProhibitedTop10(promse){
  276. this.$u.post('/cusLvStatistics/staffStatisticsProhibitedTop10',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.newlisttabinfo4=res;
  283. })
  284. },
  285. //自定义时间
  286. totalTimeChange(e) {
  287. console.log(e.startDate, e.endDate)
  288. this.activeTotal=3;
  289. this.lastEndDate=e.endDate
  290. this.lastStartDate=e.startDate
  291. this.init()
  292. },
  293. //时间切换
  294. tabtimetap(index) {
  295. if (index == 3) {
  296. this.totalTimeShow = true;
  297. } else {
  298. this.activeTotal = index;
  299. this.lastEndDate='';
  300. this.lastStartDate='';
  301. this.init()
  302. }
  303. },
  304. // 定义一个公共方法对数据进行处理
  305. dealData(arr){
  306. // 获取最大值
  307. let num=Math.max.apply(Math, arr.map(function (o) { return o.zxl })) //结果:3
  308. // console.log(num)
  309. if(num>100){
  310. // 获取最大值的下标
  311. // let idx=arr.findIndex(item=>item.zxl==num)
  312. // console.log(idx,123)
  313. arr.map(item=>{
  314. item.zxl1=Math.floor(item.zxl/num*100)
  315. })
  316. // console.log(arr)
  317. return arr
  318. }else{
  319. arr.map(item=>{
  320. item.zxl1=item.zxl
  321. })
  322. return arr
  323. }
  324. },
  325. }
  326. };
  327. </script>
  328. <style lang="scss" scoped>
  329. .box {
  330. width: 100%;
  331. height: 100%;
  332. background: #FAFAFA;
  333. padding-bottom: 60rpx;
  334. }
  335. .hejisan{
  336. width: 92%;
  337. margin: 0 auto;
  338. display: flex;
  339. padding-top: 20rpx;
  340. padding-bottom:20rpx;
  341. .text1-1{
  342. color: #666666;
  343. }
  344. .text1-2{
  345. color: #333333;
  346. margin-top: 10rpx;
  347. }
  348. }
  349. </style>