relation-consult-list.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729
  1. <template>
  2. <view class="container product clearfix">
  3. <view class="container-fiexd-top">
  4. <view class="club-search clearfix">
  5. <view class="search-from name">
  6. <text class="iconfont icon-iconfonticonfontsousuo1"></text>
  7. <input
  8. class="input"
  9. type="text"
  10. confirm-type="search"
  11. v-model="listQuery.keyWord"
  12. @input="onShowClose"
  13. @confirm="userClubReportAssociatedList"
  14. placeholder="搜索关键词 / 咨询人 / 机构名称"
  15. maxlength="16"
  16. />
  17. <text class="iconfont icon-shanchu1" v-if="isShowClose" @click="delInputText()"></text>
  18. </view>
  19. <view class="search-screen" @click="showScreenDrawer">
  20. <text class="iconfont icon-gengduo1"></text> 筛选
  21. </view>
  22. </view>
  23. </view>
  24. <view class="remarks-content" :style="{ paddingBottom: isIphoneX ? '216rpx' : '168rpx' }">
  25. <view :class="{ 'tui-order-list': scrollTop >= 0 }" class="clearfix">
  26. <!-- 空白页 -->
  27. <view class="empty-container" v-if="isEmpty">
  28. <image class="empty-container-image" :src="StaticUrl + '/icon/icon-remarks-empty@2x.png'"></image>
  29. <text class="error-text">暂无任何数据~</text>
  30. </view>
  31. <!-- 列表 -->
  32. <view
  33. class="tui-remarks-cell tui-mtop clearfix"
  34. v-for="(remark, index) in remarksList"
  35. :key="index"
  36. :class="{ orange: remark.followup == 1, blue: remark.followup == 2, grey: remark.followup == 3 }"
  37. @click.stop="details(remark.remarksId)"
  38. >
  39. <view class="tui-remarks-title">
  40. <view class="tui-remarks-title-top">
  41. <view class="tui-remarks-time tt">{{ remark.clubName }}</view>
  42. <view class="tui-remarks-time sm" v-if="remark.followup">
  43. <text
  44. :class="{
  45. orange: remark.followup == 1,
  46. blue: remark.followup == 2,
  47. grey: remark.followup == 3
  48. }"
  49. >{{ remark.followup | followupFilters }}</text
  50. >
  51. </view>
  52. </view>
  53. <view class="tui-remarks-title-bot">
  54. <view class="tui-remarks-text-view">
  55. <view class="tui-remarks-text h"
  56. ><text class="iconfont icon-bianji"></text>记录人:{{ remark.recordName }}</view
  57. >
  58. </view>
  59. <view class="tui-remarks-text-view" v-if="listQuery.manager >= 0">
  60. <view class="tui-remarks-text h"
  61. ><text class="iconfont icon-guanliyuan"></text>管理员:{{
  62. remark.leaderName ? remark.leaderName : ''
  63. }}</view
  64. >
  65. <view class="tui-remarks-text y">{{ remark.addTime }}</view>
  66. </view>
  67. </view>
  68. </view>
  69. <view class="tui-remarks-name">
  70. <view class="tui-remarks-name-text h">
  71. 咨询人:{{ remark.clubName ? remark.clubName : '' }}
  72. </view>
  73. <view class="tui-remarks-name-text y">
  74. 咨询类别:{{ remark.consultBack ? remark.consultBack : '无' }}
  75. </view>
  76. </view>
  77. <view class="tui-remarks-name none" v-if="remark.satisfied">
  78. <view class="tui-remarks-name-text h">
  79. 意向程度:<text class="red">{{ remark.satisfied | intenActionsFilters }}</text>
  80. </view>
  81. <view class="tui-remarks-name-text y">
  82. 报备状态:<text
  83. :class="{
  84. reviewed: remark.status == 1,
  85. approved: remark.status == 2,
  86. failed: remark.status == 3
  87. }"
  88. >{{ remark.status | statusFilters }}</text
  89. >
  90. </view>
  91. </view>
  92. <view class="tui-remarks-content">
  93. <text class="tui-remarks-span" v-for="(label, labelIndex) in remark.remarks" :key="labelIndex">
  94. {{ label.label }}
  95. </text>
  96. </view>
  97. <view class="tui-remarks-button" v-if="remark.serviceProviderId === listQuery.serviceProviderId">
  98. <view class="btn edit" @click.stop="cancelReport(remark.remarksId)">取消关联</view>
  99. </view>
  100. </view>
  101. <!--加载loadding-->
  102. <tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
  103. <tui-nomore :visible="!pullUpOn" :backgroundColor="'#F7F7F7'" :text="nomoreText"></tui-nomore>
  104. <!--加载loadding-->
  105. </view>
  106. </view>
  107. <!-- 筛选抽屉 -->
  108. <cm-screenDrawer
  109. ref="screendrawer"
  110. :popupType="1"
  111. :rightDrawer="isScreenDrawer"
  112. @handSearchConfirm="handSearchConfirmData"
  113. >
  114. </cm-screenDrawer>
  115. <!-- 弹窗提示 -->
  116. <tui-modal
  117. :show="modal"
  118. @click="handleClick"
  119. @cancel="hideMobel"
  120. :content="contentModalText"
  121. :button="modalButton"
  122. color="#333"
  123. :size="32"
  124. shape="circle"
  125. :maskClosable="false"
  126. >
  127. </tui-modal>
  128. </view>
  129. </template>
  130. <script>
  131. import cmClubpopup from '@/components/cm-module/cm-seller/cm-clubpopup'
  132. import cmScreenDrawer from '@/components/cm-module/cm-seller/cm-screen-drawer'
  133. import { mapState, mapMutations } from 'vuex'
  134. const defaultListQuery = {
  135. reportId: 0,
  136. pageNum: 1,
  137. pageSize: 10
  138. }
  139. export default {
  140. components: {
  141. cmClubpopup,
  142. cmScreenDrawer
  143. },
  144. data() {
  145. return {
  146. StaticUrl: this.$Static,
  147. isIphoneX: this.$store.state.isIphoneX,
  148. modalButton: [
  149. {
  150. text: '取消',
  151. type: 'gray',
  152. plain: true //是否空心
  153. },
  154. {
  155. text: '确认',
  156. customStyle: {
  157. color: '#fff',
  158. bgColor: 'linear-gradient(90deg, #F28F31 0%, #E15616 100%)'
  159. },
  160. plain: false
  161. }
  162. ],
  163. totalRecord: 0,
  164. listQuery: Object.assign({}, defaultListQuery),
  165. remarksList: [],
  166. scrollTop: 0,
  167. isEmpty: false,
  168. loadding: false,
  169. pullUpOn: true,
  170. pullFlag: true,
  171. hasNextPage: false,
  172. navbarHeight: '',
  173. nomoreText: '上拉显示更多',
  174. contentModalText: '', //操作文字提示语句
  175. modal: false,
  176. handleRemarksId: 0,
  177. isScreenDrawer: false
  178. }
  179. },
  180. onLoad(option) {
  181. this.listQuery.reportId = option.reportId
  182. this.initGetStotage()
  183. },
  184. filters: {
  185. statusFilters(value) {
  186. // 订单来源
  187. const map = {
  188. 1: '待审核',
  189. 2: '审核通过',
  190. 3: '审核未通过'
  191. }
  192. return map[value]
  193. },
  194. followupFilters(value) {
  195. // 订单来源
  196. const map = {
  197. 1: '跟进中',
  198. 2: '跟进完成',
  199. 3: '已放弃'
  200. }
  201. return map[value]
  202. },
  203. intenActionsFilters(value) {
  204. // 意向
  205. if (value) {
  206. const map = {
  207. 1: '意向强烈',
  208. 2: '意向一般',
  209. 3: '意向平淡',
  210. 4: '随便看看'
  211. }
  212. return map[value]
  213. } else {
  214. return ''
  215. }
  216. }
  217. },
  218. computed: {
  219. ...mapState(['hasLogin', 'userInfo'])
  220. },
  221. methods: {
  222. ...mapMutations(['login', 'logout']),
  223. async initGetStotage() {
  224. const userInfo = await this.$api.getStorage()
  225. this.listQuery.serviceProviderId = userInfo.serviceProviderId ? userInfo.serviceProviderId : 0
  226. this.listQuery.manager = userInfo.manager ? userInfo.manager : 0
  227. this.userClubReportAssociatedList()
  228. },
  229. userClubReportAssociatedList() {
  230. this.remarksList = []
  231. this.listQuery.pageNum = 1
  232. this.UserService.userClubReportAssociatedList(this.listQuery)
  233. .then(response => {
  234. let data = response.data
  235. if (data.results && data.results.length > 0) {
  236. this.isEmpty = false
  237. this.hasNextPage = data.hasNextPage
  238. this.totalRecord = data.totalRecord
  239. this.remarksList = data.results
  240. this.pullFlag = false
  241. setTimeout(() => {
  242. this.pullFlag = true
  243. }, 500)
  244. if (this.hasNextPage) {
  245. this.pullUpOn = false
  246. this.nomoreText = '上拉显示更多'
  247. } else {
  248. if (this.remarksList.length < 8) {
  249. this.pullUpOn = true
  250. } else {
  251. this.pullUpOn = false
  252. this.loadding = false
  253. this.nomoreText = '已至底部'
  254. }
  255. }
  256. } else {
  257. this.isEmpty = true
  258. }
  259. this.isRequest = true
  260. })
  261. .catch(error => {
  262. this.$util.msg(error.msg, 2000)
  263. })
  264. },
  265. GetOnReachBottomData(index) {
  266. //上拉加载
  267. this.listQuery.pageNum += 1
  268. this.UserService.userClubReportAssociatedList(this.listQuery)
  269. .then(response => {
  270. let data = response.data
  271. if (data.results && data.results.length > 0) {
  272. this.hasNextPage = data.hasNextPage
  273. this.remarksList = this.remarksList.concat(data.results)
  274. this.pullFlag = false // 防上拉暴滑
  275. setTimeout(() => {
  276. this.pullFlag = true
  277. }, 500)
  278. if (this.hasNextPage) {
  279. this.pullUpOn = false
  280. this.nomoreText = '上拉显示更多'
  281. } else {
  282. this.pullUpOn = false
  283. this.loadding = false
  284. this.nomoreText = '已至底部'
  285. }
  286. }
  287. })
  288. .catch(error => {
  289. this.$util.msg(error.msg, 2000)
  290. })
  291. },
  292. cancelReport(remarksId) {
  293. this.handleRemarksId = remarksId
  294. this.modal = true
  295. this.contentModalText = '确定取消该咨询记录和报备的关联吗?'
  296. },
  297. handSearchConfirmData(data) {
  298. console.log('确定筛选', data)
  299. //确定筛选
  300. this.listQuery.startAddTime = data.startAddTime
  301. this.listQuery.endAddTime = data.endAddTime
  302. this.listQuery.consult = data.consult
  303. this.listQuery.leaderId = data.leaderId
  304. this.listQuery.groupId = data.groupId
  305. this.listQuery.pinceSensitve = data.pinceSensitve
  306. this.listQuery.satisfied = data.satisfied
  307. this.listQuery.followup = data.followup
  308. this.listQuery.newDeal = data.newDeal
  309. this.listQuery.status = data.status
  310. this.userClubReportAssociatedList()
  311. },
  312. showScreenDrawer() {
  313. //显示筛选抽屉
  314. this.isScreenDrawer = true
  315. },
  316. handleClick(e) {
  317. //确认删除
  318. if (e.index == 1) {
  319. this.handleCancelReport()
  320. }
  321. this.modal = false
  322. },
  323. handleCancelReport() {
  324. //操作删除资料备注
  325. this.UserService.userClubReportDisassociation({
  326. remarksId: this.handleRemarksId
  327. })
  328. .then(response => {
  329. this.$util.msg('操作成功', 2000, true, 'success')
  330. setTimeout(() => {
  331. this.userClubReportAssociatedList()
  332. }, 2000)
  333. })
  334. .catch(error => {
  335. this.$util.msg(error.msg, 2000)
  336. })
  337. },
  338. onShowClose() {
  339. //输入框失去焦点时触发
  340. if (this.listQuery.keyWord != '') {
  341. this.isShowClose = true
  342. } else {
  343. this.isShowClose = false
  344. this.userClubReportAssociatedList()
  345. }
  346. },
  347. delInputText() {
  348. //清除输入框内容
  349. this.listQuery.keyWord = ''
  350. this.isShowClose = false
  351. this.listQuery.pageNum = 1
  352. this.userClubReportAssociatedList()
  353. },
  354. hideMobel() {
  355. this.modal = false
  356. },
  357. details(remarksId) {
  358. this.$api.navigateTo(`/pages/seller/remarks/details?remarksId=${remarksId}`)
  359. }
  360. },
  361. onPageScroll(e) {
  362. //实时获取到滚动的值
  363. },
  364. onReachBottom() {
  365. if (this.hasNextPage) {
  366. this.loadding = true
  367. this.pullUpOn = true
  368. this.GetOnReachBottomData()
  369. }
  370. },
  371. onPullDownRefresh() {
  372. setTimeout(() => {
  373. this.listQuery.pageNum = 1
  374. uni.stopPullDownRefresh()
  375. }, 200)
  376. },
  377. onShow() {}
  378. }
  379. </script>
  380. <style lang="scss">
  381. @import '@/uni.scss';
  382. page {
  383. background: #f7f7f7;
  384. }
  385. .empty-container {
  386. z-index: 99;
  387. }
  388. .container-fiexd-top {
  389. width: 100%;
  390. height: 112rpx;
  391. background: #f5f5f5;
  392. box-sizing: border-box;
  393. position: fixed;
  394. top: 0;
  395. left: 0;
  396. z-index: 982;
  397. .club-search {
  398. width: 100%;
  399. height: 112rpx;
  400. padding: 24rpx;
  401. background: #ffffff;
  402. box-sizing: border-box;
  403. .search-screen {
  404. width: 152rpx;
  405. height: 64rpx;
  406. float: right;
  407. box-sizing: border-box;
  408. padding: 0 20rpx;
  409. border: 1px solid #999999;
  410. line-height: 64rpx;
  411. border-radius: 32rpx;
  412. color: #333333;
  413. text-align: center;
  414. font-size: 28rpx;
  415. .icon-gengduo1 {
  416. font-size: 30rpx;
  417. margin-right: 10rpx;
  418. }
  419. }
  420. .search-from {
  421. width: 526rpx;
  422. height: 100%;
  423. background: #f7f7f7;
  424. border-radius: 32rpx;
  425. float: left;
  426. position: relative;
  427. .input {
  428. width: 420rpx;
  429. height: 64rpx;
  430. float: left;
  431. line-height: 64rpx;
  432. color: $text-color;
  433. font-size: $font-size-24;
  434. }
  435. .icon-iconfonticonfontsousuo1 {
  436. width: 64rpx;
  437. height: 64rpx;
  438. line-height: 64rpx;
  439. text-align: center;
  440. display: block;
  441. font-size: $font-size-38;
  442. float: left;
  443. color: #999999;
  444. }
  445. .icon-shanchu1 {
  446. font-size: $font-size-32;
  447. color: #999999;
  448. position: absolute;
  449. width: 64rpx;
  450. height: 64rpx;
  451. line-height: 64rpx;
  452. text-align: center;
  453. top: 0;
  454. right: 0;
  455. z-index: 10;
  456. }
  457. }
  458. }
  459. }
  460. .remarks-content {
  461. width: 100%;
  462. height: auto;
  463. position: relative;
  464. padding: 0;
  465. box-sizing: border-box;
  466. padding: 24rpx;
  467. padding-top: 136rpx;
  468. .empty-container-image {
  469. width: 260rpx;
  470. height: 260rpx;
  471. margin-top: -300rpx;
  472. }
  473. .tui-remarks-cell {
  474. width: 100%;
  475. border-radius: 16rpx;
  476. margin-bottom: 24rpx;
  477. background: #ffffff;
  478. box-sizing: border-box;
  479. padding: 0 24rpx 24rpx 24rpx;
  480. &.orange {
  481. background: #ffffff linear-gradient(180deg, #ffede5 0%, rgba(255, 255, 255, 0) 50%);
  482. }
  483. &.blue {
  484. background: #ffffff linear-gradient(180deg, #deefff 0%, rgba(255, 255, 255, 0) 50%);
  485. }
  486. &.grey {
  487. background: #ffffff linear-gradient(180deg, #ececec 0%, rgba(255, 255, 255, 0) 50%);
  488. }
  489. .tui-remarks-title {
  490. width: 100%;
  491. height: auto;
  492. box-sizing: border-box;
  493. padding: 20rpx 0;
  494. border-bottom: 1px solid #e1e1e1;
  495. float: left;
  496. .tui-remarks-title-top {
  497. width: 100%;
  498. height: 56rpx;
  499. line-height: 56rpx;
  500. .tui-remarks-time {
  501. float: left;
  502. &.tt {
  503. width: 60%;
  504. font-size: $font-size-32;
  505. color: #333333;
  506. text-align: left;
  507. text-overflow: ellipsis;
  508. overflow: hidden;
  509. display: -webkit-box;
  510. -webkit-line-clamp: 1;
  511. line-clamp: 1;
  512. -webkit-box-orient: vertical;
  513. font-weight: bold;
  514. .tags {
  515. display: inline-block;
  516. padding: 0 10rpx;
  517. border-radius: 8rpx;
  518. line-height: 36rpx;
  519. font-size: 22rpx;
  520. background-color: #f94b4b;
  521. color: #ffffff;
  522. text-align: center;
  523. float: left;
  524. margin-right: 10rpx;
  525. margin-top: 10rpx;
  526. font-weight: normal;
  527. }
  528. }
  529. &.sm {
  530. width: 40%;
  531. font-size: $font-size-26;
  532. color: #999999;
  533. text-align: right;
  534. .orange {
  535. display: inline-block;
  536. padding: 0 15rpx;
  537. border-radius: 24rpx;
  538. line-height: 48rpx;
  539. font-size: 24rpx;
  540. background-color: #e15616;
  541. color: #ffffff;
  542. text-align: center;
  543. }
  544. .blue {
  545. display: inline-block;
  546. padding: 0 15rpx;
  547. border-radius: 24rpx;
  548. line-height: 48rpx;
  549. font-size: 24rpx;
  550. background-color: #1890f9;
  551. color: #ffffff;
  552. text-align: center;
  553. }
  554. .grey {
  555. display: inline-block;
  556. padding: 0 15rpx;
  557. border-radius: 24rpx;
  558. line-height: 48rpx;
  559. font-size: 24rpx;
  560. background-color: #e1e1e1;
  561. color: #999999;
  562. text-align: center;
  563. }
  564. }
  565. }
  566. }
  567. .tui-remarks-title-bot {
  568. width: 100%;
  569. height: auto;
  570. .tui-remarks-text-view {
  571. width: 100%;
  572. height: 48rpx;
  573. .tui-remarks-text {
  574. width: 50%;
  575. height: 48rpx;
  576. line-height: 48rpx;
  577. box-sizing: border-box;
  578. text-align: left;
  579. font-size: $font-size-26;
  580. color: #999999;
  581. float: left;
  582. text-overflow: ellipsis;
  583. overflow: hidden;
  584. display: -webkit-box;
  585. -webkit-line-clamp: 1;
  586. line-clamp: 1;
  587. -webkit-box-orient: vertical;
  588. &.a {
  589. width: 100%;
  590. }
  591. &.y {
  592. text-align: right;
  593. }
  594. }
  595. }
  596. }
  597. }
  598. .tui-remarks-name {
  599. width: 100%;
  600. height: 48rpx;
  601. line-height: 48rpx;
  602. font-size: $font-size-26;
  603. color: #666666;
  604. text-align: left;
  605. margin-bottom: 10rpx;
  606. margin-top: 20rpx;
  607. float: left;
  608. &.none {
  609. margin-top: 0;
  610. margin-bottom: 20rpx;
  611. }
  612. .tui-remarks-name-text {
  613. height: 48rpx;
  614. box-sizing: border-box;
  615. text-align: left;
  616. font-size: $font-size-26;
  617. color: #333333;
  618. float: left;
  619. text-overflow: ellipsis;
  620. overflow: hidden;
  621. display: -webkit-box;
  622. -webkit-line-clamp: 1;
  623. line-clamp: 1;
  624. -webkit-box-orient: vertical;
  625. .red {
  626. color: #f94b4b;
  627. }
  628. &.a {
  629. width: 100%;
  630. }
  631. &.h {
  632. width: 40%;
  633. padding-right: 24rpx;
  634. }
  635. &.y {
  636. width: 60%;
  637. padding-left: 24rpx;
  638. .reviewed{
  639. color: #E15616;
  640. }
  641. .approved{
  642. color: #0DB26D;
  643. }
  644. .failed{
  645. color: #F94B4B;
  646. }
  647. }
  648. }
  649. }
  650. .tui-remarks-content {
  651. width: 100%;
  652. height: auto;
  653. .tui-remarks-span {
  654. height: 48rpx;
  655. line-height: 48rpx;
  656. text-align: center;
  657. padding: 0 20rpx;
  658. background-color: #f7f7f7;
  659. font-size: $font-size-26;
  660. color: #666666;
  661. border-radius: 25rpx;
  662. display: inline-block;
  663. margin-right: 24rpx;
  664. margin-bottom: 24rpx;
  665. &:nth-child(4n) {
  666. margin-right: none;
  667. }
  668. }
  669. }
  670. .tui-remarks-button {
  671. width: 100%;
  672. height: 68rpx;
  673. border-top: 1px solid #e1e1e1;
  674. padding-top: 20rpx;
  675. .btn {
  676. width: 100%;
  677. line-height: 48rpx;
  678. box-sizing: border-box;
  679. text-align: center;
  680. font-size: $font-size-34;
  681. float: left;
  682. font-weight: bold;
  683. &.edit {
  684. color: #1890f9;
  685. }
  686. }
  687. }
  688. }
  689. }
  690. .tui-popup-box {
  691. position: relative;
  692. box-sizing: border-box;
  693. min-height: 100rpx;
  694. padding: 6rpx 24rpx;
  695. .tui-popup-content {
  696. padding-top: 30rpx;
  697. }
  698. }
  699. .tui-popup-btn {
  700. width: 100%;
  701. height: auto;
  702. float: left;
  703. box-sizing: border-box;
  704. margin-top: 30rpx;
  705. .tui-button {
  706. width: 600rpx;
  707. height: 88rpx;
  708. background: $btn-confirm;
  709. line-height: 88rpx;
  710. text-align: center;
  711. color: #ffffff;
  712. font-size: $font-size-28;
  713. border-radius: 44rpx;
  714. margin: 0 auto;
  715. }
  716. .tui-button-text {
  717. width: 600rpx;
  718. height: 48rpx;
  719. line-height: 48rpx;
  720. text-align: center;
  721. color: #e15616;
  722. font-size: $font-size-26;
  723. margin: 0 auto;
  724. margin-top: 15rpx;
  725. }
  726. }
  727. </style>