This commit is contained in:
cwchen 2024-07-24 14:08:14 +08:00
parent fe60257b9c
commit 78d664a840
4 changed files with 156 additions and 56 deletions

View File

@ -375,25 +375,27 @@
</select>
<!--试验数据详情-->
<select id="viewTestData" resultType="com.bonus.aqgqj.basis.entity.vo.TestVo">
SELECT id,
sample_id AS sampleId,
dev_type_code AS devTypeCode,
dev_type_name AS devTypeName,
dev_num AS sampleQuantity,
dev_module AS devModule,
sample_date AS sampleDate,
DATE_FORMAT(exper_time, '%Y-%m-%d') AS experTime,
DATE_FORMAT(next_exper_time, '%Y-%m-%d') AS nextExperTime,
submit_unit AS customId,
submit_location AS experLocal,
exper_dev AS experDev,
exper_module AS experModule,
exper_code AS experCode,
DATE_FORMAT(check_time, '%Y-%m-%d') AS checkTime,
exper_stand AS experStand,
exper_conclu AS experConclu,
remarsk AS remarsk
SELECT te.id,
te.sample_id AS sampleId,
te.dev_type_code AS devTypeCode,
te.dev_type_name AS devTypeName,
te.dev_num AS sampleQuantity,
te.dev_module AS devModule,
te.sample_date AS sampleDate,
DATE_FORMAT(te.exper_time, '%Y-%m-%d') AS experTime,
DATE_FORMAT(te.next_exper_time, '%Y-%m-%d') AS nextExperTime,
te.submit_unit AS customId,
tc.custom_name AS customName,
te.submit_location AS experLocal,
te.exper_dev AS experDev,
te.exper_module AS experModule,
te.exper_code AS experCode,
DATE_FORMAT(te.check_time, '%Y-%m-%d') AS checkTime,
te.exper_stand AS experStand,
te.exper_conclu AS experConclu,
te.remarsk AS remarsk
FROM tb_exper te
LEFT JOIN tb_custom tc ON te.submit_unit = tc.id AND tc.del_flag = 0
WHERE te.id = #{id}
</select>
<!--试验依据信息-->

View File

