From 87bf2d945f0fcd2c9a3229ae7409c9dc84625ae7 Mon Sep 17 00:00:00 2001 From: ye1023 <12588209+ye1023@user.noreply.gitee.com> Date: Thu, 30 Jul 2026 14:42:24 +0800 Subject: [PATCH] =?UTF-8?q?yxk-20260730=20=E6=94=B9=E5=96=84=E6=8F=90?= =?UTF-8?q?=E6=A1=88=20=E5=B0=86=E6=B5=81=E7=A8=8B=E5=8A=9E=E7=90=86?= =?UTF-8?q?=E9=A1=B5=E5=9F=BA=E6=9C=AC=E4=BF=A1=E6=81=AF=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=E2=80=9C=E6=8F=90=E6=A1=88=E7=B1=BB=E5=88=AB=E2=80=9D=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E4=BC=98=E5=85=88=E6=98=BE=E7=A4=BA=E4=B8=8E=E5=8F=B0?= =?UTF-8?q?=E8=B4=A6=E5=88=97=E8=A1=A8=E4=B8=80=E8=87=B4=E7=9A=84=E5=AD=97?= =?UTF-8?q?=E5=85=B8=E6=96=87=E6=9C=AC=EF=BC=8C=E4=B8=8D=E5=86=8D=E7=9B=B4?= =?UTF-8?q?=E6=8E=A5=E5=B1=95=E7=A4=BA=20proposal=5Fcategory=20=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=80=BC=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/ImprovementProposalBPMForm.vue | 68 +++++++++++++++++-- 1 file changed, 63 insertions(+), 5 deletions(-) diff --git a/src/views/gh/improvementProposal/components/ImprovementProposalBPMForm.vue b/src/views/gh/improvementProposal/components/ImprovementProposalBPMForm.vue index 31f7e73..2ff8be8 100644 --- a/src/views/gh/improvementProposal/components/ImprovementProposalBPMForm.vue +++ b/src/views/gh/improvementProposal/components/ImprovementProposalBPMForm.vue @@ -14,7 +14,7 @@ {{ proposal.proposalNo || '-' }} {{ proposal.proposalName || '-' }} {{ formatDate(proposal.proposalDate) }} - {{ proposal.proposalCategory || '-' }} + {{ proposal.proposalCategory_dictText || proposal.proposalCategory || '-' }} {{ proposal.proposalDeptName || '-' }} {{ proposal.applicantName || '-' }} {{ proposal.teamName || '-' }} @@ -239,6 +239,10 @@ +
+ 加权总分 + {{ weightedTotalPreview }} +
保存评分 评分已锁定,请重新提交流程办理 @@ -325,10 +329,18 @@ if (!currentScore.value) return '未保存'; return scoreLocked.value ? '评分已锁定' : '已保存,待流程提交'; }); - const effectAveragePreview = computed(() => { - const values = ['safetyScore', 'qualityScore', 'efficiencyScore', 'costScore'].map((key) => scoreForm.value[key]); - if (values.some((value) => value === undefined || value === null)) return '-'; - return (values.reduce((sum, value) => sum + Number(value), 0) / values.length).toFixed(2); + // 以前端“分”的整数计算,匹配服务端 BigDecimal 在改善效果和总分阶段的两次 HALF_UP 取整。 + const effectScoreCents = computed(() => calculateEffectScoreCents()); + const effectAveragePreview = computed(() => formatScoreCents(effectScoreCents.value)); + const weightedTotalPreview = computed(() => { + const effectCents = effectScoreCents.value; + const promotionCents = getScoreCents(scoreForm.value.promotionScore); + const originalityCents = getScoreCents(scoreForm.value.originalityScore); + const effortCents = getScoreCents(scoreForm.value.effortScore); + if (effectCents === null || promotionCents === null || originalityCents === null || effortCents === null) return '-'; + + const totalCents = Math.round(effectCents * 0.5 + promotionCents * 0.2 + originalityCents * 0.2 + effortCents * 0.1); + return formatScoreCents(totalCents); }); // 部门评分完成后必须以系统建议奖项为基准,不能回退到初审奖项。 const leaderAwardBase = computed(() => { @@ -532,6 +544,22 @@ }; } + function calculateEffectScoreCents(): number | null { + const values = ['safetyScore', 'qualityScore', 'efficiencyScore', 'costScore'].map((key) => getScoreCents(scoreForm.value[key])); + if (values.some((value) => value === null)) return null; + return Math.round((values as number[]).reduce((sum, value) => sum + value, 0) / values.length); + } + + function getScoreCents(value: unknown): number | null { + if (value === undefined || value === null || value === '') return null; + const score = Number(value); + return Number.isFinite(score) ? Math.round(score * 100) : null; + } + + function formatScoreCents(scoreCents: number | null): string { + return scoreCents === null ? '-' : (scoreCents / 100).toFixed(2); + } + function hasValidScoreValues() { return ['safetyScore', 'qualityScore', 'efficiencyScore', 'costScore', 'promotionScore', 'originalityScore', 'effortScore'].every((key) => { const value = scoreForm.value[key]; @@ -757,6 +785,28 @@ } } + .weighted-total-summary { + display: flex; + align-items: baseline; + justify-content: space-between; + gap: 12px; + margin-top: 16px; + padding: 14px 16px; + border-left: 4px solid #1677ff; + background: #e6f4ff; + color: #1f2937; + font-size: 16px; + font-weight: 700; + + strong { + flex: 0 0 auto; + color: #0958d9; + font-size: 28px; + font-weight: 700; + line-height: 1; + } + } + .score-form-actions { display: flex; align-items: center; @@ -888,6 +938,14 @@ gap: 2px; } + .weighted-total-summary { + padding: 12px; + + strong { + font-size: 24px; + } + } + .score-form-actions { justify-content: stretch;