YY 2 年之前
父节点
当前提交
7b1fbe5aaa

+ 55 - 46
src/views/platmanag/sales/detail.vue

@@ -228,58 +228,62 @@ export default {
         else if (res.data.status == '-5') this.$set(this, `active`, 4);
         else if (res.data.status == '-5') this.$set(this, `active`, 4);
         // 查询物流
         // 查询物流
         if (res.data.transport) {
         if (res.data.transport) {
-          // 快递数据回显
-          if (res.data.transport.customer_transport_type) {
-            let arr = await this.dictQuery({ code: 'transport_company', value: res.data.transport.customer_transport_type });
-            if (this.$checkRes(arr)) {
-              let type = arr.data.find((i) => i.value == res.data.transport.customer_transport_type);
-              if (type) {
-                res.data.transport.customer_transport_name = type.label;
-                this.querySearch(type.label);
-              }
-              this.$set(this, `transport`, res.data.transport);
-              this.$set(this.customerForm, `customer_transport_type`, this.transport.customer_transport_type);
-              this.$set(this.customerForm, `customer_transport_no`, this.transport.customer_transport_no);
-            }
+          this.toLog(res.data.transport);
+        }
+        this.loading = false;
+      }
+    },
+    async toLog(e) {
+      // 快递数据回显
+      if (e.customer_transport_type) {
+        let arr = await this.dictQuery({ code: 'transport_company', value: e.customer_transport_type });
+        if (this.$checkRes(arr)) {
+          let type = arr.data.find((i) => i.value == e.customer_transport_type);
+          if (type) {
+            e.customer_transport_name = type.label;
+            this.querySearch(type.label);
+          }
+          this.$set(this, `transport`, e);
+          this.$set(this.customerForm, `customer_transport_type`, this.transport.customer_transport_type);
+          this.$set(this.customerForm, `customer_transport_no`, this.transport.customer_transport_no);
+        }
+      }
+      if (e.shop_transport_type) {
+        let aee = await this.dictQuery({ code: 'transport_company', value: e.shop_transport_type });
+        if (this.$checkRes(aee)) {
+          let type = aee.data.find((i) => i.value == e.shop_transport_type);
+          if (type) {
+            e.shop_transport_name = type.label;
+            this.querySearch(type.label);
           }
           }
-          if (res.data.transport.shop_transport_type) {
-            let aee = await this.dictQuery({ code: 'transport_company', value: res.data.transport.shop_transport_type });
-            if (this.$checkRes(aee)) {
-              let type = aee.data.find((i) => i.value == res.data.transport.shop_transport_type);
-              if (type) {
-                res.data.transport.shop_transport_name = type.label;
-                this.querySearch(type.label);
-              }
-              this.$set(this, `transport`, res.data.transport);
-              this.$set(this.form, `shop_transport_type`, this.transport.shop_transport_type);
-              this.$set(this.form, `shop_transport_no`, this.transport.shop_transport_no);
-            }
+          this.$set(this, `transport`, e);
+          this.$set(this.form, `shop_transport_type`, this.transport.shop_transport_type);
+          this.$set(this.form, `shop_transport_no`, this.transport.shop_transport_no);
+        }
+      }
+      // 显示物流
+      let res = await this.getFetch(this.id);
+      if (this.$checkRes(res)) {
+        if (res.errcode == '0') {
+          if (res.data.customer) {
+            let customer = res.data.customer.list;
+            this.$set(this, `customer`, customer);
+            customer[0].color = '#0bbd87';
+            if (res.data.customer.is_check == '已签收' && this.info.status == '3') this.$set(this, `active`, 3);
+            if (res.data.customer.is_check == '已签收' && this.info.status == '2') this.$set(this, `active`, 3);
           }
           }
-          // 显示物流
-          res = await this.getFetch(this.id);
-          if (this.$checkRes(res)) {
-            if (res.errcode == '0') {
-              if (res.data.customer) {
-                let customer = res.data.customer.list;
-                this.$set(this, `customer`, customer);
-                customer[0].color = '#0bbd87';
-                if (res.data.customer.is_check == '已签收' && this.info.status == '3') this.$set(this, `active`, 3);
-                if (res.data.customer.is_check == '已签收' && this.info.status == '2') this.$set(this, `active`, 3);
-              }
-              if (res.data.shop) {
-                if (this.info.status == '3') this.$set(this, `active`, 4);
-                let shopList = res.data.shop.list;
-                this.$set(this, `shopList`, shopList);
-                shopList[0].color = '#0bbd87';
-                if (res.data.shop.is_check == '已签收' && this.info.status == '3') this.$set(this, `active`, 5);
-              }
-              this.$set(this, `activit`, res.data);
-            }
+          if (res.data.shop) {
+            if (this.info.status == '3') this.$set(this, `active`, 4);
+            let shopList = res.data.shop.list;
+            this.$set(this, `shopList`, shopList);
+            shopList[0].color = '#0bbd87';
+            if (res.data.shop.is_check == '已签收' && this.info.status == '3') this.$set(this, `active`, 5);
           }
           }
+          this.$set(this, `activit`, res.data);
         }
         }
-        this.loading = false;
       }
       }
     },
     },
+    // 审核
     async exam(status, form) {
     async exam(status, form) {
       let info = this.info;
       let info = this.info;
       info.status = status;
       info.status = status;
@@ -309,12 +313,14 @@ export default {
         }
         }
       });
       });
     },
     },
+    // 远程查询快递公司
     async querySearch(value) {
     async querySearch(value) {
       let res = await this.dictQuery({ code: 'transport_company', label: value });
       let res = await this.dictQuery({ code: 'transport_company', label: value });
       if (this.$checkRes(res)) {
       if (this.$checkRes(res)) {
         this.$set(this, 'shop_transport_typeList', res.data);
         this.$set(this, 'shop_transport_typeList', res.data);
       }
       }
     },
     },
+    // 买家快递填写保存
     async customerSubmit(val) {
     async customerSubmit(val) {
       let info = this.info;
       let info = this.info;
       let res;
       let res;
@@ -334,6 +340,7 @@ export default {
         this.search();
         this.search();
       }
       }
     },
     },
+    // 保存
     async onSubmit(val) {
     async onSubmit(val) {
       let info = this.info;
       let info = this.info;
       let res;
       let res;
@@ -367,7 +374,9 @@ export default {
       window.history.go('-1');
       window.history.go('-1');
     },
     },
   },
   },
+
   computed: {
   computed: {
+    ...mapState(['user']),
     id() {
     id() {
       return this.$route.query.id;
       return this.$route.query.id;
     },
     },

+ 1 - 1
src/views/platmanag/sales/parts/steps-2.vue

@@ -95,7 +95,7 @@ export default {
       reverse: false,
       reverse: false,
       infoFields: [
       infoFields: [
         { label: '快递单号', model: 'customer_transport_no' },
         { label: '快递单号', model: 'customer_transport_no' },
-        { label: '快递公司', model: 'customer_transport_company', custom: true },
+        { label: '快递公司', model: 'customer_transport_type', custom: true },
       ],
       ],
       rules: {
       rules: {
         customer_transport_no: [{ required: true, message: '请输入快递单号', trigger: 'blur' }],
         customer_transport_no: [{ required: true, message: '请输入快递单号', trigger: 'blur' }],

+ 2 - 2
src/views/platmanag/sales/parts/steps-3.vue

@@ -117,7 +117,7 @@ export default {
       reverse: false,
       reverse: false,
       infoFields: [
       infoFields: [
         { label: '快递单号', model: 'shop_transport_no' },
         { label: '快递单号', model: 'shop_transport_no' },
-        { label: '快递公司', model: 'shop_transport_company', custom: true },
+        { label: '快递公司', model: 'shop_transport_type', custom: true },
       ],
       ],
       rules: {
       rules: {
         shop_transport_no: [{ required: true, message: '请输入快递单号', trigger: 'blur' }],
         shop_transport_no: [{ required: true, message: '请输入快递单号', trigger: 'blur' }],
@@ -125,7 +125,7 @@ export default {
       },
       },
       customerFields: [
       customerFields: [
         { label: '快递单号', model: 'customer_transport_no' },
         { label: '快递单号', model: 'customer_transport_no' },
-        { label: '快递公司', model: 'customer_transport_company', custom: true },
+        { label: '快递公司', model: 'customer_transport_type', custom: true },
       ],
       ],
       customerrules: {
       customerrules: {
         customer_transport_no: [{ required: true, message: '请输入快递单号', trigger: 'blur' }],
         customer_transport_no: [{ required: true, message: '请输入快递单号', trigger: 'blur' }],

+ 49 - 46
src/views/selfShop/sales/detail.vue

@@ -228,56 +228,59 @@ export default {
         else if (res.data.status == '-5') this.$set(this, `active`, 4);
         else if (res.data.status == '-5') this.$set(this, `active`, 4);
         // 查询物流
         // 查询物流
         if (res.data.transport) {
         if (res.data.transport) {
-          // 快递数据回显
-          if (res.data.transport.customer_transport_type) {
-            let arr = await this.dictQuery({ code: 'transport_company', value: res.data.transport.customer_transport_type });
-            if (this.$checkRes(arr)) {
-              let type = arr.data.find((i) => i.value == res.data.transport.customer_transport_type);
-              if (type) {
-                res.data.transport.customer_transport_name = type.label;
-                this.querySearch(type.label);
-              }
-              this.$set(this, `transport`, res.data.transport);
-              this.$set(this.customerForm, `customer_transport_type`, this.transport.customer_transport_type);
-              this.$set(this.customerForm, `customer_transport_no`, this.transport.customer_transport_no);
-            }
+          this.toLog(res.data.transport);
+        }
+        this.loading = false;
+      }
+    },
+    async toLog(e) {
+      // 快递数据回显
+      if (e.customer_transport_type) {
+        let arr = await this.dictQuery({ code: 'transport_company', value: e.customer_transport_type });
+        if (this.$checkRes(arr)) {
+          let type = arr.data.find((i) => i.value == e.customer_transport_type);
+          if (type) {
+            e.customer_transport_name = type.label;
+            this.querySearch(type.label);
           }
           }
-          if (res.data.transport.shop_transport_type) {
-            let aee = await this.dictQuery({ code: 'transport_company', value: res.data.transport.shop_transport_type });
-            if (this.$checkRes(aee)) {
-              let type = aee.data.find((i) => i.value == res.data.transport.shop_transport_type);
-              if (type) {
-                res.data.transport.shop_transport_name = type.label;
-                this.querySearch(type.label);
-              }
-              this.$set(this, `transport`, res.data.transport);
-              this.$set(this.form, `shop_transport_type`, this.transport.shop_transport_type);
-              this.$set(this.form, `shop_transport_no`, this.transport.shop_transport_no);
-            }
+          this.$set(this, `transport`, e);
+          this.$set(this.customerForm, `customer_transport_type`, this.transport.customer_transport_type);
+          this.$set(this.customerForm, `customer_transport_no`, this.transport.customer_transport_no);
+        }
+      }
+      if (e.shop_transport_type) {
+        let aee = await this.dictQuery({ code: 'transport_company', value: e.shop_transport_type });
+        if (this.$checkRes(aee)) {
+          let type = aee.data.find((i) => i.value == e.shop_transport_type);
+          if (type) {
+            e.shop_transport_name = type.label;
+            this.querySearch(type.label);
           }
           }
-          // 显示物流
-          res = await this.getFetch(this.id);
-          if (this.$checkRes(res)) {
-            if (res.errcode == '0') {
-              if (res.data.customer) {
-                let customer = res.data.customer.list;
-                this.$set(this, `customer`, customer);
-                customer[0].color = '#0bbd87';
-                if (res.data.customer.is_check == '已签收' && this.info.status == '3') this.$set(this, `active`, 3);
-                if (res.data.customer.is_check == '已签收' && this.info.status == '2') this.$set(this, `active`, 3);
-              }
-              if (res.data.shop) {
-                if (this.info.status == '3') this.$set(this, `active`, 4);
-                let shopList = res.data.shop.list;
-                this.$set(this, `shopList`, shopList);
-                shopList[0].color = '#0bbd87';
-                if (res.data.shop.is_check == '已签收' && this.info.status == '3') this.$set(this, `active`, 5);
-              }
-              this.$set(this, `activit`, res.data);
-            }
+          this.$set(this, `transport`, e);
+          this.$set(this.form, `shop_transport_type`, this.transport.shop_transport_type);
+          this.$set(this.form, `shop_transport_no`, this.transport.shop_transport_no);
+        }
+      }
+      // 显示物流
+      let res = await this.getFetch(this.id);
+      if (this.$checkRes(res)) {
+        if (res.errcode == '0') {
+          if (res.data.customer) {
+            let customer = res.data.customer.list;
+            this.$set(this, `customer`, customer);
+            customer[0].color = '#0bbd87';
+            if (res.data.customer.is_check == '已签收' && this.info.status == '3') this.$set(this, `active`, 3);
+            if (res.data.customer.is_check == '已签收' && this.info.status == '2') this.$set(this, `active`, 3);
           }
           }
+          if (res.data.shop) {
+            if (this.info.status == '3') this.$set(this, `active`, 4);
+            let shopList = res.data.shop.list;
+            this.$set(this, `shopList`, shopList);
+            shopList[0].color = '#0bbd87';
+            if (res.data.shop.is_check == '已签收' && this.info.status == '3') this.$set(this, `active`, 5);
+          }
+          this.$set(this, `activit`, res.data);
         }
         }
-        this.loading = false;
       }
       }
     },
     },
     // 审核
     // 审核

+ 1 - 1
src/views/selfShop/sales/parts/steps-2.vue

@@ -95,7 +95,7 @@ export default {
       reverse: false,
       reverse: false,
       infoFields: [
       infoFields: [
         { label: '快递单号', model: 'customer_transport_no' },
         { label: '快递单号', model: 'customer_transport_no' },
-        { label: '快递公司', model: 'customer_transport_company', custom: true },
+        { label: '快递公司', model: 'customer_transport_type', custom: true },
       ],
       ],
       rules: {
       rules: {
         customer_transport_no: [{ required: true, message: '请输入快递单号', trigger: 'blur' }],
         customer_transport_no: [{ required: true, message: '请输入快递单号', trigger: 'blur' }],

+ 2 - 2
src/views/selfShop/sales/parts/steps-3.vue

@@ -117,7 +117,7 @@ export default {
       reverse: false,
       reverse: false,
       infoFields: [
       infoFields: [
         { label: '快递单号', model: 'shop_transport_no' },
         { label: '快递单号', model: 'shop_transport_no' },
-        { label: '快递公司', model: 'shop_transport_company', custom: true },
+        { label: '快递公司', model: 'shop_transport_type', custom: true },
       ],
       ],
       rules: {
       rules: {
         shop_transport_no: [{ required: true, message: '请输入快递单号', trigger: 'blur' }],
         shop_transport_no: [{ required: true, message: '请输入快递单号', trigger: 'blur' }],
@@ -125,7 +125,7 @@ export default {
       },
       },
       customerFields: [
       customerFields: [
         { label: '快递单号', model: 'customer_transport_no' },
         { label: '快递单号', model: 'customer_transport_no' },
-        { label: '快递公司', model: 'customer_transport_company', custom: true },
+        { label: '快递公司', model: 'customer_transport_type', custom: true },
       ],
       ],
       customerrules: {
       customerrules: {
         customer_transport_no: [{ required: true, message: '请输入快递单号', trigger: 'blur' }],
         customer_transport_no: [{ required: true, message: '请输入快递单号', trigger: 'blur' }],