154 lines
6.7 KiB
HTML
154 lines
6.7 KiB
HTML
<table id="gctable" style="width:auto;height:100%;"></table>
|
|
<a id="downa" href="" target="_blank" style="display:none"></a>
|
|
<div id="gctablebar" style="padding: 4px;height: 40px;">
|
|
<div style="width: 360px;float: right;padding: 5px;">
|
|
<a id="addobserve" class="easyui-linkbutton" onclick="javascript:opendg('新建观察','observehtml/add')"
|
|
data-options="iconCls: 'fa-plus',plain:true">新增</a>
|
|
<a id="delobserve" class="easyui-linkbutton" onclick="delobserve()"
|
|
data-options="iconCls: 'fa-trash',plain:true">删除</a>
|
|
|
|
<a id="gcdetail" onclick="gcdetail()" class="easyui-linkbutton"
|
|
data-options="iconCls: 'fa-info-circle',plain:true">查看详情</a>
|
|
<a id="exportgcexcel" onclick="exportgcexcel()" class="easyui-linkbutton" data-options="iconCls: 'fa-download',plain:true">导出Excel</a>
|
|
</div>
|
|
<div style="padding: 5px;float: left;width: 400px;">
|
|
<label>快捷查询</label>
|
|
<select id='kjcxgc' style='width:150px'>
|
|
<option value="">请选择</option>
|
|
<option value="listself">我的观察</option>
|
|
<option value="listall">全部观察</option>
|
|
</select>
|
|
<a onclick="javascript:$('#sdg_gc').dialog('open')" class="easyui-linkbutton"
|
|
data-options="iconCls: 'fa-search',plain:true">详细筛选</a>
|
|
<!-- <a id="exportgcword" onclick="exportpxword()" class="easyui-linkbutton" data-options="iconCls: 'fa-download',plain:true">导出Word</a> -->
|
|
|
|
</div>
|
|
<div id="sdg_gc" 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='searchgcff'>
|
|
<div style="margin-top:6px"><label>观察部门</label><input id="sgcbm" name="gcbm" style="width:300px;" editable=false /></div>
|
|
<!-- <label>观察人</label><input id="sgcr" name="gcr" style="width:auto;" class="easyui-textbox" editable=false/> -->
|
|
<div style="margin-top:6px"><label>起始时间</label><input name='qssj' id='qssjgc' style="width:300px" class="easyui-datetimebox"
|
|
editable=false></div>
|
|
<div style="margin-top:6px"><label>结束时间</label><input name='jssj' id='jssjgc' style="width:300px" class="easyui-datetimebox"
|
|
editable=false></div>
|
|
</form>
|
|
</div>
|
|
<div id='southdiv' data-options="region:'south'" style="height:46px;text-align:center;padding:6px">
|
|
<a id="gcsearch" onclick="gcsearch()" class="easyui-linkbutton"
|
|
data-options="iconCls: 'fa-search'">查询</a>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
<script>
|
|
$(function () {
|
|
var option = $('#main').attr('value')
|
|
$('#gctable').datagrid({ url: 'gchandle', queryParams: { a: option } });
|
|
$("#searchgcff").form('clear');
|
|
})
|
|
$("#sgcbm").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;
|
|
},
|
|
onSelect: function (node) {
|
|
$('#sgcr').combobox({
|
|
url: 'getuser?partid=' + node.id + '&a=combobox',
|
|
});
|
|
}
|
|
});
|
|
$('#kjcxgc').combobox({
|
|
editable: false,
|
|
onSelect: function (node) {
|
|
if (node.value != 0) {
|
|
$('#gctable').datagrid({ url: 'gchandle', queryParams: { a: node.value } });
|
|
}
|
|
}
|
|
});
|
|
function gcsearch() {
|
|
var querydata = $('#searchgcff').serializeJSON();
|
|
querydata['a'] = 'listsearch'
|
|
$("#sdg_gc").dialog("close");
|
|
$('#gctable').datagrid('load', querydata);
|
|
}
|
|
$('#gctable').datagrid({
|
|
url: '',
|
|
rownumbers: true,
|
|
singleSelect: true,
|
|
striped: true,
|
|
fitColumns: true,
|
|
method: 'get',
|
|
pagination: 'true',
|
|
pageSize: 20,
|
|
toolbar: '#gctablebar',
|
|
border: false,
|
|
columns: [[
|
|
{ field: 'lookid', title: '观察ID', hidden: true },
|
|
{ field: 'looknum', title: '编号', width: 150 },
|
|
{ field: 'lookplace', title: '观察地点', width: 150 },
|
|
{ field: 'actname', title: '作业名称', width: 200 },
|
|
{ field: 'looktime', title: '观察时间', width: 200 },
|
|
{ field: 'looker__name', title: '观察记录人', width: 200 },
|
|
{ field: 'lookeder', title: '被观察对象', width: 200 },
|
|
{ field: 'otherunsafe', title: '过程和交流记录', width: 300 },
|
|
]]
|
|
});
|
|
function delobserve() {
|
|
var row = $('#gctable').datagrid('getSelected');
|
|
if (row) {
|
|
$.messager.confirm('提示', '确定删除吗?', function (r) {
|
|
if (r) {
|
|
$.ajax({
|
|
type: "GET",
|
|
url: 'gchandle?a=del',
|
|
data: { 'lookid': row.lookid },
|
|
datatype: "json",
|
|
beforeSend: function () { },
|
|
success: function (data) {
|
|
if (data.code == 1) {
|
|
$("#gctable").datagrid('reload');
|
|
}
|
|
else {
|
|
$.messager.alert('提示', '你无权删除该条行为观察!');
|
|
}
|
|
},
|
|
complete: function (XMLHttpRequest, textStatus) {
|
|
},
|
|
error: function () {
|
|
}
|
|
});
|
|
}
|
|
});
|
|
|
|
}
|
|
else {
|
|
$.messager.alert('提示', '请选择一行数据!');
|
|
}
|
|
}
|
|
function gcdetail() {
|
|
var row = $('#gctable').datagrid('getSelected');
|
|
if (row) {
|
|
var url = 'gchandle?a=detailhtml&lookid=' + row.lookid
|
|
opendg('查看详情', url)
|
|
}
|
|
else { $.messager.alert('提示', '请选择一行数据!'); }
|
|
}
|
|
function exportgcexcel() {
|
|
var querydata = $('#searchgcff').serializeJSON();
|
|
let url = 'gchandle?a=exportexcel&'+parseParams(querydata)
|
|
$('<form method="post" action="' + url + '"></form>').appendTo('body').submit().remove();
|
|
}
|
|
</script> |