| | |
| | | </div> |
| | | |
| | | <!-- æå
å¼¹çª --> |
| | | <div v-if="showCustomSplitDialog" class="custom-dialog-overlay"> |
| | | <div v-show="showCustomSplitDialog" class="custom-dialog-overlay" style="z-index: 2001;"> |
| | | <div class="custom-dialog-wrapper"> |
| | | <div class="custom-dialog"> |
| | | <div class="custom-dialog-header"> |
| | |
| | | </div> |
| | | |
| | | <!-- æ¤éæå
å¼¹çª --> |
| | | <div v-if="showRevertSplitDialog" class="custom-dialog-overlay"> |
| | | <div v-show="showRevertSplitDialog" class="custom-dialog-overlay" style="z-index: 2001;"> |
| | | <div class="custom-dialog-wrapper"> |
| | | <div class="custom-dialog"> |
| | | <div class="custom-dialog-header"> |
| | |
| | | </div> |
| | | |
| | | <!-- æå
é¾ä¿¡æ¯å¼¹çª --> |
| | | <div v-if="showSplitChainDialog" class="custom-dialog-overlay"> |
| | | <div v-show="showSplitChainDialog" class="custom-dialog-overlay" style="z-index: 2003;"> |
| | | <div class="custom-dialog-wrapper"> |
| | | <div class="custom-dialog" style="width: 750px;"> |
| | | <div class="custom-dialog-header"> |
| | |
| | | </div> |
| | | |
| | | <!-- æ¹éååºå¼¹çª --> |
| | | <div v-if="showBatchReturnDialog" class="custom-dialog-overlay"> |
| | | <div v-if="showBatchReturnDialog" class="custom-dialog-overlay" style="z-index: 2004;"> |
| | | <div class="custom-dialog-wrapper"> |
| | | <div class="custom-dialog"> |
| | | <div class="custom-dialog-header"> |
| | |
| | | </div> |
| | | |
| | | <!-- åèµ°ç©ºç®±å¼¹çª --> |
| | | <div v-if="showEmptyPalletDialog" class="custom-dialog-overlay"> |
| | | <div v-if="showEmptyPalletDialog" class="custom-dialog-overlay" style="z-index: 2005;"> |
| | | <div class="custom-dialog-wrapper"> |
| | | <div class="custom-dialog"> |
| | | <div class="custom-dialog-header"> |
| | |
| | | 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: '', |
| | |
| | | }, |
| | | 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: { |
| | |
| | | palletCode: '' |
| | | }, |
| | | |
| | | // æ°å¢ï¼æå
é¾ç¸å
³æ°æ® |
| | | // æå
é¾ç¸å
³æ°æ® |
| | | splitChainInfo: { |
| | | originalBarcode: '', |
| | | totalSplitTimes: 0, |
| | |
| | | ] |
| | | }, |
| | | |
| | | isProcessing: false |
| | | isProcessing: false, |
| | | |
| | | // æ°å¢: ç¨äºé²æ¢å¼¹çªéå |
| | | isDialogOpening: false |
| | | } |
| | | }, |
| | | computed: { |
| | | // æ¯å¦å¯ä»¥åæ¶æ´ä¸ªæå
é¾ |
| | | canCancelWholeChain() { |
| | | return this.splitChainInfo.splitChain && |
| | | this.splitChainInfo.splitChain.some(item => !item.isReverted); |
| | |
| | | this.$router.back() |
| | | }, |
| | | |
| | | // 忣ç¸å
³æ¹æ³ |
| | | // ä¿®å¤: æ·»å é²éå¤ç¹å»æºå¶ |
| | | async confirmPicking() { |
| | | if (this.isProcessing) return; |
| | | |
| | |
| | | } |
| | | }, |
| | | |
| | | // æå
ç¸å
³æ¹æ³ |
| | | // ä¿®å¤: æå¼æå
å¼¹çª - æ·»å é²éå æºå¶ |
| | | openSplitDialog() { |
| | | if (this.isDialogOpening) return; |
| | | |
| | | if (!this.scanData.palletCode) { |
| | | this.$message.warning('请å
æ«ææçç '); |
| | | return; |
| | | } |
| | | this.showCustomSplitDialog = true; |
| | | this.resetSplitForm(); |
| | | this.splitForm.orderNo = this.scanData.orderNo; |
| | | this.splitForm.palletCode = this.scanData.palletCode; |
| | | |
| | | this.isDialogOpening = true; |
| | | |
| | | try { |
| | | // ç¡®ä¿å
³éå
¶ä»å¼¹çª |
| | | this.closeAllDialogs(); |
| | | |
| | | // å»¶è¿æå¼ï¼ç¡®ä¿DOMæ´æ°å®æ |
| | | 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; |
| | | } |
| | | }, |
| | | |
| | | async onSplitBarcodeScan() { |
| | |
| | | }); |
| | | |
| | | if (res.status) { |
| | | if(res.data && res.data.length>0){ |
| | | this.$refs.childs.open(res.data); |
| | | } |
| | | this.splitForm.materielCode = res.data.materielCode; |
| | | this.splitForm.maxQuantity = res.data.remainQuantity; |
| | | this.splitForm.splitQuantity = Math.min(1, this.splitForm.maxQuantity); |
| | |
| | | |
| | | async handleSplitPackage() { |
| | | if (this.$refs.splitFormRef) { |
| | | 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; |
| | | } |
| | | 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; |
| | | } |
| | | } |
| | | }, |
| | | // 卿å
å¼¹çªä¸æ¥çæå
é¾ |
| | | async viewSplitChainFromSplit(barcode) { |
| | | if (!barcode) { |
| | | this.$message.warning('请å
è¾å
¥æ¡ç '); |
| | | return; |
| | | } |
| | | |
| | | // å
å
³éæå
å¼¹çª |
| | | this.closeCustomSplitDialog(); |
| | | |
| | | await this.$nextTick(); |
| | | |
| | | // ç¶åæå¼æå
é¾ä¿¡æ¯å¼¹çª |
| | | await this.viewSplitChain(barcode); |
| | | }, |
| | | // æ¤éæå
|
| | | |
| | | // ä¿®å¤: æ¤éæå
å¼¹çª |
| | | 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.isDialogOpening = false; |
| | | }); |
| | | }); |
| | | } catch (error) { |
| | | console.error('æå¼æ¤éæå
å¼¹çªå¤±è´¥:', error); |
| | | this.isDialogOpening = false; |
| | | } |
| | | }, |
| | | |
| | | 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) { |
| | | 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; |
| | | } |
| | | 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 || 'æ¤éæå
失败'); |
| | | } |
| | | }); |
| | | } catch (error) { |
| | | this.$message.error('æ¤éæå
失败'); |
| | | } 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) { |
| | | 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 = "忝æå
é¾"; |
| | | |
| | | // ä¿®å¤: æ¥çæå
é¾ |
| | | async viewSplitChain(barcode) { |
| | | if (!barcode) { |
| | | this.$message.warning('请å
è¾å
¥æ¡ç '); |
| | | return; |
| | | } |
| | | |
| | | 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; |
| | | } |
| | | }, |
| | | 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; |
| | | } |
| | | }, |
| | | |
| | | // å
³éæå
é¾ä¿¡æ¯å¼¹çª |
| | | // ä¿®å¤: å
³éæå
é¾ä¿¡æ¯å¼¹çª |
| | | 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) { |
| | | // å
è®°å½å½åä¿¡æ¯ï¼ç¶åå
³éå¼¹çª |
| | | 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() { |
| | | // å
è®°å½å½åæå
é¾ä¿¡æ¯ï¼ç¶åå
³éå¼¹çª |
| | | const originalBarcode = this.splitChainInfo.originalBarcode; |
| | | this.closeSplitChainDialog(); |
| | | |
| | | // ç»ä¸ç¹æ¶é´è®©å¼¹çªå®å
¨å
³é |
| | | await this.$nextTick(); |
| | | |
| | | try { |
| | | // ç°å¨æ¾ç¤ºç¡®è®¤å¯¹è¯æ¡ï¼ç¡®ä¿å®å¨æåé¢ |
| | | await this.$confirm( |
| | | `ç¡®å®è¦åæ¶æ´ä¸ªæå
é¾åï¼\nè¿å°åæ¶ä»æ¡ç ${originalBarcode} å¼å§çæææå
æä½ã`, |
| | | 'åæ¶æå
é¾ç¡®è®¤', |
| | | { |
| | | confirmButtonText: 'ç¡®å®åæ¶', |
| | | cancelButtonText: 'åæ³æ³', |
| | | type: 'warning', |
| | | center: true, |
| | | closeOnClickModal: 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; |
| | | } |
| | | ); |
| | | |
| | | // ç¨æ·ç¡®è®¤åæ§è¡åæ¶æä½ |
| | | 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; |
| | | } |
| | | }, |
| | | }, |
| | | |
| | | // ä¿®å¤: åæ¶æ´ä¸ªæå
é¾ |
| | | 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; |
| | | } |
| | | }, |
| | | |
| | | // æ£æ¥æ¡ç æ¯å¦å·²è¢«åæ£ |
| | | hasPicked(barcode) { |
| | |
| | | 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.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.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; |
| | | }); |
| | | }, |
| | | |
| | | async handleBatchReturnConfirm() { |
| | |
| | | |
| | | // åç©ºç®±æ¹æ³ |
| | | handleEmptyPallet() { |
| | | this.showEmptyPalletDialog = true; |
| | | this.emptypalletOutForm.orderNo = this.scanData.orderNo; |
| | | this.emptypalletOutForm.palletCode = ''; |
| | | this.closeAllDialogs(); |
| | | |
| | | this.$nextTick(() => { |
| | | this.showEmptyPalletDialog = true; |
| | | this.emptypalletOutForm.orderNo = this.scanData.orderNo; |
| | | this.emptypalletOutForm.palletCode = ''; |
| | | }); |
| | | }, |
| | | |
| | | async handleEmptyPalletConfirm() { |
| | |
| | | async loadPalletData() { |
| | | if (!this.scanData.orderNo || !this.scanData.palletCode) return; |
| | | |
| | | await this.loadUnpickedList(); |
| | | await this.loadPickedList(); |
| | | await this.loadPalletStatus(); |
| | | try { |
| | | await Promise.all([ |
| | | this.loadUnpickedList(), |
| | | this.loadPickedList(), |
| | | this.loadPalletStatus() |
| | | ]); |
| | | } catch (error) { |
| | | console.error('å è½½æçæ°æ®å¤±è´¥:', error); |
| | | } |
| | | }, |
| | | |
| | | async loadUnpickedList() { |
| | |
| | | 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('å è½½æªæ£éå表失败'); |
| | | } |
| | | }, |
| | |
| | | palletCode: this.scanData.palletCode |
| | | }); |
| | | if (res.status) { |
| | | this.pickedList = res.data || []; |
| | | |
| | | this.pickedList = res.data.map(item => { |
| | | // æ¹å¼1ï¼ä¿çåbarcodeåæ®µï¼æ°å¢currentBarcode |
| | | return { |
| | | ...item, |
| | | currentBarcode: item.barcode |
| | | }; |
| | | }); |
| | | |
| | | this.pickedList = res.data.map(item => ({ |
| | | ...item, |
| | | currentBarcode: item.barcode |
| | | })); |
| | | this.summary.pickedCount = this.pickedList.length; |
| | | } |
| | | } catch (error) { |
| | | console.error('å 载已æ£éå表失败:', error); |
| | | this.$message.error('å 载已æ£éå表失败'); |
| | | } |
| | | }, |
| | |
| | | this.palletStatus = res.data.statusText || 'æªç¥'; |
| | | } |
| | | } catch (error) { |
| | | console.error('å è½½æçç¶æå¤±è´¥:', error); |
| | | this.palletStatus = 'æªç¥'; |
| | | } |
| | | }, |
| | |
| | | return; |
| | | } |
| | | |
| | | 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(`åæ¶æ£é失败: ${row.currentBarcode} - ${res.message}`); |
| | | } |
| | | } catch (error) { |
| | | this.$message.warning(`åæ¶æ£é失败: ${row.currentBarcode} - ${error.message}`); |
| | | 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(`åæ¶æ£é失败: ${row.currentBarcode} - ${res.message}`); |
| | | } |
| | | } |
| | | this.$message.success('æ¹é忶宿'); |
| | | await this.loadPalletData(); |
| | | this.selectedPickedRows = []; |
| | | } catch (error) { |
| | | } catch (error) { |
| | | this.$message.warning(`åæ¶æ£é失败: ${row.currentBarcode} - ${error.message}`); |
| | | } |
| | | } |
| | | this.$message.success('æ¹é忶宿'); |
| | | await this.loadPalletData(); |
| | | this.selectedPickedRows = []; |
| | | } catch (error) { |
| | | if (error !== 'cancel') { |
| | | this.$message.error('æ¹éåæ¶æä½å¤±è´¥'); |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | |
| | | // éç½®æ¹æ³ |
| | |
| | | closeCustomSplitDialog() { |
| | | this.showCustomSplitDialog = false; |
| | | this.resetSplitForm(); |
| | | }, |
| | | |
| | | openRevertSplitDialog() { |
| | | this.showRevertSplitDialog = true; |
| | | this.revertSplitForm.newBarcode = ''; |
| | | }, |
| | | |
| | | closeRevertSplitDialog() { |
| | |
| | | color: #909399; |
| | | } |
| | | |
| | | /* èªå®ä¹å¼¹çªæ ·å¼ */ |
| | | :deep(.el-message-box) { |
| | | z-index: 10010 !important; |
| | | } |
| | | |
| | | :deep(.el-overlay) { |
| | | z-index: 10009 !important; |
| | | } |
| | | |
| | | :deep(.el-message) { |
| | | z-index: 10011 !important; |
| | | } |
| | | |
| | | /* èªå®ä¹å¼¹çªæ ·å¼ - å
³é®ä¿®å¤: ç§»é¤å¯è½å¯¼è´å²çªçz-indexè§å */ |
| | | .custom-dialog-overlay { |
| | | position: fixed; |
| | | top: 0; |
| | |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | z-index: 2000; /* ä¿æä¸ä¸ªåçç z-index */ |
| | | /* ç§»é¤è¿éçz-indexï¼å¨æ¨¡æ¿ä¸åç¬è®¾ç½® */ |
| | | } |
| | | |
| | | .custom-dialog-wrapper { |
| | | position: relative; |
| | | z-index: 2001; |
| | | } |
| | | |
| | | .custom-dialog { |
| | |
| | | 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%; |
| | | } |