【需求】完成工艺设计基础功能

pull/4/head
zengchenxi 8 months ago
parent fdf2707d53
commit 0c1b34f472

@ -0,0 +1,23 @@
package com.chanko.yunxi.mes.module.heli.enums;
import lombok.Getter;
/**
*
* @author chenxi
* @date 2024-02-21 01:09
*/
@Getter
public enum ProcessDesignTypeEnum {
BLUEPRINT_FOUNDRY_TECHNOLOGY("铸造工艺"),
BLUEPRINT_3D("3D图纸"),
BLUEPRINT_2D("2D图纸"),
BLUEPRINT_WORKBLANK("毛坯图纸");
private String description;
ProcessDesignTypeEnum(String description) {
this.description = description;
}
}

@ -18,13 +18,7 @@ public class ProcessDesignPageReqVO extends PageParam {
@Schema(description = "生产计划id", example = "87") @Schema(description = "生产计划id", example = "87")
private Long planId; private Long planId;
@Schema(description = "销售订单id", example = "27757") @Schema(description = "设计类型 铸造工艺|3D图纸|2D图纸|毛坯图纸 BLUEPRINT_FOUNDRY_TECHNOLOGY|BLUEPRINT_3D|BLUEPRINT_2D|BLUEPRINT_WORKBLANK", example = "1")
private Long saleOrderId;
@Schema(description = "销售订单子项id", example = "7018")
private Long saleOrderSubId;
@Schema(description = "设计类型 铸造工艺|3D图纸|2D图纸|毛坯图纸 FOUNDRY_TECHNOLOGY_BLUEPRINT|3D_BLUEPRINT|2D_BLUEPRINT|WORKBLANK_BLUEPRINT", example = "1")
private String processDesignType; private String processDesignType;
@Schema(description = "备注", example = "随便") @Schema(description = "备注", example = "随便")
@ -37,4 +31,10 @@ public class ProcessDesignPageReqVO extends PageParam {
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime; private LocalDateTime[] createTime;
} @Schema(description = "项目id", example = "527")
private Long projectId;
@Schema(description = "子项目id", example = "28809")
private Long projectSubId;
}

@ -7,6 +7,8 @@ import java.util.*;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import com.alibaba.excel.annotation.*; import com.alibaba.excel.annotation.*;
import com.chanko.yunxi.mes.framework.excel.core.annotations.DictFormat;
import com.chanko.yunxi.mes.framework.excel.core.convert.DictConvert;
@Schema(description = "管理后台 - 工艺设计 Response VO") @Schema(description = "管理后台 - 工艺设计 Response VO")
@Data @Data
@ -21,16 +23,9 @@ public class ProcessDesignRespVO {
@ExcelProperty("生产计划id") @ExcelProperty("生产计划id")
private Long planId; private Long planId;
@Schema(description = "销售订单id", requiredMode = Schema.RequiredMode.REQUIRED, example = "27757") @Schema(description = "设计类型 铸造工艺|3D图纸|2D图纸|毛坯图纸 BLUEPRINT_FOUNDRY_TECHNOLOGY|BLUEPRINT_3D|BLUEPRINT_2D|BLUEPRINT_WORKBLANK", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@ExcelProperty("销售订单id") @ExcelProperty(value = "设计类型 铸造工艺|3D图纸|2D图纸|毛坯图纸 BLUEPRINT_FOUNDRY_TECHNOLOGY|BLUEPRINT_3D|BLUEPRINT_2D|BLUEPRINT_WORKBLANK", converter = DictConvert.class)
private Long saleOrderId; @DictFormat("heli_process_design_type") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
@Schema(description = "销售订单子项id", example = "7018")
@ExcelProperty("销售订单子项id")
private Long saleOrderSubId;
@Schema(description = "设计类型 铸造工艺|3D图纸|2D图纸|毛坯图纸 FOUNDRY_TECHNOLOGY_BLUEPRINT|3D_BLUEPRINT|2D_BLUEPRINT|WORKBLANK_BLUEPRINT", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@ExcelProperty("设计类型 铸造工艺|3D图纸|2D图纸|毛坯图纸 FOUNDRY_TECHNOLOGY_BLUEPRINT|3D_BLUEPRINT|2D_BLUEPRINT|WORKBLANK_BLUEPRINT")
private String processDesignType; private String processDesignType;
@Schema(description = "备注", example = "随便") @Schema(description = "备注", example = "随便")
@ -45,4 +40,12 @@ public class ProcessDesignRespVO {
@ExcelProperty("创建时间") @ExcelProperty("创建时间")
private LocalDateTime createTime; private LocalDateTime createTime;
} @Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "527")
@ExcelProperty("项目id")
private Long projectId;
@Schema(description = "子项目id", example = "28809")
@ExcelProperty("子项目id")
private Long projectSubId;
}

@ -1,42 +1,42 @@
package com.chanko.yunxi.mes.module.heli.controller.admin.processdesign.vo; package com.chanko.yunxi.mes.module.heli.controller.admin.processdesign.vo;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*; import lombok.*;
import java.util.*; import java.util.*;
import javax.validation.constraints.*; import javax.validation.constraints.*;
import java.util.*; import java.util.*;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.processdesignprogress.ProcessDesignProgressDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.processdesignprogress.ProcessDesignProgressDO;
@Schema(description = "管理后台 - 工艺设计新增/修改 Request VO") @Schema(description = "管理后台 - 工艺设计新增/修改 Request VO")
@Data @Data
public class ProcessDesignSaveReqVO { public class ProcessDesignSaveReqVO {
@Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED, example = "13152") @Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED, example = "13152")
private Long id; private Long id;
@Schema(description = "生产计划id", requiredMode = Schema.RequiredMode.REQUIRED, example = "87") @Schema(description = "生产计划id", requiredMode = Schema.RequiredMode.REQUIRED, example = "87")
@NotNull(message = "生产计划id不能为空") @NotNull(message = "生产计划id不能为空")
private Long planId; private Long planId;
@Schema(description = "销售订单id", requiredMode = Schema.RequiredMode.REQUIRED, example = "27757") @Schema(description = "设计类型 铸造工艺|3D图纸|2D图纸|毛坯图纸 BLUEPRINT_FOUNDRY_TECHNOLOGY|BLUEPRINT_3D|BLUEPRINT_2D|BLUEPRINT_WORKBLANK", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "销售订单id不能为空") @NotEmpty(message = "设计类型 铸造工艺|3D图纸|2D图纸|毛坯图纸 BLUEPRINT_FOUNDRY_TECHNOLOGY|BLUEPRINT_3D|BLUEPRINT_2D|BLUEPRINT_WORKBLANK不能为空")
private Long saleOrderId; private String processDesignType;
@Schema(description = "销售订单子项id", example = "7018") @Schema(description = "备注", example = "随便")
private Long saleOrderSubId; private String remark;
@Schema(description = "设计类型 铸造工艺|3D图纸|2D图纸|毛坯图纸 FOUNDRY_TECHNOLOGY_BLUEPRINT|3D_BLUEPRINT|2D_BLUEPRINT|WORKBLANK_BLUEPRINT", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") @Schema(description = "状态,1表示正常2表示禁用", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
@NotEmpty(message = "设计类型 铸造工艺|3D图纸|2D图纸|毛坯图纸 FOUNDRY_TECHNOLOGY_BLUEPRINT|3D_BLUEPRINT|2D_BLUEPRINT|WORKBLANK_BLUEPRINT不能为空") @NotNull(message = "状态,1表示正常2表示禁用不能为空")
private String processDesignType; private Integer status;
@Schema(description = "备注", example = "随便") @Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "527")
private String remark; @NotNull(message = "项目id不能为空")
private Long projectId;
@Schema(description = "状态,1表示正常2表示禁用", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
@NotNull(message = "状态,1表示正常2表示禁用不能为空") @Schema(description = "子项目id", example = "28809")
private Integer status; private Long projectSubId;
@Schema(description = "工艺设计进度列表") @Schema(description = "工艺设计进度列表")
private List<ProcessDesignProgressDO> processDesignProgresss; private List<ProcessDesignProgressDO> processDesignProgressList;
} }

