Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 

483 righe
14 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">接待量(TOP10)</view>
  21. </view>
  22. <view class="hejibox">
  23. <view class="heji">楼盘:{{newTeam1||0}}</view>
  24. <view class="heji">均值:{{newAvg1||0}}</view>
  25. </view>
  26. <view class="jindu">
  27. <scroll-view style="height: 300rpx;" scroll-y="true" >
  28. <view class="jindu-box" v-for="(item,index) in newlisttabinfo1" :key="index">
  29. <view class="jindu-boxche">
  30. <view class="jindu-name">{{item.name.substring(0, 4)}}</view>
  31. <view style="width: 440rpx;margin-left: 10rpx;">
  32. <u-line-progress height="24" :show-percent="false" active-color="#FBA448" :percent="item.zxl1"></u-line-progress>
  33. </view>
  34. <view class="jindu-zxl">{{item.zxl==null?0:item.zxl}}</view>
  35. </view>
  36. </view>
  37. </scroll-view>
  38. </view>
  39. </view>
  40. <view style="width: 100%;height: 20rpx;background: #FAFAFA;"></view>
  41. <view class="single">
  42. <view class="title">
  43. <view class="title1">接待时长(TOP10)</view>
  44. </view>
  45. <view class="hejibox">
  46. <view class="heji">楼盘:{{newTeam2||0}}</view>
  47. <view class="heji">均值:{{newAvg2||0}}</view>
  48. </view>
  49. <view class="jindu">
  50. <scroll-view style="height: 300rpx;" scroll-y="true" >
  51. <view class="jindu-box" v-for="(item,index) in newlisttabinfo2" :key="index">
  52. <view class="jindu-boxche">
  53. <view class="jindu-name">{{item.name.substring(0, 4)}}</view>
  54. <view style="width: 440rpx;margin-left: 10rpx;">
  55. <u-line-progress height="24" :show-percent="false" active-color="#4FC78F" :percent="item.zxl1"></u-line-progress>
  56. </view>
  57. <view class="jindu-zxl">{{item.zxl==null?0:item.zxl}}</view>
  58. </view>
  59. </view>
  60. </scroll-view>
  61. </view>
  62. </view>
  63. <view style="width: 100%;height: 20rpx;background: #FAFAFA;"></view>
  64. <view class="single">
  65. <view class="title">
  66. <view class="title1" style="flex: 1;">销讲执行排名(TOP10)</view>
  67. <!-- <view class="title3" style="flex: 1;">
  68. <view class="title3-box">
  69. <view style="height: 42rpx;" :class="{ activecltab: activeTotal2 == 0 }">执行率</view>
  70. </view>
  71. <view class="title3-box">
  72. <view style="height: 42rpx;" :class="{ activecltab: activeTotal2 == 1 }">得分</view>
  73. </view>
  74. </view> -->
  75. </view>
  76. <view class="hejibox">
  77. <view class="heji">楼盘:{{newTeam3||0}}</view>
  78. <view class="heji">均值:{{newAvg3||0}}%</view>
  79. </view>
  80. <view class="jindu">
  81. <scroll-view style="height: 300rpx;" scroll-y="true" >
  82. <view class="jindu-box" v-for="(item,index) in newlisttabinfo3" :key="index">
  83. <view class="jindu-boxche">
  84. <view class="jindu-name">{{item.name.substring(0, 4)}}</view>
  85. <view style="width: 440rpx;margin-left: 10rpx;">
  86. <u-line-progress height="24" :show-percent="false" active-color="#9B6BDF" :percent="item.zxl1"></u-line-progress>
  87. </view>
  88. <view class="jindu-zxl">{{item.zxl==null?0:item.zxl}}%</view>
  89. </view>
  90. </view>
  91. </scroll-view>
  92. </view>
  93. </view>
  94. <view style="width: 100%;height: 20rpx;background: #FAFAFA;"></view>
  95. <view class="single">
  96. <view class="title">
  97. <view class="title1" style="flex: 1;">顾问执行排名(TOP10)</view>
  98. <!-- <view class="title3" style="flex: 1;">
  99. <view class="title3-box">
  100. <view style="height: 42rpx;" :class="{ activecltab: activeTotal2 == 0 }">执行率</view>
  101. </view>
  102. <view class="title3-box">
  103. <view style="height: 42rpx;" :class="{ activecltab: activeTotal2 == 1 }">得分</view>
  104. </view>
  105. </view> -->
  106. </view>
  107. <!-- <view class="hejibox">
  108. <view class="heji">楼盘:{{newTeam4||0}}</view>
  109. <view class="heji">均值:{{newAvg4||0}}</view>
  110. </view> -->
  111. <view class="jindu">
  112. <scroll-view style="height: 300rpx;" scroll-y="true" >
  113. <view class="jindu-box" v-for="(item,index) in newlisttabinfo4" :key="index">
  114. <view class="jindu-boxche">
  115. <view class="jindu-name">{{item.name.substring(0, 4)}}</view>
  116. <view style="width: 440rpx;margin-left: 10rpx;">
  117. <u-line-progress height="24" :show-percent="false" active-color="#9B6BDF" :percent="item.zxl1"></u-line-progress>
  118. </view>
  119. <view class="jindu-zxl">{{item.zxl==null?0:item.zxl}}%</view>
  120. </view>
  121. </view>
  122. </scroll-view>
  123. </view>
  124. </view>
  125. <view style="width: 100%;height: 20rpx;background: #FAFAFA;"></view>
  126. <view class="single">
  127. <view class="title" style="padding-right: 30rpx;">
  128. <view class="title1" style="flex: 1;">销讲能力</view>
  129. <!-- <view class="title2" style="flex: 1;justify-content: flex-end;" @click="Groupcontrast">
  130. <view class="title2-che">楼盘
  131. <image class="righttochoose" src="../../../static/images/righttochoose.png" mode=""></image>
  132. </view>
  133. </view> -->
  134. <view class="title2" style="flex: 1;justify-content: flex-end;" @click="staffShow=true">
  135. <view class="title2-che" style="width: auto;"><text style="margin-right: 40rpx;">{{staff.label}}</text>
  136. <image class="righttochoose" src="../../../static/images/righttochoose.png" mode=""></image>
  137. </view>
  138. </view>
  139. </view>
  140. <!-- <view class="hejibox">
  141. <view class="heji">楼盘:50</view>
  142. <view class="heji">均值:25</view>
  143. </view> -->
  144. <view class="uchaserbox">
  145. <qiun-data-charts
  146. type="radar"
  147. :opts="opts"
  148. :chartData="chartData"
  149. :canvas2d="true"
  150. canvasId="wangxiaohuaerlingeryilingwuyib88"
  151. background="none"
  152. />
  153. </view>
  154. </view>
  155. <!-- <view style="width: 100%;height: 20rpx;background: #FAFAFA;"></view>
  156. <view class="single">
  157. <view class="title">
  158. <view class="title1">禁忌执行率(TOP10)</view>
  159. </view>
  160. <view class="hejibox">
  161. <view class="heji">合计:50</view>
  162. <view class="heji">均值:25</view>
  163. </view>
  164. <view class="jindu">
  165. <view class="jindu-box" v-for="(item,index) in newlisttabinfo" :key="index">
  166. <view class="jindu-boxche">
  167. <view class="jindu-name">{{item.name.substring(0, 4)}}</view>
  168. <view style="width: 440rpx;margin-left: 10rpx;">
  169. <u-line-progress height="24" :show-percent="false" active-color="#E6625B" :percent="item.zxl"></u-line-progress>
  170. </view>
  171. <view class="jindu-zxl">{{item.zxl==null?0:item.zxl}}%</view>
  172. </view>
  173. </view>
  174. </view>
  175. </view> -->
  176. <view style="width: 100%;height: 20rpx;background: #FAFAFA;"></view>
  177. <!-- <view class="single">
  178. <view class="title" style="padding-right: 30rpx;">
  179. <view class="title1" style="flex: 1;">违禁能力(TOP10)</view>
  180. <view class="title2" style="flex: 1;justify-content: flex-end;">
  181. <view class="title2-che">楼盘
  182. <image class="righttochoose" src="../../../static/images/righttochoose.png" mode=""></image>
  183. </view>
  184. </view>
  185. </view>
  186. <view class="hejibox">
  187. <view class="heji">合计:50</view>
  188. <view class="heji">均值:25</view>
  189. </view>
  190. <view class="uchaserbox">
  191. <qiun-data-charts
  192. type="radar"
  193. :chartData="chartData"
  194. :canvas2d="true"
  195. canvasId="wangxiaohuaerlingeryilingwuyib89"
  196. background="none"
  197. />
  198. </view>
  199. </view> -->
  200. <u-calendar v-model="totalTimeShow" mode="range" @change="totalTimeChange"></u-calendar>
  201. <!-- 选择楼盘 -->
  202. <u-select v-model="staffShow" :list="staffList" @confirm="staffSelectCallback" :default-value='selindex'></u-select>
  203. </view>
  204. </template>
  205. <script>
  206. var app = getApp();
  207. var util = require("../../../utils/util.js");
  208. var config = require("../../../config");
  209. export default {
  210. data() {
  211. return {
  212. activeTotal: 4,
  213. activeTotal2: 0,
  214. bocindex:0,
  215. totalTimeShow: false,
  216. // 楼盘id
  217. houseId:'',
  218. staffShow:false,
  219. staffList:[],
  220. lastStartDate:'',
  221. lastEndDate :'',
  222. newTeam1:'',
  223. newAvg1:'',
  224. newTeam2:'',
  225. newAvg2:'',
  226. newTeam3:'',
  227. newAvg3:'',
  228. newTeam4:'',
  229. newAvg4:'',
  230. staff:{
  231. value:'',
  232. label:''
  233. },
  234. newlisttabinfo1:[
  235. {name:'接待量',zxl:'10'},
  236. {name:'平均执行率',zxl:'50'},
  237. {name:'接待客户',zxl:'80'},
  238. ],
  239. newlisttabinfo2:[
  240. {name:'接待量',zxl:'10'},
  241. {name:'平均执行率',zxl:'50'},
  242. {name:'接待客户',zxl:'80'},
  243. ],
  244. newlisttabinfo3:[
  245. {name:'接待量',zxl:'10'},
  246. {name:'平均执行率',zxl:'50'},
  247. {name:'接待客户',zxl:'80'},
  248. ],
  249. newlisttabinfo4:[
  250. {name:'接待量',zxl:'10'},
  251. {name:'平均执行率',zxl:'50'},
  252. {name:'接待客户',zxl:'80'},
  253. ],
  254. chartData:{
  255. "categories": ["维度1","维度2","维度3","维度4","维度5","维度6"],
  256. "series": [
  257. {
  258. "name": "成交量",
  259. "data": [90,110,165,195,187,172]
  260. }
  261. ]
  262. },
  263. opts: {
  264. fontSize: 10,
  265. extra: {
  266. radar: {
  267. max: ''
  268. }
  269. }
  270. }
  271. };
  272. },
  273. onLoad() {
  274. let that=this
  275. uni.$on('updateGroup',function(data){
  276. console.log(data)
  277. that.houseId=data.arr.join(',')
  278. // 获取销奖能力
  279. that.getPowerList()
  280. })
  281. this.getSectionList()
  282. },
  283. methods: {
  284. // 获取部门列表
  285. getSectionList(){
  286. this.$u.post('/user/getHouseByToken',)
  287. .then(res=>{
  288. // console.log(res)
  289. this.staffList=[]
  290. res.map((item,index)=>{
  291. let obj={}
  292. obj.value=item.id
  293. obj.label=item.propertyName
  294. this.staffList.push(obj)
  295. })
  296. this.houseId=this.staffList[0].value
  297. this.staff=this.staffList[0]
  298. this.getdata()
  299. // console.log(this.staffList,this.staffList,this.houseId)
  300. })
  301. },
  302. //指标执行率分析tab
  303. tapspagek2(index) {
  304. this.bocindex = index;
  305. },
  306. staffSelectCallback(e){
  307. this.staff=e[0]
  308. this.houseId=e[0].value
  309. this.getPowerList()
  310. },
  311. getdata(){
  312. // 请求接口获取接待量
  313. this.receptionCountList('1','/cusLvStatistics/groupComparisonReception')
  314. // 接待时长
  315. this.receptionCountList('2','/cusLvStatistics/groupComparisonReceptionTime')
  316. // 小将排名
  317. this.receptionCountList('3','/cusLvStatistics/groupComparisonTalkRank')
  318. // 顾问牌名
  319. this.receptionCountList('4','/cusLvStatistics/groupComparisonTalkRankByConsultant')
  320. // 销奖能力
  321. this.getPowerList()
  322. },
  323. //时间切换
  324. tabtimetap(index) {
  325. if (index == 3) {
  326. this.totalTimeShow = true;
  327. } else {
  328. this.activeTotal = index;
  329. this.lastEndDate=''
  330. this.lastStartDate=''
  331. this.getdata()
  332. // // 获取数据
  333. // // 团队对比接待量
  334. // this.receptionCountList(0,1,'/cusLvStatistics/teamAnalysisReception')
  335. // // 团队对比接待时长
  336. // this.receptionCountList(0,2,'/cusLvStatistics/teamAnalysisReceptionTime')
  337. // /* 销奖执行率 */
  338. // this.receptionCountList(0,3,'/cusLvStatistics/teamAnalysisExecutionRate')
  339. // // 获取销奖能力
  340. // this.getPowerList()
  341. }
  342. },
  343. // 接待时长
  344. receptionCountList(index,url){
  345. this.$u.post(url,{
  346. timeType:this.lastEndDate?null:this.activeTotal+'',
  347. lastEndDate:this.lastEndDate,
  348. lastStartDate:this.lastStartDate
  349. })
  350. .then(res=>{
  351. // console.log(res)
  352. let result=res.result
  353. this['newTeam'+index]=res.avg[0]
  354. this['newAvg'+index]=res.avg[1]
  355. // return
  356. // 处理数据
  357. // 先处理牌名数据,需要进行判断全部还是单个
  358. // 当为全部时
  359. this['newlisttabinfo'+index]=[]
  360. // 当选择全部时
  361. let arr=[]
  362. // 当两个都选择的时候
  363. result.map(item=>{
  364. let obj={}
  365. obj.name=item.houseName
  366. obj.zxl=item.data
  367. arr.push(obj)
  368. })
  369. arr=this.dealData(arr)
  370. this['newlisttabinfo'+index]=arr
  371. })
  372. },
  373. // 获取销奖能力
  374. getPowerList(){
  375. this.$u.post('/cusLvStatistics/groupComparisonMarketingAbility',{
  376. houseIds:this.houseId,
  377. timeType:this.lastEndDate?null:this.activeTotal+'',
  378. lastEndDate:this.lastEndDate,
  379. lastStartDate:this.lastStartDate
  380. })
  381. .then(res=>{
  382. // console.log(res,123)
  383. // 处理数据
  384. // return
  385. this.chartData={
  386. categories:[],
  387. series:[]
  388. }
  389. let allobj={
  390. categories:[],
  391. series:[]
  392. }
  393. let max = 0;
  394. res.result.map((item,index)=>{
  395. let obj={
  396. name:item[0].houseName,
  397. data:[]
  398. }
  399. item.map(item1=>{
  400. if(index==0){
  401. allobj.categories.push(item1.name)
  402. }
  403. obj.data.push(item1.avgExecutionRate)
  404. if (max < item1.avgExecutionRate) max = item1.avgExecutionRate;
  405. })
  406. allobj.series.push(obj)
  407. })
  408. // console.log(allobj)
  409. this.opts.extra.radar.max = max + 25
  410. this.chartData=allobj
  411. this.$forceUpdate()
  412. })
  413. },
  414. //自定义时间
  415. totalTimeChange(e) {
  416. console.log(e.startDate, e.endDate)
  417. this.activeTotal=3;
  418. this.lastEndDate=e.endDate
  419. this.lastStartDate=e.startDate
  420. this.getdata()
  421. },
  422. //集团对比
  423. Groupcontrast(){
  424. uni.navigateTo({
  425. url: `/pages/center/Piabodata/selectGroup?ids=${this.houseId}`
  426. });
  427. },
  428. // 定义一个公共方法对数据进行处理
  429. dealData(arr){
  430. // 获取最大值
  431. let num=Math.max.apply(Math, arr.map(function (o) { return o.zxl })) //结果:3
  432. // console.log(num)
  433. if(num>100){
  434. // 获取最大值的下标
  435. // let idx=arr.findIndex(item=>item.zxl==num)
  436. // console.log(idx,123)
  437. arr.map(item=>{
  438. item.zxl1=Math.floor(item.zxl/num*100)
  439. })
  440. // console.log(arr)
  441. return arr
  442. }else{
  443. arr.map(item=>{
  444. item.zxl1=item.zxl
  445. })
  446. return arr
  447. }
  448. },
  449. }
  450. };
  451. </script>
  452. <style lang="scss" scoped>
  453. .box {
  454. width: 100%;
  455. height: 100%;
  456. background: #FAFAFA;
  457. padding-bottom: 60rpx;
  458. }
  459. </style>