From cf83e0828b286b61b69a15005e6247d8b03f4cd8 Mon Sep 17 00:00:00 2001
From: pan <antony1029@163.com>
Date: 星期日, 16 十一月 2025 19:14:03 +0800
Subject: [PATCH] Merge branch 'master' of http://115.159.85.185:8098/r/ZhongRui/ALDbanyunxiangmu

---
 项目代码/WIDESEA_WMSClient/src/views/outbound/PickingConfirm.vue | 1458 +++++++++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 1,180 insertions(+), 278 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/outbound/PickingConfirm.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/outbound/PickingConfirm.vue"
index d9f3d25..a1be799 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/outbound/PickingConfirm.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/outbound/PickingConfirm.vue"
@@ -1,5 +1,5 @@
 <template>
-  <div class="picking-confirm">
+  <div class="OutboundPicking-container">
     <div class="page-header">
       <el-page-header @back="goBack">
         <template #content>
@@ -7,90 +7,288 @@
         </template>
       </el-page-header>
     </div>
+    <!-- 鎵爜鍖哄煙 -->
+    <div class="scanner-area">
+      <el-card>
+        <div class="scanner-form">
+          <el-input 
+            ref="palletInput"
+            v-model="scanData.palletCode" 
+            placeholder="鎵弿鎵樼洏鐮�" 
+            @change="onPalletScan"
+            @keyup.enter.native="onPalletScan">
+          </el-input>
+          <el-input 
+           ref="barcodeInput"
+            v-model="scanData.barcode" 
+            placeholder="鎵弿鐗╂枡鏉$爜" 
+            @change="onBarcodeScan"
+            @keyup.enter.native="onBarcodeScan">
+          </el-input>
+          <el-button type="success" @click="confirmPicking">纭鎷i��</el-button>
+          <el-button type="warning" @click="openSplitDialog">鎷嗗寘</el-button>
+          <el-button type="info" @click="openRevertSplitDialog">鎾ら攢鎷嗗寘</el-button>
+      
+          <el-button type="primary" @click="openBatchReturnDialog">鍥炲簱</el-button>
+          <el-button type="danger" @click="handleDirectOutbound">鐩存帴鍑哄簱</el-button> 
+
+        </div>
+      </el-card>
+    </div>
+
+    <!-- 姹囨�讳俊鎭� -->
+    <div class="summary-area">
+      <el-card>
+        <div class="summary-info">
+          <el-tag type="warning">鏈嫞閫夋潯鏁�: {{summary.unpickedCount}}</el-tag>
+          <el-tag type="danger">鏈嫞閫夋暟閲�: {{summary.unpickedQuantity}}</el-tag>
+          <el-tag type="success">宸叉嫞閫夋潯鏁�: {{summary.pickedCount}}</el-tag>
+          <el-tag type="info">鎵樼洏鐘舵��: {{palletStatus}}</el-tag>
+        </div>
+      </el-card>
+    </div>
+
+    <!-- 鏁版嵁鍒楄〃 -->
+    <div class="content-area">
+      <el-row :gutter="20">
+        <el-col :span="12">
+          <el-card header="鏈嫞閫夊垪琛�">
+            <el-table :data="unpickedList" border height="440">
+              <el-table-column prop="materielCode" label="鐗╂枡缂栫爜" width="120"></el-table-column>
     
-    <div class="content-layout">
-      <!-- 宸︿晶锛氭壂鐮佸尯鍩� -->
-      <div class="left-section">
-        <div class="scan-section">
-          <el-alert
-            title="璇蜂娇鐢ㄦ壂鐮佹灙鎵弿鎵樼洏鐮佸拰鐗╂枡鏉$爜锛屾壂鐮佹灙甯﹀洖杞﹀姛鑳斤紝鎵畬鐗╂枡鏉$爜鑷姩纭"
-            type="info"
-            :closable="false"
-            class="scan-alert"
-          />
+              <el-table-column prop="assignQuantity" label="鍒嗛厤鏁伴噺" width="100"></el-table-column>
+              <el-table-column prop="remainQuantity" label="鍓╀綑鏁伴噺" width="100"></el-table-column>
+              <el-table-column prop="locationCode" label="璐т綅" width="100"></el-table-column>
+              <el-table-column prop="currentBarcode" label="鏉$爜"></el-table-column>
+             <!--  <el-table-column label="鎿嶄綔" width="100">
+                <template slot-scope="scope">
+                  <el-button 
+                    size="mini" 
+                    type="primary" 
+                    @click="handleSingleReturn(scope.row)">
+                    鍥炲簱
+                  </el-button>
+                </template>
+              </el-table-column> -->
+            </el-table>
+          </el-card>
+        </el-col>
+        
+        <el-col :span="12">
+          <el-card header="宸叉嫞閫夊垪琛�">
+             <div class="table-actions">
+              <el-button 
+                size="mini" 
+                type="danger" 
+                :disabled="selectedPickedRows.length === 0"
+                @click="batchCancelSelected">
+                鍙栨秷鎷i��
+              </el-button>
+              <span class="selection-count">宸查�夋嫨 {{selectedPickedRows.length}} 椤�</span>
+            </div>
+            <el-table :data="pickedList" border height="400"  style="width: 100%"    @selection-change="handlePickedSelectionChange"> 
+              <el-table-column type="selection" width="55"></el-table-column>
+              <el-table-column prop="materielCode" label="鐗╂枡缂栫爜" width="120"></el-table-column>
+     
+              <el-table-column prop="pickedQty" label="宸叉嫞鏁伴噺" width="100"></el-table-column>
+              <el-table-column prop="locationCode" label="璐т綅" width="100"></el-table-column>
+              <el-table-column prop="currentBarcode" label="鏉$爜"></el-table-column>
+            
 
-          <el-form :model="scanForm" label-width="100px" class="scan-form">
-            <el-form-item label="鎵樼洏鐮�" required>
-              <el-input
-                ref="palletInput"
-                v-model="scanForm.palletCode"
-                placeholder="璇锋壂鎻忔墭鐩樼爜"
-                @keyup.enter="handlePalletScan"
-                @blur="loadPalletSummary"
-                clearable
-              />
-            </el-form-item>
+            </el-table>
+          </el-card>
+        </el-col>
+      </el-row>
+    </div>
 
-            <el-form-item label="鐗╂枡鏉$爜" required>
-              <el-input
-                ref="materialInput"
-                v-model="scanForm.materialBarcode"
-                placeholder="璇锋壂鎻忕墿鏂欐潯鐮�"
-                :disabled="!scanForm.palletCode"
-                @keyup.enter="handleMaterialScan"
-                clearable
-              />
-            </el-form-item>
-          </el-form>
+    <!-- 鎷嗗寘寮圭獥 -->
+<!-- 鎷嗗寘寮圭獥 -->
+     <div v-if="showCustomSplitDialog" class="custom-dialog-overlay">
+      <div class="custom-dialog-wrapper">
+        <div class="custom-dialog">
+          <div class="custom-dialog-header">
+            <h3>鎷嗗寘鎿嶄綔</h3>
+             <!--   <el-button 
+              type="text" 
+              icon="el-icon-close" 
+              @click="closeCustomSplitDialog"
+              class="close-button">
+            </el-button> -->
+                  <el-button 
+              type="text" 
+              @click="closeCustomSplitDialog"
+              class="close-button">
+              X
+            </el-button> 
 
