yxk-20260729
改善提案 Task_improve005 不显示 TaskHandleInnerContent。评委选择“投票通过”或“投票反对”后弹出确认框;确认即锁定个人投票并直接完成当前流程任务。
This commit is contained in:
@@ -88,8 +88,8 @@
|
|||||||
<template v-if="isTask('Task_improve005')">
|
<template v-if="isTask('Task_improve005')">
|
||||||
<a-form-item label="我的投票">
|
<a-form-item label="我的投票">
|
||||||
<a-space v-if="currentVote">
|
<a-space v-if="currentVote">
|
||||||
<a-button :type="currentVote.voteResult === 'agree' ? 'primary' : 'default'" :disabled="voteLocked" :loading="savingVote" @click="saveVoteDraft('agree')">投票通过</a-button>
|
<a-button :type="currentVote.voteResult === 'agree' ? 'primary' : 'default'" :loading="savingVote" @click="confirmInstituteVote('agree')">投票通过</a-button>
|
||||||
<a-button danger :type="currentVote.voteResult === 'disagree' ? 'primary' : 'default'" :disabled="voteLocked" :loading="savingVote" @click="saveVoteDraft('disagree')">投票反对</a-button>
|
<a-button danger :type="currentVote.voteResult === 'disagree' ? 'primary' : 'default'" :loading="savingVote" @click="confirmInstituteVote('disagree')">投票反对</a-button>
|
||||||
<span>{{ voteResultLabel(currentVote) }}</span>
|
<span>{{ voteResultLabel(currentVote) }}</span>
|
||||||
</a-space>
|
</a-space>
|
||||||
<span v-else class="form-help">当前用户不在所级评议投票名单中。</span>
|
<span v-else class="form-help">当前用户不在所级评议投票名单中。</span>
|
||||||
@@ -109,7 +109,9 @@
|
|||||||
</template>
|
</template>
|
||||||
</a-form>
|
</a-form>
|
||||||
|
|
||||||
|
<!-- 所级投票以“投票即办理”完成,避免通用“同意/退回”与投票结果产生歧义。 -->
|
||||||
<TaskHandleInnerContent
|
<TaskHandleInnerContent
|
||||||
|
v-if="!isTask('Task_improve005')"
|
||||||
:form-data="formData"
|
:form-data="formData"
|
||||||
:claim="claim"
|
:claim="claim"
|
||||||
:before-handle="saveNodeAction"
|
:before-handle="saveNodeAction"
|
||||||
@@ -178,7 +180,6 @@
|
|||||||
import SUploadFile from '/@/components/semri/fileComponent/SUploadFile.vue';
|
import SUploadFile from '/@/components/semri/fileComponent/SUploadFile.vue';
|
||||||
import TaskHandleInnerContent from '/@/views/super/bpm/process/personalOffice/myHandleTask/content/TaskHandleInnerContent.vue';
|
import TaskHandleInnerContent from '/@/views/super/bpm/process/personalOffice/myHandleTask/content/TaskHandleInnerContent.vue';
|
||||||
import {
|
import {
|
||||||
castInstituteVote,
|
|
||||||
queryDataById,
|
queryDataById,
|
||||||
queryInstituteVoteCandidates,
|
queryInstituteVoteCandidates,
|
||||||
queryImprovementInstituteVoteListByMainId,
|
queryImprovementInstituteVoteListByMainId,
|
||||||
@@ -198,7 +199,7 @@
|
|||||||
claim: { type: Boolean, default: false },
|
claim: { type: Boolean, default: false },
|
||||||
});
|
});
|
||||||
const emit = defineEmits(['success', 'claimSuccess']);
|
const emit = defineEmits(['success', 'claimSuccess']);
|
||||||
const { createMessage } = useMessage();
|
const { createMessage, createConfirm } = useMessage();
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const savingScore = ref(false);
|
const savingScore = ref(false);
|
||||||
@@ -257,7 +258,6 @@
|
|||||||
return awardOptions.filter((item) => Number(item.value) >= Number(leaderAwardBase.value));
|
return awardOptions.filter((item) => Number(item.value) >= Number(leaderAwardBase.value));
|
||||||
});
|
});
|
||||||
const currentVote = computed(() => voteRows.value.find((item) => String(item.voterId) === currentUserId.value));
|
const currentVote = computed(() => voteRows.value.find((item) => String(item.voterId) === currentUserId.value));
|
||||||
const voteLocked = computed(() => currentVote.value?.voteStatus === 'voted');
|
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => [processInfo.value.mainId, processInfo.value.processInstanceId, processInfo.value.taskId, processInfo.value.taskDefKey],
|
() => [processInfo.value.mainId, processInfo.value.processInstanceId, processInfo.value.taskId, processInfo.value.taskDefKey],
|
||||||
@@ -351,13 +351,6 @@
|
|||||||
}
|
}
|
||||||
await saveInstituteVoteMembers(actionPayload({ voterIds: selectedInstituteVoterIds.value }));
|
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 (isTask('Task_improve006')) {
|
||||||
if (!finalAward.value) {
|
if (!finalAward.value) {
|
||||||
createMessage.warning('请选择最终奖项');
|
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;
|
savingVote.value = true;
|
||||||
try {
|
try {
|
||||||
await castInstituteVote(actionPayload({ voteResult }));
|
// 后端在锁定投票后复用通用流程办理服务完成当前 Task5 任务。
|
||||||
createMessage.success('投票已保存,提交办理前可修改');
|
await submitInstituteVote(actionPayload({ voteResult }));
|
||||||
await loadProposal();
|
createMessage.success('投票提交成功');
|
||||||
|
emit('success');
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
createMessage.warning(error?.message || '投票失败');
|
createMessage.warning(error?.message || '投票提交失败');
|
||||||
} finally {
|
} finally {
|
||||||
savingVote.value = false;
|
savingVote.value = false;
|
||||||
}
|
}
|
||||||
@@ -444,8 +450,6 @@
|
|||||||
|
|
||||||
function voteResultLabel(vote: Recordable) {
|
function voteResultLabel(vote: Recordable) {
|
||||||
if (vote.voteStatus !== 'voted') {
|
if (vote.voteStatus !== 'voted') {
|
||||||
if (vote.voteResult === 'agree') return '已选择投票通过,待提交办理';
|
|
||||||
if (vote.voteResult === 'disagree') return '已选择投票反对,待提交办理';
|
|
||||||
return '待投票';
|
return '待投票';
|
||||||
}
|
}
|
||||||
return vote.voteResult === 'agree' ? '已投同意票' : '已投不同意票';
|
return vote.voteResult === 'agree' ? '已投同意票' : '已投不同意票';
|
||||||
|
|||||||
Reference in New Issue
Block a user