275 lines
9.5 KiB
Plaintext
275 lines
9.5 KiB
Plaintext
|
|
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||
|
|
<%@ page import="com.sipai.tools.SessionManager"%>
|
||
|
|
<%
|
||
|
|
SessionManager sessionManager = new SessionManager();
|
||
|
|
%>
|
||
|
|
|
||
|
|
<%String contextPath = request.getContextPath();%>
|
||
|
|
<%request.setAttribute("Flag_Weekplan",com.sipai.entity.equipment.MaintenancePlan.Flag_Weekplan);%>
|
||
|
|
<%request.setAttribute("Flag_Monthplan",com.sipai.entity.equipment.MaintenancePlan.Flag_Monthplan);%>
|
||
|
|
<%request.setAttribute("Flag_Yearplan",com.sipai.entity.equipment.MaintenancePlan.Flag_Yearplan);%>
|
||
|
|
|
||
|
|
|
||
|
|
<!DOCTYPE html>
|
||
|
|
<html>
|
||
|
|
<head>
|
||
|
|
<title></title>
|
||
|
|
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||
|
|
<script type="text/javascript">
|
||
|
|
var grid;
|
||
|
|
var addFun = function() {
|
||
|
|
var dialog = parent.ext.modalDialog({
|
||
|
|
title : '添加周保养计划',
|
||
|
|
url : ext.contextPath + '/equipment/maintenanceplan/add.do',
|
||
|
|
buttons : [ {
|
||
|
|
text : '保存',
|
||
|
|
handler : function() {
|
||
|
|
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||
|
|
}
|
||
|
|
} ]
|
||
|
|
});
|
||
|
|
};
|
||
|
|
var viewFun = function(id) {
|
||
|
|
var dialog = parent.ext.modalDialog({
|
||
|
|
title : '查看周保养计划',
|
||
|
|
url : ext.contextPath + '/equipment/maintenanceplan/view.do?id=' + id
|
||
|
|
});
|
||
|
|
};
|
||
|
|
var editFun = function(id) {
|
||
|
|
var dialog = parent.ext.modalDialog({
|
||
|
|
title : '编辑周保养计划',
|
||
|
|
url : ext.contextPath + '/equipment/maintenanceplan/edit.do?id=' + id,
|
||
|
|
buttons : [ {
|
||
|
|
text : '保存',
|
||
|
|
handler : function() {
|
||
|
|
dialog.find('iframe').get(0).contentWindow.doupdate(dialog, grid);
|
||
|
|
}
|
||
|
|
} ]
|
||
|
|
});
|
||
|
|
};
|
||
|
|
|
||
|
|
var deleteFun = function(id) {
|
||
|
|
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||
|
|
if (r) {
|
||
|
|
$.post(ext.contextPath + '/equipment/maintenanceplan/delete.do', {id : id}, function(data) {
|
||
|
|
if(data==1){
|
||
|
|
parent.$.messager.alert('提示','删除成功','info');
|
||
|
|
grid.datagrid('reload');
|
||
|
|
}else{
|
||
|
|
parent.$.messager.alert('提示','删除失败','info');
|
||
|
|
}
|
||
|
|
});
|
||
|
|
}
|
||
|
|
});
|
||
|
|
};
|
||
|
|
var deletesFun = function() {
|
||
|
|
var checkedItems = $('#grid').datagrid('getChecked');
|
||
|
|
var datas="";
|
||
|
|
$.each(checkedItems, function(index, item){
|
||
|
|
datas+=item.id+",";
|
||
|
|
});
|
||
|
|
//alert(datas);
|
||
|
|
if(datas==""){
|
||
|
|
top.$.messager.alert('提示', '请先选择要删除的记录','info');
|
||
|
|
}else{
|
||
|
|
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||
|
|
if (r) {
|
||
|
|
$.post(ext.contextPath + '/equipment/maintenanceplan/deletes.do', {ids:datas} , function(data) {
|
||
|
|
if(data>0){
|
||
|
|
parent.$.messager.alert('提示','成功删除'+data+'条记录','info',function(){
|
||
|
|
grid.datagrid('reload');
|
||
|
|
grid.datagrid('clearChecked');
|
||
|
|
});
|
||
|
|
}else{
|
||
|
|
parent.$.messager.alert('提示','删除失败','info');
|
||
|
|
}
|
||
|
|
});
|
||
|
|
}
|
||
|
|
});
|
||
|
|
}
|
||
|
|
};
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
var importFun = function() {
|
||
|
|
var dialog = parent.ext.modalDialog({
|
||
|
|
title : '选择文件',
|
||
|
|
width: 600,
|
||
|
|
height:300,
|
||
|
|
closeOnEscape:true,
|
||
|
|
url : ext.contextPath + '/equipment/maintenanceplan/doimport.do',
|
||
|
|
buttons : [ {
|
||
|
|
text : '导入数据',
|
||
|
|
handler : function() {
|
||
|
|
dialog.find('iframe').get(0).contentWindow.doimport(dialog, grid);
|
||
|
|
}
|
||
|
|
} ]
|
||
|
|
});
|
||
|
|
};
|
||
|
|
|
||
|
|
var flag=0;
|
||
|
|
$(function() {
|
||
|
|
grid = $('#grid').datagrid({
|
||
|
|
title : '',
|
||
|
|
url : ext.contextPath + '/equipment/maintenanceplan/getlist.do',
|
||
|
|
queryParams: {
|
||
|
|
search_plantype: $('#search_plantype').combobox('getValue'),
|
||
|
|
},
|
||
|
|
striped : true,
|
||
|
|
rownumbers : true,
|
||
|
|
pagination : true,
|
||
|
|
singleSelect: false,
|
||
|
|
ctrlSelect: true,
|
||
|
|
selectOnCheck: false,
|
||
|
|
checkOnSelect: false,
|
||
|
|
idField : 'id',
|
||
|
|
pageSize : 50,
|
||
|
|
pageList : [ 20, 50, 100],
|
||
|
|
columns : [ [
|
||
|
|
{checkbox:true , field : 'ck'},
|
||
|
|
{width : '100', title : '保养计划类型', field : 'plantype', sortable : true, halign:'center',formatter : function(value, row, index) {
|
||
|
|
switch (value) {
|
||
|
|
case '0':
|
||
|
|
return '周计划';
|
||
|
|
case '1':
|
||
|
|
return '月计划';
|
||
|
|
case '2':
|
||
|
|
return '年计划';
|
||
|
|
}
|
||
|
|
}},
|
||
|
|
{width : '120', title : '保养计划编号', field : 'plannumber', sortable : true, halign:'center', formatter : function(value, row){
|
||
|
|
if(value!=null){
|
||
|
|
return value;
|
||
|
|
}else{
|
||
|
|
return "";
|
||
|
|
}
|
||
|
|
}},
|
||
|
|
{width : '220', title : '保养计划内容', field : 'plancontent', sortable : true, halign:'center', formatter : function(value, row){
|
||
|
|
if(value!=null){
|
||
|
|
return value;
|
||
|
|
}else{
|
||
|
|
return "";
|
||
|
|
}
|
||
|
|
}},
|
||
|
|
|
||
|
|
|
||
|
|
{width : '140', title : '计划执行时间', field : 'plantime', sortable : true, align:'center', formatter : function(value, row){
|
||
|
|
if(value!=null){
|
||
|
|
return value.substring(5,19);
|
||
|
|
}else{
|
||
|
|
return "";
|
||
|
|
}
|
||
|
|
}},
|
||
|
|
|
||
|
|
|
||
|
|
{width : '80', title : '备注', field : 'remark', sortable : true, halign:'center', formatter : function(value, row){
|
||
|
|
if(value!=null){
|
||
|
|
return value;
|
||
|
|
}else{
|
||
|
|
return "";
|
||
|
|
}
|
||
|
|
}},
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
{title : '操作', field : 'action', width : '120', halign:'center', align:'center', formatter : function(value, row) {
|
||
|
|
var str = '';
|
||
|
|
str += '<img class="iconImg ext-icon-table" title="查看" onclick="viewFun(\''+row.id+'\');"/>';
|
||
|
|
<%if (sessionManager.havePermission(session,"material/materialinfo/edit.do")) {%>
|
||
|
|
str += '<img class="iconImg ext-icon-table_edit" title="编辑" onclick="editFun(\''+row.id+'\');"/>';
|
||
|
|
<%}%>
|
||
|
|
<%if (sessionManager.havePermission(session,"material/materialinfo/delete.do")) {%>
|
||
|
|
str += '<img class="iconImg ext-icon-table_delete" title="删除" onclick="deleteFun(\''+row.id+'\');"/>';
|
||
|
|
<%}%>
|
||
|
|
return str;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
] ],
|
||
|
|
toolbar : '#toolbar',
|
||
|
|
onLoadSuccess : function(data) {
|
||
|
|
$('.iconImg').attr('src', ext.pixel_0);
|
||
|
|
},
|
||
|
|
});
|
||
|
|
/* <td><a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-table_save',plain:true" onclick="downFun();">模版下载</a></td>
|
||
|
|
<td><a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-table_add',plain:true" onclick="importFun();">导入</a></td>
|
||
|
|
<td><a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-table_go',plain:true" onclick="exportFun();">全部导出</a></td>
|
||
|
|
<td><a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-table_go',plain:true" onclick="exportByIdFun();">指定导出</a></td>*/
|
||
|
|
});
|
||
|
|
</script>
|
||
|
|
</head>
|
||
|
|
<body class="easyui-layout" data-options="fit:true,border:false">
|
||
|
|
<div id="toolbar" style="display: none;">
|
||
|
|
<table>
|
||
|
|
<tr>
|
||
|
|
<td>
|
||
|
|
<table>
|
||
|
|
<tr>
|
||
|
|
<%if (sessionManager.havePermission(session,"material/materialinfo/add.do")) {%>
|
||
|
|
<td>
|
||
|
|
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
|
||
|
|
onclick="addFun();">添加</a>
|
||
|
|
</td>
|
||
|
|
<%}%>
|
||
|
|
<%if (sessionManager.havePermission(session,"material/materialinfo/delete.do")) {%>
|
||
|
|
<td>
|
||
|
|
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true"
|
||
|
|
onclick="deletesFun();">删除</a>
|
||
|
|
</td>
|
||
|
|
<%}%>
|
||
|
|
<td><div class="datagrid-btn-separator"></div></td>
|
||
|
|
|
||
|
|
<td><a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-table_add',plain:true" onclick="importFun();">导入保养计划</a></td>
|
||
|
|
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
<tr>
|
||
|
|
<td>
|
||
|
|
<form id="searchForm">
|
||
|
|
<input id="id" name="pid" type="hidden" value="${maintenanceplan.id }" />
|
||
|
|
<table class="tooltable">
|
||
|
|
<tr>
|
||
|
|
<td >保养计划类型</td>
|
||
|
|
<td colspan='1'><select id="search_plantype" name="search_plantype" class="easyui-combobox" style="width:152px;">
|
||
|
|
<option value='weekplan' select>周计划</option>
|
||
|
|
<option value='monthplan'>月计划</option>
|
||
|
|
<option value='yearplan'>年计划</option>
|
||
|
|
|
||
|
|
</select>
|
||
|
|
</td>
|
||
|
|
<td>保养计划编号</td>
|
||
|
|
<td><input name="search_plannumber" class="easyui-textbox" /></td></tr>
|
||
|
|
<tr>
|
||
|
|
|
||
|
|
<td>计划执行时间</td>
|
||
|
|
<td><input id="plantime" name="plantime" class="Wdate" value="${maintenanceplan.plantime }"
|
||
|
|
onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',minDate:'#F{$dp.$D(\'plantime\')}'})"
|
||
|
|
readonly></td>
|
||
|
|
<%-- <td>——</td>
|
||
|
|
<td><input id="realtime" name="realtime" class="Wdate" value="${weekmaintenance.realtime }"
|
||
|
|
onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',minDate:'#F{$dp.$D(\'plantime\')}'})"
|
||
|
|
readonly></td> --%>
|
||
|
|
|
||
|
|
<td><a href="javascript:void(0);" class="easyui-linkbutton"
|
||
|
|
data-options="iconCls:'ext-icon-search',plain:true"
|
||
|
|
onclick="$('#pid').val('${maintenanceplan.id }');grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
|
||
|
|
<a href="javascript:void(0);" class="easyui-linkbutton"
|
||
|
|
data-options="iconCls:'icon-reload',plain:true"
|
||
|
|
onclick="$('#searchForm').form('clear');grid.datagrid('load',{});">重置</a>
|
||
|
|
<!-- <a href="javascript:void(0);" class="easyui-linkbutton" -->
|
||
|
|
<!-- data-options="iconCls:'ext-icon-search',plain:true" -->
|
||
|
|
<!-- onclick="$('#searchForm').form('clear');ddvpid='';grid.datagrid('load',{});">全部计划</a> -->
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
</form>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
<div data-options="region:'center',fit:true,border:false">
|
||
|
|
<table id="grid" data-options="fit:true,border:false"></table>
|
||
|
|
</div>
|
||
|
|
</body>
|
||
|
|
</html>
|