@ -32,15 +32,9 @@ public class ProcessDesignDO extends BaseDO {
*/ */
private Long planId; private Long planId;
/** /**
* id * |3D|2D| BLUEPRINT_FOUNDRY_TECHNOLOGY|BLUEPRINT_3D|BLUEPRINT_2D|BLUEPRINT_WORKBLANK
*/ *
private Long saleOrderId; * {@link TODO heli_process_design_type }
/**
* id
*/
private Long saleOrderSubId;
/**
* |3D|2D| FOUNDRY_TECHNOLOGY_BLUEPRINT|3D_BLUEPRINT|2D_BLUEPRINT|WORKBLANK_BLUEPRINT
*/ */
private String processDesignType; private String processDesignType;
/** /**
@ -51,5 +45,69 @@ public class ProcessDesignDO extends BaseDO {
* ,12 * ,12
*/ */
private Integer status; private Integer status;
/**
* id
*/
private Long projectId;
/**
* id
*/
private Long projectSubId;
@TableField(exist = false)
private String planCode;
@TableField(exist = false)
private String projectCode;
@TableField(exist = false)
private String customerName;
@TableField(exist = false)
private String projectName;
@TableField(exist = false)
private String projectOwnerName;
@TableField(exist = false)
private String businessLine;
@TableField(exist = false)
private Integer property;
@TableField(exist = false)
private Integer isUrgency;
@TableField(exist = false)
private Integer hasCraft;
@TableField(exist = false)
private String craftOwnerName;
@TableField(exist = false)
private LocalDateTime craftStartDate;
@TableField(exist = false)
private LocalDateTime craftEndDate;
@TableField(exist = false)
private LocalDateTime blankDate;
@TableField(exist = false)
private String blankOwnerName;
@TableField(exist = false)
private LocalDateTime twoDimDate;
@TableField(exist = false)
private String twoDimOwnerName;
@TableField(exist = false)
private LocalDateTime threeDimDate;
@TableField(exist = false)
private String threeDimOwnerName;
} }

@ -49,4 +49,6 @@ public class ProcessDesignProgressDO extends BaseDO {
*/ */
private Integer status; private Integer status;
} private Boolean deleted;
}

