rev:添加质检功能
This commit is contained in:
@@ -17,6 +17,16 @@ public enum QueryTEnum {
|
||||
EQ((q, k, v) -> { q.eq(k[0],v); }),
|
||||
IN((q, key, o) -> { if (o instanceof Collection){ q.in(key[0],(Collection) o); } }),
|
||||
LK((q, keys, o) -> { for (String key : keys) { q.like(key,o); } }),
|
||||
ORLK((q, k, o) -> { q.and(query -> {
|
||||
QueryWrapper queryWrapper = (QueryWrapper) query;
|
||||
for (int i = 0; i < k.length; i++) {
|
||||
queryWrapper.like(k[i],o);
|
||||
if (i != (k.length-1)){
|
||||
queryWrapper.or();
|
||||
}
|
||||
}
|
||||
});
|
||||
}),
|
||||
LE((q, k, v) -> { q.le(k[0],v); }),
|
||||
BY((q, k, v) -> { q.orderByDesc(k[0],v); }),
|
||||
NO((q, k, v) -> { q.isNull(k[0]); }),
|
||||
|
||||
@@ -1,19 +1,18 @@
|
||||
package org.nl.wms.quality_manage.controller.inspection;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.nl.common.anno.Log;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.quality_manage.service.inspection.IQlTestInspectionitempointService;
|
||||
import org.nl.wms.quality_manage.service.inspection.dao.QlTestInspectionitempoint;
|
||||
import org.nl.wms.quality_manage.service.inspection.dto.ItemPointQuery;
|
||||
import org.nl.wms.storage_manage.semimanage.service.check.dto.CheckQuery;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -36,5 +35,32 @@ public class QlTestInspectionitempointController {
|
||||
public ResponseEntity<Object> query(ItemPointQuery query, PageQuery page) {
|
||||
return new ResponseEntity<>(inspectionitempointService.pageQuery(query, page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增检测项点")
|
||||
@ApiOperation("新增检测项点")
|
||||
public ResponseEntity<Object> create(@RequestBody JSONObject whereJson) {
|
||||
inspectionitempointService.create(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/update")
|
||||
@Log("修改检测项点")
|
||||
@ApiOperation("修改检测项点")
|
||||
public ResponseEntity<Object> update(@RequestBody JSONObject whereJson) {
|
||||
inspectionitempointService.update(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("delete")
|
||||
@Log("修改检测项点")
|
||||
@ApiOperation("新增检测项点")
|
||||
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
|
||||
for (Long id : ids) {
|
||||
inspectionitempointService.removeById(id);
|
||||
}
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,19 @@
|
||||
package org.nl.wms.quality_manage.controller.inspection;
|
||||
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.nl.common.anno.Log;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.quality_manage.service.inspection.IQlTestInspectionschemedtlproductstandardService;
|
||||
import org.nl.wms.quality_manage.service.inspection.dao.QlTestInspectionschemedtlproductstandard;
|
||||
import org.nl.wms.quality_manage.service.inspection.dto.StandardQuery;
|
||||
import org.nl.wms.storage_manage.semimanage.service.iostorInv.dto.BcpIostorInvQuery;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -14,8 +24,43 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
* @since 2023-05-06
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/qlTestInspectionschemedtlproductstandard")
|
||||
@RequestMapping("/api/productStandard")
|
||||
public class QlTestInspectionschemedtlproductstandardController {
|
||||
|
||||
@Autowired
|
||||
private IQlTestInspectionschemedtlproductstandardService standardService;
|
||||
|
||||
@PostMapping("/saveData")
|
||||
@Log("新增检测方案标准")
|
||||
@ApiOperation("新增检测方案标准")
|
||||
public ResponseEntity<Object> create(@RequestBody JSONObject whereJson) {
|
||||
standardService.saveData(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
@Log("查询检测方案标准")
|
||||
@ApiOperation("查询检测方案标准")
|
||||
public ResponseEntity<Object> query(StandardQuery query, PageQuery page) {
|
||||
return new ResponseEntity<>(standardService.query(query, page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/getDtl")
|
||||
@Log("查询检测方案标准明细")
|
||||
@ApiOperation("查询检测方案标准明细")
|
||||
public ResponseEntity<Object> query(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(standardService.getDtl(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/delete")
|
||||
@Log("删除检测方案标准")
|
||||
@ApiOperation("删除检测方案标准")
|
||||
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
|
||||
for (Long id : ids){
|
||||
standardService.remove(new QueryWrapper<QlTestInspectionschemedtlproductstandard>()
|
||||
.lambda().eq(QlTestInspectionschemedtlproductstandard::getMaterial_id,id));
|
||||
}
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,22 @@
|
||||
package org.nl.wms.quality_manage.controller.inspection;
|
||||
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.nl.common.anno.Log;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.quality_manage.service.inspection.IQlTestInspectionschemedtlService;
|
||||
import org.nl.wms.quality_manage.service.inspection.IQlTestInspectionschememstService;
|
||||
import org.nl.wms.quality_manage.service.inspection.dao.QlTestInspectionschemedtl;
|
||||
import org.nl.wms.quality_manage.service.inspection.dao.QlTestInspectionschememst;
|
||||
import org.nl.wms.quality_manage.service.inspection.dto.ItemPointQuery;
|
||||
import org.nl.wms.quality_manage.service.inspection.dto.SchemeQuery;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -14,8 +27,62 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
* @since 2023-05-06
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/qlTestInspectionschememst")
|
||||
@RequestMapping("/api/inspectionSchemeMst")
|
||||
public class QlTestInspectionschememstController {
|
||||
|
||||
@Autowired
|
||||
private IQlTestInspectionschememstService inspectionschememstService;
|
||||
|
||||
@Autowired
|
||||
private IQlTestInspectionschemedtlService inspectionschemedtlService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询检测方案")
|
||||
@ApiOperation("查询检测方案")
|
||||
public ResponseEntity<Object> query(SchemeQuery query, PageQuery page) {
|
||||
return new ResponseEntity<>(inspectionschememstService.pageQuery(query, page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增检测方案")
|
||||
@ApiOperation("新增检测方案")
|
||||
public ResponseEntity<Object> create(@RequestBody JSONObject whereJson) {
|
||||
inspectionschememstService.create(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/update")
|
||||
@Log("修改检测方案")
|
||||
@ApiOperation("修改检测方案")
|
||||
public ResponseEntity<Object> update(@RequestBody JSONObject whereJson) {
|
||||
inspectionschememstService.update(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/delete")
|
||||
@Log("删除检测方案")
|
||||
@ApiOperation("删除检测方案")
|
||||
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
|
||||
for (Long id : ids) {
|
||||
inspectionschememstService.removeById(id);
|
||||
inspectionschemedtlService.remove(new QueryWrapper<QlTestInspectionschemedtl>().lambda().eq(QlTestInspectionschemedtl::getInspection_scheme_id, id));
|
||||
}
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/getDtl")
|
||||
@Log("获取方案明细")
|
||||
@ApiOperation("获取方案明细")
|
||||
public ResponseEntity<Object> getDtl(@RequestBody QlTestInspectionschememst mst) {
|
||||
return new ResponseEntity<>(inspectionschemedtlService.getDtl(mst),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/selectList")
|
||||
@Log("检测方案下拉框")
|
||||
@ApiOperation("检测方案下拉框")
|
||||
public ResponseEntity<Object> selectList() {
|
||||
return new ResponseEntity<>(inspectionschememstService.list(new QueryWrapper<QlTestInspectionschememst>().lambda().eq(QlTestInspectionschememst::getIs_used,true)),HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.wms.quality_manage.service.inspection;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.quality_manage.service.inspection.dao.QlTestInspectionitempoint;
|
||||
@@ -17,4 +18,7 @@ public interface IQlTestInspectionitempointService extends IService<QlTestInspec
|
||||
|
||||
Object pageQuery(ItemPointQuery query, PageQuery page);
|
||||
|
||||
void create(JSONObject jo);
|
||||
void update(JSONObject jo);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,14 @@
|
||||
package org.nl.wms.quality_manage.service.inspection;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.wms.quality_manage.service.inspection.dao.QlTestInspectionschemedtl;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.wms.quality_manage.service.inspection.dao.QlTestInspectionschememst;
|
||||
import org.nl.wms.storage_manage.semimanage.service.check.dao.StIvtCheckmstBcp;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -12,5 +19,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
* @since 2023-05-06
|
||||
*/
|
||||
public interface IQlTestInspectionschemedtlService extends IService<QlTestInspectionschemedtl> {
|
||||
double create(JSONArray rows, QlTestInspectionschememst mst);
|
||||
|
||||
List<Map> getDtl(QlTestInspectionschememst mst);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,14 @@
|
||||
package org.nl.wms.quality_manage.service.inspection;
|
||||
|
||||
import org.nl.wms.quality_manage.service.inspection.dao.QlTestInspectionschemedtlproductstandard;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.quality_manage.service.inspection.dao.QlTestInspectionschemedtlproductstandard;
|
||||
import org.nl.wms.quality_manage.service.inspection.dao.QlTestInspectionschememst;
|
||||
import org.nl.wms.quality_manage.service.inspection.dto.StandardQuery;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -13,4 +20,9 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
*/
|
||||
public interface IQlTestInspectionschemedtlproductstandardService extends IService<QlTestInspectionschemedtlproductstandard> {
|
||||
|
||||
void saveData(JSONObject jo);
|
||||
|
||||
Object query(StandardQuery query, PageQuery page);
|
||||
|
||||
List<Map> getDtl(JSONObject whereJson);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
package org.nl.wms.quality_manage.service.inspection;
|
||||
|
||||
import org.nl.wms.quality_manage.service.inspection.dao.QlTestInspectionschememst;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.quality_manage.service.inspection.dao.QlTestInspectionschememst;
|
||||
import org.nl.wms.quality_manage.service.inspection.dto.SchemeQuery;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -13,4 +16,8 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
*/
|
||||
public interface IQlTestInspectionschememstService extends IService<QlTestInspectionschememst> {
|
||||
|
||||
Object pageQuery(SchemeQuery query, PageQuery page);
|
||||
void create(JSONObject jo);
|
||||
|
||||
void update(JSONObject jo);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.wms.quality_manage.service.inspection.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.util.Date;
|
||||
import java.io.Serializable;
|
||||
@@ -24,6 +25,7 @@ public class QlTestInspectionitempoint implements Serializable {
|
||||
/**
|
||||
* 项点标识
|
||||
*/
|
||||
@TableId
|
||||
private String inspection_item_id;
|
||||
|
||||
/**
|
||||
@@ -74,7 +76,7 @@ public class QlTestInspectionitempoint implements Serializable {
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date create_time;
|
||||
private String create_time;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
@@ -89,7 +91,7 @@ public class QlTestInspectionitempoint implements Serializable {
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private Date update_time;
|
||||
private String update_time;
|
||||
|
||||
/**
|
||||
* 是否临界值填充备注
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package org.nl.wms.quality_manage.service.inspection.dao;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.util.Date;
|
||||
import java.io.Serializable;
|
||||
@@ -25,6 +27,7 @@ public class QlTestInspectionschememst implements Serializable {
|
||||
/**
|
||||
* 检验方案标识
|
||||
*/
|
||||
@TableId
|
||||
private String inspection_scheme_id;
|
||||
|
||||
/**
|
||||
@@ -43,19 +46,9 @@ public class QlTestInspectionschememst implements Serializable {
|
||||
private String inspection_scheme_type;
|
||||
|
||||
/**
|
||||
* 厂家质保项数量
|
||||
* 明细项
|
||||
*/
|
||||
private BigDecimal factory_qty;
|
||||
|
||||
/**
|
||||
* 工序检验项数量
|
||||
*/
|
||||
private BigDecimal workprocedure_qty;
|
||||
|
||||
/**
|
||||
* 理化检验项数量
|
||||
*/
|
||||
private BigDecimal physical_qty;
|
||||
private BigDecimal detail_count;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
@@ -80,7 +73,7 @@ public class QlTestInspectionschememst implements Serializable {
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date create_time;
|
||||
private String create_time;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
@@ -95,7 +88,7 @@ public class QlTestInspectionschememst implements Serializable {
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private Date update_time;
|
||||
private String update_time;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
package org.nl.wms.quality_manage.service.inspection.dao.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.nl.wms.quality_manage.service.inspection.dao.QlTestInspectionschemedtl;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.nl.wms.quality_manage.service.inspection.dao.QlTestInspectionschememst;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -13,4 +18,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
*/
|
||||
public interface QlTestInspectionschemedtlMapper extends BaseMapper<QlTestInspectionschemedtl> {
|
||||
|
||||
List<Map> getDtl(@Param("mst") QlTestInspectionschememst mst);
|
||||
}
|
||||
|
||||
@@ -2,4 +2,19 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.nl.wms.quality_manage.service.inspection.dao.mapper.QlTestInspectionschemedtlMapper">
|
||||
|
||||
<select id="getDtl" resultType="java.util.Map">
|
||||
select
|
||||
dtl.*,
|
||||
qti.inspection_item_type,
|
||||
qti.inspection_type
|
||||
from
|
||||
ql_test_inspectionschemedtl dtl
|
||||
left join ql_test_inspectionitempoint qti on dtl.inspection_item_code = qti.inspection_item_code
|
||||
<where>
|
||||
<if test="mst.inspection_scheme_id != null">
|
||||
dtl.inspection_scheme_id = #{mst.inspection_scheme_id}
|
||||
</if>
|
||||
</where>
|
||||
order by dtl.order_index
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
package org.nl.wms.quality_manage.service.inspection.dao.mapper;
|
||||
|
||||
import org.nl.wms.quality_manage.service.inspection.dao.QlTestInspectionschemedtlproductstandard;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.nl.wms.quality_manage.service.inspection.dao.QlTestInspectionschemedtlproductstandard;
|
||||
import org.nl.wms.quality_manage.service.inspection.dto.StandardQuery;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -13,4 +19,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
*/
|
||||
public interface QlTestInspectionschemedtlproductstandardMapper extends BaseMapper<QlTestInspectionschemedtlproductstandard> {
|
||||
|
||||
List<Map> getDtl(@Param("query") StandardQuery query);
|
||||
List<Map> queryDtl(@Param("form") JSONObject form);
|
||||
}
|
||||
|
||||
@@ -2,4 +2,54 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.nl.wms.quality_manage.service.inspection.dao.mapper.QlTestInspectionschemedtlproductstandardMapper">
|
||||
|
||||
<select id="getDtl" resultType="java.util.Map">
|
||||
SELECT
|
||||
a.*,
|
||||
mst.inspection_scheme_type,
|
||||
mb.material_code,
|
||||
mb.material_name
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
stand.material_id,
|
||||
MAX( stand.inspection_scheme_code ) AS inspection_scheme_code,
|
||||
MAX( stand.inspection_scheme_name ) AS inspection_scheme_name,
|
||||
MAX( stand.inspection_scheme_id ) AS inspection_scheme_id,
|
||||
COUNT( stand.material_id ) AS detail_count
|
||||
FROM
|
||||
ql_test_inspectionschemedtlproductstandard stand
|
||||
GROUP BY
|
||||
stand.material_id) a
|
||||
LEFT JOIN md_me_materialbase mb ON mb.material_id = a.material_id
|
||||
LEFT JOIN ql_test_inspectionschememst mst ON a.inspection_scheme_code = mst.inspection_scheme_code
|
||||
<where>
|
||||
<if test="query.material_search != null and query.material_search != ''">
|
||||
AND (mb.material_code like '%${query.material_search}%' OR mb.material_name like
|
||||
'%${query.material_search}%')
|
||||
</if>
|
||||
<if test="query.inspection_scheme_search != null and query.inspection_scheme_search != ''">
|
||||
AND (a.inspection_scheme_name like '%${query.inspection_scheme_search}%' OR a.inspection_scheme_code
|
||||
like '%${query.inspection_scheme_search}%')
|
||||
</if>
|
||||
<if test="query.inspection_scheme_type != null and query.inspection_scheme_type != ''">
|
||||
AND mst.inspection_scheme_type = #{query.inspection_scheme_type}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="queryDtl" resultType="java.util.Map" parameterType="com.alibaba.fastjson.JSONObject">
|
||||
SELECT
|
||||
stand.*,
|
||||
mst.inspection_scheme_type,
|
||||
point.inspection_item_type,
|
||||
point.inspection_type
|
||||
FROM
|
||||
ql_test_inspectionschemedtlproductstandard stand
|
||||
LEFT JOIN ql_test_inspectionschememst mst ON mst.inspection_scheme_code = stand.inspection_scheme_code
|
||||
LEFT JOIN ql_test_inspectionitempoint point ON point.inspection_item_id = stand.inspection_item_id
|
||||
<where>
|
||||
<if test="form.material != null">
|
||||
AND stand.material_id = #{form.material_id}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -19,4 +19,12 @@ public class ItemPointQuery extends BaseQuery<QlTestInspectionitempoint> {
|
||||
|
||||
private String inspection_type;
|
||||
|
||||
private String item_search;
|
||||
|
||||
@Override
|
||||
public void paramMapping() {
|
||||
super.doP.put("item_search", QParam.builder().k(new String[]{"inspection_item_code","inspection_item_name"}).type(QueryTEnum.ORLK).build());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package org.nl.wms.quality_manage.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.wms.quality_manage.service.inspection.dao.QlTestInspectionitempoint;
|
||||
import org.nl.wms.quality_manage.service.inspection.dao.QlTestInspectionschememst;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2023/5/4 19:49
|
||||
*/
|
||||
@Data
|
||||
public class SchemeQuery extends BaseQuery<QlTestInspectionschememst> {
|
||||
|
||||
|
||||
private String inspection_scheme_type;
|
||||
|
||||
private String sch_search;
|
||||
|
||||
@Override
|
||||
public void paramMapping() {
|
||||
super.doP.put("sch_search", QParam.builder().k(new String[]{"inspection_scheme_code","inspection_scheme_name"}).type(QueryTEnum.ORLK).build());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package org.nl.wms.quality_manage.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.wms.quality_manage.service.inspection.dao.QlTestInspectionschemedtlproductstandard;
|
||||
import org.nl.wms.storage_manage.semimanage.service.iostorInv.dao.StIvtIostorinvBcp;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2023/5/4 19:49
|
||||
*/
|
||||
@Data
|
||||
public class StandardQuery extends BaseQuery<QlTestInspectionschemedtlproductstandard> {
|
||||
|
||||
|
||||
private String material_search;
|
||||
|
||||
private String inspection_scheme_type;
|
||||
|
||||
private String inspection_scheme_search;
|
||||
|
||||
}
|
||||
@@ -1,17 +1,32 @@
|
||||
package org.nl.wms.quality_manage.service.inspection.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.jsonwebtoken.lang.Assert;
|
||||
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.system.util.CodeUtil;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtBsrealstorattr;
|
||||
import org.nl.wms.quality_manage.service.inspection.dao.QlTestInspectionitempoint;
|
||||
import org.nl.wms.quality_manage.service.inspection.dao.mapper.QlTestInspectionitempointMapper;
|
||||
import org.nl.wms.quality_manage.service.inspection.IQlTestInspectionitempointService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.wms.quality_manage.service.inspection.dto.ItemPointQuery;
|
||||
import org.nl.wms.storage_manage.CHECKEnum;
|
||||
import org.nl.wms.storage_manage.semimanage.service.check.dao.StIvtCheckmstBcp;
|
||||
import org.nl.wms.storage_manage.semimanage.service.check.dto.CheckQuery;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 检验项点表 服务实现类
|
||||
@@ -22,11 +37,54 @@ import org.springframework.stereotype.Service;
|
||||
*/
|
||||
@Service
|
||||
public class QlTestInspectionitempointServiceImpl extends ServiceImpl<QlTestInspectionitempointMapper, QlTestInspectionitempoint> implements IQlTestInspectionitempointService {
|
||||
@Override
|
||||
public void create(JSONObject jo) {
|
||||
QlTestInspectionitempoint mstForm = packageMstForm(new QlTestInspectionitempoint(), jo);
|
||||
String item_code = mstForm.getInspection_item_code();
|
||||
QlTestInspectionitempoint one = this.getOne(new QueryWrapper<QlTestInspectionitempoint>().lambda().eq(QlTestInspectionitempoint::getInspection_item_code, item_code));
|
||||
if (ObjectUtil.isNotEmpty(one)) {
|
||||
throw new BadRequestException("编码已存在!");
|
||||
}
|
||||
this.save(mstForm);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(JSONObject form) {
|
||||
Assert.notNull(new Object[]{form, form.get("inspection_item_id")}, "请求参数不能为空");
|
||||
QlTestInspectionitempoint mst = form.toJavaObject(QlTestInspectionitempoint.class);
|
||||
String item_code = mst.getInspection_item_code();
|
||||
QlTestInspectionitempoint one = this.getOne(new QueryWrapper<QlTestInspectionitempoint>().lambda().eq(QlTestInspectionitempoint::getInspection_item_code, item_code));
|
||||
if (ObjectUtil.isNotEmpty(one) && !one.getInspection_item_id().equals(mst.getInspection_item_id())) {
|
||||
throw new BadRequestException("编码已存在!");
|
||||
}
|
||||
mst.setUpdate_id(SecurityUtils.getCurrentUserId());
|
||||
mst.setUpdate_name(SecurityUtils.getCurrentNickName());
|
||||
mst.setUpdate_time(DateUtil.now());
|
||||
this.updateById(mst);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object pageQuery(ItemPointQuery query, PageQuery page) {
|
||||
// 分页查询
|
||||
QueryWrapper<QlTestInspectionitempoint> queryWrapper = new QueryWrapper<>();
|
||||
Page<QlTestInspectionitempoint> pageQuery = this.page(page.build(), query.build());
|
||||
TableDataInfo<QlTestInspectionitempoint> build = TableDataInfo.build(pageQuery);
|
||||
return build;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private QlTestInspectionitempoint packageMstForm(QlTestInspectionitempoint itempoint, JSONObject whereJson) {
|
||||
itempoint.setInspection_item_id(IdUtil.getStringId());
|
||||
itempoint.setInspection_item_code(whereJson.getString("inspection_item_code"));
|
||||
itempoint.setInspection_item_name(whereJson.getString("inspection_item_name"));
|
||||
itempoint.setInspection_item_type(whereJson.getString("inspection_item_type"));
|
||||
itempoint.setInspection_type(whereJson.getString("inspection_type"));
|
||||
itempoint.setMaterial_id(whereJson.getString("material_id"));
|
||||
itempoint.setMaterial_code(whereJson.getString("material_code"));
|
||||
itempoint.setRemark(whereJson.getString("remark"));
|
||||
itempoint.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
itempoint.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||
itempoint.setCreate_time(DateUtil.now());
|
||||
return itempoint;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,19 @@
|
||||
package org.nl.wms.quality_manage.service.inspection.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.wms.quality_manage.service.inspection.dao.QlTestInspectionschemedtl;
|
||||
import org.nl.wms.quality_manage.service.inspection.dao.QlTestInspectionschememst;
|
||||
import org.nl.wms.quality_manage.service.inspection.dao.mapper.QlTestInspectionschemedtlMapper;
|
||||
import org.nl.wms.quality_manage.service.inspection.IQlTestInspectionschemedtlService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 检验方案明细表 服务实现类
|
||||
@@ -17,4 +25,29 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public class QlTestInspectionschemedtlServiceImpl extends ServiceImpl<QlTestInspectionschemedtlMapper, QlTestInspectionschemedtl> implements IQlTestInspectionschemedtlService {
|
||||
|
||||
@Override
|
||||
public List<Map> getDtl(QlTestInspectionschememst mst) {
|
||||
return this.baseMapper.getDtl(mst);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double create(JSONArray rows, QlTestInspectionschememst mst) {
|
||||
//插入明细之前把所有的明细先删除
|
||||
this.remove(new QueryWrapper<QlTestInspectionschemedtl>().lambda().eq(QlTestInspectionschemedtl::getInspection_scheme_id, mst.getInspection_scheme_id()));
|
||||
for (int i = 0; i < rows.size(); i++) {
|
||||
JSONObject row = rows.getJSONObject(i);
|
||||
QlTestInspectionschemedtl dtl = new QlTestInspectionschemedtl();
|
||||
dtl.setInspection_scheme_dtl_id(IdUtil.getStringId());
|
||||
dtl.setInspection_scheme_id(mst.getInspection_scheme_id());
|
||||
dtl.setInspection_scheme_code(mst.getInspection_scheme_code());
|
||||
dtl.setInspection_scheme_name(mst.getInspection_scheme_name());
|
||||
dtl.setInspection_item_id(row.getString("inspection_item_id"));
|
||||
dtl.setInspection_item_code(row.getString("inspection_item_code"));
|
||||
dtl.setInspection_item_name(row.getString("inspection_item_name"));
|
||||
dtl.setRemark(row.getString("remark"));
|
||||
dtl.setOrder_index(row.getInteger("order_index"));
|
||||
this.save(dtl);
|
||||
}
|
||||
return rows.size();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,32 @@
|
||||
package org.nl.wms.quality_manage.service.inspection.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
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.system.util.CodeUtil;
|
||||
import org.nl.wms.quality_manage.service.inspection.IQlTestInspectionschememstService;
|
||||
import org.nl.wms.quality_manage.service.inspection.dao.QlTestInspectionschemedtlproductstandard;
|
||||
import org.nl.wms.quality_manage.service.inspection.dao.QlTestInspectionschememst;
|
||||
import org.nl.wms.quality_manage.service.inspection.dao.mapper.QlTestInspectionschemedtlproductstandardMapper;
|
||||
import org.nl.wms.quality_manage.service.inspection.IQlTestInspectionschemedtlproductstandardService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.wms.quality_manage.service.inspection.dto.StandardQuery;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 产品检验方案标准表 服务实现类
|
||||
@@ -17,4 +38,63 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public class QlTestInspectionschemedtlproductstandardServiceImpl extends ServiceImpl<QlTestInspectionschemedtlproductstandardMapper, QlTestInspectionschemedtlproductstandard> implements IQlTestInspectionschemedtlproductstandardService {
|
||||
|
||||
@Autowired
|
||||
private IQlTestInspectionschememstService inspectionschememstService;
|
||||
|
||||
@Override
|
||||
public Object query(StandardQuery query, PageQuery pageQuery) {
|
||||
Page<Object> page = PageHelper.startPage(pageQuery.getPage() + 1, pageQuery.getSize());
|
||||
TableDataInfo build = TableDataInfo.build(this.baseMapper.getDtl(query));
|
||||
build.setTotalElements(page.getTotal());
|
||||
return build;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map> getDtl(JSONObject whereJson) {
|
||||
return this.baseMapper.queryDtl(whereJson);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveData(JSONObject jo) {
|
||||
//1-复制新增;2-新增;3-修改
|
||||
String material_id = jo.getString("material_id");
|
||||
JSONArray rows = jo.getJSONArray("tableData");
|
||||
|
||||
if (StrUtil.isEmpty(material_id)) {
|
||||
throw new BadRequestException("物料不能为空!");
|
||||
}
|
||||
if (rows.size() == 0) {
|
||||
throw new BadRequestException("明细不能为空!");
|
||||
}
|
||||
|
||||
this.remove(new QueryWrapper<QlTestInspectionschemedtlproductstandard>().lambda().eq(QlTestInspectionschemedtlproductstandard::getMaterial_id, material_id));
|
||||
|
||||
for (int i = 0; i < rows.size(); i++) {
|
||||
JSONObject row = rows.getJSONObject(i);
|
||||
row.put("material_id",jo.getString("material_id"));
|
||||
row.put("material_code",jo.getString("material_code"));
|
||||
this.save(packageMstForm(new QlTestInspectionschemedtlproductstandard(), row));
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private QlTestInspectionschemedtlproductstandard packageMstForm(QlTestInspectionschemedtlproductstandard mst, JSONObject whereJson) {
|
||||
mst.setInspection_standard_dtl_id(IdUtil.getStringId());
|
||||
mst.setMaterial_id(whereJson.getString("material_id"));
|
||||
mst.setMaterial_code(whereJson.getString("material_code"));
|
||||
String inspection_scheme_id = whereJson.getString("inspection_scheme_id");
|
||||
mst.setInspection_scheme_id(whereJson.getString("inspection_scheme_id"));
|
||||
QlTestInspectionschememst scheme_mst = inspectionschememstService.getOne(new QueryWrapper<QlTestInspectionschememst>().lambda().eq(QlTestInspectionschememst::getInspection_scheme_id, inspection_scheme_id));
|
||||
mst.setInspection_scheme_code(scheme_mst.getInspection_scheme_code());
|
||||
mst.setInspection_scheme_name(scheme_mst.getInspection_scheme_name());
|
||||
mst.setInspection_item_id(whereJson.getString("inspection_item_id"));
|
||||
mst.setInspection_item_code(whereJson.getString("inspection_item_code"));
|
||||
mst.setInspection_item_name(whereJson.getString("inspection_item_name"));
|
||||
mst.setUp_limit(whereJson.getBigDecimal("up_limit"));
|
||||
mst.setDown_limit(whereJson.getBigDecimal("down_limit"));
|
||||
mst.setUp_limit_value(whereJson.getBigDecimal("up_limit_value"));
|
||||
mst.setDown_limit_value(whereJson.getBigDecimal("down_limit_value"));
|
||||
mst.setRemark(whereJson.getString("remark"));
|
||||
return mst;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,29 @@
|
||||
package org.nl.wms.quality_manage.service.inspection.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.jsonwebtoken.lang.Assert;
|
||||
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.system.util.CodeUtil;
|
||||
import org.nl.wms.quality_manage.service.inspection.IQlTestInspectionschemedtlService;
|
||||
import org.nl.wms.quality_manage.service.inspection.dao.QlTestInspectionitempoint;
|
||||
import org.nl.wms.quality_manage.service.inspection.dao.QlTestInspectionschememst;
|
||||
import org.nl.wms.quality_manage.service.inspection.dao.mapper.QlTestInspectionschememstMapper;
|
||||
import org.nl.wms.quality_manage.service.inspection.IQlTestInspectionschememstService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.wms.quality_manage.service.inspection.dto.ItemPointQuery;
|
||||
import org.nl.wms.quality_manage.service.inspection.dto.SchemeQuery;
|
||||
import org.nl.wms.storage_manage.semimanage.service.check.dao.StIvtCheckmstBcp;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
@@ -17,4 +37,58 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public class QlTestInspectionschememstServiceImpl extends ServiceImpl<QlTestInspectionschememstMapper, QlTestInspectionschememst> implements IQlTestInspectionschememstService {
|
||||
|
||||
@Autowired
|
||||
private IQlTestInspectionschemedtlService inspectionschemedtlService;
|
||||
|
||||
@Override
|
||||
public void update(JSONObject form) {
|
||||
Assert.notNull(form.get("inspection_scheme_id"), "请求参数不能为空");
|
||||
QlTestInspectionschememst mst = form.toJavaObject(QlTestInspectionschememst.class);
|
||||
mst.setUpdate_optid(SecurityUtils.getCurrentUserId());
|
||||
mst.setUpdate_optname(SecurityUtils.getCurrentNickName());
|
||||
mst.setUpdate_time(DateUtil.now());
|
||||
this.updateById(mst);
|
||||
|
||||
JSONArray rows = form.getJSONArray("tableData");
|
||||
if (ObjectUtil.isEmpty(rows)) throw new BadRequestException("请求参数不能为空");
|
||||
// 调用明细表 插入/更新方法
|
||||
inspectionschemedtlService.create(rows, mst);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object pageQuery(SchemeQuery query, PageQuery page) {
|
||||
// 分页查询
|
||||
QueryWrapper<QlTestInspectionschememst> queryWrapper = new QueryWrapper<>();
|
||||
Page<QlTestInspectionschememst> pageQuery = this.page(page.build(), query.build());
|
||||
TableDataInfo<QlTestInspectionschememst> build = TableDataInfo.build(pageQuery);
|
||||
return build;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void create(JSONObject jo) {
|
||||
JSONArray rows = jo.getJSONArray("tableData");
|
||||
if (ObjectUtil.isEmpty(rows)) throw new BadRequestException("请求参数不能为空");
|
||||
|
||||
// 调用主表 插入/更新方法
|
||||
QlTestInspectionschememst mst = packageMstForm(new QlTestInspectionschememst(), jo);
|
||||
this.save(mst);
|
||||
|
||||
//调用明细表 插入方法
|
||||
inspectionschemedtlService.create(rows, mst);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private QlTestInspectionschememst packageMstForm(QlTestInspectionschememst mst, JSONObject whereJson) {
|
||||
mst.setInspection_scheme_id(IdUtil.getStringId());
|
||||
mst.setInspection_scheme_code(CodeUtil.getNewCode("F_CODE"));
|
||||
mst.setInspection_scheme_name(whereJson.getString("inspection_scheme_name"));
|
||||
mst.setInspection_scheme_type(whereJson.getString("inspection_scheme_type"));
|
||||
mst.setDetail_count(whereJson.getBigDecimal("detail_count"));
|
||||
mst.setIs_used(true);
|
||||
mst.setRemark(whereJson.getString("remark"));
|
||||
mst.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
mst.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||
mst.setCreate_time(DateUtil.now());
|
||||
return mst;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ public class SysCodeRule implements Serializable {
|
||||
/**
|
||||
* 当前值
|
||||
*/
|
||||
private String currentValue;
|
||||
private String current_value;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
@@ -52,42 +52,42 @@ public class SysCodeRule implements Serializable {
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
private String isActive;
|
||||
private String is_active;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private String isDelete;
|
||||
private String is_delete;
|
||||
|
||||
/**
|
||||
* 创建id
|
||||
*/
|
||||
private String createId;
|
||||
private String create_id;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
private String createName;
|
||||
private String create_name;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private String createTime;
|
||||
private String create_time;
|
||||
|
||||
/**
|
||||
* 修改id
|
||||
*/
|
||||
private String updateId;
|
||||
private String update_id;
|
||||
|
||||
/**
|
||||
* 修改者
|
||||
*/
|
||||
private String updateName;
|
||||
private String update_name;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private String updateTime;
|
||||
private String update_time;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String demo;
|
||||
|
||||
@@ -38,17 +38,17 @@ public class SysCodeRuleDetail implements Serializable {
|
||||
/**
|
||||
* 初始值
|
||||
*/
|
||||
private String initValue;
|
||||
private String init_value;
|
||||
|
||||
/**
|
||||
* 当前值
|
||||
*/
|
||||
private String currentValue;
|
||||
private String current_value;
|
||||
|
||||
/**
|
||||
* 允许最大值
|
||||
*/
|
||||
private String maxValue;
|
||||
private String max_value;
|
||||
|
||||
/**
|
||||
* 步长
|
||||
@@ -73,7 +73,7 @@ public class SysCodeRuleDetail implements Serializable {
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
private BigDecimal sortNum;
|
||||
private BigDecimal sort_num;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
@@ -83,50 +83,50 @@ public class SysCodeRuleDetail implements Serializable {
|
||||
/**
|
||||
* 编码规则标识
|
||||
*/
|
||||
private String codeRuleId;
|
||||
private String code_rule_id;
|
||||
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
private String isActive;
|
||||
private String is_active;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private String isDelete;
|
||||
private String is_delete;
|
||||
|
||||
/**
|
||||
* 创建id
|
||||
*/
|
||||
private String createId;
|
||||
private String create_id;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
private String createName;
|
||||
private String create_name;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private String createTime;
|
||||
private String create_time;
|
||||
|
||||
/**
|
||||
* 修改id
|
||||
*/
|
||||
private String updateId;
|
||||
private String update_id;
|
||||
|
||||
/**
|
||||
* 修改者
|
||||
*/
|
||||
private String updateName;
|
||||
private String update_name;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private String updateTime;
|
||||
private String update_time;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String dictName;
|
||||
private String dict_name;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -35,8 +35,8 @@ public class SysCodeRuleDetailServiceImpl extends ServiceImpl<SysCodeRuleDetailM
|
||||
@Override
|
||||
public IPage<SysCodeRuleDetail> queryAll(CodeRuleDetailQuery form, PageQuery page) {
|
||||
LambdaQueryWrapper<SysCodeRuleDetail> lam = new LambdaQueryWrapper<>();
|
||||
lam.eq(SysCodeRuleDetail::getCodeRuleId, form.getId())
|
||||
.orderByAsc(SysCodeRuleDetail::getSortNum);
|
||||
lam.eq(SysCodeRuleDetail::getCode_rule_id, form.getId())
|
||||
.orderByAsc(SysCodeRuleDetail::getSort_num);
|
||||
IPage<SysCodeRuleDetail> pages = new Page<>(page.getPage() + 1, page.getSize());
|
||||
codeRuleDetailMapper.selectPage(pages, lam);
|
||||
return pages;
|
||||
@@ -49,19 +49,19 @@ public class SysCodeRuleDetailServiceImpl extends ServiceImpl<SysCodeRuleDetailM
|
||||
String currentNickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
codeRuleDetail.setId(IdUtil.getSnowflake(1,1).nextIdStr());
|
||||
codeRuleDetail.setCurrentValue(codeRuleDetail.getInitValue());
|
||||
codeRuleDetail.setCreateId(currentUserId);
|
||||
codeRuleDetail.setCreateName(currentNickName);
|
||||
codeRuleDetail.setCreateTime(now);
|
||||
codeRuleDetail.setUpdateId(currentUserId);
|
||||
codeRuleDetail.setUpdateName(currentNickName);
|
||||
codeRuleDetail.setUpdateTime(now);
|
||||
codeRuleDetail.setCurrent_value(codeRuleDetail.getInit_value());
|
||||
codeRuleDetail.setCreate_id(currentUserId);
|
||||
codeRuleDetail.setCreate_name(currentNickName);
|
||||
codeRuleDetail.setCreate_time(now);
|
||||
codeRuleDetail.setUpdate_id(currentUserId);
|
||||
codeRuleDetail.setUpdate_name(currentNickName);
|
||||
codeRuleDetail.setUpdate_time(now);
|
||||
if (codeRuleDetail.getType().equals(CodeRuleTypeEnum.DATE.getType())) {
|
||||
Date date = DateUtil.date();
|
||||
String format = codeRuleDetail.getFormat();
|
||||
String nowDate = DateUtil.format(date, format);
|
||||
codeRuleDetail.setInitValue(nowDate);
|
||||
codeRuleDetail.setCurrentValue(nowDate);
|
||||
codeRuleDetail.setInit_value(nowDate);
|
||||
codeRuleDetail.setCurrent_value(nowDate);
|
||||
}
|
||||
codeRuleDetailMapper.insert(codeRuleDetail);
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ public class SysCodeRuleServiceImpl extends ServiceImpl<SysCodeRuleMapper, SysCo
|
||||
String id = codeRuleMapper.selectOne(new LambdaQueryWrapper<SysCodeRule>().eq(SysCodeRule::getCode, code)).getId();
|
||||
// 如果flag = 1就执行更新数据库的操作
|
||||
String flag = (String) form.get("flag");
|
||||
List<SysCodeRuleDetail> ruleDetails = codeRuleDetailMapper.selectList(new LambdaQueryWrapper<SysCodeRuleDetail>().eq(SysCodeRuleDetail::getCodeRuleId, id));
|
||||
List<SysCodeRuleDetail> ruleDetails = codeRuleDetailMapper.selectList(new LambdaQueryWrapper<SysCodeRuleDetail>().eq(SysCodeRuleDetail::getCode_rule_id, id));
|
||||
String demo = "";
|
||||
boolean isSame = true;
|
||||
for(SysCodeRuleDetail detail : ruleDetails) {
|
||||
@@ -63,11 +63,11 @@ public class SysCodeRuleServiceImpl extends ServiceImpl<SysCodeRuleMapper, SysCo
|
||||
String type = detail.getType();
|
||||
//固定直接取值
|
||||
if (type.equals(CodeRuleTypeEnum.FIXED.getType())) {
|
||||
value = detail.getInitValue();
|
||||
value = detail.getInit_value();
|
||||
}
|
||||
//日期判断数据库的值与当前值是否相同来决定顺序的值
|
||||
if (type.equals(CodeRuleTypeEnum.DATE.getType())) {
|
||||
String currentValue = detail.getCurrentValue();
|
||||
String currentValue = detail.getCurrent_value();
|
||||
Date date = DateUtil.date();
|
||||
String format = detail.getFormat();
|
||||
String nowDate = DateUtil.format(date, format);
|
||||
@@ -75,8 +75,8 @@ public class SysCodeRuleServiceImpl extends ServiceImpl<SysCodeRuleMapper, SysCo
|
||||
isSame = false;
|
||||
}
|
||||
if (flag.equals("1")) {
|
||||
detail.setInitValue(nowDate);
|
||||
detail.setCurrentValue(nowDate);
|
||||
detail.setInit_value(nowDate);
|
||||
detail.setCurrent_value(nowDate);
|
||||
}
|
||||
value = nowDate;
|
||||
}
|
||||
@@ -84,11 +84,11 @@ public class SysCodeRuleServiceImpl extends ServiceImpl<SysCodeRuleMapper, SysCo
|
||||
if (type.equals(CodeRuleTypeEnum.ORDER.getType())) {
|
||||
String numValue = "";
|
||||
int step = Integer.parseInt(detail.getStep());
|
||||
Long maxValue = Long.valueOf(detail.getMaxValue());
|
||||
if (!isSame && (Long.valueOf(detail.getCurrentValue()) + step) > maxValue) {
|
||||
numValue = detail.getInitValue();
|
||||
Long maxValue = Long.valueOf(detail.getMax_value());
|
||||
if (!isSame && (Long.parseLong(detail.getCurrent_value()) + step) > maxValue) {
|
||||
numValue = detail.getInit_value();
|
||||
} else {
|
||||
numValue = Integer.parseInt(detail.getCurrentValue()) + step + "";
|
||||
numValue = Integer.parseInt(detail.getCurrent_value()) + step + "";
|
||||
}
|
||||
int size = numValue.length();
|
||||
int length = detail.getLength();
|
||||
@@ -99,18 +99,18 @@ public class SysCodeRuleServiceImpl extends ServiceImpl<SysCodeRuleMapper, SysCo
|
||||
value += numValue;
|
||||
if (flag.equals("1")) {
|
||||
if (!isSame) {
|
||||
int initValue = Integer.parseInt(detail.getInitValue());
|
||||
int initValue = Integer.parseInt(detail.getInit_value());
|
||||
if (StrUtil.isEmpty((initValue + ""))) {
|
||||
throw new BadRequestException("请完善编码数值的初始值!");
|
||||
}
|
||||
detail.setCurrentValue(String.valueOf(initValue));
|
||||
detail.setCurrent_value(String.valueOf(initValue));
|
||||
} else {
|
||||
int numCurr = Integer.parseInt(detail.getCurrentValue());
|
||||
int numCurr = Integer.parseInt(detail.getCurrent_value());
|
||||
if (numCurr >= maxValue) {
|
||||
numCurr = Integer.parseInt(detail.getInitValue());
|
||||
detail.setCurrentValue(String.valueOf(numCurr));
|
||||
numCurr = Integer.parseInt(detail.getInit_value());
|
||||
detail.setCurrent_value(String.valueOf(numCurr));
|
||||
}else{
|
||||
detail.setCurrentValue(String.valueOf(numCurr + step));
|
||||
detail.setCurrent_value(String.valueOf(numCurr + step));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -132,12 +132,12 @@ public class SysCodeRuleServiceImpl extends ServiceImpl<SysCodeRuleMapper, SysCo
|
||||
List<SysCodeRule> sysCodeRules = codeRuleMapper.selectList(new LambdaQueryWrapper<SysCodeRule>().eq(SysCodeRule::getCode, codeRule.getCode()));
|
||||
if (ObjectUtil.isNotEmpty(sysCodeRules)) throw new BadRequestException("编号[" + sysCodeRules.get(0).getCode() + "]已存在");
|
||||
codeRule.setId(IdUtil.getSnowflake(1,1).nextIdStr());
|
||||
codeRule.setCreateId(currentUserId);
|
||||
codeRule.setCreateName(currentUsername);
|
||||
codeRule.setCreateTime(now);
|
||||
codeRule.setUpdateId(currentUserId);
|
||||
codeRule.setUpdateName(currentUsername);
|
||||
codeRule.setUpdateTime(now);
|
||||
codeRule.setCreate_id(currentUserId);
|
||||
codeRule.setCreate_name(currentUsername);
|
||||
codeRule.setCreate_time(now);
|
||||
codeRule.setUpdate_id(currentUserId);
|
||||
codeRule.setUpdate_name(currentUsername);
|
||||
codeRule.setUpdate_time(now);
|
||||
codeRuleMapper.insert(codeRule);
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ public class SysCodeRuleServiceImpl extends ServiceImpl<SysCodeRuleMapper, SysCo
|
||||
public void deleteCodeRule(Set<String> ids) {
|
||||
ids.forEach(id -> {
|
||||
codeRuleMapper.deleteById(id);
|
||||
codeRuleDetailMapper.delete(new LambdaQueryWrapper<SysCodeRuleDetail>().eq(SysCodeRuleDetail::getCodeRuleId, id));
|
||||
codeRuleDetailMapper.delete(new LambdaQueryWrapper<SysCodeRuleDetail>().eq(SysCodeRuleDetail::getCode_rule_id, id));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -159,9 +159,9 @@ public class SysCodeRuleServiceImpl extends ServiceImpl<SysCodeRuleMapper, SysCo
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||
String now = DateUtil.now();
|
||||
codeRule.setUpdateId(currentUserId);
|
||||
codeRule.setUpdateName(currentUsername);
|
||||
codeRule.setUpdateTime(now);
|
||||
codeRule.setUpdate_id(currentUserId);
|
||||
codeRule.setUpdate_name(currentUsername);
|
||||
codeRule.setUpdate_time(now);
|
||||
codeRuleMapper.updateById(codeRule);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<div v-if="query.dictName === ''">
|
||||
<div v-if="query.dict_name === ''">
|
||||
<div class="my-code">点击编码查看详情</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
@@ -42,7 +42,7 @@
|
||||
</el-form-item>
|
||||
<div v-if="form.type === '01' || form.type === '03'">
|
||||
<el-form-item label="初始值" prop="init_value">
|
||||
<el-input v-model="form.initValue" style="width: 370px;" />
|
||||
<el-input v-model="form.init_value" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div v-if="form.type === '02'">
|
||||
@@ -61,12 +61,12 @@
|
||||
<el-input v-model="form.length" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="最大值" prop="max_value">
|
||||
<el-input v-model="form.maxValue" style="width: 370px;" />
|
||||
<el-input v-model="form.max_value" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
</div>
|
||||
<el-form-item label="排序" prop="sort_num">
|
||||
<el-input-number
|
||||
v-model.number="form.sortNum"
|
||||
v-model.number="form.sort_num"
|
||||
:min="0"
|
||||
:max="999"
|
||||
controls-position="right"
|
||||
@@ -89,11 +89,11 @@
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column label="所属编码">
|
||||
{{ query.dictName }}
|
||||
{{ query.dict_name }}
|
||||
</el-table-column>
|
||||
<el-table-column prop="type" label="类型" :formatter="typeFormate" />
|
||||
<el-table-column prop="initValue" label="初始值" />
|
||||
<el-table-column prop="currentValue" label="当前值" />
|
||||
<el-table-column prop="init_value" label="初始值" />
|
||||
<el-table-column prop="current_value" label="当前值" />
|
||||
<el-table-column
|
||||
v-permission="['admin','dict:edit','dict:del']"
|
||||
label="操作"
|
||||
@@ -138,7 +138,7 @@ export default {
|
||||
cruds() {
|
||||
return [
|
||||
CRUD({
|
||||
title: '编码详情', url: 'api/codeDetail', query: { dictName: '' }, sort: ['sort_num,asc'],
|
||||
title: '编码详情', url: 'api/codeDetail', query: { dict_name: '' }, sort: ['sort_num,asc'],
|
||||
crudMethod: { ...crudCodeDetail },
|
||||
optShow: {
|
||||
add: true,
|
||||
@@ -154,7 +154,7 @@ export default {
|
||||
presenter(),
|
||||
header(),
|
||||
form(function() {
|
||||
return Object.assign({ dict: { id: this.dictId }}, defaultForm)
|
||||
return Object.assign({ dict: { id: this.dict_id }}, defaultForm)
|
||||
})],
|
||||
data() {
|
||||
return {
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
<div slot="header" class="clearfix">
|
||||
<span>编码详情</span>
|
||||
<el-button
|
||||
v-if="checkPermission(['admin','genCode:add']) && this.$refs.codeGenDetail && this.$refs.codeGenDetail.query.dictName"
|
||||
v-if="checkPermission(['admin','genCode:add']) && this.$refs.codeGenDetail && this.$refs.codeGenDetail.query.dict_name"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
style="float: right;padding: 4px 10px"
|
||||
@@ -129,10 +129,10 @@ export default {
|
||||
// 选中字典后,设置字典详情数据
|
||||
handleCurrentChange(val) {
|
||||
if (val) {
|
||||
this.$refs.codeGenDetail.query.dictName = val.code
|
||||
this.$refs.codeGenDetail.query.dict_name = val.code
|
||||
this.$refs.codeGenDetail.query.id = val.id
|
||||
this.$refs.codeGenDetail.form.codeRuleId = val.id
|
||||
this.$refs.codeGenDetail.dictId = val.id
|
||||
this.$refs.codeGenDetail.form.code_rule_id = val.id
|
||||
this.$refs.codeGenDetail.dict_id = val.id
|
||||
this.$refs.codeGenDetail.crud.toQuery()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
>
|
||||
<el-form-item label="模糊搜索">
|
||||
<el-input
|
||||
v-model="query.blurry"
|
||||
v-model="query.item_search"
|
||||
clearable
|
||||
placeholder="项点编码、名称"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
@@ -108,7 +108,7 @@
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<!-- <el-col :span="12">
|
||||
<el-form-item label="所属工序" prop="workprocedure_uuid">
|
||||
<el-select
|
||||
v-model="form.workprocedure_uuid"
|
||||
@@ -125,25 +125,22 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-col>-->
|
||||
<el-col :span="12">
|
||||
<el-form-item label="物料" prop="material_name">
|
||||
<el-form-item label="物料" prop="material_code">
|
||||
<el-input
|
||||
v-model="form.material_name"
|
||||
v-model="form.material_code"
|
||||
style="width: 280px;"
|
||||
clearable
|
||||
@focus="materShow=true"
|
||||
@clear="form.material_uuid=''"
|
||||
@clear="form.material_id=''"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="false" label="物料" prop="material_uuid">
|
||||
<el-input v-model.trim="form.material_uuid" style="width: 280px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="临界值备注显示" prop="is_limit_remark" label-width="auto">
|
||||
<el-switch v-model="form.is_limit_remark" active-value="1" inactive-value="0" />
|
||||
</el-form-item>
|
||||
@@ -172,18 +169,12 @@
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column v-if="false" prop="inspection_item_id" label="项点标识" />
|
||||
<el-table-column v-if="false" prop="material_uuid" label="物料标识" />
|
||||
<el-table-column v-if="false" prop="material_name" label="物料名称" />
|
||||
<el-table-column prop="inspection_item_code" label="项点编码" />
|
||||
<el-table-column prop="inspection_item_name" 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="inspection_item_type_name" label="项点类别" :formatter="itemTypeFormat"/>
|
||||
<!-- <el-table-column prop="workprocedure_name" label="工序名称" />-->
|
||||
<el-table-column prop="inspection_type_name" label="检验方式" :formatter="typeFormat"/>
|
||||
<el-table-column prop="remark" label="备注" />
|
||||
<el-table-column prop="update_optname" label="修改人" />
|
||||
<el-table-column prop="update_time" label="修改时间" width="135" />
|
||||
<el-table-column v-if="false" prop="is_limit_remark" label="是否临界值填充备注" />
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
@@ -196,7 +187,7 @@
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<MaterDtl :dialog-show.sync="materShow" :dialog-matertype="materType" @tableChanged2="tableChanged2" />
|
||||
<MaterDtl :dialog-show.sync="materShow" :dialog-matertype="materType" @setMaterValue="tableChanged2" />
|
||||
|
||||
</div>
|
||||
</template>
|
||||
@@ -215,13 +206,13 @@ const defaultForm = {
|
||||
inspection_item_id: null,
|
||||
inspection_item_code: null,
|
||||
inspection_item_name: null,
|
||||
inspection_item_type: null,
|
||||
inspection_item_type: '02',
|
||||
workprocedure_uuid: null,
|
||||
workprocedure_code: null,
|
||||
workprocedure_name: null,
|
||||
inspection_type: '02',
|
||||
material_uuid: null,
|
||||
material_name: null,
|
||||
material_id: null,
|
||||
material_code: null,
|
||||
remark: null,
|
||||
create_id: null,
|
||||
create_name: null,
|
||||
@@ -292,10 +283,16 @@ export default {
|
||||
hand(value) {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
typeFormat(row, column) {
|
||||
return this.dict.label.QC_INSPECTION_TYPE[row.inspection_type]
|
||||
},
|
||||
itemTypeFormat(row, column) {
|
||||
return this.dict.label.QL_TEST_POINTTYPE[row.inspection_item_type]
|
||||
},
|
||||
tableChanged2(row) {
|
||||
// 新增一行物料时,给行进行赋值
|
||||
this.form.material_uuid = row.material_id
|
||||
this.form.material_name = row.material_name
|
||||
this.form.material_id = row.material_id
|
||||
this.form.material_code = row.material_code
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,16 +10,16 @@ export function add(data) {
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/inspectionItemPoint',
|
||||
method: 'delete',
|
||||
url: 'api/inspectionItemPoint/delete',
|
||||
method: 'post',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/inspectionItemPoint',
|
||||
method: 'put',
|
||||
url: 'api/inspectionItemPoint/update',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<el-input
|
||||
v-model="query.name"
|
||||
v-model="query.item_search"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
size="mini"
|
||||
@@ -24,8 +24,8 @@
|
||||
<el-col :span="6">
|
||||
<el-select
|
||||
v-model="query.inspection_item_type"
|
||||
disabled
|
||||
size="mini"
|
||||
clearable
|
||||
placeholder="项点类别"
|
||||
class="filter-item"
|
||||
>
|
||||
@@ -38,11 +38,9 @@
|
||||
</el-col>
|
||||
|
||||
<el-col :span="6">
|
||||
<rrOperation />
|
||||
<rrOperation/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-divider />
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
@@ -58,12 +56,11 @@
|
||||
<el-table-column v-if="false" prop="inspection_item_id" label="项点标识" />
|
||||
<el-table-column prop="inspection_item_code" label="项点编码" />
|
||||
<el-table-column prop="inspection_item_name" 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="inspection_item_type_name" label="项点类别" :formatter="itemTypeFormat" />
|
||||
<el-table-column prop="inspection_type_name" label="检测方式" :formatter="typeFormat" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
<pagination/>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="close">取 消</el-button>
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
@@ -73,7 +70,7 @@
|
||||
|
||||
<script>
|
||||
|
||||
import CRUD, { crud, header, presenter } from '@crud/crud'
|
||||
import CRUD, {crud, header, presenter} from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
|
||||
@@ -81,19 +78,23 @@ import crudInspectionItemPoint from '@/views/wms/masterdata_manage/ql/inspection
|
||||
|
||||
export default {
|
||||
name: 'ItemDialog',
|
||||
dicts: ['QL_TEST_POINTTYPE'],
|
||||
components: { rrOperation, pagination },
|
||||
dicts: ['QL_TEST_POINTTYPE', 'QC_INSPECTION_TYPE'],
|
||||
components: {rrOperation, pagination},
|
||||
cruds() {
|
||||
return CRUD({ title: '物料', url: 'api/inspectionItemPoint', crudMethod: { ...crudInspectionItemPoint }, optShow: {}})
|
||||
return CRUD({
|
||||
title: '项点',
|
||||
url: 'api/inspectionItemPoint',
|
||||
idField: 'inspection_item_id',
|
||||
sort: ['inspection_item_id,desc'],
|
||||
crudMethod: { ...crudInspectionItemPoint },
|
||||
optShow: {}
|
||||
})
|
||||
},
|
||||
mixins: [presenter(), header(), crud()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
inspectionItemType: {
|
||||
type: String
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@@ -123,7 +124,6 @@ export default {
|
||||
return true
|
||||
},
|
||||
open() {
|
||||
this.crud.query.inspection_item_type = this.$parent.inspectionItemType
|
||||
this.crud.toQuery()
|
||||
},
|
||||
handleSelectionChange(val, row) {
|
||||
@@ -138,6 +138,12 @@ export default {
|
||||
onSelectAll() {
|
||||
this.$refs.table.clearSelection()
|
||||
},
|
||||
typeFormat(row, column) {
|
||||
return this.dict.label.QC_INSPECTION_TYPE[row.inspection_type]
|
||||
},
|
||||
itemTypeFormat(row, column) {
|
||||
return this.dict.label.QL_TEST_POINTTYPE[row.inspection_item_type]
|
||||
},
|
||||
close() {
|
||||
this.crud.resetQuery(false)
|
||||
this.$emit('update:dialogShow', false)
|
||||
|
||||
@@ -3,38 +3,80 @@
|
||||
<el-dialog
|
||||
title="新增检测项"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
:visible.sync="crud.status.cu > 0 || crud.status.view > 0"
|
||||
fullscreen
|
||||
:before-close="crud.cancelCU"
|
||||
destroy-on-close
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<el-form :inline="true" :model="openParam" class="demo-form-inline">
|
||||
<el-form-item label="方案编码">
|
||||
<el-input v-model.trim="openParam.inspection_scheme_code" disabled />
|
||||
<el-row v-show="crud.status.cu > 0" :gutter="20">
|
||||
<el-col :span="20" style="border: 1px solid white">
|
||||
<span/>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<span>
|
||||
<el-button
|
||||
icon="el-icon-check"
|
||||
size="mini"
|
||||
:loading="crud.cu === 2"
|
||||
type="primary"
|
||||
@click="crud.submitCU"
|
||||
>保存</el-button>
|
||||
<el-button icon="el-icon-close" size="mini" type="info" @click="crud.cancelCU">关闭</el-button>
|
||||
</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form ref="form" :inline="true" :model="form" class="demo-form-inline" :rules="rules">
|
||||
<el-form-item label="方案编码" prop="inspection_scheme_code">
|
||||
<el-input v-model.trim="form.inspection_scheme_code" disabled placeholder="系统生成"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="方案名称">
|
||||
<el-input v-model.trim="openParam.inspection_scheme_name" disabled />
|
||||
<el-form-item label="方案名称" prop="inspection_scheme_name">
|
||||
<el-input v-model.trim="form.inspection_scheme_name" :disabled="crud.status.view > 0"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="明细项数">
|
||||
<el-input v-model.trim="tableData.length" disabled />
|
||||
<el-form-item label="方案类别" prop="inspection_scheme_type">
|
||||
<el-select
|
||||
v-model="form.inspection_scheme_type"
|
||||
size="mini"
|
||||
placeholder="方案类别"
|
||||
class="filter-item"
|
||||
:disabled="crud.status.view > 0"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.QC_INSPECTION_SCHEME_TYPE"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button icon="el-icon-plus" type="primary" @click="itemDialogVisible=true">添加项点</el-button>
|
||||
</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="close">关闭</el-button>
|
||||
<el-form-item label="明细项数" prop="detail_count">
|
||||
<el-input v-model.trim="form.detail_count" disabled/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model.trim="form.remark" style="width: 370px;" rows="2" type="textarea" :disabled="crud.status.view > 0" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<div class="crud-opts2" style="margin-bottom: 5px;">
|
||||
<span class="crud-opts-right2">
|
||||
<!--左侧插槽-->
|
||||
<slot name="left"/>
|
||||
<el-button
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
v-if="crud.status.view <= 0"
|
||||
size="mini"
|
||||
@click="itemDialogVisible=true"
|
||||
>
|
||||
添加项点
|
||||
</el-button>
|
||||
</span>
|
||||
|
||||
</div>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
:data="tableData"
|
||||
:data="form.tableData"
|
||||
border
|
||||
stripe
|
||||
style="width: 100%"
|
||||
@@ -55,21 +97,19 @@
|
||||
<el-table-column
|
||||
prop="inspection_item_type_name"
|
||||
label="项点类别"
|
||||
/>
|
||||
<el-table-column
|
||||
v-if="'02'===$parent.inspection_item_type"
|
||||
prop="workprocedure_name"
|
||||
label="工序名称"
|
||||
:formatter="itemTypeFormat"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="inspection_type_name"
|
||||
label="检测方式"
|
||||
:formatter="typeFormat"
|
||||
/>
|
||||
<el-table-column prop="order_index" label="顺序号">
|
||||
<template slot-scope="scope">
|
||||
<el-input
|
||||
v-model="tableData[scope.$index].order_index"
|
||||
v-model="form.tableData[scope.$index].order_index"
|
||||
size="mini"
|
||||
:disabled="crud.status.view > 0"
|
||||
type="number"
|
||||
class="edit-input"
|
||||
style="width: 100px"
|
||||
@@ -77,95 +117,91 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作">
|
||||
<el-table-column label="操作" v-if="crud.status.view <= 0">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
@click="handleDelete(scope.$index, scope.row)"
|
||||
@click="handleDelete(scope.$index, form.tableData)"
|
||||
>删除
|
||||
</el-button>
|
||||
</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>
|
||||
<ItemDialog
|
||||
:dialog-show.sync="itemDialogVisible"
|
||||
:inspection-item-type="inspectionItemType"
|
||||
:open-param="openParam"
|
||||
:open-param="{}"
|
||||
@tableChanged2="tableChanged2"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CRUD, { crud } from '@crud/crud'
|
||||
import CRUD, {crud, form} from '@crud/crud'
|
||||
import ItemDialog from '@/views/wms/masterdata_manage/ql/inspectionSchemeMst/ItemDialog'
|
||||
import crudInspectionSchemeMst from '@/views/wms/masterdata_manage/ql/inspectionSchemeMst/inspectionSchemeMst'
|
||||
|
||||
const defaultForm = {
|
||||
inspection_scheme_id: null,
|
||||
inspection_scheme_code: '',
|
||||
inspection_scheme_name: null,
|
||||
inspection_scheme_type: null,
|
||||
factory_qty: null,
|
||||
workprocedure_qty: null,
|
||||
physical_qty: null,
|
||||
remark: null,
|
||||
is_used: null,
|
||||
create_id: null,
|
||||
create_name: null,
|
||||
create_time: null,
|
||||
update_optid: null,
|
||||
update_optname: null,
|
||||
update_time: null,
|
||||
is_delete: null,
|
||||
detail_count: null,
|
||||
tableData: []
|
||||
}
|
||||
export default {
|
||||
name: 'SetDialog',
|
||||
mixins: [crud()],
|
||||
components: { ItemDialog },
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
openParam: {
|
||||
type: Object,
|
||||
default: () => { return {} }
|
||||
},
|
||||
openArray: {
|
||||
type: Array,
|
||||
default: () => { return [] }
|
||||
}
|
||||
},
|
||||
components: {ItemDialog},
|
||||
mixins: [crud(), form(defaultForm)],
|
||||
dicts: ['QL_TEST_POINTTYPE', 'QC_INSPECTION_TYPE', 'QC_INSPECTION_SCHEME_TYPE'],
|
||||
data() {
|
||||
return {
|
||||
itemDialogVisible: false,
|
||||
dialogVisible: false,
|
||||
inspectionItemType: null,
|
||||
cols: [],
|
||||
tableData: [],
|
||||
formData: {
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
openArray: {
|
||||
handler(newValue) {
|
||||
this.tableData = newValue
|
||||
}
|
||||
},
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
if (newValue) {
|
||||
this.inspectionItemType = this.$parent.inspection_item_type
|
||||
}
|
||||
rules: {
|
||||
inspection_scheme_name: [
|
||||
{required: true, message: '方案名称不能为空', trigger: 'blur'}
|
||||
],
|
||||
inspection_scheme_type: [
|
||||
{required: true, message: '方案类别不能为空', trigger: 'blur'}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
/* const param = {
|
||||
inspection_item_type: this.$parent.inspection_item_type,
|
||||
inspection_scheme_id: this.openParam.inspection_scheme_id
|
||||
[CRUD.HOOK.beforeSubmit]() {
|
||||
if (this.form.tableData.length === 0) {
|
||||
this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
crudInspectionSchemeMst.getInspectionSchemeDtl(param).then(res => {
|
||||
this.tableData = res
|
||||
})*/
|
||||
},
|
||||
[CRUD.HOOK.beforeToEdit]() {
|
||||
crudInspectionSchemeMst.getDtl(this.form).then(res => {
|
||||
this.form.tableData = res
|
||||
})
|
||||
},
|
||||
[CRUD.HOOK.afterToView]() {
|
||||
crudInspectionSchemeMst.getDtl(this.form).then(res => {
|
||||
this.form.tableData = res
|
||||
})
|
||||
},
|
||||
tableChanged2: function(rows) {
|
||||
// 判断项点是否已存在
|
||||
rows.forEach((item) => {
|
||||
let same_mater = true
|
||||
this.tableData.forEach((row) => {
|
||||
this.form.tableData.forEach((row) => {
|
||||
// 对新增的行进行校验不能存在相同项点
|
||||
if (row.inspection_item_id === item.inspection_item_id) {
|
||||
same_mater = false
|
||||
@@ -173,24 +209,20 @@ export default {
|
||||
}
|
||||
})
|
||||
if (same_mater) {
|
||||
this.tableData.splice(-1, 0, item)
|
||||
this.form.tableData.splice(-1, 0, item)
|
||||
}
|
||||
})
|
||||
this.form.detail_count = this.form.tableData.length
|
||||
},
|
||||
typeFormat(row, column) {
|
||||
return this.dict.label.QC_INSPECTION_TYPE[row.inspection_type]
|
||||
},
|
||||
itemTypeFormat(row, column) {
|
||||
return this.dict.label.QL_TEST_POINTTYPE[row.inspection_item_type]
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
this.tableData.splice(index, 1)
|
||||
},
|
||||
onSubmit: function() {
|
||||
this.openParam.inspection_item_type = this.$parent.inspection_item_type
|
||||
const param = {
|
||||
formData: this.openParam,
|
||||
tableData: this.tableData
|
||||
}
|
||||
crudInspectionSchemeMst.saveInspectionSchemeDtl(param).then(res => {
|
||||
this.notify('操作成功', 'success')
|
||||
this.$parent.hand()
|
||||
this.close()
|
||||
})
|
||||
row.splice(index, 1)
|
||||
this.form.detail_count = this.form.tableData.length
|
||||
},
|
||||
notify(title, type) {
|
||||
this.$notify({
|
||||
|
||||
@@ -1,136 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog
|
||||
title="新增检测项"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
fullscreen
|
||||
destroy-on-close
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<el-form :inline="true" :model="openParam" class="demo-form-inline">
|
||||
<el-form-item label="方案编码">
|
||||
<el-input v-model.trim="openParam.inspection_scheme_code" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="方案名称">
|
||||
<el-input v-model.trim="openParam.inspection_scheme_name" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="方案类别">
|
||||
<el-select
|
||||
v-model="openParam.inspection_scheme_type"
|
||||
disabled
|
||||
size="mini"
|
||||
placeholder="方案类别"
|
||||
class="filter-item"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.QC_INSPECTION_SCHEME_TYPE"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button icon="el-icon-error" type="info" @click="close">关闭</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
:data="tableData"
|
||||
border
|
||||
stripe
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column
|
||||
v-if="false"
|
||||
prop="inspection_item_id"
|
||||
label="项点标识"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="inspection_item_code"
|
||||
label="项点编码"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="inspection_item_name"
|
||||
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>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { crud } from '@crud/crud'
|
||||
export default {
|
||||
name: 'ViewDialog',
|
||||
dicts: ['QC_INSPECTION_SCHEME_TYPE'],
|
||||
mixins: [crud()],
|
||||
props: {
|
||||
visiable1: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
openParam: {
|
||||
type: Object
|
||||
},
|
||||
openArray: {
|
||||
type: Array,
|
||||
default: () => { return [] }
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
itemDialogVisible: false,
|
||||
dialogVisible: false,
|
||||
inspectionItemType: null,
|
||||
cols: [],
|
||||
tableData: [],
|
||||
formData: {}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
openArray: {
|
||||
handler(newValue) {
|
||||
this.tableData = newValue
|
||||
}
|
||||
},
|
||||
visiable1: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
if (newValue) {
|
||||
// this.inspectionItemType = this.$parent.inspection_item_type
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
// const param = {
|
||||
// inspection_scheme_id: this.openParam.inspection_scheme_id
|
||||
// }
|
||||
// crudInspectionSchemeMst.getInspectionSchemeDtl(param).then(res => {
|
||||
// this.tableData = res
|
||||
// })
|
||||
},
|
||||
close() {
|
||||
this.tableData = []
|
||||
this.$emit('update:visiable1', false)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -12,7 +12,7 @@
|
||||
>
|
||||
<el-form-item label="模糊搜索">
|
||||
<el-input
|
||||
v-model="query.name"
|
||||
v-model="query.sch_search"
|
||||
clearable
|
||||
placeholder="方案编码、名称"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
@@ -34,89 +34,14 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
<rrOperation/>
|
||||
</el-form>
|
||||
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
:disabled="crud.selections.length !== 1"
|
||||
@click="maintenance('01',crud.selections[0])"
|
||||
>
|
||||
质保项维护
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="info"
|
||||
icon="el-icon-position"
|
||||
:disabled="crud.selections.length !== 1"
|
||||
size="mini"
|
||||
@click="maintenance('02',crud.selections[0])"
|
||||
>
|
||||
工序自检项
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-position"
|
||||
:disabled="crud.selections.length !== 1"
|
||||
size="mini"
|
||||
@click="maintenance('03',crud.selections[0])"
|
||||
>
|
||||
理化项维护
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表单组件-->
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:before-close="crud.cancelCU"
|
||||
:visible.sync="crud.status.cu > 0"
|
||||
:title="crud.status.title"
|
||||
width="500px"
|
||||
>
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="80px">
|
||||
<el-form-item label="方案编码" prop="inspection_scheme_code">
|
||||
<el-input v-model.trim="form.inspection_scheme_code" style="width: 370px;" :disabled="true" placeholder="系统生成" />
|
||||
</el-form-item>
|
||||
<el-form-item label="方案名称" prop="inspection_scheme_name">
|
||||
<el-input v-model.trim="form.inspection_scheme_name" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="方案类别" prop="inspection_scheme_type">
|
||||
<el-select
|
||||
v-model="form.inspection_scheme_type"
|
||||
size="mini"
|
||||
placeholder="方案类别"
|
||||
class="filter-item"
|
||||
style="width: 370px;"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.QC_INSPECTION_SCHEME_TYPE"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model.trim="form.remark" style="width: 370px;" rows="2" type="textarea" />
|
||||
</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>
|
||||
<!--表格渲染-->
|
||||
<crudOperation :permission="permission" />
|
||||
<!-- 表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
@@ -125,22 +50,20 @@
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column v-if="false" prop="inspection_scheme_id" label="检验方案标识" />
|
||||
<el-table-column type="selection" width="55"/>
|
||||
<el-table-column v-if="false" prop="inspection_scheme_id" label="检验方案标识"/>
|
||||
<el-table-column prop="inspection_scheme_code" label="方案编码">
|
||||
<template slot-scope="scope">
|
||||
<el-link type="warning" @click="view(scope.row)">{{ scope.row.inspection_scheme_code }}</el-link>
|
||||
<el-link type="warning" @click="crud.toView(scope.row)">{{ scope.row.inspection_scheme_code }}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="inspection_scheme_name" label="方案名称" />
|
||||
<el-table-column prop="inspection_scheme_name" label="方案名称"/>
|
||||
<el-table-column prop="inspection_scheme_type" label="方案类别" :formatter="format_inspection_scheme_type" />
|
||||
<el-table-column prop="factory_qty" label="质保项数" />
|
||||
<el-table-column prop="workprocedure_qty" label="自检项数" />
|
||||
<el-table-column prop="physical_qty" label="理化项数" />
|
||||
<el-table-column prop="remark" label="备注" />
|
||||
<el-table-column v-if="false" prop="is_used" label="是否启用" />
|
||||
<el-table-column prop="update_optname" label="修改人" />
|
||||
<el-table-column prop="update_time" label="修改时间" width="135" />
|
||||
<el-table-column prop="detail_count" label="明细数"/>
|
||||
<el-table-column prop="remark" label="备注"/>
|
||||
<el-table-column v-if="false" prop="is_used" label="是否启用"/>
|
||||
<el-table-column prop="create_name" label="修改人"/>
|
||||
<el-table-column prop="create_time" label="修改时间" width="135"/>
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
@@ -151,46 +74,25 @@
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
<pagination/>
|
||||
</div>
|
||||
<MaintenanceDialog :dialog-show.sync="maintenanceShow" :open-param="openParam" :open-array="openArray" />
|
||||
<ViewDialog :visiable1.sync="visiable1" :open-param="openParam" :open-array="openArray" />
|
||||
<MaintenanceDialog/>
|
||||
<ViewDialog :visiable1.sync="visiable1" :open-param="openParam" :open-array="openArray"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudInspectionSchemeMst from '@/views/wms/masterdata_manage/ql/inspectionSchemeMst/inspectionSchemeMst'
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import CRUD, { crud, header, presenter } 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'
|
||||
import MaintenanceDialog from './MaintenanceDialog'
|
||||
import ViewDialog from './ViewDialog'
|
||||
|
||||
const defaultForm = {
|
||||
inspection_scheme_id: null,
|
||||
inspection_scheme_code: '',
|
||||
inspection_scheme_name: null,
|
||||
inspection_scheme_type: null,
|
||||
factory_qty: null,
|
||||
workprocedure_qty: null,
|
||||
physical_qty: null,
|
||||
remark: null,
|
||||
is_used: null,
|
||||
create_id: null,
|
||||
create_name: null,
|
||||
create_time: null,
|
||||
update_optid: null,
|
||||
update_optname: null,
|
||||
update_time: null,
|
||||
is_delete: null
|
||||
}
|
||||
export default {
|
||||
name: 'InspectionSchemeMst',
|
||||
dicts: ['QC_INSPECTION_SCHEME_TYPE'],
|
||||
components: { pagination, crudOperation, rrOperation, udOperation, MaintenanceDialog, ViewDialog },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
components: { pagination, crudOperation, rrOperation, udOperation, MaintenanceDialog },
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '检测方案',
|
||||
@@ -204,9 +106,11 @@ export default {
|
||||
download: false,
|
||||
reset: true
|
||||
},
|
||||
crudMethod: { ...crudInspectionSchemeMst }
|
||||
crudMethod: {...crudInspectionSchemeMst}
|
||||
})
|
||||
},
|
||||
mixins: [presenter(), header(), crud()],
|
||||
dicts: ['QC_INSPECTION_SCHEME_TYPE'],
|
||||
data() {
|
||||
return {
|
||||
openParam: {},
|
||||
@@ -214,15 +118,7 @@ export default {
|
||||
visiable1: false,
|
||||
openArray: [],
|
||||
inspection_item_type: null,
|
||||
permission: {},
|
||||
rules: {
|
||||
inspection_scheme_name: [
|
||||
{ required: true, message: '检验方案名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
inspection_scheme_type: [
|
||||
{ required: true, message: '检验方案类别不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
permission: {}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -233,23 +129,8 @@ export default {
|
||||
hand(value) {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
view(row) {
|
||||
crudInspectionSchemeMst.getInspectionSchemeDtl({ inspection_scheme_id: row.inspection_scheme_id }).then(res => {
|
||||
this.openArray = res
|
||||
this.visiable1 = true
|
||||
this.openParam = row
|
||||
})
|
||||
},
|
||||
format_inspection_scheme_type(row, column) {
|
||||
return this.dict.label.QC_INSPECTION_SCHEME_TYPE[row.inspection_scheme_type]
|
||||
},
|
||||
maintenance(type, data) {
|
||||
crudInspectionSchemeMst.getInspectionSchemeDtl({ inspection_scheme_id: data.inspection_scheme_id, inspection_item_type: type }).then(res => {
|
||||
this.openArray = res
|
||||
this.inspection_item_type = type
|
||||
this.openParam = data
|
||||
this.maintenanceShow = true
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,40 +10,34 @@ export function add(data) {
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/inspectionSchemeMst/',
|
||||
method: 'delete',
|
||||
url: 'api/inspectionSchemeMst/delete',
|
||||
method: 'post',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/inspectionSchemeMst',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function saveInspectionSchemeDtl(data) {
|
||||
return request({
|
||||
url: 'api/inspectionSchemeMst/saveInspectionSchemeDtl',
|
||||
url: 'api/inspectionSchemeMst/update',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getInspectionSchemeDtl(data) {
|
||||
export function getDtl(data) {
|
||||
return request({
|
||||
url: 'api/inspectionSchemeMst/getInspectionSchemeDtl',
|
||||
url: 'api/inspectionSchemeMst/getDtl',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function selectList() {
|
||||
export function selectList(data) {
|
||||
return request({
|
||||
url: 'api/inspectionSchemeMst/selectList'
|
||||
url: 'api/inspectionSchemeMst/selectList',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, saveInspectionSchemeDtl, getInspectionSchemeDtl, selectList }
|
||||
export default { add, edit, del, getDtl, selectList }
|
||||
|
||||
@@ -86,16 +86,14 @@
|
||||
label="项点名称"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="inspection_item_type_name"
|
||||
prop="inspection_item_type"
|
||||
label="项点类别"
|
||||
:formatter="itemTypeFormat"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="workprocedure_name"
|
||||
label="工序名称"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="inspection_type_name"
|
||||
prop="inspection_type"
|
||||
label="检测方式"
|
||||
:formatter="typeFormat"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="down_limit"
|
||||
@@ -171,7 +169,7 @@
|
||||
:dialog-show.sync="materShow"
|
||||
:is-single="true"
|
||||
:mater-opt-code="'00'"
|
||||
@tableChanged2="tableChanged2"
|
||||
@setMaterValue="tableChanged2"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
@@ -193,6 +191,7 @@ export default {
|
||||
name: 'AddDialog',
|
||||
components: { MaterDtl },
|
||||
mixins: [crud(), form(defaultForm)],
|
||||
dicts:[ 'QC_INSPECTION_TYPE', 'QL_TEST_POINTTYPE'],
|
||||
data() {
|
||||
return {
|
||||
selectList: [],
|
||||
@@ -206,29 +205,23 @@ export default {
|
||||
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
|
||||
[CRUD.HOOK.beforeToEdit]() {
|
||||
crudProductStandard.getDtl(this.form).then(res => {
|
||||
this.form.tableData = res
|
||||
})
|
||||
},
|
||||
typeFormat(row, column) {
|
||||
return this.dict.label.QC_INSPECTION_TYPE[row.inspection_type]
|
||||
},
|
||||
itemTypeFormat(row, column) {
|
||||
return this.dict.label.QL_TEST_POINTTYPE[row.inspection_item_type]
|
||||
},
|
||||
handDtl() {
|
||||
const param = {
|
||||
inspection_scheme_id: this.form.inspection_scheme_id
|
||||
}
|
||||
crudProductStandard.getInspectionSchemeDtl(param).then(res => {
|
||||
crudInspectionSchemeMst.getDtl(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
|
||||
@@ -238,9 +231,6 @@ export default {
|
||||
})
|
||||
this.form.tableData = map1
|
||||
})
|
||||
},
|
||||
hand() {
|
||||
|
||||
},
|
||||
onSubmit() {
|
||||
let optType = null
|
||||
@@ -302,7 +292,7 @@ export default {
|
||||
// 新增一行物料时,给行进行赋值
|
||||
this.form.material_id = data.material_id
|
||||
this.form.material_code = data.material_code
|
||||
this.form.material_name = data.material_name + '##' + data.material_code
|
||||
this.form.material_name = data.material_name
|
||||
},
|
||||
close() {
|
||||
this.$emit('update:visiable1', false)
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
>
|
||||
<el-form-item label="方案">
|
||||
<el-input
|
||||
v-model="query.inspection_scheme_name"
|
||||
v-model="query.inspection_scheme_search"
|
||||
clearable
|
||||
placeholder="方案编码、名称"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
@@ -20,7 +20,7 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="物料">
|
||||
<el-input
|
||||
v-model="query.material_name"
|
||||
v-model="query.material_search"
|
||||
clearable
|
||||
placeholder="物料编码、名称"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
@@ -77,10 +77,8 @@
|
||||
<el-table-column prop="material_name" label="物料名称" width="200" show-tooltip-when-overflow />
|
||||
<el-table-column prop="inspection_scheme_code" label="方案编码" />
|
||||
<el-table-column prop="inspection_scheme_name" label="方案名称" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="inspection_scheme_type_name" label="方案类别" />
|
||||
<el-table-column prop="zb_num" label="质保项数" />
|
||||
<el-table-column prop="zj_num" label="质检项数" />
|
||||
<el-table-column prop="lh_num" label="理化项数" />
|
||||
<el-table-column prop="inspection_scheme_type_name" label="方案类别" :formatter="format_inspection_scheme_type" />
|
||||
<el-table-column prop="detail_count" label="明细数" />
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
@@ -132,8 +130,8 @@ export default {
|
||||
return CRUD({
|
||||
title: '产品方案标准',
|
||||
url: 'api/productStandard',
|
||||
idField: 'inspection_standard_dtl_id',
|
||||
sort: 'inspection_standard_dtl_id,desc',
|
||||
idField: 'material_id',
|
||||
sort: 'material_id,desc',
|
||||
optShow: {
|
||||
add: true,
|
||||
edit: true,
|
||||
@@ -191,6 +189,9 @@ export default {
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
format_inspection_scheme_type(row, column) {
|
||||
return this.dict.label.QC_INSPECTION_SCHEME_TYPE[row.inspection_scheme_type]
|
||||
},
|
||||
copyAdd(data) {
|
||||
this.isCopyAdd = '1'
|
||||
this.crud.toEdit(data)
|
||||
|
||||
@@ -10,8 +10,8 @@ export function add(data) {
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/productStandard/',
|
||||
method: 'delete',
|
||||
url: 'api/productStandard/delete',
|
||||
method: 'post',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
@@ -30,20 +30,14 @@ export function saveData(data) {
|
||||
data
|
||||
})
|
||||
}
|
||||
export function copyAdd(data) {
|
||||
|
||||
export function getDtl(data) {
|
||||
return request({
|
||||
url: 'api/productStandard/copyAdd',
|
||||
url: 'api/productStandard/getDtl',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getInspectionSchemeDtl(data) {
|
||||
return request({
|
||||
url: 'api/productStandard/getInspectionSchemeDtl',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, saveData, copyAdd,getInspectionSchemeDtl }
|
||||
export default { add, edit, del, saveData, getDtl }
|
||||
|
||||
Reference in New Issue
Block a user