MES:web物料信息修改,可以编辑物料大类、物料类型、常备物料、批次标识和批次数量
master
xs 5 months ago
parent f001200d1d
commit b31cc4f07c

@ -1,7 +1,11 @@
package com.hw.mes.service.impl;
import java.math.BigDecimal;
import java.util.List;
import com.hw.common.core.constant.MesConstants;
import com.hw.common.core.utils.DateUtils;
import com.hw.common.security.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hw.mes.mapper.MesBaseMaterialInfoMapper;
@ -15,8 +19,7 @@ import com.hw.mes.service.IMesBaseMaterialInfoService;
* @date 2023-12-21
*/
@Service
public class MesBaseMaterialInfoServiceImpl implements IMesBaseMaterialInfoService
{
public class MesBaseMaterialInfoServiceImpl implements IMesBaseMaterialInfoService {
@Autowired
private MesBaseMaterialInfoMapper mesBaseMaterialInfoMapper;
@ -27,8 +30,7 @@ public class MesBaseMaterialInfoServiceImpl implements IMesBaseMaterialInfoServi
* @return
*/
@Override
public MesBaseMaterialInfo selectMesBaseMaterialInfoByMaterialId(Long materialId)
{
public MesBaseMaterialInfo selectMesBaseMaterialInfoByMaterialId(Long materialId) {
return mesBaseMaterialInfoMapper.selectMesBaseMaterialInfoByMaterialId(materialId);
}
@ -39,8 +41,7 @@ public class MesBaseMaterialInfoServiceImpl implements IMesBaseMaterialInfoServi
* @return
*/
@Override
public List<MesBaseMaterialInfo> selectMesBaseMaterialInfoList(MesBaseMaterialInfo mesBaseMaterialInfo)
{
public List<MesBaseMaterialInfo> selectMesBaseMaterialInfoList(MesBaseMaterialInfo mesBaseMaterialInfo) {
return mesBaseMaterialInfoMapper.selectMesBaseMaterialInfoList(mesBaseMaterialInfo);
}
@ -51,8 +52,7 @@ public class MesBaseMaterialInfoServiceImpl implements IMesBaseMaterialInfoServi
* @return
*/
@Override
public int insertMesBaseMaterialInfo(MesBaseMaterialInfo mesBaseMaterialInfo)
{
public int insertMesBaseMaterialInfo(MesBaseMaterialInfo mesBaseMaterialInfo) {
mesBaseMaterialInfo.setCreateTime(DateUtils.getNowDate());
return mesBaseMaterialInfoMapper.insertMesBaseMaterialInfo(mesBaseMaterialInfo);
}
@ -64,9 +64,12 @@ public class MesBaseMaterialInfoServiceImpl implements IMesBaseMaterialInfoServi
* @return
*/
@Override
public int updateMesBaseMaterialInfo(MesBaseMaterialInfo mesBaseMaterialInfo)
{
public int updateMesBaseMaterialInfo(MesBaseMaterialInfo mesBaseMaterialInfo) {
mesBaseMaterialInfo.setUpdateTime(DateUtils.getNowDate());
mesBaseMaterialInfo.setUpdateBy(SecurityUtils.getUsername());
if (!mesBaseMaterialInfo.getBatchFlag().equals(MesConstants.IS_BATCH)) {
mesBaseMaterialInfo.setBatchAmount(BigDecimal.ONE);
}
return mesBaseMaterialInfoMapper.updateMesBaseMaterialInfo(mesBaseMaterialInfo);
}
@ -77,8 +80,7 @@ public class MesBaseMaterialInfoServiceImpl implements IMesBaseMaterialInfoServi
* @return
*/
@Override
public int deleteMesBaseMaterialInfoByMaterialIds(Long[] materialIds)
{
public int deleteMesBaseMaterialInfoByMaterialIds(Long[] materialIds) {
return mesBaseMaterialInfoMapper.deleteMesBaseMaterialInfoByMaterialIds(materialIds);
}
@ -89,14 +91,11 @@ public class MesBaseMaterialInfoServiceImpl implements IMesBaseMaterialInfoServi
* @return
*/
@Override
public int deleteMesBaseMaterialInfoByMaterialId(Long materialId)
{
public int deleteMesBaseMaterialInfoByMaterialId(Long materialId) {
return mesBaseMaterialInfoMapper.deleteMesBaseMaterialInfoByMaterialId(materialId);
}
/**
*
*
@ -104,8 +103,7 @@ public class MesBaseMaterialInfoServiceImpl implements IMesBaseMaterialInfoServi
* @return
*/
@Override
public List<MesBaseMaterialInfo> selectMesBaseMaterialInfoListByMaterialIds(Long[] materialIds)
{
public List<MesBaseMaterialInfo> selectMesBaseMaterialInfoListByMaterialIds(Long[] materialIds) {
return mesBaseMaterialInfoMapper.selectMesBaseMaterialInfoListByMaterialIds(materialIds);
}
@ -117,16 +115,11 @@ public class MesBaseMaterialInfoServiceImpl implements IMesBaseMaterialInfoServi
* @return
*/
@Override
public List<MesBaseMaterialInfo> selectMaterialInfos4AllocationWarehouse(MesBaseMaterialInfo mesBaseMaterialInfo)
{
public List<MesBaseMaterialInfo> selectMaterialInfos4AllocationWarehouse(MesBaseMaterialInfo mesBaseMaterialInfo) {
return mesBaseMaterialInfoMapper.selectMaterialInfos4AllocationWarehouse(mesBaseMaterialInfo);
}
/**
*
*
@ -134,8 +127,7 @@ public class MesBaseMaterialInfoServiceImpl implements IMesBaseMaterialInfoServi
* @return
*/
@Override
public MesBaseMaterialInfo selectMesBaseMaterialInfoByErpId(Long erpId)
{
public MesBaseMaterialInfo selectMesBaseMaterialInfoByErpId(Long erpId) {
return mesBaseMaterialInfoMapper.selectMesBaseMaterialInfoByErpId(erpId);
}
}

@ -111,15 +111,18 @@
</el-table-column>
<!-- <el-table-column label="物料类型" align="center" prop="materialTypeId"/>-->
<el-table-column label="物料类型" align="center" prop="materialTypeName"/>
<el-table-column label="常备物料" align="center" prop="bindFlag">
<template slot-scope="scope">
<dict-tag :options="dict.type.mes_material_bind_flag" :value="scope.row.bindFlag"/>
</template>
</el-table-column>
<el-table-column label="批次标识" align="center" prop="batchFlag">
<template slot-scope="scope">
<dict-tag :options="dict.type.active_flag" :value="scope.row.batchFlag"/>
</template>
</el-table-column>
<el-table-column label="计量单位" align="center" prop="materialUnit"/>
<el-table-column label="批次数量" align="center" prop="batchAmount"/>
<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
@ -180,6 +183,17 @@
<treeselect v-model="form.materialTypeId" :options="baseMaterialTypeOptions" :normalizer="normalizer"
placeholder="请选择物料类型"/>
</el-form-item>
<el-form-item label="常备物料" prop="bindFlag">
<el-radio-group v-model="form.bindFlag">
<el-radio
v-for="dict in dict.type.active_flag"
:key="dict.value"
:label="dict.value"
>{{ dict.label }}
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="批次标识" prop="batchFlag">
<el-radio-group v-model="form.batchFlag">
<el-radio
@ -190,6 +204,11 @@
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="批次数量" prop="batchAmount" v-if="form.batchFlag==='1'">
<el-input-number v-model="form.batchAmount" placeholder="请输入批次数量" :min="1" />
</el-form-item>
<!-- <el-form-item label="计量单位" prop="materialUnitId">-->
<!-- <el-input v-model="form.materialUnitId" placeholder="请输入计量单位" />-->
<!-- </el-form-item>-->
@ -268,7 +287,7 @@ import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
name: "Materialinfo",
dicts: ['active_flag', 'material_categories'],
dicts: ['active_flag', 'material_categories','mes_material_bind_flag'],
components: {
Treeselect
},
@ -325,19 +344,19 @@ export default {
form: {},
//
rules: {
materialCode: [
{required: true, message: "物料编码不能为空", trigger: "blur"}
bindFlag: [
{required: true, message: "常备物料不能为空", trigger: "change"}
],
materialName: [
{required: true, message: "物料名称不能为空", trigger: "blur"}
batchFlag: [
{required: true, message: "批次标识不能为空", trigger: "change"}
],
batchAmount: [
{required: true, message: "批次数量不能为空", trigger: "blur"}
],
// materialCategories: [
// {required: true, message: "", trigger: "blur"}
// ],
// materialTypeId: [
// {required: true, message: "", trigger: "blur"}
// ],
}
},
};
},
created() {

Loading…
Cancel
Save