From f692f869d5fe2e2aee9d3487dbba83e1821b7f6c Mon Sep 17 00:00:00 2001
From: pan <antony1029@163.com>
Date: 星期四, 04 十二月 2025 18:02:19 +0800
Subject: [PATCH] 提交

---
 项目代码/WIDESEA_WMSClient/src/views/outbound/BatchPickingConfirm.vue |  486 +++++++++++++++++++++++++++++++----------------------
 1 files changed, 283 insertions(+), 203 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/outbound/BatchPickingConfirm.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/outbound/BatchPickingConfirm.vue"
index b938edd..1b7dafd 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/outbound/BatchPickingConfirm.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/outbound/BatchPickingConfirm.vue"
@@ -92,7 +92,7 @@
     </div>
 
     <!-- 鎷嗗寘寮圭獥 -->
-    <div  v-show="showCustomSplitDialog" class="custom-dialog-overlay" style="z-index: 2001;">
+    <div v-if="showCustomSplitDialog" class="custom-dialog-overlay" style="z-index: 2000;">
       <div class="custom-dialog-wrapper">
         <div class="custom-dialog">
           <div class="custom-dialog-header">
@@ -154,7 +154,7 @@
     </div>
 
     <!-- 鎾ら攢鎷嗗寘寮圭獥 -->
-    <div  v-show="showRevertSplitDialog" class="custom-dialog-overlay" style="z-index: 2001;">
+    <div v-if="showRevertSplitDialog" class="custom-dialog-overlay"  style="z-index: 2001;">
       <div class="custom-dialog-wrapper">
         <div class="custom-dialog">
           <div class="custom-dialog-header">
@@ -214,7 +214,7 @@
     </div>
 
     <!-- 鎷嗗寘閾句俊鎭脊绐� -->
-<div v-show="showSplitChainDialog" class="custom-dialog-overlay" style="z-index: 2003;">
+<div v-if="showSplitChainDialog" class="custom-dialog-overlay"  style="z-index: 2002;">
   <div class="custom-dialog-wrapper">
     <div class="custom-dialog" style="width: 750px;">
       <div class="custom-dialog-header">
@@ -338,7 +338,7 @@
 </div>
 
     <!-- 鎵归噺鍥炲簱寮圭獥 -->
-    <div v-if="showBatchReturnDialog" class="custom-dialog-overlay"  style="z-index: 2004;">
+    <div v-if="showBatchReturnDialog" class="custom-dialog-overlay"  style="z-index: 2003;">
       <div class="custom-dialog-wrapper">
         <div class="custom-dialog">
           <div class="custom-dialog-header">
@@ -370,7 +370,7 @@
     </div>
 
     <!-- 鍙栬蛋绌虹寮圭獥 -->
-    <div v-if="showEmptyPalletDialog" class="custom-dialog-overlay"  style="z-index: 2005;">
+    <div v-if="showEmptyPalletDialog" class="custom-dialog-overlay"  style="z-index: 2004;">
       <div class="custom-dialog-wrapper">
         <div class="custom-dialog">
           <div class="custom-dialog-header">
@@ -405,20 +405,20 @@
   </div>
 </template>
 
+ 
+ 
 <script>
 import http from '@/api/http.js'
-import { ref, defineComponent } from "vue";
+import { defineComponent } from "vue";
 import { ElMessage } from 'element-plus' 
-import { useRoute } from 'vue-router'
 import printView from "@/extension/outbound/extend/printView.vue"
