feat(wms): 优化 md item 的迁移代码
parent
5790211897
commit
67997bd44d
|
|
@ -3,22 +3,22 @@ import { requestClient } from '#/api/request';
|
|||
export namespace MesMdItemBatchConfigApi {
|
||||
/** MES 物料批次属性配置 */
|
||||
export interface BatchConfig {
|
||||
id?: number;
|
||||
itemId?: number;
|
||||
produceDateFlag?: boolean;
|
||||
expireDateFlag?: boolean;
|
||||
receiptDateFlag?: boolean;
|
||||
vendorFlag?: boolean;
|
||||
clientFlag?: boolean;
|
||||
salesOrderCodeFlag?: boolean;
|
||||
purchaseOrderCodeFlag?: boolean;
|
||||
workorderFlag?: boolean;
|
||||
taskFlag?: boolean;
|
||||
workstationFlag?: boolean;
|
||||
toolFlag?: boolean;
|
||||
moldFlag?: boolean;
|
||||
lotNumberFlag?: boolean;
|
||||
qualityStatusFlag?: boolean;
|
||||
id?: number; // 编号
|
||||
itemId?: number; // 物料编号
|
||||
produceDateFlag?: boolean; // 批次属性-生产日期
|
||||
expireDateFlag?: boolean; // 批次属性-有效期
|
||||
receiptDateFlag?: boolean; // 批次属性-入库日期
|
||||
vendorFlag?: boolean; // 批次属性-供应商
|
||||
clientFlag?: boolean; // 批次属性-客户
|
||||
salesOrderCodeFlag?: boolean; // 批次属性-销售订单编号
|
||||
purchaseOrderCodeFlag?: boolean; // 批次属性-采购订单编号
|
||||
workorderFlag?: boolean; // 批次属性-生产工单
|
||||
taskFlag?: boolean; // 批次属性-生产任务
|
||||
workstationFlag?: boolean; // 批次属性-工作站
|
||||
toolFlag?: boolean; // 批次属性-工具
|
||||
moldFlag?: boolean; // 批次属性-模具
|
||||
lotNumberFlag?: boolean; // 批次属性-生产批号
|
||||
qualityStatusFlag?: boolean; // 批次属性-质量状态
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,30 +5,30 @@ import { requestClient } from '#/api/request';
|
|||
export namespace MesMdItemApi {
|
||||
/** MES 物料产品 */
|
||||
export interface Item {
|
||||
id?: number;
|
||||
code?: string;
|
||||
name?: string;
|
||||
specification?: string;
|
||||
unitMeasureId?: number;
|
||||
unitMeasureName?: string;
|
||||
itemTypeId?: number;
|
||||
itemTypeName?: string;
|
||||
itemOrProduct?: string;
|
||||
status?: number;
|
||||
safeStockFlag?: boolean;
|
||||
minStock?: number;
|
||||
maxStock?: number;
|
||||
highValue?: boolean;
|
||||
batchFlag?: boolean;
|
||||
remark?: string;
|
||||
createTime?: Date;
|
||||
id?: number; // 物料编号
|
||||
code?: string; // 物料编码
|
||||
name?: string; // 物料名称
|
||||
specification?: string; // 规格型号
|
||||
unitMeasureId?: number; // 计量单位编号
|
||||
unitMeasureName?: string; // 计量单位名称
|
||||
itemTypeId?: number; // 物料分类编号
|
||||
itemTypeName?: string; // 物料分类名称
|
||||
itemOrProduct?: string; // 物料/产品标识
|
||||
status?: number; // 状态
|
||||
safeStockFlag?: boolean; // 是否启用安全库存
|
||||
minStock?: number; // 最低库存量
|
||||
maxStock?: number; // 最高库存量
|
||||
highValue?: boolean; // 是否高值物料
|
||||
batchFlag?: boolean; // 是否启用批次管理
|
||||
remark?: string; // 备注
|
||||
createTime?: Date; // 创建时间
|
||||
}
|
||||
|
||||
/** 物料导入结果 */
|
||||
export interface ItemImportRespVO {
|
||||
createCodes?: string[];
|
||||
updateCodes?: string[];
|
||||
failureCodes?: Record<string, string>;
|
||||
createCodes?: string[]; // 新增成功的物料编码
|
||||
updateCodes?: string[]; // 更新成功的物料编码
|
||||
failureCodes?: Record<string, string>; // 导入失败的物料编码及原因
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,27 +5,27 @@ import { requestClient } from '#/api/request';
|
|||
export namespace MesMdProductBomApi {
|
||||
/** MES 产品 BOM */
|
||||
export interface ProductBom {
|
||||
id?: number;
|
||||
itemId?: number;
|
||||
bomItemId?: number;
|
||||
quantity?: number;
|
||||
status?: number;
|
||||
remark?: string;
|
||||
createTime?: Date;
|
||||
bomItemCode?: string;
|
||||
bomItemName?: string;
|
||||
bomItemSpecification?: string;
|
||||
unitMeasureName?: string;
|
||||
itemOrProduct?: string;
|
||||
id?: number; // BOM 编号
|
||||
itemId?: number; // 物料产品编号
|
||||
bomItemId?: number; // BOM 物料编号
|
||||
quantity?: number; // 物料使用比例
|
||||
status?: number; // 是否启用
|
||||
remark?: string; // 备注
|
||||
createTime?: Date; // 创建时间
|
||||
bomItemCode?: string; // BOM 物料编码
|
||||
bomItemName?: string; // BOM 物料名称
|
||||
bomItemSpecification?: string; // BOM 物料规格
|
||||
unitMeasureName?: string; // 计量单位名称
|
||||
itemOrProduct?: string; // 物料/产品标识
|
||||
}
|
||||
}
|
||||
|
||||
/** 创建产品 BOM */
|
||||
/** 新增产品 BOM */
|
||||
export function createProductBom(data: MesMdProductBomApi.ProductBom) {
|
||||
return requestClient.post('/mes/md/product-bom/create', data);
|
||||
}
|
||||
|
||||
/** 更新产品 BOM */
|
||||
/** 修改产品 BOM */
|
||||
export function updateProductBom(data: MesMdProductBomApi.ProductBom) {
|
||||
return requestClient.put('/mes/md/product-bom/update', data);
|
||||
}
|
||||
|
|
@ -35,14 +35,14 @@ export function deleteProductBom(id: number) {
|
|||
return requestClient.delete(`/mes/md/product-bom/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 获得产品 BOM */
|
||||
/** 查询产品 BOM 详情 */
|
||||
export function getProductBom(id: number) {
|
||||
return requestClient.get<MesMdProductBomApi.ProductBom>(
|
||||
`/mes/md/product-bom/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 获得产品 BOM 分页 */
|
||||
/** 查询产品 BOM 分页 */
|
||||
export function getProductBomPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MesMdProductBomApi.ProductBom>>(
|
||||
'/mes/md/product-bom/page',
|
||||
|
|
@ -50,7 +50,7 @@ export function getProductBomPage(params: PageParam) {
|
|||
);
|
||||
}
|
||||
|
||||
/** 根据物料产品编号获得产品 BOM 列表 */
|
||||
/** 根据物料产品编号查询产品 BOM 列表 */
|
||||
export function getProductBomListByItemId(itemId: number) {
|
||||
return requestClient.get<MesMdProductBomApi.ProductBom[]>(
|
||||
`/mes/md/product-bom/list-by-item-id?itemId=${itemId}`,
|
||||
|
|
|
|||
|
|
@ -5,26 +5,26 @@ import { requestClient } from '#/api/request';
|
|||
export namespace MesMdProductSipApi {
|
||||
/** MES 产品 SIP */
|
||||
export interface ProductSip {
|
||||
id?: number;
|
||||
itemId?: number;
|
||||
sort?: number;
|
||||
processId?: number;
|
||||
title?: string;
|
||||
description?: string;
|
||||
url?: string;
|
||||
remark?: string;
|
||||
createTime?: Date;
|
||||
processCode?: string;
|
||||
processName?: string;
|
||||
id?: number; // SIP 编号
|
||||
itemId?: number; // 物料产品编号
|
||||
sort?: number; // 排列顺序
|
||||
processId?: number; // 工序编号
|
||||
title?: string; // 标题
|
||||
description?: string; // 详细描述
|
||||
url?: string; // 图片地址
|
||||
remark?: string; // 备注
|
||||
createTime?: Date; // 创建时间
|
||||
processCode?: string; // 工序编码
|
||||
processName?: string; // 工序名称
|
||||
}
|
||||
}
|
||||
|
||||
/** 创建产品 SIP */
|
||||
/** 新增产品 SIP */
|
||||
export function createProductSip(data: MesMdProductSipApi.ProductSip) {
|
||||
return requestClient.post('/mes/md/product-sip/create', data);
|
||||
}
|
||||
|
||||
/** 更新产品 SIP */
|
||||
/** 修改产品 SIP */
|
||||
export function updateProductSip(data: MesMdProductSipApi.ProductSip) {
|
||||
return requestClient.put('/mes/md/product-sip/update', data);
|
||||
}
|
||||
|
|
@ -34,14 +34,14 @@ export function deleteProductSip(id: number) {
|
|||
return requestClient.delete(`/mes/md/product-sip/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 获得产品 SIP */
|
||||
/** 查询产品 SIP 详情 */
|
||||
export function getProductSip(id: number) {
|
||||
return requestClient.get<MesMdProductSipApi.ProductSip>(
|
||||
`/mes/md/product-sip/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 获得产品 SIP 分页 */
|
||||
/** 查询产品 SIP 分页 */
|
||||
export function getProductSipPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MesMdProductSipApi.ProductSip>>(
|
||||
'/mes/md/product-sip/page',
|
||||
|
|
@ -49,7 +49,7 @@ export function getProductSipPage(params: PageParam) {
|
|||
);
|
||||
}
|
||||
|
||||
/** 根据物料产品编号获得产品 SIP 列表 */
|
||||
/** 根据物料产品编号查询产品 SIP 列表 */
|
||||
export function getProductSipListByItemId(itemId: number) {
|
||||
return requestClient.get<MesMdProductSipApi.ProductSip[]>(
|
||||
`/mes/md/product-sip/list-by-item-id?itemId=${itemId}`,
|
||||
|
|
|
|||
|
|
@ -5,26 +5,26 @@ import { requestClient } from '#/api/request';
|
|||
export namespace MesMdProductSopApi {
|
||||
/** MES 产品 SOP */
|
||||
export interface ProductSop {
|
||||
id?: number;
|
||||
itemId?: number;
|
||||
sort?: number;
|
||||
processId?: number;
|
||||
title?: string;
|
||||
description?: string;
|
||||
url?: string;
|
||||
remark?: string;
|
||||
createTime?: Date;
|
||||
processCode?: string;
|
||||
processName?: string;
|
||||
id?: number; // SOP 编号
|
||||
itemId?: number; // 物料产品编号
|
||||
sort?: number; // 排列顺序
|
||||
processId?: number; // 工序编号
|
||||
title?: string; // 标题
|
||||
description?: string; // 详细描述
|
||||
url?: string; // 图片地址
|
||||
remark?: string; // 备注
|
||||
createTime?: Date; // 创建时间
|
||||
processCode?: string; // 工序编码
|
||||
processName?: string; // 工序名称
|
||||
}
|
||||
}
|
||||
|
||||
/** 创建产品 SOP */
|
||||
/** 新增产品 SOP */
|
||||
export function createProductSop(data: MesMdProductSopApi.ProductSop) {
|
||||
return requestClient.post('/mes/md/product-sop/create', data);
|
||||
}
|
||||
|
||||
/** 更新产品 SOP */
|
||||
/** 修改产品 SOP */
|
||||
export function updateProductSop(data: MesMdProductSopApi.ProductSop) {
|
||||
return requestClient.put('/mes/md/product-sop/update', data);
|
||||
}
|
||||
|
|
@ -34,14 +34,14 @@ export function deleteProductSop(id: number) {
|
|||
return requestClient.delete(`/mes/md/product-sop/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 获得产品 SOP */
|
||||
/** 查询产品 SOP 详情 */
|
||||
export function getProductSop(id: number) {
|
||||
return requestClient.get<MesMdProductSopApi.ProductSop>(
|
||||
`/mes/md/product-sop/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 获得产品 SOP 分页 */
|
||||
/** 查询产品 SOP 分页 */
|
||||
export function getProductSopPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MesMdProductSopApi.ProductSop>>(
|
||||
'/mes/md/product-sop/page',
|
||||
|
|
@ -49,7 +49,7 @@ export function getProductSopPage(params: PageParam) {
|
|||
);
|
||||
}
|
||||
|
||||
/** 根据物料产品编号获得产品 SOP 列表 */
|
||||
/** 根据物料产品编号查询产品 SOP 列表 */
|
||||
export function getProductSopListByItemId(itemId: number) {
|
||||
return requestClient.get<MesMdProductSopApi.ProductSop[]>(
|
||||
`/mes/md/product-sop/list-by-item-id?itemId=${itemId}`,
|
||||
|
|
|
|||
|
|
@ -3,16 +3,16 @@ import { requestClient } from '#/api/request';
|
|||
export namespace MesMdItemTypeApi {
|
||||
/** MES 物料产品分类 */
|
||||
export interface ItemType {
|
||||
id?: number;
|
||||
parentId?: number;
|
||||
code?: string;
|
||||
name?: string;
|
||||
itemOrProduct?: string;
|
||||
sort?: number;
|
||||
status?: number;
|
||||
remark?: string;
|
||||
createTime?: Date;
|
||||
children?: ItemType[];
|
||||
id?: number; // 分类编号
|
||||
parentId?: number; // 父分类编号
|
||||
code?: string; // 分类编码
|
||||
name?: string; // 分类名称
|
||||
itemOrProduct?: string; // 物料/产品标识
|
||||
sort?: number; // 显示排序
|
||||
status?: number; // 状态
|
||||
remark?: string; // 备注
|
||||
createTime?: Date; // 创建时间
|
||||
children?: ItemType[]; // 子分类
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ defineOptions({ name: 'MesMdItemForm' });
|
|||
|
||||
const emit = defineEmits(['success']);
|
||||
const formMode = ref<FormMode>('create');
|
||||
const activeTab = ref('bom');
|
||||
const subTabsName = ref('bom');
|
||||
const formData = ref<MesMdItemApi.Item>();
|
||||
const barcodeDetailRef = ref<InstanceType<typeof BarcodeDetail>>();
|
||||
|
||||
|
|
@ -86,6 +86,7 @@ const [Modal, modalApi] = useVbenModal({
|
|||
if (formMode.value === 'create') {
|
||||
const id = await createItem(data);
|
||||
formData.value = { ...data, id };
|
||||
await formApi.setFieldValue('id', id);
|
||||
formMode.value = 'update';
|
||||
message.success($t('ui.actionMessage.operationSuccess'));
|
||||
} else {
|
||||
|
|
@ -104,7 +105,7 @@ const [Modal, modalApi] = useVbenModal({
|
|||
return;
|
||||
}
|
||||
await formApi.resetForm();
|
||||
activeTab.value = 'bom';
|
||||
subTabsName.value = 'bom';
|
||||
// 加载数据
|
||||
const data = modalApi.getData<{ id?: number; type?: FormMode }>();
|
||||
formMode.value = data?.type || 'create';
|
||||
|
|
@ -130,7 +131,7 @@ const [Modal, modalApi] = useVbenModal({
|
|||
<Form class="mx-4" />
|
||||
<Tabs
|
||||
v-if="formMode !== 'create' && formData?.id"
|
||||
v-model:active-key="activeTab"
|
||||
v-model:active-key="subTabsName"
|
||||
class="mx-4 mt-4"
|
||||
>
|
||||
<Tabs.TabPane key="bom" tab="BOM 组成">
|
||||
|
|
|
|||
|
|
@ -3,22 +3,22 @@ import { requestClient } from '#/api/request';
|
|||
export namespace MesMdItemBatchConfigApi {
|
||||
/** MES 物料批次属性配置 */
|
||||
export interface BatchConfig {
|
||||
id?: number;
|
||||
itemId?: number;
|
||||
produceDateFlag?: boolean;
|
||||
expireDateFlag?: boolean;
|
||||
receiptDateFlag?: boolean;
|
||||
vendorFlag?: boolean;
|
||||
clientFlag?: boolean;
|
||||
salesOrderCodeFlag?: boolean;
|
||||
purchaseOrderCodeFlag?: boolean;
|
||||
workorderFlag?: boolean;
|
||||
taskFlag?: boolean;
|
||||
workstationFlag?: boolean;
|
||||
toolFlag?: boolean;
|
||||
moldFlag?: boolean;
|
||||
lotNumberFlag?: boolean;
|
||||
qualityStatusFlag?: boolean;
|
||||
id?: number; // 编号
|
||||
itemId?: number; // 物料编号
|
||||
produceDateFlag?: boolean; // 批次属性-生产日期
|
||||
expireDateFlag?: boolean; // 批次属性-有效期
|
||||
receiptDateFlag?: boolean; // 批次属性-入库日期
|
||||
vendorFlag?: boolean; // 批次属性-供应商
|
||||
clientFlag?: boolean; // 批次属性-客户
|
||||
salesOrderCodeFlag?: boolean; // 批次属性-销售订单编号
|
||||
purchaseOrderCodeFlag?: boolean; // 批次属性-采购订单编号
|
||||
workorderFlag?: boolean; // 批次属性-生产工单
|
||||
taskFlag?: boolean; // 批次属性-生产任务
|
||||
workstationFlag?: boolean; // 批次属性-工作站
|
||||
toolFlag?: boolean; // 批次属性-工具
|
||||
moldFlag?: boolean; // 批次属性-模具
|
||||
lotNumberFlag?: boolean; // 批次属性-生产批号
|
||||
qualityStatusFlag?: boolean; // 批次属性-质量状态
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,30 +5,30 @@ import { requestClient } from '#/api/request';
|
|||
export namespace MesMdItemApi {
|
||||
/** MES 物料产品 */
|
||||
export interface Item {
|
||||
id?: number;
|
||||
code?: string;
|
||||
name?: string;
|
||||
specification?: string;
|
||||
unitMeasureId?: number;
|
||||
unitMeasureName?: string;
|
||||
itemTypeId?: number;
|
||||
itemTypeName?: string;
|
||||
itemOrProduct?: string;
|
||||
status?: number;
|
||||
safeStockFlag?: boolean;
|
||||
minStock?: number;
|
||||
maxStock?: number;
|
||||
highValue?: boolean;
|
||||
batchFlag?: boolean;
|
||||
remark?: string;
|
||||
createTime?: Date;
|
||||
id?: number; // 物料编号
|
||||
code?: string; // 物料编码
|
||||
name?: string; // 物料名称
|
||||
specification?: string; // 规格型号
|
||||
unitMeasureId?: number; // 计量单位编号
|
||||
unitMeasureName?: string; // 计量单位名称
|
||||
itemTypeId?: number; // 物料分类编号
|
||||
itemTypeName?: string; // 物料分类名称
|
||||
itemOrProduct?: string; // 物料/产品标识
|
||||
status?: number; // 状态
|
||||
safeStockFlag?: boolean; // 是否启用安全库存
|
||||
minStock?: number; // 最低库存量
|
||||
maxStock?: number; // 最高库存量
|
||||
highValue?: boolean; // 是否高值物料
|
||||
batchFlag?: boolean; // 是否启用批次管理
|
||||
remark?: string; // 备注
|
||||
createTime?: Date; // 创建时间
|
||||
}
|
||||
|
||||
/** 物料导入结果 */
|
||||
export interface ItemImportRespVO {
|
||||
createCodes?: string[];
|
||||
updateCodes?: string[];
|
||||
failureCodes?: Record<string, string>;
|
||||
createCodes?: string[]; // 新增成功的物料编码
|
||||
updateCodes?: string[]; // 更新成功的物料编码
|
||||
failureCodes?: Record<string, string>; // 导入失败的物料编码及原因
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,27 +5,27 @@ import { requestClient } from '#/api/request';
|
|||
export namespace MesMdProductBomApi {
|
||||
/** MES 产品 BOM */
|
||||
export interface ProductBom {
|
||||
id?: number;
|
||||
itemId?: number;
|
||||
bomItemId?: number;
|
||||
quantity?: number;
|
||||
status?: number;
|
||||
remark?: string;
|
||||
createTime?: Date;
|
||||
bomItemCode?: string;
|
||||
bomItemName?: string;
|
||||
bomItemSpecification?: string;
|
||||
unitMeasureName?: string;
|
||||
itemOrProduct?: string;
|
||||
id?: number; // BOM 编号
|
||||
itemId?: number; // 物料产品编号
|
||||
bomItemId?: number; // BOM 物料编号
|
||||
quantity?: number; // 物料使用比例
|
||||
status?: number; // 是否启用
|
||||
remark?: string; // 备注
|
||||
createTime?: Date; // 创建时间
|
||||
bomItemCode?: string; // BOM 物料编码
|
||||
bomItemName?: string; // BOM 物料名称
|
||||
bomItemSpecification?: string; // BOM 物料规格
|
||||
unitMeasureName?: string; // 计量单位名称
|
||||
itemOrProduct?: string; // 物料/产品标识
|
||||
}
|
||||
}
|
||||
|
||||
/** 创建产品 BOM */
|
||||
/** 新增产品 BOM */
|
||||
export function createProductBom(data: MesMdProductBomApi.ProductBom) {
|
||||
return requestClient.post('/mes/md/product-bom/create', data);
|
||||
}
|
||||
|
||||
/** 更新产品 BOM */
|
||||
/** 修改产品 BOM */
|
||||
export function updateProductBom(data: MesMdProductBomApi.ProductBom) {
|
||||
return requestClient.put('/mes/md/product-bom/update', data);
|
||||
}
|
||||
|
|
@ -35,14 +35,14 @@ export function deleteProductBom(id: number) {
|
|||
return requestClient.delete(`/mes/md/product-bom/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 获得产品 BOM */
|
||||
/** 查询产品 BOM 详情 */
|
||||
export function getProductBom(id: number) {
|
||||
return requestClient.get<MesMdProductBomApi.ProductBom>(
|
||||
`/mes/md/product-bom/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 获得产品 BOM 分页 */
|
||||
/** 查询产品 BOM 分页 */
|
||||
export function getProductBomPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MesMdProductBomApi.ProductBom>>(
|
||||
'/mes/md/product-bom/page',
|
||||
|
|
@ -50,7 +50,7 @@ export function getProductBomPage(params: PageParam) {
|
|||
);
|
||||
}
|
||||
|
||||
/** 根据物料产品编号获得产品 BOM 列表 */
|
||||
/** 根据物料产品编号查询产品 BOM 列表 */
|
||||
export function getProductBomListByItemId(itemId: number) {
|
||||
return requestClient.get<MesMdProductBomApi.ProductBom[]>(
|
||||
`/mes/md/product-bom/list-by-item-id?itemId=${itemId}`,
|
||||
|
|
|
|||
|
|
@ -5,26 +5,26 @@ import { requestClient } from '#/api/request';
|
|||
export namespace MesMdProductSipApi {
|
||||
/** MES 产品 SIP */
|
||||
export interface ProductSip {
|
||||
id?: number;
|
||||
itemId?: number;
|
||||
sort?: number;
|
||||
processId?: number;
|
||||
title?: string;
|
||||
description?: string;
|
||||
url?: string;
|
||||
remark?: string;
|
||||
createTime?: Date;
|
||||
processCode?: string;
|
||||
processName?: string;
|
||||
id?: number; // SIP 编号
|
||||
itemId?: number; // 物料产品编号
|
||||
sort?: number; // 排列顺序
|
||||
processId?: number; // 工序编号
|
||||
title?: string; // 标题
|
||||
description?: string; // 详细描述
|
||||
url?: string; // 图片地址
|
||||
remark?: string; // 备注
|
||||
createTime?: Date; // 创建时间
|
||||
processCode?: string; // 工序编码
|
||||
processName?: string; // 工序名称
|
||||
}
|
||||
}
|
||||
|
||||
/** 创建产品 SIP */
|
||||
/** 新增产品 SIP */
|
||||
export function createProductSip(data: MesMdProductSipApi.ProductSip) {
|
||||
return requestClient.post('/mes/md/product-sip/create', data);
|
||||
}
|
||||
|
||||
/** 更新产品 SIP */
|
||||
/** 修改产品 SIP */
|
||||
export function updateProductSip(data: MesMdProductSipApi.ProductSip) {
|
||||
return requestClient.put('/mes/md/product-sip/update', data);
|
||||
}
|
||||
|
|
@ -34,14 +34,14 @@ export function deleteProductSip(id: number) {
|
|||
return requestClient.delete(`/mes/md/product-sip/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 获得产品 SIP */
|
||||
/** 查询产品 SIP 详情 */
|
||||
export function getProductSip(id: number) {
|
||||
return requestClient.get<MesMdProductSipApi.ProductSip>(
|
||||
`/mes/md/product-sip/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 获得产品 SIP 分页 */
|
||||
/** 查询产品 SIP 分页 */
|
||||
export function getProductSipPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MesMdProductSipApi.ProductSip>>(
|
||||
'/mes/md/product-sip/page',
|
||||
|
|
@ -49,7 +49,7 @@ export function getProductSipPage(params: PageParam) {
|
|||
);
|
||||
}
|
||||
|
||||
/** 根据物料产品编号获得产品 SIP 列表 */
|
||||
/** 根据物料产品编号查询产品 SIP 列表 */
|
||||
export function getProductSipListByItemId(itemId: number) {
|
||||
return requestClient.get<MesMdProductSipApi.ProductSip[]>(
|
||||
`/mes/md/product-sip/list-by-item-id?itemId=${itemId}`,
|
||||
|
|
|
|||
|
|
@ -5,26 +5,26 @@ import { requestClient } from '#/api/request';
|
|||
export namespace MesMdProductSopApi {
|
||||
/** MES 产品 SOP */
|
||||
export interface ProductSop {
|
||||
id?: number;
|
||||
itemId?: number;
|
||||
sort?: number;
|
||||
processId?: number;
|
||||
title?: string;
|
||||
description?: string;
|
||||
url?: string;
|
||||
remark?: string;
|
||||
createTime?: Date;
|
||||
processCode?: string;
|
||||
processName?: string;
|
||||
id?: number; // SOP 编号
|
||||
itemId?: number; // 物料产品编号
|
||||
sort?: number; // 排列顺序
|
||||
processId?: number; // 工序编号
|
||||
title?: string; // 标题
|
||||
description?: string; // 详细描述
|
||||
url?: string; // 图片地址
|
||||
remark?: string; // 备注
|
||||
createTime?: Date; // 创建时间
|
||||
processCode?: string; // 工序编码
|
||||
processName?: string; // 工序名称
|
||||
}
|
||||
}
|
||||
|
||||
/** 创建产品 SOP */
|
||||
/** 新增产品 SOP */
|
||||
export function createProductSop(data: MesMdProductSopApi.ProductSop) {
|
||||
return requestClient.post('/mes/md/product-sop/create', data);
|
||||
}
|
||||
|
||||
/** 更新产品 SOP */
|
||||
/** 修改产品 SOP */
|
||||
export function updateProductSop(data: MesMdProductSopApi.ProductSop) {
|
||||
return requestClient.put('/mes/md/product-sop/update', data);
|
||||
}
|
||||
|
|
@ -34,14 +34,14 @@ export function deleteProductSop(id: number) {
|
|||
return requestClient.delete(`/mes/md/product-sop/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 获得产品 SOP */
|
||||
/** 查询产品 SOP 详情 */
|
||||
export function getProductSop(id: number) {
|
||||
return requestClient.get<MesMdProductSopApi.ProductSop>(
|
||||
`/mes/md/product-sop/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 获得产品 SOP 分页 */
|
||||
/** 查询产品 SOP 分页 */
|
||||
export function getProductSopPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MesMdProductSopApi.ProductSop>>(
|
||||
'/mes/md/product-sop/page',
|
||||
|
|
@ -49,7 +49,7 @@ export function getProductSopPage(params: PageParam) {
|
|||
);
|
||||
}
|
||||
|
||||
/** 根据物料产品编号获得产品 SOP 列表 */
|
||||
/** 根据物料产品编号查询产品 SOP 列表 */
|
||||
export function getProductSopListByItemId(itemId: number) {
|
||||
return requestClient.get<MesMdProductSopApi.ProductSop[]>(
|
||||
`/mes/md/product-sop/list-by-item-id?itemId=${itemId}`,
|
||||
|
|
|
|||
|
|
@ -3,16 +3,16 @@ import { requestClient } from '#/api/request';
|
|||
export namespace MesMdItemTypeApi {
|
||||
/** MES 物料产品分类 */
|
||||
export interface ItemType {
|
||||
id?: number;
|
||||
parentId?: number;
|
||||
code?: string;
|
||||
name?: string;
|
||||
itemOrProduct?: string;
|
||||
sort?: number;
|
||||
status?: number;
|
||||
remark?: string;
|
||||
createTime?: Date;
|
||||
children?: ItemType[];
|
||||
id?: number; // 分类编号
|
||||
parentId?: number; // 父分类编号
|
||||
code?: string; // 分类编码
|
||||
name?: string; // 分类名称
|
||||
itemOrProduct?: string; // 物料/产品标识
|
||||
sort?: number; // 显示排序
|
||||
status?: number; // 状态
|
||||
remark?: string; // 备注
|
||||
createTime?: Date; // 创建时间
|
||||
children?: ItemType[]; // 子分类
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ defineOptions({ name: 'MesMdItemForm' });
|
|||
|
||||
const emit = defineEmits(['success']);
|
||||
const formMode = ref<FormMode>('create');
|
||||
const activeTab = ref('bom');
|
||||
const subTabsName = ref('bom');
|
||||
const formData = ref<MesMdItemApi.Item>();
|
||||
const barcodeDetailRef = ref<InstanceType<typeof BarcodeDetail>>();
|
||||
|
||||
|
|
@ -86,6 +86,7 @@ const [Modal, modalApi] = useVbenModal({
|
|||
if (formMode.value === 'create') {
|
||||
const id = await createItem(data);
|
||||
formData.value = { ...data, id };
|
||||
await formApi.setFieldValue('id', id);
|
||||
formMode.value = 'update';
|
||||
ElMessage.success($t('ui.actionMessage.operationSuccess'));
|
||||
} else {
|
||||
|
|
@ -104,7 +105,7 @@ const [Modal, modalApi] = useVbenModal({
|
|||
return;
|
||||
}
|
||||
await formApi.resetForm();
|
||||
activeTab.value = 'bom';
|
||||
subTabsName.value = 'bom';
|
||||
// 加载数据
|
||||
const data = modalApi.getData<{ id?: number; type?: FormMode }>();
|
||||
formMode.value = data?.type || 'create';
|
||||
|
|
@ -130,7 +131,7 @@ const [Modal, modalApi] = useVbenModal({
|
|||
<Form class="mx-4" />
|
||||
<ElTabs
|
||||
v-if="formMode !== 'create' && formData?.id"
|
||||
v-model="activeTab"
|
||||
v-model="subTabsName"
|
||||
class="mx-4 mt-4"
|
||||
>
|
||||
<ElTabPane name="bom" label="BOM 组成">
|
||||
|
|
|
|||
Loading…
Reference in New Issue