AI销管
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 

1496 linhas
38 KiB

  1. <template>
  2. <view class="box">
  3. <view class="top-search">
  4. <view class="search-box">
  5. <view class="search" @click="goSearch">
  6. <view class="search-img">
  7. <image class="search-img1" src="../../../static/images/search.png" mode=""></image>
  8. </view>
  9. <view class="search-text">输入客户姓名/手机号</view>
  10. </view>
  11. </view>
  12. <image class="filter-icon" @click="screenShow = true"
  13. src="https://static.quhouse.com/f4feade4a19d413085b591612179457f.png" mode="" />
  14. </view>
  15. <!-- 选择器 -->
  16. <view class="boxtittab">
  17. <view class="tabbox" :class="{activeColor: sortFilter!=='排序'}" @click="soltishow = true">
  18. {{ sortFilter }}
  19. <u-icon name="arrow-down" size="24" style="padding-left: 12rpx;"></u-icon>
  20. </view>
  21. <view class="tabbox" :class="{activeColor: arriveFilter!=='接待时间'}" @click="timeshow = true">
  22. {{ arriveFilter }}
  23. <u-icon name="arrow-down" size="24" style="padding-left: 12rpx;"></u-icon>
  24. </view>
  25. <view class="tabbox" :class="{activeColor: agentIdtext!=='接待顾问'}" @click="selectshow=true">
  26. {{ agentIdtext }}
  27. <u-icon name="arrow-down" size="24" style="padding-left: 12rpx;"></u-icon>
  28. </view>
  29. <view class="tabbox" @click="huaxiangShow = true">
  30. 画像标签<u-icon name="arrow-down" size="24" style="padding-left: 12rpx;"></u-icon>
  31. </view>
  32. </view>
  33. <!-- 筛选后的数量 -->
  34. <view class="count" v-if="recordList.length > 0">
  35. 筛选结果:<text>{{totalRecords}} </text>条
  36. </view>
  37. <view class="content">
  38. <view v-if="recordList.length==0" style="width: 100%;height: 100%;display: flex;align-items: center;">
  39. <view style="width: 100%;height: 100%;padding-top: 200rpx;">
  40. <view style="width: 100%;text-align: center;">
  41. <image style="width: 220rpx;height: 200rpx;"
  42. src="https://static.quhouse.com/zhikong_xcx_img/nodatalist.png" mode=""></image>
  43. </view>
  44. <view style="text-align: center;width: 100%;margin-top: 20rpx;color: #999999;">暂无数据</view>
  45. </view>
  46. </view>
  47. <view v-if="recordList.length" class="content-tips" v-for="(item,index) in recordList" :key='index'
  48. @click="gotoDetail(item.id)">
  49. <view class="content-first">
  50. <view class="left">
  51. <view class="test">{{item.name}}</view>
  52. <template v-if="item.level > 0">
  53. <view class="img" :class="colorName[item.level]">{{ item.level | levelText }}</view>
  54. </template>
  55. <view v-if="item.clientStageName" class="clientStageName">{{ item.clientStageName }}</view>
  56. </view>
  57. <view class="right">
  58. <image class="right-img" src="../../../static/images/arrow-right.png" mode=""></image>
  59. </view>
  60. </view>
  61. <view class="content-sec">
  62. <view class="content-sec-lab">
  63. 客户手机:<view class="content-sec-lab1">{{item.phone | phoneText}}</view>
  64. </view>
  65. <view class="content-sec-lab">
  66. 负责顾问:<view class="content-sec-lab1">{{item.agentName || ''}}</view>
  67. </view>
  68. <view class="content-sec-lab">
  69. <view class="u-flex" style="flex:1">
  70. 挖掘执行:<view class="content-sec-lab1">{{item.wordFraction||0}}%</view>
  71. </view>
  72. <view class="u-flex" style="flex:1">
  73. 挖掘成功:<view class="content-sec-lab1">{{item.wordFinishFraction||0}}%</view>
  74. </view>
  75. </view>
  76. <view class="content-sec-lab">
  77. 添加时间:<view class="content-sec-lab1">{{item.createTime | formatTime}}</view>
  78. </view>
  79. <view class="content-sec-num">
  80. <view>到访{{item.visitRecord || '--'}}次</view>
  81. <view>
  82. {{item.mm || '0'}}min/{{item.fraction || '0'}}%
  83. </view>
  84. </view>
  85. </view>
  86. <template v-if="permissions.commonly2">
  87. <view class="content-last">
  88. <!-- <view class="content-last-tab">
  89. <image src="/static/images/genjin-icon.png" mode="" />添加提醒</view>
  90. <view class="content-last-tab">
  91. <image src="/static/images/genjin-icon.png" mode="" />
  92. 打电话</view> -->
  93. <view class="content-last-tab" @click.stop="gotoFollowUp(item)">
  94. <image src="/static/images/genjin-icon.png" mode="" />
  95. 写跟进
  96. </view>
  97. </view>
  98. </template>
  99. </view>
  100. </view>
  101. <!-- 更多筛选 -->
  102. <u-popup v-model="screenShow" mode="top" height="900">
  103. <view class="screen">
  104. <scroll-view scroll-y="true" style="height: 750rpx;">
  105. <!-- 销讲业务 -->
  106. <view class="screen-record">
  107. <view class="screen-record-text" @click="showTemplate=!showTemplate">
  108. 销讲业务
  109. <image v-if="showTemplate" class="arrow"
  110. src="https://static.quhouse.com/6cf38a2b82694392a7ab6eea24ce76b1.png" mode="" />
  111. <image v-else class="arrow"
  112. src="https://static.quhouse.com/17d69984ec7c4830b43f712016f06807.png" mode="" />
  113. </view>
  114. <view class="screen-record-tab" v-if="showTemplate">
  115. <block v-for="(item,index) in templateList" :key="index">
  116. <view class="screen-record-item"
  117. :class="[item.isShow?'screen-record-chose':'screen-record-nochose']"
  118. @click="choice(item)">
  119. {{item.templateName}}
  120. </view>
  121. </block>
  122. </view>
  123. </view>
  124. <!-- 接待时长 -->
  125. <view class="screen-record">
  126. <view class="screen-record-text" @click="jiedaiArrow = !jiedaiArrow">
  127. 接待时长
  128. <image v-if="jiedaiArrow" class="arrow"
  129. src="https://static.quhouse.com/6cf38a2b82694392a7ab6eea24ce76b1.png" mode="" />
  130. <image v-else class="arrow"
  131. src="https://static.quhouse.com/17d69984ec7c4830b43f712016f06807.png" mode="" />
  132. </view>
  133. <view class="screen-record-tab" v-if="jiedaiArrow">
  134. <block v-for="(item, index) in jiedaiList" :key="index">
  135. <view class="screen-record-item" :class="[
  136. item.isShow ? 'screen-record-chose' : 'screen-record-nochose',
  137. ]" @click="choice(item)">
  138. {{ item.label }}
  139. </view>
  140. </block>
  141. </view>
  142. </view>
  143. <!-- 客户等级 -->
  144. <view class="screen-record">
  145. <view class="screen-record-text" @click="levelArrow = !levelArrow">
  146. 意向等级
  147. <image v-if="levelArrow" class="arrow"
  148. src="https://static.quhouse.com/6cf38a2b82694392a7ab6eea24ce76b1.png" mode="" />
  149. <image v-else class="arrow"
  150. src="https://static.quhouse.com/17d69984ec7c4830b43f712016f06807.png" mode="" />
  151. </view>
  152. <view class="screen-record-tab" v-if="levelArrow">
  153. <block v-for="(item, index) in levelList" :key="index">
  154. <view class="screen-record-item" :class="[
  155. item.isShow ? 'screen-record-chose' : 'screen-record-nochose',
  156. ]" @click="choice(item)">
  157. {{ item.label }}
  158. </view>
  159. </block>
  160. </view>
  161. </view>
  162. <!-- 客户来源 -->
  163. <view class="screen-record">
  164. <view class="screen-record-text" @click="sourceArrow = !sourceArrow">
  165. 客户来源
  166. <image v-if="sourceArrow" class="arrow"
  167. src="https://static.quhouse.com/6cf38a2b82694392a7ab6eea24ce76b1.png" mode="" />
  168. <image v-else class="arrow"
  169. src="https://static.quhouse.com/17d69984ec7c4830b43f712016f06807.png" mode="" />
  170. </view>
  171. <view class="screen-record-tab" v-if="sourceArrow">
  172. <block v-for="(item, index) in sourceList" :key="index">
  173. <view class="screen-record-item" :class="[
  174. item.isShow ? 'screen-record-chose' : 'screen-record-nochose',
  175. ]" @click="choice(item)">
  176. {{ item.label }}
  177. </view>
  178. </block>
  179. </view>
  180. </view>
  181. <!-- 客户阶段 -->
  182. <view class="screen-record">
  183. <view class="screen-record-text" @click="jieduanArrow = !jieduanArrow">
  184. 客户阶段
  185. <image v-if="jieduanArrow" class="arrow"
  186. src="https://static.quhouse.com/6cf38a2b82694392a7ab6eea24ce76b1.png" mode="" />
  187. <image v-else class="arrow"
  188. src="https://static.quhouse.com/17d69984ec7c4830b43f712016f06807.png" mode="" />
  189. </view>
  190. <view class="screen-record-tab" v-if="jieduanArrow">
  191. <block v-for="(item, index) in phaseList" :key="index">
  192. <view class="screen-record-item" :class="[
  193. item.isShow ? 'screen-record-chose' : 'screen-record-nochose',
  194. ]" @click="choice(item)">
  195. {{ item.label }}
  196. </view>
  197. </block>
  198. </view>
  199. </view>
  200. <!-- 需求挖掘率 -->
  201. <view class="screen-record">
  202. <view class="screen-record-text" @click="wajueArrow = !wajueArrow">
  203. 需求挖掘率
  204. <image v-if="wajueArrow" class="arrow"
  205. src="https://static.quhouse.com/6cf38a2b82694392a7ab6eea24ce76b1.png" mode="" />
  206. <image v-else class="arrow"
  207. src="https://static.quhouse.com/17d69984ec7c4830b43f712016f06807.png" mode="" />
  208. </view>
  209. <view class="screen-record-tab" v-if="wajueArrow">
  210. <block v-for="(item, index) in wajueList" :key="index">
  211. <view class="screen-record-item" :class="[
  212. item.isShow ? 'screen-record-chose' : 'screen-record-nochose',
  213. ]" @click="choice(item)">
  214. {{ item.label }}
  215. </view>
  216. </block>
  217. </view>
  218. </view>
  219. <!-- 销讲执行率 -->
  220. <view class="screen-record">
  221. <view class="screen-record-text" @click="xiaojiangArrow = !xiaojiangArrow">
  222. 销讲执行率
  223. <image v-if="xiaojiangArrow" class="arrow"
  224. src="https://static.quhouse.com/6cf38a2b82694392a7ab6eea24ce76b1.png" mode="" />
  225. <image v-else class="arrow"
  226. src="https://static.quhouse.com/17d69984ec7c4830b43f712016f06807.png" mode="" />
  227. </view>
  228. <view class="screen-record-tab" v-if="xiaojiangArrow">
  229. <block v-for="(item, index) in xiaojiangList" :key="index">
  230. <view class="screen-record-item" :class="[
  231. item.isShow ? 'screen-record-chose' : 'screen-record-nochose',
  232. ]" @click="choice(item)">
  233. {{ item.label }}
  234. </view>
  235. </block>
  236. </view>
  237. </view>
  238. <!-- 到访次数 -->
  239. <view class="screen-record">
  240. <view class="screen-record-text" @click="visitArrow = !visitArrow">
  241. 到访次数
  242. <image v-if="visitArrow" class="arrow"
  243. src="https://static.quhouse.com/6cf38a2b82694392a7ab6eea24ce76b1.png" mode="" />
  244. <image v-else class="arrow"
  245. src="https://static.quhouse.com/17d69984ec7c4830b43f712016f06807.png" mode="" />
  246. </view>
  247. <view class="screen-record-tab" v-if="visitArrow">
  248. <block v-for="(item, index) in visitList" :key="index">
  249. <view class="screen-record-item" :class="[
  250. item.isShow ? 'screen-record-chose' : 'screen-record-nochose',
  251. ]" @click="choice(item)">
  252. {{ item.label }}
  253. </view>
  254. </block>
  255. </view>
  256. </view>
  257. </scroll-view>
  258. <view class="screen-foot">
  259. <view class="screen-foot-reset" @click="reset"> 重置 </view>
  260. <view class="screen-foot-sure" @click="screensure"> 确定 </view>
  261. </view>
  262. </view>
  263. </u-popup>
  264. <!-- 选择顾问的选择框 -->
  265. <u-select v-model="selectshow" :list="freeList" @confirm="actionSelectCallback"></u-select>
  266. <!-- 自定义时间 -->
  267. <u-calendar v-model="totalTimeShow" mode="range" @change="totalTimeChange"></u-calendar>
  268. <!-- 选择接待时间 -->
  269. <u-popup v-model="timeshow" mode="bottom">
  270. <view class="timeview" :style="{ color: activeTotal == 5 ? '#2B6EFF' : '#333333' }"
  271. @click="tabtimetap(5, '接待时间')">
  272. 全部</view>
  273. <view class="timeview" :style="{ color: activeTotal == 0 ? '#2B6EFF' : '#333333' }"
  274. @click="tabtimetap(0, '今天')">
  275. 今天</view>
  276. <view class="timeview" :style="{ color: activeTotal == 1 ? '#2B6EFF' : '#333333' }"
  277. @click="tabtimetap(1, '昨天')">
  278. 昨天</view>
  279. <view class="timeview" :style="{ color: activeTotal == 2 ? '#2B6EFF' : '#333333' }"
  280. @click="tabtimetap(2, '近7天')">
  281. 近7天</view>
  282. <view class="timeview" :style="{ color: activeTotal == 3 ? '#2B6EFF' : '#333333' }"
  283. @click="tabtimetap(3, '近30天')">
  284. 近30天</view>
  285. <view class="timeview" :style="{ color: activeTotal == 4 ? '#2B6EFF' : '#333333' }" @click="tabtimetap(4)">
  286. 自定义</view>
  287. </u-popup>
  288. <!-- 排序 -->
  289. <u-popup v-model="soltishow" mode="bottom">
  290. <view class="soltishow" @tap.stop @touchmove.stop>
  291. <block v-for="(item, index) in orderBylist" :key="index">
  292. <view class="soltishow-item" :style="orderBy==item.value?'color: #2B6EFF':''"
  293. @click="selectCallback2(item)">
  294. {{ item.label }}
  295. </view>
  296. </block>
  297. </view>
  298. </u-popup>
  299. <!-- 画像标签 -->
  300. <u-popup v-model="huaxiangShow" mode="top" height="850">
  301. <view class="screen">
  302. <scroll-view scroll-y="true" style="height: 700rpx;">
  303. <view class="screen-record" v-if="item.children.length" v-for="(item,index) in huaxiangList"
  304. :key="index">
  305. <view class="screen-record-text" @click="choice(item)">
  306. {{item.name}}
  307. <image v-if="item.isShow" class="arrow"
  308. src="https://static.quhouse.com/6cf38a2b82694392a7ab6eea24ce76b1.png" mode="" />
  309. <image v-else class="arrow"
  310. src="https://static.quhouse.com/17d69984ec7c4830b43f712016f06807.png" mode="" />
  311. </view>
  312. <view class="screen-record-tab" v-if="item.isShow">
  313. <block v-for="(subitem, ind) in item.children" :key="ind">
  314. <view class="screen-record-item" :class="[
  315. subitem.isShow ? 'screen-record-chose' : 'screen-record-nochose',
  316. ]" @click="choice(subitem)">
  317. {{ subitem.name }}
  318. </view>
  319. </block>
  320. </view>
  321. </view>
  322. </scroll-view>
  323. <view class="screen-foot">
  324. <view class="screen-foot-reset" @click="resetHuaXiang"> 重置 </view>
  325. <view class="screen-foot-sure" @click="screensure"> 确定 </view>
  326. </view>
  327. </view>
  328. </u-popup>
  329. <!-- 加载组件 -->
  330. <u-loadings v-model="LOADING"></u-loadings>
  331. </view>
  332. </template>
  333. <script>
  334. var config = require("@/config");
  335. let _this
  336. export default {
  337. data() {
  338. return {
  339. keywordsIds: [], // 画像标签
  340. sourceList: [],//客户来源
  341. templateList: [], // 销讲业务
  342. showTemplate: true, // 展示销讲业务
  343. agentIdtext: '接待顾问',
  344. phaseList: [],// 客户阶段
  345. huaxiangShow: false,
  346. wajueArrow: true,
  347. jieduanArrow: true,
  348. sourceArrow: true,
  349. levelArrow: true,
  350. zixunArrow: true,
  351. jiedaiArrow: true,
  352. luyinArrow: true,
  353. visitArrow: true,
  354. xiaojiangArrow: true,
  355. huaxiangList: [],
  356. orderBylist: [{
  357. label: '创建时间倒序',
  358. value: '1'
  359. },
  360. {
  361. label: '创建时间正序',
  362. value: '2'
  363. },
  364. {
  365. label: '接待时间倒序',
  366. value: '3'
  367. },
  368. {
  369. label: '接待时间正序',
  370. value: '4'
  371. },
  372. {
  373. label: '执行率正序',
  374. value: '5'
  375. },
  376. {
  377. label: '执行率倒序',
  378. value: '6'
  379. },
  380. {
  381. label: '接访次数正序',
  382. value: '7'
  383. },
  384. {
  385. label: '接访次数倒序',
  386. value: '8'
  387. },
  388. ],
  389. jiedaiList: [{
  390. label: "0~15min",
  391. value: 1,
  392. isShow: false,
  393. },
  394. {
  395. label: "16~30min",
  396. value: 2,
  397. isShow: false,
  398. },
  399. {
  400. label: "31~60min",
  401. value: 3,
  402. isShow: false,
  403. },
  404. {
  405. label: "61~90min",
  406. value: 4,
  407. isShow: false,
  408. },
  409. {
  410. label: "91min及以上",
  411. value: 5,
  412. isShow: false,
  413. },
  414. ],
  415. wajueList: [{
  416. label: "31%及以下",
  417. value: 1,
  418. isShow: false,
  419. },
  420. {
  421. label: "31%~50%",
  422. value: 2,
  423. isShow: false,
  424. },
  425. {
  426. label: "51%~70%",
  427. value: 3,
  428. isShow: false,
  429. },
  430. {
  431. label: "71%及以上",
  432. value: 4,
  433. isShow: false,
  434. },
  435. ],
  436. xiaojiangList: [{
  437. label: "30%及以下",
  438. value: 1,
  439. isShow: false,
  440. },
  441. {
  442. label: "31%~50%",
  443. value: 2,
  444. isShow: false,
  445. },
  446. {
  447. label: "51%~70%",
  448. value: 3,
  449. isShow: false,
  450. },
  451. {
  452. label: "71%及以上",
  453. value: 4,
  454. isShow: false,
  455. },
  456. ],
  457. value: '',
  458. screenShow: false,
  459. selectshow: false,
  460. selectTipshow: false,
  461. buildingID: '',
  462. screen: {
  463. staTime: "",
  464. endTime: "",
  465. orderBy: "", // 排序
  466. agentId: "", //顾问
  467. sourceIds: [], // 客户来源
  468. level: [], // 客户等级
  469. visitRecord: [], // 到访次数
  470. wajueVal: [], // 需求挖掘
  471. xiaojiangVal: [], //销讲执行率
  472. jiedaiVal: [], // 接待时长
  473. validInvalid: null, // 录音标识
  474. clientStage: [], // 客户阶段 clientStage
  475. },
  476. stageList: ['未知', '到访', '意向', '定金', '成交'],
  477. recordList: [],
  478. nextPage: 1,
  479. totalRecord: '',
  480. totalRecords: '', // 总条数
  481. freeList: [],
  482. userInfo: {},
  483. isnorefresh: '',
  484. activeTotal: 5,
  485. activeTotal2: 0,
  486. totalTimeShow: false,
  487. timeshow: false,
  488. soltishow: false,
  489. permissions: {
  490. commonly1: false,
  491. commonly2: false
  492. },
  493. list: [], // 客户来源列表
  494. sourceId: '', // 选中的客户来源id
  495. // 不同等级之间的颜色
  496. colorName: [
  497. '', "A", "B", "C", "D"
  498. ],
  499. // 筛选文字展示
  500. sortFilter: '排序',
  501. arriveFilter: '接待时间',
  502. visitList: [{
  503. label: '首次到访',
  504. value: 1,
  505. isShow: false,
  506. }, {
  507. label: '2次到访',
  508. value: 2,
  509. isShow: false,
  510. }, {
  511. label: '3次到访',
  512. value: 3,
  513. isShow: false,
  514. }, {
  515. label: '3次以上',
  516. value: 4,
  517. isShow: false,
  518. }, ],
  519. levelList: [{
  520. label: 'A',
  521. value: 1,
  522. isShow: false,
  523. }, {
  524. label: 'B',
  525. value: 2,
  526. isShow: false,
  527. }, {
  528. label: 'C',
  529. value: 3,
  530. isShow: false,
  531. }, {
  532. label: 'D',
  533. value: 4,
  534. isShow: false,
  535. }, ],
  536. isRefresh: false
  537. }
  538. },
  539. onLoad(options) {
  540. this.LOADING = true
  541. this.userInfo = uni.getStorageSync("weapp_session_userInfo_data")
  542. let newmenulist = uni.getStorageSync('weapp_session_Menu_data');
  543. this.permissions.commonly1 = newmenulist.khgl_ck;
  544. this.permissions.commonly2 = newmenulist.khgl_gj;
  545. _this = this
  546. },
  547. onPullDownRefresh() {
  548. this.buildingID = uni.getStorageSync('buildingID').id;
  549. this.LOADING = true
  550. this.nextPage = 1;
  551. this.isRefresh = true;
  552. this.resetFilter()
  553. this.reset()
  554. this.getFreeList()
  555. this.getFromSource();
  556. this.getMyCustom();
  557. setTimeout(() => {
  558. uni.stopPullDownRefresh()
  559. }, 2000)
  560. },
  561. onShow() {
  562. this.buildingID = uni.getStorageSync('buildingID').id;
  563. this.updatebuildingID = uni.getStorageSync('updatebuildingID')
  564. if (this.isnorefresh != 'refresh'||this.updatebuildingID=='updatebuildingID') {
  565. this.nextPage = 1;
  566. this.recordList = []
  567. this.getMyCustom()
  568. this.getFreeList()
  569. this.getWordMiningList();
  570. this.getCustomPhase();
  571. this.getFromSource();
  572. // this.getMarketingBusiness();// 销讲业务
  573. this.isRefresh = false;
  574. this.isnorefresh = 'refresh';
  575. uni.setStorageSync('updatebuildingID', '');
  576. }
  577. this.updateInit()
  578. },
  579. onReachBottom() {
  580. if (this.totalRecord == this.nextPage) {
  581. uni.showToast({
  582. icon: 'none',
  583. title: '到底了',
  584. duration: 2000
  585. });
  586. return
  587. } else {
  588. this.isRefresh = false;
  589. this.nextPage = this.nextPage + 1;
  590. this.getMyCustom();
  591. }
  592. },
  593. methods: {
  594. // 获取客户阶段数据
  595. getCustomPhase() {
  596. this.phaseList = [];
  597. this.$u
  598. .post("/customer/lifeTrackDefineList", {
  599. houseId: this.buildingID,
  600. })
  601. .then((res) => {
  602. if (res.length) {
  603. this.phaseList = res.map(item => {
  604. return {
  605. label: item.stageName,
  606. value: item.id,
  607. isShow: false
  608. }
  609. })
  610. } else {
  611. this.phaseList = []
  612. }
  613. });
  614. },
  615. // 获取客户来源
  616. getFromSource() {
  617. this.$u.get(config.service.sourceList, {
  618. houseId: this.buildingID
  619. })
  620. .then((res) => {
  621. if (res.length) {
  622. this.sourceList = res.map((item) => {
  623. return {
  624. label: item.sourceName,
  625. value: item.id,
  626. isShow: false
  627. }
  628. })
  629. } else {
  630. this.sourceList = []
  631. }
  632. })
  633. },
  634. // 获取销讲业务
  635. getMarketingBusiness() {
  636. this.$u.get('/customer/marketingBusiness', {
  637. houseId: this.buildingID,
  638. }).then(res => {
  639. this.templateList = res.map(item => {
  640. return {
  641. ...item,
  642. isShow: false,
  643. }
  644. })
  645. })
  646. },
  647. updateInit() {
  648. this.$u.get(config.service.notReadNum, {
  649. id: uni.getStorageSync('weapp_session_userInfo_data').accountId,
  650. projectId: uni.getStorageSync('buildingID').id
  651. }).then(res => {
  652. console.log(res)
  653. if (res > 0) {
  654. uni.setTabBarBadge({ //显示数字
  655. index: 4, //tabbar下标
  656. text: `${res}`//数字
  657. })
  658. } else {
  659. uni.removeTabBarBadge({
  660. index: 4
  661. })
  662. }
  663. }).catch(e => {
  664. uni.removeTabBarBadge({
  665. index: 4
  666. })
  667. })
  668. },
  669. filterFun() {
  670. },
  671. // 过滤
  672. resetFilter() {
  673. this.sortFilter = '排序';
  674. this.agentIdtext = '接待顾问';
  675. this.screen.orderBy = null;
  676. this.arriveFilter = '接待时间';
  677. this.screen.staTime = '';
  678. this.screen.endTime = '';
  679. this.nextPage = 1;
  680. this.activeTotal = 5;
  681. this.recordList = [];
  682. this.activeTotal2 = 0;
  683. },
  684. //选择排序
  685. selectCallback2(e) {
  686. this.sortFilter = e.label;
  687. this.screen.orderBy = e.value;
  688. this.nextPage = 1;
  689. this.recordList = [];
  690. this.soltishow = false;
  691. this.isRefresh = false;
  692. this.getMyCustom();
  693. },
  694. //时间选择
  695. tabtimetap(index, text) {
  696. this.timeshow = false;
  697. if (text) this.arriveFilter = text
  698. if (index == 4) {
  699. this.totalTimeShow = true;
  700. } else {
  701. this.activeTotal = index;
  702. this.screen.staTime = '';
  703. this.screen.endTime = '';
  704. this.nextPage = 1;
  705. this.isRefresh = false;
  706. this.recordList = [];
  707. this.getMyCustom();
  708. }
  709. },
  710. //自定义时间
  711. totalTimeChange(e) {
  712. this.screen.staTime = e.startDate;
  713. this.screen.endTime = e.endDate;
  714. this.activeTotal = 4;
  715. this.nextPage = 1;
  716. this.recordList = [];
  717. this.isRefresh = false;
  718. this.arriveFilter = this.screen.staTime + '-' + this.screen.endTime
  719. this.getMyCustom();
  720. },
  721. choice(item) {
  722. item.isShow = !item.isShow;
  723. },
  724. // 客户详情
  725. gotoDetail(id) {
  726. if (this.permissions.commonly1 == true) {
  727. uni.navigateTo({
  728. url: `/pages/center/consumer/consumerDetail?id=${id}`
  729. })
  730. }
  731. },
  732. getMyCustom() {
  733. this.screen.visitRecord = []
  734. this.screen.jiedaiVal = []
  735. this.screen.wajueVal = []
  736. this.screen.xiaojiangVal = []
  737. this.screen.level = []
  738. this.screen.clientStage = []
  739. this.screen.sourceIds = []
  740. let dateType = 0;
  741. if (this.activeTotal == 5 || this.activeTotal == 4) {
  742. dateType = null;
  743. } else {
  744. dateType = this.activeTotal;
  745. }
  746. // 到访次数
  747. this.visitList.forEach(i => {
  748. if (i.isShow) this.screen.visitRecord.push(i.value)
  749. })
  750. // 接待时长
  751. this.jiedaiList.forEach(i => {
  752. if (i.isShow) this.screen.jiedaiVal.push(i.value)
  753. })
  754. // 需求挖掘
  755. this.wajueList.forEach(i => {
  756. if (i.isShow) this.screen.wajueVal.push(i.value)
  757. })
  758. // 销讲执行率
  759. this.xiaojiangList.forEach(i => {
  760. if (i.isShow) this.screen.xiaojiangVal.push(i.value)
  761. })
  762. // 客户等级
  763. this.levelList.forEach(i => {
  764. if (i.isShow) this.screen.level.push(i.value)
  765. })
  766. //客户阶段
  767. this.phaseList.forEach(i => {
  768. if (i.isShow) this.screen.clientStage.push(i.value)
  769. })
  770. // 客户来源
  771. this.sourceList.forEach(i => {
  772. if (i.isShow) this.screen.sourceIds.push(i.value)
  773. })
  774. var parames = {
  775. pageNum: this.nextPage,
  776. pageSize: 10,
  777. query: {
  778. projectId: this.buildingID,
  779. fractions: this.screen.xiaojiangVal.length ? this.screen.xiaojiangVal.join(',') : '', // 销讲执行率
  780. wordFractions: this.screen.wajueVal.length ? this.screen.wajueVal.join(',') : '', //需求挖掘
  781. visitRecordNum: this.screen.visitRecord.length ? this.screen.visitRecord.join(',') : '', //到访次数
  782. clientStages: this.screen.clientStage.length ? this.screen.clientStage.join(',') : '', // 客户阶段
  783. sourceIds: this.screen.sourceIds.length ? this.screen.sourceIds.join(',') : '', // 客户来源
  784. level: this.screen.level.length ? this.screen.level.join(',') : '', // 客户等级
  785. duractionNums: this.screen.jiedaiVal.length ? this.screen.jiedaiVal.join(',') : '', // 接待时长
  786. keywordsIds: this.keywordsIds.length ? this.keywordsIds.join(',') : '', // 画像标签
  787. dateType: dateType, // 接待时间
  788. staTime: this.screen.staTime,
  789. endTime: this.screen.endTime,
  790. agentId: this.screen.agentId, // 顾问
  791. orderBy: this.screen.orderBy == '' ? '' : this.screen.orderBy, // 排序
  792. },
  793. };
  794. let ars = []
  795. this.templateList.forEach(item => {
  796. if (item.isShow) {
  797. ars.push(item.id)
  798. }
  799. })
  800. parames.query.marketingBusiness = ars.join(',')
  801. this.$u.post("/customer/customerManagement", parames)
  802. .then((data) => {
  803. this.LOADING = false;
  804. var list = data.records || [];
  805. list.forEach((item) => {
  806. if (this.userInfo.dataCode == 6) {
  807. item.isshow = true;
  808. } else {
  809. item.isshow = false;
  810. }
  811. });
  812. if (this.isRefresh) {
  813. this.recordList = list;
  814. } else {
  815. this.recordList = [...this.recordList, ...list];
  816. }
  817. this.totalRecord = data.pages;
  818. this.totalRecords = data.total;
  819. })
  820. .catch((e) => {
  821. this.LOADING = false;
  822. });
  823. },
  824. getMyCustom1() {
  825. let dateType = 0;
  826. let recDurationInterval = 0;
  827. let orderBy = 0;
  828. if (this.activeTotal == 5) {
  829. dateType = null;
  830. } else if (this.activeTotal == 4) {
  831. dateType = null;
  832. } else {
  833. dateType = this.activeTotal;
  834. }
  835. if (this.activeTotal2 == 0) {
  836. recDurationInterval = null
  837. } else {
  838. recDurationInterval = this.activeTotal2
  839. }
  840. if (this.orderBy == 0) {
  841. orderBy = null;
  842. } else {
  843. orderBy = this.orderBy;
  844. }
  845. var parames = {
  846. pageNum: this.nextPage,
  847. pageSize: 10,
  848. query: {
  849. projectId: this.buildingID,
  850. keywordsId: this.screen.cunsumerTipsid,
  851. agentId: this.screen.agentId,
  852. dateType: dateType,
  853. staDate: this.screen.staTime,
  854. endDate: this.screen.endTime,
  855. recDurationInterval: recDurationInterval,
  856. orderBy: orderBy,
  857. sourceId: this.sourceId
  858. }
  859. };
  860. if (this.screen.visitRecord.length > 0) {
  861. parames.query.visitRecords = this.screen.visitRecord.join(',');
  862. }
  863. if (this.screen.record.length > 0) {
  864. parames.query.level = this.screen.record.join(',');
  865. }
  866. this.$u.post("/customer/customerManagement", parames).then(data => {
  867. this.LOADING = false
  868. var list = data.results || [];
  869. list.forEach(item => {
  870. if (item.demand.cusSemanticWordsList != null) {
  871. item.demand.cusSemanticWordsList.forEach(che => {
  872. if (che.isInterval == 0) {
  873. che.name = che.name + che.unit + '-' + che.endName + che.unit;
  874. }
  875. })
  876. }
  877. })
  878. if (this.isRefresh) {
  879. this.recordList = list;
  880. } else {
  881. console.log('我在这里被打印了', this.recordList)
  882. this.recordList = [...this.recordList, ...list];
  883. }
  884. this.totalRecord = data.totalPage;
  885. this.totalRecords = data.totalRecord;
  886. }).catch(e => {
  887. this.LOADING = false
  888. })
  889. },
  890. //获取顾问列表
  891. getFreeList() {
  892. this.$u.post("/cusLvStatistics/selectAllAccountIdByHouseId", {
  893. houseId: this.buildingID
  894. }).then(res => {
  895. res.forEach(item => {
  896. item.label = item.name;
  897. item.value = item.accountId
  898. })
  899. res.unshift({
  900. label: '全部',
  901. value: ''
  902. })
  903. this.freeList = res
  904. console.log(this.freeList)
  905. })
  906. },
  907. //获取画像标签
  908. getWordMiningList() {
  909. this.huaxiangList = [];
  910. this.$u.get("/corpus/findSelectedWordMiningTemplate", {
  911. houseId: this.buildingID,
  912. selected: 1
  913. })
  914. .then((res) => {
  915. // console.log(res)
  916. if (res.length) {
  917. res.forEach(item => {
  918. item.isShow = true;
  919. if (item.children.length) {
  920. item.children.forEach(subitem => {
  921. subitem.isShow = false;
  922. })
  923. }
  924. })
  925. }
  926. this.huaxiangList = res;
  927. });
  928. },
  929. //选择顾问
  930. actionSelectCallback(e) {
  931. console.log(e)
  932. if(e[0].label=='全部'){
  933. this.agentIdtext = '接待顾问'
  934. this.screen.agentId= ''
  935. }else{
  936. this.screen.agentId = e[0].value;
  937. this.agentIdtext = e[0].label;
  938. }
  939. },
  940. //重置
  941. reset() {
  942. this.screen = {
  943. agentId: "",
  944. visitRecord: [],
  945. record: [],
  946. clientStage: "",
  947. clientStageName: "",
  948. };
  949. this.sourceList.map((i) => {
  950. i.isShow = false;
  951. });
  952. this.wajueList.map((i) => {
  953. i.isShow = false;
  954. });
  955. this.phaseList.map((i) => {
  956. i.isShow = false;
  957. });
  958. this.jiedaiList.map((i) => {
  959. i.isShow = false;
  960. });
  961. this.xiaojiangList.map((i) => {
  962. i.isShow = false;
  963. });
  964. this.visitList.map((i) => {
  965. i.isShow = false;
  966. });
  967. this.levelList.map((i) => {
  968. i.isShow = false;
  969. });
  970. this.nextPage = 1;
  971. this.recordList = [];
  972. this.isRefresh = false;
  973. this.getMyCustom();
  974. },
  975. //重置画像标签选择
  976. resetHuaXiang() {
  977. if (this.huaxiangList.length) {
  978. this.huaxiangList.forEach(item => {
  979. item.isShow = true;
  980. if (item.children.length) {
  981. item.children.forEach(subitem => {
  982. subitem.isShow = false;
  983. })
  984. }
  985. })
  986. }
  987. },
  988. //筛选确认
  989. screensure() {
  990. this.nextPage = 1;
  991. this.recordList = [];
  992. this.keywordsIds = []
  993. this.screenShow = false;
  994. this.huaxiangShow = false;
  995. this.isRefresh = false;
  996. // 画像标签
  997. this.huaxiangList.forEach(item => {
  998. if (item.children.length) {
  999. item.children.forEach(im => {
  1000. if (im.isShow) this.keywordsIds.push(im.id)
  1001. })
  1002. }
  1003. })
  1004. this.getMyCustom();
  1005. },
  1006. goSearch() {
  1007. uni.navigateTo({
  1008. url: '/pages/center/consumer/consumerSearch'
  1009. });
  1010. },
  1011. gotoFollowUp(item) {
  1012. uni.navigateTo({
  1013. url: `/pages/center/consumer/newFollowup/newFollowup?id=${item.id}&level=${item.level}&clientStageName=${item.clientStageName}`
  1014. })
  1015. },
  1016. },
  1017. filters: {
  1018. // 筛选等级展示文字
  1019. levelText(level) {
  1020. let str = '';
  1021. switch (Number(level)) {
  1022. case 1:
  1023. str = "A"
  1024. break;
  1025. case 2:
  1026. str = "B"
  1027. break;
  1028. case 3:
  1029. str = "C"
  1030. break;
  1031. case 4:
  1032. str = "D"
  1033. break;
  1034. default:
  1035. str = ''
  1036. break;
  1037. }
  1038. return str
  1039. },
  1040. // 加密手机
  1041. phoneText(mobile) {
  1042. if (!mobile) return '--'
  1043. if (_this.userInfo.showPhoneStatus == 1) return mobile.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2')
  1044. else return mobile
  1045. },
  1046. // 格式化时间
  1047. formatTime(time) {
  1048. if (!time) return
  1049. return time.substring(5, time.length)
  1050. }
  1051. }
  1052. }
  1053. </script>
  1054. <style lang="scss" scoped>
  1055. .box {
  1056. width: 100vw;
  1057. min-height: calc(100vh - var(--window-top));
  1058. background: #F8F8F8;
  1059. display: flex;
  1060. flex-direction: column;
  1061. .top-search {
  1062. display: flex;
  1063. align-items: center;
  1064. justify-content: space-between;
  1065. background: #fff;
  1066. padding-right: 30rpx;
  1067. .filter-icon {
  1068. width: 40rpx;
  1069. height: 40rpx;
  1070. padding: 15rpx;
  1071. }
  1072. .search-box {
  1073. width: 670rpx;
  1074. height: 102rpx;
  1075. background: #ffffff;
  1076. display: flex;
  1077. align-items: center;
  1078. justify-content: center;
  1079. .search {
  1080. width: 94%;
  1081. height: 70rpx;
  1082. display: flex;
  1083. align-items: center;
  1084. background: #f8f8f8;
  1085. border-radius: 33rpx;
  1086. .search-img {
  1087. width: 26rpx;
  1088. height: 30rpx;
  1089. margin-left: 20rpx;
  1090. .search-img1 {
  1091. width: 100%;
  1092. height: 100%;
  1093. margin-top: 2rpx;
  1094. }
  1095. }
  1096. .search-text {
  1097. font-size: 28rpx;
  1098. font-weight: 400;
  1099. color: #999999;
  1100. margin-left: 10rpx;
  1101. }
  1102. }
  1103. .search-screen {
  1104. width: 40rpx;
  1105. height: 40rpx;
  1106. margin-left: 30rpx;
  1107. .search-screen1 {
  1108. width: 100%;
  1109. height: 100%;
  1110. }
  1111. }
  1112. }
  1113. }
  1114. .content {
  1115. flex-grow: 1;
  1116. }
  1117. }
  1118. .timeview {
  1119. height: 90rpx;
  1120. line-height: 90rpx;
  1121. width: 100%;
  1122. text-align: center;
  1123. border-bottom: 1rpx solid #F8F8F8;
  1124. }
  1125. //时间切换的样式
  1126. .boxtittab {
  1127. position: sticky;
  1128. top: var(--window-top);
  1129. z-index: 999;
  1130. width: 100;
  1131. height: 72rpx;
  1132. background: #FFFFFF;
  1133. flex-shrink: 0;
  1134. display: flex;
  1135. align-items: center;
  1136. .tabbox {
  1137. flex: 1;
  1138. height: 100%;
  1139. text-align: center;
  1140. line-height: 72rpx;
  1141. color: #666666;
  1142. font-size: 28rpx;
  1143. overflow: hidden;
  1144. text-overflow: ellipsis;
  1145. display: -webkit-box;
  1146. /* 将对象作为弹性伸缩盒子模型显示 */
  1147. -webkit-line-clamp: 1;
  1148. /* 控制最多显示几行 */
  1149. -webkit-box-orient: vertical;
  1150. /* 设置或检索伸缩盒对象的子元素的排列方式 */
  1151. }
  1152. .activeColor {
  1153. color: #2671E2;
  1154. font-weight: bold;
  1155. }
  1156. }
  1157. .soltishow {
  1158. width: 100%;
  1159. min-height: 40vh;
  1160. .soltishow-item {
  1161. width: 100%;
  1162. height: 80rpx;
  1163. display: flex;
  1164. align-items: center;
  1165. justify-content: center;
  1166. }
  1167. }
  1168. .count {
  1169. width: 100%;
  1170. height: 82rpx;
  1171. line-height: 82rpx;
  1172. display: flex;
  1173. align-items: center;
  1174. justify-content: center;
  1175. background-color: #f8f8f8;
  1176. font-size: 30rpx;
  1177. font-family: PingFangSC-Regular, PingFang SC;
  1178. font-weight: 400;
  1179. color: #333333;
  1180. text {
  1181. color: #E7483C;
  1182. }
  1183. }
  1184. .content {
  1185. .content-tips {
  1186. background: #fff;
  1187. margin-bottom: 20rpx;
  1188. .content-first {
  1189. padding: 19rpx 30rpx;
  1190. display: flex;
  1191. justify-content: space-between;
  1192. align-items: center;
  1193. box-sizing: border-box;
  1194. color: #292929;
  1195. height: 90rpx;
  1196. font-size: 30rpx;
  1197. .left {
  1198. display: flex;
  1199. align-items: center;
  1200. .img {
  1201. width: 48rpx;
  1202. height: 48rpx;
  1203. line-height: 48rpx;
  1204. text-align: center;
  1205. margin-right: 16rpx;
  1206. background: #E6625B;
  1207. border-radius: 6rpx;
  1208. font-size: 28rpx;
  1209. font-family: PingFangSC-Regular, PingFang SC;
  1210. font-weight: 400;
  1211. color: #FFFFFF;
  1212. }
  1213. .clientStageName {
  1214. margin-right: 20rpx;
  1215. padding: 0 16rpx;
  1216. font-size: 28rpx;
  1217. font-family: PingFangSC-Regular, PingFang SC;
  1218. font-weight: 400;
  1219. color: #FF981E;
  1220. height: 48rpx;
  1221. line-height: 48rpx;
  1222. background: #FFFFFF;
  1223. border-radius: 4rpx;
  1224. border: 1rpx solid #FF981E;
  1225. box-sizing: border-box;
  1226. }
  1227. .A {
  1228. background: #E6625B;
  1229. }
  1230. .B {
  1231. background: #FF981E;
  1232. }
  1233. .C {
  1234. background: #F6BD16;
  1235. }
  1236. .D {
  1237. background: #E6625B;
  1238. }
  1239. .test {
  1240. height: 42rpx;
  1241. font-size: 30rpx;
  1242. font-family: PingFangSC-Medium, PingFang SC;
  1243. font-weight: 500;
  1244. color: #333333;
  1245. line-height: 42rpx;
  1246. margin-right: 16rpx;
  1247. }
  1248. }
  1249. .right {
  1250. display: flex;
  1251. align-items: center;
  1252. color: #2671E2;
  1253. font-size: 30rpx;
  1254. .right-img {
  1255. margin: 5rpx 0 0 10rpx;
  1256. width: 14rpx;
  1257. height: 30rpx;
  1258. }
  1259. }
  1260. }
  1261. .content-sec {
  1262. border-top: 1rpx solid #E0E0E0;
  1263. padding: 0 28rpx 28rpx;
  1264. position: relative;
  1265. .content-sec-lab {
  1266. margin-top: 28rpx;
  1267. display: flex;
  1268. font-size: 30rpx;
  1269. font-weight: 400;
  1270. color: #333;
  1271. line-height: 42rpx;
  1272. .content-sec-lab1 {
  1273. color: #333333;
  1274. }
  1275. .content-sec-tips {
  1276. padding: 0 20rpx;
  1277. height: 48rpx;
  1278. background: #F4F8FD;
  1279. border-radius: 6rpx;
  1280. max-width: 160rpx;
  1281. text-align: center;
  1282. line-height: 48rpx;
  1283. overflow: hidden;
  1284. text-overflow: ellipsis;
  1285. white-space: nowrap;
  1286. font-weight: 400;
  1287. margin-right: 12rpx;
  1288. box-sizing: border-box;
  1289. font-size: 28rpx;
  1290. font-family: PingFangSC-Regular, PingFang SC;
  1291. color: #2671E2;
  1292. }
  1293. }
  1294. .content-sec-num {
  1295. position: absolute;
  1296. width: 196rpx;
  1297. height: 112rpx;
  1298. border-radius: 8rpx;
  1299. top: 28rpx;
  1300. right: 30rpx;
  1301. padding: 16rpx 20rpx;
  1302. background: #F4F8FD;
  1303. color: #2671E2;
  1304. line-height: 40rpx;
  1305. text-align: center;
  1306. }
  1307. }
  1308. .content-last {
  1309. display: flex;
  1310. justify-content: flex-end;
  1311. align-items: center;
  1312. padding-bottom: 30rpx;
  1313. .content-last-tab {
  1314. width: 214rpx;
  1315. height: 70rpx;
  1316. line-height: 70rpx;
  1317. background: #FFFFFF;
  1318. border-radius: 8rpx;
  1319. border: 1rpx solid #2671E2;
  1320. box-sizing: border-box;
  1321. font-family: PingFangSC-Regular, PingFang SC;
  1322. font-weight: 400;
  1323. color: #2671E2;
  1324. font-size: 30rpx;
  1325. margin-right: 30rpx;
  1326. display: flex;
  1327. align-items: center;
  1328. justify-content: center;
  1329. image {
  1330. width: 40rpx;
  1331. height: 40rpx;
  1332. margin-right: 12rpx;
  1333. }
  1334. }
  1335. }
  1336. }
  1337. }
  1338. // 这是弹出层
  1339. .screen {
  1340. .screen-record {
  1341. overflow: hidden;
  1342. padding: 0 30rpx;
  1343. box-sizing: border-box;
  1344. border-bottom: 1px solid #e0e0e0;
  1345. .screen-record-text {
  1346. font-weight: 600;
  1347. padding: 30rpx 0;
  1348. font-size: 30rpx;
  1349. color: #333333;
  1350. line-height: 30rpx;
  1351. display: flex;
  1352. align-items: center;
  1353. justify-content: space-between;
  1354. .arrow {
  1355. width: 30rpx;
  1356. height: 14rpx;
  1357. }
  1358. }
  1359. .screen-record-tab {
  1360. margin-top: 30rpx;
  1361. padding-bottom: 10rpx;
  1362. display: flex;
  1363. flex-wrap: wrap;
  1364. .screen-record-item {
  1365. min-width: 150rpx;
  1366. padding: 0 14rpx;
  1367. height: 60rpx;
  1368. border-radius: 8rpx;
  1369. text-align: center;
  1370. line-height: 60rpx;
  1371. margin: 0 22rpx 22rpx 0;
  1372. &:nth-child(4n) {
  1373. margin-right: 0;
  1374. }
  1375. }
  1376. .screen-record-chose {
  1377. background: #f1f6fd;
  1378. color: #2671e2;
  1379. }
  1380. .screen-record-nochose {
  1381. background: #f7f8fa;
  1382. color: #333;
  1383. }
  1384. }
  1385. }
  1386. .screen-foot {
  1387. width: 100%;
  1388. height: 78rpx;
  1389. display: flex;
  1390. margin: 30rpx 30rpx 0;
  1391. .screen-foot-reset {
  1392. width: 176rpx;
  1393. height: 78rpx;
  1394. line-height: 78rpx;
  1395. background: #FFFFFF;
  1396. border-radius: 8rpx;
  1397. border: 1px solid #2671E2;
  1398. margin-right: 30rpx;
  1399. font-size: 30rpx;
  1400. font-family: PingFangSC-Regular, PingFang SC;
  1401. font-weight: 400;
  1402. color: #2671E2;
  1403. text-align: center;
  1404. }
  1405. .screen-foot-sure {
  1406. width: 484rpx;
  1407. height: 78rpx;
  1408. line-height: 78rpx;
  1409. background: #2671E2;
  1410. border: 1px solid #2671E2;
  1411. border-radius: 8rpx;
  1412. font-size: 30rpx;
  1413. font-family: PingFangSC-Regular, PingFang SC;
  1414. font-weight: 400;
  1415. color: #FFFFFF;
  1416. text-align: center;
  1417. }
  1418. }
  1419. }
  1420. </style>