From c69cfbefce93b07f3b519ccff6e783262883d839 Mon Sep 17 00:00:00 2001
From: 647556386 <647556386@qq.com>
Date: 星期五, 23 一月 2026 12:17:58 +0800
Subject: [PATCH] 前端组盘优化

---
 项目代码/WIDESEA_WMSClient/src/extension/inbound/extend/Pallet.vue               |   65 ++++++++++
 项目代码/WIDESEA_WMSClient/src/extension/inbound/extend/AllcatedPallet.vue       |   72 +++++++++++
 项目代码/WIDESEA_WMSClient/src/extension/check/extend/ReCheckGroupPallet.vue     |  102 ++++++++++++++++
 项目代码/WIDESEA_WMSClient/src/extension/inbound/extend/StockTakeGroupPallet.vue |  102 ++++++++++++++++
 项目代码/WIDESEA_WMSClient/src/views/outbound/outPicking.vue                     |    4 
 5 files changed, 324 insertions(+), 21 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/check/extend/ReCheckGroupPallet.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/check/extend/ReCheckGroupPallet.vue"
index cea7cce..3bfaaa6 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/check/extend/ReCheckGroupPallet.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/check/extend/ReCheckGroupPallet.vue"
@@ -74,7 +74,7 @@
               class="custom-input" size="medium">
               <template slot="append">
                 <el-button :loading="loading" @click="handleBarcodeSubmit" type="primary" icon="el-icon-search"
-                  :disabled="!form.locationType || !trayBarcode || !barcode || !from.warehouseType" size="medium">
+                  :disabled="!form.locationType || !trayBarcode || !barcode || !form.warehouseType" size="medium">
                   {{ loading ? '鏌ヨ涓�...' : '鏌ヨ' }}
                 </el-button>
               </template>
@@ -240,7 +240,11 @@
             trigger: 'change'
           }
         ]
-      }
+      },
+      
+      // 鏂板锛氶敭鐩樹簨浠剁洃鍚爣璁�
+      keyPressListenerAdded: false,
+      isDialogClosing: false
     }
   },
 
@@ -256,7 +260,28 @@
       return location ? location.locationTypeDesc : ''
     }
   },
+  
   watch: {
+    // 鐩戝惉show鍙橀噺鍙樺寲
+    show(newVal) {
+      if (newVal === true) {
+        console.log('寮规鎵撳紑锛岄噸缃暟鎹�');
+        this.isDialogClosing = false;
+        this.resetData();
+        this.$nextTick(() => {
+          setTimeout(() => {
+            this.fetchUnpalletMaterialDetails();
+            this.addKeyPressListener(); // 娣诲姞閿洏浜嬩欢鐩戝惉
+          }, 300);
+        });
+      } else if (newVal === false && !this.isDialogClosing) {
+        console.log('寮规鍏抽棴锛岀Щ闄や簨浠剁洃鍚�');
+        this.isDialogClosing = true;
+        this.removeKeyPressListener(); // 绉婚櫎閿洏浜嬩欢鐩戝惉
+        this.resetData();
+      }
+    },
+    
     visible(newVal, oldVal) {
       this.palletVisible = newVal;
 
@@ -289,14 +314,36 @@
       }
     }
   },
+  
   mounted() {
-    document.addEventListener('keypress', this.handleKeyPress);
+    // 涓嶅湪mounted鏃舵坊鍔犵洃鍚紝鍦ㄥ脊绐楁墦寮�鏃舵坊鍔�
   },
+  
   beforeDestroy() {
-    document.removeEventListener('keypress', this.handleKeyPress);
+    // 纭繚缁勪欢閿�姣佹椂绉婚櫎鐩戝惉
+    this.removeKeyPressListener();
     this.clearAllTimers();
   },
