89 lines
4.0 KiB
HTML
89 lines
4.0 KiB
HTML
{% comment %} <div class="easyui-layout" style="width:100%;height:100%;" title="任务列表"> {% endcomment %}
|
|
<!-- <div data-options="region:'west',split:true,border:false" style="width:50%;height:100%;" title="任务列表"> -->
|
|
|
|
<!-- </div> -->
|
|
<!-- <div data-options="region:'center',title:'执行情况',split:true,border:false" style="width:50%;height:100%;">
|
|
|
|
<table id="tasktable" style="height:100%;"></table>
|
|
|
|
</div> -->
|
|
{% comment %} </div> {% endcomment %}
|
|
<table id="risktasktable" style="height:100%;"></table>
|
|
<div id="risktasktablebar" style="padding:6px;height:auto">
|
|
<div>
|
|
<form id='searchrisktaskff'>
|
|
<label>执行人</label>
|
|
<input id="zxr" 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="searchrisktask()" class="easyui-linkbutton" data-options="iconCls: 'fa-search',plain:true">查询</a>
|
|
<a id="taskdodetail" onclick="taskdodetail()" class="easyui-linkbutton" data-options="iconCls: 'fa-info-circle',plain:true">查看详情</a>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
<script>
|
|
function taskdodetail(){
|
|
var row = $('#risktasktable').datagrid('getSelected');
|
|
if (row) {
|
|
var url = `html/riskacttask/${row.id}/`
|
|
opendg('查看详情',url,1000)
|
|
}
|
|
else { $.messager.alert('提示', '请选择一行数据!'); }
|
|
}
|
|
function searchrisktask() {
|
|
var querydata = $('#searchrisktaskff').serializeJSON();
|
|
$('#risktasktable').datagrid('load',querydata);
|
|
}
|
|
$('#risktasktable').datagrid({
|
|
url: 'api/riskacttask?a=listalltask',
|
|
singleSelect:true,
|
|
rownumbers: true,
|
|
fitColumns: true,
|
|
striped: true,
|
|
method: 'get',
|
|
pagination: 'true',
|
|
pageSize: 20,
|
|
toolbar: '#risktasktablebar',
|
|
columns: [[
|
|
{ field: 'riskact__name', title: '风险点名称', width: 80 },
|
|
{ field: 'user__name', title: '任务执行人', width: 50 },
|
|
{ field: 'riskact__area__name', title: '区域', width: 60 },
|
|
//{ field: 'num', title: '风险数量', width: 80 },
|
|
{ field: 'taskadd', title: '任务开始时间', width: 80 },
|
|
{ field: 'taskexpire', title: '任务过期时间', width: 80 },
|
|
{ field: 'usable', title: '任务状态', width: 50, formatter: function (value, row, index) {
|
|
if(value==1){
|
|
return '可用'
|
|
}else if (value==0&&row.taskdo==null){
|
|
return '过期'
|
|
}else if(value==0&&row.taskdo!=null){
|
|
return ''
|
|
}else if(value==2){
|
|
return '作废'
|
|
}
|
|
}, styler: function (value, row, index) {
|
|
switch (value) {
|
|
case 1: return 'color:white;background-color:green'; break;
|
|
}}},
|
|
{ field: 'taskdo', title: '执行时间', width: 100, formatter: function (value, row, index) {
|
|
if(row.taskdo==null){
|
|
return '未执行';
|
|
}else{
|
|
return '已完成' + '-' + row.taskdo;
|
|
}
|
|
}, styler: function (value, row, index) {
|
|
if(value==null){
|
|
return 'color:red;font-weight:bold';
|
|
}else{
|
|
return 'color:green;font-weight:bold';
|
|
}}
|
|
},
|
|
|
|
]],
|
|
// onSelect: function (index, row) {
|
|
// $('#tasktable').datagrid({url:'api/risktask?a=listtask&riskact='+row.risk__riskact__id+'&group='+row.risk__group__groupid})
|
|
// }
|
|
})
|
|
</script> |