Skip to content
toQuery.jsp 9.16 KiB
Newer Older
杨郁彬's avatar
杨郁彬 committed
<%--
  since: 2019/7/15 13:15
  author: shen.shaohua
  description: 文电管理-发文
  url: ${ctx}/wdgl/toQuery/fw
--%>
<%@ 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" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%@ taglib prefix="cui" tagdir="/WEB-INF/tags" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<%@ page import="com.cesgroup.bdc.wdgl.vo.ConditionVo" %>
<%
	pageContext.setAttribute("idSuffix", String.valueOf(System.currentTimeMillis()).substring(6));

	ConditionVo conditionVo = (ConditionVo)request.getAttribute("conditionVo");
	pageContext.setAttribute("conditionVo", conditionVo);
	pageContext.setAttribute("cv", conditionVo.toString());
%>
<style type="text/css">
	.statistics {
		height: 85px;
		float: left;
		width: auto;
		margin-left: 13px;
		margin-top: 5px;
	}

	.statistics table {
		border: none;
		border-collapse: collapse;
	}

	.statistics table tr td {
		height: 28px;
		vertical-align: middle;
		text-align: center;
		border: 1px solid black;
	}

	.statistics table tr.dalei {
		background-color: #1fb5ad;
		font-weight: bold;
	}

	.statistics table tr.xiaolei td {
		/*background-color: #1fb5ad;*/
		/*font-weight: bold;*/
		padding: 0px 5px;
		min-width: 55px;
	}
</style>
<div style="height: 100%;">
	<div class="nav2"><img src="${ctx}/static/cm/image/wdgl-nav.png"/>文电管理</div>
	<c:if test="${not empty conditionVo.statistics}">
		<div style="height: 90px;" id="statistics${idSuffix}">
			<c:if test="${fn:contains(conditionVo.statistics, '0')}">
				<div class="statistics">
					<table>
						<tr class="dalei">
							<td colspan="5">类型</td>
						</tr>
						<tr class="xiaolei">
							<td>文件</td>
							<td>简报</td>
							<td>会议通知</td>
							<td>一般通知</td>
							<td>信息</td>
						</tr>
						<tr class="shuliang">
							<td id="mailType-wj${idSuffix}"></td>
							<td id="mailType-jb${idSuffix}"></td>
							<td id="mailType-hy${idSuffix}"></td>
							<td id="mailType-tz${idSuffix}"></td>
							<td id="mailType-xx${idSuffix}"></td>
						</tr>
					</table>
				</div>
			</c:if>
			<c:if test="${fn:contains(conditionVo.statistics, '1')}">
				<div class="statistics">
					<table>
						<tr class="dalei">
							<td colspan="5">密级</td>
						</tr>
						<tr class="xiaolei">
							<td></td>
							<td>秘密</td>
							<td>机密</td>
						</tr>
						<tr class="shuliang">
							<td id="safeLevel-wu${idSuffix}"></td>
							<td id="safeLevel-mm${idSuffix}"></td>
							<td id="safeLevel-jm${idSuffix}"></td>
						</tr>
					</table>
				</div>
			</c:if>
			<c:if test="${fn:contains(conditionVo.statistics, '2')}">
				<div class="statistics">
					<table>
						<tr class="dalei">
							<td colspan="5">紧急度</td>
						</tr>
						<tr class="xiaolei">
							<td></td>
							<td>平急</td>
							<td>加急</td>
							<td>特急</td>
							<td>特提</td>
						</tr>
						<tr class="shuliang">
							<td id="emergency-wu${idSuffix}"></td>
							<td id="emergency-pj${idSuffix}"></td>
							<td id="emergency-jj${idSuffix}"></td>
							<td id="emergency-tj${idSuffix}"></td>
							<td id="emergency-tt${idSuffix}"></td>
						</tr>
					</table>
				</div>
			</c:if>
		</div>
	</c:if>
	<div class="table-head">
		<div class="table-title">发文列表</div>
		<div class="table-head-right">
			<a onclick="mailSend_toQuery_sample.exp()">导出报表</a>
			<a onclick="mailSend_toQuery_sample.goBack()">返回</a>
		</div>
	</div>
	<cui:grid id="grid${idSuffix}" url="${ctx}/mail-send/toQuery" asyncType="get" postData="mailSend_toQuery_sample.postData"
						sortorder="desc" loadonce="false" rownumbers="true" fitStyle="fill" multiselect="true"
						style="margin-left: 5px;margin-right: 5px;">
		<cui:gridCols>
			<cui:gridCol name="id" hidden="true">id</cui:gridCol>

			<cui:gridCol name="mailNo" width="30">发文号</cui:gridCol>
			<c:if test="${conditionVo.flag eq 'all'}"></c:if>
				<cui:gridCol name="deptName" width="20">发送单位</cui:gridCol>

			<cui:gridCol name="mailTitle" formatter="mailSend_toQuery_sample.titleFmt" width="80">文电标题</cui:gridCol>
			<cui:gridCol name="mailType" width="20">类型</cui:gridCol>
			<cui:gridCol name="emergency" width="20">紧急度</cui:gridCol>
			<cui:gridCol name="safeLevel" width="20">密级</cui:gridCol>
			<cui:gridCol name="mailPage" width="20">页数</cui:gridCol>
			<cui:gridCol name="sendTime" width="30">发送时间</cui:gridCol>
			<cui:gridCol name="status" formatter="mailSend_toQuery_sample.statusFmt" width="20">状态</cui:gridCol>
		</cui:gridCols>
		<cui:gridPager gridId="grid${idSuffix}"/>
	</cui:grid>
