From 1378fc4cd7abc24ed3a982e09437c2c8a74e9f2f Mon Sep 17 00:00:00 2001
From: 647556386 <647556386@qq.com>
Date: 星期二, 27 一月 2026 19:06:32 +0800
Subject: [PATCH] 代码优化
---
项目代码/WIDESEA_WMSClient/src/views/outbound/outPicking.vue | 113 ++++++++++++++++++++++++++++++++++++++------------------
1 files changed, 77 insertions(+), 36 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 3ad4a98..6a629dc 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"
@@ -499,42 +499,81 @@
}
},
loadUnpickedData() {
- return new Promise((resolve, reject) => {
- this.http.post(`/api/Outbound/QueryPickingTasks?orderNo=${this.orderNo}&palletCode=${this.scanForm.palletCode}`, {}).then(response => {
- if (response.status) {
- if (response.data.outStockLockInfos.length > 0) {
- this.unpickedData = response.data.outStockLockInfos;
- this.matMixed = response.data.isMatMixed;
- this.calculateUnpickedStats()
- // 妫�鏌ユ槸鍚﹂渶瑕佹暣鍑虹‘璁�
- this.$nextTick(() => {
- if (this.hasWholeOut()) {
- this.showWholeOutConfirm()
- }
- })
- // 鑷姩鑱氱劍鍒扮墿鏂欐潯鐮佽緭鍏ユ
- this.$nextTick(() => {
- if (this.$refs.materialInput) {
- this.$refs.materialInput.focus()
- }
- })
- } else {
- if (flag) {
- this.$message.warning('璇ユ墭鐩樻棤鏈嫞閫変换鍔�')
- }
- this.unpickedData = []
+ return new Promise((resolve, reject) => {
+ // 鍏堟竻绌轰箣鍓嶇殑鎻愮ず锛岄伩鍏嶉噸澶嶆彁绀�
+ this.$message.closeAll();
+
+ this.http.post(`/api/Outbound/QueryPickingTasks?orderNo=${this.orderNo}&palletCode=${this.scanForm.palletCode}`, {}).then(response => {
+ if (response.status) {
+ // 鎯呭喌1锛氭湁鏈嫞閫夋暟鎹�
+ if (response.data.outStockLockInfos && response.data.outStockLockInfos.length > 0) {
+ this.unpickedData = response.data.outStockLockInfos;
+ this.matMixed = response.data.isMatMixed;
+ this.orderOver = response.data.orderOver;
+ this.calculateUnpickedStats()
+
+ // 妫�鏌ユ暣鍑虹‘璁�
+ this.$nextTick(() => {
+ if (this.hasWholeOut()) {
+ this.showWholeOutConfirm()
}
- resolve()
- } else {
- this.$message.error(response.message || '鑾峰彇鎵樼洏鏁版嵁澶辫触')
- this.unpickedData = []
- reject(response.message || '鑾峰彇鎵樼洏鏁版嵁澶辫触')
- }
- }).catch(error => {
- reject(error)
- })
- })
- },
+ })
+
+ // 鑱氱劍鐗╂枡鏉$爜杈撳叆妗�
+ this.$nextTick(() => {
+ if (this.$refs.materialInput) {
+ this.$refs.materialInput.focus()
+ }
+ })
+ }
+ // 鎯呭喌2锛氭棤鏈嫞閫夋暟鎹�
+ else {
+ this.unpickedData = [];
+ this.calculateUnpickedStats(); // 閲嶇疆缁熻鏁版嵁
+
+ // 鍙嬪ソ鎻愮ず + 浜や簰浼樺寲
+ this.$message.success({
+ message: `鎵樼洏銆�${this.scanForm.palletCode}銆戝凡鎷i�夊畬鎴愶紝鏆傛棤鎷i�夎褰昤,
+ duration: 3000, // 鎻愮ず鏄剧ず3绉�
+ showClose: true // 鍏佽鎵嬪姩鍏抽棴
+ });
+
+ // 娓呯┖鐗╂枡鏉$爜骞惰仛鐒﹀洖鎵樼洏鐮佽緭鍏ユ
+ this.scanForm.materialBarcode = '';
+ this.$nextTick(() => {
+ if (this.$refs.palletInput) {
+ this.$refs.palletInput.focus();
+ }
+ });
+ }
+ resolve();
+ }
+ // 鎯呭喌3锛氭帴鍙h繑鍥炲け璐�
+ else {
+ this.unpickedData = [];
+ this.calculateUnpickedStats();
+
+ this.$message.error({
+ message: response.message || `鑾峰彇鎵樼洏銆�${this.scanForm.palletCode}銆戞嫞閫夋暟鎹け璐,
+ duration: 5000,
+ showClose: true
+ });
+ reject(response.message || '鑾峰彇鎵樼洏鏁版嵁澶辫触');
+ }
+ }).catch(error => {
+ // 鎯呭喌4锛氱綉缁�/璇锋眰寮傚父
+ this.unpickedData = [];
+ this.calculateUnpickedStats();
+
+ this.$message.error({
+ message: `鑾峰彇鎵樼洏銆�${this.scanForm.palletCode}銆戞嫞閫夋暟鎹紓甯革細${error.message || '缃戠粶閿欒锛岃閲嶈瘯'}`,
+ duration: 5000,
+ showClose: true
+ });
+ reject(error);
+ })
+ })
+},
loadPickedData() {
return new Promise((resolve, reject) => {
@@ -545,8 +584,10 @@
this.calculatePickedStats()
} else {
this.pickedData = []
+
}
resolve()
+
} else {
this.$message.error(response.message || '鑾峰彇鎵樼洏鏁版嵁澶辫触')
this.pickedData = []
@@ -882,7 +923,7 @@
// 妫�鏌ユ槸鍚﹀寘鍚暣鍑�
hasWholeOut() {
- return this.unpickedData.some(item => item.assignQuantity === item.originalQuantity) && !this.matMixed
+ return this.unpickedData.some(item => item.assignQuantity === item.originalQuantity) && !this.matMixed && !this.orderOver
},
// 璁$畻鍓╀綑搴撳瓨
--
Gitblit v1.9.3