clue.js 5.8 KB

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