let form, layer, table, laypage, laydate; let pageNum = 1, limitSize = 10; // 默认第一页,分页数量为 layui.use(['form', 'layer', 'table', 'laypage', 'laydate'], function () { form = layui.form; table = layui.table; laypage = layui.laypage; layer = layui.layer; laydate = layui.laydate; laydate.render({ elem: '#years', //指定元素 元素选择器 type: 'year', //选择时间类型 可选值:year(年) month(年月) date(年月日) time(时分秒) datetime(年月日时分秒) trigger: 'click', format: 'yyyy', //时间格式 常用时间格式:yyyy-MM-dd HH:mm:ss btns: ['clear', 'now', 'confirm'], //选择框右下角显示的按钮 清除-现在-确定 done: function (value, date) { //时间回调 } }); layui.form.render(); pages(1, 10, 1); }) function reloadData() { pages(1, limitSize); } function pages(pageNum, pageSize, typeNum) { let params = getReqParams(pageNum, pageSize, typeNum); $.ajax({ headers: { "encrypt": sm3(JSON.stringify(params)) }, url: dataUrl + "proteam/pot/tysj/getSjNumList?token=" + token, data: params, type: 'POST', async: false, success: function (result) { if (result.code === 200) { if (result.data) { initTable(result.data, result.limit, result.curr) laypages(result.count, result.curr, result.limit) } } else if (result.code === 500) { layer.alert(result.msg, {icon: 2}) } else if (result.code === 401) { logout(1); } }, error: function () { } }); } function laypages(total, page, limit) { laypage.render({ elem: 'voi-page', count: total, curr: page, limit: limit, limits: [10, 20, 50, 100, 200, 500], layout: ['prev', 'page', 'next', 'skip', 'count', 'limit'], groups: 5, jump: function (obj, first) { if (!first) { pageNum = obj.curr, limitSize = obj.limit; pages(obj.curr, obj.limit, null); } } }); } function initTable(dataList, limit, page) { table.render({ elem: "#table", id: "table", height: "full-160", data: dataList, limit: limit, cols: [ [ { type: 'checkbox', unresize: true, width: 60, align: "center", }, //表头 { title: "序号", width: 100, unresize: true, align: "center", templet: function (d) { return (page - 1) * limit + d.LAY_INDEX; } }, { field: "org", title: "省公司", unresize: true, width: 120, align: "center", }, { field: "proName", title: "输变电工程名称", unresize: true, width: 200, align: "center", }, { field: "signName", title: "单项工程名称", unresize: true, width: 200, align: "center", }, { field: "voltage", title: "输变电工程电压等级(kV)", unresize: true, width: 200, align: "center", }, { field: "proType", title: "工程类型", unresize: true, width: 200, align: "center", }, { field: "sjUnit", title: "设计单位", unresize: true, width: 200, align: "center", }, { field: "psUnit", title: "评审单位", unresize: true, width: 200, align: "center", }, { field: "psYjTime", title: "评审意见印发时间", unresize: true, width: 200, align: "center", }, { field: "isSjzlQ", title: "是否发生设计质量问题", unresize: true, width: 200, align: "center", }, { field: "isQ", title: "是否问题库内问题", unresize: true, width: 200, align: "center", }, { field: "sjzlQName", title: "设计质量问题名称", unresize: true, width: 200, align: "center", }, { field: "wtkNum", title: "问题库编号", unresize: true, width: 200, align: "center", }, { field: "wtType", title: "问题类别", unresize: true, width: 200, align: "center", }, { field: "wtXz", title: "问题性质", unresize: true, width: 200, align: "center", }, { field: "sjjd", title: "设计阶段", unresize: true, width: 200, align: "center", }, { field: "sszy", title: "所属专业", unresize: true, width: 200, align: "center", }, { field: "sfzg", title: "是否整改", unresize: true, width: 200, align: "center", }, { field: "wtjs", title: "问题简述", unresize: true, width: 200, align: "center", templet: function (d) { if (d.wtjs) { if (d.wtjs.length > 60) { return '' + d.wtjs.substring(0, 60) + '...' } else { return '' + d.wtjs + '' } } else { return ''; } } }, { title: "问题分析", unresize: true, width: 200, align: "center", templet: function (d) { if (d.wtfx) { if (d.wtfx.length > 60) { return '' + d.wtfx.substring(0, 60) + '...' } else { return '' + d.wtfx + '' } } else { return ''; } } }, { field: "jycqcs", title: "建议采取措施", unresize: true, width: 200, align: "center", templet: function (d) { if (d.jycqcs) { if (d.jycqcs.length > 60) { return '' + d.jycqcs.substring(0, 60) + '...' } else { return '' + d.jycqcs + '' } } else { return ''; } } }, { title: "操作", width: 180, unresize: true, align: "center", templet: function (d) { let html = ''; html += "修改" + "