-          <!-- 鎵樼洏鎷h揣缁熻 -->
-          <div v-if="palletSummary" class="pallet-summary">
-            <el-card header="鎵樼洏鎷h揣缁熻">
-              <el-descriptions :column="3" border>
-                <el-descriptions-item label="鎵樼洏鍙�">
-                  {{ scanForm.palletCode }}
-                </el-descriptions-item>
-                <el-descriptions-item label="鏈嫞璐ф潯鏁�">
-                  <el-text type="warning">{{ palletSummary.unpickedCount }}</el-text>
-                </el-descriptions-item>
-                <el-descriptions-item label="鏈嫞璐ф�绘暟">
-                  <el-text type="danger">{{ palletSummary.unpickedTotal }}</el-text>
-                </el-descriptions-item>
-              </el-descriptions>
-            </el-card>
           </div>
-
-          <div class="action-buttons">
-            <el-button type="primary" @click="handleConfirm" :loading="confirmLoading">
-              鎵嬪姩纭
-            </el-button>
-            <el-button @click="handleReset">閲嶇疆</el-button>
-            <el-button @click="$emit('close')">鍙栨秷</el-button>
+          <div class="custom-dialog-body">
+            <el-form :model="splitForm"  :rules="splitFormRules" ref="splitFormRef" label-width="100px">
+              <el-form-item label="璁㈠崟缂栧彿">
+                <el-input v-model="splitForm.orderNo" disabled></el-input>
+              </el-form-item>
+              <el-form-item label="鎵樼洏缂栧彿">
+                <el-input v-model="splitForm.palletCode" disabled></el-input>
+              </el-form-item>
+              <el-form-item label="鍘熸潯鐮�"  prop="originalBarcode">
+                <el-input 
+                  v-model="splitForm.originalBarcode" 
+                  placeholder="鎵弿鍘熸潯鐮�"
+                  @keyup.enter.native="onSplitBarcodeScan"
+                  @change="onSplitBarcodeScan"
+                  clearable>
+                </el-input>
+              </el-form-item>
+              <el-form-item label="鐗╂枡缂栫爜">
+                <el-input v-model="splitForm.materielCode" disabled></el-input>
+              </el-form-item>
+              <el-form-item label="鍓╀綑鏁伴噺">
+                <el-input v-model="splitForm.maxQuantity" disabled></el-input>
+              </el-form-item>
+              <el-form-item label="鎷嗗寘鏁伴噺" prop="splitQuantity">
+                <el-input-number 
+                  v-model="splitForm.splitQuantity" 
+                  :min="1" 
+                  :max="splitForm.maxQuantity"
+                  :precision="2"
+                  :step="1"
+                  style="width: 100%">
+                </el-input-number>
+              </el-form-item>
+            </el-form>
+          </div>
+          <div class="custom-dialog-footer">
+            <el-button @click="closeCustomSplitDialog">鍙栨秷</el-button>
+            <el-button type="primary" @click="handleSplitPackage" :loading="splitLoading">纭鎷嗗寘</el-button>
           </div>
         </div>
       </div>
+    </div>
+ 
 
-      <!-- 鍙充晶锛氬嚭搴撹鎯呭垪琛� -->
-      <div class="right-section">
-        <el-card class="outbound-details-card" header="鍑哄簱璇︽儏">
-          <vol-table
-            ref="outboundTable"
-            :table-config="outboundTableConfig"
-            :height="300"
-          />
-        </el-card>
+    <!-- 鎾ら攢鎷嗗寘寮圭獥 -->
+    <div v-if="showRevertSplitDialog" class="custom-dialog-overlay">
+      <div class="custom-dialog-wrapper">
+        <div class="custom-dialog">
+          <div class="custom-dialog-header">
+            <h3>鎾ら攢鎷嗗寘</h3>
+            <el-button 
+              type="text" 
+              @click="closeRevertSplitDialog"
+              class="close-button">
+              脳
+            </el-button>
+          </div>
+          <div class="custom-dialog-body">
+            <el-form 
+              :model="revertSplitForm" 
+              :rules="revertSplitFormRules"
+              ref="revertSplitFormRef"
+              label-width="100px">
+              <el-form-item label="鍘熸潯鐮�" prop="originalBarcode">
+                <el-input 
+                  v-model="revertSplitForm.originalBarcode" 
+                  placeholder="鎵弿鍘熸潯鐮�"
+                  @keyup.enter.native="onRevertSplitBarcodeScan"
+                  @change="onRevertSplitBarcodeScan"
+                  clearable>
+                </el-input>
+              </el-form-item>
+            </el-form>
+          </div>
+          <div class="custom-dialog-footer">
+            <el-button @click="closeRevertSplitDialog">鍙栨秷</el-button>
+            <el-button type="primary" @click="handleRevertSplit" :loading="revertSplitLoading">纭鎾ら攢</el-button>
+          </div>
+        </div>
       </div>
     </div>
-
-    <!-- 宸插垎鎷h褰曞垪琛� -->
-    <div class="picked-records">
-      <el-card header="宸插垎鎷h褰�">
-        <vol-table
-          ref="pickedTable"
-          :table-config="pickedTableConfig"
-          :height="300"
-        />
-      </el-card>
+ 
+     <!-- 鎵归噺鍥炲簱寮圭獥 -->
+    <div v-if="showBatchReturnDialog" class="custom-dialog-overlay">
+      <div class="custom-dialog-wrapper">
+        <div class="custom-dialog">
+          <div class="custom-dialog-header">
+            <h3>鍥炲簱</h3>
+            <el-button 
+              type="text" 
+              @click="closeBatchReturnDialog"
+              class="close-button">
+              脳
+            </el-button>
+          </div>
+          <div class="custom-dialog-body">
+            <el-form 
+              :model="batchReturnForm" 
+              :rules="batchReturnFormRules"
+              ref="batchReturnFormRef"
+              label-width="100px">
+              <el-form-item label="璁㈠崟缂栧彿">
+                <el-input v-model="batchReturnForm.orderNo" disabled></el-input>
+              </el-form-item>
+              <el-form-item label="鎵樼洏缂栧彿" prop="palletCode">
+                <el-input 
+                  v-model="batchReturnForm.palletCode" 
+                  placeholder="鎵弿鎵樼洏鐮�"
+                  @keyup.enter.native="onBatchReturnPalletScan"
+                  @change="onBatchReturnPalletScan"
+                  clearable>
+                </el-input>
+              </el-form-item>
+              <el-form-item label="鏈嫞閫夋暟閲�">
+                <el-input v-model="batchReturnForm.unpickedCount" disabled></el-input>
+              </el-form-item>
+              <el-form-item label="鏈嫞閫夋潯鏁�">
+                <el-input v-model="batchReturnForm.unpickedQuantity" disabled></el-input>
+              </el-form-item>
+            </el-form>
+          </div>
+          <div class="custom-dialog-footer">
+            <el-button @click="closeBatchReturnDialog">鍙栨秷</el-button>
+            <el-button type="primary" @click="handleBatchReturnConfirm" :loading="batchReturnLoading">纭鍥炲簱</el-button>
+          </div>
+        </div>
+      </div>
+    </div>
+    <!-- 鐩存帴鍑哄簱寮圭獥 -->
+    <div v-if="showDirectOutDialog" class="custom-dialog-overlay">
+      <div class="custom-dialog-wrapper">
+        <div class="custom-dialog">
+          <div class="custom-dialog-header">
+            <h3>鐩存帴鍑哄簱</h3>
+            <el-button 
+              type="text" 
+              @click="closeDirectOutDialog"
+              class="close-button">
+              脳
+            </el-button>
+          </div>
+          <div class="custom-dialog-body">
+            <el-form 
+              :model="directOutForm" 
+              :rules="directOutFormRules"
+              ref="directOutFormRef"
+              label-width="100px">
+              <el-form-item label="璁㈠崟缂栧彿">
+                <el-input v-model="directOutForm.orderNo" disabled></el-input>
+              </el-form-item>
+              <el-form-item label="鎵樼洏缂栧彿" prop="palletCode">
+                <el-input 
+                  v-model="directOutForm.palletCode" 
+                  placeholder="鎵弿鎵樼洏鐮�"
+                  @keyup.enter.native="onDirectOutPalletScan"
+                  @change="onDirectOutPalletScan"
+                  clearable>
+                </el-input>
+              </el-form-item>
+            </el-form>
+          </div>
+          <div class="custom-dialog-footer">
+            <el-button @click="closeDirectOutDialog">鍙栨秷</el-button>
+            <el-button type="primary" @click="handleDirectOutConfirm" :loading="directOutLoading">纭鍑哄簱</el-button>
+          </div>
+        </div>
+      </div>
     </div>
   </div>
 </template>
