diff --git a/src/main/resources/static/js/work/newSub/subIndex.js b/src/main/resources/static/js/work/newSub/subIndex.js index 222a0ae..3141394 100644 --- a/src/main/resources/static/js/work/newSub/subIndex.js +++ b/src/main/resources/static/js/work/newSub/subIndex.js @@ -7,7 +7,6 @@ layui.use(['table', 'form'], function () { let table = layui.table; let form = layui.form; - $("#auditResult").append("") form.render(); //表格初始化 table.render({ @@ -21,31 +20,30 @@ layui.use(['table', 'form'], function () { , cellMinWidth: 80 //全局定义常规单元格的最小宽度,layui 2.2.1 新增 , cols: [[ //normal(常规列,无需设定)、checkbox(复选框列)、space(空列)、numbers(序号列) - {type: 'checkbox', title: '复选框',field: 'allCheck'}//序号列 + {type: 'checkbox', title: '复选框', field: 'allCheck'}//序号列 , {type: 'numbers', title: '序号', width: "10%"}//序号列 , { field: 'messageTheme', title: '消息内容', width: "60%", style: 'text-align: left', templet: d => { - let text = ""; + let text; if (d.status === "1" || d.status === 1) { - text = ""+d.messageTheme+""; + text = "" + d.messageTheme + ""; } else { - text = ""+d.messageTheme+""; + text = "" + d.messageTheme + ""; } return text; } } , { field: 'auditResult', title: '审核状态', templet: d => { - let text = ""; + let text; let message = d.messageTheme; if (d.auditResult === "1") { text = "通过"; - } else if(d.auditResult === "2"){ + } else if (d.auditResult === "2") { text = "待审核"; - } - else { + } else { text = "未通过"; - if (message.indexOf("撤回") > 0){ + if (message.indexOf("撤回") > 0) { text = "已撤回"; } } @@ -63,7 +61,7 @@ layui.use(['table', 'form'], function () { $('tr[data-index=' + i + '] input[type="checkbox"]').prop('disabled', true); state = "1";// 隐藏表头全选判断状态 form.render();// 重新渲染一下 - }else { + } else { allCheckList.push(item.messageId); allNameList.push(item.nameId); } @@ -100,11 +98,11 @@ layui.use(['table', 'form'], function () { //checkbox 点击事件 table.on('checkbox(table-temp)', function (obj) { - var is_all= obj.type === 'all' ? true : false;//是否全选 + var is_all = obj.type === 'all';//是否全选 if (is_all) { checkList = allCheckList; nameList = allNameList; - }else { + } else { if (obj.checked === true) { checkList.push(obj.data.messageId) nameList.push(obj.data.nameId) @@ -120,7 +118,7 @@ layui.use(['table', 'form'], function () { table.on('toolbar(table-temp)', obj => { switch (obj.event) { case "searchBt": - oldYear = $("#auditResult").val(); + oldYear = $('#auditResult').val(); table.reload('menuTable', { url: ctxPath + '/subIndex/getMsgContent' , method: 'post' //方式默认是get @@ -156,24 +154,6 @@ layui.use(['table', 'form'], function () { } }); - $('#allmessage').on('click', function () { - var type = $(this).data('type'); - active[type] ? active[type].call(this) : ''; - }); - var active = { - reload: function () { - table.reload('lay-table', { - page: { - curr: 1 //重新从第一页开始 - }, - where: { - 'type': type, // 在表格中进行搜索 - } - }); - table.reload('') - }, - }; - function updateTableData(type, id) { $('#' + id + '').on('click', function () { var type = $(this).data('type'); @@ -181,7 +161,7 @@ layui.use(['table', 'form'], function () { }); var active = { reload: function () { - table.reload('lay-table', { + table.reload('menuTable', { page: { curr: 1 //重新从第一页开始 }, @@ -201,7 +181,7 @@ layui.use(['table', 'form'], function () { * 标记已读 */ function batchRead() { - if (checkList.length == 0) { + if (checkList.length === 0) { return layer.msg("请勾选要标记已读的数据", {icon: 2, time: 2000}); } else { var data = { @@ -216,7 +196,7 @@ function batchRead() { data: JSON.stringify(data), dataType: 'json', success: function (data) { - if (data.resMsg = '删除成功') { + if (data.resMsg === '删除成功') { layer.msg('标记已读成功'); window.location.reload(); } else { @@ -231,7 +211,7 @@ function batchRead() { * 批量删除 */ function batchDel() { - if (checkList.length == 0) { + if (checkList.length === 0) { return layer.msg("请勾选要批量删除的数据", {icon: 2, time: 2000}); } else { var data = { @@ -245,7 +225,7 @@ function batchDel() { data: JSON.stringify(data), dataType: 'json', success: function (data) { - if (data.resMsg = '删除成功') { + if (data.resMsg === '删除成功') { layer.msg('删除成功'); window.location.reload(); } else { @@ -256,19 +236,6 @@ function batchDel() { } } - -/** - * 构建对象 - * @param id - * @param value - */ -function setCheckUNData(id, value) { - var obj = {}; - obj.id = id; - obj.value = value; - return obj; -} - //自定义方法,根据值去移除 function removeByValue(arr, val) { for (var i = 0; i < arr.length; i++) { diff --git a/src/main/resources/static/pages/work/newSubApply/contractorModuleList.html b/src/main/resources/static/pages/work/newSubApply/contractorModuleList.html index 058c247..a7f3096 100644 --- a/src/main/resources/static/pages/work/newSubApply/contractorModuleList.html +++ b/src/main/resources/static/pages/work/newSubApply/contractorModuleList.html @@ -55,19 +55,17 @@