clue.js 5.6 KB

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