From 9fd72bc9710ec094f7001c8a64fb3d1a882dc02a Mon Sep 17 00:00:00 2001
From: huangxiaoqiang <huangxiaoqiang@hnkhzn.com>
Date: 星期二, 23 十二月 2025 10:15:59 +0800
Subject: [PATCH] 1

---
 项目代码/WIDESEA_WMSClient/src/views/outbound/outPicking.vue |  250 +++++++++++++++++++++++++++++++++++--------------
 1 files changed, 177 insertions(+), 73 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 0fa082e..75de823 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"
@@ -1,6 +1,7 @@
 <template>
     <div class="picking-container" v-loading="globalLoading" element-loading-text="澶勭悊涓�..."
-        element-loading-background="rgba(255, 255, 255, 0.8)">
+        element-loading-background="rgba(255, 255, 255, 0.8)" element-loading-spinner="el-icon-loading"
+        element-loading-custom-class="custom-loading">
         <!-- 椤堕儴璁㈠崟淇℃伅 -->
         <el-card class="order-info-card" shadow="never">
             <div class="order-header">
@@ -9,8 +10,11 @@
                     <span class="order-label">璁㈠崟鍙凤細</span>
                     <span class="order-value">{{ orderNo }}</span>
                 </div>
-                <div class="order-status" v-if="orderInfo">
-                    <el-tag :type="getStatusType(orderInfo.status)" size="medium">
+                <div class="order-status">
+                    <!-- 娴嬭瘯鎸夐挳 -->
+
+                    <el-tag v-if="orderInfo" :type="getStatusType(orderInfo.orderStatus)" size="medium"
+                        style="margin-left: 10px;">
                         {{ orderInfo.statusName || '杩涜涓�' }}
                     </el-tag>
                 </div>
@@ -357,7 +361,7 @@
                         <div class="info-item">
                             <label>鏁村嚭鏁伴噺锛�</label>
                             <span class="info-value highlight">{{ wholeOutInfo.assignQuantity }} {{ wholeOutInfo.unit
-                            }}</span>
+                                }}</span>
                         </div>
                         <div class="info-item">
                             <label>褰撳墠搴撳瓨锛�</label>
@@ -389,6 +393,9 @@
 <script>
 
 import printView from "@/extension/outbound/extend/printView.vue"
+import { stationManager, STATION_STORAGE_KEY } from "@/../src/uitils/stationManager";
+import { ElLoading } from 'element-plus'
+
 export default {
     components: { printView },
     name: 'OutPicking',
@@ -424,7 +431,8 @@
             matMixed: true,
             wholeOutDialogVisible: false,
             wholeOutInfo: null,
-            globalLoading: false
+            globalLoading: false,
+            loadingInstance: null
         }
     },
     computed: {
@@ -444,12 +452,31 @@
                 this.$router.back()
                 return
             }
+
+            // 鍔犺浇璁㈠崟淇℃伅
+            this.loadOrderInfo()
+
             // 鑷姩鑱氱劍鍒版墭鐩樼爜杈撳叆妗�
             this.$nextTick(() => {
                 if (this.$refs.palletInput) {
                     this.$refs.palletInput.focus()
                 }
             })
+        },
+        async loadOrderInfo() {
+            try {
+                this.showFullScreenLoading()
+                const response = await this.http.get(`/api/Outbound/GetOrderInfo?orderNo=${this.orderNo}`)
+                if (response.status) {
+                    this.orderInfo = response.data
+                } else {
+                }
+            }
+            catch (error) {
+
+            } finally {
+                this.hideFullScreenLoading()
+            }
         },
 
         async loadPalletData() {
@@ -459,17 +486,16 @@
             }
 
             try {
-                this.globalLoading = true
+                this.showFullScreenLoading()
                 await Promise.all([
                     this.loadUnpickedData(),
                     this.loadPickedData()
                 ]);
 
             } catch (error) {
-                console.error('鍔犺浇鎵樼洏鏁版嵁澶辫触:', error)
                 this.unpickedData = []
             } finally {
-                this.globalLoading = false
+                this.hideFullScreenLoading()
             }
         },
         loadUnpickedData() {
@@ -493,7 +519,9 @@
                                 }
                             })
                         } else {
-                            this.$message.warning('璇ユ墭鐩樻棤鏈嫞閫変换鍔�')
+                            if (flag) {
+                                this.$message.warning('璇ユ墭鐩樻棤鏈嫞閫変换鍔�')
+                            }
                             this.unpickedData = []
                         }
                         resolve()
