From 9407df74bbae90ea4fe885c463252a4396420aa6 Mon Sep 17 00:00:00 2001 From: hayu <1604366271@qq.com> Date: Sat, 27 Jul 2024 17:28:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A3=80=E6=B5=8B=E6=8A=A5=E5=91=8A=E7=AE=A1?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 5 + .../TestReportManageController.java | 132 +- .../aqgqj/basis/dao/TestReportManageDao.java | 26 +- .../basis/entity/dto/TestReportManageDto.java | 43 + .../service/TestReportManageService.java | 7 + .../impl/TestReportManageServiceImpl.java | 10 +- .../mappers/basis/TestReportManageMapper.xml | 64 + .../js/testReport/child/testReportForm.js | 54 +- .../js/testReport/child/testReportView.js | 161 +-- .../testReport/child/testReportForm.html | 1 + .../testReport/child/testReportView.html | 85 +- src/main/resources/temple/certificate.ftl | 1117 +++++++++++++++++ 12 files changed, 1588 insertions(+), 117 deletions(-) create mode 100644 src/main/resources/temple/certificate.ftl diff --git a/pom.xml b/pom.xml index 7afc9fa..fc264ff 100644 --- a/pom.xml +++ b/pom.xml @@ -17,6 +17,11 @@ 1.8 + + org.springframework.boot + spring-boot-starter-freemarker + 3.2.5 + org.springframework.boot spring-boot-starter-web diff --git a/src/main/java/com/bonus/aqgqj/basis/controller/TestReportManageController.java b/src/main/java/com/bonus/aqgqj/basis/controller/TestReportManageController.java index 0e279fe..b2dd7cf 100644 --- a/src/main/java/com/bonus/aqgqj/basis/controller/TestReportManageController.java +++ b/src/main/java/com/bonus/aqgqj/basis/controller/TestReportManageController.java @@ -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 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 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 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 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 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 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 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; + } + } diff --git a/src/main/java/com/bonus/aqgqj/basis/dao/TestReportManageDao.java b/src/main/java/com/bonus/aqgqj/basis/dao/TestReportManageDao.java index de91e0f..0ff7054 100644 --- a/src/main/java/com/bonus/aqgqj/basis/dao/TestReportManageDao.java +++ b/src/main/java/com/bonus/aqgqj/basis/dao/TestReportManageDao.java @@ -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 getExperDev(TestReportManageDto dto); + + /** + * 试验依据信息 + * @param dto + * @return + */ + List getConfigBasis(TestReportManageDto dto); + + /** + * 获取试验信息 + * @param dto + * @return + */ + TestReportManageDto getTestData(TestReportManageDto dto); + + /** + * 获取证书列表 + * @param data + * @return + */ + TestReportManageDto downloadCertificateList(TestReportManageDto data); } diff --git a/src/main/java/com/bonus/aqgqj/basis/entity/dto/TestReportManageDto.java b/src/main/java/com/bonus/aqgqj/basis/entity/dto/TestReportManageDto.java index 428c4f0..9cd9c10 100644 --- a/src/main/java/com/bonus/aqgqj/basis/entity/dto/TestReportManageDto.java +++ b/src/main/java/com/bonus/aqgqj/basis/entity/dto/TestReportManageDto.java @@ -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 basisVos; + + /** + * 试验项 + */ + private List configItemsVos; + + /** + * 试验样品设备list + */ + private List experDevVos; + + /** + * 实验地点 + */ + private String submitLocation; + } diff --git a/src/main/java/com/bonus/aqgqj/basis/service/TestReportManageService.java b/src/main/java/com/bonus/aqgqj/basis/service/TestReportManageService.java index 76eaf9c..b1c0705 100644 --- a/src/main/java/com/bonus/aqgqj/basis/service/TestReportManageService.java +++ b/src/main/java/com/bonus/aqgqj/basis/service/TestReportManageService.java @@ -63,4 +63,11 @@ public interface TestReportManageService { * @return */ ServerResponse viewTestData(TestReportManageDto data); + + /** + * 合格证下载 + * @param data + * @return + */ + TestReportManageDto downloadCertificateList(TestReportManageDto data); } diff --git a/src/main/java/com/bonus/aqgqj/basis/service/impl/TestReportManageServiceImpl.java b/src/main/java/com/bonus/aqgqj/basis/service/impl/TestReportManageServiceImpl.java index e9052c9..b179d5a 100644 --- a/src/main/java/com/bonus/aqgqj/basis/service/impl/TestReportManageServiceImpl.java +++ b/src/main/java/com/bonus/aqgqj/basis/service/impl/TestReportManageServiceImpl.java @@ -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 experBasisVos = testReportManageDao.getConfigBasis(dto); List configItemsVos = testReportManageDao.getExperItems(dto); for (ConfigItemsVo configItemsVo : configItemsVos) { List configItemVos = testReportManageDao.getExperItem(configItemsVo.getId()); configItemsVo.setItemList(configItemVos); } List 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 diff --git a/src/main/resources/mappers/basis/TestReportManageMapper.xml b/src/main/resources/mappers/basis/TestReportManageMapper.xml index a2faff7..7cf6a62 100644 --- a/src/main/resources/mappers/basis/TestReportManageMapper.xml +++ b/src/main/resources/mappers/basis/TestReportManageMapper.xml @@ -261,4 +261,68 @@ and tsd.dev_type_name = #{sampleTools} ORDER BY ted.id + + + \ No newline at end of file diff --git a/src/main/resources/static/js/testReport/child/testReportForm.js b/src/main/resources/static/js/testReport/child/testReportForm.js index 71ea2cf..998846a 100644 --- a/src/main/resources/static/js/testReport/child/testReportForm.js +++ b/src/main/resources/static/js/testReport/child/testReportForm.js @@ -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 '查看'; } @@ -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); } diff --git a/src/main/resources/static/js/testReport/child/testReportView.js b/src/main/resources/static/js/testReport/child/testReportView.js index b82895e..8982889 100644 --- a/src/main/resources/static/js/testReport/child/testReportView.js +++ b/src/main/resources/static/js/testReport/child/testReportView.js @@ -44,93 +44,94 @@ 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); +function setFormData(obj) { + setTableInfo(obj); } -/**试验依据赋值*/ -function setYjData(list){ - let html = ''; - if(list && list.length > 0){ - $.each(list,function (index,item){ - html += '
' + - '
' + - '
' + - '' + - '
' + - '
' + - '
' +/*赋值表格信息*/ +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) { + let itemList = item.itemList; + allCloun += itemList.length; + firstHtml += '' + item.experTypeName + '' + $.each(itemList, function (index2, item2) { + colHtml += '' + twoHtml += '' + item2.itemName + ''; + }) + }) + 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 += '' + + '' + (index + 1) + '' + + '' + item.customerCode + '' + + '' + item.devCode + '' + + '' + item.manufacturer + '' + + '' + item.manufactureDate + '' + + '' + item.devModule + '' + + 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 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; +/*赋值试验子项数据*/ +function setItemData(list) { + let html = ''; + $.each(list, function (index, item) { + html += '' + item + ''; + }) + 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); //再执行关闭 } \ No newline at end of file diff --git a/src/main/resources/static/pages/testReport/child/testReportForm.html b/src/main/resources/static/pages/testReport/child/testReportForm.html index a462cdc..057a56b 100644 --- a/src/main/resources/static/pages/testReport/child/testReportForm.html +++ b/src/main/resources/static/pages/testReport/child/testReportForm.html @@ -58,6 +58,7 @@
+
diff --git a/src/main/resources/static/pages/testReport/child/testReportView.html b/src/main/resources/static/pages/testReport/child/testReportView.html index 6255f14..3d34ea9 100644 --- a/src/main/resources/static/pages/testReport/child/testReportView.html +++ b/src/main/resources/static/pages/testReport/child/testReportView.html @@ -4,7 +4,7 @@ - + @@ -14,32 +14,73 @@ 检测报告 -
- -
-
-
-
+
+

