Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
d8f645e00a
1
.gitignore
vendored
1
.gitignore
vendored
@ -52,3 +52,4 @@ application-my.yaml
|
||||
|
||||
/mes-ui-app/unpackage/
|
||||
|
||||
/.trae/
|
||||
|
||||
@ -9,6 +9,7 @@ import com.ningxia.yunxi.chemmes.module.biz.controller.admin.machine.vo.MachineR
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.machine.vo.MachineSaveReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.machine.MachineDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.service.machine.MachineService;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.service.machineparamdetail.MachineParamDetailService;
|
||||
import com.ningxia.yunxi.chemmes.module.system.dal.dataobject.user.AdminUserDO;
|
||||
import com.ningxia.yunxi.chemmes.module.system.service.user.AdminUserService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
@ -36,6 +37,9 @@ public class MachineController {
|
||||
@Resource
|
||||
private AdminUserService userService;
|
||||
|
||||
@Resource
|
||||
private MachineParamDetailService machineParamDetailService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建机台主数据")
|
||||
@PreAuthorize("@ss.hasPermission('biz:machine:create')")
|
||||
@ -66,7 +70,8 @@ public class MachineController {
|
||||
@PreAuthorize("@ss.hasPermission('biz:machine:query')")
|
||||
public CommonResult<MachineRespVO> getMachine(@RequestParam("id") Integer id) {
|
||||
MachineDO machine = machineService.getMachine(id);
|
||||
return success(BeanUtils.toBean(machine, MachineRespVO.class));
|
||||
MachineRespVO respVO = BeanUtils.toBean(machine, MachineRespVO.class);
|
||||
return success(respVO);
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ -90,8 +95,9 @@ public class MachineController {
|
||||
@GetMapping("/dropdown")
|
||||
@Operation(summary = "获得机台下拉框")
|
||||
@PreAuthorize("@ss.hasPermission('biz:machine:query')")
|
||||
public CommonResult<List<MachineRespVO>> getMachineDropdown(@RequestParam(value = "keyWord", required = false, defaultValue = "") String keyWord) {
|
||||
List<MachineDO> dropdownList = machineService.getMachineDropdown(keyWord);
|
||||
public CommonResult<List<MachineRespVO>> getMachineDropdown(@RequestParam(value = "keyWord", required = false, defaultValue = "") String keyWord,
|
||||
@RequestParam(value = "procId", required = false) Integer procId) {
|
||||
List<MachineDO> dropdownList = machineService.getMachineDropdown(keyWord, procId);
|
||||
return success(BeanUtils.toBean(dropdownList, MachineRespVO.class));
|
||||
}
|
||||
|
||||
|
||||
@ -4,10 +4,12 @@ import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.ningxia.yunxi.chemmes.framework.excel.core.annotations.DictFormat;
|
||||
import com.ningxia.yunxi.chemmes.framework.excel.core.convert.DictConvert;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.machineparamdetail.vo.MachineParamDetailRespVO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 机台主数据 Response VO")
|
||||
@Data
|
||||
@ -51,4 +53,6 @@ public class MachineRespVO {
|
||||
@ExcelProperty("创建者")
|
||||
private String creator;
|
||||
|
||||
private List<MachineParamDetailRespVO> details;
|
||||
|
||||
}
|
||||
|
||||
@ -1,10 +1,7 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.machine.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
import java.util.*;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 机台主数据新增/修改 Request VO")
|
||||
@Data
|
||||
@ -30,5 +27,4 @@ public class MachineSaveReqVO {
|
||||
|
||||
@Schema(description = "所属工序id", example = "1070")
|
||||
private Integer belgProcId;
|
||||
|
||||
}
|
||||
@ -1,33 +1,34 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.machineparam;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.CommonResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.CommonResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.util.object.BeanUtils;
|
||||
import static com.ningxia.yunxi.chemmes.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.framework.operatelog.core.annotations.OperateLog;
|
||||
import static com.ningxia.yunxi.chemmes.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.machineparam.vo.*;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.machineparam.vo.MachineParamPageReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.machineparam.vo.MachineParamRespVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.machineparam.vo.MachineParamSaveReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.machineparamdetail.vo.MachineParamDetailRespVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.machineparam.MachineParamDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.machineparamdetail.MachineParamDetailDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.service.machineparam.MachineParamService;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.service.machineparamdetail.MachineParamDetailService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static com.ningxia.yunxi.chemmes.framework.common.pojo.CommonResult.success;
|
||||
import static com.ningxia.yunxi.chemmes.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
||||
|
||||
@Tag(name = "管理后台 - 机台工艺参数配置")
|
||||
@RestController
|
||||
@ -38,6 +39,9 @@ public class MachineParamController {
|
||||
@Resource
|
||||
private MachineParamService machineParamService;
|
||||
|
||||
@Resource
|
||||
private MachineParamDetailService machineParamDetailService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建机台工艺参数配置")
|
||||
@PreAuthorize("@ss.hasPermission('biz:machine-param:create')")
|
||||
@ -68,7 +72,10 @@ public class MachineParamController {
|
||||
@PreAuthorize("@ss.hasPermission('biz:machine-param:query')")
|
||||
public CommonResult<MachineParamRespVO> getMachineParam(@RequestParam("id") Integer id) {
|
||||
MachineParamDO machineParam = machineParamService.getMachineParam(id);
|
||||
return success(BeanUtils.toBean(machineParam, MachineParamRespVO.class));
|
||||
MachineParamRespVO respVO = BeanUtils.toBean(machineParam, MachineParamRespVO.class);
|
||||
List<MachineParamDetailDO> detailList = machineParamDetailService.getListByMachineParamId(machineParam.getId());
|
||||
respVO.setDetails(BeanUtils.toBean(detailList, MachineParamDetailRespVO.class));
|
||||
return success(respVO);
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ -84,12 +91,12 @@ public class MachineParamController {
|
||||
@PreAuthorize("@ss.hasPermission('biz:machine-param:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportMachineParamExcel(@Valid MachineParamPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<MachineParamDO> list = machineParamService.getMachineParamPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "机台工艺参数配置.xls", "数据", MachineParamRespVO.class,
|
||||
BeanUtils.toBean(list, MachineParamRespVO.class));
|
||||
BeanUtils.toBean(list, MachineParamRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,14 +1,15 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.machineparam.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.ningxia.yunxi.chemmes.framework.excel.core.annotations.DictFormat;
|
||||
import com.ningxia.yunxi.chemmes.framework.excel.core.convert.DictConvert;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.machineparamdetail.vo.MachineParamDetailRespVO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 机台工艺参数配置 Response VO")
|
||||
@Data
|
||||
@ -72,4 +73,7 @@ public class MachineParamRespVO {
|
||||
@ExcelProperty("机台id")
|
||||
private Integer machineId;
|
||||
|
||||
@Schema(description = "工艺参数明细列表")
|
||||
private List<MachineParamDetailRespVO> details;
|
||||
|
||||
}
|
||||
@ -1,10 +1,10 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.machineparam.vo;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.machineparamdetail.vo.MachineParamDetailSaveReqVO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
import java.util.*;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 机台工艺参数配置新增/修改 Request VO")
|
||||
@Data
|
||||
@ -49,4 +49,6 @@ public class MachineParamSaveReqVO {
|
||||
@Schema(description = "机台id", example = "10661")
|
||||
private Integer machineId;
|
||||
|
||||
private List<MachineParamDetailSaveReqVO> details;
|
||||
|
||||
}
|
||||
@ -1,32 +1,24 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.machineparamdetail.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
import java.util.*;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - 机台工艺参数配置子新增/修改 Request VO")
|
||||
@Data
|
||||
public class MachineParamDetailSaveReqVO {
|
||||
|
||||
@Schema(description = "自增字段", requiredMode = Schema.RequiredMode.REQUIRED, example = "23169")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "状态(1启用 2 未启用)", example = "1")
|
||||
private Integer enabledStatus;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "参数名称", example = "李四")
|
||||
@Schema(description = "参数名称")
|
||||
private String procParamName;
|
||||
|
||||
@Schema(description = "参数单位")
|
||||
private String procParamUnit;
|
||||
|
||||
@Schema(description = "参数id", example = "16112")
|
||||
@Schema(description = "参数id")
|
||||
private Integer procParamId;
|
||||
|
||||
@Schema(description = "标准值")
|
||||
@ -43,8 +35,4 @@ public class MachineParamDetailSaveReqVO {
|
||||
|
||||
@Schema(description = "是否预警(0 是 1否)")
|
||||
private String isAlert;
|
||||
|
||||
@Schema(description = "主表id", example = "23736")
|
||||
private Integer machineParamId;
|
||||
|
||||
}
|
||||
|
||||
@ -1,33 +1,31 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.material;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.CommonResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.CommonResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.util.object.BeanUtils;
|
||||
import static com.ningxia.yunxi.chemmes.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.framework.operatelog.core.annotations.OperateLog;
|
||||
import static com.ningxia.yunxi.chemmes.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.material.vo.*;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.material.vo.MaterialPageReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.material.vo.MaterialRespVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.material.vo.MaterialSaveReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.material.MaterialDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.service.material.MaterialService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static com.ningxia.yunxi.chemmes.framework.common.pojo.CommonResult.success;
|
||||
import static com.ningxia.yunxi.chemmes.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
||||
|
||||
@Tag(name = "管理后台 - 物料主数据")
|
||||
@RestController
|
||||
@ -91,5 +89,12 @@ public class MaterialController {
|
||||
ExcelUtils.write(response, "物料主数据.xls", "数据", MaterialRespVO.class,
|
||||
BeanUtils.toBean(list, MaterialRespVO.class));
|
||||
}
|
||||
// 物料下拉框
|
||||
@GetMapping("/dropdown")
|
||||
@Operation(summary = "获得物料主数据下拉框")
|
||||
@PreAuthorize("@ss.hasPermission('biz:material:query')")
|
||||
public CommonResult<List<MaterialRespVO>> getMaterialDropdown(@RequestParam(value = "keyWord", required = false, defaultValue = "") String keyWord) {
|
||||
return success(BeanUtils.toBean(materialService.getMaterialDropdown(keyWord), MaterialRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,33 +1,31 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.procparam;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.CommonResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.CommonResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.util.object.BeanUtils;
|
||||
import static com.ningxia.yunxi.chemmes.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.framework.operatelog.core.annotations.OperateLog;
|
||||
import static com.ningxia.yunxi.chemmes.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.procparam.vo.*;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.procparam.vo.ProcParamPageReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.procparam.vo.ProcParamRespVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.procparam.vo.ProcParamSaveReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.procparam.ProcParamDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.service.procparam.ProcParamService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static com.ningxia.yunxi.chemmes.framework.common.pojo.CommonResult.success;
|
||||
import static com.ningxia.yunxi.chemmes.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
||||
|
||||
@Tag(name = "管理后台 - 工序工艺参数配置")
|
||||
@RestController
|
||||
@ -84,12 +82,20 @@ public class ProcParamController {
|
||||
@PreAuthorize("@ss.hasPermission('biz:proc-param:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportProcParamExcel(@Valid ProcParamPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ProcParamDO> list = procParamService.getProcParamPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "工序工艺参数配置.xls", "数据", ProcParamRespVO.class,
|
||||
BeanUtils.toBean(list, ProcParamRespVO.class));
|
||||
BeanUtils.toBean(list, ProcParamRespVO.class));
|
||||
}
|
||||
|
||||
// 下拉框
|
||||
@GetMapping("/dropdown")
|
||||
@PreAuthorize("@ss.hasPermission('biz:proc-param:query')")
|
||||
public CommonResult<List<ProcParamRespVO>> getProcParamDropdown(@RequestParam(value = "keyWord", required = false, defaultValue = "") String keyWord,
|
||||
@RequestParam(value = "procId", required = false, defaultValue = "") Integer procId) {
|
||||
return success(BeanUtils.toBean(procParamService.getProcParamDropdown(keyWord, procId), ProcParamRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@ -5,6 +5,7 @@ import com.ningxia.yunxi.chemmes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.ningxia.yunxi.chemmes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.machine.vo.MachinePageReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.machine.MachineDO;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
@ -32,10 +33,12 @@ public interface MachineMapper extends BaseMapperX<MachineDO> {
|
||||
.eqIfPresent(MachineDO::getMachineCd, code));
|
||||
}
|
||||
|
||||
default List<MachineDO> seleLectListByKeyWord(String keyWord) {
|
||||
default List<MachineDO> seleLectListByKeyWord(String keyWord, Integer procId) {
|
||||
return selectList(new LambdaQueryWrapperX<MachineDO>()
|
||||
.like(MachineDO::getMachineName, keyWord)
|
||||
.or()
|
||||
.like(MachineDO::getMachineCd, keyWord));
|
||||
.eqIfPresent(MachineDO::getBelgProcId, procId)
|
||||
.and(StringUtils.isNotBlank(keyWord), wrapper -> wrapper
|
||||
.like(MachineDO::getMachineName, keyWord)
|
||||
.or()
|
||||
.like(MachineDO::getMachineCd, keyWord)));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.dal.mysql.machineparamdetail;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.ningxia.yunxi.chemmes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
@ -7,6 +8,8 @@ import com.ningxia.yunxi.chemmes.module.biz.controller.admin.machineparamdetail.
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.machineparamdetail.MachineParamDetailDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 机台工艺参数配置子 Mapper
|
||||
*
|
||||
@ -32,4 +35,15 @@ public interface MachineParamDetailMapper extends BaseMapperX<MachineParamDetail
|
||||
.orderByDesc(MachineParamDetailDO::getId));
|
||||
}
|
||||
|
||||
default void deleteByMachineParamId(Integer machineParamId) {
|
||||
delete(new LambdaQueryWrapper<MachineParamDetailDO>()
|
||||
.eq(MachineParamDetailDO::getMachineParamId, machineParamId));
|
||||
}
|
||||
|
||||
default List<MachineParamDetailDO> selectListByMachineParamId(Integer machineParamId) {
|
||||
return selectList(new LambdaQueryWrapperX<MachineParamDetailDO>()
|
||||
.eq(MachineParamDetailDO::getMachineParamId, machineParamId)
|
||||
.orderByAsc(MachineParamDetailDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -7,6 +7,8 @@ import com.ningxia.yunxi.chemmes.module.biz.controller.admin.material.vo.Materia
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.material.MaterialDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 物料主数据 Mapper
|
||||
*
|
||||
@ -24,4 +26,15 @@ public interface MaterialMapper extends BaseMapperX<MaterialDO> {
|
||||
.orderByDesc(MaterialDO::getId));
|
||||
}
|
||||
|
||||
default List<MaterialDO> selectMaterialDropdown(String keyWord) {
|
||||
return selectList(new LambdaQueryWrapperX<MaterialDO>()
|
||||
.eq(MaterialDO::getEnabledStatus, 0)
|
||||
.and(
|
||||
wrapper -> wrapper
|
||||
.like(MaterialDO::getMatCode, keyWord)
|
||||
.or()
|
||||
.like(MaterialDO::getMatName, keyWord)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,13 +1,14 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.dal.mysql.procparam;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.ningxia.yunxi.chemmes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.ningxia.yunxi.chemmes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.procparam.vo.ProcParamPageReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.procparam.ProcParamDO;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.procparam.vo.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 工序工艺参数配置 Mapper
|
||||
@ -25,4 +26,14 @@ public interface ProcParamMapper extends BaseMapperX<ProcParamDO> {
|
||||
.orderByDesc(ProcParamDO::getId));
|
||||
}
|
||||
|
||||
default List<ProcParamDO> selectList(String keyWord, Integer procId) {
|
||||
return selectList(new LambdaQueryWrapperX<ProcParamDO>()
|
||||
.eqIfPresent(ProcParamDO::getEnabledStatus, 0)
|
||||
.eqIfPresent(ProcParamDO::getProcId, procId)
|
||||
.and(StringUtils.isNotBlank(keyWord), wrapper -> wrapper
|
||||
.like(ProcParamDO::getProcName, keyWord)
|
||||
.or()
|
||||
.like(ProcParamDO::getProcCd, keyWord))
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -53,5 +53,5 @@ public interface MachineService {
|
||||
*/
|
||||
PageResult<MachineDO> getMachinePage(MachinePageReqVO pageReqVO);
|
||||
|
||||
List<MachineDO> getMachineDropdown(String keyWord);
|
||||
List<MachineDO> getMachineDropdown(String keyWord, Integer procId);
|
||||
}
|
||||
|
||||
@ -28,12 +28,9 @@ public class MachineServiceImpl implements MachineService {
|
||||
|
||||
@Override
|
||||
public Integer createMachine(MachineSaveReqVO createReqVO) {
|
||||
// 校验存在
|
||||
validateMachineUnique(createReqVO);
|
||||
// 插入
|
||||
MachineDO machine = BeanUtils.toBean(createReqVO, MachineDO.class);
|
||||
machineMapper.insert(machine);
|
||||
// 返回
|
||||
return machine.getId();
|
||||
}
|
||||
|
||||
@ -82,7 +79,7 @@ public class MachineServiceImpl implements MachineService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MachineDO> getMachineDropdown(String keyWord) {
|
||||
return machineMapper.seleLectListByKeyWord(keyWord);
|
||||
public List<MachineDO> getMachineDropdown(String keyWord, Integer procId) {
|
||||
return machineMapper.seleLectListByKeyWord(keyWord,procId);
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,7 +6,9 @@ import com.ningxia.yunxi.chemmes.module.biz.controller.admin.machineparam.vo.Mac
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.machineparam.vo.MachineParamSaveReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.machineparam.MachineParamDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.mysql.machineparam.MachineParamMapper;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.service.machineparamdetail.MachineParamDetailService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@ -23,11 +25,17 @@ public class MachineParamServiceImpl implements MachineParamService {
|
||||
@Resource
|
||||
private MachineParamMapper machineParamMapper;
|
||||
|
||||
@Resource
|
||||
private MachineParamDetailService machineParamDetailService;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Integer createMachineParam(MachineParamSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
MachineParamDO machineParam = BeanUtils.toBean(createReqVO, MachineParamDO.class);
|
||||
machineParamMapper.insert(machineParam);
|
||||
machineParamDetailService.saveMachineParamDetails(machineParam.getId(), createReqVO.getDetails());
|
||||
|
||||
// 返回
|
||||
return machineParam.getId();
|
||||
}
|
||||
@ -39,6 +47,7 @@ public class MachineParamServiceImpl implements MachineParamService {
|
||||
// 更新
|
||||
MachineParamDO updateObj = BeanUtils.toBean(updateReqVO, MachineParamDO.class);
|
||||
machineParamMapper.updateById(updateObj);
|
||||
machineParamDetailService.saveMachineParamDetails(updateObj.getId(), updateReqVO.getDetails());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -6,6 +6,7 @@ import com.ningxia.yunxi.chemmes.module.biz.controller.admin.machineparamdetail.
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.machineparamdetail.MachineParamDetailDO;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 机台工艺参数配置子 Service 接口
|
||||
@ -52,4 +53,7 @@ public interface MachineParamDetailService {
|
||||
*/
|
||||
PageResult<MachineParamDetailDO> getMachineParamDetailPage(MachineParamDetailPageReqVO pageReqVO);
|
||||
|
||||
void saveMachineParamDetails(Integer id, List<MachineParamDetailSaveReqVO> details);
|
||||
|
||||
List<MachineParamDetailDO> getListByMachineParamId(Integer id);
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.service.machineparamdetail;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.util.object.BeanUtils;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.machineparamdetail.vo.MachineParamDetailPageReqVO;
|
||||
@ -10,6 +11,8 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 机台工艺参数配置子 Service 实现类
|
||||
@ -34,8 +37,6 @@ public class MachineParamDetailServiceImpl implements MachineParamDetailService
|
||||
|
||||
@Override
|
||||
public void updateMachineParamDetail(MachineParamDetailSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateMachineParamDetailExists(updateReqVO.getId());
|
||||
// 更新
|
||||
MachineParamDetailDO updateObj = BeanUtils.toBean(updateReqVO, MachineParamDetailDO.class);
|
||||
machineParamDetailMapper.updateById(updateObj);
|
||||
@ -43,17 +44,10 @@ public class MachineParamDetailServiceImpl implements MachineParamDetailService
|
||||
|
||||
@Override
|
||||
public void deleteMachineParamDetail(Integer id) {
|
||||
// 校验存在
|
||||
validateMachineParamDetailExists(id);
|
||||
// 删除
|
||||
machineParamDetailMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateMachineParamDetailExists(Integer id) {
|
||||
if (machineParamDetailMapper.selectById(id) == null) {
|
||||
// throw exception(MACHINE_PARAM_DETAIL_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public MachineParamDetailDO getMachineParamDetail(Integer id) {
|
||||
@ -65,4 +59,27 @@ public class MachineParamDetailServiceImpl implements MachineParamDetailService
|
||||
return machineParamDetailMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveMachineParamDetails(Integer machineParamId, List<MachineParamDetailSaveReqVO> detailList) {
|
||||
if (ObjectUtil.isEmpty(detailList)) {
|
||||
return;
|
||||
}
|
||||
machineParamDetailMapper.deleteByMachineParamId(machineParamId);
|
||||
List<MachineParamDetailDO> detailEntities = detailList.stream()
|
||||
.map(detail -> {
|
||||
MachineParamDetailDO detailEntity = BeanUtils.toBean(detail, MachineParamDetailDO.class);
|
||||
detailEntity.setMachineParamId(machineParamId);
|
||||
detailEntity.setEnabledStatus(0);
|
||||
return detailEntity;
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
|
||||
machineParamDetailMapper.insertBatch(detailEntities);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MachineParamDetailDO> getListByMachineParamId(Integer machineParamId) {
|
||||
return machineParamDetailMapper.selectListByMachineParamId(machineParamId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.service.material;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.material.vo.*;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.material.MaterialDO;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.material.vo.MaterialPageReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.material.vo.MaterialSaveReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.material.MaterialDO;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 物料主数据 Service 接口
|
||||
@ -52,4 +53,5 @@ public interface MaterialService {
|
||||
*/
|
||||
PageResult<MaterialDO> getMaterialPage(MaterialPageReqVO pageReqVO);
|
||||
|
||||
List<MaterialDO> getMaterialDropdown(String keyWord);
|
||||
}
|
||||
@ -3,6 +3,7 @@ package com.ningxia.yunxi.chemmes.module.biz.service.material;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.util.object.BeanUtils;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.material.vo.MaterialPageReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.material.vo.MaterialRespVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.material.vo.MaterialSaveReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.material.MaterialDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.mysql.material.MaterialMapper;
|
||||
@ -10,6 +11,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 物料主数据 Service 实现类
|
||||
@ -65,4 +67,8 @@ public class MaterialServiceImpl implements MaterialService {
|
||||
return materialMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MaterialDO> getMaterialDropdown(String keyWord) {
|
||||
return materialMapper.selectMaterialDropdown(keyWord);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.service.procparam;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.procparam.vo.*;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.procparam.ProcParamDO;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.procparam.vo.ProcParamPageReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.procparam.vo.ProcParamSaveReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.procparam.ProcParamDO;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 工序工艺参数配置 Service 接口
|
||||
@ -52,4 +53,5 @@ public interface ProcParamService {
|
||||
*/
|
||||
PageResult<ProcParamDO> getProcParamPage(ProcParamPageReqVO pageReqVO);
|
||||
|
||||
List<ProcParamDO> getProcParamDropdown(String keyWord, Integer procId);
|
||||
}
|
||||
@ -10,6 +10,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 工序工艺参数配置 Service 实现类
|
||||
@ -65,4 +66,8 @@ public class ProcParamServiceImpl implements ProcParamService {
|
||||
return procParamMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ProcParamDO> getProcParamDropdown(String keyWord, Integer procId) {
|
||||
return procParamMapper.selectList(keyWord, procId);
|
||||
}
|
||||
}
|
||||
|
||||
@ -44,3 +44,8 @@ export const deleteMaterial = async (id: number) => {
|
||||
export const exportMaterial = async (params) => {
|
||||
return await request.download({ url: `/biz/material/export-excel`, params })
|
||||
}
|
||||
|
||||
// 获取物料下拉列表
|
||||
export const getMaterialDropdown = async (params) => {
|
||||
return await request.get({ url: `/biz/material/dropdown`, params })
|
||||
}
|
||||
|
||||
@ -41,3 +41,8 @@ export const deleteProcParam = async (id: number) => {
|
||||
export const exportProcParam = async (params) => {
|
||||
return await request.download({ url: `/biz/proc-param/export-excel`, params })
|
||||
}
|
||||
|
||||
// 获取工序工艺参数下拉列表
|
||||
export const getProcParamDropdown = async (params) => {
|
||||
return await request.get({ url: `/biz/proc-param/dropdown`, params })
|
||||
}
|
||||
@ -68,43 +68,43 @@
|
||||
<!-- 列表 -->
|
||||
<ContentWrap>
|
||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||
<el-table-column label="序号" align="center" type="index" width="60px" />
|
||||
<el-table-column label="序号" align="center" type="index" width="80px" />
|
||||
<el-table-column label="客户编码" align="center" prop="custNo" />
|
||||
<el-table-column label="客户全称" align="center" prop="custName" />
|
||||
<el-table-column label="客户简称" align="center" prop="custSimName" />
|
||||
<el-table-column label="所属行业" align="center" prop="industryClass">
|
||||
<el-table-column label="客户全称" align="center" prop="custName" width="350px" />
|
||||
<el-table-column label="客户简称" align="center" prop="custSimName" width="200px" />
|
||||
<el-table-column label="所属行业" align="center" prop="industryClass" width="120px">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.INDUSTRY_CLASS" :value="scope.row.industryClass" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="合作状态" align="center" prop="coopStatus">
|
||||
<el-table-column label="合作状态" align="center" prop="coopStatus" width="120px">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.COOP_STATUS" :value="scope.row.coopStatus" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="企业性质" align="center" prop="enterpriseType">
|
||||
<el-table-column label="企业性质" align="center" prop="enterpriseType" width="120px">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.ENTERPRISE_TYPE" :value="scope.row.enterpriseType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="客户等级" align="center" prop="custReg">
|
||||
<el-table-column label="客户等级" align="center" prop="custReg" width="100px">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.CUSTOMER_LEVER" :value="scope.row.custReg" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="信用等级" align="center" prop="creditRate">
|
||||
<el-table-column label="信用等级" align="center" prop="creditRate" width="100px">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.CREDIT_RATE" :value="scope.row.creditRate" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="联系人1" align="center" prop="contact1" />
|
||||
<el-table-column label="联系电话1" align="center" prop="conPhone1" />
|
||||
<el-table-column label="状态" align="center" prop="enabledStatus">
|
||||
<el-table-column label="状态" align="center" prop="enabledStatus" width="100px">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.SYSTEM_STATUS" :value="scope.row.enabledStatus" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center">
|
||||
<el-table-column label="操作" align="center" width="200px">
|
||||
<template #default="scope">
|
||||
|
||||
<el-button
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<Dialog :title="dialogTitle" v-model="dialogVisible">
|
||||
<Dialog :title="dialogTitle" v-model="dialogVisible" width="1200px">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
@ -7,86 +7,280 @@
|
||||
label-width="100px"
|
||||
v-loading="formLoading"
|
||||
>
|
||||
<el-form-item label="工序编码" prop="procCd">
|
||||
<el-input v-model="formData.procCd" placeholder="请输入工序编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态(1启用 2 未启用)" prop="enabledStatus">
|
||||
<el-radio-group v-model="formData.enabledStatus">
|
||||
<el-radio
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.SYSTEM_STATUS)"
|
||||
:key="dict.value"
|
||||
:label="dict.value"
|
||||
>
|
||||
{{ dict.label }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="formData.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
<el-form-item label="工序id" prop="procId">
|
||||
<el-input v-model="formData.procId" placeholder="请输入工序id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="工序名称" prop="procName">
|
||||
<el-input v-model="formData.procName" placeholder="请输入工序名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料编码" prop="matCode">
|
||||
<el-input v-model="formData.matCode" placeholder="请输入物料编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料名称" prop="matName">
|
||||
<el-input v-model="formData.matName" placeholder="请输入物料名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料id" prop="mateId">
|
||||
<el-input v-model="formData.mateId" placeholder="请输入物料id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="规格型号" prop="spec">
|
||||
<el-input v-model="formData.spec" placeholder="请输入规格型号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="机台编码" prop="machineCd">
|
||||
<el-input v-model="formData.machineCd" placeholder="请输入机台编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="机台名称" prop="machineName">
|
||||
<el-input v-model="formData.machineName" placeholder="请输入机台名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="机台id" prop="machineId">
|
||||
<el-input v-model="formData.machineId" placeholder="请输入机台id" />
|
||||
</el-form-item>
|
||||
<!-- 基本信息区域 -->
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="工序" prop="procId" >
|
||||
<el-select v-model="formData.procId" placeholder="请选择工序" @change="handleProcChange" :disabled="formType === 'update'" filterable>
|
||||
<el-option
|
||||
v-for="item in procOptions"
|
||||
:key="item.id"
|
||||
:label="item.procName"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="机台" prop="machineId" >
|
||||
<el-select v-model="formData.machineId" placeholder="请选择机台" @change="handleMachineChange" filterable :disabled="formType === 'update'">
|
||||
<el-option
|
||||
v-for="item in machineOptions"
|
||||
:key="item.id"
|
||||
:label="item.machineName"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="启用状态" prop="enabledStatus" >
|
||||
<el-select v-model="formData.enabledStatus" placeholder="请选择状态">
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.SYSTEM_STATUS)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="产品名称" prop="mateId" >
|
||||
<el-select v-model="formData.mateId" placeholder="请选择物料" @change="handleMaterialChange" filterable :disabled="formType === 'update'">
|
||||
<el-option
|
||||
v-for="item in materialOptions"
|
||||
:key="item.id"
|
||||
:label="item.matName"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="规格型号" prop="spec" >
|
||||
<el-input v-model="formData.spec" placeholder="请输入规格型号" :disabled="formType === 'update'"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" />
|
||||
</el-row>
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="16">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="formData.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
|
||||
<!-- 工艺参数信息区域 -->
|
||||
<div class="param-info-section">
|
||||
<div class="section-header">
|
||||
<span class="section-title">工艺参数信息</span>
|
||||
<el-button type="primary" size="small" @click="addParamRow">新增</el-button>
|
||||
</div>
|
||||
|
||||
<el-table
|
||||
:data="paramDetailList"
|
||||
border
|
||||
size="small"
|
||||
max-height="250"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="60" />
|
||||
<el-table-column prop="procParamName" label="工艺参数名称(*)" width="140">
|
||||
<template #default="scope">
|
||||
<el-select
|
||||
v-model="scope.row.procParamId"
|
||||
placeholder="选择参数"
|
||||
size="small"
|
||||
filterable
|
||||
@change="(val) => handleProcParamChange(val, scope.row)"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in procParamOptions"
|
||||
:key="item.id"
|
||||
:label="item.procParamName"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="standardValue" label="标准值(*)" >
|
||||
<template #default="scope">
|
||||
<el-input v-model.number="scope.row.standardValue" placeholder="标准值" size="small" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="lowerLimit" label="下限(*)" >
|
||||
<template #default="scope">
|
||||
<el-input v-model.number="scope.row.lowerLimit" placeholder="下限" size="small" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="upperLimit" label="上限(*)">
|
||||
<template #default="scope">
|
||||
<el-input v-model.number="scope.row.upperLimit" placeholder="上限" size="small" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="dev" label="偏差">
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.dev" placeholder="偏差" size="small" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="procParamUnit" label="单位(*)">
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.procParamUnit" placeholder="单位" size="small" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="isAlert" label="预警(*)">
|
||||
<template #default="scope">
|
||||
<el-select v-model="scope.row.isAlert" placeholder="选择" size="small">
|
||||
<el-option label="是" value="0" />
|
||||
<el-option label="否" value="1" />
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注">
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.remark" placeholder="备注" size="small" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="60">
|
||||
<template #default="scope">
|
||||
<el-button type="text" size="small" @click="removeParamRow(scope.$index)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</el-form>
|
||||
|
||||
<template #footer>
|
||||
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<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 { ref, reactive, onMounted } from 'vue'
|
||||
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||
import * as MachineParamApi from '@/api/biz/machineparam'
|
||||
import * as ProcApi from '@/api/biz/proc'
|
||||
import * as MachineApi from '@/api/biz/machine'
|
||||
import * as MaterialApi from '@/api/biz/material'
|
||||
import * as ProcParamApi from '@/api/biz/procparam'
|
||||
import type { ProcVO } from '@/api/biz/proc'
|
||||
import type { MachineVO } from '@/api/biz/machine'
|
||||
import type { MaterialVO } from '@/api/biz/material'
|
||||
import type { ProcParamVO } from '@/api/biz/procparam'
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
// 表单类型定义
|
||||
interface ParamDetail {
|
||||
id?: number
|
||||
procParamName: string
|
||||
procParamUnit: string
|
||||
procParamId?: number
|
||||
standardValue: number
|
||||
upperLimit: number
|
||||
lowerLimit: number
|
||||
dev: string
|
||||
isAlert: string
|
||||
remark: string
|
||||
}
|
||||
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||
const formData = ref({
|
||||
id: undefined,
|
||||
procCd: undefined,
|
||||
enabledStatus: undefined,
|
||||
remark: undefined,
|
||||
procId: undefined,
|
||||
procName: undefined,
|
||||
matCode: undefined,
|
||||
matName: undefined,
|
||||
mateId: undefined,
|
||||
spec: undefined,
|
||||
machineCd: undefined,
|
||||
machineName: undefined,
|
||||
machineId: undefined,
|
||||
const { t } = useI18n()
|
||||
const message = useMessage()
|
||||
|
||||
// 弹窗状态
|
||||
const dialogVisible = ref(false)
|
||||
const dialogTitle = ref('')
|
||||
const formLoading = ref(false)
|
||||
const formType = ref('')
|
||||
|
||||
// 下拉选项
|
||||
const procOptions = ref<ProcVO[]>([])
|
||||
const machineOptions = ref<MachineVO[]>([])
|
||||
const materialOptions = ref<MaterialVO[]>([])
|
||||
const procParamOptions = ref<ProcParamVO[]>([])
|
||||
|
||||
// 主表单数据
|
||||
const formData = reactive({
|
||||
id: undefined as number | undefined,
|
||||
procId: undefined as number | undefined,
|
||||
procCd: '',
|
||||
procName: '',
|
||||
machineId: undefined as number | undefined,
|
||||
machineCd: '',
|
||||
machineName: '',
|
||||
mateId: undefined as number | undefined,
|
||||
matCode: '',
|
||||
matName: '',
|
||||
spec: '',
|
||||
enabledStatus: 0,
|
||||
remark: ''
|
||||
})
|
||||
|
||||
// 工艺参数详情列表
|
||||
const paramDetailList = ref<ParamDetail[]>([])
|
||||
|
||||
// 表单验证规则
|
||||
const formRules = reactive({
|
||||
procId: [{ required: true, message: '请选择工序', trigger: 'change' }],
|
||||
machineId: [{ required: true, message: '请选择机台', trigger: 'change' }],
|
||||
mateId: [{ required: true, message: '请选择产品名称', trigger: 'change' }],
|
||||
enabledStatus: [{ required: true, message: '请选择启用状态', trigger: 'change' }]
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
const formRef = ref()
|
||||
|
||||
/** 初始化下拉选项 */
|
||||
const initOptions = async () => {
|
||||
try {
|
||||
procOptions.value = await ProcApi.getProcDropdown({})
|
||||
// 机台下拉选项根据工序动态加载,初始化为空
|
||||
machineOptions.value = []
|
||||
// 使用物料下拉接口查询
|
||||
materialOptions.value = await MaterialApi.getMaterialDropdown({})
|
||||
// 工艺参数根据工序动态加载,初始化为空
|
||||
procParamOptions.value = []
|
||||
} catch (error) {
|
||||
console.error('初始化下拉选项失败:', error)
|
||||
}
|
||||
}
|
||||
|
||||
/** 根据工序加载机台下拉选项 */
|
||||
const loadMachineOptions = async (procId: number | undefined) => {
|
||||
// 保存当前选中的机台ID
|
||||
const currentMachineId = formData.machineId
|
||||
if (!procId) {
|
||||
machineOptions.value = []
|
||||
return
|
||||
}
|
||||
try {
|
||||
machineOptions.value = await MachineApi.getMachineDropdown({ procId })
|
||||
} catch (error) {
|
||||
console.error('加载机台下拉选项失败:', error)
|
||||
machineOptions.value = []
|
||||
}
|
||||
}
|
||||
|
||||
/** 加载工艺参数下拉选项 */
|
||||
const loadProcParamOptions = async (procId: number | undefined) => {
|
||||
if (!procId) {
|
||||
procParamOptions.value = []
|
||||
return
|
||||
}
|
||||
try {
|
||||
const result = await ProcParamApi.getProcParamDropdown({ procId })
|
||||
procParamOptions.value = result
|
||||
} catch (error) {
|
||||
console.error('加载工艺参数下拉选项失败:', error)
|
||||
procParamOptions.value = []
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/** 打开弹窗 */
|
||||
const open = async (type: string, id?: number) => {
|
||||
@ -94,27 +288,177 @@ const open = async (type: string, id?: number) => {
|
||||
dialogTitle.value = t('action.' + type)
|
||||
formType.value = type
|
||||
resetForm()
|
||||
// 修改时,设置数据
|
||||
|
||||
// 修改时,加载数据
|
||||
if (id) {
|
||||
formLoading.value = true
|
||||
try {
|
||||
formData.value = await MachineParamApi.getMachineParam(id)
|
||||
const data = await MachineParamApi.getMachineParam(id)
|
||||
Object.assign(formData, data)
|
||||
|
||||
// 加载机台下拉选项
|
||||
await loadMachineOptions(formData.procId)
|
||||
// 加载工艺参数下拉选项
|
||||
await loadProcParamOptions(formData.procId)
|
||||
|
||||
// 加载子表数据(需要后端提供根据主表id查询子表的接口)
|
||||
// 回显工艺参数详情列表
|
||||
if (data.details && Array.isArray(data.details)) {
|
||||
paramDetailList.value = data.details.map(item => ({
|
||||
id: item.id,
|
||||
procParamId: item.procParamId,
|
||||
procParamName: item.procParamName,
|
||||
procParamUnit: item.procParamUnit,
|
||||
standardValue: item.standardValue,
|
||||
upperLimit: item.upperLimit,
|
||||
lowerLimit: item.lowerLimit,
|
||||
dev: item.dev,
|
||||
isAlert: item.isAlert,
|
||||
remark: item.remark
|
||||
}))
|
||||
}
|
||||
// 这里假设已有查询子表列表的逻辑
|
||||
// paramDetailList.value = await loadParamDetailList(id)
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
defineExpose({ open })
|
||||
|
||||
/** 添加工艺参数行 */
|
||||
const addParamRow = () => {
|
||||
// 检查是否已选择工序
|
||||
if (!formData.procId) {
|
||||
message.warning('请先选择工序')
|
||||
return
|
||||
}
|
||||
paramDetailList.value.push({
|
||||
procParamName: '',
|
||||
procParamUnit: '',
|
||||
standardValue: 0,
|
||||
upperLimit: 0,
|
||||
lowerLimit: 0,
|
||||
dev: '',
|
||||
isAlert: '1',
|
||||
remark: ''
|
||||
})
|
||||
}
|
||||
|
||||
/** 删除工艺参数行 */
|
||||
const removeParamRow = (index: number) => {
|
||||
paramDetailList.value.splice(index, 1)
|
||||
}
|
||||
|
||||
/** 工序选择变化 */
|
||||
const handleProcChange = (val: number) => {
|
||||
const proc = procOptions.value.find(p => p.id === val)
|
||||
if (proc) {
|
||||
formData.procCd = proc.procCd
|
||||
formData.procName = proc.procName
|
||||
}
|
||||
// 根据工序加载机台下拉选项
|
||||
loadMachineOptions(val)
|
||||
loadProcParamOptions(val)
|
||||
}
|
||||
|
||||
/** 机台选择变化 */
|
||||
const handleMachineChange = (val: number) => {
|
||||
const machine = machineOptions.value.find(m => m.id === val)
|
||||
if (machine) {
|
||||
formData.machineCd = machine.machineCd
|
||||
formData.machineName = machine.machineName
|
||||
}
|
||||
}
|
||||
|
||||
/** 物料选择变化 */
|
||||
const handleMaterialChange = (val: number) => {
|
||||
const material = materialOptions.value.find(m => m.id === val)
|
||||
if (material) {
|
||||
formData.matCode = material.matCode
|
||||
formData.matName = material.matName
|
||||
formData.spec = material.spec || ''
|
||||
}
|
||||
}
|
||||
|
||||
/** 工艺参数选择变化 */
|
||||
const handleProcParamChange = (val: number, row: ParamDetail) => {
|
||||
// 检查是否已被其他行选中
|
||||
const isDuplicate = paramDetailList.value.some(
|
||||
item => item !== row && item.procParamId === val
|
||||
)
|
||||
|
||||
if (isDuplicate) {
|
||||
message.warning('该工艺参数已被选择,请选择其他参数')
|
||||
row.procParamId = undefined
|
||||
row.procParamName = ''
|
||||
row.procParamUnit = ''
|
||||
return
|
||||
}
|
||||
|
||||
const procParam = procParamOptions.value.find(p => p.id === val)
|
||||
if (procParam) {
|
||||
row.procParamId = procParam.id
|
||||
row.procParamName = procParam.procParamName
|
||||
row.procParamUnit = procParam.procParamUnit || ''
|
||||
}
|
||||
}
|
||||
|
||||
/** 提交表单 */
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||
const emit = defineEmits(['success'])
|
||||
const submitForm = async () => {
|
||||
// 校验表单
|
||||
// 表单校验
|
||||
await formRef.value.validate()
|
||||
|
||||
// 校验工艺参数列表
|
||||
if (paramDetailList.value.length === 0) {
|
||||
message.warning('请至少添加一条工艺参数')
|
||||
return
|
||||
}
|
||||
|
||||
for (const param of paramDetailList.value) {
|
||||
if (!param.procParamId) {
|
||||
message.warning('请选择工艺参数')
|
||||
return
|
||||
}
|
||||
if (param.standardValue === undefined || param.standardValue === null) {
|
||||
message.warning('请填写标准值')
|
||||
return
|
||||
}
|
||||
if (param.lowerLimit === undefined || param.lowerLimit === null) {
|
||||
message.warning('请填写下限值')
|
||||
return
|
||||
}
|
||||
if (param.upperLimit === undefined || param.upperLimit === null) {
|
||||
message.warning('请填写上限值')
|
||||
return
|
||||
}
|
||||
if (!param.procParamUnit) {
|
||||
message.warning('请填写单位')
|
||||
return
|
||||
}
|
||||
if (!param.isAlert) {
|
||||
message.warning('请选择是否预警')
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// 检查是否有重复的参数名称
|
||||
const paramIds = paramDetailList.value.map(item => item.procParamId).filter(id => id)
|
||||
const uniqueIds = [...new Set(paramIds)]
|
||||
if (paramIds.length !== uniqueIds.length) {
|
||||
message.warning('存在重复选择的工艺参数,请确保每个参数只选择一次')
|
||||
return
|
||||
}
|
||||
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
const data = formData.value as unknown as MachineParamApi.MachineParamVO
|
||||
const data = {
|
||||
...formData,
|
||||
details: paramDetailList.value
|
||||
}
|
||||
|
||||
if (formType.value === 'create') {
|
||||
await MachineParamApi.createMachineParam(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
@ -122,8 +466,8 @@ const submitForm = async () => {
|
||||
await MachineParamApi.updateMachineParam(data)
|
||||
message.success(t('common.updateSuccess'))
|
||||
}
|
||||
|
||||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
@ -132,21 +476,50 @@ const submitForm = async () => {
|
||||
|
||||
/** 重置表单 */
|
||||
const resetForm = () => {
|
||||
formData.value = {
|
||||
id: undefined,
|
||||
procCd: undefined,
|
||||
enabledStatus: undefined,
|
||||
remark: undefined,
|
||||
procId: undefined,
|
||||
procName: undefined,
|
||||
matCode: undefined,
|
||||
matName: undefined,
|
||||
mateId: undefined,
|
||||
spec: undefined,
|
||||
machineCd: undefined,
|
||||
machineName: undefined,
|
||||
machineId: undefined,
|
||||
}
|
||||
formData.id = undefined
|
||||
formData.procId = undefined
|
||||
formData.procCd = ''
|
||||
formData.procName = ''
|
||||
formData.machineId = undefined
|
||||
formData.machineCd = ''
|
||||
formData.machineName = ''
|
||||
formData.mateId = undefined
|
||||
formData.matCode = ''
|
||||
formData.matName = ''
|
||||
formData.spec = ''
|
||||
formData.enabledStatus = 0
|
||||
formData.remark = ''
|
||||
|
||||
paramDetailList.value = []
|
||||
machineOptions.value = []
|
||||
procParamOptions.value = []
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
|
||||
/** 组件挂载时初始化下拉选项 */
|
||||
onMounted(() => {
|
||||
initOptions()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.param-info-section {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.section-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 12px;
|
||||
|
||||
.section-title {
|
||||
font-weight: 600;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
|
||||
.el-table {
|
||||
--el-table-row-hover-bg-color: #fafafa;
|
||||
}
|
||||
</style>
|
||||
@ -6,12 +6,12 @@
|
||||
:model="queryParams"
|
||||
ref="queryFormRef"
|
||||
:inline="true"
|
||||
label-width="68px"
|
||||
label-width="80px"
|
||||
>
|
||||
<el-form-item label="状态(1启用 2 未启用)" prop="enabledStatus">
|
||||
<el-form-item label="状态" prop="enabledStatus">
|
||||
<el-select
|
||||
v-model="queryParams.enabledStatus"
|
||||
placeholder="请选择状态(1启用 2 未启用)"
|
||||
placeholder="请选择状态"
|
||||
clearable
|
||||
class="!w-240px"
|
||||
>
|
||||
@ -52,15 +52,6 @@
|
||||
>
|
||||
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||
</el-button>
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
@click="handleExport"
|
||||
:loading="exportLoading"
|
||||
v-hasPermi="['biz:machine-param:export']"
|
||||
>
|
||||
<Icon icon="ep:download" class="mr-5px" /> 导出
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ContentWrap>
|
||||
@ -68,30 +59,25 @@
|
||||
<!-- 列表 -->
|
||||
<ContentWrap>
|
||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||
<el-table-column label="自增字段" align="center" prop="id" />
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
align="center"
|
||||
prop="createTime"
|
||||
:formatter="dateFormatter"
|
||||
width="180px"
|
||||
/>
|
||||
<el-table-column label="工序编码" align="center" prop="procCd" />
|
||||
<el-table-column label="状态(1启用 2 未启用)" align="center" prop="enabledStatus">
|
||||
<el-table-column label="序号" align="center" type="index" width="60px"/>
|
||||
<el-table-column label="机台名称" align="center" prop="machineName" />
|
||||
<el-table-column label="产品名称" align="center" prop="matName" />
|
||||
<el-table-column label="规格型号" align="center" prop="spec" />
|
||||
<el-table-column label="所属工序" align="center" prop="procName" />
|
||||
<el-table-column label="状态" align="center" prop="enabledStatus">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.SYSTEM_STATUS" :value="scope.row.enabledStatus" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="工序id" align="center" prop="procId" />
|
||||
<el-table-column label="工序名称" align="center" prop="procName" />
|
||||
<el-table-column label="物料编码" align="center" prop="matCode" />
|
||||
<el-table-column label="物料名称" align="center" prop="matName" />
|
||||
<el-table-column label="物料id" align="center" prop="mateId" />
|
||||
<el-table-column label="规格型号" align="center" prop="spec" />
|
||||
<el-table-column label="机台编码" align="center" prop="machineCd" />
|
||||
<el-table-column label="机台名称" align="center" prop="machineName" />
|
||||
<el-table-column label="机台id" align="center" prop="machineId" />
|
||||
<el-table-column label="创建人" align="center" prop="creator" />
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
align="center"
|
||||
prop="createTime"
|
||||
:formatter="dateFormatter2"
|
||||
width="180px"
|
||||
/>
|
||||
<el-table-column label="操作" align="center">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
@ -128,7 +114,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import { dateFormatter2 } from '@/utils/formatTime'
|
||||
import download from '@/utils/download'
|
||||
import * as MachineParamApi from '@/api/biz/machineparam'
|
||||
import MachineParamForm from './MachineParamForm.vue'
|
||||
|
||||
@ -134,7 +134,7 @@ const formRules = reactive({
|
||||
matCode: [{ required: true, message: '请输入物料编码', trigger: ['blur'] }],
|
||||
matName: [{ required: true, message: '请输入物料名称', trigger: ['blur'] }],
|
||||
unit: [{ required: true, message: '请输入单位', trigger: ['blur'] }],
|
||||
schemeId: [{ required: true, message: '请输入质检方案', trigger: ['blur'] }],
|
||||
// schemeId: [{ required: true, message: '请输入质检方案', trigger: ['blur'] }],
|
||||
enabledStatus: [{ required: true, message: '请选择状态', trigger: ['blur'] }],
|
||||
safeStock: [
|
||||
{ type: 'number', min: 0, message: '安全库存不能为负数', trigger: ['blur', 'change'] },
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
<el-form-item label="工序名称" prop="procName">
|
||||
<el-input v-model="formData.procName" placeholder="请输入工序名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态(1启用 2 未启用)" prop="enabledStatus">
|
||||
<el-form-item label="状态" prop="enabledStatus">
|
||||
<el-radio-group v-model="formData.enabledStatus">
|
||||
<el-radio
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.SYSTEM_STATUS)"
|
||||
@ -36,8 +36,8 @@
|
||||
<el-form-item label="参数单位" prop="procParamUnit">
|
||||
<el-input v-model="formData.procParamUnit" placeholder="请输入参数单位" />
|
||||
</el-form-item>
|
||||
<el-form-item label="参数类别(1 温度 2压力 3 时间 4速度)" prop="procParamType">
|
||||
<el-select v-model="formData.procParamType" placeholder="请选择参数类别(1 温度 2压力 3 时间 4速度)">
|
||||
<el-form-item label="参数类别" prop="procParamType">
|
||||
<el-select v-model="formData.procParamType" placeholder="请选择参数类别">
|
||||
<el-option
|
||||
v-for="dict in getStrDictOptions(DICT_TYPE.PARAM_TYPE)"
|
||||
:key="dict.value"
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
:model="queryParams"
|
||||
ref="queryFormRef"
|
||||
:inline="true"
|
||||
label-width="68px"
|
||||
label-width="80px"
|
||||
>
|
||||
<el-form-item label="工序名称" prop="procName">
|
||||
<el-input
|
||||
@ -17,10 +17,10 @@
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态(1启用 2 未启用)" prop="enabledStatus">
|
||||
<el-form-item label="状态" prop="enabledStatus">
|
||||
<el-select
|
||||
v-model="queryParams.enabledStatus"
|
||||
placeholder="请选择状态(1启用 2 未启用)"
|
||||
placeholder="请选择状态"
|
||||
clearable
|
||||
class="!w-240px"
|
||||
>
|
||||
@ -32,10 +32,10 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="参数类别(1 温度 2压力 3 时间 4速度)" prop="procParamType">
|
||||
<el-form-item label="参数类别" prop="procParamType">
|
||||
<el-select
|
||||
v-model="queryParams.procParamType"
|
||||
placeholder="请选择参数类别(1 温度 2压力 3 时间 4速度)"
|
||||
placeholder="请选择参数类别"
|
||||
clearable
|
||||
class="!w-240px"
|
||||
>
|
||||
@ -58,15 +58,6 @@
|
||||
>
|
||||
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||
</el-button>
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
@click="handleExport"
|
||||
:loading="exportLoading"
|
||||
v-hasPermi="['biz:proc-param:export']"
|
||||
>
|
||||
<Icon icon="ep:download" class="mr-5px" /> 导出
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ContentWrap>
|
||||
@ -84,7 +75,7 @@
|
||||
/>
|
||||
<el-table-column label="工序编码" align="center" prop="procCd" />
|
||||
<el-table-column label="工序名称" align="center" prop="procName" />
|
||||
<el-table-column label="状态(1启用 2 未启用)" align="center" prop="enabledStatus">
|
||||
<el-table-column label="状态" align="center" prop="enabledStatus">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.SYSTEM_STATUS" :value="scope.row.enabledStatus" />
|
||||
</template>
|
||||
@ -93,7 +84,7 @@
|
||||
<el-table-column label="工序id" align="center" prop="procId" />
|
||||
<el-table-column label="参数名称" align="center" prop="procParamName" />
|
||||
<el-table-column label="参数单位" align="center" prop="procParamUnit" />
|
||||
<el-table-column label="参数类别(1 温度 2压力 3 时间 4速度)" align="center" prop="procParamType">
|
||||
<el-table-column label="参数类别" align="center" prop="procParamType">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.PARAM_TYPE" :value="scope.row.procParamType" />
|
||||
</template>
|
||||
|
||||
@ -92,14 +92,14 @@
|
||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||
<el-table-column label="序号" align="center" type="index" width="60px" />
|
||||
<el-table-column label="供应商编码" align="center" prop="supplierNo" />
|
||||
<el-table-column label="供应商名称" align="center" prop="supplierName" />
|
||||
<el-table-column label="简称" align="center" prop="supplierSimName" />
|
||||
<el-table-column label="供应商类型" align="center" prop="supplierType">
|
||||
<el-table-column label="供应商名称" align="center" prop="supplierName" width="350px" />
|
||||
<el-table-column label="简称" align="center" prop="supplierSimName" width="200px" />
|
||||
<el-table-column label="供应商类型" align="center" prop="supplierType" width="120px">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.SUPPLIER_TYPE" :value="scope.row.supplierType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="等级" align="center" prop="supplierReg">
|
||||
<el-table-column label="等级" align="center" prop="supplierReg" width="120px">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.SUPPLIER_GRADE" :value="scope.row.supplierReg" />
|
||||
</template>
|
||||
@ -130,7 +130,7 @@
|
||||
:formatter="dateFormatter"
|
||||
width="180px"
|
||||
/>
|
||||
<el-table-column label="操作" align="center">
|
||||
<el-table-column label="操作" align="center" width="120px">
|
||||
<template #default="scope">
|
||||
|
||||
<el-button
|
||||
|
||||
Loading…
Reference in New Issue
Block a user