修修补补 OvO

This commit is contained in:
wans 2022-04-06 15:43:31 +08:00
parent 7dddaf1596
commit bd0abfd14d
10 changed files with 284 additions and 162 deletions

View File

@ -19,9 +19,11 @@
<form class="layui-form layui-form-pane" lay-filter="dataForm"> <form class="layui-form layui-form-pane" lay-filter="dataForm">
<div class="layui-row" style="padding: 10px;"> <div class="layui-row" style="padding: 10px;">
<div class="layui-col-md6"> <div class="layui-col-md6">
<button type="button" class="layui-btn layui-btn-sm" lay-submit lay-filter="submitSend"> <button type="button" class="layui-btn layui-btn-xs" lay-submit lay-filter="submitSend">
<i class="fa fa-lg fa-paper-plane-o"></i> 转发 <i class="fa fa-lg fa-paper-plane-o"></i> 转发
</button> </button>
<a href="javascript:void(0)" id="copy-for-btn" style="color: #1e88e5;text-decoration: underline;margin-left: 25px;">抄送</a>
<a href="javascript:void(0)" id="secret-btn" style="color: #1e88e5;text-decoration: underline;margin-left: 25px;">密送</a>
</div> </div>
</div> </div>
<div class="layui-card-body" style="padding: 10px;"> <div class="layui-card-body" style="padding: 10px;">
@ -32,12 +34,22 @@
<div class="layui-input-block"> <div class="layui-input-block">
<input type="hidden" id="recipientIds" name="recipientIds" class="layui-input" value=""> <input type="hidden" id="recipientIds" name="recipientIds" class="layui-input" value="">
<input type="text" id="recipientNames" name="recipientNames" class="layui-input" value="" <input type="text" id="recipientNames" name="recipientNames" class="layui-input" value=""
style="cursor: pointer" placeholder="点击选择收件人" readonly="readonly"> style="cursor: pointer" placeholder="点击选择收件人" readonly="readonly" lay-verify="required">
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="layui-row"> <div class="layui-row">
<div class="layui-col-md12">
<div class="layui-form-item">
<label class="layui-form-label"><span style="color: #cc0000;">* </span>主题</label>
<div class="layui-input-block">
<input type="text" id="title" name="title" class="layui-input" value="" placeholder="" maxlength="255">
</div>
</div>
</div>
</div>
<div class="layui-row" id="copy-for-div" style="display: none;">
<div class="layui-col-md12"> <div class="layui-col-md12">
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">抄送人</label> <label class="layui-form-label">抄送人</label>
@ -49,7 +61,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="layui-row"> <div class="layui-row" id="secret-div" style="display: none;">
<div class="layui-col-md12"> <div class="layui-col-md12">
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">密送人</label> <label class="layui-form-label">密送人</label>
@ -61,16 +73,6 @@
</div> </div>
</div> </div>
</div> </div>
<div class="layui-row">
<div class="layui-col-md12">
<div class="layui-form-item">
<label class="layui-form-label"><span style="color: #cc0000;">* </span>主题</label>
<div class="layui-input-block">
<input type="text" id="title" name="title" class="layui-input" value="" placeholder="" maxlength="255">
</div>
</div>
</div>
</div>
<div class="layui-row"> <div class="layui-row">
<div class="layui-form-text"> <div class="layui-form-text">
<label class="layui-form-label">附件</label> <label class="layui-form-label">附件</label>
@ -138,7 +140,7 @@
var id = top.restAjax.params(window.location.href).id; var id = top.restAjax.params(window.location.href).id;
var dto = {}; var dto = {};
$('.layui-card').height($(window).height() - 30) $('.layui-card').height($(window).height())
function init(){ function init(){
top.restAjax.get(top.restAjax.path('api/mail/get-inbox-mail', []), { top.restAjax.get(top.restAjax.path('api/mail/get-inbox-mail', []), {
@ -159,6 +161,18 @@
} }
init(); init();
$(document).on('click', '#copy-for-btn', function(){
$('#copyForIds').val('');
$('#copyForNames').val('');
$('#copy-for-div').toggle();
});
$(document).on('click', '#secret-btn', function(){
$('#secretIds').val('');
$('#secretNames').val('');
$('#secret-div').toggle();
});
// 初始化文件列表 // 初始化文件列表
function initFileList(fileName, ids, callback) { function initFileList(fileName, ids, callback) {
var dataForm = {}; var dataForm = {};
@ -291,19 +305,23 @@
selectSend(); selectSend();
}); });
function selectSend(){ function selectSend(){
top.dialog.dialogData.selectedUserIds = $('#recipientIds').val(); top.dialog.dialogData.selectedUserIds = $('#recipientIds').val().replaceAll(",","_");
top.dialog.open({ top.dialog.open({
url: top.restAjax.path('route/department/user/select-user', []), url: top.restAjax.path('route/department/user/select-user', []),
title: '选择收件人', title: '选择收件人',
width: '500px', width: '600px',
height: '500px', height: '500px',
closeBtn: 0, closeBtn: 0,
onClose: function() { onClose: function() {
top.dialog.dialogData.selectedDepartmentUsers = null; var insertUsers = top.dialog.dialogData.selectedDepartmentUsers;
var insertUsers = top.dialog.dialogData.saveDepartmentUsers; if(insertUsers.length == 0){
if(insertUsers && insertUsers.length > 0) { $('#recipientIds').val('');
var recipientIds = $('#recipientIds').val() == '' ? $('#recipientIds').val() : $('#recipientIds').val() + ','; $('#recipientNames').val('');
var recipientNames = $('#recipientNames').val() == '' ? $('#recipientNames').val() : $('#recipientNames').val() + ','; return;
}
if(insertUsers.length > 0) {
var recipientIds = '';
var recipientNames = '';
for (var i = 0, item; item = insertUsers[i++];) { for (var i = 0, item; item = insertUsers[i++];) {
recipientIds += item.userId + ','; recipientIds += item.userId + ',';
recipientNames += item.userName + '[' + item.username + ']' + ','; recipientNames += item.userName + '[' + item.username + ']' + ',';
@ -324,19 +342,23 @@
selectCopyFor(); selectCopyFor();
}); });
function selectCopyFor(){ function selectCopyFor(){
top.dialog.dialogData.selectedUserIds = $('#copyForIds').val(); top.dialog.dialogData.selectedUserIds = $('#copyForIds').val().replaceAll(",","_");
top.dialog.open({ top.dialog.open({
url: top.restAjax.path('route/department/user/select-user', []), url: top.restAjax.path('route/department/user/select-user', []),
title: '选择抄送人', title: '选择抄送人',
width: '500px', width: '600px',
height: '500px', height: '500px',
closeBtn: 0, closeBtn: 0,
onClose: function() { onClose: function() {
top.dialog.dialogData.selectedDepartmentUsers = null; var insertUsers = top.dialog.dialogData.selectedDepartmentUsers;
var insertUsers = top.dialog.dialogData.saveDepartmentUsers; if(insertUsers.length == 0){
if(insertUsers && insertUsers.length > 0) { $('#copyForIds').val('');
var copyForIds = $('#copyForIds').val() == '' ? $('#copyForIds').val() : $('#copyForIds').val() + ','; $('#copyForNames').val('');
var copyForNames = $('#copyForNames').val() == '' ? $('#copyForNames').val() : $('#copyForNames').val() + ','; return;
}
if(insertUsers.length > 0) {
var copyForIds = '';
var copyForNames = '';
for (var i = 0, item; item = insertUsers[i++];) { for (var i = 0, item; item = insertUsers[i++];) {
copyForIds += item.userId + ','; copyForIds += item.userId + ',';
copyForNames += item.userName + '[' + item.username + ']' + ','; copyForNames += item.userName + '[' + item.username + ']' + ',';
@ -357,19 +379,23 @@
selectSecret(); selectSecret();
}); });
function selectSecret(){ function selectSecret(){
top.dialog.dialogData.selectedUserIds = $('#secretIds').val(); top.dialog.dialogData.selectedUserIds = $('#secretIds').val().replaceAll(",","_");
top.dialog.open({ top.dialog.open({
url: top.restAjax.path('route/department/user/select-user', []), url: top.restAjax.path('route/department/user/select-user', []),
title: '选择密送人', title: '选择密送人',
width: '500px', width: '600px',
height: '500px', height: '500px',
closeBtn: 0, closeBtn: 0,
onClose: function() { onClose: function() {
top.dialog.dialogData.selectedDepartmentUsers = null; var insertUsers = top.dialog.dialogData.selectedDepartmentUsers;
var insertUsers = top.dialog.dialogData.saveDepartmentUsers; if(insertUsers.length > 0) {
if(insertUsers && insertUsers.length > 0) { var secretIds = '';
var secretIds = $('#secretIds').val() == '' ? $('#secretIds').val() : $('#secretIds').val() + ','; var secretNames = '';
var secretNames = $('#secretNames').val() == '' ? $('#secretNames').val() : $('#secretNames').val() + ','; if(insertUsers.length == 0){
$('#secretIds').val('');
$('#secretNames').val('');
return;
}
for (var i = 0, item; item = insertUsers[i++];) { for (var i = 0, item; item = insertUsers[i++];) {
secretIds += item.userId + ','; secretIds += item.userId + ',';
secretNames += item.userName + '[' + item.username + ']' + ','; secretNames += item.userName + '[' + item.username + ']' + ',';

View File

@ -40,6 +40,16 @@
</div> </div>
</div> </div>
<div class="layui-row"> <div class="layui-row">
<div class="layui-col-md12">
<div class="layui-form-item">
<label class="layui-form-label">主题</label>
<div class="layui-input-block">
<input type="text" id="title" name="title" class="layui-input" value="" readonly="readonly">
</div>
</div>
</div>
</div>
<div class="layui-row" id="copy-for-div" style="display: none;">
<div class="layui-col-md12"> <div class="layui-col-md12">
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">抄送人</label> <label class="layui-form-label">抄送人</label>
@ -51,7 +61,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="layui-row"> <div class="layui-row" id="secret-div" style="display: none;">
<div class="layui-col-md12"> <div class="layui-col-md12">
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">密送人</label> <label class="layui-form-label">密送人</label>
@ -63,16 +73,6 @@
</div> </div>
</div> </div>
</div> </div>
<div class="layui-row">
<div class="layui-col-md12">
<div class="layui-form-item">
<label class="layui-form-label">主题</label>
<div class="layui-input-block">
<input type="text" id="title" name="title" class="layui-input" value="" readonly="readonly">
</div>
</div>
</div>
</div>
<div class="layui-row"> <div class="layui-row">
<div class="layui-form-text"> <div class="layui-form-text">
<label class="layui-form-label">附件</label> <label class="layui-form-label">附件</label>
@ -145,6 +145,12 @@
initRichContentContentRichText(dataFormData['contentRich']); initRichContentContentRichText(dataFormData['contentRich']);
initMailFilesUploadFile(); initMailFilesUploadFile();
form.render(null, 'dataForm'); form.render(null, 'dataForm');
if(dataFormData['copyForIds'] != ''){
$('#copy-for-div').toggle();
}
if(dataFormData['secretIds'] != ''){
$('#secret-div').toggle();
}
}, function(code, data) { }, function(code, data) {
top.dialog.msg(data.msg); top.dialog.msg(data.msg);
}); });

View File

@ -167,6 +167,7 @@
anim: 2, anim: 2,
content: top.restAjax.path('route/mail/mail-send-draft-edit.html?mailId={arg}', [checkDatas[0].mailId]), content: top.restAjax.path('route/mail/mail-send-draft-edit.html?mailId={arg}', [checkDatas[0].mailId]),
end: function() { end: function() {
reloadTable();
} }
}); });
return; return;

View File

@ -163,9 +163,13 @@
var checkStatus = table.checkStatus('dataTable'); var checkStatus = table.checkStatus('dataTable');
var checkDatas = checkStatus.data; var checkDatas = checkStatus.data;
if(layEvent === 'showEvent') { if(layEvent === 'showEvent') {
if(checkDatas.length === 0 || checkDatas.length > 1){
layer.msg("请选择一条记录");
return;
}
layer.open({ layer.open({
type: 2, type: 2,
title: '查看邮件', title: '收件箱',
closeBtn: 1, closeBtn: 1,
area: ['95%', '95%'], area: ['95%', '95%'],
shadeClose: false, shadeClose: false,

View File

@ -20,8 +20,8 @@
<div class="layui-row" style="padding: 10px;"> <div class="layui-row" style="padding: 10px;">
<div class="layui-col-md6"> <div class="layui-col-md6">
<div> <div>
<span>发件人: <span id="creatorNames"></span></span> <span>发件人: <span id="creatorNames" style="margin-left: 5px;"></span></span>
<button type="button" id="reply-btn" class="layui-btn layui-btn-normal layui-btn-xs"> <button type="button" id="reply-btn" class="layui-btn layui-btn-normal layui-btn-xs" style="margin-left: 25px;">
<i class="fa fa-lg fa-paper-plane-o"></i> 回复 <i class="fa fa-lg fa-paper-plane-o"></i> 回复
</button> </button>
<button type="button" id="forward-btn" class="layui-btn layui-btn-info layui-btn-xs"> <button type="button" id="forward-btn" class="layui-btn layui-btn-info layui-btn-xs">
@ -44,6 +44,16 @@
</div> </div>
</div> </div>
<div class="layui-row"> <div class="layui-row">
<div class="layui-col-md12">
<div class="layui-form-item">
<label class="layui-form-label">主题</label>
<div class="layui-input-block">
<input type="text" id="title" name="title" class="layui-input" value="" readonly="readonly">
</div>
</div>
</div>
</div>
<div class="layui-row" id="copy-for-div" style="display: none">
<div class="layui-col-md12"> <div class="layui-col-md12">
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">抄送人</label> <label class="layui-form-label">抄送人</label>
@ -55,7 +65,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="layui-row"> <div class="layui-row" id="secret-div" style="display: none">
<div class="layui-col-md12"> <div class="layui-col-md12">
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">密送人</label> <label class="layui-form-label">密送人</label>
@ -67,16 +77,6 @@
</div> </div>
</div> </div>
</div> </div>
<div class="layui-row">
<div class="layui-col-md12">
<div class="layui-form-item">
<label class="layui-form-label">主题</label>
<div class="layui-input-block">
<input type="text" id="title" name="title" class="layui-input" value="" readonly="readonly">
</div>
</div>
</div>
</div>
<div class="layui-row"> <div class="layui-row">
<div class="layui-form-text"> <div class="layui-form-text">
<label class="layui-form-label">附件</label> <label class="layui-form-label">附件</label>
@ -150,6 +150,12 @@
initMailFilesUploadFile(); initMailFilesUploadFile();
$('#creatorNames').html(dataFormData['creatorNames']); $('#creatorNames').html(dataFormData['creatorNames']);
form.render(null, 'dataForm'); form.render(null, 'dataForm');
if(dataFormData['copyForIds'] != ''){
$('#copy-for-div').toggle();
}
if(dataFormData['secretIds'] != ''){
$('#secret-div').toggle();
}
}, function(code, data) { }, function(code, data) {
top.dialog.msg(data.msg); top.dialog.msg(data.msg);
}); });

View File

@ -19,12 +19,14 @@
<form class="layui-form layui-form-pane" lay-filter="dataForm"> <form class="layui-form layui-form-pane" lay-filter="dataForm">
<div class="layui-row" style="padding: 10px;"> <div class="layui-row" style="padding: 10px;">
<div class="layui-col-md6"> <div class="layui-col-md6">
<button type="button" class="layui-btn layui-btn-sm" lay-submit lay-filter="submitSendDraft"> <button type="button" class="layui-btn layui-btn-xs" lay-submit lay-filter="submitSendDraft">
<i class="fa fa-lg fa-paper-plane-o"></i> 发送 <i class="fa fa-lg fa-paper-plane-o"></i> 发送
</button> </button>
<button type="button" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit lay-filter="submitEditDraft"> <button type="button" class="layui-btn layui-btn-normal layui-btn-xs" lay-submit lay-filter="submitEditDraft">
<i class="fa fa-lg fa-edit"></i> 保存修改 <i class="fa fa-lg fa-edit"></i> 保存修改
</button> </button>
<a href="javascript:void(0)" id="copy-for-btn" style="color: #1e88e5;text-decoration: underline;margin-left: 25px;">抄送</a>
<a href="javascript:void(0)" id="secret-btn" style="color: #1e88e5;text-decoration: underline;margin-left: 25px;">密送</a>
</div> </div>
</div> </div>
<div class="layui-card-body" style="padding: 10px;"> <div class="layui-card-body" style="padding: 10px;">
@ -35,12 +37,22 @@
<div class="layui-input-block"> <div class="layui-input-block">
<input type="hidden" id="recipientIds" name="recipientIds" class="layui-input" value=""> <input type="hidden" id="recipientIds" name="recipientIds" class="layui-input" value="">
<input type="text" id="recipientNames" name="recipientNames" class="layui-input" value="" <input type="text" id="recipientNames" name="recipientNames" class="layui-input" value=""
style="cursor: pointer" placeholder="点击选择收件人" readonly="readonly"> style="cursor: pointer" placeholder="点击选择收件人" readonly="readonly" lay-verify="required">
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="layui-row"> <div class="layui-row">
<div class="layui-col-md12">
<div class="layui-form-item">
<label class="layui-form-label"><span style="color: #cc0000;">* </span>主题</label>
<div class="layui-input-block">
<input type="text" id="title" name="title" class="layui-input" value="" placeholder="" maxlength="255" lay-verify="required">
</div>
</div>
</div>
</div>
<div class="layui-row" id="copy-for-div" style="display: none">
<div class="layui-col-md12"> <div class="layui-col-md12">
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">抄送人</label> <label class="layui-form-label">抄送人</label>
@ -52,7 +64,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="layui-row"> <div class="layui-row" id="secret-div" style="display: none">
<div class="layui-col-md12"> <div class="layui-col-md12">
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">密送人</label> <label class="layui-form-label">密送人</label>
@ -64,16 +76,6 @@
</div> </div>
</div> </div>
</div> </div>
<div class="layui-row">
<div class="layui-col-md12">
<div class="layui-form-item">
<label class="layui-form-label"><span style="color: #cc0000;">* </span>主题</label>
<div class="layui-input-block">
<input type="text" id="title" name="title" class="layui-input" value="" placeholder="" maxlength="255">
</div>
</div>
</div>
</div>
<div class="layui-row"> <div class="layui-row">
<div class="layui-form-text"> <div class="layui-form-text">
<label class="layui-form-label">附件</label> <label class="layui-form-label">附件</label>
@ -140,7 +142,7 @@
var wangEditorObj = {}; var wangEditorObj = {};
var mailId = top.restAjax.params(window.location.href).mailId; var mailId = top.restAjax.params(window.location.href).mailId;
$('.layui-card').height($(window).height() - 30) $('.layui-card').height($(window).height());
function init(){ function init(){
top.restAjax.get(top.restAjax.path('api/mail/get-draft-mail', []), { top.restAjax.get(top.restAjax.path('api/mail/get-draft-mail', []), {
@ -155,6 +157,12 @@
initRichContentContentRichText(dataFormData['contentRich']); initRichContentContentRichText(dataFormData['contentRich']);
initMailFilesUploadFile(); initMailFilesUploadFile();
form.render(null, 'dataForm'); form.render(null, 'dataForm');
if(dataFormData['copyForIds'] != ''){
$('#copy-for-div').toggle();
}
if(dataFormData['secretIds'] != ''){
$('#secret-div').toggle();
}
}, function(code, data) { }, function(code, data) {
top.dialog.msg(data.msg); top.dialog.msg(data.msg);
}); });
@ -163,6 +171,18 @@
} }
init(); init();
$(document).on('click', '#copy-for-btn', function(){
$('#copyForIds').val('');
$('#copyForNames').val('');
$('#copy-for-div').toggle();
});
$(document).on('click', '#secret-btn', function(){
$('#secretIds').val('');
$('#secretNames').val('');
$('#secret-div').toggle();
});
// 初始化文件列表 // 初始化文件列表
function initFileList(fileName, ids, callback) { function initFileList(fileName, ids, callback) {
var dataForm = {}; var dataForm = {};
@ -301,7 +321,7 @@
top.dialog.open({ top.dialog.open({
url: top.restAjax.path('route/department/user/select-user', []), url: top.restAjax.path('route/department/user/select-user', []),
title: '选择收件人', title: '选择收件人',
width: '500px', width: '600px',
height: '500px', height: '500px',
closeBtn: 1, closeBtn: 1,
onClose: function() { onClose: function() {
@ -334,7 +354,7 @@
top.dialog.open({ top.dialog.open({
url: top.restAjax.path('route/department/user/select-user', []), url: top.restAjax.path('route/department/user/select-user', []),
title: '选择抄送人', title: '选择抄送人',
width: '500px', width: '600px',
height: '500px', height: '500px',
closeBtn: 1, closeBtn: 1,
onClose: function() { onClose: function() {
@ -367,7 +387,7 @@
top.dialog.open({ top.dialog.open({
url: top.restAjax.path('route/department/user/select-user', []), url: top.restAjax.path('route/department/user/select-user', []),
title: '选择密送人', title: '选择密送人',
width: '500px', width: '600px',
height: '500px', height: '500px',
closeBtn: 1, closeBtn: 1,
onClose: function() { onClose: function() {

View File

@ -167,6 +167,7 @@
anim: 2, anim: 2,
content: top.restAjax.path('route/mail/mail-send-show.html?mailId={arg}', [checkDatas[0].mailId]), content: top.restAjax.path('route/mail/mail-send-show.html?mailId={arg}', [checkDatas[0].mailId]),
end: function() { end: function() {
reloadTable();
} }
}); });
return; return;

View File

@ -38,6 +38,16 @@
</div> </div>
</div> </div>
<div class="layui-row"> <div class="layui-row">
<div class="layui-col-md12">
<div class="layui-form-item">
<label class="layui-form-label">主题</label>
<div class="layui-input-block">
<input type="text" id="title" name="title" class="layui-input" value="" readonly="readonly">
</div>
</div>
</div>
</div>
<div class="layui-row" id="copy-for-div" style="display: none;">
<div class="layui-col-md12"> <div class="layui-col-md12">
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">抄送人</label> <label class="layui-form-label">抄送人</label>
@ -49,7 +59,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="layui-row"> <div class="layui-row" id="secret-div" style="display: none;">
<div class="layui-col-md12"> <div class="layui-col-md12">
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">密送人</label> <label class="layui-form-label">密送人</label>
@ -61,16 +71,6 @@
</div> </div>
</div> </div>
</div> </div>
<div class="layui-row">
<div class="layui-col-md12">
<div class="layui-form-item">
<label class="layui-form-label">主题</label>
<div class="layui-input-block">
<input type="text" id="title" name="title" class="layui-input" value="" readonly="readonly">
</div>
</div>
</div>
</div>
<div class="layui-row"> <div class="layui-row">
<div class="layui-form-text"> <div class="layui-form-text">
<label class="layui-form-label">附件</label> <label class="layui-form-label">附件</label>
@ -141,6 +141,12 @@
initRichContentContentRichText(dataFormData['contentRich']); initRichContentContentRichText(dataFormData['contentRich']);
initMailFilesUploadFile(); initMailFilesUploadFile();
form.render(null, 'dataForm'); form.render(null, 'dataForm');
if(dataFormData['copyForIds'] != ''){
$('#copy-for-div').toggle();
}
if(dataFormData['secretIds'] != ''){
$('#secret-div').toggle();
}
}, function(code, data) { }, function(code, data) {
top.dialog.msg(data.msg); top.dialog.msg(data.msg);
}); });

View File

@ -19,9 +19,11 @@
<form class="layui-form layui-form-pane" lay-filter="dataForm"> <form class="layui-form layui-form-pane" lay-filter="dataForm">
<div class="layui-row" style="padding: 10px;"> <div class="layui-row" style="padding: 10px;">
<div class="layui-col-md6"> <div class="layui-col-md6">
<button type="button" class="layui-btn layui-btn-sm" lay-submit lay-filter="submitSend"> <button type="button" class="layui-btn layui-btn-xs" lay-submit lay-filter="submitSend">
<i class="fa fa-lg fa-paper-plane-o"></i> 回复 <i class="fa fa-lg fa-paper-plane-o"></i> 回复
</button> </button>
<a href="javascript:void(0)" id="copy-for-btn" style="color: #1e88e5;text-decoration: underline;margin-left: 25px;">抄送</a>
<a href="javascript:void(0)" id="secret-btn" style="color: #1e88e5;text-decoration: underline;margin-left: 25px;">密送</a>
</div> </div>
</div> </div>
<div class="layui-card-body" style="padding: 10px;"> <div class="layui-card-body" style="padding: 10px;">
@ -32,12 +34,22 @@
<div class="layui-input-block"> <div class="layui-input-block">
<input type="hidden" id="recipientIds" name="recipientIds" class="layui-input" value=""> <input type="hidden" id="recipientIds" name="recipientIds" class="layui-input" value="">
<input type="text" id="recipientNames" name="recipientNames" class="layui-input" value="" <input type="text" id="recipientNames" name="recipientNames" class="layui-input" value=""
style="cursor: pointer" placeholder="点击选择收件人" readonly="readonly"> style="cursor: pointer" placeholder="点击选择收件人" readonly="readonly" lay-verify="required">
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="layui-row"> <div class="layui-row">
<div class="layui-col-md12">
<div class="layui-form-item">
<label class="layui-form-label"><span style="color: #cc0000;">* </span>主题</label>
<div class="layui-input-block">
<input type="text" id="title" name="title" class="layui-input" value="" placeholder="" maxlength="255" lay-verify="required">
</div>
</div>
</div>
</div>
<div class="layui-row" id="copy-for-div" style="display: none;">
<div class="layui-col-md12"> <div class="layui-col-md12">
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">抄送人</label> <label class="layui-form-label">抄送人</label>
@ -49,7 +61,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="layui-row"> <div class="layui-row" id="secret-div" style="display: none;">
<div class="layui-col-md12"> <div class="layui-col-md12">
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">密送人</label> <label class="layui-form-label">密送人</label>
@ -61,16 +73,6 @@
</div> </div>
</div> </div>
</div> </div>
<div class="layui-row">
<div class="layui-col-md12">
<div class="layui-form-item">
<label class="layui-form-label"><span style="color: #cc0000;">* </span>主题</label>
<div class="layui-input-block">
<input type="text" id="title" name="title" class="layui-input" value="" placeholder="" maxlength="255">
</div>
</div>
</div>
</div>
<div class="layui-row"> <div class="layui-row">
<div class="layui-form-text"> <div class="layui-form-text">
<label class="layui-form-label">附件</label> <label class="layui-form-label">附件</label>
@ -138,7 +140,7 @@
var id = top.restAjax.params(window.location.href).id; var id = top.restAjax.params(window.location.href).id;
var dto = {}; var dto = {};
$('.layui-card').height($(window).height() - 30) $('.layui-card').height($(window).height())
function init(){ function init(){
top.restAjax.get(top.restAjax.path('api/mail/get-inbox-mail', []), { top.restAjax.get(top.restAjax.path('api/mail/get-inbox-mail', []), {
@ -161,6 +163,18 @@
} }
init(); init();
$(document).on('click', '#copy-for-btn', function(){
$('#copyForIds').val('');
$('#copyForNames').val('');
$('#copy-for-div').toggle();
});
$(document).on('click', '#secret-btn', function(){
$('#secretIds').val('');
$('#secretNames').val('');
$('#secret-div').toggle();
});
// 初始化文件列表 // 初始化文件列表
function initFileList(fileName, ids, callback) { function initFileList(fileName, ids, callback) {
var dataForm = {}; var dataForm = {};
@ -293,19 +307,23 @@
selectSend(); selectSend();
}); });
function selectSend(){ function selectSend(){
top.dialog.dialogData.selectedUserIds = $('#recipientIds').val(); top.dialog.dialogData.selectedUserIds = $('#recipientIds').val().replaceAll(",","_");
top.dialog.open({ top.dialog.open({
url: top.restAjax.path('route/department/user/select-user', []), url: top.restAjax.path('route/department/user/select-user', []),
title: '选择收件人', title: '选择收件人',
width: '500px', width: '600px',
height: '500px', height: '500px',
closeBtn: 1, closeBtn: 0,
onClose: function() { onClose: function() {
top.dialog.dialogData.selectedDepartmentUsers = null; var insertUsers = top.dialog.dialogData.selectedDepartmentUsers;
var insertUsers = top.dialog.dialogData.saveDepartmentUsers; if(insertUsers.length == 0){
if(insertUsers && insertUsers.length > 0) { $('#recipientIds').val('');
var recipientIds = $('#recipientIds').val() == '' ? $('#recipientIds').val() : $('#recipientIds').val() + ','; $('#recipientNames').val('');
var recipientNames = $('#recipientNames').val() == '' ? $('#recipientNames').val() : $('#recipientNames').val() + ','; return;
}
if(insertUsers.length > 0) {
var recipientIds = '';
var recipientNames = '';
for (var i = 0, item; item = insertUsers[i++];) { for (var i = 0, item; item = insertUsers[i++];) {
recipientIds += item.userId + ','; recipientIds += item.userId + ',';
recipientNames += item.userName + '[' + item.username + ']' + ','; recipientNames += item.userName + '[' + item.username + ']' + ',';
@ -326,19 +344,23 @@
selectCopyFor(); selectCopyFor();
}); });
function selectCopyFor(){ function selectCopyFor(){
top.dialog.dialogData.selectedUserIds = $('#copyForIds').val(); top.dialog.dialogData.selectedUserIds = $('#copyForIds').val().replaceAll(",","_");
top.dialog.open({ top.dialog.open({
url: top.restAjax.path('route/department/user/select-user', []), url: top.restAjax.path('route/department/user/select-user', []),
title: '选择抄送人', title: '选择抄送人',
width: '500px', width: '600px',
height: '500px', height: '500px',
closeBtn: 1, closeBtn: 0,
onClose: function() { onClose: function() {
top.dialog.dialogData.selectedDepartmentUsers = null; var insertUsers = top.dialog.dialogData.selectedDepartmentUsers;
var insertUsers = top.dialog.dialogData.saveDepartmentUsers; if(insertUsers.length == 0){
if(insertUsers && insertUsers.length > 0) { $('#copyForIds').val('');
var copyForIds = $('#copyForIds').val() == '' ? $('#copyForIds').val() : $('#copyForIds').val() + ','; $('#copyForNames').val('');
var copyForNames = $('#copyForNames').val() == '' ? $('#copyForNames').val() : $('#copyForNames').val() + ','; return;
}
if(insertUsers.length > 0) {
var copyForIds = '';
var copyForNames = '';
for (var i = 0, item; item = insertUsers[i++];) { for (var i = 0, item; item = insertUsers[i++];) {
copyForIds += item.userId + ','; copyForIds += item.userId + ',';
copyForNames += item.userName + '[' + item.username + ']' + ','; copyForNames += item.userName + '[' + item.username + ']' + ',';
@ -359,19 +381,23 @@
selectSecret(); selectSecret();
}); });
function selectSecret(){ function selectSecret(){
top.dialog.dialogData.selectedUserIds = $('#secretIds').val(); top.dialog.dialogData.selectedUserIds = $('#secretIds').val().replaceAll(",","_");
top.dialog.open({ top.dialog.open({
url: top.restAjax.path('route/department/user/select-user', []), url: top.restAjax.path('route/department/user/select-user', []),
title: '选择密送人', title: '选择密送人',
width: '500px', width: '600px',
height: '500px', height: '500px',
closeBtn: 1, closeBtn: 1,
onClose: function() { onClose: function() {
top.dialog.dialogData.selectedDepartmentUsers = null; var insertUsers = top.dialog.dialogData.selectedDepartmentUsers;
var insertUsers = top.dialog.dialogData.saveDepartmentUsers; if(insertUsers.length == 0){
if(insertUsers && insertUsers.length > 0) { $('#secretIds').val('');
var secretIds = $('#secretIds').val() == '' ? $('#secretIds').val() : $('#secretIds').val() + ','; $('#secretNames').val('');
var secretNames = $('#secretNames').val() == '' ? $('#secretNames').val() : $('#secretNames').val() + ','; return;
}
if(insertUsers.length > 0) {
var secretIds = '';
var secretNames = '';
for (var i = 0, item; item = insertUsers[i++];) { for (var i = 0, item; item = insertUsers[i++];) {
secretIds += item.userId + ','; secretIds += item.userId + ',';
secretNames += item.userName + '[' + item.username + ']' + ','; secretNames += item.userName + '[' + item.username + ']' + ',';

View File

@ -25,6 +25,8 @@
<button type="button" class="layui-btn layui-btn-primary layui-btn-sm" lay-submit lay-filter="submitDraft"> <button type="button" class="layui-btn layui-btn-primary layui-btn-sm" lay-submit lay-filter="submitDraft">
<i class="fa fa-lg fa-edit"></i> 存草稿 <i class="fa fa-lg fa-edit"></i> 存草稿
</button> </button>
<a href="javascript:void(0)" id="copy-for-btn" style="color: #1e88e5;text-decoration: underline;margin-left: 50px;">抄送</a>
<a href="javascript:void(0)" id="secret-btn" style="color: #1e88e5;text-decoration: underline;margin-left: 25px;">密送</a>
</div> </div>
</div> </div>
<div class="layui-card-body" style="padding: 10px;"> <div class="layui-card-body" style="padding: 10px;">
@ -35,12 +37,22 @@
<div class="layui-input-block"> <div class="layui-input-block">
<input type="hidden" id="recipientIds" name="recipientIds" class="layui-input" value=""> <input type="hidden" id="recipientIds" name="recipientIds" class="layui-input" value="">
<input type="text" id="recipientNames" name="recipientNames" class="layui-input" value="" <input type="text" id="recipientNames" name="recipientNames" class="layui-input" value=""
style="cursor: pointer" placeholder="点击选择收件人" readonly="readonly"> style="cursor: pointer" placeholder="点击选择收件人" readonly="readonly" lay-verify="required">
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="layui-row"> <div class="layui-row">
<div class="layui-col-md12">
<div class="layui-form-item">
<label class="layui-form-label"><span style="color: #cc0000;">* </span>主题</label>
<div class="layui-input-block">
<input type="text" id="title" name="title" class="layui-input" value="" placeholder="" maxlength="255" lay-verify="required">
</div>
</div>
</div>
</div>
<div class="layui-row" id="copy-for-div" style="display: none;">
<div class="layui-col-md12"> <div class="layui-col-md12">
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">抄送人</label> <label class="layui-form-label">抄送人</label>
@ -52,7 +64,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="layui-row"> <div class="layui-row" id="secret-div" style="display: none;">
<div class="layui-col-md12"> <div class="layui-col-md12">
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">密送人</label> <label class="layui-form-label">密送人</label>
@ -64,16 +76,6 @@
</div> </div>
</div> </div>
</div> </div>
<div class="layui-row">
<div class="layui-col-md12">
<div class="layui-form-item">
<label class="layui-form-label"><span style="color: #cc0000;">* </span>主题</label>
<div class="layui-input-block">
<input type="text" id="title" name="title" class="layui-input" value="" placeholder="" maxlength="255">
</div>
</div>
</div>
</div>
<div class="layui-row"> <div class="layui-row">
<div class="layui-form-text"> <div class="layui-form-text">
<label class="layui-form-label">附件</label> <label class="layui-form-label">附件</label>
@ -147,6 +149,18 @@
} }
init(); init();
$(document).on('click', '#copy-for-btn', function(){
$('#copyForIds').val('');
$('#copyForNames').val('');
$('#copy-for-div').toggle();
});
$(document).on('click', '#secret-btn', function(){
$('#secretIds').val('');
$('#secretNames').val('');
$('#secret-div').toggle();
});
// 初始化文件列表 // 初始化文件列表
function initFileList(fileName, ids, callback) { function initFileList(fileName, ids, callback) {
var dataForm = {}; var dataForm = {};
@ -280,19 +294,23 @@
selectSend(); selectSend();
}); });
function selectSend(){ function selectSend(){
top.dialog.dialogData.selectedUserIds = $('#recipientIds').val(); top.dialog.dialogData.selectedUserIds = $('#recipientIds').val().replaceAll(",","_");
top.dialog.open({ top.dialog.open({
url: top.restAjax.path('route/department/user/select-user', []), url: top.restAjax.path('route/department/user/select-user', []),
title: '选择收件人', title: '选择收件人',
width: '500px', width: '600px',
height: '500px', height: '500px',
closeBtn: 1, closeBtn: 0,
onClose: function() { onClose: function() {
top.dialog.dialogData.selectedDepartmentUsers = null; var insertUsers = top.dialog.dialogData.selectedDepartmentUsers;
var insertUsers = top.dialog.dialogData.saveDepartmentUsers; if(insertUsers.length == 0){
if(insertUsers && insertUsers.length > 0) { $('#recipientIds').val('');
var recipientIds = $('#recipientIds').val() == '' ? $('#recipientIds').val() : $('#recipientIds').val() + ','; $('#recipientNames').val('');
var recipientNames = $('#recipientNames').val() == '' ? $('#recipientNames').val() : $('#recipientNames').val() + ','; return;
}
if(insertUsers.length > 0) {
var recipientIds = '';
var recipientNames = '';
for (var i = 0, item; item = insertUsers[i++];) { for (var i = 0, item; item = insertUsers[i++];) {
recipientIds += item.userId + ','; recipientIds += item.userId + ',';
recipientNames += item.userName + '[' + item.username + ']' + ','; recipientNames += item.userName + '[' + item.username + ']' + ',';
@ -313,19 +331,23 @@
selectCopyFor(); selectCopyFor();
}); });
function selectCopyFor(){ function selectCopyFor(){
top.dialog.dialogData.selectedUserIds = $('#copyForIds').val(); top.dialog.dialogData.selectedUserIds = $('#copyForIds').val().replaceAll(",","_");
top.dialog.open({ top.dialog.open({
url: top.restAjax.path('route/department/user/select-user', []), url: top.restAjax.path('route/department/user/select-user', []),
title: '选择抄送人', title: '选择抄送人',
width: '500px', width: '600px',
height: '500px', height: '500px',
closeBtn: 1, closeBtn: 0,
onClose: function() { onClose: function() {
top.dialog.dialogData.selectedDepartmentUsers = null; var insertUsers = top.dialog.dialogData.selectedDepartmentUsers;
var insertUsers = top.dialog.dialogData.saveDepartmentUsers; if(insertUsers.length == 0){
if(insertUsers && insertUsers.length > 0) { $('#copyForIds').val('');
var copyForIds = $('#copyForIds').val() == '' ? $('#copyForIds').val() : $('#copyForIds').val() + ','; $('#copyForNames').val('');
var copyForNames = $('#copyForNames').val() == '' ? $('#copyForNames').val() : $('#copyForNames').val() + ','; return;
}
if(insertUsers.length > 0) {
var copyForIds = '';
var copyForNames = '';
for (var i = 0, item; item = insertUsers[i++];) { for (var i = 0, item; item = insertUsers[i++];) {
copyForIds += item.userId + ','; copyForIds += item.userId + ',';
copyForNames += item.userName + '[' + item.username + ']' + ','; copyForNames += item.userName + '[' + item.username + ']' + ',';
@ -346,19 +368,23 @@
selectSecret(); selectSecret();
}); });
function selectSecret(){ function selectSecret(){
top.dialog.dialogData.selectedUserIds = $('#secretIds').val(); top.dialog.dialogData.selectedUserIds = $('#secretIds').val().replaceAll(",","_");
top.dialog.open({ top.dialog.open({
url: top.restAjax.path('route/department/user/select-user', []), url: top.restAjax.path('route/department/user/select-user', []),
title: '选择密送人', title: '选择密送人',
width: '500px', width: '600px',
height: '500px', height: '500px',
closeBtn: 1, closeBtn: 0,
onClose: function() { onClose: function() {
top.dialog.dialogData.selectedDepartmentUsers = null; var insertUsers = top.dialog.dialogData.selectedDepartmentUsers;
var insertUsers = top.dialog.dialogData.saveDepartmentUsers; if(insertUsers.length == 0){
if(insertUsers && insertUsers.length > 0) { $('#secretIds').val('');
var secretIds = $('#secretIds').val() == '' ? $('#secretIds').val() : $('#secretIds').val() + ','; $('#secretNames').val('');
var secretNames = $('#secretNames').val() == '' ? $('#secretNames').val() : $('#secretNames').val() + ','; return;
}
if(insertUsers.length > 0) {
var secretIds = '';
var secretNames = '';
for (var i = 0, item; item = insertUsers[i++];) { for (var i = 0, item; item = insertUsers[i++];) {
secretIds += item.userId + ','; secretIds += item.userId + ',';
secretNames += item.userName + '[' + item.username + ']' + ','; secretNames += item.userName + '[' + item.username + ']' + ',';