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.
 
 
 

522 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="Piabodata-box">
  19. <view class="Piabodata" @click="toTrendAnalysis()">
  20. <view class="Piabodata-img">
  21. <image class="Piabodata-img1" src="../../../static/images/qushi.png" mode=""></image>
  22. </view>
  23. <view class="Piabodata-text">趋势分析</view>
  24. </view>
  25. <view class="Piabodata" @click="toStaffAnalysis()">
  26. <view class="Piabodata-img">
  27. <image class="Piabodata-img1" src="../../../static/images/yuangong.png" mode=""></image>
  28. </view>
  29. <view class="Piabodata-text">员工分析</view>
  30. </view>
  31. <view class="Piabodata" @click="toUserinsightinto()">
  32. <view class="Piabodata-img">
  33. <image class="Piabodata-img1" src="../../../static/images/yinghu.png" mode=""></image>
  34. </view>
  35. <view class="Piabodata-text">用户洞察</view>
  36. </view>
  37. <view class="Piabodata" @click="Theteamcompared()">
  38. <view class="Piabodata-img">
  39. <image class="Piabodata-img1" src="../../../static/images/tuandui.png" mode=""></image>
  40. </view>
  41. <view class="Piabodata-text">团队对比</view>
  42. </view>
  43. <view class="Piabodata" @click="Groupcontrast()">
  44. <view class="Piabodata-img">
  45. <image class="Piabodata-img1" src="../../../static/images/jituan.png" mode=""></image>
  46. </view>
  47. <view class="Piabodata-text">集团对比</view>
  48. </view>
  49. </view>
  50. <view style="width: 100%;height: 20rpx;background: #FAFAFA;"></view>
  51. <view class="boxzonglan">
  52. <view class="zonglantit">简报</view>
  53. <view class="zonglanbox">
  54. <view class="grid" v-for="(item,index) in numlist" :key="index">
  55. <view class="audonum">{{item.name}}</text></view>
  56. <view class="num">{{item.num}}</view>
  57. </view>
  58. </view>
  59. </view>
  60. <view style="width: 100%;height: 20rpx;background: #FAFAFA;"></view>
  61. <view class="single">
  62. <view class="title">
  63. <view class="title1">接待趋势</view>
  64. </view>
  65. <view class="swiper-box">
  66. <u-tabs-swiper ref="tabs" font-size="30" :bold="true" swiper-width="600" :current="bocindex" @change="tapspagek2($event,2)"
  67. inactive-color="#b1b1b1" active-color="#008ef2" :list="newlistoj" :is-scroll="true">
  68. </u-tabs-swiper>
  69. </view>
  70. <view class="hejibox">
  71. <view class="heji">合计:50</view>
  72. <view class="heji">均值:25</view>
  73. </view>
  74. <view class="danwei">来访(人)</view>
  75. <view class="uchaserbox">
  76. <qiun-data-charts
  77. type="line"
  78. :chartData="lineOptsect"
  79. background="none"
  80. :ontouch="true"
  81. canvasId="wangxiaohuaerlingilingwuyiba1"
  82. :canvas2d="true"
  83. />
  84. </view>
  85. </view>
  86. <view style="width: 100%;height: 20rpx;background: #FAFAFA;"></view>
  87. <view class="single">
  88. <view class="title" @click="staffShow1=true">
  89. <view class="title1">团队接待趋势</view>
  90. <view class="title2">
  91. <view class="title2-che" style="width: 220rpx;">{{team.label}}
  92. <image class="righttochoose" src="../../../static/images/righttochoose.png" mode=""></image>
  93. </view>
  94. <!-- <view class="title2-che">执行率
  95. <image class="righttochoose" src="../../../static/images/righttochoose.png" mode=""></image>
  96. </view> -->
  97. </view>
  98. </view>
  99. <view class="hejibox">
  100. <view class="heji">合计:50</view>
  101. <view class="heji">均值:25</view>
  102. </view>
  103. <view class="danwei">来访(人)</view>
  104. <view class="uchaserbox">
  105. <qiun-data-charts
  106. type="line"
  107. :chartData="lineOptsect1"
  108. background="none"
  109. :ontouch="true"
  110. canvasId="wangxiaohuaerlineryiliwuyibao"
  111. :canvas2d="true"
  112. />
  113. </view>
  114. </view>
  115. <view style="width: 100%;height: 20rpx;background: #FAFAFA;"></view>
  116. <view class="single">
  117. <view class="title">
  118. <view class="title1">员工接待趋势</view>
  119. <view class="title2" @click="staffShow=true">
  120. <view class="title2-che" style="width: 220rpx;">{{staff.label}}
  121. <image class="righttochoose" src="../../../static/images/righttochoose.png" mode=""></image>
  122. </view>
  123. <!-- <view class="title2-che">执行率
  124. <image class="righttochoose" src="../../../static/images/righttochoose.png" mode=""></image>
  125. </view> -->
  126. </view>
  127. </view>
  128. <view class="hejibox">
  129. <view class="heji">合计:50</view>
  130. <view class="heji">均值:25</view>
  131. </view>
  132. <view class="danwei">来访(人)</view>
  133. <view class="uchaserbox">
  134. <qiun-data-charts
  135. type="line"
  136. :chartData="lineOptsect2"
  137. background="none"
  138. :ontouch="true"
  139. canvasId="wangxiaohuaerlingeryilingwuyibao"
  140. :canvas2d="true"
  141. />
  142. </view>
  143. </view>
  144. <view style="width: 100%;height: 20rpx;background: #FAFAFA;"></view>
  145. <view class="single">
  146. <view class="title">
  147. <view class="title1">销讲维度执行率</view>
  148. <!-- <view class="title3">
  149. <view class="title3-box">
  150. <view style="height: 42rpx;" :class="{ activecltab: activeTotal2 == 0 }">执行率</view>
  151. </view>
  152. <view class="title3-box">
  153. <view style="height: 42rpx;" :class="{ activecltab: activeTotal2 == 1 }">得分</view>
  154. </view>
  155. </view> -->
  156. </view>
  157. <!-- <view class="hejibox">
  158. <view class="heji">合计:50</view>
  159. <view class="heji">均值:25</view>
  160. </view> -->
  161. <view class="jindu">
  162. <view class="jindu-box" v-for="(item,index) in newlisttabinfo" :key="index">
  163. <view class="jindu-boxche">
  164. <view class="jindu-name">{{item.name.substring(0, 4)}}</view>
  165. <view style="width: 440rpx;margin-left: 10rpx;">
  166. <u-line-progress height="24" :show-percent="false" active-color="#4FC78F" :percent="item.zxl"></u-line-progress>
  167. </view>
  168. <view class="jindu-zxl">{{item.zxl==null?0:item.zxl}}%</view>
  169. </view>
  170. </view>
  171. </view>
  172. </view>
  173. <view style="width: 100%;height: 20rpx;background: #FAFAFA;"></view>
  174. <view class="single">
  175. <view class="title">
  176. <view class="title1">销讲指标执行率</view>
  177. </view>
  178. <view class="swiper-box">
  179. <u-tabs-swiper ref="tabs" font-size="30" :bold="true" swiper-width="600" :current="bocindex" @change="tapspagek2"
  180. inactive-color="#b1b1b1" active-color="#008ef2" :list="newlistoj" :is-scroll="true">
  181. </u-tabs-swiper>
  182. </view>
  183. <view class="jindu">
  184. <view class="jindu-box" v-for="(item,index) in newlisttabinfo" :key="index">
  185. <view class="jindu-boxche">
  186. <view class="jindu-name">{{item.name.substring(0, 4)}}</view>
  187. <view style="width: 440rpx;margin-left: 10rpx;">
  188. <u-line-progress height="24" :show-percent="false" active-color="#4FC78F" :percent="item.zxl"></u-line-progress>
  189. </view>
  190. <view class="jindu-zxl">{{item.zxl==null?0:item.zxl}}%</view>
  191. </view>
  192. </view>
  193. </view>
  194. </view>
  195. <u-calendar v-model="totalTimeShow" mode="range" @change="totalTimeChange"></u-calendar>
  196. <u-select v-model="staffShow" :list="staffList" @confirm="staffSelectCallback($event,0)" :default-value='selindex'></u-select>
  197. <u-select v-model="staffShow1" :list="teamList" @confirm="staffSelectCallback($event,1)" :default-value='selindex'></u-select>
  198. </view>
  199. </template>
  200. <script>
  201. var app = getApp();
  202. var util = require("../../../utils/util.js");
  203. var config = require("../../../config");
  204. export default {
  205. data() {
  206. return {
  207. activeTotal: 4,
  208. activeTotal2: 0,
  209. houseId:'',
  210. timeobj:{
  211. statDateStart:'',
  212. statDateEnd:''
  213. },
  214. // 员工列表
  215. staffList:[],
  216. // 团队列表
  217. teamList:[],
  218. staffShow:false,
  219. staff:{
  220. value:'',
  221. label:''
  222. },
  223. team:{
  224. value:'',
  225. label:''
  226. },
  227. teamFlag:true,
  228. staffFlag:true,
  229. staffShow1:false,
  230. lastStartDate:'',
  231. lastEndDate :'',
  232. totalTimeShow: false,
  233. activeTab: 0,
  234. numlist:[
  235. {name:'接待量',num:'10'},
  236. {name:'平均执行率',num:'10'},
  237. {name:'接待客户',num:'10'},
  238. ],
  239. lineOptsect:{
  240. "categories": ["2016","2017","2018","2019","2020","2021"],
  241. "series": [
  242. {
  243. "name": "成交量",
  244. "data": [35,8,25,37,4,20]
  245. }
  246. ]
  247. },
  248. lineOptsect1:{
  249. "categories": ["2016","2017","2018","2019","2020","2021"],
  250. "series": [
  251. {
  252. "name": "成交量",
  253. "data": [35,8,25,37,4,20]
  254. }
  255. ]
  256. },
  257. lineOptsect2:{
  258. "categories": ["2016","2017","2018","2019","2020","2021"],
  259. "series": [
  260. {
  261. "name": "成交量",
  262. "data": [35,8,25,37,4,20]
  263. }
  264. ]
  265. },
  266. newlistoj:[
  267. {name:"接待量",id:1},
  268. {name:"平均执行率",id:2},
  269. {name:"接待客户",id:3},
  270. {name:"平均得分",id:4},
  271. {name:"录音时长",id:5},
  272. {name:"违禁预警",id:6},
  273. ],
  274. bocindex:0,
  275. newlisttabinfo:[
  276. {name:'接待量',zxl:'10'},
  277. {name:'平均执行率',zxl:'50'},
  278. {name:'接待客户',zxl:'80'},
  279. ],
  280. };
  281. },
  282. async onLoad() {
  283. // 获取楼盘id
  284. this.houseId = uni.getStorageSync('buildingID').id;
  285. // 获取数据看板
  286. // 获取员工
  287. this.getStaffList()
  288. // 获取团队
  289. this.getSectionList()
  290. // 获取团队是否显示权限
  291. },
  292. methods: {
  293. // 获取员工列表
  294. getStaffList(){
  295. this.$u.post('/cusLvStatistics/selectAllAccountIdByHouseId',{houseId:this.houseId})
  296. .then(res=>{
  297. // console.log(res,'123')
  298. res.map(item=>{
  299. let obj={}
  300. obj.value=item.accountId
  301. obj.label=item.name
  302. this.staffList.push(obj)
  303. })
  304. this.staff=this.staffList[0]
  305. this.getAward()
  306. })
  307. },
  308. // 获取团队列表
  309. getSectionList(){
  310. this.$u.post('/cusLvStatistics/findAllDeptIdByHouseId',{houseId:this.houseId})
  311. .then(res=>{
  312. this.staffList=[]
  313. this.staffList1=[]
  314. res.map(item=>{
  315. let obj={}
  316. obj.value=item.deptId
  317. obj.label=item.deptName
  318. this.teamList.push(obj)
  319. })
  320. this.team=this.teamList[0]
  321. this.receptionCountList()
  322. })
  323. },
  324. // 员工销奖趋势
  325. getAward(){
  326. this.$u.post('/cusLvStatistics/employeeAnalysisExacutiveRate',{
  327. userA:this.staff.value,
  328. userB:'',
  329. houseId:this.houseId,
  330. timeType:this.lastEndDate?null:this.activeTotal+'',
  331. lastEndDate:this.lastEndDate,
  332. lastStartDate:this.lastStartDate
  333. })
  334. .then(res=>{
  335. this.newTeam3=res.avg[0]
  336. this.newAvg3=res.avg[1]
  337. // console.log(res)
  338. let first=res.first
  339. let second=res.second
  340. this.lineOptsect2.categories=[]
  341. this.lineOptsect2.series=[
  342. {
  343. name:first[0].accountName,
  344. data:[]
  345. }
  346. ]
  347. first.map(item=>{
  348. this.lineOptsect2.categories.push(item.statDate.slice(5,10))
  349. this.lineOptsect2.series[0].data.push(item.sumFraction)
  350. })
  351. })
  352. },
  353. // 团队接待趋势
  354. receptionCountList(){
  355. // if(!this.team.value){
  356. // this.teamFlag=false
  357. // return
  358. // }
  359. this.$u.post('/cusLvStatistics/teamAnalysisExecutionRate',{
  360. deptIds:this.team.value,
  361. showRank:1,
  362. houseId:this.houseId,
  363. timeType:this.lastEndDate?null:this.activeTotal+'',
  364. lastEndDate:this.lastEndDate,
  365. lastStartDate:this.lastStartDate
  366. })
  367. .then(res=>{
  368. // console.log(res)
  369. let result=res.result
  370. this.newTeam=res.avg[0]
  371. this.newAvg=res.avg[1]
  372. // 当选择趋势时
  373. this.lineOptsect1={}
  374. let allobj={
  375. categories:[],
  376. series:[]
  377. }
  378. // 先处理时间
  379. // 当选择全部时
  380. // 当选择只有一个时
  381. let obj={}
  382. obj.data=[]
  383. obj.name=result[0][0].deptName
  384. result[0].map(item=>{
  385. allobj.categories.push(item.statDate.slice(5,10))
  386. obj.data.push(item.data)
  387. })
  388. allobj.series.push(obj)
  389. // 判断是否显示平均
  390. // 如果显示对比
  391. // if(this.timepickpickisshow){
  392. // let obj={}
  393. // obj.data=[]
  394. // obj.name='平均'
  395. // result[1].map(item=>{
  396. // obj.data.push(item.data)
  397. // })
  398. // allobj.series.push(obj)
  399. // }
  400. this.lineOptsect1=allobj
  401. })
  402. },
  403. //时间切换
  404. tabtimetap(index) {
  405. if (index == 3) {
  406. this.totalTimeShow = true;
  407. } else {
  408. this.activeTotal = index;
  409. this.lastEndDate=''
  410. this.lastStartDate=''
  411. this.getdata()
  412. }
  413. },
  414. // 获取数据
  415. getdata(){
  416. this.receptionCountList()
  417. },
  418. staffSelectCallback(e,idx){
  419. if(idx==0){
  420. this.staff=e[0]
  421. this.getAward()
  422. }else{
  423. this.team=e[0]
  424. this.receptionCountList()
  425. }
  426. // console.log(e,idx)
  427. },
  428. //自定义时间
  429. totalTimeChange(e) {
  430. console.log(e.startDate, e.endDate)
  431. this.activeTotal=3;
  432. this.lastEndDate=e.endDate
  433. this.lastStartDate=e.startDate
  434. },
  435. //指标执行率分析tab
  436. tapspagek2(index,idx) {
  437. console.log(index,idx)
  438. this.bocindex = index;
  439. },
  440. //集团对比
  441. Groupcontrast(){
  442. uni.navigateTo({
  443. url: '/pages/center/Piabodata/Groupcontrast'
  444. });
  445. },
  446. //团队对比
  447. Theteamcompared(){
  448. uni.navigateTo({
  449. url: '/pages/center/Piabodata/Theteamcompared'
  450. });
  451. },
  452. //用户洞察
  453. toUserinsightinto(){
  454. uni.navigateTo({
  455. url: '/pages/center/Piabodata/Userinsightinto'
  456. });
  457. },
  458. //趋势分析
  459. toTrendAnalysis(){
  460. uni.navigateTo({
  461. url: '/pages/center/Piabodata/TrendAnalysis'
  462. });
  463. },
  464. //员工分析
  465. toStaffAnalysis(){
  466. uni.navigateTo({
  467. url: '/pages/center/Piabodata/StaffAnalysis'
  468. });
  469. }
  470. }
  471. };
  472. </script>
  473. <style lang="scss" scoped>
  474. .box {
  475. width: 100%;
  476. height: 100%;
  477. background: #FAFAFA;
  478. padding-bottom: 60rpx;
  479. }
  480. .Piabodata-box{
  481. width: 100%;
  482. background: #FFFFFF;
  483. display: flex;
  484. flex-wrap: wrap;
  485. padding-bottom: 30rpx;
  486. .Piabodata{
  487. width: 33.3%;
  488. .Piabodata-img{
  489. width: 100%;
  490. text-align: center;
  491. .Piabodata-img1{
  492. width: 134rpx;
  493. height: 134rpx;
  494. }
  495. }
  496. .Piabodata-text{
  497. width: 100%;
  498. text-align: center;
  499. font-size: 24rpx;
  500. font-weight: 400;
  501. color: #333333;
  502. margin-top: -10rpx;
  503. }
  504. }
  505. }
  506. </style>