fix: 修复流程设计器中指定人员后发起流程还需要选择接受人员问题
parent
08a43e8f4a
commit
ad891029fe
|
|
@ -16,10 +16,7 @@ import java.util.List;
|
||||||
public class FlowNextDto implements Serializable {
|
public class FlowNextDto implements Serializable {
|
||||||
|
|
||||||
private String type;
|
private String type;
|
||||||
|
private String dataType;
|
||||||
private String vars;
|
private String vars;
|
||||||
|
|
||||||
private List<SysUser> userList;
|
|
||||||
|
|
||||||
private List<SysRole> roleList;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -623,11 +623,14 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
||||||
public AjaxResult todoList(Integer pageNum, Integer pageSize) {
|
public AjaxResult todoList(Integer pageNum, Integer pageSize) {
|
||||||
Page<FlowTaskDto> page = new Page<>();
|
Page<FlowTaskDto> page = new Page<>();
|
||||||
// 只查看自己的数据
|
// 只查看自己的数据
|
||||||
Long userId = SecurityUtils.getLoginUser().getUser().getUserId();
|
SysUser sysUser = SecurityUtils.getLoginUser().getUser();
|
||||||
|
Long userId = sysUser.getUserId();
|
||||||
TaskQuery taskQuery = taskService.createTaskQuery()
|
TaskQuery taskQuery = taskService.createTaskQuery()
|
||||||
.active()
|
.active()
|
||||||
.includeProcessVariables()
|
.includeProcessVariables()
|
||||||
// .taskAssignee(userId.toString())
|
.taskAssignee(userId.toString())
|
||||||
|
// .taskCandidateUser(userId.toString())
|
||||||
|
// .taskCandidateGroup(sysUser.getRoleId().toString())
|
||||||
.orderByTaskCreateTime().desc();
|
.orderByTaskCreateTime().desc();
|
||||||
page.setTotal(taskQuery.count());
|
page.setTotal(taskQuery.count());
|
||||||
List<Task> taskList = taskQuery.listPage(pageSize * (pageNum - 1), pageSize);
|
List<Task> taskList = taskQuery.listPage(pageSize * (pageNum - 1), pageSize);
|
||||||
|
|
@ -959,17 +962,14 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
||||||
if (Objects.nonNull(multiInstance)) {
|
if (Objects.nonNull(multiInstance)) {
|
||||||
flowNextDto.setVars(multiInstance.getInputDataItem());
|
flowNextDto.setVars(multiInstance.getInputDataItem());
|
||||||
flowNextDto.setType(ProcessConstants.PROCESS_MULTI_INSTANCE);
|
flowNextDto.setType(ProcessConstants.PROCESS_MULTI_INSTANCE);
|
||||||
|
flowNextDto.setDataType(ProcessConstants.PROCESS_MULTI_INSTANCE);
|
||||||
} else {
|
} else {
|
||||||
// 读取自定义节点属性 判断是否是否需要动态指定任务接收人员、组
|
// 读取自定义节点属性 判断是否是否需要动态指定任务接收人员、组
|
||||||
String dataType = userTask.getAttributeValue(ProcessConstants.NAMASPASE, ProcessConstants.PROCESS_CUSTOM_DATA_TYPE);
|
String dataType = userTask.getAttributeValue(ProcessConstants.NAMASPASE, ProcessConstants.PROCESS_CUSTOM_DATA_TYPE);
|
||||||
String userType = userTask.getAttributeValue(ProcessConstants.NAMASPASE, ProcessConstants.PROCESS_CUSTOM_USER_TYPE);
|
String userType = userTask.getAttributeValue(ProcessConstants.NAMASPASE, ProcessConstants.PROCESS_CUSTOM_USER_TYPE);
|
||||||
flowNextDto.setVars(ProcessConstants.PROCESS_APPROVAL);
|
flowNextDto.setVars(ProcessConstants.PROCESS_APPROVAL);
|
||||||
flowNextDto.setType(userType);
|
flowNextDto.setType(userType);
|
||||||
// 处理加载动态指定下一节点接收人员信息
|
flowNextDto.setDataType(dataType);
|
||||||
if (ProcessConstants.DYNAMIC.equals(dataType)) {
|
|
||||||
flowNextDto.setVars(ProcessConstants.PROCESS_APPROVAL);
|
|
||||||
flowNextDto.setType(userType);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -999,17 +999,14 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
||||||
if (Objects.nonNull(multiInstance)) {
|
if (Objects.nonNull(multiInstance)) {
|
||||||
flowNextDto.setVars(multiInstance.getInputDataItem());
|
flowNextDto.setVars(multiInstance.getInputDataItem());
|
||||||
flowNextDto.setType(ProcessConstants.PROCESS_MULTI_INSTANCE);
|
flowNextDto.setType(ProcessConstants.PROCESS_MULTI_INSTANCE);
|
||||||
|
flowNextDto.setDataType(ProcessConstants.PROCESS_MULTI_INSTANCE);
|
||||||
} else {
|
} else {
|
||||||
// 读取自定义节点属性 判断是否是否需要动态指定任务接收人员、组
|
// 读取自定义节点属性 判断是否是否需要动态指定任务接收人员、组
|
||||||
String dataType = userTask.getAttributeValue(ProcessConstants.NAMASPASE, ProcessConstants.PROCESS_CUSTOM_DATA_TYPE);
|
String dataType = userTask.getAttributeValue(ProcessConstants.NAMASPASE, ProcessConstants.PROCESS_CUSTOM_DATA_TYPE);
|
||||||
String userType = userTask.getAttributeValue(ProcessConstants.NAMASPASE, ProcessConstants.PROCESS_CUSTOM_USER_TYPE);
|
String userType = userTask.getAttributeValue(ProcessConstants.NAMASPASE, ProcessConstants.PROCESS_CUSTOM_USER_TYPE);
|
||||||
flowNextDto.setVars(ProcessConstants.PROCESS_APPROVAL);
|
flowNextDto.setVars(ProcessConstants.PROCESS_APPROVAL);
|
||||||
flowNextDto.setType(userType);
|
flowNextDto.setType(userType);
|
||||||
// 处理加载动态指定下一节点接收人员信息
|
flowNextDto.setDataType(dataType);
|
||||||
if (ProcessConstants.DYNAMIC.equals(dataType)) {
|
|
||||||
flowNextDto.setVars(ProcessConstants.PROCESS_APPROVAL);
|
|
||||||
flowNextDto.setType(userType);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -367,56 +367,69 @@ export default {
|
||||||
this.updateProperties({'flowable:userType': val})
|
this.updateProperties({'flowable:userType': val})
|
||||||
},
|
},
|
||||||
'formData.async': function(val) {
|
'formData.async': function(val) {
|
||||||
if (val === '') val = null
|
if (val) {
|
||||||
this.updateProperties({ 'flowable:async': val })
|
this.updateProperties({'flowable:async': val})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
'formData.dueDate': function(val) {
|
'formData.dueDate': function(val) {
|
||||||
if (val === '') val = null
|
if (val) {
|
||||||
this.updateProperties({ 'flowable:dueDate': val })
|
this.updateProperties({'flowable:dueDate': val})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
'formData.formKey': function(val) {
|
'formData.formKey': function(val) {
|
||||||
if (val === '') val = null
|
if (val) {
|
||||||
this.updateProperties({ 'flowable:formKey': val })
|
this.updateProperties({'flowable:formKey': val})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
'formData.priority': function(val) {
|
'formData.priority': function(val) {
|
||||||
if (val === '') val = null
|
if (val) {
|
||||||
this.updateProperties({ 'flowable:priority': val })
|
this.updateProperties({'flowable:priority': val})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
'formData.skipExpression': function(val) {
|
'formData.skipExpression': function(val) {
|
||||||
if (val === '') val = null
|
if (val) {
|
||||||
this.updateProperties({ 'flowable:skipExpression': val })
|
this.updateProperties({'flowable:skipExpression': val})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
'formData.isForCompensation': function(val) {
|
'formData.isForCompensation': function(val) {
|
||||||
if (val === '') val = null
|
if (val) {
|
||||||
this.updateProperties({ 'isForCompensation': val })
|
this.updateProperties({'isForCompensation': val})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
'formData.triggerable': function(val) {
|
'formData.triggerable': function(val) {
|
||||||
if (val === '') val = null
|
if (val) {
|
||||||
this.updateProperties({ 'flowable:triggerable': val })
|
this.updateProperties({'flowable:triggerable': val})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
'formData.class': function(val) {
|
'formData.class': function(val) {
|
||||||
if (val === '') val = null
|
if (val) {
|
||||||
this.updateProperties({ 'flowable:class': val })
|
this.updateProperties({'flowable:class': val})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
'formData.autoStoreVariables': function(val) {
|
'formData.autoStoreVariables': function(val) {
|
||||||
if (val === '') val = null
|
if (val) {
|
||||||
this.updateProperties({ 'flowable:autoStoreVariables': val })
|
this.updateProperties({'flowable:autoStoreVariables': val})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
'formData.exclude': function(val) {
|
'formData.exclude': function(val) {
|
||||||
if (val === '') val = null
|
if (val) {
|
||||||
this.updateProperties({ 'flowable:exclude': val })
|
this.updateProperties({'flowable:exclude': val})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
'formData.ruleVariablesInput': function(val) {
|
'formData.ruleVariablesInput': function(val) {
|
||||||
if (val === '') val = null
|
if (val) {
|
||||||
this.updateProperties({ 'flowable:ruleVariablesInput': val })
|
this.updateProperties({'flowable:ruleVariablesInput': val})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
'formData.rules': function(val) {
|
'formData.rules': function(val) {
|
||||||
if (val === '') val = null
|
if (val) {
|
||||||
this.updateProperties({ 'flowable:rules': val })
|
this.updateProperties({'flowable:rules': val})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
'formData.resultVariable': function(val) {
|
'formData.resultVariable': function(val) {
|
||||||
if (val === '') val = null
|
if (val) {
|
||||||
this.updateProperties({ 'flowable:resultVariable': val })
|
this.updateProperties({'flowable:resultVariable': val})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
|
|
||||||
|
|
@ -141,44 +141,40 @@ export default {
|
||||||
getNextFlowNodeByStart({deploymentId: this.deployId,variables:formData.valData}).then(res => {
|
getNextFlowNodeByStart({deploymentId: this.deployId,variables:formData.valData}).then(res => {
|
||||||
const data = res.data;
|
const data = res.data;
|
||||||
if (data) {
|
if (data) {
|
||||||
if (data.type === 'assignee') { // 指定人员
|
this.formData = formData;
|
||||||
this.checkSendUser = true;
|
if (data.dataType === 'dynamic') {
|
||||||
this.checkType = "single";
|
if (data.type === 'assignee') { // 指定人员
|
||||||
} else if (data.type === 'candidateUsers') { // 候选人员(多个)
|
this.checkSendUser = true;
|
||||||
this.checkSendUser = true;
|
this.checkType = "single";
|
||||||
this.checkType = "multiple";
|
} else if (data.type === 'candidateUsers') { // 候选人员(多个)
|
||||||
} else if (data.type === 'candidateGroups') { // 指定组(所属角色接收任务)
|
this.checkSendUser = true;
|
||||||
this.checkSendRole = true;
|
this.checkType = "multiple";
|
||||||
} else if (data.type === 'multiInstance') { // 会签?
|
} else if (data.type === 'candidateGroups') { // 指定组(所属角色接收任务)
|
||||||
// 流程设计指定的 elementVariable 作为会签人员列表
|
this.checkSendRole = true;
|
||||||
this.multiInstanceVars = data.vars;
|
} else { // 会签
|
||||||
this.checkSendUser = true;
|
// 流程设计指定的 elementVariable 作为会签人员列表
|
||||||
this.checkType = "multiple";
|
this.multiInstanceVars = data.vars;
|
||||||
}
|
this.checkSendUser = true;
|
||||||
if (this.checkSendUser || this.checkSendRole){
|
this.checkType = "multiple";
|
||||||
|
}
|
||||||
this.taskOpen = true;
|
this.taskOpen = true;
|
||||||
this.taskTitle = "选择任务接收";
|
this.taskTitle = "选择任务接收";
|
||||||
this.formData = formData;
|
} else {
|
||||||
|
const variables = this.formData.valData;
|
||||||
|
const formData = this.formData.formData;
|
||||||
|
formData.disabled = true;
|
||||||
|
formData.formBtns = false;
|
||||||
|
if (this.procDefId) {
|
||||||
|
variables.variables = formData;
|
||||||
|
// 启动流程并将表单数据加入流程变量
|
||||||
|
definitionStart(this.procDefId, JSON.stringify(variables)).then(res => {
|
||||||
|
this.$modal.msgSuccess(res.msg);
|
||||||
|
this.goBack();
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
// else {
|
|
||||||
// if (data) {
|
|
||||||
// const variables = data.valData;
|
|
||||||
// const formData = data.formData;
|
|
||||||
// formData.disabled = true;
|
|
||||||
// formData.formBtns = false;
|
|
||||||
// if (this.taskForm.procDefId) {
|
|
||||||
// variables.variables = formData;
|
|
||||||
// // 启动流程并将表单数据加入流程变量
|
|
||||||
// definitionStart(this.taskForm.procDefId, JSON.stringify(variables)).then(res => {
|
|
||||||
// this.$modal.msgSuccess(res.msg);
|
|
||||||
// this.goBack();
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
},
|
},
|
||||||
/** 提交流程 */
|
/** 提交流程 */
|
||||||
submitTask() {
|
submitTask() {
|
||||||
|
|
|
||||||
|
|
@ -338,19 +338,33 @@ export default {
|
||||||
getNextFlowNode(params).then(res => {
|
getNextFlowNode(params).then(res => {
|
||||||
const data = res.data;
|
const data = res.data;
|
||||||
if (data) {
|
if (data) {
|
||||||
if (data.type === 'assignee') { // 指定人员
|
if (data.dataType === 'dynamic') {
|
||||||
this.checkSendUser = true;
|
if (data.type === 'assignee') { // 指定人员
|
||||||
this.checkType = "single";
|
this.checkSendUser = true;
|
||||||
} else if (data.type === 'candidateUsers') { // 候选人员(多个)
|
this.checkType = "single";
|
||||||
this.checkSendUser = true;
|
} else if (data.type === 'candidateUsers') { // 候选人员(多个)
|
||||||
this.checkType = "multiple";
|
this.checkSendUser = true;
|
||||||
} else if (data.type === 'candidateGroups') { // 指定组(所属角色接收任务)
|
this.checkType = "multiple";
|
||||||
this.checkSendRole = true;
|
} else if (data.type === 'candidateGroups') { // 指定组(所属角色接收任务)
|
||||||
} else if (data.type === 'multiInstance') { // 会签
|
this.checkSendRole = true;
|
||||||
// 流程设计指定的 elementVariable 作为会签人员列表
|
} else { // 会签
|
||||||
this.multiInstanceVars = data.vars;
|
// 流程设计指定的 elementVariable 作为会签人员列表
|
||||||
this.checkSendUser = true;
|
this.multiInstanceVars = data.vars;
|
||||||
this.checkType = "multiple";
|
this.checkSendUser = true;
|
||||||
|
this.checkType = "multiple";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 表单是否禁用
|
||||||
|
this.taskForm.formData.formData.disabled = true;
|
||||||
|
// 是否显示按钮
|
||||||
|
this.taskForm.formData.formData.formBtns = false;
|
||||||
|
this.taskForm.variables = Object.assign({}, this.taskForm.variables, this.taskForm.formData.valData);
|
||||||
|
this.taskForm.variables.variables = this.taskForm.formData.formData;
|
||||||
|
console.log(this.taskForm, "流程审批提交表单数据")
|
||||||
|
complete(this.taskForm).then(response => {
|
||||||
|
this.$modal.msgSuccess(response.msg);
|
||||||
|
this.goBack();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
@ -476,32 +490,38 @@ export default {
|
||||||
getNextFlowNode(params).then(res => {
|
getNextFlowNode(params).then(res => {
|
||||||
const data = res.data;
|
const data = res.data;
|
||||||
if (data) {
|
if (data) {
|
||||||
if (data.type === 'assignee') { // 指定人员
|
this.taskForm.formData = formData;
|
||||||
this.checkSendUser = true;
|
if (data.dataType === 'dynamic') {
|
||||||
this.checkType = "single";
|
if (data.type === 'assignee') { // 指定人员
|
||||||
} else if (data.type === 'candidateUsers') { // 候选人员(多个)
|
this.checkSendUser = true;
|
||||||
this.checkSendUser = true;
|
this.checkType = "single";
|
||||||
this.checkType = "multiple";
|
} else if (data.type === 'candidateUsers') { // 候选人员(多个)
|
||||||
} else if (data.type === 'candidateGroups') { // 指定组(所属角色接收任务)
|
this.checkSendUser = true;
|
||||||
this.checkSendRole = true;
|
this.checkType = "multiple";
|
||||||
} else if (data.type === 'multiInstance') { // 会签?
|
} else if (data.type === 'candidateGroups') { // 指定组(所属角色接收任务)
|
||||||
// 流程设计指定的 elementVariable 作为会签人员列表
|
this.checkSendRole = true;
|
||||||
this.multiInstanceVars = data.vars;
|
} else { // 会签
|
||||||
this.checkSendUser = true;
|
// 流程设计指定的 elementVariable 作为会签人员列表
|
||||||
this.checkType = "multiple";
|
this.multiInstanceVars = data.vars;
|
||||||
}
|
this.checkSendUser = true;
|
||||||
if (this.checkSendUser || this.checkSendRole) {
|
this.checkType = "multiple";
|
||||||
|
}
|
||||||
this.completeOpen = true;
|
this.completeOpen = true;
|
||||||
this.completeTitle = "流程审批";
|
this.completeTitle = "流程审批";
|
||||||
this.taskForm.formData = formData;
|
} else {
|
||||||
|
// 表单是否禁用
|
||||||
|
this.taskForm.formData.formData.disabled = true;
|
||||||
|
// 是否显示按钮
|
||||||
|
this.taskForm.formData.formData.formBtns = false;
|
||||||
|
this.taskForm.variables = Object.assign({}, this.taskForm.variables, this.taskForm.formData.valData);
|
||||||
|
this.taskForm.variables.variables = this.taskForm.formData.formData;
|
||||||
|
console.log(this.taskForm, "流程审批提交表单数据")
|
||||||
|
complete(this.taskForm).then(response => {
|
||||||
|
this.$modal.msgSuccess(response.msg);
|
||||||
|
this.goBack();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// 最后一个任务节点
|
|
||||||
// console.log(this.taskForm, "流程审批提交表单数据")
|
|
||||||
// complete(this.taskForm).then(response => {
|
|
||||||
// this.$modal.msgSuccess(response.msg);
|
|
||||||
// this.goBack();
|
|
||||||
// });
|
|
||||||
this.completeOpen = true;
|
this.completeOpen = true;
|
||||||
this.completeTitle = "流程审批";
|
this.completeTitle = "流程审批";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue