first commit
This commit is contained in:
150
WebRoot/jsp/maintenance/defectListView.jsp
Normal file
150
WebRoot/jsp/maintenance/defectListView.jsp
Normal file
@ -0,0 +1,150 @@
|
||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
||||
<%@page import="com.sipai.entity.maintenance.MaintenanceDetail"%>
|
||||
<%@page import="com.sipai.entity.maintenance.MaintenanceCommString"%>
|
||||
<%request.setAttribute("Status_Start",MaintenanceDetail.Status_Start);%>
|
||||
<%request.setAttribute("Status_Finish",MaintenanceDetail.Status_Finish);%>
|
||||
|
||||
<%request.setAttribute("MAINTENANCE_TYPE_REPAIR",MaintenanceCommString.MAINTENANCE_TYPE_REPAIR);%>
|
||||
<%request.setAttribute("MAINTENANCE_TYPE_OVERHAUL",MaintenanceCommString.MAINTENANCE_TYPE_OVERHAUL);%>
|
||||
<%request.setAttribute("MAINTENANCE_TYPE_MAINTAIN",MaintenanceCommString.MAINTENANCE_TYPE_MAINTAIN);%>
|
||||
<style type="text/css">
|
||||
.select2-container .select2-selection--single{
|
||||
height:34px;
|
||||
line-height: 34px;
|
||||
}
|
||||
.select2-selection__arrow{
|
||||
margin-top:3px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
|
||||
var viewDetailFun = function(id) {
|
||||
$.post(ext.contextPath + '/maintenance/showMaintenanceDetailView.do', {id:id} , function(data) {
|
||||
$("#subDetailDiv").html(data);
|
||||
openModal('maintenanceDetailModal');
|
||||
});
|
||||
};
|
||||
|
||||
$(function() {
|
||||
|
||||
$("#table").bootstrapTable({ // 对应table标签的id
|
||||
url: ext.contextPath + '/maintenance/getDefectList.do', // 获取表格数据的url
|
||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||
striped: true, //表格显示条纹,默认为false
|
||||
pagination: true, // 在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||||
pageSize: 10, // 页面数据条数
|
||||
pageNumber: 1, // 首页页码
|
||||
sidePagination: 'server', // 设置为服务器端分页
|
||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||
return {
|
||||
rows: params.limit, // 每页要显示的数据条数
|
||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||
sort: params.sort, // 要排序的字段
|
||||
order: params.order,
|
||||
ids : '${ids}'
|
||||
}
|
||||
},
|
||||
sortName: 'id', // 要排序的字段
|
||||
sortOrder: 'desc', // 排序规则
|
||||
onClickRow:function(row){
|
||||
viewDetailFun(row.id);
|
||||
},
|
||||
columns: [
|
||||
/*{
|
||||
checkbox: true, // 显示一个勾选框
|
||||
},{
|
||||
field: 'companyName', // 返回json数据中的name
|
||||
title: '厂区', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' ,
|
||||
formatter:function(value,row,index){
|
||||
//新数据直接保存维护公司信息,老数据只含有运维信息
|
||||
if(row.company!=null){
|
||||
return row.company.name;
|
||||
}else if(row.maintenance!=null){
|
||||
return row.maintenance.company.name;
|
||||
}else{
|
||||
return "--";
|
||||
}
|
||||
|
||||
}
|
||||
}, */ {
|
||||
field: 'problemcontent', // 返回json数据中的name
|
||||
title: '问题描述', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle' // 上下居中
|
||||
}, {
|
||||
field: 'insdt', // 返回json数据中的name
|
||||
title: '发起时间', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle',
|
||||
formatter:function(value,row,index){
|
||||
return value.substring(0,19);
|
||||
}
|
||||
},{
|
||||
field: 'type', // 返回json数据中的name
|
||||
title: '类型', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter:function(value,row,index){
|
||||
switch (value) {
|
||||
case '${MAINTENANCE_TYPE_REPAIR}':
|
||||
return '缺陷';
|
||||
case '${MAINTENANCE_TYPE_OVERHAUL}':
|
||||
return '检修';
|
||||
case '${MAINTENANCE_TYPE_MAINTAIN}':
|
||||
return '保养';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
}
|
||||
},{
|
||||
field: 'status', // 返回json数据中的name
|
||||
title: '问题状态', // 表格表头显示文字
|
||||
align: 'center', // 左右居中
|
||||
valign: 'middle', // 上下居中
|
||||
formatter:function(value,row,index){
|
||||
if(value == '${Status_Start}' && row.type == '${TYPE_SUPPLEMENT}'){
|
||||
return '处理中';
|
||||
}else if(value == '${Status_Start}'){
|
||||
return '已下发';
|
||||
}else if(value == '${Status_Finish}'){
|
||||
return '已完成';
|
||||
}else{
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
onLoadSuccess: function(){ //加载成功时执行
|
||||
adjustBootstrapTableView("table");
|
||||
console.info("加载数据成功");
|
||||
},
|
||||
onLoadError: function(){ //加载失败时执行
|
||||
console.info("加载数据失败");
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
});
|
||||
</script>
|
||||
<div class="modal fade" id="subModal">
|
||||
<div class="modal-dialog">
|
||||
<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">
|
||||
<table id="table"></table>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<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