safesite/safesite/templates/riskactchose.html

68 lines
2.9 KiB
HTML

<div class="easyui-layout" style="width:100%;height:100%;">
<div id="riskactbar" style="padding:5px;height:auto">
<div>
<form id="searchriskactff">
<label>区域</label>
<input class="easyui-combotree" name="area" data-options="
url: 'api/area?a=tree',
method: 'get',
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;
},"/>
<a onclick="searchriskact()" class="easyui-linkbutton" data-options="iconCls: 'fa-search',plain:true">查询</a>
</form>
</div>
</div>
<table id="riskacttable" style="height:100%;"></table>
</div>
<script>
var area = {{area}};
var url = 'api/riskact?a=listall&type=396&area='+area
$('#riskacttable').datagrid({
url: url,
singleSelect:true,
rownumbers: true,
fitColumns: true,
striped: true,
method: 'get',
toolbar: '#riskactbar',
pagination: 'true',
pageSize: 20,
columns: [[
// { field: 'ck', checkbox:true },
{ field: 'id', title: 'ID', hidden: true },
{ field: 'area__name', title: '区域', width: 100 },
{ field: 'type__dickeyname', title: '类型', width: 80 },
{ field: 'name', title: '名称', width: 100 },
{ field: 'level', title: '级别', width: 80 , styler: function (value, row, index) {
switch (value) {
case '低风险': return 'background-color:blue;color:white'; break;
case '一般风险': return 'background-color:yellow;'; break;
case '较大风险': return 'background-color:orange;'; break;
case '重大风险': return 'background-color:red;color:white'; break;
}
}},
{ field: 'gkcj', title: '层级', width: 80 },
{ field: 'zrbm__partname', title: '责任部门', width: 80 },
{ field: 'zrr__name', title: '责任人', width: 80 },
{ field: 'group__groupname', title: '岗位', width: 100 },
]],
onSelect: function (index, data) {
$('#fxdspan').css('color','blue')
$('#fxdspan').html(' '+data.name)
$('#fxdinput').val(data.id)
closeForm()
}})
function searchriskact(){
var querydata = $('#searchriskactff').serializeJSON();
$('#riskacttable').datagrid('load',querydata);
}
</script>