fix: 修复流程设计器中指定人员后发起流程还需要选择接受人员问题

This commit is contained in:
tony
2022-12-25 21:29:30 +08:00
parent 08a43e8f4a
commit ad891029fe
5 changed files with 133 additions and 110 deletions

View File

@@ -367,56 +367,69 @@ export default {
this.updateProperties({'flowable:userType': val})
},
'formData.async': function(val) {
if (val === '') val = null
this.updateProperties({ 'flowable:async': val })
if (val) {
this.updateProperties({'flowable:async': val})
}
},
'formData.dueDate': function(val) {
if (val === '') val = null
this.updateProperties({ 'flowable:dueDate': val })
if (val) {
this.updateProperties({'flowable:dueDate': val})
}
},
'formData.formKey': function(val) {
if (val === '') val = null
this.updateProperties({ 'flowable:formKey': val })
if (val) {
this.updateProperties({'flowable:formKey': val})
}
},
'formData.priority': function(val) {
if (val === '') val = null
this.updateProperties({ 'flowable:priority': val })
if (val) {
this.updateProperties({'flowable:priority': val})
}
},
'formData.skipExpression': function(val) {
if (val === '') val = null
this.updateProperties({ 'flowable:skipExpression': val })
if (val) {
this.updateProperties({'flowable:skipExpression': val})
}
},
'formData.isForCompensation': function(val) {
if (val === '') val = null
this.updateProperties({ 'isForCompensation': val })
if (val) {
this.updateProperties({'isForCompensation': val})
}
},
'formData.triggerable': function(val) {
if (val === '') val = null
this.updateProperties({ 'flowable:triggerable': val })
if (val) {
this.updateProperties({'flowable:triggerable': val})
}
},
'formData.class': function(val) {
if (val === '') val = null
this.updateProperties({ 'flowable:class': val })
if (val) {
this.updateProperties({'flowable:class': val})
}
},
'formData.autoStoreVariables': function(val) {
if (val === '') val = null
this.updateProperties({ 'flowable:autoStoreVariables': val })
if (val) {
this.updateProperties({'flowable:autoStoreVariables': val})
}
},
'formData.exclude': function(val) {
if (val === '') val = null
this.updateProperties({ 'flowable:exclude': val })
if (val) {
this.updateProperties({'flowable:exclude': val})
}
},
'formData.ruleVariablesInput': function(val) {
if (val === '') val = null
this.updateProperties({ 'flowable:ruleVariablesInput': val })
if (val) {
this.updateProperties({'flowable:ruleVariablesInput': val})
}
},
'formData.rules': function(val) {
if (val === '') val = null
this.updateProperties({ 'flowable:rules': val })
if (val) {
this.updateProperties({'flowable:rules': val})
}
},
'formData.resultVariable': function(val) {
if (val === '') val = null
this.updateProperties({ 'flowable:resultVariable': val })
if (val) {
this.updateProperties({'flowable:resultVariable': val})
}
}
},
created() {

View File

@@ -141,44 +141,40 @@ export default {
getNextFlowNodeByStart({deploymentId: this.deployId,variables:formData.valData}).then(res => {
const data = res.data;
if (data) {
if (data.type === 'assignee') { // 指定人员
this.checkSendUser = true;
this.checkType = "single";
} else if (data.type === 'candidateUsers') { // 候选人员(多个)
this.checkSendUser = true;
this.checkType = "multiple";
} else if (data.type === 'candidateGroups') { // 指定组(所属角色接收任务)
this.checkSendRole = true;
} else if (data.type === 'multiInstance') { // 会签?
// 流程设计指定的 elementVariable 作为会签人员列表
this.multiInstanceVars = data.vars;
this.checkSendUser = true;
this.checkType = "multiple";
}
if (this.checkSendUser || this.checkSendRole){
this.formData = formData;
if (data.dataType === 'dynamic') {
if (data.type === 'assignee') { // 指定人员
this.checkSendUser = true;
this.checkType = "single";
} else if (data.type === 'candidateUsers') { // 候选人员(多个)
this.checkSendUser = true;
this.checkType = "multiple";
} else if (data.type === 'candidateGroups') { // 指定组(所属角色接收任务)
this.checkSendRole = true;
} else { // 会签
// 流程设计指定的 elementVariable 作为会签人员列表
this.multiInstanceVars = data.vars;
this.checkSendUser = true;
this.checkType = "multiple";
}
this.taskOpen = true;
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() {

View File

@@ -338,19 +338,33 @@ export default {
getNextFlowNode(params).then(res => {
const data = res.data;
if (data) {
if (data.type === 'assignee') { // 指定人员
this.checkSendUser = true;
this.checkType = "single";
} else if (data.type === 'candidateUsers') { // 候选人员(多个)
this.checkSendUser = true;
this.checkType = "multiple";
} else if (data.type === 'candidateGroups') { // 指定组(所属角色接收任务)
this.checkSendRole = true;
} else if (data.type === 'multiInstance') { // 会签
// 流程设计指定的 elementVariable 作为会签人员列表
this.multiInstanceVars = data.vars;
this.checkSendUser = true;
this.checkType = "multiple";
if (data.dataType === 'dynamic') {
if (data.type === 'assignee') { // 指定人员
this.checkSendUser = true;
this.checkType = "single";
} else if (data.type === 'candidateUsers') { // 候选人员(多个)
this.checkSendUser = true;
this.checkType = "multiple";
} else if (data.type === 'candidateGroups') { // 指定组(所属角色接收任务)
this.checkSendRole = true;
} else { // 会签
// 流程设计指定的 elementVariable 作为会签人员列表
this.multiInstanceVars = data.vars;
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 => {
const data = res.data;
if (data) {
if (data.type === 'assignee') { // 指定人员
this.checkSendUser = true;
this.checkType = "single";
} else if (data.type === 'candidateUsers') { // 候选人员(多个)
this.checkSendUser = true;
this.checkType = "multiple";
} else if (data.type === 'candidateGroups') { // 指定组(所属角色接收任务)
this.checkSendRole = true;
} else if (data.type === 'multiInstance') { // 会签?
// 流程设计指定的 elementVariable 作为会签人员列表
this.multiInstanceVars = data.vars;
this.checkSendUser = true;
this.checkType = "multiple";
}
if (this.checkSendUser || this.checkSendRole) {
this.taskForm.formData = formData;
if (data.dataType === 'dynamic') {
if (data.type === 'assignee') { // 指定人员
this.checkSendUser = true;
this.checkType = "single";
} else if (data.type === 'candidateUsers') { // 候选人员(多个)
this.checkSendUser = true;
this.checkType = "multiple";
} else if (data.type === 'candidateGroups') { // 指定组(所属角色接收任务)
this.checkSendRole = true;
} else { // 会签
// 流程设计指定的 elementVariable 作为会签人员列表
this.multiInstanceVars = data.vars;
this.checkSendUser = true;
this.checkType = "multiple";
}
this.completeOpen = true;
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 {
// 最后一个任务节点
// console.log(this.taskForm, "流程审批提交表单数据")
// complete(this.taskForm).then(response => {
// this.$modal.msgSuccess(response.msg);
// this.goBack();
// });
this.completeOpen = true;
this.completeTitle = "流程审批";
}