在配置工序中某个产品在谋道工序的BOM比例时,直接从主数据中定义的BOM数据中选取。
This commit is contained in:
@@ -72,7 +72,13 @@
|
||||
<el-table v-loading="loading" :data="routeproductList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="产品物料编码" width="120px" align="center" prop="itemCode" >
|
||||
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
type="text"
|
||||
@click="handleView(scope.row)"
|
||||
v-hasPermi="['mes:pro:proroute:query']"
|
||||
>{{scope.row.itemCode}}</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="产品物料名称" width="150px" align="center" prop="itemName" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="规格型号" align="center" prop="specification" :show-overflow-tooltip="true"/>
|
||||
@@ -170,7 +176,7 @@
|
||||
</el-form>
|
||||
<el-tabs type="border-card" v-if="form.recordId != null">
|
||||
<el-tab-pane v-for="(process,index) in processList" :key="index" :label="process.processName">
|
||||
<Routeproductbom :routeId="form.routeId" :productId="form.productId" :processId="process.processId" :optType="optType"></Routeproductbom>
|
||||
<Routeproductbom :routeId="form.routeId" :productId="form.itemId" :processId="process.processId" :optType="optType"></Routeproductbom>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
@@ -326,6 +332,16 @@ export default {
|
||||
this.open = true;
|
||||
this.title = "添加产品制程";
|
||||
},
|
||||
// 查询明细按钮操作
|
||||
handleView(row){
|
||||
this.reset();
|
||||
const recordId = row.recordId || this.ids;
|
||||
getRouteproduct(recordId).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "查看工艺线路信息";
|
||||
});
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
|
||||
@@ -62,12 +62,15 @@
|
||||
|
||||
<!-- 添加或修改产品制程物料BOM对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="960px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="产品物料编码" prop="itemCode">
|
||||
<el-input v-model="form.itemCode" placeholder="请输入产品物料编码" />
|
||||
<el-input v-model="form.itemCode" placeholder="请选择此产品当前工序的BOM物料" >
|
||||
<el-button slot="append" @click="handleItemBomSelect" icon="el-icon-search"></el-button>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<ItemBomSelectSingle ref="itemBom" :itemId="productId" @onSelected="onItemBomSelected"></ItemBomSelectSingle>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="产品物料名称" prop="itemName">
|
||||
@@ -105,9 +108,10 @@
|
||||
|
||||
<script>
|
||||
import { listRouteproductbom, getRouteproductbom, delRouteproductbom, addRouteproductbom, updateRouteproductbom } from "@/api/mes/pro/routeproductbom";
|
||||
|
||||
import ItemBomSelectSingle from "@/components/itemBomSelect/single.vue"
|
||||
export default {
|
||||
name: "Routeproductbom",
|
||||
components:{ItemBomSelectSingle},
|
||||
props:{
|
||||
routeId: null,
|
||||
productId: null,
|
||||
@@ -153,26 +157,17 @@ export default {
|
||||
// 表单校验
|
||||
rules: {
|
||||
routeId: [
|
||||
{ required: true, message: "工艺路线ID不能为空", trigger: "blur" }
|
||||
{ required: true, message: "工艺路线不能为空", trigger: "blur" }
|
||||
],
|
||||
processId: [
|
||||
{ required: true, message: "工序ID不能为空", trigger: "blur" }
|
||||
{ required: true, message: "工序不能为空", trigger: "blur" }
|
||||
],
|
||||
productId: [
|
||||
{ required: true, message: "产品物料ID不能为空", trigger: "blur" }
|
||||
{ required: true, message: "产品物料不能为空", trigger: "blur" }
|
||||
],
|
||||
itemId: [
|
||||
{ required: true, message: "产品物料ID不能为空", trigger: "blur" }
|
||||
],
|
||||
itemCode: [
|
||||
{ required: true, message: "产品物料编码不能为空", trigger: "blur" }
|
||||
],
|
||||
itemName: [
|
||||
{ required: true, message: "产品物料名称不能为空", trigger: "blur" }
|
||||
],
|
||||
unitOfMeasure: [
|
||||
{ required: true, message: "单位不能为空", trigger: "blur" }
|
||||
],
|
||||
{ required: true, message: "产品BOM物料不能为空", trigger: "blur" }
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
@@ -182,6 +177,7 @@ export default {
|
||||
methods: {
|
||||
/** 查询产品制程物料BOM列表 */
|
||||
getList() {
|
||||
debugger;
|
||||
this.loading = true;
|
||||
listRouteproductbom(this.queryParams).then(response => {
|
||||
this.routeproductbomList = response.rows;
|
||||
@@ -286,6 +282,18 @@ export default {
|
||||
this.download('pro/routeproductbom/export', {
|
||||
...this.queryParams
|
||||
}, `routeproductbom_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
handleItemBomSelect(){
|
||||
this.$refs.itemBom.showFlag=true;
|
||||
this.$refs.itemBom.getList();
|
||||
},
|
||||
onItemBomSelected(row){
|
||||
this.form.itemId = row.bomItemId;
|
||||
this.form.itemCode = row.bomItemCode;
|
||||
this.form.itemName = row.bomItemName;
|
||||
this.form.specification = row.bomItemSpec;
|
||||
this.form.unitOfMeasure = row.unitOfMeasure;
|
||||
this.form.quantity = row.quantity;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user