Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<%@ 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="shiro" uri="http://shiro.apache.org/tags" %>
<%@ taglib prefix="cui" tagdir="/WEB-INF/tags" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<%
pageContext.setAttribute("idSuffix", String.valueOf(System.currentTimeMillis()).substring(6));
%>
<div style="height: 100%;">
<div class="nav2"><img src="${ctx}/static/cm/image/sjj-nav.png"/>收件夹</div>
<div class="table-head">
<div class="table-title">收文列表</div>
</div>
<cui:form id="searchForm${idSuffix}" style="padding: 0px;margin:10px 0px;vertical-align: middle;">
<div align="center">
<span>来文单位:</span>
<cui:input type="text" name="deptName" id="deptName${idSuffix}" width="120" required="false"/>
<span style="padding-left: 20px">文电标题:</span>
<cui:input type="text" name="mailTitle" id="mailTitle${idSuffix}" width="120" required="false"/>
<%-- <span style="padding-left: 20px">密级:</span>
<cui:combobox name="securityLevel" id="securityLevel${idSuffix}" readonlyInput="false"
width="120" data="fileSearch_sendList.securityLevelData" emptyText="请选择"/>--%>
<span style="padding-left: 20px">发送时间:</span>
<cui:datepicker width="120" name="sendTimeStart" dateFormat="yyyy-MM-dd"/>至<cui:datepicker width="120"
name="sendTimeEnd"
dateFormat="yyyy-MM-dd"/>
<span class="btn-bar">
<a onclick="mailReceive_list_sample.search('A')">查询</a>
<a onclick="mailReceive_list_sample.search(1)">未签收</a>
<a onclick="mailReceive_list_sample.search(2)">已签收</a>
<a onclick="mailReceive_list_sample.batchSign()">批量签收</a>
</span>
</div>
</cui:form>
<cui:grid id="grid${idSuffix}" url="${ctx}/mail-receive/queryReceiveList2" asyncType="get"
postData="mailReceive_list_sample.postData"
sortorder="desc" loadonce="false" rownumbers="true" rownumName="序号" 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="mailSendId" hidden="true">mailSendId</cui:gridCol>
<%--<cui:gridCol name="mailSend.mailNo" width="60">发文号</cui:gridCol>--%>
<cui:gridCol name="mailSend.deptName" width="60" formatter="mailReceive_list_sample.deptNameFmt">来文单位</cui:gridCol>
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
<cui:gridCol name="mailSend.mailTitle" width="120"
formatter="mailReceive_list_sample.titleFmt">文电标题</cui:gridCol>
<cui:gridCol name="mailSend.mailType" width="50">类型</cui:gridCol>
<cui:gridCol name="mailSend.emergency" width="30">紧急度</cui:gridCol>
<cui:gridCol name="mailSend.safeLevel" width="25">密级</cui:gridCol>
<cui:gridCol name="mailSend.mailPage" width="15">页数</cui:gridCol>
<cui:gridCol name="mailSend.sendTime" width="80">发送时间</cui:gridCol>
<cui:gridCol name="status" width="60"
formatter="mailReceive_list_sample.statusFmt">状态</cui:gridCol>
</cui:gridCols>
<cui:gridPager gridId="grid${idSuffix}"/>
</cui:grid>
</div>
<cui:dialog id="dialogA${idSuffix}" modal="true" autoOpen="false" reLoadOnOpen="true"
focusInput="false" resizable="true" autoDestroy="true" maximized="false"></cui:dialog>
<script type="text/javascript">
var mailReceive_list_fun = (function (win, $) {
var status = '${status}';
var selectDepts = [];//已选单位
function sample() {
this.postData = {
descs: 'SEND_TIME',
status: status
}
}
var $grid = $('#grid${idSuffix}');
//查询
sample.prototype.search = function (status1) {
status = status1;
console.log("开始查询!")
var $form = $('#searchForm${idSuffix}');
var formData = $form.form('formData');
if (formData.sendTimeStart) formData.sendTimeStart = formData.sendTimeStart + ' 00:00:00';
if (formData.sendTimeEnd) formData.sendTimeEnd = formData.sendTimeEnd + ' 23:59:59';
formData.status = status;
this.postData = $.extend(this.postData, formData);
$grid.grid('reload', {page: 1});
}
//选择部门
sample.prototype.jsdwPicker = function () {
selectDepts = []
var url = '${ctx}/auth/selectDept?initfun=mailReceive_list_sample.initfun&callback=mailReceive_list_sample.deptCallback';
$('#dialogA${idSuffix}').dialog('option', {
url: url,
title: '添加单位',
asyncType: 'get',
width: 735,
height: 565,
buttons: null
}).dialog('open');
}
//获取已选单位
sample.prototype.initfun = function () {
return selectDepts;
}
//选择部门回调方法
sample.prototype.deptCallback = function (selectDeptArray) {
selectDepts = selectDeptArray;
var str = JSON.stringify(selectDeptArray);
$('#receiveDept${idSuffix}').val(str);
var dd = '';
$.each(selectDeptArray, function (i, item) {
if (i > 0) dd += ',';
dd += item.deptName;
});
$('#deptNames${idSuffix}').textbox('setValue', dd);
}
//批量签收
sample.prototype.batchSign = function () {
console.log("批量签收!")
var selrows = $grid.grid('option', 'selarrrow');
if (selrows.length < 1) {
warning('请选择要批量签收的记录!');
return;
}
$.confirm('将同时批量签收收件夹的相关信息<br>确定要批量签收吗?', function (r) {
if (r) {
var ids = [];
for (var i = 0; i < selrows.length; i++) {
var rowData = $grid.grid('getRowData', selrows[i]);
ids.push(rowData.id);
}
loading('发送中...');
$.ajax({
type: 'POST',
url: '${ctx}/mail-receive/batchSign',
traditional: true,
data: {
relevanceIds: ids,
},
dataType: 'json',
success: function (data) {
hide();
if (data.code == '0') {
message('保存成功!');
mailReceive_list_sample.search(status);
} else if (data.code == '-1') {
error('保存失败!');
}
},
error: function (e) {
hide();
error(e);
}
});
}
});
}
/* //添加
sample.prototype.add = function () {
var url = '
${ctx}/mail-send/add';
$('#dialogA
${idSuffix}').dialog('option', {
url: url,
title: '添加发文',
asyncType: 'get',
width: 900,
height: 550,
buttons: null
}).dialog('open');
}*/
//删除
sample.prototype.del = function () {
alert('删除');
}
//刷新列表
sample.prototype.reloadGrid = function () {
$grid.grid('reload');
}
sample.prototype.statusFmt = function (cellValue, options, rowObject) {
var result = '';
var status = rowObject.status;
if (status == '1') {
result = '未签收';
} else if (status == '2') {
result = '已签收';
} else {
result = status;
}
return result;
}
sample.prototype.deptNameFmt = function (cellValue, options, rowObject) {
var result = '';
if (rowObject.mailSend.forwordDept != null && rowObject.mailSend.forwordDept != "" && rowObject.mailSend.forwordDept != rowObject.mailSend.deptName){
result = rowObject.mailSend.forwordDept;
}else {
result = cellValue;
}
return result;
}
var result = '';
if (rowObject.mailSend.forwordDept != null && rowObject.mailSend.forwordDept != "" && rowObject.mailSend.forwordDept != rowObject.mailSend.deptName){
result += '<a style="color:rgb(67,71,201)" onclick="mailReceive_list_sample.edit(\'' + rowObject.id + '\',\'' + rowObject.mailSendId + '\')">' + cellValue +'(由'+rowObject.mailSend.deptName+'转发)</a>';
}else {
result += '<a style="color:rgb(67,71,201)" onclick="mailReceive_list_sample.edit(\'' + rowObject.id + '\',\'' + rowObject.mailSendId + '\')">' + cellValue + '</a>';
}
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
return result;
}
//查看
sample.prototype.edit = function (id, mailSendId) {
var url = '${ctx}/mail-receive/edit?id=' + id + "&mailSendId=" + mailSendId;
$('#dialogA${idSuffix}').dialog('option', {
url: url,
title: '收件',
asyncType: 'get',
width: 1100,
height: 520,
buttons: null
}).dialog('open');
}
return sample;
})(window, $);
var mailReceive_list_sample = new mailReceive_list_fun();
window['mailReceive_list_fun'] = null;
delete window['mailReceive_list_fun'];
</script>