|
|
|
@ -95,7 +95,7 @@
|
|
|
|
|
<el-table-column label="父级标识" prop="parentId" v-if="columns[1].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="物料名称" align="center" prop="materialName" v-if="columns[4].visible"/>
|
|
|
|
|
<el-table-column label="物料名称" align="left" prop="materialName" v-if="columns[4].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">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
@ -129,7 +129,7 @@
|
|
|
|
|
icon="el-icon-plus"
|
|
|
|
|
@click="handleAdd(scope.row)"
|
|
|
|
|
v-hasPermi="['mes:materialBom:add']"
|
|
|
|
|
>新增</el-button>
|
|
|
|
|
>新增子BOM</el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
size="mini"
|
|
|
|
|
type="text"
|
|
|
|
@ -144,27 +144,29 @@
|
|
|
|
|
<!-- 添加或修改物料BOM信息对话框 -->
|
|
|
|
|
<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-item label="父级标识" prop="parentId">
|
|
|
|
|
<treeselect v-model="form.parentId" :options="materialBomOptions" :normalizer="normalizer" placeholder="请选择父级标识" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="物料ID" prop="materialId">
|
|
|
|
|
<el-input v-model="form.materialId" placeholder="请输入物料ID" />
|
|
|
|
|
<el-form-item label="父级BOM" prop="parentId" >
|
|
|
|
|
<treeselect v-model="form.parentId" :options="materialBomOptions" :normalizer="normalizer" disabled/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<!-- <el-form-item label="物料ID" prop="materialId">-->
|
|
|
|
|
<!-- <el-input v-model="form.materialId" placeholder="请输入物料ID" />-->
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
<el-form-item label="物料名称" prop="materialName">
|
|
|
|
|
<el-input v-model="form.materialName" placeholder="请输入物料名称" />
|
|
|
|
|
<el-input v-model="form.materialName" placeholder="请输入子BOM" readonly>
|
|
|
|
|
<el-button slot="append" icon="el-icon-search" @click="handleMaterialAdd"></el-button>
|
|
|
|
|
</el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="标准数量" prop="standardAmount">
|
|
|
|
|
<el-input v-model="form.standardAmount" placeholder="请输入标准数量" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="顶级标识" prop="topFlag">
|
|
|
|
|
<el-radio-group v-model="form.topFlag">
|
|
|
|
|
<el-radio
|
|
|
|
|
v-for="dict in dict.type.active_flag"
|
|
|
|
|
:key="dict.value"
|
|
|
|
|
:label="parseInt(dict.value)"
|
|
|
|
|
>{{dict.label}}</el-radio>
|
|
|
|
|
</el-radio-group>
|
|
|
|
|
<el-input-number v-model="form.standardAmount" :min="1" placeholder="请输入标准数量" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<!-- <el-form-item label="顶级标识" prop="topFlag">-->
|
|
|
|
|
<!-- <el-radio-group v-model="form.topFlag">-->
|
|
|
|
|
<!-- <el-radio-->
|
|
|
|
|
<!-- v-for="dict in dict.type.active_flag"-->
|
|
|
|
|
<!-- :key="dict.value"-->
|
|
|
|
|
<!-- :label="parseInt(dict.value)"-->
|
|
|
|
|
<!-- >{{dict.label}}</el-radio>-->
|
|
|
|
|
<!-- </el-radio-group>-->
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
<el-form-item label="校验类型" prop="checkType">
|
|
|
|
|
<el-radio-group v-model="form.checkType">
|
|
|
|
|
<el-radio
|
|
|
|
@ -195,6 +197,16 @@
|
|
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
<!-- 添加物料信息对话框 -->
|
|
|
|
|
<el-dialog title="选择物料信息" :visible.sync="materialOpen" append-to-body>
|
|
|
|
|
<add-bom @selection="handleSelection" ref="materialRef"></add-bom>
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button type="primary" @click="submitMaterialForm">确 定</el-button>
|
|
|
|
|
<el-button @click="materialOpen = false">取 消</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
@ -202,12 +214,14 @@
|
|
|
|
|
import { listMaterialBom, getMaterialBom, delMaterialBom, addMaterialBom, updateMaterialBom } from "@/api/mes/materialBom";
|
|
|
|
|
import Treeselect from "@riophae/vue-treeselect";
|
|
|
|
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
|
|
|
import addBom from '@//views/mes/materialBom/addBom.vue';
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: "MaterialBom",
|
|
|
|
|
dicts: ['active_flag', 'check_type'],
|
|
|
|
|
components: {
|
|
|
|
|
Treeselect
|
|
|
|
|
Treeselect,
|
|
|
|
|
'add-bom': addBom
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
@ -223,6 +237,8 @@ export default {
|
|
|
|
|
title: "",
|
|
|
|
|
// 是否显示弹出层
|
|
|
|
|
open: false,
|
|
|
|
|
// 是否显示物料弹出层
|
|
|
|
|
materialOpen: false,
|
|
|
|
|
// 是否展开,默认全部展开
|
|
|
|
|
isExpandAll: true,
|
|
|
|
|
// 重新渲染表格状态
|
|
|
|
@ -254,17 +270,17 @@ export default {
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
columns: [
|
|
|
|
|
{ key: 0, label: `主键标识`, visible: true },
|
|
|
|
|
{ key: 1, label: `父级标识`, visible: true },
|
|
|
|
|
{ key: 2, label: `祖级列表`, visible: true },
|
|
|
|
|
{ key: 3, label: `物料ID`, visible: true },
|
|
|
|
|
{ key: 0, label: `主键标识`, visible: false },
|
|
|
|
|
{ key: 1, label: `父级标识`, visible: false },
|
|
|
|
|
{ key: 2, label: `祖级列表`, visible: false },
|
|
|
|
|
{ key: 3, label: `物料ID`, visible: false },
|
|
|
|
|
{ key: 4, label: `物料名称`, visible: true },
|
|
|
|
|
{ key: 5, label: `标准数量`, visible: true },
|
|
|
|
|
{ key: 6, label: `顶级标识`, visible: true },
|
|
|
|
|
{ key: 7, label: `校验类型`, visible: true },
|
|
|
|
|
{ key: 8, label: `项目ID`, visible: true },
|
|
|
|
|
{ key: 9, label: `激活标识`, visible: true },
|
|
|
|
|
{ key: 10, label: `备注`, visible: true },
|
|
|
|
|
{ key: 9, label: `激活标识`, visible: false },
|
|
|
|
|
{ key: 10, label: `备注`, visible: false },
|
|
|
|
|
{ key: 11, label: `创建人`, visible: true },
|
|
|
|
|
{ key: 12, label: `创建时间`, visible: true },
|
|
|
|
|
{ key: 13, label: `更新人`, visible: true },
|
|
|
|
@ -318,10 +334,10 @@ export default {
|
|
|
|
|
materialId: null,
|
|
|
|
|
materialName: null,
|
|
|
|
|
standardAmount: null,
|
|
|
|
|
topFlag: null,
|
|
|
|
|
checkType: null,
|
|
|
|
|
topFlag: 1,
|
|
|
|
|
checkType: '0',
|
|
|
|
|
projectId: null,
|
|
|
|
|
activeFlag: null,
|
|
|
|
|
activeFlag: '1',
|
|
|
|
|
remark: null,
|
|
|
|
|
createBy: null,
|
|
|
|
|
createTime: null,
|
|
|
|
@ -351,6 +367,10 @@ export default {
|
|
|
|
|
this.open = true;
|
|
|
|
|
this.title = "添加物料BOM信息";
|
|
|
|
|
},
|
|
|
|
|
/** 新增按钮操作 */
|
|
|
|
|
handleMaterialAdd() {
|
|
|
|
|
this.materialOpen = true;
|
|
|
|
|
},
|
|
|
|
|
/** 展开/折叠操作 */
|
|
|
|
|
toggleExpandAll() {
|
|
|
|
|
this.refreshTable = false;
|
|
|
|
@ -392,6 +412,18 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
handleSelection(selection) {
|
|
|
|
|
this.ids = selection.map(item => item.objId)
|
|
|
|
|
this.single = selection.length!==1
|
|
|
|
|
this.multiple = !selection.length
|
|
|
|
|
},
|
|
|
|
|
/** 提交物料信息按钮 */
|
|
|
|
|
submitMaterialForm() {
|
|
|
|
|
let selectedRow = this.$refs.materialRef.selectedRow;
|
|
|
|
|
this.form.materialId = selectedRow.materialId;
|
|
|
|
|
this.form.materialName = selectedRow.materialName;
|
|
|
|
|
this.materialOpen = false;
|
|
|
|
|
},
|
|
|
|
|
/** 删除按钮操作 */
|
|
|
|
|
handleDelete(row) {
|
|
|
|
|
this.$modal.confirm('是否确认删除物料BOM信息编号为"' + row.materialBomId + '"的数据项?').then(function() {
|
|
|
|
|