From 8639f19c82f6e263654db44286256bb8d028d2c2 Mon Sep 17 00:00:00 2001
From: 647556386 <647556386@qq.com>
Date: 星期日, 30 十一月 2025 10:10:40 +0800
Subject: [PATCH] 1

---
 项目代码/WIDESEA_WMSClient/src/views/outbound/PickingConfirm.vue |  220 ++++++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 193 insertions(+), 27 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 a1be799..2fc26e1 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"
@@ -26,11 +26,11 @@
             @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="warning" @click="openSplitDialog">鎷嗗寘</el-button>
+          <el-button type="info" @click="openRevertSplitDialog">鎾ら攢鎷嗗寘</el-button> -->
+           <el-button type="info" @click="handleEmptyPallet">鍙栫┖绠�</el-button>
           <el-button type="primary" @click="openBatchReturnDialog">鍥炲簱</el-button>
-          <el-button type="danger" @click="handleDirectOutbound">鐩存帴鍑哄簱</el-button> 
+          <!-- <el-button type="danger" @click="handleDirectOutbound">鐩存帴鍑哄簱</el-button>  -->
 
         </div>
       </el-card>
@@ -42,7 +42,7 @@
         <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="success">宸叉嫞閫夋潯鏁�: {{summary.pickedCount}}</el-tag> -->
           <el-tag type="info">鎵樼洏鐘舵��: {{palletStatus}}</el-tag>
         </div>
       </el-card>
@@ -250,6 +250,49 @@
         </div>
       </div>
     </div>
+
+    <!-- 鍙栬蛋绌虹-->
+ <div v-if="showEmptyPalletDialog" 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="closeEmptyPalletDialog"
+              class="close-button">
+              脳
+            </el-button>
+          </div>
+          <div class="custom-dialog-body">
+            <el-form 
+              :model="emptypalletOutForm" 
+              :rules="emptypalletOutFormRules"
+              ref="emptypalletOutFormRef"
+              label-width="100px">
+              <el-form-item label="璁㈠崟缂栧彿">
+                <el-input v-model="emptypalletOutForm.orderNo" disabled></el-input>
+              </el-form-item>
+              <el-form-item label="鎵樼洏缂栧彿" prop="palletCode">
+                <el-input 
+                  v-model="emptypalletOutForm.palletCode" 
+                  placeholder="鎵弿鎵樼洏鐮�"
+                  @keyup.enter.native="onEmptyPalletScan"
+                  @change="onEmptyPalletScan"
+                  clearable>
+                </el-input>
+              </el-form-item>
+            </el-form>
+          </div>
+          <div class="custom-dialog-footer">
+            <el-button @click="closeEmptyPalletDialog">鍙栨秷</el-button>
+            <el-button type="primary" @click="handleEmptyPalletConfirm" :loading="emptypalletOutLoading">纭鍙栬蛋绌虹</el-button>
+          </div>
+        </div>
+      </div>
+    </div>
+  </div>
+
     <!-- 鐩存帴鍑哄簱寮圭獥 -->
     <div v-if="showDirectOutDialog" class="custom-dialog-overlay">
       <div class="custom-dialog-wrapper">
@@ -290,7 +333,8 @@
         </div>
       </div>
     </div>
-  </div>
+ 
+  <print-view ref="childs" @parentcall="parentcall"></print-view>
 </template>
 
 <script>
@@ -298,12 +342,11 @@
 import { ref, 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: 'PickingConfirm',
-  components: {
-  
-  },
+  components: {printView},
   props: {
     orderNo: {
       type: String,
@@ -431,6 +474,20 @@
           { required: true, validator: validateDirectOutPalletCode, trigger: 'blur' }
         ]
       },
+
+      showEmptyPalletDialog: false, // 鍙栬蛋绌虹寮圭獥鏄剧ず鐘舵��
+      emptypalletOutLoading: false, // 鍙栬蛋绌虹鍔犺浇鐘舵��
+      emptypalletOutForm: {
+        orderNo: '',
+        palletCode: ''
+      },
+      emptypalletOutFormRules: {
+        palletCode: [
+          { required: true, validator: validateDirectOutPalletCode, trigger: 'blur' }
+        ]
+      },
+
+
       returnForm: {
         orderNo: '',
         palletCode: '',
@@ -552,7 +609,7 @@
       }
     },
 
-    // 鎵归噺鍥炲簱鎵樼洏鐮佹壂鐮�
+    // 鍥炲簱鎵樼洏鐮佹壂鐮�
     onBatchReturnPalletScan() {
       if (!this.batchReturnForm.palletCode) return;
       
@@ -564,7 +621,7 @@
       }
     },
 
