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

490 строки
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. onPullDownRefresh(){
  281. this.getSectionList()
  282. setTimeout(function () {
  283. uni.stopPullDownRefresh();
  284. }, 1000);
  285. },
  286. methods: {
  287. // 获取部门列表
  288. getSectionList(){
  289. this.$u.post('/user/getHouseByToken',)
  290. .then(res=>{
  291. // console.log(res)
  292. this.staffList=[]
  293. res.map((item,index)=>{
  294. let obj={}
  295. obj.value=item.id
  296. obj.label=item.propertyName
  297. this.staffList.push(obj)
  298. })
  299. this.houseId=this.staffList[0].value
  300. this.staff=this.staffList[0]
  301. this.getdata()
  302. // console.log(this.staffList,this.staffList,this.houseId)
  303. })
  304. },
  305. //指标执行率分析tab
  306. tapspagek2(index) {
  307. this.bocindex = index;
  308. },
  309. staffSelectCallback(e){
  310. this.staff=e[0]
  311. this.houseId=e[0].value
  312. this.getPowerList()
  313. },
  314. getdata(){
  315. // 请求接口获取接待量
  316. this.receptionCountList('1','/cusLvStatistics/groupComparisonReception')
  317. // 接待时长
  318. this.receptionCountList('2','/cusLvStatistics/groupComparisonReceptionTime')
  319. // 小将排名
  320. this.receptionCountList('3','/cusLvStatistics/groupComparisonTalkRank')
  321. // 顾问牌名
  322. this.receptionCountList('4','/cusLvStatistics/groupComparisonTalkRankByConsultant')
  323. // 销奖能力
  324. this.getPowerList()
  325. },
  326. //时间切换
  327. tabtimetap(index) {
  328. if (index == 3) {
  329. this.totalTimeShow = true;
  330. } else {
  331. this.activeTotal = index;
  332. this.lastEndDate=''
  333. this.lastStartDate=''
  334. this.getdata()
  335. // // 获取数据
  336. // // 团队对比接待量
  337. // this.receptionCountList(0,1,'/cusLvStatistics/teamAnalysisReception')
  338. // // 团队对比接待时长
  339. // this.receptionCountList(0,2,'/cusLvStatistics/teamAnalysisReceptionTime')
  340. // /* 销奖执行率 */
  341. // this.receptionCountList(0,3,'/cusLvStatistics/teamAnalysisExecutionRate')
  342. // // 获取销奖能力
  343. // this.getPowerList()
  344. }
  345. },
  346. // 接待时长
  347. receptionCountList(index,url){
  348. this.$u.post(url,{
  349. timeType:this.lastEndDate?null:this.activeTotal+'',
  350. lastEndDate:this.lastEndDate,
  351. lastStartDate:this.lastStartDate
  352. })
  353. .then(res=>{
  354. // console.log(res)
  355. let result=res.result
  356. this['newTeam'+index]=res.avg[0]
  357. this['newAvg'+index]=res.avg[1]
  358. // return
  359. // 处理数据
  360. // 先处理牌名数据,需要进行判断全部还是单个
  361. // 当为全部时
  362. this['newlisttabinfo'+index]=[]
  363. // 当选择全部时
  364. let arr=[]
  365. // 当两个都选择的时候
  366. result.map(item=>{
  367. let obj={}
  368. obj.name=item.houseName
  369. obj.zxl=item.data
  370. arr.push(obj)
  371. })
  372. arr=this.dealData(arr)
  373. this['newlisttabinfo'+index]=arr
  374. })
  375. },
  376. // 获取销奖能力
  377. getPowerList(){
  378. this.chartData={
  379. categories:[],
  380. series:[]
  381. }
  382. this.$u.post('/cusLvStatistics/groupComparisonMarketingAbility',{
  383. houseIds:this.houseId,
  384. timeType:this.lastEndDate?null:this.activeTotal+'',
  385. lastEndDate:this.lastEndDate,
  386. lastStartDate:this.lastStartDate
  387. })
  388. .then(res=>{
  389. let allobj={
  390. categories:[],
  391. series:[]
  392. }
  393. if(res.result!=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. })
  405. allobj.series.push(obj)
  406. })
  407. this.chartData=allobj
  408. this.$forceUpdate()
  409. }
  410. })
  411. },
  412. //自定义时间
  413. totalTimeChange(e) {
  414. console.log(e.startDate, e.endDate)
  415. this.activeTotal=3;
  416. this.lastEndDate=e.endDate
  417. this.lastStartDate=e.startDate
  418. this.getdata()
  419. },
  420. //集团对比
  421. Groupcontrast(){
  422. uni.navigateTo({
  423. url: `/pages/center/Piabodata/selectGroup?ids=${this.houseId}`
  424. });
  425. },
  426. // 定义一个公共方法对数据进行处理
  427. dealData(arr){
  428. // 获取最大值
  429. let num=Math.max.apply(Math, arr.map(function (o) { return o.zxl })) //结果:3
  430. // console.log(num)
  431. if(num>100){
  432. // 获取最大值的下标
  433. // let idx=arr.findIndex(item=>item.zxl==num)
  434. // console.log(idx,123)
  435. arr.map(item=>{
  436. item.zxl1=Math.floor(item.zxl/num*100)
  437. })
  438. // console.log(arr)
  439. return arr
  440. }else{
  441. arr.map(item=>{
  442. item.zxl1=item.zxl
  443. })
  444. return arr
  445. }
  446. },
  447. }
  448. };
  449. </script>
  450. <style lang="scss" scoped>
  451. .box {
  452. width: 100%;
  453. height: 100%;
  454. background: #FAFAFA;
  455. padding-bottom: 60rpx;
  456. }
  457. .boxtittab {
  458. position: sticky;
  459. top: var(--window-top);
  460. z-index: 999;
  461. }
  462. </style>