add:物料项点
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
package org.nl.common.handler;
|
||||
|
||||
@FunctionalInterface
|
||||
public
|
||||
interface LockProcess {
|
||||
void process();
|
||||
}
|
||||
@@ -9,11 +9,15 @@ import java.util.HashMap;
|
||||
|
||||
public class CodeUtil{
|
||||
public static String getNewCode(String ruleCode) {
|
||||
|
||||
final String[] code = {""};
|
||||
HashMap<String,String> map = new HashMap<>();
|
||||
map.put("flag", "1");
|
||||
map.put("code", ruleCode);
|
||||
GenCodeService service = SpringContextHolder.getBean(GenCodeServiceImpl.class);
|
||||
return service.codeDemo(map);
|
||||
String codeId = service.queryIdByCode(ruleCode);
|
||||
RedissonUtils.lock(() -> {
|
||||
code[0] = service.codeDemo(map);
|
||||
}, codeId, 3);
|
||||
return code[0];
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,66 @@
|
||||
package org.nl.wms.ql.controller.inspection;
|
||||
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.ql.service.inspection.IMdQlInspectionpointService;
|
||||
import org.nl.wms.ql.service.inspection.dao.MdQlInspectionpoint;
|
||||
import org.nl.wms.ql.service.inspection.dto.InspectionQuery;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 物料检测项点 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-04-23
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/mdQlInspectionpoint")
|
||||
public class MdQinspectionPointController {
|
||||
|
||||
@Autowired
|
||||
private IMdQlInspectionpointService inspectionpointService;
|
||||
|
||||
@GetMapping()
|
||||
public ResponseEntity<Object> query(InspectionQuery query, PageQuery pageQuery){
|
||||
return new ResponseEntity<>(TableDataInfo.build(inspectionpointService.page(query,pageQuery)),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/create")
|
||||
public ResponseEntity<Object> create(@RequestBody JSONObject req){
|
||||
Assert.notNull(req,"参数不能为空");
|
||||
inspectionpointService.create(req);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
@PostMapping("/update")
|
||||
public ResponseEntity<Object> update(@RequestBody JSONObject req){
|
||||
Assert.notNull(req,"参数不能为空");
|
||||
MdQlInspectionpoint form = req.toJavaObject(MdQlInspectionpoint.class);
|
||||
form.setUpdateId(SecurityUtils.getCurrentUserId());
|
||||
form.setUpdateName(SecurityUtils.getCurrentNickName());
|
||||
form.setUpdateTime(new Date());
|
||||
inspectionpointService.updateById(form);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/delete")
|
||||
public ResponseEntity<Object> delete(@RequestBody List<String> ids){
|
||||
Assert.notNull(ids,"参数不能为空");
|
||||
inspectionpointService.removeByIds(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
package org.nl.wms.ql.controller.inspection;
|
||||
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.nl.wms.ql.service.inspection.IMdQlInspectionpointService;
|
||||
import org.nl.wms.ql.service.inspection.IMdQlMaterialinspectionService;
|
||||
import org.nl.wms.ql.service.inspection.dao.MdQlInspectionpoint;
|
||||
import org.nl.wms.ql.service.inspection.dao.MdQlMaterialinspection;
|
||||
import org.nl.wms.ql.service.inspection.dto.MaterialInspectionQuery;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.transaction.PlatformTransactionManager;
|
||||
import org.springframework.transaction.TransactionDefinition;
|
||||
import org.springframework.transaction.TransactionStatus;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.transaction.support.DefaultTransactionDefinition;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.BiFunction;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 物料检测项点 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-04-23
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/materialInspection")
|
||||
public class MdQlMaterialinspectionController {
|
||||
|
||||
@Autowired
|
||||
private IMdQlInspectionpointService inspectionpointService;
|
||||
@Autowired
|
||||
private IMdQlMaterialinspectionService materialinspectionService;
|
||||
|
||||
|
||||
@GetMapping("/mst")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> query(MaterialInspectionQuery query, PageQuery pageQuery){
|
||||
return new ResponseEntity<>(TableDataInfo.build(materialinspectionService.pageQuery(query,pageQuery)),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/create")
|
||||
public ResponseEntity<Object> create(@RequestBody JSONObject req){
|
||||
Assert.notNull(req,"参数不能为空");
|
||||
materialinspectionService.create(req);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
@PostMapping("/update")
|
||||
public ResponseEntity<Object> update(@RequestBody JSONObject req){
|
||||
Assert.notNull(req,"参数不能为空");
|
||||
MdQlMaterialinspection form = req.toJavaObject(MdQlMaterialinspection.class);
|
||||
form.setUpdateId(SecurityUtils.getCurrentUserId());
|
||||
form.setUpdateName(SecurityUtils.getCurrentNickName());
|
||||
form.setUpdateTime(new Date());
|
||||
materialinspectionService.updateById(form);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/delete")
|
||||
public ResponseEntity<Object> delete(@RequestBody List<String> ids){
|
||||
Assert.notNull(ids,"参数不能为空");
|
||||
inspectionpointService.removeByIds(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package org.nl.wms.ql.controller.report;
|
||||
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 质检报告 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-04-23
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mdMeInspectionsheet")
|
||||
public class MdMeInspectionsheetController {
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package org.nl.wms.ql.service.inspection;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.ql.service.inspection.dao.MdQlInspectionpoint;
|
||||
import org.nl.wms.ql.service.inspection.dto.InspectionQuery;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 检测项点 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-04-23
|
||||
*/
|
||||
public interface IMdQlInspectionpointService extends IService<MdQlInspectionpoint> {
|
||||
|
||||
void create(JSONObject form);
|
||||
|
||||
Page page(InspectionQuery query, PageQuery pageQuery);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package org.nl.wms.ql.service.inspection;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.ql.service.inspection.dao.MdQlMaterialinspection;
|
||||
import org.nl.wms.ql.service.inspection.dto.MaterialInspectionQuery;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 物料检测项点 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-04-23
|
||||
*/
|
||||
public interface IMdQlMaterialinspectionService extends IService<MdQlMaterialinspection> {
|
||||
void create(JSONObject form);
|
||||
Page pageQuery(MaterialInspectionQuery query, PageQuery pageQuery);
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
package org.nl.wms.ql.service.inspection.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 检测项点
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-04-23
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("md_ql_inspectionpoint")
|
||||
public class MdQlInspectionpoint implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
@TableId(value = "inspection_id", type = IdType.NONE)
|
||||
private String inspectionId;
|
||||
|
||||
/**
|
||||
* 项目编码
|
||||
*/
|
||||
private String inspectionCode;
|
||||
|
||||
/**
|
||||
* 项目名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 检测类型
|
||||
*/
|
||||
private String inspectionType;
|
||||
|
||||
/**
|
||||
* 标准值
|
||||
*/
|
||||
private String standard;
|
||||
|
||||
/**
|
||||
* 创建人姓名
|
||||
*/
|
||||
private String createName;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createId;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private String updateId;
|
||||
|
||||
/**
|
||||
* 修改人姓名
|
||||
*/
|
||||
private String updateName;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
package org.nl.wms.ql.service.inspection.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.util.Date;
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 物料检测项点
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-04-23
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("md_ql_materialinspection")
|
||||
public class MdQlMaterialinspection implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 物料id
|
||||
*/
|
||||
@TableId(value = "material_code")
|
||||
private String material_code;
|
||||
/**
|
||||
* 检测项名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 项目集合{"项目编号":"true"/123.000~123.500}
|
||||
*/
|
||||
private String inspections;
|
||||
|
||||
/**
|
||||
* 版本号
|
||||
*/
|
||||
private String version;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createId;
|
||||
|
||||
/**
|
||||
* 创建人姓名
|
||||
*/
|
||||
private String createName;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private String updateId;
|
||||
|
||||
/**
|
||||
* 修改人姓名
|
||||
*/
|
||||
private String updateName;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
private Boolean isUsed;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package org.nl.wms.ql.service.inspection.dao.TypeHandler;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import jdk.nashorn.internal.parser.JSONParser;
|
||||
import org.apache.ibatis.type.*;
|
||||
import org.nl.wms.ql.service.inspection.dao.MdQlInspectionpoint;
|
||||
|
||||
import java.sql.CallableStatement;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2023/4/24 09:50
|
||||
*/
|
||||
@MappedJdbcTypes(JdbcType.VARCHAR)
|
||||
@MappedTypes(JSONArray.class)
|
||||
public class InspectionArrayHandler extends BaseTypeHandler<List<MdQlInspectionpoint>> {
|
||||
@Override
|
||||
public void setNonNullParameter(PreparedStatement ps, int i, List<MdQlInspectionpoint> parameter, JdbcType jdbcType) throws SQLException {
|
||||
ps.setString(i, JSON.toJSONString(parameter));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MdQlInspectionpoint> getNullableResult(ResultSet rs, String columnName) throws SQLException {
|
||||
return JSONArray.parseArray(rs.getString(columnName),MdQlInspectionpoint.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MdQlInspectionpoint> getNullableResult(ResultSet rs, int columnIndex) throws SQLException {
|
||||
return JSONArray.parseArray(rs.getString(columnIndex),MdQlInspectionpoint.class);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MdQlInspectionpoint> getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
|
||||
return JSONArray.parseArray(cs.getString(columnIndex),MdQlInspectionpoint.class);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package org.nl.wms.ql.service.inspection.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.nl.wms.ql.service.inspection.dao.MdQlInspectionpoint;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 检测项点 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-04-23
|
||||
*/
|
||||
public interface MdQlInspectionpointMapper extends BaseMapper<MdQlInspectionpoint> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package org.nl.wms.ql.service.inspection.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.nl.wms.ql.service.inspection.dao.MdQlMaterialinspection;
|
||||
import org.nl.wms.ql.service.inspection.dto.MaterialInspectionQuery;
|
||||
import org.nl.wms.ql.service.inspection.dto.MdQlMaterialinspectionDto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 物料检测项点 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-04-23
|
||||
*/
|
||||
public interface MdQlMaterialinspectionMapper extends BaseMapper<MdQlMaterialinspection> {
|
||||
|
||||
List<MdQlMaterialinspectionDto> pageQuery(@Param("query") MaterialInspectionQuery query);
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.nl.wms.ql.service.inspection.dao.mapper.MdQlMaterialinspectionMapper">
|
||||
<resultMap id="BaseResultMap" type="org.nl.wms.ql.service.inspection.dto.MdQlMaterialinspectionDto" autoMapping="true">
|
||||
<id column="id" jdbcType="BIGINT" property="materialCode" />
|
||||
<result column="inspections" typeHandler="org.nl.wms.ql.service.inspection.dao.TypeHandler.InspectionArrayHandler" property="inspections"></result>
|
||||
</resultMap>
|
||||
<select id="pageQuery" resultMap="BaseResultMap">
|
||||
select
|
||||
`name`
|
||||
,material_code
|
||||
,inspections,version
|
||||
,create_id
|
||||
,create_name
|
||||
,create_time
|
||||
,update_id
|
||||
,update_name
|
||||
,update_time
|
||||
,is_used
|
||||
from md_ql_materialinspection
|
||||
<where>
|
||||
<if test="query.blurry != null and query.blurry != ''">
|
||||
material_code '%${query.blurry}%'
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,19 @@
|
||||
package org.nl.wms.ql.service.inspection.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import org.nl.common.domain.query.BaseQuery;
|
||||
import org.nl.common.domain.query.QParam;
|
||||
import org.nl.common.enums.QueryTEnum;
|
||||
import org.nl.system.service.dept.dao.SysDept;
|
||||
import org.nl.wms.ql.service.inspection.dao.MdQlInspectionpoint;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2022/12/15 4:20 下午
|
||||
*/
|
||||
@Data
|
||||
public class InspectionQuery extends BaseQuery<MdQlInspectionpoint> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package org.nl.wms.ql.service.inspection.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import org.nl.common.domain.query.BaseQuery;
|
||||
import org.nl.wms.ql.service.inspection.dao.MdQlInspectionpoint;
|
||||
import org.nl.wms.ql.service.inspection.dao.MdQlMaterialinspection;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2022/12/15 4:20 下午
|
||||
*/
|
||||
@Data
|
||||
public class MaterialInspectionQuery extends BaseQuery<MdQlMaterialinspection> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package org.nl.wms.ql.service.inspection.dto;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nl.wms.ql.service.inspection.dao.MdQlInspectionpoint;
|
||||
import org.nl.wms.ql.service.inspection.dao.MdQlMaterialinspection;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 物料检测项点
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-04-23
|
||||
*/
|
||||
@Data
|
||||
public class MdQlMaterialinspectionDto implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 物料id
|
||||
*/
|
||||
private String materialCode;
|
||||
/**
|
||||
* 检测项名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 项目集合{"项目编号":"true"/123.000~123.500}
|
||||
*/
|
||||
private List<MdQlInspectionpoint> inspections;
|
||||
|
||||
/**
|
||||
* 版本号
|
||||
*/
|
||||
private String version;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createId;
|
||||
|
||||
/**
|
||||
* 创建人姓名
|
||||
*/
|
||||
private String createName;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private String updateId;
|
||||
|
||||
/**
|
||||
* 修改人姓名
|
||||
*/
|
||||
private String updateName;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
private Boolean isUsed;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package org.nl.wms.ql.service.inspection.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import io.jsonwebtoken.lang.Assert;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.modules.system.util.CodeUtil;
|
||||
import org.nl.system.service.dept.dao.SysDept;
|
||||
import org.nl.wms.ql.service.inspection.IMdQlInspectionpointService;
|
||||
import org.nl.wms.ql.service.inspection.dao.MdQlInspectionpoint;
|
||||
import org.nl.wms.ql.service.inspection.dao.mapper.MdQlInspectionpointMapper;
|
||||
import org.nl.wms.ql.service.inspection.dto.InspectionQuery;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 检测项点 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-04-23
|
||||
*/
|
||||
@Service
|
||||
public class MdQlInspectionpointServiceImpl extends ServiceImpl<MdQlInspectionpointMapper, MdQlInspectionpoint> implements IMdQlInspectionpointService {
|
||||
|
||||
|
||||
@Override
|
||||
public void create(JSONObject form) {
|
||||
Assert.notNull(form,"请求参数不能为空");
|
||||
MdQlInspectionpoint param = form.toJavaObject(MdQlInspectionpoint.class);
|
||||
param.setInspectionId(IdUtil.getStringId());
|
||||
param.setInspectionCode(CodeUtil.getNewCode("INSPECTION_POINT"));
|
||||
param.setCreateName(SecurityUtils.getCurrentNickName());
|
||||
param.setCreateId(SecurityUtils.getCurrentUserId());
|
||||
param.setCreateTime(new Date());
|
||||
this.save(param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page page(InspectionQuery query, PageQuery pageQuery) {
|
||||
return this.page(pageQuery.build(MdQlInspectionpoint.class), query.build());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package org.nl.wms.ql.service.inspection.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import io.jsonwebtoken.lang.Assert;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.system.service.user.dto.SysUserDetail;
|
||||
import org.nl.wms.ql.service.inspection.IMdQlMaterialinspectionService;
|
||||
import org.nl.wms.ql.service.inspection.dao.MdQlInspectionpoint;
|
||||
import org.nl.wms.ql.service.inspection.dao.MdQlMaterialinspection;
|
||||
import org.nl.wms.ql.service.inspection.dao.mapper.MdQlMaterialinspectionMapper;
|
||||
import org.nl.wms.ql.service.inspection.dto.MaterialInspectionQuery;
|
||||
import org.nl.wms.ql.service.inspection.dto.MdQlMaterialinspectionDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 物料检测项点 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-04-23
|
||||
*/
|
||||
@Service
|
||||
public class MdQlMaterialinspectionServiceImpl extends ServiceImpl<MdQlMaterialinspectionMapper, MdQlMaterialinspection> implements IMdQlMaterialinspectionService {
|
||||
|
||||
@Resource
|
||||
MdQlMaterialinspectionMapper mdQlMaterialinspectionMapper;
|
||||
@Override
|
||||
public void create(JSONObject form) {
|
||||
Assert.notNull(form,"请求参数不能为空");
|
||||
MdQlMaterialinspection param = form.toJavaObject(MdQlMaterialinspection.class);
|
||||
param.setInspections(IdUtil.getStringId());
|
||||
param.setCreateName(SecurityUtils.getCurrentNickName());
|
||||
param.setCreateId(SecurityUtils.getCurrentUserId());
|
||||
param.setCreateTime(new Date());
|
||||
this.save(param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page pageQuery(MaterialInspectionQuery query, PageQuery pageQuery) {
|
||||
return this.page(pageQuery.build(MdQlMaterialinspection.class), query.build());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package org.nl.wms.ql.service.report;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.wms.ql.service.report.dao.MdMeInspectionsheet;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 质检报告 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-04-23
|
||||
*/
|
||||
public interface IMdMeInspectionsheetService extends IService<MdMeInspectionsheet> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
package org.nl.wms.ql.service.report.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.util.Date;
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 质检报告
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-04-23
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("md_me_inspectionsheet")
|
||||
public class MdMeInspectionsheet implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 质检id
|
||||
*/
|
||||
private String inspectionsheetId;
|
||||
|
||||
/**
|
||||
* 质检编号
|
||||
*/
|
||||
private String inspectionsheetCode;
|
||||
|
||||
/**
|
||||
* 物料id
|
||||
*/
|
||||
private String materialId;
|
||||
|
||||
/**
|
||||
* 批次
|
||||
*/
|
||||
private String pcsn;
|
||||
|
||||
/**
|
||||
* 质检单类型
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 检测项目集合
|
||||
*/
|
||||
private String inspections;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createId;
|
||||
|
||||
/**
|
||||
* 创建人姓名
|
||||
*/
|
||||
private String createName;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private String updateId;
|
||||
|
||||
/**
|
||||
* 修改人姓名
|
||||
*/
|
||||
private String updateName;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private Boolean isDeleted;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package org.nl.wms.ql.service.report.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.nl.wms.ql.service.report.dao.MdMeInspectionsheet;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 质检报告 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-04-23
|
||||
*/
|
||||
public interface MdMeInspectionsheetMapper extends BaseMapper<MdMeInspectionsheet> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.nl.wms.ql.service.report.dao.mapper.MdMeInspectionsheetMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,21 @@
|
||||
package org.nl.wms.ql.service.report.impl;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.wms.ql.service.report.IMdMeInspectionsheetService;
|
||||
import org.nl.wms.ql.service.report.dao.MdMeInspectionsheet;
|
||||
import org.nl.wms.ql.service.report.dao.mapper.MdMeInspectionsheetMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 质检报告 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-04-23
|
||||
*/
|
||||
@Service
|
||||
public class MdMeInspectionsheetServiceImpl extends ServiceImpl<MdMeInspectionsheetMapper, MdMeInspectionsheet> implements IMdMeInspectionsheetService {
|
||||
|
||||
}
|
||||
142
mes/qd/src/views/wms/ql/inspection/index.vue
Normal file
142
mes/qd/src/views/wms/ql/inspection/index.vue
Normal file
@@ -0,0 +1,142 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<label class="el-form-item-label">模糊搜索</label>
|
||||
<el-input v-model="query.blurry" clearable placeholder="项点名称" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
||||
<rrOperation :crud="crud" />
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<!--表单组件-->
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="475px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="120px">
|
||||
<el-form-item label="项点名称" prop="name">
|
||||
<el-input v-model="form.name" style="width: 250px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="标准值">
|
||||
<el-input v-model="form.standard" style="width: 250px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="项点类型" prop="inspectionType">
|
||||
<el-select
|
||||
v-model="form.inspectionType"
|
||||
placeholder=""
|
||||
style="width: 250px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.INSPECTION_POINT_TYPE"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="form.remark" :rows="3" type="textarea" style="width: 250px;" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="inspectionCode" label="项点编码" />
|
||||
<el-table-column prop="name" label="项点名称" />
|
||||
<el-table-column prop="standard" label="标准值">
|
||||
<template slot-scope="scope">
|
||||
{{ is_or_no(scope.row.standard, scope.row.inspectionType) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="inspectionType" label="项点类型">
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.INSPECTION_POINT_TYPE[scope.row.inspectionType] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注" />
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudInspection from '@/views/wms/ql/inspection/inspectionpoint'
|
||||
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
|
||||
const defaultForm = { inspectionType: '1', inspectionId: null, inspectionCode: null, name: null, standard: null, remark: null }
|
||||
export default {
|
||||
name: 'InspectionPoint',
|
||||
dicts: ['INSPECTION_POINT_TYPE'],
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({ title: '质检项点', url: 'api/mdQlInspectionpoint', idField: 'inspectionId', sort: 'id,desc',
|
||||
optShow: {
|
||||
add: true,
|
||||
edit: true,
|
||||
del: true,
|
||||
reset: true,
|
||||
download: false
|
||||
},
|
||||
crudMethod: { ...crudInspection }})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permission: {
|
||||
},
|
||||
rules: {
|
||||
inspectionCode: [
|
||||
{ required: true, message: '项点编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: '项点名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
inspectionType: [
|
||||
{ required: true, message: '项点类型不能为空', trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
queryTypeOptions: [
|
||||
{ key: 'inspection_code', display_name: '项点编码' }
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
is_or_no(val, type) {
|
||||
if (type === '01' && val === '1') {
|
||||
return '是'
|
||||
} else if (type === '01' && val === '0') {
|
||||
return '否'
|
||||
} else {
|
||||
return val
|
||||
}
|
||||
},
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
27
mes/qd/src/views/wms/ql/inspection/inspectionpoint.js
Normal file
27
mes/qd/src/views/wms/ql/inspection/inspectionpoint.js
Normal file
@@ -0,0 +1,27 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: '/api/mdQlInspectionpoint/create',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: '/api/mdQlInspectionpoint/delete',
|
||||
method: 'post',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: '/api/mdQlInspectionpoint/update',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del }
|
||||
320
mes/qd/src/views/wms/ql/materialInspection/AddDialog.vue
Normal file
320
mes/qd/src/views/wms/ql/materialInspection/AddDialog.vue
Normal file
@@ -0,0 +1,320 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog
|
||||
title="物料检测方案设置"
|
||||
append-to-body
|
||||
:visible.sync="crud.status.cu > 0"
|
||||
fullscreen
|
||||
destroy-on-close
|
||||
:before-close="crud.cancelCU"
|
||||
@open="open"
|
||||
>
|
||||
<el-form :inline="true" :model="form" class="demo-form-inline">
|
||||
|
||||
<el-form-item label="物料" prop="material_name">
|
||||
<el-input
|
||||
v-model="form.material_name"
|
||||
style="width: 280px;"
|
||||
placeholder="请选择物料"
|
||||
clearable
|
||||
prefix-icon="el-icon-search"
|
||||
@focus="materShow=true"
|
||||
@clear="form.material_id=''"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="false" label="物料" prop="material_id">
|
||||
<el-input v-model.trim="form.material_id" style="width: 280px;" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="方案名称">
|
||||
<el-select
|
||||
v-model="form.inspection_scheme_id"
|
||||
filterable
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="方案名称"
|
||||
class="filter-item"
|
||||
@change="handDtl"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in selectList"
|
||||
:label="item.inspection_scheme_name"
|
||||
:value="item.inspection_scheme_id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-form-item>
|
||||
<el-button icon="el-icon-check" type="success" @click="onSubmit">保存</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button icon="el-icon-error" type="info" @click="crud.cancelCU">关闭</el-button>
|
||||
</el-form-item>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
:data="form.tableData"
|
||||
border
|
||||
size="mini"
|
||||
stripe
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column
|
||||
v-if="false"
|
||||
prop="inspection_item_id"
|
||||
label="项点标识"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="order_index"
|
||||
width="60"
|
||||
label="序号"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.$index + 1 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="inspection_item_code"
|
||||
label="项点编码"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="inspection_item_name"
|
||||
show-overflow-tooltip
|
||||
label="项点名称"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="inspection_item_type_name"
|
||||
label="项点类别"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="workprocedure_name"
|
||||
label="工序名称"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="inspection_type_name"
|
||||
label="检测方式"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="down_limit"
|
||||
label="合格下限(≥)"
|
||||
width="155"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-input-number
|
||||
v-if="form.tableData[scope.$index].inspection_type==='02'"
|
||||
v-model="form.tableData[scope.$index].down_limit"
|
||||
:precision="4"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
prop="up_limit"
|
||||
label="合格上限(≤)"
|
||||
width="155"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-input-number
|
||||
v-if="form.tableData[scope.$index].inspection_type==='02'"
|
||||
v-model="form.tableData[scope.$index].up_limit"
|
||||
:precision="4"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
prop="down_limit_value"
|
||||
label="下限临界值(≤)"
|
||||
width="155"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-input-number
|
||||
v-if="form.tableData[scope.$index].inspection_type==='02'"
|
||||
v-model="form.tableData[scope.$index].down_limit_value"
|
||||
:precision="4"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
prop="up_limit_value"
|
||||
label="上限临界值(≥)"
|
||||
width="155"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-input-number
|
||||
v-if="form.tableData[scope.$index].inspection_type==='02'"
|
||||
v-model="form.tableData[scope.$index].up_limit_value"
|
||||
:precision="4"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="remark"
|
||||
label="备注"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model.trim="form.tableData[scope.$index].remark" size="mini" class="edit-input" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- <span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="dialogVisible = false">确 定</el-button>
|
||||
</span>-->
|
||||
</el-dialog>
|
||||
|
||||
<MaterDtl
|
||||
:dialog-show.sync="materShow"
|
||||
:is-single="true"
|
||||
:mater-opt-code="'00'"
|
||||
@tableChanged2="tableChanged2"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CRUD, { crud, form } from '@crud/crud'
|
||||
import {} from '@/views/wms/ql/materialInspection/materialInspection'
|
||||
import MaterDtl from '@/views/wms/pub/MaterDialog'
|
||||
import crudProductStandard from '@/api/wms/basedata/ql/productStandard'
|
||||
|
||||
const defaultForm = {
|
||||
material_id: '',
|
||||
material_code: '',
|
||||
material_name: '',
|
||||
inspection_scheme_id: '',
|
||||
tableData: []
|
||||
}
|
||||
export default {
|
||||
name: 'AddDialog',
|
||||
components: { MaterDtl },
|
||||
mixins: [crud(), form(defaultForm)],
|
||||
data() {
|
||||
return {
|
||||
selectList: [],
|
||||
materShow: false,
|
||||
dialogVisible: false,
|
||||
inspectionItemType: null
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
crudInspectionSchemeMst.selectList().then(res => {
|
||||
this.selectList = res
|
||||
})
|
||||
this.handDtl2()
|
||||
},
|
||||
handDtl2() { // 修改的时候有物料标识
|
||||
const param = {
|
||||
inspection_scheme_id: this.form.inspection_scheme_id,
|
||||
material_id: this.form.material_id
|
||||
}
|
||||
crudProductStandard.getInspectionSchemeDtl(param).then(res => {
|
||||
const map1 = res.map(function(item) {
|
||||
if (!item.down_limit_value) item.down_limit_value = undefined
|
||||
if (!item.up_limit_value) item.up_limit_value = undefined
|
||||
if (!item.down_limit) item.down_limit = undefined
|
||||
if (!item.up_limit) item.up_limit = undefined
|
||||
return item
|
||||
})
|
||||
this.form.tableData = map1
|
||||
})
|
||||
},
|
||||
handDtl() {
|
||||
const param = {
|
||||
inspection_scheme_id: this.form.inspection_scheme_id
|
||||
}
|
||||
crudProductStandard.getInspectionSchemeDtl(param).then(res => {
|
||||
const map1 = res.map(function(item) {
|
||||
if (!item.down_limit_value) item.down_limit_value = undefined
|
||||
if (!item.up_limit_value) item.up_limit_value = undefined
|
||||
if (!item.down_limit) item.down_limit = undefined
|
||||
if (!item.up_limit) item.up_limit = undefined
|
||||
return item
|
||||
})
|
||||
this.form.tableData = map1
|
||||
})
|
||||
},
|
||||
hand() {
|
||||
|
||||
},
|
||||
onSubmit() {
|
||||
let optType = null
|
||||
|
||||
const isCopyAdd = this.$parent.isCopyAdd
|
||||
debugger
|
||||
if (isCopyAdd === '1') {
|
||||
optType = '01' // 复制新增
|
||||
} else if (this.crud.status.add === 1) {
|
||||
optType = '02' // 新增
|
||||
} else {
|
||||
this.crud.status.add
|
||||
optType = '03' // 修改
|
||||
}
|
||||
// 判断是新增还是修改还是复制新增
|
||||
this.form.optType = optType
|
||||
const arr = this.form.tableData
|
||||
const that = this
|
||||
const errMsgList = []
|
||||
const data = arr.map(function(item) {
|
||||
debugger
|
||||
// 合格上下限同时为填入的数字或同时为空
|
||||
if ((!isNaN(item.up_limit) && !isNaN(item.down_limit)) || (isNaN(item.up_limit) && isNaN(item.down_limit))) {
|
||||
// 临界上下限同时为填入的数字或同时为空
|
||||
if ((!isNaN(item.up_limit_value) && !isNaN(item.down_limit_value)) || (isNaN(item.up_limit_value) && isNaN(item.down_limit_value))) {
|
||||
if (isNaN(item.up_limit) && !isNaN(item.up_limit_value)) {
|
||||
errMsgList.push(item.order_index)
|
||||
}
|
||||
return item
|
||||
} else {
|
||||
errMsgList.push(item.order_index)
|
||||
}
|
||||
} else {
|
||||
errMsgList.push(item.order_index)
|
||||
return item
|
||||
}
|
||||
})
|
||||
if (errMsgList.length > 0) {
|
||||
that.crud.notify(errMsgList.toString() + '行格式错误,请检查!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
|
||||
this.form.tableData = data
|
||||
crudProductStandard.saveData(this.form).then(res => {
|
||||
this.crud.cancelCU()
|
||||
this.$parent.isCopyAdd = null
|
||||
this.crud.toQuery()
|
||||
this.notify('操作成功', 'success')
|
||||
})
|
||||
},
|
||||
notify(title, type) {
|
||||
this.$notify({
|
||||
title: title,
|
||||
type: type,
|
||||
duration: 2500
|
||||
})
|
||||
},
|
||||
tableChanged2(data) {
|
||||
// 新增一行物料时,给行进行赋值
|
||||
this.form.material_id = data.material_id
|
||||
this.form.material_code = data.material_code
|
||||
this.form.material_name = data.material_name + '##' + data.material_code
|
||||
},
|
||||
close() {
|
||||
this.$emit('update:visiable1', false)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss">
|
||||
.edit-input {
|
||||
.el-input__inner {
|
||||
border: 1px solid #e5e6e7;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
142
mes/qd/src/views/wms/ql/materialInspection/index.vue
Normal file
142
mes/qd/src/views/wms/ql/materialInspection/index.vue
Normal file
@@ -0,0 +1,142 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<label class="el-form-item-label">模糊搜索</label>
|
||||
<el-input v-model="query.blurry" clearable placeholder="项点名称" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
||||
<rrOperation :crud="crud" />
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<!--表单组件-->
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="475px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="120px">
|
||||
<el-form-item label="项点名称" prop="name">
|
||||
<el-input v-model="form.name" style="width: 250px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="标准值">
|
||||
<el-input v-model="form.standard" style="width: 250px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="项点类型" prop="inspectionType">
|
||||
<el-select
|
||||
v-model="form.inspectionType"
|
||||
placeholder=""
|
||||
style="width: 250px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.INSPECTION_POINT_TYPE"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="form.remark" :rows="3" type="textarea" style="width: 250px;" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="inspectionCode" label="项点编码" />
|
||||
<el-table-column prop="name" label="项点名称" />
|
||||
<el-table-column prop="standard" label="标准值">
|
||||
<template slot-scope="scope">
|
||||
{{ is_or_no(scope.row.standard, scope.row.inspectionType) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="inspectionType" label="项点类型">
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.INSPECTION_POINT_TYPE[scope.row.inspectionType] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注" />
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudInspection from '@/views/wms/ql/inspection/inspectionpoint'
|
||||
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
|
||||
const defaultForm = { inspectionType: '1', inspectionId: null, inspectionCode: null, name: null, standard: null, remark: null }
|
||||
export default {
|
||||
name: 'InspectionPoint',
|
||||
dicts: ['INSPECTION_POINT_TYPE'],
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({ title: '质检项点', url: 'api/mdQlInspectionpoint', idField: 'inspectionId', sort: 'id,desc',
|
||||
optShow: {
|
||||
add: true,
|
||||
edit: true,
|
||||
del: true,
|
||||
reset: true,
|
||||
download: false
|
||||
},
|
||||
crudMethod: { ...crudInspection }})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permission: {
|
||||
},
|
||||
rules: {
|
||||
inspectionCode: [
|
||||
{ required: true, message: '项点编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: '项点名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
inspectionType: [
|
||||
{ required: true, message: '项点类型不能为空', trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
queryTypeOptions: [
|
||||
{ key: 'inspection_code', display_name: '项点编码' }
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
is_or_no(val, type) {
|
||||
if (type === '01' && val === '1') {
|
||||
return '是'
|
||||
} else if (type === '01' && val === '0') {
|
||||
return '否'
|
||||
} else {
|
||||
return val
|
||||
}
|
||||
},
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,35 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: '/api/materialInspection/create',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: '/api/materialInspection/delete',
|
||||
method: 'post',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: '/api/materialInspection/update',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: '/api/materialInspection/update',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del }
|
||||
Reference in New Issue
Block a user