let element, layer, laydate; const bidCode = parent.$('#bidPro').val(); var table; var alarmTableIns; var qualityInspectionTableIns; layui.use(['layer', 'element', 'table'], function () { element = layui.element; layer = layui.layer; laydate = layui.laydate; table = layui.table; //下拉选 getConstruction(); getRegion(); //施工质量列表 ConstructionQualityList(); laydate.render({ elem: '#ID-laydate-type-datetime', }); }); //下拉选 function getConstruction(){ const url = commonUrl + "system/sys/select/getBuildLists"; // 建管单位url ajaxRequest(url, "get", null , true, function () { }, function (result) { if (result.code === 200) { let html = ''; if (result.data && result.data.length > 0) { $.each(result.data, function (index, item) { html += '' }) } $('#construction').empty().append(html); layui.form.render(); } else if (result.code === 500) { layer.msg(result.msg, { icon: 2 }); } }, function (xhr) { error(xhr) }); } function getRegion(){ const url = commonUrl + "system/sys/select/getAreaLists"; // 建管单位url ajaxRequest(url, "get", null , true, function () { }, function (result) { if (result.code === 200) { let html = ''; if (result.data && result.data.length > 0) { $.each(result.data, function (index, item) { html += '' }) } $('#region').empty().append(html); layui.form.render(); } else if (result.code === 500) { layer.msg(result.msg, { icon: 2 }); } }, function (xhr) { error(xhr) }); } function ConstructionQualityList(){ const url = commonUrl + "screen/largeScreen/constructionQuality/getConstructionQualityList"; qualityInspectionTableIns = table.render({ elem: '#demo', url: url, skin: 'line', headers:{ decrypt:"decrypt", "Authorization":token }, where: { roleCode: roleCode, orgId: orgId, userId: userId, bidCode: bidCode, // month: $('#ID-laydate-type-datetime').val(), }, cols: [[ {field: 'number', width:80,title: '序号', align: 'center', type: 'numbers', fixed: 'left'}, // {field: 'areaName', align: 'center', title: '区域'}, {field: 'deviceName', align: 'center', title: '设备名称'}, {field: 'devicType', align: 'center', title: '施工工艺'}, {field: 'maxVal', align: 'center', title: '标准值'}, {field: 'val', align: 'center', title: '检测值'}, {field: 'createTime', align: 'center', title: '检测时间'}, {field: 'isWarn', align: 'center', title: '状态'}, ]], initComplete: function () { // 在表格渲染完成后,重新渲染序号列 var that = this.elem.next(); var tool = that.children('.layui-table-box').children('.layui-table-fixed').children('.layui-table-body').children('.layui-table'); tool.find("tr").each(function (index, item) { $(this).find('td[data-field="LAY_TABLE_INDEX"]').text(index + 1); }); }, done:function(res, curr, count, origin){ console.log(res); }, page: true, //开启分页 loading: true, //数据加载中。。。 limits: [5, 10, 20, 100], limit: 7 }) }