Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
ee1f37d64b
|
|
@ -20,7 +20,7 @@ import java.util.Map;
|
|||
public interface OriginalRecordMapper {
|
||||
|
||||
/**
|
||||
* 原始记录列表
|
||||
* 审查记录列表
|
||||
*
|
||||
* @param dto
|
||||
* @return List<ExperimentalVo>
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ public class ConfigItemsVo {
|
|||
* 金额
|
||||
*/
|
||||
@NotBlank(message = "金额不能为空", groups = {Query.class})
|
||||
@Pattern(regexp = "(?:0|(?:[1-9]\\d{0,8}))(\\.\\d{2})?", message = "金额格式不正确(范围0-100000000并且最多保留两位小数)", groups = {Query.class})
|
||||
@Pattern(regexp = "(?:0(?:\\.0{0,2})?|[1-9]\\d{0,7}(?:\\.\\d{1,2})?|100000000(?:\\.0{1,2})?)", message = "金额格式不正确(范围0-100000000并且最多保留两位小数)", groups = {Query.class})
|
||||
private String amount;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ public class ExperDevVo {
|
|||
private String devData;
|
||||
/**额外超出的金额默认值0*/
|
||||
@NotBlank(message = "金额不能为空", groups = {Query.class})
|
||||
@Pattern(regexp = "(?:0|(?:[1-9]\\d{0,8}))(\\.\\d{2})?", message = "金额格式不正确(范围0-100000000并且最多保留两位小数)", groups = {Query.class})
|
||||
@Pattern(regexp = "(?:0(?:\\.0{0,2})?|[1-9]\\d{0,7}(?:\\.\\d{1,2})?|100000000(?:\\.0{1,2})?)", message = "金额格式不正确(范围0-100000000并且最多保留两位小数)", groups = {Query.class})
|
||||
private String amount;
|
||||
/**备注*/
|
||||
@NotBlank(message = "备注不能为空", groups = {Query.class})
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.bonus.aqgqj.primaryData.controller;
|
|||
import com.bonus.aqgqj.annotation.DecryptAndVerify;
|
||||
import com.bonus.aqgqj.annotation.LogAnnotation;
|
||||
import com.bonus.aqgqj.basis.entity.dto.ParamsDto;
|
||||
import com.bonus.aqgqj.basis.entity.vo.ExperimentalDetailVo;
|
||||
import com.bonus.aqgqj.basis.entity.vo.ExperimentalVo;
|
||||
import com.bonus.aqgqj.exper.dao.DeviceDao;
|
||||
import com.bonus.aqgqj.exper.entity.vo.ExperDevice;
|
||||
|
|
@ -54,5 +55,16 @@ public class PrimaryDataController {
|
|||
return ServerResponse.createSuccessPage(pageInfo, data.getData().getPage(), data.getData().getLimit());
|
||||
}
|
||||
|
||||
@PostMapping(value = "getDetailList")
|
||||
@DecryptAndVerify(decryptedClass = ParamsDto.class)//加解密统一管理
|
||||
@LogAnnotation(operModul = "试验详情管理", operation = "查询试验详情列表", operDesc = "系统级事件", operType = "查询")
|
||||
// @PreAuthorize("@pms.hasPermission('sys:experimentalTest:query')")
|
||||
public ServerResponse getDetailList(EncryptedReq<ParamsDto> data) {
|
||||
PageHelper.startPage(data.getData().getPage(), data.getData().getLimit());
|
||||
List<ExperimentalDetailVo> list = primarydataService.getDetailList(data.getData());
|
||||
PageInfo<ExperimentalDetailVo> pageInfo = new PageInfo<>(list);
|
||||
return ServerResponse.createSuccessPage(pageInfo, data.getData().getPage(), data.getData().getLimit());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,14 @@
|
|||
package com.bonus.aqgqj.primaryData.dao;
|
||||
|
||||
import com.bonus.aqgqj.basis.entity.dto.ParamsDto;
|
||||
import com.bonus.aqgqj.basis.entity.vo.ExperimentalDetailVo;
|
||||
import com.bonus.aqgqj.basis.entity.vo.ExperimentalVo;
|
||||
import com.bonus.aqgqj.exper.entity.vo.ExperDevice;
|
||||
import org.apache.ibatis.annotations.MapKey;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Mapper
|
||||
public interface PrimaryDataDao {
|
||||
|
|
@ -17,46 +20,25 @@ public interface PrimaryDataDao {
|
|||
*/
|
||||
List<ExperimentalVo> getList(ParamsDto data);
|
||||
|
||||
// /**
|
||||
// * 根据实验设备id获取信息
|
||||
// * @param device
|
||||
// * @return
|
||||
// */
|
||||
// ExperDevice getDeviceId(ExperDevice device);
|
||||
//
|
||||
// /**
|
||||
// * 根据设备id查询是否重名
|
||||
// * @param devName
|
||||
// * @param devId
|
||||
// * @return
|
||||
// */
|
||||
// ExperDevice getDevice(String devName,Long devId);
|
||||
//
|
||||
// /**
|
||||
// * 修改该条设备数据
|
||||
// * @param device
|
||||
// * @return
|
||||
// */
|
||||
// int update(ExperDevice device);
|
||||
//
|
||||
// /**
|
||||
// * 根据设备名称查是否重名
|
||||
// * @param devName
|
||||
// * @return
|
||||
// */
|
||||
// ExperDevice getAdd(String devName);
|
||||
//
|
||||
// /**
|
||||
// * 新增该条数据
|
||||
// * @param device
|
||||
// * @return
|
||||
// */
|
||||
// int add(ExperDevice device);
|
||||
// /**
|
||||
// * 删除该条数据
|
||||
// * @param devId
|
||||
// * @return
|
||||
// */
|
||||
// int delDevice(Long devId);
|
||||
/**
|
||||
* 试验详情列表
|
||||
*
|
||||
* @param dto
|
||||
* @return List<ExperimentalDetailVo>
|
||||
* @author cwchen
|
||||
* @date 2024/7/20 13:27
|
||||
*/
|
||||
List<ExperimentalDetailVo> getDetailList(ParamsDto dto);
|
||||
|
||||
/**
|
||||
* 查询试验设备数量
|
||||
*
|
||||
* @param experId
|
||||
* @return List<Sample>
|
||||
* @author cwchen
|
||||
* @date 2024/7/22 10:58
|
||||
*/
|
||||
@MapKey("id")
|
||||
List<Map<String, String>> getExperDevItemsNum(Long experId);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.bonus.aqgqj.primaryData.service;
|
||||
|
||||
import com.bonus.aqgqj.basis.entity.dto.ParamsDto;
|
||||
import com.bonus.aqgqj.basis.entity.vo.ExperimentalDetailVo;
|
||||
import com.bonus.aqgqj.basis.entity.vo.ExperimentalVo;
|
||||
|
||||
|
||||
|
|
@ -15,47 +16,14 @@ public interface PrimaryDataService {
|
|||
*/
|
||||
List<ExperimentalVo> getList(ParamsDto data);
|
||||
|
||||
// /**
|
||||
// * 根据实验设备id获取信息
|
||||
// * @param device
|
||||
// * @return
|
||||
// */
|
||||
// ServerResponse getDeviceId(ExperDevice device);
|
||||
//
|
||||
// /**
|
||||
// * 根据设备id查询是否重名
|
||||
// * @param devName
|
||||
// * @param devId
|
||||
// * @return
|
||||
// */
|
||||
// ExperDevice getDevice(String devName,Long devId);
|
||||
//
|
||||
// /**
|
||||
// * 修改该条设备数据
|
||||
// * @param device
|
||||
// * @return
|
||||
// */
|
||||
// ExperDevice updateDevice(ExperDevice device);
|
||||
//
|
||||
// /**
|
||||
// * 根据设备名称查是否重名
|
||||
// * @param devName
|
||||
// * @return
|
||||
// */
|
||||
// ExperDevice getAdd(String devName);
|
||||
//
|
||||
// /**
|
||||
// * 新增该条数据
|
||||
// * @param device
|
||||
// * @return
|
||||
// */
|
||||
// ExperDevice add(ExperDevice device);
|
||||
//
|
||||
// /**
|
||||
// * 删除该条数据
|
||||
// * @param devId
|
||||
// * @return
|
||||
// */
|
||||
// int delDevice(Long devId);
|
||||
/**
|
||||
* 试验详情列表
|
||||
*
|
||||
* @param data
|
||||
* @return List<ExperimentalDetailVo>
|
||||
* @author cwchen
|
||||
* @date 2024/7/20 13:26
|
||||
*/
|
||||
List<ExperimentalDetailVo> getDetailList(ParamsDto data);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,14 +1,18 @@
|
|||
package com.bonus.aqgqj.primaryData.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.bonus.aqgqj.basis.entity.dto.ParamsDto;
|
||||
import com.bonus.aqgqj.basis.entity.vo.ExperimentalDetailVo;
|
||||
import com.bonus.aqgqj.basis.entity.vo.ExperimentalVo;
|
||||
import com.bonus.aqgqj.primaryData.dao.PrimaryDataDao;
|
||||
import com.bonus.aqgqj.primaryData.service.PrimaryDataService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
|
|
@ -30,55 +34,29 @@ public class PrimaryDataServiceImpl implements PrimaryDataService {
|
|||
return list;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public ServerResponse getDeviceId(ExperDevice device) {
|
||||
// try{
|
||||
// ExperDevice vo= deviceDao.getDeviceId(device);
|
||||
// return ServerResponse.createSuccess(vo);
|
||||
// }catch (Exception e){
|
||||
// return ServerResponse.createSuccess("修改成功");
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public ExperDevice getDevice(String devName,Long devId) {
|
||||
// try{
|
||||
// return deviceDao.getDevice(devName,devId);
|
||||
// }catch (Exception e){
|
||||
// log.error(e.toString(),e);
|
||||
// }
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
//
|
||||
// @Override
|
||||
// @Transactional
|
||||
// public ExperDevice updateDevice(ExperDevice device) {
|
||||
// deviceDao.update(device);
|
||||
// return device;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public ExperDevice getAdd(String devName) {
|
||||
// try{
|
||||
// return deviceDao.getAdd(devName);
|
||||
// }catch (Exception e){
|
||||
// log.error(e.toString(),e);
|
||||
// }
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// @Transactional
|
||||
// public ExperDevice add(ExperDevice device) {
|
||||
// deviceDao.add(device);
|
||||
// return device;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public int delDevice(Long devId) {
|
||||
// return deviceDao.delDevice(devId);
|
||||
// }
|
||||
//
|
||||
@Override
|
||||
public List<ExperimentalDetailVo> getDetailList(ParamsDto dto) {
|
||||
List<ExperimentalDetailVo> list = new ArrayList<>();
|
||||
try {
|
||||
list = primarydataDao.getDetailList(dto);
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
for (ExperimentalDetailVo detailVo : list) {
|
||||
// 样品试验结果、样品数量、送样总数
|
||||
List<ExperimentalDetailVo.Sample> sampleList = new ArrayList<>();
|
||||
if (detailVo.getExperId() != null) {
|
||||
List<Map<String, String>> mapList = primarydataDao.getExperDevItemsNum(detailVo.getExperId());
|
||||
JSONArray jsonArray = new JSONArray();
|
||||
jsonArray.addAll(mapList);
|
||||
sampleList = jsonArray.toJavaList(ExperimentalDetailVo.Sample.class);
|
||||
}
|
||||
detailVo.setSampleList(sampleList);
|
||||
detailVo.setSampleQuantity(sampleList.size());
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,24 +29,10 @@
|
|||
DATE_FORMAT(ts.sample_date, '%Y-%m-%d') AS sampleDate,
|
||||
tt.team_name AS teamName,
|
||||
ts.process_status AS status,
|
||||
<if test="roleCode == 'experimentalTeamLeader'">
|
||||
CASE WHEN process_status = 1 AND audti_status = 0 THEN '待审阅'
|
||||
END AS audtiStatus,
|
||||
</if>
|
||||
<if test="roleCode == 'technicalDirector'">
|
||||
CASE WHEN process_status = 2 AND audti_status = 0 THEN '待审核'
|
||||
END AS audtiStatus,
|
||||
</if>
|
||||
<if test="roleCode=='centerManager'">
|
||||
CASE WHEN process_status = 3 AND audti_status = 0 THEN '待审批'
|
||||
END AS audtiStatus,
|
||||
</if>
|
||||
<if test="roleCode == 'administrators'">
|
||||
CASE WHEN process_status = 1 AND audti_status = 0 THEN '待审阅'
|
||||
WHEN process_status = 2 AND audti_status = 0 THEN '待审核'
|
||||
WHEN process_status = 3 AND audti_status = 0 THEN '待审批'
|
||||
END AS audtiStatus,
|
||||
</if>
|
||||
CASE WHEN process_status = 1 AND audti_status = 0 THEN '待审阅'
|
||||
WHEN process_status = 2 AND audti_status = 0 THEN '待审核'
|
||||
WHEN process_status = 3 AND audti_status = 0 THEN '待审批'
|
||||
END AS audtiStatus,
|
||||
ts.remarks
|
||||
FROM tb_sample ts
|
||||
LEFT JOIN tb_custom tc ON ts.custom_id = tc.id
|
||||
|
|
|
|||
|
|
@ -275,7 +275,7 @@
|
|||
FROM tb_sample ts
|
||||
LEFT JOIN tb_custom tc ON ts.custom_id = tc.id
|
||||
LEFT JOIN sys_user su ON ts.create_user = su.id AND su.del_flag = 0
|
||||
LEFT JOIN sys_user su2 ON ts.update_user = su2.id AND su2.del_flag = 0
|
||||
LEFT JOIN sys_user su2 ON ts.dispatch_user = su2.id AND su2.del_flag = 0
|
||||
LEFT JOIN tb_team tt ON ts.team_id = tt.id AND tt.del_flag = 0
|
||||
LEFT JOIN (
|
||||
SELECT sample_id,COUNT(sample_id) AS num,ANY_VALUE(GROUP_CONCAT(DISTINCT dev_type_name)) AS sampleDev,ANY_VALUE(GROUP_CONCAT(DISTINCT dev_type_code)) AS sampleDevCode
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.aqgqj.basis.dao.OriginalRecordMapper">
|
||||
|
||||
<!--原始记录列表-->
|
||||
<!--审查记录列表-->
|
||||
<select id="getList" resultType="com.bonus.aqgqj.basis.entity.vo.ExperimentalVo">
|
||||
SELECT ts.id,
|
||||
tc.custom_name AS customName,
|
||||
|
|
|
|||
|
|
@ -51,4 +51,36 @@
|
|||
ORDER BY dispatch_time ASC
|
||||
</select>
|
||||
|
||||
<!--试验详情列表-->
|
||||
<select id="getDetailList" resultType="com.bonus.aqgqj.basis.entity.vo.ExperimentalDetailVo">
|
||||
SELECT * FROM (
|
||||
SELECT ANY_VALUE(tsd.sample_id) AS sampleId,
|
||||
ANY_VALUE(tsd.dev_type_name) AS devTypeName,
|
||||
tsd.dev_type_code AS devTypeCode,
|
||||
ANY_VALUE(te.id) AS experId,
|
||||
COUNT(tsd.dev_type_code) AS sampleNum,
|
||||
ANY_VALUE(te.audit_remakr) AS causeOfRejection,
|
||||
ANY_VALUE(su2.user_name) AS experimenter,
|
||||
ANY_VALUE(DATE_FORMAT(te.update_time, '%Y-%m-%d')) AS testTime
|
||||
FROM tb_sample_device tsd
|
||||
LEFT JOIN tb_exper te ON tsd.sample_id = te.sample_id AND tsd.dev_type_code = te.dev_type_code AND te.del_flag = 0
|
||||
LEFT JOIN sys_user su2 ON te.update_user = su2.id AND su2.del_flag = 0
|
||||
WHERE tsd.sample_id = #{id} AND tsd.del_falg = 0 and te.`status` = 4 and te.audit_status = 1
|
||||
<if test="devTypeCode != null and devTypeCode!=''">
|
||||
AND INSTR(tsd.dev_type_code,#{devTypeCode})
|
||||
</if>
|
||||
GROUP BY tsd.dev_type_code
|
||||
)a
|
||||
ORDER BY a.testTime DESC
|
||||
</select>
|
||||
|
||||
<!--查询试验设备数量-->
|
||||
<select id="getExperDevItemsNum" resultType="java.util.Map">
|
||||
SELECT dev_code AS devCode,
|
||||
case is_hg WHEN '1' THEN '不合格'
|
||||
WHEN '0' THEN '合格'
|
||||
ELSE '不合格' END AS testResult
|
||||
FROM tb_exper_dev
|
||||
WHERE exper_id = #{experId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -798,6 +798,10 @@ input:-ms-input-placeholder {
|
|||
.classTable thead tr:nth-of-type(1) {
|
||||
background-color: #f0f0f0;
|
||||
height: 40px;
|
||||
font-size: 18px;
|
||||
color: #262626;
|
||||
letter-spacing: 1px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.classTable thead tr:nth-of-type(1) td {
|
||||
|
|
@ -825,4 +829,6 @@ input:-ms-input-placeholder {
|
|||
.classTable tbody tr {
|
||||
width: 100%;
|
||||
cursor: pointer;
|
||||
height: 40px;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -253,7 +253,7 @@ function getMouseover(data) {
|
|||
html += '</table>';
|
||||
let devOpenIndex = layer.open({
|
||||
type: 0,
|
||||
title: '样品设备详情',
|
||||
title: ['<div style="border-left: 3px solid #00377A;color:#00377A;font-size:18px;display: flex;letter-spacing:1px;align-items: center;height: 20px;padding: 0 10px;font-weight: bold;">样品设备详情</div>', 'font-size:16px;background-color:#f0f0f0;display: flex;align-items: center;'],
|
||||
area: ['400px', '500px'],
|
||||
content: html,
|
||||
btn: ['关闭'],
|
||||
|
|
@ -320,7 +320,7 @@ function viewData(experId, devTypeCode) {
|
|||
'experId': experId,
|
||||
'devTypeCode': devTypeCode
|
||||
}
|
||||
openIframe7("viewData", title, "child/viewExperData.html", '1500px', '800px', param);
|
||||
openIframe7("viewData", title, "child/viewExperData.html", '1500px', '750px', param);
|
||||
}
|
||||
|
||||
/**/
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@ function getMouseover(data) {
|
|||
html += '</table>';
|
||||
let devOpenIndex = layer.open({
|
||||
type: 0,
|
||||
title: '样品设备详情',
|
||||
title: ['<div style="border-left: 3px solid #00377A;color:#00377A;font-size:18px;display: flex;letter-spacing:1px;align-items: center;height: 20px;padding: 0 10px;font-weight: bold;">样品设备详情</div>', 'font-size:16px;background-color:#f0f0f0;display: flex;align-items: center;'],
|
||||
area: ['400px', '500px'],
|
||||
content: html,
|
||||
btn: ['关闭'],
|
||||
|
|
@ -225,5 +225,5 @@ function viewData(experId, devTypeCode) {
|
|||
'experId': experId,
|
||||
'devTypeCode': devTypeCode
|
||||
}
|
||||
openIframe7("viewData", title, "child/viewExperData.html", '1500px', '800px', param);
|
||||
openIframe7("viewData", title, "child/viewExperData.html", '1500px', '750px', param);
|
||||
}
|
||||
|
|
@ -161,9 +161,9 @@ function reloadData() {
|
|||
// 新增/修改平台用户
|
||||
function addData(customId) {
|
||||
console.log()
|
||||
let title = '新增单位客户'
|
||||
let title = '新增部门客户'
|
||||
if (customId) {
|
||||
title = '修改单位客户';
|
||||
title = '修改部门客户';
|
||||
}
|
||||
let param = {
|
||||
'customId': customId,
|
||||
|
|
|
|||
|
|
@ -168,7 +168,7 @@ function auditData(id, status, btnName) {
|
|||
'id': id,
|
||||
'status': status
|
||||
}
|
||||
openIframe3("auditData", title, "child/auditData.html", '1500px', '800px', param);
|
||||
openIframe3("auditData", title, "child/auditData.html", '1500px', '750px', param);
|
||||
}
|
||||
|
||||
const data = {
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ function auditData(id, status, btnName) {
|
|||
'id': id,
|
||||
'status':status
|
||||
}
|
||||
openIframe3("auditData", title, "child/viewAuditData.html", '1500px', '800px', param);
|
||||
openIframe3("auditData", title, "child/viewAuditData.html", '1500px', '750px', param);
|
||||
}
|
||||
|
||||
const data = {
|
||||
|
|
|
|||
|
|
@ -800,7 +800,7 @@ function generateRows(data,sampleDeviceVos){
|
|||
<td class="table-cell-wide"><input id="manufactureDate-${idCounter}" lay-verify="required" class="layui-input" name="manufactureDate-${idCounter}" readonly /></td>
|
||||
<td class="table-cell-wide"><input maxlength="30" id="devModule-${idCounter}" lay-verify="required" class="layui-input" name="devModule-${idCounter}" /></td>
|
||||
<td class="table-cell-wide"><input maxlength="30" id="devStatus-${idCounter}" lay-verify="required" class="layui-input" name="devStatus-${idCounter}" /></td>
|
||||
<td class="table-cell-wide"><input maxlength="6" id="amounts-${idCounter}" type="text" lay-affix="number" oninput="this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\\..*)\\./g, '$1')" min="0" lay-verify="required" class="layui-input" name="amounts-${idCounter}" /></td>
|
||||
<td class="table-cell-wide"><input maxlength="6" id="amounts-${idCounter}" type="text" lay-affix="number" oninput="this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\\..*)\\./g, '$1')" min="0" value="0.00" lay-verify="required" class="layui-input" name="amounts-${idCounter}" /></td>
|
||||
<td class="table-cell-wide"><input maxlength="60" id="remarks-${idCounter}" lay-verify="required" class="layui-input" name="remarks-${idCounter}" /></td>
|
||||
`;
|
||||
// 遍历itemList的长度,而不是itemList本身,以匹配表头的列数
|
||||
|
|
|
|||
|
|
@ -180,7 +180,7 @@ var devOpenIndex='';
|
|||
function getMouseover(data){
|
||||
// console.log(data)
|
||||
// openIframeTable(data)
|
||||
var html = '<table class="layui-table" lay-skin="line" lay-size="sm" style="width: 100%;">' +
|
||||
var html = '<table class="classTable" lay-skin="line" lay-size="sm" style="width: 100%;">' +
|
||||
'<thead>' +
|
||||
'<tr>' +
|
||||
'<th>序号</th>' +
|
||||
|
|
@ -195,7 +195,7 @@ function getMouseover(data){
|
|||
html += '<tr>' +
|
||||
'<td>' + (i+1) + '</td>' +
|
||||
'<td title="'+ data[i].devCode +'" style="cursor: pointer;" >' + data[i].devCode + '</td>' +
|
||||
'<td title="'+ data[i].testResult +'" style="cursor: pointer;">' + data[i].testResult + '</td>' +
|
||||
'<td title="' + data[i].testResult + '" style="cursor: pointer;color:'+(data[i].testResult.indexOf('不合格')>-1 ? '#F39268' : '#2A6EDF')+'">' + data[i].testResult + '</td>' +
|
||||
'</tr>';
|
||||
}
|
||||
}else{
|
||||
|
|
@ -209,7 +209,7 @@ function getMouseover(data){
|
|||
devOpenIndex = layer.open({
|
||||
type: 0,
|
||||
title: '设备信息',
|
||||
area: ['300px', '300px'],
|
||||
area: ['400px', '500px'],
|
||||
content: html,
|
||||
btn: ['关闭'],
|
||||
yes: function (index, layero) {
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ function initTable(dataList, limit, page) {
|
|||
var customNum = d.customNum
|
||||
var edit = buttonTest(id,customNum, "sys:experimentalTest:query", pers);
|
||||
return edit;
|
||||
//return '<a href="#" class="layui-icon layui-icon-set-sm" style="color: blue;cursor:pointer;" title="试验" onclick="testClick(\'' + d.id + '\',\''+d.customNum+'\')"></a>';
|
||||
|
||||
}
|
||||
},
|
||||
],
|
||||
|
|
@ -260,8 +260,7 @@ function buttonTest(id,customNum, permission, pers){
|
|||
return "";
|
||||
}
|
||||
}
|
||||
//return '<a href="#" class="layui-icon layui-icon-set-sm" style="color: blue;cursor:pointer;" title="试验" onclick="testClick(\'' + d.id + '\',\''+d.customNum+'\')"></a>';
|
||||
var btn = $("<button class='layui-btn layui-btn-xs' title='试验' onclick='testClick(\"" + id +"\",\"" + customNum +"\")'><i class='layui-icon layui-icon-set-sm'></i></button>");
|
||||
var btn = $("<a class='layui-icon layui-icon-set-sm' title='试验' onclick='testClick(\"" + id +"\",\"" + customNum +"\")'></a>");
|
||||
return btn.prop("outerHTML");
|
||||
}
|
||||
function testClick(id,customNum) {
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ function buttonEdit(id, permission, pers){
|
|||
return "";
|
||||
}
|
||||
}
|
||||
var btn = $("<button class='layui-btn layui-btn-xs' title='编辑' onclick='addData(\"" + id +"\")'><i class='layui-icon layui-icon-edit'></i></button>");
|
||||
var btn = $("<a class='layui-icon layui-icon-edit' title='编辑' onclick='addData(\"" + id +"\")'></a>");
|
||||
return btn.prop("outerHTML");
|
||||
}
|
||||
function addData(id) {
|
||||
|
|
@ -158,7 +158,7 @@ function buttonSearch(id, permission, pers){
|
|||
}
|
||||
}
|
||||
|
||||
var btn = $("<button class='layui-btn layui-btn-xs' title='查看' onclick='checkData(\"" + id +"\")'><i class='layui-icon layui-icon-search'></i></button>");
|
||||
var btn = $("<a class='layui-icon layui-icon-search' title='查看' onclick='checkData(\"" + id +"\")'></a>");
|
||||
return btn.prop("outerHTML");
|
||||
}
|
||||
function checkData(id) {
|
||||
|
|
@ -176,7 +176,7 @@ function buttonDel(id, permission, pers){
|
|||
return "";
|
||||
}
|
||||
}
|
||||
var btn = $("<button class='layui-btn layui-btn-xs' title='编辑' onclick='delData(\""+id+"\")'><i class='layui-icon layui-icon-delete'></i></button>");
|
||||
var btn = $("<a class='layui-icon layui-icon-delete' title='编辑' onclick='delData(\""+id+"\")'></a>");
|
||||
return btn.prop("outerHTML");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,283 @@
|
|||
let form, layer, table, tableIns,idParam,customNumParam;
|
||||
let pageNum = 1, limitSize = 10; // 默认第一页,分页数量为10
|
||||
|
||||
var pers = checkPermission();
|
||||
|
||||
function setParams(params) {
|
||||
idParam = JSON.parse(params).id;
|
||||
customNumParam = JSON.parse(params).customNum;
|
||||
layui.use(['form', 'layer', 'table', 'laydate'], function () {
|
||||
form = layui.form;
|
||||
layer = layui.layer;
|
||||
table = layui.table;
|
||||
layui.form.render();
|
||||
getDevSelected();
|
||||
pages(1, 10, 1);
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
function pages(pageNum, pageSize, typeNum) {
|
||||
let params = getReqParams(pageNum, pageSize, typeNum);
|
||||
let url = dataUrl + "/primaryDatas/getDetailList"
|
||||
ajaxRequest(url, "POST", params, true, function () {
|
||||
}, function (result) {
|
||||
if (result.code === 200) {
|
||||
if (result.data) {
|
||||
initTable(result.data, result.limit, result.curr)
|
||||
laypages(result.count, result.curr, result.limit)
|
||||
}
|
||||
} else if (result.code === 500) {
|
||||
layer.alert(result.msg, {icon: 2})
|
||||
}
|
||||
}, function (xhr) {
|
||||
error(xhr)
|
||||
});
|
||||
}
|
||||
|
||||
function laypages(total, page, limit) {
|
||||
layui.use(['laypage'], function () {
|
||||
let laypage = layui.laypage;
|
||||
laypage.render({
|
||||
elem: 'voi-page',
|
||||
count: total,
|
||||
curr: page,
|
||||
limit: limit,
|
||||
limits: [10, 20, 50, 100, 200, 500],
|
||||
layout: ['prev', 'page', 'next', 'skip', 'count', 'limit'],
|
||||
groups: 5,
|
||||
jump: function (obj, first) {
|
||||
if (!first) {
|
||||
pageNum = obj.curr, limitSize = obj.limit;
|
||||
pages(obj.curr, obj.limit, null);
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
/*初始化表格*/
|
||||
function initTable(dataList, limit, page) {
|
||||
let loadingMsg = layer.msg("数据加载中,请稍候...", {icon: 16, scrollbar: false, time: 0,});
|
||||
tableIns = table.render({
|
||||
elem: "#table_data",
|
||||
height: "full-130",
|
||||
data: dataList,
|
||||
limit: limit,
|
||||
cols: [
|
||||
[
|
||||
//表头
|
||||
{title: "序号", width: 80, unresize: true, align: "center",
|
||||
templet: function (d) {
|
||||
return (page - 1) * limit + d.LAY_INDEX;
|
||||
}
|
||||
},
|
||||
{field: "devTypeName", title: "样品类型", unresize: true, align: "center"},
|
||||
// {field: "devModule", title: "规格型号", unresize: true, align: "center"},
|
||||
{field: "sampleNum", title: "送样数量", unresize: true, align: "center"},
|
||||
{field: "", title: "样品数量", unresize: true, align: "center",
|
||||
templet: function (d) {
|
||||
var testResult="";
|
||||
var html = '';
|
||||
var sampleList = JSON.stringify(d.sampleList);
|
||||
if(d.sampleList.length>0){
|
||||
for (let i = 0; i < d.sampleList.length; i++) {
|
||||
if (d.sampleList[i].testResult == "合格") {
|
||||
|
||||
}else{
|
||||
testResult = d.sampleList[i].testResult
|
||||
}
|
||||
}
|
||||
// sampleList = JSON.stringify(d.sampleList);
|
||||
}
|
||||
|
||||
if(testResult=="不合格"){
|
||||
// 添加包裹元素并应用类
|
||||
html += "<span class='layui-show-details' onmouseover='getMouseover("+ sampleList +")' onmouseout='getMouseout()' style='color: #F39268; cursor: pointer'>" +
|
||||
d.sampleQuantity +
|
||||
"</span>";
|
||||
}else{
|
||||
// 添加包裹元素并应用类
|
||||
html += "<span class='layui-show-details' onmouseover='getMouseover("+ sampleList +")' onmouseout='getMouseout()' style='color: #2A6EDF; cursor: pointer'>" +
|
||||
d.sampleQuantity +
|
||||
"</span>";
|
||||
|
||||
}
|
||||
return html;
|
||||
}
|
||||
},
|
||||
{title: "原始记录", unresize: true, width: 300, align: "center",
|
||||
templet: function (d) {
|
||||
return '<a href="#" style="color: blue;" onclick="testClick(\'' + d.id + '\',\''+d.customNum+'\')">查看</a>';
|
||||
}
|
||||
},
|
||||
],
|
||||
],
|
||||
done: function (res, curr, count) {
|
||||
layer.close(loadingMsg);
|
||||
table.resize("table_data");
|
||||
count || this.elem.next(".layui-table-view").find(".layui-table-header").css("display", "inline-block");
|
||||
count || this.elem.next(".layui-table-view").find(".layui-table-box").css("overflow", "auto");
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
var devOpenIndex='';
|
||||
function getMouseover(data){
|
||||
// console.log(data)
|
||||
// openIframeTable(data)
|
||||
var html = '<table class="layui-table" lay-skin="line" lay-size="sm" style="width: 100%;">' +
|
||||
'<thead>' +
|
||||
'<tr>' +
|
||||
'<th>序号</th>' +
|
||||
'<th>设备编号</th>' +
|
||||
'<th>试验结果</th>'+
|
||||
'</tr>'+
|
||||
'</thead>'
|
||||
|
||||
html += '<tbody>';
|
||||
if (data.length>0){
|
||||
for (let i = 0; i < data.length; i++){
|
||||
html += '<tr>' +
|
||||
'<td>' + (i+1) + '</td>' +
|
||||
'<td title="'+ data[i].devCode +'" style="cursor: pointer;" >' + data[i].devCode + '</td>' +
|
||||
'<td title="'+ data[i].testResult +'" style="cursor: pointer;">' + data[i].testResult + '</td>' +
|
||||
'</tr>';
|
||||
}
|
||||
}else{
|
||||
html += '<tr>' +
|
||||
'<td colspan="3" style="text-align: center">暂无数据</td>' +
|
||||
'</tr>';
|
||||
}
|
||||
html += '</tbody>';
|
||||
html += '</table>';
|
||||
|
||||
devOpenIndex = layer.open({
|
||||
type: 0,
|
||||
title: '设备信息',
|
||||
area: ['300px', '300px'],
|
||||
content: html,
|
||||
btn: ['关闭'],
|
||||
yes: function (index, layero) {
|
||||
layer.close(index);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function getMouseout(){
|
||||
// alert("鼠标移出");
|
||||
// layer.close(devOpenIndex);
|
||||
}
|
||||
|
||||
// 获取参数
|
||||
function getReqParams(page, limit, type) {
|
||||
// console.log(idParam)
|
||||
let obj = {};
|
||||
if (!type) {
|
||||
obj = {
|
||||
page: page + "",
|
||||
limit: limit + "",
|
||||
devTypeCode: $('#devId').val(),
|
||||
id: idParam
|
||||
};
|
||||
} else {
|
||||
obj = {
|
||||
page: '1',
|
||||
limit: '10',
|
||||
devTypeCode: '',
|
||||
id: idParam
|
||||
};
|
||||
}
|
||||
// console.log(obj)
|
||||
obj={
|
||||
encryptedData:encryptCBC(JSON.stringify(obj))
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
// 查询/重置
|
||||
function query() {
|
||||
pageNum = 1;
|
||||
pages(1, limitSize);
|
||||
}
|
||||
|
||||
function reloadData() {
|
||||
pages(pageNum, limitSize);
|
||||
}
|
||||
|
||||
// 查看
|
||||
function buttonCheck(experId,sampleId,devTypeCode, permission, pers){
|
||||
if(permission != ""){
|
||||
if ($.inArray(permission, pers) < 0) {
|
||||
return ""
|
||||
}
|
||||
}
|
||||
var btn=$("<a class=\"layui-icon layui-icon-search\" title='查看' style=\"color: blue;\" onclick=\"checkData('" + experId + "','" + sampleId + "','"+ devTypeCode+"')\"></a>");
|
||||
return btn.prop("outerHTML");
|
||||
}
|
||||
function checkData(experId,sampleId,devTypeCode) {
|
||||
let param = {
|
||||
'experId': experId,
|
||||
'sampleId': sampleId,
|
||||
'devTypeCode':devTypeCode,
|
||||
'customNum':customNumParam
|
||||
}
|
||||
openIframeMax("testCheck.html", "查看试验", "testCheck.html", '80%', '100%', param);
|
||||
}
|
||||
|
||||
// 试验新增、修改
|
||||
|
||||
function addData(experId,sampleId,devTypeCode) {
|
||||
let title = '新增试验'
|
||||
if (experId!=null && experId!='null') {
|
||||
title = '修改试验';
|
||||
}
|
||||
let param = {
|
||||
'experId': experId,
|
||||
'sampleId': sampleId,
|
||||
'devTypeCode':devTypeCode,
|
||||
'customNum':customNumParam
|
||||
}
|
||||
openIframeMax("testForm", title, "testForm.html", '80%', '100%', param);
|
||||
}
|
||||
|
||||
function testClick(id,customNum) {
|
||||
let title = '试验详细信息'
|
||||
let param = {
|
||||
'id': id,
|
||||
'customNum':customNum
|
||||
}
|
||||
openIframeMax("primaryDataList", title, "child/primaryDataList.html", '100%', '100%', param);
|
||||
}
|
||||
|
||||
function getDevSelected() {
|
||||
let url = dataUrl + '/sys/select/getDicts';
|
||||
let obj = {
|
||||
'code':"dev_code"
|
||||
}
|
||||
let params = {
|
||||
encryptedData: encryptCBC(JSON.stringify(obj))
|
||||
}
|
||||
|
||||
ajaxRequest(url, "POST", params, true, function () {
|
||||
}, function (result) {
|
||||
if (result.code === 200) {
|
||||
setSelectValue(result.data, 'devId');
|
||||
// return result.data
|
||||
} else {
|
||||
layer.alert(result.msg, {icon: 2})
|
||||
}
|
||||
}, function (xhr) {
|
||||
error(xhr)
|
||||
});
|
||||
}
|
||||
|
||||
/*下拉选表单赋值*/
|
||||
function setSelectValue(list, selectName) {
|
||||
let html = '<option value="" selected>请选设备类型</option>';
|
||||
$.each(list, function (index, item) {
|
||||
html += '<option value="' + item.value + '">' + item.name + '</option>';
|
||||
})
|
||||
$('#' + selectName).empty().append(html);
|
||||
layui.form.render();
|
||||
}
|
||||
|
|
@ -175,7 +175,7 @@ function reloadData() {
|
|||
|
||||
// 试验标准新增、修改
|
||||
function testClick(id,customNum) {
|
||||
let title = '试验'
|
||||
let title = '试验详细信息'
|
||||
let param = {
|
||||
'id': id,
|
||||
'customNum':customNum
|
||||
|
|
|
|||
|
|
@ -192,8 +192,8 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="btn-box">
|
||||
<button class="layui-btn layui-btn-norma save" onclick="basisAdd()">新增试验依据</button>
|
||||
<button class="layui-btn layui-btn-primary cancel" onclick="basisDel()">删除试验依据</button>
|
||||
<button class="layui-btn layui-btn-norma save" onclick="basisAdd()">+</button>
|
||||
<button class="layui-btn layui-btn-primary cancel" onclick="basisDel()">-</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@
|
|||
<link rel="stylesheet" href="../../../../js/layui-v2.6.8/dtree/dtree.css">
|
||||
<link rel="stylesheet" href="../../../../js/layui-v2.6.8/dtree/font/dtreefont.css">
|
||||
<link rel="stylesheet" href="../../../../css/dataForm.css">
|
||||
<link rel="stylesheet" href="../../../../css/font.css">
|
||||
<link rel="stylesheet" href="../../../../css/basis/originalRecord.css">
|
||||
<script src="../../../../js/libs/jquery-2.1.1.min.js" charset="UTF-8" type="text/javascript"></script>
|
||||
<script src="../../../../js/layui-v2.6.8/layui.js" charset="UTF-8" type="text/javascript"></script>
|
||||
<script src="../../../../js/publicJs.js"></script>
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
<input hidden id="id" name="id">
|
||||
|
||||
<div class="layui-form-item" style="margin-top: 2%;">
|
||||
<label class="layui-form-label"><i style="padding: 0 10px;">*</i>客户名称</label>
|
||||
<label class="layui-form-label"><i style="padding: 0 10px;">*</i>部门名称</label>
|
||||
<div class="layui-input-inline">
|
||||
<input class="layui-input" id="customName" name="customName" autocomplete="off"
|
||||
lay-verify="required" maxlength="50">
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
<form class="layui-form" onsubmit="return false;" lay-filter="formInfo">
|
||||
<input hidden id="id" name="id">
|
||||
<div class="layui-form-item" style="margin-top: 2%;">
|
||||
<label class="layui-form-label"><i style="padding: 0 10px;">*</i>客户名称</label>
|
||||
<label class="layui-form-label"><i style="padding: 0 10px;">*</i>单位名称</label>
|
||||
<div class="layui-input-inline">
|
||||
<input class="layui-input" id="customName" name="customName" autocomplete="off"
|
||||
lay-verify="required" maxlength="50">
|
||||
|
|
|
|||
|
|
@ -38,5 +38,5 @@
|
|||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<script src="../../../js/basis/standard/child/testList.js" charset="UTF-8" type="text/javascript"></script>
|
||||
<script src="../../../js/primaryData/child/primaryAddList.js" charset="UTF-8" type="text/javascript"></script>
|
||||
</html>
|
||||
Loading…
Reference in New Issue