|
|
@ -88,7 +88,7 @@
|
|
|
|
v-if="refreshTable"
|
|
|
|
v-if="refreshTable"
|
|
|
|
v-loading="loading"
|
|
|
|
v-loading="loading"
|
|
|
|
:data="materialBomList"
|
|
|
|
:data="materialBomList"
|
|
|
|
row-key="materialId"
|
|
|
|
row-key="materialBomId"
|
|
|
|
:default-expand-all="isExpandAll"
|
|
|
|
:default-expand-all="isExpandAll"
|
|
|
|
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
|
|
|
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
|
|
|
>
|
|
|
|
>
|
|
|
@ -96,6 +96,7 @@
|
|
|
|
<el-table-column label="祖级列表" align="center" prop="ancestors" v-if="columns[2].visible"/>
|
|
|
|
<el-table-column label="祖级列表" align="center" prop="ancestors" v-if="columns[2].visible"/>
|
|
|
|
<el-table-column label="物料ID" align="center" prop="materialId" v-if="columns[3].visible"/>
|
|
|
|
<el-table-column label="物料ID" align="center" prop="materialId" v-if="columns[3].visible"/>
|
|
|
|
<el-table-column label="物料名称" align="left" prop="materialName" v-if="columns[4].visible"/>
|
|
|
|
<el-table-column label="物料名称" align="left" prop="materialName" v-if="columns[4].visible"/>
|
|
|
|
|
|
|
|
<el-table-column label="BOM说明" align="center" prop="materialBomDesc" v-if="columns[15].visible"/>
|
|
|
|
<el-table-column label="标准数量" align="center" prop="standardAmount" v-if="columns[5].visible"/>
|
|
|
|
<el-table-column label="标准数量" align="center" prop="standardAmount" v-if="columns[5].visible"/>
|
|
|
|
<el-table-column label="顶级标识" align="center" prop="topFlag" v-if="columns[6].visible">
|
|
|
|
<el-table-column label="顶级标识" align="center" prop="topFlag" v-if="columns[6].visible">
|
|
|
|
<template slot-scope="scope">
|
|
|
|
<template slot-scope="scope">
|
|
|
@ -143,18 +144,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 添加或修改物料BOM信息对话框 -->
|
|
|
|
<!-- 添加或修改物料BOM信息对话框 -->
|
|
|
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
|
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
|
|
|
<el-form-item label="父级BOM" prop="parentId" >
|
|
|
|
<el-form-item label="父级BOM" prop="parentId" >
|
|
|
|
<treeselect v-model="form.parentId" :options="materialBomOptions" :normalizer="normalizer" disabled/>
|
|
|
|
<treeselect v-model="form.parentId" :options="materialBomOptions" :normalizer="normalizer" disabled/>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
<!-- <el-form-item label="物料ID" prop="materialId">-->
|
|
|
|
<!-- <el-form-item label="物料ID" prop="materialId">-->
|
|
|
|
<!-- <el-input v-model="form.materialId" placeholder="请输入物料ID" />-->
|
|
|
|
<!-- <el-input v-model="form.materialId" placeholder="请输入物料ID" />-->
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
<el-form-item label="物料名称" prop="materialName">
|
|
|
|
<el-form-item label="子级BOM" prop="materialName">
|
|
|
|
<el-input v-model="form.materialName" placeholder="请输入子BOM" readonly>
|
|
|
|
<el-input v-model="form.materialName" placeholder="请点击右侧检索子BOM" readonly>
|
|
|
|
<el-button slot="append" icon="el-icon-search" @click="handleMaterialAdd"></el-button>
|
|
|
|
<el-button slot="append" icon="el-icon-search" @click="handleMaterialAdd"></el-button>
|
|
|
|
</el-input>
|
|
|
|
</el-input>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
<el-form-item label="BOM说明" prop="materialBomDesc" >
|
|
|
|
|
|
|
|
<el-input v-model="form.materialBomDesc" placeholder="请输入BOM说明(BOM版本)" />
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="标准数量" prop="standardAmount">
|
|
|
|
<el-form-item label="标准数量" prop="standardAmount">
|
|
|
|
<el-input-number v-model="form.standardAmount" :min="1" placeholder="请输入标准数量" />
|
|
|
|
<el-input-number v-model="form.standardAmount" :min="1" placeholder="请输入标准数量" />
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
@ -250,6 +254,7 @@ export default {
|
|
|
|
materialId: null,
|
|
|
|
materialId: null,
|
|
|
|
materialName: null,
|
|
|
|
materialName: null,
|
|
|
|
standardAmount: null,
|
|
|
|
standardAmount: null,
|
|
|
|
|
|
|
|
materialBomDesc: null,
|
|
|
|
topFlag: null,
|
|
|
|
topFlag: null,
|
|
|
|
checkType: null,
|
|
|
|
checkType: null,
|
|
|
|
projectId: null,
|
|
|
|
projectId: null,
|
|
|
@ -262,6 +267,9 @@ export default {
|
|
|
|
materialId: [
|
|
|
|
materialId: [
|
|
|
|
{ required: true, message: "物料ID不能为空", trigger: "blur" }
|
|
|
|
{ required: true, message: "物料ID不能为空", trigger: "blur" }
|
|
|
|
],
|
|
|
|
],
|
|
|
|
|
|
|
|
materialBomDesc: [
|
|
|
|
|
|
|
|
{required: true, message: "BOM说明不能为空", trigger: "blur"}
|
|
|
|
|
|
|
|
],
|
|
|
|
standardAmount: [
|
|
|
|
standardAmount: [
|
|
|
|
{ required: true, message: "标准数量不能为空", trigger: "blur" }
|
|
|
|
{ required: true, message: "标准数量不能为空", trigger: "blur" }
|
|
|
|
],
|
|
|
|
],
|
|
|
@ -278,13 +286,14 @@ export default {
|
|
|
|
{ key: 5, label: `标准数量`, visible: true },
|
|
|
|
{ key: 5, label: `标准数量`, visible: true },
|
|
|
|
{ key: 6, label: `顶级标识`, visible: true },
|
|
|
|
{ key: 6, label: `顶级标识`, visible: true },
|
|
|
|
{ key: 7, label: `校验类型`, visible: true },
|
|
|
|
{ key: 7, label: `校验类型`, visible: true },
|
|
|
|
{ key: 8, label: `项目ID`, visible: true },
|
|
|
|
{ key: 8, label: `项目ID`, visible: false },
|
|
|
|
{ key: 9, label: `激活标识`, visible: false },
|
|
|
|
{ key: 9, label: `激活标识`, visible: false },
|
|
|
|
{ key: 10, label: `备注`, visible: false },
|
|
|
|
{ key: 10, label: `备注`, visible: false },
|
|
|
|
{ key: 11, label: `创建人`, visible: true },
|
|
|
|
{ key: 11, label: `创建人`, visible: true },
|
|
|
|
{ key: 12, label: `创建时间`, visible: true },
|
|
|
|
{ key: 12, label: `创建时间`, visible: true },
|
|
|
|
{ key: 13, label: `更新人`, visible: true },
|
|
|
|
{ key: 13, label: `更新人`, visible: true },
|
|
|
|
{ key: 14, label: `更新时间`, visible: true },
|
|
|
|
{ key: 14, label: `更新时间`, visible: true },
|
|
|
|
|
|
|
|
{ key: 15, label: `BOM说明`, visible: true },
|
|
|
|
],
|
|
|
|
],
|
|
|
|
};
|
|
|
|
};
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -296,7 +305,7 @@ export default {
|
|
|
|
getList() {
|
|
|
|
getList() {
|
|
|
|
this.loading = true;
|
|
|
|
this.loading = true;
|
|
|
|
listMaterialBom(this.queryParams).then(response => {
|
|
|
|
listMaterialBom(this.queryParams).then(response => {
|
|
|
|
this.materialBomList = this.handleTree(response.data, "materialId", "parentId");
|
|
|
|
this.materialBomList = this.handleTree(response.data, "materialBomId", "parentId");
|
|
|
|
this.loading = false;
|
|
|
|
this.loading = false;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -306,7 +315,7 @@ export default {
|
|
|
|
delete node.children;
|
|
|
|
delete node.children;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
id: node.materialId,
|
|
|
|
id: node.materialBomId,
|
|
|
|
label: node.materialName,
|
|
|
|
label: node.materialName,
|
|
|
|
children: node.children
|
|
|
|
children: node.children
|
|
|
|
};
|
|
|
|
};
|
|
|
@ -315,8 +324,8 @@ export default {
|
|
|
|
getTreeselect() {
|
|
|
|
getTreeselect() {
|
|
|
|
listMaterialBom().then(response => {
|
|
|
|
listMaterialBom().then(response => {
|
|
|
|
this.materialBomOptions = [];
|
|
|
|
this.materialBomOptions = [];
|
|
|
|
const data = { materialId: 0, materialName: '顶级节点', children: [] };
|
|
|
|
const data = { materialBomId: 0, materialName: '顶级节点', children: [] };
|
|
|
|
data.children = this.handleTree(response.data, "materialId", "parentId");
|
|
|
|
data.children = this.handleTree(response.data, "materialBomId", "parentId");
|
|
|
|
this.materialBomOptions.push(data);
|
|
|
|
this.materialBomOptions.push(data);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -334,6 +343,7 @@ export default {
|
|
|
|
materialId: null,
|
|
|
|
materialId: null,
|
|
|
|
materialName: null,
|
|
|
|
materialName: null,
|
|
|
|
standardAmount: null,
|
|
|
|
standardAmount: null,
|
|
|
|
|
|
|
|
materialBomDesc: null,
|
|
|
|
topFlag: 1,
|
|
|
|
topFlag: 1,
|
|
|
|
checkType: '0',
|
|
|
|
checkType: '0',
|
|
|
|
projectId: null,
|
|
|
|
projectId: null,
|
|
|
@ -359,11 +369,13 @@ export default {
|
|
|
|
handleAdd(row) {
|
|
|
|
handleAdd(row) {
|
|
|
|
this.reset();
|
|
|
|
this.reset();
|
|
|
|
this.getTreeselect();
|
|
|
|
this.getTreeselect();
|
|
|
|
if (row != null && row.materialId) {
|
|
|
|
if (row != null && row.materialBomId) {
|
|
|
|
this.form.parentId = row.materialId;
|
|
|
|
this.form.parentId = row.materialBomId;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
this.form.parentId = 0;
|
|
|
|
this.form.parentId = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//BOM说明,顶级不能为空,在选择bom时可以用此字段区分
|
|
|
|
|
|
|
|
this.rules.materialBomDesc[0].required = this.form.parentId === 0;
|
|
|
|
this.open = true;
|
|
|
|
this.open = true;
|
|
|
|
this.title = "添加物料BOM信息";
|
|
|
|
this.title = "添加物料BOM信息";
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -384,10 +396,12 @@ export default {
|
|
|
|
this.reset();
|
|
|
|
this.reset();
|
|
|
|
this.getTreeselect();
|
|
|
|
this.getTreeselect();
|
|
|
|
if (row != null) {
|
|
|
|
if (row != null) {
|
|
|
|
this.form.parentId = row.materialId;
|
|
|
|
this.form.parentId = row.materialBomId;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
getMaterialBom(row.materialBomId).then(response => {
|
|
|
|
getMaterialBom(row.materialBomId).then(response => {
|
|
|
|
this.form = response.data;
|
|
|
|
this.form = response.data;
|
|
|
|
|
|
|
|
//BOM说明,顶级不能为空,在选择bom时可以用此字段区分
|
|
|
|
|
|
|
|
this.rules.materialBomDesc[0].required = this.form.parentId === 0;
|
|
|
|
this.open = true;
|
|
|
|
this.open = true;
|
|
|
|
this.title = "修改物料BOM信息";
|
|
|
|
this.title = "修改物料BOM信息";
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -413,7 +427,7 @@ export default {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
handleSelection(selection) {
|
|
|
|
handleSelection(selection) {
|
|
|
|
this.ids = selection.map(item => item.objId)
|
|
|
|
this.ids = selection.map(item => item.materialBomId)
|
|
|
|
this.single = selection.length!==1
|
|
|
|
this.single = selection.length!==1
|
|
|
|
this.multiple = !selection.length
|
|
|
|
this.multiple = !selection.length
|
|
|
|
},
|
|
|
|
},
|
|
|
|