safesite/safesite/templates/troubleashtml.html

192 lines
7.6 KiB
HTML

<div style="width:100%;height:5%;">
<div style="margin-left:10px;margin-top:5px">
<form id="yhbztf">
<label>起始时间</label><input id="sqssj" name="qssj" class="easyui-datebox" style="width:110px;height:22px" />
<label>结束时间</label><input id="sjssj" name="jssj" class="easyui-datebox" style="width:110px;height:22px" />
<label>发现部门</label><input id="sfxbm" name="fxbm" style="width:200px;height:22px" />
<a onclick="yhbztsearch()" class='easyui-linkbutton' iconCls='fa-search' plain=true>查询</a></form>
</div>
</div>
<div style="width:100%;height:500px;padding: 20px">
<div style="width:33%;height:80%;float: left;margin-top:20px;" align=center>
<div id="yhlbt" style="width:80%;height:100%;">
</div>
</div>
<div style="width:33%;height:80%;float: left;margin-top:20px" align=center>
<div id="yhpgt" style="width:80%;height:100%;">
</div>
</div>
<div style="width:33%;height:80%;float: left;margin-top:20px" align=center>
<div id="yhztt" style="width:80%;height:100%;">
</div>
</div>
</div>
<div id="yhqst" style="width:100%;height:400px;padding: 20px">
</div>
<div style="width: 60%; margin: 0px auto; ">
<table name="" id="fxrpmtable" class='easyui-datagrid' title="隐患发现人排名" data-options="
rownumbers:true,
singleSelect:true,
striped: true,
method:'get',
url: 'fxhandle?a=yhfxpm',
toolbar:'#fxrpmbar'" style="height:400px">
<thead>
<tr>
<th data-options="field:'fxr__userid',hidden:true">用户ID</th>
<th data-options="field:'fxr__name',align:'right'" width="30%">姓名</th>
<th data-options="field:'fxbm__partname',align:'right'" width="40%">所属部门</th>
<th data-options="field:'number',align:'right'" width="20%">填报隐患数</th>
</tr>
</thead>
</table>
<div id='fxrpmbar'>
<form id="fxrpms">
<a onclick="fxrpmsearch()" class='easyui-linkbutton' iconCls='fa-search' plain=true>查询</a>
<a onclick="fxrpmexport()" class='easyui-linkbutton' iconCls='fa-upload' plain=true>导出</a>
<div>
<label>发现部门</label><input id="sfxbm2" name="fxbm" style="width:180px;height:22px" />
<label>起始时间</label><input id="sqssj" name="qssj" class="easyui-datebox" style="width:80px;height:22px" />
<label>结束时间</label><input id="sjssj" name="jssj" class="easyui-datebox" style="width:80px;height:22px" />
<label>检查类型</label><input id="sjclx" name="jclx" class="easyui-combobox" style="width:100px;height:22px" data-options="
method: 'get',
valueField:'value',
textField:'text',
url:'getdickey?dicclass=14&a=combobox'
"/>
</div>
</form>
</div>
<div style="height:20px"></div>
<table name="" id="zgrpmtable" class='easyui-datagrid' title="隐患整改人排名" data-options="
rownumbers:true,
singleSelect:true,
striped: true,
method:'get',
url: 'fxhandle?a=yhzgpm',
toolbar:'#zgrpmbar'" style="height:400px">
<thead>
<tr>
<th data-options="field:'zgr__userid',hidden:true">用户ID</th>
<th data-options="field:'zgr__name',align:'right'" width="30%">姓名</th>
<th data-options="field:'zgbm__partname',align:'right'" width="40%">所属部门</th>
<th data-options="field:'number',align:'right'" width="20%">整改隐患数</th>
</tr>
</thead>
</table>
<div id='zgrpmbar'>
<form id="zgrpms">
<a onclick="zgrpmsearch()" class='easyui-linkbutton' iconCls='fa-search' plain=true>查询</a>
<a onclick="zgrpmexport()" class='easyui-linkbutton' iconCls='fa-upload' plain=true>导出</a>
<div>
<label>整改人</label><input class="easyui-textbox" name="zgr" style="width:80px;height:22px" />
<label>起始时间</label><input id="sqssj" name="qssj" class="easyui-datebox" style="width:80px;height:22px" />
<label>结束时间</label><input id="sjssj" name="jssj" class="easyui-datebox" style="width:80px;height:22px" />
</div>
</form>
</div>
</div>
<script>
$("#sfxbm,#sfxbm2").combotree({
url: 'parthandle?a=tree',
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;
},
onSelect: function (node) {
$('#sfxr').combobox({
url: 'getuser?partid=' + node.id + '&a=combobox',
editable: false,
});
}
});
function fxrpmsearch() {
var querydata = $('#fxrpms').serializeJSON();
$('#fxrpmtable').datagrid('load', querydata);
}
function zgrpmsearch() {
var querydata = $('#zgrpms').serializeJSON();
$('#zgrpmtable').datagrid('load', querydata);
}
function yhbztsearch() {
var querydata = $('#yhbztf').serializeJSON();
bindmap3_o('yhlbt', querydata)
bindmap4_o('yhpgt', querydata)
bindmap8('yhztt', querydata)
bindmap7('yhqst',querydata);
}
var now = new Date();
var year = now.getFullYear();
var month = now.getMonth() + 1;
bindmap3_o('yhlbt', { 'year': year, 'month': month });
bindmap4_o('yhpgt', { 'year': year, 'month': month });
bindmap7('yhqst');
bindmap8('yhztt');
function fxrpmexport() {
var data = $('#fxrpmtable').datagrid('getData');
var datalist = data.rows;
//datalist.unshift({'fxr__userid':'用户ID','fxr__name':'姓名','fxbm__partname':'部门','number':'发现隐患数'})
for (var j = 0, len = datalist.length; j < len; j++) {
var dic = datalist[j]
for (var key in dic) {
dic["姓名"] = dic["fxr__name"]
dic["部门"] = dic["fxbm__partname"]
dic["发现隐患数"] = dic["number"]
delete dic["fxr__userid"];
delete dic["fxr__name"]
delete dic["fxbm__partname"]
delete dic["number"]
}
}
JSONToCSVConvertor(JSON.stringify(datalist), "发现排名", true);
// var postdata = {
// data:JSON.stringify(datalist)
// }
// $.ajax({
// type: "POST",
// url: "fxhandle?a=exportexcel",
// data: postdata,
// success: function (data) {
// if (data.code==1) {
// downloadurl = 'http://' + window.location.host + '/' + data.downloadurl
// window.open(downloadurl);
// } else{
// $.messager.alert('提示', '导出失败!');
// }
// }
// });
}
function zgrpmexport() {
var data = $('#zgrpmtable').datagrid('getData');
var datalist = data.rows;
for (var j = 0, len = datalist.length; j < len; j++) {
var dic = datalist[j]
for (var key in dic) {
dic["姓名"] = dic["zgr__name"]
dic["部门"] = dic["zgbm__partname"]
dic["整改隐患数"] = dic["number"]
delete dic["zgr__userid"];
delete dic["zgr__name"]
delete dic["zgbm__partname"]
delete dic["number"]
}
}
JSONToCSVConvertor(JSON.stringify(datalist), "整改排名", true);
}
</script>