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.
 
 
 

683 lines
18 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()" v-if="Theteamcomparedisshow">
  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()" v-if="Groupcontrastisshow">
  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()"
  67. inactive-color="#b1b1b1" active-color="#008ef2" :list="newlistoj1" :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 class="" v-if="teamFlag">
  87. <view style="width: 100%;height: 20rpx;background: #FAFAFA;"></view>
  88. <view class="single">
  89. <view class="title" @click="staffShow1=true">
  90. <view class="title1">团队接待趋势</view>
  91. <view class="title2">
  92. <view class="title2-che" style="width: 220rpx;">{{team.label}}
  93. <image class="righttochoose" src="../../../static/images/righttochoose.png" mode=""></image>
  94. </view>
  95. <!-- <view class="title2-che">执行率
  96. <image class="righttochoose" src="../../../static/images/righttochoose.png" mode=""></image>
  97. </view> -->
  98. </view>
  99. </view>
  100. <view class="hejibox">
  101. <view class="heji">合计:{{allnum||0}}</view>
  102. <view class="heji">均值:{{allavg||0}}</view>
  103. </view>
  104. <view class="danwei">来访(人)</view>
  105. <view class="uchaserbox">
  106. <qiun-data-charts
  107. type="line"
  108. :chartData="lineOptsect1"
  109. background="none"
  110. :ontouch="true"
  111. canvasId="wangxiaohuaerlineryiliwuyibao"
  112. :canvas2d="true"
  113. />
  114. </view>
  115. </view>
  116. </view>
  117. <view class="" v-if="staffFlag">
  118. <view style="width: 100%;height: 20rpx;background: #FAFAFA;"></view>
  119. <view class="single">
  120. <view class="title">
  121. <view class="title1">员工接待趋势</view>
  122. <view class="title2" @click="staffShow=true">
  123. <view class="title2-che" style="width: 220rpx;">{{staff.label}}
  124. <image class="righttochoose" src="../../../static/images/righttochoose.png" mode=""></image>
  125. </view>
  126. <!-- <view class="title2-che">执行率
  127. <image class="righttochoose" src="../../../static/images/righttochoose.png" mode=""></image>
  128. </view> -->
  129. </view>
  130. </view>
  131. <view class="hejibox">
  132. <view class="heji">合计:{{allnum1||0}}</view>
  133. <view class="heji">均值:{{allavg1||0}}</view>
  134. </view>
  135. <view class="danwei">来访(人)</view>
  136. <view class="uchaserbox">
  137. <qiun-data-charts
  138. type="line"
  139. :chartData="lineOptsect2"
  140. background="none"
  141. :ontouch="true"
  142. canvasId="wangxiaohuaerlingeryilingwuyibao"
  143. :canvas2d="true"
  144. />
  145. </view>
  146. </view>
  147. </view>
  148. <view style="width: 100%;height: 20rpx;background: #FAFAFA;"></view>
  149. <view class="single">
  150. <view class="title">
  151. <view class="title1">销讲维度执行率</view>
  152. <!-- <view class="title3">
  153. <view class="title3-box">
  154. <view style="height: 42rpx;" :class="{ activecltab: activeTotal2 == 0 }">执行率</view>
  155. </view>
  156. <view class="title3-box">
  157. <view style="height: 42rpx;" :class="{ activecltab: activeTotal2 == 1 }">得分</view>
  158. </view>
  159. </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="#4FC78F" :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">
  180. <view class="title1">销讲指标执行率</view>
  181. </view>
  182. <view class="swiper-box">
  183. <u-tabs-swiper ref="tabs" font-size="30" :bold="true" swiper-width="600" :current="bocindex1" @change="tapspagek3"
  184. inactive-color="#b1b1b1" active-color="#008ef2" :list="newlistoj" :is-scroll="true">
  185. </u-tabs-swiper>
  186. </view>
  187. <view class="jindu">
  188. <view class="jindu-box" v-for="(item,index) in newlisttabinfo1" :key="index">
  189. <view class="jindu-boxche">
  190. <view class="jindu-name">{{item.name.substring(0, 4)}}</view>
  191. <view style="width: 440rpx;margin-left: 10rpx;">
  192. <u-line-progress height="24" :show-percent="false" active-color="#4FC78F" :percent="item.zxl"></u-line-progress>
  193. </view>
  194. <view class="jindu-zxl">{{item.zxl==null?0:item.zxl}}%</view>
  195. </view>
  196. </view>
  197. </view>
  198. </view>
  199. <u-calendar v-model="totalTimeShow" mode="range" @change="totalTimeChange"></u-calendar>
  200. <u-select v-model="staffShow" :list="staffList" @confirm="staffSelectCallback($event,0)" :default-value='selindex'></u-select>
  201. <u-select v-model="staffShow1" :list="teamList" @confirm="staffSelectCallback($event,1)" :default-value='selindex'></u-select>
  202. </view>
  203. </template>
  204. <script>
  205. var app = getApp();
  206. var util = require("../../../utils/util.js");
  207. var config = require("../../../config");
  208. export default {
  209. data() {
  210. return {
  211. activeTotal: 4,
  212. activeTotal2: 0,
  213. houseId:'',
  214. timeobj:{
  215. statDateStart:'',
  216. statDateEnd:''
  217. },
  218. // 员工列表
  219. staffList:[],
  220. // 团队列表
  221. teamList:[],
  222. staffShow:false,
  223. staff:{
  224. value:'',
  225. label:''
  226. },
  227. team:{
  228. value:'',
  229. label:''
  230. },
  231. teamFlag:true,
  232. bocindex1:0,
  233. staffFlag:true,
  234. staffShow1:false,
  235. lastStartDate:'',
  236. lastEndDate :'',
  237. allnum:'',
  238. allavg:'',
  239. allnum1:'',
  240. allavg1:'',
  241. totalTimeShow: false,
  242. activeTab: 0,
  243. numlist:[
  244. {name:'接待量',num:'10'},
  245. {name:'接待客户',num:'10'},
  246. {name:'平均执行率',num:'10'},
  247. {name:'录音时长',num:'10'},
  248. ],
  249. lineOptsect:{
  250. "categories": ["2016","2017","2018","2019","2020","2021"],
  251. "series": [
  252. {
  253. "name": "成交量",
  254. "data": [35,8,25,37,4,20]
  255. }
  256. ]
  257. },
  258. lineOptsect1:{
  259. "categories": ["2016","2017","2018","2019","2020","2021"],
  260. "series": [
  261. {
  262. "name": "成交量",
  263. "data": [35,8,25,37,4,20]
  264. }
  265. ]
  266. },
  267. lineOptsect2:{
  268. "categories": ["2016","2017","2018","2019","2020","2021"],
  269. "series": [
  270. {
  271. "name": "成交量",
  272. "data": [35,8,25,37,4,20]
  273. }
  274. ]
  275. },
  276. newlistoj:[],
  277. newlistoj1:[
  278. {name:"接待量",id:1},
  279. {name:"平均执行率",id:2},
  280. {name:"接待客户",id:3},
  281. {name:"录音时长",id:5},
  282. ],
  283. bocindex:0,
  284. newlisttabinfo:[
  285. {name:'接待量',zxl:'10'},
  286. {name:'平均执行率',zxl:'50'},
  287. {name:'接待客户',zxl:'80'},
  288. ],
  289. newlisttabinfo1:[
  290. {name:'接待量',zxl:'10'},
  291. {name:'平均执行率',zxl:'50'},
  292. {name:'接待客户',zxl:'80'},
  293. ],
  294. Theteamcomparedisshow:false,
  295. Groupcontrastisshow:false,
  296. allechar:[],
  297. allList:[]
  298. };
  299. },
  300. onShow() {
  301. // 获取楼盘id
  302. this.houseId = uni.getStorageSync('buildingID').id;
  303. // 获取数据看板
  304. // 获取员工
  305. this.getStaffList()
  306. // 获取团队
  307. this.getSectionList()
  308. // 获取团队是否显示权限
  309. this.queryHaveDept()
  310. // 获取简报
  311. this.getReport()
  312. // 获取接待趋势
  313. this.getRtrent()
  314. // 获取维度
  315. this.getindexZxl()
  316. },
  317. methods: {
  318. queryHaveDept() {
  319. return new Promise((resolve, reject) => {
  320. this.$u.get("/user/queryHaveDept?houseId="+this.houseId).then(res => {
  321. this.permissions(res)
  322. })
  323. })
  324. },
  325. permissions(res){
  326. if(res==1){
  327. this.Theteamcomparedisshow=false;
  328. this.Groupcontrastisshow=false;
  329. return
  330. }
  331. let totle=uni.getStorageSync('weapp_session_userInfo_data').total;
  332. if(totle==1){
  333. this.Theteamcomparedisshow=true;
  334. this.Groupcontrastisshow=false;
  335. }else{
  336. this.Theteamcomparedisshow=true;
  337. this.Groupcontrastisshow=true;
  338. }
  339. },
  340. // 获取员工列表
  341. getStaffList(){
  342. this.$u.post('/cusLvStatistics/selectAllAccountIdByHouseId',{houseId:this.houseId})
  343. .then(res=>{
  344. // console.log(res,'123')
  345. this.staffList=[]
  346. res.map(item=>{
  347. let obj={}
  348. obj.value=item.accountId
  349. obj.label=item.name
  350. this.staffList.push(obj)
  351. })
  352. this.staff=this.staffList[0]
  353. this.getAward()
  354. })
  355. },
  356. // 获取接待趋势
  357. getRtrent(){
  358. this.$u.post('/cusLvStatistics/receptionTrend',{
  359. houseId:this.houseId,
  360. timeType:this.lastEndDate?null:this.activeTotal,
  361. lastEndDate:this.lastEndDate,
  362. lastStartDate:this.lastStartDate
  363. })
  364. .then(res=>{
  365. // console.log(res)
  366. this.allechar=res
  367. this.tapspagek2(this.bocindex)
  368. })
  369. },
  370. // 销奖维度
  371. getindexZxl(){
  372. this.$u.post('/cusLvStatistics/indexZxl',{
  373. houseId:this.houseId,
  374. timeType:this.lastEndDate?null:this.activeTotal,
  375. lastEndDate:this.lastEndDate,
  376. lastStartDate:this.lastStartDate
  377. })
  378. .then(res=>{
  379. // console.log(res)
  380. // 处理销奖维度执行率
  381. // this.newlisttabinfo
  382. let arr=[]
  383. this.newlistoj=[]
  384. res.list.map((item,index)=>{
  385. arr.push({
  386. name:item.name,
  387. zxl:item.zxl
  388. })
  389. this.newlistoj.push({
  390. name:item.name,
  391. id:index
  392. })
  393. })
  394. this.newlisttabinfo=arr
  395. this.allList=res.list
  396. this.tapspagek3(this.bocindex1)
  397. })
  398. },
  399. // 获取简报
  400. getReport(){
  401. this.$u.post('/cusLvStatistics/xiaojiangAnalysis',{
  402. houseId:this.houseId,
  403. timeType:this.lastEndDate?null:this.activeTotal,
  404. lastEndDate:this.lastEndDate,
  405. lastStartDate:this.lastStartDate
  406. })
  407. .then(res=>{
  408. // console.log(res)
  409. // 接待量
  410. this.numlist[0].num=res.receptionCount||0
  411. // 接待客户
  412. this.numlist[1].num=res.sumCustomer||0
  413. // 执行率
  414. this.numlist[2].num=(res.fraction||0)+'%'
  415. // 录音时长
  416. this.numlist[3].num=res.sumDuration||0
  417. })
  418. },
  419. // 获取团队列表
  420. getSectionList(){
  421. this.$u.post('/cusLvStatistics/findAllDeptIdByHouseId',{houseId:this.houseId})
  422. .then(res=>{
  423. this.teamList=[]
  424. res.map(item=>{
  425. let obj={}
  426. obj.value=item.deptId
  427. obj.label=item.deptName
  428. this.teamList.push(obj)
  429. })
  430. this.team=this.teamList[0]
  431. this.receptionCountList()
  432. })
  433. },
  434. // 员工销奖趋势
  435. getAward(){
  436. if(!this.staff.value){
  437. this.staffFlag=false
  438. return
  439. }
  440. this.$u.post('/cusLvStatistics/employeeAnalysisExacutiveRate',{
  441. userA:this.staff.value,
  442. userB:'',
  443. houseId:this.houseId,
  444. timeType:this.lastEndDate?null:this.activeTotal+'',
  445. lastEndDate:this.lastEndDate,
  446. lastStartDate:this.lastStartDate
  447. })
  448. .then(res=>{
  449. this.allnum1=res.avg[0]
  450. this.allavg1=res.avg[1]
  451. // console.log(res)
  452. let first=res.first
  453. let second=res.second
  454. this.lineOptsect2.categories=[]
  455. this.lineOptsect2.series=[
  456. {
  457. name:first[0].accountName,
  458. data:[]
  459. }
  460. ]
  461. first.map(item=>{
  462. this.lineOptsect2.categories.push(item.statDate.slice(5,10))
  463. this.lineOptsect2.series[0].data.push(item.sumFraction)
  464. })
  465. })
  466. },
  467. // 团队接待趋势
  468. receptionCountList(){
  469. if(!this.team.value){
  470. this.teamFlag=false
  471. return
  472. }
  473. this.$u.post('/cusLvStatistics/teamAnalysisExecutionRate',{
  474. deptIds:this.team.value,
  475. showRank:1,
  476. houseId:this.houseId,
  477. timeType:this.lastEndDate?null:this.activeTotal+'',
  478. lastEndDate:this.lastEndDate,
  479. lastStartDate:this.lastStartDate
  480. })
  481. .then(res=>{
  482. // console.log(res)
  483. let result=res.result
  484. this.allnum=res.avg[0]
  485. this.allavg=res.avg[1]
  486. // 当选择趋势时
  487. this.lineOptsect1={}
  488. let allobj={
  489. categories:[],
  490. series:[]
  491. }
  492. // 先处理时间
  493. // 当选择全部时
  494. // 当选择只有一个时
  495. let obj={}
  496. obj.data=[]
  497. obj.name=result[0][0].deptName
  498. result[0].map(item=>{
  499. allobj.categories.push(item.statDate.slice(5,10))
  500. obj.data.push(item.data)
  501. })
  502. allobj.series.push(obj)
  503. this.lineOptsect1=allobj
  504. })
  505. },
  506. //时间切换
  507. tabtimetap(index) {
  508. if (index == 3) {
  509. this.totalTimeShow = true;
  510. } else {
  511. this.activeTotal = index;
  512. this.lastEndDate=''
  513. this.lastStartDate=''
  514. this.getdata()
  515. }
  516. },
  517. // 获取数据
  518. getdata(){
  519. this.receptionCountList()
  520. this.getReport()
  521. this.getRtrent()
  522. this.getindexZxl()
  523. },
  524. staffSelectCallback(e,idx){
  525. if(idx==0){
  526. this.staff=e[0]
  527. this.getAward()
  528. }else{
  529. this.team=e[0]
  530. this.receptionCountList()
  531. }
  532. // console.log(e,idx)
  533. },
  534. //自定义时间
  535. totalTimeChange(e) {
  536. console.log(e.startDate, e.endDate)
  537. this.activeTotal=3;
  538. this.lastEndDate=e.endDate
  539. this.lastStartDate=e.startDate
  540. this.getdata()
  541. },
  542. //指标执行率分析tab
  543. tapspagek2(index) {
  544. // console.log(index)
  545. // 对数据进行分析和处理
  546. // 先处理日期
  547. let allobj={
  548. "categories": [],
  549. "series": [
  550. {
  551. name:'接待量',
  552. data:[]
  553. }
  554. ]
  555. }
  556. if(index==0){
  557. // 接待量
  558. this.allechar.map(item=>{
  559. allobj.categories.push(item.statDate.slice(5,10))
  560. allobj.series[0].data.push(item.receptionCount)
  561. })
  562. }else if(index==1){
  563. // 平均执行率
  564. this.allechar.map(item=>{
  565. allobj.categories.push(item.statDate.slice(5,10))
  566. allobj.series[0].data.push(item.fraction)
  567. })
  568. }else if(index==2){
  569. // 接待客户
  570. this.allechar.map(item=>{
  571. allobj.categories.push(item.statDate.slice(5,10))
  572. allobj.series[0].data.push(item.sumCustomer)
  573. })
  574. }else{
  575. // 录音时长
  576. this.allechar.map(item=>{
  577. allobj.categories.push(item.statDate.slice(5,10))
  578. allobj.series[0].data.push(item.sumDuration)
  579. })
  580. }
  581. this.bocindex = index;
  582. // console.log(allobj)
  583. // return
  584. this.lineOptsect=allobj
  585. },
  586. tapspagek3(index){
  587. let arr=[]
  588. // return
  589. // console.log(index,this.allList[index])
  590. this.allList[index].children.map(item=>{
  591. arr.push({
  592. name:item.name,
  593. zxl:item.zxl
  594. })
  595. })
  596. this.newlisttabinfo1=arr
  597. this.bocindex1 = index;
  598. },
  599. //集团对比
  600. Groupcontrast(){
  601. uni.navigateTo({
  602. url: '/pages/center/Piabodata/Groupcontrast'
  603. });
  604. },
  605. //团队对比
  606. Theteamcompared(){
  607. uni.navigateTo({
  608. url: '/pages/center/Piabodata/Theteamcompared'
  609. });
  610. },
  611. //用户洞察
  612. toUserinsightinto(){
  613. uni.navigateTo({
  614. url: '/pages/center/Piabodata/Userinsightinto'
  615. });
  616. },
  617. //趋势分析
  618. toTrendAnalysis(){
  619. uni.navigateTo({
  620. url: '/pages/center/Piabodata/TrendAnalysis'
  621. });
  622. },
  623. //员工分析
  624. toStaffAnalysis(){
  625. uni.navigateTo({
  626. url: '/pages/center/Piabodata/StaffAnalysis'
  627. });
  628. }
  629. }
  630. };
  631. </script>
  632. <style lang="scss" scoped>
  633. .box {
  634. width: 100%;
  635. height: 100%;
  636. background: #FAFAFA;
  637. padding-bottom: 60rpx;
  638. }
  639. .Piabodata-box{
  640. width: 100%;
  641. background: #FFFFFF;
  642. display: flex;
  643. flex-wrap: wrap;
  644. padding-bottom: 30rpx;
  645. .Piabodata{
  646. width: 33.3%;
  647. .Piabodata-img{
  648. width: 100%;
  649. text-align: center;
  650. .Piabodata-img1{
  651. width: 134rpx;
  652. height: 134rpx;
  653. }
  654. }
  655. .Piabodata-text{
  656. width: 100%;
  657. text-align: center;
  658. font-size: 24rpx;
  659. font-weight: 400;
  660. color: #333333;
  661. margin-top: -10rpx;
  662. }
  663. }
  664. }
  665. </style>