【需求】完善bom清单明细

pull/4/head
zengchenxi 8 months ago
parent 5652a71423
commit ede8c52cc4

@ -12,6 +12,7 @@ public enum ProcessBomStatusEnum {
SAVE(1, "已保存"),
SUBMIT(2, "已提交"),
CANCEL_SUBMIT(1, "取消提交"),
TERMINATE(3, "已终止");
private int code;

@ -12,7 +12,7 @@ import com.chanko.yunxi.mes.module.heli.controller.admin.processbom.vo.ProcessBo
import com.chanko.yunxi.mes.module.heli.controller.admin.processbom.vo.ProcessBomRespVO;
import com.chanko.yunxi.mes.module.heli.controller.admin.processbom.vo.ProcessBomSaveReqVO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbomdetail.ProcessBomDetailDO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDetailDO;
import com.chanko.yunxi.mes.module.heli.enums.BusinesTypeEnum;
import com.chanko.yunxi.mes.module.heli.service.processbom.ProcessBomService;
import io.swagger.v3.oas.annotations.Operation;

@ -5,7 +5,7 @@ import lombok.*;
import java.util.*;
import javax.validation.constraints.*;
import java.util.*;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbomdetail.ProcessBomDetailDO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDetailDO;
@Schema(description = "管理后台 - 工艺bom新增/修改 Request VO")
@Data
@ -30,12 +30,10 @@ public class ProcessBomSaveReqVO {
@NotNull(message = "子项目id不能为空")
private Long projectSubId;
@Schema(description = "子项目名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
@NotEmpty(message = "子项目名称不能为空")
@Schema(description = "子项目名称", example = "张三")
private String projectSubName;
@Schema(description = "子项目编号", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "子项目编号不能为空")
@Schema(description = "子项目编号")
private String projectSubCode;
@Schema(description = "bom版本号", requiredMode = Schema.RequiredMode.REQUIRED)

@ -1,11 +1,10 @@
package com.chanko.yunxi.mes.module.heli.dal.dataobject.processbomdetail;
package com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.chanko.yunxi.mes.framework.mybatis.core.dataobject.BaseDO;
import lombok.*;
/**
* bom DO
@ -78,4 +77,4 @@ public class ProcessBomDetailDO extends BaseDO {
*/
private Integer status;
}
}

@ -1,4 +1,4 @@
package com.chanko.yunxi.mes.module.heli.dal.mysql.processbomdetail;
package com.chanko.yunxi.mes.module.heli.dal.mysql.processbom;
import java.util.*;
@ -6,7 +6,7 @@ import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
import com.chanko.yunxi.mes.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbomdetail.ProcessBomDetailDO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDetailDO;
import org.apache.ibatis.annotations.Mapper;
/**
@ -25,4 +25,4 @@ public interface ProcessBomDetailMapper extends BaseMapperX<ProcessBomDetailDO>
return delete(ProcessBomDetailDO::getBomId, bomId);
}
}
}

@ -1,12 +1,13 @@
package com.chanko.yunxi.mes.module.heli.service.processbom;
import java.util.*;
import javax.validation.*;
import com.chanko.yunxi.mes.module.heli.controller.admin.processbom.vo.*;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbomdetail.ProcessBomDetailDO;
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
import com.chanko.yunxi.mes.module.heli.controller.admin.processbom.vo.ProcessBomPageReqVO;
import com.chanko.yunxi.mes.module.heli.controller.admin.processbom.vo.ProcessBomSaveReqVO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDetailDO;
import javax.validation.Valid;
import java.util.List;
/**
* bom Service

@ -1,21 +1,21 @@
package com.chanko.yunxi.mes.module.heli.service.processbom;
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils;
import com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum;
import com.chanko.yunxi.mes.module.heli.controller.admin.processbom.vo.ProcessBomPageReqVO;
import com.chanko.yunxi.mes.module.heli.controller.admin.processbom.vo.ProcessBomSaveReqVO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDetailDO;
import com.chanko.yunxi.mes.module.heli.dal.mysql.processbom.ProcessBomMapper;
import com.chanko.yunxi.mes.module.heli.dal.mysql.processbom.ProcessBomDetailMapper;
import com.chanko.yunxi.mes.module.heli.enums.ProcessBomStatusEnum;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
import java.util.*;
import com.chanko.yunxi.mes.module.heli.controller.admin.processbom.vo.*;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbomdetail.ProcessBomDetailDO;
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils;
import com.chanko.yunxi.mes.module.heli.dal.mysql.processbom.ProcessBomMapper;
import com.chanko.yunxi.mes.module.heli.dal.mysql.processbomdetail.ProcessBomDetailMapper;
import javax.annotation.Resource;
import java.util.List;
import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception;
import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*;
@ -64,6 +64,7 @@ public class ProcessBomServiceImpl implements ProcessBomService {
if(!updateObj.canOperate(OperateTypeEnum.valueOf(updateReqVO.getActive()))){
throw exception(INVALID_OPERATE);
}
updateObj.setBomStatus(ProcessBomStatusEnum.valueOf(updateReqVO.getActive()).getCode());
processBomMapper.updateById(updateObj);
// 更新子表

@ -77,7 +77,7 @@
<div class="hl-card-info-icona"></div><span class="hl-card-info-text">BOM明细</span>
</template>
<el-row>
<el-col v-if="active != 'detail'">
<el-col v-if="!detailDisabled">
<el-button class="hl-addbutton" type="primary" size="large" @click="onAddItem"></el-button>
</el-col>
<el-col>
@ -88,7 +88,7 @@
<el-table-column label="是否标准件" prop="type" width="200">
<template #default="{ row, $index }">
<el-form-item :prop="`${$index}.type`" :rules="subFormRules.type" class="mb-0px!">
<el-radio-group v-model="row.type" @change="(val) => {onChangeType(row, val);}">
<el-radio-group :disabled="detailDisabled" v-model="row.type" @change="(val) => {onChangeType(row, val);}">
<el-radio
v-for="dict in getStrDictOptions(DICT_TYPE.HELI_BOM_MATERIAL_TYPE)"
:key="dict.value"
@ -104,8 +104,8 @@
<template #header><span class="hl-table_header">*</span>零件名称</template>
<template #default="{ row, $index }">
<el-form-item :prop="`${$index}.materialName`" :rules="subFormRules.materialName" class="mb-0px!">
<MaterialSelect v-if="row.type == '1'" v-model="row.materialId" @update:newValue="(val) => {handleSelectedMaterial(row, val);}"/>
<el-input v-else v-model="row.materialName" />
<MaterialSelect :disabled="detailDisabled" v-if="row.type == '1'" v-model="row.materialId" @update:newValue="(val) => {handleSelectedMaterial(row, val);}"/>
<el-input :disabled="detailDisabled" v-else v-model="row.materialName" />
</el-form-item>
</template>
</el-table-column>
@ -114,21 +114,21 @@
<template #header><span class="hl-table_header">*</span>材质</template>
<template #default="{ row, $index }">
<el-form-item :prop="`${$index}.compositionId`" :rules="subFormRules.compositionId" class="mb-0px!">
<CompositionSelect v-model="row.compositionId" @update:newValue="(val) => {row.compositionId = val.id;}"/>
<CompositionSelect :disabled="detailDisabled" v-model="row.compositionId" @update:newValue="(val) => {row.compositionId = val.id;}"/>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="规格型号" prop="spec" width="140">
<template #default="scope">
<span v-if="scope.row.type == '1'" v-html="scope.row.spec"></span>
<el-input v-else v-model="scope.row.spec" />
<el-input :disabled="detailDisabled" v-else v-model="scope.row.spec" />
</template>
</el-table-column>
<el-table-column label="图号" prop="blueprintNo" width="150">
<template #header><span class="hl-table_header">*</span>图号</template>
<template #default="{ row, $index }">
<el-form-item :prop="`${$index}.blueprintNo`" :rules="subFormRules.blueprintNo" class="mb-0px!">
<el-input v-model="row.blueprintNo" />
<el-input :disabled="detailDisabled" v-model="row.blueprintNo" />
</el-form-item>
</template>
</el-table-column>
@ -136,7 +136,7 @@
<template #header> <span class="hl-table_header">*</span>数量</template>
<template #default="{ row, $index }">
<el-form-item :prop="`${$index}.amount`" :rules="subFormRules.amount" class="mb-0px!">
<el-input-number min="0" step="1" step-strictly :disabled="detailDisabled || row.id" v-model="row.amount" />
<el-input-number min="0" step="1" step-strictly :disabled="detailDisabled" v-model="row.amount" />
</el-form-item>
</template>
</el-table-column>
@ -144,7 +144,8 @@
<template #header> <span class="hl-table_header">*</span>系统单位</template>
<template #default="{ row, $index }">
<el-form-item :prop="`${$index}.unit`" :rules="subFormRules.unit" class="mb-0px!">
<el-select v-model="row.unit" clearable class="!w-250px">
<span v-if="row.type == '1'">{{getDictLabel(DICT_TYPE.HELI_MATERIAL_UNIT, row.unit)}}</span>
<el-select :disabled="detailDisabled" v-else v-model="row.unit" clearable class="!w-250px">
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.HELI_MATERIAL_UNIT)"
:key="dict.value"
@ -157,7 +158,7 @@
</el-table-column>
<el-table-column label="操作" align="center" width="160">
<template #default="scope">
<el-button link type="danger" size="small" @click.prevent="onDeleteItem(scope.$index)">
<el-button v-if="!detailDisabled" link type="danger" size="small" @click.prevent="onDeleteItem(scope.$index)">
删除
</el-button>
</template>
@ -184,7 +185,6 @@
</el-table-column>
<el-table-column prop="userNickname" label="操作人" align="center" />
<el-table-column label="操作时间" align="center" prop="startTime" :formatter="dateFormatter" />
<el-table-column prop="content" label="操作意见" align="center" />
</el-table>
</el-card>
</el-col>
@ -289,6 +289,10 @@ const queryData = async (id?: number) => {
formData.value = await ProcessBomApi.getProcessBom(id)
formData.value.processBomDetails = await ProcessBomApi.getProcessBomDetailListByBomId(id)
if(formData.value.bomStatus == 2) {
detailDisabled.value = true
}
//
let logParams = {
pageNo: 1,

Loading…
Cancel
Save