生产bom前端完成
master
xs 4 months ago
parent 70c141556a
commit f4a636cb88

@ -84,10 +84,10 @@ export interface BaseStructureBomVO {
*/
updateTime: string;
/**
*
*/
children: BaseStructureBomVO[];
/**
*
*/
children: BaseStructureBomVO[];
}
export interface BaseStructureBomForm extends BaseEntity {
@ -200,11 +200,37 @@ export interface BaseStructureBomQuery {
*/
activeFlag?: string;
/**
*
*/
params?: any;
/**
*
*/
params?: any;
/**
*
*/
materialTypeCode?: string;
}
export interface BaseStructureBomTreeVO {
/**
*
*/
id: string | number;
/**
*
*/
parentId: string | number;
/**
* ID
*/
materialTypeId: string | number;
/**
*
*/
label: string;
}

@ -88,3 +88,30 @@ export const addBatchMaterialBom = (data) => {
data: data
});
};
/**
* bom
*/
export const materialBomTreeSelect = (): AxiosPromise<MaterialBomVO[]> => {
return request({
url: '/mes/materialBom/materialBomTree',
method: 'get'
});
};
/**
* BOM
* @param query
* @returns {*}
*/
export const listMaterialBomJoinStructure = (query?: MaterialBomQuery): AxiosPromise<MaterialBomVO[]> => {
return request({
url: '/mes/materialBom/joinStructureList',
method: 'get',
params: query
});
};

@ -104,10 +104,35 @@ export interface MaterialBomVO {
*/
updateTime: string;
/**
*
*/
children: MaterialBomVO[];
/**
*
*/
children: MaterialBomVO[];
/**
* ID
*/
materialTypeId: number;
/**
*
*/
materialTypeCode: string;
/**
*
*/
materialTypeName: string;
/**
*
*/
unitName: string;
/**
* (tree
*/
id: string | number;
}
export interface MaterialBomForm extends BaseEntity {
@ -131,6 +156,11 @@ export interface MaterialBomForm extends BaseEntity {
*/
materialName?: string;
/**
* ID
*/
materialTypeId?: string | number;
/**
* bom
*/
@ -192,6 +222,12 @@ export interface MaterialBomForm extends BaseEntity {
remark?: string;
materialBomList?: any[];//批量新增
/**
*
*/
materialTypeName?: string;
}
export interface MaterialBomQuery {
@ -271,10 +307,26 @@ export interface MaterialBomQuery {
*/
activeFlag?: string;
/**
*
*/
params?: any;
/**
*
*/
params?: any;
/**
*
*/
materialTypeCode?: string;
/**
*
*/
materialTypeName?: string;
/**
* parentId
*/
bomStructureParentId?: string | number;
}

@ -370,6 +370,13 @@ const data = reactive<PageData<BaseMaterialInfoForm, BaseMaterialInfoQuery>>({
const { queryParams, form, rules } = toRefs(data);
const props = defineProps({
materialTypeId: Object
});
const { materialTypeId } = toRefs(props);
/** 下拉框查询工厂信息列表 */
let factoryList = ref([])
const getFactorySelect = async () => {
@ -381,6 +388,7 @@ const getFactorySelect = async () => {
const getList = async () => {
loading.value = true;
queryParams.value.params = {};
queryParams.value.materialTypeId = materialTypeId.value;
proxy?.addDateRange(queryParams.value, dateRangeApproveDate.value, 'ApproveDate');
const res = await listBaseMaterialInfo(queryParams.value);
baseMaterialInfoList.value = res.rows;

@ -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) {

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save