index.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  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. export default {
  66. name: 'clew',
  67. data() {
  68. return {
  69. isHandle: '-1',
  70. disabled: false,
  71. loading: false,
  72. list: [],
  73. finished: true,
  74. cid: -1,
  75. customerClueOption: [],
  76. };
  77. },
  78. activated() {
  79. this.getCustomerClue();
  80. this.approveList();
  81. },
  82. watch: {
  83. $route(to, from) {
  84. if (to.path == '/clew' && from.path == '/My/index') {
  85. this.isHandle = '-1';
  86. this.cid = -1;
  87. }
  88. // if (to.path == '/clew' && from.path == '/clewent') {
  89. // this.pageNum = 1;
  90. // this.approveList();
  91. // }
  92. },
  93. },
  94. beforeRouteLeave(to, from, next) {
  95. if (from.path != '/clew') {
  96. this.$router.push('/My/index');
  97. }
  98. next();
  99. },
  100. methods: {
  101. async getCustomerClue() {
  102. let option = await getDictOption({}, 'customer_clue');
  103. let arr = [{ text: '全部', value: -1 }];
  104. option.data.forEach((val) => {
  105. arr.push({
  106. text: val.dictLabel,
  107. value: val.dictValue,
  108. });
  109. });
  110. this.customerClueOption = arr;
  111. console.log(this.customerClueOption);
  112. },
  113. submit() {
  114. var taskIds = [];
  115. var instanceIds = [];
  116. for (var i = 0; i < this.radio.length; i++) {
  117. taskIds.push(this.radio[i].taskId);
  118. instanceIds.push(this.radio[i].instanceId);
  119. }
  120. var dormData = {
  121. taskIds: taskIds.join(','),
  122. instanceIds: instanceIds.join(','),
  123. variables: JSON.stringify({
  124. comment: this.blackReason,
  125. pass: true,
  126. }),
  127. };
  128. this.$dialog
  129. .confirm({
  130. message: '确认提交审批?',
  131. })
  132. .then(() => {
  133. completeAll(dormData).then((res) => {
  134. if (res.code == 200) {
  135. this.radio = [];
  136. this.$toast('提交成功!');
  137. this.submitShow = false;
  138. this.pageNum = 1;
  139. this.approveList();
  140. }
  141. });
  142. });
  143. },
  144. approveFn(row) {
  145. if (row.cid == 9) {
  146. // 渠道客诉
  147. this.$router.push({
  148. path: '/complaintDetail',
  149. query: { id: row.customerClueInfoId },
  150. });
  151. } else if (row.cid == 7) {
  152. // 家装客资跟进
  153. this.$router.push({
  154. path: '/JZfollowUp',
  155. query: { id: row.customerClueInfoId },
  156. });
  157. } else {
  158. // 非家装客资跟进
  159. this.list = [];
  160. this.$router.push({
  161. path: '/clewent',
  162. query: { id: row.customerClueInfoId },
  163. });
  164. }
  165. },
  166. tabChange() {
  167. this.disabled = true;
  168. this.list = [];
  169. this.pageNum = 1;
  170. this.approveList();
  171. },
  172. approveList() {
  173. let loading1 = this.$toast.loading({
  174. duration: 0,
  175. message: '数据加载中...',
  176. forbidClick: true,
  177. });
  178. infolist({ type: this.isHandle, cid: this.cid == -1 ? null : this.cid }).then((res) => {
  179. loading1.clear();
  180. this.disabled = false;
  181. this.loading = false;
  182. this.list = res.data;
  183. });
  184. },
  185. dropdownChange(value) {
  186. this.list = [];
  187. this.pageNum = 1;
  188. this.approveList();
  189. },
  190. onClickLeft() {
  191. this.$router.push('/My/index');
  192. },
  193. },
  194. };
  195. </script>
  196. <style lang="scss">
  197. .newCarList {
  198. margin: 14px;
  199. border-radius: 8px;
  200. overflow: hidden;
  201. }
  202. .newCarList .van-cell {
  203. border-radius: 6px;
  204. overflow: hidden;
  205. }
  206. .newCarList .newlist .title {
  207. /* line-height: 32px; */
  208. }
  209. .newCarList .van-cell__right-icon {
  210. top: 5px;
  211. }
  212. .newCarList .newlist {
  213. box-sizing: border-box;
  214. }
  215. .newCarList .newlist .title {
  216. font-size: 14px;
  217. font-weight: bold;
  218. color: #333;
  219. padding: 5px 0;
  220. /* line-height: 14px; */
  221. }
  222. .newCarList .newlist .info {
  223. font-size: 14px;
  224. color: #999;
  225. line-height: 26px;
  226. }
  227. .newCarList .newlist .title p {
  228. padding: 0;
  229. margin: 0;
  230. }
  231. .newCarList .newlist .title .textLeft {
  232. display: inline-block;
  233. /* padding-bottom: 10px; */
  234. }
  235. .newCarList .newlist .title .textRight {
  236. float: right;
  237. color: #0057ba;
  238. }
  239. .van-tab--active {
  240. color: #0057ba;
  241. }
  242. .clew {
  243. .van-nav-bar {
  244. z-index: 2;
  245. }
  246. .van-nav-bar__right {
  247. height: 40px;
  248. margin-top: 3px;
  249. .van-dropdown-menu {
  250. height: 100%;
  251. /* border: 1px solid #f4f0f0; */
  252. .van-dropdown-menu__bar {
  253. box-shadow: none !important;
  254. }
  255. }
  256. }
  257. .van-dropdown-menu__bar {
  258. padding: 0 4px;
  259. height: 100%;
  260. }
  261. .van-dropdown-menu__title::after {
  262. right: 0 !important;
  263. border-color: transparent transparent #000000 #000000 !important;
  264. }
  265. }
  266. </style>