Compare commits
No commits in common. "d8f645e00a8e17c1f8d913cd7c4b52e202ec38e6" and "908c58c101c8685fec435f787bbec2ea4157a5a5" have entirely different histories.
d8f645e00a
...
908c58c101
@ -70,8 +70,4 @@ public interface ErrorCodeConstants {
|
|||||||
|
|
||||||
ErrorCode CUSTOMER_CODE_DUPLICATE = new ErrorCode(1_001_024, "客户编码不能重复");
|
ErrorCode CUSTOMER_CODE_DUPLICATE = new ErrorCode(1_001_024, "客户编码不能重复");
|
||||||
ErrorCode CUSTOMER_NAME_DUPLICATE = new ErrorCode(1_001_025, "客户名称不能重复");
|
ErrorCode CUSTOMER_NAME_DUPLICATE = new ErrorCode(1_001_025, "客户名称不能重复");
|
||||||
|
|
||||||
/********************质检方案信息*************************/
|
|
||||||
ErrorCode INS_PLAN_SCHEME_NAME_DUPLICATE = new ErrorCode(1_001_026, "质检方案名称不能重复");
|
|
||||||
ErrorCode INS_PLAN_SCHEME_NO_DUPLICATE = new ErrorCode(1_001_027, "质检方案编号不能重复");
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -49,5 +49,4 @@ public class CheckItemPageReqVO extends PageParam {
|
|||||||
private String printAvgValues;
|
private String printAvgValues;
|
||||||
@Schema(description = "编号")
|
@Schema(description = "编号")
|
||||||
private String itemNo;
|
private String itemNo;
|
||||||
private String keyWord;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,7 +39,7 @@ public class InspPlanController {
|
|||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
@Operation(summary = "创建质检方案表主")
|
@Operation(summary = "创建质检方案表主")
|
||||||
@PreAuthorize("@ss.hasPermission('biz:insp-plan:create')")
|
@PreAuthorize("@ss.hasPermission('biz:insp-plan:create')")
|
||||||
public CommonResult<Integer> createInspPlan(@Valid @RequestBody InspPlanSaveReqVO createReqVO) {
|
public CommonResult<String> createInspPlan(@Valid @RequestBody InspPlanSaveReqVO createReqVO) {
|
||||||
return success(inspPlanService.createInspPlan(createReqVO));
|
return success(inspPlanService.createInspPlan(createReqVO));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -55,7 +55,7 @@ public class InspPlanController {
|
|||||||
@Operation(summary = "删除质检方案表主")
|
@Operation(summary = "删除质检方案表主")
|
||||||
@Parameter(name = "id", description = "编号", required = true)
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
@PreAuthorize("@ss.hasPermission('biz:insp-plan:delete')")
|
@PreAuthorize("@ss.hasPermission('biz:insp-plan:delete')")
|
||||||
public CommonResult<Boolean> deleteInspPlan(@RequestParam("id") Integer id) {
|
public CommonResult<Boolean> deleteInspPlan(@RequestParam("id") String id) {
|
||||||
inspPlanService.deleteInspPlan(id);
|
inspPlanService.deleteInspPlan(id);
|
||||||
return success(true);
|
return success(true);
|
||||||
}
|
}
|
||||||
@ -64,7 +64,7 @@ public class InspPlanController {
|
|||||||
@Operation(summary = "获得质检方案表主")
|
@Operation(summary = "获得质检方案表主")
|
||||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
@PreAuthorize("@ss.hasPermission('biz:insp-plan:query')")
|
@PreAuthorize("@ss.hasPermission('biz:insp-plan:query')")
|
||||||
public CommonResult<InspPlanRespVO> getInspPlan(@RequestParam("id") Integer id) {
|
public CommonResult<InspPlanRespVO> getInspPlan(@RequestParam("id") String id) {
|
||||||
InspPlanDO inspPlan = inspPlanService.getInspPlan(id);
|
InspPlanDO inspPlan = inspPlanService.getInspPlan(id);
|
||||||
return success(BeanUtils.toBean(inspPlan, InspPlanRespVO.class));
|
return success(BeanUtils.toBean(inspPlan, InspPlanRespVO.class));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,7 +17,7 @@ public class InspPlanRespVO {
|
|||||||
|
|
||||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "17012")
|
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "17012")
|
||||||
@ExcelProperty("id")
|
@ExcelProperty("id")
|
||||||
private Integer id;
|
private String id;
|
||||||
|
|
||||||
@Schema(description = "质检方案编号")
|
@Schema(description = "质检方案编号")
|
||||||
@ExcelProperty("质检方案编号")
|
@ExcelProperty("质检方案编号")
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.inspplan.vo;
|
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.inspplan.vo;
|
||||||
|
|
||||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.inspplanitem.vo.InspPlanItemSaveReqVO;
|
|
||||||
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.*;
|
||||||
@ -12,7 +11,7 @@ import java.util.*;
|
|||||||
public class InspPlanSaveReqVO {
|
public class InspPlanSaveReqVO {
|
||||||
|
|
||||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "17012")
|
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "17012")
|
||||||
private Integer id;
|
private String id;
|
||||||
|
|
||||||
@Schema(description = "质检方案编号")
|
@Schema(description = "质检方案编号")
|
||||||
private String schemeNo;
|
private String schemeNo;
|
||||||
@ -45,7 +44,4 @@ public class InspPlanSaveReqVO {
|
|||||||
@Schema(description = "打印模板名称", example = "张三")
|
@Schema(description = "打印模板名称", example = "张三")
|
||||||
private String printName;
|
private String printName;
|
||||||
|
|
||||||
@Schema(description = "子表列表")
|
|
||||||
private List<InspPlanItemSaveReqVO> inspPlanItemList;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -41,7 +41,7 @@ public class InspPlanItemController {
|
|||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
@Operation(summary = "创建质检方案子")
|
@Operation(summary = "创建质检方案子")
|
||||||
@PreAuthorize("@ss.hasPermission('tba:insp-plan-item:create')")
|
@PreAuthorize("@ss.hasPermission('tba:insp-plan-item:create')")
|
||||||
public CommonResult<Integer> createInspPlanItem(@Valid @RequestBody InspPlanItemSaveReqVO createReqVO) {
|
public CommonResult<String> createInspPlanItem(@Valid @RequestBody InspPlanItemSaveReqVO createReqVO) {
|
||||||
return success(inspPlanItemService.createInspPlanItem(createReqVO));
|
return success(inspPlanItemService.createInspPlanItem(createReqVO));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -57,7 +57,7 @@ public class InspPlanItemController {
|
|||||||
@Operation(summary = "删除质检方案子")
|
@Operation(summary = "删除质检方案子")
|
||||||
@Parameter(name = "id", description = "编号", required = true)
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
@PreAuthorize("@ss.hasPermission('tba:insp-plan-item:delete')")
|
@PreAuthorize("@ss.hasPermission('tba:insp-plan-item:delete')")
|
||||||
public CommonResult<Boolean> deleteInspPlanItem(@RequestParam("id") Integer id) {
|
public CommonResult<Boolean> deleteInspPlanItem(@RequestParam("id") String id) {
|
||||||
inspPlanItemService.deleteInspPlanItem(id);
|
inspPlanItemService.deleteInspPlanItem(id);
|
||||||
return success(true);
|
return success(true);
|
||||||
}
|
}
|
||||||
@ -66,7 +66,7 @@ public class InspPlanItemController {
|
|||||||
@Operation(summary = "获得质检方案子")
|
@Operation(summary = "获得质检方案子")
|
||||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
@PreAuthorize("@ss.hasPermission('tba:insp-plan-item:query')")
|
@PreAuthorize("@ss.hasPermission('tba:insp-plan-item:query')")
|
||||||
public CommonResult<InspPlanItemRespVO> getInspPlanItem(@RequestParam("id") Integer id) {
|
public CommonResult<InspPlanItemRespVO> getInspPlanItem(@RequestParam("id") String id) {
|
||||||
InspPlanItemDO inspPlanItem = inspPlanItemService.getInspPlanItem(id);
|
InspPlanItemDO inspPlanItem = inspPlanItemService.getInspPlanItem(id);
|
||||||
return success(BeanUtils.toBean(inspPlanItem, InspPlanItemRespVO.class));
|
return success(BeanUtils.toBean(inspPlanItem, InspPlanItemRespVO.class));
|
||||||
}
|
}
|
||||||
@ -91,11 +91,5 @@ public class InspPlanItemController {
|
|||||||
ExcelUtils.write(response, "质检方案子.xls", "数据", InspPlanItemRespVO.class,
|
ExcelUtils.write(response, "质检方案子.xls", "数据", InspPlanItemRespVO.class,
|
||||||
BeanUtils.toBean(list, InspPlanItemRespVO.class));
|
BeanUtils.toBean(list, InspPlanItemRespVO.class));
|
||||||
}
|
}
|
||||||
@GetMapping("/getInspPlanItemByPlanId")
|
|
||||||
@Operation(summary = "获得质检方案子")
|
|
||||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
|
||||||
@PreAuthorize("@ss.hasPermission('tba:insp-plan-item:query')")
|
|
||||||
public CommonResult<List<InspPlanItemDO>> getInspPlanItemByPlanId(@RequestParam("planId") Integer planId) {
|
|
||||||
return success(inspPlanItemService.getInspPlanItemByPlanId(planId));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.inspplanitem.vo;
|
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.inspplanitem.vo;
|
||||||
|
|
||||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.inspplanitem.InspPlanItemDO;
|
|
||||||
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.*;
|
||||||
@ -12,13 +11,13 @@ import java.util.*;
|
|||||||
public class InspPlanItemSaveReqVO {
|
public class InspPlanItemSaveReqVO {
|
||||||
|
|
||||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "16314")
|
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "16314")
|
||||||
private Integer id;
|
private String id;
|
||||||
|
|
||||||
@Schema(description = "质检方案id,对应qa_scheme_base中的id列", example = "4222")
|
@Schema(description = "质检方案id,对应qa_scheme_base中的id列", example = "4222")
|
||||||
private Integer schemeId;
|
private String schemeId;
|
||||||
|
|
||||||
@Schema(description = "检验项目id,对应qa_check_item_base中的id列", example = "32292")
|
@Schema(description = "检验项目id,对应qa_check_item_base中的id列", example = "32292")
|
||||||
private Integer itemId;
|
private String itemId;
|
||||||
|
|
||||||
@Schema(description = "单位")
|
@Schema(description = "单位")
|
||||||
private String unit;
|
private String unit;
|
||||||
@ -49,7 +48,5 @@ public class InspPlanItemSaveReqVO {
|
|||||||
|
|
||||||
@Schema(description = "模板检测值数量")
|
@Schema(description = "模板检测值数量")
|
||||||
private Integer printNum;
|
private Integer printNum;
|
||||||
@Schema(description = "明细列表")
|
|
||||||
private List<InspPlanItemDO> inspPlanItemList;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,7 +25,8 @@ public class InspPlanDO extends BaseDO {
|
|||||||
/**
|
/**
|
||||||
* id
|
* id
|
||||||
*/
|
*/
|
||||||
private Integer id;
|
@TableId(type = IdType.INPUT)
|
||||||
|
private String id;
|
||||||
/**
|
/**
|
||||||
* 质检方案编号
|
* 质检方案编号
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -25,11 +25,12 @@ public class InspPlanItemDO extends BaseDO {
|
|||||||
/**
|
/**
|
||||||
* id
|
* id
|
||||||
*/
|
*/
|
||||||
private Integer id;
|
@TableId(type = IdType.INPUT)
|
||||||
|
private String id;
|
||||||
/**
|
/**
|
||||||
* 质检方案id,对应qa_scheme_base中的id列
|
* 质检方案id,对应qa_scheme_base中的id列
|
||||||
*/
|
*/
|
||||||
private Integer schemeId;
|
private String schemeId;
|
||||||
/**
|
/**
|
||||||
* 检验项目id,对应qa_check_item_base中的id列
|
* 检验项目id,对应qa_check_item_base中的id列
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -2,13 +2,10 @@ package com.ningxia.yunxi.chemmes.module.biz.dal.mysql.checkitem;
|
|||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
|
||||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
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.query.LambdaQueryWrapperX;
|
||||||
import com.ningxia.yunxi.chemmes.framework.mybatis.core.mapper.BaseMapperX;
|
import com.ningxia.yunxi.chemmes.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.checkitem.CheckItemDO;
|
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.checkitem.CheckItemDO;
|
||||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.inspplan.InspPlanDO;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.checkitem.vo.*;
|
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.checkitem.vo.*;
|
||||||
|
|
||||||
@ -50,10 +47,7 @@ public interface CheckItemMapper extends BaseMapperX<CheckItemDO> {
|
|||||||
.eqIfPresent(CheckItemDO::getTestNum, reqVO.getTestNum())
|
.eqIfPresent(CheckItemDO::getTestNum, reqVO.getTestNum())
|
||||||
.eqIfPresent(CheckItemDO::getFloatNum, reqVO.getFloatNum())
|
.eqIfPresent(CheckItemDO::getFloatNum, reqVO.getFloatNum())
|
||||||
.eqIfPresent(CheckItemDO::getPrintAvgValues, reqVO.getPrintAvgValues())
|
.eqIfPresent(CheckItemDO::getPrintAvgValues, reqVO.getPrintAvgValues())
|
||||||
.orderByDesc(CheckItemDO::getCreateTime) .and(ObjectUtil.isNotEmpty(reqVO.getKeyWord()), wrapper -> wrapper
|
.orderByDesc(CheckItemDO::getCreateTime));
|
||||||
.like(CheckItemDO::getItemName, reqVO.getKeyWord())
|
|
||||||
.or()
|
|
||||||
.like(CheckItemDO::getItemNo, reqVO.getKeyWord())));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -33,26 +33,4 @@ public interface InspPlanMapper extends BaseMapperX<InspPlanDO> {
|
|||||||
.like(InspPlanDO::getSchemeNo, keyWord))
|
.like(InspPlanDO::getSchemeNo, keyWord))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
default InspPlanDO selectBySchemeName(String schemeName) {
|
|
||||||
return selectOne(new LambdaQueryWrapperX<InspPlanDO>()
|
|
||||||
.eq(InspPlanDO::getSchemeName, schemeName));
|
|
||||||
}
|
|
||||||
|
|
||||||
default InspPlanDO selectBySchemeNameExcludeId(String schemeName, Integer excludeId) {
|
|
||||||
return selectOne(new LambdaQueryWrapperX<InspPlanDO>()
|
|
||||||
.eq(InspPlanDO::getSchemeName, schemeName)
|
|
||||||
.ne(InspPlanDO::getId, excludeId));
|
|
||||||
}
|
|
||||||
|
|
||||||
default InspPlanDO selectBySchemeNo(String schemeNo) {
|
|
||||||
return selectOne(new LambdaQueryWrapperX<InspPlanDO>()
|
|
||||||
.eq(InspPlanDO::getSchemeNo, schemeNo));
|
|
||||||
}
|
|
||||||
|
|
||||||
default InspPlanDO selectBySchemeNoExcludeId(String schemeNo, Integer excludeId) {
|
|
||||||
return selectOne(new LambdaQueryWrapperX<InspPlanDO>()
|
|
||||||
.eq(InspPlanDO::getSchemeNo, schemeNo)
|
|
||||||
.ne(InspPlanDO::getId, excludeId));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,8 +7,6 @@ import com.ningxia.yunxi.chemmes.module.biz.controller.admin.inspplanitem.vo.Ins
|
|||||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.inspplanitem.InspPlanItemDO;
|
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.inspplanitem.InspPlanItemDO;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 质检方案子 Mapper
|
* 质检方案子 Mapper
|
||||||
*
|
*
|
||||||
@ -40,20 +38,4 @@ public interface InspPlanItemMapper extends BaseMapperX<InspPlanItemDO> {
|
|||||||
.eq(InspPlanItemDO::getItemId, id));
|
.eq(InspPlanItemDO::getItemId, id));
|
||||||
}
|
}
|
||||||
|
|
||||||
default List<InspPlanItemDO> getInspPlanItemByPlanId(Integer planId){
|
|
||||||
return selectList(new LambdaQueryWrapperX<InspPlanItemDO>()
|
|
||||||
.eq(InspPlanItemDO::getSchemeId, planId)
|
|
||||||
.orderByAsc(InspPlanItemDO::getSeqNo));
|
|
||||||
}
|
|
||||||
|
|
||||||
default InspPlanItemDO selectBySchemeIdAndItemId(Integer schemeId, Integer itemId) {
|
|
||||||
return selectOne(new LambdaQueryWrapperX<InspPlanItemDO>()
|
|
||||||
.eq(InspPlanItemDO::getSchemeId, schemeId)
|
|
||||||
.eq(InspPlanItemDO::getItemId, itemId));
|
|
||||||
}
|
|
||||||
|
|
||||||
default int deleteBySchemeId(Integer schemeId) {
|
|
||||||
return delete(new LambdaQueryWrapperX<InspPlanItemDO>()
|
|
||||||
.eq(InspPlanItemDO::getSchemeId, schemeId));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -33,7 +33,7 @@ public interface TechProcMapper extends BaseMapperX<TechProcDO> {
|
|||||||
default Long selectByTechProcCount(String techProc, Integer id){
|
default Long selectByTechProcCount(String techProc, Integer id){
|
||||||
return selectCount(new MPJLambdaWrapper<TechProcDO>()
|
return selectCount(new MPJLambdaWrapper<TechProcDO>()
|
||||||
.eq(TechProcDO::getTechProc, techProc)
|
.eq(TechProcDO::getTechProc, techProc)
|
||||||
.ne(ObjectUtil.isNotEmpty(id),TechProcDO::getId, id)
|
.eq(TechProcDO::getId, id)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -21,7 +21,7 @@ public interface InspPlanService {
|
|||||||
* @param createReqVO 创建信息
|
* @param createReqVO 创建信息
|
||||||
* @return 编号
|
* @return 编号
|
||||||
*/
|
*/
|
||||||
Integer createInspPlan(@Valid InspPlanSaveReqVO createReqVO);
|
String createInspPlan(@Valid InspPlanSaveReqVO createReqVO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新质检方案表主
|
* 更新质检方案表主
|
||||||
@ -35,7 +35,7 @@ public interface InspPlanService {
|
|||||||
*
|
*
|
||||||
* @param id 编号
|
* @param id 编号
|
||||||
*/
|
*/
|
||||||
void deleteInspPlan(Integer id);
|
void deleteInspPlan(String id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获得质检方案表主
|
* 获得质检方案表主
|
||||||
@ -43,7 +43,7 @@ public interface InspPlanService {
|
|||||||
* @param id 编号
|
* @param id 编号
|
||||||
* @return 质检方案表主
|
* @return 质检方案表主
|
||||||
*/
|
*/
|
||||||
InspPlanDO getInspPlan(Integer id);
|
InspPlanDO getInspPlan(String id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获得质检方案表主分页
|
* 获得质检方案表主分页
|
||||||
|
|||||||
@ -1,28 +1,16 @@
|
|||||||
package com.ningxia.yunxi.chemmes.module.biz.service.inspplan;
|
package com.ningxia.yunxi.chemmes.module.biz.service.inspplan;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||||
import com.ningxia.yunxi.chemmes.framework.common.util.object.BeanUtils;
|
import com.ningxia.yunxi.chemmes.framework.common.util.object.BeanUtils;
|
||||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.inspplan.vo.InspPlanPageReqVO;
|
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.inspplan.vo.InspPlanPageReqVO;
|
||||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.inspplan.vo.InspPlanSaveReqVO;
|
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.inspplan.vo.InspPlanSaveReqVO;
|
||||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.inspplanitem.vo.InspPlanItemSaveReqVO;
|
|
||||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.inspplan.InspPlanDO;
|
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.inspplan.InspPlanDO;
|
||||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.inspplanitem.InspPlanItemDO;
|
|
||||||
import com.ningxia.yunxi.chemmes.module.biz.dal.mysql.inspplan.InspPlanMapper;
|
import com.ningxia.yunxi.chemmes.module.biz.dal.mysql.inspplan.InspPlanMapper;
|
||||||
import com.ningxia.yunxi.chemmes.module.biz.dal.mysql.inspplanitem.InspPlanItemMapper;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
import static com.ningxia.yunxi.chemmes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
|
||||||
import static com.ningxia.yunxi.chemmes.module.biz.enums.ErrorCodeConstants.*;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 质检方案表主 Service 实现类
|
* 质检方案表主 Service 实现类
|
||||||
@ -36,106 +24,40 @@ public class InspPlanServiceImpl implements InspPlanService {
|
|||||||
@Resource
|
@Resource
|
||||||
private InspPlanMapper inspPlanMapper;
|
private InspPlanMapper inspPlanMapper;
|
||||||
|
|
||||||
@Resource
|
|
||||||
private InspPlanItemMapper inspPlanItemMapper;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
public String createInspPlan(InspPlanSaveReqVO createReqVO) {
|
||||||
public Integer createInspPlan(InspPlanSaveReqVO createReqVO) {
|
// 插入
|
||||||
// 校验方案名称不能重复
|
|
||||||
if (inspPlanMapper.selectBySchemeName(createReqVO.getSchemeName()) != null) {
|
|
||||||
throw exception(INS_PLAN_SCHEME_NAME_DUPLICATE);
|
|
||||||
}
|
|
||||||
// 校验方案编号不能重复
|
|
||||||
if (createReqVO.getSchemeNo() != null && inspPlanMapper.selectBySchemeNo(createReqVO.getSchemeNo()) != null) {
|
|
||||||
throw exception(INS_PLAN_SCHEME_NO_DUPLICATE);
|
|
||||||
}
|
|
||||||
// 插入主表
|
|
||||||
InspPlanDO inspPlan = BeanUtils.toBean(createReqVO, InspPlanDO.class);
|
InspPlanDO inspPlan = BeanUtils.toBean(createReqVO, InspPlanDO.class);
|
||||||
inspPlanMapper.insert(inspPlan);
|
inspPlanMapper.insert(inspPlan);
|
||||||
|
|
||||||
// 处理子表
|
|
||||||
saveInspPlanItemList(inspPlan.getId(), createReqVO.getInspPlanItemList());
|
|
||||||
|
|
||||||
// 返回
|
// 返回
|
||||||
return inspPlan.getId();
|
return inspPlan.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public void updateInspPlan(InspPlanSaveReqVO updateReqVO) {
|
public void updateInspPlan(InspPlanSaveReqVO updateReqVO) {
|
||||||
// 校验存在
|
// 校验存在
|
||||||
validateInspPlanExists(updateReqVO.getId());
|
validateInspPlanExists(updateReqVO.getId());
|
||||||
// 校验方案名称不能重复(排除自身)
|
// 更新
|
||||||
if (inspPlanMapper.selectBySchemeNameExcludeId(updateReqVO.getSchemeName(), updateReqVO.getId()) != null) {
|
|
||||||
throw exception(INS_PLAN_SCHEME_NAME_DUPLICATE);
|
|
||||||
}
|
|
||||||
// 校验方案编号不能重复(排除自身)
|
|
||||||
if (updateReqVO.getSchemeNo() != null && inspPlanMapper.selectBySchemeNoExcludeId(updateReqVO.getSchemeNo(), updateReqVO.getId()) != null) {
|
|
||||||
throw exception(INS_PLAN_SCHEME_NO_DUPLICATE);
|
|
||||||
}
|
|
||||||
// 更新主表
|
|
||||||
InspPlanDO updateObj = BeanUtils.toBean(updateReqVO, InspPlanDO.class);
|
InspPlanDO updateObj = BeanUtils.toBean(updateReqVO, InspPlanDO.class);
|
||||||
inspPlanMapper.updateById(updateObj);
|
inspPlanMapper.updateById(updateObj);
|
||||||
|
|
||||||
// 处理子表
|
|
||||||
saveInspPlanItemList(updateReqVO.getId(), updateReqVO.getInspPlanItemList());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 保存子表列表
|
|
||||||
*/
|
|
||||||
private void saveInspPlanItemList(Integer schemeId, List<InspPlanItemSaveReqVO> itemList) {
|
|
||||||
if (CollUtil.isEmpty(itemList)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 处理子表:如果子表数据没有 id 但有相同的 schemeId + itemId,则复用已有的 id
|
|
||||||
List<InspPlanItemSaveReqVO> collect = itemList.stream()
|
|
||||||
.filter(model -> ObjectUtil.isEmpty(model.getId()))
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
|
|
||||||
boolean updated = false;
|
|
||||||
if (CollUtil.isNotEmpty(collect)) {
|
|
||||||
for (InspPlanItemSaveReqVO model : collect) {
|
|
||||||
// 查询是否已存在相同的 schemeId + itemId
|
|
||||||
InspPlanItemDO existItem = inspPlanItemMapper.selectBySchemeIdAndItemId(schemeId, model.getItemId());
|
|
||||||
if (existItem != null) {
|
|
||||||
model.setId(existItem.getId());
|
|
||||||
updated = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 删除该方案下所有旧的子表数据
|
|
||||||
inspPlanItemMapper.deleteBySchemeId(schemeId);
|
|
||||||
|
|
||||||
// 重新插入/更新子表数据
|
|
||||||
for (InspPlanItemSaveReqVO item : itemList) {
|
|
||||||
InspPlanItemDO inspPlanItem = BeanUtils.toBean(item, InspPlanItemDO.class);
|
|
||||||
inspPlanItem.setSchemeId(schemeId);
|
|
||||||
inspPlanItemMapper.insertOrUpdate(inspPlanItem);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void deleteInspPlan(Integer id) {
|
public void deleteInspPlan(String id) {
|
||||||
// 校验存在
|
// 校验存在
|
||||||
validateInspPlanExists(id);
|
validateInspPlanExists(id);
|
||||||
// 删除子表
|
// 删除
|
||||||
inspPlanItemMapper.deleteBySchemeId(id);
|
|
||||||
// 删除主表
|
|
||||||
inspPlanMapper.deleteById(id);
|
inspPlanMapper.deleteById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void validateInspPlanExists(Integer id) {
|
private void validateInspPlanExists(String id) {
|
||||||
if (inspPlanMapper.selectById(id) == null) {
|
if (inspPlanMapper.selectById(id) == null) {
|
||||||
throw exception("数据不存在");
|
// throw exception(INSP_PLAN_NOT_EXISTS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public InspPlanDO getInspPlan(Integer id) {
|
public InspPlanDO getInspPlan(String id) {
|
||||||
return inspPlanMapper.selectById(id);
|
return inspPlanMapper.selectById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,6 @@ import com.ningxia.yunxi.chemmes.module.biz.controller.admin.inspplanitem.vo.Ins
|
|||||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.inspplanitem.InspPlanItemDO;
|
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.inspplanitem.InspPlanItemDO;
|
||||||
|
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 质检方案子 Service 接口
|
* 质检方案子 Service 接口
|
||||||
@ -21,7 +20,7 @@ public interface InspPlanItemService {
|
|||||||
* @param createReqVO 创建信息
|
* @param createReqVO 创建信息
|
||||||
* @return 编号
|
* @return 编号
|
||||||
*/
|
*/
|
||||||
Integer createInspPlanItem(@Valid InspPlanItemSaveReqVO createReqVO);
|
String createInspPlanItem(@Valid InspPlanItemSaveReqVO createReqVO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新质检方案子
|
* 更新质检方案子
|
||||||
@ -35,7 +34,7 @@ public interface InspPlanItemService {
|
|||||||
*
|
*
|
||||||
* @param id 编号
|
* @param id 编号
|
||||||
*/
|
*/
|
||||||
void deleteInspPlanItem(Integer id);
|
void deleteInspPlanItem(String id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获得质检方案子
|
* 获得质检方案子
|
||||||
@ -43,7 +42,7 @@ public interface InspPlanItemService {
|
|||||||
* @param id 编号
|
* @param id 编号
|
||||||
* @return 质检方案子
|
* @return 质检方案子
|
||||||
*/
|
*/
|
||||||
InspPlanItemDO getInspPlanItem(Integer id);
|
InspPlanItemDO getInspPlanItem(String id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获得质检方案子分页
|
* 获得质检方案子分页
|
||||||
@ -53,5 +52,4 @@ public interface InspPlanItemService {
|
|||||||
*/
|
*/
|
||||||
PageResult<InspPlanItemDO> getInspPlanItemPage(InspPlanItemPageReqVO pageReqVO);
|
PageResult<InspPlanItemDO> getInspPlanItemPage(InspPlanItemPageReqVO pageReqVO);
|
||||||
|
|
||||||
List<InspPlanItemDO> getInspPlanItemByPlanId(Integer planId);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,9 +10,6 @@ import org.springframework.stereotype.Service;
|
|||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import static com.ningxia.yunxi.chemmes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 质检方案子 Service 实现类
|
* 质检方案子 Service 实现类
|
||||||
@ -27,7 +24,7 @@ public class InspPlanItemServiceImpl implements InspPlanItemService {
|
|||||||
private InspPlanItemMapper inspPlanItemMapper;
|
private InspPlanItemMapper inspPlanItemMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Integer createInspPlanItem(InspPlanItemSaveReqVO createReqVO) {
|
public String createInspPlanItem(InspPlanItemSaveReqVO createReqVO) {
|
||||||
// 插入
|
// 插入
|
||||||
InspPlanItemDO inspPlanItem = BeanUtils.toBean(createReqVO, InspPlanItemDO.class);
|
InspPlanItemDO inspPlanItem = BeanUtils.toBean(createReqVO, InspPlanItemDO.class);
|
||||||
inspPlanItemMapper.insert(inspPlanItem);
|
inspPlanItemMapper.insert(inspPlanItem);
|
||||||
@ -45,21 +42,21 @@ public class InspPlanItemServiceImpl implements InspPlanItemService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void deleteInspPlanItem(Integer id) {
|
public void deleteInspPlanItem(String id) {
|
||||||
// 校验存在
|
// 校验存在
|
||||||
validateInspPlanItemExists(id);
|
validateInspPlanItemExists(id);
|
||||||
// 删除
|
// 删除
|
||||||
inspPlanItemMapper.deleteById(id);
|
inspPlanItemMapper.deleteById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void validateInspPlanItemExists(Integer id) {
|
private void validateInspPlanItemExists(String id) {
|
||||||
if (inspPlanItemMapper.selectById(id) == null) {
|
if (inspPlanItemMapper.selectById(id) == null) {
|
||||||
throw exception("数据不存在");
|
// throw exception(INSP_PLAN_ITEM_NOT_EXISTS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public InspPlanItemDO getInspPlanItem(Integer id) {
|
public InspPlanItemDO getInspPlanItem(String id) {
|
||||||
return inspPlanItemMapper.selectById(id);
|
return inspPlanItemMapper.selectById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -68,9 +65,4 @@ public class InspPlanItemServiceImpl implements InspPlanItemService {
|
|||||||
return inspPlanItemMapper.selectPage(pageReqVO);
|
return inspPlanItemMapper.selectPage(pageReqVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<InspPlanItemDO> getInspPlanItemByPlanId(Integer planId) {
|
|
||||||
return inspPlanItemMapper.getInspPlanItemByPlanId(planId);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,5 @@
|
|||||||
import request from '@/config/axios'
|
import request from '@/config/axios'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export interface InspPlanItemVO {
|
export interface InspPlanItemVO {
|
||||||
id: string
|
id: string
|
||||||
schemeId: string
|
schemeId: string
|
||||||
@ -47,6 +45,3 @@ export const deleteInspPlanItem = async (id: number) => {
|
|||||||
export const exportInspPlanItem = async (params) => {
|
export const exportInspPlanItem = async (params) => {
|
||||||
return await request.download({ url: `/tba/insp-plan-item/export-excel`, params })
|
return await request.download({ url: `/tba/insp-plan-item/export-excel`, params })
|
||||||
}
|
}
|
||||||
export const getInspPlanItemByPlanId = async (id: number) => {
|
|
||||||
return await request.get({ url: `/tba/insp-plan-item/getInspPlanItemByPlanId?planId=` + id })
|
|
||||||
}
|
|
||||||
|
|||||||
@ -239,7 +239,6 @@ export enum DICT_TYPE {
|
|||||||
TEST_VALUE_TYPE='test_value_type', // 检验值类型
|
TEST_VALUE_TYPE='test_value_type', // 检验值类型
|
||||||
RAW_MATERIALS_TYPE='raw_materials_type', // 原材料大类
|
RAW_MATERIALS_TYPE='raw_materials_type', // 原材料大类
|
||||||
FINISHED_PRODUCT_TYPE='finished_product_type', // 成品大类
|
FINISHED_PRODUCT_TYPE='finished_product_type', // 成品大类
|
||||||
CLASSIFICATION_CODE='classification_code',// 质检方案分类编码
|
|
||||||
TEMPLATE_CODE='template_code', // 模板编码
|
TEMPLATE_CODE='template_code', // 模板编码
|
||||||
ORDER_TYPE='order_type', // 销售订单类型
|
ORDER_TYPE='order_type', // 销售订单类型
|
||||||
ORDER_STATUS='order_status', // 销售订单状态
|
ORDER_STATUS='order_status', // 销售订单状态
|
||||||
|
|||||||
@ -13,19 +13,19 @@
|
|||||||
<el-row :gutter="15">
|
<el-row :gutter="15">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="编号" prop="itemNo">
|
<el-form-item label="编号" prop="itemNo">
|
||||||
<el-input v-model="formData.itemNo" placeholder="请输入检验项编号" class="!w-240px" clearable/>
|
<el-input v-model="formData.itemNo" placeholder="请输入检验项编号" class="!w-240px"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="名称" prop="itemName">
|
<el-form-item label="名称" prop="itemName">
|
||||||
<el-input v-model="formData.itemName" placeholder="请输入名称" class="!w-240px" clearable/>
|
<el-input v-model="formData.itemName" placeholder="请输入名称" class="!w-240px"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="15">
|
<el-row :gutter="15">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="性质" prop="nature">
|
<el-form-item label="性质" prop="nature">
|
||||||
<el-radio-group v-model="formData.nature" >
|
<el-radio-group v-model="formData.nature">
|
||||||
<el-radio
|
<el-radio
|
||||||
v-for="dict in getStrDictOptions(DICT_TYPE.NATURE)"
|
v-for="dict in getStrDictOptions(DICT_TYPE.NATURE)"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
@ -38,14 +38,14 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="单位" prop="unitName">
|
<el-form-item label="单位" prop="unitName">
|
||||||
<el-input v-model="formData.unitName" placeholder="请输入单位" class="!w-240px" clearable/>
|
<el-input v-model="formData.unitName" placeholder="请输入单位" class="!w-240px"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="15">
|
<el-row :gutter="15">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="检验值类型" prop="itemValueType">
|
<el-form-item label="检验值类型" prop="itemValueType">
|
||||||
<el-select v-model="formData.itemValueType" placeholder="请选择检验值类型" @change="handleItemValueTypeChange" clearable>
|
<el-select v-model="formData.itemValueType" placeholder="请选择检验值类型" @change="handleItemValueTypeChange">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in getStrDictOptions(DICT_TYPE.TEST_VALUE_TYPE)"
|
v-for="dict in getStrDictOptions(DICT_TYPE.TEST_VALUE_TYPE)"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
@ -57,7 +57,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="适用类型" prop="itemType">
|
<el-form-item label="适用类型" prop="itemType">
|
||||||
<el-select v-model="formData.itemType" placeholder="请选择适用类型" @change="handleItemTypeChange" clearable>
|
<el-select v-model="formData.itemType" placeholder="请选择适用类型" @change="handleItemTypeChange">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in getStrDictOptions(DICT_TYPE.MAT_TYPE)"
|
v-for="dict in getStrDictOptions(DICT_TYPE.MAT_TYPE)"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
@ -71,12 +71,12 @@
|
|||||||
<el-row :gutter="15">
|
<el-row :gutter="15">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="检验值数量" prop="testNum">
|
<el-form-item label="检验值数量" prop="testNum">
|
||||||
<el-input v-model="formData.testNum" placeholder="请输入检验值数量" class="!w-240px" clearable/>
|
<el-input v-model="formData.testNum" placeholder="请输入检验值数量" class="!w-240px"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="绑定值" prop="itemContent">
|
<el-form-item label="绑定值" prop="itemContent">
|
||||||
<el-input v-model="formData.itemContent" class="!w-240px" clearable />
|
<el-input v-model="formData.itemContent" class="!w-240px" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -96,14 +96,14 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="小数位数" prop="floatNum">
|
<el-form-item label="小数位数" prop="floatNum">
|
||||||
<el-input v-model="formData.floatNum" placeholder="请输入小数位数" class="!w-240px" clearable />
|
<el-input v-model="formData.floatNum" placeholder="请输入小数位数" class="!w-240px" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="15">
|
<el-row :gutter="15">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="检验大类" prop="itemClass">
|
<el-form-item label="检验大类" prop="itemClass">
|
||||||
<el-select v-model="formData.itemClass" placeholder="请选择检验大类" v-if="formData.itemType=='3'" clearable>
|
<el-select v-model="formData.itemClass" placeholder="请选择检验大类" v-if="formData.itemType=='3'">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in getStrDictOptions(DICT_TYPE.FINISHED_PRODUCT_TYPE)"
|
v-for="dict in getStrDictOptions(DICT_TYPE.FINISHED_PRODUCT_TYPE)"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
@ -111,7 +111,7 @@
|
|||||||
:value="dict.value"
|
:value="dict.value"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-select v-model="formData.itemClass" placeholder="请选择检验大类" v-if="formData.itemType=='1'" clearable>
|
<el-select v-model="formData.itemClass" placeholder="请选择检验大类" v-if="formData.itemType=='1'">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in getStrDictOptions(DICT_TYPE.RAW_MATERIALS_TYPE)"
|
v-for="dict in getStrDictOptions(DICT_TYPE.RAW_MATERIALS_TYPE)"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
@ -119,21 +119,21 @@
|
|||||||
:value="dict.value"
|
:value="dict.value"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-select v-model="formData.itemClass" placeholder="请选择检验大类" v-if="formData.itemType=='2'||!formData.itemType" disabled clearable/>
|
<el-select v-model="formData.itemClass" placeholder="请选择检验大类" v-if="formData.itemType=='2'||!formData.itemType" disabled/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="15">
|
<el-row :gutter="15">
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="检验方法" prop="checkMethod">
|
<el-form-item label="检验方法" prop="checkMethod">
|
||||||
<el-input type="textarea" :rows="4" v-model="formData.checkMethod" placeholder="请输入检验方法" clearable/>
|
<el-input type="textarea" :rows="4" v-model="formData.checkMethod" placeholder="请输入检验方法"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="15">
|
<el-row :gutter="15">
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="备注" prop="remark">
|
<el-form-item label="备注" prop="remark">
|
||||||
<el-input type="textarea" :rows="4" v-model="formData.remark" placeholder="请输入备注" clearable/>
|
<el-input type="textarea" :rows="4" v-model="formData.remark" placeholder="请输入备注"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -147,7 +147,7 @@
|
|||||||
</Dialog>
|
</Dialog>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {getStrDictOptions, DICT_TYPE,} from '@/utils/dict'
|
import {getStrDictOptions, DICT_TYPE, getIntDictOptions} from '@/utils/dict'
|
||||||
import * as CheckItemApi from '@/api/biz/checkitem'
|
import * as CheckItemApi from '@/api/biz/checkitem'
|
||||||
|
|
||||||
const {t} = useI18n() // 国际化
|
const {t} = useI18n() // 国际化
|
||||||
|
|||||||
@ -1,124 +0,0 @@
|
|||||||
<template>
|
|
||||||
<Dialog :title="dialogTitle" v-model="dialogVisible" width="800px">
|
|
||||||
<el-form :model="queryParams" inline label-width="80px">
|
|
||||||
<el-form-item label="检索条件">
|
|
||||||
<el-input v-model="queryParams.keyWord" placeholder="请输入编号或者名称" clearable class="!w-200px" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
|
||||||
<el-button @click="getList">搜索</el-button>
|
|
||||||
<el-button @click="resetQuery">重置</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<el-table ref="tableRef" v-loading="loading" :data="CheckItemList" :show-overflow-tooltip="true" class="mt-15px" row-key="id" @row-click="handleRowClick" @row-dblclick="handleRowDblClick" @selection-change="handleSelectionChange" border>
|
|
||||||
<el-table-column type="selection" width="55"/>
|
|
||||||
<el-table-column label="序号" width="60px" align="center" type="index" />
|
|
||||||
<el-table-column label="编号" align="center" prop="itemNo" />
|
|
||||||
<el-table-column label="名称" align="center" prop="itemName" />
|
|
||||||
<el-table-column label="性质" align="center" prop="nature" >
|
|
||||||
<template #default="scope">
|
|
||||||
<dict-tag :type="DICT_TYPE.NATURE" :value="scope.row.nature" />
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="单位" align="center" prop="unitName" />
|
|
||||||
|
|
||||||
</el-table>
|
|
||||||
<template #footer>
|
|
||||||
<div style="display: flex; justify-content: space-between; align-items: center; padding: 10px 0;">
|
|
||||||
<Pagination
|
|
||||||
:total="total"
|
|
||||||
v-model:page="queryParams.pageNo"
|
|
||||||
v-model:limit="queryParams.pageSize"
|
|
||||||
@pagination="getList"
|
|
||||||
/>
|
|
||||||
<div style="display: flex; gap: 10px;">
|
|
||||||
<el-button @click="confirmSelection" type="primary">确 定</el-button>
|
|
||||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</Dialog>
|
|
||||||
</template>
|
|
||||||
<script setup lang="ts">
|
|
||||||
import { ref, reactive, nextTick } from 'vue'
|
|
||||||
import {DICT_TYPE} from "@/utils/dict";
|
|
||||||
import * as CheckItemApi from "@/api/biz/checkitem";
|
|
||||||
|
|
||||||
const message = useMessage()
|
|
||||||
const dialogVisible = ref(false)
|
|
||||||
const dialogTitle = ref('选择检验标准')
|
|
||||||
const loading = ref(false)
|
|
||||||
const total = ref(0)
|
|
||||||
const tableRef = ref()
|
|
||||||
let isRestoring = false
|
|
||||||
const CheckItemList = ref([])
|
|
||||||
const selectedCheckItems = ref<any[]>([])
|
|
||||||
const selectedIds = ref<string[]>([])
|
|
||||||
|
|
||||||
const queryParams = reactive({
|
|
||||||
keyWord: undefined,
|
|
||||||
pageNo: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
itemType: '',
|
|
||||||
})
|
|
||||||
|
|
||||||
const emit = defineEmits(['confirm'])
|
|
||||||
|
|
||||||
const open = (params?: { schemeType?: number; selectedIds?: number[] }) => {
|
|
||||||
dialogVisible.value = true
|
|
||||||
selectedCheckItems.value = []
|
|
||||||
selectedIds.value = params?.selectedIds ? params.selectedIds.map(String) : []
|
|
||||||
queryParams.itemType = params?.schemeType ?? ''
|
|
||||||
getList()
|
|
||||||
}
|
|
||||||
|
|
||||||
const getList = async () => {
|
|
||||||
loading.value = true
|
|
||||||
try {
|
|
||||||
const data = await CheckItemApi.getCheckItemPage(queryParams)
|
|
||||||
CheckItemList.value = data.list
|
|
||||||
total.value = data.total
|
|
||||||
// 恢复已选项
|
|
||||||
isRestoring = true
|
|
||||||
nextTick(() => {
|
|
||||||
tableRef.value?.clearSelection()
|
|
||||||
CheckItemList.value.forEach((row: any) => {
|
|
||||||
if (selectedIds.value.includes(String(row.id))) {
|
|
||||||
tableRef.value?.toggleRowSelection(row, true)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
isRestoring = false
|
|
||||||
})
|
|
||||||
} finally {
|
|
||||||
loading.value = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const resetQuery = () => {
|
|
||||||
queryParams.keyWord = undefined
|
|
||||||
getList()
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleSelectionChange = (rows: any[]) => {
|
|
||||||
if (isRestoring) return
|
|
||||||
selectedCheckItems.value = rows
|
|
||||||
selectedIds.value = rows.map((item: any) => String(item.id))
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleRowClick = (row: any) => {
|
|
||||||
tableRef.value?.toggleRowSelection(row)
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleRowDblClick = (row: any) => {
|
|
||||||
const isSelected = selectedIds.value.includes(String(row.id))
|
|
||||||
if (!isSelected) {
|
|
||||||
tableRef.value?.toggleRowSelection(row, true)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const confirmSelection = () => {
|
|
||||||
emit('confirm', selectedCheckItems.value)
|
|
||||||
dialogVisible.value = false
|
|
||||||
}
|
|
||||||
|
|
||||||
defineExpose({ open })
|
|
||||||
</script>
|
|
||||||
@ -1,29 +1,23 @@
|
|||||||
<template>
|
<template>
|
||||||
<Dialog :title="dialogTitle" v-model="dialogVisible" @close="cancel" width="1500px">
|
<Dialog :title="dialogTitle" v-model="dialogVisible">
|
||||||
<el-form
|
<el-form
|
||||||
ref="formRef"
|
ref="formRef"
|
||||||
:model="formData"
|
:model="formData"
|
||||||
:rules="formRules"
|
:rules="formRules"
|
||||||
label-width="120px"
|
label-width="100px"
|
||||||
v-loading="formLoading"
|
v-loading="formLoading"
|
||||||
>
|
>
|
||||||
<el-row :gutter="15">
|
<el-form-item label="质检方案编号" prop="schemeNo">
|
||||||
<el-col :span="12">
|
<el-input v-model="formData.schemeNo" placeholder="请输入质检方案编号" />
|
||||||
<el-form-item label="编号" prop="schemeNo">
|
|
||||||
<el-input v-model="formData.schemeNo" placeholder="请输入编号" clearable/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
<el-form-item label="质检方案名称" prop="schemeName">
|
||||||
<el-col :span="12">
|
<el-input v-model="formData.schemeName" placeholder="请输入质检方案名称" />
|
||||||
<el-form-item label="名称" prop="schemeName">
|
|
||||||
<el-input v-model="formData.schemeName" placeholder="请输入名称" clearable/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
<el-form-item label="描述" prop="remark">
|
||||||
</el-row>
|
<el-input v-model="formData.remark" placeholder="请输入描述" />
|
||||||
<el-row :gutter="15">
|
</el-form-item>
|
||||||
<el-col :span="12">
|
<el-form-item label="适用类型,1表示原材料 2表示半成品 3表示成品" prop="schemeType">
|
||||||
<el-form-item label="适用类型" prop="schemeType">
|
<el-select v-model="formData.schemeType" placeholder="请选择适用类型,1表示原材料 2表示半成品 3表示成品">
|
||||||
<el-select v-model="formData.schemeType" clearable class="!w-1/1"
|
|
||||||
placeholder="请选择适用类型" @change="formData.tiemClass = undefined">
|
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in getIntDictOptions(DICT_TYPE.MAT_TYPE)"
|
v-for="dict in getIntDictOptions(DICT_TYPE.MAT_TYPE)"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
@ -32,216 +26,42 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
<el-form-item label="分类编码" prop="tiemClass">
|
||||||
<el-col :span="12">
|
<el-input v-model="formData.tiemClass" placeholder="请输入分类编码" />
|
||||||
<el-form-item label="产品大类" prop="tiemClass">
|
|
||||||
<el-select v-model="formData.tiemClass" v-if="formData.schemeType==1" clearable class="!w-1/1"
|
|
||||||
placeholder="请选择产品大类">
|
|
||||||
<el-option
|
|
||||||
v-for="dict in getStrDictOptions(DICT_TYPE.CLASSIFICATION_CODE)"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label"
|
|
||||||
:value="dict.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
<el-select v-model="formData.tiemClass" placeholder="请选择产品大类" v-if="formData.schemeType!=1" disabled class="!w-1/1"/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="15">
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="表单编号" prop="formCode">
|
<el-form-item label="表单编号" prop="formCode">
|
||||||
<el-input v-model="formData.formCode" placeholder="请输入表单编号" clearable/>
|
<el-input v-model="formData.formCode" placeholder="请输入表单编号" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="执行标准" prop="execStandard">
|
<el-form-item label="执行标准" prop="execStandard">
|
||||||
<el-input v-model="formData.execStandard" placeholder="请输入执行标准" clearable/>
|
<el-input v-model="formData.execStandard" placeholder="请输入执行标准" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<el-row :gutter="15">
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="检验值数量" prop="testNum">
|
<el-form-item label="检验值数量" prop="testNum">
|
||||||
<el-input v-model="formData.testNum" placeholder="请输入检验值数量" clearable/>
|
<el-input v-model="formData.testNum" placeholder="请输入检验值数量" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
<el-form-item label="打印模板编码" prop="printCode">
|
||||||
<el-col :span="12">
|
<el-input v-model="formData.printCode" placeholder="请输入打印模板编码" />
|
||||||
<el-form-item label="描述" prop="remark">
|
|
||||||
<el-input v-model="formData.remark" placeholder="请输入描述" clearable/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
<el-form-item label="打印模板名称" prop="printName">
|
||||||
</el-row>
|
<el-input v-model="formData.printName" placeholder="请输入打印模板名称" />
|
||||||
|
|
||||||
<el-row :gutter="15">
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="模板编码" prop="printCode" >
|
|
||||||
<el-select v-model="formData.printCode" clearable class="!w-1/1"
|
|
||||||
placeholder="请选择模板编码">
|
|
||||||
<el-option
|
|
||||||
v-for="dict in getStrDictOptions(DICT_TYPE.TEMPLATE_CODE)"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label"
|
|
||||||
:value="dict.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<el-card class="hl-card-info">
|
|
||||||
<template #header>
|
|
||||||
<div class="hl-card-info-icona"></div><span class="hl-card-info-text">质检方案明细</span>
|
|
||||||
<el-button type="primary" size="large" @click="openCheckItem" style="margin-left: 20px">新增</el-button>
|
|
||||||
|
|
||||||
</template>
|
|
||||||
<el-row>
|
|
||||||
<el-col>
|
|
||||||
<el-card class="hl-incard">
|
|
||||||
<el-form ref="OrderYsDetailSubFormRef" :model="formData.inspPlanItemList" label-width="0" >
|
|
||||||
<el-table :data="formData.inspPlanItemList" class="hl-table" >
|
|
||||||
<el-table-column type="index" label="序号" align="center" min-width="60" fixed />
|
|
||||||
<el-table-column label="检验项目" prop="itemName" width="250" align="center">
|
|
||||||
<template #default="scope">
|
|
||||||
{{scope.row.itemName}}
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column align="center" label="单位" width="120">
|
|
||||||
<template #default="scope">
|
|
||||||
|
|
||||||
<el-input v-model="scope.row.unit" placeholder="请输入单位" clearable/>
|
|
||||||
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column align="center" label="标准值" width="150">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-input v-model="scope.row.standardValue" placeholder="请输入标准值" clearable/>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
|
|
||||||
<el-table-column align="center" label="上限值" width="150">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-input v-model="scope.row.upperLimit" placeholder="请输入上限值" clearable/>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
|
|
||||||
<el-table-column align="center" label="下限值" width="150">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-input v-model="scope.row.lowerLimit" placeholder="请输入下限值" clearable/>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
|
|
||||||
<el-table-column align="center" label="打印是否合并" width="150">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-select
|
|
||||||
v-model="scope.row.printMergeYn"
|
|
||||||
placeholder="请选择"
|
|
||||||
clearable
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="dict in getStrDictOptions(DICT_TYPE.SYSTEM_IS_CELL)"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label"
|
|
||||||
:value="dict.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column align="center" label="备注" width="200">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-input v-model="scope.row.remark" placeholder="请输入备注" clearable/>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
|
|
||||||
<el-table-column align="center" label="打印是否传送标准" width="180">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-select
|
|
||||||
v-model="scope.row.printItem"
|
|
||||||
placeholder="请选择"
|
|
||||||
clearable
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="dict in getStrDictOptions(DICT_TYPE.SYSTEM_IS_CELL)"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label"
|
|
||||||
:value="dict.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
|
|
||||||
<el-table-column align="center" label="模板检测值数量" width="180">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-input v-model="scope.row.printNum" placeholder="请输入模板检测值数量" clearable/>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
|
|
||||||
<el-table-column label="展示顺序" prop="seqNo" align="center" width="150" >
|
|
||||||
<template #default="scope">
|
|
||||||
<el-input-number
|
|
||||||
v-model="scope.row.seqNo"
|
|
||||||
placeholder="请输入展示顺序"
|
|
||||||
:min="0"
|
|
||||||
controls-position="right"
|
|
||||||
class="!w-1/1"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
|
|
||||||
<el-table-column label="操作" align="center" width="120" fixed="right">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-button link type="danger" size="small" @click.prevent="onDeleteItem(scope.$index)" >
|
|
||||||
删除
|
|
||||||
</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
</el-form>
|
|
||||||
</el-card>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-card>
|
|
||||||
|
|
||||||
|
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
||||||
<el-button @click="cancel">取 消</el-button>
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||||
</template>
|
</template>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
<CheckItem ref="checkItemRef" @confirm="confirmCheckItem" />
|
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {getIntDictOptions, DICT_TYPE, getStrDictOptions} from '@/utils/dict'
|
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||||
import * as InspPlanApi from '@/api/biz/inspplan'
|
import * as InspPlanApi from '@/api/biz/inspplan'
|
||||||
import * as InspPlanItemApi from '@/api/biz/inspplanitem'
|
|
||||||
import CheckItem from "./CheckItem.vue";
|
|
||||||
import {ref} from "vue";
|
|
||||||
|
|
||||||
const {t} = useI18n() // 国际化
|
const { t } = useI18n() // 国际化
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
const checkItemRef = ref() // 检验项目选择弹窗引用
|
|
||||||
|
|
||||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||||
const dialogTitle = ref('') // 弹窗的标题
|
const dialogTitle = ref('') // 弹窗的标题
|
||||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||||
interface InspPlanItem {
|
|
||||||
itemId?: number
|
|
||||||
itemName?: string
|
|
||||||
unit?: string
|
|
||||||
standardValue?: string
|
|
||||||
upperLimit?: string
|
|
||||||
lowerLimit?: string
|
|
||||||
printMergeYn?: string
|
|
||||||
remark?: string
|
|
||||||
printItem?: string
|
|
||||||
printNum?: string
|
|
||||||
seqNo?: number
|
|
||||||
}
|
|
||||||
|
|
||||||
const formData = ref({
|
const formData = ref({
|
||||||
id: undefined,
|
id: undefined,
|
||||||
schemeNo: undefined,
|
schemeNo: undefined,
|
||||||
@ -254,51 +74,12 @@ const formData = ref({
|
|||||||
testNum: undefined,
|
testNum: undefined,
|
||||||
printCode: undefined,
|
printCode: undefined,
|
||||||
printName: undefined,
|
printName: undefined,
|
||||||
inspPlanItemList: [] as InspPlanItem[],
|
|
||||||
})
|
})
|
||||||
const formRules = reactive({
|
const formRules = reactive({
|
||||||
schemeNo: [{required: true, message: '编号不能为空', trigger: 'blur'}],
|
schemeName: [{ required: true, message: '质检方案名称不能为空', trigger: 'blur' }],
|
||||||
schemeName: [{required: true, message: '名称不能为空', trigger: 'blur'}],
|
|
||||||
schemeType: [{required: true, message: '适用类型不能为空', trigger: 'change'}],
|
|
||||||
testNum: [{required: true, message: '检验值数量不能为空', trigger: 'blur'}],
|
|
||||||
})
|
})
|
||||||
const formRef = ref() // 表单 Ref
|
const formRef = ref() // 表单 Ref
|
||||||
const cancel = async () => {
|
|
||||||
dialogVisible.value = false
|
|
||||||
emit('success')
|
|
||||||
}
|
|
||||||
/** 打开质检方案选择弹窗 */
|
|
||||||
const openCheckItem = () => {
|
|
||||||
if (!formData.value.schemeType) {
|
|
||||||
message.warning('请先选择适用类型')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
const selectedIds = formData.value.inspPlanItemList
|
|
||||||
.filter((item: any) => item.itemId)
|
|
||||||
.map((item: any) => item.itemId)
|
|
||||||
checkItemRef.value.open({
|
|
||||||
schemeType: formData.value.schemeType,
|
|
||||||
selectedIds,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 确认选择检验标准 */
|
|
||||||
const confirmCheckItem = async (checkItems: any[]) => {
|
|
||||||
if (!checkItems || checkItems.length === 0) return
|
|
||||||
checkItems.forEach((item: any) => {
|
|
||||||
// 避免重复添加
|
|
||||||
const exists = formData.value.inspPlanItemList.some(
|
|
||||||
(existing: any) => existing.itemId === item.id
|
|
||||||
)
|
|
||||||
if (!exists) {
|
|
||||||
formData.value.inspPlanItemList.push({
|
|
||||||
itemId: item.id,
|
|
||||||
itemName: item.itemName,
|
|
||||||
unit: item.unitName,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
/** 打开弹窗 */
|
/** 打开弹窗 */
|
||||||
const open = async (type: string, id?: number) => {
|
const open = async (type: string, id?: number) => {
|
||||||
dialogVisible.value = true
|
dialogVisible.value = true
|
||||||
@ -310,38 +91,16 @@ const open = async (type: string, id?: number) => {
|
|||||||
formLoading.value = true
|
formLoading.value = true
|
||||||
try {
|
try {
|
||||||
formData.value = await InspPlanApi.getInspPlan(id)
|
formData.value = await InspPlanApi.getInspPlan(id)
|
||||||
formData.value.inspPlanItemList = await InspPlanItemApi.getInspPlanItemByPlanId(id)
|
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
formLoading.value = false
|
formLoading.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
defineExpose({open}) // 提供 open 方法,用于打开弹窗
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||||
|
|
||||||
/** 提交表单 */
|
/** 提交表单 */
|
||||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||||
const submitForm = async () => {
|
const submitForm = async () => {
|
||||||
// 校验展示顺序是否为空
|
|
||||||
const hasEmptySeqNo = formData.value.inspPlanItemList.some((item) => item.seqNo == null || item.seqNo === ('' as unknown as number))
|
|
||||||
if (hasEmptySeqNo) {
|
|
||||||
message.warning('展示顺序不能为空,请输入')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// 校验展示顺序是否为数字
|
|
||||||
const hasInvalidSeqNo = formData.value.inspPlanItemList.some((item) => item.seqNo != null && typeof item.seqNo !== 'number')
|
|
||||||
if (hasInvalidSeqNo) {
|
|
||||||
message.warning('展示顺序必须为数字,请确认')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// 校验展示顺序是否重复
|
|
||||||
const seqNos = formData.value.inspPlanItemList
|
|
||||||
.map((item) => item.seqNo)
|
|
||||||
.filter((seqNo) => seqNo != null)
|
|
||||||
if (new Set(seqNos).size !== seqNos.length) {
|
|
||||||
message.warning('展示顺序不能重复,请确认')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// 校验表单
|
// 校验表单
|
||||||
await formRef.value.validate()
|
await formRef.value.validate()
|
||||||
// 提交请求
|
// 提交请求
|
||||||
@ -363,11 +122,6 @@ const submitForm = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 删除子项操作 */
|
|
||||||
const onDeleteItem = async (index) => {
|
|
||||||
formData.value.inspPlanItemList.splice(index, 1)
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 重置表单 */
|
/** 重置表单 */
|
||||||
const resetForm = () => {
|
const resetForm = () => {
|
||||||
formData.value = {
|
formData.value = {
|
||||||
@ -382,7 +136,6 @@ const resetForm = () => {
|
|||||||
testNum: undefined,
|
testNum: undefined,
|
||||||
printCode: undefined,
|
printCode: undefined,
|
||||||
printName: undefined,
|
printName: undefined,
|
||||||
inspPlanItemList: [] as InspPlanItem[],
|
|
||||||
}
|
}
|
||||||
formRef.value?.resetFields()
|
formRef.value?.resetFields()
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,21 +6,21 @@
|
|||||||
:model="queryParams"
|
:model="queryParams"
|
||||||
ref="queryFormRef"
|
ref="queryFormRef"
|
||||||
:inline="true"
|
:inline="true"
|
||||||
label-width="80px"
|
label-width="68px"
|
||||||
>
|
>
|
||||||
<el-form-item label="名称" prop="schemeName">
|
<el-form-item label="质检方案名称" prop="schemeName">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.schemeName"
|
v-model="queryParams.schemeName"
|
||||||
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="适用类型" prop="schemeType">
|
<el-form-item label="适用类型,1表示原材料 2表示半成品 3表示成品" prop="schemeType">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="queryParams.schemeType"
|
v-model="queryParams.schemeType"
|
||||||
placeholder="请选择适用类型"
|
placeholder="请选择适用类型,1表示原材料 2表示半成品 3表示成品"
|
||||||
clearable
|
clearable
|
||||||
class="!w-240px"
|
class="!w-240px"
|
||||||
>
|
>
|
||||||
@ -39,38 +39,55 @@
|
|||||||
type="primary"
|
type="primary"
|
||||||
plain
|
plain
|
||||||
@click="openForm('create')"
|
@click="openForm('create')"
|
||||||
|
v-hasPermi="['biz:insp-plan:create']"
|
||||||
>
|
>
|
||||||
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||||
</el-button>
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
plain
|
||||||
|
@click="handleExport"
|
||||||
|
:loading="exportLoading"
|
||||||
|
v-hasPermi="['biz:insp-plan:export']"
|
||||||
|
>
|
||||||
|
<Icon icon="ep:download" class="mr-5px" /> 导出
|
||||||
|
</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</ContentWrap>
|
</ContentWrap>
|
||||||
|
|
||||||
<!-- 列表 -->
|
<!-- 列表 -->
|
||||||
<ContentWrap>
|
<ContentWrap>
|
||||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" border>
|
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||||
<el-table-column type="index" label="序号" align="center" min-width="60" />
|
<el-table-column label="id" align="center" prop="id" />
|
||||||
<el-table-column label="名称" align="center" prop="schemeName" />
|
<el-table-column label="质检方案编号" align="center" prop="schemeNo" />
|
||||||
<el-table-column label="适用类型" align="center" prop="schemeType">
|
<el-table-column label="质检方案名称" align="center" prop="schemeName" />
|
||||||
|
<el-table-column label="描述" align="center" prop="remark" />
|
||||||
|
<el-table-column label="适用类型,1表示原材料 2表示半成品 3表示成品" align="center" prop="schemeType">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<dict-tag :type="DICT_TYPE.MAT_TYPE" :value="scope.row.schemeType" />
|
<dict-tag :type="DICT_TYPE.MAT_TYPE" :value="scope.row.schemeType" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="产品大类" align="center" prop="tiemClass" >
|
<el-table-column
|
||||||
<template #default="scope">
|
label="创建时间"
|
||||||
<dict-tag :type="DICT_TYPE.CLASSIFICATION_CODE" :value="scope.row.tiemClass" />
|
align="center"
|
||||||
</template>
|
prop="createTime"
|
||||||
</el-table-column>
|
:formatter="dateFormatter"
|
||||||
|
width="180px"
|
||||||
|
/>
|
||||||
|
<el-table-column label="分类编码" align="center" prop="tiemClass" />
|
||||||
<el-table-column label="表单编号" align="center" prop="formCode" />
|
<el-table-column label="表单编号" align="center" prop="formCode" />
|
||||||
<el-table-column label="执行标准" align="center" prop="execStandard" />
|
<el-table-column label="执行标准" align="center" prop="execStandard" />
|
||||||
<el-table-column label="描述" align="center" prop="remark" />
|
<el-table-column label="检验值数量" align="center" prop="testNum" />
|
||||||
<el-table-column label="编号" align="center" prop="schemeNo" />
|
<el-table-column label="打印模板编码" align="center" prop="printCode" />
|
||||||
|
<el-table-column label="打印模板名称" align="center" prop="printName" />
|
||||||
<el-table-column label="操作" align="center">
|
<el-table-column 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="['biz:insp-plan:update']"
|
||||||
>
|
>
|
||||||
编辑
|
编辑
|
||||||
</el-button>
|
</el-button>
|
||||||
@ -78,6 +95,7 @@
|
|||||||
link
|
link
|
||||||
type="danger"
|
type="danger"
|
||||||
@click="handleDelete(scope.row.id)"
|
@click="handleDelete(scope.row.id)"
|
||||||
|
v-hasPermi="['biz:insp-plan:delete']"
|
||||||
>
|
>
|
||||||
删除
|
删除
|
||||||
</el-button>
|
</el-button>
|
||||||
@ -99,7 +117,8 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||||
|
import { dateFormatter } from '@/utils/formatTime'
|
||||||
|
import download from '@/utils/download'
|
||||||
import * as InspPlanApi from '@/api/biz/inspplan'
|
import * as InspPlanApi from '@/api/biz/inspplan'
|
||||||
import InspPlanForm from './InspPlanForm.vue'
|
import InspPlanForm from './InspPlanForm.vue'
|
||||||
|
|
||||||
@ -108,7 +127,7 @@ defineOptions({ name: 'InspPlan' })
|
|||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
const { t } = useI18n() // 国际化
|
const { t } = useI18n() // 国际化
|
||||||
|
|
||||||
const loading = ref(false) // 列表的加载中
|
const loading = ref(true) // 列表的加载中
|
||||||
const list = ref([]) // 列表的数据
|
const list = ref([]) // 列表的数据
|
||||||
const total = ref(0) // 列表的总页数
|
const total = ref(0) // 列表的总页数
|
||||||
const queryParams = reactive({
|
const queryParams = reactive({
|
||||||
@ -118,6 +137,7 @@ const queryParams = reactive({
|
|||||||
schemeType: undefined,
|
schemeType: undefined,
|
||||||
})
|
})
|
||||||
const queryFormRef = ref() // 搜索的表单
|
const queryFormRef = ref() // 搜索的表单
|
||||||
|
const exportLoading = ref(false) // 导出的加载中
|
||||||
|
|
||||||
/** 查询列表 */
|
/** 查询列表 */
|
||||||
const getList = async () => {
|
const getList = async () => {
|
||||||
@ -162,10 +182,23 @@ const handleDelete = async (id: number) => {
|
|||||||
} catch {}
|
} catch {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
const handleExport = async () => {
|
||||||
|
try {
|
||||||
|
// 导出的二次确认
|
||||||
|
await message.exportConfirm()
|
||||||
|
// 发起导出
|
||||||
|
exportLoading.value = true
|
||||||
|
const data = await InspPlanApi.exportInspPlan(queryParams)
|
||||||
|
download.excel(data, '质检方案表主.xls')
|
||||||
|
} catch {
|
||||||
|
} finally {
|
||||||
|
exportLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** 初始化 **/
|
/** 初始化 **/
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
// getList()
|
getList()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
@ -196,14 +196,6 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
|||||||
/** 提交表单 */
|
/** 提交表单 */
|
||||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||||
const submitForm = async () => {
|
const submitForm = async () => {
|
||||||
// 校验序列号是否重复
|
|
||||||
const seqNos = formData.value.shiftConfigList
|
|
||||||
.map((item) => item.seqNo)
|
|
||||||
.filter((seqNo) => seqNo != null)
|
|
||||||
if (new Set(seqNos).size !== seqNos.length) {
|
|
||||||
message.warning('序列号不能重复,请确认')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// 校验表单
|
// 校验表单
|
||||||
await formRef.value.validate()
|
await formRef.value.validate()
|
||||||
// 提交请求
|
// 提交请求
|
||||||
|
|||||||
@ -6,7 +6,8 @@
|
|||||||
ref="queryFormRef"
|
ref="queryFormRef"
|
||||||
:inline="true"
|
:inline="true"
|
||||||
label-width="80px">
|
label-width="80px">
|
||||||
<div style="display: flex; flex-wrap: nowrap; align-items: flex-start;">
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="6">
|
||||||
<el-form-item label="排班年月">
|
<el-form-item label="排班年月">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="queryParams.years"
|
v-model="queryParams.years"
|
||||||
@ -17,12 +18,16 @@
|
|||||||
class="!w-240px"
|
class="!w-240px"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
<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-form-item>
|
</el-form-item>
|
||||||
</div>
|
</el-col>
|
||||||
<div style="display: flex; flex-wrap: nowrap; align-items: flex-start;">
|
</el-row>
|
||||||
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="6">
|
||||||
<el-form-item label="倒班类型">
|
<el-form-item label="倒班类型">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="queryParams.chgClassType"
|
v-model="queryParams.chgClassType"
|
||||||
@ -38,6 +43,8 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
<el-form-item label="开始日期">
|
<el-form-item label="开始日期">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="queryParams.bgnDtime"
|
v-model="queryParams.bgnDtime"
|
||||||
@ -49,6 +56,8 @@
|
|||||||
:disabled-date="disabledDate"
|
:disabled-date="disabledDate"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button
|
<el-button
|
||||||
type="success"
|
type="success"
|
||||||
@ -59,7 +68,8 @@
|
|||||||
生成排班结果
|
生成排班结果
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</div>
|
</el-col>
|
||||||
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
</ContentWrap>
|
</ContentWrap>
|
||||||
|
|
||||||
|
|||||||
@ -19,13 +19,13 @@
|
|||||||
/>
|
/>
|
||||||
</el-select> </el-form-item>
|
</el-select> </el-form-item>
|
||||||
<el-form-item label="库区编码" prop="storeAreCd">
|
<el-form-item label="库区编码" prop="storeAreCd">
|
||||||
<el-input v-model="formData.storeAreCd" placeholder="请输入库区编码" clearable class="!w-240px" :disabled="formData.id"/>
|
<el-input v-model="formData.storeAreCd" placeholder="请输入库区编码" class="!w-240px" :disabled="formData.id"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="库区名称" prop="storeAreaName">
|
<el-form-item label="库区名称" prop="storeAreaName">
|
||||||
<el-input v-model="formData.storeAreaName" placeholder="请输入库区名称" clearable class="!w-240px"/>
|
<el-input v-model="formData.storeAreaName" placeholder="请输入库区名称" class="!w-240px"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="状态" prop="enabledStatus">
|
<el-form-item label="状态" prop="enabledStatus">
|
||||||
<el-select v-model="formData.enabledStatus" placeholder="请选择状态" clearable>
|
<el-select v-model="formData.enabledStatus" placeholder="请选择状态">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in getIntDictOptions(DICT_TYPE.SYSTEM_STATUS)"
|
v-for="dict in getIntDictOptions(DICT_TYPE.SYSTEM_STATUS)"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
@ -35,7 +35,7 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="备注" prop="remark">
|
<el-form-item label="备注" prop="remark">
|
||||||
<el-input type='textarea' :rows="4" v-model="formData.remark" placeholder="请输入备注" clearable/>
|
<el-input type='textarea' :rows="4" v-model="formData.remark" placeholder="请输入备注" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
v-loading="formLoading"
|
v-loading="formLoading"
|
||||||
>
|
>
|
||||||
<el-form-item label="仓库类型" prop="storeType">
|
<el-form-item label="仓库类型" prop="storeType">
|
||||||
<el-select v-model="formData.storeType" placeholder="请选择仓库类型" clearable>
|
<el-select v-model="formData.storeType" placeholder="请选择仓库类型">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in getStrDictOptions(DICT_TYPE.WAREHOUSE_TYPE)"
|
v-for="dict in getStrDictOptions(DICT_TYPE.WAREHOUSE_TYPE)"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
@ -19,15 +19,15 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="仓储编码" prop="storeHouseCd">
|
<el-form-item label="仓储编码" prop="storeHouseCd">
|
||||||
<el-input v-model="formData.storeHouseCd" placeholder="请输入仓储编码" clearable class="!w-240px" :disabled="formData.id"/>
|
<el-input v-model="formData.storeHouseCd" placeholder="请输入仓储编码" class="!w-240px" :disabled="formData.id"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="仓储名称" prop="storeHouseName">
|
<el-form-item label="仓储名称" prop="storeHouseName">
|
||||||
<el-input v-model="formData.storeHouseName" placeholder="请输入仓储名称" class="!w-240px" clearable/>
|
<el-input v-model="formData.storeHouseName" placeholder="请输入仓储名称" class="!w-240px" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="状态" prop="enabledStatus">
|
<el-form-item label="状态" prop="enabledStatus">
|
||||||
<el-select v-model="formData.enabledStatus" placeholder="请选择状态" clearable>
|
<el-select v-model="formData.enabledStatus" placeholder="请选择状态">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in getIntDictOptions(DICT_TYPE.SYSTEM_STATUS)"
|
v-for="dict in getIntDictOptions(DICT_TYPE.SYSTEM_STATUS)"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
@ -37,7 +37,7 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="备注" prop="remark">
|
<el-form-item label="备注" prop="remark">
|
||||||
<el-input type="textarea" :rows="4" v-model="formData.remark" placeholder="请输入备注" clearable/>
|
<el-input type="textarea" :rows="4" v-model="formData.remark" placeholder="请输入备注" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|||||||
@ -9,10 +9,10 @@
|
|||||||
|
|
||||||
>
|
>
|
||||||
<el-form-item label="工艺流程" prop="techProc">
|
<el-form-item label="工艺流程" prop="techProc">
|
||||||
<el-input v-model="techProcDisplay" placeholder="请输入工艺流程" clearable disabled/>
|
<el-input v-model="techProcDisplay" placeholder="请输入工艺流程" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="状态" prop="enabledStatus">
|
<el-form-item label="状态" prop="enabledStatus">
|
||||||
<el-select v-model="formData.enabledStatus" placeholder="请选择状态" clearable>
|
<el-select v-model="formData.enabledStatus" placeholder="请选择状态">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in getIntDictOptions(DICT_TYPE.SYSTEM_STATUS)"
|
v-for="dict in getIntDictOptions(DICT_TYPE.SYSTEM_STATUS)"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
@ -22,7 +22,7 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="备注" prop="remark">
|
<el-form-item label="备注" prop="remark">
|
||||||
<el-input type="textarea" :rows="4" v-model="formData.remark" placeholder="请输入备注" clearable />
|
<el-input type="textarea" :rows="4" v-model="formData.remark" placeholder="请输入备注" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-card class="hl-card-info">
|
<el-card class="hl-card-info">
|
||||||
@ -127,26 +127,21 @@ const convertCodeToName = (codeStr: string | undefined) => {
|
|||||||
})
|
})
|
||||||
return names.join(PROC_SEPARATOR)
|
return names.join(PROC_SEPARATOR)
|
||||||
}
|
}
|
||||||
/** 工序选择变化处理 - 按选择顺序排列 */
|
/** 工序选择变化处理 - 按列表顺序排列 */
|
||||||
const handleProcSelectionChange = (rows: ProcApi.ProcVO[]) => {
|
const handleProcSelectionChange = (rows: ProcApi.ProcVO[]) => {
|
||||||
const newCodes = new Set(rows.map(item => item.procCd))
|
selectedProcs.value = rows
|
||||||
const oldCodes = new Set(selectedProcs.value.map(item => item.procCd))
|
// 获取选中的编码集合
|
||||||
// 找出新增的工序(在 rows 中但不在 selectedProcs 中),追加到末尾
|
const selectedCodes = new Set(rows.map(item => item.procCd))
|
||||||
for (const row of rows) {
|
// 按列表顺序过滤选中的工序
|
||||||
if (!oldCodes.has(row.procCd)) {
|
const sortedSelected = procList.value.filter(item => selectedCodes.has(item.procCd))
|
||||||
selectedProcs.value.push(row)
|
// 显示用:工序名称拼接(按列表顺序)
|
||||||
}
|
techProcDisplay.value = sortedSelected.map(item => item.procName).join(PROC_SEPARATOR)
|
||||||
}
|
// 存储用:工序编码拼接(按列表顺序)
|
||||||
// 找出移除的工序(在 selectedProcs 中但不在 rows 中),从原位置删除
|
formData.value.techProc = sortedSelected.map(item => item.procCd).join(PROC_SEPARATOR)
|
||||||
selectedProcs.value = selectedProcs.value.filter(item => newCodes.has(item.procCd))
|
// 保存选中的工序编码列表(按列表顺序)
|
||||||
// 显示用:工序名称拼接(按选择顺序)
|
formData.value.procList = sortedSelected.map(item => item.procCd)
|
||||||
techProcDisplay.value = selectedProcs.value.map(item => item.procName).join(PROC_SEPARATOR)
|
|
||||||
// 存储用:工序编码拼接(按选择顺序)
|
|
||||||
formData.value.techProc = selectedProcs.value.map(item => item.procCd).join(PROC_SEPARATOR)
|
|
||||||
// 保存选中的工序编码列表(按选择顺序)
|
|
||||||
formData.value.procList = selectedProcs.value.map(item => item.procCd)
|
|
||||||
}
|
}
|
||||||
/** 设置表格选中行 - 按传入顺序排列 */
|
/** 设置表格选中行 */
|
||||||
const setSelectedRows = (procCodes) => {
|
const setSelectedRows = (procCodes) => {
|
||||||
if (!procCodes || !procTable.value || procList.value.length === 0) {
|
if (!procCodes || !procTable.value || procList.value.length === 0) {
|
||||||
return
|
return
|
||||||
@ -164,12 +159,10 @@ const setSelectedRows = (procCodes) => {
|
|||||||
procTable.value.clearSelection()
|
procTable.value.clearSelection()
|
||||||
if (codes.length > 0) {
|
if (codes.length > 0) {
|
||||||
const codeSet = new Set(codes.map(c => String(c)))
|
const codeSet = new Set(codes.map(c => String(c)))
|
||||||
// 按 codes 原始顺序筛选,并作为选中顺序
|
const rows = procList.value.filter(item => codeSet.has(String(item.procCd)))
|
||||||
selectedProcs.value = codes
|
selectedProcs.value = rows
|
||||||
.map(c => procList.value.find(item => String(item.procCd) === String(c)))
|
|
||||||
.filter(Boolean) as ProcApi.ProcVO[]
|
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
selectedProcs.value.forEach(row => {
|
rows.forEach(row => {
|
||||||
procTable.value.toggleRowSelection(row, true)
|
procTable.value.toggleRowSelection(row, true)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user