181 lines
5.1 KiB
Plaintext
181 lines
5.1 KiB
Plaintext
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||
<%@ page language="java" import="java.util.*" 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"%>
|
||
<html>
|
||
<head>
|
||
<title></title>
|
||
<jsp:include page="../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 doupdate(dialog,grid) {
|
||
if ($(".form").form('validate')) {
|
||
$.post(ext.contextPath + "/equipment/maintenanceplan/update.do", $(".form").serialize(), function(data) {
|
||
if (data.res == 1) {
|
||
$.post(ext.contextPath + "/equipment/maintenanceplan/saveEquipmentCard.do",{maintenanceplanid:data.id,ids:getids()},function(data1){
|
||
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');
|
||
}
|
||
}
|
||
|
||
function doadd(){
|
||
$("#qids").val(getids());
|
||
|
||
localStorage.setItem("qids",$("#qids").val());
|
||
//清除旧数据
|
||
var qrows= grid.datagrid("getRows");
|
||
//复制rows,否则deleteRow的index会出错
|
||
var copyRows = [];
|
||
for ( var i= 0; i < qrows.length; i++) {
|
||
copyRows.push(qrows[i]);
|
||
}
|
||
$.each(copyRows, function(index, item){
|
||
grid.datagrid('deleteRow', grid.datagrid('getRowIndex',copyRows[index]));
|
||
});
|
||
*/
|
||
/* var dialog = parent.ext.modalDialog({
|
||
title : '添加设备',
|
||
height:500,
|
||
url : ext.contextPath + '/equipment/showEquipmentCardForSelects.do?iframeId=lineEdit',
|
||
buttons : [ {
|
||
iconCls:'icon-ok',
|
||
text : '确认',
|
||
handler : function() {
|
||
var data = dialog.find('iframe').get(0).contentWindow.selectFun(dialog, grid);
|
||
var datas= $.parseJSON(data);
|
||
console.log('enter',datas);
|
||
if(datas.length>0){
|
||
for(var i=0;i<datas.length;i++){
|
||
$("#grid").datagrid('appendRow',{
|
||
id:datas[i].id,
|
||
equipmentcardid:datas[i].equipmentcardid,
|
||
equipmentname:datas[i].equipmentname,
|
||
equipmentmodel:datas[i].equipmentmodel,
|
||
equipmentclass:datas[i].equipmentclass,
|
||
geographyarea:datas[i].geographyarea
|
||
});
|
||
}
|
||
}
|
||
dialog.dialog('destroy');
|
||
}
|
||
} ]
|
||
});
|
||
} */
|
||
|
||
/* function dodelete(){
|
||
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]));
|
||
});
|
||
}
|
||
});
|
||
}
|
||
} */
|
||
|
||
|
||
|
||
$(function() {
|
||
|
||
$('#p').panel({
|
||
width:"100%",
|
||
height:"350",
|
||
title: '相关设备',
|
||
|
||
});
|
||
|
||
grid = $('#grid').datagrid({
|
||
title : '',
|
||
striped : true,
|
||
rownumbers : true,
|
||
idField : 'id',
|
||
columns : [ [
|
||
|
||
{width : '100', title : '设备编号', field : 'equipmentcardid', sortable : true, editor:'textbox',halign:'center'},
|
||
{width : '120', title : '设备名称', field : 'equipmentname', sortable : true, editor:'textbox',halign:'center'},
|
||
{width : '100', title : '设备型号', field : 'equipmentmodel', sortable : true, editor:'textbox',halign:'center'},
|
||
{width : '100', title : '设备类型', field : 'equipmentclassid', sortable : true, editor:'textbox',halign:'center'},
|
||
{width : '100', title : '存放位置', field : 'areaid', sortable : true, editor:'textbox',halign:'center'}
|
||
] ],
|
||
data:${equipmentcardList}
|
||
|
||
});
|
||
|
||
});
|
||
|
||
|
||
|
||
|
||
</script>
|
||
|
||
</head>
|
||
<body>
|
||
<form method="post" class="form">
|
||
<input type="hidden" name="id" value="${maintenanceplan.id }"/>
|
||
<table class="table">
|
||
<tr>
|
||
<th>保养计划类型</th>
|
||
<td> <c:if test="${maintenanceplan.plantype=='0'}">周计划</c:if>
|
||
<c:if test="${maintenanceplan.plantype=='1'}">月计划</c:if>
|
||
<c:if test="${maintenanceplan.plantype=='2'}">年计划</c:if>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<th>保养计划编号</th>
|
||
<td>${maintenanceplan.plannumber }</td>
|
||
</tr>
|
||
<tr>
|
||
<th>保养计划内容</th>
|
||
<td>${maintenanceplan.plancontent }</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<th>计划执行时间</th>
|
||
<td>${fn:substring(maintenanceplan.plantime,5,10)}</td>
|
||
</tr>
|
||
<tr>
|
||
<th>备注</th>
|
||
<td>${maintenanceplan.remark}</td>
|
||
</tr>
|
||
|
||
</table>
|
||
</form>
|
||
|
||
</br>
|
||
|
||
<div id="p">
|
||
<table id="grid" data-options="border:false"></table>
|
||
</div>
|
||
</body>
|
||
</html> |