在配置工序中某个产品在谋道工序的BOM比例时,直接从主数据中定义的BOM数据中选取。
This commit is contained in:
parent
6f744f7537
commit
295fec5e0f
136
src/components/itemBomSelect/single.vue
Normal file
136
src/components/itemBomSelect/single.vue
Normal file
@ -0,0 +1,136 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog title="产品BOM物料选择"
|
||||||
|
v-if="showFlag"
|
||||||
|
:visible.sync="showFlag"
|
||||||
|
:modal= false
|
||||||
|
width="80%"
|
||||||
|
center
|
||||||
|
>
|
||||||
|
<el-table v-loading="loading" :data="bomList" @current-change="handleCurrent" @row-dblclick="handleRowDbClick">
|
||||||
|
<el-table-column width="50" align="center" >
|
||||||
|
<template v-slot="scope">
|
||||||
|
<el-radio v-model="selectedItemId" :label="scope.row.bomItemId" @change="handleRowChange(scope.row)">{{""}}</el-radio>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="物料编码" align="center" prop="bomItemCode" />
|
||||||
|
<el-table-column label="物料名称" align="center" prop="bomItemName" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column label="规格" align="center" prop="bomItemSpec" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column label="单位" width="60px" align="center" prop="unitOfMeasure" />
|
||||||
|
<el-table-column label="使用比例" width="90px" align="center" prop="quantity" />
|
||||||
|
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination
|
||||||
|
v-show="total>0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="queryParams.pageNum"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="confirmSelect">确 定</el-button>
|
||||||
|
<el-button @click="showFlag=false">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { listBom } from "@/api/mes/md/bom";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "ItemBomSelectSingle",
|
||||||
|
props: {
|
||||||
|
itemId: undefined
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
showFlag: false,
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
selectedItemId: undefined,
|
||||||
|
selectedRows: undefined,
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
// 显示搜索条件
|
||||||
|
showSearch: true,
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// 产品BOM关系表格数据
|
||||||
|
bomList: [],
|
||||||
|
// 弹出层标题
|
||||||
|
title: "",
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
itemId: this.itemId,
|
||||||
|
bomItemId: null,
|
||||||
|
bomItemCode: null,
|
||||||
|
bomItemName: null,
|
||||||
|
bomItemSpec: null,
|
||||||
|
unitOfMeasure: null,
|
||||||
|
quantity: null,
|
||||||
|
enableFlag: null,
|
||||||
|
attr1: null,
|
||||||
|
attr2: null,
|
||||||
|
attr3: null,
|
||||||
|
attr4: null,
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/** 查询产品BOM关系列表 */
|
||||||
|
getList() {
|
||||||
|
debugger;
|
||||||
|
this.loading = true;
|
||||||
|
listBom(this.queryParams).then(response => {
|
||||||
|
this.bomList = response.rows;
|
||||||
|
this.total = response.total;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleCurrent(row){
|
||||||
|
if(row){
|
||||||
|
this.selectedRows = row;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleRowDbClick(row){
|
||||||
|
if(row){
|
||||||
|
this.selectedRows = row;
|
||||||
|
this.$emit('onSelected',this.selectedRows);
|
||||||
|
this.showFlag = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 单选选中数据
|
||||||
|
handleRowChange(row) {
|
||||||
|
if(row){
|
||||||
|
this.selectedRows = row;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
//确定选中
|
||||||
|
confirmSelect(){
|
||||||
|
if(this.selectedItemId ==null || this.selectedItemId==0){
|
||||||
|
this.$notify({
|
||||||
|
title:'提示',
|
||||||
|
type:'warning',
|
||||||
|
message: '请至少选择一条数据!'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.$emit('onSelected',this.selectedRows);
|
||||||
|
this.showFlag = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
@ -72,7 +72,13 @@
|
|||||||
<el-table v-loading="loading" :data="routeproductList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="routeproductList" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="产品物料编码" width="120px" align="center" prop="itemCode" >
|
<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>
|
||||||
<el-table-column label="产品物料名称" width="150px" align="center" prop="itemName" :show-overflow-tooltip="true"/>
|
<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"/>
|
<el-table-column label="规格型号" align="center" prop="specification" :show-overflow-tooltip="true"/>
|
||||||
@ -170,7 +176,7 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
<el-tabs type="border-card" v-if="form.recordId != null">
|
<el-tabs type="border-card" v-if="form.recordId != null">
|
||||||
<el-tab-pane v-for="(process,index) in processList" :key="index" :label="process.processName">
|
<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-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
@ -326,6 +332,16 @@ export default {
|
|||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "添加产品制程";
|
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) {
|
handleUpdate(row) {
|
||||||
this.reset();
|
this.reset();
|
||||||
|
@ -62,12 +62,15 @@
|
|||||||
|
|
||||||
<!-- 添加或修改产品制程物料BOM对话框 -->
|
<!-- 添加或修改产品制程物料BOM对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="960px" append-to-body>
|
<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-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="产品物料编码" prop="itemCode">
|
<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>
|
</el-form-item>
|
||||||
|
<ItemBomSelectSingle ref="itemBom" :itemId="productId" @onSelected="onItemBomSelected"></ItemBomSelectSingle>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="产品物料名称" prop="itemName">
|
<el-form-item label="产品物料名称" prop="itemName">
|
||||||
@ -105,9 +108,10 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listRouteproductbom, getRouteproductbom, delRouteproductbom, addRouteproductbom, updateRouteproductbom } from "@/api/mes/pro/routeproductbom";
|
import { listRouteproductbom, getRouteproductbom, delRouteproductbom, addRouteproductbom, updateRouteproductbom } from "@/api/mes/pro/routeproductbom";
|
||||||
|
import ItemBomSelectSingle from "@/components/itemBomSelect/single.vue"
|
||||||
export default {
|
export default {
|
||||||
name: "Routeproductbom",
|
name: "Routeproductbom",
|
||||||
|
components:{ItemBomSelectSingle},
|
||||||
props:{
|
props:{
|
||||||
routeId: null,
|
routeId: null,
|
||||||
productId: null,
|
productId: null,
|
||||||
@ -153,26 +157,17 @@ export default {
|
|||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
routeId: [
|
routeId: [
|
||||||
{ required: true, message: "工艺路线ID不能为空", trigger: "blur" }
|
{ required: true, message: "工艺路线不能为空", trigger: "blur" }
|
||||||
],
|
],
|
||||||
processId: [
|
processId: [
|
||||||
{ required: true, message: "工序ID不能为空", trigger: "blur" }
|
{ required: true, message: "工序不能为空", trigger: "blur" }
|
||||||
],
|
],
|
||||||
productId: [
|
productId: [
|
||||||
{ required: true, message: "产品物料ID不能为空", trigger: "blur" }
|
{ required: true, message: "产品物料不能为空", trigger: "blur" }
|
||||||
],
|
],
|
||||||
itemId: [
|
itemId: [
|
||||||
{ required: true, message: "产品物料ID不能为空", trigger: "blur" }
|
{ required: true, message: "产品BOM物料不能为空", trigger: "blur" }
|
||||||
],
|
]
|
||||||
itemCode: [
|
|
||||||
{ required: true, message: "产品物料编码不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
itemName: [
|
|
||||||
{ required: true, message: "产品物料名称不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
unitOfMeasure: [
|
|
||||||
{ required: true, message: "单位不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@ -182,6 +177,7 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
/** 查询产品制程物料BOM列表 */
|
/** 查询产品制程物料BOM列表 */
|
||||||
getList() {
|
getList() {
|
||||||
|
debugger;
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
listRouteproductbom(this.queryParams).then(response => {
|
listRouteproductbom(this.queryParams).then(response => {
|
||||||
this.routeproductbomList = response.rows;
|
this.routeproductbomList = response.rows;
|
||||||
@ -286,6 +282,18 @@ export default {
|
|||||||
this.download('pro/routeproductbom/export', {
|
this.download('pro/routeproductbom/export', {
|
||||||
...this.queryParams
|
...this.queryParams
|
||||||
}, `routeproductbom_${new Date().getTime()}.xlsx`)
|
}, `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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user