<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
|
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
<!DOCTYPE html>
|
<html>
|
<head>
|
<title>设备润滑</title>
|
<jsp:include page="../../../initlib/initAll.jsp"></jsp:include>
|
<link href="${pageContext.request.contextPath}/css/toptoolbar.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript">
|
function dateFomat(value) {
|
var date = value;
|
var year = date.getFullYear().toString();
|
var month = (date.getMonth() + 1);
|
var day = date.getDate().toString();
|
var hour = date.getHours().toString();
|
var minutes = date.getMinutes().toString();
|
var seconds = date.getSeconds().toString();
|
if (month < 10) {
|
month = "0" + month;
|
}
|
if (day < 10) {
|
day = "0" + day;
|
}
|
if (hour < 10) {
|
hour = "0" + hour;
|
}
|
|
if (minutes < 10) {
|
minutes = "0" + minutes;
|
}
|
if (seconds < 10) {
|
seconds = "0" + seconds;
|
}
|
return year + "-" + month + "-" + day + " " + hour + ":" + minutes + ":" + seconds;
|
}
|
|
function dateFomatYYYYMMDD(value) {
|
var date = value;
|
var year = date.getFullYear().toString();
|
var month = (date.getMonth() + 1);
|
var day = date.getDate().toString();
|
if (month < 10) {
|
month = "0" + month;
|
}
|
if (day < 10) {
|
day = "0" + day;
|
}
|
return year + "-" + month + "-" + day;
|
}
|
</script>
|
<script type="text/javascript">
|
var plan_id = null; //维保计划id
|
var orderDetailId = null;//维保计划详细项id
|
var dataGrid = null;
|
var param = null;
|
$(function () {
|
//初始化时间
|
var today = new Date();
|
var month = today.getMonth() + 1;
|
if (month < 10) {
|
month = ("0" + month);
|
}
|
var day = today.getDate();
|
if (day < 10) {
|
day = ("0" + day);
|
}
|
var date = today.getFullYear() + "-" + month + "-" + day;//获取当月最后一天日期
|
$("#date1").datebox("setValue", date);
|
$("#date2").datebox("setValue", date);
|
dataGrid = $('#dataGrid').datagrid({
|
fit: true,
|
fitColumns: true,
|
border: false,
|
pagination: true,
|
idField: 'id',
|
striped: true,
|
rownumbers: true,
|
remoteSort: false,
|
pageSize: 10,
|
pageList: [10, 20, 30, 40, 50],
|
sortName: 'id',
|
sortOrder: 'desc',
|
singleSelect: true,
|
checkOnSelect: true,
|
selectOnCheck: false,
|
nowrap: false,
|
showPageList: false,
|
columns: [[{
|
field: 'id',
|
title: '编号',
|
width: 100,
|
checkbox: true
|
}, {
|
field: 'shop_name',
|
title: '车间名称',
|
width: 70,
|
hidden: true
|
}, {
|
field: 'type',
|
title: '维保类型',
|
width: 70,
|
align: 'center',
|
formatter: function (value, row, index) {
|
if (value == 1) {
|
return "轮保计划";
|
} else if (value == 2) {
|
return "润滑计划";
|
} else if (value == 3) {
|
return "检修计划";
|
} else if (value == 4) {
|
return "保养计划";
|
} else if (value == 5) {
|
return "点检计划";
|
}
|
}
|
}, {
|
field: 'eqp_name',
|
title: '设备名称',
|
width: 120,
|
align: 'center'
|
}, {
|
field: 'shift_name',
|
title: '班次',
|
width: 50,
|
align: 'center',
|
sortable: true
|
}/* ,{
|
field : 'attr2',
|
title : '检验周期',
|
align:'center',
|
width : 60
|
} */, {
|
field: 'attr1',
|
title: '检验类型',
|
align: 'center',
|
width: 60,
|
formatter: function (value, row, index) {
|
if (value == 1) {
|
return "月检";
|
} else if (value == 2) {
|
return "周检";
|
} else if (value == 3) {
|
return "日检";
|
} else if (value == 4) {
|
return "年检";
|
} else if (value == 5) {
|
return "每班";
|
}
|
}
|
}, {
|
field: 'plan_stime',
|
title: '计划开始时间',
|
width: 120,
|
align: 'center',
|
sortable: true,
|
formatter: function (value, row, index) {
|
var unixTimestamp = new Date(value);
|
return dateFomat(unixTimestamp);
|
}
|
|
}, {
|
field: 'plan_times',
|
title: '计划维护时长/小时',
|
align: 'center',
|
width: 100,
|
align: 'center',
|
sortable: true
|
}, {
|
field: 'plan_name',
|
title: '制单人',
|
align: 'center',
|
width: 65,
|
align: 'center'
|
}, {
|
field: 'last_stime',
|
title: '实际开始时间',
|
align: 'center',
|
width: 120,
|
hidden: true,
|
sortable: true,
|
formatter: function (value, row, index) {
|
if (value != null && value != "") {
|
var unixTimestamp = new Date(value);
|
return dateFomat(unixTimestamp);
|
} else {
|
return "";
|
}
|
}
|
}, {
|
field: 'last_etime',
|
title: '实际结束时间',
|
align: 'center',
|
width: 120,
|
sortable: true,
|
formatter: function (value, row, index) {
|
if (value != null && value != "") {
|
var unixTimestamp = new Date(value);
|
return dateFomat(unixTimestamp);
|
} else {
|
return "";
|
}
|
|
}
|
}, {
|
field: 'sh_status',
|
title: '状态',
|
align: 'center',
|
width: 50,
|
formatter: function (value, row, index) {
|
var status = "";//0:默认 1:正在保养 2:保养完成 3:反馈MES
|
switch (value) {
|
case 0:
|
status = "下发";
|
break;
|
case 1:
|
status = "<font color='blue'>已完成</font> ";
|
break;
|
/* case 2:
|
status="<font color='blue'>已完成</font>";
|
break;
|
case 3:
|
status="<font color='green'>已反馈MES</font>";
|
break; */
|
}
|
return status;
|
}
|
}]],
|
toolbar: '#toolbar',
|
url: "${pageContext.request.contextPath}/pms/eqpMaintain/queryMaintainPlan.do",
|
queryParams: $("#searchForm").form("getData"),
|
onLoadError: function (data) {
|
$.messager.show('提示', "查询保养计划异常", 'error');
|
},
|
onLoadSuccess: function () {
|
//$(this).datagrid('tooltip');
|
}, onRowContextMenu: function (e, rowIndex, rowData) {
|
plan_id = rowData.id;
|
e.preventDefault();
|
$(this).datagrid('unselectAll').datagrid('uncheckAll');
|
$(this).datagrid('selectRow', rowIndex);
|
$('#editPlanMenu').menu('show', {
|
left: e.pageX - 10,
|
top: e.pageY - 5
|
});
|
}, onClickRow: function (rowIndex, rowData) {
|
getParam(rowData.id, rowData.eqp_id, rowData.type);
|
}
|
});
|
param = $('#paramGrid').datagrid({
|
rownumbers: true,
|
fit: true,
|
fitColumns: false,//fitColumns= true就会自动适应宽度(无滚动条)
|
//width:$(this).width()-252,
|
border: false,
|
pagination: false,
|
idField: 'id',
|
striped: true,
|
remoteSort: false,
|
pageSize: 100,
|
pageList: [80, 100],
|
singleSelect: true,
|
checkOnSelect: false,
|
selectOnCheck: false,
|
nowrap: true,
|
showPageList: false,
|
columns: [[{
|
field: 'id',
|
title: 'id',
|
width: 120,
|
hidden: true
|
}, {
|
field: 'jobNo',
|
title: '序号',
|
width: 30,
|
align: 'center',
|
sortable: true
|
}, {
|
field: 'maintMethod',
|
title: '润滑方法',
|
width: 150,
|
align: 'center'
|
}, {
|
field: 'jobStandard',
|
title: '润滑部位',
|
width: 250,
|
align: 'center'
|
}, {
|
field: 'reviewer',
|
title: '任务角色',
|
width: 100,
|
align: 'center'
|
}, {
|
field: 'completeStatus',
|
title: '完成情况',
|
align: 'center',
|
width: 100,
|
formatter: function (value, row, index) {
|
/* 0未完成 1完成 3-后期处理 */
|
if (value == 0) {
|
return '<span style="color:red">未完成<span>';
|
} else {
|
return value;
|
}
|
}
|
}, {
|
field: 'checkResult',
|
title: '检查情况',
|
align: 'center',
|
width: 60
|
}, {
|
field: 'completeby',
|
title: '完成人',
|
width: 100,
|
align: 'center'
|
}]],
|
onLoadSuccess: function () {
|
$(this).datagrid('tooltip');
|
}/* ,
|
//右键事件
|
onRowContextMenu : function(e, rowIndex, rowData) {
|
orderDetailId=rowData.id;
|
e.preventDefault();
|
$(this).datagrid('unselectAll').datagrid('uncheckAll');
|
$(this).datagrid('selectRow', rowIndex);
|
$('#editPlanParamMenu').menu('show', {
|
left : e.pageX-10,
|
top : e.pageY-5
|
});
|
} */
|
|
});
|
});
|
|
// 查询设备保养计划
|
function queryWCPlan() {
|
dataGrid.datagrid({
|
url: "${pageContext.request.contextPath}/pms/eqpMaintain/queryMaintainPlan.do",
|
queryParams: $("#searchForm").form("getData"),
|
onLoadError: function (data) {
|
$.messager.show('提示', "查询保养计划异常", 'error');
|
}
|
});
|
$('#dataGrid').datagrid('clearSelections');
|
}
|
|
//获取维保详细
|
function getParam(id, eqpid, type) {
|
plan_id = id;
|
param.datagrid({
|
url: "${pageContext.request.contextPath}/pms/eqpMaintain/queryMaintainInfo.do?ewcpId=" + id + "&des=" + eqpid + "&teamName=" + type
|
});
|
}
|
|
//完成维保计划
|
function finishPlan() {
|
//按钮是否点击标志(默认为true:可被点击)
|
var isClick = true;
|
//未点击过则执行里面的内容
|
if (isClick) {
|
//改变为点击无效状态
|
isClick = false;
|
$.post('${pageContext.request.contextPath}/pms/eqpMaintain/finishMaintainPlan.do', {id: plan_id},
|
function (json) {
|
//恢复点击有效状态
|
isClick = true;
|
if (json.success) {
|
$.messager.show('提示', json.msg, 'info');
|
queryWCPlan();
|
} else {
|
$.messager.show('提示', json.msg, 'info');
|
}
|
}, "JSON");
|
}
|
}
|
|
//添加维修呼叫记录
|
function addCallInfo() {
|
var dialog = parent.$.modalDialog({
|
title: '维修呼叫',
|
width: 750,
|
height: 420,
|
href: '${pageContext.request.contextPath}/pms/equ/maintain/chooseMaintenanceman.jsp',
|
buttons: [{
|
text: '选择',
|
iconCls: 'icon-standard-disk',
|
handler: function () {
|
var row = dialog.find("#maintencemanGrid").datagrid('getSelected');
|
if (row) {
|
$.post("${pageContext.request.contextPath}/pms/eqpMaintain/addCallInfo.do", {
|
id: plan_id,
|
rId: row.userId,
|
rName: row.userName,
|
rType: row.typeId
|
}, function (json) {
|
if (json.success) {
|
$.messager.show('提示', json.msg, 'info');
|
dialog.dialog('destroy');
|
} else {
|
$.messager.show('提示', json.msg, 'error');
|
dialog.dialog('destroy');
|
}
|
}, "JSON");
|
}
|
}
|
}]
|
});
|
};
|
|
|
/**清空查询条件*/
|
function clearForm() {
|
$("#searchForm input").val(null);
|
$("#type").val("2");
|
};
|
|
|
/* 反馈MES */
|
function sendMes() {
|
var rows = dataGrid.datagrid('getChecked');
|
var ids = [];
|
if (rows.length > 0) {
|
parent.$.messager.confirm('确认', '确定将选中数据反馈MES吗?', function (r) {
|
if (r) {
|
for (var i = 0; i < rows.length; i++) {
|
ids.push(rows[i].id);
|
}
|
parent.$.messager.progress({
|
title: '提示',
|
text: '数据处理中,请稍后....'
|
});
|
$.post('${pageContext.request.contextPath}/pms/eqpMaintain/dasSendEquipmentWorkOrderResult.do',
|
{
|
ids: ids.join(',')
|
}, function (json) {
|
parent.$.messager.progress('close');
|
if (json.success) {
|
$.messager.show('提示', json.msg, 'info');
|
} else {
|
$.messager.show('提示', json.msg, 'info');
|
}
|
}, "JSON");
|
}
|
});
|
} else {
|
parent.$.messager.show({
|
title: '提示',
|
msg: '请选择数据!!'
|
});
|
}
|
|
}
|
|
//修改维保计划详细
|
function goToEditEqpOrderDetail() {
|
//按钮是否点击标志(默认为true:可被点击)
|
var isClick = true;
|
var dialog = parent.$.modalDialog({
|
title: '维保计划小项信息',
|
width: 750,
|
height: 420,
|
href: '${pageContext.request.contextPath}/pms/eqpMaintain/goToEditParamsDetailJsp.do?id=' + orderDetailId,
|
buttons: [{
|
text: '保存',
|
iconCls: 'icon-standard-disk',
|
handler: function () {
|
var f = dialog.find('#form');
|
if (f.form("validate")) {
|
//未点击过则执行里面的内容
|
if (isClick) {
|
//改变为点击无效状态
|
isClick = false;
|
$.post("${pageContext.request.contextPath}/pms/eqpMaintain/editParamsBean.do", f.form("getData"), function (json) {
|
//恢复点击有效状态
|
isClick = true;
|
if (json.success) {
|
$.messager.show('提示', json.msg, 'info');
|
dialog.dialog('destroy');
|
getParam(plan_id);
|
} else {
|
$.messager.show('提示', json.msg, 'error');
|
}
|
}, "JSON");
|
}
|
}
|
|
}
|
}]
|
});
|
}
|
|
|
function deleteWCPlan() {
|
//按钮是否点击标志(默认为true:可被点击)
|
var isClick = true;
|
var rows = dataGrid.datagrid('getChecked');
|
var ids = [];
|
if (rows.length > 0) {
|
parent.$.messager.confirm('确认', '确定将选中数据删除吗?', function (r) {
|
if (r) {
|
for (var i = 0; i < rows.length; i++) {
|
ids.push(rows[i].id);
|
}
|
parent.$.messager.progress({
|
title: '提示',
|
text: '数据处理中,请稍后....'
|
});
|
//未点击过则执行里面的内容
|
if (isClick) {
|
//改变为点击无效状态
|
isClick = false;
|
$.post('${pageContext.request.contextPath}/pms/eqpMaintain/delMainTainPlan.do',
|
{
|
ids: ids.join(',')
|
}, function (json) {
|
//恢复点击有效状态
|
isClick = true;
|
parent.$.messager.progress('close');
|
if (json.success) {
|
$.messager.show('提示', json.msg, 'info');
|
queryWCPlan();
|
} else {
|
$.messager.show('提示', json.msg, 'info');
|
}
|
}, "JSON");
|
}
|
}
|
});
|
} else {
|
parent.$.messager.show({
|
title: '提示',
|
msg: '请选择数据!!'
|
});
|
}
|
}
|
</script>
|
</head>
|
<body class="easyui-layout" data-options="fit : true,border : false">
|
<div data-options="region:'north',border:false,split:true,title:'设备润滑计划管理'" style="height:400px;">
|
<div id="toolbar" style="display: none;width:100%;">
|
<form id="searchForm" style="margin:4px 0px 0px 0px;">
|
<div class="topTool">
|
<fieldset>
|
<div>
|
<span class="label">计划日期:</span>
|
<span>
|
<input id="date1" name="date1" type="text" class="easyui-datebox" readOnly=true
|
datefmt="yyyy-MM-dd" style="width:120px"/>
|
</span>
|
</div>
|
<div>
|
<span class="label">到</span>
|
<span>
|
<input id="date2" name="date2" type="text" class="easyui-datebox" readOnly=true
|
datefmt="yyyy-MM-dd" style="width:120px"/>
|
</span>
|
</div>
|
<div>
|
<span class="label">设备类型:</span>
|
<select name="eqpType"
|
class="easyui-combobox"
|
data-options="panelHeight:'auto',editable:false,width:120">
|
<option value="">全部</option>
|
<option value="卷接机">卷接机</option>
|
<option value="包装机">包装机</option>
|
<option value="成型机">成型机</option>
|
<option value="封箱机">封箱机</option>
|
<option value="发射机">发射机</option>
|
</select>
|
</div>
|
<div>
|
<span class="label">周期:</span>
|
<select name="attr1"
|
class="easyui-combobox"
|
data-options="panelHeight:'auto',editable:false,width:120">
|
<option value="">全部</option>
|
<option value="3">日</option>
|
<option value="2">周</option>
|
<option value="1">月</option>
|
<option value="4">年</option>
|
</select>
|
</div>
|
<div>
|
<span class="label">班次:</span>
|
<select name="attr2"
|
class="easyui-combobox"
|
data-options="panelHeight:'auto',editable:false,width:120">
|
<option value="">全部</option>
|
<option value="1">早</option>
|
<option value="2">中</option>
|
<option value="3">晚</option>
|
</select>
|
</div>
|
<div>
|
<span class="label">状态:</span>
|
<select name="sh_status"
|
class="easyui-combobox"
|
data-options="panelHeight:'auto',editable:false,width:120">
|
<option value="-1">全部</option>
|
<option value="0">下发</option>
|
<option value="1">完成</option>
|
</select>
|
<input id="type" name="type" type="hidden" value="2"/>
|
</div>
|
</fieldset>
|
</div>
|
</form>
|
<div class="easyui-toolbar">
|
<c:if test="${not empty sessionInfo.resourcesMap['/pms/eqpMaintain/queryMaintainPlan.do/lhjh']}">
|
<a onclick="queryWCPlan()" href="javascript:void(0);" class="easyui-linkbutton"
|
data-options="plain:true,iconCls:'icon-standard-zoom'">查询</a>
|
<a onclick="clearForm();" href="javascript:void(0);" class="easyui-linkbutton"
|
data-options="plain:true,iconCls:'icon-standard-table-refresh'">重置</a>
|
</c:if>
|
<c:if test="${not empty sessionInfo.resourcesMap['/pms/eqpMaintain/delMainTainPlan.do/lhjh']}">
|
<a onclick="deleteWCPlan();" href="javascript:void(0);" class="easyui-linkbutton"
|
data-options="plain:true,iconCls:'icon-standard-plugin-delete'">删除</a>
|
</c:if>
|
<!-- <a onclick="sendMes();" href="javascript:void(0);" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-standard-plugin'">反馈MES</a> -->
|
</div>
|
<!-- 详细项右键菜单 -->
|
<div id="editPlanParamMenu" class="easyui-menu" style="width: 80px; display: none;">
|
<c:if test="${not empty sessionInfo.resourcesMap['/pms/eqpMaintain/editParamsBean.do/lhjh']}">
|
<div onclick="goToEditEqpOrderDetail()" data-options="iconCls:'icon-standard-server-edit'">编辑</div>
|
</c:if>
|
</div>
|
<!-- 维保项右键菜单 -->
|
<div id="editPlanMenu" class="easyui-menu" style="width: 80px; display: none;">
|
<c:if test="${not empty sessionInfo.resourcesMap['/pms/eqpMaintain/finishMaintainPlan.do/lhjh']}">
|
<div onclick="finishPlan()" data-options="iconCls:'icon-standard-plugin-add'">完成</div>
|
</c:if>
|
<!-- <div onclick="addCallInfo()" data-options="iconCls:'icon-standard-plugin-error'">维修呼叫</div> -->
|
</div>
|
</div>
|
<table id="dataGrid"></table>
|
</div>
|
<div data-options="region:'',border:false">
|
<table id="paramGrid"></table>
|
</div>
|
</body>
|
</html>
|