@ -1,13 +1,18 @@
package com.chanko.yunxi.mes.module.heli.dal.mysql.processdesign; package com.chanko.yunxi.mes.module.heli.dal.mysql.processdesign;
import java.util.*;
import com.chanko.yunxi.mes.framework.common.pojo.PageResult; import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
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.framework.mybatis.core.mapper.BaseMapperX;
import com.chanko.yunxi.mes.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.chanko.yunxi.mes.module.heli.controller.admin.processdesign.vo.ProcessDesignPageReqVO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.customer.CustomerDO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.plan.PlanDO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.plansub.PlanSubDO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.processdesign.ProcessDesignDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.processdesign.ProcessDesignDO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderDO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderSubDO;
import com.chanko.yunxi.mes.module.system.dal.dataobject.user.AdminUserDO;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import com.chanko.yunxi.mes.module.heli.controller.admin.processdesign.vo.*;
/** /**
* Mapper * Mapper
@ -20,13 +25,37 @@ public interface ProcessDesignMapper extends BaseMapperX<ProcessDesignDO> {
default PageResult<ProcessDesignDO> selectPage(ProcessDesignPageReqVO reqVO) { default PageResult<ProcessDesignDO> selectPage(ProcessDesignPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<ProcessDesignDO>() return selectPage(reqVO, new LambdaQueryWrapperX<ProcessDesignDO>()
.eqIfPresent(ProcessDesignDO::getPlanId, reqVO.getPlanId()) .eqIfPresent(ProcessDesignDO::getPlanId, reqVO.getPlanId())
.eqIfPresent(ProcessDesignDO::getSaleOrderId, reqVO.getSaleOrderId())
.eqIfPresent(ProcessDesignDO::getSaleOrderSubId, reqVO.getSaleOrderSubId())
.eqIfPresent(ProcessDesignDO::getProcessDesignType, reqVO.getProcessDesignType()) .eqIfPresent(ProcessDesignDO::getProcessDesignType, reqVO.getProcessDesignType())
.eqIfPresent(ProcessDesignDO::getRemark, reqVO.getRemark()) .eqIfPresent(ProcessDesignDO::getRemark, reqVO.getRemark())
.eqIfPresent(ProcessDesignDO::getStatus, reqVO.getStatus()) .eqIfPresent(ProcessDesignDO::getStatus, reqVO.getStatus())
.betweenIfPresent(ProcessDesignDO::getCreateTime, reqVO.getCreateTime()) .betweenIfPresent(ProcessDesignDO::getCreateTime, reqVO.getCreateTime())
.eqIfPresent(ProcessDesignDO::getProjectId, reqVO.getProjectId())
.eqIfPresent(ProcessDesignDO::getProjectSubId, reqVO.getProjectSubId())
.orderByDesc(ProcessDesignDO::getId)); .orderByDesc(ProcessDesignDO::getId));
} }
} default ProcessDesignDO selectById(Long id) {
MPJLambdaWrapper<ProcessDesignDO> query = new MPJLambdaWrapper<>();
query.selectAll(ProcessDesignDO.class)
.select("a.plan_no as planCode","a.has_craft as hasCraft", "a.craft_start_date as craftStartDate", "a.craft_end_date as craftEndDate", "e.name as customerName")
.select("d.code as projectCode", "d.project_name as projectName", "d.business_line as businessLine", "d.property","d.is_urgency as isUrgency")
.select("u1.nickname as projectOwnerName", "u2.nickname as craftOwnerName")
.select("b.blank_date as blankDate", "b.two_dim_date as twoDimDate", "b.three_dim_date as threeDimDate")
.select("u3.nickname as blankOwnerName", "u4.nickname as twoDimOwnerName", "u5.nickname as threeDimOwnerName")
.leftJoin(PlanDO.class, "a", PlanDO::getId, ProcessDesignDO::getPlanId)
.leftJoin("project_plan_sub b on b.project_plan_id = t.plan_id and b.id = t.project_sub_id")
.leftJoin(ProjectOrderSubDO.class, "c", ProjectOrderSubDO::getId, ProcessDesignDO::getProjectSubId)
.leftJoin(ProjectOrderDO.class, "d", ProjectOrderDO::getId, ProcessDesignDO::getProjectId)
.leftJoin(CustomerDO.class, "e", CustomerDO::getId, ProjectOrderDO::getCustomerId)
.leftJoin(AdminUserDO.class, "u1", AdminUserDO::getId, PlanDO::getProjectOwner)
.leftJoin(AdminUserDO.class, "u2", AdminUserDO::getId, PlanDO::getCraftOwner)
.leftJoin("system_users u3 on u3.id = b.blank_owner")
.leftJoin("system_users u4 on u4.id = b.two_dim_owner")
.leftJoin("system_users u5 on u5.id = b.three_dim_owner")
.eq(ProcessDesignDO::getId, id)
.last("LIMIT 1")
.disableSubLogicDel();
return selectOne(query);
}
}

@ -1,112 +1,112 @@
package com.chanko.yunxi.mes.module.heli.service.processdesign; package com.chanko.yunxi.mes.module.heli.service.processdesign;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.*; import java.util.*;
import com.chanko.yunxi.mes.module.heli.controller.admin.processdesign.vo.*; import com.chanko.yunxi.mes.module.heli.controller.admin.processdesign.vo.*;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.processdesign.ProcessDesignDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.processdesign.ProcessDesignDO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.processdesignprogress.ProcessDesignProgressDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.processdesignprogress.ProcessDesignProgressDO;
import com.chanko.yunxi.mes.framework.common.pojo.PageResult; 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.pojo.PageParam;
import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils; import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils;
import com.chanko.yunxi.mes.module.heli.dal.mysql.processdesign.ProcessDesignMapper; import com.chanko.yunxi.mes.module.heli.dal.mysql.processdesign.ProcessDesignMapper;
import com.chanko.yunxi.mes.module.heli.dal.mysql.processdesignprogress.ProcessDesignProgressMapper; import com.chanko.yunxi.mes.module.heli.dal.mysql.processdesignprogress.ProcessDesignProgressMapper;
import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception; import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception;
import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*; import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*;
/** /**
* Service * Service
* *
* @author * @author
*/ */
@Service @Service
@Validated @Validated
public class ProcessDesignServiceImpl implements ProcessDesignService { public class ProcessDesignServiceImpl implements ProcessDesignService {
@Resource @Resource
private ProcessDesignMapper processDesignMapper; private ProcessDesignMapper processDesignMapper;
@Resource @Resource
private ProcessDesignProgressMapper processDesignProgressMapper; private ProcessDesignProgressMapper processDesignProgressMapper;
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Long createProcessDesign(ProcessDesignSaveReqVO createReqVO) { public Long createProcessDesign(ProcessDesignSaveReqVO createReqVO) {
// 插入 // 插入
ProcessDesignDO processDesign = BeanUtils.toBean(createReqVO, ProcessDesignDO.class); ProcessDesignDO processDesign = BeanUtils.toBean(createReqVO, ProcessDesignDO.class);
processDesignMapper.insert(processDesign); processDesignMapper.insert(processDesign);
// 插入子表 // 插入子表
createProcessDesignProgressList(processDesign.getId(), createReqVO.getProcessDesignProgresss()); createProcessDesignProgressList(processDesign.getId(), createReqVO.getProcessDesignProgressList());
// 返回 // 返回
return processDesign.getId(); return processDesign.getId();
} }
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void updateProcessDesign(ProcessDesignSaveReqVO updateReqVO) { public void updateProcessDesign(ProcessDesignSaveReqVO updateReqVO) {
// 校验存在 // 校验存在
validateProcessDesignExists(updateReqVO.getId()); validateProcessDesignExists(updateReqVO.getId());
// 更新 // 更新
ProcessDesignDO updateObj = BeanUtils.toBean(updateReqVO, ProcessDesignDO.class); ProcessDesignDO updateObj = BeanUtils.toBean(updateReqVO, ProcessDesignDO.class);
processDesignMapper.updateById(updateObj); processDesignMapper.updateById(updateObj);
// 更新子表 // 更新子表
updateProcessDesignProgressList(updateReqVO.getId(), updateReqVO.getProcessDesignProgresss()); updateProcessDesignProgressList(updateReqVO.getId(), updateReqVO.getProcessDesignProgressList());
} }
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void deleteProcessDesign(Long id) { public void deleteProcessDesign(Long id) {
// 校验存在 // 校验存在
validateProcessDesignExists(id); validateProcessDesignExists(id);
// 删除 // 删除
processDesignMapper.deleteById(id); processDesignMapper.deleteById(id);
// 删除子表 // 删除子表
deleteProcessDesignProgressByProcessDesignId(id); deleteProcessDesignProgressByProcessDesignId(id);
} }
private void validateProcessDesignExists(Long id) { private void validateProcessDesignExists(Long id) {
if (processDesignMapper.selectById(id) == null) { if (processDesignMapper.selectById(id) == null) {
throw exception(PROCESS_DESIGN_NOT_EXISTS); throw exception(PROCESS_DESIGN_NOT_EXISTS);
} }
} }
@Override @Override
public ProcessDesignDO getProcessDesign(Long id) { public ProcessDesignDO getProcessDesign(Long id) {
return processDesignMapper.selectById(id); return processDesignMapper.selectById(id);
} }
@Override @Override
public PageResult<ProcessDesignDO> getProcessDesignPage(ProcessDesignPageReqVO pageReqVO) { public PageResult<ProcessDesignDO> getProcessDesignPage(ProcessDesignPageReqVO pageReqVO) {
return processDesignMapper.selectPage(pageReqVO); return processDesignMapper.selectPage(pageReqVO);
} }
// ==================== 子表(工艺设计进度) ==================== // ==================== 子表(工艺设计进度) ====================
@Override @Override
public List<ProcessDesignProgressDO> getProcessDesignProgressListByProcessDesignId(Long processDesignId) { public List<ProcessDesignProgressDO> getProcessDesignProgressListByProcessDesignId(Long processDesignId) {
return processDesignProgressMapper.selectListByProcessDesignId(processDesignId); return processDesignProgressMapper.selectListByProcessDesignId(processDesignId);
} }
private void createProcessDesignProgressList(Long processDesignId, List<ProcessDesignProgressDO> list) { private void createProcessDesignProgressList(Long processDesignId, List<ProcessDesignProgressDO> list) {
list.forEach(o -> o.setProcessDesignId(processDesignId)); list.forEach(o -> o.setProcessDesignId(processDesignId));
processDesignProgressMapper.insertBatch(list); processDesignProgressMapper.insertBatch(list);
} }
private void updateProcessDesignProgressList(Long processDesignId, List<ProcessDesignProgressDO> list) { private void updateProcessDesignProgressList(Long processDesignId, List<ProcessDesignProgressDO> list) {
deleteProcessDesignProgressByProcessDesignId(processDesignId); deleteProcessDesignProgressByProcessDesignId(processDesignId);
list.forEach(o -> o.setId(null).setUpdater(null).setUpdateTime(null)); // 解决更新情况下1id 冲突2updateTime 不更新 list.forEach(o -> o.setId(null).setUpdater(null).setUpdateTime(null)); // 解决更新情况下1id 冲突2updateTime 不更新
createProcessDesignProgressList(processDesignId, list); createProcessDesignProgressList(processDesignId, list);
} }
private void deleteProcessDesignProgressByProcessDesignId(Long processDesignId) { private void deleteProcessDesignProgressByProcessDesignId(Long processDesignId) {
processDesignProgressMapper.deleteByProcessDesignId(processDesignId); processDesignProgressMapper.deleteByProcessDesignId(processDesignId);
} }
} }

