diff --git a/apps/web-antdv-next/src/api/mes/wm/sn/index.ts b/apps/web-antdv-next/src/api/mes/wm/sn/index.ts index 6970a796a..c0de18db4 100644 --- a/apps/web-antdv-next/src/api/mes/wm/sn/index.ts +++ b/apps/web-antdv-next/src/api/mes/wm/sn/index.ts @@ -17,6 +17,21 @@ export namespace MesWmSnApi { createTime?: Date; // 生成时间 } + /** MES SN 码明细 */ + export interface Sn { + id?: number; // 编号 + uuid?: string; // 批次 UUID + code?: string; // SN 码 + itemId?: number; // 物料编号 + itemCode?: string; // 物料编码 + itemName?: string; // 物料名称 + specification?: string; // 规格型号 + unitName?: string; // 单位名称 + batchCode?: string; // 批次号 + workOrderId?: number; // 生产工单编号 + createTime?: Date; // 生成时间 + } + /** MES SN 码生成参数 */ export interface SnGenerate { itemId?: number; // 物料编号 @@ -48,6 +63,13 @@ export function getSnGroupPage(params: MesWmSnApi.PageParams) { ); } +/** 查询批次 SN 码明细列表 */ +export function getSnListByUuid(uuid: string) { + return requestClient.get('/mes/wm/sn/list-by-uuid', { + params: { uuid }, + }); +} + /** 批量删除 SN 码(按批次 UUID) */ export function deleteSnBatch(uuid: string) { return requestClient.delete('/mes/wm/sn/delete-batch', { diff --git a/apps/web-antdv-next/src/views/mes/wm/sn/data.ts b/apps/web-antdv-next/src/views/mes/wm/sn/data.ts index 804fd203f..202336608 100644 --- a/apps/web-antdv-next/src/views/mes/wm/sn/data.ts +++ b/apps/web-antdv-next/src/views/mes/wm/sn/data.ts @@ -117,6 +117,7 @@ export function useGridColumns(): VxeTableGridOptions['colum field: 'count', title: 'SN 码数量', width: 100, + slots: { default: 'count' }, }, { field: 'createTime', @@ -126,7 +127,55 @@ export function useGridColumns(): VxeTableGridOptions['colum }, { title: '操作', - width: 180, + width: 240, + fixed: 'right', + slots: { default: 'actions' }, + }, + ]; +} + +/** SN 码明细弹窗的字段 */ +export function useDetailGridColumns(): VxeTableGridOptions['columns'] { + return [ + { + field: 'code', + title: 'SN 码', + minWidth: 180, + }, + { + field: 'itemCode', + title: '物料编码', + minWidth: 120, + }, + { + field: 'itemName', + title: '物料名称', + minWidth: 150, + }, + { + field: 'specification', + title: '规格型号', + minWidth: 120, + }, + { + field: 'unitName', + title: '单位', + width: 80, + }, + { + field: 'batchCode', + title: '批次号', + minWidth: 120, + }, + { + field: 'createTime', + title: '生成时间', + width: 180, + formatter: 'formatDateTime', + }, + { + title: '操作', + width: 100, fixed: 'right', slots: { default: 'actions' }, }, diff --git a/apps/web-antdv-next/src/views/mes/wm/sn/index.vue b/apps/web-antdv-next/src/views/mes/wm/sn/index.vue index d9c50c56d..97b3a318b 100644 --- a/apps/web-antdv-next/src/views/mes/wm/sn/index.vue +++ b/apps/web-antdv-next/src/views/mes/wm/sn/index.vue @@ -17,6 +17,7 @@ import { import { $t } from '#/locales'; import { useGridColumns, useGridFormSchema } from './data'; +import Detail from './modules/detail.vue'; import Form from './modules/form.vue'; const [FormModal, formModalApi] = useVbenModal({ @@ -24,6 +25,11 @@ const [FormModal, formModalApi] = useVbenModal({ destroyOnClose: true, }); +const [DetailModal, detailModalApi] = useVbenModal({ + connectedComponent: Detail, + destroyOnClose: true, +}); + /** 刷新表格 */ function handleRefresh() { gridApi.query(); @@ -46,6 +52,11 @@ async function handleExportDetail(row: MesWmSnApi.SnGroup) { downloadFileFromBlobPart({ fileName: 'SN码明细.xls', source: data }); } +/** 查看 SN 码明细 */ +function handleDetail(row: MesWmSnApi.SnGroup) { + detailModalApi.setData(row).open(); +} + /** 删除 SN 码批次 */ async function handleDelete(row: MesWmSnApi.SnGroup) { const hideLoading = message.loading({ @@ -104,6 +115,7 @@ const [Grid, gridApi] = useVbenVxeGrid({ + +