195 lines
6.8 KiB
Plaintext
195 lines
6.8 KiB
Plaintext
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||
<%@page import="java.util.Date" %>
|
||
<%@page import="java.text.SimpleDateFormat" %>
|
||
<%@ 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">
|
||
/* function getids(){
|
||
var rows= $('#grid').datagrid("getRows");
|
||
var ids="";
|
||
$.each(rows, function(index, item){
|
||
ids+=item.id+",";
|
||
});
|
||
ids=ids.replace(/,$/gi,"");
|
||
return ids;
|
||
}
|
||
$(function() {
|
||
grid = $('#grid').datagrid({
|
||
title : '',
|
||
url : ext.contextPath + '/equipment/maintenancerecord/getlist.do',
|
||
striped : true,
|
||
rownumbers : true,
|
||
pagination : true,
|
||
idField : 'id',
|
||
pageSize : 50,
|
||
pageList : [ 20, 50, 100],
|
||
selectOnCheck: true,
|
||
checkOnSelect: true,
|
||
columns : [ [
|
||
{checkbox:true , field : 'ck'},
|
||
{width : '80', title : '保养计划类型', field : 'plantype', sortable : true, halign:'center'},
|
||
{width : '100', title : '保养计划编号', field : 'plannumber', sortable : true, halign:'center'},
|
||
{width : '100', title : '保养计划内容', field: 'plancontent', sortable : true, halign:'center'},
|
||
{width : '80', title : '状态', field : 'condition', sortable : true, halign:'center'},
|
||
{width : '100', title : '计划执行时间', field : 'plantime', sortable : true, halign:'center'},
|
||
{width : '100', title : '实际执行时间', field: 'realtime', sortable : true, halign:'center'},
|
||
{width : '50', title : '执行描述', field: 'behaviordescription', sortable : true, halign:'center'},
|
||
{width : '50', title : '执行者', field: 'performer', sortable : true, halign:'center'},
|
||
{width : '80', title : '备注', field : 'remark', sortable : true, halign:'center'}
|
||
] ],
|
||
toolbar : '#toolbar',
|
||
onLoadSuccess : function(data) {
|
||
var ids = localStorage.getItem("ids").split(",");
|
||
|
||
localStorage.removeItem("ids");
|
||
|
||
$.each(ids, function(index, item){
|
||
if(item != ""){
|
||
$('#grid').datagrid("checkRow",$('#grid').datagrid("getRowIndex",item));
|
||
}
|
||
});
|
||
}
|
||
});
|
||
}); */
|
||
|
||
function dosave(dialog,grid) {
|
||
if ($(".form").form('validate')) {
|
||
$.post(ext.contextPath + "/equipment/maintenancerecord/save.do", $(".form").serialize(), function(data) {
|
||
if (data.res == 1) {
|
||
top.$.messager.alert('提示', "保存成功", 'info', function() {
|
||
grid.datagrid('reload');
|
||
dialog.dialog('destroy');
|
||
});
|
||
|
||
}else if(data.res == 0){
|
||
top.$.messager.alert('提示', "保存失败", 'info');
|
||
}else{
|
||
top.$.messager.alert('提示', data.res, 'info');
|
||
}
|
||
},'json');
|
||
}
|
||
}
|
||
/* var addFun = function() {
|
||
var dialog = parent.ext.modalDialog({
|
||
title : '添加保养计划',
|
||
height:500,
|
||
url : ext.contextPath + '/equipment/maintenancerecord/showMaintenancePlanForSelects.do?',
|
||
buttons : [ {
|
||
iconCls:'icon-ok',
|
||
text : '确定',
|
||
handler : function() {
|
||
var data = dialog.find('iframe').get(0).contentWindow.selectFun(dialog, grid);
|
||
var datas= $.parseJSON(data);alert(datas)
|
||
if(datas.length>0){
|
||
for(var i=0;i<datas.length;i++){
|
||
grid.datagrid('appendRow',{
|
||
id:datas[i].id,
|
||
plantype:datas[i].plantype,
|
||
plannumber:datas[i].plannumber,
|
||
plancontent:datas[i].plancontent,
|
||
condition:datas[i].condition,
|
||
plantime:datas[i].plantime,
|
||
realtime:datas[i].realtime,
|
||
behaviordescription:datas[i].behaviordescription,
|
||
performer:datas[i].performer,
|
||
remark:datas[i].remark
|
||
});
|
||
}
|
||
}
|
||
dialog.dialog('destroy');
|
||
}
|
||
} ]
|
||
});
|
||
};
|
||
var delectFun=function(){
|
||
var rows = $('#grid').datagrid('getChecked');
|
||
if(rows.length==0){
|
||
top.$.messager.alert("提示","请选择需要删除的数据","info");
|
||
}else{
|
||
top.$.messager.confirm("提示", "确定删除这些数据?", function(r) {
|
||
if (r) {
|
||
//复制rows,否则deleteRow的index会出错
|
||
var copyRows = [];
|
||
for ( var j= 0; j < rows.length; j++) {
|
||
copyRows.push(rows[j]);
|
||
}
|
||
|
||
$.each(copyRows, function(index, item){
|
||
$('#grid').datagrid('deleteRow',$('#grid').datagrid('getRowIndex',copyRows[index]));
|
||
});
|
||
}
|
||
});
|
||
}
|
||
} */
|
||
</script>
|
||
</head>
|
||
<body>
|
||
<form method="post" class="form">
|
||
<table class="table">
|
||
<tr>
|
||
<th>保养计划类型</th>
|
||
<td>
|
||
<select name="plantype" class="easyui-combobox" data-options="panelHeight:'auto',editable:false">
|
||
<option value="0" selected >周计划</option>
|
||
<option value="1">月计划</option>
|
||
<option value="2">年计划</option>
|
||
</select>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<th>保养计划编号</th>
|
||
<td><input name="plannumber" class="easyui-textbox" data-options="required:true,validType:'isBlank'" value="" />
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<th>保养计划内容</th>
|
||
<td><input name="plancontent" class="easyui-textbox" data-options="required:true,validType:'isBlank'" value=""/>
|
||
</td>
|
||
</tr>
|
||
<!-- <tr>
|
||
<th>状态</th>
|
||
<td><select name="condition" class="easyui-combobox" data-options="panelHeight:'auto',editable:false">
|
||
<option value="0" >未执行</option>
|
||
<option value="1">执行完毕</option>
|
||
</select>
|
||
</td>
|
||
</tr> -->
|
||
<tr>
|
||
<th>计划执行时间</th>
|
||
<td><input id="plantime" name="plantime" class="Wdate" data-options="required:true,validType:'isBlank'" value="" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly/>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<th>实际执行时间</th>
|
||
<td><input id="realtime" name="realtime" class="Wdate" data-options="required:true,validType:'isBlank'" value="" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly/>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<th>执行描述</th>
|
||
<td><input id="behaviordescription" name="behaviordescription" class='easyui-textbox' value=""/>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<th>执行者</th>
|
||
<td><input id="performer" name="performer" class="easyui-textbox" value=""/>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<th>备注</th>
|
||
<td><input name="remark" class="easyi-textbox" style="overflow:auto; width:100%;height:100px" value=""/>
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
</form>
|
||
<div id="p">
|
||
<table id="grid" data-options=" boder:false"></table>
|
||
</div>
|
||
</body>
|
||
</html> |