Files
SIPAIIS_WMS_JSSW/WebRoot/jsp/equipment/maintenancePlanListForSelects.jsp

141 lines
4.9 KiB
Plaintext
Raw Normal View History

2026-01-16 14:13:44 +08:00
<%@ 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 selectFun(dialog, grid) {
var rows= grid.datagrid("getRows");
//复制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]));
});
var checkedItems = $('#grid').datagrid('getChecked');
var datas="";
$.each(checkedItems, function(index, item){
if(datas !=""){
datas+=",";
}
datas += '{"id":"'+item.id +'","plantype":"'+item.plantype +'",'+
'"plannumber":"'+item.plannumber +'","plancontent":"'+item.plancontent +'",'+
'"condition":"'+item.condition +'","plantime":"'+item.plantime +'","realtime":"'+item.realtime
+'","behaviordescription":"'+item.behaviordescription +'","performer":"'+item.performer +'","remark":"'+item.remark +'"}';
});
datas="["+datas+"]";
return datas;//$.parseJSON(datas);
}
var grid;
$(function() {
grid = $('#grid').datagrid({
title : '',
url : ext.contextPath + '/equipment/maintenanceplan/getlist.do?querytype=select',
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 mids = parent.$("#${param.iframeId}")[0].contentWindow.$("#mids").val().split(",");
$.each(mids, function(index, item){
if(item != ""){
$('#grid').datagrid("checkRow",$('#grid').datagrid("getRowIndex",item)); */
var ids = localStorage.getItem("ids").split(",");
localStorage.removeItem("ids");
$.each(ids, function(index, item){
if(item != ""){
$('#grid').datagrid("checkRow",$('#grid').datagrid("getRowIndex",item));
}
});
//$('.iconImg').attr('src', ext.pixel_0);
}
//});
//}
});
});
var dosave = function(dialog,parentWin) {
var checkedItems = $('#grid').datagrid('getChecked');
if(checkedItems==""){
top.$.messager.alert('提示', '请选择保养计划','info');
}else{
var res=JSON.stringify(checkedItems);
$.post(ext.contextPath + '/equipment/maintenancerecord/save.do', {ids:getids()} , function(data) {
if(data==1){
top.$.messager.alert('提示','保存成功','info');
parentWin.refreshcalerdar();//更新父窗体
dialog.dialog('destroy');
}else{
top.$.messager.alert('提示','保存失败','info');
}
});
}
};
</script>
</head>
<body class="easyui-layout" data-options="fit:true,border:false">
<div id="toolbar" style="display: none;">
<table>
<tr>
<td>
<form id="searchForm">
<table>
<tr>
<td>名称</td>
<td><input name="search_name" 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>
</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>