| | |
| | | exportBagCodeExcel, |
| | | exportBagQr, |
| | | getBagCodePage, |
| | | bindBagCodeBatch, |
| | | unbindBagCodePallet, |
| | | } from "#/api/mes/pro/bagCode"; |
| | | import { $t } from "#/locales"; |
| | | |
| | | import { useGridColumns, useGridFormSchema } from "./data"; |
| | | import BindBatchModal from "./modules/bind-batch.vue"; |
| | | import BindPalletModal from "./modules/bind-pallet.vue"; |
| | | import GenerateModal from "./modules/generate-form.vue"; |
| | | import ReplaceModal from "./modules/replace-form.vue"; |
| | |
| | | |
| | | const [GenerateFormModal, generateFormModalApi] = useVbenModal({ |
| | | connectedComponent: GenerateModal, |
| | | destroyOnClose: true, |
| | | }); |
| | | |
| | | const [BindBatchFormModal, bindBatchFormModalApi] = useVbenModal({ |
| | | connectedComponent: BindBatchModal, |
| | | destroyOnClose: true, |
| | | }); |
| | | |
| | |
| | | .open(); |
| | | } |
| | | |
| | | /** 批量录入生产批次 */ |
| | | function handleBindBatch() { |
| | | const records = getSelectedRecords(); |
| | | if (!records) return; |
| | | if (records.some((record) => record.status !== MesProBagCodeStatusEnum.GENERATED || record.batchId)) { |
| | | message.warning("请选择未录入批次且状态为已生成的袋码"); |
| | | return; |
| | | } |
| | | bindBatchFormModalApi.setData({ ids: records.map((record) => record.id!) }).open(); |
| | | } |
| | | |
| | | /** 批量绑定托盘 */ |
| | | function handleBindPallet() { |
| | | const records = getSelectedRecords(); |
| | | if (!records) return; |
| | | if (records.some((record) => !record.batchId)) { |
| | | message.warning("请先录入生产批次,再绑定托盘"); |
| | | return; |
| | | } |
| | | const batchIds = new Set(records.map((record) => record.batchId)); |
| | | if (batchIds.size > 1) { |
| | | message.warning("请选择同一批次下的袋码进行绑定"); |
| | |
| | | <template> |
| | | <Page auto-content-height> |
| | | <GenerateFormModal @success="handleRefresh" /> |
| | | <BindBatchFormModal @success="handleRefresh" /> |
| | | <BindPalletFormModal @success="handleRefresh" /> |
| | | <ReplaceFormModal @success="handleReplaceSuccess" /> |
| | | <QrTraceQueryModal /> |
| | |
| | | onClick: handleGenerate, |
| | | }, |
| | | { |
| | | label: '录入批次', |
| | | type: 'primary', |
| | | auth: ['mes:pro-bag-code:update'], |
| | | onClick: handleBindBatch, |
| | | }, |
| | | { |
| | | label: '绑定托盘', |
| | | type: 'primary', |
| | | auth: ['mes:pro-bag-code:update'], |