diff --git a/src/api/mes/md/item/productBom/index.ts b/src/api/mes/md/item/productBom/index.ts new file mode 100644 index 000000000..dac96599e --- /dev/null +++ b/src/api/mes/md/item/productBom/index.ts @@ -0,0 +1,51 @@ +import request from '@/config/axios' + +// MES 产品BOM VO +export interface MdProductBomVO { + id?: number // BOM 编号 + itemId: number // 物料产品 ID + bomItemId: number // BOM 物料 ID + quantity: number // 物料使用比例 + status?: number // 是否启用 + remark?: string // 备注 + createTime?: Date // 创建时间 + // ========== 关联展示字段 ========== + bomItemCode?: string // BOM 物料编码 + bomItemName?: string // BOM 物料名称 + bomItemSpecification?: string // BOM 物料规格 + unitMeasureName?: string // 计量单位名称 + itemOrProduct?: string // 产品物料标识 +} + +// MES 产品BOM API +export const MdProductBomApi = { + // 创建产品BOM + createProductBom: async (data: MdProductBomVO) => { + return await request.post({ url: `/mes/md/product-bom/create`, data }) + }, + + // 更新产品BOM + updateProductBom: async (data: MdProductBomVO) => { + return await request.put({ url: `/mes/md/product-bom/update`, data }) + }, + + // 删除产品BOM + deleteProductBom: async (id: number) => { + return await request.delete({ url: `/mes/md/product-bom/delete?id=` + id }) + }, + + // 获得产品BOM + getProductBom: async (id: number) => { + return await request.get({ url: `/mes/md/product-bom/get?id=` + id }) + }, + + // 获得产品BOM分页 + getProductBomPage: async (params: any) => { + return await request.get({ url: `/mes/md/product-bom/page`, params }) + }, + + // 根据物料产品编号获得产品BOM列表 + getProductBomListByItemId: async (itemId: number) => { + return await request.get({ url: `/mes/md/product-bom/list-by-item-id?itemId=` + itemId }) + } +} diff --git a/src/api/mes/md/item/productSip/index.ts b/src/api/mes/md/item/productSip/index.ts new file mode 100644 index 000000000..7cd2a08d3 --- /dev/null +++ b/src/api/mes/md/item/productSip/index.ts @@ -0,0 +1,50 @@ +import request from '@/config/axios' + +// MES 产品SIP VO +export interface MdProductSipVO { + id?: number // SIP 编号 + itemId: number // 物料产品 ID + orderNumber: number // 排列顺序 + processId?: number // 工序 ID + title: string // 标题 + description?: string // 详细描述 + url?: string // 图片地址 + remark?: string // 备注 + createTime?: Date // 创建时间 + // ========== 关联展示字段 ========== + processCode?: string // 工序编号 + processName?: string // 工序名称 +} + +// MES 产品SIP API +export const MdProductSipApi = { + // 创建产品SIP + createProductSip: async (data: MdProductSipVO) => { + return await request.post({ url: `/mes/md/product-sip/create`, data }) + }, + + // 更新产品SIP + updateProductSip: async (data: MdProductSipVO) => { + return await request.put({ url: `/mes/md/product-sip/update`, data }) + }, + + // 删除产品SIP + deleteProductSip: async (id: number) => { + return await request.delete({ url: `/mes/md/product-sip/delete?id=` + id }) + }, + + // 获得产品SIP + getProductSip: async (id: number) => { + return await request.get({ url: `/mes/md/product-sip/get?id=` + id }) + }, + + // 获得产品SIP分页 + getProductSipPage: async (params: any) => { + return await request.get({ url: `/mes/md/product-sip/page`, params }) + }, + + // 根据物料产品编号获得产品SIP列表 + getProductSipListByItemId: async (itemId: number) => { + return await request.get({ url: `/mes/md/product-sip/list-by-item-id?itemId=` + itemId }) + } +} diff --git a/src/api/mes/md/item/productSop/index.ts b/src/api/mes/md/item/productSop/index.ts new file mode 100644 index 000000000..f5b83b58e --- /dev/null +++ b/src/api/mes/md/item/productSop/index.ts @@ -0,0 +1,50 @@ +import request from '@/config/axios' + +// MES 产品SOP VO +export interface MdProductSopVO { + id?: number // SOP 编号 + itemId: number // 物料产品 ID + orderNumber: number // 排列顺序 + processId?: number // 工序 ID + title: string // 标题 + description?: string // 详细描述 + url?: string // 图片地址 + remark?: string // 备注 + createTime?: Date // 创建时间 + // ========== 关联展示字段 ========== + processCode?: string // 工序编号 + processName?: string // 工序名称 +} + +// MES 产品SOP API +export const MdProductSopApi = { + // 创建产品SOP + createProductSop: async (data: MdProductSopVO) => { + return await request.post({ url: `/mes/md/product-sop/create`, data }) + }, + + // 更新产品SOP + updateProductSop: async (data: MdProductSopVO) => { + return await request.put({ url: `/mes/md/product-sop/update`, data }) + }, + + // 删除产品SOP + deleteProductSop: async (id: number) => { + return await request.delete({ url: `/mes/md/product-sop/delete?id=` + id }) + }, + + // 获得产品SOP + getProductSop: async (id: number) => { + return await request.get({ url: `/mes/md/product-sop/get?id=` + id }) + }, + + // 获得产品SOP分页 + getProductSopPage: async (params: any) => { + return await request.get({ url: `/mes/md/product-sop/page`, params }) + }, + + // 根据物料产品编号获得产品SOP列表 + getProductSopListByItemId: async (itemId: number) => { + return await request.get({ url: `/mes/md/product-sop/list-by-item-id?itemId=` + itemId }) + } +} diff --git a/src/views/mes/md/item/MdItemBatchConfigForm.vue b/src/views/mes/md/item/MdItemBatchConfigForm.vue index a8ee9aebf..fb91a9c23 100644 --- a/src/views/mes/md/item/MdItemBatchConfigForm.vue +++ b/src/views/mes/md/item/MdItemBatchConfigForm.vue @@ -4,7 +4,7 @@
保存批次属性
-
+
生产日期 质量状态 @@ -39,13 +39,14 @@ import { MesItemOrProductEnum } from '@/views/mes/utils/constants' defineOptions({ name: 'MdItemBatchConfigForm' }) const props = defineProps<{ - itemId: number - itemOrProduct: string // 'ITEM' | 'PRODUCT' + itemId: number // 物料编号 + itemOrProduct: string // 区分原材料/产品:'ITEM' | 'PRODUCT' }>() -const message = useMessage() -const loading = ref(false) -const formRef = ref() +const message = useMessage() // 消息弹窗 +const loading = ref(false) // 加载中 +const formRef = ref() // 表单 Ref +/** 表单数据 */ const formData = ref({ itemId: props.itemId, produceDateFlag: false, @@ -112,11 +113,3 @@ const handleSave = async () => { onMounted(() => loadData()) - - diff --git a/src/views/mes/md/item/MdProductSipForm.vue b/src/views/mes/md/item/MdProductSipForm.vue index fcba67afe..3c1fbe3e9 100644 --- a/src/views/mes/md/item/MdProductSipForm.vue +++ b/src/views/mes/md/item/MdProductSipForm.vue @@ -9,16 +9,19 @@ -
- -
+
+ +
{{ item.title }}
-
序号:{{ item.orderNum }}
+
序号:{{ item.orderNumber }}
工序:{{ item.processName }}
@@ -41,22 +44,15 @@ - - - - + - - diff --git a/src/views/mes/md/item/MdProductSopForm.vue b/src/views/mes/md/item/MdProductSopForm.vue index 6029e0613..ee0987e43 100644 --- a/src/views/mes/md/item/MdProductSopForm.vue +++ b/src/views/mes/md/item/MdProductSopForm.vue @@ -9,16 +9,19 @@ -
- -
+
+ +
{{ item.title }}
-
序号:{{ item.orderNum }}
+
序号:{{ item.orderNumber }}
工序:{{ item.processName }}
@@ -41,22 +44,15 @@ - - - - + - - diff --git a/src/views/mes/md/workstation/WorkstationForm.vue b/src/views/mes/md/workstation/WorkstationForm.vue index e614960e0..2077ed574 100644 --- a/src/views/mes/md/workstation/WorkstationForm.vue +++ b/src/views/mes/md/workstation/WorkstationForm.vue @@ -43,7 +43,7 @@ - + @@ -94,20 +94,17 @@ import WorkstationMachinePanel from './components/WorkstationMachinePanel.vue' import WorkstationToolPanel from './components/WorkstationToolPanel.vue' import WorkstationWorkerPanel from './components/WorkstationWorkerPanel.vue' -// TODO @AI:方法注释; -// TODO @AI:字段注释; - defineOptions({ name: 'WorkstationForm' }) const { t } = useI18n() // 国际化 const message = useMessage() // 消息弹窗 -const dialogVisible = ref(false) -const dialogTitle = ref('') -const formLoading = ref(false) -const formType = ref('') -const activeTab = ref('machine') -const workshopList = ref([]) // 车间列表 +const dialogVisible = ref(false) // 弹窗的是否展示 +const dialogTitle = ref('') // 弹窗的标题 +const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用 +const formType = ref('') // 表单的类型:create - 新增;update - 修改 +const activeTab = ref('machine') // 当前激活的资源 Tab +const workshopList = ref([]) // 车间下拉列表 const formData = ref({ id: undefined, code: undefined, @@ -120,13 +117,13 @@ const formData = ref({ areaId: undefined, status: CommonStatusEnum.ENABLE, remark: undefined -}) +}) // 表单数据 const formRules = reactive({ code: [{ required: true, message: '工作站编码不能为空', trigger: 'blur' }], name: [{ required: true, message: '工作站名称不能为空', trigger: 'blur' }], workshopId: [{ required: true, message: '所在车间不能为空', trigger: 'change' }], status: [{ required: true, message: '状态不能为空', trigger: 'blur' }] -}) +}) // 表单校验规则 const formRef = ref() /** 生成工作站编码 */ diff --git a/src/views/mes/md/workstation/components/WorkstationMachinePanel.vue b/src/views/mes/md/workstation/components/WorkstationMachinePanel.vue index 42affd659..5e8f7ce39 100644 --- a/src/views/mes/md/workstation/components/WorkstationMachinePanel.vue +++ b/src/views/mes/md/workstation/components/WorkstationMachinePanel.vue @@ -16,22 +16,31 @@ - - + + - + - + - +
@@ -40,16 +49,13 @@