瀏覽代碼

no message

linwenxin 9 月之前
父節點
當前提交
39d9b5c46e

+ 9 - 2
src/views/auxiliaryFittings/AuxiliaryAccessoriesWarehouse/index.vue

@@ -181,6 +181,13 @@ export default {
             label: '网点名称',
             prop: 'websitId',
             rules: [...required]
+          },
+          events: {
+            change: () => {
+              this.formData.outStorageId = ''
+              this.formData.inStorageId = ''
+              this.formData.items = []
+            }
           }
         },
         {
@@ -375,10 +382,10 @@ export default {
       })
     },
     initData() {
-      this.biyaowebsitId(this.formData.websitId)
-      this.biyaooutStorageId(this.formData.outStorageId)
       Promise.all([getWebsit({ type: 'C', status: true })]).then(([res1]) => {
         this.websitSelectList = res1.data
+        this.biyaowebsitId(this.formData.websitId)
+        this.biyaooutStorageId(this.formData.outStorageId)
       })
     },
     formSubmit(cancel) {

+ 4 - 7
src/views/auxiliaryFittings/AuxiliaryAccessoriesWarehouse/storage_table.js

@@ -478,18 +478,15 @@ export default {
   },
   watch: {
     'formData.websitId'(newVal) {
-      this.formData.outStorageId = ''
-      this.formData.inStorageId = ''
-      this.formData.items = []
       this.biyaowebsitId(newVal)
     },
     'formData.outStorageId'(newValue) {
-      this.biyaooutStorageId(newValue)
+      this.biyaooutStorageId()
     }
   },
   methods: {
-    biyaooutStorageId(newValue) {
-      if (newValue && this.formData.websitId) {
+    biyaooutStorageId() {
+      if (this.formData.outStorageId && this.formData.websitId) {
         getGoods({
           websitId: this.formData.websitId,
           type: 'P',
@@ -529,7 +526,7 @@ export default {
         getCategory({ websitId: newVal }).then(res => {
           this.mainList = res.data
         })
-        if (this.formData.outStorageId) {
+        if (this.formData.outStorageId && this.formData.websitId) {
           getGoods({
             websitId: this.formData.websitId,
             type: 'P',