@ -1,48 +1,49 @@
import request from '@/config/axios' import request from '@/config/axios'
export interface ProcessDesignVO { export interface ProcessDesignVO {
id: number id: number
planId: number planId: number
saleOrderId: number processDesignType: string
saleOrderSubId: number remark: string
processDesignType: string status: number
remark: string projectId: number
status: number projectSubId: number
} processDesignProgressList: any
}
// 查询工艺设计分页
export const getProcessDesignPage = async (params) => { // 查询工艺设计分页
return await request.get({ url: `/heli/process-design/page`, params }) export const getProcessDesignPage = async (params) => {
} return await request.get({ url: `/heli/process-design/page`, params })
}
// 查询工艺设计详情
export const getProcessDesign = async (id: number) => { // 查询工艺设计详情
return await request.get({ url: `/heli/process-design/get?id=` + id }) export const getProcessDesign = async (id: number) => {
} return await request.get({ url: `/heli/process-design/get?id=` + id })
}
// 新增工艺设计
export const createProcessDesign = async (data: ProcessDesignVO) => { // 新增工艺设计
return await request.post({ url: `/heli/process-design/create`, data }) export const createProcessDesign = async (data: ProcessDesignVO) => {
} return await request.post({ url: `/heli/process-design/create`, data })
}
// 修改工艺设计
export const updateProcessDesign = async (data: ProcessDesignVO) => { // 修改工艺设计
return await request.put({ url: `/heli/process-design/update`, data }) export const updateProcessDesign = async (data: ProcessDesignVO) => {
} return await request.put({ url: `/heli/process-design/update`, data })
}
// 删除工艺设计
export const deleteProcessDesign = async (id: number) => { // 删除工艺设计
return await request.delete({ url: `/heli/process-design/delete?id=` + id }) export const deleteProcessDesign = async (id: number) => {
} return await request.delete({ url: `/heli/process-design/delete?id=` + id })
}
// 导出工艺设计 Excel
export const exportProcessDesign = async (params) => { // 导出工艺设计 Excel
return await request.download({ url: `/heli/process-design/export-excel`, params }) export const exportProcessDesign = async (params) => {
} return await request.download({ url: `/heli/process-design/export-excel`, params })
}
// ==================== 子表(工艺设计进度) ====================
// ==================== 子表(工艺设计进度) ====================
// 获得工艺设计进度列表
export const getProcessDesignProgressListByProcessDesignId = async (processDesignId) => { // 获得工艺设计进度列表
return await request.get({ url: `/heli/process-design/process-design-progress/list-by-process-design-id?processDesignId=` + processDesignId }) export const getProcessDesignProgressListByProcessDesignId = async (processDesignId) => {
} return await request.get({ url: `/heli/process-design/process-design-progress/list-by-process-design-id?processDesignId=` + processDesignId })
}

