From 212dbf03fffc03b27c94d8ca8c1076b95e9ec260 Mon Sep 17 00:00:00 2001 From: xs Date: Mon, 19 May 2025 08:36:51 +0800 Subject: [PATCH] =?UTF-8?q?1.3.3=20=E5=89=8D=E7=AB=AF=EF=BC=9A=E7=89=A9?= =?UTF-8?q?=E6=96=99bom=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/mes/materialBom/index.ts | 24 +++++++++++++ src/router/index.ts | 14 ++++++++ src/views/mes/materialBom/index.vue | 52 ++++++++++++++++++++--------- 3 files changed, 75 insertions(+), 15 deletions(-) diff --git a/src/api/mes/materialBom/index.ts b/src/api/mes/materialBom/index.ts index ccdb9ad..cd36aa2 100644 --- a/src/api/mes/materialBom/index.ts +++ b/src/api/mes/materialBom/index.ts @@ -170,3 +170,27 @@ export const getMaterialBomVersionList = (query?: MaterialBomVersionQuery): Axio params: query }); }; + +/** + * 查询物料BOM信息详细 + * @param materialBomId + */ +export const selectNextMaterialBomVersion = (parentId: string | number): AxiosPromise => { + return request({ + url: '/mes/materialBom/selectNextMaterialBomVersion/' + parentId, + method: 'get' + }); +}; + + +/** + * 发布物料BOM信息 + * @param data + */ +export const publish = (data: MaterialBomForm) => { + return request({ + url: '/mes/materialBom/publish', + method: 'post', + data: data + }); +}; diff --git a/src/router/index.ts b/src/router/index.ts index 2005e2a..261892c 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -291,6 +291,20 @@ export const dynamicRoutes: RouteRecordRaw[] = [ } ] }, + { + path: '/mes/product-order', + component: Layout, + hidden: true, + permissions: ['mes:orderInfo:edit'], + children: [ + { + path: 'index/:productOrderId(\\d+)', + component: () => import('@/views/mes/orderInfo/editProductOrder.vue'), + name: 'productOrderEdit', + meta: { title: '生产任务', activeMenu: '/mes/productplan', noCache: true } + } + ] + }, { path: '/dms/deviceMode/mode-edit', component: Layout, diff --git a/src/views/mes/materialBom/index.vue b/src/views/mes/materialBom/index.vue index 980fde2..a775250 100644 --- a/src/views/mes/materialBom/index.vue +++ b/src/views/mes/materialBom/index.vue @@ -27,9 +27,9 @@ }} - - 上传 + + 发布 @@ -97,11 +97,11 @@ + style="width:200px" :disabled="parentForm.activeFlag !== MATERIAL_BOM_ACTIVE_FLAG.DESIGN"/> - + - + @@ -126,12 +126,12 @@ 新增 + @click="handleAdd()" :loading="btnLoading" v-if="parentForm.activeFlag === MATERIAL_BOM_ACTIVE_FLAG.DESIGN">新增 + icon="Delete" @click="handleDelete()" :loading="btnLoading" v-if="parentForm.activeFlag === MATERIAL_BOM_ACTIVE_FLAG.DESIGN"> 删除 @@ -187,7 +187,7 @@ @@ -278,7 +278,7 @@ import { listMaterialBomJoinStructure, addBatchMaterialBom, getUnitInfoList, getMaterialBomVersionList, getParentMaterialBom, deleteMaterialBoms, - selectNextMaterialBomVersion + selectNextMaterialBomVersion,publish } from '@/api/mes/materialBom'; import { MaterialBomVO, MaterialBomForm, MaterialBomQuery } from '@/api/mes/materialBom/types'; @@ -971,6 +971,28 @@ const addNewMaterialBomVersion = async () => { console.log(materialBomList); }; +/** 基于当前父级物料和版本,发布 */ +const publishMaterialBom = async (data) => { + try{ + loading.value = true; + treeLoading.value = true; + const toPublishMaterialBom = { + parentId:data.materialId, + materialBomVersion:data.materialBomVersion + }; + + await publish(toPublishMaterialBom); + proxy?.$modal.msgSuccess('操作成功'); + await getTreeSelect(); + loading.value = false; + }catch (e) { + proxy?.$modal.msgWarning(e); + loading.value = false; + treeLoading.value = false; + } + +}; + // const getClickNode = (obj) => { // // 如果当前对象有 id,并且与之前focus的id相同,则收集 // // console.log(JSON.stringify(obj)) @@ -987,13 +1009,13 @@ const addNewMaterialBomVersion = async () => { // // } const getColor = (e) => { - if (e.materialBomVersion === '01') { - return ['#ff0000', '#fff']; - } - if (e.materialBomVersion === '02') { + if (e.activeFlag === MATERIAL_BOM_ACTIVE_FLAG.value.ACTIVE) { return ['#00ff00', '#000']; } - if (e.materialBomVersion === '03') { + if (e.activeFlag === MATERIAL_BOM_ACTIVE_FLAG.value.HISTORY) { + return ['#ff0000', '#fff']; + } + if (e.activeFlag === MATERIAL_BOM_ACTIVE_FLAG.value.DESIGN) { return ['#0000ff', '#fff']; } };