-
 
 export default defineComponent({
   name: 'BatchOutboundPicking',
   components: {printView},
   data() {
     return {
-      // 淇濇寔鍘熷鏁版嵁缁撴瀯涓嶅彉
+      // 淇濇寔鎵�鏈夊師濮嬫暟鎹粨鏋勪笉鍙�...
       scanData: {
         orderNo: '',
         palletCode: '',
@@ -434,13 +434,16 @@
       },
       palletStatus: '鏈煡',
       
-      // 寮圭獥鐘舵�� - 淇濇寔鍘熷鐘舵��
+      // 寮圭獥鐘舵�� - 鍏抽敭淇锛氬彧鍏佽涓�涓脊绐楁墦寮�
+      activeDialog: null, // 'split', 'revert', 'batchReturn', 'emptyPallet', 'splitChain'
       showCustomSplitDialog: false,
       showRevertSplitDialog: false,
       showBatchReturnDialog: false,
       showEmptyPalletDialog: false,
       showSplitChainDialog: false,
       
+        // 娣诲姞闃查噸澶嶇偣鍑绘爣蹇�
+      isOpeningDialog: false,
       // 鍔犺浇鐘舵��
       splitLoading: false,
       revertSplitLoading: false,
@@ -448,7 +451,7 @@
       emptypalletOutLoading: false,
       splitChainLoading: false,
       
-      // 琛ㄥ崟鏁版嵁
+      // 琛ㄥ崟鏁版嵁...
       splitForm: {
         orderNo: '',
         palletCode: '',
@@ -474,14 +477,13 @@
         palletCode: ''
       },
       
-      // 鎷嗗寘閾剧浉鍏虫暟鎹�
       splitChainInfo: {
         originalBarcode: '',
         totalSplitTimes: 0,
         splitChain: []
       },
       
-      // 楠岃瘉瑙勫垯
+      // 楠岃瘉瑙勫垯...
       splitFormRules: {
         originalBarcode: [
           { required: true, message: '璇疯緭鍏ュ師鏉$爜', trigger: 'blur' }
@@ -504,10 +506,17 @@
         ]
       },
       
-      isProcessing: false,
-      
-      // 鏂板: 鐢ㄤ簬闃叉寮圭獥閲嶅彔
-      isDialogOpening: false
+      isProcessing: false
+    }
+  },
+  watch: {
+    // 鍏抽敭淇锛氱‘淇濆悓涓�鏃堕棿鍙湁涓�涓脊绐楁墦寮�
+    activeDialog(newVal, oldVal) {
+      this.showCustomSplitDialog = newVal === 'split'
+      this.showRevertSplitDialog = newVal === 'revert'
+      this.showBatchReturnDialog = newVal === 'batchReturn'
+      this.showEmptyPalletDialog = newVal === 'emptyPallet'
+      this.showSplitChainDialog = newVal === 'splitChain'
     }
   },
   computed: {
@@ -523,16 +532,20 @@
       this.batchReturnForm.orderNo = this.$route.query.orderNo;
       this.emptypalletOutForm.orderNo = this.$route.query.orderNo;
     }
-    this.$nextTick(() => {
-      this.$refs.palletInput.focus();
+    // 浣跨敤 requestAnimationFrame 纭繚椤甸潰瀹屽叏鍔犺浇
+    requestAnimationFrame(() => {
+      if (this.$refs.palletInput) {
+        this.$refs.palletInput.focus();
+      }
     });
+ 
   },
   methods: {
     goBack(){
       this.$router.back()
     },
 
-    // 淇: 娣诲姞闃查噸澶嶇偣鍑绘満鍒�
+    // 鍒嗘嫞鐩稿叧鏂规硶
     async confirmPicking() {
       if (this.isProcessing) return;
       
@@ -572,41 +585,77 @@
       }
     },
 
-    // 淇: 鎵撳紑鎷嗗寘寮圭獥 - 娣诲姞闃查噸鍙犳満鍒�
-    openSplitDialog() {
-      if (this.isDialogOpening) return;
+   openSplitDialog() {
+      console.log('寮�濮嬫墦寮�鎷嗗寘寮圭獥');
+      
+      if (this.isOpeningDialog) {
+        console.log('姝e湪鎵撳紑寮圭獥锛岃烦杩�');
+        return;
+      }
       
       if (!this.scanData.palletCode) {
         this.$message.warning('璇峰厛鎵弿鎵樼洏鐮�');
         return;
       }
       
-      this.isDialogOpening = true;
+      this.isOpeningDialog = true;
       
       try {
-        // 纭繚鍏抽棴鍏朵粬寮圭獥
-        this.closeAllDialogs();
-        
-        // 寤惰繜鎵撳紑锛岀‘淇滵OM鏇存柊瀹屾垚
-        this.$nextTick(() => {
-          this.showCustomSplitDialog = true;
-          this.resetSplitForm();
-          this.splitForm.orderNo = this.scanData.orderNo;
-          this.splitForm.palletCode = this.scanData.palletCode;
+        // 鏂规硶1: 浣跨敤 setTimeout 纭繚寮傛鎵ц
+        setTimeout(() => {
+          console.log('鎵ц寮圭獥鎵撳紑閫昏緫');
           
-          // 纭繚杈撳叆妗嗚幏寰楃劍鐐�
-          this.$nextTick(() => {
-            const input = document.querySelector('#splitOriginalBarcode');
-            if (input) {
-              input.focus();
-            }
-            this.isDialogOpening = false;
+          // 鍏堝叧闂墍鏈夊脊绐�
+          this.closeAllDialogsImmediately();
+          
+          // 浣跨敤 requestAnimationFrame 纭繚鍦ㄤ笅涓�甯ф墦寮�
+          requestAnimationFrame(() => {
+            console.log('璁剧疆寮圭獥鐘舵�佷负 true');
+            
+            // 閲嶇疆琛ㄥ崟
+            this.resetSplitForm();
+            this.splitForm.orderNo = this.scanData.orderNo;
+            this.splitForm.palletCode = this.scanData.palletCode;
+            
+            // 鍏抽敭锛氱洿鎺ヨ缃脊绐楃姸鎬�
+            this.showCustomSplitDialog = true;
+            
+            console.log('寮圭獥鐘舵�佸凡璁剧疆锛岀瓑寰匘OM鏇存柊');
+            
+            // 浣跨敤 nextTick 纭繚DOM鏇存柊瀹屾垚
+            this.$nextTick(() => {
+              console.log('DOM鏇存柊瀹屾垚锛屽脊绐楀簲璇ユ樉绀轰簡');
+              this.isOpeningDialog = false;
+              
+              // 灏濊瘯鑱氱劍鍒拌緭鍏ユ
+              setTimeout(() => {
+                const input = this.$refs.splitFormRef?.$el?.querySelector('input');
+                if (input) {
+                  input.focus();
+                  console.log('杈撳叆妗嗗凡鑱氱劍');
+                }
+              }, 100);
+            });
           });
-        });
+        }, 0);
+        
       } catch (error) {
-        console.error('鎵撳紑鎷嗗寘寮圭獥澶辫触:', error);
-        this.isDialogOpening = false;
+        console.error('鎵撳紑鎷嗗寘寮圭獥鍑洪敊:', error);
+        this.isOpeningDialog = false;
       }
+    },
+      closeAllDialogsImmediately() {
+      console.log('绔嬪嵆鍏抽棴鎵�鏈夊脊绐�');
+      
+      // 鐩存帴璁剧疆涓� false锛屼笉绛夊緟浠讳綍寮傛鎿嶄綔
+      this.showCustomSplitDialog = false;
+      this.showRevertSplitDialog = false;
+      this.showBatchReturnDialog = false;
+      this.showEmptyPalletDialog = false;
+      this.showSplitChainDialog = false;
+      
+      // 寮哄埗DOM鏇存柊
+      this.$forceUpdate();
     },
 
     async onSplitBarcodeScan() {
@@ -637,59 +686,47 @@
 
     async handleSplitPackage() {
       if (this.$refs.splitFormRef) {
-        try {
-          const valid = await this.$refs.splitFormRef.validate();
-          if (!valid) return;
-          
-          this.splitLoading = true;
-          const res = await http.post('/api/OutboundBatchPicking/split-package', {
-            orderNo: this.splitForm.orderNo,
-            palletCode: this.splitForm.palletCode,
-            originalBarcode: this.splitForm.originalBarcode,
-            splitQuantity: this.splitForm.splitQuantity
-          });
-          
-          if (res.status) {
-            this.$message.success('鎷嗗寘鎴愬姛');
-            this.showCustomSplitDialog = false;
-            await this.loadPalletData();
-          } else {
-            this.$message.error(res.message || '鎷嗗寘澶辫触');
-          }
-        } catch (error) {
-          this.$message.error('鎷嗗寘澶辫触');
-        } finally {
-          this.splitLoading = false;
-        }
-      }
-    },
-
-    // 淇: 鎾ら攢鎷嗗寘寮圭獥
-    openRevertSplitDialog() {
-      if (this.isDialogOpening) return;
-      
-      this.isDialogOpening = true;
-      
-      try {
-        this.closeAllDialogs();
-        
-        this.$nextTick(() => {
-          this.showRevertSplitDialog = true;
-          this.revertSplitForm.newBarcode = '';
-          this.$nextTick(() => {
-            const input = document.querySelector('#revertSplitBarcode');
-            if (input) {
-              input.focus();
+        this.$refs.splitFormRef.validate(async (valid) => {
+          if (valid) {
+            this.splitLoading = true;
+            try {
+              const res = await http.post('/api/OutboundBatchPicking/split-package', {
+                orderNo: this.splitForm.orderNo,
+                palletCode: this.splitForm.palletCode,
+                originalBarcode: this.splitForm.originalBarcode,
+                splitQuantity: this.splitForm.splitQuantity
+              });
+              if (res.status) {
+                this.$message.success('鎷嗗寘鎴愬姛');
+                this.closeAllDialogs();
+                await this.loadPalletData();
+              } else {
+                this.$message.error(res.message || '鎷嗗寘澶辫触');
+              }
+            } catch (error) {
+              this.$message.error('鎷嗗寘澶辫触');
+            } finally {
+              this.splitLoading = false;
             }
-            this.isDialogOpening = false;
-          });
+          }
         });
-      } catch (error) {
-        console.error('鎵撳紑鎾ら攢鎷嗗寘寮圭獥澶辫触:', error);
-        this.isDialogOpening = false;
       }
     },
 
+    async viewSplitChainFromSplit(barcode) {
+      if (!barcode) {
+        this.$message.warning('璇峰厛杈撳叆鏉$爜');
+        return;
+      }
+      
+      this.closeAllDialogs();
+      
+      setTimeout(() => {
+        this.viewSplitChain(barcode);
+      }, 50);
+    },
+
+    // 鎾ら攢鎷嗗寘
     async onRevertSplitBarcodeScan() {
       if (!this.revertSplitForm.newBarcode) return;
       this.revertSplitForm.newBarcode = this.revertSplitForm.newBarcode.replace(/\n/g, '').trim();
@@ -697,41 +734,59 @@
 
     async handleRevertSplit() {
       if (this.$refs.revertSplitFormRef) {
-        try {
-          const valid = await this.$refs.revertSplitFormRef.validate();
-          if (!valid) return;
-          
-          this.revertSplitLoading = true;
-          const res = await http.post('/api/OutboundBatchPicking/cancel-split', {
-            orderNo: this.scanData.orderNo,
-            palletCode: this.scanData.palletCode,
-            newBarcode: this.revertSplitForm.newBarcode
-          });
-          
-          if (res.status) {
-            this.$message.success('鎾ら攢鎷嗗寘鎴愬姛');
-            this.showRevertSplitDialog = false;
-            await this.loadPalletData();
-          } else {
-            this.$message.error(res.message || '鎾ら攢鎷嗗寘澶辫触');
+        this.$refs.revertSplitFormRef.validate(async (valid) => {
+          if (valid) {
+            this.revertSplitLoading = true;
+            try {
+              const res = await http.post('/api/OutboundBatchPicking/cancel-split', {
+                orderNo: this.scanData.orderNo,
+                palletCode: this.scanData.palletCode,
+                newBarcode: this.revertSplitForm.newBarcode
+              });
+              if (res.status) {
+                this.$message.success('鎾ら攢鎷嗗寘鎴愬姛');
+                this.closeAllDialogs();
+                await this.loadPalletData();
+              } else {
+                this.$message.error(res.message || '鎾ら攢鎷嗗寘澶辫触');
+              }
+            } catch (error) {
+              this.$message.error('鎾ら攢鎷嗗寘澶辫触');
+            } finally {
+              this.revertSplitLoading = false;
+            }
           }
-        } catch (error) {
-          this.$message.error('鎾ら攢鎷嗗寘澶辫触');
-        } finally {
-          this.revertSplitLoading = false;
-        }
+        });
       }
     },
 
-    // 淇: 鏌ョ湅鎷嗗寘閾�
+    async findRootChain(currentBarcode) {
+      this.splitChainLoading = true;
+      try {
+        const res = await http.post('/api/OutboundBatchPicking/find-root-split-chain', {
+          orderNo: this.scanData.orderNo,
+          barcode: currentBarcode
+        });
+        
+        if (res.status) {
+          this.splitChainInfo = res.data;
+          this.$message.success('宸插姞杞藉畬鏁存媶鍖呴摼');
+        } else {
+          this.$message.error(res.message || '鏌ユ壘瀹屾暣鎷嗗寘閾惧け璐�');
+        }
+      } catch (error) {
+        this.$message.error('鏌ユ壘瀹屾暣鎷嗗寘閾惧け璐�');
+      } finally {
+        this.splitChainLoading = false;
+      }
+    },
+
+    // 鏌ョ湅鎷嗗寘閾句俊鎭�
     async viewSplitChain(barcode) {
       if (!barcode) {
         this.$message.warning('璇峰厛杈撳叆鏉$爜');
         return;
       }
-      
-      if (this.isDialogOpening) return;
-      this.isDialogOpening = true;
       
       this.splitChainLoading = true;
       try {
@@ -742,35 +797,28 @@
         
         if (res.status) {
           this.splitChainInfo = res.data;
-          
-          // 鍏抽棴鍏朵粬寮圭獥
-          this.closeAllDialogs();
-          
-          await this.$nextTick(() => {
-            this.showSplitChainDialog = true;
-            this.isDialogOpening = false;
-          });
+          this.activeDialog = 'splitChain';
         } else {
           this.$message.error(res.message || '鑾峰彇鎷嗗寘閾句俊鎭け璐�');
-          this.isDialogOpening = false;
         }
       } catch (error) {
         this.$message.error('鑾峰彇鎷嗗寘閾句俊鎭け璐�');
-        this.isDialogOpening = false;
       } finally {
         this.splitChainLoading = false;
       }
     },
 
-    // 淇: 鍏抽棴鎷嗗寘閾句俊鎭脊绐�
-    closeSplitChainDialog() {
+    // 鍏抽棴鎷嗗寘閾句俊鎭脊绐�
+     closeSplitChainDialog() {
       this.showSplitChainDialog = false;
     },
 
-    // 淇: 鍙栨秷鍗曚釜鎷嗗寘璁板綍
+    // 鍙栨秷鍗曚釜鎷嗗寘璁板綍
     async cancelSingleSplit(newBarcode) {
+      const originalBarcode = this.splitChainInfo.originalBarcode;
+      
       try {
-        await ElMessageBox.confirm(
+        await this.$confirm(
           `纭畾瑕佸彇娑堟潯鐮� ${newBarcode} 鐨勬媶鍖呮搷浣滃悧锛焋, 
           '鍙栨秷鍗曚釜鎷嗗寘', 
           {
@@ -791,11 +839,10 @@
         if (res.status) {
           this.$message.success('鍙栨秷鎷嗗寘鎴愬姛');
           await this.loadPalletData();
-          
-          // 閲嶆柊鍔犺浇鎷嗗寘閾句俊鎭�
-          if (this.splitChainInfo.originalBarcode) {
-            await this.viewSplitChain(this.splitChainInfo.originalBarcode);
-          }
+          this.closeAllDialogs();
+          setTimeout(() => {
+            this.viewSplitChain(originalBarcode);
+          }, 50);
         } else {
           this.$message.error(res.message || '鍙栨秷鎷嗗寘澶辫触');
         }
@@ -808,16 +855,18 @@
       }
     },
 
-    // 淇: 鍙栨秷鏁翠釜鎷嗗寘閾�  
+    // 鍙栨秷鏁翠釜鎷嗗寘閾�  
     async cancelWholeSplitChain() {
       try {
-        await ElMessageBox.confirm(
+        await this.$confirm(
           `纭畾瑕佸彇娑堟暣涓媶鍖呴摼鍚楋紵\n杩欏皢鍙栨秷浠庢潯鐮� ${this.splitChainInfo.originalBarcode} 寮�濮嬬殑鎵�鏈夋媶鍖呮搷浣溿�俙, 
           '鍙栨秷鎷嗗寘閾剧‘璁�', 
           {
             confirmButtonText: '纭畾鍙栨秷',
             cancelButtonText: '鍐嶆兂鎯�',
-            type: 'warning'
+            type: 'warning',
+            center: true,
+            closeOnClickModal: false
           }
         );
         
@@ -831,14 +880,14 @@
         
         if (res.status) {
           this.$message.success('鍙栨秷鎷嗗寘閾炬垚鍔�');
-          this.closeSplitChainDialog();
+          this.closeAllDialogs();
           await this.loadPalletData();
         } else {
           this.$message.error(res.message || '鍙栨秷鎷嗗寘閾惧け璐�');
         }
       } catch (error) {
         if (error !== 'cancel') {
-          this.$message.error('鍙栨秷鎷嗗寘閾惧け璐�');
+          this.$message.error('鍙栨秷鎷嗗寘閾惧け璐�: ' + error.message);
         }
       } finally {
         this.revertSplitLoading = false;
@@ -857,13 +906,15 @@
       return `${date.getFullYear()}-${(date.getMonth() + 1).toString().padStart(2, '0')}-${date.getDate().toString().padStart(2, '0')} ${date.getHours().toString().padStart(2, '0')}:${date.getMinutes().toString().padStart(2, '0')}:${date.getSeconds().toString().padStart(2, '0')}`;
     },
 
-    // 淇: 鏂板鍏抽棴鎵�鏈夊脊绐楃殑鏂规硶
+    // 鍏抽敭淇锛氭柊澧炲叧闂墍鏈夊脊绐楃殑鏂规硶
     closeAllDialogs() {
+      this.activeDialog = null;
+      // 纭繚鎵�鏈夊脊绐楃姸鎬侀兘琚噸缃�
       this.showCustomSplitDialog = false;
       this.showRevertSplitDialog = false;
-      this.showSplitChainDialog = false;
       this.showBatchReturnDialog = false;
       this.showEmptyPalletDialog = false;
+      this.showSplitChainDialog = false;
     },
 
     // 鍥炲簱鐩稿叧鏂规硶
@@ -873,15 +924,25 @@
         return;
       }
       
-      this.closeAllDialogs();
+      if (this.isOpeningDialog) return;
       
-      this.$nextTick(() => {
-        this.showBatchReturnDialog = true;
-        this.batchReturnForm.orderNo = this.scanData.orderNo;
-        this.batchReturnForm.palletCode = this.scanData.palletCode;
-        this.batchReturnForm.unpickedCount = this.summary.unpickedCount;
-        this.batchReturnForm.unpickedQuantity = this.summary.unpickedQuantity;
-      });
+      this.isOpeningDialog = true;
+      
+      setTimeout(() => {
+        this.closeAllDialogsImmediately();
+        
+        requestAnimationFrame(() => {
+          this.showBatchReturnDialog = true;
+          this.batchReturnForm.orderNo = this.scanData.orderNo;
+          this.batchReturnForm.palletCode = this.scanData.palletCode;
+          this.batchReturnForm.unpickedCount = this.summary.unpickedCount;
+          this.batchReturnForm.unpickedQuantity = this.summary.unpickedQuantity;
+          
+          this.$nextTick(() => {
+            this.isOpeningDialog = false;
+          });
+        });
+      }, 0);
     },
 
     async handleBatchReturnConfirm() {
@@ -893,7 +954,7 @@
         });
         if (res.status) {
           this.$message.success('鍥炲簱鎴愬姛');
-          this.showBatchReturnDialog = false;
+          this.closeAllDialogs();
           await this.loadPalletData();
         } else {
           this.$message.error(res.message || '鍥炲簱澶辫触');
@@ -906,14 +967,24 @@
     },
 
     // 鍙栫┖绠辨柟娉�
-    handleEmptyPallet() {
-      this.closeAllDialogs();
+handleEmptyPallet() {
+      if (this.isOpeningDialog) return;
       
-      this.$nextTick(() => {
-        this.showEmptyPalletDialog = true;
-        this.emptypalletOutForm.orderNo = this.scanData.orderNo;
-        this.emptypalletOutForm.palletCode = '';
-      });
+      this.isOpeningDialog = true;
+      
+      setTimeout(() => {
+        this.closeAllDialogsImmediately();
+        
+        requestAnimationFrame(() => {
+          this.showEmptyPalletDialog = true;
+          this.emptypalletOutForm.orderNo = this.scanData.orderNo;
+          this.emptypalletOutForm.palletCode = '';
+          
+          this.$nextTick(() => {
+            this.isOpeningDialog = false;
+          });
+        });
+      }, 0);
     },
 
     async handleEmptyPalletConfirm() {
@@ -925,7 +996,7 @@
         });
         if (res.status) {
           this.$message.success('鍙栬蛋绌虹鎴愬姛');
-          this.showEmptyPalletDialog = false;
+          this.closeAllDialogs();
           await this.loadPalletData();
         } else {
           this.$message.error(res.message || '鍙栬蛋绌虹澶辫触');
@@ -942,11 +1013,9 @@
       if (!this.scanData.orderNo || !this.scanData.palletCode) return;
       
       try {
-        await Promise.all([
-          this.loadUnpickedList(),
-          this.loadPickedList(),
-          this.loadPalletStatus()
-        ]);
+        await this.loadUnpickedList();
+        await this.loadPickedList();
+        await this.loadPalletStatus();
       } catch (error) {
         console.error('鍔犺浇鎵樼洏鏁版嵁澶辫触:', error);
       }
@@ -964,7 +1033,6 @@
           this.summary.unpickedQuantity = this.unpickedList.reduce((sum, item) => sum + (item.remainQuantity || 0), 0);
         }
       } catch (error) {
-        console.error('鍔犺浇鏈嫞閫夊垪琛ㄥけ璐�:', error);
         this.$message.error('鍔犺浇鏈嫞閫夊垪琛ㄥけ璐�');
       }
     },
@@ -983,7 +1051,6 @@
           this.summary.pickedCount = this.pickedList.length;
         }
       } catch (error) {
-        console.error('鍔犺浇宸叉嫞閫夊垪琛ㄥけ璐�:', error);
         this.$message.error('鍔犺浇宸叉嫞閫夊垪琛ㄥけ璐�');
       }
     },
@@ -998,7 +1065,6 @@
           this.palletStatus = res.data.statusText || '鏈煡';
         }
       } catch (error) {
-        console.error('鍔犺浇鎵樼洏鐘舵�佸け璐�:', error);
         this.palletStatus = '鏈煡';
       }
     },
@@ -1043,39 +1109,33 @@
         return;
       }
 
-      try {
-        await ElMessageBox.confirm(
-          `纭畾瑕佸彇娑堥�変腑鐨� ${this.selectedPickedRows.length} 椤瑰悧锛焋, 
-          '鎻愮ず', 
-          {
-            confirmButtonText: '纭畾',
-            cancelButtonText: '鍙栨秷',
-            type: 'warning'
-          }
-        );
-        
-        for (const row of this.selectedPickedRows) {
-          try {
-            const res = await http.post('/api/OutboundBatchPicking/cancel-picking', {
-              orderNo: this.scanData.orderNo,
-              palletCode: this.scanData.palletCode,
-              barcode: row.currentBarcode
-            });
-            if (!res.status) {
-              this.$message.warning(`鍙栨秷鎷i�夊け璐�: ${row.currentBarcode} - ${res.message}`);
+      this.$confirm(`纭畾瑕佸彇娑堥�変腑鐨� ${this.selectedPickedRows.length} 椤瑰悧锛焋, '鎻愮ず', {
+        confirmButtonText: '纭畾',
+        cancelButtonText: '鍙栨秷',
+        type: 'warning'
+      }).then(async () => {
+        try {
+          for (const row of this.selectedPickedRows) {
+            try {
+              const res = await http.post('/api/OutboundBatchPicking/cancel-picking', {
+                orderNo: this.scanData.orderNo,
+                palletCode: this.scanData.palletCode,
+                barcode: row.currentBarcode
+              });
+              if (!res.status) {
+                this.$message.warning(`鍙栨秷鎷i�夊け璐�: ${row.currentBarcode} - ${res.message}`);
+              }
+            } catch (error) {
+              this.$message.warning(`鍙栨秷鎷i�夊け璐�: ${row.currentBarcode} - ${error.message}`);
             }
-          } catch (error) {
-            this.$message.warning(`鍙栨秷鎷i�夊け璐�: ${row.currentBarcode} - ${error.message}`);
-          }
-        }        
-        this.$message.success('鎵归噺鍙栨秷瀹屾垚');
-        await this.loadPalletData();
-        this.selectedPickedRows = [];
-      } catch (error) {
-        if (error !== 'cancel') {
+          }        
+          this.$message.success('鎵归噺鍙栨秷瀹屾垚');
+          await this.loadPalletData();
+          this.selectedPickedRows = [];
+        } catch (error) {
           this.$message.error('鎵归噺鍙栨秷鎿嶄綔澶辫触');
         }
-      }
+      });
     },
 
     // 閲嶇疆鏂规硶
@@ -1091,12 +1151,31 @@
       this.resetSplitForm();
     },
 
