446 lines
21 KiB
Plaintext
446 lines
21 KiB
Plaintext
<%@page import="com.sipai.entity.maintenance.MaintenanceDetail" %>
|
||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
|
||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
|
||
<%@ page import="com.sipai.entity.base.ServerObject" %>
|
||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security" %>
|
||
<%String contextPath = request.getContextPath();%>
|
||
|
||
<%@ page import="com.sipai.entity.command.EmergencyPlan" %>
|
||
<%request.setAttribute("NoStart", EmergencyPlan.Status_NoStart); %>
|
||
<%request.setAttribute("Start", EmergencyPlan.Status_Start); %>
|
||
<%request.setAttribute("Finish", EmergencyPlan.Status_Finish); %>
|
||
|
||
<!DOCTYPE html>
|
||
<!-- <html lang="zh-CN"> -->
|
||
<!-- BEGIN HEAD -->
|
||
<head>
|
||
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
||
</title>
|
||
|
||
<!-- 引用页头及CSS页-->
|
||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||
<style type="text/css">
|
||
.select2-container .select2-selection--single {
|
||
height: 34px;
|
||
line-height: 34px;
|
||
}
|
||
|
||
.select2-selection__arrow {
|
||
margin-top: 3px;
|
||
}
|
||
|
||
.table-hover > tbody > tr:hover {
|
||
cursor: pointer;
|
||
}
|
||
</style>
|
||
<!-- 文件上传-->
|
||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||
<script type="text/javascript"
|
||
src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js"
|
||
charset="utf-8"></script>
|
||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js"
|
||
charset="utf-8"></script>
|
||
|
||
<%--文件上传 minio--%>
|
||
<script type="text/javascript" src="<%=request.getContextPath()%>/JS/commonFile.js" charset="utf-8"></script>
|
||
<!-- 引入daterangepicker-->
|
||
<link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.css"/>
|
||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/moment.min.js"
|
||
charset="utf-8"></script>
|
||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.js"
|
||
charset="utf-8"></script>
|
||
<script type="text/javascript">
|
||
|
||
var beginTimeStore = '';
|
||
var endTimeStore = '';
|
||
$(function () {
|
||
var locale = {
|
||
"format": 'YYYY-MM-DD',
|
||
"separator": " ~ ",
|
||
"applyLabel": "确定",
|
||
"cancelLabel": "取消",
|
||
"fromLabel": "起始时间",
|
||
"toLabel": "结束时间'",
|
||
"customRangeLabel": "自定义",
|
||
"weekLabel": "W",
|
||
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
|
||
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
|
||
"firstDay": 1
|
||
};
|
||
//定义locale汉化插件
|
||
beginTimeStore = moment().startOf('year').format('YYYY-MM-DD');
|
||
endTimeStore = moment().subtract(0, 'days').format('YYYY-MM-DD');
|
||
$('#reservoirTime').val(beginTimeStore + locale.separator + endTimeStore);
|
||
$('#reservoirTime').daterangepicker({
|
||
"timePicker": false,
|
||
"timePicker24Hour": false,
|
||
"linkedCalendars": false,
|
||
"autoUpdateInput": false,
|
||
"timePickerIncrement": 10,
|
||
"locale": locale,
|
||
//汉化按钮部分
|
||
ranges: {
|
||
'今日': [moment(), moment().subtract(-1, 'days')],
|
||
'昨日': [moment().subtract(1, 'days'), moment()],
|
||
'最近7日': [moment().subtract(6, 'days'), moment().subtract(-1, 'days')],
|
||
'本月': [moment().startOf('month'), moment().endOf('month').subtract(-1, 'days')],
|
||
'上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month').subtract(-1, 'days')]
|
||
},
|
||
startDate: beginTimeStore,
|
||
endDate: endTimeStore
|
||
}, function(start, end, label) {
|
||
beginTimeStore = start.format(this.locale.format);
|
||
endTimeStore = end.format(this.locale.format);
|
||
if(!this.startDate){
|
||
this.element.val('');
|
||
}else{
|
||
this.element.val(this.startDate.format(this.locale.format) + this.locale.separator + this.endDate.format(this.locale.format));
|
||
}
|
||
dosearch();
|
||
});
|
||
initFun();
|
||
});
|
||
|
||
var addFun = function () {
|
||
if (unitId == "") {
|
||
showAlert('d', '请先选择厂区', 'mainAlertdiv');
|
||
} else {
|
||
$.post(ext.contextPath + '/command/emergencyPlan/showConfigure.do', {unitId: unitId}, function (data) {
|
||
$("#subDivAbnorm").html(data);
|
||
openModal('selectModal');
|
||
});
|
||
}
|
||
};
|
||
|
||
var editFun = function (id) {
|
||
stopBubbleDefaultEvent();
|
||
$.post(ext.contextPath + '/command/emergencyPlan/doedit.do', {id: id}, function (data) {
|
||
$("#subDiv").html(data);
|
||
openModal('subModal');
|
||
});
|
||
};
|
||
|
||
var viewFun = function (id) {
|
||
stopBubbleDefaultEvent();
|
||
$.post(ext.contextPath + '/command/emergencyPlan/doview.do', {id: id}, function (data) {
|
||
$("#subDiv").html(data);
|
||
openModal('subModal');
|
||
});
|
||
};
|
||
|
||
var deleteFun = function (id) {
|
||
stopBubbleDefaultEvent();
|
||
swal({
|
||
text: "您确定要删除此记录?",
|
||
dangerMode: true,
|
||
buttons: {
|
||
cancel: {
|
||
text: "取消",
|
||
value: null,
|
||
visible: true,
|
||
className: "btn btn-default btn-sm",
|
||
closeModal: true,
|
||
},
|
||
confirm: {
|
||
text: "确定",
|
||
value: true,
|
||
visible: true,
|
||
className: "btn btn-danger btn-sm",
|
||
closeModal: true
|
||
}
|
||
}
|
||
})
|
||
.then(function (willDelete) {
|
||
if (willDelete) {
|
||
$.post(ext.contextPath + '/command/emergencyPlan/dodelete.do', {id: id}, function (data) {
|
||
if (data == 1) {
|
||
$("#table").bootstrapTable('refresh');
|
||
} else {
|
||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||
}
|
||
});
|
||
|
||
}
|
||
});
|
||
};
|
||
var deletesFun = function () {
|
||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||
var datas = "";
|
||
$.each(checkedItems, function (index, item) {
|
||
//进入流程的不能删除
|
||
if (item.status == null || item.status == '0' || item.status == '') {
|
||
datas += item.id + ",";
|
||
}
|
||
});
|
||
if (datas == "") {
|
||
showAlert('d', '请先选择记录', 'mainAlertdiv');
|
||
} else {
|
||
swal({
|
||
text: "您确定要删除此记录?",
|
||
dangerMode: true,
|
||
buttons: {
|
||
cancel: {
|
||
text: "取消",
|
||
value: null,
|
||
visible: true,
|
||
className: "btn btn-default btn-sm",
|
||
closeModal: true,
|
||
},
|
||
confirm: {
|
||
text: "确定",
|
||
value: true,
|
||
visible: true,
|
||
className: "btn btn-danger btn-sm",
|
||
closeModal: true
|
||
}
|
||
}
|
||
})
|
||
.then(function (willDelete) {
|
||
if (willDelete) {
|
||
$.post(ext.contextPath + '/command/emergencyPlan/dodeletes.do', {ids: datas}, function (data) {
|
||
if (data > 0) {
|
||
$("#table").bootstrapTable('refresh');
|
||
} else {
|
||
showAlert('d', '删除失败', 'mainAlertdiv');
|
||
}
|
||
});
|
||
|
||
}
|
||
});
|
||
}
|
||
};
|
||
|
||
function dodown() {
|
||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||
var datas = "";
|
||
$.each(checkedItems, function (index, item) {
|
||
//进入流程的不能删除
|
||
if (item.status == null || item.status == '0' || item.status == '') {
|
||
datas += item.id + ",";
|
||
}
|
||
});
|
||
if (datas == "") {
|
||
showAlert('d', '请先选择记录', 'mainAlertdiv');
|
||
} else {
|
||
$.post(ext.contextPath + '/command/emergencyPlan/dodown.do', {ids: datas}, function (data) {
|
||
var str = $.parseJSON(data);
|
||
if (str.result > 0) {
|
||
showAlert('s', '下发成功', 'mainAlertdiv');
|
||
$("#table").bootstrapTable('refresh');
|
||
} else {
|
||
showAlert('d', '下发失败', 'mainAlertdiv');
|
||
}
|
||
});
|
||
}
|
||
};
|
||
|
||
var dosearch = function () {
|
||
$("#table").bootstrapTable('refresh');
|
||
};
|
||
|
||
var initFun = function () {
|
||
|
||
var statusSelect = $("#statusSelect").select2({
|
||
minimumResultsForSearch: 10,
|
||
placeholder: '请选择',
|
||
}).val('${NoStart}').trigger("change");
|
||
statusSelect.on("change", function (e) {
|
||
dosearch();
|
||
});
|
||
|
||
$("#table").bootstrapTable({ // 对应table标签的id
|
||
url: ext.contextPath + '/command/emergencyPlan/getList.do', // 获取表格数据的url
|
||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||
striped: true, //表格显示条纹,默认为false
|
||
pagination: true, // 在表格底部显示分页组件,默认false
|
||
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||
pageSize: 50, // 页面数据条数
|
||
pageNumber: 1, // 首页页码
|
||
sidePagination: 'server', // 设置为服务器端分页
|
||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||
return {
|
||
rows: params.limit, // 每页要显示的数据条数
|
||
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||
sort: params.sort, // 要排序的字段
|
||
order: params.order,
|
||
search_name: $('#search_name').val(),
|
||
unitId: unitId,
|
||
pSectionId: $("#processSection").val(),
|
||
statusSelect: $("#statusSelect").val(),
|
||
sdt: beginTimeStore + " 00:00:00",
|
||
edt: endTimeStore + " 23:59:59"
|
||
}
|
||
},
|
||
onClickRow: function (row) {//单击行事件,执行查看功能
|
||
// viewFun(row.id);
|
||
},
|
||
sortName: 'insdt', // 要排序的字段
|
||
sortOrder: 'desc', // 排序规则
|
||
columns: [
|
||
{
|
||
checkbox: true,
|
||
width: '40px',
|
||
formatter: function (value, row, index) {
|
||
if (row.status == null || row.status == '0' || row.status == '') {
|
||
return {disabled: false,}
|
||
} else {
|
||
return {disabled: true,}
|
||
}
|
||
}
|
||
},
|
||
{
|
||
field: 'emergencyConfigure.name', // 返回json数据中的name
|
||
title: '预案名称', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle' // 上下居中
|
||
},
|
||
/*{
|
||
field: 'emergencyConfigure.grade', // 返回json数据中的name
|
||
title: '级别', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle' // 上下居中
|
||
},*/
|
||
{
|
||
field: 'emergencyConfigure.memo', // 返回json数据中的name
|
||
title: '总体介绍', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle' // 上下居中
|
||
},
|
||
{
|
||
field: 'emergencyConfigure.firstperson', // 返回json数据中的name
|
||
title: '总负责人', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
width: 90, // 定义列的宽度,单位为像素px
|
||
},
|
||
{
|
||
field: 'planDate', // 返回json数据中的name
|
||
title: '计划日期', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle',
|
||
width: 90, // 定义列的宽度,单位为像素px
|
||
formatter: function (value, row, index) {
|
||
return value.substring(0, 10);
|
||
}
|
||
},
|
||
{
|
||
field: 'company.name', // 返回json数据中的name
|
||
title: '所属厂区', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle' // 上下居中
|
||
},
|
||
{
|
||
field: 'status', // 返回json数据中的name
|
||
title: '状态', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
width: 70, // 定义列的宽度,单位为像素px
|
||
formatter: function (value, row, index) {
|
||
switch (value) {
|
||
case '${NoStart}':
|
||
return "未下发";
|
||
case '${Start}':
|
||
return "进行中";
|
||
case '${Finish}':
|
||
return "已完成";
|
||
default :
|
||
return value;
|
||
}
|
||
}
|
||
},
|
||
{
|
||
title: "操作",
|
||
align: 'center',
|
||
valign: 'middle',
|
||
width: 70, // 定义列的宽度,单位为像素px
|
||
formatter: function (value, row, index) {
|
||
var buts = "";
|
||
// buts += '<button class="btn btn-default btn-sm" title="修改" onclick="editFun(\'' + row.id + '\')"><i class="fa fa fa-edit"></i><span class="hidden-md hidden-lg">修改</span></button>';
|
||
buts += '<button class="btn btn-default btn-sm" title="查看" onclick="viewFun(\'' + row.emergencyConfigureId + '\')"><i class="fa 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");
|
||
|
||
},
|
||
onLoadError: function () { //加载失败时执行
|
||
console.info("加载数据失败");
|
||
}
|
||
});
|
||
}
|
||
|
||
</script>
|
||
|
||
</head>
|
||
<body class="hold-transition ${cu.themeclass} sidebar-mini">
|
||
<div class="wrapper">
|
||
<div class="content-wrapper">
|
||
<section class="content container-fluid">
|
||
<div id="mainAlertdiv"></div>
|
||
<div id="subDiv" style="width: 220px;height:10px;"></div>
|
||
<div id="subDivAbnorm"></div>
|
||
<div id="menu4SelectDiv"></div>
|
||
<div id="equ4SelectDiv"></div>
|
||
<div id="library4SelectDiv"></div>
|
||
<div id="problemTyp4SelectDiv"></div>
|
||
<div id="user4SelectDiv"></div>
|
||
<div id="fileInputDiv"></div>
|
||
<div>
|
||
<div class="form-group form-inline" style="padding:0;">
|
||
<div class="btn-group" style="width: 280px;padding-bottom:10px;">
|
||
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"><i
|
||
class="fa fa-plus"></i> 新增
|
||
</button>
|
||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i
|
||
class="fa fa-trash-o"></i> 删除
|
||
</button>
|
||
<button type="button" class="btn btn-default btn-sm" onclick="dodown();"><i
|
||
class="fa fa-paper-plane"></i> 下发
|
||
</button>
|
||
</div>
|
||
<div class="form-group pull-right form-inline hidden-xs">
|
||
<div class="form-group">
|
||
<label class="form-label">状态:</label>
|
||
<select class="form-control select2 " id="statusSelect" name="statusSelect"
|
||
style="width: 160px;">
|
||
<option value="${NoStart}">未开始</option>
|
||
<option value="${Start}">处理中</option>
|
||
<option value="${Finish}">已完成</option>
|
||
</select>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="form-label">开始时间:</label>
|
||
<div class="input-group dateSelect">
|
||
<input type="text" class="form-control" id="reservoirTime" style="width:190px">
|
||
</div><!-- /input-group -->
|
||
</div>
|
||
<div class="form-group">
|
||
<div class="input-group input-group-sm" style="width: 250px;">
|
||
<input type="text" id="search_name" name="search_name" class="form-control pull-right"
|
||
style="height:34px;" placeholder="名称">
|
||
<div class="input-group-btn">
|
||
<button class="btn btn-default" style="height:34px;" onclick="dosearch();"><i
|
||
class="fa fa-search"></i></button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<table id="table"></table>
|
||
</div>
|
||
</section>
|
||
</div>
|
||
</div>
|
||
</body>
|
||
<!-- bootstrap switch -->
|
||
<link rel="stylesheet"
|
||
href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css"/>
|
||
<script type="text/javascript"
|
||
src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js"
|
||
charset="utf-8"></script>
|
||
</html> |