first commit
This commit is contained in:
246
bin/WebRoot/jsp/equipment/equipCardListForDistrictWork.jsp
Normal file
246
bin/WebRoot/jsp/equipment/equipCardListForDistrictWork.jsp
Normal file
@ -0,0 +1,246 @@
|
||||
<%@ 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() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
/* $.each(checkedItems, function(index, item){
|
||||
if(datas !=""){
|
||||
datas+=",";
|
||||
}
|
||||
datas += '{"id":"'+item.id +'","equipmentcardid":"'+item.equipmentcardid +'",'+
|
||||
'"equipmentname":"'+item.equipmentname +'","equipmentmodel":"'+item.equipmentmodel +'",'+
|
||||
'"equipmentclass":"'+item.equipmentclass.name +'","geographyarea":"'+item.geographyarea.name +'"}';
|
||||
|
||||
});
|
||||
datas="["+datas+"]"; */
|
||||
//alert(datas)
|
||||
|
||||
return JSON.stringify(checkedItems) ;//datas;//$.parseJSON(datas);
|
||||
|
||||
}
|
||||
|
||||
function updateFun() {
|
||||
var checkedItems = $('#grid').datagrid('getRows');
|
||||
var datas="";
|
||||
return JSON.stringify(checkedItems) ;//datas;//$.parseJSON(datas);
|
||||
|
||||
}
|
||||
function getInfoFromArrangement(arrangement){
|
||||
var str ="";
|
||||
$.each(arrangement, function(index, item){
|
||||
if(str !=""){
|
||||
str+="\n";
|
||||
}
|
||||
|
||||
if(item.checkFlag){
|
||||
str+= item.gt_name+": "+ item.stdt.substring(11,16)+" ~ "+item.enddt.substring(11,16);
|
||||
}
|
||||
});
|
||||
//alert(JSON.stringify(arrangement))
|
||||
//alert(str)
|
||||
//console.info(arrangement)
|
||||
return str;
|
||||
}
|
||||
|
||||
var grid;
|
||||
var dialogT;
|
||||
var equiparrange;
|
||||
function getEquipArrange() {
|
||||
return equiparrange;
|
||||
}
|
||||
var arrangework = function(id){
|
||||
//alert(id)
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '设备调度',
|
||||
url : ext.contextPath + '/equipment/showEquipCardsArrangement.do?equipmentid='+id,
|
||||
width:800,
|
||||
height:450,
|
||||
buttons : [{
|
||||
text : '关闭',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
}],
|
||||
onDestroy:function(){
|
||||
$('#grid').datagrid('reload');
|
||||
}
|
||||
});
|
||||
};
|
||||
function dblClickFun(rowIndex){
|
||||
|
||||
rowData=grid.datagrid('getData').rows[rowIndex];
|
||||
//console.info(rowData)
|
||||
equiparrange=rowData.equipmentArrangements;
|
||||
//grid timespiner编辑的时间格式需要格式化为12:00
|
||||
$.each(equiparrange, function(index, item){
|
||||
if(item.enddt!=null && item.enddt.length>10){
|
||||
item.enddt=item.enddt.substring(11,16);
|
||||
}
|
||||
});
|
||||
equiparrange=JSON.stringify(rowData.equipmentArrangements);
|
||||
//alert(equiparrange);
|
||||
var dialog = ext.modalDialog({
|
||||
title : '安排时间',
|
||||
width : 700,
|
||||
height : 360,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/equipment/doeditEquipArrange.do?equipmentid=' +rowData.id +'&plandate=${param.plandate}',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.dosave();
|
||||
//alert(res);
|
||||
var temp=JSON.parse(res);
|
||||
$.each(temp, function(index, item){
|
||||
if(item.enddt!=null && item.enddt.length<10){
|
||||
item.enddt="1900-01-01 "+item.enddt;
|
||||
//alert(item.enddt)
|
||||
}
|
||||
});
|
||||
rowData.equipmentArrangements=temp;
|
||||
//$('#grid').datagrid('updateRow',{index:rowIndex,row:rowData});
|
||||
$('#grid').datagrid('refreshRow',rowIndex);
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
}]
|
||||
});
|
||||
}
|
||||
$(function() {
|
||||
|
||||
|
||||
$("#lineid").combobox({
|
||||
url : ext.contextPath + '/work/line/getLineListForSelect.do',
|
||||
valueField : 'id',
|
||||
textField : 'name',
|
||||
method:'get',
|
||||
panelHeight:'auto',
|
||||
onLoadSuccess:function(){
|
||||
var val = $("#lineid").combobox("getData");
|
||||
var i=0;
|
||||
for(i=0;i<val.length;i++){
|
||||
//console.log("${param.taskid}")
|
||||
if(val[i].serial=="${param.taskid}"){
|
||||
$("#lineid").combobox('select',val[i].id);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(i==val.length){
|
||||
$("#lineid").combobox('select',val[0].id);
|
||||
}
|
||||
|
||||
} ,
|
||||
onSelect:function(){
|
||||
var lineid=$("#lineid").combobox("getValue");
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/equipment/getEquipCardForDistrictWork.do?arrangementdate=${param.plandate}&workorderid=${param.workorderid}&taskid=${param.taskid}&equipmentid=${param.equipmentid}&lineid='+lineid,
|
||||
striped : true,
|
||||
nowrap:false,
|
||||
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 : 'equipmentcardid', sortable : true, halign:'center'},
|
||||
{width : '100', title : '设备名称', field : 'equipmentname', sortable : true, halign:'center'},
|
||||
{width : '100', title : '设备型号', field: 'equipmentmodel', sortable : true, halign:'center'},
|
||||
{width : '100', title : '设备类型', field: 'equipmentclass', sortable : true, halign:'center',formatter:function(value,row){
|
||||
//console.info(row.equipmentclass.name);
|
||||
if(row.equipmentclass!=null)
|
||||
return row.equipmentclass.name;
|
||||
} },
|
||||
{width : '100', title : '设备产能', field: 'capacity', sortable : true, halign:'center',formatter:function(value,row){
|
||||
//console.info(row.equipmentclass.name);
|
||||
if(row.equipmentclass!=null)
|
||||
return row.equipmentclass._capacity;
|
||||
} },
|
||||
{width : '100', title : '当前状态', field: 'equipmentstatus', sortable : true, halign:'center'},
|
||||
{width : '50', title : '管理状态', field: 'currentmanageflag', sortable : true, halign:'center'},
|
||||
{width : '130', title : '分配时段', field : 'remark', sortable : true, halign:'center',formatter:function(value,row){
|
||||
|
||||
return getInfoFromArrangement(row.equipmentArrangements);
|
||||
}},
|
||||
{title : '操作', field : 'action', width : '70', halign:'center', align:'center', formatter : function(value, row,rowindex) {
|
||||
var str = '';
|
||||
str += '<img class="iconImg ext-icon-table_edit" title="设备分配" onclick="dblClickFun(\''+rowindex+'\');"/>';
|
||||
str += '<img class="iconImg ext-icon-chart_organisation" title="设备已分配情况" onclick="arrangework(\''+row.id+'\');"/>';
|
||||
|
||||
return str;
|
||||
}
|
||||
}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
|
||||
if(data){
|
||||
var userids='${userids}';
|
||||
var userid;
|
||||
if(userids!=""){
|
||||
userid=userids.split(',');
|
||||
}
|
||||
$.each(data.rows, function(index, item){
|
||||
if(item._checkflag){
|
||||
$('#grid').datagrid('checkRow', index);
|
||||
}
|
||||
});
|
||||
}
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
},
|
||||
onDblClickRow :function (rowIndex, rowData){
|
||||
dblClickFun(rowIndex);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
</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><input id="lineid" name="lineid" class="easyui-combobox" style="width: 180px;" data-options="validType:'isBlank'"/></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>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
228
bin/WebRoot/jsp/equipment/equipCardsArrangement.jsp
Normal file
228
bin/WebRoot/jsp/equipment/equipCardsArrangement.jsp
Normal file
@ -0,0 +1,228 @@
|
||||
<%@ 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;
|
||||
function selectEquipment(){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择设备',
|
||||
width : 800,
|
||||
height : 450,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/equipment/showEquipCardForDistrictWork.do?plandate=${requestScope.plandate}&workorderid=${workorderid}&processid=${processid}&taskid=${taskid}',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectFun();
|
||||
if(res!=null){
|
||||
$.post(ext.contextPath + '/work/workorder/save_task_equ.do', {datas:res,workorderid:'${workorderid}',taskid:'${taskid}',processid:'${processid}',arrangementdate:'${requestScope.plandate}'}, function(data) {
|
||||
if(data==1){
|
||||
grid.datagrid('reload');
|
||||
}else{
|
||||
top.$.messager.alert('提示','添加失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
var equiparrange;
|
||||
function getEquipArrange() {
|
||||
return equiparrange;
|
||||
}
|
||||
var editFun = function(index) {
|
||||
var row =grid.datagrid("getRows")[index];
|
||||
//grid timespiner编辑的时间格式需要格式化为12:00
|
||||
equiparrange=row.equipmentArrangements_;
|
||||
$.each(equiparrange, function(index, item){
|
||||
if(item.enddt!=null && item.enddt.length>10){
|
||||
item.enddt=item.enddt.substring(11,16);
|
||||
}
|
||||
});
|
||||
equiparrange=JSON.stringify(equiparrange);
|
||||
//alert(equiparrange);
|
||||
var dialog = ext.modalDialog({
|
||||
title : '安排时间',
|
||||
width : 700,
|
||||
height : 360,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/equipment/doeditEquipArrange.do?equipmentid=${param.equipmentid}&plandate=${dt}',
|
||||
buttons : [{
|
||||
text : '保存',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.dosave();
|
||||
//alert(res);
|
||||
var temp=JSON.parse(res);
|
||||
$.each(temp, function(index, item){
|
||||
if(item.enddt!=null && item.enddt.length<10){
|
||||
item.enddt="1900-01-01 "+item.enddt;
|
||||
//alert(item.enddt)
|
||||
}
|
||||
});
|
||||
temp=JSON.stringify(temp);
|
||||
// alert(temp);
|
||||
$.post(ext.contextPath + '/equipment/doupdateEquipArrangement.do', {arrangestr:temp} , function(data) {
|
||||
if(data>0){
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
}else{
|
||||
top.$.messager.alert('提示','修改失败','info');
|
||||
}
|
||||
});
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
}]
|
||||
});
|
||||
};
|
||||
var deletesFun = function() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
if(datas!=""){
|
||||
datas+=',';
|
||||
}
|
||||
datas+="'"+item.id+"'";
|
||||
});
|
||||
if(datas==""){
|
||||
top.$.messager.alert('提示', '请先选择要删除的记录','info');
|
||||
}else{
|
||||
top.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/work/workorder/deletes_task_equ.do', {ids:datas,workorderid:'${workorderid}',taskid:'${taskid}',arrangementdate:'${requestScope.plandate}'} , function(data) {
|
||||
if(data>0){
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
}else{
|
||||
top.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
var dosave = function() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.equipmentid+",";
|
||||
});
|
||||
//if(datas==""){
|
||||
//top.$.messager.alert('提示', '请选择设备','info');
|
||||
//}else{
|
||||
$.post(ext.contextPath + '/work/workTaskEquipment/save.do', {ids:datas,taskid:'${param.taskid}',processrealdetailid:'${param.processrealdetailid}',workstationid:'${param.workstationid}'} , function(data) {
|
||||
if(data==1){
|
||||
top.$.messager.alert('提示','保存成功','info');
|
||||
}else{
|
||||
top.$.messager.alert('提示','保存失败','info');
|
||||
}
|
||||
});
|
||||
//}
|
||||
};
|
||||
function getInfoFromArrangement(arrangement){
|
||||
var str ="";
|
||||
$.each(arrangement, function(index, item){
|
||||
if(str !=""){
|
||||
str+="\n";
|
||||
}
|
||||
|
||||
if(item.checkFlag){
|
||||
str+= item.gt_name+": "+ item.stdt.substring(11,16)+" ~ "+item.enddt.substring(11,16);
|
||||
}
|
||||
});
|
||||
//alert(JSON.stringify(arrangement))
|
||||
//alert(str)
|
||||
//console.info(arrangement)
|
||||
return str;
|
||||
}
|
||||
var searchgrid = function() {
|
||||
grid.datagrid('load',ext.contextPath + '/equipment/getEquipCardsArrangement.do?equipmentid=${param.equipmentid}&'+$('#searchForm').serialize());
|
||||
};
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/equipment/getEquipCardsArrangement.do?equipmentid=${param.equipmentid}&'+$('#searchForm').serialize(),
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
selectOnCheck: true,
|
||||
checkOnSelect: true,
|
||||
nowrap:false,
|
||||
idField : 'taskid',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '120', title : '工单编号', field : 'workorderno_', sortable : false, halign:'center'},
|
||||
{width : '120', title : '任务名称', field : 'name', sortable : false, halign:'center'},
|
||||
{width : '120', title : '任务编码', field : 'id', sortable : false, halign:'center'},
|
||||
{width : '130', title : '分配时段', field : 'remark', sortable : true, halign:'center',formatter:function(value,row){
|
||||
|
||||
return getInfoFromArrangement(row.equipmentArrangements_);
|
||||
}},
|
||||
{title : '操作', field : 'action', width : '90', halign:'center', align:'center', formatter : function(value, row,index) {
|
||||
var str = '';
|
||||
//var arr=JSON.stringify(row.equipmentArrangements_);
|
||||
<%if (sessionManager.havePermission(session,"equipment/editEquipmentCard.do")) {%>
|
||||
|
||||
str += '<img class="iconImg ext-icon-table_edit" title="编辑" onclick="editFun(\''+index+'\');"/> ';
|
||||
<%}%>
|
||||
|
||||
return str;
|
||||
}
|
||||
}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
/* if(data){
|
||||
$.each(data.rows, function(index, item){
|
||||
if(item._checked){
|
||||
$('#grid').datagrid('checkRow', index);
|
||||
}
|
||||
});
|
||||
} */
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<table id="toolbar" style="width:100%">
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<table class="tooltable">
|
||||
<tr>
|
||||
|
||||
<td>日期</td>
|
||||
<td><input id="dt" name="dt" class="Wdate" value="${dt}"
|
||||
onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})"
|
||||
readonly></td>
|
||||
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="searchgrid();">搜索</a>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</body>
|
||||
</html>
|
||||
183
bin/WebRoot/jsp/equipment/equipmentArrangeEdit.jsp
Normal file
183
bin/WebRoot/jsp/equipment/equipmentArrangeEdit.jsp
Normal file
@ -0,0 +1,183 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@page import="com.sipai.entity.scada.MPoint"%>
|
||||
<%@ 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"%>
|
||||
<%request.setAttribute("Flag_Enable",MPoint.Flag_Enable);%>
|
||||
<%request.setAttribute("Flag_Disable",MPoint.Flag_Disable);%>
|
||||
|
||||
<%request.setAttribute("Flag_Sql",MPoint.Flag_Sql);%>
|
||||
<%request.setAttribute("Flag_Modbus",MPoint.Flag_Modbus);%>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
|
||||
function cellStyler(value,row,index){
|
||||
//if (index==1){
|
||||
return 'background-color:#999999;color:white;';
|
||||
//}
|
||||
}
|
||||
var grid="";
|
||||
$(function() {
|
||||
var content=parent.getEquipArrange();
|
||||
//alert(content)
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
striped : true,
|
||||
singleSelect: true,
|
||||
ctrlSelect:true,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
rownumbers : true,
|
||||
idField : 'id',
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '90', title : '班次', field : 'gt_name', halign:'center'},
|
||||
{width : '160', title : '开始时间', field : 'stdt',halign:'center',styler:cellStyler,formatter:function(value,row){
|
||||
return row.stdt.substring(11,16);
|
||||
}},
|
||||
{width : '160', title : '结束时间', field : 'enddt',halign:'center',
|
||||
/* formatter:function(value,row){
|
||||
return row.enddt.substring(11,16);
|
||||
}, */
|
||||
editor:{
|
||||
type:'timespinner',
|
||||
options:{
|
||||
required : true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
] ],
|
||||
onClickCell: function (rowIndex, field, value) {
|
||||
beginEditing(rowIndex, field, value);
|
||||
},
|
||||
|
||||
onLoadSuccess : function(data) {
|
||||
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
if(data){
|
||||
$.each(data.rows, function(index, item){
|
||||
if(item.checkFlag){
|
||||
$('#grid').datagrid('checkRow', index);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
onCheck: function(rowIndex,rowData){
|
||||
rowData.checkFlag=true;
|
||||
},
|
||||
onUncheck : function(rowIndex,rowData){
|
||||
rowData.checkFlag=false;
|
||||
},
|
||||
data:JSON.parse(content)
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
var editIndex = undefined;
|
||||
var beginEditing = function (rowIndex, field, value) {
|
||||
//alert(value)
|
||||
if (field != "enddt" )
|
||||
{
|
||||
if(editIndex!=undefined)
|
||||
{
|
||||
endEditing();
|
||||
$('#grid').datagrid('endEdit', editIndex);
|
||||
editIndex = undefined;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (rowIndex != editIndex) {
|
||||
if (endEditing()) {
|
||||
$('#grid').datagrid('beginEdit', rowIndex);
|
||||
//alert("行号:"+rowIndex);
|
||||
editIndex = rowIndex;
|
||||
var ed = $('#grid').datagrid('getEditor', { index: rowIndex, field: 'enddt' });
|
||||
//alert("oled"+value)
|
||||
$(ed.target).timespinner('setValue',value);
|
||||
$(ed.target).focus().bind('blur', function () {
|
||||
endEditing();
|
||||
});
|
||||
} else {
|
||||
$('#grid').datagrid('selectRow', editIndex);
|
||||
}
|
||||
}
|
||||
};
|
||||
var endEditing = function () {
|
||||
if (editIndex == undefined)
|
||||
{ return true; }
|
||||
if ($('#grid').datagrid('validateRow', editIndex)) {
|
||||
var ed = $('#grid').datagrid('getEditor', { index: editIndex, field: 'enddt' });
|
||||
var number = $(ed.target).timespinner('getValue');
|
||||
|
||||
$('#grid').datagrid('getRows')[editIndex]['enddt'] =number;
|
||||
//alert( 'new:'+$('#grid').datagrid('getRows')[editIndex]['enddt']);
|
||||
$('#grid').datagrid('endEdit', editIndex);
|
||||
editIndex = undefined;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
var dosave = function(dialog,grid) {
|
||||
//alert();
|
||||
//若用户未确认编辑状态,则自动完成编辑
|
||||
var row=$('#grid').datagrid('getSelected');
|
||||
var editIndex=$('#grid').datagrid('getRowIndex',row);
|
||||
var ed = $('#grid').datagrid('getEditor', { index: editIndex, field: 'enddt' });
|
||||
if(ed!=null){
|
||||
var number = $(ed.target).timespinner('getValue');
|
||||
$('#grid').datagrid('getRows')[editIndex]['enddt'] = number;
|
||||
$('#grid').datagrid('endEdit', editIndex);
|
||||
}
|
||||
|
||||
var allItems = $('#grid').datagrid('getData').rows;
|
||||
|
||||
/* $.each(allItems, function(index, item){
|
||||
//alert(item)
|
||||
if(datas !=""){
|
||||
datas+=",";
|
||||
}
|
||||
datas += '{"id":"'+item.id +'","gt_id":"'+item.gt_id +'",'+
|
||||
'"stdt":"'+item.stdt +'","enddt":"'+item.enddt +'"}';
|
||||
}); */
|
||||
|
||||
//alert(JSON.stringify(allItems))
|
||||
return JSON.stringify(allItems);
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>设备名称</th>
|
||||
<td>${equipmentCard.equipmentname}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>设备编码</th>
|
||||
<td>${equipmentCard.equipmentcardid}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>日期</th>
|
||||
<td>${param.plandate}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br />
|
||||
|
||||
</form>
|
||||
<table class="table">
|
||||
<div data-options="region:'center',border:false">
|
||||
<table id="grid" data-options="border:false "></table>
|
||||
</div>
|
||||
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
221
bin/WebRoot/jsp/equipment/equipmentCardAdd.jsp
Normal file
221
bin/WebRoot/jsp/equipment/equipmentCardAdd.jsp
Normal file
@ -0,0 +1,221 @@
|
||||
<!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"%>
|
||||
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
function dosave(dialog,grid) {
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/equipment/saveEquipmentCard.do", $(".form").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
$.post(ext.contextPath + "/equipment/saveEquipmentPoints.do",{no:data.id,mids:getMids()},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 getMids(){
|
||||
var mrows= $('#grid').datagrid("getRows");
|
||||
var mids="";
|
||||
$.each(mrows, function(index, item){
|
||||
mids+=item.id+",";
|
||||
});
|
||||
mids=mids.replace(/,$/gi,"");
|
||||
|
||||
return mids;
|
||||
}
|
||||
function doadd_M(){
|
||||
$("#mids").val(getMids());
|
||||
localStorage.setItem("mids",$("#mids").val().split(","));
|
||||
/* //清除旧数据
|
||||
var mrows= grid.datagrid("getRows");
|
||||
|
||||
//复制rows,否则deleteRow的index会出错
|
||||
var copyRows = [];
|
||||
for ( var j= 0; j < mrows.length; j++) {
|
||||
copyRows.push(mrows[j]);
|
||||
}
|
||||
$.each(copyRows, function(index, item){
|
||||
grid.datagrid('deleteRow', grid.datagrid('getRowIndex',copyRows[index]));
|
||||
});
|
||||
*/
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '添加测量点',
|
||||
height:500,
|
||||
url : ext.contextPath + '/work/mpoint/showlistForSelects.do',
|
||||
buttons : [ {
|
||||
iconCls:'icon-ok',
|
||||
text : '确认',
|
||||
handler : function() {
|
||||
var data = dialog.find('iframe').get(0).contentWindow.selectFun(dialog, grid);
|
||||
var datas= $.parseJSON(data);
|
||||
|
||||
if(datas.length>0){
|
||||
for(var i=0;i<datas.length;i++){
|
||||
grid.datagrid('appendRow',{
|
||||
id:datas[i].id,
|
||||
id:datas[i].id,
|
||||
parmname:datas[i].parmname,
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
} ]
|
||||
});
|
||||
}
|
||||
function dodelete_M(){
|
||||
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() {
|
||||
$('#equipmentclassid').combobox({
|
||||
url:ext.contextPath + '/equipment/getEquipmentClassname.do',
|
||||
valueField:'id',
|
||||
textField:'name',
|
||||
editable:false,
|
||||
panelHeight:'auto',
|
||||
|
||||
});
|
||||
$('#areaid').combobox({
|
||||
url:ext.contextPath + '/equipment/getGeographyAreaname.do',
|
||||
valueField:'id',
|
||||
textField:'name',
|
||||
editable:false,
|
||||
panelHeight:'auto',
|
||||
});
|
||||
$('#m').panel({
|
||||
width:"100%",
|
||||
height:"300",
|
||||
title: '添加测量点',
|
||||
tools: [{
|
||||
iconCls:'icon-add',
|
||||
handler:function(){doadd_M();}
|
||||
},{
|
||||
iconCls:'icon-remove',
|
||||
handler:function(){dodelete_M();}
|
||||
}]
|
||||
|
||||
});
|
||||
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
idField : 'id',
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '100', title : '测量点ID', field : 'id', sortable : true, halign:'center'},
|
||||
|
||||
{width : '180', title : '名称', field : 'parmname', sortable : false, halign:'center'},
|
||||
|
||||
] ]
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<table class="table">
|
||||
<input id="mids" name="mids" type="hidden" value="" />
|
||||
<tr>
|
||||
<th >设备编号</th>
|
||||
<td ><input id="equipmentcardid" name="equipmentcardid" class="easyui-textbox" data-options="required:true,validType:'isBlank'" style="overflow:auto;" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >设备名称</th>
|
||||
<td ><input id="equipmentname" name="equipmentname" class="easyui-textbox" data-options="required:true,validType:'isBlank'" style="overflow:auto;" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >设备型号</th>
|
||||
<td ><input id="equipmentmodel" name="equipmentmodel" class="easyui-textbox" style="overflow:auto;" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>设备类型</th>
|
||||
<td>
|
||||
<input id="equipmentclassid" name="equipmentclassid" class="easyui-combobox" value="" />
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<th>存放位置</th>
|
||||
<td>
|
||||
<input id="areaid" name="areaid" class="easyui-combobox" value="" />
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<th >管理状态</th>
|
||||
<td ><select id="currentmanageflag" name="currentmanageflag" class="easyui-combobox" data-options="panelHeight:'auto'">
|
||||
<option value="启用" selected>启用</option>
|
||||
<option value="禁用">禁用</option>
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >设备厂商</th>
|
||||
<td ><input id="equipmentmanufacturer" name="equipmentmanufacturer" class="easyui-textbox" style="overflow:auto;" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >责任人</th>
|
||||
<td ><input id="responsibleperson" name="responsibleperson" class="easyui-textbox" style="overflow:auto;" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >使用部门</th>
|
||||
<td ><input id="responsibledepartment" name="responsibledepartment" class="easyui-textbox" style="overflow:auto;" value="" /></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>使用日期</th>
|
||||
<td><input id="productiondate" name="productiondate" class="Wdate"
|
||||
value="" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"
|
||||
readonly>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >资产原值</th>
|
||||
<td ><input id="equipmentvalue" name="equipmentvalue" class="easyui-textbox" style="overflow:auto;" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >备注</th>
|
||||
<td ><input id="remark" name="remark" class="easyui-textbox"
|
||||
data-options="multiline:true" style="overflow:auto;width:100%;height:80px;" value=""
|
||||
validtype="length[0,250]" invalidMessage="有效长度0-250"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<div id="m">
|
||||
<table id="grid" data-options="border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
200
bin/WebRoot/jsp/equipment/equipmentCardEdit.jsp
Normal file
200
bin/WebRoot/jsp/equipment/equipmentCardEdit.jsp
Normal file
@ -0,0 +1,200 @@
|
||||
<!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"%>
|
||||
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
function dosave(dialog,grid) {
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/equipment/updateEquipmentCard.do", $(".form").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
$.post(ext.contextPath + "/equipment/saveEquipmentPoints.do",{no:data.id,mids:getMids()},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 getMids(){
|
||||
var mrows= $('#grid').datagrid("getRows");
|
||||
var mids="";
|
||||
$.each(mrows, function(index, item){
|
||||
mids+=item.id+",";
|
||||
});
|
||||
mids=mids.replace(/,$/gi,"");
|
||||
|
||||
return mids;
|
||||
}
|
||||
function doadd_M(){
|
||||
$("#mids").val(getMids());
|
||||
localStorage.setItem("mids",$("#mids").val().split(","));
|
||||
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '关联测量点',
|
||||
height:500,
|
||||
url : ext.contextPath + '/work/mpoint/showlistForSelects.do?iframeId=equipmentCardAdd',
|
||||
buttons : [ {
|
||||
iconCls:'icon-ok',
|
||||
text : '确认',
|
||||
handler : function() {
|
||||
var data = dialog.find('iframe').get(0).contentWindow.selectFun(dialog, grid);
|
||||
var datas= $.parseJSON(data);
|
||||
|
||||
if(datas.length>0){
|
||||
for(var i=0;i<datas.length;i++){
|
||||
grid.datagrid('appendRow',{
|
||||
id:datas[i].id,
|
||||
id:datas[i].id,
|
||||
parmname:datas[i].parmname,
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
} ]
|
||||
});
|
||||
}
|
||||
function dodelete_M(){
|
||||
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() {
|
||||
$('#m').panel({
|
||||
width:"100%",
|
||||
height:"300",
|
||||
title: '添加测量点',
|
||||
tools: [{
|
||||
iconCls:'icon-add',
|
||||
handler:function(){doadd_M();}
|
||||
},{
|
||||
iconCls:'icon-remove',
|
||||
handler:function(){dodelete_M();}
|
||||
}]
|
||||
|
||||
});
|
||||
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
idField : 'id',
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '100', title : '测量点ID', field : 'id', sortable : true, halign:'center'},
|
||||
|
||||
{width : '180', title : '名称', field : 'parmname', sortable : false, halign:'center'},
|
||||
|
||||
] ],
|
||||
data:${equipmentPointList}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<input id="mids" name="mids" type="hidden" value="" />
|
||||
<form method="post" class="form">
|
||||
<input id="id" name="id" type="hidden" value="${ equipmentcard.id}"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th >设备编号</th>
|
||||
<td ><input id="equipmentcardid" name="equipmentcardid" class="easyui-textbox" data-options="required:true,validType:'isBlank'" style="overflow:auto;" value="${ equipmentcard.equipmentcardid}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >设备名称</th>
|
||||
<td ><input id="equipmentname" name="equipmentname" class="easyui-textbox" data-options="required:true,validType:'isBlank'" style="overflow:auto;" value="${ equipmentcard.equipmentname}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >设备型号</th>
|
||||
<td ><input id="equipmentmodel" name="equipmentmodel" class="easyui-textbox" style="overflow:auto;" value="${ equipmentcard.equipmentmodel}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >设备类型</th>
|
||||
<td ><select id="equipmentclassid" name="equipmentclassid" class="easyui-combobox" data-options="panelHeight:'auto'">
|
||||
<c:forEach items="${equipmentClassList}" var="ecObj">
|
||||
<option value="${ecObj.id}" <c:if test="${equipmentcard.equipmentclassid==ecObj.id }"> selected</c:if>><c:out value="${ecObj.name}"></c:out></option>
|
||||
</c:forEach>
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >存放位置</th>
|
||||
<td ><select id="areaid" name="areaid" class="easyui-combobox" data-options="panelHeight:'auto'">
|
||||
<c:forEach items="${geographyAreaList}" var="gaObj">
|
||||
<option value="${gaObj.id}" <c:if test="${equipmentcard.areaid==gaObj.id }"> selected</c:if>><c:out value="${gaObj.name}"></c:out></option>
|
||||
</c:forEach>
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >管理状态</th>
|
||||
<td ><select id="currentmanageflag" name="currentmanageflag" class="easyui-combobox" data-options="panelHeight:'auto'">
|
||||
<option value="启用" <c:if test="${equipmentcard.currentmanageflag=='启用' }"> selected</c:if>>启用</option>
|
||||
<option value="禁用" <c:if test="${equipmentcard.currentmanageflag=='禁用' }"> selected</c:if>>禁用</option>
|
||||
</select></td>
|
||||
</tr>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >设备厂商</th>
|
||||
<td ><input id="equipmentmanufacturer" name="equipmentmanufacturer" class="easyui-textbox" style="overflow:auto;" value="${equipmentcard.equipmentmanufacturer}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >责任人</th>
|
||||
<td ><input id="responsibleperson" name="responsibleperson" class="easyui-textbox" style="overflow:auto;" value="${equipmentcard.responsibleperson}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >使用部门</th>
|
||||
<td ><input id="responsibledepartment" name="responsibledepartment" class="easyui-textbox" style="overflow:auto;" value="${equipmentcard.responsibledepartment}" /></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>使用日期</th>
|
||||
<td><input id="productiondate" name="productiondate"class="Wdate"
|
||||
value="${equipmentcard.productiondate}" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"readonly/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >资产原值</th>
|
||||
<td ><input id="equipmentvalue" name="equipmentvalue" class="easyui-textbox" style="overflow:auto;" value="${equipmentcard.equipmentvalue}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >备注</th>
|
||||
<td ><input id="remark" name="remark" class="easyui-textbox"
|
||||
data-options="multiline:true" style="overflow:auto;width:100%;height:80px;"
|
||||
validtype="length[0,250]" invalidMessage="有效长度0-250"
|
||||
value="${ equipmentcard.remark}" /></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</form>
|
||||
<div id="m">
|
||||
<table id="grid" data-options="border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
290
bin/WebRoot/jsp/equipment/equipmentCardList.jsp
Normal file
290
bin/WebRoot/jsp/equipment/equipmentCardList.jsp
Normal file
@ -0,0 +1,290 @@
|
||||
<%@page import="com.sipai.entity.equipment.EquipmentCard"%>
|
||||
<%@ 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();
|
||||
%>
|
||||
<%request.setAttribute("Status_Fault",EquipmentCard.Status_Fault);%>
|
||||
<%request.setAttribute("Status_OFF",EquipmentCard.Status_OFF);%>
|
||||
<%request.setAttribute("Status_ON",EquipmentCard.Status_ON);%>
|
||||
<%request.setAttribute("Status_StandBy",EquipmentCard.Status_StandBy);%>
|
||||
<%request.setAttribute("Status_UnMathch",EquipmentCard.Status_UnMathch);%>
|
||||
<!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/addEquipmentCard.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/viewEquipmentCard.do?id=' + id
|
||||
});
|
||||
dialog.dialog({
|
||||
onClose:function(){
|
||||
grid.datagrid('reload');
|
||||
}
|
||||
});
|
||||
};
|
||||
var editFun = function(id) {
|
||||
grid.datagrid('clearChecked');
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '编辑设备信息',
|
||||
url : ext.contextPath + '/equipment/editEquipmentCard.do?id=' + id,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
dialog.dialog({
|
||||
onClose:function(){
|
||||
grid.datagrid('reload');
|
||||
}
|
||||
});
|
||||
};
|
||||
var importFun = function() {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择文件',
|
||||
width: 600,
|
||||
height:300,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/equipment/doimportEquipmentCard.do',
|
||||
buttons : [ {
|
||||
text : '导入数据',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.doimport(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var deleteFun = function(id) {
|
||||
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/equipment/deleteEquipmentCard.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
top.$.messager.alert('提示','删除成功','info');
|
||||
grid.datagrid('reload');
|
||||
}else{
|
||||
top.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
var deletesFun = function() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
if(datas==""){
|
||||
top.$.messager.alert('提示', '请先选择要删除的记录','info');
|
||||
}else{
|
||||
top.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/equipment/deleteEquipmentCards.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
top.$.messager.alert('提示','成功删除'+data+'条记录','info');
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
}else{
|
||||
top.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/equipment/getEquipmentCard.do',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
ctrlSelect:true,
|
||||
singleSelect: false,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
selectOnCheck: true,
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '160', title : '设备编号', field : 'equipmentcardid', sortable : true, halign:'center'},
|
||||
{width : '150', title : '设备名称', field : 'equipmentname', sortable : true, halign:'center'},
|
||||
{width : '100', title : '设备型号', field : 'equipmentmodel', sortable : true, halign:'center'},
|
||||
{width : '100', title : '设备状态', field : 'equipmentstatus', sortable : true, halign:'center',formatter:function(value,row){
|
||||
switch(row.equipmentstatus){
|
||||
case '${Status_Fault}':
|
||||
return '故障';
|
||||
break;
|
||||
case '${Status_OFF}':
|
||||
return '停机';
|
||||
break;
|
||||
case '${Status_ON}':
|
||||
return '运行中';
|
||||
break;
|
||||
case '${Status_StandBy}':
|
||||
return '待机';
|
||||
break;
|
||||
case '${Status_UnMathch}':
|
||||
return '未匹配测量点';
|
||||
break;
|
||||
}
|
||||
|
||||
}},
|
||||
{width : '100', title : '设备类型', field: 'equipmentclass', sortable : true, halign:'center',formatter:function(value){
|
||||
if(value!=null){
|
||||
if(value.status=="禁用"){
|
||||
return value.name+"<img class='iconImg ext-icon-bullet_error' title='该类型已禁用' /> ";
|
||||
}else{
|
||||
|
||||
return value.name;
|
||||
}}}
|
||||
},
|
||||
{width : '100', title : '存放位置', field: 'geographyarea', sortable : true, halign:'center',formatter:function(value,row){
|
||||
|
||||
if(value!=null){
|
||||
if(value.status=="禁用"){
|
||||
return value.name+"<img class='iconImg ext-icon-bullet_error' title='该位置已禁用' /> ";
|
||||
}else{
|
||||
return value.name;
|
||||
}}
|
||||
}},
|
||||
{width : '70', title : '能否被使用', field: 'currentmanageflag', sortable : true, halign:'center'},
|
||||
{width : '80', title : '备注', field : 'remark', sortable : true, halign:'center'},
|
||||
{width : '120', title : '最后更新时间', field : 'insdt', sortable : true, halign:'center',formatter:function(value){
|
||||
return value.substring(0,19);
|
||||
}
|
||||
},
|
||||
{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/editEquipmentCard.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_edit" title="编辑" onclick="editFun(\''+row.id+'\');"/> ';
|
||||
str += '<img class="iconImg ext-icon-chart_organisation" title="设备调度" onclick="arrangework(\''+row.id+'\');"/>';
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"equipment/deleteEquipmentCard.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);
|
||||
}
|
||||
});
|
||||
});
|
||||
var arrangework = function(id){
|
||||
//alert(planid+workorderid+processid)
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '设备调度',
|
||||
url : ext.contextPath + '/equipment/showEquipCardsArrangement.do?equipmentid='+id,
|
||||
width:1000,
|
||||
height:500,
|
||||
buttons : [{
|
||||
text : '关闭',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
}]
|
||||
});
|
||||
};
|
||||
function formattime(val) {
|
||||
var year = parseInt(val.year) + 1900;
|
||||
var month = (parseInt(val.month) + 1);
|
||||
month = month > 9 ? month : ('0' + month);
|
||||
var date = parseInt(val.date);
|
||||
date = date > 9 ? date : ('0' + date);
|
||||
var hours = parseInt(val.hours);
|
||||
hours = hours > 9 ? hours : ('0' + hours);
|
||||
var minutes = parseInt(val.minutes);
|
||||
minutes = minutes > 9 ? minutes : ('0' + minutes);
|
||||
var seconds = parseInt(val.seconds);
|
||||
seconds = seconds > 9 ? seconds : ('0' + seconds);
|
||||
var time = year + '-' + month + '-' + date + ' ' + hours + ':'
|
||||
+ minutes + ':' + seconds;
|
||||
return time;
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<%if (sessionManager.havePermission(session,"equipment/addEquipmentCard.do")) {%>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
|
||||
onclick="addFun();">添加</a>
|
||||
<%}%>
|
||||
</td>
|
||||
<td>
|
||||
<%if (sessionManager.havePermission(session,"equipment/deleteEquipmentCard.do")) {%>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true"
|
||||
onclick="deletesFun();">删除</a>
|
||||
<%}%>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
|
||||
onclick="importFun();">导入</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="">导入</a></td>
|
||||
<td><a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-table_go',plain:true" onclick="">导出</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>
|
||||
<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>
|
||||
99
bin/WebRoot/jsp/equipment/equipmentCardListForSelect.jsp
Normal file
99
bin/WebRoot/jsp/equipment/equipmentCardListForSelect.jsp
Normal file
@ -0,0 +1,99 @@
|
||||
<%@ 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() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas = '{"id":"'+item.id +'","equipmentcardid":"'+item.equipmentcardid +'",'+
|
||||
'"equipmentname":"'+item.equipmentname +'","equipmentmodel":"'+item.equipmentmodel +'",'+
|
||||
'"equipmentclass":"'+item.equipmentclass.name +'","geographyarea":"'+item.geographyarea.name +'"}';
|
||||
});
|
||||
console.log("datas",$.parseJSON(datas));
|
||||
return $.parseJSON(datas);
|
||||
}
|
||||
|
||||
var grid;
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/equipment/getEquipmentCard.do?querytype=select',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: true,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
selectOnCheck: true,
|
||||
checkOnSelect: true,
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '135', title : '设备编号', field : 'equipmentcardid', sortable : true, halign:'center'},
|
||||
{width : '127', title : '设备名称', field : 'equipmentname', sortable : true, halign:'center'},
|
||||
{width : '100', title : '设备型号', field: 'equipmentmodel', sortable : true, halign:'center'},
|
||||
{width : '100', title : '设备类型', field: 'equipmentclass', sortable : true, halign:'center',formatter:function(value){
|
||||
if(value!=null){
|
||||
return value.name;
|
||||
}} },
|
||||
{width : '100', title : '存放位置', field: 'geographyarea', sortable : true, halign:'center',formatter:function(value){
|
||||
if(value!=null){
|
||||
return value.name;
|
||||
}} },
|
||||
{width : '50', title : '管理状态', field: 'currentmanageflag', sortable : true, halign:'center'},
|
||||
{width : '80', title : '备注', field : 'remark', sortable : true, halign:'center'}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
var equids = localStorage.getItem("search_equ").split(",");
|
||||
localStorage.clear();
|
||||
$.each(equids, function(index, item){
|
||||
if(item != ""){
|
||||
$('#grid').datagrid("checkRow",$('#grid').datagrid("getRowIndex",item));
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
</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>
|
||||
131
bin/WebRoot/jsp/equipment/equipmentCardListForSelects.jsp
Normal file
131
bin/WebRoot/jsp/equipment/equipmentCardListForSelects.jsp
Normal file
@ -0,0 +1,131 @@
|
||||
<%@ 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 wrows= grid.datagrid("getRows");
|
||||
//复制rows,否则deleteRow的index会出错
|
||||
var copyRows = [];
|
||||
for ( var j= 0; j < wrows.length; j++) {
|
||||
copyRows.push(wrows[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 +'","equipmentcardid":"'+item.equipmentcardid +'",'+
|
||||
'"equipmentname":"'+item.equipmentname +'","equipmentmodel":"'+item.equipmentmodel +'"}';
|
||||
|
||||
});
|
||||
datas="["+datas+"]";
|
||||
|
||||
return datas;//$.parseJSON(datas);
|
||||
|
||||
}
|
||||
function selectID(dialog, grid) {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas = '{"id":"'+item.id +'","id":"'+item.id +'"}';
|
||||
});
|
||||
return $.parseJSON(datas);
|
||||
}
|
||||
|
||||
var grid;
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/equipment/getEquipmentCard.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 : 'equipmentcardid', sortable : true, halign:'center'},
|
||||
{width : '100', title : '设备名称', field : 'equipmentname', sortable : true, halign:'center'},
|
||||
{width : '100', title : '设备型号', field: 'equipmentmodel', sortable : true, halign:'center'},
|
||||
{width : '100', title : '设备类型', field: 'equipmentclass', sortable : true, halign:'center',formatter:function(value){
|
||||
if(value!=null){
|
||||
return value.name;
|
||||
}} },
|
||||
{width : '100', title : '存放位置', field: 'geographyarea', sortable : true, halign:'center',formatter:function(value){
|
||||
if(value!=null){
|
||||
return value.name;
|
||||
} }},
|
||||
|
||||
|
||||
{width : '50', title : '管理状态', field: 'currentmanageflag', 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 mids = localStorage.getItem("mids").split(",");
|
||||
localStorage.removeItem("mids");
|
||||
|
||||
$.each(mids, function(index, item){
|
||||
if(item != ""){
|
||||
$('#grid').datagrid("checkRow",$('#grid').datagrid("getRowIndex",item));
|
||||
}
|
||||
});
|
||||
//$('.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>
|
||||
<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>
|
||||
126
bin/WebRoot/jsp/equipment/equipmentCardView.jsp
Normal file
126
bin/WebRoot/jsp/equipment/equipmentCardView.jsp
Normal file
@ -0,0 +1,126 @@
|
||||
<!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 utf16to8(str) {
|
||||
var out, i, len, c;
|
||||
out = "";
|
||||
len = str.length;
|
||||
for (i = 0; i < len; i++) {
|
||||
c = str.charCodeAt(i);
|
||||
if ((c >= 0x0001) && (c <= 0x007F)) {
|
||||
out += str.charAt(i);
|
||||
} else if (c > 0x07FF) {
|
||||
out += String.fromCharCode(0xE0 | ((c >> 12) & 0x0F));
|
||||
out += String.fromCharCode(0x80 | ((c >> 6) & 0x3F));
|
||||
out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F));
|
||||
} else {
|
||||
out += String.fromCharCode(0xC0 | ((c >> 6) & 0x1F));
|
||||
out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F));
|
||||
}
|
||||
}
|
||||
return out;
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th >设备编号</th>
|
||||
<td id="cfilenametd">${equipmentcard.equipmentcardid}</td>
|
||||
<td rowspan="7" width="150px">
|
||||
<div id="qrcodeTable2" style="display:block;align:center; width:150px"></div>
|
||||
<script >
|
||||
var filename2 = $('#cfilenametd').html();
|
||||
var cidd2 = utf16to8(filename2);
|
||||
$('#qrcodeTable2').qrcode({
|
||||
render : "canvas",
|
||||
width : 150, //设置宽度
|
||||
height : 150, //设置高度
|
||||
typeNumber : -1, //计算模式
|
||||
correctLevel : QRErrorCorrectLevel.H,//纠错等级
|
||||
background : "#ffffff",//背景颜色
|
||||
foreground : "#000000", //前景颜色
|
||||
text : cidd2
|
||||
});
|
||||
|
||||
</script>
|
||||
<!-- </div> -->
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >设备名称</th>
|
||||
<td >${equipmentcard.equipmentname}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >设备型号</th>
|
||||
<td >${equipmentcard.equipmentmodel}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >设备类型</th>
|
||||
<td >
|
||||
<c:if test="${equipmentcard.equipmentclass.id==equipmentcard.equipmentclassid}">
|
||||
${equipmentcard.equipmentclass.name}
|
||||
</c:if>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >存放位置</th>
|
||||
<td >
|
||||
|
||||
<c:if test="${equipmentcard.geographyarea.id==equipmentcard.areaid}">
|
||||
${equipmentcard.geographyarea.name}
|
||||
</c:if>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >管理状态</th>
|
||||
<td >${equipmentcard.currentmanageflag}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >设备厂商</th>
|
||||
<td >${equipmentcard.equipmentmanufacturer}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >责任人</th>
|
||||
<td >${equipmentcard.responsibleperson}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >使用部门</th>
|
||||
<td >${equipmentcard.responsibledepartment}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >使用日期</th>
|
||||
<td >${equipmentcard.productiondate}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >资产原值</th>
|
||||
<td >${equipmentcard.equipmentvalue}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >备注</th>
|
||||
<td >${equipmentcard.remark}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th >关联测量点</th>
|
||||
<td >
|
||||
<c:if test="${equipmentPointname != null}">
|
||||
${equipmentPointname}
|
||||
</c:if>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
78
bin/WebRoot/jsp/equipment/equipmentCardimport.jsp
Normal file
78
bin/WebRoot/jsp/equipment/equipmentCardimport.jsp
Normal file
@ -0,0 +1,78 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>导入人员</title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script>
|
||||
var uploader,state;
|
||||
$(function() {
|
||||
var $ = jQuery,
|
||||
$list = $('#thelist'),
|
||||
state = 'pending';
|
||||
|
||||
uploader = WebUploader.create({
|
||||
// swf文件路径
|
||||
swf: ext.contextPath+'/JS/webuploader-0.1.5/Uploader.swf',
|
||||
// 文件接收服务端。
|
||||
server: ext.contextPath+'/equipment/importequipmentCard.do',
|
||||
// 选择文件的按钮。可选。
|
||||
// 内部根据当前运行是创建,可能是input元素,也可能是flash.
|
||||
pick: {
|
||||
id: '#picker',
|
||||
multiple: false
|
||||
},
|
||||
// 不压缩image, 默认如果是jpeg,文件上传前会压缩一把再上传!
|
||||
resize: false,
|
||||
accept: {
|
||||
title: 'Excel',
|
||||
extensions: 'xls,xlsx',
|
||||
mimeTypes: 'excel/*'
|
||||
}
|
||||
});
|
||||
//当有文件被添加进队列的时候
|
||||
uploader.on( 'fileQueued', function( file ) {
|
||||
$list.append( '<div id="' + file.id + '" class="item">' +
|
||||
'<h4 class="info">' + file.name + '</h4>' +
|
||||
'<p class="state">等待上传...</p>' +
|
||||
'</div>' );
|
||||
});
|
||||
});
|
||||
|
||||
var doimport = function(dialog, grid){
|
||||
//执行上传功能
|
||||
if ( state === 'uploading' ) {
|
||||
alert("文件正在上传中,请稍等");
|
||||
} else {
|
||||
uploader.upload();
|
||||
}
|
||||
|
||||
uploader.on( 'uploadError', function( file ) {
|
||||
$( '#'+file.id ).find('p.state').text('上传出错');
|
||||
});
|
||||
|
||||
uploader.on( 'uploadSuccess', function( file,response ) {
|
||||
$( '#'+file.id ).find('p.state').text('已上传');
|
||||
if(response.feedback!=null&&response.feedback!=""){
|
||||
alert(response.feedback);
|
||||
grid.datagrid('reload');
|
||||
dialog.dialog('destroy');
|
||||
}else{
|
||||
alert("导入未完成!");
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="uploader" class="wu-example">
|
||||
<div class="btns">
|
||||
<div id="picker">选择文件</div>
|
||||
</div>
|
||||
<!--用来存放文件信息-->
|
||||
<div id="thelist" class="uploader-list"></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
58
bin/WebRoot/jsp/equipment/equipmentClassAdd.jsp
Normal file
58
bin/WebRoot/jsp/equipment/equipmentClassAdd.jsp
Normal file
@ -0,0 +1,58 @@
|
||||
<!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"%>
|
||||
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
function dosave(dialog,grid) {
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/equipment/saveEquipmentClass.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');
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<table class="table">
|
||||
|
||||
<tr>
|
||||
<th >类型名称</th>
|
||||
<td ><input id="name" name="name" class="easyui-textbox" data-options="required:true,validType:'isBlank'" style="overflow:auto;" value="" /></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th >管理状态</th>
|
||||
<td ><select id="status" name="status" class="easyui-combobox" data-options="panelHeight:'auto'">
|
||||
<option value="启用">启用</option>
|
||||
<option value="禁用">禁用</option>
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >备注</th>
|
||||
<td ><input id="remark" name="remark" class="easyui-textbox" data-options="multiline:true" style="overflow:auto;width:100%;height:80px;" value=""
|
||||
validtype="length[0,250]" invalidMessage="有效长度0-250"/></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
59
bin/WebRoot/jsp/equipment/equipmentClassEdit.jsp
Normal file
59
bin/WebRoot/jsp/equipment/equipmentClassEdit.jsp
Normal file
@ -0,0 +1,59 @@
|
||||
<!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"%>
|
||||
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
function dosave(dialog,grid) {
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/equipment/updateEquipmentClass.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');
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<table class="table">
|
||||
<input id="id" name="id" type="hidden" value="${ equipmentclass.id}"/>
|
||||
<tr>
|
||||
<th >类型名称</th>
|
||||
<td ><input id="name" name="name" class="easyui-textbox" data-options="required:true,validType:'isBlank'" style="overflow:auto;" value="${equipmentclass.name }" /></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th >管理状态</th>
|
||||
<td ><select id="status" name="status" class="easyui-combobox" data-options="panelHeight:'auto'">
|
||||
<option value="启用" <c:if test="${equipmentclass.status=='启用' }">selected</c:if>>启用</option>
|
||||
<option value="禁用" <c:if test="${equipmentclass.status=='禁用' }">selected</c:if>>禁用</option>
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >备注</th>
|
||||
<td ><input id="remark" name="remark" class="easyui-textbox"
|
||||
validtype="length[0,250]" invalidMessage="有效长度0-250"
|
||||
data-options="multiline:true" style="overflow:auto;width:100%;height:80px;" value="${equipmentclass.remark}" /></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
230
bin/WebRoot/jsp/equipment/equipmentClassList.jsp
Normal file
230
bin/WebRoot/jsp/equipment/equipmentClassList.jsp
Normal file
@ -0,0 +1,230 @@
|
||||
<%@ 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">
|
||||
var grid;
|
||||
var addFun = function() {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '添加设备类型信息',
|
||||
url : ext.contextPath + '/equipment/addEquipmentClass.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/viewEquipmentClass.do?id=' + id
|
||||
});
|
||||
dialog.dialog({
|
||||
onClose:function(){
|
||||
grid.datagrid('reload');
|
||||
}
|
||||
});
|
||||
};
|
||||
var editFun = function(id) {
|
||||
grid.datagrid('clearChecked');
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '编辑设备类型信息',
|
||||
url : ext.contextPath + '/equipment/editEquipmentClass.do?id=' + id,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
dialog.dialog({
|
||||
onClose:function(){
|
||||
grid.datagrid('reload');
|
||||
}
|
||||
});
|
||||
};
|
||||
var deleteFun = function(id) {
|
||||
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/equipment/deleteEquipmentClass.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
top.$.messager.alert('提示','删除成功','info');
|
||||
grid.datagrid('reload');
|
||||
}else{
|
||||
top.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
var deletesFun = function() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
if(datas==""){
|
||||
top.$.messager.alert('提示', '请先选择要删除的记录','info');
|
||||
}else{
|
||||
top.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/equipment/deleteEquipmentClasses.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
top.$.messager.alert('提示','成功删除'+data+'条记录','info');
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
}else{
|
||||
top.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
//同步PLM设备类型同步信息
|
||||
var synchroFun = function() {
|
||||
parent.$.messager.confirm('提示', '您确定要与PLM系统同步设备类型信息?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/equipment/synchroEquipmentClass.do', "" , function(data) {
|
||||
if(data>0){
|
||||
parent.$.messager.alert('提示','同步成功','info');
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
}else{
|
||||
parent.$.messager.alert('提示','同步失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/equipment/getEquipmentClass.do',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
ctrlSelect:true,
|
||||
singleSelect: false,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
selectOnCheck: true,
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '100', title : '名称', field : 'name', sortable : true, halign:'center'},
|
||||
{width : '80', title : '备注', field : 'remark', sortable : true, halign:'center'},
|
||||
|
||||
{width : '50', title : '状态', field: 'status', sortable : true, halign:'center'},
|
||||
{width : '180', title : '最后更新时间', field : 'insdt', sortable : true, halign:'center',formatter:function(value){
|
||||
return value.substring(0,19);
|
||||
}
|
||||
},
|
||||
{title : '操作', field : 'action', width : '90', 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/editEquipmentClass.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_edit" title="编辑" onclick="editFun(\''+row.id+'\');"/> ';
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"equipment/deleteEquipmentClass.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);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function formattime(val) {
|
||||
var year = parseInt(val.year) + 1900;
|
||||
var month = (parseInt(val.month) + 1);
|
||||
month = month > 9 ? month : ('0' + month);
|
||||
var date = parseInt(val.date);
|
||||
date = date > 9 ? date : ('0' + date);
|
||||
var hours = parseInt(val.hours);
|
||||
hours = hours > 9 ? hours : ('0' + hours);
|
||||
var minutes = parseInt(val.minutes);
|
||||
minutes = minutes > 9 ? minutes : ('0' + minutes);
|
||||
var seconds = parseInt(val.seconds);
|
||||
seconds = seconds > 9 ? seconds : ('0' + seconds);
|
||||
var time = year + '-' + month + '-' + date + ' ' + hours + ':'
|
||||
+ minutes + ':' + seconds;
|
||||
return time;
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<%if (sessionManager.havePermission(session,"equipment/addEquipmentClass.do")) {%>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
|
||||
onclick="addFun();">添加</a>
|
||||
<%}%>
|
||||
</td>
|
||||
<td>
|
||||
<%if (sessionManager.havePermission(session,"equipment/deleteEquipmentClass.do")) {%>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true"
|
||||
onclick="deletesFun();">删除</a>
|
||||
<%}%>
|
||||
</td>
|
||||
<%if (sessionManager.havePermission(session,"equipment/addEquipmentClass.do")) {%>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
|
||||
onclick="synchroFun();">同步</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="">导入</a></td>
|
||||
<td><a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-table_go',plain:true" onclick="">导出</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>
|
||||
<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>
|
||||
39
bin/WebRoot/jsp/equipment/equipmentClassView.jsp
Normal file
39
bin/WebRoot/jsp/equipment/equipmentClassView.jsp
Normal file
@ -0,0 +1,39 @@
|
||||
<!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"%>
|
||||
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<table class="table">
|
||||
|
||||
<tr>
|
||||
<th >类型名称</th>
|
||||
<td >${equipmentclass.name}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th >管理状态</th>
|
||||
<td >${equipmentclass.status}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >备注</th>
|
||||
<td colspan="3">
|
||||
<input name="remark" class="easyui-textbox" value="${equipmentclass.remark}" validtype="length[0,250]" invalidMessage="有效长度0-250"
|
||||
data-options="multiline:true" style="width:100%;height:100px"/>
|
||||
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
96
bin/WebRoot/jsp/equipment/equipmentListForSelect.jsp
Normal file
96
bin/WebRoot/jsp/equipment/equipmentListForSelect.jsp
Normal file
@ -0,0 +1,96 @@
|
||||
<%@ 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 selectID(dialog, grid) {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas = '{"equipmentcard":"'+item.equipmentcardid +'_'+item.equipmentname+'","id":"'+item.id +'"}';
|
||||
});
|
||||
return $.parseJSON(datas);
|
||||
}
|
||||
|
||||
var grid;
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/equipment/getEquipmentCard.do?querytype=select',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: true,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '80', title : '设备编号', field : 'equipmentcardid', sortable : true, halign:'center'},
|
||||
{width : '100', title : '设备名称', field : 'equipmentname', sortable : true, halign:'center'},
|
||||
{width : '100', title : '设备型号', field: 'equipmentmodel', sortable : true, halign:'center'},
|
||||
{width : '100', title : '设备类型', field: 'equipmentclass', sortable : true, halign:'center',formatter:function(value){
|
||||
if(value!=null){
|
||||
return value.name;
|
||||
}} },
|
||||
{width : '100', title : '存放位置', field: 'geographyarea', sortable : true, halign:'center',formatter:function(value){
|
||||
if(value!=null){
|
||||
return value.name;
|
||||
} }},
|
||||
|
||||
|
||||
{width : '50', title : '管理状态', field: 'currentmanageflag', sortable : true, halign:'center'},
|
||||
{width : '80', title : '备注', field : 'remark', sortable : true, halign:'center'}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
var mids = localStorage.getItem("mids").split(",");
|
||||
localStorage.removeItem("mids");
|
||||
|
||||
$.each(mids, function(index, item){
|
||||
if(item != ""){
|
||||
$('#grid').datagrid("checkRow",$('#grid').datagrid("getRowIndex",item));
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
</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>
|
||||
170
bin/WebRoot/jsp/equipment/equipmentMaintainAdd.jsp
Normal file
170
bin/WebRoot/jsp/equipment/equipmentMaintainAdd.jsp
Normal file
@ -0,0 +1,170 @@
|
||||
<!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 dosave(dialog,grid) {
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/equipment/equipmentmaintain/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');
|
||||
}
|
||||
}
|
||||
function selectequipmentmaintain(equipmentid,eid){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择设备',
|
||||
width: 700,
|
||||
height:420,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/equipment/equipmentmaintain/showListForSelect.do',
|
||||
toolbar:'',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectFun();
|
||||
if(res!=null){
|
||||
console.log("enter",res);
|
||||
dialog.dialog('destroy');
|
||||
$("#"+equipmentid).textbox("setValue",res.equipmentid);
|
||||
$("#"+eid).val(res.id);
|
||||
$("#equipmentname").html(res.equipmentname);
|
||||
$("#equipmentclassid").html(res.equipmentclass);
|
||||
$("#equipmentmodel").html(res.equipmentmodel);
|
||||
$("#areaid").html(res.geographyarea);
|
||||
$("#currentmanageflag").html(res.currentmanageflag);
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '取消',
|
||||
iconCls:'icon-cancel',
|
||||
handler : function() {
|
||||
// dialog.find('iframe').get(0).contentWindow.selectCancel();
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
$(function() {
|
||||
$("#equipmentid").textbox('textbox').bind("click", function () {
|
||||
selectequipmentmaintain("equipmentid","eid");
|
||||
});
|
||||
});
|
||||
function selectmaintenanceman(maintenanceman,mid){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择维修者',
|
||||
width: 700,
|
||||
height:420,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/equipment/equipmentmaintain/showMaintenancemanForSelect.do',
|
||||
toolbar:'',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectFun();
|
||||
if(res!=null){
|
||||
dialog.dialog('destroy');
|
||||
$("#"+maintenanceman).textbox("setValue",res.name);
|
||||
$("#"+mid).val(res.id);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '取消',
|
||||
iconCls:'icon-cancel',
|
||||
handler : function() {
|
||||
// dialog.find('iframe').get(0).contentWindow.selectCancel();
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
$(function() {
|
||||
$("#maintenanceman").textbox('textbox').bind("click", function () {
|
||||
selectmaintenanceman("maintenanceman","mid");
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>设备编号</th>
|
||||
<td >
|
||||
<input id="equipmentid" name="equipmentid" class="easyui-textbox" data-options="required:true,validType:'isBlank',prompt:'单击选择'" value="" readonly/>
|
||||
<input id="eid" name="eid" type="hidden" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>设备名称</th>
|
||||
<td>
|
||||
<span id="equipmentname"></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>设备类型</th>
|
||||
<td><span id="equipmentclassid" ></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>设备型号</th>
|
||||
<td><span id="equipmentmodel" ></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>存放位置</th>
|
||||
<td><span id="areaid"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>状态</th>
|
||||
<td><span id="currentmanageflag" ></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>维修描述</th>
|
||||
<td ><input id="describe" name="describe" class="easyui-textbox"
|
||||
data-options="multiline:true" style="overflow:auto;width:100%;height:80px;" value=""
|
||||
validtype="length[0,250]" invalidMessage="有效长度0-250"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>维修时间</th>
|
||||
<td><input id="time" name="time" class="Wdate"
|
||||
value="" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" readonly/>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<th>维修者</th>
|
||||
<td><input id="maintenanceman" name="maintenanceman" class="easyui-textbox" data-options="required:true,validType:'isBlank',prompt:'单击选择'" value="" readonly/>
|
||||
<input id="mid" name="mid" type="hidden" value="" /></td>
|
||||
|
||||
</tr>
|
||||
|
||||
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
169
bin/WebRoot/jsp/equipment/equipmentMaintainEdit.jsp
Normal file
169
bin/WebRoot/jsp/equipment/equipmentMaintainEdit.jsp
Normal file
@ -0,0 +1,169 @@
|
||||
<!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 dosave(dialog,grid) {
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/equipment/equipmentmaintain/update.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');
|
||||
}
|
||||
}
|
||||
function selectequipmentmaintain(equipmentid,equipmentcardid){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择设备',
|
||||
width: 700,
|
||||
height:420,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/equipment/equipmentmaintain/showListForSelect.do',
|
||||
toolbar:'',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectFun();
|
||||
if(res!=null){
|
||||
console.log("enter",res);
|
||||
dialog.dialog('destroy');
|
||||
$("#"+equipmentid).textbox("setValue",res.equipmentid);
|
||||
$("#"+equipmentcardid).val(res.id);
|
||||
$("#equipmentname").html(res.equipmentname);
|
||||
$("#equipmentclassid").html(res.equipmentclass);
|
||||
$("#equipmentmodel").html(res.equipmentmodel);
|
||||
$("#areaid").html(res.geographyarea);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '取消',
|
||||
iconCls:'icon-cancel',
|
||||
handler : function() {
|
||||
// dialog.find('iframe').get(0).contentWindow.selectCancel();
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
$(function() {
|
||||
$("#equipmentid").textbox('textbox').bind("click", function () {
|
||||
selectequipmentmaintain("equipmentid","equipmentcardid");
|
||||
});
|
||||
});
|
||||
function selectmaintenanceman(mancaption,maintenanceman){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择维修者',
|
||||
width: 700,
|
||||
height:420,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/equipment/equipmentmaintain/showMaintenancemanForSelect.do',
|
||||
toolbar:'',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectFun();
|
||||
if(res!=null){
|
||||
console.log("enter",res);
|
||||
dialog.dialog('destroy');
|
||||
$("#"+mancaption).textbox("setValue",res.name);
|
||||
$("#"+maintenanceman).val(res.id);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '取消',
|
||||
iconCls:'icon-cancel',
|
||||
handler : function() {
|
||||
// dialog.find('iframe').get(0).contentWindow.selectCancel();
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
$(function() {
|
||||
$("#mancaption").textbox('textbox').bind("click", function () {
|
||||
selectmaintenanceman("mancaption","maintenanceman");
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<input type="hidden" name="id" value="${equipmentmaintain.id}"/>
|
||||
<table class="table">
|
||||
|
||||
<tr>
|
||||
<th >设备编号</th>
|
||||
<td><input id="equipmentid" name="equipmentid" class="easyui-textbox" data-options="required:true,validType:'isBlank',"value="${equipmentmaintain.equipmentcode}" readonly/>
|
||||
<input id="equipmentcardid" name="equipmentcardid" type="hidden" value="${equipmentmaintain.equipmentcardid}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>设备名称</th>
|
||||
<td><span id="equipmentname"></span> </td>
|
||||
<script type="text/javascript">
|
||||
document.getElementById('equipmentname').innerText="${equipmentmaintain.equipmentname}";
|
||||
</script>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>设备类型</th>
|
||||
<td><span id="equipmentclassid"></span> </td>
|
||||
<script type="text/javascript">
|
||||
document.getElementById('equipmentclassid').innerText="${equipmentmaintain.equipmentclassid}";
|
||||
</script>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>设备型号</th>
|
||||
<td><span id="equipmentmodel"></span> </td>
|
||||
<script type="text/javascript">
|
||||
document.getElementById('equipmentmodel').innerText="${equipmentmaintain.equipmentmodel}";
|
||||
</script>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>存放位置</th>
|
||||
<td><span id="areaid"></span> </td>
|
||||
<script type="text/javascript">
|
||||
document.getElementById('areaid').innerText="${equipmentmaintain.areaid}";
|
||||
</script>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >维修者</th>
|
||||
<td><input id="mancaption" name="mancaption" class="easyui-textbox" data-options="required:true,validType:'isBlank',"value="${equipmentmaintain.mancaption}" readonly/>
|
||||
<input id="maintenanceman" name="maintenanceman" type="hidden" value="${equipmentmaintain.maintenanceman}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >维修描述</th>
|
||||
<td ><input id="describe" name="describe" class="easyui-textbox"
|
||||
data-options="multiline:true" style="overflow:auto;width:100%;height:80px;"
|
||||
validtype="length[0,250]" invalidMessage="有效长度0-250"
|
||||
value="${ equipmentmaintain.describe}" /></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
195
bin/WebRoot/jsp/equipment/equipmentMaintainList.jsp
Normal file
195
bin/WebRoot/jsp/equipment/equipmentMaintainList.jsp
Normal file
@ -0,0 +1,195 @@
|
||||
<%@ 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>
|
||||
106
bin/WebRoot/jsp/equipment/equipmentMaintainListForSelect.jsp
Normal file
106
bin/WebRoot/jsp/equipment/equipmentMaintainListForSelect.jsp
Normal file
@ -0,0 +1,106 @@
|
||||
<%@ 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">
|
||||
function selectFun(dialog, grid) {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas = '{"equipmentid":"'+item.equipmentcardid +'","id":"'+item.id+'","equipmentname":"'+item.equipmentname +'",'+
|
||||
'"equipmentmodel":"'+item.equipmentmodel +'","equipmentclass":"'+item.equipmentclass.name+'",'+
|
||||
'"geographyarea":"'+item.geographyarea.name +'","currentmanageflag":"'+item.currentmanageflag +'","remark":"'+item.remark +'"}';
|
||||
});
|
||||
return $.parseJSON(datas);
|
||||
}
|
||||
|
||||
var grid;
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/equipment/getEquipmentCard.do?querytype=select',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: true,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '160', title : '设备编号', field : 'equipmentcardid', sortable : true, halign:'center'},
|
||||
{width : '240', title : '设备名称', field : 'equipmentname', sortable : true, halign:'center'},
|
||||
{width : '80', title : '设备型号', field : 'equipmentmodel', sortable : true, halign:'center'},
|
||||
{width : '80', title : '设备类型', field : 'equipmentclass', sortable : true, halign:'center' ,formatter:function(value){
|
||||
if(value!=null){
|
||||
if(value.status=="禁用"){
|
||||
return value.name+"<img class='iconImg ext-icon-bullet_error' title='该类型已禁用' /> ";
|
||||
}else{
|
||||
|
||||
return value.name;
|
||||
}}}
|
||||
},
|
||||
{width : '180', title : '存放位置', field : 'geographyarea', sortable : true, halign:'center',formatter:function(value){
|
||||
if(value!=null){
|
||||
if(value.status=="禁用"){
|
||||
return value.name+"<img class='iconImg ext-icon-bullet_error' title='该位置已禁用' /> ";
|
||||
}else{
|
||||
return value.name;
|
||||
}}
|
||||
}},
|
||||
{width : '80', title : '状态', field : 'currentmanageflag', sortable : true, halign:'center'},
|
||||
{width : '80', title : '备注', field : 'remark', sortable : true, halign:'center'},
|
||||
] ],
|
||||
toolbar : '#toolbar'
|
||||
});
|
||||
|
||||
$('#search_dept').combotree({
|
||||
url : ext.contextPath + '/user/getUnitsJson.do?random=' + Math.random(),
|
||||
parentField : 'pid',
|
||||
method:'get',
|
||||
onBeforeSelect:function(node){
|
||||
if(node.id=="-1"){
|
||||
$("#deptid").tree("unselect");
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
</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 class="tooltable">
|
||||
<tr>
|
||||
<td>设备名称</td>
|
||||
<td><input id="search_name" name="search_name" class="easyui-textbox" /></td>
|
||||
<td>存放位置</td>
|
||||
<td><input id="search_areaid" name="search_areaid" class="easyui-texbox"/></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="$('#search_name').textbox('setValue','');$('#search_line').combobox('setValue','');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>
|
||||
54
bin/WebRoot/jsp/equipment/equipmentMaintainView.jsp
Normal file
54
bin/WebRoot/jsp/equipment/equipmentMaintainView.jsp
Normal file
@ -0,0 +1,54 @@
|
||||
<!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>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<input type="hidden" id="id" name="id" value="${equipmentMaintain.id}"/>
|
||||
|
||||
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th >设备编号</th>
|
||||
<td >${equipmentMaintain.equipmentcardid}</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<th>设备名称</th>
|
||||
<td> ${equipmentMaintain.equipmentname}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>设备类型</th>
|
||||
<td> ${equipmentMaintain.equipmentclassid} </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>设备型号</th>
|
||||
<td> ${equipmentMaintain.equipmentmodel}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>存放位置</th>
|
||||
<td> ${equipmentMaintain.areaid} </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >状态</th>
|
||||
<td >${equipmentMaintain.currentmanageflag}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >维修者</th>
|
||||
<td >${equipmentMaintain.maintenanceman}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >维修描述</th>
|
||||
<td >${equipmentMaintain.describe}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br />
|
||||
<div class="barcode2" id="div128" style="text-align:center;margin-left:250px;margin-top:200px;"></div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
56
bin/WebRoot/jsp/equipment/geographyAreaAdd.jsp
Normal file
56
bin/WebRoot/jsp/equipment/geographyAreaAdd.jsp
Normal file
@ -0,0 +1,56 @@
|
||||
<!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"%>
|
||||
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
function dosave(dialog,grid) {
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/equipment/saveGeographyArea.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');
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<table class="table">
|
||||
|
||||
<tr>
|
||||
<th >位置名称</th>
|
||||
<td ><input id="name" name="name" class="easyui-textbox" data-options="required:true,validType:'isBlank'" style="overflow:auto;" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >管理状态</th>
|
||||
<td ><select id="status" name="status" class="easyui-combobox" data-options="panelHeight:'auto'">
|
||||
<option value="启用">启用</option>
|
||||
<option value="禁用">禁用</option>
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >备注</th>
|
||||
<td ><input id="remark" name="remark" class="easyui-textbox" data-options="multiline:true" style="overflow:auto;width:100%;height:80px;" value="" validtype="length[0,250]" invalidMessage="有效长度0-250"/></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
58
bin/WebRoot/jsp/equipment/geographyAreaEdit.jsp
Normal file
58
bin/WebRoot/jsp/equipment/geographyAreaEdit.jsp
Normal file
@ -0,0 +1,58 @@
|
||||
<!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"%>
|
||||
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
function dosave(dialog,grid) {
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/equipment/updateGeographyArea.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');
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<table class="table">
|
||||
<input id="id" name="id" type="hidden" value="${ geographyarea.id}"/>
|
||||
<tr>
|
||||
<th >位置名称</th>
|
||||
<td ><input id="name" name="name" class="easyui-textbox" data-options="required:true,validType:'isBlank'" style="overflow:auto;" value="${geographyarea.name }" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >管理状态</th>
|
||||
<td ><select id="status" name="status" class="easyui-combobox" data-options="panelHeight:'auto'">
|
||||
<option value="启用" <c:if test="${geographyarea.status=='启用' }">selected</c:if>>启用</option>
|
||||
<option value="禁用" <c:if test="${geographyarea.status=='禁用' }">selected</c:if>>禁用</option>
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >备注</th>
|
||||
<td ><input id="remark" name="remark" class="easyui-textbox"
|
||||
validtype="length[0,250]" invalidMessage="有效长度0-250"
|
||||
data-options="multiline:true" style="overflow:auto;width:100%;height:80px;" value="${geographyarea.remark }" /></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
219
bin/WebRoot/jsp/equipment/geographyAreaList.jsp
Normal file
219
bin/WebRoot/jsp/equipment/geographyAreaList.jsp
Normal file
@ -0,0 +1,219 @@
|
||||
<%@ 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();
|
||||
%>
|
||||
<%String contextPath = request.getContextPath();%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
|
||||
<script type="text/javascript" src="<%=contextPath%>/JS/datagrid-dnd.js"></script>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
var addFun = function() {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '添加设备存放位置信息',
|
||||
url : ext.contextPath + '/equipment/addGeographyArea.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/viewGeographyArea.do?id=' + id
|
||||
});
|
||||
dialog.dialog({
|
||||
onClose:function(){
|
||||
grid.datagrid('reload');
|
||||
}
|
||||
});
|
||||
};
|
||||
var editFun = function(id) {
|
||||
grid.datagrid('clearChecked');
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '编辑设备存放位置信息',
|
||||
url : ext.contextPath + '/equipment/editGeographyArea.do?id=' + id,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
dialog.dialog({
|
||||
onClose:function(){
|
||||
grid.datagrid('reload');
|
||||
}
|
||||
});
|
||||
};
|
||||
var deleteFun = function(id) {
|
||||
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/equipment/deleteGeographyArea.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
top.$.messager.alert('提示','删除成功','info');
|
||||
grid.datagrid('reload');
|
||||
}else{
|
||||
top.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
var deletesFun = function() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
if(datas==""){
|
||||
top.$.messager.alert('提示', '请先选择要删除的记录','info');
|
||||
}else{
|
||||
top.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/equipment/deleteGeographyAreas.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
top.$.messager.alert('提示','成功删除'+data+'条记录','info');
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
}else{
|
||||
top.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/equipment/getGeographyArea.do',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
ctrlSelect:true,
|
||||
singleSelect: false,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
selectOnCheck: true,
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '100', title : '名称', field : 'name', sortable : true, halign:'center'},
|
||||
{width : '120', title : '备注', field : 'remark', sortable : true, halign:'center'},
|
||||
{width : '50', title : '状态', field: 'status', sortable : true, halign:'center'},
|
||||
{width : '120', title : '最后更新时间', field : 'insdt', sortable : true, halign:'center',formatter:function(value){
|
||||
return value.substring(0,19);
|
||||
}
|
||||
},
|
||||
{title : '操作', field : 'action', width : '90', 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/editGeographyArea.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_edit" title="编辑" onclick="editFun(\''+row.id+'\');"/> ';
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"equipment/deleteGeographyArea.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);
|
||||
//$(this).datagrid('enableDnd');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function formattime(val) {
|
||||
var year = parseInt(val.year) + 1900;
|
||||
var month = (parseInt(val.month) + 1);
|
||||
month = month > 9 ? month : ('0' + month);
|
||||
var date = parseInt(val.date);
|
||||
date = date > 9 ? date : ('0' + date);
|
||||
var hours = parseInt(val.hours);
|
||||
hours = hours > 9 ? hours : ('0' + hours);
|
||||
var minutes = parseInt(val.minutes);
|
||||
minutes = minutes > 9 ? minutes : ('0' + minutes);
|
||||
var seconds = parseInt(val.seconds);
|
||||
seconds = seconds > 9 ? seconds : ('0' + seconds);
|
||||
var time = year + '-' + month + '-' + date + ' ' + hours + ':'
|
||||
+ minutes + ':' + seconds;
|
||||
return time;
|
||||
}
|
||||
function allow(){
|
||||
grid.datagrid('enableDnd');
|
||||
//grid.datagrid('reload');
|
||||
}
|
||||
function notallow(){
|
||||
grid.datagrid('reload');
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<%if (sessionManager.havePermission(session,"equipment/addGeographyArea.do")) {%>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
|
||||
onclick="addFun();">添加</a>
|
||||
<%}%>
|
||||
</td>
|
||||
<td>
|
||||
<%if (sessionManager.havePermission(session,"equipment/deleteGeographyArea.do")) {%>
|
||||
<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="">导入</a></td>
|
||||
<td><a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-table_go',plain:true" onclick="">导出</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>
|
||||
<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>
|
||||
35
bin/WebRoot/jsp/equipment/geographyAreaView.jsp
Normal file
35
bin/WebRoot/jsp/equipment/geographyAreaView.jsp
Normal file
@ -0,0 +1,35 @@
|
||||
<!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"%>
|
||||
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<table class="table">
|
||||
|
||||
<tr>
|
||||
<th >类型名称</th>
|
||||
<td >${geographyarea.name}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >管理状态</th>
|
||||
<td >${geographyarea.status}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >备注</th>
|
||||
<td >${geographyarea.remark}</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
79
bin/WebRoot/jsp/equipment/importMaintenancePlan.jsp
Normal file
79
bin/WebRoot/jsp/equipment/importMaintenancePlan.jsp
Normal file
@ -0,0 +1,79 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>导入人员</title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script>
|
||||
var uploader,state;
|
||||
$(function() {
|
||||
var $ = jQuery,
|
||||
$list = $('#thelist'),
|
||||
state = 'pending';
|
||||
|
||||
uploader = WebUploader.create({
|
||||
// swf文件路径
|
||||
swf: ext.contextPath+'/JS/webuploader-0.1.5/Uploader.swf',
|
||||
// 文件接收服务端。
|
||||
server: ext.contextPath+'/equipment/maintenanceplan/importMaintenancePlan.do',
|
||||
// 选择文件的按钮。可选。
|
||||
// 内部根据当前运行是创建,可能是input元素,也可能是flash.
|
||||
pick: {
|
||||
id: '#picker',
|
||||
multiple: false
|
||||
},
|
||||
// 不压缩image, 默认如果是jpeg,文件上传前会压缩一把再上传!
|
||||
resize: false,
|
||||
accept: {
|
||||
title: 'Excel',
|
||||
extensions: 'xls,xlsx',
|
||||
mimeTypes: 'excel/*'
|
||||
}
|
||||
});
|
||||
//当有文件被添加进队列的时候
|
||||
uploader.on( 'fileQueued', function( file ) {
|
||||
$list.append( '<div id="' + file.id + '" class="item">' +
|
||||
'<h4 class="info">' + file.name + '</h4>' +
|
||||
'<p class="state">等待上传...</p>' +
|
||||
'</div>' );
|
||||
});
|
||||
});
|
||||
|
||||
var doimport = function(dialog, grid){
|
||||
//执行上传功能
|
||||
if ( state === 'uploading' ) {
|
||||
alert("文件正在上传中,请稍等");
|
||||
} else {
|
||||
uploader.upload();
|
||||
}
|
||||
|
||||
uploader.on( 'uploadError', function( file ) {
|
||||
$( '#'+file.id ).find('p.state').text('上传出错');
|
||||
});
|
||||
|
||||
uploader.on( 'uploadSuccess', function( file,response ) {
|
||||
$( '#'+file.id ).find('p.state').text('已上传');
|
||||
if(response.feedback!=null&&response.feedback!=""){
|
||||
|
||||
alert(response.feedback);
|
||||
grid.datagrid('reload');
|
||||
dialog.dialog('destroy');
|
||||
}else{
|
||||
alert("导入未完成!");
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="uploader" class="wu-example">
|
||||
<div class="btns">
|
||||
<div id="picker">选择文件</div>
|
||||
</div>
|
||||
<!--用来存放文件信息-->
|
||||
<div id="thelist" class="uploader-list"></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
172
bin/WebRoot/jsp/equipment/maintenancePlanAdd.jsp
Normal file
172
bin/WebRoot/jsp/equipment/maintenancePlanAdd.jsp
Normal file
@ -0,0 +1,172 @@
|
||||
<!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>xxx</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 dosave(dialog,grid) {
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/equipment/maintenanceplan/save.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(){
|
||||
$("#mids").val(getids());
|
||||
localStorage.setItem("mids",$("#mids").val());
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '添加设备',
|
||||
height:500,
|
||||
url : ext.contextPath + '/equipment/showEquipmentCardForSelects.do?',
|
||||
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:"300",
|
||||
title: '相关设备',
|
||||
tools: [{
|
||||
iconCls:'icon-add',
|
||||
handler:function(){doadd();}
|
||||
},{
|
||||
iconCls:'icon-remove',
|
||||
handler:function(){dodelete();}
|
||||
}]
|
||||
});
|
||||
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
idField : 'id',
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{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 : 'equipmentclass', sortable : true, editor:'textbox',halign:'center'},
|
||||
{width : '100', title : '存放位置', field : 'geographyarea', sortable : true, editor:'textbox',halign:'center'}
|
||||
] ]
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<input id="mids" name="mids" type="hidden" value="" />
|
||||
<form method="post" class="form">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th >保养计划类型</th>
|
||||
<td ><select id="plantype" name="plantype" class="easyui-combobox" data-options="panelHeight:'auto'">
|
||||
<option value="0">周计划</option>
|
||||
<option value="1">月计划</option>
|
||||
<option value="2">年计划</option>
|
||||
</select></td>
|
||||
<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><input id="plantime" name="plantime" class="Wdate"
|
||||
value="" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})"readonly/>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>备注</th>
|
||||
<td>
|
||||
<input name="remark" class="easyui-textbox" style="width:100%;height:25px" value=""
|
||||
data-options="multiline:true" validtype="length[0,250]" invalidMessage="有效长度0-250" />
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<br/>
|
||||
<div id="p">
|
||||
<table id="grid" data-options="border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
176
bin/WebRoot/jsp/equipment/maintenancePlanEdit.jsp
Normal file
176
bin/WebRoot/jsp/equipment/maintenancePlanEdit.jsp
Normal file
@ -0,0 +1,176 @@
|
||||
<!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(){
|
||||
$("#mids").val(getids());
|
||||
localStorage.setItem("mids",$("#mids").val());
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '添加设备',
|
||||
height:500,
|
||||
url : ext.contextPath + '/equipment/showEquipmentCardForSelects.do?',
|
||||
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,
|
||||
equipmentclassid:datas[i].equipmentclass,
|
||||
areaid: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:"300",
|
||||
title: '相关设备',
|
||||
tools: [{
|
||||
iconCls:'icon-add',
|
||||
handler:function(){doadd();}
|
||||
},{
|
||||
iconCls:'icon-remove',
|
||||
handler:function(){dodelete();}
|
||||
}]
|
||||
});
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
idField : 'id',
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{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>
|
||||
<input id="mids" name="mids" type="hidden" value="" />
|
||||
|
||||
<form method="post" class="form">
|
||||
<input name="id" type="hidden" value="${maintenanceplan.id}"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>保养计划类型</th>
|
||||
<td>
|
||||
<select name="plantype" class="easyui-combobox" data-options="panelHeight:'auto',editable:false">
|
||||
<option value="0" <c:if test="${maintenanceplan.plantype=='0'}">selected</c:if>>周计划</option>
|
||||
<option value="1" <c:if test="${maintenanceplan.plantype=='1'}">selected</c:if>>月计划</option>
|
||||
<option value="2" <c:if test="${maintenanceplan.plantype=='2'}">selected</c:if>>年计划</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>保养计划编号</th>
|
||||
<td><input name="plannumber" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${maintenanceplan.plannumber}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>保养计划内容</th>
|
||||
<td><input name="plancontent" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${maintenanceplan.plancontent}" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>计划执行时间</th>
|
||||
<td><input id="plantime" name="plantime" class="Wdate"
|
||||
value="${fn:substring(maintenanceplan.plantime,0,10)}" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})"readonly/>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<th>备注</th>
|
||||
<td>
|
||||
<textarea name="remark" class="easyui-textbox" data-options="multiline:true" style="height:25px;width:100%" validtype="length[0,250]" invalidMessage="有效长度0-250">${maintenanceplan.remark}</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<br/>
|
||||
|
||||
<div id="p">
|
||||
<table id="grid" data-options="border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
275
bin/WebRoot/jsp/equipment/maintenancePlanList.jsp
Normal file
275
bin/WebRoot/jsp/equipment/maintenancePlanList.jsp
Normal file
@ -0,0 +1,275 @@
|
||||
<%@ 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>
|
||||
141
bin/WebRoot/jsp/equipment/maintenancePlanListForSelects.jsp
Normal file
141
bin/WebRoot/jsp/equipment/maintenancePlanListForSelects.jsp
Normal file
@ -0,0 +1,141 @@
|
||||
<%@ 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>
|
||||
181
bin/WebRoot/jsp/equipment/maintenancePlanView.jsp
Normal file
181
bin/WebRoot/jsp/equipment/maintenancePlanView.jsp
Normal file
@ -0,0 +1,181 @@
|
||||
<!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>
|
||||
195
bin/WebRoot/jsp/equipment/maintenanceRecordAdd.jsp
Normal file
195
bin/WebRoot/jsp/equipment/maintenanceRecordAdd.jsp
Normal file
@ -0,0 +1,195 @@
|
||||
<%@ 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>
|
||||
102
bin/WebRoot/jsp/equipment/maintenanceRecordEdit.jsp
Normal file
102
bin/WebRoot/jsp/equipment/maintenanceRecordEdit.jsp
Normal file
@ -0,0 +1,102 @@
|
||||
<!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 doupdate(dialog,grid) {
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/equipment/maintenancerecord/update.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 if (data.res==2){
|
||||
top.$.messager.alert('', "实际执行时间有误!",'info', function() {
|
||||
grid.datagrid('reload');
|
||||
dialog.dialog('destroy');
|
||||
});
|
||||
}else{
|
||||
top.$.messager.alert('提示', data.res, 'info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<input id="mids" name="mids" type="hidden" value="" />
|
||||
<form method="post" class="form">
|
||||
<input name="id" type="hidden" value="${maintenanceRecord.id}"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>保养计划类型</th>
|
||||
<td>
|
||||
<select name="plantype" class="easyui-combobox" data-options="panelHeight:'auto',editable:false">
|
||||
<option value="0" <c:if test="${maintenanceRecord.plantype=='0'}">selected</c:if>>周计划</option>
|
||||
<option value="1" <c:if test="${maintenanceRecord.plantype=='1'}">selected</c:if>>月计划</option>
|
||||
<option value="2" <c:if test="${maintenanceRecord.plantype=='2'}">selected</c:if>>年计划</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>保养计划编号</th>
|
||||
<td><input name="plannumber" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${maintenanceRecord.plannumber}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>保养计划内容</th>
|
||||
<td><input name="plancontent" class="easyui-textbox" data-options="required:true,validType:'isBlank'" value="${maintenanceRecord.plancontent}"/>
|
||||
</td>
|
||||
</tr>
|
||||
<%-- <tr>
|
||||
<th>状态</th>
|
||||
<td><sel name="condition" class="easyui-combobox" data-options="panelHeight:'auto',editable:false">
|
||||
<option value="0" <c:if test="${maintenanceRecord.condition=='0'}">selected</c:if>>未执行</option>
|
||||
<option value="1" <c:if test="${maintenanceRecord.condition=='1'}">selected</c:if>>执行完毕</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr> --%>
|
||||
<tr>
|
||||
<th>计划执行时间</th>
|
||||
<td><input id="plantime" name="plantime" class="Wdate" data-options="required:true,validType:'isBlank'" value="${maintenanceRecord.plantime}" 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="${maintenanceRecord.realtime}" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>执行描述</th>
|
||||
<td><input id="behaviordescription" name="behaviordescription" class='easyui-textbox' value="${maintenanceRecord.behaviordescription}"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>执行者</th>
|
||||
<td><input id="performer" name="performer" class='easyui-textbox' value="${maintenanceRecord.performer}"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>备注</th>
|
||||
<td><input id="remark" name="remark" class="easyi-textbox" style="overflow:auto; width:100%;height:100px" value="${maintenanceRecord.remark}"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<div id="p">
|
||||
<table id="grid" data-options="border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
324
bin/WebRoot/jsp/equipment/maintenanceRecordList.jsp
Normal file
324
bin/WebRoot/jsp/equipment/maintenanceRecordList.jsp
Normal file
@ -0,0 +1,324 @@
|
||||
<%@ 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.MaintenanceRecord.Flag_Weekplan);%>
|
||||
<%request.setAttribute("Flag_Monthplan",com.sipai.entity.equipment.MaintenanceRecord.Flag_Monthplan);%>
|
||||
<%request.setAttribute("Flag_Yearplan",com.sipai.entity.equipment.MaintenanceRecord.Flag_Yearplan);%>
|
||||
|
||||
<%request.setAttribute("Flag_Nimplemented",com.sipai.entity.equipment.MaintenanceRecord.Flag_Nimplemented);%>
|
||||
<%request.setAttribute("Flag_Yimplemented",com.sipai.entity.equipment.MaintenanceRecord.Flag_Yimplemented);%>
|
||||
|
||||
<!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 : '选择保养计划',
|
||||
iframeId:"",
|
||||
url : ext.contextPath + '/equipment/maintenancerecord/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/maintenancerecord/view.do?id=' + id
|
||||
});
|
||||
};
|
||||
var editFun = function(id) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '编辑周保养计划',
|
||||
url : ext.contextPath + '/equipment/maintenancerecord/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/maintenancerecord/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/maintenancerecord/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 synchroFun = function() {
|
||||
parent.$.messager.confirm('提示', '您确定要同步保养计划?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/equipment/maintenancerecord/synchroMaintenancePlan.do', "" , function(data) {
|
||||
if(data>0){
|
||||
parent.$.messager.alert('提示','同步成功','info');
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
}else if(data==0){
|
||||
parent.$.messager.alert('提示','无可更新数据','info');
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
}else {
|
||||
parent.$.messager.alert('提示','更新失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/equipment/maintenancerecord/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 : '100', title : '状态', field : 'condition', sortable : true, halign:'center',formatter : function(value, row, index) {
|
||||
switch (value) {
|
||||
case '0':
|
||||
return '未执行';
|
||||
case '1':
|
||||
return '执行完毕';
|
||||
|
||||
}
|
||||
}},
|
||||
{width : '140', title : '计划执行时间', field : 'plantime', sortable : true, align:'center', formatter : function(value, row){
|
||||
if(value!=null){
|
||||
return value.substring(0,10);
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{width : '140', title : '实际执行时间', field : 'realtime', sortable : true, align:'center', formatter : function(value, row){
|
||||
if(value!=null){
|
||||
return value.substring(0,10);
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{width : '140', title : '执行描述', field : 'behaviordescription', sortable : true, align:'center', formatter : function(value, row){
|
||||
if(value!=null){
|
||||
return value;
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{width : '140', title : '执行者', field : 'performer', sortable : true, align:'center', formatter : function(value, row){
|
||||
if(value!=null){
|
||||
return value;
|
||||
}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,"equipment/maintenancerecord/edit.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_edit" title="编辑" onclick="editFun(\''+row.id+'\');"/>';
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"equipment/maintenancerecord/delete.do")) {%>
|
||||
if(row.c_judge1!="1"){
|
||||
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);
|
||||
},
|
||||
rowStyler:function(index,row) {
|
||||
// console.log("condition",row.condition);
|
||||
|
||||
if (row.condition=="0"&&row.c_judge=="0"){
|
||||
return 'background-color:red;' ;
|
||||
}
|
||||
if (row.condition=="0"){
|
||||
return 'background-color:white;' ;
|
||||
}
|
||||
if (row.condition=="1"){
|
||||
return 'background-color:gray;color:white' ;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
(白色未执行,灰色执行完毕,红色过期未执行。
|
||||
同步数据无删除操作) </td>
|
||||
</tr>
|
||||
<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>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
|
||||
onclick="synchroFun();">数据同步</a>
|
||||
</td>
|
||||
<%-- <%}%> --%>
|
||||
<td><div class="datagrid-btn-separator"></div></td>
|
||||
|
||||
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<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="${maintenancerecord.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="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>
|
||||
72
bin/WebRoot/jsp/equipment/maintenanceRecordView.jsp
Normal file
72
bin/WebRoot/jsp/equipment/maintenanceRecordView.jsp
Normal file
@ -0,0 +1,72 @@
|
||||
<!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">
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<input id="mids" name="mids" type="hidden" value="" />
|
||||
<form method="post" class="form">
|
||||
<input name="id" type="hidden" value="${maintenanceRecord.id}"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>保养计划类型</th>
|
||||
<td>
|
||||
<c:if test="${maintenanceRecord.plantype=='0'}">周计划</c:if>
|
||||
<c:if test="${maintenanceRecord.plantype=='1'}">月计划</c:if>
|
||||
<c:if test="${maintenanceRecord.plantype=='2'}">年计划</c:if>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>保养计划编号</th>
|
||||
<td>${maintenanceRecord.plannumber}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>保养计划内容</th>
|
||||
<td>${maintenanceRecord.plancontent}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>状态</th>
|
||||
<td>
|
||||
<c:if test="${maintenanceRecord.condition=='0'}">未执行</c:if>
|
||||
<c:if test="${maintenanceRecord.condition=='1'}">执行完毕</c:if>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>计划执行时间</th>
|
||||
<td>${maintenanceRecord.plantime}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>实际执行时间</th>
|
||||
<td>${maintenanceRecord.realtime}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>执行描述</th>
|
||||
<td>${maintenanceRecord.behaviordescription}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>执行者</th>
|
||||
<td>${maintenanceRecord.performer}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>备注</th>
|
||||
<td>${maintenanceRecord.remark}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<div id="p">
|
||||
<table id="grid" data-options="border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
111
bin/WebRoot/jsp/equipment/maintenancemanForSelect.jsp
Normal file
111
bin/WebRoot/jsp/equipment/maintenancemanForSelect.jsp
Normal file
@ -0,0 +1,111 @@
|
||||
<%@ 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">
|
||||
function selectFun(dialog, grid) {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas = '{"id":"'+item.id+'","name":"'+item.name +'"}';
|
||||
});
|
||||
return $.parseJSON(datas);
|
||||
}
|
||||
|
||||
var grid;
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/user/getUsers.do?querytype=select',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: true,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '100', title : '登录名', field : 'name', sortable : true, halign:'center'},
|
||||
{width : '80', title : '姓名', field : 'caption', sortable : true, halign:'center'},
|
||||
{width : '180', title : '部门', field : '_pname', sortable : true, halign:'center'},
|
||||
{width : '50', title : '性别', field : 'sex', sortable : true, halign:'center', align:'center', formatter : function(value, row, index) {
|
||||
switch (value) {
|
||||
case '0':
|
||||
return '女';
|
||||
case '1':
|
||||
return '男';
|
||||
}
|
||||
}
|
||||
}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess:function(data){
|
||||
if(data){
|
||||
$.each(data.rows, function(index, item){
|
||||
$.each(eval('${json}'), function(index1, item1){
|
||||
if(item.id==item1.empid){
|
||||
$('#grid').datagrid('checkRow', index);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
$('#search_dept').combotree({
|
||||
url : ext.contextPath + '/user/getUnitsJson.do?random=' + Math.random(),
|
||||
parentField : 'pid',
|
||||
method:'get',
|
||||
onBeforeSelect:function(node){
|
||||
if(node.id=="-1"){
|
||||
$("#deptid").tree("unselect");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
</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>姓名</td>
|
||||
<td><input name="search_caption" class="easyui-textbox" style="width: 180px;" /></td>
|
||||
<td>性别</td>
|
||||
<td><select name="search_sex" class="easyui-combobox" style="width:100px;" data-options="panelHeight:'auto',editable:false">
|
||||
<option value="">请选择</option>
|
||||
<option value="1">男</option>
|
||||
<option value="0">女</option></select>
|
||||
</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>
|
||||
Reference in New Issue
Block a user