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.
 
 
 

671 lines
15 KiB

  1. <template>
  2. <view class="box">
  3. <view class="boxtittabs">
  4. <div class="items" @tap="screenShow = true">{{ showTimeText }}</div>
  5. <div class="items" @tap="showTemplate = true">{{ showBeText }}</div>
  6. </view>
  7. <view class="info">
  8. <view class="item" @click="goTo(1)">
  9. <text class="num">{{efficient}}</text>
  10. <text class="tit">有效接待</text>
  11. </view>
  12. <view class="item" @click="goTo(2)">
  13. <text class="num">{{markCount}}</text>
  14. <text class="tit">已标顾问</text>
  15. </view>
  16. <view class="item" @click="goTo(3)">
  17. <text class="num">{{noMarkCount}}</text>
  18. <text class="tit">未标顾问</text>
  19. </view>
  20. </view>
  21. <view class="boxzonglan">
  22. <view class="zonglantit">客群特征总览</view>
  23. <view class="zonglanbox">
  24. <view class="grid" v-for="(item,index) in numlist" :key="index" v-if="item.isshow">
  25. <view class="audonum">{{item.name}}<text v-if="index!=0">触达次数</text></view>
  26. <view class="num">{{item.num}}</view>
  27. </view>
  28. </view>
  29. <view v-if="Afolding" class="anclack" @click="anclick(1)">展开 <u-icon style="margin-left: 8rpx;"
  30. label-color='#666666' name="arrow-down"></u-icon>
  31. </view>
  32. <view v-else class="anclack" @click="anclick(2)">收起 <u-icon style="margin-left: 8rpx;" label-color='#666666'
  33. name="arrow-up"></u-icon>
  34. </view>
  35. </view>
  36. <view style="width: 100%;height: 20rpx;background: #FAFAFA;"></view>
  37. <view class="centerfor" v-for="(item,index) in objlist" :key="index">
  38. <view class="fortit">
  39. <view class="left">
  40. <view class="lefti"></view>
  41. <view class="lefttext">{{item.name}}触达排名</view>
  42. </view>
  43. <view class="right">
  44. <view :class="{ activeclass: item.activeTab == 0 }" @click="charttoswitch(index,0)">表格</view>
  45. <view style="margin-left: 16rpx;" :class="{ activeclass: item.activeTab == 1 }"
  46. @click="charttoswitch(index,1)">饼状图</view>
  47. </view>
  48. </view>
  49. <view v-if="item.activeTab==0" class="tabdada">
  50. <view class="tabth">
  51. <view>排名</view>
  52. <view>画像语意词/触达次数</view>
  53. <view>触达占比</view>
  54. <view>沟通记录</view>
  55. </view>
  56. <view v-if="item.total==0"
  57. style="color: #999999;width: 100%;height: 500rpx;line-height: 500rpx;text-align: center;">暂无数据
  58. </view>
  59. <view class="tabtd" v-if="item.total!=0" v-for="(chend,i) in item.matchKeywords" :key="i">
  60. <view>
  61. <image v-if="i==0" class="ranking" src="../../../static/images/ranking1.png" mode=""></image>
  62. <image v-else-if="i==1" class="ranking" src="../../../static/images/ranking2.png" mode="">
  63. </image>
  64. <image v-else-if="i==2" class="ranking" src="../../../static/images/ranking3.png" mode="">
  65. </image>
  66. <view class="ranking1" v-else>{{i+1}}</view>
  67. </view>
  68. <view>{{chend.name}}({{chend.total}})</view>
  69. <view>{{chend.proportion>100?100:chend.proportion}}%</view>
  70. <view @click="Toview(item,i)">查看</view>
  71. </view>
  72. </view>
  73. <view v-if="item.activeTab==1" class="tabech">
  74. <qiun-data-charts :key="item.id" type="ring" :chartData="item.chartData" :canvas2d="true"
  75. :canvasId="'wangxiaohuahahahahaha'+item.id" :opts='item.opts' background="none" />
  76. </view>
  77. </view>
  78. <u-calendar v-model="totalTimeShow" mode="range" @change="totalTimeChange"></u-calendar>
  79. <u-back-top :scroll-top="scrollTop"></u-back-top>
  80. <!-- 更多筛选 -->
  81. <u-popup v-model="screenShow" mode="top">
  82. <view class="screen">
  83. <view class="boxtittab">
  84. <view class="tabbox">
  85. <view :class="{ activecllasscet: activeTotal == 0 }" @click="tabtimetap(0, '今日')">今日</view>
  86. </view>
  87. <view class="tabbox">
  88. <view :class="{ activecllasscet: activeTotal == 1 }" @click="tabtimetap(1, '昨日')">昨日</view>
  89. </view>
  90. <view class="tabbox">
  91. <view :class="{ activecllasscet: activeTotal == 2 }" @click="tabtimetap(2, '近一周')">近一周
  92. </view>
  93. </view>
  94. <view class="tabbox">
  95. <view :class="{ activecllasscet: activeTotal == 3 }" @click="tabtimetap(3, '自定义')">自定义
  96. </view>
  97. </view>
  98. </view>
  99. </view>
  100. </u-popup>
  101. <!-- 销讲业务 -->
  102. <u-select :mask-close-able="false" label-name="templateName" value-name="id" v-model="showTemplate"
  103. mode="single-column" :list="templateList" @cancel="templateCancel" @confirm="templateConfirm"></u-select>
  104. <!-- 加载组件 -->
  105. <loading v-model="LOADING"></loading>
  106. </view>
  107. </template>
  108. <script>
  109. var app = getApp();
  110. var util = require("../../../utils/util.js");
  111. var config = require("../../../config");
  112. import loading from "@/components/loading/index.vue"
  113. export default {
  114. components: {
  115. loading
  116. },
  117. data() {
  118. return {
  119. scrollTop: 0,
  120. activeTotal: 2,
  121. timeobj: {
  122. statDateStart: '',
  123. statDateEnd: ''
  124. },
  125. buildingID: '',
  126. totalTimeShow: false,
  127. activeTab: 0,
  128. numlist: [],
  129. objlist: [],
  130. Afolding: true,
  131. efficient: "",
  132. markCount: "",
  133. noMarkCount: "",
  134. screenShow: false, // 时间筛选弹窗
  135. showTimeText: '近一周', // 展示文字
  136. showBeText: '全部业务', //
  137. templateList: [], // 销讲业务
  138. showTemplate: false, // 展示选择销讲业务弹窗
  139. marketingBusiness: '', // 选择的业务id
  140. };
  141. },
  142. onPageScroll(e) {
  143. this.scrollTop = e.scrollTop;
  144. },
  145. onLoad(e) {
  146. this.LOADING = true
  147. this.buildingID = uni.getStorageSync('buildingID').id;
  148. if (e.activeTotal) {
  149. this.activeTotal = e.activeTotal
  150. }
  151. if (e.staTime) {
  152. this.timeobj = {
  153. statDateStart: e.staTime,
  154. statDateEnd: e.endtime
  155. }
  156. }
  157. this.gitinit()
  158. this.getMarketingBusiness()
  159. },
  160. onPullDownRefresh() {
  161. this.gitinit()
  162. this.getMarketingBusiness()
  163. setTimeout(function() {
  164. uni.stopPullDownRefresh();
  165. }, 1000);
  166. },
  167. methods: {
  168. // 销讲业务方法
  169. templateCancel() {
  170. this.showTemplate = false;
  171. },
  172. // 确认选择销讲业务
  173. templateConfirm(e) {
  174. this.showTemplate = false;
  175. this.marketingBusiness = e[0].value
  176. this.showBeText = e[0].label
  177. this.gitinit()
  178. },
  179. // 获取销讲业务
  180. getMarketingBusiness() {
  181. this.$u.get('/customer/marketingBusiness', {
  182. houseId: uni.getStorageSync('buildingID').id,
  183. }).then(res => {
  184. this.templateList = res
  185. this.templateList.unshift({
  186. templateName: '全部业务',
  187. id: ''
  188. })
  189. })
  190. },
  191. goTo(i) {
  192. if (i == 1) {
  193. uni.navigateTo({
  194. url: '/pages/center/records/index?refresh=' + 'refresh' + '&activeTotal=' + this
  195. .activeTotal + '&validInvalid=0' + '&staTime=' + this.timeobj.statDateStart +
  196. '&endtime=' + this.timeobj.statDateEnd
  197. });
  198. } else if (i == 2) {
  199. uni.navigateTo({
  200. url: '/pages/center/records/index?refresh=' + 'refresh' + '&activeTotal=' + this
  201. .activeTotal + '&markAdvisor=1&validInvalid=0' + '&staTime=' + this.timeobj
  202. .statDateStart + '&endtime=' + this.timeobj.statDateEnd
  203. });
  204. } else {
  205. uni.navigateTo({
  206. url: '/pages/center/records/index?refresh=' + 'refresh' + '&activeTotal=' + this
  207. .activeTotal + '&markAdvisor=0&validInvalid=0' + '&staTime=' + this.timeobj
  208. .statDateStart + '&endtime=' + this.timeobj.statDateEnd
  209. });
  210. }
  211. },
  212. anclick(i) {
  213. console.log(i)
  214. this.Afolding = !this.Afolding;
  215. this.numlist.forEach((citem, index) => {
  216. if (index < 6) {
  217. citem.isshow = true;
  218. } else {
  219. citem.isshow = !citem.isshow;
  220. }
  221. })
  222. this.$forceUpdate()
  223. },
  224. //获取数据
  225. gitinit() {
  226. this.objlist = [];
  227. this.numlist = [];
  228. var dateType = '';
  229. if (this.activeTotal == 3) {
  230. dateType = null;
  231. } else {
  232. dateType = this.activeTotal;
  233. }
  234. let parames = {
  235. dateType: dateType,
  236. statDateStart: this.timeobj.statDateStart,
  237. statDateEnd: this.timeobj.statDateEnd,
  238. houseId: this.buildingID,
  239. marketingBusiness: this.marketingBusiness,
  240. }
  241. this.$u.post("/matchKeywords/findmatchdata", parames).then(data => {
  242. this.LOADING = false
  243. // this.numlist.push({
  244. // name:"有效接待",
  245. // num:data.total
  246. // })
  247. this.efficient = data.total
  248. this.markCount = data.markCount
  249. this.noMarkCount = data.noMarkCount
  250. data.list.forEach((item, index) => {
  251. this.numlist.push({
  252. name: item.name,
  253. num: item.total
  254. })
  255. item.activeTab = 0;
  256. item.opts = {
  257. "title": {
  258. "name": item.total,
  259. "color": '#666666',
  260. "fontSize": 20
  261. },
  262. "subtitle": {
  263. "name": '总触达次数',
  264. "color": '#32363D',
  265. "fontSize": 12,
  266. "offsetY": 4
  267. }
  268. }
  269. item.chartData = {
  270. "categories": [],
  271. "series": [{
  272. "data": []
  273. }],
  274. };
  275. item.matchKeywords.forEach(chend => {
  276. item.chartData.series[0].data.push({
  277. "name": chend.name,
  278. "value": chend.proportion
  279. })
  280. })
  281. })
  282. data.list.forEach(item => {
  283. item.matchKeywords.forEach(chend => {
  284. if (chend.isInterval == 0) {
  285. chend.name = chend.name + chend.unit + '-' + chend.endName + chend
  286. .unit
  287. } else {
  288. chend.name = chend.name
  289. }
  290. })
  291. })
  292. this.objlist = data.list;
  293. this.Afolding = true;
  294. this.numlist.forEach((citem, index) => {
  295. if (index < 6) {
  296. citem.isshow = true
  297. } else {
  298. citem.isshow = false
  299. }
  300. })
  301. }).catch(e => {
  302. this.LOADING = false
  303. })
  304. },
  305. //查看
  306. Toview(item, i) {
  307. console.log(item)
  308. let keywordsid = 0
  309. if (item.matchKeywords[i].children && item.matchKeywords[i].children.length > 0) {
  310. keywordsid = item.matchKeywords[i].children[0].keywordsId
  311. } else {
  312. keywordsid = item.matchKeywords[i].keywordsId
  313. }
  314. uni.navigateTo({
  315. url: '/pages/center/Piabodata/Customerportrait/Receivingrecords?datatype=' + this.activeTotal +
  316. "&keywordsId=" + keywordsid + "&starttime=" + this.timeobj.statDateStart + "&endoftime=" +
  317. this.timeobj.statDateEnd
  318. })
  319. },
  320. //时间切换
  321. tabtimetap(index, text) {
  322. if (index == 3) {
  323. this.totalTimeShow = true;
  324. } else {
  325. this.screenShow = false
  326. this.showTimeText = text
  327. this.activeTotal = index;
  328. this.gitinit()
  329. }
  330. },
  331. //自定义时间
  332. totalTimeChange(e) {
  333. this.screenShow = false
  334. this.showTimeText = `${e.startDate}-${e.endDate}`
  335. this.timeobj.statDateStart = e.startDate;
  336. this.timeobj.statDateEnd = e.endDate;
  337. this.activeTotal = 3;
  338. this.gitinit()
  339. },
  340. charttoswitch(index, num) {
  341. this.objlist[index].activeTab = num
  342. }
  343. }
  344. };
  345. </script>
  346. <style lang="scss" scoped>
  347. .boxtittabs {
  348. width: 100%;
  349. height: 92rpx;
  350. background: #FFFFFF;
  351. display: flex;
  352. align-items: center;
  353. .items {
  354. padding: 0 24rpx;
  355. width: 50%;
  356. height: 100%;
  357. display: flex;
  358. align-items: center;
  359. justify-content: center;
  360. overflow: hidden;
  361. white-space: nowrap;
  362. text-overflow: ellipsis;
  363. }
  364. }
  365. .screen {
  366. width: 100%;
  367. .boxtittab {
  368. width: 100%;
  369. flex-direction: column;
  370. .tabbox {
  371. width: 100%;
  372. }
  373. }
  374. }
  375. .info {
  376. display: flex;
  377. justify-content: space-between;
  378. background: #fff;
  379. padding: 10px 20px;
  380. .item {
  381. display: flex;
  382. flex-direction: column;
  383. justify-content: center;
  384. align-items: center;
  385. text {
  386. font-size: 32rpx;
  387. }
  388. .num {
  389. font-weight: bold;
  390. }
  391. .tit {
  392. margin-top: 20rpx;
  393. }
  394. }
  395. }
  396. .anclack {
  397. width: 100%;
  398. height: 78rpx;
  399. text-align: center;
  400. line-height: 78rpx;
  401. font-size: 30rpx;
  402. border: 1rpx solid #E0E0E0;
  403. font-weight: 400;
  404. color: #666666;
  405. }
  406. .box {
  407. width: 100%;
  408. height: 100%;
  409. background: #FAFAFA;
  410. padding-bottom: 60rpx;
  411. }
  412. .boxtittab {
  413. width: 100;
  414. height: 92rpx;
  415. background: #FFFFFF;
  416. border: 1px solid #E0E0E0;
  417. display: flex;
  418. align-items: center;
  419. .tabbox {
  420. flex: 1;
  421. height: 100%;
  422. text-align: center;
  423. line-height: 92rpx;
  424. color: #666666;
  425. font-size: 28rpx;
  426. display: flex;
  427. justify-content: center;
  428. .activecllasscet {
  429. width: 96rpx;
  430. border-bottom: 2px solid #2671E2;
  431. }
  432. }
  433. }
  434. .tabtime {
  435. width: 100%;
  436. height: 50rpx;
  437. text-align: center;
  438. line-height: 50rpx;
  439. font-size: 24rpx;
  440. color: #666666;
  441. }
  442. .boxzonglan {
  443. width: 100%;
  444. min-height: 496rpx;
  445. background: #FFFFFF;
  446. padding: 30rpx 30rpx 30rpx 30rpx;
  447. .zonglantit {
  448. font-size: 30rpx;
  449. color: #333333;
  450. font-family: PingFangSC-Semibold, PingFang SC;
  451. font-weight: 600;
  452. }
  453. .zonglanbox {
  454. width: 100%;
  455. display: flex;
  456. flex-wrap: wrap;
  457. margin-top: 24rpx;
  458. .grid {
  459. width: 50%;
  460. height: 128rpx;
  461. border: 1px solid #E0E0E0;
  462. .audonum {
  463. color: #666666;
  464. text-indent: 40rpx;
  465. font-size: 26rpx;
  466. margin-top: 20rpx;
  467. }
  468. .num {
  469. color: #333333;
  470. text-indent: 40rpx;
  471. font-size: 32rpx;
  472. font-weight: 600;
  473. margin-top: 10rpx;
  474. }
  475. }
  476. }
  477. }
  478. .centerfor {
  479. width: 100%;
  480. height: 686rpx;
  481. background: #FFFFFF;
  482. padding-left: 30rpx;
  483. padding-right: 30rpx;
  484. margin-top: 20rpx;
  485. .fortit {
  486. width: 100%;
  487. height: 86rpx;
  488. display: flex;
  489. border-bottom: 1px solid #E0E0E0;
  490. .left {
  491. width: 70%;
  492. height: 100%;
  493. display: flex;
  494. align-items: center;
  495. .lefti {
  496. width: 6rpx;
  497. height: 30rpx;
  498. background: #2671E2;
  499. }
  500. .lefttext {
  501. font-size: 30rpx;
  502. font-family: PingFangSC-Semibold, PingFang SC;
  503. font-weight: 600;
  504. color: #333333;
  505. margin-left: 10rpx;
  506. }
  507. }
  508. .right {
  509. width: 30%;
  510. height: 70rpx;
  511. display: flex;
  512. font-size: 28rpx;
  513. align-items: center;
  514. margin-top: 16rpx;
  515. }
  516. .right view {
  517. width: 92rpx;
  518. height: 50rpx;
  519. text-align: center;
  520. }
  521. }
  522. }
  523. .activeclass {
  524. color: #2671E2;
  525. border-bottom: 2px solid #2671E2;
  526. }
  527. .tabdada {
  528. width: 100%;
  529. height: 580rpx;
  530. overflow-y: auto;
  531. padding-bottom: 20rpx;
  532. }
  533. .tabth {
  534. width: 100%;
  535. height: 28rpx;
  536. display: flex;
  537. font-size: 28rpx;
  538. line-height: 28rpx;
  539. color: #666666;
  540. margin-top: 28rpx;
  541. }
  542. .tabth>view:nth-of-type(1) {
  543. width: 10%;
  544. text-align: center;
  545. }
  546. .tabth>view:nth-of-type(2) {
  547. width: 46%;
  548. text-align: center;
  549. }
  550. .tabth>view:nth-of-type(3) {
  551. width: 22%;
  552. text-align: center;
  553. }
  554. .tabth>view:nth-of-type(4) {
  555. width: 22%;
  556. text-align: center;
  557. }
  558. .tabtd {
  559. width: 100%;
  560. height: 30rpx;
  561. display: flex;
  562. font-size: 26rpx;
  563. line-height: 30rpx;
  564. margin-top: 32rpx;
  565. }
  566. .tabtd>view:nth-of-type(1) {
  567. width: 10%;
  568. text-align: center;
  569. line-height: 30rpx;
  570. }
  571. .tabtd>view:nth-of-type(2) {
  572. width: 46%;
  573. text-align: center;
  574. color: #333333;
  575. }
  576. .tabtd>view:nth-of-type(3) {
  577. width: 22%;
  578. text-align: center;
  579. color: #333333;
  580. }
  581. .tabtd>view:nth-of-type(4) {
  582. width: 22%;
  583. text-align: center;
  584. color: #2671E2;
  585. }
  586. .ranking {
  587. width: 34rpx;
  588. height: 34rpx;
  589. }
  590. .ranking1 {
  591. width: 30rpx;
  592. height: 30rpx;
  593. background: #ECF1FF;
  594. color: #424D64;
  595. font-size: 18rpx;
  596. text-align: center;
  597. line-height: 30rpx;
  598. border-radius: 50%;
  599. margin: 0 auto;
  600. }
  601. .tabech {
  602. width: 100%;
  603. height: 600rpx;
  604. }
  605. </style>