From cab9553235650f73ac878f08721535b946d3699f Mon Sep 17 00:00:00 2001 From: jason <2667446@qq.com> Date: Thu, 13 Jun 2024 08:24:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=BF=E9=92=89=E9=92=89=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=20-=E4=BC=9A=E7=AD=BE=E6=8C=89?= =?UTF-8?q?=E9=80=9A=E8=BF=87=E6=AF=94=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SimpleProcessDesignerV2/src/consts.ts | 4 +- .../src/nodes-config/UserTaskNodeConfig.vue | 43 +++++++++++++------ 2 files changed, 33 insertions(+), 14 deletions(-) diff --git a/src/components/SimpleProcessDesignerV2/src/consts.ts b/src/components/SimpleProcessDesignerV2/src/consts.ts index a3638415..575bfa3f 100644 --- a/src/components/SimpleProcessDesignerV2/src/consts.ts +++ b/src/components/SimpleProcessDesignerV2/src/consts.ts @@ -108,7 +108,7 @@ export enum ApproveMethodType { */ ALL_APPROVE = 2, /** - * 多人会签(按比例投票) + * 多人会签(按通过比例) */ APPROVE_BY_RATIO = 3, /** @@ -218,7 +218,7 @@ NODE_DEFAULT_NAME.set(NodeType.CONDITION_NODE, '条件') export const APPROVE_METHODS: DictDataVO [] = [ { label: '单人审批', value: ApproveMethodType.SINGLE_PERSON_APPROVE }, { label: '多人会签(需所有审批人同意)', value: ApproveMethodType.ALL_APPROVE }, - // { label: '多人会签(按比例投票)', value: ApproveMethodType.APPROVE_BY_RATIO }, + { label: '多人会签(按通过比例%)', value: ApproveMethodType.APPROVE_BY_RATIO }, { label: '多人会签(通过只需一人,拒绝需要全员)', value: ApproveMethodType.ANY_APPROVE_ALL_REJECT }, { label: '多人或签(一名审批人通过即可)', value: ApproveMethodType.ANY_APPROVE }, { label: '依次审批(按顺序依次审批)', value: ApproveMethodType.SEQUENTIAL_APPROVE } diff --git a/src/components/SimpleProcessDesignerV2/src/nodes-config/UserTaskNodeConfig.vue b/src/components/SimpleProcessDesignerV2/src/nodes-config/UserTaskNodeConfig.vue index 71fb5411..65af2755 100644 --- a/src/components/SimpleProcessDesignerV2/src/nodes-config/UserTaskNodeConfig.vue +++ b/src/components/SimpleProcessDesignerV2/src/nodes-config/UserTaskNodeConfig.vue @@ -149,7 +149,7 @@ @change="approveMethodChanged" >
-
+
{{ item.label }} +
@@ -175,6 +183,7 @@ :label="item.label" :disabled="rejectHandlerOptionDisabled(item.value)" /> +
@@ -512,6 +521,7 @@ const changedCandidateUsers = () => { currentNode.value.attributes?.candidateStrategy === CandidateStrategy.USER ) { currentNode.value.attributes.approveMethod = ApproveMethodType.SINGLE_PERSON_APPROVE + currentNode.value.attributes.rejectHandler.type = RejectHandlerType.FINISH_PROCESS notAllowedMultiApprovers.value = true } else { notAllowedMultiApprovers.value = false @@ -530,26 +540,35 @@ const blurEvent = () => { currentNode.value.name || (NODE_DEFAULT_NAME.get(NodeType.USER_TASK_NODE) as string) } const approveMethodChanged = () => { - const approveMethod = currentNode.value.attributes?.approveMethod - if (approveMethod === ApproveMethodType.ANY_APPROVE_ALL_REJECT || approveMethod === ApproveMethodType.APPROVE_BY_RATIO) { - currentNode.value.attributes.rejectHandler.type =RejectHandlerType.FINISH_PROCESS_BY_REJECT_RATIO + const approveMethod = currentNode.value.attributes?.approveMethod + if ( approveMethod === ApproveMethodType.ANY_APPROVE_ALL_REJECT || approveMethod === ApproveMethodType.APPROVE_BY_RATIO) { + currentNode.value.attributes.rejectHandler.type = + RejectHandlerType.FINISH_PROCESS_BY_REJECT_RATIO } else { currentNode.value.attributes.rejectHandler.type = RejectHandlerType.FINISH_PROCESS } + + if (approveMethod === ApproveMethodType.APPROVE_BY_RATIO) { + currentNode.value.attributes.approveRatio = 50; + } } const rejectHandlerOptionDisabled = computed(() => { return (val: number) => { - const approveMethod = currentNode.value.attributes?.approveMethod - if (val === RejectHandlerType.FINISH_PROCESS_BY_REJECT_RATIO && approveMethod !== ApproveMethodType.APPROVE_BY_RATIO - && approveMethod !== ApproveMethodType.ANY_APPROVE_ALL_REJECT) { - return true - } - if ( approveMethod === ApproveMethodType.ANY_APPROVE_ALL_REJECT && - val === RejectHandlerType.FINISH_PROCESS + const approveMethod = currentNode.value.attributes?.approveMethod + if ( + val === RejectHandlerType.FINISH_PROCESS_BY_REJECT_RATIO && + approveMethod !== ApproveMethodType.APPROVE_BY_RATIO && + approveMethod !== ApproveMethodType.ANY_APPROVE_ALL_REJECT ) { return true } - + if ( + approveMethod === ApproveMethodType.ANY_APPROVE_ALL_REJECT && + val === RejectHandlerType.FINISH_PROCESS + ) { + return true + } + return false } })