update - 生产BOM

master
yinq 11 months ago
parent 6165dec495
commit 1a39d0bf9f

@ -1,6 +1,6 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="物料编码" prop="materialCode">
<el-input
v-model="queryParams.materialCode"
@ -17,6 +17,14 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="父级物料编码" prop="parentId">
<el-input
v-model="queryParams.parentId"
placeholder="请输入物料名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
@ -34,11 +42,12 @@
<el-table-column label="物料名称" align="center" prop="materialName" v-if="columns[3].visible"/>
<el-table-column label="物料类别" align="center" prop="materialType" v-if="columns[4].visible">
<template slot-scope="scope">
<dict-tag :options="dict.type.material_type" :value="scope.row.materialType"/>
<dict-tag :options="dict.type.material_subclass" :value="scope.row.materialType"/>
</template>
</el-table-column>
<el-table-column label="标准数量" align="center" prop="standardAmount" v-if="columns[5].visible"/>
<el-table-column label="父级编号" align="center" prop="parentId" v-if="columns[6].visible"/>
<el-table-column label="父级物料编号" align="center" prop="parentId" v-if="columns[6].visible"/>
<el-table-column label="父级物料名称" align="center" prop="parentName" v-if="columns[16].visible"/>
<el-table-column label="启用标识" align="center" prop="isFlag" v-if="columns[7].visible">
<template slot-scope="scope">
<dict-tag :options="dict.type.is_flag" :value="scope.row.isFlag"/>
@ -99,11 +108,16 @@ import {
addOrderBomInfo,
updateOrderBomInfo
} from '@/api/base/orderBomInfo'
import { listMaterialInfo } from '@//api/base/materialInfo'
export default {
name: 'OrderBomInfo',
dicts: ['material_type', 'is_flag'],
dicts: ['material_subclass', 'is_flag'],
props: {
message: String
},
// mounted() {
// this.getList();
// },
data() {
return {
//
@ -152,7 +166,7 @@ export default {
rules: {},
columns: [
{ key: 0, label: `主键标识`, visible: false },
{ key: 1, label: `BOM编号`, visible: true },
{ key: 1, label: `BOM编号`, visible: false },
{ key: 2, label: `物料编码`, visible: true },
{ key: 3, label: `物料名称`, visible: true },
{ key: 4, label: `物料类别`, visible: true },
@ -166,7 +180,8 @@ export default {
{ key: 12, label: `工厂编号`, visible: false },
{ key: 13, label: `排序`, visible: false },
{ key: 14, label: `销售凭证`, visible: false },
{ key: 15, label: `销售单据项目`, visible: false }
{ key: 15, label: `销售单据项目`, visible: false },
{ key: 16, label: `父级物料名称`, visible: true }
]
}
},
@ -177,7 +192,11 @@ export default {
/** 查询订单BOM列表 */
getList() {
this.loading = true
listMaterialInfo(this.queryParams).then(response => {
if (this.message != null){
this.queryParams.parentId = this.message;
console.log(333,this.queryParams.parentId)
}
listOrderBomInfo(this.queryParams).then(response => {
this.orderBomInfoList = response.rows
this.total = response.total
this.loading = false

@ -133,7 +133,7 @@
<el-input v-model="form.standardAmount" placeholder="请输入标准数量" />
</el-form-item>
<el-form-item label="物料类型" prop="materialType" >
<el-select v-model="form.materialType" placeholder="请选择物料类型">
<el-select v-model="form.materialType" placeholder="请选择物料类型" :disabled="true">
<el-option
v-for="dict in dict.type.material_subclass"
:key="dict.value"
@ -143,7 +143,7 @@
</el-select>
</el-form-item>
<el-form-item label="所属工厂">
<el-select v-model="form.plantCode" placeholder="请选择所属工厂" >
<el-select v-model="form.plantCode" placeholder="请选择所属工厂" :disabled="true">
<el-option
v-for="item in factoryList"
:key="item.factoryCode"
@ -180,7 +180,7 @@
<!-- 添加物料信息对话框 -->
<el-dialog title="添加成品BOM明细" :visible.sync="materialOpen" append-to-body>
<add-bom @selection="handleSelection" ref="materialRef"></add-bom>
<add-bom :message="parentMessage" @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>
@ -249,6 +249,8 @@ export default {
},
//
form: {},
//
parentMessage: null,
//
rules: {
},
@ -256,6 +258,7 @@ export default {
factoryList: [],
// 线
productLineList: [],
openSum: 1,
};
},
created() {
@ -315,11 +318,12 @@ export default {
/** 提交物料信息按钮 */
submitMaterialForm() {
let selectedRow = this.$refs.materialRef.selectedRow;
this.form.bomCode = selectedRow.bomCode;
this.form.bomCode = selectedRow.materialCode;
this.form.materialCode = selectedRow.materialCode;
this.form.materialName = selectedRow.materialName;
this.form.plantCode = selectedRow.factoryCode;
this.form.materialType = selectedRow.materialType;
this.form.standardAmount = selectedRow.standardAmount;
this.materialOpen = false;
},
//
@ -354,7 +358,14 @@ export default {
},
/** 新增按钮操作 */
handleMaterialAdd() {
if (this.openSum !== 1){
this.parentMessage = this.form.parentId;
this.$refs.materialRef.getList();
}else {
this.openSum++;
}
this.materialOpen = true;
// this.$refs.materialRef.getList();
// this.title = "BOM";
},
/** 新增按钮操作 */
@ -366,6 +377,8 @@ export default {
} else {
this.form.parentId = 0;
}
//
this.parentMessage = this.form.parentId;
this.open = true;
this.title = "添加生产BOM";
},

@ -226,7 +226,6 @@ import {
} from '@/api/production/baseBomInfo'
import {findFactoryList} from "@//api/base/factory";
import addBom from '@//views/base/orderBomInfo/addBom.vue';
import { addSAPCalendar } from '@//api/production/calendarInfo'
export default {
name: "BaseBomInfo",

Loading…
Cancel
Save