-    closeRevertSplitDialog() {
+openRevertSplitDialog() {
+      if (this.isOpeningDialog) return;
+      
+      this.isOpeningDialog = true;
+      
+      setTimeout(() => {
+        this.closeAllDialogsImmediately();
+        
+        requestAnimationFrame(() => {
+          this.showRevertSplitDialog = true;
+          this.revertSplitForm.newBarcode = '';
+          
+          this.$nextTick(() => {
+            this.isOpeningDialog = false;
+          });
+        });
+      }, 0);
+    },
+
+  closeRevertSplitDialog() {
       this.showRevertSplitDialog = false;
       this.revertSplitForm.newBarcode = '';
     },
 
-    closeBatchReturnDialog() {
+ closeBatchReturnDialog() {
       this.showBatchReturnDialog = false;
     },
 
@@ -1105,7 +1184,7 @@
       this.emptypalletOutForm.palletCode = this.emptypalletOutForm.palletCode.replace(/\n/g, '').trim();
     },
 
-    closeEmptyPalletDialog() {
+     closeEmptyPalletDialog() {
       this.showEmptyPalletDialog = false;
       this.emptypalletOutForm.palletCode = '';
     },
@@ -1152,7 +1231,7 @@
   color: #909399;
 }
 
-/* 鑷畾涔夊脊绐楁牱寮� - 鍏抽敭淇: 绉婚櫎鍙兘瀵艰嚧鍐茬獊鐨剒-index瑙勫垯 */
+/* 鑷畾涔夊脊绐楁牱寮� - 鍏抽敭淇 */
 .custom-dialog-overlay {
   position: fixed;
   top: 0;
@@ -1163,11 +1242,12 @@
   display: flex;
   align-items: center;
   justify-content: center;
-  /* 绉婚櫎杩欓噷鐨剒-index锛屽湪妯℃澘涓崟鐙缃� */
+  z-index: 9999; /* 鎻愰珮z-index纭繚鍦ㄦ渶涓婂眰 */
 }
 
 .custom-dialog-wrapper {
   position: relative;
+  z-index: 10000;
 }
 
 .custom-dialog {

--
Gitblit v1.9.3