@@ -503,7 +531,6 @@
                         reject(response.message || '鑾峰彇鎵樼洏鏁版嵁澶辫触')
                     }
                 }).catch(error => {
-                    console.error('鍔犺浇鏈嫞閫夋暟鎹け璐�:', error)
                     reject(error)
                 })
             })
@@ -526,7 +553,6 @@
                         reject(response.message || '鑾峰彇鎵樼洏鏁版嵁澶辫触')
                     }
                 }).catch(error => {
-                    console.error('鍔犺浇宸叉嫞閫夋暟鎹け璐�:', error)
                     reject(error)
                 })
             })
@@ -563,10 +589,11 @@
             this.pickedTotal = this.pickedCount
         },
 
-        handlePalletScan() {
+        handlePalletScan(flag = true) {
             if (this.scanForm.palletCode) {
                 // this.$message.success(`鎵樼洏鐮�: ${this.scanForm.palletCode}`)
-                this.loadPalletData()
+                this.loadPalletData(flag)
+            } else {
             }
         },
 
@@ -586,41 +613,39 @@
             this.handleConfirmPick()
         },
 
-        handleConfirmPick() {
+        async handleConfirmPick() {
             if (!this.scanForm.palletCode || !this.scanForm.materialBarcode) {
                 this.$message.warning('璇峰厛鎵弿鎵樼洏鐮佸拰鐗╂枡鏉$爜')
                 return
             }
 
             this.confirmLoading = true
-            this.globalLoading = true
+            this.showFullScreenLoading()
 
             try {
-                this.http.post('/api/Outbound/CompleteOutboundWithBarcode', {
+                const response = await this.http.post('/api/Outbound/CompleteOutboundWithBarcode', {
                     orderNo: this.orderNo,
                     palletCode: this.scanForm.palletCode,
                     barcode: this.scanForm.materialBarcode,
                     operator: this.getUserName()
-                }).then(response => {
-                    if (response.status) {
-                        if (response.data.scannedDetail.isUnpacked && response.data.scannedDetail.materialCodes.length > 0) {
-                            this.$refs.printView.open(response.data.scannedDetail.materialCodes);
-                        }
-                        this.$message.success('鎷i�夌‘璁ゆ垚鍔�')
-                        this.resetMaterialBarcode()
-                        // this.loadUnpickedData()
-                        // this.loadPickedData()
-                        this.loadPalletData()
-                    } else {
-                        this.$message.error(response.message || '鎷i�夌‘璁ゅけ璐�')
-                    }
                 })
+                if (response.status) {
+                    if (response.data.scannedDetail.isUnpacked && response.data.scannedDetail.materialCodes.length > 0) {
+                        this.$refs.printView.open(response.data.scannedDetail.materialCodes);
+                    }
+                    this.$message.success('鎷i�夌‘璁ゆ垚鍔�')
+                    this.resetMaterialBarcode()
+                    // this.loadUnpickedData()
+                    // this.loadPickedData()
+                    await this.loadPalletData(false)
+                } else {
+                    this.$message.error(response.message || '鎷i�夌‘璁ゅけ璐�')
+                }
             } catch (error) {
-                console.error('鎷i�夌‘璁ゅけ璐�:', error)
                 this.$message.error('鎷i�夌‘璁ゅけ璐�')
             } finally {
                 this.confirmLoading = false
-                this.globalLoading = false
+                this.hideFullScreenLoading()
             }
         },
 
@@ -646,41 +671,39 @@
             this.confirmDialogVisible = true
         },
 
-        executeConfirm() {
+        async executeConfirm() {
             this.executeLoading = true
-            this.globalLoading = true
+            this.showFullScreenLoading()
 
             try {
                 let apiUrl = ''
                 let params = {
                     orderNo: this.orderNo,
-                    palletCode: this.scanForm.palletCode
+                    palletCode: this.scanForm.palletCode,
+                    station: stationManager.getStation()
                 }
-
                 if (this.currentAction === 'emptyBox') {
                     apiUrl = '/api/Outbound/EmptyBox'
                 } else if (this.currentAction === 'returnToWarehouse') {
                     apiUrl = '/api/Outbound/ReturnToWarehouse'
                 }
 
-                this.http.post(apiUrl, params).then(response => {
+                const response = await this.http.post(apiUrl, params)
 
-                    if (response.status) {
-                        this.$message.success('鎿嶄綔鎴愬姛')
-                        this.confirmDialogVisible = false
-                        this.resetForm()
-                        // this.loadUnpickedData()
-                        // this.loadPickedData()
-                    } else {
-                        this.$message.error(response.message || '鎿嶄綔澶辫触')
-                    }
-                })
+                if (response.status) {
+                    this.$message.success('鎿嶄綔鎴愬姛')
+                    this.confirmDialogVisible = false
+                    this.resetForm()
+                    // this.loadUnpickedData()
+                    // this.loadPickedData()
+                } else {
+                    this.$message.error(response.message || '鎿嶄綔澶辫触')
+                }
             } catch (error) {
-                console.error('鎿嶄綔澶辫触:', error)
                 this.$message.error('鎿嶄綔澶辫触')
             } finally {
                 this.executeLoading = false
-                this.globalLoading = false
+                this.hideFullScreenLoading()
             }
         },
 
@@ -694,7 +717,6 @@
         showWholeOutConfirm() {
             // 鑾峰彇闇�瑕佹暣鍑虹殑鐗╂枡淇℃伅
             const wholeOutItem = this.unpickedData.find(item => item.assignQuantity === item.originalQuantity);
-            console.log('wholeOutItem:', wholeOutItem);
             if (wholeOutItem) {
                 this.wholeOutInfo = {
                     palletCode: this.scanForm.palletCode,
@@ -718,37 +740,35 @@
             }
         },
 
-        executeWholeOut() {
+        async executeWholeOut() {
             if (!this.wholeOutInfo) {
                 this.$message.error('鏁村嚭淇℃伅鏃犳晥');
                 return;
             }
 
             this.executeLoading = true;
-            this.globalLoading = true;
+            this.showFullScreenLoading();
 
             try {
                 // 璋冪敤鏁村嚭鎺ュ彛锛岃繖閲屼娇鐢ㄧ墿鏂欑紪鐮佷綔涓烘潯鐮�
-                this.http.post('/api/Outbound/CompleteOutboundWithPallet', {
+                const response = await this.http.post('/api/Outbound/CompleteOutboundWithPallet', {
                     orderNo: this.orderNo,
                     palletCode: this.scanForm.palletCode,
                     operator: this.getUserName()
-                }).then(response => {
-                    if (response.status) {
-                        this.$message.success('鏁村嚭鎿嶄綔鎴愬姛');
-                        this.wholeOutDialogVisible = false;
-                        this.wholeOutInfo = null;
-                        this.loadPalletData();
-                    } else {
-                        this.$message.error(response.message || '鏁村嚭鎿嶄綔澶辫触');
-                    }
                 });
+                if (response.status) {
+                    this.$message.success('鏁村嚭鎿嶄綔鎴愬姛');
+                    this.wholeOutDialogVisible = false;
+                    this.wholeOutInfo = null;
+                    await this.loadPalletData();
+                } else {
+                    this.$message.error(response.message || '鏁村嚭鎿嶄綔澶辫触');
+                }
             } catch (error) {
-                console.error('鏁村嚭鎿嶄綔澶辫触:', error);
                 this.$message.error('鏁村嚭鎿嶄綔澶辫触');
             } finally {
                 this.executeLoading = false;
-                this.globalLoading = false;
+                this.hideFullScreenLoading();
             }
         },
 
@@ -776,7 +796,6 @@
                 })
             } catch (error) {
                 if (error !== 'cancel') {
-                    console.error('鎾ら攢澶辫触:', error)
                     this.$message.error('鎾ら攢澶辫触')
                 }
             }
@@ -833,7 +852,6 @@
                     return user.userName || user.username || '鏈櫥褰曠敤鎴�'
                 }
             } catch (error) {
-                console.error('鑾峰彇鐢ㄦ埛淇℃伅澶辫触:', error)
             }
 
             return '鏈櫥褰曠敤鎴�'
@@ -864,7 +882,6 @@
 
         // 妫�鏌ユ槸鍚﹀寘鍚暣鍑�
         hasWholeOut() {
-            console.log('妫�鏌ユ暣鍑虹姸鎬�:', this.unpickedData.some(item => item.assignQuantity === item.originalQuantity));
             return this.unpickedData.some(item => item.assignQuantity === item.originalQuantity) && !this.matMixed;
         },
 
@@ -908,12 +925,46 @@
         getStatusType(status) {
             const statusMap = {
                 0: 'info',    // 寰呭鐞�
-                10: 'warning', // 杩涜涓�
+                1: 'warning', // 杩涜涓�
                 20: 'primary', // 鎷i�変腑
                 30: 'success', // 宸插畬鎴�
                 40: 'danger'   // 寮傚父
             }
             return statusMap[status] || 'info'
+        },
+
+        // 鏄剧ず鍏ㄥ睆閬僵灞�
+        showFullScreenLoading() {
+            if (this.loadingInstance) {
+                this.loadingInstance.close()
+            }
+            this.loadingInstance = ElLoading.service({
+                lock: true,
+                text: '澶勭悊涓�...',
+                background: 'rgba(0, 0, 0, 0.7)',
+                customClass: 'custom-full-loading'
+            })
+        },
+
+        // 闅愯棌鍏ㄥ睆閬僵灞�
+        hideFullScreenLoading() {
+            if (this.loadingInstance) {
+                this.loadingInstance.close()
+                this.loadingInstance = null
+            } else {
+            }
+        },
+
+        // 娴嬭瘯閬僵灞傛樉绀�
+        testLoading() {
+            // 娴嬭瘯涓ょ鏂瑰紡
+            this.globalLoading = true
+            // 鍚屾椂涔熸祴璇曞叏灞弆oading
+            this.showFullScreenLoading()
+            setTimeout(() => {
+                this.globalLoading = false
+                this.hideFullScreenLoading()
+            }, 3000)
         }
     }
 }
