风险整改分析

This commit is contained in:
cwchen 2024-12-09 16:49:17 +08:00
parent a62228bb64
commit f82390f946
4 changed files with 321 additions and 28 deletions

View File

@ -0,0 +1,59 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="../../js/layui-v2.9.2/layui/css/layui.css">
<link rel="stylesheet" href="../../css/font.css">
<link rel="stylesheet" href="../../css/table-common2.css">
<script src="../../js/public/jquery-3.6.0.js" type="text/javascript"></script>
<script src="../../js/public/public.js" type="text/javascript"></script>
<script src="../../js/public/permission.js" type="text/javascript"></script>
<script src="../../js/public/sm3.js" type="text/javascript"></script>
<script src="../../js/layui-v2.9.2/layui/layui.js"></script>
<script src="../../js/public/commonUtils.js"></script>
<script src="../../js/public/aes.js"></script>
<title>风险整改分析</title>
<style>
.layui-inline button {
width: auto;
height: auto;
font-size: 15px;
}
</style>
</head>
<body>
<div id="content">
<div class="basic-search-box layout">
<form class="layui-form basic-form" onclick="return false;">
<div class="layui-form-item">
<div class="layui-inline keyWord">
<label class="layui-form-label" style="width: 80px;">工程名称:</label>
<div class="layui-input-inline">
<input type="text" id="proName" class="layui-input" autocomplete="off" placeholder="工程名称">
</div>
</div>
<div class="layui-inline btns">
<button class="layui-btn layui-bg-blue" onclick="queryTable(1)"><i class="layui-icon"></i>
</button>
<button class="layui-btn layui-btn-primary" onclick="queryTable(2)"><i
class="layui-icon layui-icon-refresh"></i> 重 置</button>
</div>
</div>
</form>
</div>
<div class="table-box" table-responsive style="z-index: 1;">
<table id="currTable" class="table" lay-filter="currTable"></table>
<div id="voi-page" class="layout"></div>
</div>
</div>
</body>
<style>
.layui-table-init {
background-color: transparent !important;
}
</style>
<script src="../../js/supplement/risk_rect_list.js"></script>
</html>

View File

@ -380,4 +380,39 @@ function setValue2(value) {
return '';
}
return value;
}
/* 公共请求 */
function ajaxRequest(url, type, data, async, beforeFn, successFn, errorFn, contentType) {
$.ajax({
url: url,
type: type,
headers: {
"authorization": token,
},
data: data,
async: async,
beforeSend: beforeFn,
contentType: contentType || "application/x-www-form-urlencoded; charset=utf-8",
success: function (data) {
if (data.code === 401) {
logout(1);
}
successFn(data);
},
error: function (error) {
errorFn(error)
}
});
}
/* 请求错误 */
function errorFn(xhr, status, error) {
if (xhr.status === 0) {
// 网络连接失败
console.error("网络连接失败,请检查网络是否正常");
} else {
// 请求出现其他错误
console.error("ajax请求错误" + error);
}
}

View File

