diff --git a/apps/web-antd/src/api/mes/wm/batch/index.ts b/apps/web-antd/src/api/mes/wm/batch/index.ts new file mode 100644 index 000000000..02ca877eb --- /dev/null +++ b/apps/web-antd/src/api/mes/wm/batch/index.ts @@ -0,0 +1,67 @@ +import type { PageParam, PageResult } from '@vben/request'; + +import { requestClient } from '#/api/request'; + +export namespace MesWmBatchApi { + /** MES 批次 */ + export interface Batch { + id?: number; // 批次 ID + code?: string; // 批次编码 + itemId?: number; // 物料 ID + itemCode?: string; // 物料编码 + itemName?: string; // 物料名称 + itemSpecification?: string; // 规格型号 + unitName?: string; // 单位名称 + produceDate?: Date; // 生产日期 + expireDate?: Date; // 有效期 + receiptDate?: Date; // 入库日期 + vendorId?: number; // 供应商 ID + vendorCode?: string; // 供应商编码 + vendorName?: string; // 供应商名称 + clientId?: number; // 客户 ID + clientCode?: string; // 客户编码 + clientName?: string; // 客户名称 + purchaseOrderCode?: string; // 采购订单编号 + salesOrderCode?: string; // 销售订单编号 + workOrderId?: number; // 生产工单 ID + workOrderCode?: string; // 生产工单编号 + taskId?: number; // 生产任务 ID + taskCode?: string; // 生产任务编号 + workstationId?: number; // 工作站 ID + workstationCode?: string; // 工作站编码 + toolId?: number; // 工具 ID + toolCode?: string; // 工具编号 + moldId?: number; // 模具 ID + lotNumber?: string; // 生产批号 + qualityStatus?: number; // 质量状态 + remark?: string; // 备注 + } +} + +/** 查询批次详情 */ +export function getBatch(id: number) { + return requestClient.get(`/mes/wm/batch/get?id=${id}`); +} + +/** 查询批次分页 */ +export function getBatchPage(params: PageParam) { + return requestClient.get>( + '/mes/wm/batch/page', + { params }, + ); +} + +/** 批次向前追溯 */ +export function getForwardBatchList(code: string) { + return requestClient.get('/mes/wm/batch/forward-list', { + params: { code }, + }); +} + +/** 批次向后追溯 */ +export function getBackwardBatchList(code: string) { + return requestClient.get( + '/mes/wm/batch/backward-list', + { params: { code } }, + ); +} diff --git a/apps/web-antd/src/views/mes/qc/batchtrace/data.ts b/apps/web-antd/src/views/mes/qc/batchtrace/data.ts new file mode 100644 index 000000000..6e7f8c042 --- /dev/null +++ b/apps/web-antd/src/views/mes/qc/batchtrace/data.ts @@ -0,0 +1,169 @@ +import type { VbenFormSchema } from '#/adapter/form'; +import type { VxeTableGridOptions } from '#/adapter/vxe-table'; +import type { MesWmBatchApi } from '#/api/mes/wm/batch'; + +import { markRaw } from 'vue'; + +import MdClientSelect from '#/views/mes/md/client/components/md-client-select.vue'; +import MdItemSelect from '#/views/mes/md/item/components/md-item-select.vue'; +import MdVendorSelect from '#/views/mes/md/vendor/components/md-vendor-select.vue'; + +/** 列表的搜索表单 */ +export function useGridFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'code', + label: '批次号', + component: 'Input', + componentProps: { + allowClear: true, + placeholder: '请输入批次号', + }, + }, + { + fieldName: 'itemId', + label: '产品物料', + component: markRaw(MdItemSelect), + componentProps: { + placeholder: '请选择产品物料', + }, + }, + { + fieldName: 'vendorId', + label: '供应商', + component: markRaw(MdVendorSelect), + componentProps: { + placeholder: '请选择供应商', + }, + }, + { + fieldName: 'clientId', + label: '客户', + component: markRaw(MdClientSelect), + componentProps: { + placeholder: '请选择客户', + }, + }, + { + fieldName: 'salesOrderCode', + label: '销售订单编号', + component: 'Input', + componentProps: { + allowClear: true, + placeholder: '请输入销售订单编号', + }, + }, + { + fieldName: 'purchaseOrderCode', + label: '采购订单编号', + component: 'Input', + componentProps: { + allowClear: true, + placeholder: '请输入采购订单编号', + }, + }, + ]; +} + +/** 列表的字段 */ +export function useGridColumns(): VxeTableGridOptions['columns'] { + return [ + { + field: 'code', + title: '批次编号', + minWidth: 160, + }, + { + field: 'itemCode', + title: '产品物料编码', + minWidth: 140, + }, + { + field: 'itemName', + title: '产品物料名称', + minWidth: 160, + }, + { + field: 'itemSpecification', + title: '规格型号', + minWidth: 140, + }, + { + field: 'unitName', + title: '单位', + width: 80, + }, + { + field: 'vendorCode', + title: '供应商编码', + minWidth: 140, + }, + { + field: 'vendorName', + title: '供应商名称', + minWidth: 160, + }, + { + field: 'clientCode', + title: '客户编码', + minWidth: 140, + }, + { + field: 'clientName', + title: '客户名称', + minWidth: 160, + }, + { + field: 'salesOrderCode', + title: '销售订单编号', + minWidth: 160, + }, + { + field: 'purchaseOrderCode', + title: '采购订单编号', + minWidth: 160, + }, + { + title: '操作', + width: 110, + fixed: 'right', + slots: { default: 'actions' }, + }, + ]; +} + +/** 追溯明细列表的字段 */ +export function useTraceGridColumns(): VxeTableGridOptions['columns'] { + return [ + { + field: 'workOrderCode', + title: '生产工单号', + width: 160, + }, + { + field: 'code', + title: '批次编号', + minWidth: 160, + }, + { + field: 'itemCode', + title: '产品物料编码', + minWidth: 140, + }, + { + field: 'itemName', + title: '产品物料名称', + minWidth: 160, + }, + { + field: 'itemSpecification', + title: '规格型号', + minWidth: 140, + }, + { + field: 'unitName', + title: '单位', + width: 80, + }, + ]; +} diff --git a/apps/web-antd/src/views/mes/qc/batchtrace/index.vue b/apps/web-antd/src/views/mes/qc/batchtrace/index.vue new file mode 100644 index 000000000..2a88c3b6d --- /dev/null +++ b/apps/web-antd/src/views/mes/qc/batchtrace/index.vue @@ -0,0 +1,81 @@ + + + diff --git a/apps/web-antd/src/views/mes/qc/batchtrace/modules/trace-detail.vue b/apps/web-antd/src/views/mes/qc/batchtrace/modules/trace-detail.vue new file mode 100644 index 000000000..241a2bc61 --- /dev/null +++ b/apps/web-antd/src/views/mes/qc/batchtrace/modules/trace-detail.vue @@ -0,0 +1,89 @@ + + + diff --git a/apps/web-antd/src/views/mes/qc/batchtrace/modules/trace-list.vue b/apps/web-antd/src/views/mes/qc/batchtrace/modules/trace-list.vue new file mode 100644 index 000000000..d961f1707 --- /dev/null +++ b/apps/web-antd/src/views/mes/qc/batchtrace/modules/trace-list.vue @@ -0,0 +1,66 @@ + + +