+  
   methods: {
+    // 娣诲姞閿洏浜嬩欢鐩戝惉
+    addKeyPressListener() {
+      if (!this.keyPressListenerAdded) {
+        document.addEventListener('keypress', this.handleKeyPress);
+        this.keyPressListenerAdded = true;
+        console.log('閿洏浜嬩欢鐩戝惉宸叉坊鍔�');
+      }
+    },
+    
+    // 绉婚櫎閿洏浜嬩欢鐩戝惉
+    removeKeyPressListener() {
+      if (this.keyPressListenerAdded) {
+        document.removeEventListener('keypress', this.handleKeyPress);
+        this.keyPressListenerAdded = false;
+        console.log('閿洏浜嬩欢鐩戝惉宸茬Щ闄�');
+      }
+    },
+    
     open() {
       this.show = true;
       this.orderNo = "";
@@ -304,7 +351,15 @@
       this.initLocationTypes();
       this.initwarehouseTypes();
       this.fetchUnpalletMaterialDetails();
+      
+      // 寮圭獥鎵撳紑鏃舵坊鍔犻敭鐩樹簨浠剁洃鍚�
+      this.$nextTick(() => {
+        setTimeout(() => {
+          this.addKeyPressListener();
+        }, 100);
+      });
     },
+    
     validateLocationType(rule, value, callback) {
       if (!this.form.warehouseType) {
         callback(new Error('璇峰厛閫夋嫨浠撳簱'));
@@ -338,6 +393,7 @@
         }));
       }
     },
+    
     async initLocationTypes() {
       try {
         const { data } = await this.http.post("api/LocationInfo/GetLocationTypes")
@@ -346,6 +402,7 @@
         this.$message.error('鑾峰彇鍖哄煙绫诲瀷澶辫触')
       }
     },
+    
     async initwarehouseTypes() {
       try {
         const { data } = await this.http.post("api/Warehouse/GetwarehouseTypes")
@@ -394,7 +451,8 @@
             this.error = '';
             resolve(true);
           } else {
-            if (!this.from.warehouseType) {
+            // 淇鎷煎啓閿欒锛歵his.from.warehouseType 搴旇鏄� this.form.warehouseType
+            if (!this.form.warehouseType) {
               this.error = '璇峰厛閫夋嫨浠撳簱';
             }
             else if (this.form.locationType === null || this.form.locationType === undefined || this.form.locationType === '') {
@@ -407,6 +465,7 @@
         });
       });
     },
+    
     // 鑱氱劍鍒版墭鐩樿緭鍏ユ
     focusTrayInput() {
       if (this.$refs.trayInput && this.$refs.trayInput.$el) {
@@ -432,8 +491,12 @@
         }
       }
     },
+    
     // 閲嶇疆鎵�鏈夋暟鎹�
     resetData() {
+      // 鍏堢Щ闄ら敭鐩樹簨浠剁洃鍚�
+      this.removeKeyPressListener();
+      
       this.trayBarcode = '';
       this.barcode = '';
       this.materials = [];
@@ -458,6 +521,9 @@
       }
       this.warehouseTypes = [];
       this.locationTypes = [];
+      this.isDialogClosing = false;
+      this.keyPressListenerAdded = false;
+      
       // 娓呴櫎琛ㄥ崟楠岃瘉鐘舵��
       this.$nextTick(() => {
         if (this.$refs.locationForm) {
@@ -477,7 +543,10 @@
         this.scanTimer = null;
       }
     },
+    
     handleDialogClose() {
+      // 鍏堢Щ闄ら敭鐩樹簨浠剁洃鍚�
+      this.removeKeyPressListener();
       this.show = false;
       this.resetData();
     },
@@ -510,6 +579,7 @@
       this.$emit('back-success', result);
       this.palletVisible = false;
     },
