Browse Source

行业挂钩公司客户跟进等下拉项改动

lmx 1 day ago
parent
commit
26553cf7c5

+ 8 - 0
src/api/crm/customer.js

@@ -206,3 +206,11 @@ export function getMyCustomerPhone(customerId) {
     }
     }
   })
   })
 }
 }
+
+// 获取基于行业配置的动态字典数据
+export function getTradeDicts() {
+  return request({
+    url: '/crm/customer/tradeDicts',
+    method: 'get'
+  })
+}

+ 3 - 3
src/views/crm/components/addVisitStatus.vue

@@ -19,7 +19,7 @@
 </template>
 </template>
   
   
 <script>
 <script>
-    import { updateCustomer  } from "@/api/crm/customer";
+    import { updateCustomer, getTradeDicts  } from "@/api/crm/customer";
     export default {
     export default {
         name: "visit",
         name: "visit",
         data() {
         data() {
@@ -40,8 +40,8 @@
             };
             };
         },
         },
         created() {
         created() {
-            this.getDicts("crm_customer_user_status").then((response) => {
-                this.statusOptions = response.data;
+            getTradeDicts().then((response) => {
+                this.statusOptions = response.data["crm_customer_user_status"] || [];
             });
             });
         },
         },
         methods: {
         methods: {

+ 10 - 20
src/views/crm/customer/my.vue

@@ -311,7 +311,7 @@
 </template>
 </template>
 
 
 <script>
 <script>
-import { getMyCustomerList,recover,exportCustomer,getMyCustomerPhone } from "@/api/crm/customer";
+import { getMyCustomerList,recover,exportCustomer,getMyCustomerPhone,getTradeDicts } from "@/api/crm/customer";
 import customerDetails from '../components/customerDetails.vue';
 import customerDetails from '../components/customerDetails.vue';
 import addVisit from '../components/addVisit.vue';
 import addVisit from '../components/addVisit.vue';
 import {getCitys} from "@/api/store/city";
 import {getCitys} from "@/api/store/city";
@@ -431,6 +431,7 @@ export default {
         lng: null,
         lng: null,
         lat: null,
         lat: null,
         status: null,
         status: null,
+        visitStatus: null,
         deptId: null,
         deptId: null,
         isDel: null,
         isDel: null,
         customerType: null,
         customerType: null,
@@ -478,27 +479,16 @@ export default {
     };
     };
   },
   },
   created() {
   created() {
-    this.getDicts("crm_customer_source").then((response) => {
-      this.sourceOptions = response.data;
+    getTradeDicts().then((response) => {
+      const data = response.data;
+      this.sourceOptions = data["crm_customer_source"] || [];
+      this.statusOptions = data["crm_customer_user_status"] || [];
+      this.typeOptions = data["crm_customer_type"] || [];
+      this.tagsOptions = data["crm_customer_tag"] || [];
     });
     });
     this.getDicts("sys_sex").then((response) => {
     this.getDicts("sys_sex").then((response) => {
       this.sexOptions = response.data;
       this.sexOptions = response.data;
     });
     });
-    this.getDicts("crm_customer_source").then((response) => {
-      this.sourceOptions = response.data;
-    });
-    this.getDicts("sys_sex").then((response) => {
-      this.sexOptions = response.data;
-    });
-    this.getDicts("crm_customer_user_status").then((response) => {
-      this.statusOptions = response.data;
-    });
-    this.getDicts("crm_customer_type").then((response) => {
-      this.typeOptions = response.data;
-    });
-    this.getDicts("crm_customer_tag").then((response) => {
-        this.tagsOptions = response.data;
-    });
     this.getCitys();
     this.getCitys();
     this.getList();
     this.getList();
   },
   },
@@ -655,10 +645,10 @@ export default {
         this.queryParams.createTimeRange=null;
         this.queryParams.createTimeRange=null;
       }
       }
       if(this.statusArr.length>0){
       if(this.statusArr.length>0){
-        this.queryParams.status=this.statusArr.toString();
+        this.queryParams.visitStatus=this.statusArr.toString();
       }
       }
       else{
       else{
-        this.queryParams.status=null
+        this.queryParams.visitStatus=null
       }
       }
 
 
       if(this.ctsTypeArr.length>0){
       if(this.ctsTypeArr.length>0){