index.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. <template>
  2. <div class="bgcolor clew">
  3. <div class="navBarTOP">
  4. <van-nav-bar class="navBar" title="客资任务" left-arrow @click-left="onClickLeft">
  5. <template #right>
  6. <van-dropdown-menu>
  7. <van-dropdown-item
  8. v-model="cid"
  9. :options="customerClueOption"
  10. @change="dropdownChange" />
  11. </van-dropdown-menu>
  12. </template>
  13. </van-nav-bar>
  14. <van-tabs v-model="isHandle" color="#0057ba" @change="tabChange">
  15. <van-tab title="未跟进" name="-1" :disabled="disabled"></van-tab>
  16. <van-tab title="跟进中" name="0" :disabled="disabled"></van-tab>
  17. <van-tab title="已结案" name="1" :disabled="disabled"></van-tab>
  18. </van-tabs>
  19. </div>
  20. <div class="container">
  21. <div class="lineGrey"></div>
  22. <div class="lineGrey"></div>
  23. <div class="lineGrey"></div>
  24. <div class="lineGrey"></div>
  25. <div class="lineGrey"></div>
  26. <div class="lineGrey"></div>
  27. <div class="lineGrey"></div>
  28. <div class="lineGrey"></div>
  29. <div class="lineGrey"></div>
  30. <van-list v-model="loading" :finished="finished" finished-text="--已经到底了--">
  31. <div class="newCarList" v-for="(item, index) in list" :key="index">
  32. <van-cell is-link>
  33. <div class="newlist" @click="approveFn(item)">
  34. <div class="title">
  35. <p class="textLeft">{{ item.name }}</p>
  36. <p class="textRight" v-if="isHandle == '-1' || isHandle == '0'">详情</p>
  37. </div>
  38. <div class="info">
  39. 客资线索:
  40. <span v-if="item.cid == 3">申请代理</span>
  41. <span v-if="item.cid == 4">开设门店</span>
  42. <span v-if="item.cid == 5">批量采购</span>
  43. <span v-if="item.cid == 7">家装客资</span>
  44. <span v-if="item.cid == 9">渠道客诉</span>
  45. </div>
  46. <div class="info" v-if="item.cid == 7">
  47. 家装类型:{{ item.jzCustomerDescription }}
  48. </div>
  49. <div class="info">联系电话:{{ item.phone }}</div>
  50. <div class="info" v-if="item.createTime">首次接入时间:{{ item.createTime }}</div>
  51. <div class="info" v-if="item.latestClueTime">
  52. 最后一次跟进时间:{{ item.latestClueTime }}
  53. </div>
  54. </div>
  55. </van-cell>
  56. </div>
  57. <van-empty description="" v-if="list.length == 0" />
  58. </van-list>
  59. </div>
  60. </div>
  61. </template>
  62. <script>
  63. import { infolist } from '@/api/clew';
  64. import { getDictOption } from '@/api';
  65. import { mapState } from 'vuex';
  66. import store from '@/store';
  67. export default {
  68. name: 'clew',
  69. computed: {
  70. ...mapState({
  71. refreshClewPage: (state) => state.isRefreshPage.refreshClewPage,
  72. }),
  73. },
  74. data() {
  75. return {
  76. isHandle: '-1',
  77. disabled: false,
  78. loading: false,
  79. list: [],
  80. finished: true,
  81. cid: -1,
  82. customerClueOption: [],
  83. };
  84. },
  85. created() {
  86. this.getCustomerClue();
  87. this.approveList();
  88. },
  89. activated() {},
  90. watch: {
  91. refreshClewPage: {
  92. handler(val) {
  93. if (val) {
  94. this.approveList();
  95. store.dispatch('setRefreshClewPage', false);
  96. }
  97. },
  98. immediate: true,
  99. },
  100. $route(to, from) {
  101. if (to.path == '/clew' && from.path == '/My/index') {
  102. this.isHandle = '-1';
  103. this.cid = -1;
  104. }
  105. // if (to.path == '/clew' && from.path == '/clewent') {
  106. // this.pageNum = 1;
  107. // this.approveList();
  108. // }
  109. },
  110. },
  111. beforeRouteLeave(to, from, next) {
  112. if (from.path != '/clew') {
  113. this.$router.push('/My/index');
  114. }
  115. next();
  116. },
  117. methods: {
  118. async getCustomerClue() {
  119. let option = await getDictOption({}, 'customer_clue');
  120. let arr = [{ text: '全部', value: -1 }];
  121. option.data.forEach((val) => {
  122. arr.push({
  123. text: val.dictLabel,
  124. value: val.dictValue,
  125. });
  126. });
  127. this.customerClueOption = arr;
  128. console.log(this.customerClueOption);
  129. },
  130. submit() {
  131. var taskIds = [];
  132. var instanceIds = [];
  133. for (var i = 0; i < this.radio.length; i++) {
  134. taskIds.push(this.radio[i].taskId);
  135. instanceIds.push(this.radio[i].instanceId);
  136. }
  137. var dormData = {
  138. taskIds: taskIds.join(','),
  139. instanceIds: instanceIds.join(','),
  140. variables: JSON.stringify({
  141. comment: this.blackReason,
  142. pass: true,
  143. }),
  144. };
  145. this.$dialog
  146. .confirm({
  147. message: '确认提交审批?',
  148. })
  149. .then(() => {
  150. completeAll(dormData).then((res) => {
  151. if (res.code == 200) {
  152. this.radio = [];
  153. this.$toast('提交成功!');
  154. this.submitShow = false;
  155. this.pageNum = 1;
  156. this.approveList();
  157. }
  158. });
  159. });
  160. },
  161. approveFn(row) {
  162. if (row.cid == 9) {
  163. // 渠道客诉
  164. this.$router.push({
  165. path: '/complaintDetail',
  166. query: { id: row.customerClueInfoId },
  167. });
  168. } else if (row.cid == 7) {
  169. // 家装客资跟进
  170. this.$router.push({
  171. path: '/JZfollowUp',
  172. query: { id: row.customerClueInfoId },
  173. });
  174. } else {
  175. // 非家装客资跟进
  176. // this.list = [];
  177. this.$router.push({
  178. path: '/clewent',
  179. query: { id: row.customerClueInfoId },
  180. });
  181. }
  182. },
  183. tabChange() {
  184. this.disabled = true;
  185. this.list = [];
  186. this.pageNum = 1;
  187. this.approveList();
  188. },
  189. approveList() {
  190. infolist({ type: this.isHandle, cid: this.cid == -1 ? null : this.cid }).then((res) => {
  191. this.disabled = false;
  192. this.loading = false;
  193. this.list = res.data;
  194. });
  195. },
  196. dropdownChange(value) {
  197. this.list = [];
  198. this.pageNum = 1;
  199. this.approveList();
  200. },
  201. onClickLeft() {
  202. this.$router.push('/My/index');
  203. },
  204. },
  205. };
  206. </script>
  207. <style lang="scss">
  208. .newCarList {
  209. margin: 14px;
  210. border-radius: 8px;
  211. overflow: hidden;
  212. }
  213. .newCarList .van-cell {
  214. border-radius: 6px;
  215. overflow: hidden;
  216. }
  217. .newCarList .newlist .title {
  218. /* line-height: 32px; */
  219. }
  220. .newCarList .van-cell__right-icon {
  221. top: 5px;
  222. }
  223. .newCarList .newlist {
  224. box-sizing: border-box;
  225. }
  226. .newCarList .newlist .title {
  227. font-size: 14px;
  228. font-weight: bold;
  229. color: #333;
  230. padding: 5px 0;
  231. /* line-height: 14px; */
  232. }
  233. .newCarList .newlist .info {
  234. font-size: 14px;
  235. color: #999;
  236. line-height: 26px;
  237. }
  238. .newCarList .newlist .title p {
  239. padding: 0;
  240. margin: 0;
  241. }
  242. .newCarList .newlist .title .textLeft {
  243. display: inline-block;
  244. /* padding-bottom: 10px; */
  245. }
  246. .newCarList .newlist .title .textRight {
  247. float: right;
  248. color: #0057ba;
  249. }
  250. .van-tab--active {
  251. color: #0057ba;
  252. }
  253. .clew {
  254. .van-nav-bar {
  255. z-index: 2;
  256. }
  257. .van-nav-bar__right {
  258. height: 40px;
  259. margin-top: 3px;
  260. .van-dropdown-menu {
  261. height: 100%;
  262. /* border: 1px solid #f4f0f0; */
  263. .van-dropdown-menu__bar {
  264. box-shadow: none !important;
  265. }
  266. }
  267. }
  268. .van-dropdown-menu__bar {
  269. padding: 0 4px;
  270. height: 100%;
  271. }
  272. .van-dropdown-menu__title::after {
  273. right: 0 !important;
  274. border-color: transparent transparent #000000 #000000 !important;
  275. }
  276. }
  277. </style>