@ -1,141 +0,0 @@
<template>
<Dialog :title="dialogTitle" v-model="dialogVisible">
<el-form
ref="formRef"
:model="formData"
:rules="formRules"
label-width="100px"
v-loading="formLoading"
>
<el-form-item label="生产计划id" prop="planId">
<el-input v-model="formData.planId" placeholder="请输入生产计划id" />
</el-form-item>
<el-form-item label="销售订单id" prop="saleOrderId">
<el-input v-model="formData.saleOrderId" placeholder="请输入销售订单id" />
</el-form-item>
<el-form-item label="销售订单子项id" prop="saleOrderSubId">
<el-input v-model="formData.saleOrderSubId" placeholder="请输入销售订单子项id" />
</el-form-item>
<el-form-item label="设计类型 铸造工艺|3D图纸|2D图纸|毛坯图纸 FOUNDRY_TECHNOLOGY_BLUEPRINT|3D_BLUEPRINT|2D_BLUEPRINT|WORKBLANK_BLUEPRINT" prop="processDesignType">
<el-select v-model="formData.processDesignType" placeholder="请选择设计类型 铸造工艺|3D图纸|2D图纸|毛坯图纸 FOUNDRY_TECHNOLOGY_BLUEPRINT|3D_BLUEPRINT|2D_BLUEPRINT|WORKBLANK_BLUEPRINT">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="formData.remark" placeholder="请输入备注" />
</el-form-item>
<el-form-item label="状态,1表示正常2表示禁用" prop="status">
<el-radio-group v-model="formData.status">
<el-radio label="1">请选择字典生成</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<!-- 子表的表单 -->
<el-tabs v-model="subTabsName">
<el-tab-pane label="工艺设计进度" name="processDesignProgress">
<ProcessDesignProgressForm ref="processDesignProgressFormRef" :process-design-id="formData.id" />
</el-tab-pane>
</el-tabs>
<template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</template>
</Dialog>
</template>
<script setup lang="ts">
import * as ProcessDesignApi from '@/api/heli/processdesign'
import ProcessDesignProgressForm from './components/ProcessDesignProgressForm.vue'
const { t } = useI18n() //
const message = useMessage() //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const formData = ref({
id: undefined,
planId: undefined,
saleOrderId: undefined,
saleOrderSubId: undefined,
processDesignType: undefined,
remark: undefined,
status: undefined,
})
const formRules = reactive({
planId: [{ required: true, message: '生产计划id不能为空', trigger: 'blur' }],
saleOrderId: [{ required: true, message: '销售订单id不能为空', trigger: 'blur' }],
processDesignType: [{ required: true, message: '设计类型 铸造工艺|3D图纸|2D图纸|毛坯图纸 FOUNDRY_TECHNOLOGY_BLUEPRINT|3D_BLUEPRINT|2D_BLUEPRINT|WORKBLANK_BLUEPRINT不能为空', trigger: 'change' }],
status: [{ required: true, message: '状态,1表示正常2表示禁用不能为空', trigger: 'blur' }],
})
const formRef = ref() // Ref
/** 子表的表单 */
const subTabsName = ref('processDesignProgress')
const processDesignProgressFormRef = ref()
/** 打开弹窗 */
const open = async (type: string, id?: number) => {
dialogVisible.value = true
dialogTitle.value = t('action.' + type)
formType.value = type
resetForm()
//
if (id) {
formLoading.value = true
try {
formData.value = await ProcessDesignApi.getProcessDesign(id)
} finally {
formLoading.value = false
}
}
}
defineExpose({ open }) // open
/** 提交表单 */
const emit = defineEmits(['success']) // success
const submitForm = async () => {
//
await formRef.value.validate()
//
try {
await processDesignProgressFormRef.value.validate()
} catch (e) {
subTabsName.value = 'processDesignProgress'
return
}
//
formLoading.value = true
try {
const data = formData.value as unknown as ProcessDesignApi.ProcessDesignVO
//
data.processDesignProgresss = processDesignProgressFormRef.value.getData()
if (formType.value === 'create') {
await ProcessDesignApi.createProcessDesign(data)
message.success(t('common.createSuccess'))
} else {
await ProcessDesignApi.updateProcessDesign(data)
message.success(t('common.updateSuccess'))
}
dialogVisible.value = false
//
emit('success')
} finally {
formLoading.value = false
}
}
/** 重置表单 */
const resetForm = () => {
formData.value = {
id: undefined,
planId: undefined,
saleOrderId: undefined,
saleOrderSubId: undefined,
processDesignType: undefined,
remark: undefined,
status: undefined,
}
formRef.value?.resetFields()
}
</script>

@ -1,119 +0,0 @@
<template>
<el-form
ref="formRef"
:model="formData"
:rules="formRules"
v-loading="formLoading"
label-width="0px"
:inline-message="true"
>
<el-table :data="formData" class="-mt-10px">
<el-table-column label="序号" type="index" width="100" />
<el-table-column label="进度百分比(%)" min-width="150">
<template #default="{ row, $index }">
<el-form-item :prop="`${$index}.progress`" :rules="formRules.progress" class="mb-0px!">
<el-input v-model="row.progress" placeholder="请输入进度百分比(%)" />
</el-form-item>
</template>
</el-table-column>
<el-table-column label="图纸链接" min-width="150">
<template #default="{ row, $index }">
<el-form-item :prop="`${$index}.blueprintLink`" :rules="formRules.blueprintLink" class="mb-0px!">
<el-input v-model="row.blueprintLink" placeholder="请输入图纸链接" />
</el-form-item>
</template>
</el-table-column>
<el-table-column label="备注" min-width="150">
<template #default="{ row, $index }">
<el-form-item :prop="`${$index}.remark`" :rules="formRules.remark" class="mb-0px!">
<el-input v-model="row.remark" placeholder="请输入备注" />
</el-form-item>
</template>
</el-table-column>
<el-table-column label="状态,1表示正常2表示禁用" min-width="150">
<template #default="{ row, $index }">
<el-form-item :prop="`${$index}.status`" :rules="formRules.status" class="mb-0px!">
<el-radio-group v-model="row.status">
<el-radio label="1">请选择字典生成</el-radio>
</el-radio-group>
</el-form-item>
</template>
</el-table-column>
<el-table-column align="center" fixed="right" label="操作" width="60">
<template #default="{ $index }">
<el-button @click="handleDelete($index)" link></el-button>
</template>
</el-table-column>
</el-table>
</el-form>
<el-row justify="center" class="mt-3">
<el-button @click="handleAdd" round>+ 添加工艺设计进度</el-button>
</el-row>
</template>
<script setup lang="ts">
import * as ProcessDesignApi from '@/api/heli/processdesign'
const props = defineProps<{
processDesignId: undefined // id
}>()
const formLoading = ref(false) //
const formData = ref([])
const formRules = reactive({
processDesignId: [{ required: true, message: '工艺设计id不能为空', trigger: 'blur' }],
progress: [{ required: true, message: '进度百分比(%)不能为空', trigger: 'blur' }],
blueprintLink: [{ required: true, message: '图纸链接不能为空', trigger: 'blur' }],
status: [{ required: true, message: '状态,1表示正常2表示禁用不能为空', trigger: 'blur' }],
})
const formRef = ref() // Ref
/** 监听主表的关联字段的变化,加载对应的子表数据 */
watch(
() => props.processDesignId,
async (val) => {
// 1.
formData.value = []
// 2. val
if (!val) {
return;
}
try {
formLoading.value = true
formData.value = await ProcessDesignApi.getProcessDesignProgressListByProcessDesignId(val)
} finally {
formLoading.value = false
}
},
{ immediate: true }
)
/** 新增按钮操作 */
const handleAdd = () => {
const row = {
id: undefined,
processDesignId: undefined,
progress: undefined,
blueprintLink: undefined,
remark: undefined,
status: undefined,
}
row.processDesignId = props.processDesignId
formData.value.push(row)
}
/** 删除按钮操作 */
const handleDelete = (index) => {
formData.value.splice(index, 1)
}
/** 表单校验 */
const validate = () => {
return formRef.value.validate()
}
/** 表单值 */
const getData = () => {
return formData.value
}
defineExpose({ validate, getData })
</script>