+    
     // 澶勭悊鎵樼洏杈撳叆
     handleTrayInput() {
       // 鏍囪涓烘墜鍔ㄨ緭鍏ユā寮�
@@ -715,6 +785,11 @@
 
     // 澶勭悊鎵爜鏋緭鍏�
     handleKeyPress(event) {
+      // 妫�鏌ュ脊绐楁槸鍚︽樉绀�
+      if (!this.show || this.isDialogClosing) {
+        return;
+      }
+      
       // 濡傛灉鏄墜鍔ㄨ緭鍏ユā寮忥紝涓嶅鐞嗘壂鐮佹灙閫昏緫
       if (this.isManualInput) {
         return;
@@ -776,6 +851,23 @@
       const seconds = String(date.getSeconds()).padStart(2, '0');
 
       return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
+    },
+    
+    // 浠撳簱鍒囨崲浜嬩欢
+    handleWarehouseChange() {
+      this.form.locationType = null;
+      this.trayBarcode = '';
+      this.barcode = '';
+      this.materials = [];
+      this.error = '';
+    },
+    
+    // 鍖哄煙鍒囨崲浜嬩欢
+    handleLocationChange() {
+      this.trayBarcode = '';
+      this.barcode = '';
+      this.materials = [];
+      this.error = '';
     }
   }
 }
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/AllcatedPallet.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/AllcatedPallet.vue"
index 0fc42d7..fe15c2e 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/AllcatedPallet.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/AllcatedPallet.vue"
@@ -175,7 +175,7 @@
 import http from '@/api/http.js';
 import VolBox from '@/components/basic/VolBox.vue';
 
-// 闃叉姈鍑芥暟淇濇寔涓嶅彉
+// 闃叉姈鍑芥暟
 function debounce(func, wait) {
   let timeout;
   return function () {
@@ -251,7 +251,11 @@
             trigger: 'change'
           }
         ]
-      }
+      },
+      
+      // 鏂板锛氶敭鐩樹簨浠剁洃鍚爣璁�
+      keyPressListenerAdded: false,
+      isDialogClosing: false
     }
   },
 
