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.
 
 
 

741 lines
18 KiB

  1. <template>
  2. <view class="box">
  3. <!-- 选择器 -->
  4. <view class="boxtittab">
  5. <view class="tabbox" @click="timeshow=true">
  6. {{ time }}
  7. <u-icon name="arrow-down" size="24" style="padding-left: 12rpx;"></u-icon>
  8. </view>
  9. <view class="tabbox" @click="deptshow=true">
  10. {{ dept}}
  11. <u-icon name="arrow-down" size="24" style="padding-left: 12rpx;"></u-icon>
  12. </view>
  13. <view class="tabbox" @click="guwenshow=true">
  14. {{ guwen}}
  15. <u-icon name="arrow-down" size="24" style="padding-left: 12rpx;"></u-icon>
  16. </view>
  17. </view>
  18. <view style="width: 100%;height: 20rpx;background: #FAFAFA;"></view>
  19. <view class="boxzonglan" style="min-height: 400rpx;">
  20. <view class="zonglantitle">简报 <text @click="showDesc=true">统计说明</text></view>
  21. <view class="zonglanbox">
  22. <view class="grid" style="height: auto;" v-for="(item,index) in numlist" :key="index">
  23. <view class="audonum">{{item.name}}</view>
  24. <view class="num">{{item.firstnum||0}}</view>
  25. <view class="bottom">
  26. <view class="leftnum">对比:{{item.endnum||0}}</view>
  27. <view class="rightnum" :class="item.duibinum>0?'red':'green'">{{item.duibinum||0}}
  28. <image v-if="item.duibinum>0" src="https://static.quhouse.com/c4145f84cc3c49769ee2ec11465c085b.png" mode="" />
  29. <image v-else src="https://static.quhouse.com/c5dbf780e09a4da0b0bab2d7fa58accd.png" mode="" />
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. </view>
  35. <!-- 统计说明 -->
  36. <view class="black-bg" v-if="showDesc" >
  37. <view class="tongjiDesc">
  38. <view class="tongji-title">统计说明</view>
  39. <view class="text">
  40. <view><text class="bold">平均需求挖掘率:</text>筛选时间内,有效接待中已标记顾问的需求挖掘执行率的平均值;</view>
  41. <view><text class="bold">未标记:</text>筛选时间内,有效接待中未标记顾问的接待数;</view>
  42. <view><text class="bold">有效接待:</text>筛选时间内,标记为有效的接待数,不包含待接单;</view>
  43. <view><text class="bold">未挖掘需求数:</text>筛选时间内,需求挖掘平均执行率为0的需求数;</view>
  44. </view>
  45. </view>
  46. <view class="close" @click="showDesc=false">X</view>
  47. </view>
  48. <view style="width: 100%;height: 20rpx;background: #FAFAFA;"></view>
  49. <view class="single">
  50. <view class="title">
  51. <view class="title1">平均需求挖掘率趋势</view>
  52. </view>
  53. <view class="uchaserbox">
  54. <qiun-data-charts type="line" :chartData="lineOptsect" :opts="lineOpts" background="none"
  55. :ontouch="true" canvasId="wangxiaohuaerlingilingwuyiba2" :canvas2d="true" />
  56. </view>
  57. </view>
  58. <view style="width: 100%;height: 20rpx;background: #FAFAFA;"></view>
  59. <view class="single">
  60. <view class="title">
  61. <view class="title1">平均需求挖掘分布</view>
  62. </view>
  63. <view class="uchaserbox">
  64. <qiun-data-charts
  65. type="ring"
  66. :chartData="ringChartData"
  67. :canvas2d="true"
  68. canvasId="ChartBoxIdwangxiaohuaerlingilingwuyiba1"
  69. :opts='opts'
  70. background="none" />
  71. </view>
  72. </view>
  73. <view style="width: 100%;height: 20rpx;background: #FAFAFA;"></view>
  74. <view class="single">
  75. <view class="title">
  76. <view class="title1">需求挖掘排名</view>
  77. </view>
  78. <view class="tabdada">
  79. <view class="tabth">
  80. <view>排名</view>
  81. <view>需求类型/挖掘执行接待数</view>
  82. <view>执行率</view>
  83. <view>操作</view>
  84. </view>
  85. <view v-if="total==0" style="color: #999999;width: 100%;height: 500rpx;line-height: 500rpx;text-align: center;" >暂无数据</view>
  86. <view class="tabtd" v-for="(item,i) in rankList" :key="i">
  87. <view>
  88. <image v-if="i==0" class="ranking" src="../../../static/images/ranking1.png" mode=""></image>
  89. <image v-else-if="i==1" class="ranking" src="../../../static/images/ranking2.png" mode=""></image>
  90. <image v-else-if="i==2" class="ranking" src="../../../static/images/ranking3.png" mode=""></image>
  91. <view class="ranking1" v-else>{{i+1}}</view>
  92. </view>
  93. <view class="u-line-1">{{item.name}}({{item.selected}})</view>
  94. <view>{{item.fraction}}%</view>
  95. <view @click="Toview(item,i)">查看</view>
  96. </view>
  97. </view>
  98. </view>
  99. <u-popup v-model="timeshow" mode="bottom">
  100. <view class="timeview" :style="{ color: activeTotal == 2 ? '#2B6EFF' : '#333333' }"
  101. @click="tabtimetap(2, '近7天')">
  102. 近7天</view>
  103. <view class="timeview" :style="{ color: activeTotal == 5 ? '#2B6EFF' : '#333333' }"
  104. @click="tabtimetap(5, '近15天')">
  105. 近15天</view>
  106. <view class="timeview" :style="{ color: activeTotal == 6 ? '#2B6EFF' : '#333333' }"
  107. @click="tabtimetap(6, '近30天')">
  108. 近30天</view>
  109. <view class="timeview" :style="{ color: activeTotal == 4 ? '#2B6EFF' : '#333333' }"
  110. @click="tabtimetap(4,'自定义')">
  111. 自定义</view>
  112. </u-popup>
  113. <u-calendar v-model="calendarShow" mode="range" @change="calendarTimeChange"></u-calendar>
  114. <u-select v-model="guwenshow" :list="staffList" @confirm="guwenCallback"
  115. :default-value='selindex'></u-select>
  116. <u-select v-model="deptshow" :list="teamList" @confirm="deptCallback"
  117. :default-value='selindex'></u-select>
  118. <!-- 加载组件 -->
  119. <loading v-model="LOADING"></loading>
  120. </view>
  121. </template>
  122. <script>
  123. var app = getApp();
  124. var config = require("../../../config");
  125. import loading from "@/components/loading/index.vue"
  126. export default {
  127. components: {
  128. loading
  129. },
  130. data() {
  131. return {
  132. selindex: '',
  133. guwenshow: false,
  134. timeshow: false,
  135. selectshow: false,
  136. deptshow: false,
  137. deptVal: '',
  138. huashuVal: '',
  139. guwenVal: '',
  140. // 筛选文字展示
  141. time: '接待时间',
  142. dept: '部门',
  143. guwen: '顾问',
  144. huashu: '业务话术',
  145. showDesc: false,
  146. rankList: [],//排名列表
  147. ringChartData: {
  148. },
  149. // ring图 分布图
  150. opts: {
  151. rotate: false,
  152. rotateLock: false,
  153. color: ['#F8A12B','#07B79D','#E7483C','#2671E1'],
  154. padding: [5,5,5,5],
  155. dataLabel: true,
  156. legend: {
  157. show: true,
  158. position: "right",
  159. lineHeight: 25
  160. },
  161. title: {
  162. name: "",
  163. fontSize: 15,
  164. color: "#666666"
  165. },
  166. subtitle: {
  167. name: "",
  168. fontSize: 25,
  169. color: "#7cb5ec"
  170. },
  171. extra: {
  172. ring: {
  173. ringWidth: 60,
  174. activeOpacity: 0.5,
  175. activeRadius: 10,
  176. offsetAngle: 0,
  177. labelWidth: 15,
  178. border: false,
  179. borderWidth: 3,
  180. borderColor: "#FFFFFF"
  181. }
  182. }
  183. },
  184. activeTotal: 2,
  185. houseId: '',
  186. // hushuList: [],// 业务话术
  187. staffList: [],// 员工列表
  188. teamList: [],// 团队列表
  189. team: {
  190. value: '',
  191. label: ''
  192. },
  193. startDate: '',
  194. endDate: '',
  195. calendarShow: false,
  196. numlist: [{
  197. name: '平均需求挖掘率',
  198. firstnum: '',
  199. endnum: '',
  200. duibinum: '',
  201. setName: 'wordFraction'
  202. }, {
  203. name: '未挖掘需求',
  204. firstnum: '',
  205. endnum: '',
  206. duibinum: '',
  207. setName: 'noFinishWord'
  208. },
  209. {
  210. name: '有效接待',
  211. firstnum: '',
  212. endnum: '',
  213. duibinum: '',
  214. setName: 'activeCustomer'
  215. },
  216. {
  217. name: '未标记',
  218. firstnum: '',
  219. endnum: '',
  220. duibinum: '',
  221. setName: 'markAdvisor'
  222. },
  223. ],
  224. lineOptsect: {
  225. "categories": [],
  226. "series": [{
  227. "name": "起始时间",
  228. "data": []
  229. },{
  230. "name": "对比时间",
  231. "data": []
  232. }]
  233. },
  234. lineOpts: {
  235. yAxis: {
  236. data: [{
  237. max: 100,
  238. min: 0,
  239. }]
  240. }
  241. },
  242. };
  243. },
  244. onShow() {
  245. // 获取项目id
  246. this.houseId = uni.getStorageSync('buildingID').id;
  247. // 获取员工
  248. this.getStaffList()
  249. // 获取团队
  250. this.getSectionList()
  251. this.getdata()
  252. },
  253. onReady: function(){
  254. // 获取项目id
  255. this.houseId = uni.getStorageSync('buildingID').id;
  256. // 获取员工
  257. this.getStaffList()
  258. // 获取团队
  259. this.getSectionList()
  260. this.getdata()
  261. },
  262. methods: {
  263. getdata(){
  264. // 需求挖掘分析-简报
  265. this.wordMiningAnalyze()
  266. //需求挖掘排行
  267. this.getwordMiningRank()
  268. // 挖掘趋势图
  269. this.getwordMiningAnalyzePercentage()
  270. // 需求挖掘f分布图
  271. this.getRingData()
  272. },
  273. // 需求挖掘排行
  274. getwordMiningRank(){
  275. let dateType = 0;
  276. if (this.activeTotal == 4) {// 选择全部和自定义
  277. dateType = null;
  278. }else {
  279. dateType = this.activeTotal;
  280. this.startDate = ''
  281. this.endDate = ''
  282. }
  283. this.$u.post('/cusLvStatistics/wordMiningRank', {
  284. "houseId": this.houseId,
  285. "deptId": this.deptVal,
  286. "createUser": this.guwenVal,
  287. "dateType":dateType,
  288. "firstStartDate":this.startDate,
  289. "firstEndDate":this.endDate
  290. })
  291. .then(res => {
  292. // console.log(res)
  293. if(res.length){
  294. this.rankList = res.map(item=>{
  295. return {
  296. name: item.name,
  297. id: item.id,
  298. fraction: item.fraction,
  299. selected: item.selected
  300. }
  301. })
  302. }else{
  303. this.rankList = []
  304. }
  305. })
  306. },
  307. // 需求挖掘分布图
  308. getRingData(){
  309. let dateType = 0;
  310. if (this.activeTotal == 4) {// 选择自定义
  311. dateType = null;
  312. }else {
  313. dateType = this.activeTotal;
  314. this.startDate = ''
  315. this.endDate = ''
  316. }
  317. this.$u.post('/cusLvStatistics/wordMiningAnalyzeFenbu', {
  318. "houseId": this.houseId,
  319. "deptId": this.deptVal,
  320. "createUser": this.guwenVal,
  321. "dateType":dateType,
  322. "firstStartDate":this.startDate,
  323. "firstEndDate":this.endDate
  324. })
  325. .then(res => {
  326. // console.log(res)
  327. this.ringChartData = { series: [
  328. {
  329. data: [
  330. {"name":"30%以下","value":res.a},
  331. {"name":"30%~50%","value":res.b},
  332. {"name":"50%~70%","value":res.c},
  333. {"name":"70%以上","value":res.d},
  334. ]
  335. }
  336. ]}
  337. })
  338. },
  339. //跳转到接待记录
  340. Toview(){
  341. uni.navigateTo({
  342. url: '/pages/center/records/index?refresh=refresh&activeTotal='+this.activeTotal+'&staTime='+ this.startDate + '&endTime'+this.endDate+'&validInvalid=0'
  343. });
  344. },
  345. // 需求挖掘分析-简报
  346. wordMiningAnalyze() {
  347. let dateType = 0;
  348. if (this.activeTotal == 4) {// 选择全部和自定义
  349. dateType = null;
  350. }else {
  351. dateType = this.activeTotal;
  352. this.startDate = ''
  353. this.endDate = ''
  354. }
  355. let params = {
  356. "houseId": this.houseId,
  357. "deptId": this.deptVal,
  358. "createUser": this.guwenVal,
  359. "dateType":dateType,
  360. "firstStartDate":this.startDate,
  361. "firstEndDate":this.endDate
  362. }
  363. this.$u.post("/cusLvStatistics/wordMiningAnalyze",params).then(res => {
  364. // console.log(res.contrast)
  365. res.contrast.wordFraction = (res.contrast.wordFraction || 0) + '%'
  366. res.first.wordFraction = (res.first.wordFraction || 0) + '%'
  367. res.end.wordFraction = (res.end.wordFraction || 0) + '%'
  368. this.numlist.forEach(item => {
  369. item.duibinum = res.contrast[item.setName]
  370. item.endnum = res.end[item.setName]
  371. item.firstnum = res.first[item.setName]
  372. })
  373. })
  374. },
  375. // 获取员工列表
  376. getStaffList() {
  377. this.$u.post('/cusLvStatistics/selectAllAccountIdByHouseId', {
  378. houseId: this.houseId
  379. })
  380. .then(res => {
  381. // console.log(res)
  382. if(res.length){
  383. this.staffList = res.map(item => {
  384. return {
  385. label: item.name,
  386. value: item.accountId
  387. }
  388. })
  389. this.staffList.unshift({
  390. label: '全部',
  391. value: ''
  392. })
  393. }
  394. })
  395. },
  396. // 需求挖掘率趋势图
  397. getwordMiningAnalyzePercentage() {
  398. let categories1 = []
  399. let categories2 = []
  400. let categories3 = []
  401. let dateType = 0;
  402. if (this.activeTotal == 4) {// 选择全部和自定义
  403. dateType = null;
  404. }else {
  405. dateType = this.activeTotal;
  406. this.startDate = ''
  407. this.endDate = ''
  408. }
  409. this.$u.post('/cusLvStatistics/wordMiningAnalyzePercentage', {
  410. "houseId": this.houseId,
  411. "deptId": this.deptVal,
  412. "createUser": this.guwenVal,
  413. "dateType":dateType,
  414. "firstStartDate":this.startDate,
  415. "firstEndDate":this.endDate
  416. })
  417. .then(res => {
  418. if(res.first&&res.first.length){
  419. categories1 = res.first.map(item=> item.statDate.substring(0,10))
  420. this.lineOptsect.series[0].data=res.first.map(item=> item.wordFraction)
  421. }else{
  422. categories1= []
  423. this.lineOptsect.series[0].data = []
  424. }
  425. if(res.end&&res.end.length){
  426. this.lineOptsect.series[1].data=res.end.map(item=> item.wordFraction)
  427. categories2 = res.end.map(item => item.statDate.substring(0,10))
  428. }else{
  429. categories2 = []
  430. this.lineOptsect.series[1].data = []
  431. }
  432. for(let i=0;i<categories1.length;i++){
  433. categories3.push(categories1[i]+'/'+categories2[i])
  434. }
  435. // console.log(categories3)
  436. this.lineOptsect.categories = categories3
  437. })
  438. },
  439. // 获取团队列表
  440. getSectionList() {
  441. this.$u.post('/cusLvStatistics/findAllDeptIdByHouseId', {
  442. houseId: this.houseId
  443. })
  444. .then(res => {
  445. this.teamList = []
  446. if(res.length){
  447. this.teamList = res.map(item=> {
  448. return {
  449. label: item.deptName,
  450. value: item.deptId
  451. }
  452. })
  453. this.teamList.unshift({
  454. label: '全部',
  455. value: ''
  456. })
  457. }
  458. })
  459. },
  460. //时间切换
  461. tabtimetap(index, text) {
  462. if (index == 4) {
  463. this.calendarShow = true;
  464. } else {
  465. this.endDate = ''
  466. this.startDate = ''
  467. this.time = text
  468. this.getdata()
  469. }
  470. this.activeTotal = index;
  471. this.timeshow = false
  472. },
  473. // 顾问选择
  474. guwenCallback(e){
  475. // console.log(e)
  476. this.guwenVal = e[0].value
  477. this.guwen = e[0].label
  478. this.getdata()
  479. },
  480. // 部门选择
  481. deptCallback(e){
  482. // console.log(e)
  483. this.deptVal = e[0].value
  484. this.dept = e[0].label
  485. this.getdata()
  486. },
  487. // 话术选择
  488. huashuCallback(e){
  489. // console.log(e)
  490. this.huashuVal = e[0].value
  491. this.huashu = e[0].label
  492. this.getdata()
  493. },
  494. //自定义时间
  495. calendarTimeChange(e) {
  496. this.endDate = e.endDate
  497. this.startDate = e.startDate
  498. this.time = '自定义'
  499. this.getdata()
  500. }
  501. }
  502. };
  503. </script>
  504. <style lang="scss" scoped>
  505. .box {
  506. width: 100%;
  507. height: 100%;
  508. background: #FAFAFA;
  509. }
  510. //时间切换的样式
  511. .boxtittab {
  512. position: sticky;
  513. top: var(--window-top);
  514. z-index: 999;
  515. width: 100;
  516. height: 92rpx;
  517. background: #FFFFFF;
  518. border: 1px solid #E0E0E0;
  519. display: flex;
  520. align-items: center;
  521. .tabbox {
  522. flex: 1;
  523. height: 100%;
  524. text-align: center;
  525. line-height: 92rpx;
  526. color: #666666;
  527. font-size: 28rpx;
  528. overflow: hidden;
  529. text-overflow: ellipsis;
  530. display: -webkit-box;
  531. /* 将对象作为弹性伸缩盒子模型显示 */
  532. -webkit-line-clamp: 1;
  533. /* 控制最多显示几行 */
  534. -webkit-box-orient: vertical;
  535. /* 设置或检索伸缩盒对象的子元素的排列方式 */
  536. }
  537. }
  538. .timeview {
  539. height: 80rpx;
  540. line-height: 80rpx;
  541. width: 100%;
  542. text-align: center;
  543. border-bottom: 1px solid #F8F8F8;
  544. }
  545. .black-bg{
  546. position: fixed;
  547. background: rgba(0,0,0,0.6);
  548. left: 0;
  549. right: 0;
  550. top: 0;
  551. bottom: 0;
  552. display: flex;
  553. flex-direction: column;
  554. justify-content: center;
  555. align-items: center;
  556. z-index: 9999;
  557. .tongjiDesc{
  558. width: 80%;
  559. background: #FFFFFF;
  560. border-radius: 12rpx;
  561. padding: 30rpx;
  562. }
  563. .close{
  564. background: #fff;
  565. border-radius: 50%;
  566. width: 80rpx;
  567. height: 80rpx;
  568. margin-top: 30rpx;
  569. display: flex;
  570. justify-content: center;
  571. align-items: center;
  572. }
  573. .tongji-title{
  574. text-align: center;
  575. font-size: 30rpx;
  576. margin-bottom: 20rpx;
  577. }
  578. .text view{
  579. margin-bottom: 24rpx;
  580. }
  581. .bold{
  582. font-weight: bold;
  583. }
  584. }
  585. .grid:nth-child(1) {
  586. border-right: none;
  587. border-bottom: none;
  588. }
  589. .grid:nth-child(2) {
  590. border-bottom: none;
  591. }
  592. .grid:nth-child(3) {
  593. border-right: none;
  594. }
  595. .grid .bottom{
  596. display: flex;
  597. align-items: center;
  598. padding-left: 20rpx;
  599. margin: 10rpx 0 20rpx;
  600. .leftnum{
  601. height: 36rpx;
  602. font-size: 26rpx;
  603. font-family: PingFangSC-Regular, PingFang SC;
  604. font-weight: 400;
  605. color: #666666;
  606. line-height: 36rpx;
  607. margin-right: 20rpx;
  608. }
  609. .rightnum{
  610. height: 36rpx;
  611. font-size: 26rpx;
  612. font-family: PingFangSC-Semibold, PingFang SC;
  613. font-weight: 600;
  614. color: #666;
  615. line-height: 36rpx;
  616. display: flex;
  617. align-items: center;
  618. &.red{
  619. color: #E6273A;
  620. }
  621. &.green{
  622. color: #43CD80;
  623. }
  624. image{
  625. width: 18rpx;
  626. height: 14rpx;
  627. margin-left: 6rpx;
  628. }
  629. }
  630. }
  631. .zonglantitle{
  632. display: flex;
  633. justify-content: space-between;
  634. align-items: center;
  635. text{
  636. color: #666666;
  637. }
  638. }
  639. .uchaserbox{
  640. width: 100%;
  641. height: 500rpx;
  642. }
  643. .tabdada {
  644. width: 100%;
  645. height: 580rpx;
  646. overflow-y: auto;
  647. padding-bottom: 20rpx;
  648. .tabth {
  649. width: 100%;
  650. height: 28rpx;
  651. display: flex;
  652. font-size: 28rpx;
  653. line-height: 28rpx;
  654. color: #666666;
  655. margin-top: 28rpx;
  656. }
  657. .tabth>view:nth-of-type(1) {
  658. width: 10%;
  659. text-align: center;
  660. }
  661. .tabth>view:nth-of-type(2) {
  662. width: 46%;
  663. text-align: center;
  664. }
  665. .tabth>view:nth-of-type(3) {
  666. width: 22%;
  667. text-align: center;
  668. }
  669. .tabth>view:nth-of-type(4) {
  670. width: 22%;
  671. text-align: center;
  672. }
  673. .tabtd {
  674. width: 100%;
  675. height: 30rpx;
  676. display: flex;
  677. font-size: 26rpx;
  678. line-height: 30rpx;
  679. margin-top: 32rpx;
  680. }
  681. .tabtd>view:nth-of-type(1) {
  682. width: 10%;
  683. text-align: center;
  684. line-height: 30rpx;
  685. }
  686. .tabtd>view:nth-of-type(2) {
  687. width: 46%;
  688. max-width: 400rpx;
  689. text-align: center;
  690. color: #333333;
  691. }
  692. .tabtd>view:nth-of-type(3) {
  693. width: 22%;
  694. text-align: center;
  695. color: #333333;
  696. }
  697. .tabtd>view:nth-of-type(4) {
  698. width: 22%;
  699. text-align: center;
  700. color: #2671E2;
  701. }
  702. .ranking {
  703. width: 34rpx;
  704. height: 34rpx;
  705. }
  706. .ranking1 {
  707. width: 30rpx;
  708. height: 30rpx;
  709. background: #ECF1FF;
  710. color: #424D64;
  711. font-size: 18rpx;
  712. text-align: center;
  713. line-height: 30rpx;
  714. border-radius: 50%;
  715. margin: 0 auto;
  716. }
  717. .tabech {
  718. width: 100%;
  719. height: 600rpx;
  720. }
  721. }
  722. </style>