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.
 
 
 

468 lignes
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. :chartData="chartData"
  148. :canvas2d="true"
  149. canvasId="wangxiaohuaerlingeryilingwuyib88"
  150. background="none"
  151. :loadingType="0"
  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": [],
  256. "series": [
  257. ]
  258. }
  259. };
  260. },
  261. onLoad() {
  262. let that=this
  263. uni.$on('updateGroup',function(data){
  264. console.log(data)
  265. that.houseId=data.arr.join(',')
  266. // 获取销奖能力
  267. that.getPowerList()
  268. })
  269. this.getSectionList()
  270. },
  271. methods: {
  272. // 获取部门列表
  273. getSectionList(){
  274. this.$u.post('/user/getHouseByToken',)
  275. .then(res=>{
  276. // console.log(res)
  277. this.staffList=[]
  278. res.map((item,index)=>{
  279. let obj={}
  280. obj.value=item.id
  281. obj.label=item.propertyName
  282. this.staffList.push(obj)
  283. })
  284. this.houseId=this.staffList[0].value
  285. this.staff=this.staffList[0]
  286. this.getdata()
  287. // console.log(this.staffList,this.staffList,this.houseId)
  288. })
  289. },
  290. //指标执行率分析tab
  291. tapspagek2(index) {
  292. this.bocindex = index;
  293. },
  294. staffSelectCallback(e){
  295. this.staff=e[0]
  296. this.houseId=e[0].value
  297. this.getPowerList()
  298. },
  299. getdata(){
  300. // 请求接口获取接待量
  301. this.receptionCountList('1','/cusLvStatistics/groupComparisonReception')
  302. // 接待时长
  303. this.receptionCountList('2','/cusLvStatistics/groupComparisonReceptionTime')
  304. // 小将排名
  305. this.receptionCountList('3','/cusLvStatistics/groupComparisonTalkRank')
  306. // 顾问牌名
  307. this.receptionCountList('4','/cusLvStatistics/groupComparisonTalkRankByConsultant')
  308. // 销奖能力
  309. this.getPowerList()
  310. },
  311. //时间切换
  312. tabtimetap(index) {
  313. if (index == 3) {
  314. this.totalTimeShow = true;
  315. } else {
  316. this.activeTotal = index;
  317. this.lastEndDate=''
  318. this.lastStartDate=''
  319. this.getdata()
  320. // // 获取数据
  321. // // 团队对比接待量
  322. // this.receptionCountList(0,1,'/cusLvStatistics/teamAnalysisReception')
  323. // // 团队对比接待时长
  324. // this.receptionCountList(0,2,'/cusLvStatistics/teamAnalysisReceptionTime')
  325. // /* 销奖执行率 */
  326. // this.receptionCountList(0,3,'/cusLvStatistics/teamAnalysisExecutionRate')
  327. // // 获取销奖能力
  328. // this.getPowerList()
  329. }
  330. },
  331. // 接待时长
  332. receptionCountList(index,url){
  333. this.$u.post(url,{
  334. timeType:this.lastEndDate?null:this.activeTotal+'',
  335. lastEndDate:this.lastEndDate,
  336. lastStartDate:this.lastStartDate
  337. })
  338. .then(res=>{
  339. // console.log(res)
  340. let result=res.result
  341. this['newTeam'+index]=res.avg[0]
  342. this['newAvg'+index]=res.avg[1]
  343. // return
  344. // 处理数据
  345. // 先处理牌名数据,需要进行判断全部还是单个
  346. // 当为全部时
  347. this['newlisttabinfo'+index]=[]
  348. // 当选择全部时
  349. let arr=[]
  350. // 当两个都选择的时候
  351. result.map(item=>{
  352. let obj={}
  353. obj.name=item.houseName
  354. obj.zxl=item.data
  355. arr.push(obj)
  356. })
  357. arr=this.dealData(arr)
  358. this['newlisttabinfo'+index]=arr
  359. })
  360. },
  361. // 获取销奖能力
  362. getPowerList(){
  363. this.chartData={
  364. categories:[],
  365. series:[]
  366. }
  367. this.$u.post('/cusLvStatistics/groupComparisonMarketingAbility',{
  368. houseIds:this.houseId,
  369. timeType:this.lastEndDate?null:this.activeTotal+'',
  370. lastEndDate:this.lastEndDate,
  371. lastStartDate:this.lastStartDate
  372. })
  373. .then(res=>{
  374. let allobj={
  375. categories:[],
  376. series:[]
  377. }
  378. if(res.result!=0){
  379. res.result.map((item,index)=>{
  380. let obj={
  381. name:item[0].houseName,
  382. data:[]
  383. }
  384. item.map(item1=>{
  385. if(index==0){
  386. allobj.categories.push(item1.name)
  387. }
  388. obj.data.push(item1.avgExecutionRate)
  389. })
  390. allobj.series.push(obj)
  391. })
  392. this.chartData=allobj
  393. this.$forceUpdate()
  394. }
  395. })
  396. },
  397. //自定义时间
  398. totalTimeChange(e) {
  399. console.log(e.startDate, e.endDate)
  400. this.activeTotal=3;
  401. this.lastEndDate=e.endDate
  402. this.lastStartDate=e.startDate
  403. this.getdata()
  404. },
  405. //集团对比
  406. Groupcontrast(){
  407. uni.navigateTo({
  408. url: `/pages/center/Piabodata/selectGroup?ids=${this.houseId}`
  409. });
  410. },
  411. // 定义一个公共方法对数据进行处理
  412. dealData(arr){
  413. // 获取最大值
  414. let num=Math.max.apply(Math, arr.map(function (o) { return o.zxl })) //结果:3
  415. // console.log(num)
  416. if(num>100){
  417. // 获取最大值的下标
  418. // let idx=arr.findIndex(item=>item.zxl==num)
  419. // console.log(idx,123)
  420. arr.map(item=>{
  421. item.zxl1=Math.floor(item.zxl/num*100)
  422. })
  423. // console.log(arr)
  424. return arr
  425. }else{
  426. arr.map(item=>{
  427. item.zxl1=item.zxl
  428. })
  429. return arr
  430. }
  431. },
  432. }
  433. };
  434. </script>
  435. <style lang="scss" scoped>
  436. .box {
  437. width: 100%;
  438. height: 100%;
  439. background: #FAFAFA;
  440. padding-bottom: 60rpx;
  441. }
  442. </style>