Integrate leave and discipline approval tasks

This commit is contained in:
biss committed 2026-12-01 10:14:54 +08:00
1 parent 167af46687
commit 784b5b76f2
6 files changed
+80 -7

No files matched your search

+14 -3
View File
@@ -91,6 +91,11 @@ const isStudent = computed(
);
const pending = ref<any[]>([]);
const leavePanel = ref<InstanceType<typeof StudentLeavePanel> | null>(null);
async function showLeave(id: string) {
await leavePanel.value?.focusLeave(id);
document.getElementById('student-leave-panel')?.scrollIntoView({ behavior: 'smooth' });
}
const reviewed = ref<any[]>([]);
const reviewedPage = ref(1);
const reviewedTotal = ref(0);
@@ -723,6 +728,8 @@ function approvalLabel(item: any) {
if (item.type === "TeachingImprovement")
return t("approvalCenterExtra.teachingImprovement");
if (item.type === "GraduationClearance") return t("approvalCenterClearance");
if (item.type === "StudentLeave") return attachmentText("学生请假", "Student leave");
if (item.type === "StudentDiscipline") return attachmentText("学生处分", "Student discipline");
const extra: Record<string, string> = {
GradeSubmissionBatch: "gradeBatch",
ExperimentGradeSheet: "experimentGrade",
@@ -791,6 +798,7 @@ function approvalRoute(type: string) {
GradeAppeal: "/grades",
TeachingImprovement: "/evaluations",
GraduationClearance: "/graduation-clearance",
StudentDiscipline: "/student-disciplines",
};
return routes[type];
}
@@ -981,7 +989,7 @@ onMounted(async () => {
</template>
</el-dialog>
<StudentLeavePanel v-if="isStudent || isManager" :student="!!isStudent" :manager="isManager" />
<div id="student-leave-panel"><StudentLeavePanel v-if="isStudent || isManager" ref="leavePanel" :student="!!isStudent" :manager="isManager" @reviewed="load" /></div>
<section v-if="isStudent" v-loading="loading" class="application-launcher">
<button
@@ -1226,7 +1234,7 @@ onMounted(async () => {
$router.push({
path: approvalRoute(item.type),
query:
item.type === 'ClassroomReservation' ? { tab: 'review' } : item.type === 'AssessmentDeclaration' ? { tab: 'reviews' } : item.type === 'AssessmentAppeal' ? { tab: 'appeals' } : {},
item.type === 'StudentDiscipline' ? { id: item.id } : item.type === 'ClassroomReservation' ? { tab: 'review' } : item.type === 'AssessmentDeclaration' ? { tab: 'reviews' } : item.type === 'AssessmentAppeal' ? { tab: 'appeals' } : {},
})
"
>{{ t("approvalBatch.view") }}</el-button
@@ -1249,6 +1257,9 @@ onMounted(async () => {
>{{ t("businessLabels.approve") }}</el-button
>
</div>
<div v-else-if="item.type === 'StudentLeave'" class="appr-actions">
<el-button size="small" text type="primary" @click="showLeave(item.id)">{{ t('approvalBatch.view') }}</el-button>
</div>
<div v-else-if="approvalRoute(item.type)" class="appr-actions">
<el-button
v-if="progressTypes.has(item.type)"
@@ -1266,7 +1277,7 @@ onMounted(async () => {
$router.push({
path: approvalRoute(item.type),
query:
item.type === 'ClassroomReservation' ? { tab: 'review' } : item.type === 'AssessmentDeclaration' ? { tab: 'reviews' } : item.type === 'AssessmentAppeal' ? { tab: 'appeals' } : {},
item.type === 'StudentDiscipline' ? { id: item.id } : item.type === 'ClassroomReservation' ? { tab: 'review' } : item.type === 'AssessmentDeclaration' ? { tab: 'reviews' } : item.type === 'AssessmentAppeal' ? { tab: 'appeals' } : {},
})
"
>
+3 -1
View File
@@ -2,6 +2,7 @@
import CustomExportDialog from '../components/CustomExportDialog.vue'
import { downloadApiFile } from '../api/excel'
import { onMounted, reactive, ref } from 'vue'
import { useRoute } from 'vue-router'
import { ElMessage, ElMessageBox } from 'element-plus'
import http, { apiErrorMessage } from '../api/http'
import { useAuthStore } from '../stores/auth'
@@ -56,7 +57,8 @@ async function transition(next: string) {
await http.post(`/student-disciplines/${selected.value.id}/transition`, { state: next, comment: result.value || null }); ElMessage.success('操作成功'); await load(); await detail(selected.value.id)
} catch (e) { if (e !== 'cancel' && e !== 'close') ElMessage.error(apiErrorMessage(e)) }
}
onMounted(() => { void load(); void loadTypes() })
const route = useRoute()
onMounted(() => { void load(); void loadTypes(); const id = route.query.id; if (typeof id === 'string') void detail(id) })
</script>
<template>