195 lines
6.7 KiB
Plaintext
195 lines
6.7 KiB
Plaintext
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
|
<%@ page import="com.sipai.tools.SessionManager"%>
|
|
<%
|
|
SessionManager sessionManager = new SessionManager();
|
|
%>
|
|
<!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 = top.ext.modalDialog({
|
|
title : '添加设备',
|
|
width : 600,
|
|
height : 500,
|
|
resizable:true,
|
|
url : ext.contextPath + '/equipment/equipmentmaintain/add.do',
|
|
buttons : [{
|
|
text : '保存',
|
|
handler : function() {
|
|
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
|
}
|
|
}]
|
|
});
|
|
}
|
|
var viewFun = function(id) {
|
|
grid.datagrid('clearChecked');
|
|
var dialog = parent.ext.modalDialog({
|
|
title : '设备信息',
|
|
url : ext.contextPath + '/equipment/equipmentmaintain/view.do?id=' + id,
|
|
});
|
|
dialog.dialog({
|
|
onClose:function(){
|
|
grid.datagrid('reload');
|
|
}
|
|
});
|
|
};
|
|
var editFun = function(id) {
|
|
var dialog = parent.ext.modalDialog({
|
|
title : '编辑设备',
|
|
url : ext.contextPath + '/equipment/equipmentmaintain/edit.do?id=' + id,
|
|
buttons : [ {
|
|
text : '保存',
|
|
handler : function() {
|
|
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
|
}
|
|
} ]
|
|
});
|
|
};
|
|
var deleteFun = function(id) {
|
|
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
|
if (r) {
|
|
$.post(ext.contextPath + '/equipment/equipmentmaintain/delete.do', {id : id}, function(data) {
|
|
if(data==1){
|
|
parent.$.messager.alert('提示','删除成功','info',function(){
|
|
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/equipmentmaintain/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');
|
|
}
|
|
});
|
|
}
|
|
});
|
|
}
|
|
};
|
|
$(function() {
|
|
grid = $('#grid').datagrid({
|
|
title : '',
|
|
url : ext.contextPath + '/equipment/equipmentmaintain/getlist.do',
|
|
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 : 'equipmentcode', sortable : true, halign:'center'},
|
|
{width : '80', title : '设备名称', field : 'equipmentname', sortable : true, halign:'center'},
|
|
{width : '80', title : '设备型号', field : 'equipmentmodel', sortable : true, halign:'center'},
|
|
{width : '80', title : '设备类型', field: 'equipmentclassid', sortable : true, halign:'center' },
|
|
{width : '80', title : '存放位置', field: 'areaid', sortable : true, halign:'center'},
|
|
{width : '50', title : '状态', field: 'currentmanageflag', sortable : true, halign:'center'},
|
|
{width : '80', title : '维修者', field : 'mancaption', sortable : true, halign:'center'},
|
|
{width : '160', title : '维修描述', field : 'describe', sortable : true, halign:'center'},
|
|
{width : '100', title : '维修时间', field : 'time', sortable : true, halign:'center'},
|
|
{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,"equipment/equipmentmaintain/edit.do")) {%>
|
|
str += '<img class="iconImg ext-icon-table_edit" title="编辑" onclick="editFun(\''+row.id+'\');"/>';
|
|
<%}%>
|
|
<%if (sessionManager.havePermission(session,"equipment/equipmentmaintain/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);
|
|
}
|
|
});
|
|
|
|
});
|
|
|
|
</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,"equipment/equipmentmaintain/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,"equipment/equipmentmaintain/delete.do")) {%>
|
|
<td>
|
|
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true"
|
|
onclick="deletesFun();">删除</a>
|
|
</td>
|
|
<%}%>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<form id="searchForm">
|
|
<table>
|
|
<tr>
|
|
<td>设备名称</td>
|
|
<td><input name="search_name" class="easyui-textbox" style="width: 180px;" /></td>
|
|
<td>设备类型</td>
|
|
<td><input name="search_class" class="easyui-textbox" style="width: 180px;" /></td></tr>
|
|
<tr>
|
|
<td>维修日期</td>
|
|
<td><input name="search_time" class="easyui-textbox" style="width: 180px;" /></td>
|
|
<td>维修者</td>
|
|
<td><input name="search_maintenanceman" class="easyui-textbox" style="width: 180px;" /></td>
|
|
<td>
|
|
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
|
onclick="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>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</table>
|
|
</div>
|
|
|
|
</table>
|
|
<div data-options="region:'center',fit:true,border:false">
|
|
<table id="grid" data-options="fit:true,border:false"></table>
|
|
</div>
|
|
</body>
|
|
</html> |