From e57b06871c0a0276a308592f7906678e8be4dbe4 Mon Sep 17 00:00:00 2001
From: heshaofeng <heshaofeng@hnkhzn.com>
Date: 星期六, 06 十二月 2025 23:12:58 +0800
Subject: [PATCH] 提交
---
项目代码/WIDESEA_WMSClient/src/views/outbound/BatchPickingConfirm.vue | 1181 ++++++++++++++++++++++++++++++++++++++++------------------
1 files changed, 818 insertions(+), 363 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 c98438a..1c9c6a2 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"
@@ -27,8 +27,8 @@
@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>
</div>
@@ -92,7 +92,7 @@
</div>
<!-- 鎷嗗寘寮圭獥 -->
- <div v-show="showCustomSplitDialog" class="custom-dialog-overlay">
+ <div v-if="showCustomSplitDialog" class="custom-dialog-overlay" style="z-index: 2000;">
<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">
+ <div v-if="showRevertSplitDialog" class="custom-dialog-overlay" style="z-index: 2001;">
<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">
+<div v-if="showSplitChainDialog" class="custom-dialog-overlay" style="z-index: 2002;">
<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">
+ <div v-if="showBatchReturnDialog" class="custom-dialog-overlay" style="z-index: 2003;">
<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">
+ <div v-if="showEmptyPalletDialog" class="custom-dialog-overlay" style="z-index: 2004;">
<div class="custom-dialog-wrapper">
<div class="custom-dialog">
<div class="custom-dialog-header">
@@ -405,11 +405,12 @@
</div>
</template>
+
+
<script>
import http from '@/api/http.js'
-import { ref, defineComponent } from "vue";
+import { defineComponent } from "vue";
import { ElMessage } from 'element-plus'
-import { useRoute } from 'vue-router'
import printView from "@/extension/outbound/extend/printView.vue"
export default defineComponent({
@@ -417,6 +418,7 @@
components: {printView},
data() {
return {
+ // 淇濇寔鎵�鏈夊師濮嬫暟鎹粨鏋勪笉鍙�...
scanData: {
orderNo: '',
palletCode: '',
@@ -432,21 +434,24 @@
},
palletStatus: '鏈煡',
- // 寮圭獥鐘舵��
+ // 寮圭獥鐘舵�� - 鍏抽敭淇锛氬彧鍏佽涓�涓脊绐楁墦寮�
+ activeDialog: null, // 'split', 'revert', 'batchReturn', 'emptyPallet', 'splitChain'
showCustomSplitDialog: false,
showRevertSplitDialog: false,
showBatchReturnDialog: false,
showEmptyPalletDialog: false,
- showSplitChainDialog: false, // 鏂板锛氭媶鍖呴摼淇℃伅寮圭獥
+ showSplitChainDialog: false,
+ // 娣诲姞闃查噸澶嶇偣鍑绘爣蹇�
+ isOpeningDialog: false,
// 鍔犺浇鐘舵��
splitLoading: false,
revertSplitLoading: false,
batchReturnLoading: false,
emptypalletOutLoading: false,
- splitChainLoading: false, // 鏂板锛氭媶鍖呴摼鍔犺浇鐘舵��
+ splitChainLoading: false,
- // 琛ㄥ崟鏁版嵁
+ // 琛ㄥ崟鏁版嵁...
splitForm: {
orderNo: '',
palletCode: '',
@@ -472,14 +477,13 @@
palletCode: ''
},
- // 鏂板锛氭媶鍖呴摼鐩稿叧鏁版嵁
splitChainInfo: {
originalBarcode: '',
totalSplitTimes: 0,
splitChain: []
},
- // 楠岃瘉瑙勫垯
+ // 楠岃瘉瑙勫垯...
splitFormRules: {
originalBarcode: [
{ required: true, message: '璇疯緭鍏ュ師鏉$爜', trigger: 'blur' }
@@ -501,88 +505,21 @@
{ required: true, message: '璇疯緭鍏ユ墭鐩樼爜', trigger: 'blur' }
]
},
- // 寮圭獥鐘舵�� - 鏀逛负浣跨敤瀵硅薄绠$悊锛岄伩鍏嶅悓鏃舵墦寮�澶氫釜寮圭獥
- dialogs: {
- customSplit: false,
- revertSplit: false,
- splitChain: false,
- batchReturn: false,
- emptyPallet: false
- },
- // 鍔犺浇鐘舵��
- loading: {
- split: false,
- revertSplit: false,
- batchReturn: false,
- emptyPallet: false,
- splitChain: false
- },
-
- // 褰撳墠娲诲姩鐨勫脊绐楃被鍨�
- activeDialog: null,
isProcessing: false
}
},
+ watch: {
+ // 鍏抽敭淇锛氱‘淇濆悓涓�鏃堕棿鍙湁涓�涓脊绐楁墦寮�
+ activeDialog(newVal, oldVal) {
+ this.showCustomSplitDialog = newVal === 'split'
+ this.showRevertSplitDialog = newVal === 'revert'
+ this.showBatchReturnDialog = newVal === 'batchReturn'
+ this.showEmptyPalletDialog = newVal === 'emptyPallet'
+ this.showSplitChainDialog = newVal === 'splitChain'
+ }
+ },
computed: {
- // 璁$畻灞炴�ф槧灏勫埌dialogs瀵硅薄
- showCustomSplitDialog: {
- get() { return this.dialogs.customSplit; },
- set(val) {
- this.dialogs.customSplit = val;
- this.activeDialog = val ? 'customSplit' : null;
- }
- },
- showRevertSplitDialog: {
- get() { return this.dialogs.revertSplit; },
- set(val) {
- this.dialogs.revertSplit = val;
- this.activeDialog = val ? 'revertSplit' : null;
- }
- },
- showSplitChainDialog: {
- get() { return this.dialogs.splitChain; },
- set(val) {
- this.dialogs.splitChain = val;
- this.activeDialog = val ? 'splitChain' : null;
- }
- },
- showBatchReturnDialog: {
- get() { return this.dialogs.batchReturn; },
- set(val) {
- this.dialogs.batchReturn = val;
- this.activeDialog = val ? 'batchReturn' : null;
- }
- },
- showEmptyPalletDialog: {
- get() { return this.dialogs.emptyPallet; },
- set(val) {
- this.dialogs.emptyPallet = val;
- this.activeDialog = val ? 'emptyPallet' : null;
- },
- },
- // 鍔犺浇鐘舵�佹槧灏�
- splitLoading: {
- get() { return this.loading.split; },
- set(val) { this.loading.split = val; }
- },
- revertSplitLoading: {
- get() { return this.loading.revertSplit; },
- set(val) { this.loading.revertSplit = val; }
- },
- batchReturnLoading: {
- get() { return this.loading.batchReturn; },
- set(val) { this.loading.batchReturn = val; }
- },
- emptypalletOutLoading: {
- get() { return this.loading.emptyPallet; },
- set(val) { this.loading.emptyPallet = val; }
- },
- splitChainLoading: {
- get() { return this.loading.splitChain; },
- set(val) { this.loading.splitChain = val; }
- },
- // 鏄惁鍙互鍙栨秷鏁翠釜鎷嗗寘閾�
canCancelWholeChain() {
return this.splitChainInfo.splitChain &&
this.splitChainInfo.splitChain.some(item => !item.isReverted);
@@ -595,9 +532,13 @@
this.batchReturnForm.orderNo = this.$route.query.orderNo;
this.emptypalletOutForm.orderNo = this.$route.query.orderNo;
}
- this.$nextTick(() => {
- this.$refs.palletInput.focus();
+ // 浣跨敤 requestAnimationFrame 纭繚椤甸潰瀹屽叏鍔犺浇
+ requestAnimationFrame(() => {
+ if (this.$refs.palletInput) {
+ this.$refs.palletInput.focus();
+ }
});
+
},
methods: {
goBack(){
@@ -644,29 +585,445 @@
}
},
- // 鎷嗗寘鐩稿叧鏂规硶
- openSplitDialog() {
+ openSplitDialog() {
+ console.log('绱ф�ヤ慨澶嶇増锛氭墦寮�鎷嗗寘寮圭獥');
+
if (!this.scanData.palletCode) {
this.$message.warning('璇峰厛鎵弿鎵樼洏鐮�');
return;
}
- // 鍏抽棴鍏朵粬鎵�鏈夊脊绐�
+
+ // 1. 鍏抽棴鎵�鏈塚ue寮圭獥
this.closeAllDialogs();
- // 寤惰繜鎵撳紑鏂板脊绐楋紝纭繚鍏朵粬寮圭獥瀹屽叏鍏抽棴
- this.$nextTick(() => {
- this.showCustomSplitDialog = true;
- this.resetSplitForm();
- this.splitForm.orderNo = this.scanData.orderNo;
- this.splitForm.palletCode = this.scanData.palletCode;
-
- // 纭繚杈撳叆妗嗚幏寰楃劍鐐�
- this.$nextTick(() => {
- const inputs = document.querySelectorAll('.custom-dialog input');
- if (inputs.length > 0) {
- inputs[0].focus();
+
+ // 2. 寮哄埗浠嶥OM涓Щ闄ゆ墍鏈夊脊绐�
+ setTimeout(() => {
+ const dialogs = document.querySelectorAll('.custom-dialog-overlay');
+ dialogs.forEach(dialog => {
+ if (dialog.parentNode) {
+ dialog.parentNode.removeChild(dialog);
}
});
- });
+
+ // 濡傛灉宸茬粡瀛樺湪鎵嬪姩寮圭獥锛屽厛绉婚櫎
+ if (this.manualDialog && this.manualDialog.parentNode) {
+ this.manualDialog.parentNode.removeChild(this.manualDialog);
+ }
+
+ // 3. 绛夊緟涓�甯�
+ requestAnimationFrame(() => {
+ // 4. 鐩存帴鍒涘缓鏂板脊绐楋紝涓嶄緷璧朧ue鐨勫搷搴斿紡绯荤粺
+ this.createManualSplitDialog();
+ });
+ }, 10);
+ },
+
+ // 鍒涘缓鎵嬪姩鎷嗗寘寮圭獥
+ createManualSplitDialog() {
+ const newDialog = document.createElement('div');
+ newDialog.className = 'custom-dialog-overlay emergency-fix';
+
+ // 鐢熸垚闅忔満ID鐢ㄤ簬浜嬩欢缁戝畾
+ const dialogId = 'manual-dialog-' + Date.now();
+ newDialog.id = dialogId;
+
+ // 瀛樺偍寮曠敤
+ this.manualDialog = newDialog;
+
+ // 寮圭獥鍐呭
+ newDialog.innerHTML = `
+ <div class="custom-dialog-wrapper">
+ <div class="custom-dialog" style="width: 500px;">
+ <div class="custom-dialog-header">
+ <h3 style="margin: 0; color: #303133;">鎷嗗寘鎿嶄綔</h3>
+ <button class="close-button" onclick="document.getElementById('${dialogId}').remove()" style="
+ font-size: 18px;
+ color: #909399;
+ padding: 0;
+ width: 24px;
+ height: 24px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ background: none;
+ border: none;
+ cursor: pointer;
+ ">脳</button>
+ </div>
+ <div class="custom-dialog-body" style="padding: 20px;">
+ <div style="margin-bottom: 15px;">
+ <div style="display: flex; align-items: center; margin-bottom: 5px;">
+ <span style="width: 100px; text-align: right; padding-right: 12px; color: #606266;">璁㈠崟缂栧彿:</span>
+ <input type="text" value="${this.scanData.orderNo}" disabled style="
+ flex: 1;
+ padding: 8px 12px;
+ border: 1px solid #dcdfe6;
+ border-radius: 4px;
+ background-color: #f5f7fa;
+ color: #909399;
+ ">
+ </div>
+ </div>
+
+ <div style="margin-bottom: 15px;">
+ <div style="display: flex; align-items: center; margin-bottom: 5px;">
+ <span style="width: 100px; text-align: right; padding-right: 12px; color: #606266;">鎵樼洏缂栧彿:</span>
+ <input type="text" value="${this.scanData.palletCode}" disabled style="
+ flex: 1;
+ padding: 8px 12px;
+ border: 1px solid #dcdfe6;
+ border-radius: 4px;
+ background-color: #f5f7fa;
+ color: #909399;
+ ">
+ </div>
+ </div>
+
+ <div style="margin-bottom: 15px;">
+ <div style="display: flex; align-items: center; margin-bottom: 5px;">
+ <span style="width: 100px; text-align: right; padding-right: 12px; color: #606266;">鍘熸潯鐮�:</span>
+ <div style="flex: 1; display: flex; align-items: center; gap: 10px;">
+ <input type="text" id="${dialogId}-barcode" placeholder="鎵弿鍘熸潯鐮�" style="
+ flex: 1;
+ padding: 8px 12px;
+ border: 1px solid #dcdfe6;
+ border-radius: 4px;
+ ">
+ <button id="${dialogId}-viewChain" style="
+ padding: 8px 16px;
+ background: #409eff;
+ color: white;
+ border: none;
+ border-radius: 4px;
+ cursor: pointer;
+ white-space: nowrap;
+ ">鏌ョ湅鎷嗗寘閾�</button>
+ </div>
+ </div>
+ </div>
+
+ <div style="margin-bottom: 15px;">
+ <div style="display: flex; align-items: center; margin-bottom: 5px;">
+ <span style="width: 100px; text-align: right; padding-right: 12px; color: #606266;">鐗╂枡缂栫爜:</span>
+ <input type="text" id="${dialogId}-materiel" disabled style="
+ flex: 1;
+ padding: 8px 12px;
+ border: 1px solid #dcdfe6;
+ border-radius: 4px;
+ background-color: #f5f7fa;
+ color: #909399;
+ ">
+ </div>
+ </div>
+
+ <div style="margin-bottom: 15px;">
+ <div style="display: flex; align-items: center; margin-bottom: 5px;">
+ <span style="width: 100px; text-align: right; padding-right: 12px; color: #606266;">鍓╀綑鏁伴噺:</span>
+ <input type="text" id="${dialogId}-remain" disabled style="
+ flex: 1;
+ padding: 8px 12px;
+ border: 1px solid #dcdfe6;
+ border-radius: 4px;
+ background-color: #f5f7fa;
+ color: #909399;
+ ">
+ </div>
+ </div>
+
+ <div style="margin-bottom: 15px;">
+ <div style="display: flex; align-items: center; margin-bottom: 5px;">
+ <span style="width: 100px; text-align: right; padding-right: 12px; color: #606266;">鎷嗗寘鏁伴噺:</span>
+ <div style="flex: 1;">
+ <input type="number" id="${dialogId}-splitQty" value="1" min="0.01" step="0.01" style="
+ width: 100%;
+ padding: 8px 12px;
+ border: 1px solid #dcdfe6;
+ border-radius: 4px;
+ ">
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <div class="custom-dialog-footer" style="
+ padding: 10px 20px 20px;
+ text-align: right;
+ border-top: 1px solid #ebeef5;
+ ">
+ <button id="${dialogId}-cancel" style="
+ padding: 9px 15px;
+ background: white;
+ color: #606266;
+ border: 1px solid #dcdfe6;
+ border-radius: 4px;
+ cursor: pointer;
+ margin-right: 10px;
+ ">鍙栨秷</button>
+ <button id="${dialogId}-confirm" style="
+ padding: 9px 15px;
+ background: #409eff;
+ color: white;
+ border: none;
+ border-radius: 4px;
+ cursor: pointer;
+ ">纭鎷嗗寘</button>
+ </div>
+ </div>
+ </div>
+ `;
+
+ // 娣诲姞鏍峰紡
+ newDialog.style.cssText = `
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background: rgba(0,0,0,0.5);
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ z-index: 999999;
+ `;
+
+ // 寮圭獥瀹瑰櫒鏍峰紡
+ const wrapper = newDialog.querySelector('.custom-dialog-wrapper');
+ if (wrapper) {
+ wrapper.style.position = 'relative';
+ wrapper.style.zIndex = '1000000';
+ }
+
+ // 寮圭獥鍐呭鏍峰紡
+ const dialog = newDialog.querySelector('.custom-dialog');
+ if (dialog) {
+ dialog.style.background = 'white';
+ dialog.style.borderRadius = '4px';
+ dialog.style.maxWidth = '90vw';
+ dialog.style.maxHeight = '90vh';
+ dialog.style.boxShadow = '0 2px 12px 0 rgba(0, 0, 0, 0.1)';
+ dialog.style.overflow = 'auto';
+ }
+
+ // 寮圭獥澶撮儴鏍峰紡
+ const header = newDialog.querySelector('.custom-dialog-header');
+ if (header) {
+ header.style.display = 'flex';
+ header.style.justifyContent = 'space-between';
+ header.style.alignItems = 'center';
+ header.style.padding = '20px 20px 10px';
+ header.style.borderBottom = '1px solid #ebeef5';
+ }
+
+ document.body.appendChild(newDialog);
+ console.log('绱ф�ュ脊绐楀凡鍒涘缓');
+
+ // 缁戝畾浜嬩欢
+ this.bindManualDialogEvents(dialogId);
+
+ // 鑷姩鑱氱劍鍒版潯鐮佽緭鍏ユ
+ setTimeout(() => {
+ const barcodeInput = document.getElementById(`${dialogId}-barcode`);
+ if (barcodeInput) {
+ barcodeInput.focus();
+ // 娣诲姞鍥炶溅閿洃鍚�
+ barcodeInput.addEventListener('keyup', (event) => {
+ if (event.key === 'Enter') {
+ this.onManualSplitBarcodeScan(dialogId);
+ }
+ });
+ }
+ }, 100);
+ },
+
+ // 缁戝畾鎵嬪姩寮圭獥浜嬩欢
+ bindManualDialogEvents(dialogId) {
+ const vm = this; // 淇濆瓨Vue瀹炰緥寮曠敤
+
+ // 鏌ョ湅鎷嗗寘閾炬寜閽�
+ const viewChainBtn = document.getElementById(`${dialogId}-viewChain`);
+ if (viewChainBtn) {
+ viewChainBtn.onclick = () => {
+ const barcodeInput = document.getElementById(`${dialogId}-barcode`);
+ if (barcodeInput && barcodeInput.value.trim()) {
+ vm.viewSplitChainFromManualDialog(barcodeInput.value.trim(), dialogId);
+ } else {
+ ElMessage.warning('璇峰厛杈撳叆鏉$爜');
+ }
+ };
+ }
+
+ // 鍙栨秷鎸夐挳
+ const cancelBtn = document.getElementById(`${dialogId}-cancel`);
+ if (cancelBtn) {
+ cancelBtn.onclick = () => {
+ const dialog = document.getElementById(dialogId);
+ if (dialog && dialog.parentNode) {
+ dialog.parentNode.removeChild(dialog);
+ }
+ };
+ }
+
+ // 纭鎷嗗寘鎸夐挳
+ const confirmBtn = document.getElementById(`${dialogId}-confirm`);
+ if (confirmBtn) {
+ confirmBtn.onclick = () => {
+ vm.handleManualSplitPackage(dialogId);
+ };
+ }
+
+ // 鏉$爜杈撳叆妗嗗彉鍖栦簨浠�
+ const barcodeInput = document.getElementById(`${dialogId}-barcode`);
+ if (barcodeInput) {
+ // 闃叉姈澶勭悊
+ let timeout;
+ barcodeInput.addEventListener('input', () => {
+ clearTimeout(timeout);
+ timeout = setTimeout(() => {
+ if (barcodeInput.value.trim()) {
+ vm.onManualSplitBarcodeScan(dialogId);
+ }
+ }, 500);
+ });
+ }
+ },
+
+ // 鎵嬪姩寮圭獥鐨勬潯鐮佹壂鎻忓鐞�
+ async onManualSplitBarcodeScan(dialogId) {
+ const barcodeInput = document.getElementById(`${dialogId}-barcode`);
+ if (!barcodeInput || !barcodeInput.value.trim()) return;
+
+ const barcode = barcodeInput.value.trim();
+
+ try {
+ const res = await http.post('/api/OutboundBatchPicking/split-package-info', {
+ orderNo: this.scanData.orderNo,
+ palletCode: this.scanData.palletCode,
+ barcode: barcode
+ });
+
+ if (res.status) {
+ // 鏇存柊鐗╂枡缂栫爜
+ const materielInput = document.getElementById(`${dialogId}-materiel`);
+ if (materielInput) {
+ materielInput.value = res.data.materielCode || '';
+ }
+
+ // 鏇存柊鍓╀綑鏁伴噺
+ const remainInput = document.getElementById(`${dialogId}-remain`);
+ if (remainInput) {
+ remainInput.value = res.data.remainQuantity || 0;
+ }
+
+ // 鏇存柊鎷嗗寘鏁伴噺锛堥粯璁や负1锛屼笉瓒呰繃鍓╀綑鏁伴噺锛�
+ const splitQtyInput = document.getElementById(`${dialogId}-splitQty`);
+ if (splitQtyInput) {
+ const maxQty = res.data.remainQuantity || 0;
+ splitQtyInput.max = maxQty;
+ const currentVal = parseFloat(splitQtyInput.value) || 1;
+ if (currentVal > maxQty) {
+ splitQtyInput.value = Math.min(1, maxQty);
+ }
+ }
+ } else {
+ ElMessage.error(res.message || '鑾峰彇鎷嗗寘淇℃伅澶辫触');
+ }
+ } catch (error) {
+ console.error('鑾峰彇鎷嗗寘淇℃伅澶辫触:', error);
+ ElMessage.error('鑾峰彇鎷嗗寘淇℃伅澶辫触');
+ }
+ },
+
+ // 浠庢墜鍔ㄥ脊绐楁煡鐪嬫媶鍖呴摼
+ viewSplitChainFromManualDialog(barcode, dialogId) {
+ // 鍏堝叧闂墜鍔ㄥ脊绐�
+ const dialog = document.getElementById(dialogId);
+ if (dialog && dialog.parentNode) {
+ dialog.parentNode.removeChild(dialog);
+ }
+
+ // 寤惰繜涓�涓嬶紝鐒跺悗鎵撳紑Vue鐨勬媶鍖呴摼寮圭獥
+ setTimeout(() => {
+ this.viewSplitChain(barcode);
+ }, 50);
+ },
+
+ // 澶勭悊鎵嬪姩寮圭獥鐨勬媶鍖呮搷浣�
+ async handleManualSplitPackage(dialogId) {
+ const barcodeInput = document.getElementById(`${dialogId}-barcode`);
+ const splitQtyInput = document.getElementById(`${dialogId}-splitQty`);
+
+ if (!barcodeInput || !barcodeInput.value.trim()) {
+ ElMessage.warning('璇疯緭鍏ュ師鏉$爜');
+ return;
+ }
+
+ if (!splitQtyInput || !splitQtyInput.value || parseFloat(splitQtyInput.value) <= 0) {
+ ElMessage.warning('璇疯緭鍏ユ湁鏁堢殑鎷嗗寘鏁伴噺');
+ return;
+ }
+
+ const originalBarcode = barcodeInput.value.trim();
+ const splitQuantity = parseFloat(splitQtyInput.value);
+
+ try {
+ // 鏄剧ず鍔犺浇鐘舵��
+ const confirmBtn = document.getElementById(`${dialogId}-confirm`);
+ if (confirmBtn) {
+ confirmBtn.disabled = true;
+ confirmBtn.textContent = '澶勭悊涓�...';
+ }
+
+ const res = await http.post('/api/OutboundBatchPicking/split-package', {
+ orderNo: this.scanData.orderNo,
+ palletCode: this.scanData.palletCode,
+ originalBarcode: originalBarcode,
+ splitQuantity: splitQuantity
+ });
+
+ if (res.status) {
+ ElMessage.success('鎷嗗寘鎴愬姛');
+
+ // 鍏抽棴鎵嬪姩寮圭獥
+ const dialog = document.getElementById(dialogId);
+ if (dialog && dialog.parentNode) {
+ dialog.parentNode.removeChild(dialog);
+ }
+
+ // 閲嶆柊鍔犺浇鏁版嵁
+ await this.loadPalletData();
+ } else {
+ ElMessage.error(res.message || '鎷嗗寘澶辫触');
+
+ // 鎭㈠鎸夐挳鐘舵��
+ if (confirmBtn) {
+ confirmBtn.disabled = false;
+ confirmBtn.textContent = '纭鎷嗗寘';
+ }
+ }
+ } catch (error) {
+ console.error('鎷嗗寘澶辫触:', error);
+ ElMessage.error('鎷嗗寘澶辫触');
+
+ // 鎭㈠鎸夐挳鐘舵��
+ const confirmBtn = document.getElementById(`${dialogId}-confirm`);
+ if (confirmBtn) {
+ confirmBtn.disabled = false;
+ confirmBtn.textContent = '纭鎷嗗寘';
+ }
+ }
+ },
+ closeAllDialogsImmediately() {
+ console.log('绔嬪嵆鍏抽棴鎵�鏈夊脊绐�');
+
+ // 鐩存帴璁剧疆涓� false锛屼笉绛夊緟浠讳綍寮傛鎿嶄綔
+ this.showCustomSplitDialog = false;
+ this.showRevertSplitDialog = false;
+ this.showBatchReturnDialog = false;
+ this.showEmptyPalletDialog = false;
+ this.showSplitChainDialog = false;
+
+ // 寮哄埗DOM鏇存柊
+ this.$forceUpdate();
},
async onSplitBarcodeScan() {
@@ -697,103 +1054,104 @@
async handleSplitPackage() {
if (this.$refs.splitFormRef) {
- const valid = await this.$refs.splitFormRef.validate();
- if (!valid) return;
-
- 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 || '鎷嗗寘澶辫触');
+ 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.closeAllDialogs();
+ await this.loadPalletData();
+ } else {
+ this.$message.error(res.message || '鎷嗗寘澶辫触');
+ }
+ } catch (error) {
+ this.$message.error('鎷嗗寘澶辫触');
+ } finally {
+ this.splitLoading = false;
+ }
}
- } catch (error) {
- this.$message.error('鎷嗗寘澶辫触: ' + (error.message || '缃戠粶閿欒'));
- } finally {
- this.splitLoading = false;
- }
+ });
}
},
-// 鍦ㄦ媶鍖呭脊绐椾腑鏌ョ湅鎷嗗寘閾�
-async viewSplitChainFromSplit(barcode) {
- if (!barcode) {
- this.$message.warning('璇峰厛杈撳叆鏉$爜');
- return;
- }
-
- // 鍏堝叧闂媶鍖呭脊绐�
- this.closeCustomSplitDialog();
-
- await this.$nextTick();
-
- // 鐒跺悗鎵撳紑鎷嗗寘閾句俊鎭脊绐�
- await this.viewSplitChain(barcode);
-},
+
+ async viewSplitChainFromSplit(barcode) {
+ if (!barcode) {
+ this.$message.warning('璇峰厛杈撳叆鏉$爜');
+ return;
+ }
+
+ this.closeAllDialogs();
+
+ setTimeout(() => {
+ this.viewSplitChain(barcode);
+ }, 50);
+ },
+
// 鎾ら攢鎷嗗寘
async onRevertSplitBarcodeScan() {
- if (!this.revertSplitForm.newBarcode) return;
+ if (!this.revertSplitForm.newBarcode) return;
this.revertSplitForm.newBarcode = this.revertSplitForm.newBarcode.replace(/\n/g, '').trim();
},
async handleRevertSplit() {
- if (this.$refs.revertSplitFormRef) {
- const valid = await this.$refs.revertSplitFormRef.validate();
- if (!valid) return;
-
- 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 || '鎾ら攢鎷嗗寘澶辫触');
+ if (this.$refs.revertSplitFormRef) {
+ 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.closeAllDialogs();
+ await this.loadPalletData();
+ } else {
+ this.$message.error(res.message || '鎾ら攢鎷嗗寘澶辫触');
+ }
+ } catch (error) {
+ this.$message.error('鎾ら攢鎷嗗寘澶辫触');
+ } finally {
+ this.revertSplitLoading = false;
+ }
}
- } catch (error) {
- this.$message.error('鎾ら攢鎷嗗寘澶辫触: ' + (error.message || '缃戠粶閿欒'));
- } finally {
- this.revertSplitLoading = 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) {
+
+ 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;
}
@@ -807,86 +1165,34 @@
if (res.status) {
this.splitChainInfo = res.data;
-
- // 鍏抽棴鍏朵粬寮圭獥鍚庡啀鎵撳紑鎷嗗寘閾惧脊绐�
- this.closeAllDialogs();
-
- await this.$nextTick(() => {
- this.showSplitChainDialog = true;
-
- // 鏄剧ず鎻愮ず淇℃伅
- let chainType = "褰撳墠鏉$爜鐨勬媶鍖呴摼";
- if (this.splitChainInfo.chainType === 'root') {
- chainType = "瀹屾暣鎷嗗寘閾撅紙浠庡師濮嬫潯鐮佸紑濮嬶級";
- } else if (this.splitChainInfo.chainType === 'branch') {
- chainType = "鍒嗘敮鎷嗗寘閾�";
- }
-
- this.$message.info(`宸插姞杞�${chainType}锛屽叡${this.splitChainInfo.totalSplitTimes}娆℃媶鍖卄);
- });
+ this.activeDialog = 'splitChain';
} else {
this.$message.error(res.message || '鑾峰彇鎷嗗寘閾句俊鎭け璐�');
}
} catch (error) {
- this.$message.error('鑾峰彇鎷嗗寘閾句俊鎭け璐�: ' + (error.message || '缃戠粶閿欒'));
+ this.$message.error('鑾峰彇鎷嗗寘閾句俊鎭け璐�');
} finally {
this.splitChainLoading = false;
}
-},
+ },
// 鍏抽棴鎷嗗寘閾句俊鎭脊绐�
- closeSplitChainDialog() {
+ closeSplitChainDialog() {
this.showSplitChainDialog = 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) {
- try {
- await ElMessageBox.confirm(
+ async cancelSingleSplit(newBarcode) {
+ const originalBarcode = this.splitChainInfo.originalBarcode;
+
+ try {
+ await this.$confirm(
`纭畾瑕佸彇娑堟潯鐮� ${newBarcode} 鐨勬媶鍖呮搷浣滃悧锛焋,
'鍙栨秷鍗曚釜鎷嗗寘',
{
confirmButtonText: '纭畾鍙栨秷',
cancelButtonText: '鍐嶆兂鎯�',
- type: 'warning',
- customClass: 'message-box-top'
+ type: 'warning'
}
);
@@ -901,29 +1207,26 @@
if (res.status) {
this.$message.success('鍙栨秷鎷嗗寘鎴愬姛');
await this.loadPalletData();
-
- // 閲嶆柊鍔犺浇鎷嗗寘閾句俊鎭�
- if (this.splitChainInfo.originalBarcode) {
- await this.viewSplitChain(this.splitChainInfo.originalBarcode);
- }
+ this.closeAllDialogs();
+ setTimeout(() => {
+ this.viewSplitChain(originalBarcode);
+ }, 50);
} else {
this.$message.error(res.message || '鍙栨秷鎷嗗寘澶辫触');
}
} catch (error) {
if (error !== 'cancel') {
- this.$message.error('鍙栨秷鎷嗗寘澶辫触: ' + error.message);
+ this.$message.error('鍙栨秷鎷嗗寘澶辫触');
}
} finally {
this.revertSplitLoading = false;
}
-},
+ },
-// 鍙栨秷鏁翠釜鎷嗗寘閾�
-async cancelWholeSplitChain() {
- if (!this.canCancelWholeChain) return;
-
+ // 鍙栨秷鏁翠釜鎷嗗寘閾�
+ async cancelWholeSplitChain() {
try {
- await ElMessageBox.confirm(
+ await this.$confirm(
`纭畾瑕佸彇娑堟暣涓媶鍖呴摼鍚楋紵\n杩欏皢鍙栨秷浠庢潯鐮� ${this.splitChainInfo.originalBarcode} 寮�濮嬬殑鎵�鏈夋媶鍖呮搷浣溿�俙,
'鍙栨秷鎷嗗寘閾剧‘璁�',
{
@@ -931,8 +1234,7 @@
cancelButtonText: '鍐嶆兂鎯�',
type: 'warning',
center: true,
- closeOnClickModal: false,
- customClass: 'message-box-top'
+ closeOnClickModal: false
}
);
@@ -946,7 +1248,7 @@
if (res.status) {
this.$message.success('鍙栨秷鎷嗗寘閾炬垚鍔�');
- this.closeSplitChainDialog();
+ this.closeAllDialogs();
await this.loadPalletData();
} else {
this.$message.error(res.message || '鍙栨秷鎷嗗寘閾惧け璐�');
@@ -958,7 +1260,7 @@
} finally {
this.revertSplitLoading = false;
}
-},
+ },
// 妫�鏌ユ潯鐮佹槸鍚﹀凡琚垎鎷�
hasPicked(barcode) {
@@ -971,31 +1273,59 @@
const date = new Date(dateTime);
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() {
+
+ // 鍏抽敭淇锛氭柊澧炲叧闂墍鏈夊脊绐楃殑鏂规硶
+ closeAllDialogs() {
+ this.activeDialog = null;
+ // 纭繚鎵�鏈夊脊绐楃姸鎬侀兘琚噸缃�
+// 鍏抽棴Vue寮圭獥
this.showCustomSplitDialog = false;
this.showRevertSplitDialog = false;
- this.showSplitChainDialog = false;
this.showBatchReturnDialog = false;
this.showEmptyPalletDialog = false;
- this.activeDialog = null;
+ this.showSplitChainDialog = false;
+
+ // 鍏抽棴鎵嬪姩寮圭獥
+ if (this.manualDialog && this.manualDialog.parentNode) {
+ this.manualDialog.parentNode.removeChild(this.manualDialog);
+ this.manualDialog = null;
+ }
+
+ // 绉婚櫎鎵�鏈夌揣鎬ュ脊绐�
+ const emergencyDialogs = document.querySelectorAll('.emergency-fix');
+ emergencyDialogs.forEach(dialog => {
+ if (dialog.parentNode) {
+ dialog.parentNode.removeChild(dialog);
+ }
+ });
},
+
// 鍥炲簱鐩稿叧鏂规硶
openBatchReturnDialog() {
- if (!this.scanData.palletCode) {
+ if (!this.scanData.palletCode) {
this.$message.warning('璇峰厛鎵弿鎵樼洏鐮�');
return;
}
- // 鍏抽棴鍏朵粬寮圭獥
- this.closeAllDialogs();
+ if (this.isOpeningDialog) return;
- 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.isOpeningDialog = true;
+
+ setTimeout(() => {
+ this.closeAllDialogsImmediately();
+
+ requestAnimationFrame(() => {
+ 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.$nextTick(() => {
+ this.isOpeningDialog = false;
+ });
+ });
+ }, 0);
},
async handleBatchReturnConfirm() {
@@ -1007,28 +1337,37 @@
});
if (res.status) {
this.$message.success('鍥炲簱鎴愬姛');
- this.showBatchReturnDialog = false;
+ this.closeAllDialogs();
await this.loadPalletData();
} else {
this.$message.error(res.message || '鍥炲簱澶辫触');
}
} catch (error) {
- this.$message.error('鍥炲簱澶辫触: ' + (error.message || '缃戠粶閿欒'));
+ this.$message.error('鍥炲簱澶辫触');
} finally {
this.batchReturnLoading = false;
}
},
// 鍙栫┖绠辨柟娉�
- handleEmptyPallet() {
- // 鍏抽棴鍏朵粬寮圭獥
- this.closeAllDialogs();
+handleEmptyPallet() {
+ if (this.isOpeningDialog) return;
- this.$nextTick(() => {
- this.showEmptyPalletDialog = true;
- this.emptypalletOutForm.orderNo = this.scanData.orderNo;
- this.emptypalletOutForm.palletCode = '';
- });
+ this.isOpeningDialog = true;
+
+ setTimeout(() => {
+ this.closeAllDialogsImmediately();
+
+ requestAnimationFrame(() => {
+ this.showEmptyPalletDialog = true;
+ this.emptypalletOutForm.orderNo = this.scanData.orderNo;
+ this.emptypalletOutForm.palletCode = '';
+
+ this.$nextTick(() => {
+ this.isOpeningDialog = false;
+ });
+ });
+ }, 0);
},
async handleEmptyPalletConfirm() {
@@ -1040,13 +1379,13 @@
});
if (res.status) {
this.$message.success('鍙栬蛋绌虹鎴愬姛');
- this.showEmptyPalletDialog = false;
+ this.closeAllDialogs();
await this.loadPalletData();
} else {
this.$message.error(res.message || '鍙栬蛋绌虹澶辫触');
}
} catch (error) {
- this.$message.error('鍙栬蛋绌虹澶辫触: ' + (error.message || '缃戠粶閿欒'));
+ this.$message.error('鍙栬蛋绌虹澶辫触');
} finally {
this.emptypalletOutLoading = false;
}
@@ -1054,21 +1393,19 @@
// 鏁版嵁鍔犺浇鏂规硶
async loadPalletData() {
- if (!this.scanData.orderNo || !this.scanData.palletCode) return;
+ if (!this.scanData.orderNo || !this.scanData.palletCode) return;
try {
- await Promise.all([
- this.loadUnpickedList(),
- this.loadPickedList(),
- this.loadPalletStatus()
- ]);
+ await this.loadUnpickedList();
+ await this.loadPickedList();
+ await this.loadPalletStatus();
} catch (error) {
console.error('鍔犺浇鎵樼洏鏁版嵁澶辫触:', error);
}
},
async loadUnpickedList() {
- try {
+ try {
const res = await http.post('/api/OutboundBatchPicking/pallet-locks', {
orderNo: this.scanData.orderNo,
palletCode: this.scanData.palletCode
@@ -1079,7 +1416,6 @@
this.summary.unpickedQuantity = this.unpickedList.reduce((sum, item) => sum + (item.remainQuantity || 0), 0);
}
} catch (error) {
- console.error('鍔犺浇鏈嫞閫夊垪琛ㄥけ璐�:', error);
this.$message.error('鍔犺浇鏈嫞閫夊垪琛ㄥけ璐�');
}
},
@@ -1098,13 +1434,12 @@
this.summary.pickedCount = this.pickedList.length;
}
} catch (error) {
- console.error('鍔犺浇宸叉嫞閫夊垪琛ㄥけ璐�:', error);
this.$message.error('鍔犺浇宸叉嫞閫夊垪琛ㄥけ璐�');
}
},
async loadPalletStatus() {
- try {
+ try {
const res = await http.post('/api/OutboundBatchPicking/pallet-status', {
orderNo: this.scanData.orderNo,
palletCode: this.scanData.palletCode
@@ -1113,14 +1448,13 @@
this.palletStatus = res.data.statusText || '鏈煡';
}
} catch (error) {
- console.error('鍔犺浇鎵樼洏鐘舵�佸け璐�:', error);
this.palletStatus = '鏈煡';
}
},
// 鎵爜鐩稿叧鏂规硶
onPalletScan() {
- this.scanData.palletCode = this.scanData.palletCode.replace(/\n/g, '').trim();
+ this.scanData.palletCode = this.scanData.palletCode.replace(/\n/g, '').trim();
if (!this.scanData.palletCode) return;
this.loadPalletData();
@@ -1130,7 +1464,7 @@
},
onBarcodeScan() {
- this.scanData.barcode = this.scanData.barcode.replace(/\n/g, '').trim();
+ this.scanData.barcode = this.scanData.barcode.replace(/\n/g, '').trim();
if (!this.scanData.barcode) return;
this.confirmPicking();
},
@@ -1158,40 +1492,33 @@
return;
}
- try {
- await ElMessageBox.confirm(
- `纭畾瑕佸彇娑堥�変腑鐨� ${this.selectedPickedRows.length} 椤瑰悧锛焋,
- '鎻愮ず',
- {
- confirmButtonText: '纭畾',
- cancelButtonText: '鍙栨秷',
- type: 'warning',
- customClass: 'message-box-top'
- }
- );
-
- 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('鎵归噺鍙栨秷鎿嶄綔澶辫触');
}
- }
+ });
},
// 閲嶇疆鏂规硶
@@ -1207,22 +1534,31 @@
this.resetSplitForm();
},
- openRevertSplitDialog() {
- // 鍏抽棴鍏朵粬寮圭獥
- this.closeAllDialogs();
+openRevertSplitDialog() {
+ if (this.isOpeningDialog) return;
- this.$nextTick(() => {
- this.showRevertSplitDialog = true;
- this.revertSplitForm.newBarcode = '';
- });
+ this.isOpeningDialog = true;
+
+ setTimeout(() => {
+ this.closeAllDialogsImmediately();
+
+ requestAnimationFrame(() => {
+ this.showRevertSplitDialog = true;
+ this.revertSplitForm.newBarcode = '';
+
+ this.$nextTick(() => {
+ this.isOpeningDialog = false;
+ });
+ });
+ }, 0);
},
- closeRevertSplitDialog() {
+ closeRevertSplitDialog() {
this.showRevertSplitDialog = false;
this.revertSplitForm.newBarcode = '';
},
- closeBatchReturnDialog() {
+ closeBatchReturnDialog() {
this.showBatchReturnDialog = false;
},
@@ -1231,7 +1567,7 @@
this.emptypalletOutForm.palletCode = this.emptypalletOutForm.palletCode.replace(/\n/g, '').trim();
},
- closeEmptyPalletDialog() {
+ closeEmptyPalletDialog() {
this.showEmptyPalletDialog = false;
this.emptypalletOutForm.palletCode = '';
},
@@ -1278,24 +1614,130 @@
color: #909399;
}
-/* 鑷畾涔夊脊绐楁牱寮� */
-:deep(.el-message-box) {
- z-index: 9999 !important;
+/* 鑷畾涔夊脊绐楁牱寮� - 鍏抽敭淇 */
+.custom-dialog-overlay {
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background-color: rgba(0, 0, 0, 0.5);
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ z-index: 9999; /* 鎻愰珮z-index纭繚鍦ㄦ渶涓婂眰 */
}
-:deep(.el-overlay) {
- z-index: 9998 !important;
+.custom-dialog-wrapper {
+ position: relative;
+ z-index: 10000;
}
-:deep(.el-message) {
- z-index: 10000 !important;
+.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;
}
-/* 纭繚纭瀵硅瘽妗嗗湪鏈�鍓嶉潰 */
-:deep(.message-box-top) {
- z-index: 10001 !important;
+.custom-dialog-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding: 20px 20px 10px;
+ border-bottom: 1px solid #ebeef5;
}
+.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;
+}
+
+.close-button:hover {
+ color: #409EFF;
+ background-color: transparent;
+}
+
+.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;
+}
+
+@media (max-width: 768px) {
+ .custom-dialog {
+ width: 95vw;
+ margin: 10px;
+ }
+
+ .scanner-form {
+ flex-direction: column;
+ align-items: stretch;
+ }
+
+ .scanner-form .el-input {
+ width: 100%;
+ }
+}
+
+/* 鍘熸湁鐨勬牱寮忎繚鎸佷笉鍙� */
+.OutboundPicking-container {
+ padding: 20px;
+}
+
+.scanner-form {
+ display: flex;
+ gap: 10px;
+ align-items: center;
+ flex-wrap: wrap;
+}
+
+.scanner-form .el-input {
+ width: 200px;
+}
+
+.summary-info {
+ display: flex;
+ gap: 20px;
+ flex-wrap: wrap;
+}
+
+.table-actions {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ margin-bottom: 10px;
+ padding: 0 10px;
+}
+
+.selection-count {
+ font-size: 12px;
+ color: #909399;
+}
+
+/* 鍘熸湁鐨勮嚜瀹氫箟寮圭獥鏍峰紡 */
.custom-dialog-overlay {
position: fixed;
top: 0;
@@ -1382,4 +1824,17 @@
width: 100%;
}
}
+
+/* 鏂板锛氭墜鍔ㄥ脊绐楃殑鎸夐挳鎮仠鏁堟灉 */
+:deep(button) {
+ transition: all 0.3s;
+}
+
+:deep(button:hover) {
+ opacity: 0.8;
+}
+
+:deep(button:active) {
+ opacity: 0.6;
+}
</style>
\ No newline at end of file
--
Gitblit v1.9.3