linwenxin 7 ay önce
ebeveyn
işleme
f7856716e1

+ 18 - 14
src/views/auxiliaryFittings/salesManagement/components/auxiliarySalesOrderDetail.vue

@@ -203,15 +203,7 @@
                       }
                     }
                   "
-                  @change="
-                    e => {
-                      if (!formData.isImport && formData.orderSource == 'SELF') {
-                        dataList = []
-                      }
-                      formData.storageId = e.storageId
-                      formData.storageName = e.storageName
-                    }
-                  "
+                  @change="changeStorage(e)"
                   :disabled="
                     (['SAVE', 'PAY_NOT_TAKE'].indexOf(formData.flag) == -1 && formData.orderSource == 'ONLINE') ||
                     (formType != 0 && ['SAVE', 'PAY_NOT_TAKE'].indexOf(formData.flag) == -1)
@@ -826,13 +818,25 @@ export default {
       this.formData.storageName = ''
       this.formData.storageId = ''
       this.getWorker()
-      this.getCategory(e.websitId)
+      this.getCategory(e.websitId, this.formData.storageId)
       this.getWarehouseList(e.websitId)
     },
-    getCategory(websitId) {
-      getCategory({ websitId }).then(res => {
-        this.mainList = res.data
-      })
+    changeStorage(e) {
+      if (!this.formData.isImport && this.formData.orderSource == 'SELF') {
+        this.dataList = []
+      }
+      this.formData.storageId = e.storageId
+      this.formData.storageName = e.storageName
+      this.getCategory(this.formData.websitId, e.storageId)
+    },
+    getCategory(websitId, storageId) {
+      if (websitId && storageId) {
+        getCategory({ websitId, storageId }).then(res => {
+          this.mainList = res.data
+        })
+      } else {
+        this.mainList = []
+      }
     },
     toAddProject() {
       this.$router.push({