前端:物料bom完善
master
xs 1 month ago
parent d50e58fbc1
commit 212dbf03ff

@ -170,3 +170,27 @@ export const getMaterialBomVersionList = (query?: MaterialBomVersionQuery): Axio
params: query
});
};
/**
* BOM
* @param materialBomId
*/
export const selectNextMaterialBomVersion = (parentId: string | number): AxiosPromise<string> => {
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
});
};

@ -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,

@ -27,9 +27,9 @@
}}</span>
</div>
</el-tooltip>
<el-button type="primary" link @click="fun(data)"
style=" vertical-align: top; ">
上传
<el-button type="success" v-has-permi="['mes:materialBom:publish']" link @click="publishMaterialBom(data)" style=" vertical-align: top; "
v-if="data.activeFlag && data.activeFlag!==MATERIAL_BOM_ACTIVE_FLAG.ACTIVE && data.children">
发布
</el-button>
</div>
</template>
@ -97,11 +97,11 @@
<el-form-item label='父物料数量' prop='parentStandardAmount'>
<el-input-number v-model='parentForm.parentStandardAmount' :precision="2" :step="1"
placeholder='请输入父物料数量'
style="width:200px" />
style="width:200px" :disabled="parentForm.activeFlag !== MATERIAL_BOM_ACTIVE_FLAG.DESIGN"/>
</el-form-item>
<el-form-item label='单位' prop='parentUnitId'>
<el-select v-model="parentForm.parentUnitId" placeholder="请选择" style="width:200px">
<el-select v-model="parentForm.parentUnitId" placeholder="请选择" style="width:200px" :disabled="parentForm.activeFlag !== MATERIAL_BOM_ACTIVE_FLAG.DESIGN">
<el-option
v-for="item in unitInfoOptions"
:key="item.unitId"
@ -112,7 +112,7 @@
</el-form-item>
<el-form-item label="BOM说明" prop='materialBomDesc'>
<el-input v-model='parentForm.materialBomDesc' placeholder='' style="width:360px" type="textarea" />
<el-input v-model='parentForm.materialBomDesc' placeholder='' style="width:360px" type="textarea" :disabled="parentForm.activeFlag !== MATERIAL_BOM_ACTIVE_FLAG.DESIGN"/>
</el-form-item>
</el-row>
@ -126,12 +126,12 @@
<el-row :gutter="10">
<el-col :span="1.5">
<el-button v-has-permi="['mes:materialBom:add']" type="primary" plain icon="Plus"
@click="handleAdd()" :loading="btnLoading">新增
@click="handleAdd()" :loading="btnLoading" v-if="parentForm.activeFlag === MATERIAL_BOM_ACTIVE_FLAG.DESIGN">新增
</el-button>
</el-col>
<el-col :span="1.5">
<el-button v-has-permi="['mes:materialBom:remove']" type="danger" plain :disabled="multiple"
icon="Delete" @click="handleDelete()" :loading="btnLoading">
icon="Delete" @click="handleDelete()" :loading="btnLoading" v-if="parentForm.activeFlag === MATERIAL_BOM_ACTIVE_FLAG.DESIGN">
删除
</el-button>
</el-col>
@ -187,7 +187,7 @@
<template #footer>
<div class="dialog-footer">
<el-button v-has-permi="['mes:materialBom:add']" type="success" plain icon="CircleCheck"
@click="submitBatchSaveMaterialBoms()" :loading="btnLoading">保存
@click="submitBatchSaveMaterialBoms()" :loading="btnLoading" v-if="parentForm.activeFlag === MATERIAL_BOM_ACTIVE_FLAG.DESIGN">保存
</el-button>
</div>
</template>
@ -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,focusid
// // 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'];
}
};

Loading…
Cancel
Save