| | |
| | | <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-if="showCustomSplitDialog" class="custom-dialog-overlay" style="z-index: 2000;"> |
| | | <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-if="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-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"> |
| | |
| | | </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"> |
| | |
| | | </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"> |
| | |
| | | </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({ |
| | |
| | | components: {printView}, |
| | | data() { |
| | | return { |
| | | // ä¿æææåå§æ°æ®ç»æä¸å... |
| | | scanData: { |
| | | orderNo: '', |
| | | palletCode: '', |
| | |
| | | }, |
| | | 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: '', |
| | |
| | | palletCode: '' |
| | | }, |
| | | |
| | | // æ°å¢ï¼æå
é¾ç¸å
³æ°æ® |
| | | splitChainInfo: { |
| | | originalBarcode: '', |
| | | totalSplitTimes: 0, |
| | | splitChain: [] |
| | | }, |
| | | |
| | | // éªè¯è§å |
| | | // éªè¯è§å... |
| | | splitFormRules: { |
| | | originalBarcode: [ |
| | | { required: true, message: '请è¾å
¥åæ¡ç ', trigger: 'blur' } |
| | |
| | | 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: { |
| | | // æ¯å¦å¯ä»¥åæ¶æ´ä¸ªæå
é¾ |
| | | canCancelWholeChain() { |
| | | return this.splitChainInfo.splitChain && |
| | | this.splitChainInfo.splitChain.some(item => !item.isReverted); |
| | |
| | | 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(){ |
| | |
| | | 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(); |
| | |
| | | } |
| | | }, |
| | | |
| | | // æå
ç¸å
³æ¹æ³ |
| | | openSplitDialog() { |
| | | openSplitDialog() { |
| | | console.log('å¼å§æå¼æå
å¼¹çª'); |
| | | |
| | | if (this.isOpeningDialog) { |
| | | console.log('æ£å¨æå¼å¼¹çªï¼è·³è¿'); |
| | | 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.isOpeningDialog = true; |
| | | |
| | | try { |
| | | // æ¹æ³1: ä½¿ç¨ setTimeout ç¡®ä¿å¼æ¥æ§è¡ |
| | | setTimeout(() => { |
| | | console.log('æ§è¡å¼¹çªæå¼é»è¾'); |
| | | |
| | | // å
å
³éææå¼¹çª |
| | | this.closeAllDialogsImmediately(); |
| | | |
| | | // ä½¿ç¨ requestAnimationFrame ç¡®ä¿å¨ä¸ä¸å¸§æå¼ |
| | | requestAnimationFrame(() => { |
| | | console.log('设置弹çªç¶æä¸º true'); |
| | | |
| | | // é置表å |
| | | this.resetSplitForm(); |
| | | this.splitForm.orderNo = this.scanData.orderNo; |
| | | this.splitForm.palletCode = this.scanData.palletCode; |
| | | |
| | | // å
³é®ï¼ç´æ¥è®¾ç½®å¼¹çªç¶æ |
| | | this.showCustomSplitDialog = true; |
| | | |
| | | console.log('å¼¹çªç¶æå·²è®¾ç½®ï¼çå¾
DOMæ´æ°'); |
| | | |
| | | // ä½¿ç¨ nextTick ç¡®ä¿DOMæ´æ°å®æ |
| | | this.$nextTick(() => { |
| | | console.log('DOMæ´æ°å®æï¼å¼¹çªåºè¯¥æ¾ç¤ºäº'); |
| | | this.isOpeningDialog = false; |
| | | |
| | | // å°è¯èç¦å°è¾å
¥æ¡ |
| | | setTimeout(() => { |
| | | const input = this.$refs.splitFormRef?.$el?.querySelector('input'); |
| | | if (input) { |
| | | input.focus(); |
| | | console.log('è¾å
¥æ¡å·²èç¦'); |
| | | } |
| | | }, 100); |
| | | }); |
| | | }); |
| | | }, 0); |
| | | |
| | | } catch (error) { |
| | | console.error('æå¼æå
å¼¹çªåºé:', error); |
| | | this.isOpeningDialog = false; |
| | | } |
| | | }, |
| | | closeAllDialogsImmediately() { |
| | | console.log('ç«å³å
³éææå¼¹çª'); |
| | | |
| | | // ç´æ¥è®¾ç½®ä¸º falseï¼ä¸çå¾
ä»»ä½å¼æ¥æä½ |
| | | this.showCustomSplitDialog = false; |
| | | this.showRevertSplitDialog = false; |
| | | this.showBatchReturnDialog = false; |
| | | this.showEmptyPalletDialog = false; |
| | | this.showSplitChainDialog = false; |
| | | |
| | | // 强å¶DOMæ´æ° |
| | | this.$forceUpdate(); |
| | | }, |
| | | |
| | | 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); |
| | |
| | | }); |
| | | if (res.status) { |
| | | this.$message.success('æå
æå'); |
| | | this.showCustomSplitDialog = false; |
| | | this.closeAllDialogs(); |
| | | await this.loadPalletData(); |
| | | } else { |
| | | this.$message.error(res.message || 'æå
失败'); |
| | |
| | | }); |
| | | } |
| | | }, |
| | | // 卿å
å¼¹çªä¸æ¥çæå
é¾ |
| | | 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; |
| | | this.revertSplitForm.newBarcode = this.revertSplitForm.newBarcode.replace(/\n/g, '').trim(); |
| | | |
| | | // æ°å¢ï¼æ«æåèªå¨æ¾ç¤ºæå
é¾ä¿¡æ¯ |
| | | await this.viewSplitChain(this.revertSplitForm.newBarcode); |
| | | }, |
| | | |
| | | async handleRevertSplit() { |
| | |
| | | }); |
| | | if (res.status) { |
| | | this.$message.success('æ¤éæå
æå'); |
| | | this.showRevertSplitDialog = false; |
| | | this.closeAllDialogs(); |
| | | await this.loadPalletData(); |
| | | } else { |
| | | this.$message.error(res.message || 'æ¤éæå
失败'); |
| | |
| | | }); |
| | | } |
| | | }, |
| | | // æ¥æ¾å®æ´æå
é¾ï¼ä»æ ¹æ¡ç å¼å§ï¼ |
| | | 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 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.$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.activeDialog = 'splitChain'; |
| | | } else { |
| | | this.$message.error(res.message || 'è·åæå
é¾ä¿¡æ¯å¤±è´¥'); |
| | | } |
| | | } catch (error) { |
| | | 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) { |
| | | // å
è®°å½å½åä¿¡æ¯ï¼ç¶åå
³éå¼¹çª |
| | | 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) { |
| | | const originalBarcode = this.splitChainInfo.originalBarcode; |
| | | |
| | | 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(); |
| | | this.closeAllDialogs(); |
| | | setTimeout(() => { |
| | | this.viewSplitChain(originalBarcode); |
| | | }, 50); |
| | | } 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 this.$confirm( |
| | | `ç¡®å®è¦åæ¶æ´ä¸ªæå
é¾åï¼\nè¿å°åæ¶ä»æ¡ç ${this.splitChainInfo.originalBarcode} å¼å§çæææå
æä½ã`, |
| | | 'åæ¶æå
é¾ç¡®è®¤', |
| | | { |
| | | confirmButtonText: 'ç¡®å®åæ¶', |
| | | cancelButtonText: 'åæ³æ³', |
| | | type: 'warning', |
| | | center: true, |
| | | closeOnClickModal: false |
| | | } |
| | | ); |
| | | |
| | | this.revertSplitLoading = true; |
| | | |
| | | const res = await http.post('/api/OutboundBatchPicking/cancel-split-chain', { |
| | | orderNo: this.scanData.orderNo, |
| | | palletCode: this.scanData.palletCode, |
| | | startBarcode: this.splitChainInfo.originalBarcode |
| | | }); |
| | | |
| | | if (res.status) { |
| | | this.$message.success('åæ¶æå
龿å'); |
| | | this.closeAllDialogs(); |
| | | await this.loadPalletData(); |
| | | } else { |
| | | this.$message.error(res.message || 'åæ¶æå
é¾å¤±è´¥'); |
| | | } |
| | | } catch (error) { |
| | | if (error !== 'cancel') { |
| | | this.$message.error('åæ¶æå
é¾å¤±è´¥: ' + error.message); |
| | | } |
| | | } 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.activeDialog = null; |
| | | // ç¡®ä¿ææå¼¹çªç¶æé½è¢«éç½® |
| | | this.showCustomSplitDialog = false; |
| | | this.showRevertSplitDialog = false; |
| | | this.showBatchReturnDialog = false; |
| | | this.showEmptyPalletDialog = false; |
| | | this.showSplitChainDialog = 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; |
| | | |
| | | if (this.isOpeningDialog) return; |
| | | |
| | | 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() { |
| | |
| | | }); |
| | | if (res.status) { |
| | | this.$message.success('ååºæå'); |
| | | this.showBatchReturnDialog = false; |
| | | this.closeAllDialogs(); |
| | | await this.loadPalletData(); |
| | | } else { |
| | | this.$message.error(res.message || 'ååºå¤±è´¥'); |
| | |
| | | }, |
| | | |
| | | // åç©ºç®±æ¹æ³ |
| | | handleEmptyPallet() { |
| | | this.showEmptyPalletDialog = true; |
| | | this.emptypalletOutForm.orderNo = this.scanData.orderNo; |
| | | this.emptypalletOutForm.palletCode = ''; |
| | | handleEmptyPallet() { |
| | | if (this.isOpeningDialog) return; |
| | | |
| | | 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() { |
| | |
| | | }); |
| | | if (res.status) { |
| | | this.$message.success('å走空箱æå'); |
| | | this.showEmptyPalletDialog = false; |
| | | this.closeAllDialogs(); |
| | | await this.loadPalletData(); |
| | | } else { |
| | | this.$message.error(res.message || 'å走空箱失败'); |
| | |
| | | async loadPalletData() { |
| | | if (!this.scanData.orderNo || !this.scanData.palletCode) return; |
| | | |
| | | await this.loadUnpickedList(); |
| | | await this.loadPickedList(); |
| | | await this.loadPalletStatus(); |
| | | try { |
| | | await this.loadUnpickedList(); |
| | | await this.loadPickedList(); |
| | | await 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); |
| | | } |
| | |
| | | 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) { |
| | |
| | | this.resetSplitForm(); |
| | | }, |
| | | |
| | | openRevertSplitDialog() { |
| | | this.showRevertSplitDialog = true; |
| | | this.revertSplitForm.newBarcode = ''; |
| | | openRevertSplitDialog() { |
| | | if (this.isOpeningDialog) return; |
| | | |
| | | 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; |
| | | }, |
| | | |
| | |
| | | this.emptypalletOutForm.palletCode = this.emptypalletOutForm.palletCode.replace(/\n/g, '').trim(); |
| | | }, |
| | | |
| | | closeEmptyPalletDialog() { |
| | | closeEmptyPalletDialog() { |
| | | this.showEmptyPalletDialog = false; |
| | | this.emptypalletOutForm.palletCode = ''; |
| | | }, |
| | |
| | | color: #909399; |
| | | } |
| | | |
| | | /* èªå®ä¹å¼¹çªæ ·å¼ */ |
| | | :deep(.el-message-box) { |
| | | z-index: 10010 !important; |
| | | } |
| | | |
| | | :deep(.el-overlay) { |
| | | z-index: 10009 !important; |
| | | } |
| | | |
| | | :deep(.el-message) { |
| | | z-index: 10011 !important; |
| | | } |
| | | |
| | | /* èªå®ä¹å¼¹çªæ ·å¼ - å
³é®ä¿®å¤ */ |
| | | .custom-dialog-overlay { |
| | | position: fixed; |
| | | top: 0; |
| | |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | z-index: 2000; /* ä¿æä¸ä¸ªåçç z-index */ |
| | | z-index: 9999; /* æé«z-indexç¡®ä¿å¨æä¸å± */ |
| | | } |
| | | |
| | | .custom-dialog-wrapper { |
| | | position: relative; |
| | | z-index: 2001; |
| | | z-index: 10000; |
| | | } |
| | | |
| | | .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%; |
| | | } |