change - 生产BOM页面、工位页面

master
yinq 9 months ago
parent 51817a09c6
commit aba082b5ad

@ -32,11 +32,17 @@ public class MesBaseStationInfo extends BaseEntity {
private String stationName; private String stationName;
/** /**
* *
*/ */
@Excel(name = "所属工序") @Excel(name = "所属工序编号")
private Long processId; private Long processId;
/**
*
*/
@Excel(name = "所属工序名称")
private String processName;
/** /**
* *
*/ */
@ -55,6 +61,14 @@ public class MesBaseStationInfo extends BaseEntity {
@Excel(name = "激活标识") @Excel(name = "激活标识")
private String activeFlag; private String activeFlag;
public String getProcessName() {
return processName;
}
public void setProcessName(String processName) {
this.processName = processName;
}
public void setStationId(Long stationId) { public void setStationId(Long stationId) {
this.stationId = stationId; this.stationId = stationId;
} }

@ -2,6 +2,7 @@ package com.hw.mes.service.impl;
import java.util.List; import java.util.List;
import com.hw.common.core.utils.DateUtils; import com.hw.common.core.utils.DateUtils;
import com.hw.common.core.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.hw.mes.mapper.MesMaterialBomMapper; import com.hw.mes.mapper.MesMaterialBomMapper;
@ -53,6 +54,7 @@ public class MesMaterialBomServiceImpl implements IMesMaterialBomService
@Override @Override
public int insertMesMaterialBom(MesMaterialBom mesMaterialBom) public int insertMesMaterialBom(MesMaterialBom mesMaterialBom)
{ {
isTopFlag(mesMaterialBom);
mesMaterialBom.setCreateTime(DateUtils.getNowDate()); mesMaterialBom.setCreateTime(DateUtils.getNowDate());
return mesMaterialBomMapper.insertMesMaterialBom(mesMaterialBom); return mesMaterialBomMapper.insertMesMaterialBom(mesMaterialBom);
} }
@ -66,6 +68,7 @@ public class MesMaterialBomServiceImpl implements IMesMaterialBomService
@Override @Override
public int updateMesMaterialBom(MesMaterialBom mesMaterialBom) public int updateMesMaterialBom(MesMaterialBom mesMaterialBom)
{ {
isTopFlag(mesMaterialBom);
mesMaterialBom.setUpdateTime(DateUtils.getNowDate()); mesMaterialBom.setUpdateTime(DateUtils.getNowDate());
return mesMaterialBomMapper.updateMesMaterialBom(mesMaterialBom); return mesMaterialBomMapper.updateMesMaterialBom(mesMaterialBom);
} }
@ -109,4 +112,17 @@ public class MesMaterialBomServiceImpl implements IMesMaterialBomService
return mesMaterialBomMapper.selectMesMaterialBomJoinList(mesMaterialBom); return mesMaterialBomMapper.selectMesMaterialBomJoinList(mesMaterialBom);
} }
/**
* BOM
* @param mesMaterialBom
*/
private void isTopFlag(MesMaterialBom mesMaterialBom){
// 顶级标识1=是0=否
if (StringUtils.isNull(mesMaterialBom.getParentId()) || mesMaterialBom.getParentId() == 0L){
mesMaterialBom.setTopFlag(1L);
}else {
mesMaterialBom.setTopFlag(0L);
}
}
} }

@ -9,6 +9,7 @@
<result property="stationCode" column="station_code"/> <result property="stationCode" column="station_code"/>
<result property="stationName" column="station_name"/> <result property="stationName" column="station_name"/>
<result property="processId" column="process_id"/> <result property="processId" column="process_id"/>
<result property="processName" column="process_name"/>
<result property="floor" column="floor"/> <result property="floor" column="floor"/>
<result property="productionTime" column="production_time"/> <result property="productionTime" column="production_time"/>
<result property="activeFlag" column="active_flag"/> <result property="activeFlag" column="active_flag"/>
@ -20,19 +21,21 @@
</resultMap> </resultMap>
<sql id="selectMesBaseStationInfoVo"> <sql id="selectMesBaseStationInfoVo">
select station_id, select mbsi.station_id,
station_code, mbsi.station_code,
station_name, mbsi.station_name,
process_id, mbsi.process_id,
floor, mbpi.process_name,
production_time, mbsi.floor,
active_flag, mbsi.production_time,
remark, mbsi.active_flag,
create_by, mbsi.remark,
create_time, mbsi.create_by,
update_by, mbsi.create_time,
update_time mbsi.update_by,
from mes_base_station_info mbsi.update_time
from mes_base_station_info mbsi
left join mes_base_process_info mbpi on mbpi.process_id = mbsi.process_id
</sql> </sql>
<select id="selectMesBaseStationInfoList" parameterType="MesBaseStationInfo" resultMap="MesBaseStationInfoResult"> <select id="selectMesBaseStationInfoList" parameterType="MesBaseStationInfo" resultMap="MesBaseStationInfoResult">

