update 物料BOM显示优化

master
yinq 4 months ago
parent 6f3cb944e8
commit 4db2bbdedd

@ -271,7 +271,7 @@ const getTreeSelect = async () => {
loading.value = true;
const res = await structureBomTreeSelect();
// structureBomOptions.value = res.data;
structureBomOptions.value = [];
const initialTree: BaseStructureBomTreeVO = {
id: 1,
parentId: -1,

@ -92,21 +92,21 @@
<el-table :data="materialBomList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="50" align="center"/>
<el-table-column type="index" width="50" align="center" label="序号"/>
<el-table-column v-if="columns[0].visible" key="materialBomId" label="生产BOM编号" align="center"
prop="materialBomId"/>
<el-table-column v-if="columns[0].visible" key="materialBomId" label="生产BOM_ID" align="center"
prop="materialBomId" width="110px"/>
<el-table-column v-if="columns[1].visible" key="materialTypeCode" label="子物料类型编号" align="center"
prop="materialTypeCode" :show-overflow-tooltip="true"/>
prop="materialTypeCode" :show-overflow-tooltip="true" width="130px"/>
<el-table-column v-if="columns[2].visible" key="materialTypeName" label="子物料类型名称" align="center"
prop="materialTypeName" :show-overflow-tooltip="true"/>
prop="materialTypeName" :show-overflow-tooltip="true" width="130px"/>
<el-table-column v-if="columns[3].visible" key="materialBomVersion" label="BOM版本" align="center"
prop="materialBomVersion" :show-overflow-tooltip="true">
prop="materialBomVersion" :show-overflow-tooltip="true" width="90px">
<template #default='scope'>
<el-input v-model='scope.row.materialBomVersion'/>
</template>
</el-table-column>
<el-table-column v-if="columns[4].visible" key="materialId" label="子物料ID" align="center"
prop="materialId" :show-overflow-tooltip="true"/>
prop="materialId" :show-overflow-tooltip="true" />
<el-table-column v-if="columns[5].visible" key="materialName" label="子物料名称" align="center"
prop="materialName" :show-overflow-tooltip="true" width="300px">
<template #default='scope'>
@ -115,14 +115,14 @@
</template>
</el-table-column>
<el-table-column v-if="columns[6].visible" key="standardAmount" label="子物料数量" align="center"
prop="standardAmount" :show-overflow-tooltip="true">
prop="standardAmount" :show-overflow-tooltip="true" width="100px">
<template #default='scope'>
<el-input v-model='scope.row.standardAmount'/>
</template>
</el-table-column>
<el-table-column v-if="columns[7].visible" key="unitName" label="子物料单位" align="center"
prop="unitName" :show-overflow-tooltip="true"/>
prop="unitName" :show-overflow-tooltip="true" width="100px"/>
</el-table>
<!-- <pagination-->
@ -231,7 +231,7 @@ const childTableTitle = ref('');
const materialName = ref('');
const materialBomOptions = ref<MaterialBomVO[]>([]);
const materialTypeOptions = ref<BaseMaterialTypeVO[]>([]);
const parentMaterialId = ref(-1);
const parentMaterialId = ref(1);
const parentParentMaterialId = ref();
const parentMaterialTypeName = ref('');
const parentMaterialName = ref('');
@ -239,11 +239,11 @@ const parentMaterialBomVersion = ref('');
//
const columns = ref<FieldOption[]>([
{key: 0, label: `生产BOM编号`, visible: true, children: []},
{key: 0, label: `生产BOM_ID`, visible: false, children: []},
{key: 1, label: `子物料类型编号`, visible: true, children: []},
{key: 2, label: `子物料类型名称`, visible: true, children: []},
{key: 3, label: `BOM版本`, visible: false, children: []},
{key: 4, label: `子物料ID`, visible: true, children: []},
{key: 4, label: `子物料ID`, visible: false, children: []},
{key: 5, label: `子物料名称`, visible: true, children: []},
{key: 6, label: `子物料数量`, visible: true, children: []},
{key: 7, label: `子物料单位`, visible: true, children: []}
@ -314,7 +314,7 @@ const {queryParams, form, rules} = toRefs(data);
/** 通过条件过滤节点 */
const filterNode = (value: string, data: any) => {
if (!value) return true;
return data.label.indexOf(value) !== -1;
return data.label?.toLowerCase().includes(value.toLowerCase());
};
/** 根据名称筛选部门树 */
watchEffect(
@ -338,7 +338,7 @@ const getTreeSelect = async () => {
columns.value[3].visible = false;
if (queryParams.value.parentId === null || queryParams.value.parentId === undefined) {
const topMaterialBom = materialBomOptions.value.find(item => item.id === 0);
queryParams.value.bomStructureParentId = -1;//bomparentId
queryParams.value.bomStructureParentId = 1;//bomparentId
queryParams.value.parentId = 0;
parentMaterialId.value = 0;
parentParentMaterialId.value = undefined;

Loading…
Cancel
Save