@ -8,30 +8,21 @@ layui.use(['form', 'layer', 'table', 'laydate'], function () {
pages(1, 10, 1);
})
/* 加载表格 */
function pages(pageNum, pageSize, typeNum) {
let params = getReqParams(pageNum, pageSize, typeNum);
$.ajax({
headers: {
"encrypt": sm3(JSON.stringify(params))
},
url: dataUrl + "proteam/pot/proVio/getDutyPersonList?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 () {
let url = dataUrl + "proteam/pot/proVio/getDutyPersonList";
ajaxRequest(url, "POST", params, true, function () {
}, function (result) {
if (result.code === 200) {
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 })
}
});
}, function (xhr, status, error) {
errorFn(xhr, status, error)
}, null);
}
function laypages(total, page, limit) {
@ -98,7 +89,7 @@ function initTable(dataList, limit, page) {
unresize: true,
align: "center",
templet: function (d) {
return '<p>'+transformNull(d.workManager)+'</p><p>'+transformNull(d.workManagerPhone)+'</p>';
return '<p>' + transformNull(d.workManager) + '</p><p>' + transformNull(d.workManagerPhone) + '</p>';
}
},
{
@ -214,10 +205,4 @@ function queryTable(type) {
}
pageNum = 1;
pages(1, limitSize)
}
// 关闭页面
function closePage() {
let index = parent.layer.getFrameIndex(window.name); //先得到当前 iframe层的索引
parent.layer.close(index); //再执行关闭
}

View File

@ -0,0 +1,214 @@
let form, layer, table, laydate, tableIns, user = getUser(), tableHeight;
let pageNum = 1, limitSize = 10; // 默认第一页分页数量为10
layui.use(['form', 'layer', 'table', 'laydate'], function () {
form = layui.form;
layer = layui.layer;
table = layui.table;
laydate = layui.laydate;
pages(1, 10, 1);
})
/* 加载表格 */
function pages(pageNum, pageSize, typeNum) {
let params = getReqParams(pageNum, pageSize, typeNum);
let url = dataUrl + "proteam/pot/proVio/getDutyPersonList";
ajaxRequest(url, "POST", params, true, function () {
}, function (result) {
if (result.code === 200) {
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 })
}
}, function (xhr, status, error) {
errorFn(xhr, status, error)
}, null);
}
function laypages(total, page, limit) {
layui.use(['laypage'], function () {
let laypage = layui.laypage;
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) {
let loadingMsg = layer.msg("数据加载中,请稍候...", { icon: 16, scrollbar: false, time: 0, });
tableIns = table.render({
id: 'currTable',
elem: "#currTable",
height: 'full-130',
data: dataList,
limit: limit,
cols: [
[
{
title: "序号",
width: '5%',
unresize: true,
align: "center",
templet: function (d) {
return (page - 1) * limit + d.LAY_NUM;
}
},
{
field: "ticketNo",
title: "作业票编号",
width: '10%',
unresize: true,
align: "center",
style: 'word-break: break-all'
},
{
field: "proName",
title: "工程名称",
width: '15%',
unresize: true,
align: "center",
style: 'word-break: break-all'
},
{
field: "workManager",
title: "班组长",
width: '10%',
unresize: true,
align: "center",
templet: function (d) {
return '<p>' + transformNull(d.workManager) + '</p><p>' + transformNull(d.workManagerPhone) + '</p>';
}
},
{
field: "riskLevel",
title: "风险等级",
width: '10%',
unresize: true,
align: "center",
templet: function (d) {
return setRiskLevelColor(d.riskLevel);
}
},
{
field: "org",
title: "违章单位",
width: '10%',
unresize: true,
align: "center",
},
{
field: "type",
title: "违章类型",
width: '10%',
unresize: true,
align: "center",
},
{
field: "childType",
title: "违章子类型",
width: '10%',
unresize: true,
align: "center",
},
{
field: "levelId",
title: "违章等级",
width: '10%',
unresize: true,
align: "center",
templet: function (d) {
if (d.levelId === '严重违章') {
return '<span style="color: #ff5d5d;">' + d.levelId + '</span>';
}
return '<span>' + d.levelId + '</span>';
}
},
{
field: "content",
title: "违章内容",
width: '10%',
unresize: true,
align: "center",
templet: function (d) {
if (d.content) {
if (d.content.length > 60) {
return '<span title="' + d.content + '">' + d.content.substring(0, 60) + '...</span>'
} else {
return '<span title="' + d.content + '">' + d.content + '</span>'
}
} else {
return '';
}
}
}
],
],
done: function (res, curr, count) {
layer.close(loadingMsg);
table.resize("currTable");
count || this.elem.next(".layui-table-view").find(".layui-table-header").css("display", "inline-block");
count || this.elem.next(".layui-table-view").find(".layui-table-box").css("overflow", "auto");
},
});
}
// 获取参数
function getReqParams(page, limit, type) {
let obj = {};
if (!type) {
obj = {
page: page + "",
limit: limit + "",
proName: $('#proName').val(),
currentUserId: user.userId + '',
isSup: user.isSup,
currentUserOrgId: user.orgId
};
} else {
obj = {
page: '1',
limit: '10',
proName: '',
currentUserId: user.userId + '',
isSup: user.isSup,
currentUserOrgId: user.orgId
};
}
return obj;
}
// 查询/重置
function queryTable(type) {
if (type === 2) {
$('#proName').val('');
}
let pattern = new RegExp("[%_<>]");
if (pattern.test($("#proName").val())) {
$("#proName").val('');
return layer.msg('关键字查询包含特殊字符,请重新输入', {
icon: 2,
time: 2000 //2秒关闭如果不配置默认是3秒
});
}
pageNum = 1;
pages(1, limitSize)
}
// 关闭页面
function closePage() {
let index = parent.layer.getFrameIndex(window.name); //先得到当前 iframe层的索引
parent.layer.close(index); //再执行关闭
}