From c4fc82ef4877c51777c23ae1b2ae828ff170afd0 Mon Sep 17 00:00:00 2001 From: ye1023 <12588209+ye1023@user.noreply.gitee.com> Date: Wed, 29 Jul 2026 10:59:04 +0800 Subject: [PATCH] =?UTF-8?q?yxk-20260729=20=E6=94=B9=E5=96=84=E6=8F=90?= =?UTF-8?q?=E6=A1=88=20Task=5Fimprove005=20=E4=B8=8D=E6=98=BE=E7=A4=BA=20T?= =?UTF-8?q?askHandleInnerContent=E3=80=82=E8=AF=84=E5=A7=94=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E2=80=9C=E6=8A=95=E7=A5=A8=E9=80=9A=E8=BF=87=E2=80=9D?= =?UTF-8?q?=E6=88=96=E2=80=9C=E6=8A=95=E7=A5=A8=E5=8F=8D=E5=AF=B9=E2=80=9D?= =?UTF-8?q?=E5=90=8E=E5=BC=B9=E5=87=BA=E7=A1=AE=E8=AE=A4=E6=A1=86=EF=BC=9B?= =?UTF-8?q?=E7=A1=AE=E8=AE=A4=E5=8D=B3=E9=94=81=E5=AE=9A=E4=B8=AA=E4=BA=BA?= =?UTF-8?q?=E6=8A=95=E7=A5=A8=E5=B9=B6=E7=9B=B4=E6=8E=A5=E5=AE=8C=E6=88=90?= =?UTF-8?q?=E5=BD=93=E5=89=8D=E6=B5=81=E7=A8=8B=E4=BB=BB=E5=8A=A1=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/ImprovementProposalBPMForm.vue | 42 ++++++++++--------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/src/views/gh/improvementProposal/components/ImprovementProposalBPMForm.vue b/src/views/gh/improvementProposal/components/ImprovementProposalBPMForm.vue index d52df23..6aaae70 100644 --- a/src/views/gh/improvementProposal/components/ImprovementProposalBPMForm.vue +++ b/src/views/gh/improvementProposal/components/ImprovementProposalBPMForm.vue @@ -88,8 +88,8 @@ + Number(item.value) >= Number(leaderAwardBase.value)); }); const currentVote = computed(() => voteRows.value.find((item) => String(item.voterId) === currentUserId.value)); - const voteLocked = computed(() => currentVote.value?.voteStatus === 'voted'); watch( () => [processInfo.value.mainId, processInfo.value.processInstanceId, processInfo.value.taskId, processInfo.value.taskDefKey], @@ -351,13 +351,6 @@ } await saveInstituteVoteMembers(actionPayload({ voterIds: selectedInstituteVoterIds.value })); } - if (isTask('Task_improve005')) { - if (!currentVote.value?.voteResult) { - createMessage.warning('请先选择投票通过或投票反对'); - return false; - } - await submitInstituteVote(actionPayload()); - } if (isTask('Task_improve006')) { if (!finalAward.value) { createMessage.warning('请选择最终奖项'); @@ -372,14 +365,27 @@ } } - async function saveVoteDraft(voteResult: string) { + function confirmInstituteVote(voteResult: 'agree' | 'disagree') { + const voteLabel = voteResult === 'agree' ? '通过' : '反对'; + createConfirm({ + iconType: 'warning', + title: '确认投票', + content: `确认提交投票${voteLabel}吗?`, + okText: '确认提交', + cancelText: '取消', + onOk: () => submitInstituteVoteAndComplete(voteResult), + }); + } + + async function submitInstituteVoteAndComplete(voteResult: 'agree' | 'disagree') { savingVote.value = true; try { - await castInstituteVote(actionPayload({ voteResult })); - createMessage.success('投票已保存,提交办理前可修改'); - await loadProposal(); + // 后端在锁定投票后复用通用流程办理服务完成当前 Task5 任务。 + await submitInstituteVote(actionPayload({ voteResult })); + createMessage.success('投票提交成功'); + emit('success'); } catch (error: any) { - createMessage.warning(error?.message || '投票失败'); + createMessage.warning(error?.message || '投票提交失败'); } finally { savingVote.value = false; } @@ -444,8 +450,6 @@ function voteResultLabel(vote: Recordable) { if (vote.voteStatus !== 'voted') { - if (vote.voteResult === 'agree') return '已选择投票通过,待提交办理'; - if (vote.voteResult === 'disagree') return '已选择投票反对,待提交办理'; return '待投票'; } return vote.voteResult === 'agree' ? '已投同意票' : '已投不同意票';