|
|
@ -270,13 +270,22 @@ const getTreeSelect = async () => {
|
|
|
|
treeLoading.value = true;
|
|
|
|
treeLoading.value = true;
|
|
|
|
loading.value = true;
|
|
|
|
loading.value = true;
|
|
|
|
const res = await structureBomTreeSelect();
|
|
|
|
const res = await structureBomTreeSelect();
|
|
|
|
// alert(JSON.stringify(res))
|
|
|
|
// structureBomOptions.value = res.data;
|
|
|
|
structureBomOptions.value = res.data;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const initialTree: BaseStructureBomTreeVO = {
|
|
|
|
|
|
|
|
id: 1,
|
|
|
|
|
|
|
|
parentId: -1,
|
|
|
|
|
|
|
|
materialTypeId: 0,
|
|
|
|
|
|
|
|
label: "制造BOM结构",
|
|
|
|
|
|
|
|
children: res.data
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
structureBomOptions.value.push(initialTree);
|
|
|
|
if (queryParams.value.parentId === null || queryParams.value.parentId === undefined) {
|
|
|
|
if (queryParams.value.parentId === null || queryParams.value.parentId === undefined) {
|
|
|
|
const topStructureBom = structureBomOptions.value.find(item => item.id === -1);
|
|
|
|
const topStructureBom = structureBomOptions.value.find(item => item.parentId === -1);
|
|
|
|
queryParams.value.parentId = -1;
|
|
|
|
if (topStructureBom != null){
|
|
|
|
parentMaterialTypeName.value = topStructureBom.label;
|
|
|
|
parentMaterialTypeName.value = topStructureBom.label;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
queryParams.value.parentId = 1;
|
|
|
|
parentParentMaterialTypeName.value = "顶级";
|
|
|
|
parentParentMaterialTypeName.value = "顶级";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -305,10 +314,10 @@ const getList = async () => {
|
|
|
|
const handleNodeClick = (data: BaseStructureBomTreeVO) => {
|
|
|
|
const handleNodeClick = (data: BaseStructureBomTreeVO) => {
|
|
|
|
queryParams.value.parentId = data.id;
|
|
|
|
queryParams.value.parentId = data.id;
|
|
|
|
parentMaterialTypeName.value = data.label;
|
|
|
|
parentMaterialTypeName.value = data.label;
|
|
|
|
if (data.parentId === 0) {
|
|
|
|
if (data.parentId === -1) {
|
|
|
|
parentParentMaterialTypeName.value = "顶级";
|
|
|
|
parentParentMaterialTypeName.value = "顶级";
|
|
|
|
} else if (data.parentId === -1) {
|
|
|
|
} else if (data.parentId === 1) {
|
|
|
|
parentParentMaterialTypeName.value = "BOM结构";
|
|
|
|
parentParentMaterialTypeName.value = "制造BOM结构";
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
const findMaterialType = materialTypeOptions.value.find(item => item.matrialTypeId === data.parentId);
|
|
|
|
const findMaterialType = materialTypeOptions.value.find(item => item.matrialTypeId === data.parentId);
|
|
|
|
parentParentMaterialTypeName.value = findMaterialType.matrialTypeName;
|
|
|
|
parentParentMaterialTypeName.value = findMaterialType.matrialTypeName;
|
|
|
|