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 |  102 ++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 89 insertions(+), 13 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 14cef75..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"
@@ -9,6 +9,8 @@
                     <i class="el-icon-document"></i>
                     <span class="order-label">璁㈠崟鍙凤細</span>
                     <span class="order-value">{{ orderNo }}</span>
+                    <span class="order-label" style="margin-left: 20px;">浜х嚎鍚嶇О锛�</span>
+                    <span class="order-value">{{ orderInfo?.departmentName || '' }}</span>
                 </div>
                 <div class="order-status">
                     <el-tag v-if="orderInfo" :type="getStatusType(orderInfo.orderStatus)" size="medium"
@@ -212,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">
@@ -374,7 +389,8 @@
             loadingInstance: null,
             // 闊抽瀹炰緥锛堢紦瀛橈紝閬垮厤閲嶅鍒涘缓锛�
             successAudio: null,
-            errorAudio: null
+            errorAudio: null,
+            reverseLoading: false
         }
     },
     computed: {
@@ -410,7 +426,6 @@
             }
         },
 
-        // ============== 鏂板锛氭牴鎹墭鐩樺彿鑾峰彇璁㈠崟鍙凤紙鏍稿績鍔熻兘锛� ==============
         async getOrderNoByPallet(palletCode) {
             if (!palletCode) {
                 this.$message.warning('鎵樼洏鍙蜂笉鑳戒负绌�');
@@ -431,6 +446,12 @@
                     this.playErrorAudio();
                     const errorMsg = response.message || '璇ユ墭鐩樺彿鏈叧鑱斾换浣曡鍗�';
                     this.$message.error(errorMsg);
+                    this.$nextTick(() => {
+                if (this.$refs.palletInput) {
+                    this.$refs.palletInput.focus();
+                    this.$refs.palletInput.select(); // 閫変腑鍏ㄩ儴鍐呭
+                }
+            });
                     return null;
                 }
             } catch (error) {
@@ -438,12 +459,18 @@
                 const errorMsg = `鑾峰彇璁㈠崟鍙峰紓甯革細${error.message || '缃戠粶閿欒'}`;
                 this.$message.error(errorMsg);
                 console.error("銆愭墭鐩樺彿鏌ヨ鍗曞彿鎺ュ彛寮傚父銆�", error);
+                this.$nextTick(() => {
+                if (this.$refs.palletInput) {
+                    this.$refs.palletInput.focus();
+                    this.$refs.palletInput.select(); // 閫変腑鍏ㄩ儴鍐呭
+                }
+            });
                 return null;
             } finally {
                 this.hideFullScreenLoading();
             }
         },
-        // ============== 鏂板缁撴潫 ==============
+        
 
         // 鎾斁鎴愬姛闊抽
         playSuccessAudio() {
@@ -471,14 +498,7 @@
         initPage() {
             // 浠庤矾鐢卞弬鏁拌幏鍙栬鍗曞彿
             this.orderNo = this.$route.query.orderNo || ''
-            // ============== 寰皟锛氭敞閲婂己鍒惰繑鍥為�昏緫锛屽吋瀹规墭鐩樺彿鏌ヨ鍗曞彿 ==============
-            // if (!this.orderNo) {
-            //     this.$message.error('璁㈠崟鍙蜂笉鑳戒负绌�')
-            //     this.$router.back()
-            //     return
-            // }
-            // ============== 寰皟缁撴潫 ==============
-
+            
             // 鍔犺浇璁㈠崟淇℃伅
             this.loadOrderInfo()
 
@@ -656,12 +676,18 @@
             this.pickedTotal = this.pickedCount
         },
 
-        // ============== 寰皟锛氭柊澧炶幏鍙栬鍗曞彿閫昏緫锛屽叾浣欎笉鍙� ==============
         handlePalletScan(flag = true) {
             const palletCode = this.scanForm.palletCode.trim();
             if (!palletCode) {
                 return;
             }
+
+            this.$nextTick(() => {
+        if (this.$refs.palletInput) {
+            this.$refs.palletInput.focus();
+            this.$refs.palletInput.select(); // 閫変腑鍏ㄩ儴鍐呭
+        }
+    });
             // 鍏堟牴鎹墭鐩樺彿鑾峰彇璁㈠崟鍙�
             this.getOrderNoByPallet(palletCode).then((orderNo) => {
                 if (orderNo) {
@@ -673,7 +699,55 @@
                 this.loadPalletData(flag);
             });
         },
-        // ============== 寰皟缁撴潫 ==============
+
+        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) {
@@ -718,10 +792,12 @@
                     await this.loadPalletData(false)
                 } else {
                     this.$message.error(response.message || '鎷i�夌‘璁ゅけ璐�')
+                    this.scanForm.materialBarcode = '';
                     this.playErrorAudio()
                 }
             } catch (error) {
                 this.$message.error('鎷i�夌‘璁ゅけ璐�')
+                this.scanForm.materialBarcode = '';
                 this.playErrorAudio()
             } finally {
                 this.confirmLoading = false

--
Gitblit v1.9.3