151 lines
6.3 KiB
HTML
151 lines
6.3 KiB
HTML
<table id="wstable" style="width:auto;height:100%;"></table>
|
|
<a id="downa" href="" target="_blank" style="display:none"></a>
|
|
<div id="wstablebar" style="padding: 4px;">
|
|
<div >
|
|
<label>快捷查询</label>
|
|
<select id='kjcxws' style='width:150px'>
|
|
<option value="">请选择</option>
|
|
<option value="listself">我的未遂</option>
|
|
<option value="listall">全部未遂</option>
|
|
</select>
|
|
<a onclick="javascript:$('#sdg_ws').dialog('open')" class="easyui-linkbutton" data-options="iconCls: 'fa-search',plain:true">详细筛选</a>
|
|
</div>
|
|
<div >
|
|
{% load myfilter %}
|
|
{% if request|has_permission:'b_miss_add' %}
|
|
<a id="addmiss" class="easyui-linkbutton" onclick="addmiss()" data-options="iconCls: 'fa-plus',plain:true">新增</a>
|
|
{% endif %}
|
|
{% if request|has_permission:'b_miss_del' %}
|
|
<a id="delmiss" class="easyui-linkbutton" onclick="delmiss()" data-options="iconCls: 'fa-trash',plain:true">删除</a>
|
|
{% endif %}
|
|
{% if request|has_permission:'b_miss_detail' %}
|
|
<a id="wsdetail" onclick="wsdetail()" class="easyui-linkbutton" data-options="iconCls: 'fa-info-circle',plain:true">查看详情</a>
|
|
{% endif %}
|
|
{% if request|has_permission:'b_miss_exportxls' %}
|
|
<a id="exportwsexcel" onclick="exportwsexcel()" class="easyui-linkbutton" data-options="iconCls: 'fa-download',plain:true">导出Excel</a>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<div id="sdg_ws" class="easyui-dialog" title="筛选条件" style="width:400px;height:300px;"
|
|
data-options="iconCls:'fa-search',resizable:true,modal:true,closed:true,border:false">
|
|
<div class="easyui-layout" style="width:100%;height:100%;">
|
|
<div data-options="region:'center'" style="height:100%;text-align:center">
|
|
<form id='searchwsff'>
|
|
<div style="margin-top:6px"><label>发生部门</label><input id="sfsbm" name="fsbm" style="width:300px;"
|
|
editable=false /></div>
|
|
<div style="margin-top:6px"><label>起始时间</label><input name='qssj' id='qssjgc' style="width:300px"
|
|
class="easyui-datebox" editable=false></div>
|
|
<div style="margin-top:6px"><label>结束时间</label><input name='jssj' id='jssjgc' style="width:300px"
|
|
class="easyui-datebox" editable=false></div>
|
|
</form>
|
|
</div>
|
|
<div id='southdiv' data-options="region:'south'" style="height:46px;text-align:center;padding:6px">
|
|
<a id="wssearch" onclick="wssearch()" class="easyui-linkbutton" data-options="iconCls: 'fa-search'">查询</a>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script>
|
|
$(function(){
|
|
var option = $('#main').attr('value')
|
|
$('#wstable').datagrid({url:'api/miss',queryParams:{a:option}});
|
|
$("#searchwsff").form('clear');
|
|
})
|
|
$("#sfsbm").combotree({
|
|
url: 'parthandle?a=tree',
|
|
editable: false,
|
|
loadFilter: function (rows) {
|
|
return convert(rows);
|
|
},
|
|
formatter: function (node) {
|
|
var s = node.text;
|
|
if (node.children) {
|
|
s += ' <span style=\'color:blue\'>(' + node.children.length + ')</span>';
|
|
}
|
|
return s;
|
|
},
|
|
});
|
|
$('#kjcxws').combobox({
|
|
editable:false,
|
|
onSelect: function (node) {
|
|
if(node.value != 0){
|
|
$('#wstable').datagrid({url:'api/miss',queryParams:{a:node.value}});
|
|
}
|
|
}
|
|
});
|
|
function wssearch() {
|
|
var querydata = $('#searchwsff').serializeJSON();
|
|
querydata['a'] = 'listsearch'
|
|
$("#sdg_ws").dialog("close");
|
|
$('#wstable').datagrid('load',querydata);
|
|
}
|
|
$('#wstable').datagrid({
|
|
url: '',
|
|
rownumbers: true,
|
|
singleSelect: true,
|
|
striped: true,
|
|
fitColumns: true,
|
|
method: 'get',
|
|
pagination: 'true',
|
|
pageSize: 20,
|
|
toolbar: '#wstablebar',
|
|
border:false,
|
|
columns: [[
|
|
{ field: 'missid', title: 'ID', hidden: true },
|
|
{ field: 'missnum', title: '编号', width: 150 },
|
|
{ field: 'missplace', title: '发生地点', width: 80 },
|
|
{ field: 'misstime', title: '发生时间', width: 200 },
|
|
{ field: 'description', title: '简要描述', width: 400 },
|
|
]]
|
|
});
|
|
function addmiss(){
|
|
opendg('新增未遂事件','misshtml/add')
|
|
}
|
|
function delmiss(){
|
|
var row = $('#wstable').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) {
|
|
$("#wstable").datagrid('reload');
|
|
}
|
|
else {
|
|
$.messager.alert('提示', '你无权删除该条未遂事件!');
|
|
}
|
|
},
|
|
complete: function (XMLHttpRequest, textStatus) {
|
|
},
|
|
error: function () {
|
|
}
|
|
});
|
|
}
|
|
});
|
|
|
|
}
|
|
else {
|
|
$.messager.alert('提示', '请选择一行数据!');
|
|
}
|
|
}
|
|
function wsdetail(){
|
|
var row = $('#wstable').datagrid('getSelected');
|
|
if (row) {
|
|
var url = 'misshtml/detail/' + row.missid
|
|
opendg('查看详情',url)
|
|
}
|
|
else { $.messager.alert('提示', '请选择一行数据!'); }
|
|
}
|
|
function exportwsexcel() {
|
|
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> |