AI销管
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.
 
 
 
 

710 lines
16 KiB

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