safesite/safesite/templates/taskdo.html

61 lines
2.7 KiB
HTML

<div class="easyui-layout" style="width:100%;height:100%;" title="任务列表">
<!-- <div data-options="region:'west',split:true,border:false" style="width:50%;height:100%;" title="任务列表"> -->
<table id="risktasktable" style="height:100%;"></table>
<!-- </div> -->
<!-- <div data-options="region:'center',title:'执行情况',split:true,border:false" style="width:50%;height:100%;">
<table id="tasktable" style="height:100%;"></table>
</div> -->
</div>
<script>
$('#risktasktable').datagrid({
url: 'api/riskacttask?a=listalltask',
singleSelect:true,
rownumbers: true,
fitColumns: true,
striped: true,
method: 'get',
pagination: 'true',
pageSize: 20,
columns: [[
{ field: 'riskact__name', title: '风险点名称', width: 80 },
{ field: 'user__name', title: '任务执行人', width: 80 },
{ field: 'riskact__area__name', title: '区域', width: 100 },
//{ field: 'num', title: '风险数量', width: 80 },
{ field: 'taskadd', title: '任务开始时间', width: 80 },
{ field: 'taskexpire', title: '任务过期时间', width: 80 },
{ field: 'usable', title: '任务状态', width: 80, 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: 80, 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>