@@ -272,6 +276,26 @@
   },
   
   watch: {
+    // 鐩戝惉show鍙橀噺鍙樺寲
+    show(newVal) {
+      if (newVal === true) {
+        console.log('寮规鎵撳紑锛岄噸缃暟鎹�');
+        this.isDialogClosing = false;
+        this.resetData();
+        this.$nextTick(() => {
+          setTimeout(() => {
+            this.fetchUnpalletMaterialDetails();
+            this.addKeyPressListener(); // 娣诲姞閿洏浜嬩欢鐩戝惉
+          }, 300);
+        });
+      } else if (newVal === false && !this.isDialogClosing) {
+        console.log('寮规鍏抽棴锛岀Щ闄や簨浠剁洃鍚�');
+        this.isDialogClosing = true;
+        this.removeKeyPressListener(); // 绉婚櫎閿洏浜嬩欢鐩戝惉
+        this.resetData();
+      }
+    },
+    
     visible(newVal, oldVal) {
       this.palletVisible = newVal;
 
@@ -306,15 +330,34 @@
   },
   
   mounted() {
-    document.addEventListener('keypress', this.handleKeyPress);
+    // 涓嶅湪mounted鏃舵坊鍔犵洃鍚紝鍦ㄥ脊绐楁墦寮�鏃舵坊鍔�
   },
   
   beforeDestroy() {
-    document.removeEventListener('keypress', this.handleKeyPress);
+    // 纭繚缁勪欢閿�姣佹椂绉婚櫎鐩戝惉
+    this.removeKeyPressListener();
     this.clearAllTimers();
   },
   
   methods: {
+    // 娣诲姞閿洏浜嬩欢鐩戝惉
+    addKeyPressListener() {
+      if (!this.keyPressListenerAdded) {
+        document.addEventListener('keypress', this.handleKeyPress);
+        this.keyPressListenerAdded = true;
+        console.log('閿洏浜嬩欢鐩戝惉宸叉坊鍔�');
+      }
+    },
+    
+    // 绉婚櫎閿洏浜嬩欢鐩戝惉
+    removeKeyPressListener() {
+      if (this.keyPressListenerAdded) {
+        document.removeEventListener('keypress', this.handleKeyPress);
+        this.keyPressListenerAdded = false;
+        console.log('閿洏浜嬩欢鐩戝惉宸茬Щ闄�');
+      }
+    },
+    
     open() {
       this.show = true;
       this.orderNo = "";
@@ -322,6 +365,13 @@
       this.initLocationTypes();
       this.initwarehouseTypes();
       this.fetchUnpalletMaterialDetails();
+      
+      // 寮圭獥鎵撳紑鏃舵坊鍔犻敭鐩樹簨浠剁洃鍚�
+      this.$nextTick(() => {
+        setTimeout(() => {
+          this.addKeyPressListener();
+        }, 100);
+      });
     },
     
     validateLocationType(rule, value, callback) {
@@ -483,6 +533,9 @@
     },
     
     resetData() {
+      // 鍏堢Щ闄ら敭鐩樹簨浠剁洃鍚�
+      this.removeKeyPressListener();
+      
       this.palletGroupedBarcodes = {};
       this.isSubmitting = false;
       this.trayBarcode = '';
@@ -509,6 +562,8 @@
       };
       this.warehouseTypes = [];
       this.locationTypes = [];
+      this.isDialogClosing = false;
+      this.keyPressListenerAdded = false;
       
       this.$nextTick(() => {
         if (this.$refs.locationForm) {
@@ -529,6 +584,8 @@
     },
     
     handleDialogClose() {
+      // 鍏堢Щ闄ら敭鐩樹簨浠剁洃鍚�
+      this.removeKeyPressListener();
       this.show = false;
       this.resetData();
     },
@@ -759,7 +816,7 @@
         });
     },
 
-    // API璇锋眰
+    // API璇锋眰 - 娉ㄦ剰杩欓噷淇敼浜咥PI鍦板潃涓�/AllGroupPallet
     fetchMaterialData(barcode) {
       return http.post('/api/Inbound/AllGroupPallet', {
         palletCode: this.trayBarcode,
@@ -797,6 +854,11 @@
 
     // 澶勭悊鎵爜鏋緭鍏�
     handleKeyPress(event) {
+      // 妫�鏌ュ脊绐楁槸鍚︽樉绀�
+      if (!this.show || this.isDialogClosing) {
+        return;
+      }
+      
       if (this.isManualInput || this.isSubmitting) {
         return;
       }
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/Pallet.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/Pallet.vue"
index 85cfe01..5c9a1b6 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/Pallet.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/Pallet.vue"
@@ -175,7 +175,7 @@
 import http from '@/api/http.js';
 import VolBox from '@/components/basic/VolBox.vue';
 
-// 闃叉姈鍑芥暟淇濇寔涓嶅彉
+// 闃叉姈鍑芥暟
 function debounce(func, wait) {
   let timeout;
   return function () {
@@ -251,7 +251,11 @@
             trigger: 'change'
           }
         ]
-      }
+      },
+      
+      // 鏂板锛氶敭鐩樹簨浠剁洃鍚爣璁�
+      keyPressListenerAdded: false,
+      isDialogClosing: false
     }
   },
 
@@ -272,6 +276,26 @@
   },
   
   watch: {
+    // 鐩戝惉show鍙橀噺鍙樺寲
+    show(newVal) {
+      if (newVal === true) {
+        console.log('寮规鎵撳紑锛岄噸缃暟鎹�');
+        this.isDialogClosing = false;
+        this.resetData();
+        this.$nextTick(() => {
+          setTimeout(() => {
+            this.fetchUnpalletMaterialDetails();
+            this.addKeyPressListener(); // 娣诲姞閿洏浜嬩欢鐩戝惉
+          }, 300);
+        });
+      } else if (newVal === false && !this.isDialogClosing) {
+        console.log('寮规鍏抽棴锛岀Щ闄や簨浠剁洃鍚�');
+        this.isDialogClosing = true;
+        this.removeKeyPressListener(); // 绉婚櫎閿洏浜嬩欢鐩戝惉
+        this.resetData();
+      }
+    },
+    
     visible(newVal, oldVal) {
       this.palletVisible = newVal;
 
@@ -306,15 +330,34 @@
   },
   
   mounted() {
-    document.addEventListener('keypress', this.handleKeyPress);
+    // 涓嶅湪mounted鏃舵坊鍔犵洃鍚紝鍦ㄥ脊绐楁墦寮�鏃舵坊鍔�
   },
   
   beforeDestroy() {
-    document.removeEventListener('keypress', this.handleKeyPress);
+    // 纭繚缁勪欢閿�姣佹椂绉婚櫎鐩戝惉
+    this.removeKeyPressListener();
     this.clearAllTimers();
   },
   
   methods: {
+    // 娣诲姞閿洏浜嬩欢鐩戝惉
+    addKeyPressListener() {
+      if (!this.keyPressListenerAdded) {
+        document.addEventListener('keypress', this.handleKeyPress);
+        this.keyPressListenerAdded = true;
+        console.log('閿洏浜嬩欢鐩戝惉宸叉坊鍔�');
+      }
+    },
+    
+    // 绉婚櫎閿洏浜嬩欢鐩戝惉
+    removeKeyPressListener() {
+      if (this.keyPressListenerAdded) {
+        document.removeEventListener('keypress', this.handleKeyPress);
+        this.keyPressListenerAdded = false;
+        console.log('閿洏浜嬩欢鐩戝惉宸茬Щ闄�');
+      }
+    },
+    
     open() {
       this.show = true;
       this.orderNo = "";
@@ -322,6 +365,13 @@
       this.initLocationTypes();
       this.initwarehouseTypes();
       this.fetchUnpalletMaterialDetails();
+      
+      // 寮圭獥鎵撳紑鏃舵坊鍔犻敭鐩樹簨浠剁洃鍚�
+      this.$nextTick(() => {
+        setTimeout(() => {
+          this.addKeyPressListener();
+        }, 100);
+      });
     },
     
     validateLocationType(rule, value, callback) {
@@ -529,6 +579,8 @@
     },
     
     handleDialogClose() {
+      // 鍏堢Щ闄ら敭鐩樹簨浠剁洃鍚�
+      this.removeKeyPressListener();
       this.show = false;
       this.resetData();
     },
@@ -797,6 +849,11 @@
 
     // 澶勭悊鎵爜鏋緭鍏�
     handleKeyPress(event) {
+      // 妫�鏌ュ脊绐楁槸鍚︽樉绀�
+      if (!this.show || this.isDialogClosing) {
+        return;
+      }
+      
       if (this.isManualInput || this.isSubmitting) {
         return;
       }
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/StockTakeGroupPallet.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/StockTakeGroupPallet.vue"
index 20885b9..b6ec746 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/StockTakeGroupPallet.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/StockTakeGroupPallet.vue"
@@ -74,7 +74,7 @@
               class="custom-input" size="medium">
               <template slot="append">
                 <el-button :loading="loading" @click="handleBarcodeSubmit" type="primary" icon="el-icon-search"
-                  :disabled="!form.locationType || !trayBarcode || !barcode || !from.warehouseType" size="medium">
+                  :disabled="!form.locationType || !trayBarcode || !barcode || !form.warehouseType" size="medium">
                   {{ loading ? '鏌ヨ涓�...' : '鏌ヨ' }}
                 </el-button>
               </template>
@@ -240,7 +240,11 @@
             trigger: 'change'
           }
         ]
-      }
+      },
+      
+      // 鏂板锛氶敭鐩樹簨浠剁洃鍚爣璁�
+      keyPressListenerAdded: false,
+      isDialogClosing: false
     }
   },
 