@@ -98,8 +296,8 @@
 <script>
 import http from '@/api/http.js'
 import { ref, defineComponent } from "vue";
-import { ElMessage } from "element-plus";
-import { useRoute } from 'vue-router' 
+import { ElMessage } from 'element-plus' 
+import { useRoute } from 'vue-router'
 
 export default defineComponent({
   name: 'PickingConfirm',
@@ -114,264 +312,968 @@
   },
   emits: ['confirm', 'close'],
   data() {
+        // 瀹氫箟鎷嗗寘琛ㄥ崟楠岃瘉瑙勫垯
+    const validateOriginalBarcode = (rule, value, callback) => {
+      if (!value || value.trim() === '') {
+        callback(new Error('璇疯緭鍏ュ師鏉$爜'));
+      } else {
+        callback();
+      }
+    };
+    
+    const validateSplitQuantity = (rule, value, callback) => {
+      if (value === null || value === undefined || value === '') {
+        callback(new Error('璇疯緭鍏ユ媶鍖呮暟閲�'));
+      } else if (value <= 0) {
+        callback(new Error('鎷嗗寘鏁伴噺蹇呴』澶т簬0'));
+      } else if (this.splitForm.maxQuantity && value > this.splitForm.maxQuantity) {
+        callback(new Error('鎷嗗寘鏁伴噺涓嶈兘澶т簬鍓╀綑鏁伴噺'));
+      } else {
+        callback();
+      }
+    };
+        
+    // 瀹氫箟鎾ら攢鎷嗗寘琛ㄥ崟楠岃瘉瑙勫垯
+    const validateRevertOriginalBarcode = (rule, value, callback) => {
+      if (!value || value.trim() === '') {
+        callback(new Error('璇疯緭鍏ュ師鏉$爜'));
+      } else {
+        callback();
+      }
+    };
+        // 瀹氫箟鎵归噺鍥炲簱琛ㄥ崟楠岃瘉瑙勫垯
+    const validateBatchReturnPalletCode = (rule, value, callback) => {
+      if (!value || value.trim() === '') {
+        callback(new Error('璇疯緭鍏ユ墭鐩樼爜'));
+      } else {
+        callback();
+      }
+    };
+     // 瀹氫箟鐩存帴鍑哄簱琛ㄥ崟楠岃瘉瑙勫垯
+    const validateDirectOutPalletCode = (rule, value, callback) => {
+      if (!value || value.trim() === '') {
+        callback(new Error('璇疯緭鍏ユ墭鐩樼爜'));
+      } else {
+        callback();
+      }
+    };
     return {
-      scanForm: {
+      scanData: {
+        orderNo: '',
         palletCode: '',
-        materialBarcode: ''
+        barcode: ''
       },
-      palletSummary: null,
-      confirmLoading: false,
-      pickedTableConfig: {
-        url: '/api/outbound/getPickingRecords',
-        query: { orderNo: this.orderNo },
-        columns: [
-          { prop: 'TaskNo', label: '浠诲姟鍙�', width: 150 },
-          { prop: 'Barcode', label: '鐗╂枡鏉$爜', width: 150 },
-          { prop: 'MaterielName', label: '鐗╂枡鍚嶇О', width: 150 },
-          { prop: 'PickQuantity', label: '鎷h揣鏁伴噺', width: 100 },
-          { prop: 'LocationCode', label: '璐т綅', width: 120 },
-          { prop: 'CreateTime', label: '鎷h揣鏃堕棿', width: 180 }
+      unpickedList: [],
+      pickedList: [],
+       selectedUnpickedRows: [], // 鏈嫞閫夊垪琛ㄩ�変腑鐨勮
+      selectedPickedRows: [], // 宸叉嫞閫夊垪琛ㄩ�変腑鐨勮
+      summary: {
+        unpickedCount: 0,
+        unpickedQuantity: 0,
+        pickedCount: 0
+      },
+      palletStatus: '鏈煡',
+      showSplitDialog: false,
+      showRevertSplitDialog: false,
+      showCustomSplitDialog: false, // 鑷畾涔夋媶鍖呭脊绐楁樉绀虹姸鎬�
+      showBatchReturnDialog: false, // 鎵归噺鍥炲簱寮圭獥鏄剧ず鐘舵��
+      showReturnDialog: false,
+      splitLoading: false,
+       revertSplitLoading: false,
+      batchReturnLoading: false, // 鎵归噺鍥炲簱鍔犺浇鐘舵��
+      splitForm: {
+        orderNo: '',
+        palletCode: '',
+        originalBarcode: '',
+        materielCode: '',
+        splitQuantity: 0,
+        maxQuantity: 0
+      },
+            // 鎷嗗寘琛ㄥ崟楠岃瘉瑙勫垯
+      splitFormRules: {
+        originalBarcode: [
+          { required: true, validator: validateOriginalBarcode, trigger: 'blur' }
+        ],
+        splitQuantity: [
+          { required: true, validator: validateSplitQuantity, trigger: 'blur' }
         ]
       },
-      // 鍑哄簱璇︽儏琛ㄦ牸閰嶇疆
-      outboundTableConfig: {
-        url: '/api/outbound/getOutboundDetails',
-        query: { orderNo: this.orderNo },
-        columns: [
-          { prop: 'OrderNo', label: '鍑哄簱鍗曞彿', width: 150 },
-          { prop: 'MaterialCode', label: '鐗╂枡缂栧彿', width: 120 },
-          { prop: 'MaterialBarcode', label: '鐗╂枡鏉$爜', width: 150 },
-          { prop: 'BatchNo', label: '鎵规鍙�', width: 120 },
-          { prop: 'AssignQuantity', label: '鍒嗛厤鍑哄簱閲�', width: 100 },
-          { prop: 'PalletCode', label: '鎵樼洏缂栧彿', width: 120 },
-          { prop: 'Unit', label: '鍗曚綅', width: 80 }
+      revertSplitForm: {
+        originalBarcode: ''
+      },
+          // 鎾ら攢鎷嗗寘琛ㄥ崟楠岃瘉瑙勫垯
+      revertSplitFormRules: {
+        originalBarcode: [
+          { required: true, validator: validateRevertOriginalBarcode, trigger: 'blur' }
         ]
       },
-      orderInfo: {orderNo:''}
+         // 鎵归噺鍥炲簱琛ㄥ崟
+      batchReturnForm: {
+        orderNo: '',
+        palletCode: '',
+        unpickedCount: 0,
+        unpickedQuantity: 0
+      },
+      // 鎵归噺鍥炲簱琛ㄥ崟楠岃瘉瑙勫垯
+      batchReturnFormRules: {
+        palletCode: [
+          { required: true, validator: validateBatchReturnPalletCode, trigger: 'blur' }
+        ]
+      },
+       showDirectOutDialog: false, // 鐩存帴鍑哄簱寮圭獥鏄剧ず鐘舵��
+      directOutLoading: false, // 鐩存帴鍑哄簱鍔犺浇鐘舵��
+      directOutForm: {
+        orderNo: '',
+        palletCode: ''
+      },
+      directOutFormRules: {
+        palletCode: [
+          { required: true, validator: validateDirectOutPalletCode, trigger: 'blur' }
+        ]
+      },
+      returnForm: {
+        orderNo: '',
+        palletCode: '',
+        barcode: '',
+        materielCode: '',
+        returnQuantity: 0
+      },
+      isProcessing: false // 闃叉閲嶅鎻愪氦
     }
   },
   mounted() {
-    this.loadOrderInfo();
+    // 浠庤矾鐢卞弬鏁拌幏鍙栬鍗曠紪鍙�
+    if (this.$route.query.orderNo) {
+      this.scanData.orderNo = this.$route.query.orderNo;
+      this.splitForm.orderNo = this.$route.query.orderNo;
+      this.returnForm.orderNo = this.$route.query.orderNo;
+    }
+        // 椤甸潰鍔犺浇鍚庤嚜鍔ㄨ仛鐒﹀埌鎵樼洏鐮佽緭鍏ユ
     this.$nextTick(() => {
-      if (this.$refs.palletInput) {
-        this.$refs.palletInput.focus()
-      }
-    })
+      this.$refs.palletInput.focus();
+    });
+  
   },
   methods: {
-    loadOrderInfo() {
-      const orderId = this.$route.query.orderId
-      if (!orderId) return
+    goBack(){
+       this.$router.back()
+    },
+
+     openSplitDialog() {
+      console.log('鎵撳紑鑷畾涔夋媶鍖呭脊绐�');
+         if (!this.scanData.palletCode) {
+        this.$message.warning('璇峰厛鎵弿鎵樼洏鐮�');
+        return;
+      }
+      this.showCustomSplitDialog = true;
+      
+      // 閲嶇疆琛ㄥ崟
+      this.resetSplitForm();
+      
+      // 璁剧疆璁㈠崟鍜屾墭鐩樹俊鎭�
+      this.splitForm.orderNo = this.scanData.orderNo;
+      this.splitForm.palletCode = this.scanData.palletCode;
+
+        // 娓呴櫎琛ㄥ崟楠岃瘉
+      this.$nextTick(() => {
+        if (this.$refs.splitFormRef) {
+          this.$refs.splitFormRef.clearValidate();
+        }
+      });
+    },
+
+    // 鍏抽棴鑷畾涔夋媶鍖呭脊绐�
+    closeCustomSplitDialog() {
+      this.showCustomSplitDialog = false;
+      this.resetSplitForm();
+         // 娓呴櫎琛ㄥ崟楠岃瘉
+      if (this.$refs.splitFormRef) {
+        this.$refs.splitFormRef.clearValidate();
+      }
+    }, 
+    
+    // 鎵撳紑鎾ら攢鎷嗗寘寮圭獥
+    openRevertSplitDialog() {
+      console.log('鎵撳紑鎾ら攢鎷嗗寘寮圭獥');
+      this.showRevertSplitDialog = true;
+      
+      // 閲嶇疆琛ㄥ崟
+      this.resetRevertSplitForm();
+      
+      // 娓呴櫎琛ㄥ崟楠岃瘉
+      this.$nextTick(() => {
+        if (this.$refs.revertSplitFormRef) {
+          this.$refs.revertSplitFormRef.clearValidate();
+        }
+      });
+    },
+
+    // 鍏抽棴鎾ら攢鎷嗗寘寮圭獥
+    closeRevertSplitDialog() {
+      this.showRevertSplitDialog = false;
+      this.resetRevertSplitForm();
+      
+      // 娓呴櫎琛ㄥ崟楠岃瘉
+      if (this.$refs.revertSplitFormRef) {
+        this.$refs.revertSplitFormRef.clearValidate();
+      }
+    },
+     // 鎵撳紑鎵归噺鍥炲簱寮圭獥
+    openBatchReturnDialog() {
+      console.log('鎵撳紑鎵归噺鍥炲簱寮圭獥');
+      this.showBatchReturnDialog = true;
+      
+      // 閲嶇疆琛ㄥ崟
+      this.resetBatchReturnForm();
+      
+      // 璁剧疆璁㈠崟淇℃伅
+      this.batchReturnForm.orderNo = this.scanData.orderNo;
+      
+      // 鏇存柊鏈嫞閫変俊鎭�
+      this.batchReturnForm.unpickedCount = this.summary.unpickedCount || 0;
+      this.batchReturnForm.unpickedQuantity = this.summary.unpickedQuantity || 0;
+      
+      // 娓呴櫎琛ㄥ崟楠岃瘉
+      this.$nextTick(() => {
+        if (this.$refs.batchReturnFormRef) {
+          this.$refs.batchReturnFormRef.clearValidate();
+        }
+      });
+    },
+
+    // 鍏抽棴鎵归噺鍥炲簱寮圭獥
+    closeBatchReturnDialog() {
+      this.showBatchReturnDialog = false;
+      this.resetBatchReturnForm();
+      
+      // 娓呴櫎琛ㄥ崟楠岃瘉
+      if (this.$refs.batchReturnFormRef) {
+        this.$refs.batchReturnFormRef.clearValidate();
+      }
+    },
+
+    // 鎵归噺鍥炲簱鎵樼洏鐮佹壂鐮�
+    onBatchReturnPalletScan() {
+      if (!this.batchReturnForm.palletCode) return;
+      
+      this.batchReturnForm.palletCode = this.batchReturnForm.palletCode.replace(/\n/g, '').trim();
+      
+      // 娓呴櫎楠岃瘉鐘舵��
+      if (this.$refs.batchReturnFormRef) {
+        this.$refs.batchReturnFormRef.clearValidate(['palletCode']);
+      }
+    },
+
+    // 鎵归噺鍥炲簱纭
+    async handleBatchReturnConfirm() {
+      // 琛ㄥ崟楠岃瘉
+      if (this.$refs.batchReturnFormRef) {
+        this.$refs.batchReturnFormRef.validate((valid) => {
+          if (valid) {
+            this.submitBatchReturn();
+          } else {
+            this.$message.warning('璇锋壂鎻忔墭鐩樼爜');
+            return false;
+          }
+        });
+      } else {
+        // 濡傛灉娌℃湁琛ㄥ崟寮曠敤锛屼娇鐢ㄥ師鏈夌殑楠岃瘉
+        if (!this.batchReturnForm.palletCode) {
+          this.$message.warning('璇锋壂鎻忔墭鐩樼爜');
+          return;
+        }
+        
+        this.submitBatchReturn();
+      }
+    },
+    
+    // 鎻愪氦鎵归噺鍥炲簱璇锋眰
+    async submitBatchReturn() {
+      this.batchReturnLoading = true;
+      
+      try {
+        const res = await this.http.post('/api/OutboundPicking/batch-return-to-stock', {
+          orderNo: this.batchReturnForm.orderNo,
+          palletCode: this.batchReturnForm.palletCode
+        });
+        
+        if (res.status) {
+          this.$message.success('鎵归噺鍥炲簱鎴愬姛');
+          this.showBatchReturnDialog = false;
+          this.loadData();
+        } else {
+          this.$message.error(res.message || '鎵归噺鍥炲簱澶辫触');
+        }
+      } catch (error) {
+        this.$message.error('鎵归噺鍥炲簱澶辫触');
+      } finally {
+        this.batchReturnLoading = false;
+      }
+    },
+    // 鎵撳紑鐩存帴鍑哄簱寮圭獥
+    openDirectOutDialog() {
+      console.log('鎵撳紑鐩存帴鍑哄簱寮圭獥');
+      this.showDirectOutDialog = true;
+      
+      // 閲嶇疆琛ㄥ崟
+      this.resetDirectOutForm();
+      
+      // 璁剧疆璁㈠崟淇℃伅
+      this.directOutForm.orderNo = this.scanData.orderNo;
+      
+      // 娓呴櫎琛ㄥ崟楠岃瘉
+      this.$nextTick(() => {
+        if (this.$refs.directOutFormRef) {
+          this.$refs.directOutFormRef.clearValidate();
+        }
+      });
+    },
+
+    // 鍏抽棴鐩存帴鍑哄簱寮圭獥
+    closeDirectOutDialog() {
+      this.showDirectOutDialog = false;
+      this.resetDirectOutForm();
+      
+      // 娓呴櫎琛ㄥ崟楠岃瘉
+      if (this.$refs.directOutFormRef) {
+        this.$refs.directOutFormRef.clearValidate();
+      }
+    },
+
+    // 鐩存帴鍑哄簱鎵樼洏鐮佹壂鐮�
+    onDirectOutPalletScan() {
+      if (!this.directOutForm.palletCode) return;
+      
+      this.directOutForm.palletCode = this.directOutForm.palletCode.replace(/\n/g, '').trim();
+      
+      // 娓呴櫎楠岃瘉鐘舵��
+      if (this.$refs.directOutFormRef) {
+        this.$refs.directOutFormRef.clearValidate(['palletCode']);
+      }
+    },
+
+    // 鐩存帴鍑哄簱纭
+    async handleDirectOutConfirm() {
+      // 琛ㄥ崟楠岃瘉
+      if (this.$refs.directOutFormRef) {
+        this.$refs.directOutFormRef.validate((valid) => {
+          if (valid) {
+            this.submitDirectOut();
+          } else {
+            this.$message.warning('璇锋壂鎻忔墭鐩樼爜');
+            return false;
+          }
+        });
+      } else {
+        // 濡傛灉娌℃湁琛ㄥ崟寮曠敤锛屼娇鐢ㄥ師鏈夌殑楠岃瘉
+        if (!this.directOutForm.palletCode) {
+          this.$message.warning('璇锋壂鎻忔墭鐩樼爜');
+          return;
+        }
+        
+        this.submitDirectOut();
+      }
+    },
+    
+    // 鎻愪氦鐩存帴鍑哄簱璇锋眰
+    async submitDirectOut() {
+      this.directOutLoading = true;
+      
+      try {
+        const res = await this.http.post('/api/OutboundPicking/direct-outbound', {
+          orderNo: this.directOutForm.orderNo,
+          palletCode: this.directOutForm.palletCode
+        });
+        debugger;
+        if (res.status) {
+          this.$message.success('鐩存帴鍑哄簱鎴愬姛');
+          this.showDirectOutDialog = false;
+          this.loadData();
+        } else {
+          this.$message.error(res.message || '鐩存帴鍑哄簱澶辫触');
+        }
+      } catch (error) {
+        this.$message.error('鐩存帴鍑哄簱澶辫触');
+      } finally {
+        this.directOutLoading = false;
+      }
+    },
+
+    // 閲嶇疆鐩存帴鍑哄簱琛ㄥ崟
+    resetDirectOutForm() {
+      this.directOutForm.palletCode = '';
+    },
+
+    // 淇敼鍘熸湁鐨勭洿鎺ュ嚭搴撴寜閽偣鍑讳簨浠�
+    handleDirectOutbound() {
+      this.openDirectOutDialog();
+    },
+    async loadData() {
+      if (!this.scanData.orderNo || !this.scanData.palletCode) {
+        return;
+      }
 
       try {
-        this.http.get(`/api/OutboundOrder/GetById?id=${orderId}`).then(response => {debugger;
-          if (response.status) {
-            this.orderInfo = response.data
+        // 鍔犺浇鏈嫞閫夊垪琛�
+        const unpickedRes = await this.http.post('/api/OutboundPicking/unpicked-list', this.scanData);
+        this.unpickedList = unpickedRes.data || [];
+
+        // 鍔犺浇宸叉嫞閫夊垪琛�
+        const pickedRes = await this.http.post('/api/OutboundPicking/picked-list', this.scanData);
+        this.pickedList = pickedRes.data || [];
+
+        // 鍔犺浇姹囨�讳俊鎭�
+        const summaryRes = await this.http.post('/api/OutboundPicking/picking-summary',this.scanData);
+        this.summary = summaryRes.data || {};
+        
+        // 鏇存柊鎵樼洏鐘舵��
+        this.updatePalletStatus();
+        
+      } catch (error) {
+        this.$message.error('鍔犺浇鏁版嵁澶辫触');
+      }
+    },
+
+    updatePalletStatus() {
+      if (this.unpickedList.length === 0 && this.pickedList.length > 0) {
+        this.palletStatus = '宸插叏閮ㄦ嫞閫�';
+      } else if (this.unpickedList.length > 0 && this.pickedList.length === 0) {
+        this.palletStatus = '寰呮嫞閫�';
+      } else if (this.unpickedList.length > 0 && this.pickedList.length > 0) {
+        this.palletStatus = '閮ㄥ垎鎷i��';
+      } else {
+        this.palletStatus = '鏃犳暟鎹�';
+      }
+    },
+    // 宸叉嫞閫夊垪琛ㄩ�夋嫨鍙樺寲
+    handlePickedSelectionChange(selection) {
+      this.selectedPickedRows = selection;
+    },
+       // 鎵归噺鍙栨秷閫変腑鐨勫凡鎷i�夐」
+    async batchCancelSelected() {
+      if (this.selectedPickedRows.length === 0) {
+        this.$message.warning('璇峰厛閫夋嫨瑕佸彇娑堢殑椤�');
+        return;
+      }
+
+      this.$confirm(`纭畾瑕佸彇娑堥�変腑鐨� ${this.selectedPickedRows.length} 椤瑰悧锛焋, '鎻愮ず', {
+        confirmButtonText: '纭畾',
+        cancelButtonText: '鍙栨秷',
+        type: 'warning'
+      }).then(async () => {
+        try {
+          let successCount = 0;
+          let errorCount = 0;
+          
+          for (const row of this.selectedPickedRows) {
+            try {
+              const res = await this.http.post('/api/OutboundPicking/CancelPicking', {
+                orderNo: this.scanData.orderNo,
+                palletCode: this.scanData.palletCode,
+                barcode: row.currentBarcode
+              });
               
-          }
-        })
-      } catch (error) {
-        ElMessage.error('鍔犺浇鍑哄簱鍗曚俊鎭け璐�')
-      }
-    },
-     goBack() {
-      this.$router.back()
-    },
-    async handlePalletScan() {
-      if (this.scanForm.palletCode) {
-        ElMessage.success(`宸叉壂鎻忔墭鐩�: ${this.scanForm.palletCode}`)
-        await this.loadPalletSummary()
-
-        this.$nextTick(() => {
-          if (this.$refs.materialInput) {
-            this.$refs.materialInput.focus()
-          }
-        })
-      }
-    },
-    async handleMaterialScan() {
-      if (!this.scanForm.palletCode) {
-        ElMessage.warning('璇峰厛鎵弿鎵樼洏鐮�')
-        this.$refs.palletInput.focus()
-        return
-      }
-
-      if (!this.scanForm.materialBarcode) {
-        ElMessage.warning('璇锋壂鎻忕墿鏂欐潯鐮�')
-        return
-      }
-
-      await this.executePickingConfirm()
-    },
-    async loadPalletSummary() {
-      if (!this.scanForm.palletCode) {
-        this.palletSummary = null
-        return
-      }
-
-      try {
-        const result = await http.get('/api/outbound/getPalletPickingSummary', {
-          params: {
-            orderNo: this.orderNo,
-            palletCode: this.scanForm.palletCode
-          }
-        })
-
-        if (result.success) {
-          // 澶勭悊缁熻淇℃伅
-          const summary = result.data
-          const assigned = summary.find(x => x.Status === '宸插垎閰�') || { TotalAssignQty: 0, TotalPickedQty: 0 }
-          const picked = summary.find(x => x.Status === '宸叉嫞閫�') || { TotalPickedQty: 0 }
-
-          this.palletSummary = {
-            unpickedCount: assigned.TotalAssignQty > 0 ? 1 : 0, // 绠�鍖栬绠�
-            unpickedTotal: assigned.TotalAssignQty - assigned.TotalPickedQty
-          }
-        }
-      } catch (error) {
-        console.error('鍔犺浇鎵樼洏缁熻澶辫触:', error)
-      }
-    },
-    async handleConfirm() {
-      if (!this.scanForm.palletCode || !this.scanForm.materialBarcode) {
-        ElMessage.warning('璇峰~鍐欏畬鏁寸殑鎵爜淇℃伅')
-        return
-      }
-
-      await this.executePickingConfirm()
-    },
-    async executePickingConfirm() {
-      this.confirmLoading = true
-
-      try {
-        // 鍏堟壘鍒板搴旂殑鍑哄簱閿佸畾淇℃伅
-        const lockInfoResult = await this.http.get('/api/outbound/getOutStockLockInfo', {
-          params: {
-            orderNo: this.orderNo,
-            palletCode: this.scanForm.palletCode,
-            materialBarcode: this.scanForm.materialBarcode
-          }
-        })
-
-        if (!lockInfoResult.success || !lockInfoResult.data || lockInfoResult.data.length === 0) {
-          ElMessage.error('鏈壘鍒板搴旂殑鍑哄簱閿佸畾淇℃伅')
-          return
-        }
-
-        const lockInfo = lockInfoResult.data[0]
-
-        const request = {
-          outStockLockId: lockInfo.Id,
-          taskNo: `TASK_${Date.now()}`,
-          palletCode: this.scanForm.palletCode,
-          materialBarcode: this.scanForm.materialBarcode,
-          locationCode: lockInfo.LocationCode
-        }
-
-        const result = await this.http.post('/api/outbound/pickingConfirm', request)
-
-        if (result.success) {
-          ElMessage.success('鍒嗘嫞纭鎴愬姛')
-          this.handleReset()
-          this.$emit('confirm')
-
-          // 鍒锋柊琛ㄦ牸
-          if (this.$refs.pickedTable) {
-            this.$refs.pickedTable.refresh()
+              if (res.status) {
+                successCount++;
+              } else {
+                errorCount++;
+                console.error(`鍙栨秷鎷i�夊け璐�: ${row.Barcode}`, res.message);
+              }
+            } catch (error) {
+              errorCount++;
+              console.error(`鍙栨秷鎷i�夊け璐�: ${row.Barcode}`, error);
+            }
           }
           
-          // 鍒锋柊鍑哄簱璇︽儏琛ㄦ牸
-          if (this.$refs.outboundTable) {
-            this.$refs.outboundTable.refresh()
+          if (errorCount === 0) {
+            this.$message.success(`鎴愬姛鍙栨秷 ${successCount} 椤筦);
+          } else {
+            this.$message.warning(`鎴愬姛鍙栨秷 ${successCount} 椤癸紝澶辫触 ${errorCount} 椤筦);
           }
+          
+          this.loadData();
+          this.selectedPickedRows = [];
+        } catch (error) {
+          this.$message.error('鎵归噺鍙栨秷鎿嶄綔澶辫触');
+        }
+      }).catch(() => {
+        this.$message.info('宸插彇娑堟壒閲忔搷浣�');
+      });
+    },
+    // 鎵樼洏鐮佹壂鐮�
+    onPalletScan() {
+     // 鍘婚櫎鍥炶溅绗﹀拰鍓嶅悗绌烘牸
+      this.scanData.palletCode = this.scanData.palletCode.replace(/\n/g, '').trim();
+      if (!this.scanData.palletCode) return;
+      
+      this.splitForm.palletCode = this.scanData.palletCode;
+      this.returnForm.palletCode = this.scanData.palletCode;
+      
+      // 鍔犺浇鏁版嵁
+      this.loadData();
+      
+      // 鑷姩璺宠浆鍒扮墿鏂欐潯鐮佽緭鍏ユ
+      this.$nextTick(() => {
+        this.$refs.barcodeInput.focus();
+      });
+    },
 
-          // 閲嶆柊鍔犺浇鎵樼洏缁熻
-          await this.loadPalletSummary()
+    onBarcodeScan() {
+       // 鍘婚櫎鍥炶溅绗﹀拰鍓嶅悗绌烘牸
+      this.scanData.barcode = this.scanData.barcode.replace(/\n/g, '').trim();
+      if (!this.scanData.barcode) return;
+      
+      // 鑷姩纭鎷i��
+      this.confirmPicking();
+    },
+
+    async confirmPicking() {
+       if (this.isProcessing) return;
+      
+      if (!this.scanData.orderNo || !this.scanData.palletCode || !this.scanData.barcode) {
+        this.$message.warning('璇峰厛鎵弿鎵樼洏鐮佸拰鐗╂枡鏉$爜');
+        this.focusBarcodeInput();
+        return;
+      }
+
+      this.isProcessing = true;
+      
+      try {
+        const res = await this.http.post('/api/OutboundPicking/confirm-picking', this.scanData);
+        if (res.status) {
+          this.$message.success('鎷i�夌‘璁ゆ垚鍔�');
+          this.scanData.barcode = ''; // 娓呯┖鐗╂枡鏉$爜
+          this.loadData();
+          
+          // 鎴愬姛鍚庣户缁仛鐒﹀埌鐗╂枡鏉$爜杈撳叆妗嗭紝鍑嗗涓嬩竴涓壂鐮�
+          this.$nextTick(() => {
+            this.$refs.barcodeInput.focus();
+          });
         } else {
-          ElMessage.error(result.ElMessage)
+          // 鏄剧ず鍚庣杩斿洖鐨勯敊璇俊鎭�
+          this.$message.error(res.message || '鎷i�夌‘璁ゅけ璐�');
+          // 澶辫触鏃惰仛鐒﹀苟閫変腑鐗╂枡鏉$爜杈撳叆妗嗗唴瀹�
+          this.focusBarcodeInput(true);
         }
       } catch (error) {
-        ElMessage.error('鍒嗘嫞纭澶辫触')
+        this.$message.error('鎷i�夌‘璁ゅけ璐�: ' + (error.message || '缃戠粶閿欒'));
+        // 澶辫触鏃惰仛鐒﹀苟閫変腑鐗╂枡鏉$爜杈撳叆妗嗗唴瀹�
+        this.focusBarcodeInput(true);
       } finally {
-        this.confirmLoading = false
+        this.isProcessing = false;
       }
     },
-    handleReset() {
-      this.scanForm.materialBarcode = ''
+
+    // 鑱氱劍鍒扮墿鏂欐潯鐮佽緭鍏ユ
+    focusBarcodeInput(selectText = false) {
       this.$nextTick(() => {
-        if (this.$refs.materialInput) {
-          this.$refs.materialInput.focus()
+        const input = this.$refs.barcodeInput;
+        if (input && input.$el && input.$el.querySelector('input')) {
+          const inputEl = input.$el.querySelector('input');
+          inputEl.focus();
+          if (selectText) {
+            inputEl.select();
+          }
         }
-      })
+      });
+    },
+
+    async cancelPicking(row) {
+      try {
+        const res = await this.http.post('/api/OutboundPicking/CancelPicking', {
+          orderNo: this.scanData.orderNo,
+          palletCode: this.scanData.palletCode,
+          barcode: row.Barcode
+        });
+        
+        if (res.status) {
+          this.$message.success('鍙栨秷鎷i�夋垚鍔�');
+          this.loadData();
+        } else {
+          this.$message.error(res.message || '鍙栨秷鎷i�夊け璐�');
+        }
+      } catch (error) {
+        this.$message.error('鍙栨秷鎷i�夊け璐�');
+      }
+    },
+
+   /*  // 鍥炲簱鎿嶄綔 - 鍥炲簱鏁翠釜鎵樼洏鏈嫞閫夌殑璐х墿
+    async handleBatchReturn() {
+      if (!this.scanData.orderNo || !this.scanData.palletCode) {
+        this.$message.warning('璇峰厛鎵弿鎵樼洏鐮�');
+        return;
+      }
+
+      if (this.unpickedList.length === 0) {
+        this.$message.warning('璇ユ墭鐩樻病鏈夊彲鍥炲簱鐨勮揣鐗�');
+        return;
+      }
+
+      this.$confirm(`纭畾瑕佸洖搴撴暣涓墭鐩樼殑鏈嫞閫夎揣鐗╁悧锛熷叡 ${this.unpickedList.length} 鏉¤褰昤, '鎻愮ず', {
+        confirmButtonText: '纭畾',
+        cancelButtonText: '鍙栨秷',
+        type: 'warning'
+      }).then(async () => {
+        try {
+          const res = await this.http.post('/api/OutboundPicking/batch-return-to-stock', {
+            orderNo: this.scanData.orderNo,
+            palletCode: this.scanData.palletCode
+          });
+          
+          if (res.success) {
+            this.$message.success('鎵归噺鍥炲簱鎴愬姛');
+            this.loadData();
+          } else {
+            this.$message.error(res.message || '鎵归噺鍥炲簱澶辫触');
+          }
+        } catch (error) {
+          this.$message.error('鎵归噺鍥炲簱澶辫触');
+        }
+      }).catch(() => {
+        this.$message.info('宸插彇娑堟壒閲忓洖搴�');
+      });
+    }, */
+
+   /*  // 鐩存帴鍑哄簱鎿嶄綔
+    async handleDirectOutbound() {
+      if (!this.scanData.orderNo || !this.scanData.palletCode) {
+        this.$message.warning('璇峰厛鎵弿鎵樼洏鐮�');
+        return;
+      }
+
+      this.$confirm('纭畾瑕佺洿鎺ュ嚭搴撴暣涓墭鐩樺悧锛�', '鎻愮ず', {
+        confirmButtonText: '纭畾',
+        cancelButtonText: '鍙栨秷',
+        type: 'warning'
+      }).then(async () => {
+        try {
+          const res = await this.http.post('/api/OutboundPicking/direct-outbound', {
+            orderNo: this.scanData.orderNo,
+            palletCode: this.scanData.palletCode
+          });
+          
+          if (res.success) {
+            this.$message.success('鐩存帴鍑哄簱鎴愬姛');
+            this.loadData();
+          } else {
+            this.$message.error(res.message || '鐩存帴鍑哄簱澶辫触');
+          }
+        } catch (error) {
+          this.$message.error('鐩存帴鍑哄簱澶辫触');
+        }
+      }).catch(() => {
+        this.$message.info('宸插彇娑堢洿鎺ュ嚭搴�');
+      });
+    }, */
+    // 纭鍥炲簱锛堥�氳繃寮圭獥锛�
+    async handleReturnConfirm() {
+      if (!this.returnForm.barcode) {
+        this.$message.warning('璇锋壂鎻忓洖搴撴潯鐮�');
+        return;
+      }
+
+      try {
+        const res = await this.http.post('/api/OutboundPicking/return-to-stock', {
+          orderNo: this.returnForm.orderNo,
+          palletCode: this.returnForm.palletCode,
+          barcode: this.returnForm.barcode
+        });
+        
+        if (res.success) {
+          this.$message.success('鍥炲簱鎴愬姛');
+          this.showReturnDialog = false;
+          this.resetReturnForm();
+          this.loadData();
+        } else {
+          this.$message.error(res.message || '鍥炲簱澶辫触');
+        }
+      } catch (error) {
+        this.$message.error('鍥炲簱澶辫触');
+      }
+    },
+
+    // 鎷嗗寘鎵爜
+    async onSplitBarcodeScan() {
+      if (!this.splitForm.originalBarcode) return;
+      
+      // 鍘婚櫎鍥炶溅绗﹀拰鍓嶅悗绌烘牸
+      this.splitForm.originalBarcode = this.splitForm.originalBarcode.replace(/\n/g, '').trim();
+
+      try {
+        const res = await this.http.post('/api/OutboundPicking/split-package-info', {
+     
+            orderNo: this.splitForm.orderNo,
+            palletCode: this.splitForm.palletCode,
+            barcode: this.splitForm.originalBarcode
+        
+        });
+
+        if (res.status) {
+          this.splitForm.materielCode = res.data.materielCode;
+          this.splitForm.maxQuantity = res.data.remainQuantity;
+          this.splitForm.splitQuantity = Math.min(1, this.splitForm.maxQuantity);
+           // 娓呴櫎楠岃瘉鐘舵��
+          if (this.$refs.splitFormRef) {
+            this.$refs.splitFormRef.clearValidate(['originalBarcode']);
+          }
+        } else {
+          this.$message.error(res.message || '鑾峰彇鎷嗗寘淇℃伅澶辫触');
+            // 楠岃瘉澶辫触锛岃缃敊璇姸鎬�
+          if (this.$refs.splitFormRef) {
+            this.$refs.splitFormRef.validateField('originalBarcode');
+          }
+        }
+      } catch (error) {
+        this.$message.error('鑾峰彇鎷嗗寘淇℃伅澶辫触');
+         // 楠岃瘉澶辫触锛岃缃敊璇姸鎬�
+        if (this.$refs.splitFormRef) {
+          this.$refs.splitFormRef.validateField('originalBarcode');
+        }
+      }
+    },
+
+    async handleSplitPackage() {
+       // 琛ㄥ崟楠岃瘉
+      if (this.$refs.splitFormRef) {
+        this.$refs.splitFormRef.validate((valid) => {
+          if (valid) {
+            this.submitSplitPackage();
+          } else {
+            this.$message.warning('璇峰~鍐欏畬鏁寸殑鎷嗗寘淇℃伅');
+            return false;
+          }
+        });
+      } else {
+        // 濡傛灉娌℃湁琛ㄥ崟寮曠敤锛屼娇鐢ㄥ師鏈夌殑楠岃瘉
+        if (!this.splitForm.originalBarcode || this.splitForm.splitQuantity <= 0) {
+          this.$message.warning('璇峰~鍐欏畬鏁寸殑鎷嗗寘淇℃伅');
+          return;
+        }
+        
+        if (this.splitForm.splitQuantity > this.splitForm.maxQuantity) {
+          this.$message.warning('鎷嗗寘鏁伴噺涓嶈兘澶т簬鍓╀綑鏁伴噺');
+          return;
+        }
+        
+        this.submitSplitPackage();
+      }
+
+ 
+    },
+    // 鎻愪氦鎷嗗寘璇锋眰
+    async submitSplitPackage() {
+    this.splitLoading = true;
+     try {
+        const res = await this.http.post('/api/OutboundPicking/split-package', this.splitForm);
+        if (res.status) {
+          this.$message.success('鎷嗗寘鎴愬姛');
+          this.showSplitDialog = false;
+          this.resetSplitForm();
+          this.loadData();
+        } else {
+          this.$message.error(res.message || '鎷嗗寘澶辫触');
+        }
+      } catch (error) {
+        this.$message.error('鎷嗗寘澶辫触');
+      }
+    },
+        // 鎾ら攢鎷嗗寘鎵爜
+    onRevertSplitBarcodeScan() {
+      if (!this.revertSplitForm.originalBarcode) return;
+      
+      this.revertSplitForm.originalBarcode = this.revertSplitForm.originalBarcode.replace(/\n/g, '').trim();
+      
+      // 娓呴櫎楠岃瘉鐘舵��
+      if (this.$refs.revertSplitFormRef) {
+        this.$refs.revertSplitFormRef.clearValidate(['originalBarcode']);
+      }
+    },
+    async handleRevertSplit() {
+      // 琛ㄥ崟楠岃瘉
+      if (this.$refs.revertSplitFormRef) {
+        this.$refs.revertSplitFormRef.validate((valid) => {
+          if (valid) {
+            this.submitRevertSplit();
+          } else {
+            this.$message.warning('璇疯緭鍏ュ師鏉$爜');
+            return false;
+          }
+        });
+      } else {
+        // 濡傛灉娌℃湁琛ㄥ崟寮曠敤锛屼娇鐢ㄥ師鏈夌殑楠岃瘉
+        if (!this.revertSplitForm.originalBarcode) {
+          this.$message.warning('璇疯緭鍏ュ師鏉$爜');
+          return;
+        }
+        
+        this.submitRevertSplit();
+      }
+    },
+    // 鎻愪氦鎾ら攢鎷嗗寘璇锋眰
+    async submitRevertSplit() {
+      this.revertSplitLoading = true;
+      
+      try {
+        const res = await this.http.post('/api/OutboundPicking/revert-split-package', {
+          originalBarcode: this.revertSplitForm.originalBarcode
+        });
+
+        if (res.status) {
+          this.$message.success('鎾ら攢鎷嗗寘鎴愬姛');
+          this.showRevertSplitDialog = false;
+          this.revertSplitForm.originalBarcode = '';
+          this.loadData();
+        } else {
+          this.$message.error(res.message || '鎾ら攢鎷嗗寘澶辫触');
+        }
+      } catch (error) {
+        this.$message.error('鎾ら攢鎷嗗寘澶辫触');
+      }
+    },
+    resetSplitForm() {
+      this.splitForm.originalBarcode = '';
+      this.splitForm.materielCode = '';
+      this.splitForm.splitQuantity = 0;
+      this.splitForm.maxQuantity = 0;
+    },
+    // 閲嶇疆鎵归噺鍥炲簱琛ㄥ崟
+    resetBatchReturnForm() {
+      this.batchReturnForm.palletCode = '';
+      this.batchReturnForm.unpickedCount = 0;
+      this.batchReturnForm.unpickedQuantity = 0;
+    },
+    resetReturnForm() {
+      this.returnForm.barcode = '';
+      this.returnForm.materielCode = '';
+      this.returnForm.returnQuantity = 0;
     }
   }
 })
 </script>
 
 <style scoped>
-.picking-confirm {
+.picking-container {
+  padding: 20px;
+  position: relative; /* 涓哄脊绐楀畾浣嶆彁渚涗笂涓嬫枃 */
+}
+.scanner-form {
   display: flex;
-  flex-direction: column;
-  height: 70vh;
+  gap: 10px;
+  align-items: center;
+  flex-wrap: wrap;
 }
-
-.content-layout {
+.scanner-form .el-input {
+  width: 200px;
+}
+.summary-info {
   display: flex;
-  gap: 16px;
-  margin-bottom: 16px;
-  flex: 1;
-  min-height: 0; /* 閲嶈锛氶槻姝lex瀛愬厓绱犳孩鍑� */
+  gap: 20px;
+  flex-wrap: wrap;
 }
 
-.left-section {
-  flex: 1;
+/* 琛ㄦ牸鎿嶄綔鍖哄煙鏍峰紡 */
+.table-actions {
   display: flex;
-  flex-direction: column;
+  justify-content: space-between;
+  align-items: center;
+  margin-bottom: 10px;
+  padding: 0 10px;
 }
 
-.right-section {
-  flex: 1;
+.selection-count {
+  font-size: 12px;
+  color: #909399;
+}
+
+/* 琛ㄦ牸鏍峰紡璋冩暣 */
+.content-area .el-table {
+  margin-top: 0;
+}
+
+/* 纭繚琛ㄦ牸楂樺害閫傚簲 */
+.content-area .el-card__body {
+  padding: 15px;
+}
+
+ 
+/* 鑷畾涔夊脊绐楁牱寮� */
+.custom-dialog-overlay {
+  position: fixed;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
+  background-color: rgba(0, 0, 0, 0.5);
   display: flex;
-  flex-direction: column;
+  align-items: center;
+  justify-content: center;
+  z-index: 9999;
 }
 
-.scan-section {
-  flex-shrink: 0;
+.custom-dialog-wrapper {
+  position: relative;
+  z-index: 10000;
 }
 
-.scan-alert {
-  margin-bottom: 16px;
+.custom-dialog {
+  background: white;
+  border-radius: 4px;
+  width: 500px;
+  max-width: 90vw;
+  max-height: 90vh;
+  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
+  overflow: auto;
 }
 
-.scan-form {
-  max-width: 500px;
-}
-
-.pallet-summary {
-  margin: 16px 0;
-}
-
-.action-buttons {
-  margin-top: 16px;
-}
-
-.outbound-details-card {
-  height: 100%;
+.custom-dialog-header {
   display: flex;
-  flex-direction: column;
+  justify-content: space-between;
+  align-items: center;
+  padding: 20px 20px 10px;
+  border-bottom: 1px solid #ebeef5;
 }
 
-.outbound-details-card :deep(.el-card__body) {
-  flex: 1;
+.custom-dialog-header h3 {
+  margin: 0;
+  color: #303133;
+}
+
+/* 鍏抽棴鎸夐挳鏍峰紡 */
+.close-button {
+  font-size: 18px;
+  color: #909399;
   padding: 0;
+  width: 24px;
+  height: 24px;
+  display: flex;
+  align-items: center;
+  justify-content: center;
 }
 
-.picked-records {
-  flex-shrink: 0;
-  height: 300px;
+.close-button:hover {
+  color: #409EFF;
+  background-color: transparent;
 }
 
-.picked-records :deep(.el-card__body) {
-  padding: 0;
+.custom-dialog-body {
+  padding: 20px;
+}
+
+.custom-dialog-footer {
+  padding: 10px 20px 20px;
+  text-align: right;
+  border-top: 1px solid #ebeef5;
+}
+
+.custom-dialog-footer .el-button {
+  margin-left: 10px;
+}
+
+/* 纭繚寮圭獥鍦ㄧЩ鍔ㄨ澶囦笂涔熻兘姝e父鏄剧ず */
+@media (max-width: 768px) {
+  .custom-dialog {
+    width: 95vw;
+    margin: 10px;
+  }
 }
 </style>
\ No newline at end of file

--
Gitblit v1.9.3