-    // 鎵归噺鍥炲簱纭
+    // 鍥炲簱纭
     async handleBatchReturnConfirm() {
       // 琛ㄥ崟楠岃瘉
       if (this.$refs.batchReturnFormRef) {
@@ -587,25 +644,25 @@
       }
     },
     
-    // 鎻愪氦鎵归噺鍥炲簱璇锋眰
+    // 鎻愪氦鍥炲簱璇锋眰
     async submitBatchReturn() {
       this.batchReturnLoading = true;
       
       try {
-        const res = await this.http.post('/api/OutboundPicking/batch-return-to-stock', {
+        const res = await this.http.post('/api/OutboundPicking/return-to-stock', {
           orderNo: this.batchReturnForm.orderNo,
           palletCode: this.batchReturnForm.palletCode
         });
         
         if (res.status) {
-          this.$message.success('鎵归噺鍥炲簱鎴愬姛');
+          this.$message.success(res.message);
           this.showBatchReturnDialog = false;
           this.loadData();
         } else {
-          this.$message.error(res.message || '鎵归噺鍥炲簱澶辫触');
+          this.$message.error(res.message || '鍥炲簱澶辫触');
         }
       } catch (error) {
-        this.$message.error('鎵归噺鍥炲簱澶辫触');
+        this.$message.error('鍥炲簱澶辫触');
       } finally {
         this.batchReturnLoading = false;
       }
@@ -708,6 +765,109 @@
     handleDirectOutbound() {
       this.openDirectOutDialog();
     },
+
+   // 鎵撳紑鍙栬蛋绌虹寮圭獥
+    openEmptyPalletDialog() {
+      console.log('鎵撳紑鍙栬蛋绌虹寮圭獥');
+      this.showEmptyPalletDialog = true;
+      
+      // 閲嶇疆琛ㄥ崟
+      this.resetEmptyPalletForm();
+      
+      // 璁剧疆璁㈠崟淇℃伅
+      this.emptypalletOutForm.orderNo = this.scanData.orderNo;
+      
+      // 娓呴櫎琛ㄥ崟楠岃瘉
+      this.$nextTick(() => {
+        if (this.$refs.emptyPalletFormRef) {
+          this.$refs.emptyPalletFormRef.clearValidate();
+        }
+      });
+    },
+
+    // 鍏抽棴鍙栬蛋绌虹寮圭獥
+    closeEmptyPalletDialog() {
+      this.showEmptyPalletDialog = false;
+      this.resetEmptyPalletForm();
+      
+      // 娓呴櫎琛ㄥ崟楠岃瘉
+      if (this.$refs.emptyPalletFormRef) {
+        this.$refs.emptyPalletFormRef.clearValidate();
+      }
+    },
+
+    // 鍙栬蛋绌虹鎵樼洏鐮佹壂鐮�
+    onEmptyPalletScan() {
+      if (!this.emptypalletOutForm.palletCode) return;
+      
+      this.emptypalletOutForm.palletCode = this.emptypalletOutForm.palletCode.replace(/\n/g, '').trim();
+      
+      // 娓呴櫎楠岃瘉鐘舵��
+      if (this.$refs.emptyPalletFormRef) {
+        this.$refs.emptyPalletFormRef.clearValidate(['palletCode']);
+      }
+    },
+
+    // 鍙栬蛋绌虹纭
+    async handleEmptyPalletConfirm() {
+      // 琛ㄥ崟楠岃瘉
+      if (this.$refs.emptyPalletFormRef) {
+        this.$refs.emptyPalletFormRef.validate((valid) => {
+          if (valid) {
+            this.submitEmptyPallet();
+          } else {
+            this.$message.warning('璇锋壂鎻忔墭鐩樼爜');
+            return false;
+          }
+        });
+      } else {
+        // 濡傛灉娌℃湁琛ㄥ崟寮曠敤锛屼娇鐢ㄥ師鏈夌殑楠岃瘉
+        if (!this.emptypalletOutForm.palletCode) {
+          this.$message.warning('璇锋壂鎻忔墭鐩樼爜');
+          return;
+        }
+        
+        this.submitEmptyPallet();
+      }
+    },
+    
+    // 鎻愪氦鍙栬蛋绌虹璇锋眰
+    async submitEmptyPallet() {
+      this.emptypalletOutLoading = true;
+      
+      try {
+        const res = await this.http.post('/api/OutboundPicking/remove-empty-pallet', {
+          orderNo: this.emptypalletOutForm.orderNo,
+          palletCode: this.emptypalletOutForm.palletCode
+        });
+        debugger;
+        if (res.status) {
+          this.$message.success('鍙栬蛋绌虹鎴愬姛');
+          this.showEmptyPalletDialog = false;
+          this.loadData();
+        } else {
+          this.$message.error(res.message || '鍙栬蛋绌虹澶辫触');
+        }
+      } catch (error) {
+        this.$message.error('鍙栬蛋绌虹澶辫触');
+      } finally {
+        this.emptypalletOutLoading = false;
+      }
+    },
+
+    // 閲嶇疆鍙栬蛋绌虹琛ㄥ崟
+    resetEmptyPalletForm() {
+      this.emptypalletOutForm.palletCode = '';
+    },
+
+    // 淇敼鍘熸湁鐨勫彇璧扮┖绠辨寜閽偣鍑讳簨浠� 
+    handleEmptyPallet() {
+      this.openEmptyPalletDialog();
+    },
+
+
+
+    
     async loadData() {
       if (!this.scanData.orderNo || !this.scanData.palletCode) {
         return;
@@ -775,21 +935,16 @@
               
               if (res.status) {
                 successCount++;
+                 this.$message.success(`鎴愬姛鍙栨秷`);
               } else {
                 errorCount++;
-                console.error(`鍙栨秷鎷i�夊け璐�: ${row.Barcode}`, res.message);
+                 this.$message.warning(`鍙栨秷鎷i�夊け璐�: ${row.currentBarcode} - ${res.message}`);
               }
             } catch (error) {
               errorCount++;
-              console.error(`鍙栨秷鎷i�夊け璐�: ${row.Barcode}`, error);
+              this.$message.warning(`鍙栨秷鎷i�夊け璐�: ${row.currentBarcode} - ${error.message}` );
             }
-          }
-          
-          if (errorCount === 0) {
-            this.$message.success(`鎴愬姛鍙栨秷 ${successCount} 椤筦);
-          } else {
-            this.$message.warning(`鎴愬姛鍙栨秷 ${successCount} 椤癸紝澶辫触 ${errorCount} 椤筦);
-          }
+          }        
           
           this.loadData();
           this.selectedPickedRows = [];
@@ -844,7 +999,12 @@
           this.$message.success('鎷i�夌‘璁ゆ垚鍔�');
           this.scanData.barcode = ''; // 娓呯┖鐗╂枡鏉$爜
           this.loadData();
-          
+          console.log(res.data.splitResults)
+          if(res.data && res.data.splitResults.length>0){
+            // 璋冪敤瀛愮粍浠舵墦鍗版柟娉�
+            this.$refs.childs.open(res.data.splitResults);
+            //this.$refs.childs.printSplitLabel(res.data.splitResults);
+          }
           // 鎴愬姛鍚庣户缁仛鐒﹀埌鐗╂枡鏉$爜杈撳叆妗嗭紝鍑嗗涓嬩竴涓壂鐮�
           this.$nextTick(() => {
             this.$refs.barcodeInput.focus();
@@ -979,7 +1139,7 @@
           barcode: this.returnForm.barcode
         });
         
-        if (res.success) {
+        if (res.status) {
           this.$message.success('鍥炲簱鎴愬姛');
           this.showReturnDialog = false;
           this.resetReturnForm();
@@ -1068,12 +1228,15 @@
         if (res.status) {
           this.$message.success('鎷嗗寘鎴愬姛');
           this.showSplitDialog = false;
+              this.splitLoading = false;
           this.resetSplitForm();
           this.loadData();
         } else {
+               this.splitLoading = false;
           this.$message.error(res.message || '鎷嗗寘澶辫触');
         }
       } catch (error) {
+             this.splitLoading = false;
         this.$message.error('鎷嗗寘澶辫触');
       }
     },
@@ -1121,12 +1284,15 @@
         if (res.status) {
           this.$message.success('鎾ら攢鎷嗗寘鎴愬姛');
           this.showRevertSplitDialog = false;
+           this.revertSplitLoading = false;
           this.revertSplitForm.originalBarcode = '';
           this.loadData();
         } else {
+         this.revertSplitLoading = false;
           this.$message.error(res.message || '鎾ら攢鎷嗗寘澶辫触');
         }
       } catch (error) {
+         this.revertSplitLoading = false;
         this.$message.error('鎾ら攢鎷嗗寘澶辫触');
       }
     },

--
Gitblit v1.9.3