100 lines
3.5 KiB
HTML
100 lines
3.5 KiB
HTML
<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="exportwzword" onclick="exportwzword()" 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>发生时间:{{happentime| dateFormat 'yyyy-MM-dd hh:mm:ss'}}</td>
|
||
<td>人员类型:{{type}}</td>
|
||
</tr>
|
||
<tr>
|
||
<td style="width:50%">区域:{{area__name}}</td>
|
||
<td style="width:50%">地点:{{place}}</td>
|
||
</tr>
|
||
<tr>
|
||
<td>车间:{{dept}}</td>
|
||
<td>岗位:{{post}}</td>
|
||
</tr>
|
||
<tr>
|
||
<td colspan="2">当事人:{{parter}}</td>
|
||
</tr>
|
||
<tr>
|
||
<td colspan="2">简要描述:{{description}}</td>
|
||
</tr>
|
||
<tr>
|
||
<td colspan="2">举报人:{{reporter__name}}</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>
|
||
{% endverbatim %}
|
||
</script>
|
||
<script type="text/javascript" src="/static/safesite/mystatic/js/template-web.js"></script>
|
||
<script>
|
||
var html;
|
||
var state;
|
||
var id = {{ id }};
|
||
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/offence?a=detail",
|
||
data: { id: id },
|
||
async: false, // ajax同步使用false
|
||
success: function (data) {
|
||
html = template('text', data);
|
||
state = data.state;
|
||
}
|
||
});
|
||
|
||
$('#result').html(html);
|
||
function exportwzword() {
|
||
let url = 'api/offence?a=exportword&id='+missid
|
||
$('<form method="post" action="' + url + '"></form>').appendTo('body').submit().remove();
|
||
}
|
||
</script> |