@ -97,7 +97,8 @@
<el-table-column label="主键标识" align="center" prop="stationId" v-if="columns[0].visible"/> <el-table-column label="主键标识" align="center" prop="stationId" v-if="columns[0].visible"/>
<el-table-column label="工位编号" align="center" prop="stationCode" v-if="columns[1].visible"/> <el-table-column label="工位编号" align="center" prop="stationCode" v-if="columns[1].visible"/>
<el-table-column label="工位名称" align="center" prop="stationName" v-if="columns[2].visible"/> <el-table-column label="工位名称" align="center" prop="stationName" v-if="columns[2].visible"/>
<el-table-column label="所属工序" align="center" prop="processId" v-if="columns[3].visible"/> <!-- <el-table-column label="所属工序" align="center" prop="processId" v-if="columns[3].visible"/>-->
<el-table-column label="所属工序" align="center" prop="processName" v-if="columns[3].visible"/>
<el-table-column label="楼层" align="center" prop="floor" v-if="columns[4].visible"/> <el-table-column label="楼层" align="center" prop="floor" v-if="columns[4].visible"/>
<el-table-column label="单位生产时间" align="center" prop="productionTime" v-if="columns[5].visible"/> <el-table-column label="单位生产时间" align="center" prop="productionTime" v-if="columns[5].visible"/>
<el-table-column label="激活标识" align="center" prop="activeFlag" v-if="columns[6].visible"> <el-table-column label="激活标识" align="center" prop="activeFlag" v-if="columns[6].visible">

