safesite/safesite/templates/riskactcheck.html

129 lines
5.4 KiB
HTML

<table id="riskactchecktable" style="width:auto;height:100%;"></table>
<a id="downa" href="" target="_blank" style="display:none"></a>
<div id="riskactchecktablebar" style="padding:6px;height:auto">
<!-- <div style="margin-bottom:2px;margin-top:2px">
<a id="delriskactcheck" class="easyui-linkbutton" onclick="delriskactcheck()" data-options="iconCls: 'fa-trash',plain:true">删除</a>
<a id="exportriskcheckexcel" onclick="exportriskcheckexcel()" class="easyui-linkbutton" data-options="iconCls: 'fa-download',plain:true">导出Excel</a>
</div> -->
<div>
<form id='searchriskactcheckff'>
<label>排查部门</label>
<input id="spcbm" name="pcbm" style="width:180px;"
editable=false />
<label>排查人</label>
<input id="pcr" name="user__name" style="width:180px;" class="easyui-textbox"/>
<label>起始时间</label><input name='qssj' style="width:180px"
class="easyui-datebox" editable=false>
<label>结束时间</label><input name='jssj' style="width:180px"
class="easyui-datebox" editable=false>
<a onclick="searchriskcheck()" class="easyui-linkbutton" data-options="iconCls: 'fa-search',plain:true">查询</a>
<a id="checkdetail" onclick="checkdetail()" class="easyui-linkbutton" data-options="iconCls: 'fa-info-circle',plain:true">查看详情</a>
</form>
</div>
</div>
<script>
function checkdetail(){
var row = $('#riskactchecktable').datagrid('getSelected');
if (row) {
var url = `html/riskacttask/${row.id}/`
opendg('查看详情',url,1000)
}
else { $.messager.alert('提示', '请选择一行数据!'); }
}
$("#spcbm").combotree({
url: 'parthandle?a=tree',
editable: false,
loadFilter: function (rows) {
return convert(rows);
},
formatter: function (node) {
var s = node.text;
if (node.children) {
s += '&nbsp;<span style=\'color:blue\'>(' + node.children.length + ')</span>';
}
return s;
},
});
function searchriskcheck() {
var querydata = $('#searchriskactcheckff').serializeJSON();
$('#riskactchecktable').datagrid('load',querydata);
}
$('#riskactchecktable').datagrid({
url: 'api/riskacttask?a=listall',
rownumbers: true,
singleSelect: true,
striped: true,
fitColumns: true,
method: 'get',
pagination: 'true',
pageSize: 20,
toolbar: '#riskactchecktablebar',
border:false,
columns: [[
{ field: 'id', title: 'ID', hidden: true },
{ field: 'riskact__name', title: '风险点', width: 100 },
{ field: 'riskact__area__name', title: '所属区域', width: 80 },
{ field: 'user__ubelongpart__partname', title: '排查部门', width: 100 },
{ field: 'user__name', title: '排查人', width: 80 },
{ field: 'taskdo', title: '排查时间', width: 80 },
{ field: 'state', title: '风险点状态', width: 80,formatter: function (value, row, index) {
if(value==1){
return '正常';
}else{
return '异常';
}
}, styler: function (value, row, index) {
if(value==1){
return 'color:green;font-weight:bold';
}else{
return 'color:red;font-weight:bold';
}}},
{ field: 'istask', title: '是否任务派发', width: 50,formatter: function (value, row, index) {
if(value==1){
return '是';
}else{
return '否';
}
}},
]]
});
function delriskactcheck(){
var row = $('#riskactchecktable').datagrid('getSelected');
if (row) {
$.messager.confirm('提示', '确定删除吗?', function (r) {
if (r) {
$.ajax({
type: "GET",
url: 'api/miss?a=del',
data: { 'missid': row.missid },
datatype: "json",
beforeSend: function () { },
success: function (data) {
if (data.code == 1) {
$("#riskactchecktable").datagrid('reload');
}
else {
$.messager.alert('提示', '你无权删除该条未遂事件!');
}
},
complete: function (XMLHttpRequest, textStatus) {
},
error: function () {
}
});
}
});
}
else {
$.messager.alert('提示', '请选择一行数据!');
}
}
function exportriskcheckexcel() {
var querydata = $('#searchwsff').serializeJSON();
console.log(querydata)
let url = 'api/miss?a=exportexcel&'+parseParams(querydata)
$('<form method="post" action="' + url + '"></form>').appendTo('body').submit().remove();
}
</script>