yxk-20260730

改善提案
将流程办理页基本信息中的“提案类别”改为优先显示与台账列表一致的字典文本,不再直接展示 proposal_category 数据值。
This commit is contained in:
ye1023
2026-07-30 14:42:24 +08:00
parent b228a806f0
commit 87bf2d945f
@@ -14,7 +14,7 @@
<a-descriptions-item label="提案编号">{{ proposal.proposalNo || '-' }}</a-descriptions-item> <a-descriptions-item label="提案编号">{{ proposal.proposalNo || '-' }}</a-descriptions-item>
<a-descriptions-item label="提案名称">{{ proposal.proposalName || '-' }}</a-descriptions-item> <a-descriptions-item label="提案名称">{{ proposal.proposalName || '-' }}</a-descriptions-item>
<a-descriptions-item label="提出日期">{{ formatDate(proposal.proposalDate) }}</a-descriptions-item> <a-descriptions-item label="提出日期">{{ formatDate(proposal.proposalDate) }}</a-descriptions-item>
<a-descriptions-item label="提案类别">{{ proposal.proposalCategory || '-' }}</a-descriptions-item> <a-descriptions-item label="提案类别">{{ proposal.proposalCategory_dictText || proposal.proposalCategory || '-' }}</a-descriptions-item>
<a-descriptions-item label="提案部门">{{ proposal.proposalDeptName || '-' }}</a-descriptions-item> <a-descriptions-item label="提案部门">{{ proposal.proposalDeptName || '-' }}</a-descriptions-item>
<a-descriptions-item label="申请人">{{ proposal.applicantName || '-' }}</a-descriptions-item> <a-descriptions-item label="申请人">{{ proposal.applicantName || '-' }}</a-descriptions-item>
<a-descriptions-item label="团队名称" :span="2">{{ proposal.teamName || '-' }}</a-descriptions-item> <a-descriptions-item label="团队名称" :span="2">{{ proposal.teamName || '-' }}</a-descriptions-item>
@@ -239,6 +239,10 @@
</a-col> </a-col>
</a-row> </a-row>
</div> </div>
<div class="weighted-total-summary">
<span>加权总分</span>
<strong>{{ weightedTotalPreview }}</strong>
</div>
<div class="score-form-actions"> <div class="score-form-actions">
<a-button v-if="!scoreLocked" type="primary" :loading="savingScore" @click="saveScoreDraft">保存评分</a-button> <a-button v-if="!scoreLocked" type="primary" :loading="savingScore" @click="saveScoreDraft">保存评分</a-button>
<span v-else>评分已锁定请重新提交流程办理</span> <span v-else>评分已锁定请重新提交流程办理</span>
@@ -325,10 +329,18 @@
if (!currentScore.value) return '未保存'; if (!currentScore.value) return '未保存';
return scoreLocked.value ? '评分已锁定' : '已保存,待流程提交'; return scoreLocked.value ? '评分已锁定' : '已保存,待流程提交';
}); });
const effectAveragePreview = computed(() => { // 以前端“分”的整数计算,匹配服务端 BigDecimal 在改善效果和总分阶段的两次 HALF_UP 取整。
const values = ['safetyScore', 'qualityScore', 'efficiencyScore', 'costScore'].map((key) => scoreForm.value[key]); const effectScoreCents = computed(() => calculateEffectScoreCents());
if (values.some((value) => value === undefined || value === null)) return '-'; const effectAveragePreview = computed(() => formatScoreCents(effectScoreCents.value));
return (values.reduce((sum, value) => sum + Number(value), 0) / values.length).toFixed(2); 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(() => { 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() { function hasValidScoreValues() {
return ['safetyScore', 'qualityScore', 'efficiencyScore', 'costScore', 'promotionScore', 'originalityScore', 'effortScore'].every((key) => { return ['safetyScore', 'qualityScore', 'efficiencyScore', 'costScore', 'promotionScore', 'originalityScore', 'effortScore'].every((key) => {
const value = scoreForm.value[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 { .score-form-actions {
display: flex; display: flex;
align-items: center; align-items: center;
@@ -888,6 +938,14 @@
gap: 2px; gap: 2px;
} }
.weighted-total-summary {
padding: 12px;
strong {
font-size: 24px;
}
}
.score-form-actions { .score-form-actions {
justify-content: stretch; justify-content: stretch;