承包商页面按钮修改,消息中心按钮修改

This commit is contained in:
tqzhang 2024-03-11 17:06:20 +08:00
parent 30c40198f5
commit 1ad50338ef
2 changed files with 21 additions and 59 deletions

View File

@ -7,7 +7,6 @@ layui.use(['table', 'form'], function () {
let table = layui.table; let table = layui.table;
let form = layui.form; let form = layui.form;
$("#auditResult").append("<option>111</option>")
form.render(); form.render();
//表格初始化 //表格初始化
table.render({ table.render({
@ -21,31 +20,30 @@ layui.use(['table', 'form'], function () {
, cellMinWidth: 80 //全局定义常规单元格的最小宽度layui 2.2.1 新增 , cellMinWidth: 80 //全局定义常规单元格的最小宽度layui 2.2.1 新增
, cols: [[ , cols: [[
//normal常规列无需设定、checkbox复选框列、space空列、numbers序号列 //normal常规列无需设定、checkbox复选框列、space空列、numbers序号列
{type: 'checkbox', title: '复选框',field: 'allCheck'}//序号列 {type: 'checkbox', title: '复选框', field: 'allCheck'}//序号列
, {type: 'numbers', title: '序号', width: "10%"}//序号列 , {type: 'numbers', title: '序号', width: "10%"}//序号列
, { , {
field: 'messageTheme', title: '消息内容', width: "60%", style: 'text-align: left', templet: d => { field: 'messageTheme', title: '消息内容', width: "60%", style: 'text-align: left', templet: d => {
let text = ""; let text;
if (d.status === "1" || d.status === 1) { if (d.status === "1" || d.status === 1) {
text = "<span style='margin-left: 3px; text-align: left;'>"+d.messageTheme+"</span>"; text = "<span style='margin-left: 3px; text-align: left;'>" + d.messageTheme + "</span>";
} else { } else {
text = "<span class='layui-badge-dot'></span><span style='margin-left: 3px; text-align: left;'>"+d.messageTheme+"</span>"; text = "<span class='layui-badge-dot'></span><span style='margin-left: 3px; text-align: left;'>" + d.messageTheme + "</span>";
} }
return text; return text;
} }
} }
, { , {
field: 'auditResult', title: '审核状态', templet: d => { field: 'auditResult', title: '审核状态', templet: d => {
let text = ""; let text;
let message = d.messageTheme; let message = d.messageTheme;
if (d.auditResult === "1") { if (d.auditResult === "1") {
text = "<span style='color:#70e070;cursor: pointer;' >通过</span>"; text = "<span style='color:#70e070;cursor: pointer;' >通过</span>";
} else if(d.auditResult === "2"){ } else if (d.auditResult === "2") {
text = "<span style='color:orange;cursor: pointer;' >待审核</span>"; text = "<span style='color:orange;cursor: pointer;' >待审核</span>";
} } else {
else {
text = "<span style='color:#ce2332;cursor: pointer;' >未通过</span>"; text = "<span style='color:#ce2332;cursor: pointer;' >未通过</span>";
if (message.indexOf("撤回") > 0){ if (message.indexOf("撤回") > 0) {
text = "<span style='color:#928c8d;cursor: pointer;' >已撤回</span>"; text = "<span style='color:#928c8d;cursor: pointer;' >已撤回</span>";
} }
} }
@ -63,7 +61,7 @@ layui.use(['table', 'form'], function () {
$('tr[data-index=' + i + '] input[type="checkbox"]').prop('disabled', true); $('tr[data-index=' + i + '] input[type="checkbox"]').prop('disabled', true);
state = "1";// 隐藏表头全选判断状态 state = "1";// 隐藏表头全选判断状态
form.render();// 重新渲染一下 form.render();// 重新渲染一下
}else { } else {
allCheckList.push(item.messageId); allCheckList.push(item.messageId);
allNameList.push(item.nameId); allNameList.push(item.nameId);
} }
@ -100,11 +98,11 @@ layui.use(['table', 'form'], function () {
//checkbox 点击事件 //checkbox 点击事件
table.on('checkbox(table-temp)', function (obj) { table.on('checkbox(table-temp)', function (obj) {
var is_all= obj.type === 'all' ? true : false;//是否全选 var is_all = obj.type === 'all';//是否全选
if (is_all) { if (is_all) {
checkList = allCheckList; checkList = allCheckList;
nameList = allNameList; nameList = allNameList;
}else { } else {
if (obj.checked === true) { if (obj.checked === true) {
checkList.push(obj.data.messageId) checkList.push(obj.data.messageId)
nameList.push(obj.data.nameId) nameList.push(obj.data.nameId)
@ -120,7 +118,7 @@ layui.use(['table', 'form'], function () {
table.on('toolbar(table-temp)', obj => { table.on('toolbar(table-temp)', obj => {
switch (obj.event) { switch (obj.event) {
case "searchBt": case "searchBt":
oldYear = $("#auditResult").val(); oldYear = $('#auditResult').val();
table.reload('menuTable', { table.reload('menuTable', {
url: ctxPath + '/subIndex/getMsgContent' url: ctxPath + '/subIndex/getMsgContent'
, method: 'post' //方式默认是get , 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) { function updateTableData(type, id) {
$('#' + id + '').on('click', function () { $('#' + id + '').on('click', function () {
var type = $(this).data('type'); var type = $(this).data('type');
@ -181,7 +161,7 @@ layui.use(['table', 'form'], function () {
}); });
var active = { var active = {
reload: function () { reload: function () {
table.reload('lay-table', { table.reload('menuTable', {
page: { page: {
curr: 1 //重新从第一页开始 curr: 1 //重新从第一页开始
}, },
@ -201,7 +181,7 @@ layui.use(['table', 'form'], function () {
* 标记已读 * 标记已读
*/ */
function batchRead() { function batchRead() {
if (checkList.length == 0) { if (checkList.length === 0) {
return layer.msg("请勾选要标记已读的数据", {icon: 2, time: 2000}); return layer.msg("请勾选要标记已读的数据", {icon: 2, time: 2000});
} else { } else {
var data = { var data = {
@ -216,7 +196,7 @@ function batchRead() {
data: JSON.stringify(data), data: JSON.stringify(data),
dataType: 'json', dataType: 'json',
success: function (data) { success: function (data) {
if (data.resMsg = '删除成功') { if (data.resMsg === '删除成功') {
layer.msg('标记已读成功'); layer.msg('标记已读成功');
window.location.reload(); window.location.reload();
} else { } else {
@ -231,7 +211,7 @@ function batchRead() {
* 批量删除 * 批量删除
*/ */
function batchDel() { function batchDel() {
if (checkList.length == 0) { if (checkList.length === 0) {
return layer.msg("请勾选要批量删除的数据", {icon: 2, time: 2000}); return layer.msg("请勾选要批量删除的数据", {icon: 2, time: 2000});
} else { } else {
var data = { var data = {
@ -245,7 +225,7 @@ function batchDel() {
data: JSON.stringify(data), data: JSON.stringify(data),
dataType: 'json', dataType: 'json',
success: function (data) { success: function (data) {
if (data.resMsg = '删除成功') { if (data.resMsg === '删除成功') {
layer.msg('删除成功'); layer.msg('删除成功');
window.location.reload(); window.location.reload();
} else { } 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) { function removeByValue(arr, val) {
for (var i = 0; i < arr.length; i++) { for (var i = 0; i < arr.length; i++) {

View File

@ -55,19 +55,17 @@
<script type="text/javascript" src="../../../js/select.js"></script> <script type="text/javascript" src="../../../js/select.js"></script>
<script type="text/javascript" src="../../../js/work/newSub/contractorModuleList.js" defer="defer"></script> <script type="text/javascript" src="../../../js/work/newSub/contractorModuleList.js" defer="defer"></script>
<script type="text/html" id="toolsBar"> <script type="text/html" id="toolsBar">
<a lay-event="details" style="color: #009688;cursor: pointer;font-size: 16px">详情</a>
<!-- {{# if(d.auditStatus !== null && d.auditStatus !== 'null' && d.auditStatus !== ''){ }}-->
<!-- <a lay-event="approvalProcess" style="color: #009688;cursor: pointer;font-size: 16px">流程</a>--> {{# if(d.auditStatus == '2'){ }}
<!-- {{# } }}--> <a lay-event="details" style="color: #009688;cursor: pointer;font-size: 16px">详情</a>
{{# } }}
<!-- <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>--> <!-- <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>-->
<!-- 条件待确认--> <!-- 条件待确认-->
{{# if((d.auditStatus === null || d.auditStatus === 'null' || d.auditStatus === '') && (d.proName !== null && d.proName !== 'null' && d.proName !== '')){ }} {{# if((d.auditStatus === null || d.auditStatus === 'null' || d.auditStatus === '') && (d.proName !== null && d.proName !== 'null' && d.proName !== '')){ }}
<span> | </span>
<a lay-event="edit" style="color: #009688;cursor: pointer;font-size: 16px">编辑</a> <a lay-event="edit" style="color: #009688;cursor: pointer;font-size: 16px">编辑</a>
{{# } }} {{# } }}
{{# if((d.proName === null || d.proName === 'null' || d.proName === '') && (d.subStatus == '2')){ }} {{# if((d.proName === null || d.proName === 'null' || d.proName === '') && (d.subStatus == '2')){ }}
<span> | </span>
<a lay-event="update" style="color: #009688;cursor: pointer;font-size: 16px">分包修改</a> <a lay-event="update" style="color: #009688;cursor: pointer;font-size: 16px">分包修改</a>
{{# } }} {{# } }}
<!-- {{# if((d.proName === null || d.proName === 'null' || d.proName === '') && (d.subStatus !== '2')){ }}--> <!-- {{# if((d.proName === null || d.proName === 'null' || d.proName === '') && (d.subStatus !== '2')){ }}-->
@ -75,7 +73,6 @@
<!-- <a lay-event="view_sub" style="color: #009688;cursor: pointer;font-size: 16px">查看</a>--> <!-- <a lay-event="view_sub" style="color: #009688;cursor: pointer;font-size: 16px">查看</a>-->
<!-- {{# } }}--> <!-- {{# } }}-->
{{# if(d.auditStatus === '5' || d.auditStatus === '1'){ }} {{# if(d.auditStatus === '5' || d.auditStatus === '1'){ }}
<span> | </span>
<a lay-event="edit" style="color: #009688;cursor: pointer;font-size: 16px">修改</a> <a lay-event="edit" style="color: #009688;cursor: pointer;font-size: 16px">修改</a>
{{# } }} {{# } }}
<!-- {{# if(d.auditStatus === '0' || d.auditStatus === '2' || d.auditStatus === '3' || d.auditStatus === '4'){ }}--> <!-- {{# if(d.auditStatus === '0' || d.auditStatus === '2' || d.auditStatus === '3' || d.auditStatus === '4'){ }}-->
@ -84,11 +81,9 @@
<!-- {{# } }}--> <!-- {{# } }}-->
<!-- <a class="layui-btn layui-btn-xs" lay-event="recall">撤回</a>--> <!-- <a class="layui-btn layui-btn-xs" lay-event="recall">撤回</a>-->
{{# if(d.auditStatus != '' && d.auditStatus != '2' && d.auditStatus != '5' && d.auditStatus != '3'){ }} {{# if(d.auditStatus != '' && d.auditStatus != '2' && d.auditStatus != '5' && d.auditStatus != '3'){ }}
<span> | </span>
<a lay-event="recall" style="color: #E81D58;cursor: pointer;font-size: 16px">撤回</a> <a lay-event="recall" style="color: #E81D58;cursor: pointer;font-size: 16px">撤回</a>
{{# } }} {{# } }}
{{# if(d.auditStatus == '6'){ }} {{# if(d.auditStatus == '6'){ }}
<span> | </span>
<a lay-event="tempStorage" style="color: #009688;cursor: pointer;font-size: 16px">编辑</a> <a lay-event="tempStorage" style="color: #009688;cursor: pointer;font-size: 16px">编辑</a>
{{# } }} {{# } }}
<!-- {{# if(d.auditStatus == '2' && d.consApplyStatus != '2'){ }}--> <!-- {{# if(d.auditStatus == '2' && d.consApplyStatus != '2'){ }}-->