@ -0,0 +1,249 @@
<template>
<el-card class="hl-card">
<template #header>
<span><span v-html="dialogTitle"></span></span>
</template>
<el-form ref="formRef" label-width="120px" :model="formData" v-loading="formLoading">
<!-- 基础信息 竖列布局 -->
<el-card class="hl-card-info">
<template #header>
<div class="hl-card-info-icona"></div><span class="hl-card-info-text">基础信息</span>
</template>
<el-row>
<el-col :span="6">
<el-form-item label="计划单号" prop="planCode">
{{ formData.planCode }}
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="项目编号" prop="projectCode">
{{ formData.projectCode }}
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="客户名称" prop="customerName">
{{ formData.customerName }}
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="项目名称" prop="projectName">
{{ formData.projectName }}
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="6">
<el-form-item label="项目负责人" prop="projectOwnerName">
{{ formData.projectOwnerName }}
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="所属业务线" prop="businessLine">
{{getDictLabel(DICT_TYPE.HELI_BUSINESS_FILE_TYPE, formData.businessLine)}}
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="性质" prop="property">
{{formData.property}}
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="是否紧急" prop="isUrgency">
{{ getDictLabel(DICT_TYPE.HELI_COMMON_IS_OR_NOT, formData.isUrgency) }}
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="6">
<el-form-item label="是否要工艺" prop="hasCraft">
{{ getDictLabel(DICT_TYPE.HELI_COMMON_IS_OR_NOT, formData.hasCraft) }}
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="工艺负责人" prop="craftOwnerName">
{{formData.craftOwnerName}}
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="工艺开始日期" prop="craftStartDate">
{{formatDate(formData.craftStartDate, 'YYYY-MM-DD')}}
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="工艺结束日期" prop="craftStartDate">
{{formatDate(formData.craftEndDate, 'YYYY-MM-DD')}}
</el-form-item>
</el-col>
</el-row>
</el-card>
<!-- 表格类信息 -->
<el-card class="hl-card-info">
<template #header>
<div class="hl-card-info-icona"></div><span class="hl-card-info-text">进度汇报</span>
</template>
<el-row>
<el-col v-if="active != 'detail'">
<el-button class="hl-addbutton" type="primary" size="large" @click="onAddItem"></el-button>
</el-col>
<el-col>
<el-card class="hl-incard">
<el-form ref="subFormRef" :model="formData.processDesignProgressList" :rules="subFormRules" v-loading="subFormLoading" label-width="0">
<el-table :data="formData.processDesignProgressList" class="hl-table">
<el-table-column label="序号" type="index" width="80" fixed />
<el-table-column label="上报时间" prop="createTime" :formatter="dateFormatter"/>
<el-table-column label="上报人" prop="creatorName"/>
<el-table-column label="进度百分比(%" prop="progress">
<template #header> <span class="hl-table_header">*</span>进度百分比% </template>
<template #default="{ row, $index }">
<el-form-item :prop="`${$index}.progress`" :rules="subFormRules.progress" class="mb-0px!">
<el-input-number min="0" max="100" :disabled="detailDisabled" v-model="row.progress" placeholder="请输入进度百分比" />
</el-form-item>
</template>
</el-table-column>
<el-table-column label="图纸链接" prop="progress">
<template #header> <span class="hl-table_header">*</span>图纸链接 </template>
<template #default="{ row, $index }">
<el-form-item :prop="`${$index}.blueprintLink`" :rules="subFormRules.blueprintLink" class="mb-0px!">
<el-input :disabled="detailDisabled" v-model="row.blueprintLink" placeholder="请输入图纸链接" />
</el-form-item>
</template>
</el-table-column>
<el-table-column label="备注" prop="remark">
<template #default="{ row, $index }">
<el-form-item :prop="`${$index}.remark`" class="mb-0px!">
<el-input :disabled="detailDisabled" v-model="row.remark" placeholder="请输入备注" />
</el-form-item>
</template>
</el-table-column>
</el-table>
</el-form>
</el-card>
</el-col>
</el-row>
</el-card>
</el-form>
</el-card>
</template>
<script setup lang="ts">
import {DICT_TYPE, getDictLabel, getStrDictOptions} from "@/utils/dict";
import {dateFormatter, formatDate} from "@/utils/formatTime";
import {useCommonStateWithOut} from "@/store/modules/common";
import {ref} from "vue";
import * as ProcessDesignApi from "@/api/heli/processdesign";
import { inject } from 'vue'
import {useUserStore} from "@/store/modules/user";
const reload = inject('reload')
const { t } = useI18n() //
const message = useMessage() //
const commonStore = useCommonStateWithOut()
const userStore = useUserStore()
const active = toRef(commonStore.getStore('active'))
const currentId = toRef(commonStore.getStore('id'))
const processDesignType = toRef(commonStore.getStore('processDesignType'))
const formLoading = ref(false)
const dialogTitle = ref('')
const detailDisabled = ref(false)
const formData = ref({
id: undefined,
planId: undefined,
processDesignType: undefined,
remark: undefined,
status: 1,
projectId: undefined,
projectSubId: undefined,
processDesignProgressList: [],
})
const formRef = ref() // Ref
const processDesignProgressFormRef = ref()
/** 重置表单 */
const resetForm = () => {
formData.value = {
id: undefined,
planId: undefined,
processDesignType: undefined,
remark: undefined,
status: 1,
projectId: undefined,
projectSubId: undefined,
processDesignProgressList: [],
}
formRef.value?.resetFields()
}
const subFormLoading = ref(false) //
const subFormRules = reactive({
progress: [{ required: true, message: '进度百分比(%)不能为空', trigger: 'blur' }],
blueprintLink: [{ required: true, message: '图纸链接不能为空', trigger: 'blur' }],
})
const queryData = async (id?: number) => {
resetForm()
//
if (id) {
formLoading.value = true
try {
formData.value = await ProcessDesignApi.getProcessDesign(id)
formData.value.processDesignProgressList = await ProcessDesignApi.getProcessDesignProgressListByProcessDesignId(id)
} finally {
formLoading.value = false
}
}
}
const submitForm = async (operate) => {
//
await formRef.value.validate()
//
await processDesignProgressFormRef.value.validate()
//
formLoading.value = true
try {
const data = formData.value as unknown as ProcessDesignApi.ProcessDesignVO
//
data.processDesignProgressList = processDesignProgressFormRef.value.getData()
let processDesignId;
if (operate === 'SAVE') {
processDesignId = await ProcessDesignApi.createProcessDesign(data)
} else {
processDesignId = await ProcessDesignApi.updateProcessDesign(data)
}
message.success(t('common.operationSuccess'))
commonStore.setStore('active', 'update');
commonStore.setStore('id', processDesignId);
reload()
} finally {
formLoading.value = false
}
}
/** 新增按钮操作 */
const onAddItem = () => {
const row = {
id: undefined,
processDesignId: undefined,
progress: undefined,
blueprintLink: undefined,
remark: undefined,
createTime: new Date(),
creatorName: userStore.getUser.nickname,
status: 1,
}
row.processDesignId = formData.value.id
formData.value.processDesignProgressList.push(row)
}
onMounted(() => {
dialogTitle.value = t('action.' + active.value)
if ('detail' == active.value) {
detailDisabled.value = true
}
queryData(currentId.value)
})
</script>
<style scoped lang="less"></style>