@@ -256,7 +260,28 @@
       return location ? location.locationTypeDesc : ''
     }
   },
+  
   watch: {
+    // 鐩戝惉show鍙橀噺鍙樺寲
+    show(newVal) {
+      if (newVal === true) {
+        console.log('寮规鎵撳紑锛岄噸缃暟鎹�');
+        this.isDialogClosing = false;
+        this.resetData();
+        this.$nextTick(() => {
+          setTimeout(() => {
+            this.fetchUnpalletMaterialDetails();
+            this.addKeyPressListener(); // 娣诲姞閿洏浜嬩欢鐩戝惉
+          }, 300);
+        });
+      } else if (newVal === false && !this.isDialogClosing) {
+        console.log('寮规鍏抽棴锛岀Щ闄や簨浠剁洃鍚�');
+        this.isDialogClosing = true;
+        this.removeKeyPressListener(); // 绉婚櫎閿洏浜嬩欢鐩戝惉
+        this.resetData();
+      }
+    },
+    
     visible(newVal, oldVal) {
       this.palletVisible = newVal;
 
@@ -289,14 +314,36 @@
       }
     }
   },
+  
   mounted() {
-    document.addEventListener('keypress', this.handleKeyPress);
+    // 涓嶅湪mounted鏃舵坊鍔犵洃鍚紝鍦ㄥ脊绐楁墦寮�鏃舵坊鍔�
   },
