From e93431645da64bfbce8054a4188fc448ba40fae6 Mon Sep 17 00:00:00 2001 From: cwchen <1048842385@qq.com> Date: Fri, 26 Jul 2024 18:49:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=9F=E5=A7=8B=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../static/css/basis/viewOriginalRecord.css | 117 +++++++++++++++ .../js/primaryData/child/primaryAddList.js | 18 ++- .../primaryData/child/viewOriginalRecord.js | 137 ++++++++++++++++++ .../static/js/primaryData/primary.js | 3 +- .../primaryData/child/primaryDataList.html | 4 +- .../primaryData/child/viewOriginalRecord.html | 88 +++++++++++ .../static/pages/primaryData/primary.html | 4 +- 7 files changed, 360 insertions(+), 11 deletions(-) create mode 100644 src/main/resources/static/css/basis/viewOriginalRecord.css create mode 100644 src/main/resources/static/js/primaryData/child/viewOriginalRecord.js create mode 100644 src/main/resources/static/pages/primaryData/child/viewOriginalRecord.html diff --git a/src/main/resources/static/css/basis/viewOriginalRecord.css b/src/main/resources/static/css/basis/viewOriginalRecord.css new file mode 100644 index 0000000..935393d --- /dev/null +++ b/src/main/resources/static/css/basis/viewOriginalRecord.css @@ -0,0 +1,117 @@ +/*表格/查询条件公共样式*/ +html, +body { + width: 99.5%; + /*height: calc(100% - 5px);*/ + height: 99%; + margin: 0.15% 0 0 0.25%; + padding: 0; + font-family: 'Alibaba PuHuiTi R'; + letter-spacing: 1px; +} + +.layout { + display: flex; + align-items: center; + justify-content: start; + box-sizing: border-box; +} + +#content { + width: 100%; + height: 100%; + padding: 1% 2% 1% 2%; + box-sizing: border-box; + background-color: #fff; + overflow: auto; +} + +#title { + width: 100%; + height: 50px; + text-align: center; +} +#title2{ + width: 100%; + height: 30px; + font-size: 18px; +} +.title2 p { + width: 25%; +} +.classTable { + /*width: 100%;*/ + table-layout: fixed; + text-align: center; + border-collapse: collapse; + border-spacing: 0; + box-sizing: border-box; + border: 1px solid #000; + /*height: calc(100% - 80px);*/ +} +.classTable tr td{ + font-size: 16px; + border: 1px solid #000; +} +.w-50 { + width: 50px; +} +.w-60 { + width: 60px; +} +.w-70 { + width: 70px; +} +.w-80 { + width: 80px; +} +.w-90 { + width: 90px; +} +.w-100 { + width: 100px; +} + +.w-150 { + width: 150px; +} + +.w-200 { + width: 200px; +} +.w-300 { + width: 300px; +} +.w-350 { + width: 350px; +} +.w-400 { + width: 400px; +} +/*滚动条样式start*/ +::-webkit-scrollbar { + width: 10px; + height: 13px; +} + +::-webkit-scrollbar-track { + background: #e7e7f1 !important; + border-radius: 0px; +} + +::-webkit-scrollbar-thumb { + background: rgba(94, 96, 97, 0.43) !important; + border-radius: 0px; +} + +::-webkit-scrollbar-thumb:hover { + background: rgba(94, 96, 97, 0.43) !important; + border-radius: 0px; +} + +::-webkit-scrollbar-thumb:active { + background: rgba(94, 96, 97, 0.43) !important; + border-radius: 0px; +} + +/*滚动条样式end*/ \ No newline at end of file diff --git a/src/main/resources/static/js/primaryData/child/primaryAddList.js b/src/main/resources/static/js/primaryData/child/primaryAddList.js index 095be67..3036a27 100644 --- a/src/main/resources/static/js/primaryData/child/primaryAddList.js +++ b/src/main/resources/static/js/primaryData/child/primaryAddList.js @@ -1,8 +1,6 @@ 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; @@ -69,7 +67,7 @@ function initTable(dataList, limit, page) { //表头 {title: "序号", width: 80, unresize: true, align: "center", templet: function (d) { - return (page - 1) * limit + d.LAY_INDEX; + return (page - 1) * limit + d.LAY_NUM; } }, {field: "devTypeName", title: "样品类型", unresize: true, align: "center"}, @@ -108,7 +106,7 @@ function initTable(dataList, limit, page) { }, {title: "原始记录", unresize: true, width: 300, align: "center", templet: function (d) { - return '查看'; + return '查看'; } }, ], @@ -241,13 +239,23 @@ function addData(experId,sampleId,devTypeCode) { openIframeMax("testForm", title, "testForm.html", '80%', '100%', param); } -function testClick(id,customNum) { +/*function testClick(id,customNum) { let title = '试验详细信息' let param = { 'id': id, 'customNum':customNum } openIframeMax("primaryDataList", title, "child/primaryDataList.html", '100%', '100%', param); +}*/ + +/*原始记录*/ +function viewData(experId, devTypeCode) { + let title = '原始记录'; + let param = { + 'experId': experId, + 'devTypeCode': devTypeCode + } + openIframe7("viewData", title, "child/viewOriginalRecord.html", '1500px', '750px', param); } function getDevSelected() { diff --git a/src/main/resources/static/js/primaryData/child/viewOriginalRecord.js b/src/main/resources/static/js/primaryData/child/viewOriginalRecord.js new file mode 100644 index 0000000..e312412 --- /dev/null +++ b/src/main/resources/static/js/primaryData/child/viewOriginalRecord.js @@ -0,0 +1,137 @@ +let form, layer, table; +let experIdParam = null, devTypeCodeParam = null; + +function setParams(params) { + experIdParam = JSON.parse(params).experId; + devTypeCodeParam = JSON.parse(params).devTypeCode; + layui.use(['form', 'layer', 'table'], function () { + form = layui.form; + layer = layui.layer; + table = layui.table; + }) + getDataById(); +} + +/**详情*/ +function getDataById() { + let loadingMsg = layer.msg("数据加载中,请稍候...", {icon: 16, scrollbar: false, time: 0,}); + let url = dataUrl + "/experimental/viewTestData"; + let obj = { + 'id': experIdParam + } + let params = { + encryptedData: encryptCBC(JSON.stringify(obj)) + } + ajaxRequest(url, "POST", params, true, function () { + }, function (result) { + layer.close(loadingMsg); // 关闭提示层 + if (result.status === 200) { + setFormData(result.data); + } else if (result.status === 500) { + layer.alert(result.msg, {icon: 2, move: false}) + } + }, function (xhr) { + layer.close(loadingMsg); // 关闭提示层 + error(xhr) + }); +} + +/**表单赋值*/ +function setFormData(obj) { + setTableInfo(obj); + console.log(obj) +} + +/*赋值表格信息*/ +function setTableInfo(obj) { + let list = obj.configItemsVos; + let num = 0, colspanNum = []; + let colHtml = '', firstHtml = '', twoHtml = '', tdHtml = '',yjList = ''; + $.each(list, function (index, item) { + let itemList = item.itemList; + colspanNum.push(itemList.length); + firstHtml += '' + item.experTypeName + '' + $.each(itemList, function (index2, item2) { + num++; + colHtml += '' + twoHtml += '' + item2.itemName + ''; + }) + }) + if(obj.basisVos && obj.basisVos.length > 0){ + $.each(obj.basisVos,function (index,item){ + yjList += (index + 1)+'、'+item.basisName + '\n'; + }) + } + tdHtml = setTableData(obj); + setColNum('sampleUnit', num); + setColNum('illustrate', num); + setColNum('mainDev', num); + setColNum('yj', num); + setColNum('mainDevData', num); + $('#mainCol').after(colHtml); + $('#appearanceStatus').after(firstHtml); + $('#model').after(twoHtml); + $('#itemTd').after(tdHtml); + let zsNum = Math.floor(num / 4); + let xsNum = num % 4; + if (zsNum > 0) { + $('#td2').attr("colspan", zsNum + 1); + $('#td4').attr("colspan", zsNum + 1); + $('#td6').attr("colspan", zsNum + 1); + $('#td8').attr("colspan", zsNum + 1); + } + if (xsNum > 0 && xsNum == 1) { + setColNum('td2', 1); + } else if (xsNum > 0 && xsNum == 2) { + setColNum('td2', 1); + setColNum('td8', 1); + } else if (xsNum > 0 && xsNum == 3) { + setColNum('td2', 1); + setColNum('td4', 1); + setColNum('td8', 1); + } + $('#td2').html(obj.experDev); + $('#td4').html(obj.experModule); + $('#td6').html(obj.experCode); + $('#td8').html(obj.checkTime); + $('#yj').html(yjList); + $('#sampleUnit').html(obj.customName); + $('#sampleDate').html(obj.sampleDate); +} + +function setColNum(name, addNum) { + let num = $('#' + name + '').attr("colspan"); + $('#' + name + '').attr("colspan", parseInt(num) + addNum); +} + +/*赋值表格数据*/ +function setTableData(obj) { + let list = obj.experDevVos; + let html = ''; + $.each(list, function (index, item) { + html += '' + + '' + (index + 1) + '' + + '' + item.devCode + '' + + '' + item.manufacturer + '' + + '' + item.manufactureDate + '' + + '' + item.devModule + '' + + '' + item.devStatus + '' + + setItemData(JSON.parse(item.devData)); + if (index == 0) { + html += '' + obj.experStand + '' + + '' + obj.experConclu + ''; + } + html += '' + item.remarks + '' + + ''; + }) + return html; +} + +/*赋值试验子项数据*/ +function setItemData(list) { + let html = ''; + $.each(list, function (index, item) { + html += '' + item + ''; + }) + return html; +} diff --git a/src/main/resources/static/js/primaryData/primary.js b/src/main/resources/static/js/primaryData/primary.js index 731cdac..3a09475 100644 --- a/src/main/resources/static/js/primaryData/primary.js +++ b/src/main/resources/static/js/primaryData/primary.js @@ -66,11 +66,10 @@ function initTable(dataList, limit, page) { limit: limit, cols: [ [ - {type: 'checkbox', fixed: 'left'}, //表头 {title: "序号", width: 80, unresize: true, align: "center", templet: function (d) { - return (page - 1) * limit + d.LAY_INDEX; + return (page - 1) * limit + d.LAY_NUM; } }, {field: "customName", title: "送样单位", unresize: true, align: "center"}, diff --git a/src/main/resources/static/pages/primaryData/child/primaryDataList.html b/src/main/resources/static/pages/primaryData/child/primaryDataList.html index eec43b5..50b4cd0 100644 --- a/src/main/resources/static/pages/primaryData/child/primaryDataList.html +++ b/src/main/resources/static/pages/primaryData/child/primaryDataList.html @@ -2,10 +2,10 @@ - + - + diff --git a/src/main/resources/static/pages/primaryData/child/viewOriginalRecord.html b/src/main/resources/static/pages/primaryData/child/viewOriginalRecord.html new file mode 100644 index 0000000..11fad43 --- /dev/null +++ b/src/main/resources/static/pages/primaryData/child/viewOriginalRecord.html @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + 原始数据记录-原始记录 + + +
+
+

安全帽检测原始记录

+
+
+

记录编号:

+

收样日期:

+

试验日期:

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
送检单位
试验地点力学检测室主要试验设备
名称型号编号检定/校准有效期
试验依据
编号客户自编号样品信息外观状态试验标准试验结论备注
生产厂家生产日期型号
说明:外观状态若符合判定依据要求的则打V,不符合要求的则打X;试验结论一栏则填符合:Y或不符合:N,不符合原因在备注一栏体现。
+
+

试验员:

+

审核员:

+

第 页共 页:

+
+
+ + + \ No newline at end of file diff --git a/src/main/resources/static/pages/primaryData/primary.html b/src/main/resources/static/pages/primaryData/primary.html index e3377c3..b8afc9c 100644 --- a/src/main/resources/static/pages/primaryData/primary.html +++ b/src/main/resources/static/pages/primaryData/primary.html @@ -2,10 +2,10 @@ - + - +