Show recorded approval progress

This commit is contained in:
biss committed 2026-11-07 20:27:41 +08:00
1 parent 88ef93022d
commit 75f1751629
6 files changed
+165 -1

No files matched your search

+1
View File
@@ -1,4 +1,5 @@
export default {
approvalProgress: { title: 'Progress', submitted: 'Submitted', approved: 'Approved', rejected: 'Rejected', collegeApproved: 'College review approved', collegeRejected: 'College review rejected', finalApproved: 'Final review approved', finalRejected: 'Final review rejected' },
approvalCenterAdjustment: 'Class adjustment',
approvalCenterClearance: 'Graduation clearance',
approvalCenterCounselorStage: 'Counselor review',
+1
View File
@@ -1,4 +1,5 @@
export default {
approvalProgress: { title: '办理进度', submitted: '已提交', approved: '审核通过', rejected: '审核驳回', collegeApproved: '学院审核通过', collegeRejected: '学院审核驳回', finalApproved: '校级审核通过', finalRejected: '校级审核驳回' },
approvalCenterAdjustment: '调停课',
approvalCenterClearance: '毕业离校办理',
approvalCenterCounselorStage: '辅导员审核',
+40
View File
@@ -92,6 +92,10 @@ const reviewInProgress = ref(false)
const workflowDialog = ref(false)
const workflowSettings = ref<{ type: string; reviewerRole: string }[]>([])
const workflowSaving = ref('')
const progressDialog = ref(false)
const progressSteps = ref<{ kind: string; time: string; comment?: string | null }[]>([])
const progressType = ref('')
const progressTypes = new Set(['CourseExemption', 'DeferredExam', 'CourseSubstitution', 'GradeModification'])
const enrolledCourses = ref<CourseOption[]>([])
const gradeRecords = ref<any[]>([])
@@ -337,6 +341,24 @@ async function openWorkflowSettings() {
} catch (e) { ElMessage.error(apiErrorMessage(e)) }
}
async function openProgress(type: string, id: string) {
try {
const { data } = await http.get(`/approvals/progress/${type}/${id}`)
progressType.value = type
progressSteps.value = data.steps
progressDialog.value = true
} catch (e) { ElMessage.error(apiErrorMessage(e)) }
}
function progressLabel(kind: string) {
const labels: Record<string, string> = {
submitted: 'submitted', approved: 'approved', rejected: 'rejected',
collegeApproved: 'collegeApproved', collegeRejected: 'collegeRejected',
finalApproved: 'finalApproved', finalRejected: 'finalRejected',
}
return t(`approvalProgress.${labels[kind] ?? 'submitted'}`)
}
async function saveWorkflowSetting(setting: { type: string; reviewerRole: string }) {
workflowSaving.value = setting.type
try {
@@ -506,6 +528,16 @@ onMounted(() => {
</div>
</el-dialog>
<el-dialog v-model="progressDialog" :title="`${approvalLabel({ type: progressType })} · ${t('approvalProgress.title')}`" width="min(520px, 95vw)">
<ol class="approval-progress">
<li v-for="(step, index) in progressSteps" :key="index">
<strong>{{ progressLabel(step.kind) }}</strong>
<time>{{ new Date(step.time).toLocaleString(getDisplayLocale()) }}</time>
<p v-if="step.comment">{{ step.comment }}</p>
</li>
</ol>
</el-dialog>
<section v-if="isStudent" v-loading="loading" class="application-launcher">
<button class="launch-card exemption" type="button" @click="openDialog('exemption')">
<span class="launch-icon"><DocumentChecked /></span>
@@ -585,6 +617,7 @@ onMounted(() => {
<small>{{ item.college }} · {{ new Date(item.time).toLocaleString(getDisplayLocale()) }}<template v-if="item.stage"> · {{ approvalStageLabel(item.stage) }}</template></small>
</div>
<div v-if="isActionable(item)" class="appr-actions">
<el-button v-if="progressTypes.has(item.type)" size="small" text type="primary" @click="openProgress(item.type, item.id)">{{ t('approvalProgress.title') }}</el-button>
<el-button v-if="approvalRoute(item.type)" size="small" text type="primary" @click="$router.push({ path: approvalRoute(item.type), query: item.type === 'ClassroomReservation' ? { tab: 'review' } : {} })">{{ t('approvalBatch.k76') }}</el-button>
<el-button size="small" type="danger" plain :disabled="reviewInProgress" :icon="Close" @click="openReject(item)">{{ t('businessLabels.reject') }}</el-button>
<el-button size="small" type="success" :disabled="reviewInProgress" :icon="Check" @click="approveItem(item)">{{ t('businessLabels.approve') }}</el-button>
@@ -625,6 +658,7 @@ onMounted(() => {
<p>{{ item.reason }}</p>
<small v-if="item.reviewComment">{{ t('approvalBatch.k77', { comment: item.reviewComment }) }}</small>
</div>
<el-button size="small" text type="primary" @click="openProgress('CourseExemption', item.id)">{{ t('approvalProgress.title') }}</el-button>
</article>
<p v-if="!myExemptions.length" class="record-empty">{{ t('approvalBatch.k33') }}</p>
</div>
@@ -639,6 +673,7 @@ onMounted(() => {
<p>{{ item.reason }}</p>
<small v-if="item.reviewComment">{{ t('approvalBatch.k77', { comment: item.reviewComment }) }}</small>
</div>
<el-button size="small" text type="primary" @click="openProgress('DeferredExam', item.id)">{{ t('approvalProgress.title') }}</el-button>
</article>
<p v-if="!myDeferred.length" class="record-empty">{{ t('approvalBatch.k35') }}</p>
</div>
@@ -653,6 +688,7 @@ onMounted(() => {
<p>{{ item.reason }}</p>
<small v-if="item.reviewComment">{{ t('approvalBatch.k77', { comment: item.reviewComment }) }}</small>
</div>
<el-button size="small" text type="primary" @click="openProgress('CourseSubstitution', item.id)">{{ t('approvalProgress.title') }}</el-button>
</article>
<p v-if="!mySubstitutions.length" class="record-empty">{{ t('approvalBatch.k37') }}</p>
</div>
@@ -882,6 +918,10 @@ onMounted(() => {
.approval-monitor { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 12px 16px; color: #475467; background: #f3f6fb; border-radius: 10px; font-size: 13px; }
.approval-monitor .el-switch { margin-left: auto; }
.approval-monitor-counts { display: flex; flex-basis: 100%; flex-wrap: wrap; gap: 6px; }
.approval-progress { display: grid; gap: 18px; padding-left: 24px; }
.approval-progress li { padding-left: 4px; }
.approval-progress time { display: block; margin-top: 4px; color: #667085; font-size: 12px; }
.approval-progress p { margin: 6px 0 0; white-space: pre-wrap; }
.workflow-setting-row { display: grid; grid-template-columns: 1fr 1.5fr auto; gap: 12px; align-items: center; margin: 12px 0; }
.appr-card { display: flex; align-items: center; gap: 14px; padding: 14px 18px; background: #fff; border: 1px solid #e4e7ed; border-radius: 10px; }
.appr-card.compact { align-items: flex-start; padding: 13px; }