+  
   beforeDestroy() {
-    document.removeEventListener('keypress', this.handleKeyPress);
+    // 纭繚缁勪欢閿�姣佹椂绉婚櫎鐩戝惉
+    this.removeKeyPressListener();
     this.clearAllTimers();
   },
+  
   methods: {
+    // 娣诲姞閿洏浜嬩欢鐩戝惉
+    addKeyPressListener() {
+      if (!this.keyPressListenerAdded) {
+        document.addEventListener('keypress', this.handleKeyPress);
+        this.keyPressListenerAdded = true;
+        console.log('閿洏浜嬩欢鐩戝惉宸叉坊鍔�');
+      }
+    },
+    
+    // 绉婚櫎閿洏浜嬩欢鐩戝惉
+    removeKeyPressListener() {
+      if (this.keyPressListenerAdded) {
+        document.removeEventListener('keypress', this.handleKeyPress);
+        this.keyPressListenerAdded = false;
+        console.log('閿洏浜嬩欢鐩戝惉宸茬Щ闄�');
+      }
+    },
+    
     open() {
       this.show = true;
       this.orderNo = "";
@@ -304,7 +351,15 @@
       this.initLocationTypes();
       this.initwarehouseTypes();
       this.fetchUnpalletMaterialDetails();
+      
+      // 寮圭獥鎵撳紑鏃舵坊鍔犻敭鐩樹簨浠剁洃鍚�
+      this.$nextTick(() => {
+        setTimeout(() => {
+          this.addKeyPressListener();
+        }, 100);
+      });
     },
+    
     validateLocationType(rule, value, callback) {
       if (!this.form.warehouseType) {
         callback(new Error('璇峰厛閫夋嫨浠撳簱'));
@@ -338,6 +393,7 @@
         }));
       }
     },
+    
     async initLocationTypes() {
       try {
         const { data } = await this.http.post("api/LocationInfo/GetLocationTypes")
@@ -346,6 +402,7 @@
         this.$message.error('鑾峰彇鍖哄煙绫诲瀷澶辫触')
       }
     },
+    
     async initwarehouseTypes() {
       try {
         const { data } = await this.http.post("api/Warehouse/GetwarehouseTypes")
@@ -394,7 +451,8 @@
             this.error = '';
             resolve(true);
           } else {
-            if (!this.from.warehouseType) {
+            // 淇鎷煎啓閿欒锛歵his.from.warehouseType 搴旇鏄� this.form.warehouseType
+            if (!this.form.warehouseType) {
               this.error = '璇峰厛閫夋嫨浠撳簱';
             }
             else if (this.form.locationType === null || this.form.locationType === undefined || this.form.locationType === '') {
@@ -407,6 +465,7 @@
         });
       });
     },
