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.
 
 
 
 

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