From ff0b689043e80743c6d0b76fa578f19efafbf4b8 Mon Sep 17 00:00:00 2001
From: pan <antony1029@163.com>
Date: 星期四, 04 十二月 2025 11:50:04 +0800
Subject: [PATCH] 提交
---
项目代码/WIDESEA_WMSClient/src/views/outbound/BatchPickingConfirm.vue | 662 +++++++++++++++++++++++++++++-------------------------
1 files changed, 356 insertions(+), 306 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/outbound/BatchPickingConfirm.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/outbound/BatchPickingConfirm.vue"
index b938edd..b73d987 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/outbound/BatchPickingConfirm.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/outbound/BatchPickingConfirm.vue"
@@ -92,7 +92,7 @@
</div>
<!-- 鎷嗗寘寮圭獥 -->
- <div v-show="showCustomSplitDialog" class="custom-dialog-overlay" style="z-index: 2001;">
+ <div v-if="showCustomSplitDialog" class="custom-dialog-overlay">
<div class="custom-dialog-wrapper">
<div class="custom-dialog">
<div class="custom-dialog-header">
@@ -154,7 +154,7 @@
</div>
<!-- 鎾ら攢鎷嗗寘寮圭獥 -->
- <div v-show="showRevertSplitDialog" class="custom-dialog-overlay" style="z-index: 2001;">
+ <div v-if="showRevertSplitDialog" class="custom-dialog-overlay">
<div class="custom-dialog-wrapper">
<div class="custom-dialog">
<div class="custom-dialog-header">
@@ -214,7 +214,7 @@
</div>
<!-- 鎷嗗寘閾句俊鎭脊绐� -->
-<div v-show="showSplitChainDialog" class="custom-dialog-overlay" style="z-index: 2003;">
+<div v-if="showSplitChainDialog" class="custom-dialog-overlay">
<div class="custom-dialog-wrapper">
<div class="custom-dialog" style="width: 750px;">
<div class="custom-dialog-header">
@@ -338,7 +338,7 @@
</div>
<!-- 鎵归噺鍥炲簱寮圭獥 -->
- <div v-if="showBatchReturnDialog" class="custom-dialog-overlay" style="z-index: 2004;">
+ <div v-if="showBatchReturnDialog" class="custom-dialog-overlay">
<div class="custom-dialog-wrapper">
<div class="custom-dialog">
<div class="custom-dialog-header">
@@ -370,7 +370,7 @@
</div>
<!-- 鍙栬蛋绌虹寮圭獥 -->
- <div v-if="showEmptyPalletDialog" class="custom-dialog-overlay" style="z-index: 2005;">
+ <div v-if="showEmptyPalletDialog" class="custom-dialog-overlay">
<div class="custom-dialog-wrapper">
<div class="custom-dialog">
<div class="custom-dialog-header">
@@ -412,13 +412,11 @@
import { useRoute } from 'vue-router'
import printView from "@/extension/outbound/extend/printView.vue"
-
export default defineComponent({
name: 'BatchOutboundPicking',
components: {printView},
data() {
return {
- // 淇濇寔鍘熷鏁版嵁缁撴瀯涓嶅彉
scanData: {
orderNo: '',
palletCode: '',
@@ -434,19 +432,19 @@
},
palletStatus: '鏈煡',
- // 寮圭獥鐘舵�� - 淇濇寔鍘熷鐘舵��
+ // 寮圭獥鐘舵��
showCustomSplitDialog: false,
showRevertSplitDialog: false,
showBatchReturnDialog: false,
showEmptyPalletDialog: false,
- showSplitChainDialog: false,
+ showSplitChainDialog: false, // 鏂板锛氭媶鍖呴摼淇℃伅寮圭獥
// 鍔犺浇鐘舵��
splitLoading: false,
revertSplitLoading: false,
batchReturnLoading: false,
emptypalletOutLoading: false,
- splitChainLoading: false,
+ splitChainLoading: false, // 鏂板锛氭媶鍖呴摼鍔犺浇鐘舵��
// 琛ㄥ崟鏁版嵁
splitForm: {
@@ -474,7 +472,7 @@
palletCode: ''
},
- // 鎷嗗寘閾剧浉鍏虫暟鎹�
+ // 鏂板锛氭媶鍖呴摼鐩稿叧鏁版嵁
splitChainInfo: {
originalBarcode: '',
totalSplitTimes: 0,
@@ -504,13 +502,11 @@
]
},
- isProcessing: false,
-
- // 鏂板: 鐢ㄤ簬闃叉寮圭獥閲嶅彔
- isDialogOpening: false
+ isProcessing: false
}
},
computed: {
+ // 鏄惁鍙互鍙栨秷鏁翠釜鎷嗗寘閾�
canCancelWholeChain() {
return this.splitChainInfo.splitChain &&
this.splitChainInfo.splitChain.some(item => !item.isReverted);
@@ -532,7 +528,7 @@
this.$router.back()
},
- // 淇: 娣诲姞闃查噸澶嶇偣鍑绘満鍒�
+ // 鍒嗘嫞鐩稿叧鏂规硶
async confirmPicking() {
if (this.isProcessing) return;
@@ -572,41 +568,16 @@
}
},
- // 淇: 鎵撳紑鎷嗗寘寮圭獥 - 娣诲姞闃查噸鍙犳満鍒�
+ // 鎷嗗寘鐩稿叧鏂规硶
openSplitDialog() {
- if (this.isDialogOpening) return;
-
if (!this.scanData.palletCode) {
this.$message.warning('璇峰厛鎵弿鎵樼洏鐮�');
return;
}
-
- this.isDialogOpening = true;
-
- try {
- // 纭繚鍏抽棴鍏朵粬寮圭獥
- this.closeAllDialogs();
-
- // 寤惰繜鎵撳紑锛岀‘淇滵OM鏇存柊瀹屾垚
- this.$nextTick(() => {
- this.showCustomSplitDialog = true;
- this.resetSplitForm();
- this.splitForm.orderNo = this.scanData.orderNo;
- this.splitForm.palletCode = this.scanData.palletCode;
-
- // 纭繚杈撳叆妗嗚幏寰楃劍鐐�
- this.$nextTick(() => {
- const input = document.querySelector('#splitOriginalBarcode');
- if (input) {
- input.focus();
- }
- this.isDialogOpening = false;
- });
- });
- } catch (error) {
- console.error('鎵撳紑鎷嗗寘寮圭獥澶辫触:', error);
- this.isDialogOpening = false;
- }
+ this.showCustomSplitDialog = true;
+ this.resetSplitForm();
+ this.splitForm.orderNo = this.scanData.orderNo;
+ this.splitForm.palletCode = this.scanData.palletCode;
},
async onSplitBarcodeScan() {
@@ -637,213 +608,293 @@
async handleSplitPackage() {
if (this.$refs.splitFormRef) {
- try {
- const valid = await this.$refs.splitFormRef.validate();
- if (!valid) return;
-
- this.splitLoading = true;
- const res = await http.post('/api/OutboundBatchPicking/split-package', {
- orderNo: this.splitForm.orderNo,
- palletCode: this.splitForm.palletCode,
- originalBarcode: this.splitForm.originalBarcode,
- splitQuantity: this.splitForm.splitQuantity
- });
-
- if (res.status) {
- this.$message.success('鎷嗗寘鎴愬姛');
- this.showCustomSplitDialog = false;
- await this.loadPalletData();
- } else {
- this.$message.error(res.message || '鎷嗗寘澶辫触');
- }
- } catch (error) {
- this.$message.error('鎷嗗寘澶辫触');
- } finally {
- this.splitLoading = false;
- }
- }
- },
-
- // 淇: 鎾ら攢鎷嗗寘寮圭獥
- openRevertSplitDialog() {
- if (this.isDialogOpening) return;
-
- this.isDialogOpening = true;
-
- try {
- this.closeAllDialogs();
-
- this.$nextTick(() => {
- this.showRevertSplitDialog = true;
- this.revertSplitForm.newBarcode = '';
- this.$nextTick(() => {
- const input = document.querySelector('#revertSplitBarcode');
- if (input) {
- input.focus();
+ this.$refs.splitFormRef.validate(async (valid) => {
+ if (valid) {
+ this.splitLoading = true;
+ try {
+ const res = await http.post('/api/OutboundBatchPicking/split-package', {
+ orderNo: this.splitForm.orderNo,
+ palletCode: this.splitForm.palletCode,
+ originalBarcode: this.splitForm.originalBarcode,
+ splitQuantity: this.splitForm.splitQuantity
+ });
+ if (res.status) {
+ this.$message.success('鎷嗗寘鎴愬姛');
+ this.showCustomSplitDialog = false;
+ await this.loadPalletData();
+ } else {
+ this.$message.error(res.message || '鎷嗗寘澶辫触');
+ }
+ } catch (error) {
+ this.$message.error('鎷嗗寘澶辫触');
+ } finally {
+ this.splitLoading = false;
}
- this.isDialogOpening = false;
- });
+ }
});
- } catch (error) {
- console.error('鎵撳紑鎾ら攢鎷嗗寘寮圭獥澶辫触:', error);
- this.isDialogOpening = false;
}
},
-
+// 鍦ㄦ媶鍖呭脊绐椾腑鏌ョ湅鎷嗗寘閾�
+async viewSplitChainFromSplit(barcode) {
+ if (!barcode) {
+ this.$message.warning('璇峰厛杈撳叆鏉$爜');
+ return;
+ }
+
+ // 鍏堝叧闂媶鍖呭脊绐�
+ this.closeCustomSplitDialog();
+
+ await this.$nextTick();
+
+ // 鐒跺悗鎵撳紑鎷嗗寘閾句俊鎭脊绐�
+ await this.viewSplitChain(barcode);
+},
+ // 鎾ら攢鎷嗗寘
async onRevertSplitBarcodeScan() {
if (!this.revertSplitForm.newBarcode) return;
this.revertSplitForm.newBarcode = this.revertSplitForm.newBarcode.replace(/\n/g, '').trim();
+
+ // 鏂板锛氭壂鎻忓悗鑷姩鏄剧ず鎷嗗寘閾句俊鎭�
+ await this.viewSplitChain(this.revertSplitForm.newBarcode);
},
async handleRevertSplit() {
if (this.$refs.revertSplitFormRef) {
- try {
- const valid = await this.$refs.revertSplitFormRef.validate();
- if (!valid) return;
-
- this.revertSplitLoading = true;
- const res = await http.post('/api/OutboundBatchPicking/cancel-split', {
- orderNo: this.scanData.orderNo,
- palletCode: this.scanData.palletCode,
- newBarcode: this.revertSplitForm.newBarcode
- });
-
- if (res.status) {
- this.$message.success('鎾ら攢鎷嗗寘鎴愬姛');
- this.showRevertSplitDialog = false;
- await this.loadPalletData();
- } else {
- this.$message.error(res.message || '鎾ら攢鎷嗗寘澶辫触');
+ this.$refs.revertSplitFormRef.validate(async (valid) => {
+ if (valid) {
+ this.revertSplitLoading = true;
+ try {
+ const res = await http.post('/api/OutboundBatchPicking/cancel-split', {
+ orderNo: this.scanData.orderNo,
+ palletCode: this.scanData.palletCode,
+ newBarcode: this.revertSplitForm.newBarcode
+ });
+ if (res.status) {
+ this.$message.success('鎾ら攢鎷嗗寘鎴愬姛');
+ this.showRevertSplitDialog = false;
+ await this.loadPalletData();
+ } else {
+ this.$message.error(res.message || '鎾ら攢鎷嗗寘澶辫触');
+ }
+ } catch (error) {
+ this.$message.error('鎾ら攢鎷嗗寘澶辫触');
+ } finally {
+ this.revertSplitLoading = false;
+ }
}
- } catch (error) {
- this.$message.error('鎾ら攢鎷嗗寘澶辫触');
- } finally {
- this.revertSplitLoading = false;
- }
- }
- },
-
- // 淇: 鏌ョ湅鎷嗗寘閾�
- async viewSplitChain(barcode) {
- if (!barcode) {
- this.$message.warning('璇峰厛杈撳叆鏉$爜');
- return;
- }
-
- if (this.isDialogOpening) return;
- this.isDialogOpening = true;
-
- this.splitChainLoading = true;
- try {
- const res = await http.post('/api/OutboundBatchPicking/split-package-chain-info', {
- orderNo: this.scanData.orderNo,
- barcode: barcode
});
-
- if (res.status) {
- this.splitChainInfo = res.data;
-
- // 鍏抽棴鍏朵粬寮圭獥
- this.closeAllDialogs();
-
- await this.$nextTick(() => {
- this.showSplitChainDialog = true;
- this.isDialogOpening = false;
- });
- } else {
- this.$message.error(res.message || '鑾峰彇鎷嗗寘閾句俊鎭け璐�');
- this.isDialogOpening = false;
- }
- } catch (error) {
- this.$message.error('鑾峰彇鎷嗗寘閾句俊鎭け璐�');
- this.isDialogOpening = false;
- } finally {
- this.splitChainLoading = false;
}
},
+// 鏌ユ壘瀹屾暣鎷嗗寘閾撅紙浠庢牴鏉$爜寮�濮嬶級
+async findRootChain(currentBarcode) {
+ this.splitChainLoading = true;
+ try {
+ const res = await http.post('/api/OutboundBatchPicking/find-root-split-chain', {
+ orderNo: this.scanData.orderNo,
+ barcode: currentBarcode
+ });
+
+ if (res.status) {
+ this.splitChainInfo = res.data;
+ this.$message.success('宸插姞杞藉畬鏁存媶鍖呴摼');
+ } else {
+ this.$message.error(res.message || '鏌ユ壘瀹屾暣鎷嗗寘閾惧け璐�');
+ }
+ } catch (error) {
+ this.$message.error('鏌ユ壘瀹屾暣鎷嗗寘閾惧け璐�');
+ } finally {
+ this.splitChainLoading = false;
+ }
+},
+ // 鎷嗗寘閾剧浉鍏虫柟娉�
+ // 鏌ョ湅鎷嗗寘閾句俊鎭�
+async viewSplitChain(barcode) {
+ if (!barcode) {
+ this.$message.warning('璇峰厛杈撳叆鏉$爜');
+ return;
+ }
+
+ this.splitChainLoading = true;
+ try {
+ const res = await http.post('/api/OutboundBatchPicking/split-package-chain-info', {
+ orderNo: this.scanData.orderNo,
+ barcode: barcode
+ });
+
+ if (res.status) {
+ this.splitChainInfo = res.data;
+
+ // 鏄剧ず鎻愮ず淇℃伅锛屽憡璇夌敤鎴疯繖鏄粈涔堢被鍨嬬殑鎷嗗寘閾�
+ let chainType = "褰撳墠鏉$爜鐨勬媶鍖呴摼";
+ if (this.splitChainInfo.chainType === 'root') {
+ chainType = "瀹屾暣鎷嗗寘閾撅紙浠庡師濮嬫潯鐮佸紑濮嬶級";
+ } else if (this.splitChainInfo.chainType === 'branch') {
+ chainType = "鍒嗘敮鎷嗗寘閾�";
+ }
+
+ this.$message.info(`宸插姞杞�${chainType}锛屽叡${this.splitChainInfo.totalSplitTimes}娆℃媶鍖卄);
+ this.showSplitChainDialog = true;
+ } else {
+ this.$message.error(res.message || '鑾峰彇鎷嗗寘閾句俊鎭け璐�');
+ }
+ } catch (error) {
+ this.$message.error('鑾峰彇鎷嗗寘閾句俊鎭け璐�');
+ } finally {
+ this.splitChainLoading = false;
+ }
+},
- // 淇: 鍏抽棴鎷嗗寘閾句俊鎭脊绐�
+ // 鍏抽棴鎷嗗寘閾句俊鎭脊绐�
closeSplitChainDialog() {
this.showSplitChainDialog = false;
+
},
-
- // 淇: 鍙栨秷鍗曚釜鎷嗗寘璁板綍
- async cancelSingleSplit(newBarcode) {
- try {
- await ElMessageBox.confirm(
- `纭畾瑕佸彇娑堟潯鐮� ${newBarcode} 鐨勬媶鍖呮搷浣滃悧锛焋,
- '鍙栨秷鍗曚釜鎷嗗寘',
- {
- confirmButtonText: '纭畾鍙栨秷',
- cancelButtonText: '鍐嶆兂鎯�',
- type: 'warning'
- }
- );
-
- this.revertSplitLoading = true;
-
- const res = await http.post('/api/OutboundBatchPicking/cancel-split', {
- orderNo: this.scanData.orderNo,
- palletCode: this.scanData.palletCode,
- newBarcode: newBarcode
- });
-
- if (res.status) {
- this.$message.success('鍙栨秷鎷嗗寘鎴愬姛');
- await this.loadPalletData();
-
- // 閲嶆柊鍔犺浇鎷嗗寘閾句俊鎭�
- if (this.splitChainInfo.originalBarcode) {
- await this.viewSplitChain(this.splitChainInfo.originalBarcode);
- }
- } else {
- this.$message.error(res.message || '鍙栨秷鎷嗗寘澶辫触');
- }
- } catch (error) {
- if (error !== 'cancel') {
- this.$message.error('鍙栨秷鎷嗗寘澶辫触');
- }
- } finally {
- this.revertSplitLoading = false;
+ // 鍦ㄦ挙閿�鎷嗗寘寮圭獥涓煡鐪嬫媶鍖呴摼
+async viewSplitChainFromRevert(barcode) {
+ if (!barcode) {
+ this.$message.warning('璇峰厛杈撳叆鏉$爜');
+ return;
+ }
+
+ // 鍏堝叧闂挙閿�鎷嗗寘寮圭獥
+ this.closeRevertSplitDialog();
+
+ await this.$nextTick();
+
+ // 鐒跺悗鎵撳紑鎷嗗寘閾句俊鎭脊绐�
+ await this.viewSplitChain(barcode);
+},
+// 蹇�熼噸鏂版墦寮�鎷嗗寘閾惧脊绐�
+async quickReopenSplitChainDialog(barcode) {
+ if (!barcode) return;
+
+ this.showSplitChainDialog = true;
+ this.splitChainLoading = true;
+
+ try {
+ const res = await http.post('/api/OutboundBatchPicking/split-package-chain-info', {
+ orderNo: this.scanData.orderNo,
+ barcode: barcode
+ });
+
+ if (res.status) {
+ this.splitChainInfo = res.data;
+ }
+ } catch (error) {
+ console.error('閲嶆柊鍔犺浇鎷嗗寘閾句俊鎭け璐�:', error);
+ } finally {
+ this.splitChainLoading = false;
+ }
+},
+ // 鍙栨秷鍗曚釜鎷嗗寘璁板綍
+async cancelSingleSplit(newBarcode) {
+ // 鍏堣褰曞綋鍓嶄俊鎭紝鐒跺悗鍏抽棴寮圭獥
+ const originalBarcode = this.splitChainInfo.originalBarcode;
+ this.closeSplitChainDialog();
+
+ await this.$nextTick();
+
+ try {
+ await this.$confirm(
+ `纭畾瑕佸彇娑堟潯鐮� ${newBarcode} 鐨勬媶鍖呮搷浣滃悧锛焋,
+ '鍙栨秷鍗曚釜鎷嗗寘',
+ {
+ confirmButtonText: '纭畾鍙栨秷',
+ cancelButtonText: '鍐嶆兂鎯�',
+ type: 'warning'
}
- },
+ );
+
+ this.revertSplitLoading = true;
+
+ const res = await http.post('/api/OutboundBatchPicking/cancel-split', {
+ orderNo: this.scanData.orderNo,
+ palletCode: this.scanData.palletCode,
+ newBarcode: newBarcode
+ });
+
+ if (res.status) {
+ this.$message.success('鍙栨秷鎷嗗寘鎴愬姛');
+ await this.loadPalletData();
+ // 閲嶆柊鎵撳紑寮圭獥鏄剧ず鏇存柊鍚庣殑鐘舵��
+ await this.viewSplitChain(originalBarcode);
+ } else {
+ this.$message.error(res.message || '鍙栨秷鎷嗗寘澶辫触');
+ await this.viewSplitChain(originalBarcode);
+ }
+ } catch (error) {
+ if (error === 'cancel') {
+ // 鐢ㄦ埛鍙栨秷鍚庨噸鏂版墦寮�寮圭獥
+ await this.viewSplitChain(originalBarcode);
+ } else {
+ this.$message.error('鍙栨秷鎷嗗寘澶辫触');
+ await this.viewSplitChain(originalBarcode);
+ }
+ } finally {
+ this.revertSplitLoading = false;
+ }
+},
- // 淇: 鍙栨秷鏁翠釜鎷嗗寘閾�
- async cancelWholeSplitChain() {
- try {
- await ElMessageBox.confirm(
- `纭畾瑕佸彇娑堟暣涓媶鍖呴摼鍚楋紵\n杩欏皢鍙栨秷浠庢潯鐮� ${this.splitChainInfo.originalBarcode} 寮�濮嬬殑鎵�鏈夋媶鍖呮搷浣溿�俙,
- '鍙栨秷鎷嗗寘閾剧‘璁�',
- {
- confirmButtonText: '纭畾鍙栨秷',
- cancelButtonText: '鍐嶆兂鎯�',
- type: 'warning'
- }
- );
-
- this.revertSplitLoading = true;
-
- const res = await http.post('/api/OutboundBatchPicking/cancel-split-chain', {
- orderNo: this.scanData.orderNo,
- palletCode: this.scanData.palletCode,
- startBarcode: this.splitChainInfo.originalBarcode
- });
-
- if (res.status) {
- this.$message.success('鍙栨秷鎷嗗寘閾炬垚鍔�');
- this.closeSplitChainDialog();
- await this.loadPalletData();
- } else {
- this.$message.error(res.message || '鍙栨秷鎷嗗寘閾惧け璐�');
- }
- } catch (error) {
- if (error !== 'cancel') {
- this.$message.error('鍙栨秷鎷嗗寘閾惧け璐�');
- }
- } finally {
- this.revertSplitLoading = false;
+// 鍙栨秷鏁翠釜鎷嗗寘閾�
+async cancelWholeSplitChain() {
+ // 鍏堣褰曞綋鍓嶆媶鍖呴摼淇℃伅锛岀劧鍚庡叧闂脊绐�
+ const originalBarcode = this.splitChainInfo.originalBarcode;
+ this.closeSplitChainDialog();
+
+ // 缁欎竴鐐规椂闂磋寮圭獥瀹屽叏鍏抽棴
+ await this.$nextTick();
+
+ try {
+ // 鐜板湪鏄剧ず纭瀵硅瘽妗嗭紝纭繚瀹冨湪鏈�鍓嶉潰
+ await this.$confirm(
+ `纭畾瑕佸彇娑堟暣涓媶鍖呴摼鍚楋紵\n杩欏皢鍙栨秷浠庢潯鐮� ${originalBarcode} 寮�濮嬬殑鎵�鏈夋媶鍖呮搷浣溿�俙,
+ '鍙栨秷鎷嗗寘閾剧‘璁�',
+ {
+ confirmButtonText: '纭畾鍙栨秷',
+ cancelButtonText: '鍐嶆兂鎯�',
+ type: 'warning',
+ center: true,
+ closeOnClickModal: false
}
- },
+ );
+
+ // 鐢ㄦ埛纭鍚庢墽琛屽彇娑堟搷浣�
+ this.revertSplitLoading = true;
+
+ const res = await http.post('/api/OutboundBatchPicking/cancel-split-chain', {
+ orderNo: this.scanData.orderNo,
+ palletCode: this.scanData.palletCode,
+ startBarcode: originalBarcode
+ });
+
+ console.log('鍙栨秷鎷嗗寘閾惧搷搴�:', res);
+
+ if (res.status) {
+ this.$message.success('鍙栨秷鎷嗗寘閾炬垚鍔�');
+ await this.loadPalletData();
+ // 鍙�夛細閲嶆柊鎵撳紑鎷嗗寘閾句俊鎭脊绐楁樉绀烘洿鏂板悗鐨勭姸鎬�
+ // await this.viewSplitChain(originalBarcode);
+ } else {
+ this.$message.error(res.message || '鍙栨秷鎷嗗寘閾惧け璐�');
+ // 澶辫触鍚庨噸鏂版墦寮�寮圭獥
+ await this.viewSplitChain(originalBarcode);
+ }
+ } catch (error) {
+ // 鐢ㄦ埛鍙栨秷鎿嶄綔
+ if (error === 'cancel') {
+ console.log('鐢ㄦ埛鍙栨秷浜嗘媶鍖呴摼鎿嶄綔');
+ // 鐢ㄦ埛鍙栨秷鍚庨噸鏂版墦寮�寮圭獥
+ await this.viewSplitChain(originalBarcode);
+ } else {
+ console.error('鍙栨秷鎷嗗寘閾鹃敊璇�:', error);
+ this.$message.error('鍙栨秷鎷嗗寘閾惧け璐�: ' + error.message);
+ // 鍑洪敊鍚庨噸鏂版墦寮�寮圭獥
+ await this.viewSplitChain(originalBarcode);
+ }
+ } finally {
+ this.revertSplitLoading = false;
+ }
+},
// 妫�鏌ユ潯鐮佹槸鍚﹀凡琚垎鎷�
hasPicked(barcode) {
@@ -857,31 +908,17 @@
return `${date.getFullYear()}-${(date.getMonth() + 1).toString().padStart(2, '0')}-${date.getDate().toString().padStart(2, '0')} ${date.getHours().toString().padStart(2, '0')}:${date.getMinutes().toString().padStart(2, '0')}:${date.getSeconds().toString().padStart(2, '0')}`;
},
- // 淇: 鏂板鍏抽棴鎵�鏈夊脊绐楃殑鏂规硶
- closeAllDialogs() {
- this.showCustomSplitDialog = false;
- this.showRevertSplitDialog = false;
- this.showSplitChainDialog = false;
- this.showBatchReturnDialog = false;
- this.showEmptyPalletDialog = false;
- },
-
// 鍥炲簱鐩稿叧鏂规硶
openBatchReturnDialog() {
if (!this.scanData.palletCode) {
this.$message.warning('璇峰厛鎵弿鎵樼洏鐮�');
return;
}
-
- this.closeAllDialogs();
-
- this.$nextTick(() => {
- this.showBatchReturnDialog = true;
- this.batchReturnForm.orderNo = this.scanData.orderNo;
- this.batchReturnForm.palletCode = this.scanData.palletCode;
- this.batchReturnForm.unpickedCount = this.summary.unpickedCount;
- this.batchReturnForm.unpickedQuantity = this.summary.unpickedQuantity;
- });
+ this.showBatchReturnDialog = true;
+ this.batchReturnForm.orderNo = this.scanData.orderNo;
+ this.batchReturnForm.palletCode = this.scanData.palletCode;
+ this.batchReturnForm.unpickedCount = this.summary.unpickedCount;
+ this.batchReturnForm.unpickedQuantity = this.summary.unpickedQuantity;
},
async handleBatchReturnConfirm() {
@@ -907,13 +944,9 @@
// 鍙栫┖绠辨柟娉�
handleEmptyPallet() {
- this.closeAllDialogs();
-
- this.$nextTick(() => {
- this.showEmptyPalletDialog = true;
- this.emptypalletOutForm.orderNo = this.scanData.orderNo;
- this.emptypalletOutForm.palletCode = '';
- });
+ this.showEmptyPalletDialog = true;
+ this.emptypalletOutForm.orderNo = this.scanData.orderNo;
+ this.emptypalletOutForm.palletCode = '';
},
async handleEmptyPalletConfirm() {
@@ -941,15 +974,9 @@
async loadPalletData() {
if (!this.scanData.orderNo || !this.scanData.palletCode) return;
- try {
- await Promise.all([
- this.loadUnpickedList(),
- this.loadPickedList(),
- this.loadPalletStatus()
- ]);
- } catch (error) {
- console.error('鍔犺浇鎵樼洏鏁版嵁澶辫触:', error);
- }
+ await this.loadUnpickedList();
+ await this.loadPickedList();
+ await this.loadPalletStatus();
},
async loadUnpickedList() {
@@ -959,12 +986,12 @@
palletCode: this.scanData.palletCode
});
if (res.status) {
+ //this.unpickedList = res.data || [];
this.unpickedList = (res.data || []).filter(item => item.canPick === true);
this.summary.unpickedCount = this.unpickedList.length;
this.summary.unpickedQuantity = this.unpickedList.reduce((sum, item) => sum + (item.remainQuantity || 0), 0);
}
} catch (error) {
- console.error('鍔犺浇鏈嫞閫夊垪琛ㄥけ璐�:', error);
this.$message.error('鍔犺浇鏈嫞閫夊垪琛ㄥけ璐�');
}
},
@@ -976,14 +1003,19 @@
palletCode: this.scanData.palletCode
});
if (res.status) {
- this.pickedList = res.data.map(item => ({
- ...item,
- currentBarcode: item.barcode
- }));
+ this.pickedList = res.data || [];
+
+ this.pickedList = res.data.map(item => {
+ // 鏂瑰紡1锛氫繚鐣欏師barcode瀛楁锛屾柊澧瀋urrentBarcode
+ return {
+ ...item,
+ currentBarcode: item.barcode
+ };
+});
+
this.summary.pickedCount = this.pickedList.length;
}
} catch (error) {
- console.error('鍔犺浇宸叉嫞閫夊垪琛ㄥけ璐�:', error);
this.$message.error('鍔犺浇宸叉嫞閫夊垪琛ㄥけ璐�');
}
},
@@ -998,7 +1030,6 @@
this.palletStatus = res.data.statusText || '鏈煡';
}
} catch (error) {
- console.error('鍔犺浇鎵樼洏鐘舵�佸け璐�:', error);
this.palletStatus = '鏈煡';
}
},
@@ -1043,39 +1074,33 @@
return;
}
- try {
- await ElMessageBox.confirm(
- `纭畾瑕佸彇娑堥�変腑鐨� ${this.selectedPickedRows.length} 椤瑰悧锛焋,
- '鎻愮ず',
- {
- confirmButtonText: '纭畾',
- cancelButtonText: '鍙栨秷',
- type: 'warning'
- }
- );
-
- for (const row of this.selectedPickedRows) {
- try {
- const res = await http.post('/api/OutboundBatchPicking/cancel-picking', {
- orderNo: this.scanData.orderNo,
- palletCode: this.scanData.palletCode,
- barcode: row.currentBarcode
- });
- if (!res.status) {
- this.$message.warning(`鍙栨秷鎷i�夊け璐�: ${row.currentBarcode} - ${res.message}`);
+ this.$confirm(`纭畾瑕佸彇娑堥�変腑鐨� ${this.selectedPickedRows.length} 椤瑰悧锛焋, '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(async () => {
+ try {
+ for (const row of this.selectedPickedRows) {
+ try {
+ const res = await http.post('/api/OutboundBatchPicking/cancel-picking', {
+ orderNo: this.scanData.orderNo,
+ palletCode: this.scanData.palletCode,
+ barcode: row.currentBarcode
+ });
+ if (!res.status) {
+ this.$message.warning(`鍙栨秷鎷i�夊け璐�: ${row.currentBarcode} - ${res.message}`);
+ }
+ } catch (error) {
+ this.$message.warning(`鍙栨秷鎷i�夊け璐�: ${row.currentBarcode} - ${error.message}`);
}
- } catch (error) {
- this.$message.warning(`鍙栨秷鎷i�夊け璐�: ${row.currentBarcode} - ${error.message}`);
- }
- }
- this.$message.success('鎵归噺鍙栨秷瀹屾垚');
- await this.loadPalletData();
- this.selectedPickedRows = [];
- } catch (error) {
- if (error !== 'cancel') {
+ }
+ this.$message.success('鎵归噺鍙栨秷瀹屾垚');
+ await this.loadPalletData();
+ this.selectedPickedRows = [];
+ } catch (error) {
this.$message.error('鎵归噺鍙栨秷鎿嶄綔澶辫触');
}
- }
+ });
},
// 閲嶇疆鏂规硶
@@ -1089,6 +1114,11 @@
closeCustomSplitDialog() {
this.showCustomSplitDialog = false;
this.resetSplitForm();
+ },
+
+ openRevertSplitDialog() {
+ this.showRevertSplitDialog = true;
+ this.revertSplitForm.newBarcode = '';
},
closeRevertSplitDialog() {
@@ -1152,7 +1182,19 @@
color: #909399;
}
-/* 鑷畾涔夊脊绐楁牱寮� - 鍏抽敭淇: 绉婚櫎鍙兘瀵艰嚧鍐茬獊鐨剒-index瑙勫垯 */
+/* 鑷畾涔夊脊绐楁牱寮� */
+:deep(.el-message-box) {
+ z-index: 10010 !important;
+}
+
+:deep(.el-overlay) {
+ z-index: 10009 !important;
+}
+
+:deep(.el-message) {
+ z-index: 10011 !important;
+}
+
.custom-dialog-overlay {
position: fixed;
top: 0;
@@ -1163,11 +1205,12 @@
display: flex;
align-items: center;
justify-content: center;
- /* 绉婚櫎杩欓噷鐨剒-index锛屽湪妯℃澘涓崟鐙缃� */
+ z-index: 2000; /* 淇濇寔涓�涓悎鐞嗙殑 z-index */
}
.custom-dialog-wrapper {
position: relative;
+ z-index: 2001;
}
.custom-dialog {
@@ -1233,7 +1276,14 @@
flex-direction: column;
align-items: stretch;
}
-
+ /* 纭繚纭瀵硅瘽妗嗗湪鏈�鍓嶉潰 */
+.el-message-box__wrapper {
+ z-index: 10001 !important;
+}
+
+.el-message {
+ z-index: 10002 !important;
+}
.scanner-form .el-input {
width: 100%;
}
--
Gitblit v1.9.3