|
|
|
@ -2,7 +2,7 @@
|
|
|
|
|
<div class="p-2">
|
|
|
|
|
<el-row :gutter="20">
|
|
|
|
|
<!-- bom结构树 -->
|
|
|
|
|
<el-col :lg="4" :xs="24" style="">
|
|
|
|
|
<el-col :lg="4" :xs="24" style="" v-loading="treeLoading">
|
|
|
|
|
<el-card shadow="hover">
|
|
|
|
|
<el-input v-model="materialTypeName" placeholder="请输入物料类型名称" prefix-icon="Search" clearable/>
|
|
|
|
|
<el-tree
|
|
|
|
@ -19,7 +19,7 @@
|
|
|
|
|
/>
|
|
|
|
|
</el-card>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :lg="20" :xs="24">
|
|
|
|
|
<el-col :lg="20" :xs="24" v-loading="loading">
|
|
|
|
|
<el-divider content-position="left">物料类型</el-divider>
|
|
|
|
|
<el-form ref="parentStructureBomFormRef" label-width="120px">
|
|
|
|
|
<el-row>
|
|
|
|
@ -83,7 +83,7 @@
|
|
|
|
|
</el-row>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<el-table v-loading="loading" :data="structureBomList" @selection-change="handleSelectionChange">
|
|
|
|
|
<el-table :data="structureBomList" @selection-change="handleSelectionChange">
|
|
|
|
|
<el-table-column type="selection" width="50" align="center"/>
|
|
|
|
|
<el-table-column v-if="columns[0].visible" key="structureBomId" label="BOM结构编号" align="center"
|
|
|
|
|
prop="structureBomId"/>
|
|
|
|
@ -168,7 +168,7 @@ import {
|
|
|
|
|
addBaseStructureBom,
|
|
|
|
|
updateBaseStructureBom, getMaterialTypeList
|
|
|
|
|
} from "@/api/mes/baseStructureBom";
|
|
|
|
|
import {BaseStructureBomVO, BaseStructureBomQuery, BaseStructureBomForm} from '@/api/mes/baseStructureBom/types';
|
|
|
|
|
import {BaseStructureBomVO, BaseStructureBomTreeVO,BaseStructureBomQuery, BaseStructureBomForm} from '@/api/mes/baseStructureBom/types';
|
|
|
|
|
import {BaseMaterialTypeVO} from '@/api/mes/baseMaterialType/types';
|
|
|
|
|
import {to} from 'await-to-js';
|
|
|
|
|
import {nextTick} from "vue";
|
|
|
|
@ -177,6 +177,7 @@ const router = useRouter();
|
|
|
|
|
const {proxy} = getCurrentInstance() as ComponentInternalInstance;
|
|
|
|
|
const {sys_normal_disable, sys_user_sex} = toRefs<any>(proxy?.useDict('sys_normal_disable', 'sys_user_sex'));
|
|
|
|
|
const structureBomList = ref<BaseStructureBomVO[]>();
|
|
|
|
|
const treeLoading = ref(false);
|
|
|
|
|
const loading = ref(false);
|
|
|
|
|
const submitLoading = ref(false);
|
|
|
|
|
const showSearch = ref(true);
|
|
|
|
@ -186,7 +187,7 @@ const multiple = ref(true);
|
|
|
|
|
const total = ref(0);
|
|
|
|
|
const dateRange = ref<[DateModelType, DateModelType]>(['', '']);
|
|
|
|
|
const materialTypeName = ref('');
|
|
|
|
|
const structureBomOptions = ref<BaseStructureBomVO[]>([]);
|
|
|
|
|
const structureBomOptions = ref<BaseStructureBomTreeVO[]>([]);
|
|
|
|
|
const materialTypeOptions = ref<BaseMaterialTypeVO[]>([]);
|
|
|
|
|
const parentMaterialTypeName = ref('');
|
|
|
|
|
const parentParentMaterialTypeName = ref('');
|
|
|
|
@ -266,6 +267,8 @@ watchEffect(
|
|
|
|
|
|
|
|
|
|
/** 查询物料类型bom结构树下拉树结构 */
|
|
|
|
|
const getTreeSelect = async () => {
|
|
|
|
|
treeLoading.value = true;
|
|
|
|
|
loading.value = true;
|
|
|
|
|
const res = await structureBomTreeSelect();
|
|
|
|
|
// alert(JSON.stringify(res))
|
|
|
|
|
structureBomOptions.value = res.data;
|
|
|
|
@ -292,13 +295,14 @@ const getList = async () => {
|
|
|
|
|
loading.value = true;
|
|
|
|
|
const res = await listBaseStructureBom(queryParams.value);
|
|
|
|
|
// alert(JSON.stringify(res))
|
|
|
|
|
loading.value = false;
|
|
|
|
|
structureBomList.value = res.data;
|
|
|
|
|
loading.value = false;
|
|
|
|
|
treeLoading.value = false;
|
|
|
|
|
// total.value = res.total;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** 节点单击事件 */
|
|
|
|
|
const handleNodeClick = (data: BaseStructureBomVO) => {
|
|
|
|
|
const handleNodeClick = (data: BaseStructureBomTreeVO) => {
|
|
|
|
|
queryParams.value.parentId = data.id;
|
|
|
|
|
parentMaterialTypeName.value = data.label;
|
|
|
|
|
if (data.parentId === 0) {
|
|
|
|
|