@@ -1376,18 +1427,71 @@
 }
 
 /* Element Plus Loading 閬僵灞傛牱寮忎慨澶� */
+::v-deep .custom-loading {
+    background-color: rgba(0, 0, 0, 0.7) !important;
+    z-index: 9999 !important;
+}
+
+::v-deep .custom-loading .el-loading-mask {
+    background-color: rgba(0, 0, 0, 0.7) !important;
+}
+
+::v-deep .custom-loading .el-loading-spinner {
+    z-index: 10000 !important;
+}
+
+::v-deep .custom-loading .el-loading-text {
+    color: #ffffff !important;
+    font-weight: bold !important;
+    font-size: 16px !important;
+}
+
+/* 鍏ㄥ眬 Loading 鏍峰紡 */
 ::v-deep .el-loading-mask {
-    background-color: rgba(255, 255, 255, 0.8);
-    z-index: 2000;
+    background-color: rgba(0, 0, 0, 0.7) !important;
+    z-index: 9999 !important;
 }
 
 ::v-deep .el-loading-spinner {
-    z-index: 2001;
+    z-index: 10000 !important;
 }
 
 ::v-deep .el-loading-text {
-    color: #409EFF;
-    font-weight: bold;
-    font-size: 14px;
+    color: #ffffff !important;
+    font-weight: bold !important;
+}
+
+/* 鍏ㄥ睆Loading鑷畾涔夋牱寮� */
+::v-deep .custom-full-loading {
+    z-index: 999999 !important;
+}
+
+::v-deep .custom-full-loading .el-loading-mask {
+    z-index: 999999 !important;
+}
+
+::v-deep .custom-full-loading .el-loading-spinner {
+    z-index: 1000000 !important;
+}
+
+::v-deep .custom-full-loading .el-loading-text {
+    color: #ffffff !important;
+    font-weight: bold !important;
+    font-size: 18px !important;
+}
+
+/* 纭繚瀵硅瘽妗嗕笉浼氶伄鐩杔oading */
+::v-deep .el-dialog {
+    z-index: 2000 !important;
+}
+
+::v-deep .el-dialog__wrapper {
+    z-index: 2000 !important;
+}
+
+/* 纭繚瀹瑰櫒鐩稿瀹氫綅 */
+.picking-container {
+    position: relative !important;
+    min-height: 100vh;
 }
 </style>
\ No newline at end of file

--
Gitblit v1.9.3