完善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,
|
public SuccessResult update(@PathVariable("processInstanceId") String processInstanceId,
|
||||||
@PathVariable("taskId") String taskId,
|
@PathVariable("taskId") String taskId,
|
||||||
@PathVariable("nodeId") String nodeId,
|
@PathVariable("nodeId") String nodeId,
|
||||||
@RequestBody Map<String, Object> params) {
|
@RequestBody Map<String, String> params) {
|
||||||
oaFormReportService.updateGoBack(processInstanceId, taskId, nodeId, 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();
|
return new SuccessResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,6 +25,7 @@ public interface IOaFormReportService {
|
|||||||
String KEY_SELECT_TYPE = "selectType";
|
String KEY_SELECT_TYPE = "selectType";
|
||||||
String KEY_IS_NEXT_END_EVENT = "isNextEndEvent";
|
String KEY_IS_NEXT_END_EVENT = "isNextEndEvent";
|
||||||
String KEY_RECORD_FIELDS = "recordFields";
|
String KEY_RECORD_FIELDS = "recordFields";
|
||||||
|
String KEY_GO_BACK_REASON = "reason";
|
||||||
/**
|
/**
|
||||||
* 签批关键字后缀
|
* 签批关键字后缀
|
||||||
*/
|
*/
|
||||||
@ -112,9 +113,9 @@ public interface IOaFormReportService {
|
|||||||
* @param processInstanceId
|
* @param processInstanceId
|
||||||
* @param currentTaskId
|
* @param currentTaskId
|
||||||
* @param jumpNodeId
|
* @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
|
@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流程回退");
|
LOG.debug("OA流程回退");
|
||||||
Task currentTask = taskService.createTaskQuery().taskId(currentTaskId).singleResult();
|
Task currentTask = taskService.createTaskQuery().taskId(currentTaskId).singleResult();
|
||||||
if (currentTask == null) {
|
if (currentTask == null) {
|
||||||
@ -233,25 +233,27 @@ public class OaFormReportServiceImpl extends DefaultBaseService implements IOaFo
|
|||||||
}
|
}
|
||||||
LOG.debug("7. 开始完成任务");
|
LOG.debug("7. 开始完成任务");
|
||||||
List<String> historicUserTaskUserIds = new ArrayList<>(historicUserTaskUserIdSet);
|
List<String> historicUserTaskUserIds = new ArrayList<>(historicUserTaskUserIdSet);
|
||||||
|
Map<String, Object> processVariables = getHashMap(4);
|
||||||
if (historicUserTaskUserIdSet.size() == 1) {
|
if (historicUserTaskUserIdSet.size() == 1) {
|
||||||
LOG.debug("7.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) {
|
} else if (historicTaskInstances.size() > 1) {
|
||||||
LOG.debug("7.2 设置代理人(多实例)");
|
LOG.debug("7.2 设置代理人(多实例)");
|
||||||
requestParams.put(IActivitiModelService.ASSIGNEE_LIST, historicUserTaskUserIds);
|
processVariables.put(IActivitiModelService.ASSIGNEE_LIST, historicUserTaskUserIds);
|
||||||
} else {
|
} else {
|
||||||
throw new SearchException("找不到回退代理人");
|
throw new SearchException("找不到回退代理人");
|
||||||
}
|
}
|
||||||
LOG.debug("7.3 完成任务");
|
LOG.debug("7.3 完成任务");
|
||||||
TaskCommentBO taskCommentBO = new TaskCommentBO();
|
TaskCommentBO taskCommentBO = new TaskCommentBO();
|
||||||
taskCommentBO.setType(TaskCommentTypeEnum.GO_BACK);
|
taskCommentBO.setType(TaskCommentTypeEnum.GO_BACK);
|
||||||
taskCommentBO.setContent(requestParams.get("content").toString());
|
taskCommentBO.setContent(reason);
|
||||||
taskCommentBO.setTime(DateUtil.getTime());
|
taskCommentBO.setTime(DateUtil.getTime());
|
||||||
taskCommentBO.setUserId(userId);
|
taskCommentBO.setUserId(userId);
|
||||||
taskCommentBO.setUserName(userName);
|
taskCommentBO.setUserName(userName);
|
||||||
taskService.addComment(currentTaskId, processInstanceId, TaskCommentTypeEnum.GO_BACK.getValue(), JSONObject.toJSONString(taskCommentBO));
|
taskService.addComment(currentTaskId, processInstanceId, TaskCommentTypeEnum.GO_BACK.getValue(), JSONObject.toJSONString(taskCommentBO));
|
||||||
taskService.complete(currentTaskId, requestParams);
|
taskService.complete(currentTaskId, processVariables);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
throw new SystemException(e);
|
throw new SystemException(e);
|
||||||
} finally {
|
} finally {
|
||||||
LOG.debug("9. 恢复原有的下一步连线");
|
LOG.debug("9. 恢复原有的下一步连线");
|
||||||
|
@ -160,7 +160,7 @@
|
|||||||
top.dialog.open({
|
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]),
|
url: top.restAjax.path('route/oa-form-report/save/definition-id/{processDefinitionId}/code/{formCode}/version/{formVersion}', [data.id, data.formCode, data.formVersion]),
|
||||||
title: '发起流程',
|
title: '发起流程',
|
||||||
width: '500px',
|
width: '800px',
|
||||||
height: '80%',
|
height: '80%',
|
||||||
onClose: function() {}
|
onClose: function() {}
|
||||||
});
|
});
|
||||||
|
@ -111,14 +111,13 @@
|
|||||||
return rowData;
|
return rowData;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{field: 'form', width: 150, title: '操作', align:'center', fixed: 'right',
|
{field: 'form', width: 80, title: '操作', align:'center', fixed: 'right',
|
||||||
templet: function(row) {
|
templet: function(row) {
|
||||||
if(!row.formCode || !row.formVersion) {
|
if(!row.formCode || !row.formVersion) {
|
||||||
return '-';
|
return '-';
|
||||||
}
|
}
|
||||||
return '<div class="layui-btn-group">' +
|
return '<div class="layui-btn-group">' +
|
||||||
'<button class="layui-btn layui-btn-xs" lay-event="handleEvent">处理</button>'+
|
'<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>';
|
'</div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -166,20 +165,12 @@
|
|||||||
top.dialog.open({
|
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]),
|
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: '编辑',
|
title: '编辑',
|
||||||
width: '500px',
|
width: '800px',
|
||||||
height: '80%',
|
height: '80%',
|
||||||
onClose: function() {
|
onClose: function() {
|
||||||
reloadTable();
|
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,15 +25,6 @@ function OaFormUtil(layui) {
|
|||||||
formData.field.recordFields = recordFields;
|
formData.field.recordFields = recordFields;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取会签内容
|
|
||||||
* @param signItem
|
|
||||||
* @return {string}
|
|
||||||
*/
|
|
||||||
function getJointlySignText(signItem) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置签字列表
|
* 设置签字列表
|
||||||
* @param formData
|
* @param formData
|
||||||
@ -88,7 +79,7 @@ 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) {
|
restAjax.get(restAjax.path('api/oa/list-process-log/process-instance-id/{processInstanceId}', [processInstanceId]), {}, null, function (code, data) {
|
||||||
var ul = '<ul class="layui-timeline">';
|
var ul = '<ul class="layui-timeline">';
|
||||||
for (var i = 0, item; item = data[i++];) {
|
for (var i = 0, item; item = data[i++];) {
|
||||||
@ -98,6 +89,8 @@ function OaFormUtil(layui) {
|
|||||||
if (comment) {
|
if (comment) {
|
||||||
if (comment.type === 'JOINTLY_SIGN') {
|
if (comment.type === 'JOINTLY_SIGN') {
|
||||||
commentText = '类型:会签。内容:' + comment.content + '。时间:' + comment.time;
|
commentText = '类型:会签。内容:' + comment.content + '。时间:' + comment.time;
|
||||||
|
} else if (comment.type === 'GO_BACK') {
|
||||||
|
commentText = '类型:回退。内容:' + comment.content + '。时间:' + comment.time;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var li = [
|
var li = [
|
||||||
@ -153,9 +146,29 @@ function OaFormUtil(layui) {
|
|||||||
* 初始化流程图
|
* 初始化流程图
|
||||||
* @param processInstanceId
|
* @param processInstanceId
|
||||||
*/
|
*/
|
||||||
this.initProcessImage = function (processInstanceId) {
|
initProcessImage = function (processInstanceId) {
|
||||||
function initRuntimeProcessImage() {
|
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();
|
initRuntimeProcessImage();
|
||||||
@ -181,11 +194,13 @@ function OaFormUtil(layui) {
|
|||||||
/**
|
/**
|
||||||
* 初始化选择项
|
* 初始化选择项
|
||||||
*/
|
*/
|
||||||
this.initTabItem = function () {
|
this.initTabItem = function (processInstanceId) {
|
||||||
$('.layui-tab-item, #runtimeProcessImageBox').css({
|
$('.layui-tab-item, #runtimeProcessImageBox').css({
|
||||||
height: (win.height() - 138) + 'px',
|
height: (win.height() - 138) + 'px',
|
||||||
overflow: 'auto'
|
overflow: 'auto'
|
||||||
});
|
});
|
||||||
|
initProcessLog(processInstanceId);
|
||||||
|
initProcessImage(processInstanceId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -249,20 +264,24 @@ function OaFormUtil(layui) {
|
|||||||
var headers = opt.headers;
|
var headers = opt.headers;
|
||||||
headers = headers ? headers : {};
|
headers = headers ? headers : {};
|
||||||
var isApp = opt.isApp;
|
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() {
|
function initButton() {
|
||||||
var buttons = '';
|
var buttons = '';
|
||||||
buttons += '<div class="layui-btn-group">'
|
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) {
|
if (formButton.btnGoBack) {
|
||||||
buttons += '<button id="goBackBtn" type="button" class="layui-btn layui-btn-sm layui-btn-danger confirm-btn">回退</button>';
|
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);
|
$('#formButtonGroup').append(buttons);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -288,16 +307,21 @@ function OaFormUtil(layui) {
|
|||||||
'application/vnd.ms-works',
|
'application/vnd.ms-works',
|
||||||
'text/plain',
|
'text/plain',
|
||||||
'application/x-rar',
|
'application/x-rar',
|
||||||
'application/x-zip-compressed'
|
'application/x-zip-compressed',
|
||||||
|
'image/*',
|
||||||
|
'video/mp4',
|
||||||
|
'audio/wav',
|
||||||
|
'audio/mp3'
|
||||||
].join(''),
|
].join(''),
|
||||||
field: 'file',
|
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,
|
headers: headers,
|
||||||
before: function (obj) {
|
before: function (obj) {
|
||||||
layerLoadingIndex = layer.msg('上传中...', {icon: 16, time: 0, shade: 0.3})
|
layerLoadingIndex = layer.msg('上传中...', {icon: 16, time: 0, shade: 0.3})
|
||||||
},
|
},
|
||||||
done: function (res, index, upload) {
|
done: function (res, index, upload) {
|
||||||
layer.close(layerLoadingIndex);
|
layer.close(layerLoadingIndex);
|
||||||
|
layer.msg('上传成功')
|
||||||
var attachments = $('#attachments').val();
|
var attachments = $('#attachments').val();
|
||||||
var data = res.data;
|
var data = res.data;
|
||||||
if (attachments.length > 0) {
|
if (attachments.length > 0) {
|
||||||
@ -310,9 +334,11 @@ function OaFormUtil(layui) {
|
|||||||
layer.close(layerLoadingIndex);
|
layer.close(layerLoadingIndex);
|
||||||
layer.msg('文件上传失败');
|
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 attachments = $('#attachments').val();
|
||||||
var attachmentArray = attachments.split(',');
|
var attachmentArray = attachments.split(',');
|
||||||
@ -321,7 +347,7 @@ function OaFormUtil(layui) {
|
|||||||
' <table class="layui-table" lay-size="sm">',
|
' <table class="layui-table" lay-size="sm">',
|
||||||
' <colgroup>',
|
' <colgroup>',
|
||||||
' <col>',
|
' <col>',
|
||||||
' <col width="60">',
|
onPreview && formButton.btnAttachment ? '<col width="100">' : '<col width="60">',
|
||||||
' </colgroup>',
|
' </colgroup>',
|
||||||
' <thead>',
|
' <thead>',
|
||||||
' <tr>',
|
' <tr>',
|
||||||
@ -331,19 +357,26 @@ function OaFormUtil(layui) {
|
|||||||
' </thead>',
|
' </thead>',
|
||||||
' <tbody>',
|
' <tbody>',
|
||||||
].join('');
|
].join('');
|
||||||
|
if (attachmentArray.length > 0) {
|
||||||
for (var i = 0, file; file = attachmentArray[i++];) {
|
for (var i = 0, file; file = attachmentArray[i++];) {
|
||||||
var idNameArray = file.split(':');
|
var idNameArray = file.split(':');
|
||||||
var fileId = idNameArray[0];
|
var fileId = idNameArray[0];
|
||||||
var fileName = idNameArray[1];
|
var fileName = idNameArray[1];
|
||||||
html += [
|
html += [
|
||||||
'<tr>',
|
'<tr>',
|
||||||
' <td><a href="route/file/download/false/'+ fileId +'" target="_blank">' + fileName + '</a></td>',
|
' <td><a href="route/file/download/false/' + fileId + '" target="_blank" title="下载">' + fileName + '</a></td>',
|
||||||
' <td class="operation">',
|
' <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>' : '',
|
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>',
|
' </td>',
|
||||||
'</tr>',
|
'</tr>',
|
||||||
].join('');
|
].join('');
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
html += '<tr><td colspan="2" style="text-align: center;">没有附件</td></tr>';
|
||||||
|
}
|
||||||
html += [
|
html += [
|
||||||
' </tbody>',
|
' </tbody>',
|
||||||
' </table>',
|
' </table>',
|
||||||
@ -352,8 +385,10 @@ function OaFormUtil(layui) {
|
|||||||
layer.open({
|
layer.open({
|
||||||
type: 1,
|
type: 1,
|
||||||
title: false,
|
title: false,
|
||||||
area: ['80%'],
|
area: ['400px', '100%'],
|
||||||
maxHeight: '60%',
|
offset: 'r',
|
||||||
|
anim: 2,
|
||||||
|
isOutAnim: false,
|
||||||
closeBtn: 0,
|
closeBtn: 0,
|
||||||
shadeClose: true,
|
shadeClose: true,
|
||||||
content: html
|
content: html
|
||||||
@ -372,12 +407,106 @@ function OaFormUtil(layui) {
|
|||||||
files = files.substring(0, files.length - 1);
|
files = files.substring(0, files.length - 1);
|
||||||
}
|
}
|
||||||
$('#attachments').val(files);
|
$('#attachments').val(files);
|
||||||
$(this).parent().parent().remove();
|
$(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 () {
|
$(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>' + goBackUserTask.taskName + '</a></td>',
|
||||||
|
' <td class="operation">',
|
||||||
|
' <button type="button" class="layui-btn layui-btn-xs layui-btn-danger go-back-btn" data-node-id="' + goBackUserTask.nodeId + '">回退</button>',
|
||||||
|
' </td>',
|
||||||
|
'</tr>',
|
||||||
|
].join('');
|
||||||
|
}
|
||||||
|
html += [
|
||||||
|
' </tbody>',
|
||||||
|
' </table>',
|
||||||
|
'</div>'
|
||||||
|
].join('');
|
||||||
|
layer.open({
|
||||||
|
type: 1,
|
||||||
|
title: false,
|
||||||
|
area: ['350px', '100%'],
|
||||||
|
offset: 'r',
|
||||||
|
anim: 2,
|
||||||
|
isOutAnim: false,
|
||||||
|
closeBtn: 0,
|
||||||
|
shadeClose: true,
|
||||||
|
content: html
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// 回退
|
||||||
|
$(document.body).on('click', '.go-back-btn', function () {
|
||||||
|
if (!taskId) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!processInstanceId) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var nodeId = this.dataset.nodeId;
|
||||||
|
layer.confirm('确定回退吗?', function (confirmLayerIndex) {
|
||||||
|
layer.close(confirmLayerIndex);
|
||||||
|
|
||||||
|
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();
|
initButton();
|
||||||
|
@ -108,6 +108,7 @@
|
|||||||
token: token
|
token: token
|
||||||
}
|
}
|
||||||
}, function (code, data) {
|
}, function (code, data) {
|
||||||
|
layer.msg('提交成功');
|
||||||
// 这里手动添加操作成功后的操作',
|
// 这里手动添加操作成功后的操作',
|
||||||
}, function (code, data) {
|
}, function (code, data) {
|
||||||
$('#submitFormBtn').show();
|
$('#submitFormBtn').show();
|
||||||
|
@ -138,6 +138,7 @@
|
|||||||
token: token
|
token: token
|
||||||
}
|
}
|
||||||
}, function (code, data) {
|
}, function (code, data) {
|
||||||
|
layer.msg('提交成功');
|
||||||
// 这里手动添加操作成功后的操作',
|
// 这里手动添加操作成功后的操作',
|
||||||
}, function (code, data) {
|
}, function (code, data) {
|
||||||
$('#submitFormBtn').show();
|
$('#submitFormBtn').show();
|
||||||
|
@ -119,6 +119,7 @@
|
|||||||
token: token
|
token: token
|
||||||
}
|
}
|
||||||
}, function (code, data) {
|
}, function (code, data) {
|
||||||
|
layer.msg('提交成功');
|
||||||
// 这里手动添加操作成功后的操作',
|
// 这里手动添加操作成功后的操作',
|
||||||
}, function (code, data) {
|
}, function (code, data) {
|
||||||
$('.confirm-btn').show();
|
$('.confirm-btn').show();
|
||||||
|
@ -151,6 +151,7 @@
|
|||||||
token: token
|
token: token
|
||||||
}
|
}
|
||||||
}, function (code, data) {
|
}, function (code, data) {
|
||||||
|
layer.msg('提交成功');
|
||||||
// 这里手动添加操作成功后的操作',
|
// 这里手动添加操作成功后的操作',
|
||||||
}, function (code, data) {
|
}, function (code, data) {
|
||||||
$('.confirm-btn').show();
|
$('.confirm-btn').show();
|
||||||
|
@ -101,6 +101,7 @@
|
|||||||
$('#formCode').val(),
|
$('#formCode').val(),
|
||||||
$('#formVersion').val()
|
$('#formVersion').val()
|
||||||
]), formData.field, null, function (code, data) {
|
]), formData.field, null, function (code, data) {
|
||||||
|
layer.msg('提交成功');
|
||||||
// 这里手动添加操作成功后的操作',
|
// 这里手动添加操作成功后的操作',
|
||||||
}, function (code, data) {
|
}, function (code, data) {
|
||||||
$('#submitFormBtn').show();
|
$('#submitFormBtn').show();
|
||||||
|
@ -128,6 +128,7 @@
|
|||||||
$('#formVersion').val(),
|
$('#formVersion').val(),
|
||||||
uid
|
uid
|
||||||
]), formData.field, null, function (code, data) {
|
]), formData.field, null, function (code, data) {
|
||||||
|
layer.msg('提交成功');
|
||||||
// 这里手动添加操作成功后的操作',
|
// 这里手动添加操作成功后的操作',
|
||||||
}, function (code, data) {
|
}, function (code, data) {
|
||||||
$('#submitFormBtn').show();
|
$('#submitFormBtn').show();
|
||||||
|
@ -24,7 +24,9 @@
|
|||||||
<div class="layui-col-xs8 tool-bar-left layui-layout-admin">
|
<div class="layui-col-xs8 tool-bar-left layui-layout-admin">
|
||||||
<div id="submitBtnGroup" class="layui-btn-group"></div>
|
<div id="submitBtnGroup" class="layui-btn-group"></div>
|
||||||
</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>
|
||||||
<div id="reportForm" class="save-report-form">
|
<div id="reportForm" class="save-report-form">
|
||||||
<#list fields as field>
|
<#list fields as field>
|
||||||
@ -58,10 +60,12 @@
|
|||||||
// 调试可先设置为空对象
|
// 调试可先设置为空对象
|
||||||
var confirmAssignees = ${r"${confirmAssignees}"};
|
var confirmAssignees = ${r"${confirmAssignees}"};
|
||||||
var fields = ${r"${fields}"};
|
var fields = ${r"${fields}"};
|
||||||
|
var formButton = ${r"${formButton}"};
|
||||||
|
|
||||||
// 初始化
|
// 初始化
|
||||||
function initData() {
|
function initData() {
|
||||||
oaFormUtil.initSubmitBtns(confirmAssignees);
|
oaFormUtil.initSubmitBtns(confirmAssignees);
|
||||||
|
oaFormUtil.initFormButtons(formButton, {isApp:false});
|
||||||
|
|
||||||
<#list fields as field>
|
<#list fields as field>
|
||||||
<#if field.data.tag == 'uploadImage'>
|
<#if field.data.tag == 'uploadImage'>
|
||||||
|
@ -42,22 +42,7 @@
|
|||||||
</#list>
|
</#list>
|
||||||
</div>
|
</div>
|
||||||
<div id="processLog" class="layui-tab-item"></div>
|
<div id="processLog" class="layui-tab-item"></div>
|
||||||
<div class="layui-tab-item" style="position: relative; text-align: center;">
|
<div id="processImage" class="layui-tab-item"></div>
|
||||||
<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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
@ -89,9 +74,14 @@
|
|||||||
|
|
||||||
// 初始化
|
// 初始化
|
||||||
function initData() {
|
function initData() {
|
||||||
oaFormUtil.initTabItem();
|
oaFormUtil.initFormButtons({}, {
|
||||||
oaFormUtil.initProcessLog(processInstanceId);
|
isApp:false,
|
||||||
oaFormUtil.initProcessImage(processInstanceId);
|
onPreview: function(obj) {
|
||||||
|
// 这里写预览的逻辑,没有不写此方法
|
||||||
|
// console.log(obj);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
oaFormUtil.initTabItem(processInstanceId);
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
var loadLayerIndex;
|
var loadLayerIndex;
|
||||||
|
@ -21,11 +21,11 @@
|
|||||||
<div class="layui-card-body">
|
<div class="layui-card-body">
|
||||||
<form class="layui-form layui-form-pane" lay-filter="dataForm">
|
<form class="layui-form layui-form-pane" lay-filter="dataForm">
|
||||||
<div class="layui-row oa-form-header-tool-bar">
|
<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 id="submitBtnGroup" class="layui-btn-group"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-col-xs4 tool-bar-right">
|
<div class="layui-col-xs4 tool-bar-right">
|
||||||
<div class="layui-btn-group"></div>
|
<div id="formButtonGroup"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -42,22 +42,7 @@
|
|||||||
</#list>
|
</#list>
|
||||||
</div>
|
</div>
|
||||||
<div id="processLog" class="layui-tab-item"></div>
|
<div id="processLog" class="layui-tab-item"></div>
|
||||||
<div class="layui-tab-item" style="position: relative; text-align: center;">
|
<div id="processImage" class="layui-tab-item"></div>
|
||||||
<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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
@ -91,13 +76,21 @@
|
|||||||
// 调试可先设置为空对象
|
// 调试可先设置为空对象
|
||||||
var confirmAssignees = ${r"${confirmAssignees}"};
|
var confirmAssignees = ${r"${confirmAssignees}"};
|
||||||
var fields = ${r"${fields}"};
|
var fields = ${r"${fields}"};
|
||||||
|
var formButton = ${r"${formButton}"};
|
||||||
|
|
||||||
// 初始化
|
// 初始化
|
||||||
function initData() {
|
function initData() {
|
||||||
oaFormUtil.initTabItem();
|
|
||||||
oaFormUtil.initProcessLog($('#processInstanceId').val());
|
|
||||||
oaFormUtil.initProcessImage($('#processInstanceId').val());
|
|
||||||
oaFormUtil.initSubmitBtns(confirmAssignees);
|
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 self = this;
|
||||||
var loadLayerIndex;
|
var loadLayerIndex;
|
||||||
|
Loading…
Reference in New Issue
Block a user