safesite/safesite/templates/personalp.html

113 lines
4.7 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<div style=" overflow-y:auto; width:100%; height:100%">
<form id='ff' style="margin-top:20px;margin-left:10px;">
<label>查看</label>
<input class="easyui-datebox" id="startdate" name="startdate" data-options="prompt:'起始日期'"></input>
<input class="easyui-datebox" id="enddate" name="enddate" data-options="prompt:'结束日期'"></input>
<input id="username" class="easyui-textbox" readonly>
<input type="hidden" name="userid" id="userid" value="" />
<a href="#" class="easyui-linkbutton" onclick="choseuser('user')">选择员工</a>
<a href="#" class="easyui-linkbutton" onclick="startSearch();"
data-options="{ iconCls: 'fa-search', plain: true }">查询</a>
<a href="#" class="easyui-linkbutton" onclick="ExportWord();"
data-options="{ iconCls: 'fa-download', plain: true }">导出</a>
</form>
<div id="exportdiv" style="text-align: center;">
<div style="width: 90%; height: 100%; margin: 0px auto; font-size: 17px;">
<div style="width: 98%; margin: 0px auto;">
<h3 style="font-size: 18px; width: 100%; text-align: center; margin-top: 10px;">个人安全数据统计</h3>
<div style="text-align: right;" id="createdate"></div>
<p style="text-indent: 40px; padding: 5px;">
感谢您为公司的安全生产付出的一份力,以下是您的安全数据清单。时间段为:
<span id="span_timerange"></span>
</p>
</div>
<div id="troublediv">
</div>
<div id="traindiv">
</div>
<div id="riskdiv">
</div>
<div id="operationdiv">
</div>
<div id="missdiv">
</div>
<div id="suggestdiv">
</div>
<div id="testdiv">
</div>
<div id="yldiv">
</div>
<div id="xjdiv">
</div>
<div id="zsdiv">
</div>
</div>
</div>
</div>
<script type="text/javascript">
$(function () {
beginsearch({type:'trouble'});
beginsearch({type:'train'});
beginsearch({type:'operation'});
beginsearch({type:'miss'});
beginsearch({type:'suggest'});
})
function aaa(x) {
if (x == "user") {
$('#userid').attr('value', top.$('#in').val());
$('#username').textbox('setValue', top.$('#in').attr('show'));
}
}
function ExportWord(e) {
$("#exportdiv").wordExport();
}
function beginsearch(data) {
$.ajax({
type: "get",
async: true, //异步请求(同步请求将会锁住浏览器,用户其他操作必须等待请求完成才可以执行)
url: "api/countsafe/", //请求发送
data: data,
dataType: "json", //返回数据形式为json
success: function (res) {
//请求成功时执行该函数内容data即为服务器返回的json对象
if(res){
if(data.type == 'trouble'){
$('#troublediv').html('<p>共上报隐患<span style="color:red;font-weight:bold">' + res.fx_count + '</span>条, 整改隐患<span style="color:red;font-weight:bold">' + res.zg_count + '</span>条.</p>')
}
else if(data.type == 'train'){
$('#traindiv').html('<p>需参加培训<span style="color:red;font-weight:bold">' + res.px_count + '</span>场, 参加并签到<span style="color:red;font-weight:bold">' + res.qd_count + '</span>场.</p>')
}
else if(data.type == 'operation'){
$('#operationdiv').html('<p>共参与作业<span style="color:red;font-weight:bold">' + res.zy_count + '</span>场, 其中身为作业负责人<span style="color:red;font-weight:bold">' + res.zyfzr_count + '</span>场.</p>')
}
else if(data.type == 'miss'){
$('#missdiv').html('<p>共上报未遂事件<span style="color:red;font-weight:bold">' + res.ws_count + '</span>件.</p>')
}
else if(data.type == 'suggest'){
$('#suggestdiv').html('<p>共提出并被采纳的建议<span style="color:red;font-weight:bold">' + res.jy_count + '</span>条, 本人处理了<span style="color:red;font-weight:bold">' + res.jycl_count + '</span>条.</p>')
}
}
},
error: function (errorMsg) {
//请求失败时执行该函数
//alert("汗,没有数据吧!");
}
});
}
</script>