| | |
| | | <el-table-column type="selection" width="55"></el-table-column> |
| | | <el-table-column prop="materielCode" label="ç©æç¼ç " width="120"></el-table-column> |
| | | <el-table-column prop="pickedQty" label="å·²æ£æ°é" width="100"></el-table-column> |
| | | <el-table-column prop="locationCode" label="è´§ä½" width="100"></el-table-column> |
| | | <!-- <el-table-column prop="locationCode" label="è´§ä½" width="100"></el-table-column> --> |
| | | <el-table-column prop="currentBarcode" label="æ¡ç "></el-table-column> |
| | | </el-table> |
| | | </el-card> |
| | |
| | | </div> |
| | | |
| | | <!-- æå
å¼¹çª --> |
| | | <div v-if="showCustomSplitDialog" class="custom-dialog-overlay"> |
| | | <div v-show="showCustomSplitDialog" class="custom-dialog-overlay"> |
| | | <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"> |
| | | <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"> |
| | | <div class="custom-dialog-wrapper"> |
| | | <div class="custom-dialog" style="width: 750px;"> |
| | | <div class="custom-dialog-header"> |
| | |
| | | { 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 |
| | | } |
| | | }, |
| | | 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.$message.success('æ£é确认æå'); |
| | | this.scanData.barcode = ''; |
| | | await this.loadPalletData(); |
| | | if(res.data && res.data.splitResults && res.data.splitResults.length>0){ |
| | | this.$refs.childs.open(res.data.splitResults); |
| | | if(res.data && res.data && res.data.length>0){ |
| | | this.$refs.childs.open(res.data); |
| | | } |
| | | this.$nextTick(() => { |
| | | this.$refs.barcodeInput.focus(); |
| | |
| | | this.$message.warning('请å
æ«ææçç '); |
| | | return; |
| | | } |
| | | this.showCustomSplitDialog = true; |
| | | this.resetSplitForm(); |
| | | this.splitForm.orderNo = this.scanData.orderNo; |
| | | this.splitForm.palletCode = this.scanData.palletCode; |
| | | // å
³éå
¶ä»ææå¼¹çª |
| | | 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(); |
| | | } |
| | | }); |
| | | }); |
| | | }, |
| | | |
| | | 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; |
| | | } |
| | | 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 || 'æå
失败'); |
| | | } |
| | | }); |
| | | } catch (error) { |
| | | this.$message.error('æå
失败: ' + (error.message || 'ç½ç»é误')); |
| | | } finally { |
| | | this.splitLoading = false; |
| | | } |
| | | } |
| | | }, |
| | | // 卿å
å¼¹çªä¸æ¥çæå
é¾ |
| | |
| | | }, |
| | | // æ¤éæå
|
| | | async onRevertSplitBarcodeScan() { |
| | | if (!this.revertSplitForm.newBarcode) return; |
| | | 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; |
| | | } |
| | | 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 || 'æ¤éæå
失败'); |
| | | } |
| | | }); |
| | | } catch (error) { |
| | | this.$message.error('æ¤éæå
失败: ' + (error.message || 'ç½ç»é误')); |
| | | } finally { |
| | | this.revertSplitLoading = 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 = "忝æå
é¾"; |
| | | 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; |
| | | } |
| | | 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; |
| | | |
| | | // æ¾ç¤ºæç¤ºä¿¡æ¯ |
| | | let chainType = "å½åæ¡ç çæå
é¾"; |
| | | if (this.splitChainInfo.chainType === 'root') { |
| | | chainType = "宿´æå
é¾ï¼ä»åå§æ¡ç å¼å§ï¼"; |
| | | } else if (this.splitChainInfo.chainType === 'branch') { |
| | | chainType = "忝æå
é¾"; |
| | | } |
| | | |
| | | this.$message.info(`å·²å è½½${chainType}ï¼å
±${this.splitChainInfo.totalSplitTimes}次æå
`); |
| | | }); |
| | | } else { |
| | | this.$message.error(res.message || 'è·åæå
é¾ä¿¡æ¯å¤±è´¥'); |
| | | } |
| | | } catch (error) { |
| | | this.$message.error('è·åæå
é¾ä¿¡æ¯å¤±è´¥: ' + (error.message || 'ç½ç»é误')); |
| | | } 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' |
| | | try { |
| | | await ElMessageBox.confirm( |
| | | `ç¡®å®è¦åæ¶æ¡ç ${newBarcode} çæå
æä½åï¼`, |
| | | 'åæ¶å个æå
', |
| | | { |
| | | confirmButtonText: 'ç¡®å®åæ¶', |
| | | cancelButtonText: 'åæ³æ³', |
| | | type: 'warning', |
| | | customClass: 'message-box-top' |
| | | } |
| | | ); |
| | | |
| | | 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('åæ¶æå
失败: ' + error.message); |
| | | } |
| | | } finally { |
| | | this.revertSplitLoading = false; |
| | | } |
| | | ); |
| | | |
| | | 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 |
| | | if (!this.canCancelWholeChain) return; |
| | | |
| | | try { |
| | | await ElMessageBox.confirm( |
| | | `ç¡®å®è¦åæ¶æ´ä¸ªæå
é¾åï¼\nè¿å°åæ¶ä»æ¡ç ${this.splitChainInfo.originalBarcode} å¼å§çæææå
æä½ã`, |
| | | 'åæ¶æå
é¾ç¡®è®¤', |
| | | { |
| | | confirmButtonText: 'ç¡®å®åæ¶', |
| | | cancelButtonText: 'åæ³æ³', |
| | | type: 'warning', |
| | | center: true, |
| | | closeOnClickModal: false, |
| | | customClass: 'message-box-top' |
| | | } |
| | | ); |
| | | |
| | | 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('åæ¶æå
é¾å¤±è´¥: ' + error.message); |
| | | } |
| | | } 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; |
| | | } |
| | | }, |
| | | |
| | | // æ£æ¥æ¡ç æ¯å¦å·²è¢«åæ£ |
| | |
| | | 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() { |
| | | this.showCustomSplitDialog = false; |
| | | this.showRevertSplitDialog = false; |
| | | this.showSplitChainDialog = false; |
| | | this.showBatchReturnDialog = false; |
| | | this.showEmptyPalletDialog = false; |
| | | this.activeDialog = null; |
| | | }, |
| | | // ååºç¸å
³æ¹æ³ |
| | | openBatchReturnDialog() { |
| | | if (!this.scanData.palletCode) { |
| | | 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() { |
| | |
| | | this.$message.error(res.message || 'ååºå¤±è´¥'); |
| | | } |
| | | } catch (error) { |
| | | this.$message.error('ååºå¤±è´¥'); |
| | | this.$message.error('ååºå¤±è´¥: ' + (error.message || 'ç½ç»é误')); |
| | | } finally { |
| | | this.batchReturnLoading = false; |
| | | } |
| | |
| | | |
| | | // åç©ºç®±æ¹æ³ |
| | | 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() { |
| | |
| | | this.$message.error(res.message || 'å走空箱失败'); |
| | | } |
| | | } catch (error) { |
| | | this.$message.error('å走空箱失败'); |
| | | this.$message.error('å走空箱失败: ' + (error.message || 'ç½ç»é误')); |
| | | } finally { |
| | | this.emptypalletOutLoading = false; |
| | | } |
| | |
| | | |
| | | // æ°æ®å è½½æ¹æ³ |
| | | async loadPalletData() { |
| | | if (!this.scanData.orderNo || !this.scanData.palletCode) return; |
| | | 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() { |
| | | try { |
| | | try { |
| | | const res = await http.post('/api/OutboundBatchPicking/pallet-locks', { |
| | | orderNo: this.scanData.orderNo, |
| | | 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 => ({ |
| | | ...item, |
| | | currentBarcode: item.barcode |
| | | })); |
| | | 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 |
| | |
| | | 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(); |
| | |
| | | }, |
| | | |
| | | 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(); |
| | | }, |
| | |
| | | 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', |
| | | 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(`åæ¶æ£é失败: ${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('æ¹éåæ¶æä½å¤±è´¥'); |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | |
| | | // éç½®æ¹æ³ |
| | |
| | | }, |
| | | |
| | | openRevertSplitDialog() { |
| | | this.showRevertSplitDialog = true; |
| | | this.revertSplitForm.newBarcode = ''; |
| | | // å
³éå
¶ä»å¼¹çª |
| | | this.closeAllDialogs(); |
| | | |
| | | this.$nextTick(() => { |
| | | this.showRevertSplitDialog = true; |
| | | this.revertSplitForm.newBarcode = ''; |
| | | }); |
| | | }, |
| | | |
| | | closeRevertSplitDialog() { |
| | |
| | | |
| | | /* èªå®ä¹å¼¹çªæ ·å¼ */ |
| | | :deep(.el-message-box) { |
| | | z-index: 10010 !important; |
| | | z-index: 9999 !important; |
| | | } |
| | | |
| | | :deep(.el-overlay) { |
| | | z-index: 10009 !important; |
| | | z-index: 9998 !important; |
| | | } |
| | | |
| | | :deep(.el-message) { |
| | | z-index: 10011 !important; |
| | | z-index: 10000 !important; |
| | | } |
| | | |
| | | /* ç¡®ä¿ç¡®è®¤å¯¹è¯æ¡å¨æåé¢ */ |
| | | :deep(.message-box-top) { |
| | | z-index: 10001 !important; |
| | | } |
| | | |
| | | .custom-dialog-overlay { |
| | |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | z-index: 2000; /* ä¿æä¸ä¸ªåçç z-index */ |
| | | z-index: 2000; |
| | | } |
| | | |
| | | .custom-dialog-wrapper { |
| | |
| | | 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%; |
| | | } |