<%@ 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>
|
<script type="text/javascript" src="${pageContext.request.contextPath }/pms/pub/combobox/comboboxUtil.js"
|
charset="utf-8"></script>
|
<link href="${pageContext.request.contextPath}/css/toptoolbar.css" rel="stylesheet" type="text/css"/>
|
<script type="text/javascript">
|
var dataGrid = 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;
|
$("#scrq_sdate").datebox("setValue", date); //时间用这个
|
$("#scrq_edate").datebox("setValue", date); //时间用这个
|
$.loadComboboxData($("#searchShift"), "shift");
|
dataGrid = $('#dataGrid').datagrid({
|
fit: true,
|
fitColumns: true,
|
border: false,
|
pagination: true,
|
idField: 'id',
|
striped: true,
|
remoteSort: false,
|
pageSize: 20,
|
pageList: [10, 20, 30, 40, 50],
|
sortName: 'id',
|
sortOrder: 'desc',
|
singleSelect: true,
|
checkOnSelect: false,
|
selectOnCheck: false,
|
nowrap: false,
|
showPageList: false,
|
columns: [[
|
{
|
field: 'id',
|
title: 'ID',
|
align: 'center',
|
width: 100,
|
checkbox: true
|
}, {
|
field: 'title',
|
title: '标题',
|
align: 'center',
|
width: 100
|
}, {
|
field: 'initiatorName',
|
title: '发起人',
|
align: 'center',
|
width: 50
|
}, {
|
field: 'time',
|
title: '通知时间',
|
align: 'center',
|
width: 120,
|
sortable: true
|
}, {
|
field: 'content',
|
title: '通知内容',
|
align: 'center',
|
width: 300
|
}, {
|
field: 'sendType',
|
title: '推送类型',
|
align: 'center',
|
width: 60,
|
formatter: function (value, row, index) {
|
if (value == '0')
|
return "PMS和WCT";
|
else if (value == '1')
|
return "PMS";
|
else if (value == '2')
|
return "WCT";
|
else
|
return "<font color=red>无</font>";
|
|
|
}
|
}, {
|
field: 'sendFlag',
|
title: '推送状态',
|
align: 'center',
|
width: 50,
|
formatter: function (value, row, index) {
|
if (value == '0' | value == null)
|
return "<font color=red>未推送</font>";
|
else if (value == '1')
|
return "已推送";
|
|
}
|
}/* ,{
|
field : 'flag',
|
title : '状态',
|
align:'center',
|
width : 60,
|
sortable : true,
|
formatter: function(value,row,index){
|
if(value=='0')
|
return "驳回";
|
else if(value=='1')
|
return "审核中";
|
else if(value=='2')
|
return "签发中";
|
else if(value=="3")
|
return "已发布";
|
|
}
|
},{
|
field : 'approveContent',
|
title : '审批内容',
|
align:'center',
|
width : 50
|
},{
|
field : 'issuerName',
|
title : '签发人',
|
align:'center',
|
width : 50
|
} */, {
|
field: 'createUserName',
|
title: '创建人姓名',
|
align: 'center',
|
width: 70,
|
sortable: true,
|
hidden: 'true'
|
}, {
|
field: 'createUserTime',
|
title: '创建时间',
|
align: 'center',
|
width: 150,
|
sortable: true,
|
hidden: 'true'
|
}, {
|
field: 'updateUserName',
|
title: '修改人姓名',
|
align: 'center',
|
width: 70,
|
sortable: true
|
}, {
|
field: 'updateUserTime',
|
title: '最后修改时间',
|
align: 'center',
|
width: 130,
|
sortable: true
|
}]],
|
toolbar: '#toolbar',
|
url: "${pageContext.request.contextPath}/pms/msg/queryMsgInfo.do",
|
queryParams: $("#searchForm").form("getData"),
|
onLoadError: function (data) {
|
$.messager.show('提示', "查询机台通知信息异常", 'error');
|
},
|
onLoadSuccess: function () {
|
$(this).datagrid('tooltip');
|
},
|
onRowContextMenu: function (e, rowIndex, rowData) {
|
e.preventDefault();
|
$(this).datagrid('unselectAll').datagrid('uncheckAll');
|
$(this).datagrid('selectRow', rowIndex);
|
var items = getMenus(rowData.id, rowData.sendFlag, rowData.flag, rowData.initiator, rowData.initiatorName,
|
rowData.approval, rowData.approvalName,
|
rowData.issuer, rowData.issuerName);
|
$.easyui.showMenu({
|
left: e.pageX, top: e.pageY,
|
items: eval("(" + items + ")")
|
});
|
//$(this).datagrid('unselectAll').datagrid('uncheckAll');
|
/* $(this).datagrid('selectRow', rowIndex);
|
$('#menu').menu('show', {
|
left : e.pageX-10,
|
top : e.pageY-5
|
}); */
|
}
|
});
|
});
|
|
function showTips(message) {
|
$.messager.show('提示', message, 'info');
|
}
|
|
function showWctOnlineEqu(sendType) {
|
var rowSelected = dataGrid.datagrid("getSelected");//返回选中一行
|
rowSelected.sendType = sendType;
|
//推送到pms
|
if (sendType == 1) {
|
//修改消息状态为已推送
|
rowSelected.sendFlag = 1;
|
saveSend(rowSelected);
|
//推送到wct或wct和pms
|
} else {
|
var wctOnlineDialog = parent.$.modalDialog({
|
title: '选择设备',
|
width: 340,
|
height: 360,
|
href: '${pageContext.request.contextPath}/pms/msg/goToWctOnlineEquJsp.do',
|
buttons: [{
|
text: '保存',
|
iconCls: 'icon-standard-disk',
|
handler: function () {
|
var rows = wctOnlineDialog.find("#wctDataGrid").datagrid('getChecked');
|
console.info(rows);
|
if (rows != null && rows.length > 0) {
|
var ids = [];
|
for (var i = 0; i < rows.length; i++) {
|
ids.push(rows[i].equipmentCode);
|
}
|
rowSelected.eid = ids.join(",");
|
//修改消息状态为已推送
|
rowSelected.sendFlag = 1;
|
saveSend(rowSelected, wctOnlineDialog);
|
wctOnlineDialog.dialog('destroy');
|
}
|
}
|
}]
|
});
|
}
|
}
|
|
//保存推送
|
function saveSend(data, wctOnlineDialog) {
|
|
$.ajax({
|
url: "${pageContext.request.contextPath}/pms/msg/saveMsgSend.do",
|
type: "post",
|
data: data,
|
success: function (json) {
|
|
if (json.success) {
|
|
$.messager.show({title:'提示', msg:"操作成功!",icon:'info',style:{
|
|
}});
|
queryMsgInfo();
|
} else {
|
$.messager.show({title:'提示', msg:"操作失败!",timeout:0,icon:'info',style:{
|
|
}});
|
}
|
}
|
});
|
}
|
|
//保存推送
|
function saveSend(data) {
|
|
$.ajax({
|
url: "${pageContext.request.contextPath}/pms/msg/saveMsgSend.do",
|
type: "post",
|
data: data,
|
success: function (json) {
|
|
if (json.success) {
|
$.messager.show({title:'提示', msg:"操作成功!",icon:'info',style:{
|
|
}});
|
queryMsgInfo();
|
} else {
|
$.messager.show({title:'提示', msg:"操作失败!",icon:'info',style:{
|
|
}});
|
}
|
}
|
});
|
}
|
|
|
function getMenus(itemid, sendFlag, state, senderId, sponsor, approval, assessor, issuer, sender) {
|
//id~推送状态~状态~发起者ID~发起者~审核ID~审核者~签发ID~签发者
|
var menus = "[";
|
<c:if test="${not empty sessionInfo.resourcesMap['/pms/msg/showWctOnlineEqu.do/tzgl']}">
|
if (sendFlag == '0' | sendFlag == null) {// 如果没推送
|
menus += '{ text: "推送至PMS和WCT",iconCls:"icon-hamburg-up", handler: function (e, item) { showWctOnlineEqu(' + 0 + '); } }';
|
menus += ",";
|
menus += '{ text: "推送至PMS",iconCls:"icon-hamburg-up", handler: function (e, item) { showWctOnlineEqu(' + 1 + ');} }';
|
menus += ",";
|
menus += '{ text: "推送至WCT",iconCls:"icon-hamburg-up", handler: function (e, item) { showWctOnlineEqu(' + 2 + '); } }';
|
}
|
</c:if>
|
<c:if test="${not empty sessionInfo.resourcesMap['/pms/msg/onclick.do/tzgl']}">
|
if ("${msgOperator.operId}" == senderId) {//发起者登陆右键
|
/* if(state==1 ||state==0){//审核中 */
|
menus += ",";
|
menus += '{ text: "编辑",iconCls:"icon-standard-plugin-edit", handler: function (e, item) { editMsgInfo(); } }';
|
menus += ",";
|
menus += '{ text: "删除",iconCls:"icon-standard-plugin-delete", handler: function (e, item) { deleteMsgInfo(); } }';
|
/* }else if("
|
${msgOperator.operId}"==approval){//审核人
|
if(state==1)
|
menus += '{ text: "审核",iconCls:"icon-standard-plugin-add", handler: function (e, item) { approveMsgInfo(); } }';
|
|
}else if("
|
${msgOperator.operId}"==issuer){//签发人
|
if(state==2){
|
menus += '{ text: "签发",iconCls:"icon-standard-plugin-add", handler: function (e, item) { issueMsgInfo(); } }';
|
|
} */
|
}
|
</c:if>
|
menus += "]";
|
return menus;
|
}
|
|
|
/**
|
* 查询文件
|
*/
|
function queryMsgInfo() {
|
dataGrid.datagrid({
|
url: "${pageContext.request.contextPath}/pms/msg/queryMsgInfo.do",
|
queryParams: $("#searchForm").form("getData"),
|
onLoadError: function (data) {
|
$.messager.show('提示', "查询机台通知信息异常", 'error');
|
}
|
});
|
}
|
|
//机台通知信息编辑
|
function editMsgInfo() {
|
//按钮是否点击标志(默认为true:可被点击)
|
var isClick = true;
|
var id = dataGrid.datagrid('getSelected').id;
|
if (id != null) {
|
var dialog = parent.$.modalDialog({
|
title: '机台通知信息编辑',
|
width: 620,
|
height: 300,
|
href: '${pageContext.request.contextPath}/pms/msg/gotoMsgInfoForm.do?id=' + id,
|
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/msg/saveOrUpdateMsgInfo.do?flag=0", f.form("getData"), function (json) {
|
//恢复点击有效状态
|
isClick = true;
|
if (json.success) {
|
$.messager.show('提示', json.msg, 'info');
|
dialog.dialog('destroy');
|
queryMsgInfo();
|
} else {
|
$.messager.show('提示', json.msg, 'error');
|
}
|
}, "JSON");
|
}
|
}
|
}
|
}]
|
});
|
} else {
|
alert("请选中修改项");
|
}
|
}
|
|
//删除当前机台通知信息
|
function deleteMsgInfo() {
|
var row = dataGrid.datagrid('getSelected');
|
parent.$.messager.confirm('操作提示', '您是否要删除当前机台通知信息?', function (b) {
|
if (b) {
|
$.post('${pageContext.request.contextPath}/pms/msg/deleteMsgInfo.do', {
|
id: row.id
|
}, function (json) {
|
if (json.success) {
|
$.messager.show('提示', json.msg, 'info');
|
queryMsgInfo();
|
} else {
|
$.messager.show('提示', json.msg, 'error');
|
}
|
}, 'JSON');
|
}
|
});
|
}
|
|
/**
|
* 批量删除
|
*/
|
function beatchDeleteMsgInfo() {
|
//按钮是否点击标志(默认为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/msg/batchDeleteMsgInfo.do',
|
{
|
ids: ids.join(',')
|
}, function (json) {
|
//恢复点击有效状态
|
isClick = true;
|
parent.$.messager.progress('close');
|
if (json.success) {
|
$.messager.show('提示', json.msg, 'info');
|
queryMsgInfo();
|
} else {
|
$.messager.show('提示', json.msg, 'info');
|
}
|
}, "JSON");
|
}
|
}
|
});
|
} else {
|
parent.$.messager.show({
|
title: '提示',
|
msg: '请勾选要需要操作的数据!'
|
});
|
}
|
}
|
|
|
//机台通知信息添加
|
function goToMsgInfoAdd() {
|
//按钮是否点击标志(默认为true:可被点击)
|
var isClick = true;
|
var dialog = parent.$.modalDialog({
|
title: '机台通知信息添加',
|
width: 820,
|
height: 500,
|
href: '${pageContext.request.contextPath}/pms/msg/gotoMsgInfoForm.do',
|
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/msg/saveOrUpdateMsgInfo.do?flag=0", f.form("getData"), function (json) {
|
//恢复点击有效状态
|
isClick = true;
|
if (json.success) {
|
$.messager.show('提示', json.msg, 'info');
|
dialog.dialog('destroy');
|
queryMsgInfo();
|
} else {
|
$.messager.show('提示', json.msg, 'error');
|
}
|
}, "JSON");
|
}
|
}
|
}
|
}]
|
});
|
}
|
|
function viewMsgInfo() {
|
goToMsgInfoAdd();
|
}
|
|
//审核
|
function approveMsgInfo() {
|
var dialog = parent.$.modalDialog({
|
title: '机台通知信息-审核',
|
width: 620,
|
height: 350,
|
href: '${pageContext.request.contextPath}/pms/msg/gotoMsgInfoApprove.do?id=' + dataGrid.datagrid('getSelected').id,
|
buttons: [{
|
text: '驳回',
|
iconCls: 'icon-standard-disk',
|
handler: function () {
|
var f = dialog.find("#form");
|
if (f.form("validate")) {
|
$.post("${pageContext.request.contextPath}/pms/msg/saveMsgInfo.do?flag=0", f.form("getData"), function (json) {
|
if (json.success) {
|
$.messager.show('提示', json.msg, 'info');
|
dialog.dialog('destroy');
|
queryMsgInfo();
|
} else {
|
$.messager.show('提示', json.msg, 'error');
|
}
|
}, "JSON");
|
}
|
}
|
}, {
|
text: '审核通过',
|
iconCls: 'icon-standard-disk',
|
handler: function () {
|
var f = dialog.find("#form");
|
if (f.form("validate")) {
|
$.post("${pageContext.request.contextPath}/pms/msg/saveMsgInfo.do?flag=2", f.form("getData"), function (json) {
|
if (json.success) {
|
$.messager.show('提示', json.msg, 'info');
|
dialog.dialog('destroy');
|
queryMsgInfo();
|
} else {
|
$.messager.show('提示', json.msg, 'error');
|
}
|
}, "JSON");
|
}
|
}
|
}]
|
});
|
}
|
|
//签发
|
function issueMsgInfo() {
|
var dialog = parent.$.modalDialog({
|
title: '机台通知信息-签发',
|
width: 620,
|
height: 350,
|
href: '${pageContext.request.contextPath}/pms/msg/gotoMsgInfoIssuer.do?id=' + dataGrid.datagrid('getSelected').id,
|
buttons: [{
|
text: '驳回',
|
iconCls: 'icon-standard-disk',
|
handler: function () {
|
var f = dialog.find("#form");
|
if (f.form("validate")) {
|
$.post("${pageContext.request.contextPath}/pms/msg/saveMsgInfo.do?flag=1", f.form("getData"), function (json) {
|
if (json.success) {
|
$.messager.show('提示', json.msg, 'info');
|
dialog.dialog('destroy');
|
queryMsgInfo();
|
} else {
|
$.messager.show('提示', json.msg, 'error');
|
}
|
}, "JSON");
|
}
|
}
|
}, {
|
text: '签发',
|
iconCls: 'icon-standard-disk',
|
handler: function () {
|
var f = dialog.find("#form");
|
if (f.form("validate")) {
|
$.post("${pageContext.request.contextPath}/pms/msg/saveMsgInfo.do?flag=3", f.form("getData"), function (json) {
|
if (json.success) {
|
$.messager.show('提示', json.msg, 'info');
|
dialog.dialog('destroy');
|
queryMsgInfo();
|
} else {
|
$.messager.show('提示', json.msg, 'error');
|
}
|
}, "JSON");
|
}
|
}
|
}]
|
});
|
}
|
|
function clearForm() {
|
$("#searchForm input").val(null);
|
$("#sel1").combobox("setValue", "");//下拉框赋值
|
}
|
</script>
|
</head>
|
<body class="easyui-layout" data-options="fit : true,border : false">
|
|
<div id="toolbar" style="display: none;">
|
<form id="searchForm" style="margin:4px 0px 0px 0px">
|
<div class="topTool">
|
<fieldset>
|
<div>
|
<span class="label">标题:</span>
|
<input type="text" name="title" style="width:120px;"/>
|
</div>
|
<div>
|
<span class="label">状态:</span>
|
<select id="sel1" name="sendFlag" style="width:120px;" class="easyui-combobox fselect"
|
data-options="panelHeight:'auto'">
|
<option value=""> ---选择状态---</option>
|
<%--<option value="0" >草稿</option>
|
<option value="1" >审核中</option>
|
<option value="2" >签发中</option>
|
<option value="3" >已发布</option>--%>
|
<option value="0">未推送</option>
|
<option value="1">已推送</option>
|
</select>
|
</div>
|
<div>
|
<span class="label">日期: </span>
|
<span class="label"><input id="scrq_sdate" name="time" readOnly=true type="text"
|
class="easyui-datebox" datefmt="yyyy-MM-dd" style="width:120px"/></span>
|
</div>
|
<div>
|
<span class="label">到</span>
|
<span class="label"><input id="scrq_edate" name="approveTime" readOnly=true type="text"
|
class="easyui-datebox" datefmt="yyyy-MM-dd" style="width:120px"/></span>
|
</div>
|
</fieldset>
|
</div>
|
</form>
|
<div class="easyui-toolbar">
|
<c:if test="${not empty sessionInfo.resourcesMap['/pms/msg/queryMsgInfo.do/tzgl']}">
|
<a onclick="queryMsgInfo()" 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/msg/gotoMsgInfoForm.do/tzgl']}">
|
<a onclick="goToMsgInfoAdd();" href="javascript:void(0);" class="easyui-linkbutton"
|
data-options="plain:true,iconCls:'icon-standard-plugin-add'">添加</a>
|
</c:if>
|
<c:if test="${not empty sessionInfo.resourcesMap['/pms/msg/onclick.do/tzgl']}">
|
<!-- <div onclick="editMsgInfo()" class="easyui-linkbutton" data-options="iconCls:'icon-standard-plugin-add'">编辑</div> -->
|
<a onclick="editMsgInfo();" href="javascript:void(0);" class="easyui-linkbutton"
|
data-options="plain:true,iconCls:'icon-standard-plugin-edit'">编辑</a>
|
</c:if>
|
<c:if test="${not empty sessionInfo.resourcesMap['/pms/msg/batchDeleteMsgInfo.do/tzgl']}">
|
<!-- <div onclick="deleteMsgInfo();" class="easyui-linkbutton" data-options="iconCls:'icon-standard-plugin-delete'">删除</div> -->
|
<a onclick="beatchDeleteMsgInfo();" href="javascript:void(0);" class="easyui-linkbutton"
|
data-options="plain:true,iconCls:'icon-standard-plugin-delete'">批量删除</a>
|
</c:if>
|
</div>
|
</div>
|
|
<div data-options="region:'center',border:false">
|
<table id="dataGrid"></table>
|
</div>
|
<%-- <div id="menu" class="easyui-menu" style="width: 80px; display: none;">
|
<c:if test="${msgOperator.name == 'APPROVE'}">
|
<div onclick="approveMsgInfo();" data-options="iconCls:'icon-standard-plugin-add'">审核</div>
|
</c:if>
|
<c:if test="${msgOperator.name == 'ISSUER' }">
|
<div onclick="issueMsgInfo();" data-options="iconCls:'icon-standard-plugin-add'">签发</div>
|
</c:if>
|
|
|
</div> --%>
|
</body>
|
</html>
|