safesite/safesite/templates/missdetail.html

101 lines
3.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 class="easyui-layout" id="result" style="width:100%;height:100%"></div>
<script type="text/html" id="text">
{% verbatim %}
<div id='southdiv' data-options="region:'south'" style="height:50px;text-align:center;padding:5px">
<a id="exportwsword" onclick="exportwsword()" class="easyui-linkbutton" data-options="iconCls: 'fa-download'">导出</a>
<a iconCls="fa-close" class="easyui-linkbutton" onclick="closeForm()">关闭</a>
</div>
<div data-options="region:'center'" style="height:100%;padding:15px 15px;">
<div class="labeldiv">事件概况</div>
<table class='detailtable'>
<tr>
<td>事件编号{{missnum}}</td>
<td>填报时间{{submittime| dateFormat 'yyyy-MM-dd hh:mm:ss'}}</td>
</tr>
<tr>
<td style="width:50%">发生部门{{misspart__partname}}</td>
<td style="width:50%">当事人{{misser__name}}</td>
</tr>
<tr>
<td>发生时间{{misstime| dateFormat 'yyyy-MM-dd hh:mm:ss'}}</td>
<td>发生地点{{missplace}}</td>
</tr>
<tr>
<td colspan="2">简要描述:{{description}}</td>
</tr>
</table>
<div class="labeldiv">现场照片</div>
<table class='detailtable'>
<tr>
{{each missimg value index}}
<td><img onclick='bigger(this)' class='tp' width="200" height="200" src='{{value}}' /></td>
{{/each}}
</tr>
</table>
<div class="labeldiv">其他</div>
<table class='detailtable'>
<tr>
<td colspan="2">防范措施:{{prevent}}</td>
</tr>
<tr>
<td colspan="2">经验教训:{{lesson}}</td>
</tr>
</table>
</div>
{% endverbatim %}
</script>
<script type="text/javascript" src="/static/safesite/mystatic/js/template-web.js"></script>
<script>
var html;
var state;
var missid = {{ missid }};
template.defaults.imports.dateFormat = function (date, format) {
date = new Date(date);
var map = {
"M": date.getMonth() + 1, //月份
"d": date.getDate(), //日
"h": date.getHours(), //小时
"m": date.getMinutes(), //分
"s": date.getSeconds(), //秒
"q": Math.floor((date.getMonth() + 3) / 3), //季度
"S": date.getMilliseconds() //毫秒
};
format = format.replace(/([yMdhmsqS])+/g, function (all, t) {
var v = map[t];
if (v !== undefined) {
if (all.length > 1) {
v = '0' + v;
v = v.substr(v.length - 2);
}
return v;
}
else if (t === 'y') {
return (date.getFullYear() + '').substr(4 - all.length);
}
return all;
});
return format;
};
template.defaults.imports.gfilename = function(value){
x = value.split('/').pop();
return x;
}
$.ajax({
type: "get",
url: "api/miss?a=detail",
data: { missid: missid },
async: false, // ajax同步使用false
success: function (data) {
html = template('text', data);
state = data.state;
}
});
$('#result').html(html);
function exportwsword() {
let url = 'api/miss?a=exportword&id='+missid
$('<form method="post" action="' + url + '"></form>').appendTo('body').submit().remove();
}
</script>