@ -0,0 +1,293 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="物料编码" prop="materialCode">
<el-input
v-model="queryParams.materialCode"
placeholder="请输入物料编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="物料名称" prop="materialName">
<el-input
v-model="queryParams.materialName"
placeholder="请输入物料名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="物料大类" prop="materialCategories">
<el-input
v-model="queryParams.materialCategories"
placeholder="请输入物料大类"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="物料类型" prop="materialTypeId">
<el-input
v-model="queryParams.materialTypeId"
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>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="materialinfoList" @selection-change="handleSelectionChange"
@row-click="handleRowClick"
highlight-current-row
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="物料编码" align="center" prop="materialCode" />
<el-table-column label="物料名称" align="center" prop="materialName" />
<el-table-column label="物料大类" align="center" prop="materialCategories" />
<el-table-column label="物料类型" align="center" prop="materialTypeId" />
<el-table-column label="批次标识" align="center" prop="batchFlag" />
<el-table-column label="计量单位" align="center" prop="materialUnit" />
<el-table-column label="物料规格" align="center" prop="materialSpec" />
<el-table-column label="净重" align="center" prop="netWeight" />
<el-table-column label="毛重" align="center" prop="grossWeight" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['mes:materialinfo:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['mes:materialinfo:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
import { listMaterialinfo, getMaterialinfo, delMaterialinfo, addMaterialinfo, updateMaterialinfo } from "@/api/mes/materialinfo";
export default {
name: "Materialinfo",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
materialinfoList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
erpId: null,
materialCode: null,
oldMaterialCode: null,
materialName: null,
materialCategories: null,
materialSubclass: null,
materialTypeId: null,
batchFlag: null,
materialUnitId: null,
materialUnit: null,
materialMatkl: null,
materialSpec: null,
netWeight: null,
grossWeight: null,
factoryId: null,
createOrgId: null,
useOrgId: null,
prodlineId: null,
activeFlag: null,
deletedFlag: null,
approveDate: null,
erpModifyDate: null
},
//
form: {},
//
rules: {
erpId: [
{ required: true, message: "ERP的主键;对应FMATERIALID不能为空", trigger: "blur" }
],
materialCode: [
{ required: true, message: "物料编码;对应ERP的FNumber不能为空", trigger: "blur" }
],
materialName: [
{ required: true, message: "物料名称;对应ERP的FName不能为空", trigger: "blur" }
],
materialCategories: [
{ required: true, message: "物料大类(1,原材料 2,半成品 3,成品)不能为空", trigger: "blur" }
],
materialTypeId: [
{ required: true, message: "物料类型关联mes_base_material_type的material_type_id不能为空", trigger: "blur" }
],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询物料信息列表 */
getList() {
this.loading = true;
listMaterialinfo(this.queryParams).then(response => {
this.materialinfoList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
materialId: null,
erpId: null,
materialCode: null,
oldMaterialCode: null,
materialName: null,
materialCategories: null,
materialSubclass: null,
materialTypeId: null,
batchFlag: null,
materialUnitId: null,
materialUnit: null,
materialMatkl: null,
materialSpec: null,
netWeight: null,
grossWeight: null,
factoryId: null,
createOrgId: null,
useOrgId: null,
prodlineId: null,
activeFlag: null,
deletedFlag: null,
remark: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
approveDate: null,
erpModifyDate: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.materialId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加物料信息";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const materialId = row.materialId || this.ids
getMaterialinfo(materialId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改物料信息";
});
},
//
handleRowClick(row) {
this.selectedRow = row
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.materialId != null) {
updateMaterialinfo(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addMaterialinfo(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const materialIds = row.materialId || this.ids;
this.$modal.confirm('是否确认删除物料信息编号为"' + materialIds + '"的数据项?').then(function() {
return delMaterialinfo(materialIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('mes/materialinfo/export', {
...this.queryParams
}, `materialinfo_${new Date().getTime()}.xlsx`)
}
}
};
</script>

@ -95,7 +95,7 @@
<el-table-column label="父级标识" prop="parentId" v-if="columns[1].visible"/> <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="祖级列表" 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="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="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">
@ -129,7 +129,7 @@
icon="el-icon-plus" icon="el-icon-plus"
@click="handleAdd(scope.row)" @click="handleAdd(scope.row)"
v-hasPermi="['mes:materialBom:add']" v-hasPermi="['mes:materialBom:add']"
>新增</el-button> >新增子BOM</el-button>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
@ -144,27 +144,29 @@
<!-- 添加或修改物料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="80px">
<el-form-item label="父级标识" prop="parentId"> <el-form-item label="父级BOM" prop="parentId" >
<treeselect v-model="form.parentId" :options="materialBomOptions" :normalizer="normalizer" placeholder="请选择父级标识" /> <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>
<!-- <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-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>
<el-form-item label="标准数量" prop="standardAmount"> <el-form-item label="标准数量" prop="standardAmount">
<el-input v-model="form.standardAmount" placeholder="请输入标准数量" /> <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>
<!-- <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-form-item label="校验类型" prop="checkType">
<el-radio-group v-model="form.checkType"> <el-radio-group v-model="form.checkType">
<el-radio <el-radio
@ -195,6 +197,16 @@
<el-button @click="cancel"> </el-button> <el-button @click="cancel"> </el-button>
</div> </div>
</el-dialog> </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> </div>
</template> </template>
@ -202,12 +214,14 @@
import { listMaterialBom, getMaterialBom, delMaterialBom, addMaterialBom, updateMaterialBom } from "@/api/mes/materialBom"; import { listMaterialBom, getMaterialBom, delMaterialBom, addMaterialBom, updateMaterialBom } from "@/api/mes/materialBom";
import Treeselect from "@riophae/vue-treeselect"; import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css"; import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import addBom from '@//views/mes/materialBom/addBom.vue';
export default { export default {
name: "MaterialBom", name: "MaterialBom",
dicts: ['active_flag', 'check_type'], dicts: ['active_flag', 'check_type'],
components: { components: {
Treeselect Treeselect,
'add-bom': addBom
}, },
data() { data() {
return { return {
@ -223,6 +237,8 @@ export default {
title: "", title: "",
// //
open: false, open: false,
//
materialOpen: false,
// //
isExpandAll: true, isExpandAll: true,
// //
@ -254,17 +270,17 @@ export default {
], ],
}, },
columns: [ columns: [
{ key: 0, label: `主键标识`, visible: true }, { key: 0, label: `主键标识`, visible: false },
{ key: 1, label: `父级标识`, visible: true }, { key: 1, label: `父级标识`, visible: false },
{ key: 2, label: `祖级列表`, visible: true }, { key: 2, label: `祖级列表`, visible: false },
{ key: 3, label: `物料ID`, visible: true }, { key: 3, label: `物料ID`, visible: false },
{ key: 4, label: `物料名称`, visible: true }, { key: 4, label: `物料名称`, visible: true },
{ 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: true },
{ key: 9, label: `激活标识`, visible: true }, { key: 9, label: `激活标识`, visible: false },
{ key: 10, label: `备注`, visible: true }, { 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 },
@ -318,10 +334,10 @@ export default {
materialId: null, materialId: null,
materialName: null, materialName: null,
standardAmount: null, standardAmount: null,
topFlag: null, topFlag: 1,
checkType: null, checkType: '0',
projectId: null, projectId: null,
activeFlag: null, activeFlag: '1',
remark: null, remark: null,
createBy: null, createBy: null,
createTime: null, createTime: null,
@ -351,6 +367,10 @@ export default {
this.open = true; this.open = true;
this.title = "添加物料BOM信息"; this.title = "添加物料BOM信息";
}, },
/** 新增按钮操作 */
handleMaterialAdd() {
this.materialOpen = true;
},
/** 展开/折叠操作 */ /** 展开/折叠操作 */
toggleExpandAll() { toggleExpandAll() {
this.refreshTable = false; 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) { handleDelete(row) {
this.$modal.confirm('是否确认删除物料BOM信息编号为"' + row.materialBomId + '"的数据项?').then(function() { this.$modal.confirm('是否确认删除物料BOM信息编号为"' + row.materialBomId + '"的数据项?').then(function() {

Loading…
Cancel
Save