安全帽检测报告附页

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
报告编号收样日期样品数量
检测设备
检测依据
序号样品编号样品信息
客户自编号生产厂家生产日期规格型号
技术要求
检测结论
备注
检测日期下次检测日期
+
- \ No newline at end of file diff --git a/src/main/resources/temple/certificate.ftl b/src/main/resources/temple/certificate.ftl new file mode 100644 index 0000000..7199e6f --- /dev/null +++ b/src/main/resources/temple/certificate.ftl @@ -0,0 +1,1117 @@ + + + + + الالتزام + Mr.郝 + 1 + 2024-07-27T07:02:00Z + 2024-07-27T07:51:26Z + 1 + 50 + 155 + 0 + 0 + 155 + 14 + + + 2052-12.1.0.17147 + 68E099EF87E641029AFC51911E3A6A94_13 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 合格证 + + + + + + + + + + + + + + + + ${submitLocation} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 试验结果 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 样品名称 + + + + + + + + + + + + + + + + + + + + + + + ${sampleTools} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 规格型号 + + + + + + + + + + + + + + + + + + + + + + + ${devModule} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 样品编号 + + + + + + + + + + + + + + + + + + + + + + + ${devCode} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 检验日期 + + + + + + + + + + + + + + + + + + + + + + + ${experTime} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 下次检验日期 + + + + + + + + + + + + + + + + + + + + + + + ${nextExperTime} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 试验人员 + + + + + + + + + + + + + + + + + + + + + + + ${experUser} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 试验结果 + + + + + + + + + + + + + + + + + + + + + + + ${isHg} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 送检单位 + + + + + + + + + + + + + + + + + + + + + + + + ${customName} + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file