From 1cd8899b91a760da09e170c030091d2465df51a3 Mon Sep 17 00:00:00 2001
From: cuilei <ray_tsu1@163.com>
Date: 星期四, 24 七月 2025 16:48:15 +0800
Subject: [PATCH] 货架标签管理表单三级联动问题处理

---
 src/views/tms/modules/GoodsShelvesMarkForm.vue |   34 ++++++++++++++++++++++------------
 1 files changed, 22 insertions(+), 12 deletions(-)

diff --git a/src/views/tms/modules/GoodsShelvesMarkForm.vue b/src/views/tms/modules/GoodsShelvesMarkForm.vue
index 6150ce0..51141ee 100644
--- a/src/views/tms/modules/GoodsShelvesMarkForm.vue
+++ b/src/views/tms/modules/GoodsShelvesMarkForm.vue
@@ -54,7 +54,11 @@
     data () {
       return {
         model:{
-         },
+          warehouseId: '',
+          goodsShelves: '',
+          storey: '',
+          variety: ''
+        },
         labelCol: {
           xs: { span: 24 },
           sm: { span: 5 },
@@ -91,7 +95,8 @@
         editDisabled: false,
         warehouseOptions: [],
         goodsShelvesOptions: [],
-        storeyOptions: []
+        storeyOptions: [],
+        warehouseId: ''
       }
     },
     computed: {
@@ -129,6 +134,8 @@
         })
       },
       warehouseChange(warehouseId) {
+        this.model.goodsShelves = ''
+        this.model.storey = ''
         this.goodsShelvesOptions = []
         this.storeyOptions = []
         this.warehouseId = warehouseId
@@ -140,6 +147,7 @@
       },
       goodsShelvesChange(shelfNumber) {
         this.storeyOptions = []
+        this.model.storey = ''
         getAction(this.url.queryGoodsShelvesStoreyDictList, {
           warehouseId: this.warehouseId,
           shelfNumber: shelfNumber
@@ -163,16 +171,18 @@
             this.warehouseOptions = res.result
           }
         })
-        getAction(this.url.queryGoodsShelvesDictList, { warehouseId: record.warehouseId }).then(res => {
-          if (res.success) {
-            this.goodsShelvesOptions = res.result
-          }
-        })
-        getAction(this.url.queryGoodsShelvesStoreyDictList,  { warehouseId: record.warehouseId, shelfNumber: record.goodsShelves }).then(res => {
-          if (res.success) {
-            this.storeyOptions = res.result
-          }
-        })
+        if (record.warehouseId) {
+          getAction(this.url.queryGoodsShelvesDictList, { warehouseId: record.warehouseId }).then(res => {
+            if (res.success) {
+              this.goodsShelvesOptions = res.result
+            }
+          })
+          getAction(this.url.queryGoodsShelvesStoreyDictList,  { warehouseId: record.warehouseId, shelfNumber: record.goodsShelves }).then(res => {
+            if (res.success) {
+              this.storeyOptions = res.result
+            }
+          })
+        }
         if (this.title === '鏂板' || this.title === '璇︽儏') {
           this.editDisabled = false
         }

--
Gitblit v1.9.3