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.
 
 
 

549 lines
15 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($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. Theteamcomparedisshow:false,
  281. Groupcontrastisshow:false
  282. };
  283. },
  284. onShow() {
  285. // 获取楼盘id
  286. this.houseId = uni.getStorageSync('buildingID').id;
  287. // 获取数据看板
  288. // 获取员工
  289. this.getStaffList()
  290. // 获取团队
  291. this.getSectionList()
  292. // 获取团队是否显示权限
  293. this.queryHaveDept()
  294. },
  295. methods: {
  296. queryHaveDept() {
  297. return new Promise((resolve, reject) => {
  298. this.$u.get("/user/queryHaveDept?houseId="+this.houseId).then(res => {
  299. this.permissions(res)
  300. })
  301. })
  302. },
  303. permissions(res){
  304. if(res==1){
  305. this.Theteamcomparedisshow=false;
  306. this.Groupcontrastisshow=false;
  307. return
  308. }
  309. let totle=uni.getStorageSync('weapp_session_userInfo_data').total;
  310. if(totle==1){
  311. this.Theteamcomparedisshow=true;
  312. this.Groupcontrastisshow=false;
  313. }else{
  314. this.Theteamcomparedisshow=true;
  315. this.Groupcontrastisshow=true;
  316. }
  317. },
  318. // 获取员工列表
  319. getStaffList(){
  320. this.$u.post('/cusLvStatistics/selectAllAccountIdByHouseId',{houseId:this.houseId})
  321. .then(res=>{
  322. // console.log(res,'123')
  323. res.map(item=>{
  324. let obj={}
  325. obj.value=item.accountId
  326. obj.label=item.name
  327. this.staffList.push(obj)
  328. })
  329. this.staff=this.staffList[0]
  330. this.getAward()
  331. })
  332. },
  333. // 获取团队列表
  334. getSectionList(){
  335. this.$u.post('/cusLvStatistics/findAllDeptIdByHouseId',{houseId:this.houseId})
  336. .then(res=>{
  337. this.staffList=[]
  338. this.staffList1=[]
  339. res.map(item=>{
  340. let obj={}
  341. obj.value=item.deptId
  342. obj.label=item.deptName
  343. this.teamList.push(obj)
  344. })
  345. this.team=this.teamList[0]
  346. this.receptionCountList()
  347. })
  348. },
  349. // 员工销奖趋势
  350. getAward(){
  351. this.$u.post('/cusLvStatistics/employeeAnalysisExacutiveRate',{
  352. userA:this.staff.value,
  353. userB:'',
  354. houseId:this.houseId,
  355. timeType:this.lastEndDate?null:this.activeTotal+'',
  356. lastEndDate:this.lastEndDate,
  357. lastStartDate:this.lastStartDate
  358. })
  359. .then(res=>{
  360. this.newTeam3=res.avg[0]
  361. this.newAvg3=res.avg[1]
  362. // console.log(res)
  363. let first=res.first
  364. let second=res.second
  365. this.lineOptsect2.categories=[]
  366. this.lineOptsect2.series=[
  367. {
  368. name:first[0].accountName,
  369. data:[]
  370. }
  371. ]
  372. first.map(item=>{
  373. this.lineOptsect2.categories.push(item.statDate.slice(5,10))
  374. this.lineOptsect2.series[0].data.push(item.sumFraction)
  375. })
  376. })
  377. },
  378. // 团队接待趋势
  379. receptionCountList(){
  380. // if(!this.team.value){
  381. // this.teamFlag=false
  382. // return
  383. // }
  384. this.$u.post('/cusLvStatistics/teamAnalysisExecutionRate',{
  385. deptIds:this.team.value,
  386. showRank:1,
  387. houseId:this.houseId,
  388. timeType:this.lastEndDate?null:this.activeTotal+'',
  389. lastEndDate:this.lastEndDate,
  390. lastStartDate:this.lastStartDate
  391. })
  392. .then(res=>{
  393. // console.log(res)
  394. let result=res.result
  395. this.newTeam=res.avg[0]
  396. this.newAvg=res.avg[1]
  397. // 当选择趋势时
  398. this.lineOptsect1={}
  399. let allobj={
  400. categories:[],
  401. series:[]
  402. }
  403. // 先处理时间
  404. // 当选择全部时
  405. // 当选择只有一个时
  406. let obj={}
  407. obj.data=[]
  408. obj.name=result[0][0].deptName
  409. result[0].map(item=>{
  410. allobj.categories.push(item.statDate.slice(5,10))
  411. obj.data.push(item.data)
  412. })
  413. allobj.series.push(obj)
  414. // 判断是否显示平均
  415. // 如果显示对比
  416. // if(this.timepickpickisshow){
  417. // let obj={}
  418. // obj.data=[]
  419. // obj.name='平均'
  420. // result[1].map(item=>{
  421. // obj.data.push(item.data)
  422. // })
  423. // allobj.series.push(obj)
  424. // }
  425. this.lineOptsect1=allobj
  426. })
  427. },
  428. //时间切换
  429. tabtimetap(index) {
  430. if (index == 3) {
  431. this.totalTimeShow = true;
  432. } else {
  433. this.activeTotal = index;
  434. this.lastEndDate=''
  435. this.lastStartDate=''
  436. this.getdata()
  437. }
  438. },
  439. // 获取数据
  440. getdata(){
  441. this.receptionCountList()
  442. },
  443. staffSelectCallback(e,idx){
  444. if(idx==0){
  445. this.staff=e[0]
  446. this.getAward()
  447. }else{
  448. this.team=e[0]
  449. this.receptionCountList()
  450. }
  451. // console.log(e,idx)
  452. },
  453. //自定义时间
  454. totalTimeChange(e) {
  455. console.log(e.startDate, e.endDate)
  456. this.activeTotal=3;
  457. this.lastEndDate=e.endDate
  458. this.lastStartDate=e.startDate
  459. },
  460. //指标执行率分析tab
  461. tapspagek2(index,idx) {
  462. console.log(index,idx)
  463. this.bocindex = index;
  464. },
  465. //集团对比
  466. Groupcontrast(){
  467. uni.navigateTo({
  468. url: '/pages/center/Piabodata/Groupcontrast'
  469. });
  470. },
  471. //团队对比
  472. Theteamcompared(){
  473. uni.navigateTo({
  474. url: '/pages/center/Piabodata/Theteamcompared'
  475. });
  476. },
  477. //用户洞察
  478. toUserinsightinto(){
  479. uni.navigateTo({
  480. url: '/pages/center/Piabodata/Userinsightinto'
  481. });
  482. },
  483. //趋势分析
  484. toTrendAnalysis(){
  485. uni.navigateTo({
  486. url: '/pages/center/Piabodata/TrendAnalysis'
  487. });
  488. },
  489. //员工分析
  490. toStaffAnalysis(){
  491. uni.navigateTo({
  492. url: '/pages/center/Piabodata/StaffAnalysis'
  493. });
  494. }
  495. }
  496. };
  497. </script>
  498. <style lang="scss" scoped>
  499. .box {
  500. width: 100%;
  501. height: 100%;
  502. background: #FAFAFA;
  503. padding-bottom: 60rpx;
  504. }
  505. .Piabodata-box{
  506. width: 100%;
  507. background: #FFFFFF;
  508. display: flex;
  509. flex-wrap: wrap;
  510. padding-bottom: 30rpx;
  511. .Piabodata{
  512. width: 33.3%;
  513. .Piabodata-img{
  514. width: 100%;
  515. text-align: center;
  516. .Piabodata-img1{
  517. width: 134rpx;
  518. height: 134rpx;
  519. }
  520. }
  521. .Piabodata-text{
  522. width: 100%;
  523. text-align: center;
  524. font-size: 24rpx;
  525. font-weight: 400;
  526. color: #333333;
  527. margin-top: -10rpx;
  528. }
  529. }
  530. }
  531. </style>