+    
     // 鑱氱劍鍒版墭鐩樿緭鍏ユ
     focusTrayInput() {
       if (this.$refs.trayInput && this.$refs.trayInput.$el) {
@@ -432,8 +491,12 @@
         }
       }
     },
+    
     // 閲嶇疆鎵�鏈夋暟鎹�
     resetData() {
+      // 鍏堢Щ闄ら敭鐩樹簨浠剁洃鍚�
+      this.removeKeyPressListener();
+      
       this.trayBarcode = '';
       this.barcode = '';
       this.materials = [];
@@ -458,6 +521,9 @@
       }
       this.warehouseTypes = [];
       this.locationTypes = [];
+      this.isDialogClosing = false;
+      this.keyPressListenerAdded = false;
+      
       // 娓呴櫎琛ㄥ崟楠岃瘉鐘舵��
       this.$nextTick(() => {
         if (this.$refs.locationForm) {
@@ -477,7 +543,10 @@
         this.scanTimer = null;
       }
     },
+    
     handleDialogClose() {
+      // 鍏堢Щ闄ら敭鐩樹簨浠剁洃鍚�
+      this.removeKeyPressListener();
       this.show = false;
       this.resetData();
     },
@@ -510,6 +579,7 @@
       this.$emit('back-success', result);
       this.palletVisible = false;
     },
+    
     // 澶勭悊鎵樼洏杈撳叆
     handleTrayInput() {
       // 鏍囪涓烘墜鍔ㄨ緭鍏ユā寮�
@@ -715,6 +785,11 @@
 
     // 澶勭悊鎵爜鏋緭鍏�
     handleKeyPress(event) {
+      // 妫�鏌ュ脊绐楁槸鍚︽樉绀�
+      if (!this.show || this.isDialogClosing) {
+        return;
+      }
+      
       // 濡傛灉鏄墜鍔ㄨ緭鍏ユā寮忥紝涓嶅鐞嗘壂鐮佹灙閫昏緫
       if (this.isManualInput) {
         return;
@@ -776,6 +851,23 @@
       const seconds = String(date.getSeconds()).padStart(2, '0');
 
       return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
+    },
+    
+    // 浠撳簱鍒囨崲浜嬩欢
+    handleWarehouseChange() {
+      this.form.locationType = null;
+      this.trayBarcode = '';
+      this.barcode = '';
+      this.materials = [];
+      this.error = '';
+    },
+    
+    // 鍖哄煙鍒囨崲浜嬩欢
+    handleLocationChange() {
+      this.trayBarcode = '';
+      this.barcode = '';
+      this.materials = [];
+      this.error = '';
     }
   }
 }
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/outbound/outPicking.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/outbound/outPicking.vue"
index 578021c..6a629dc 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/outbound/outPicking.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/outbound/outPicking.vue"
@@ -532,8 +532,8 @@
                     this.calculateUnpickedStats(); // 閲嶇疆缁熻鏁版嵁
                     
                     // 鍙嬪ソ鎻愮ず + 浜や簰浼樺寲
-                    this.$message.warning({
-                        message: `鎵樼洏銆�${this.scanForm.palletCode}銆戞殏鏃犳嫞閫夎褰昤,
+                    this.$message.success({
+                        message: `鎵樼洏銆�${this.scanForm.palletCode}銆戝凡鎷i�夊畬鎴愶紝鏆傛棤鎷i�夎褰昤,
                         duration: 3000, // 鎻愮ず鏄剧ず3绉�
                         showClose: true // 鍏佽鎵嬪姩鍏抽棴
                     });

--
Gitblit v1.9.3