AI销管
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 

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