| | |
| | | <script lang="ts" setup> |
| | | import { ref } from 'vue'; |
| | | import type { VxeTableGridOptions } from "#/adapter/vxe-table"; |
| | | import type { MesProBagCodeApi } from "#/api/mes/pro/bagCode"; |
| | | |
| | |
| | | unbindBagCodePallet, |
| | | } from "#/api/mes/pro/bagCode"; |
| | | import { IconifyIcon } from "@vben/icons"; |
| | | import { countQrExport, submitQrExport } from '#/api/mes/pro/qrExport'; |
| | | import { $t } from "#/locales"; |
| | | |
| | | import { useGridColumns, useGridFormSchema } from "./data"; |
| | |
| | | import ReplaceModal from "./modules/replace-form.vue"; |
| | | import QrTraceModal from "../components/qr-trace-modal.vue"; |
| | | import BusinessQrModal from "../components/business-qr.vue"; |
| | | import QrExportTaskModal from '../components/qr-export-task-modal.vue'; |
| | | |
| | | defineOptions({ name: "MesProBagCode" }); |
| | | |
| | | const qrExportTaskModal = ref<InstanceType<typeof QrExportTaskModal>>(); |
| | | |
| | | const [GenerateFormModal, generateFormModalApi] = useVbenModal({ |
| | | connectedComponent: GenerateModal, |
| | |
| | | } |
| | | if (!params.uuid && !params.batchId) { |
| | | message.warning("请先按生成组或批次筛选后再导出二维码"); |
| | | return; |
| | | } |
| | | const bizType = kind === 'business' ? 'BAG_BUSINESS' : 'BAG_LABEL'; |
| | | const count = await countQrExport({ bizType, ...params }); |
| | | if (count.mode === 'ASYNC') { |
| | | const task = await submitQrExport({ bizType, ...params }); |
| | | qrExportTaskModal.value?.show(task); |
| | | message.success(`已提交 ${count.totalCount} 张二维码的后台导出任务`); |
| | | return; |
| | | } |
| | | const data = await (kind === 'business' ? exportBagBusinessQr : exportBagQr)(params); |
| | |
| | | <ReplaceFormModal @success="handleReplaceSuccess" /> |
| | | <QrTraceQueryModal /> |
| | | <BusinessQrViewModal /> |
| | | <QrExportTaskModal ref="qrExportTaskModal" /> |
| | | <Grid table-title="袋码列表(一袋一码)"> |
| | | <template #table-title><span class="text-[1rem] font-bold" style="white-space:nowrap">袋码列表(一袋一码)</span></template> |
| | | <template #toolbar-tools> |
| | |
| | | { label: 'Excel 数据包', auth: ['mes:pro-bag-code:export'], onClick: handleExport }]"> |
| | | <template #more><Button>导出 <IconifyIcon icon="lucide:chevron-down" /></Button></template> |
| | | </TableAction> |
| | | <Button @click="qrExportTaskModal?.showLast()">后台导出任务</Button> |
| | | <TableAction :dropdown-trigger="['click']" :drop-down-actions="[{ label: '生成原始袋码', auth: ['mes:pro-bag-code:create'], onClick: handleRawGenerate }, |
| | | { label: '补生成业务码', auth: ['mes:pro-bag-code:create'], onClick: handleGenerateBusinessCodes }, |
| | | { label: '破损替换', auth: ['mes:pro-bag-code:replace'], onClick: handleReplace }, |