diff --git a/src/main/resources/static/css/table-common2.css b/src/main/resources/static/css/table-common2.css index dc6ad04..92871fb 100644 --- a/src/main/resources/static/css/table-common2.css +++ b/src/main/resources/static/css/table-common2.css @@ -777,4 +777,52 @@ input:-ms-input-placeholder { .xm-select-parent dd > .xm-cz-group { margin-right: 20px !important; -} \ No newline at end of file +} +.classTable { + width: 100%; + table-layout: fixed; + text-align: center; + border-collapse: collapse; + border-spacing: 0; + box-sizing: border-box; + height: 100%; +} + +.classTable tr td { + font-size: 13px; + border-bottom: 1px solid #7c7878; + height: 30px; + color: #262626; +} + +.classTable thead tr:nth-of-type(1) { + background-color: #f0f0f0; + height: 40px; +} + +.classTable thead tr:nth-of-type(1) td { + font-size: 15px; +} + +.classTable tbody { + display: block; + height: 300px; + /*height: 35vh;*/ + overflow-y: auto; +} + +.classTable thead, +.classTable tbody tr { + display: table; + width: 100%; + table-layout: fixed; +} + +.classTable thead { + width: calc(100% - 5px); +} + +.classTable tbody tr { + width: 100%; + cursor: pointer; +} diff --git a/src/main/resources/static/js/basis/child/auditData.js b/src/main/resources/static/js/basis/child/auditData.js index e95b264..4fb4ca8 100644 --- a/src/main/resources/static/js/basis/child/auditData.js +++ b/src/main/resources/static/js/basis/child/auditData.js @@ -96,7 +96,23 @@ function initTable(dataList, limit, page) { }, {field: "devTypeName", title: "设备类型", unresize: true, align: "center"}, {field: "sampleNum", title: "送样总数", unresize: true, align: "center"}, - {field: "sampleQuantity", title: "样品总数", unresize: true, align: "center"}, + {field: "sampleQuantity", title: "样品总数", unresize: true, align: "center", + templet: function (d) { + const sampleList = d.sampleList; + if (sampleList && sampleList.length > 0) { + let flag = false,style = ''; + $.each(sampleList, function (index, item) { + if (item.testResult === '不合格') { + flag = true; + return false; + } + }) + style='color: '+(flag ? "#F39268" : '#2A6EDF')+''; + return "" + sampleList.length + ""; + } else { + return 0; + } + }}, {field: "experimenter", title: "试验人员", unresize: true, align: "center"}, {field: "testTime", title: "试验时间", unresize: true, align: "center"}, {field: "status", title: "状态", unresize: true, align: "center", templet: function (d) { @@ -210,6 +226,46 @@ function checkAllList(list, obj) { return -1; } +function getMouseover(data) { + for (let i = 0; i < 10; i++) { + data.push(data[0]); + } + let html = '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + html += ''; + if (data.length > 0) { + for (let i = 0; i < data.length; i++) { + html += '' + + '' + + '' + + '' + + ''; + } + } else { + html += '' + + '' + + ''; + } + html += ''; + html += '
序号设备编号试验结果
' + (i + 1) + '' + data[i].devCode + '' + data[i].testResult + '
暂无数据
'; + let devOpenIndex = layer.open({ + type: 0, + title: '样品设备详情', + area: ['400px', '500px'], + content: html, + btn: ['关闭'], + yes: function (index, layero) { + layer.close(index); + } + }); +} + // 获取参数 function getReqParams(page, limit, type) { let obj = {}; diff --git a/src/main/resources/static/js/basis/child/viewAuditData.js b/src/main/resources/static/js/basis/child/viewAuditData.js index e76b6c7..0d08940 100644 --- a/src/main/resources/static/js/basis/child/viewAuditData.js +++ b/src/main/resources/static/js/basis/child/viewAuditData.js @@ -2,6 +2,7 @@ let form, layer, table, tableIns, laydate; let pageNum = 1, limitSize = 10; // 默认第一页,分页数量为10 let deviceTypeList = []; let idParam = null, statusParam = null; + function setParams(params) { idParam = JSON.parse(params).id; statusParam = JSON.parse(params).status; @@ -68,8 +69,6 @@ function laypages(total, page, limit) { }) } -let flag = true; - /*初始化表格*/ function initTable(dataList, limit, page) { let loadingMsg = layer.msg("数据加载中,请稍候...", {icon: 16, scrollbar: false, time: 0,}); @@ -89,12 +88,30 @@ function initTable(dataList, limit, page) { }, {field: "devTypeName", title: "设备类型", unresize: true, align: "center"}, {field: "sampleNum", title: "送样总数", unresize: true, align: "center"}, - {field: "sampleQuantity", title: "样品总数", unresize: true, align: "center"}, + { + field: "sampleQuantity", title: "样品总数", unresize: true, align: "center", templet: function (d) { + const sampleList = d.sampleList; + if (sampleList && sampleList.length > 0) { + let flag = false,style = ''; + $.each(sampleList, function (index, item) { + if (item.testResult === '不合格') { + flag = true; + return false; + } + }) + style='color: '+(flag ? "#F39268" : '#2A6EDF')+''; + return "" + sampleList.length + ""; + } else { + return 0; + } + } + }, {field: "experimenter", title: "试验人员", unresize: true, align: "center"}, {field: "testTime", title: "试验时间", unresize: true, align: "center"}, - {field: "status", title: "状态", unresize: true, align: "center", templet: function (d) { - return setAuditStatus(d.status); - } + { + field: "status", title: "状态", unresize: true, align: "center", templet: function (d) { + return setAuditStatus(d.status); + } }, {field: "causeOfRejection", title: "驳回原因", unresize: true, align: "center"}, { @@ -116,6 +133,45 @@ function initTable(dataList, limit, page) { }); } +function getMouseover(data) { + for (let i = 0; i < 10; i++) { + data.push(data[0]); + } + let html = '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + html += ''; + if (data.length > 0) { + for (let i = 0; i < data.length; i++) { + html += '' + + '' + + '' + + '' + + ''; + } + } else { + html += '' + + '' + + ''; + } + html += ''; + html += '
序号设备编号试验结果
' + (i + 1) + '' + data[i].devCode + '' + data[i].testResult + '
暂无数据
'; + let devOpenIndex = layer.open({ + type: 0, + title: '样品设备详情', + area: ['400px', '500px'], + content: html, + btn: ['关闭'], + yes: function (index, layero) { + layer.close(index); + } + }); +} // 获取参数 function getReqParams(page, limit, type) { let obj = {};