Merge branch 'refs/heads/master' into wsq-20260727

This commit is contained in:
王淑勤
2026-07-29 17:48:50 +08:00
2 changed files with 143 additions and 16 deletions
@@ -62,7 +62,7 @@
<a-form-item v-if="proposal.needDeptScore === '1'" label="部门评议小组打分结果">
平均分{{ proposal.deptAvgScore ?? '-' }}建议奖项{{ awardLabel(proposal.suggestedAward) }}
</a-form-item>
<a-form-item label="负责人确认奖项" required>
<a-form-item label="部门负责人确认奖项" required>
<a-radio-group v-if="leaderAwardBase" v-model:value="leaderFinalAward">
<a-radio v-for="item in leaderAwardOptions" :key="item.value" :value="item.value">{{ item.label }}</a-radio>
</a-radio-group>
@@ -72,7 +72,7 @@
</template>
<template v-if="isTask('Task_improve004')">
<a-form-item label="负责人确认奖项">{{ awardLabel(proposal.leaderFinalAward) }}</a-form-item>
<a-form-item label="申请部门负责人确认奖项">{{ awardLabel(proposal.leaderFinalAward) }}</a-form-item>
<a-form-item label="所级评议人员" required>
<a-checkbox-group v-model:value="selectedInstituteVoterIds" class="vote-member-grid">
<a-checkbox v-for="member in instituteVoteCandidates" :key="member.id" :value="member.id" class="vote-member-option">
@@ -86,20 +86,46 @@
</template>
<template v-if="isTask('Task_improve005')">
<a-form-item label="我的投票">
<a-space v-if="currentVote">
<a-button :type="currentVote.voteResult === 'agree' ? 'primary' : 'default'" :loading="savingVote" @click="confirmInstituteVote('agree')">投票通过</a-button>
<a-button danger :type="currentVote.voteResult === 'disagree' ? 'primary' : 'default'" :loading="savingVote" @click="confirmInstituteVote('disagree')">投票反对</a-button>
<span>{{ voteResultLabel(currentVote) }}</span>
</a-space>
<!-- 投票操作独占整行避免受通用标签列宽影响而视觉偏右 -->
<a-form-item label="我的投票" class="vote-action-form-item" :label-col="{ span: 24 }" :wrapper-col="{ span: 24 }">
<div v-if="currentVote" class="vote-action-panel">
<div class="vote-action-buttons">
<a-button size="large" type="primary" class="vote-action-button" :loading="savingVote" @click="confirmInstituteVote('agree')">投票通过</a-button>
<a-button size="large" danger class="vote-action-button" :type="currentVote.voteResult === 'disagree' ? 'primary' : 'default'" :loading="savingVote" @click="confirmInstituteVote('disagree')">投票反对</a-button>
</div>
<span class="vote-action-status">{{ voteResultLabel(currentVote) }}</span>
</div>
<span v-else class="form-help">当前用户不在所级评议投票名单中</span>
</a-form-item>
</template>
<template v-if="isTask('Task_improve006')">
<a-form-item label="负责人确认奖项">{{ awardLabel(proposal.leaderFinalAward) }}</a-form-item>
<a-form-item label="申请部门负责人确认奖项">{{ awardLabel(proposal.leaderFinalAward) }}</a-form-item>
<a-form-item v-if="proposal.isneedvote === '1'" label="所级评议结果">
同意票{{ proposal.instituteAgreeCount ?? '-' }}不同意票{{ proposal.instituteDisagreeCount ?? '-' }}结果{{ proposal.instituteVoteResult || '-' }}
<div class="institute-vote-summary">
<span class="institute-vote-summary-item institute-vote-total">
<span class="institute-vote-summary-label">总票数</span>
<strong>{{ proposal.instituteTotalVoters ?? '-' }}</strong>
</span>
<span class="institute-vote-summary-item institute-vote-agree">
<span class="institute-vote-summary-label">同意票</span>
<strong>{{ proposal.instituteAgreeCount ?? '-' }}</strong>
</span>
<span class="institute-vote-summary-item institute-vote-disagree">
<span class="institute-vote-summary-label">不同意票</span>
<strong>{{ proposal.instituteDisagreeCount ?? '-' }}</strong>
</span>
<span
class="institute-vote-summary-item institute-vote-result"
:class="{
'is-passed': proposal.instituteVoteResult === '通过',
'is-failed': proposal.instituteVoteResult === '不通过',
}"
>
<span class="institute-vote-summary-label">结果</span>
<strong>{{ proposal.instituteVoteResult || '-' }}</strong>
</span>
</div>
</a-form-item>
<a-form-item label="最终奖项" required>
<a-radio-group v-model:value="finalAward">
@@ -289,7 +315,7 @@
voteRows.value = votes || [];
initialAward.value = proposal.value.initialAward || '';
leaderFinalAward.value = proposal.value.leaderFinalAward || '';
finalAward.value = proposal.value.finalAward || '';
finalAward.value = resolveInitialFinalAward(proposal.value);
if (isTask('Task_improve004') && processInfo.value.processInstanceId && processInfo.value.taskId) {
instituteVoteCandidates.value = await queryInstituteVoteCandidates(processInfo.value);
const candidateIds = new Set(instituteVoteCandidates.value.map((item) => String(item.id)));
@@ -316,6 +342,17 @@
return { ...processInfo.value, ...extra };
}
/**
* 归档节点优先回显已保存的最终奖项;仅首次办理时按所级评议或部门负责人结论预选,
* 金奖所级评议不通过必须由经办人手动确认,不能自动带入任何奖项。
*/
function resolveInitialFinalAward(data: Recordable) {
if (data.finalAward) return String(data.finalAward);
if (!isTask('Task_improve006')) return '';
if (data.isneedvote === '1') return data.instituteVoteResult === '通过' ? '0' : '';
return data.isneedvote === '0' ? String(data.leaderFinalAward || '') : '';
}
async function saveNodeAction() {
try {
if (isTask('Task_improve001')) {
@@ -335,11 +372,11 @@
return false;
}
if (!leaderFinalAward.value) {
createMessage.warning('请选择负责人确认奖项');
createMessage.warning('请选择部门负责人确认奖项');
return false;
}
if (!leaderAwardOptions.value.some((item) => item.value === leaderFinalAward.value)) {
createMessage.warning('负责人确认奖项只能选择当前档位或降档奖项');
createMessage.warning('部门负责人确认奖项只能选择当前档位或降档奖项');
return false;
}
await saveLeaderAward(actionPayload({ leaderFinalAward: leaderFinalAward.value }));
@@ -516,6 +553,81 @@
margin-bottom: 16px;
}
.institute-vote-summary {
display: flex;
flex-wrap: wrap;
gap: 8px 20px;
width: 100%;
}
.institute-vote-summary-item {
display: inline-flex;
align-items: baseline;
gap: 6px;
min-width: 96px;
color: #64748b;
strong {
color: #334155;
font-size: 16px;
}
}
.institute-vote-summary-label {
font-size: 13px;
}
.institute-vote-agree strong {
color: #1677ff;
}
.institute-vote-disagree strong,
.institute-vote-result.is-failed strong {
color: #cf1322;
}
.institute-vote-result.is-passed strong {
color: #389e0d;
}
.vote-action-panel {
display: flex;
flex-direction: column;
align-items: center;
width: 100%;
}
.vote-action-form-item {
:deep(.ant-form-item-label) {
padding-bottom: 8px;
text-align: center;
}
:deep(.ant-form-item-control-input-content) {
width: 100%;
}
}
.vote-action-buttons {
display: grid;
grid-template-columns: repeat(2, minmax(160px, 1fr));
gap: 16px;
width: min(100%, 352px);
}
.vote-action-button {
min-width: 160px;
height: 52px;
font-size: 16px;
}
.vote-action-status {
margin-top: 10px;
color: #64748b;
font-size: 14px;
text-align: center;
}
.vote-member-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
@@ -551,4 +663,19 @@
grid-template-columns: 1fr;
}
}
@media (max-width: 576px) {
.institute-vote-summary-item {
flex: 1 1 120px;
}
.vote-action-buttons {
grid-template-columns: 1fr;
width: min(100%, 280px);
}
.vote-action-button {
width: 100%;
}
}
</style>