@ -35,10 +35,24 @@ body {
width: 350px;
}
.yj{
.yj {
width: 725px !important;
}
/*.layui-table thead tr {
background-color: #f0f0f0;
font-size: 16px;
height: 40px;
color: #262626 !important;
}*/
.layui-table th {
background-color: #f6f5f5;
height: 40px;
font-size: 16px;
}
.layui-form-label {
padding: 9px 0;
width: 150px;
@ -46,7 +60,7 @@ body {
text-align: left;
}
.layui-input,.layui-textarea {
.layui-input, .layui-textarea {
border-color: #c7c5c5 !important;
font-size: 15px;
}
@ -59,10 +73,11 @@ hr {
border-bottom: 1px solid #c7c5c5;
}
/*滚动条样式start*/
::-webkit-scrollbar {
width: 10px;
height: 20px;
height: 13px;
}
::-webkit-scrollbar-track {

View File

@ -1,11 +1,12 @@
let form, layer;
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'], function () {
layui.use(['form', 'layer','table'], function () {
form = layui.form;
layer = layui.layer;
table = layui.table;
})
getDataById();
}
@ -39,5 +40,91 @@ 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 setYjData(list){
let html = '';
if(list && list.length > 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>'
})
}
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: 'devCode',title: '客户自编号',width: 120,fixed: 'left',rowspan: 2,align: 'center',unresize: true,},
{title: '样品信息',fixed: 'left', align: 'center', colspan: 3, unresize: true},
{field: 'devStatus', fixed: 'left',title: '外观状态', width: 100, rowspan: 2, align: 'center', unresize: true},
{field: 'amount', fixed: 'left',title: '金额', width: 100, rowspan: 2, align: 'center', unresize: true},
{field: 'remarks', fixed: 'left',title: '备注', width: 150, rowspan: 2, 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 + "(金额:" +item.amount+ "",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 handleData(dataList){
$.each(dataList,function (index,item){
let arr = JSON.parse(item.devData);
$.each(arr,function (index2,item2){
item['val' + index2] = item2;
})
})
return dataList;
}

View File

@ -14,6 +14,11 @@
<script src="../../../js/ajaxRequest.js"></script>
<script src="../../../js/select.js"></script>
<title>原始记录</title>
<style>
.none {
display: none;
}
</style>
</head>
<body>
<div id="content">
@ -49,21 +54,21 @@
<label class="layui-form-label">收样日期</label>
<br>
<div class="layui-input-inline">
<input type="text" name="username" readonly autocomplete="off" class="layui-input">
<input type="text" id="sampleDate" readonly autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">试验日期</label>
<br>
<div class="layui-input-inline">
<input type="text" name="username" readonly autocomplete="off" class="layui-input">
<input type="text" id="experTime" readonly autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">下次试验日期</label>
<br>
<div class="layui-input-inline">
<input type="text" name="username" readonly autocomplete="off" class="layui-input">
<input type="text" id="nextExperTime" readonly autocomplete="off" class="layui-input">
</div>
</div>
</div>
@ -72,14 +77,14 @@
<label class="layui-form-label">送检单位</label>
<br>
<div class="layui-input-inline" style="width: 725px;">
<input type="text" name="username" readonly autocomplete="off" class="layui-input">
<input type="text" id="customName" readonly autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">试验地点</label>
<br>
<div class="layui-input-inline">
<input type="text" name="username" readonly autocomplete="off" class="layui-input">
<input type="text" id="experLocal" readonly autocomplete="off" class="layui-input">
</div>
</div>
</div>
@ -90,21 +95,21 @@
<label class="layui-form-label">名称</label>
<br>
<div class="layui-input-inline">
<input type="text" name="username" readonly autocomplete="off" class="layui-input">
<input type="text" id="experDev" readonly autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">型号</label>
<br>
<div class="layui-input-inline">
<input type="text" name="username" readonly autocomplete="off" class="layui-input">
<input type="text" id="experModule" readonly autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">编号</label>
<br>
<div class="layui-input-inline">
<input type="text" name="username" readonly autocomplete="off" class="layui-input">
<input type="text" id="experCode" readonly autocomplete="off" class="layui-input">
</div>
</div>
</div>
@ -113,39 +118,19 @@
<label class="layui-form-label">检定/校准有效期</label>
<br>
<div class="layui-input-inline">
<input type="text" name="username" readonly autocomplete="off" class="layui-input">
<input type="text" id="checkTime" readonly autocomplete="off" class="layui-input">
</div>
</div>
</div>
<hr>
<p style="margin-bottom: 1%">试验依据</p>
<div class="layui-form-item">
<div class="layui-inline">
<div class="layui-input-inline yj">
<input type="text" name="username" readonly autocomplete="off" class="layui-input">
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-inline">
<div class="layui-input-inline yj">
<input type="text" name="username" readonly autocomplete="off" class="layui-input">
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-inline">
<div class="layui-input-inline yj">
<input type="text" name="username" readonly autocomplete="off" class="layui-input">
</div>
</div>
</div>
<p style="margin-bottom: 1%" id="yjList">试验依据</p>
<table id="testTable" class="layui-table"></table>
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">试验标准</label>
<br>
<div class="layui-input-inline yj">
<textarea type="text" name="username" readonly autocomplete="off" class="layui-textarea"></textarea>
<textarea type="text" id="experStand" readonly autocomplete="off" class="layui-textarea"></textarea>
</div>
</div>
</div>
@ -154,7 +139,7 @@
<label class="layui-form-label">试验结论</label>
<br>
<div class="layui-input-inline yj">
<textarea type="text" name="username" readonly autocomplete="off" class="layui-textarea"></textarea>
<textarea type="text" id="experConclu" readonly autocomplete="off" class="layui-textarea"></textarea>
</div>
</div>
</div>
@ -171,5 +156,16 @@
</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/basis/child/viewExperData.js" charset="UTF-8" type="text/javascript"></script>
</html>