clue.js 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. import pullUpRefresh from "@/utils/pullUpRefresh";
  2. import dayjs from "dayjs";
  3. export default {
  4. mixins: [pullUpRefresh],
  5. computed: {
  6. currentIndex() {
  7. return this.queryParams.type == 1 ? 0 : 1;
  8. }
  9. },
  10. onPullDownRefresh() {
  11. uni.stopPullDownRefresh();
  12. // 刷新
  13. },
  14. data() {
  15. return {
  16. clueStateList: [],
  17. mapHeight: "0px",
  18. key: new Date().getTime(),
  19. clueTagGroupVoList: [],
  20. dicts: {
  21. caseStatusDicts: [],
  22. crmFollowStatus: [],
  23. crmCallStatus: [],
  24. clueEntranceType: []
  25. },
  26. options: [{
  27. value: "3",
  28. label: "电话/微信"
  29. },
  30. {
  31. value: "1",
  32. label: "姓名"
  33. },
  34. {
  35. value: "8",
  36. label: "广告主ID"
  37. },
  38. {
  39. value: "7",
  40. label: "广告主名称"
  41. },
  42. {
  43. value: "10",
  44. label: "广告ID"
  45. },
  46. {
  47. value: "9",
  48. label: "广告名称"
  49. },
  50. {
  51. value: "11",
  52. label: "标题ID"
  53. },
  54. {
  55. value: "12",
  56. label: "视频ID"
  57. },
  58. {
  59. value: "5",
  60. label: "qq号"
  61. },
  62. {
  63. value: "6",
  64. label: "邮箱"
  65. },
  66. {
  67. value: "2",
  68. label: "线索ID"
  69. },
  70. ],
  71. queryParams: {
  72. name: undefined,
  73. telephone: undefined,
  74. weixin: undefined,
  75. createTimeStart: dayjs().format("YYYY-MM-DD"),
  76. createTimeEnd: dayjs().format("YYYY-MM-DD"),
  77. conditionContent: undefined,
  78. condition: "3",
  79. batchCodes: [],
  80. clueIds: [],
  81. deptName: undefined,
  82. deptId: undefined,
  83. type: "1",
  84. pageNum: 1,
  85. pageSize: 20,
  86. allTagList: [],
  87. clueStateList: [],
  88. followStatusList: [],
  89. handleStateList: [],
  90. convertStatusList: [],
  91. followCountStart: undefined,
  92. followCountEnd: undefined,
  93. autoProvince: undefined,
  94. autoCity: undefined,
  95. autoArea: undefined,
  96. manualProvince: undefined,
  97. manualCity: undefined,
  98. manualArea: undefined,
  99. clueEntranceType: [],
  100. clueOperationId: undefined,
  101. clueOwnerId: undefined,
  102. sort: undefined,
  103. clueState: undefined,
  104. sortField: undefined,
  105. appNames: [],
  106. appNameLabel: undefined,
  107. isRepetitionOperWeixinName : '',
  108. isRepetitionOperationName : '',
  109. isVideoIdIsNull : '',
  110. advName: "",
  111. promotionName: "",
  112. advId: "",
  113. promotionId: "",
  114. titleId: "",
  115. videoId: ""
  116. },
  117. }
  118. },
  119. onPullDownRefresh() {
  120. uni.stopPullDownRefresh();
  121. this.resetData();
  122. },
  123. mounted() {
  124. uni.getSystemInfo({
  125. success: (e) => {
  126. const {
  127. windowTop,
  128. windowBottom,
  129. windowHeight
  130. } = e;
  131. this.mapHeight = windowHeight + 'px';
  132. }
  133. });
  134. this.getDicts();
  135. // this.handleLoadData();
  136. this.resetData();
  137. },
  138. // onShow() {
  139. // this.resetData();
  140. // },
  141. methods: {
  142. handleAddClue() {
  143. uni.navigateTo({
  144. url: "/pages/addClue/index"
  145. })
  146. },
  147. handleClueStateClick(item) {
  148. this.queryParams.clueState = item.clueState;
  149. this.resetData();
  150. },
  151. handleKeyword() {
  152. this.resetData();
  153. },
  154. handleKeywordClear() {
  155. // 组件有bug 清空后的值还是存在
  156. this.queryParams.conditionContent = "";
  157. this.resetData();
  158. },
  159. handleShowTag() {
  160. this.$refs.clueTag.showModal();
  161. },
  162. async handleClueTagConfirm() {
  163. this.resetData();
  164. },
  165. async getDicts() {
  166. this.$getDicts('crm_clue_phase').then(res => {
  167. this.dicts.caseStatusDicts = res;
  168. });
  169. this.$getDicts('crm_follow_status').then(res => {
  170. this.dicts.crmFollowStatus = res;
  171. })
  172. this.$getDicts('crm_call_status').then(res => {
  173. this.dicts.crmCallStatus = res;
  174. })
  175. this.$getDicts('clue_entrance_type').then(res => {
  176. this.dicts.clueEntranceType = res;
  177. });
  178. uni.$u.api.getClueTagGroupVoList({ tagGroupApplication : '1' }).then(({
  179. data
  180. }) => {
  181. this.clueTagGroupVoList = data;
  182. });
  183. },
  184. getOtherData() {
  185. this.statisticsCaseState();
  186. },
  187. async statisticsCaseState() {
  188. const {
  189. data
  190. } = await uni.$u.api.statisticsCaseState(this.queryParams);
  191. this.clueStateList = data;
  192. },
  193. handleshowFilter() {
  194. this.$refs.filter.show();
  195. },
  196. handleShowSort() {
  197. this.$refs.sort.show();
  198. },
  199. sectionChange(val) {
  200. this.queryParams.type = val == 0 ? 1 : 2;
  201. this.resetData();
  202. },
  203. handleConfirm() {
  204. this.resetData();
  205. },
  206. handleConditionChange() {
  207. if (this.queryParams.conditionContent) {
  208. this.resetData();
  209. }
  210. },
  211. handleToDetail(item) {
  212. const {
  213. id,
  214. name
  215. } = item;
  216. uni.navigateTo({
  217. url: `/pages/clueDetail/index?clueId=${id}&name=${name}&type=${this.queryParams.type}`,
  218. });
  219. },
  220. async getList() {
  221. const {
  222. pageNum,
  223. pageSize,
  224. ...params
  225. } = this.queryParams;
  226. const {
  227. rows,
  228. total
  229. } = await uni.$u.api.getClueMainInfoList({
  230. pageSize,
  231. pageNum
  232. }, params);
  233. rows.forEach(v=>{
  234. if(v.repetitionOperationName){
  235. // 按逗号分割成数组
  236. const parts = v.repetitionOperationName.split(',');
  237. // 对每个部分提取 '-' 前面的内容
  238. const result = parts.map(part => part.split('-')[0]).join(',');
  239. v.repetitionOperationName = result;
  240. }
  241. if(v.repetitionOperWeixinName){
  242. // 按逗号分割成数组
  243. const parts = v.repetitionOperWeixinName.split(',');
  244. // 对每个部分提取 '-' 前面的内容
  245. const result = parts.map(part => part.split('-')[0]).join(',');
  246. v.repetitionOperWeixinName = result;
  247. }
  248. })
  249. return rows;
  250. }
  251. }
  252. }