safesite/safesite/templates/observedetail.html

133 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 class="easyui-layout" id="result" style="width:100%;height:100%"></div>
<script type="text/html" id="text">
{% verbatim %}
<div data-options="region:'south'" id='southdiv' style="height:50px;text-align:center;padding:5px">
<a id="exportgcword" onclick="exportgcword()" 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>观察编号{{looknum}}</td>
<td>填报时间{{submittime| dateFormat 'yyyy-MM-dd hh:mm'}}</td>
</tr>
<tr>
<td style="width:50%">所属部门{{lookpart__partname}}</td>
<td>观察人{{looker__name}}</td>
</tr>
<tr>
<td colspan="2">参与/陪同人{{lookers}}</td>
</tr>
<tr>
<td>开始时间{{looktime| dateFormat 'yyyy-MM-dd hh:mm'}}</td>
<td>结束时间{{looktime2| dateFormat 'yyyy-MM-dd hh:mm'}}</td>
</tr>
<tr>
<td>观察地点{{lookplace}}</td>
<td>被观察人员:{{lookeder}}</td>
</tr>
<tr>
<td colspan="2">作业名称:{{actname}}</td>
</tr>
<tr>
<td colspan="2">过程及交流记录:{{otherunsafe}}</td>
</tr>
<tr>
<td colspan="2">共识和改进:{{safecontent}}</td>
</tr>
</table>
<div class="labeldiv">现场照片</div>
<table class='detailtable'>
<tr>
{{each lookimg value index}}
<td><img onclick='bigger(this)' class='tp' width="180" height="180" src='{{value}}' /></td>
{{/each}}
</tr>
</table>
<div class="labeldiv">观察记录</div>
<table class='detailtable'>
<thead>
<tr>
<th style="width:20%">
类别
</th>
<th style="width:80%">
描述
</th>
</tr>
</thead>
{{each gcnr}}
<tr>
<td>{{$value.unsafedicclass__dicname}}</td>
<td>{{$value.unsafedickey__dickeyname}}</td>
</tr>
{{/each}}
</table>
</div>
{% endverbatim %}
</script>
<script type="text/javascript" src="/static/safesite/mystatic/js/template-web.js"></script>
<script>
var html;
var state;
var lookid = {{ lookid }};
var gcdata
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: "gchandle?a=detail",
data: { lookid: lookid },
async: false, // ajax同步使用false
success: function (data) {
html = template('text', data);
state = data.state;
gcdata = data
}
});
$('#result').html(html);
function exportgcword(){
$.ajax({
type: "post",
url: "gchandle?a=exportword",
contentType:'application/json; charset=utf-8',
data: JSON.stringify(gcdata),
success: function (data) {
window.open(data.downloadurl);
}
});
}
</script>