完善OA的WEB端模板,完善文件上传、预览、删除功能,完善回退功能
This commit is contained in:
parent
d592a2b592
commit
cc99dc920e
@ -80,8 +80,12 @@ public class OaFormReportController extends DefaultBaseController {
|
||||
public SuccessResult update(@PathVariable("processInstanceId") String processInstanceId,
|
||||
@PathVariable("taskId") String taskId,
|
||||
@PathVariable("nodeId") String nodeId,
|
||||
@RequestBody Map<String, Object> params) {
|
||||
oaFormReportService.updateGoBack(processInstanceId, taskId, nodeId, params);
|
||||
@RequestBody Map<String, String> params) {
|
||||
String reason = params.get(IOaFormReportService.KEY_GO_BACK_REASON);
|
||||
if (StringUtils.isBlank(reason)) {
|
||||
throw new ParamsException("回退原因不能为空");
|
||||
}
|
||||
oaFormReportService.updateGoBack(processInstanceId, taskId, nodeId, reason);
|
||||
return new SuccessResult();
|
||||
}
|
||||
|
||||
|
@ -25,6 +25,7 @@ public interface IOaFormReportService {
|
||||
String KEY_SELECT_TYPE = "selectType";
|
||||
String KEY_IS_NEXT_END_EVENT = "isNextEndEvent";
|
||||
String KEY_RECORD_FIELDS = "recordFields";
|
||||
String KEY_GO_BACK_REASON = "reason";
|
||||
/**
|
||||
* 签批关键字后缀
|
||||
*/
|
||||
@ -112,9 +113,9 @@ public interface IOaFormReportService {
|
||||
* @param processInstanceId
|
||||
* @param currentTaskId
|
||||
* @param jumpNodeId
|
||||
* @param params
|
||||
* @param reason 错误原因
|
||||
*/
|
||||
void updateGoBack(String processInstanceId, String currentTaskId, String jumpNodeId, Map<String, Object> params);
|
||||
void updateGoBack(String processInstanceId, String currentTaskId, String jumpNodeId, String reason);
|
||||
|
||||
/**
|
||||
* 表单详情
|
||||
|
@ -156,7 +156,7 @@ public class OaFormReportServiceImpl extends DefaultBaseService implements IOaFo
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateGoBack(String processInstanceId, String currentTaskId, String jumpNodeId, Map<String, Object> requestParams) {
|
||||
public void updateGoBack(String processInstanceId, String currentTaskId, String jumpNodeId, String reason) {
|
||||
LOG.debug("OA流程回退");
|
||||
Task currentTask = taskService.createTaskQuery().taskId(currentTaskId).singleResult();
|
||||
if (currentTask == null) {
|
||||
@ -233,25 +233,27 @@ public class OaFormReportServiceImpl extends DefaultBaseService implements IOaFo
|
||||
}
|
||||
LOG.debug("7. 开始完成任务");
|
||||
List<String> historicUserTaskUserIds = new ArrayList<>(historicUserTaskUserIdSet);
|
||||
Map<String, Object> processVariables = getHashMap(4);
|
||||
if (historicUserTaskUserIdSet.size() == 1) {
|
||||
LOG.debug("7.1 设置代理人");
|
||||
requestParams.put(IOaFormReportService.KEY_ASSIGNEE_USER, historicUserTaskUserIds.get(0));
|
||||
processVariables.put(IOaFormReportService.KEY_ASSIGNEE_USER, historicUserTaskUserIds.get(0));
|
||||
} else if (historicTaskInstances.size() > 1) {
|
||||
LOG.debug("7.2 设置代理人(多实例)");
|
||||
requestParams.put(IActivitiModelService.ASSIGNEE_LIST, historicUserTaskUserIds);
|
||||
processVariables.put(IActivitiModelService.ASSIGNEE_LIST, historicUserTaskUserIds);
|
||||
} else {
|
||||
throw new SearchException("找不到回退代理人");
|
||||
}
|
||||
LOG.debug("7.3 完成任务");
|
||||
TaskCommentBO taskCommentBO = new TaskCommentBO();
|
||||
taskCommentBO.setType(TaskCommentTypeEnum.GO_BACK);
|
||||
taskCommentBO.setContent(requestParams.get("content").toString());
|
||||
taskCommentBO.setContent(reason);
|
||||
taskCommentBO.setTime(DateUtil.getTime());
|
||||
taskCommentBO.setUserId(userId);
|
||||
taskCommentBO.setUserName(userName);
|
||||
taskService.addComment(currentTaskId, processInstanceId, TaskCommentTypeEnum.GO_BACK.getValue(), JSONObject.toJSONString(taskCommentBO));
|
||||
taskService.complete(currentTaskId, requestParams);
|
||||
taskService.complete(currentTaskId, processVariables);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new SystemException(e);
|
||||
} finally {
|
||||
LOG.debug("9. 恢复原有的下一步连线");
|
||||
|
@ -160,7 +160,7 @@
|
||||
top.dialog.open({
|
||||
url: top.restAjax.path('route/oa-form-report/save/definition-id/{processDefinitionId}/code/{formCode}/version/{formVersion}', [data.id, data.formCode, data.formVersion]),
|
||||
title: '发起流程',
|
||||
width: '500px',
|
||||
width: '800px',
|
||||
height: '80%',
|
||||
onClose: function() {}
|
||||
});
|
||||
|
@ -111,14 +111,13 @@
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'form', width: 150, title: '操作', align:'center', fixed: 'right',
|
||||
{field: 'form', width: 80, title: '操作', align:'center', fixed: 'right',
|
||||
templet: function(row) {
|
||||
if(!row.formCode || !row.formVersion) {
|
||||
return '-';
|
||||
}
|
||||
return '<div class="layui-btn-group">' +
|
||||
'<button class="layui-btn layui-btn-xs" lay-event="handleEvent">处理</button>'+
|
||||
'<button class="layui-btn layui-btn-xs layui-btn-primary" lay-event="logEvent">流转日志</button>'+
|
||||
'</div>';
|
||||
}
|
||||
}
|
||||
@ -166,20 +165,12 @@
|
||||
top.dialog.open({
|
||||
url: top.restAjax.path('route/oa-form-report/update/task-id/{taskId}/code/{formCode}/version/{formVersion}/is-need-claim/{isNeedClaim}?uid={reportUid}', [data.taskId, data.formCode, data.formVersion, data.isNeedClaim, data.reportUid]),
|
||||
title: '编辑',
|
||||
width: '500px',
|
||||
width: '800px',
|
||||
height: '80%',
|
||||
onClose: function() {
|
||||
reloadTable();
|
||||
}
|
||||
});
|
||||
} else if(layEvent === 'logEvent') {
|
||||
top.dialog.open({
|
||||
url: top.restAjax.path('route/oa/list-process-log?processInstanceId={processInstanceId}', [data.processInstanceId]),
|
||||
title: '流转日志',
|
||||
width: '800px',
|
||||
height: '80%',
|
||||
onClose: function() {}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@ -25,31 +25,22 @@ function OaFormUtil(layui) {
|
||||
formData.field.recordFields = recordFields;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取会签内容
|
||||
* @param signItem
|
||||
* @return {string}
|
||||
*/
|
||||
function getJointlySignText(signItem) {
|
||||
return
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置签字列表
|
||||
* @param formData
|
||||
*/
|
||||
this.initSignList = function (formData) {
|
||||
if(formData.jointlySign) {
|
||||
if (formData.jointlySign) {
|
||||
return;
|
||||
}
|
||||
var jointlySign = formData.jointlySign;
|
||||
for(var key in formData) {
|
||||
var jointlySigns = jointlySign[key +'JointlySign'];
|
||||
if(!jointlySigns) {
|
||||
for (var key in formData) {
|
||||
var jointlySigns = jointlySign[key + 'JointlySign'];
|
||||
if (!jointlySigns) {
|
||||
continue;
|
||||
}
|
||||
var signListDom = '<div><span>记录</span>';
|
||||
for(var i = 0, item; item = jointlySigns[i++];) {
|
||||
for (var i = 0, item; item = jointlySigns[i++];) {
|
||||
signListDom += [
|
||||
'<div>',
|
||||
' <span>姓名:' + item.userName + '。 </span>',
|
||||
@ -68,18 +59,18 @@ function OaFormUtil(layui) {
|
||||
* @param formData
|
||||
*/
|
||||
this.initTextareaSignList = function (formData) {
|
||||
if(formData.jointlySign) {
|
||||
if (formData.jointlySign) {
|
||||
return;
|
||||
}
|
||||
var jointlySign = formData.jointlySign;
|
||||
for(var key in formData) {
|
||||
var jointlySigns = jointlySign[key+'JointlySign'];
|
||||
if(!jointlySigns) {
|
||||
for (var key in formData) {
|
||||
var jointlySigns = jointlySign[key + 'JointlySign'];
|
||||
if (!jointlySigns) {
|
||||
continue;
|
||||
}
|
||||
var jointlySignListText = '';
|
||||
for(var i = 0, item; item = jointlySigns[i++];) {
|
||||
jointlySignListText += '姓名:'+ item.userName +'。 内容:'+ item.content +'。 时间:'+ item.time +'。\n';
|
||||
for (var i = 0, item; item = jointlySigns[i++];) {
|
||||
jointlySignListText += '姓名:' + item.userName + '。 内容:' + item.content + '。 时间:' + item.time + '。\n';
|
||||
}
|
||||
formData[key] = jointlySignListText;
|
||||
}
|
||||
@ -88,16 +79,18 @@ function OaFormUtil(layui) {
|
||||
/**
|
||||
* 初始化日志
|
||||
*/
|
||||
this.initProcessLog = function (processInstanceId) {
|
||||
initProcessLog = function (processInstanceId) {
|
||||
restAjax.get(restAjax.path('api/oa/list-process-log/process-instance-id/{processInstanceId}', [processInstanceId]), {}, null, function (code, data) {
|
||||
var ul = '<ul class="layui-timeline">';
|
||||
for (var i = 0, item; item = data[i++];) {
|
||||
// 批注
|
||||
var commentText = '';
|
||||
var comment = item.comment;
|
||||
if(comment) {
|
||||
if(comment.type === 'JOINTLY_SIGN') {
|
||||
commentText = '类型:会签。内容:'+ comment.content + '。时间:'+ comment.time;
|
||||
if (comment) {
|
||||
if (comment.type === 'JOINTLY_SIGN') {
|
||||
commentText = '类型:会签。内容:' + comment.content + '。时间:' + comment.time;
|
||||
} else if (comment.type === 'GO_BACK') {
|
||||
commentText = '类型:回退。内容:' + comment.content + '。时间:' + comment.time;
|
||||
}
|
||||
}
|
||||
var li = [
|
||||
@ -133,7 +126,7 @@ function OaFormUtil(layui) {
|
||||
' </tr>',
|
||||
' <tr>',
|
||||
' <td class="row-title">批注</td>',
|
||||
' <td>'+ commentText +'</td>',
|
||||
' <td>' + commentText + '</td>',
|
||||
' </tr>',
|
||||
' </tbody>',
|
||||
' </table>',
|
||||
@ -153,9 +146,29 @@ function OaFormUtil(layui) {
|
||||
* 初始化流程图
|
||||
* @param processInstanceId
|
||||
*/
|
||||
this.initProcessImage = function (processInstanceId) {
|
||||
initProcessImage = function (processInstanceId) {
|
||||
function initRuntimeProcessImage() {
|
||||
$('#runtimeProcessImage').attr('src', 'route/activiti/model/get-runtime-process-image/' + processInstanceId);
|
||||
var html = [
|
||||
'<div id="runtimeProcessImageBox">',
|
||||
' <img id="runtimeProcessImage" src="route/activiti/model/get-runtime-process-image/' + processInstanceId + '" alt="流转图" style="height: 100%"/>',
|
||||
'</div>',
|
||||
'<div id="operationBtnBox" class="layui-btn-group">',
|
||||
' <button id="searchPlus" type="button" class="layui-btn layui-btn-xs" title="放大">',
|
||||
' <i class="fa fa-search-plus" aria-hidden="true"></i>',
|
||||
' </button>',
|
||||
' <button id="searchMinus" type="button" class="layui-btn layui-btn-xs layui-btn-default" title="缩小">',
|
||||
' <i class="fa fa-search-minus" aria-hidden="true"></i>\n' +
|
||||
' </button>',
|
||||
' <button id="searchDefault" type="button" class="layui-btn layui-btn-xs layui-btn-primary" title="还原">',
|
||||
' <i class="fa fa-search" aria-hidden="true"></i>',
|
||||
' </button>',
|
||||
'</div>'
|
||||
].join('');
|
||||
$('#processImage').css({
|
||||
position: 'relative',
|
||||
textAlign: 'center'
|
||||
})
|
||||
$('#processImage').append(html);
|
||||
}
|
||||
|
||||
initRuntimeProcessImage();
|
||||
@ -181,11 +194,13 @@ function OaFormUtil(layui) {
|
||||
/**
|
||||
* 初始化选择项
|
||||
*/
|
||||
this.initTabItem = function () {
|
||||
this.initTabItem = function (processInstanceId) {
|
||||
$('.layui-tab-item, #runtimeProcessImageBox').css({
|
||||
height: (win.height() - 138) + 'px',
|
||||
overflow: 'auto'
|
||||
});
|
||||
initProcessLog(processInstanceId);
|
||||
initProcessImage(processInstanceId);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -249,25 +264,29 @@ function OaFormUtil(layui) {
|
||||
var headers = opt.headers;
|
||||
headers = headers ? headers : {};
|
||||
var isApp = opt.isApp;
|
||||
var isShow = opt.isShow;
|
||||
var processInstanceId = opt.processInstanceId;
|
||||
var taskId = opt.taskId;
|
||||
var onPreview = typeof (opt.onPreview) === 'function' ? opt.onPreview : null;
|
||||
|
||||
function initButton() {
|
||||
var buttons = '';
|
||||
buttons += '<div class="layui-btn-group">'
|
||||
if (formButton.btnAttachment) {
|
||||
buttons += '<button id="attachmentBtn" type="button" class="layui-btn layui-btn-sm layui-btn-default confirm-btn">上传附件</button>';
|
||||
}
|
||||
buttons += '<button id="showAttachmentBtn" type="button" class="layui-btn layui-btn-sm layui-btn-primary" title="附件列表"><i class="fa fa-list-ul" aria-hidden="true"></i></button>';
|
||||
buttons += '<input type="hidden" name="attachments" id="attachments"/>';
|
||||
buttons += '</div>';
|
||||
if (formButton.btnGoBack) {
|
||||
buttons += '<button id="goBackBtn" type="button" class="layui-btn layui-btn-sm layui-btn-danger confirm-btn">回退</button>';
|
||||
}
|
||||
if (formButton.btnAttachment) {
|
||||
buttons += '<button id="attachmentBtn" type="button" class="layui-btn layui-btn-sm layui-btn-default confirm-btn">上传附件</button>';
|
||||
}
|
||||
buttons += '</div>';
|
||||
buttons += '<div class="layui-btn-group">';
|
||||
buttons += '<button id="showAttachmentBtn" type="button" class="layui-btn layui-btn-sm layui-btn-primary" title="附件列表"><i class="fa fa-list-ul" aria-hidden="true"></i></button>';
|
||||
buttons += '<input type="hidden" name="attachments" id="attachments"/>';
|
||||
buttons += '</div>';
|
||||
$('#formButtonGroup').append(buttons);
|
||||
}
|
||||
|
||||
function addClick() {
|
||||
if(formButton.btnAttachment) {
|
||||
if (formButton.btnAttachment) {
|
||||
var layerLoadingIndex;
|
||||
var url = 'api/file/v2/upload-file';
|
||||
if (isApp) {
|
||||
@ -288,32 +307,39 @@ function OaFormUtil(layui) {
|
||||
'application/vnd.ms-works',
|
||||
'text/plain',
|
||||
'application/x-rar',
|
||||
'application/x-zip-compressed'
|
||||
'application/x-zip-compressed',
|
||||
'image/*',
|
||||
'video/mp4',
|
||||
'audio/wav',
|
||||
'audio/mp3'
|
||||
].join(''),
|
||||
field: 'file',
|
||||
exts: 'pdf|doc|docx|xls|xlsx|ppt|pptx|wps|txt|rar|zip',
|
||||
exts: 'pdf|doc|docx|xls|xlsx|ppt|pptx|wps|txt|rar|zip|jpg|png|gif|bmp|jpeg|mp4|wav|mp3',
|
||||
headers: headers,
|
||||
before: function (obj) {
|
||||
layerLoadingIndex = layer.msg('上传中...', {icon: 16, time: 0, shade: 0.3})
|
||||
},
|
||||
done: function (res, index, upload) {
|
||||
layer.close(layerLoadingIndex);
|
||||
layer.msg('上传成功')
|
||||
var attachments = $('#attachments').val();
|
||||
var data = res.data;
|
||||
if(attachments.length > 0) {
|
||||
if (attachments.length > 0) {
|
||||
attachments += ',';
|
||||
}
|
||||
attachments += data.fileId +':'+ data.fileName.replace(/\,/g, ',');
|
||||
attachments += data.fileId + ':' + data.fileName.replace(/\,/g, ',');
|
||||
$('#attachments').val(attachments);
|
||||
},
|
||||
error: function (index, upload) {
|
||||
layer.close(layerLoadingIndex);
|
||||
layer.msg('文件上传失败');
|
||||
},
|
||||
progress: function (n, elem, res, index) {}
|
||||
progress: function (n, elem, res, index) {
|
||||
}
|
||||
});
|
||||
}
|
||||
$(document.body).on('click', '#showAttachmentBtn', function() {
|
||||
|
||||
$(document.body).on('click', '#showAttachmentBtn', function () {
|
||||
var attachments = $('#attachments').val();
|
||||
var attachmentArray = attachments.split(',');
|
||||
var html = [
|
||||
@ -321,7 +347,7 @@ function OaFormUtil(layui) {
|
||||
' <table class="layui-table" lay-size="sm">',
|
||||
' <colgroup>',
|
||||
' <col>',
|
||||
' <col width="60">',
|
||||
onPreview && formButton.btnAttachment ? '<col width="100">' : '<col width="60">',
|
||||
' </colgroup>',
|
||||
' <thead>',
|
||||
' <tr>',
|
||||
@ -331,15 +357,102 @@ function OaFormUtil(layui) {
|
||||
' </thead>',
|
||||
' <tbody>',
|
||||
].join('');
|
||||
for (var i = 0, file; file = attachmentArray[i++];) {
|
||||
var idNameArray = file.split(':');
|
||||
var fileId = idNameArray[0];
|
||||
var fileName = idNameArray[1];
|
||||
if (attachmentArray.length > 0) {
|
||||
for (var i = 0, file; file = attachmentArray[i++];) {
|
||||
var idNameArray = file.split(':');
|
||||
var fileId = idNameArray[0];
|
||||
var fileName = idNameArray[1];
|
||||
html += [
|
||||
'<tr>',
|
||||
' <td><a href="route/file/download/false/' + fileId + '" target="_blank" title="下载">' + fileName + '</a></td>',
|
||||
' <td class="operation">',
|
||||
' <div class="layui-btn-group">',
|
||||
onPreview ? '<button type="button" class="layui-btn layui-btn-xs layui-btn-primary preview-btn" data-id="' + fileId + '" data-name="' + fileName + '">预览</button>' : '',
|
||||
formButton.btnAttachment ? '<button type="button" class="layui-btn layui-btn-xs layui-btn-danger delete-btn delete-attachment-btn" data-id="' + fileId + '" data-name="' + fileName + '">删除</button>' : '',
|
||||
' </div>',
|
||||
' </td>',
|
||||
'</tr>',
|
||||
].join('');
|
||||
}
|
||||
} else {
|
||||
html += '<tr><td colspan="2" style="text-align: center;">没有附件</td></tr>';
|
||||
}
|
||||
html += [
|
||||
' </tbody>',
|
||||
' </table>',
|
||||
'</div>'
|
||||
].join('');
|
||||
layer.open({
|
||||
type: 1,
|
||||
title: false,
|
||||
area: ['400px', '100%'],
|
||||
offset: 'r',
|
||||
anim: 2,
|
||||
isOutAnim: false,
|
||||
closeBtn: 0,
|
||||
shadeClose: true,
|
||||
content: html
|
||||
});
|
||||
});
|
||||
|
||||
$(document.body).on('click', '.delete-attachment-btn', function () {
|
||||
var id = this.dataset.id;
|
||||
var name = this.dataset.name;
|
||||
var files = $('#attachments').val().replace(id + ':' + name, '');
|
||||
files = files.replace(/\,+/g, ',');
|
||||
if (files.charAt(0) == ',') {
|
||||
files = files.substring(1);
|
||||
}
|
||||
if (files.charAt(files.length - 1) == ',') {
|
||||
files = files.substring(0, files.length - 1);
|
||||
}
|
||||
$('#attachments').val(files);
|
||||
$(this).parent().parent().parent().remove();
|
||||
});
|
||||
|
||||
$(document.body).on('click', '.operation .preview-btn', function () {
|
||||
var id = this.dataset.id;
|
||||
var name = this.dataset.name;
|
||||
if (onPreview) {
|
||||
onPreview({
|
||||
data: {
|
||||
fileId: id,
|
||||
fileName: name
|
||||
},
|
||||
elem: this
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$(document.body).on('click', '#goBackBtn', function () {
|
||||
if (!taskId) {
|
||||
return;
|
||||
}
|
||||
if (!processInstanceId) {
|
||||
return;
|
||||
}
|
||||
var goBackUserTasks = formButton.goBackUserTasks;
|
||||
var html = [
|
||||
'<div class="form-upload-file" style="margin: 0 10px;">',
|
||||
' <table class="layui-table" lay-size="sm">',
|
||||
' <colgroup>',
|
||||
' <col>',
|
||||
' <col width="60">',
|
||||
' </colgroup>',
|
||||
' <thead>',
|
||||
' <tr>',
|
||||
' <th>节点名称</th>',
|
||||
' <th class="operation">操作</th>',
|
||||
' </tr>',
|
||||
' </thead>',
|
||||
' <tbody>',
|
||||
].join('');
|
||||
for (var i = 0, goBackUserTask; goBackUserTask = goBackUserTasks[i++];) {
|
||||
html += [
|
||||
'<tr>',
|
||||
' <td><a href="route/file/download/false/'+ fileId +'" target="_blank">' + fileName + '</a></td>',
|
||||
' <td>' + goBackUserTask.taskName + '</a></td>',
|
||||
' <td class="operation">',
|
||||
formButton.btnAttachment ? '<button type="button" class="layui-btn layui-btn-xs layui-btn-danger delete-btn delete-attachment-btn" data-id="' + fileId + '" data-name="' + fileName + '">删除</button>' : '',
|
||||
' <button type="button" class="layui-btn layui-btn-xs layui-btn-danger go-back-btn" data-node-id="' + goBackUserTask.nodeId + '">回退</button>',
|
||||
' </td>',
|
||||
'</tr>',
|
||||
].join('');
|
||||
@ -352,32 +465,48 @@ function OaFormUtil(layui) {
|
||||
layer.open({
|
||||
type: 1,
|
||||
title: false,
|
||||
area: ['80%'],
|
||||
maxHeight: '60%',
|
||||
area: ['350px', '100%'],
|
||||
offset: 'r',
|
||||
anim: 2,
|
||||
isOutAnim: false,
|
||||
closeBtn: 0,
|
||||
shadeClose: true,
|
||||
content: html
|
||||
});
|
||||
});
|
||||
|
||||
$(document.body).on('click', '.delete-attachment-btn', function() {
|
||||
var id = this.dataset.id;
|
||||
var name = this.dataset.name;
|
||||
var files = $('#attachments').val().replace(id + ':' + name, '');
|
||||
files = files.replace(/\,+/g, ',');
|
||||
if (files.charAt(0) == ',') {
|
||||
files = files.substring(1);
|
||||
// 回退
|
||||
$(document.body).on('click', '.go-back-btn', function () {
|
||||
if (!taskId) {
|
||||
return;
|
||||
}
|
||||
if (files.charAt(files.length - 1) == ',') {
|
||||
files = files.substring(0, files.length - 1);
|
||||
if (!processInstanceId) {
|
||||
return;
|
||||
}
|
||||
$('#attachments').val(files);
|
||||
$(this).parent().parent().remove();
|
||||
});
|
||||
var nodeId = this.dataset.nodeId;
|
||||
layer.confirm('确定回退吗?', function (confirmLayerIndex) {
|
||||
layer.close(confirmLayerIndex);
|
||||
|
||||
$(document.body).on('click', '#goBackBtn', function() {
|
||||
layer.prompt({title: '请输入回退原因', formType: 2}, function (reason, promptIndex) {
|
||||
layer.close(promptIndex);
|
||||
|
||||
});
|
||||
var loadLayerIndex;
|
||||
restAjax.put(restAjax.path('api/oa-form-report/update-go-back/process-instance-id/{processInstanceId}/task-id/{taskId}/node-id/{nodeId}', [processInstanceId, taskId, nodeId]), {
|
||||
reason: reason
|
||||
}, null, function (code, data) {
|
||||
layer.msg('回退成功');
|
||||
}, function (code, data) {
|
||||
$('.confirm-btn, .go-back-btn').show();
|
||||
layer.msg(data.msg);
|
||||
}, function () {
|
||||
$('.confirm-btn, .go-back-btn').hide();
|
||||
loadLayerIndex = layer.msg('提交中...', {icon: 16, time: 0, shade: 0.3});
|
||||
}, function () {
|
||||
layer.close(loadLayerIndex);
|
||||
});
|
||||
});
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
initButton();
|
||||
|
@ -108,6 +108,7 @@
|
||||
token: token
|
||||
}
|
||||
}, function (code, data) {
|
||||
layer.msg('提交成功');
|
||||
// 这里手动添加操作成功后的操作',
|
||||
}, function (code, data) {
|
||||
$('#submitFormBtn').show();
|
||||
|
@ -138,6 +138,7 @@
|
||||
token: token
|
||||
}
|
||||
}, function (code, data) {
|
||||
layer.msg('提交成功');
|
||||
// 这里手动添加操作成功后的操作',
|
||||
}, function (code, data) {
|
||||
$('#submitFormBtn').show();
|
||||
|
@ -119,6 +119,7 @@
|
||||
token: token
|
||||
}
|
||||
}, function (code, data) {
|
||||
layer.msg('提交成功');
|
||||
// 这里手动添加操作成功后的操作',
|
||||
}, function (code, data) {
|
||||
$('.confirm-btn').show();
|
||||
|
@ -151,6 +151,7 @@
|
||||
token: token
|
||||
}
|
||||
}, function (code, data) {
|
||||
layer.msg('提交成功');
|
||||
// 这里手动添加操作成功后的操作',
|
||||
}, function (code, data) {
|
||||
$('.confirm-btn').show();
|
||||
|
@ -101,6 +101,7 @@
|
||||
$('#formCode').val(),
|
||||
$('#formVersion').val()
|
||||
]), formData.field, null, function (code, data) {
|
||||
layer.msg('提交成功');
|
||||
// 这里手动添加操作成功后的操作',
|
||||
}, function (code, data) {
|
||||
$('#submitFormBtn').show();
|
||||
|
@ -128,6 +128,7 @@
|
||||
$('#formVersion').val(),
|
||||
uid
|
||||
]), formData.field, null, function (code, data) {
|
||||
layer.msg('提交成功');
|
||||
// 这里手动添加操作成功后的操作',
|
||||
}, function (code, data) {
|
||||
$('#submitFormBtn').show();
|
||||
|
@ -24,7 +24,9 @@
|
||||
<div class="layui-col-xs8 tool-bar-left layui-layout-admin">
|
||||
<div id="submitBtnGroup" class="layui-btn-group"></div>
|
||||
</div>
|
||||
<div class="layui-col-xs4 tool-bar-right"></div>
|
||||
<div class="layui-col-xs4 tool-bar-right">
|
||||
<div id="formButtonGroup"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="reportForm" class="save-report-form">
|
||||
<#list fields as field>
|
||||
@ -58,10 +60,12 @@
|
||||
// 调试可先设置为空对象
|
||||
var confirmAssignees = ${r"${confirmAssignees}"};
|
||||
var fields = ${r"${fields}"};
|
||||
var formButton = ${r"${formButton}"};
|
||||
|
||||
// 初始化
|
||||
function initData() {
|
||||
oaFormUtil.initSubmitBtns(confirmAssignees);
|
||||
oaFormUtil.initFormButtons(formButton, {isApp:false});
|
||||
|
||||
<#list fields as field>
|
||||
<#if field.data.tag == 'uploadImage'>
|
||||
|
@ -42,22 +42,7 @@
|
||||
</#list>
|
||||
</div>
|
||||
<div id="processLog" class="layui-tab-item"></div>
|
||||
<div class="layui-tab-item" style="position: relative; text-align: center;">
|
||||
<div id="runtimeProcessImageBox">
|
||||
<img id="runtimeProcessImage" alt="流转图" style="height: 100%"/>
|
||||
</div>
|
||||
<div id="operationBtnBox" class="layui-btn-group">
|
||||
<button id="searchPlus" type="button" class="layui-btn layui-btn-xs" title="放大">
|
||||
<i class="fa fa-search-plus" aria-hidden="true"></i>
|
||||
</button>
|
||||
<button id="searchMinus" type="button" class="layui-btn layui-btn-xs layui-btn-default" title="缩小">
|
||||
<i class="fa fa-search-minus" aria-hidden="true"></i>
|
||||
</button>
|
||||
<button id="searchDefault" type="button" class="layui-btn layui-btn-xs layui-btn-primary" title="还原">
|
||||
<i class="fa fa-search" aria-hidden="true"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="processImage" class="layui-tab-item"></div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@ -89,9 +74,14 @@
|
||||
|
||||
// 初始化
|
||||
function initData() {
|
||||
oaFormUtil.initTabItem();
|
||||
oaFormUtil.initProcessLog(processInstanceId);
|
||||
oaFormUtil.initProcessImage(processInstanceId);
|
||||
oaFormUtil.initFormButtons({}, {
|
||||
isApp:false,
|
||||
onPreview: function(obj) {
|
||||
// 这里写预览的逻辑,没有不写此方法
|
||||
// console.log(obj);
|
||||
}
|
||||
});
|
||||
oaFormUtil.initTabItem(processInstanceId);
|
||||
|
||||
var self = this;
|
||||
var loadLayerIndex;
|
||||
|
@ -21,11 +21,11 @@
|
||||
<div class="layui-card-body">
|
||||
<form class="layui-form layui-form-pane" lay-filter="dataForm">
|
||||
<div class="layui-row oa-form-header-tool-bar">
|
||||
<div class="layui-col-xs8 tool-bar-left">
|
||||
<div class="layui-col-xs8 tool-bar-left layui-layout-admin">
|
||||
<div id="submitBtnGroup" class="layui-btn-group"></div>
|
||||
</div>
|
||||
<div class="layui-col-xs4 tool-bar-right">
|
||||
<div class="layui-btn-group"></div>
|
||||
<div id="formButtonGroup"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -42,22 +42,7 @@
|
||||
</#list>
|
||||
</div>
|
||||
<div id="processLog" class="layui-tab-item"></div>
|
||||
<div class="layui-tab-item" style="position: relative; text-align: center;">
|
||||
<div id="runtimeProcessImageBox">
|
||||
<img id="runtimeProcessImage" alt="流转图" style="height: 100%"/>
|
||||
</div>
|
||||
<div id="operationBtnBox" class="layui-btn-group">
|
||||
<button id="searchPlus" type="button" class="layui-btn layui-btn-xs" title="放大">
|
||||
<i class="fa fa-search-plus" aria-hidden="true"></i>
|
||||
</button>
|
||||
<button id="searchMinus" type="button" class="layui-btn layui-btn-xs layui-btn-default" title="缩小">
|
||||
<i class="fa fa-search-minus" aria-hidden="true"></i>
|
||||
</button>
|
||||
<button id="searchDefault" type="button" class="layui-btn layui-btn-xs layui-btn-primary" title="还原">
|
||||
<i class="fa fa-search" aria-hidden="true"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="processImage" class="layui-tab-item"></div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@ -91,13 +76,21 @@
|
||||
// 调试可先设置为空对象
|
||||
var confirmAssignees = ${r"${confirmAssignees}"};
|
||||
var fields = ${r"${fields}"};
|
||||
var formButton = ${r"${formButton}"};
|
||||
|
||||
// 初始化
|
||||
function initData() {
|
||||
oaFormUtil.initTabItem();
|
||||
oaFormUtil.initProcessLog($('#processInstanceId').val());
|
||||
oaFormUtil.initProcessImage($('#processInstanceId').val());
|
||||
oaFormUtil.initSubmitBtns(confirmAssignees);
|
||||
oaFormUtil.initFormButtons(formButton, {
|
||||
isApp:false,
|
||||
processInstanceId: $('#processInstanceId').val(),
|
||||
taskId: $('#taskId').val(),
|
||||
onPreview: function(obj) {
|
||||
// 这里写预览的逻辑,没有不写此方法
|
||||
// console.log(obj);
|
||||
}
|
||||
});
|
||||
oaFormUtil.initTabItem($('#processInstanceId').val());
|
||||
|
||||
var self = this;
|
||||
var loadLayerIndex;
|
||||
|
Loading…
Reference in New Issue
Block a user