fix(流程设计): 修复 任务节点选择顺序审批会清除多实例选项问题[I6FOJ4](https://gitee.com/KonBAI-Q/ruoyi-flowable-plus/issues/I6FOJ4)

This commit is contained in:
konbai
2023-02-19 18:06:54 +08:00
parent 666ea6e010
commit 7f2609af8e

View File

@@ -50,7 +50,7 @@
<el-divider /> <el-divider />
<h4><b>多实例审批方式</b></h4> <h4><b>多实例审批方式</b></h4>
<el-row> <el-row>
<el-radio-group v-model="multiLoopType" @change="changeMultiLoopType"> <el-radio-group v-model="multiLoopType" @change="changeMultiLoopType()">
<el-row><el-radio label="Null"></el-radio></el-row> <el-row><el-radio label="Null"></el-radio></el-row>
<el-row><el-radio label="SequentialMultiInstance">会签需所有审批人同意</el-radio></el-row> <el-row><el-radio label="SequentialMultiInstance">会签需所有审批人同意</el-radio></el-row>
<el-row><el-radio label="ParallelMultiInstance">或签一名审批人同意即可</el-radio></el-row> <el-row><el-radio label="ParallelMultiInstance">或签一名审批人同意即可</el-radio></el-row>
@@ -61,7 +61,7 @@
<i class="header-icon el-icon-info"></i> <i class="header-icon el-icon-info"></i>
</el-tooltip> </el-tooltip>
<span class="custom-label">顺序审批</span> <span class="custom-label">顺序审批</span>
<el-switch v-model="isSequential" @change="changeMultiLoopType" /> <el-switch v-model="isSequential" @change="changeMultiLoopType()" />
</el-row> </el-row>
</div> </div>
</el-row> </el-row>
@@ -337,7 +337,7 @@ export default {
userTaskForm.candidateUsers = null; userTaskForm.candidateUsers = null;
this.showMultiFlog = false; this.showMultiFlog = false;
this.multiLoopType = 'Null'; this.multiLoopType = 'Null';
this.changeMultiLoopType(this.multiLoopType); this.changeMultiLoopType();
} else { } else {
userTaskForm.candidateUsers = this.selectedUserDate.map(k => k.userId).join() || null; userTaskForm.candidateUsers = this.selectedUserDate.map(k => k.userId).join() || null;
userTaskForm.text = this.selectedUserDate.map(k => k.nickName).join() || null; userTaskForm.text = this.selectedUserDate.map(k => k.nickName).join() || null;
@@ -362,7 +362,7 @@ export default {
userTaskForm.candidateGroups = groups; userTaskForm.candidateGroups = groups;
userTaskForm.text = text; userTaskForm.text = text;
this.updateElementTask(); this.updateElementTask();
this.changeMultiLoopType(this.multiLoopType); this.changeMultiLoopType();
}, },
checkedDeptChange(checkedIds) { checkedDeptChange(checkedIds) {
let groups = null; let groups = null;
@@ -394,7 +394,7 @@ export default {
userTaskForm.candidateGroups = groups; userTaskForm.candidateGroups = groups;
userTaskForm.text = text; userTaskForm.text = text;
this.updateElementTask(); this.updateElementTask();
this.changeMultiLoopType(this.multiLoopType); this.changeMultiLoopType();
}, },
changeDataType(val) { changeDataType(val) {
if (val === 'ROLES' || val === 'DEPTS' || (val === 'USERS' && this.selectedUser.ids.length > 1)) { if (val === 'ROLES' || val === 'DEPTS' || (val === 'USERS' && this.selectedUser.ids.length > 1)) {
@@ -402,7 +402,8 @@ export default {
} else { } else {
this.showMultiFlog = false; this.showMultiFlog = false;
} }
this.changeMultiLoopType('Null'); this.multiLoopType = 'Null';
this.changeMultiLoopType();
// 清空 userTaskForm 所有属性值 // 清空 userTaskForm 所有属性值
Object.keys(userTaskForm).forEach(key => userTaskForm[key] = null); Object.keys(userTaskForm).forEach(key => userTaskForm[key] = null);
userTaskForm.dataType = val; userTaskForm.dataType = val;
@@ -464,10 +465,9 @@ export default {
} }
} }
}, },
changeMultiLoopType(type) { changeMultiLoopType() {
this.multiLoopType = type;
// 取消多实例配置 // 取消多实例配置
if (type === "Null") { if (this.multiLoopType === "Null") {
window.bpmnInstances.modeling.updateProperties(this.bpmnElement, { loopCharacteristics: null, assignee: null }); window.bpmnInstances.modeling.updateProperties(this.bpmnElement, { loopCharacteristics: null, assignee: null });
return; return;
} }
@@ -480,11 +480,11 @@ export default {
// 完成条件 // 完成条件
let completionCondition = null; let completionCondition = null;
// 会签 // 会签
if (type === "SequentialMultiInstance") { if (this.multiLoopType === "SequentialMultiInstance") {
completionCondition = window.bpmnInstances.moddle.create("bpmn:FormalExpression", { body: "${nrOfCompletedInstances >= nrOfInstances}" }); completionCondition = window.bpmnInstances.moddle.create("bpmn:FormalExpression", { body: "${nrOfCompletedInstances >= nrOfInstances}" });
} }
// 或签 // 或签
if (type === "ParallelMultiInstance") { if (this.multiLoopType === "ParallelMultiInstance") {
completionCondition = window.bpmnInstances.moddle.create("bpmn:FormalExpression", { body: "${nrOfCompletedInstances > 0}" }); completionCondition = window.bpmnInstances.moddle.create("bpmn:FormalExpression", { body: "${nrOfCompletedInstances > 0}" });
} }
// 更新模块属性信息 // 更新模块属性信息