first commit
This commit is contained in:
443
WebRoot/jsp/timeefficiency/patrolRecordView.jsp
Normal file
443
WebRoot/jsp/timeefficiency/patrolRecordView.jsp
Normal file
@ -0,0 +1,443 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security" %>
|
||||
<%--<%@page import="com.sipai.entity.timeefficiency.PatrolRecord" %>--%>
|
||||
<%--<%@page import="com.sipai.entity.timeefficiency.TimeEfficiencyCommStr" %>--%>
|
||||
<% request.setAttribute("Status_Issue", com.sipai.entity.timeefficiency.PatrolRecord.Status_Issue); %>
|
||||
<% request.setAttribute("Status_Start", com.sipai.entity.timeefficiency.PatrolRecord.Status_Start); %>
|
||||
<% request.setAttribute("Status_Finish", com.sipai.entity.timeefficiency.PatrolRecord.Status_Finish); %>
|
||||
<% request.setAttribute("Status_PartFinish", com.sipai.entity.timeefficiency.PatrolRecord.Status_PartFinish); %>
|
||||
<% request.setAttribute("Status_Undo", com.sipai.entity.timeefficiency.PatrolRecord.Status_Undo); %>
|
||||
<%String contextPath = request.getContextPath();%>
|
||||
<%String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath();%>
|
||||
<%String serverPath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort();%>
|
||||
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single {
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.select2-selection__arrow {
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
.div-row {
|
||||
margin-left: 3px;
|
||||
margin-right: 3px;
|
||||
}
|
||||
|
||||
.div-border {
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.right-border {
|
||||
border-right: none;
|
||||
}
|
||||
|
||||
.top-right-border {
|
||||
border-top: none;
|
||||
border-right: none;
|
||||
}
|
||||
|
||||
.top-border {
|
||||
border-top: none;
|
||||
|
||||
}
|
||||
</style>
|
||||
|
||||
<script type="text/javascript">
|
||||
var patrolPointorEquipment = "p";
|
||||
|
||||
var tbName = 'TB_TimeEfficiency_PatrolRecord_file'; //数据表
|
||||
var nameSpace = 'patrolrecord';//保存文件夹
|
||||
var bucketName = 'patrolrecord';
|
||||
var masterId = '';
|
||||
|
||||
var previews = new Array();
|
||||
var previewConfigs = new Array();
|
||||
var previews2 = new Array();
|
||||
var previewConfigs2 = new Array();
|
||||
|
||||
var showDetailView = function (id) {
|
||||
if (${ PatrolType_Equipment == patrolRecord.type }) {
|
||||
$.post(ext.contextPath + '/timeEfficiency/patrolRecord/viewDetial_Equipment.do', {id: id}, function (data) {
|
||||
$("#subDiv_recordDetail").html(data);
|
||||
openModal('subModal_recordDetail');
|
||||
});
|
||||
} else {
|
||||
$.post(ext.contextPath + '/timeEfficiency/patrolRecord/viewDetial.do', {id: id}, function (data) {
|
||||
$("#subDiv_recordDetail").html(data);
|
||||
openModal('subModal_recordDetail');
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
var getRecordStatus = function (status) {
|
||||
switch (status) {
|
||||
case '${Status_Issue}':
|
||||
return "已下发";
|
||||
break;
|
||||
case '${Status_Start}':
|
||||
return "进行中";
|
||||
break;
|
||||
case '${Status_Finish}':
|
||||
return "已完成";
|
||||
break;
|
||||
default:
|
||||
return "";
|
||||
|
||||
}
|
||||
}
|
||||
var viewContentsFun = function (patrolRecordId, patrolPointId, unitId) {
|
||||
$.post(ext.contextPath + '/timeEfficiency/patrolContentsRecord/showPatrolPointViewContentsMeasurepoints.do', {
|
||||
patrolRecordId: patrolRecordId,
|
||||
patrolPointId: patrolPointId,
|
||||
unitId: unitId
|
||||
}, function (data) {
|
||||
$("#subDiv_contents").html(data);
|
||||
openModal('subModal_contents');
|
||||
});
|
||||
};
|
||||
var initFun = function () {
|
||||
//日期格式需对齐,不然会不准
|
||||
$("#table_patrolPoint").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/timeEfficiency/patrolPoint/getPatrolPointForRecord.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||
pageSize: 50, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'client', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
patrolRecordId: '${patrolRecord.id}'
|
||||
}
|
||||
},
|
||||
responseHandler: function (res) {
|
||||
return res.result
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
columns: [
|
||||
{
|
||||
field: 'name', // 返回json数据中的name
|
||||
title: '巡检点名称', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '26%',
|
||||
formatter: function (value, row, index) {
|
||||
if (row.patrolPoint != null && row.patrolPoint != '') {
|
||||
return row.patrolPoint.name;
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'finishNumContent', // 返回json数据中的name
|
||||
title: '巡检内容', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
formatter: function (value, row, index) {
|
||||
return row.finishNumContent + "/" + row.allNumContent;
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'finishNumMeasurePoint', // 返回json数据中的name
|
||||
title: '填报内容', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
formatter: function (value, row, index) {
|
||||
return row.finishNumMeasurePoint + "/" + row.allNumMeasurePoint;
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'abnormityNum', // 返回json数据中的name
|
||||
title: '异常数量', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '8%',
|
||||
formatter: function (value, row, index) {
|
||||
if (row.abnormityNum != null && row.abnormityNum != '' && row.abnormityNum > 0) {
|
||||
return '<span style="color:#c12e2a">' + row.abnormityNum + '</span>';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'caption', // 返回json数据中的name
|
||||
title: '打卡人员', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
formatter: function (value, row, index) {
|
||||
if (row.worker != null) {
|
||||
return row.worker.caption;
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'finishdt', // 返回json数据中的name
|
||||
title: '完成时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '18%',
|
||||
formatter: function (value, row, index) {
|
||||
return value.substring(0, 19);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'status', // 返回json数据中的name
|
||||
title: '状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
formatter: function (value, row, index) {
|
||||
var str = "";
|
||||
if ("${Status_Issue}" == value) {
|
||||
// str = '<span style="color:#c12e2a;"><i class="fa fa-times-circle-o" aria-hidden="true"></i> 已下发</span>';
|
||||
str = '<span style="color:#c12e2a;"><i class="fa fa-close" aria-hidden="true"></i>未打卡</span>';
|
||||
}
|
||||
if ("${Status_Finish}" == value) {
|
||||
// str = '<span style="color:#3e8f3e"><i class="fa fa-check-circle-o" aria-hidden="true"></i> 已完成</span>';
|
||||
str = '<span style="color:#3e8f3e"><i class="fa fa-check" aria-hidden="true"></i>已打卡</span>';
|
||||
}
|
||||
return str;
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: '8%', // 定义列的宽度,单位为像素px
|
||||
formatter: function (value, row, index) {
|
||||
var buts = '';
|
||||
if (row.patrolPoint != null && row.patrolPoint != '') {
|
||||
buts += '<button class="btn btn-default btn-sm" onclick="viewContentsFun(\'' + row.patrolRecordId + '\',\'' + row.patrolPoint.id + '\',\'' + row.patrolPoint.unitId + '\')" data-toggle="tooltip" title="查看"><i class="fa fa-eye "></i><span class="hidden-md hidden-lg"> 查看</span></button>';
|
||||
} else {
|
||||
buts += '<button class="btn btn-default btn-sm" onclick="viewContentsFun(\'' + row.patrolRecordId + '\',\'' + '' + '\',\'' + '' + '\')" data-toggle="tooltip" title="查看"><i class="fa fa-eye "></i><span class="hidden-md hidden-lg"> 查看</span></button>';
|
||||
}
|
||||
buts = '<div class = "btn-group">' + buts + '</div>';
|
||||
return buts;
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
adjustBootstrapTableView("table_patrolPoint");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
var printpage = function (myDiv) {
|
||||
var printHtml = document.getElementById(myDiv).innerHTML;
|
||||
var wind = window.open("", "newwin", "width=1550,height=565,top=80,left=80,toolbar=no,scrollbars=yes,menubar=no");
|
||||
var ss = ".coversheet-pageBoder{"
|
||||
+ " padding: 10px;"
|
||||
+ " margin-top: 10px;"
|
||||
+ " border: 1px solid gray;"
|
||||
+ " page-break-after: always;"
|
||||
+ " border-radius: 5px;"
|
||||
+ " box-shadow: 0 1px 2px 1px rgba(0,0,0,.08), 0 3px 6px rgba(0,0,0,.08);"
|
||||
+ "}"
|
||||
+ ".noprint{display: none;}"
|
||||
+ ".select2-container .select2-selection--single{ "
|
||||
+ " height:34px; "
|
||||
+ " line-height: 34px; "
|
||||
+ " }"
|
||||
+ " .select2-selection__arrow{"
|
||||
+ " margin-top:3px;"
|
||||
+ " } "
|
||||
+ " .div-row{"
|
||||
+ " margin-left:3px;"
|
||||
+ " margin-right:3px;"
|
||||
+ " }"
|
||||
+ " .div-border{"
|
||||
+ " border-style:solid;"
|
||||
+ " border-width:1px;"
|
||||
+ " text-align:center;"
|
||||
+ " }"
|
||||
+ " .right-border{"
|
||||
+ " border-right:none;"
|
||||
+ " }"
|
||||
+ " .top-right-border{"
|
||||
+ " border-top:none;"
|
||||
+ " border-right:none;"
|
||||
+ " }"
|
||||
+ " .top-border{"
|
||||
+ " border-top:none;"
|
||||
+ " }";
|
||||
|
||||
var link = document.createElement('link');
|
||||
link.type = 'text/css';
|
||||
link.rel = 'stylesheet';
|
||||
link.href = '<%=serverPath%><%=contextPath%>/plugins/bootstrap-ext/dist/bootstrap.min.css';
|
||||
wind.document.head.appendChild(link);
|
||||
|
||||
var style = document.createElement('style');
|
||||
style.type = 'text/css';
|
||||
style.rel = 'stylesheet';
|
||||
style.appendChild(document.createTextNode(ss));
|
||||
wind.document.head.appendChild(style);
|
||||
|
||||
wind.document.body.innerHTML = printHtml;
|
||||
wind.print();
|
||||
wind.close();
|
||||
};
|
||||
|
||||
/*$('#subModal').on('hide.bs.modal', function () {
|
||||
$('#subModal').modal('hide');
|
||||
});*/
|
||||
|
||||
//用于测试南市返回json
|
||||
function showJson(id) {
|
||||
$.post(ext.contextPath + '/timeEfficiency/patrolRecord/getJson4Map.do', {
|
||||
patrolRecordId: id
|
||||
}, function (data) {
|
||||
alert(data);
|
||||
// $("#subDiv_contents").html(data);
|
||||
// openModal('subModal_contents');
|
||||
});
|
||||
}
|
||||
|
||||
$(function () {
|
||||
var status = getRecordStatus('${patrolRecord.status}')
|
||||
$('#status').text(status)
|
||||
initFun();
|
||||
|
||||
//初始化文件显示
|
||||
getFileListMinioPic('patrolRecordFileId', 'view', '${patrolRecord.id}', previews2, previewConfigs2);
|
||||
})
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">记录详情</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 新增界面formid强制为subForm -->
|
||||
<form class="form-horizontal" id="subForm">
|
||||
<div id="alertDiv"></div>
|
||||
<input id="id" name="id" type="hidden" value="${patrolRecord.id}"/>
|
||||
<!-- 界面提醒div强制id为alertdiv -->
|
||||
<!-- <div class="form-group">
|
||||
<label class="col-sm-2 control-label">*工艺段</label>
|
||||
<div class="col-sm-10">
|
||||
<select class="form-control select2" id="processSectionId" name ="processSectionId" style="width: 270px;">
|
||||
</select>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">名称</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${patrolRecord.name}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">所属厂区</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${patrolRecord.unit.name}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group ">
|
||||
<label class="control-label col-sm-2">发单人</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${patrolRecord.sendUser.caption}</p>
|
||||
</div>
|
||||
<label class="control-label col-sm-2">完成人</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${patrolRecord.worker.caption}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">计划开始时间</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${patrolRecord.startTime.substring(0,16)}</p>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">计划结束时间</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${patrolRecord.endTime.substring(0,16)}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group ">
|
||||
<label class="control-label col-sm-2">执行状态</label>
|
||||
<div class="col-sm-4">
|
||||
<p id="status" class="form-control-static"></p>
|
||||
</div>
|
||||
<label class="control-label col-sm-2">实际完成时间</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${patrolRecord.actFinishTime.substring(0,16)}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">巡检内容</label>
|
||||
<div class="col-sm-10">
|
||||
<p class="form-control-static">${patrolRecord.content}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group ">
|
||||
<label class="control-label col-sm-2">执行反馈</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${patrolRecord.workResult}</p>
|
||||
</div>
|
||||
<label class="control-label col-sm-2">工时(分钟)</label>
|
||||
<div class="col-sm-4">
|
||||
<p class="form-control-static">${patrolRecord.duration}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">巡检图片</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="file" name="patrolRecordFileId" id="patrolRecordFileId"
|
||||
class="file-loading"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">巡检情况</h3>
|
||||
|
||||
<!-- <div class="box-tools pull-right">
|
||||
<a onclick="doEditPatrolPoint()" class="btn btn-box-tool" data-toggle="tooltip" title="编辑"><i class="glyphicon glyphicon-edit"></i></a>
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
<div class="box-body ">
|
||||
<table id="table_patrolPoint"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<%-- <button type="button" class="btn btn-primary" onclick="showJson('${patrolRecord.id}')">json</button>--%>
|
||||
<%-- <button type="button" class="btn btn-default hidden-sm hidden-md" onclick="printpage('subForm');"><i class="fa fa-print"></i>打印</button>--%>
|
||||
|
||||
<security:authorize buttonUrl="timeEfficiency/patrolRecord/editRouteFun.do">
|
||||
<button type="button" class="btn btn-primary hidden-sm hidden-md"
|
||||
onclick="showDetailView('${patrolRecord.id}')">详情
|
||||
</button>
|
||||
</security:authorize>
|
||||
|
||||
<button type="button" class="btn btn-default " data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
Reference in New Issue
Block a user