</div>
<cui:form id="expForm${idSuffix}" action="${ctx}/mail-send/toQuery/exp"
					target="_blank" style="display: none;">
	<input type="hidden" name="mailType"/>
	<input type="hidden" name="safeLevel"/>
	<input type="hidden" name="emergency"/>
	<input type="hidden" name="effDateBegin"/>
	<input type="hidden" name="effDateEnd"/>
	<input type="hidden" name="sendTimeBegin"/>
	<input type="hidden" name="sendTimeEnd"/>
	<input type="hidden" name="mailStatus"/>
	<input type="hidden" name="sendDept"/>
	<input type="hidden" name="autoDownload"/>
	<input type="hidden" name="mailNo"/>
	<input type="hidden" name="mailTitle"/>
	<input type="hidden" name="receiveDateBegin"/>
	<input type="hidden" name="receiveDateEnd"/>
	<input type="hidden" name="receiveDept"/>
	<input type="hidden" name="statistics"/>
	<input type="hidden" name="flag"/>
	<input type="hidden" name="receiveDeptId"/>
	<input type="hidden" name="sendUserId"/>
	<input type="hidden" name="descs"/>
	<input type="hidden" name="ascs"/>
</cui:form>
<cui:dialog id="dialogC${idSuffix}" modal="true" autoOpen="false" reLoadOnOpen="true"
						focusInput="false" resizable="true" autoDestroy="true" maximized="false"></cui:dialog>
<script type="text/javascript">
	var mailSend_toQuery_fun = (function (win, $) {
		var postData = ${cv};
		postData.descs = 'SEND_TIME';

		function sample() {
			this.postData = postData;
		}

		var statistics = '${conditionVo.statistics}';//归类统计

		var $expForm = $('#expForm${idSuffix}');
		var $grid = $('#grid${idSuffix}');

		$.parseDone(function () {
			$expForm.form('load', postData);

			if (statistics) {
				loadStatistics();
			}
		});

		//归类统计
		function loadStatistics() {
			$.ajax({
				type: 'POST',
				url: '${ctx}/mail-send/statistics',
				data: postData,
				dataType: 'json',
				success: function (data) {
					//console.log('归类统计', data);
					$('#statistics${idSuffix} .shuliang td').html('0');
					$.each(data, function (i, item) {
						var id = '';
						if (item.MAIL_TYPE == '文件') {
							id = 'mailType-wj${idSuffix}';
						} else if (item.MAIL_TYPE == '简报') {
							id = 'mailType-jb${idSuffix}';
						} else if (item.MAIL_TYPE == '会议通知') {
							id = 'mailType-hy${idSuffix}';
						} else if (item.MAIL_TYPE == '一般通知') {
							id = 'mailType-tz${idSuffix}';
						} else if (item.MAIL_TYPE == '信息') {
							id = 'mailType-xx${idSuffix}';
						} else if (item.SAFE_LEVEL == '') {
							id = 'safeLevel-wu${idSuffix}';
						} else if (item.SAFE_LEVEL == '秘密') {
							id = 'safeLevel-mm${idSuffix}';
						} else if (item.SAFE_LEVEL == '机密') {
							id = 'safeLevel-jm${idSuffix}';
						} else if (item.EMERGENCY == '') {
							id = 'emergency-wu${idSuffix}';
						} else if (item.EMERGENCY == '平急') {
							id = 'emergency-pj${idSuffix}';
						} else if (item.EMERGENCY == '加急') {
							id = 'emergency-jj${idSuffix}';
						} else if (item.EMERGENCY == '特急') {
							id = 'emergency-tj${idSuffix}';
						} else if (item.EMERGENCY == '特提') {
							id = 'emergency-tt${idSuffix}';
						}
						$('#' + id).html(item.CC);
					});
				},
				error: function (e) {
					error(e);
				}
			});
		}

		//导出报表
		sample.prototype.exp = function () {
			$expForm.submit();
		}

		//返回
		sample.prototype.goBack = function () {
			index_sample.refreshTheMainPanel('${ctx}/wdgl/index')
		}

		//刷新列表
		sample.prototype.reloadGrid = function () {
			$grid.grid('reload');
		}

		sample.prototype.titleFmt = function (cellValue, options, rowObject) {
			var result = '<a onclick="mailSend_toQuery_sample.view(\'' + rowObject.id + '\')">' + cellValue + '</a>';
			return result;
		}

		sample.prototype.statusFmt = function (cellValue, options, rowObject) {
			var result = '';
			var status = rowObject.status;
			if (status == '0') {
				result = '未完成';
			} else if (status == '1') {
				result = '完成';
			} else if (status == '-1') {
				result = '未发送';
			}else {
				result = status;
			}
			return result;
		}

		//查看
		sample.prototype.view = function (id) {
			var url = '${ctx}/mail-send/view/' + id;
			$('#dialogC${idSuffix}').dialog('option', {
				url: url,
				title: '发文',
				asyncType: 'get',
				width: 1000,
				height: 550,
				buttons: null
			}).dialog('open');
		}

		return sample;
	})(window, $);

	var mailSend_toQuery_sample = new mailSend_toQuery_fun();
	window['mailSend_toQuery_fun'] = null;
	delete window['mailSend_toQuery_fun'];
</script>