Parcourir la source

Finish Hotfix-mo-74

莫绍宝 il y a 3 ans
Parent
commit
a811c582e5

+ 18 - 0
src/views/supply/engin/components/commerce_form.vue

@@ -465,6 +465,24 @@ export default {
     }
   },
 
+  watch: {
+    goodsList: {
+      handler(newValue, oldValue) {
+        if(this.goodsList && this.goodsList.length) {
+          if(this.isFirst) {
+            this.isFirst = false;
+          }else {
+            this.mainForm.salesMan = this.goodsList[0].serviceId;
+          }
+        }else {
+          this.mainForm.salesMan = '';
+        }
+      },
+      immediate: true,
+      deep: true
+    }
+  },
+
   beforeCreate() {
     that = this;
   },

+ 18 - 0
src/views/supply/engin/components/home_form.vue

@@ -594,6 +594,24 @@ export default {
     }
   },
 
+  watch: {
+    goodsList: {
+      handler(newValue, oldValue) {
+        if(this.goodsList && this.goodsList.length) {
+          if(this.isFirst) {
+            this.isFirst = false;
+          }else {
+            this.mainForm.salesMan = this.goodsList[0].serviceId;
+          }
+        }else {
+          this.mainForm.salesMan = '';
+        }
+      },
+      immediate: true,
+      deep: true
+    }
+  },
+
   beforeCreate() {
     that = this;
   },

+ 18 - 0
src/views/supply/retail/components/retail_form.vue

@@ -390,6 +390,24 @@ export default {
     }
   },
 
+  watch: {
+    goodsList: {
+      handler(newValue, oldValue) {
+        if(this.goodsList && this.goodsList.length) {
+          if(this.isFirst) {
+            this.isFirst = false;
+          }else {
+            this.mainForm.salesMan = this.goodsList[0].serviceId;
+          }
+        }else {
+          this.mainForm.salesMan = '';
+        }
+      },
+      immediate: true,
+      deep: true
+    }
+  },
+
   beforeCreate() {
     that = this;
   },