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.
 
 
 
 

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