| | |
| | | |
| | | import { Page, useVbenModal } from '@vben/common-ui'; |
| | | |
| | | import { Input, message } from 'ant-design-vue'; |
| | | |
| | | import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; |
| | | import { getBatchPage } from '#/api/mes/wm/batch'; |
| | | import { getBatchBySn, getBatchPage } from '#/api/mes/wm/batch'; |
| | | |
| | | import { useGridColumns, useGridFormSchema } from './data'; |
| | | import TraceDetail from './modules/trace-detail.vue'; |
| | |
| | | /** 打开批次追溯详情 */ |
| | | function handleTrace(row: MesWmBatchApi.Batch) { |
| | | detailModalApi.setData(row).open(); |
| | | } |
| | | |
| | | /** 根据 SN 反查批次并打开详情 */ |
| | | async function handleSearchBySn(sn: string) { |
| | | if (!sn) { |
| | | return; |
| | | } |
| | | const batch = await getBatchBySn(sn.trim()); |
| | | if (batch) { |
| | | handleTrace(batch); |
| | | } else { |
| | | message.warning(`未找到 SN「${sn}」对应的批次`); |
| | | } |
| | | } |
| | | |
| | | const [Grid] = useVbenVxeGrid({ |
| | |
| | | <template> |
| | | <Page auto-content-height><DetailModal /> |
| | | |
| | | <div class="mb-3 w-80"> |
| | | <Input.Search |
| | | placeholder="输入 SN 序列号反查批次" |
| | | enter-button="反查" |
| | | allow-clear |
| | | @search="handleSearchBySn" |
| | | /> |
| | | </div> |
| | | |
| | | <Grid table-title="批次追溯列表"> |
| | | <template #actions="{ row }"> |
| | | <TableAction |