Ver código fonte

提货人档案bug修改

chen 3 anos atrás
pai
commit
cf64637573

+ 2 - 1
src/store/getters.js

@@ -8,6 +8,7 @@ const getters = {
   phone: state => state.user.phone,
   name: state => state.user.name,
   menus: state => state.user.menus,
-  customerId: state => state.user.customerId
+  customerId: state => state.user.customerId,
+  customerName: state => state.user.customerName
 }
 export default getters

+ 7 - 2
src/store/modules/user.js

@@ -9,7 +9,8 @@ const getDefaultState = () => {
     name: '', // 用户名称
     phone: '', // 用户手机
     menus: "", // 菜单
-    customerId:''//经销商ID
+    customerId:'',//经销商ID
+    customerName:''//经销商名称
   }
 }
 
@@ -36,6 +37,9 @@ const mutations = {
   },
   SET_CUSTOMERID: (state, customerId) => {
     state.customerId = customerId
+  },
+  SET_CUSTOMERNAME: (state, customerName) => {
+    state.customerName = customerName
   }
 }
 
@@ -69,7 +73,7 @@ const actions = {
           return reject('Verification failed, please Login again.')
         }
         console.log(data);
-        const { nickName, userName ,customerId} = data
+        const { nickName, userName ,customerId,customerName} = data
         
         // 模拟请求数据
         // const menus = [
@@ -97,6 +101,7 @@ const actions = {
         // ]
         // menus.push({ path: '*', redirect: '/404', hidden: true })
         commit('SET_CUSTOMERID',customerId)
+        commit('SET_CUSTOMERNAME',customerName)
         commit('SET_NAME', nickName)
         commit('SET_PHONE', userName)
         // commit("SET_MENUS", menus) // 触发vuex SET_MENUS 保存路由表到vuex

+ 13 - 10
src/views/basic_data/taker/taker_list.vue

@@ -286,6 +286,7 @@
 </template>
 
 <script>
+import { mapGetters } from "vuex";
 import {
   getList,
   addDataList,
@@ -300,6 +301,9 @@ export default {
   components: {
     fileUpload,
   },
+  computed: {
+    ...mapGetters(["customerId", "customerName"]),
+  },
   data() {
     return {
       baseURL: process.env.VUE_APP_BASE_API,
@@ -386,6 +390,7 @@ export default {
   },
   async created() {
     await this.getDataList({ pageNum: 1, pageSize: 10 });
+
     // await this.getDealerDataList({ pageNum: 1, pageSize: 10 });
   },
   methods: {
@@ -394,7 +399,7 @@ export default {
       this.showOK = true;
       this.id = data.id;
       this.addForm = {
-        customerId: data.customerId,
+        customerName: data.customerName,
         takerName: data.takerName,
         identity: data.identity,
         phone: data.phone,
@@ -424,7 +429,6 @@ export default {
     cancelFn() {
       if (this.addForm.id) {
         this.addForm = {
-          customerId: "",
           takerName: "",
           identity: "",
           phone: "",
@@ -513,24 +517,23 @@ export default {
 
       await this.$refs.addForm.validate();
 
-      const res = this.dealerList.filter(
-        (v) => v.id === this.addForm.customerId
-      )[0];
-      console.log(res);
+      // const res = this.dealerList.filter(
+      //   (v) => v.id === this.addForm.customerId
+      // )[0];
+      // console.log(res);
 
       if (this.fileList.length == 1) {
         await addDataList({
           ...this.addForm,
-          orgNumber: res.useOrgNumber,
 
+          customerId: this.customerId,
           fileName: this.fileList[0].name,
           fileUrl: this.fileList[0].url,
         });
       } else {
         await addDataList({
           ...this.addForm,
-          // orgNumber: res.useOrgNumber,
-
+          customerId: this.customerId,
           fileName: "",
           fileUrl: "",
         });
@@ -557,7 +560,7 @@ export default {
     },
     addFn() {
       this.addForm = {
-        customerId: "",
+        customerName: this.customerName,
         takerName: "",
         identity: "",
         phone: "",