检测报告管理

This commit is contained in:
hayu 2024-07-27 17:28:01 +08:00
parent e3f2272685
commit 9407df74bb
12 changed files with 1588 additions and 117 deletions

View File

@ -17,6 +17,11 @@
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-freemarker</artifactId>
<version>3.2.5</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>

View File

@ -6,19 +6,29 @@ import com.bonus.aqgqj.basis.entity.dto.ParamsDto;
import com.bonus.aqgqj.basis.entity.dto.TestReportManageDto;
import com.bonus.aqgqj.basis.service.TestReportManageService;
import com.bonus.aqgqj.system.vo.EncryptedReq;
import com.bonus.aqgqj.utils.DateTimeHelper;
import com.bonus.aqgqj.utils.ServerResponse;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import freemarker.template.Configuration;
import freemarker.template.Template;
import io.swagger.annotations.Api;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
@ -37,7 +47,7 @@ public class TestReportManageController {
@PostMapping(value = "getList")
@DecryptAndVerify(decryptedClass = TestReportManageDto.class)
@LogAnnotation(operModul = "收样管理-收样管理", operation = "查询用列表", operDesc = "业务级事件",operType="查询")
@LogAnnotation(operModul = "检测报告管理-检测报告管理", operation = "查询用列表", operDesc = "业务级事件",operType="查询")
@PreAuthorize("@pms.hasPermission('sys:testReport:query')" )
public ServerResponse listUsers(EncryptedReq<TestReportManageDto> data) {
PageHelper.startPage(data.getData().getPage(), data.getData().getLimit());
@ -53,7 +63,7 @@ public class TestReportManageController {
@PostMapping(value = "getDetailsList")
@DecryptAndVerify(decryptedClass = TestReportManageDto.class)
@LogAnnotation(operModul = "收样管理-收样管理详情", operation = "查询用列表", operDesc = "业务级事件",operType="查询")
@LogAnnotation(operModul = "检测报告管理-收样管理详情", operation = "查询用列表", operDesc = "业务级事件",operType="查询")
@PreAuthorize("@pms.hasPermission('sys:samples:query')" )
public ServerResponse getDetailsList(EncryptedReq<TestReportManageDto> data) {
PageHelper.startPage(data.getData().getPage(), data.getData().getLimit());
@ -69,7 +79,7 @@ public class TestReportManageController {
@PostMapping(value = "all")
@LogAnnotation(operModul = "收样管理", operation = "查询所有工器具", operDesc = "业务级事件",operType="查询")
@LogAnnotation(operModul = "检测报告管理", operation = "查询所有工器具", operDesc = "业务级事件",operType="查询")
@PreAuthorize("@pms.hasPermission('sys:samples:query')" )
public ServerResponse getAll() {
try {
@ -82,7 +92,7 @@ public class TestReportManageController {
}
@PostMapping(value = "allCustomName")
@LogAnnotation(operModul = "收样管理", operation = "查询所有单位", operDesc = "业务级事件",operType="查询")
@LogAnnotation(operModul = "检测报告管理", operation = "查询所有单位", operDesc = "业务级事件",operType="查询")
@PreAuthorize("@pms.hasPermission('sys:samples:query')" )
public ServerResponse getAllCustomName() {
try {
@ -99,7 +109,7 @@ public class TestReportManageController {
*/
@PostMapping("addSamples")
@DecryptAndVerify(decryptedClass = TestReportManageDto.class)//加解密统一管理
@LogAnnotation(operModul = "收样管理", operation = "新增收样数据", operDesc = "业务级事件", operType = "新增")
@LogAnnotation(operModul = "检测报告管理", operation = "新增收样数据", operDesc = "业务级事件", operType = "新增")
@PreAuthorize("@pms.hasPermission('sys:samples:add')")
public ServerResponse addSamples(EncryptedReq<TestReportManageDto> vo) {
try {
@ -111,7 +121,7 @@ public class TestReportManageController {
}
@PostMapping(value = "getTeamSelected")
@LogAnnotation(operModul = "收样管理", operation = "查询所有班组", operDesc = "业务级事件",operType="查询")
@LogAnnotation(operModul = "检测报告管理", operation = "查询所有班组", operDesc = "业务级事件",operType="查询")
@PreAuthorize("@pms.hasPermission('sys:samples:query')" )
public ServerResponse getToolsSelected() {
try {
@ -128,7 +138,7 @@ public class TestReportManageController {
*/
@PostMapping("dispatchWork")
@DecryptAndVerify(decryptedClass = TestReportManageDto.class)//加解密统一管理
@LogAnnotation(operModul = "收样管理", operation = "派工", operDesc = "业务级事件", operType = "新增")
@LogAnnotation(operModul = "检测报告管理", operation = "派工", operDesc = "业务级事件", operType = "新增")
@PreAuthorize("@pms.hasPermission('sys:samples:dispatch')")
public ServerResponse dispatchWork(EncryptedReq<TestReportManageDto> vo) {
try {
@ -145,4 +155,112 @@ public class TestReportManageController {
return testReportManageService.viewTestData(data.getData());
}
@GetMapping("/downloadReport")
public void downloadReport(HttpServletRequest request, HttpServletResponse response){
// 处理请求参数
TestReportManageDto vo = new TestReportManageDto();
vo.setId(Integer.valueOf(request.getParameter("id")));
vo.setDepartmentId(Integer.valueOf(request.getParameter("departmentId")));
vo.setSampleTools(request.getParameter("sampleTools"));
vo.setIsHg(request.getParameter("isHg"));
TestReportManageDto bean = testReportManageService.downloadCertificateList(vo);
// 准备数据
Map<String, Object> map = new HashMap<>();
map.put("submitLocation", isNull(bean.getSubmitLocation()));
map.put("sampleTools", isNull(bean.getSampleTools()));
map.put("devModule", isNull(bean.getDevModule()));
map.put("devCode", isNull(bean.getDevCode()));
map.put("experTime", isNull(bean.getExperTime()));
map.put("nextExperTime", isNull(bean.getNextExperTime()));
map.put("experUser", isNull(bean.getExperUser()));
map.put("isHg", isNull(bean.getIsHg()));
map.put("customName", isNull(bean.getCustomName()));
Configuration cfg = new Configuration(Configuration.getVersion());
cfg.setClassForTemplateLoading(this.getClass(), "/temple");
File tempFile = null;
OutputStream out = null;
FileInputStream fis = null;
try {
// 设置响应头
response.setCharacterEncoding("utf-8");
response.setContentType("application/msword");
response.setHeader("Content-Disposition", "attachment;filename="
.concat(String.valueOf(URLEncoder.encode("合格证" + DateTimeHelper.getNowDMS() + ".doc", "UTF-8"))));
// 创建临时文件
tempFile = createDoc(map, cfg.getTemplate("certificate.ftl"));
// 读取文件并写入响应
fis = new FileInputStream(tempFile);
out = response.getOutputStream();
byte[] buffer = new byte[512];
int bytesToRead;
while ((bytesToRead = fis.read(buffer)) != -1) {
out.write(buffer, 0, bytesToRead);
}
} catch (Exception ex) {
ex.printStackTrace();
} finally {
// 释放资源
try {
if (fis != null) {
fis.close();
}
if (out != null) {
out.flush();
out.close();
}
// 删除临时文件
if (tempFile != null && tempFile.exists()) {
tempFile.delete();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
// 创建临时word文件
private File createDoc(String fileName, Map<String, Object> map, Template template) {
// 添加时间戳以确保文件名唯一
String uniqueFileName = fileName + "_" + System.currentTimeMillis() + ".doc";
File f = new File(uniqueFileName);
try {
Writer w = new OutputStreamWriter(new FileOutputStream(f), "utf-8");
template.process(map, w);
w.close();
} catch (Exception ex) {
ex.printStackTrace();
}
return f;
}
// 创建临时word文件
private File createDoc(Map<String, Object> map, Template template) {
File f = null;
try {
// 创建临时文件
f = File.createTempFile("certificate_", ".doc");
Writer w = new OutputStreamWriter(new FileOutputStream(f), "utf-8");
template.process(map, w);
w.close();
} catch (Exception ex) {
ex.printStackTrace();
}
return f;
}
/**
* 判断字符串是否为空或者null如果是则返回''否则返回原字符串
*/
public static String isNull(String str) {
if (str == null || "".equals(str)) {
return "";
}
return str;
}
}

View File

@ -2,9 +2,8 @@ package com.bonus.aqgqj.basis.dao;
import com.bonus.aqgqj.basis.entity.dto.ParamsDto;
import com.bonus.aqgqj.basis.entity.dto.TestReportManageDto;
import com.bonus.aqgqj.basis.entity.vo.ConfigItemVo;
import com.bonus.aqgqj.basis.entity.vo.ConfigItemsVo;
import com.bonus.aqgqj.basis.entity.vo.ExperDevVo;
import com.bonus.aqgqj.basis.entity.vo.*;
import com.bonus.aqgqj.utils.ServerResponse;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
@ -130,4 +129,25 @@ public interface TestReportManageDao {
* @return
*/
List<ExperDevVo> getExperDev(TestReportManageDto dto);
/**
* 试验依据信息
* @param dto
* @return
*/
List<ExperBasisVo> getConfigBasis(TestReportManageDto dto);
/**
* 获取试验信息
* @param dto
* @return
*/
TestReportManageDto getTestData(TestReportManageDto dto);
/**
* 获取证书列表
* @param data
* @return
*/
TestReportManageDto downloadCertificateList(TestReportManageDto data);
}

View File

@ -1,6 +1,9 @@
package com.bonus.aqgqj.basis.entity.dto;
import com.bonus.aqgqj.base.entity.PageEntity;
import com.bonus.aqgqj.basis.entity.vo.ConfigItemsVo;
import com.bonus.aqgqj.basis.entity.vo.ExperBasisVo;
import com.bonus.aqgqj.basis.entity.vo.ExperDevVo;
import com.bonus.aqgqj.basis.entity.vo.ExperimentalDetailVo;
import lombok.Data;
@ -183,5 +186,45 @@ public class TestReportManageDto extends PageEntity {
*/
private String endTime;
/**
* 备注
*/
private String remarks;
/**
* 试验标准
*/
private String experStand;
/**
* 检测设备
*/
private String devTypeName;
/**
* 技术要求
*/
private String technicalRequirements;
/**
* 试验依据
*/
private List<ExperBasisVo> basisVos;
/**
* 试验项
*/
private List<ConfigItemsVo> configItemsVos;
/**
* 试验样品设备list
*/
private List<ExperDevVo> experDevVos;
/**
* 实验地点
*/
private String submitLocation;
}

View File

@ -63,4 +63,11 @@ public interface TestReportManageService {
* @return
*/
ServerResponse viewTestData(TestReportManageDto data);
/**
* 合格证下载
* @param data
* @return
*/
TestReportManageDto downloadCertificateList(TestReportManageDto data);
}

View File

@ -187,14 +187,17 @@ public class TestReportManageServiceImpl implements TestReportManageService {
@Override
public ServerResponse viewTestData(TestReportManageDto dto) {
TestVo testVo = new TestVo();
TestReportManageDto testVo = new TestReportManageDto();
try {
testVo= testReportManageDao.getTestData(dto);
List<ExperBasisVo> experBasisVos = testReportManageDao.getConfigBasis(dto);
List<ConfigItemsVo> configItemsVos = testReportManageDao.getExperItems(dto);
for (ConfigItemsVo configItemsVo : configItemsVos) {
List<ConfigItemVo> configItemVos = testReportManageDao.getExperItem(configItemsVo.getId());
configItemsVo.setItemList(configItemVos);
}
List<ExperDevVo> experDevVos = testReportManageDao.getExperDev(dto);
testVo.setBasisVos(experBasisVos);
testVo.setConfigItemsVos(configItemsVos);
testVo.setExperDevVos(experDevVos);
return ServerResponse.createSuccess(testVo);
@ -204,6 +207,11 @@ public class TestReportManageServiceImpl implements TestReportManageService {
}
}
@Override
public TestReportManageDto downloadCertificateList(TestReportManageDto data) {
return testReportManageDao.downloadCertificateList(data);
}
/**
* 设备编号--自动生成
* 生成规则YYMMDDNNNN

View File

@ -261,4 +261,68 @@
and tsd.dev_type_name = #{sampleTools}
ORDER BY ted.id
</select>
<select id="getConfigBasis" resultType="com.bonus.aqgqj.basis.entity.vo.ExperBasisVo">
SELECT id,
exper_id AS configId,
exper_basis_name AS basisName
FROM tb_config_basis WHERE exper_id = #{id}
</select>
<select id="getTestData" resultType="com.bonus.aqgqj.basis.entity.dto.TestReportManageDto">
SELECT
te.id,
te.dev_type_name as sampleTools,
tc.`code` as reportCode,
te.sample_date as collectSamplesTime,
COUNT(ted.id) as devNum,
te.exper_dev as devTypeName,
te.exper_stand as experStand,
te.exper_conclu as experConclu,
te.remarsk as remarks,
te.exper_time as experTime,
te.next_exper_time as nextExperTime
FROM
tb_exper_dev ted
LEFT JOIN tb_exper te on te.id=ted.exper_id and te.del_flag=0
LEFT JOIN tb_custom tcs on tcs.id=ted.department_id and tcs.del_flag=0
LEFT JOIN tb_certificate tc on tc.exper_id=ted.exper_id and tc.is_hg=ted.is_hg and tc.department=tcs.custom_name and te.dev_type_name=tc.dev_type
WHERE
ted.exper_id=#{id}
and ted.is_hg=#{isHg}
and department_id=#{departmentId}
and te.dev_type_name=#{sampleTools}
GROUP BY ted.exper_id
</select>
<select id="downloadCertificateList" resultType="com.bonus.aqgqj.basis.entity.dto.TestReportManageDto">
SELECT
te.id,
te.submit_location as submitLocation,
te.dev_type_name AS sampleTools,
GROUP_CONCAT( DISTINCT te.dev_module SEPARATOR '、' ) AS devModule,
GROUP_CONCAT( DISTINCT ted.dev_code SEPARATOR '、' ) AS devCode,
te.exper_time AS experTime,
te.next_exper_time AS nextExperTime,
su.user_name as experUser,
CASE
ted.is_hg
WHEN 0 THEN
'合格'
WHEN 1 THEN
'不合格' ELSE ''
END isHg,
tc.custom_name AS customName
FROM
tb_exper_dev ted
LEFT JOIN tb_exper te on te.id=ted.exper_id and te.del_flag=0
LEFT JOIN tb_custom tc ON tc.id = ted.department_id
AND tc.del_flag = 0
LEFT JOIN sys_user su ON su.id = te.create_user
AND su.del_flag = 0
WHERE
ted.exper_id=#{id}
and ted.is_hg=#{isHg}
and department_id=#{departmentId}
and te.dev_type_name=#{sampleTools}
GROUP BY ted.exper_id
LIMIT 1
</select>
</mapper>

View File

@ -87,17 +87,22 @@ function initTable(dataList, limit, page) {
limit: limit,
cols: [
[
{
type: 'checkbox',
fixed: 'left',
align: "center"
},
//表头
{title: "序号", width: 68, unresize: true, align: "center",
templet: function (d) {
return (page - 1) * limit + d.LAY_NUM;
}
},
{field: "sampleTools", title: "设备类型", unresize: true, align: "center"},
{field: "sampleTools", width: 150, title: "设备类型", unresize: true, align: "center"},
{field: "reportCode", title: "报告编号", unresize: true, align: "center"},
{field: "sampleDepartment", title: "送样部门", unresize: true, align: "center"},
{field: "sampleDepartment",width: 130, title: "送样部门", unresize: true, align: "center"},
{field: "devModule", title: "规格型号", unresize: true, align: "center"},
{field: "", title: "样品数量", width: 68, unresize: true, align: "center",
{field: "", title: "样品数量", width: 110, unresize: true, align: "center",
templet: function (d) {
var testResult="";
var html = '';
@ -141,7 +146,7 @@ function initTable(dataList, limit, page) {
},
{field: "detectionTime", title: "检测时间", unresize: true, align: "center"},
{
field: "view1", title: "检测报告",width: 68, unresize: true, align: "center",
field: "view1", title: "检测报告",width: 110, unresize: true, align: "center",
templet: function (d) {
return '<a href="#" style="color: blue;" onclick="handleClick1(\'' + d.id + '\',\'' + d.isHg + '\',\'' + d.departmentId + '\',\'' + d.sampleTools + '\')">查看</a>';
}
@ -203,6 +208,47 @@ function getMouseover(data){
}
// 下载合格证
function downloadClick() {
//获取选中的数据
var selectedRows = table.checkStatus("table_data").data;
if (selectedRows.length == 0) {
return layer.msg('请选择要下载的数据', {icon: 7})
}
selectedRows.forEach(function (row, index) {
var id=row.id;
var isHg=row.isHg;
var sampleTools=row.sampleTools;
var departmentId=row.departmentId;
downloadDaily(id,isHg,sampleTools,departmentId,index);
});
}
function downloadDaily(id,isHg,sampleTools,departmentId,index){
let loadingMsg = layer.msg('合格证下载中,请稍候...', {icon: 16, scrollbar: false, time: 0, offset: ['45%', '57%']});
let tokens = localStorage.getItem("token");
let url = dataUrl + '/testReport/downloadReport?id=' + id + "&isHg=" + isHg +"&sampleTools="+sampleTools +"&departmentId="+departmentId+ "&token=" + tokens;
let xhr = new XMLHttpRequest();
xhr.open("get", url, true);
xhr.responseType = "blob"; // 转换流
xhr.onload = function () {
layer.close(loadingMsg);
if (this.status === 200) {
let blob = this.response;
var a = document.createElement("a");
var url = window.URL.createObjectURL(blob);
a.href = url;
a.download = "合格证" + (index + 1) + ".doc"; // 文件名
} else {
layer.msg('服务异常,请稍后重试', {icon: 16, scrollbar: false, time: 2000, offset: ['45%', '57%']});
}
a.click()
window.URL.revokeObjectURL(url)
};
xhr.send();
}
function handleClick2(view1) {
alert('Clicked on: ' + view1);
}

View File

@ -45,92 +45,93 @@ function getDataById() {
/**表单赋值*/
function setFormData(obj) {
// $('#devTypeName').val(obj.devTypeName);
// $('#devModule').val(obj.devModule);
// $('#sampleQuantity').val(obj.sampleQuantity);
// $('#sampleDate').val(obj.sampleDate);
// $('#experTime').val(obj.experTime);
// $('#nextExperTime').val(obj.nextExperTime);
// $('#customName').val(obj.customName);
// $('#experLocal').val(obj.experLocal);
// $('#experDev').val(obj.experDev);
// $('#experModule').val(obj.experModule);
// $('#experCode').val(obj.experCode);
// $('#checkTime').val(obj.checkTime);
// $('#yjList').after(setYjData(obj.basisVos));
initTable(obj.experDevVos,obj.configItemsVos);
// $('#experStand').val(obj.experStand);
// $('#experConclu').val(obj.experConclu);
// $('#remarsk').val(obj.remarsk);
setTableInfo(obj);
}
/**试验依据赋值*/
function setYjData(list){
let html = '';
if(list && list.length > 0){
/*赋值表格信息*/
function setTableInfo(obj) {
$('#titleName').html(obj.sampleTools+'检验报告附页')
//表格
let colHtml = '', firstHtml = '', twoHtml = '', tdHtml = '',yjList = '';
let list = obj.configItemsVos;
let allCloun=0;
$.each(list, function (index, item) {
html += '<div class="layui-form-item">' +
'<div class="layui-inline">' +
'<div class="layui-input-inline yj">' +
'<input type="text" value="' + item.basisName + '" readonly autocomplete="off" class="layui-input">' +
'</div>' +
'</div>' +
'</div>'
let itemList = item.itemList;
allCloun += itemList.length;
firstHtml += '<td colspan="' + itemList.length + '">' + item.experTypeName + '</td>'
$.each(itemList, function (index2, item2) {
colHtml += '<col class="w-100" width="100"></col>'
twoHtml += '<td>' + item2.itemName + '</td>';
})
})
console.log(allCloun);
let nums =parseInt((allCloun+2)/2);
console.log(nums);
setColNum2('reportCode', nums);
setColNum2('collectSamplesTime', allCloun+2-nums);
setColNum2('devTypeName', allCloun+5);
setColNum2('yj', allCloun+5);
if(obj.basisVos && obj.basisVos.length > 0){
$.each(obj.basisVos,function (index,item){
yjList += (index + 1)+'、'+item.basisName + '\n';
})
}
$('#mainCol').after(colHtml);
$('#appearanceStatus').after(firstHtml);
$('#devModule').after(twoHtml);
tdHtml = setTableData(obj);
$('#itemTd').after(tdHtml);
setColNum2('technicalRequirements', allCloun+5);
setColNum2('experConclu', allCloun+5);
setColNum2('remark', allCloun+5)
let timeNum=parseInt((allCloun+4)/2);
setColNum2('experTime', timeNum);
setColNum2('nextExperTime', allCloun+4-timeNum)
$('#yj').html(yjList);
$('#reportCode').html(obj.reportCode);
$('#collectSamplesTime').html(obj.collectSamplesTime);
$('#devNum').html(obj.devNum);
$('#devTypeName').html(obj.devTypeName);
$('#technicalRequirements').html(obj.experStand);
$('#experConclu').html(obj.experConclu);
$('#remark').html(obj.remarks);
$('#experTime').html(obj.experTime);
$('#nextExperTime').html(obj.nextExperTime);
$('.classTable').removeAttr('style');
$('.btn-box').removeAttr('style');
}
function setColNum2(name, addNum) {
$('#' + name + '').attr("colspan", parseInt(addNum));
}
/*赋值表格数据*/
function setTableData(obj) {
let list = obj.experDevVos;
let html = '';
$.each(list, function (index, item) {
html += '<tr>' +
'<td colspan="1">' + (index + 1) + '</td>' +
'<td>' + item.customerCode + '</td>' +
'<td>' + item.devCode + '</td>' +
'<td>' + item.manufacturer + '</td>' +
'<td>' + item.manufactureDate + '</td>' +
'<td>' + item.devModule + '</td>' +
setItemData(JSON.parse(item.devData));
})
return html;
}
function initTable(dataList,configList) {
let handleDataList = handleData(dataList);
// dataList = [{"username":"12"},{"username":"12"},{"username":"12"}];
// let loadingMsg = layer.msg("数据加载中,请稍候...", { icon: 16, scrollbar: false, time: 0, });
table.render({
elem: '#testTable',
id: 'testTable',
data: handleDataList,
cols:setTableData(configList),
});
}
function setTableData(configList){
let tableTitle = [[
{field: 'number',type: 'numbers',title: '序号',width: 60,rowspan: 2,fixed: 'left',align: 'center',unresize: true,},
{field: 'customerCode',title: '样品编号',width: 120,fixed: 'left',rowspan: 2,align: 'center',unresize: true,},
{title: '样品信息',fixed: 'left', align: 'center', colspan: 4, unresize: true},
],[
{field: 'devCode',title: '客户自编号',width: 120,fixed: 'left',align: 'center',unresize: true,},
{field: 'manufacturer',fixed: 'left', title: '生产厂家', width: 120, align: 'center', unresize: true},
{field: 'manufactureDate',fixed: 'left', title: '生产日期', width: 120, align: 'center', unresize: true},
{field: 'devModule',fixed: 'left', title: '规格型号', width: 100, align: 'center', unresize: true},
]];
setFirstTitle();
setTwoTitle();
function setFirstTitle(){
$.each(configList,function (index,item){
tableTitle[0].push({title: item.experTypeName,colspan: item.experNum, width: 180 * (item.experNum), align: 'center', unresize: true})
/*赋值试验子项数据*/
function setItemData(list) {
let html = '';
$.each(list, function (index, item) {
html += '<td>' + item + '</td>';
})
}
function setTwoTitle(){
let indexNum = 0;
$.each(configList,function (index,item){
let itemList = item.itemList;
let length = itemList.length;
$.each(itemList,function (index2,item2){
indexNum = index * length + index2;
tableTitle[1].push({field: 'val' + indexNum ,title: item2.itemName, width: 180, align: 'center', unresize: true});
})
})
}
return tableTitle;
return html;
}
/**处理数据*/
function handleData(dataList){
$.each(dataList,function (index,item){
let arr = JSON.parse(item.devData);
$.each(arr,function (index2,item2){
item['val' + index2] = item2;
})
})
return dataList;
function closePage(type) {
let index = parent.layer.getFrameIndex(window.name); //先得到当前 iframe层的索引
parent.layer.close(index); //再执行关闭
}

View File

@ -58,6 +58,7 @@
<div class="layui-inline btns">
<button type="button" class="layui-btn layui-btn-normal layui-btn-sm btn-1" onclick="query(1)">查询
</button>
<button type="button" class="layui-btn layui-btn-normal layui-btn-sm btn-1" onclick="downloadClick()"><i class="layui-icon layui-icon-download-circle" style="font-size: 24px;"></i></button>
</div>
</div>
</form>

View File

@ -4,7 +4,7 @@
<meta charset="UTF-8">
<link rel="stylesheet" href="../../../js/layui-v2.9.14/layui/css/layui.css">
<link rel="stylesheet" href="../../../css/font.css">
<link rel="stylesheet" href="../../../css/basis/originalRecord.css">
<link rel="stylesheet" href="../../../css/basis/viewOriginalRecord.css">
<script src="../../../js/libs/jquery-2.1.1.min.js" charset="UTF-8" type="text/javascript"></script>
<script src="../../../js/layui-v2.9.14/layui/layui.js" charset="UTF-8" type="text/javascript"></script>
<script src="../../../js/publicJs.js"></script>
@ -14,32 +14,73 @@
<script src="../../../js/ajaxRequest.js"></script>
<script src="../../../js/select.js"></script>
<title>检测报告</title>
<style>
.none {
display: none;
}
</style>
</head>
<body>
<div id="content">
<!--基本信息-->
<div class="basic-box">
<form class="layui-form" onsubmit="return false;">
<table id="testTable" class="layui-table"></table>
</form>
<div id="title">
<h1 id="titleName">安全帽检测报告附页</h1>
</div>
<table class="classTable" style="">
<!-- <colgroup style="overflow: auto">-->
<!-- <col class="w-60" width="60"></col>-->
<!-- <col class="w-60" width="60"></col>-->
<!-- <col class="w-90" width="90"></col>-->
<!-- <col class="w-80" width="80"></col>-->
<!-- <col class="w-80" width="80"></col>-->
<!-- <col class="w-80" width="80" id="mainCol"></col>-->
<!-- </colgroup>-->
<tr>
<td colspan="1">报告编号</td>
<td id="reportCode" colspan="1"></td>
<td colspan="1">收样日期</td>
<td id="collectSamplesTime" colspan="1"></td>
<td colspan="1">样品数量</td>
<td id="devNum" colspan="1"></td>
</tr>
<tr>
<td rowspan="1">检测设备</td>
<td style="text-align: left; text-indent: 20px;" id="devTypeName" colspan="10"></td>
</tr>
<tr>
<td colspan="1">检测依据</td>
<td style="text-align: left; text-indent: 20px;" colspan="10" id="yj"></td>
</tr>
<tr>
<td rowspan="2" colspan="1">序号</td>
<td rowspan="2">样品编号</td>
<td colspan="4" id="appearanceStatus">样品信息</td>
</tr>
<tr id="itemTd">
<td>客户自编号</td>
<td>生产厂家</td>
<td>生产日期</td>
<td id="devModule">规格型号</td>
</tr>
<tr>
<td colspan="1">技术要求</td>
<td style="text-align: left; text-indent: 20px;" id="technicalRequirements" colspan="10"></td>
</tr>
<tr>
<td colspan="1">检测结论</td>
<td style="text-align: left; text-indent: 20px;" id="experConclu" colspan="10"></td>
</tr>
<tr>
<td colspan="1">备注</td>
<td style="text-align: left; text-indent: 20px;" id="remark" colspan="10"></td>
</tr>
<tr>
<td colspan="1">检测日期</td>
<td id="experTime" colspan="4"></td>
<td colspan="1">下次检测日期</td>
<td id="nextExperTime" colspan="4"></td>
</tr>
</table>
<div class="btn-box" style="display: none;">
<button class="layui-btn layui-btn-norma save" onclick="print()">打印</button>
<button class="layui-btn layui-btn-primary cancel" onclick="closePage()">取消</button>
</div>
</div>
</body>
<style>
.layui-table .layui-table-cell {
height: auto;
word-break: normal;
display: block;
white-space: pre-wrap;
word-wrap: break-word;
overflow: hidden;
padding: 0 10px !important;
}
</style>
<script src="../../../js/testReport/child/testReportView.js" charset="UTF-8" type="text/javascript"></script>
</html>

File diff suppressed because it is too large Load Diff