JZfollowUp.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. <template>
  2. <div class="bgcolor assignPage">
  3. <div class="navBarTOP">
  4. <van-nav-bar class="navBar" left-arrow :title="title" @click-left="onClickLeft" />
  5. </div>
  6. <div class="lineGrey"></div>
  7. <div class="lineGrey"></div>
  8. <div class="lineGrey"></div>
  9. <div class="lineGrey"></div>
  10. <div class="lineGrey"></div>
  11. <!-- 客资详情 -->
  12. <assignAwaitDetail :infoData="infoData">
  13. <div class="info">
  14. 跟进状态:
  15. <span v-if="infoData.isClose == 1">跟进完成</span>
  16. <span v-if="infoData.isClose == 0">跟进中</span>
  17. <span v-if="infoData.isClose == -1">未跟进</span>
  18. </div>
  19. <!-- 转交 -->
  20. <!-- v-if="infoData.customerClueStatus == 0 && postName && postName == '区域家装销售负责人'" -->
  21. <van-button type="info" size="small" plain class="centerBtn" @click="showPicker = true">
  22. 转交下属
  23. </van-button>
  24. </assignAwaitDetail>
  25. <!-- 历史跟进记录 -->
  26. <p style="margin: 0 16px 8px; color: #888" v-if="infoData.userCustomerClueList">
  27. 该客资历史跟进记录
  28. </p>
  29. <van-cell-group inset class="cardclewContentCell">
  30. <div style="border-radius: 6px; overflow: hidden">
  31. <van-cell
  32. is-link
  33. v-for="(item, index) in infoData.userCustomerClueList"
  34. :key="index"
  35. @click="viewFn(item.userCustomerClueId)">
  36. <template #title>
  37. <span class="custom-title">{{ item.nickName }}</span>
  38. </template>
  39. <div class="cardContent">
  40. <p class="textLeft" style="padding-bottom: 0px; margin: 0">{{ item.createTime }}</p>
  41. </div>
  42. </van-cell>
  43. </div>
  44. </van-cell-group>
  45. <!-- 跟进任务填写 -->
  46. <div class="assign">
  47. <div class="followUp required">跟进结果</div>
  48. <!-- <div
  49. class="taskGather"
  50. v-if="taskGather && taskGather.customerClueItemList.customerClueOptionList">
  51. <radioGroup
  52. :clueOptionList="taskGather.customerClueItemList.customerClueOptionList"></radioGroup>
  53. </div> -->
  54. <div v-if="infoData.isClose != 1" class="tc" style="padding: 0 16px">
  55. <van-button class="submitBtn" block type="info" color="#0057ba" @click="onSubmit">
  56. 提交
  57. </van-button>
  58. </div>
  59. </div>
  60. <!-- 转交下属 -->
  61. <van-popup v-model="showPicker" position="bottom">
  62. <van-picker
  63. show-toolbar
  64. value-key="nickName"
  65. :columns="assignTypeData"
  66. @confirm="confirm"
  67. @cancel="showPicker = false" />
  68. </van-popup>
  69. <!-- 客资跟进历史 -->
  70. <van-dialog
  71. v-model="showView"
  72. title="客资历史"
  73. show-cancel-button
  74. cancel-button-text="关闭"
  75. :show-confirm-button="false"
  76. class="dialogz">
  77. <followUpHistory :historyId="historyId"></followUpHistory>
  78. </van-dialog>
  79. </div>
  80. </template>
  81. <script>
  82. import { getCustomerClueInfoById } from '@/api/clew';
  83. import { getDictOption } from '@/api/index';
  84. import assignAwaitDetail from './assignAwaitDetail.vue';
  85. import {
  86. selectCustomerClueInfoById,
  87. selectSubUserList,
  88. allocationSubCustomer,
  89. } from '@/api/assignAwait';
  90. import { mapState } from 'vuex';
  91. import radioGroup from './radioGroup';
  92. import followUpHistory from './followUpHistory';
  93. export default {
  94. name: 'assignPage',
  95. components: {
  96. assignAwaitDetail,
  97. radioGroup,
  98. followUpHistory,
  99. },
  100. computed: {
  101. ...mapState({
  102. userInfo: (state) => state.user.userInfo,
  103. }),
  104. },
  105. data() {
  106. return {
  107. id: '',
  108. infoData: {},
  109. collectionItemList: [],
  110. title: '',
  111. postName: '',
  112. showPicker: false,
  113. assignTypeData: [],
  114. taskGather: null, //跟进任务集合
  115. showView: false,
  116. historyId: '',
  117. };
  118. },
  119. watch: {},
  120. activated() {
  121. this.id = this.$route.query.id;
  122. this.postName = localStorage.getItem('postName');
  123. this.getCustomerClueInfoById();
  124. this.getSelectCustomerClueInfoById();
  125. },
  126. methods: {
  127. getCustomerClueInfoById() {
  128. this.id = this.$route.query.id;
  129. this.collectionAnswerlisd = [];
  130. this.collectionItemList = [];
  131. getCustomerClueInfoById({ customerClueInfoId: this.id }).then((response) => {
  132. if (response.code == 200) {
  133. this.infoData = response.data;
  134. this.title = response.data.name;
  135. if (response.data.customerClue != null) {
  136. this.collectionItemList = response.data.customerClue.customerClueItemList;
  137. } else {
  138. this.collectionItemList = [];
  139. }
  140. // 获取转交下属数据
  141. if (
  142. this.infoData.customerClueStatus == 0 &&
  143. this.postName &&
  144. this.postName == '区域家装销售负责人'
  145. )
  146. this.getSelectSubUserList();
  147. } else {
  148. this.$toast(res.msg);
  149. }
  150. });
  151. },
  152. getSelectCustomerClueInfoById() {
  153. selectCustomerClueInfoById({ customerClueInfoId: this.id }).then((res) => {
  154. if (res.code == 200) {
  155. this.taskGather = res.data;
  156. } else {
  157. this.$toast(res.msg);
  158. }
  159. });
  160. },
  161. getSelectSubUserList() {
  162. selectSubUserList().then((res) => {
  163. if (res.code == 200) {
  164. this.assignTypeData = res.data ? res.data : [];
  165. } else {
  166. this.$toast(res.msg);
  167. }
  168. });
  169. },
  170. confirm(value) {
  171. allocationSubCustomer({
  172. userId: value.userId, // string 用户ID
  173. customerClueInfoId: this.id, // string 客资主键ID
  174. }).then((res) => {
  175. if (res.code == 200) {
  176. this.$toast(res.msg);
  177. this.onClickLeft();
  178. } else {
  179. this.$toast(res.msg);
  180. }
  181. });
  182. },
  183. // 查看历史跟进记录
  184. viewFn(val) {
  185. // this.viewTextShow = false;
  186. this.historyId = val;
  187. this.showView = true;
  188. },
  189. onSubmit() {
  190. // allocationCustomer({
  191. // userId: this.assignUserItem.userId || '', // string 用户ID
  192. // customerClueInfoId: this.id, // string 客资主键ID
  193. // customerClassify: this.activaAssignTypeItem.dictValue || '', // string 客资类型,(取值页面字典选择的值 jz_customer_type)
  194. // }).then((res) => {
  195. // if (res.code == 200) {
  196. // this.$toast(res.msg);
  197. // this.onClickLeft();
  198. // } else {
  199. // this.$toast(res.msg);
  200. // }
  201. // });
  202. },
  203. // 校验错误返回信息
  204. onFailed(errorInfo) {
  205. console.log('failed', errorInfo);
  206. },
  207. onClickLeft() {
  208. this.$router.go(-1);
  209. },
  210. },
  211. };
  212. </script>
  213. <style scoped lang="scss">
  214. .assignPage {
  215. }
  216. </style>
  217. <style lang="scss">
  218. .assignPage {
  219. .van-field__label {
  220. width: 100px;
  221. &::before {
  222. content: '*';
  223. color: red;
  224. }
  225. }
  226. .centerBtn {
  227. float: right;
  228. background: #0057ba;
  229. border-color: #0057ba;
  230. color: #fff;
  231. margin-top: -33px;
  232. border-radius: 5px;
  233. }
  234. }
  235. </style>