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