@ -6,95 +6,66 @@
:model="queryParams" :model="queryParams"
ref="queryFormRef" ref="queryFormRef"
:inline="true" :inline="true"
label-width="68px" label-width="110px"
> >
<el-form-item label="生产计划id" prop="planId"> <el-form-item label="计划单号" prop="planCode">
<el-input <el-input
v-model="queryParams.planId" v-model="queryParams.planCode"
placeholder="请输入生产计划id" placeholder="请输入计划单号"
clearable clearable
@keyup.enter="handleQuery" @keyup.enter="handleQuery"
class="!w-240px" class="!w-240px"
/> />
</el-form-item> </el-form-item>
<el-form-item label="销售订单id" prop="saleOrderId"> <el-form-item label="项目编号" prop="projectCode">
<el-input <el-input
v-model="queryParams.saleOrderId" v-model="queryParams.projectCode"
placeholder="请输入销售订单id" placeholder="请输入项目编号"
clearable clearable
@keyup.enter="handleQuery" @keyup.enter="handleQuery"
class="!w-240px" class="!w-240px"
/> />
</el-form-item> </el-form-item>
<el-form-item label="销售订单子项id" prop="saleOrderSubId"> <el-form-item label="客户名称" prop="customerName">
<el-input <el-input
v-model="queryParams.saleOrderSubId" v-model="queryParams.customerName"
placeholder="请输入销售订单子项id" placeholder="请输入客户名称"
clearable clearable
@keyup.enter="handleQuery" @keyup.enter="handleQuery"
class="!w-240px" class="!w-240px"
/> />
</el-form-item> </el-form-item>
<el-form-item label="设计类型 铸造工艺|3D图纸|2D图纸|毛坯图纸 FOUNDRY_TECHNOLOGY_BLUEPRINT|3D_BLUEPRINT|2D_BLUEPRINT|WORKBLANK_BLUEPRINT" prop="processDesignType"> <el-form-item label="项目名称" prop="projectName">
<el-select
v-model="queryParams.processDesignType"
placeholder="请选择设计类型 铸造工艺|3D图纸|2D图纸|毛坯图纸 FOUNDRY_TECHNOLOGY_BLUEPRINT|3D_BLUEPRINT|2D_BLUEPRINT|WORKBLANK_BLUEPRINT"
clearable
class="!w-240px"
>
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input <el-input
v-model="queryParams.remark" v-model="queryParams.projectName"
placeholder="请输入备注" placeholder="请输入项目名称"
clearable clearable
@keyup.enter="handleQuery" @keyup.enter="handleQuery"
class="!w-240px" class="!w-240px"
/> />
</el-form-item> </el-form-item>
<el-form-item label="状态,1表示正常2表示禁用" prop="status"> <el-form-item label="所属业务线" prop="businessLine">
<el-select <el-select class="!w-240px" v-model="queryParams.businessLine" placeholder="下拉选择">
v-model="queryParams.status" <el-option v-for="dict in getStrDictOptions(DICT_TYPE.HELI_BUSINESS_LINE)" :key="dict.value" :label="dict.label" :value="dict.value" />
placeholder="请选择状态,1表示正常2表示禁用" </el-select>
clearable </el-form-item>
class="!w-240px" <el-form-item label="性质" prop="property">
> <el-select class="!w-240px" v-model="queryParams.property" placeholder="下拉选择">
<el-option label="请选择字典生成" value="" /> <el-option v-for="dict in getIntDictOptions(DICT_TYPE.HELI_PROJECT_PROPERTY)" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="创建时间" prop="createTime"> <el-form-item label="工艺负责人" prop="craftOwnerName">
<el-date-picker <el-input
v-model="queryParams.createTime" v-model="queryParams.craftOwnerName"
value-format="YYYY-MM-DD HH:mm:ss" placeholder="请输入工艺负责人"
type="daterange" clearable
start-placeholder="开始日期" @keyup.enter="handleQuery"
end-placeholder="结束日期"
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
class="!w-240px" class="!w-240px"
/> />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button> <el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button> <el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
<el-button
type="primary"
plain
@click="openForm('create')"
v-hasPermi="['heli:process-design:create']"
>
<Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button>
<el-button
type="success"
plain
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['heli:process-design:export']"
>
<Icon icon="ep:download" class="mr-5px" /> 导出
</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</ContentWrap> </ContentWrap>
@ -102,37 +73,48 @@
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <ContentWrap>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true"> <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="自增字段,唯一" align="center" prop="id" /> <el-table-column fixed label="序号" type="index" width="100" />
<el-table-column label="生产计划id" align="center" prop="planId" /> <el-table-column fixed label="计划单号" align="center" prop="planCode" />
<el-table-column label="销售订单id" align="center" prop="saleOrderId" /> <el-table-column fixed label="项目编号" align="center" prop="projectCode" />
<el-table-column label="销售订单子项id" align="center" prop="saleOrderSubId" /> <el-table-column label="客户名称" align="center" prop="customerName" />
<el-table-column label="设计类型 铸造工艺|3D图纸|2D图纸|毛坯图纸 FOUNDRY_TECHNOLOGY_BLUEPRINT|3D_BLUEPRINT|2D_BLUEPRINT|WORKBLANK_BLUEPRINT" align="center" prop="processDesignType" /> <el-table-column label="项目名称" align="center" prop="projectName" />
<el-table-column label="备注" align="center" prop="remark" /> <el-table-column label="所属业务线" align="center" prop="businessLine">
<el-table-column label="状态,1表示正常2表示禁用" align="center" prop="status" /> <template #default="scope">
<el-table-column <dict-tag :type="DICT_TYPE.HELI_BUSINESS_FILE_TYPE" :value="scope.row.businessLine" />
label="创建时间" </template>
align="center" </el-table-column>
prop="createTime" <el-table-column label="性质" align="center" prop="property" width="120">
:formatter="dateFormatter" <template #default="scope">
width="180px" <dict-tag :type="DICT_TYPE.HELI_PROJECT_PROPERTY" :value="scope.row.property" />
/> </template>
<el-table-column label="操作" align="center"> </el-table-column>
<el-table-column fixed="right" label="项目负责人" align="center" prop="projectOwnerName" />
<el-table-column fixed="right" label="工艺负责人" align="center" prop="craftOwnerName" />
<el-table-column fixed="right" label="工艺起止日期" align="center" prop="craftDate" >
<template #default="scope">
{{formatDate(scope.row.craftStartDate, 'YYYY-MM-DD') + '~' + formatDate(scope.row.craftEndDate, 'YYYY-MM-DD')}}
</template>
</el-table-column>
<el-table-column fixed="right" label="最新进度" align="center" prop="progress" >
<template #default="scope">
{{scope.row.progress + '%'}}
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" align="center">
<template #default="scope"> <template #default="scope">
<el-button <el-button
link link
type="primary" type="primary"
@click="openForm('update', scope.row.id)" @click="openForm('update', scope.row.id)"
v-hasPermi="['heli:process-design:update']"
> >
编辑 编辑
</el-button> </el-button>
<el-button <el-button
link link
type="danger" type="primary"
@click="handleDelete(scope.row.id)" @click="openDetail('detail', scope.row.id)"
v-hasPermi="['heli:process-design:delete']"
> >
删除 查看详情
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
@ -145,21 +127,21 @@
@pagination="getList" @pagination="getList"
/> />
</ContentWrap> </ContentWrap>
<!-- 表单弹窗添加/修改 -->
<ProcessDesignForm ref="formRef" @success="getList" />
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { dateFormatter } from '@/utils/formatTime' import {getStrDictOptions, DICT_TYPE, getDictLabel, getIntDictOptions} from '@/utils/dict'
import {dateFormatter, formatDate} from '@/utils/formatTime'
import download from '@/utils/download' import download from '@/utils/download'
import * as ProcessDesignApi from '@/api/heli/processdesign' import * as ProcessDesignApi from '@/api/heli/processdesign'
import ProcessDesignForm from './ProcessDesignForm.vue' import {useCommonStateWithOut} from "@/store/modules/common";
defineOptions({ name: 'ProcessDesign' }) defineOptions({ name: 'ProcessDesign' })
const message = useMessage() // const message = useMessage() //
const { t } = useI18n() // const { t } = useI18n() //
const router = useRouter()
const commonStore = useCommonStateWithOut()
const loading = ref(true) // const loading = ref(true) //
const list = ref([]) // const list = ref([]) //
@ -167,13 +149,14 @@ const total = ref(0) // 列表的总页数
const queryParams = reactive({ const queryParams = reactive({
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
planId: undefined, planCode: undefined,
saleOrderId: undefined, projectCode: undefined,
saleOrderSubId: undefined, processDesignType: 'BLUEPRINT_FOUNDRY_TECHNOLOGY',
processDesignType: undefined, customerName: undefined,
remark: undefined, projectName: undefined,
status: undefined, businessLine: undefined,
createTime: [], property: undefined,
craftOwnerName: undefined
}) })
const queryFormRef = ref() // const queryFormRef = ref() //
const exportLoading = ref(false) // const exportLoading = ref(false) //
@ -208,6 +191,19 @@ const openForm = (type: string, id?: number) => {
formRef.value.open(type, id) formRef.value.open(type, id)
} }
/** 添加/修改操作 */
const openDetail = (type: string, id?: number) => {
commonStore.setStore("active", type);
commonStore.setStore("id", id);
commonStore.setStore("processDesignType", 'BLUEPRINT_FOUNDRY_TECHNOLOGY');
router.push({
name: 'ProcessDesignDetail',
query: {
operateId: Math.random()
}
})
}
/** 删除按钮操作 */ /** 删除按钮操作 */
const handleDelete = async (id: number) => { const handleDelete = async (id: number) => {
try { try {
@ -240,4 +236,4 @@ const handleExport = async () => {
onMounted(() => { onMounted(() => {
getList() getList()
}) })
</script> </script>

@ -36,9 +36,9 @@ DROP TABLE IF EXISTS `pro_process_design`;
CREATE TABLE `pro_process_design` ( CREATE TABLE `pro_process_design` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增字段,唯一', `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增字段,唯一',
`plan_id` BIGINT(20) NOT NULL COMMENT '生产计划id', `plan_id` BIGINT(20) NOT NULL COMMENT '生产计划id',
`sale_order_id` BIGINT(20) NOT NULL COMMENT '销售订单id', `project_id` BIGINT(20) NOT NULL COMMENT '项目id',
`sale_order_sub_id` BIGINT(20) COMMENT '销售订单子项id', `project_sub_id` BIGINT(20) COMMENT '子项id',
`process_design_type` varchar(64) not null COMMENT '设计类型 铸造工艺|3D图纸|2D图纸|毛坯图纸 FOUNDRY_TECHNOLOGY_BLUEPRINT|3D_BLUEPRINT|2D_BLUEPRINT|WORKBLANK_BLUEPRINT', `process_design_type` varchar(64) not null COMMENT '设计类型 铸造工艺|3D图纸|2D图纸|毛坯图纸 BLUEPRINT_FOUNDRY_TECHNOLOGY|BLUEPRINT_3D|BLUEPRINT_2D|BLUEPRINT_WORKBLANK',
`remark` varchar(255) DEFAULT NULL COMMENT '备注', `remark` varchar(255) DEFAULT NULL COMMENT '备注',
`status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态,1表示正常2表示禁用', `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态,1表示正常2表示禁用',
`creator` varchar(64) DEFAULT '' COMMENT '创建者', `creator` varchar(64) DEFAULT '' COMMENT '创建者',
@ -47,7 +47,9 @@ CREATE TABLE `pro_process_design` (
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
`tenant_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '租户编号', `tenant_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '租户编号',
PRIMARY KEY (`id`) USING BTREE PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_plan`(`plan_id`) USING BTREE,
INDEX `idx_project`(`project_id`) USING BTREE
) ENGINE=InnoDB COMMENT='工艺设计表'; ) ENGINE=InnoDB COMMENT='工艺设计表';
DROP TABLE IF EXISTS `pro_process_design_progress`; DROP TABLE IF EXISTS `pro_process_design_progress`;

Loading…
Cancel
Save