| | |
| | | @keyup.enter.native="onBarcodeScan"> |
| | | </el-input> |
| | | <el-button type="success" @click="confirmPicking">确认æ£é</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> |
| | | <el-button type="danger" @click="handleDirectOutbound">ç´æ¥åºåº</el-button> |
| | | <!-- <el-button type="danger" @click="handleDirectOutbound">ç´æ¥åºåº</el-button> --> |
| | | |
| | | </div> |
| | | </el-card> |
| | |
| | | <div class="summary-info"> |
| | | <el-tag type="warning">æªæ£éæ¡æ°: {{summary.unpickedCount}}</el-tag> |
| | | <el-tag type="danger">æªæ£éæ°é: {{summary.unpickedQuantity}}</el-tag> |
| | | <el-tag type="success">å·²æ£éæ¡æ°: {{summary.pickedCount}}</el-tag> |
| | | <!-- <el-tag type="success">å·²æ£éæ¡æ°: {{summary.pickedCount}}</el-tag> --> |
| | | <el-tag type="info">æçç¶æ: {{palletStatus}}</el-tag> |
| | | </div> |
| | | </el-card> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- å走空箱--> |
| | | <div v-if="showEmptyPalletDialog" class="custom-dialog-overlay"> |
| | | <div class="custom-dialog-wrapper"> |
| | | <div class="custom-dialog"> |
| | | <div class="custom-dialog-header"> |
| | | <h3>å走空箱</h3> |
| | | <el-button |
| | | type="text" |
| | | @click="closeEmptyPalletDialog" |
| | | class="close-button"> |
| | | Ã |
| | | </el-button> |
| | | </div> |
| | | <div class="custom-dialog-body"> |
| | | <el-form |
| | | :model="emptypalletOutForm" |
| | | :rules="emptypalletOutFormRules" |
| | | ref="emptypalletOutFormRef" |
| | | label-width="100px"> |
| | | <el-form-item label="订åç¼å·"> |
| | | <el-input v-model="emptypalletOutForm.orderNo" disabled></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="æçç¼å·" prop="palletCode"> |
| | | <el-input |
| | | v-model="emptypalletOutForm.palletCode" |
| | | placeholder="æ«ææçç " |
| | | @keyup.enter.native="onEmptyPalletScan" |
| | | @change="onEmptyPalletScan" |
| | | clearable> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <div class="custom-dialog-footer"> |
| | | <el-button @click="closeEmptyPalletDialog">åæ¶</el-button> |
| | | <el-button type="primary" @click="handleEmptyPalletConfirm" :loading="emptypalletOutLoading">确认å走空箱</el-button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- ç´æ¥åºåºå¼¹çª --> |
| | | <div v-if="showDirectOutDialog" class="custom-dialog-overlay"> |
| | | <div class="custom-dialog-wrapper"> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <print-view ref="childs" @parentcall="parentcall"></print-view> |
| | | </template> |
| | | |
| | | <script> |
| | |
| | | import { ref, defineComponent } from "vue"; |
| | | import { ElMessage } from 'element-plus' |
| | | import { useRoute } from 'vue-router' |
| | | import printView from "@/extension/outbound/extend/printView.vue" |
| | | |
| | | export default defineComponent({ |
| | | name: 'PickingConfirm', |
| | | components: { |
| | | |
| | | }, |
| | | components: {printView}, |
| | | props: { |
| | | orderNo: { |
| | | type: String, |
| | |
| | | { required: true, validator: validateDirectOutPalletCode, trigger: 'blur' } |
| | | ] |
| | | }, |
| | | |
| | | showEmptyPalletDialog: false, // åèµ°ç©ºç®±å¼¹çªæ¾ç¤ºç¶æ |
| | | emptypalletOutLoading: false, // å走空箱å è½½ç¶æ |
| | | emptypalletOutForm: { |
| | | orderNo: '', |
| | | palletCode: '' |
| | | }, |
| | | emptypalletOutFormRules: { |
| | | palletCode: [ |
| | | { required: true, validator: validateDirectOutPalletCode, trigger: 'blur' } |
| | | ] |
| | | }, |
| | | |
| | | |
| | | returnForm: { |
| | | orderNo: '', |
| | | palletCode: '', |
| | |
| | | } |
| | | }, |
| | | |
| | | // æ¹éååºæçç æ«ç |
| | | // ååºæçç æ«ç |
| | | onBatchReturnPalletScan() { |
| | | if (!this.batchReturnForm.palletCode) return; |
| | | |
| | |
| | | } |
| | | }, |
| | | |
| | | // æ¹éååºç¡®è®¤ |
| | | // ååºç¡®è®¤ |
| | | async handleBatchReturnConfirm() { |
| | | // 表åéªè¯ |
| | | if (this.$refs.batchReturnFormRef) { |
| | |
| | | } |
| | | }, |
| | | |
| | | // æäº¤æ¹éååºè¯·æ± |
| | | // æäº¤ååºè¯·æ± |
| | | async submitBatchReturn() { |
| | | this.batchReturnLoading = true; |
| | | |
| | | try { |
| | | const res = await this.http.post('/api/OutboundPicking/batch-return-to-stock', { |
| | | const res = await this.http.post('/api/OutboundPicking/return-to-stock', { |
| | | orderNo: this.batchReturnForm.orderNo, |
| | | palletCode: this.batchReturnForm.palletCode |
| | | }); |
| | | |
| | | if (res.status) { |
| | | this.$message.success('æ¹éååºæå'); |
| | | this.$message.success(res.message); |
| | | this.showBatchReturnDialog = false; |
| | | this.loadData(); |
| | | } else { |
| | | this.$message.error(res.message || 'æ¹éååºå¤±è´¥'); |
| | | this.$message.error(res.message || 'ååºå¤±è´¥'); |
| | | } |
| | | } catch (error) { |
| | | this.$message.error('æ¹éååºå¤±è´¥'); |
| | | this.$message.error('ååºå¤±è´¥'); |
| | | } finally { |
| | | this.batchReturnLoading = false; |
| | | } |
| | |
| | | handleDirectOutbound() { |
| | | this.openDirectOutDialog(); |
| | | }, |
| | | |
| | | // æå¼åèµ°ç©ºç®±å¼¹çª |
| | | openEmptyPalletDialog() { |
| | | console.log('æå¼å走空箱弹çª'); |
| | | this.showEmptyPalletDialog = true; |
| | | |
| | | // é置表å |
| | | this.resetEmptyPalletForm(); |
| | | |
| | | // 设置订åä¿¡æ¯ |
| | | this.emptypalletOutForm.orderNo = this.scanData.orderNo; |
| | | |
| | | // æ¸
é¤è¡¨åéªè¯ |
| | | this.$nextTick(() => { |
| | | if (this.$refs.emptyPalletFormRef) { |
| | | this.$refs.emptyPalletFormRef.clearValidate(); |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | // å
³éåèµ°ç©ºç®±å¼¹çª |
| | | closeEmptyPalletDialog() { |
| | | this.showEmptyPalletDialog = false; |
| | | this.resetEmptyPalletForm(); |
| | | |
| | | // æ¸
é¤è¡¨åéªè¯ |
| | | if (this.$refs.emptyPalletFormRef) { |
| | | this.$refs.emptyPalletFormRef.clearValidate(); |
| | | } |
| | | }, |
| | | |
| | | // å走空箱æçç æ«ç |
| | | onEmptyPalletScan() { |
| | | if (!this.emptypalletOutForm.palletCode) return; |
| | | |
| | | this.emptypalletOutForm.palletCode = this.emptypalletOutForm.palletCode.replace(/\n/g, '').trim(); |
| | | |
| | | // æ¸
é¤éªè¯ç¶æ |
| | | if (this.$refs.emptyPalletFormRef) { |
| | | this.$refs.emptyPalletFormRef.clearValidate(['palletCode']); |
| | | } |
| | | }, |
| | | |
| | | // å走空箱确认 |
| | | async handleEmptyPalletConfirm() { |
| | | // 表åéªè¯ |
| | | if (this.$refs.emptyPalletFormRef) { |
| | | this.$refs.emptyPalletFormRef.validate((valid) => { |
| | | if (valid) { |
| | | this.submitEmptyPallet(); |
| | | } else { |
| | | this.$message.warning('è¯·æ«ææçç '); |
| | | return false; |
| | | } |
| | | }); |
| | | } else { |
| | | // å¦ææ²¡æè¡¨åå¼ç¨ï¼ä½¿ç¨åæçéªè¯ |
| | | if (!this.emptypalletOutForm.palletCode) { |
| | | this.$message.warning('è¯·æ«ææçç '); |
| | | return; |
| | | } |
| | | |
| | | this.submitEmptyPallet(); |
| | | } |
| | | }, |
| | | |
| | | // æäº¤åèµ°ç©ºç®±è¯·æ± |
| | | async submitEmptyPallet() { |
| | | this.emptypalletOutLoading = true; |
| | | |
| | | try { |
| | | const res = await this.http.post('/api/OutboundPicking/remove-empty-pallet', { |
| | | orderNo: this.emptypalletOutForm.orderNo, |
| | | palletCode: this.emptypalletOutForm.palletCode |
| | | }); |
| | | debugger; |
| | | if (res.status) { |
| | | this.$message.success('å走空箱æå'); |
| | | this.showEmptyPalletDialog = false; |
| | | this.loadData(); |
| | | } else { |
| | | this.$message.error(res.message || 'å走空箱失败'); |
| | | } |
| | | } catch (error) { |
| | | this.$message.error('å走空箱失败'); |
| | | } finally { |
| | | this.emptypalletOutLoading = false; |
| | | } |
| | | }, |
| | | |
| | | // éç½®å走空箱表å |
| | | resetEmptyPalletForm() { |
| | | this.emptypalletOutForm.palletCode = ''; |
| | | }, |
| | | |
| | | // ä¿®æ¹åæçå走空箱æé®ç¹å»äºä»¶ |
| | | handleEmptyPallet() { |
| | | this.openEmptyPalletDialog(); |
| | | }, |
| | | |
| | | |
| | | |
| | | |
| | | async loadData() { |
| | | if (!this.scanData.orderNo || !this.scanData.palletCode) { |
| | | return; |
| | |
| | | |
| | | if (res.status) { |
| | | successCount++; |
| | | this.$message.success(`æååæ¶`); |
| | | } else { |
| | | errorCount++; |
| | | console.error(`åæ¶æ£é失败: ${row.Barcode}`, res.message); |
| | | this.$message.warning(`åæ¶æ£é失败: ${row.currentBarcode} - ${res.message}`); |
| | | } |
| | | } catch (error) { |
| | | errorCount++; |
| | | console.error(`åæ¶æ£é失败: ${row.Barcode}`, error); |
| | | this.$message.warning(`åæ¶æ£é失败: ${row.currentBarcode} - ${error.message}` ); |
| | | } |
| | | } |
| | | |
| | | if (errorCount === 0) { |
| | | this.$message.success(`æååæ¶ ${successCount} 项`); |
| | | } else { |
| | | this.$message.warning(`æååæ¶ ${successCount} 项ï¼å¤±è´¥ ${errorCount} 项`); |
| | | } |
| | | } |
| | | |
| | | this.loadData(); |
| | | this.selectedPickedRows = []; |
| | |
| | | this.$message.success('æ£é确认æå'); |
| | | this.scanData.barcode = ''; // æ¸
ç©ºç©ææ¡ç |
| | | this.loadData(); |
| | | |
| | | console.log(res.data.splitResults) |
| | | if(res.data && res.data.splitResults.length>0){ |
| | | // è°ç¨åç»ä»¶æå°æ¹æ³ |
| | | this.$refs.childs.open(res.data.splitResults); |
| | | //this.$refs.childs.printSplitLabel(res.data.splitResults); |
| | | } |
| | | // æååç»§ç»èç¦å°ç©ææ¡ç è¾å
¥æ¡ï¼åå¤ä¸ä¸ä¸ªæ«ç |
| | | this.$nextTick(() => { |
| | | this.$refs.barcodeInput.focus(); |
| | |
| | | barcode: this.returnForm.barcode |
| | | }); |
| | | |
| | | if (res.success) { |
| | | if (res.status) { |
| | | this.$message.success('ååºæå'); |
| | | this.showReturnDialog = false; |
| | | this.resetReturnForm(); |
| | |
| | | if (res.status) { |
| | | this.$message.success('æå
æå'); |
| | | this.showSplitDialog = false; |
| | | this.splitLoading = false; |
| | | this.resetSplitForm(); |
| | | this.loadData(); |
| | | } else { |
| | | this.splitLoading = false; |
| | | this.$message.error(res.message || 'æå
失败'); |
| | | } |
| | | } catch (error) { |
| | | this.splitLoading = false; |
| | | this.$message.error('æå
失败'); |
| | | } |
| | | }, |
| | |
| | | if (res.status) { |
| | | this.$message.success('æ¤éæå
æå'); |
| | | this.showRevertSplitDialog = false; |
| | | this.revertSplitLoading = false; |
| | | this.revertSplitForm.originalBarcode = ''; |
| | | this.loadData(); |
| | | } else { |
| | | this.revertSplitLoading = false; |
| | | this.$message.error(res.message || 'æ¤éæå
失败'); |
| | | } |
| | | } catch (error) { |
| | | this.revertSplitLoading = false; |
| | | this.$message.error('æ¤éæå
失败'); |
| | | } |
| | | }, |