From 696edbff3c8812e4b820f624d66a02ae6ddb1a06 Mon Sep 17 00:00:00 2001
From: 647556386 <647556386@qq.com>
Date: 星期四, 16 四月 2026 13:40:18 +0800
Subject: [PATCH] Merge branch 'htq20251215' of http://115.159.85.185:8098/r/ZhongRui/ALDbanyunxiangmu into htq20251215

---
 项目代码/WIDESEA_WMSClient/src/views/outbound/outPicking.vue |   77 +++++++++++++++++++++++++++++++++-----
 1 files changed, 66 insertions(+), 11 deletions(-)

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 49b205f..2ce2088 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"
@@ -214,6 +214,19 @@
                             <el-table-column prop="createDate" label="鎷i�夋椂闂�" width="160" />
                             <el-table-column prop="originalBarcode" label="鍘熺墿鏂欑爜" width="160" />
                             <el-table-column prop="newBarcode" label="鏂扮墿鏂欑爜" width="160" />
+                            <el-table-column label="鎿嶄綔" width="100" align="center">
+                        <template #default="scope">
+                            <el-button 
+                                type="danger" 
+                                size="small" 
+                                icon="el-icon-refresh-left"
+                                @click="handleReversePicking(scope.row)"
+                                :disabled="reverseLoading"
+                            >
+                                鎾ら攢
+                            </el-button>
+                        </template>
+                    </el-table-column>
                         </el-table>
 
                         <div class="table-footer">
@@ -376,7 +389,8 @@
             loadingInstance: null,
             // 闊抽瀹炰緥锛堢紦瀛橈紝閬垮厤閲嶅鍒涘缓锛�
             successAudio: null,
-            errorAudio: null
+            errorAudio: null,
+            reverseLoading: false
         }
     },
     computed: {
@@ -412,7 +426,6 @@
             }
         },
 
-        // ============== 鏂板锛氭牴鎹墭鐩樺彿鑾峰彇璁㈠崟鍙凤紙鏍稿績鍔熻兘锛� ==============
         async getOrderNoByPallet(palletCode) {
             if (!palletCode) {
                 this.$message.warning('鎵樼洏鍙蜂笉鑳戒负绌�');
@@ -457,7 +470,7 @@
                 this.hideFullScreenLoading();
             }
         },
-        // ============== 鏂板缁撴潫 ==============
+        
 
         // 鎾斁鎴愬姛闊抽
         playSuccessAudio() {
@@ -485,14 +498,7 @@
         initPage() {
             // 浠庤矾鐢卞弬鏁拌幏鍙栬鍗曞彿
             this.orderNo = this.$route.query.orderNo || ''
-            // ============== 寰皟锛氭敞閲婂己鍒惰繑鍥為�昏緫锛屽吋瀹规墭鐩樺彿鏌ヨ鍗曞彿 ==============
-            // if (!this.orderNo) {
-            //     this.$message.error('璁㈠崟鍙蜂笉鑳戒负绌�')
-            //     this.$router.back()
-            //     return
-            // }
-            // ============== 寰皟缁撴潫 ==============
-
+            
             // 鍔犺浇璁㈠崟淇℃伅
             this.loadOrderInfo()
 
@@ -694,6 +700,55 @@
             });
         },
 
+        async handleReversePicking(row) {
+            // 1. 浜屾纭
+            try {
+                await this.$confirm(
+                    '纭畾瑕佹挙閿�杩欐潯鎷i�夎褰曞悧锛熸挙閿�鍚庡簱瀛樺皢鎭㈠锛屽嚭搴撳崟鐘舵�佷篃浼氬悓姝ユ洿鏂�', 
+                    '鎾ら攢纭', 
+                    {
+                        type: 'warning',
+                        confirmButtonText: '纭鎾ら攢',
+                        cancelButtonText: '鍙栨秷',
+                        closeOnClickModal: false
+                    }
+                );
+
+                // 2. 鎵ц鎾ら攢
+                this.reverseLoading = true;
+                this.showFullScreenLoading();
+
+                // 3. 璋冪敤鎾ら攢鎺ュ彛锛堥�傞厤浣犲悗绔殑鎾ら攢鎺ュ彛鍦板潃锛�
+                const response = await this.http.post('/api/Outbound/ReversePickingWithBarcode', {
+                    Barcode: row.originalBarcode || row.newBarcode, // 浼樺厛鍙栧師鏉$爜锛屾棤鍒欏彇鏂版潯鐮�
+                    OrderNo: this.orderNo,
+                    PalletCode: row.palletCode || this.scanForm.palletCode,
+                    Operator: this.getUserName(),
+                    OrderType: this.orderInfo?.orderType || 0 // 璁㈠崟绫诲瀷锛屾棤鍒欎紶0
+                });
+
+                // 4. 澶勭悊缁撴灉
+                if (response.status) {
+                    this.$message.success('鎾ら攢鎷i�夋垚鍔�');
+                    this.playSuccessAudio(); // 鎾斁鎴愬姛闊抽
+                    // 鍒锋柊鏁版嵁鍒楄〃
+                    await this.loadPalletData(false);
+                } else {
+                    this.$message.error(response.message || '鎾ら攢鎷i�夊け璐�');
+                    this.playErrorAudio();
+                }
+            } catch (error) {
+                // 鍙栨秷纭涓嶆姤閿�
+                if (error !== 'cancel') {
+                    this.$message.error('鎾ら攢鎷i�夊け璐ワ細' + (error.message || '缃戠粶寮傚父'));
+                    this.playErrorAudio();
+                }
+            } finally {
+                this.reverseLoading = false;
+                this.hideFullScreenLoading();
+            }
+        },
+
         handleMaterialScan() {
             if (!this.scanForm.palletCode) {
                 this.$message.warning('璇峰厛鎵弿鎵樼洏鐮�')

--
Gitblit v1.9.3