Files
hzdyjs/web/src/views/zsjy/enrollmentStatistics/components/StudentDetailDialog.vue
T
2025-07-24 21:03:00 +08:00

324 lines
11 KiB
Vue

<template>
<el-dialog
v-model="dialogVisible"
title="学生报名详情"
width="1000px"
class="student-detail-dialog"
:close-on-click-modal="false"
>
<div class="detail-container">
<!-- 基本信息 -->
<el-card class="detail-card" shadow="never">
<template #header>
<div class="card-header">
<span class="section-title">基本信息</span>
</div>
</template>
<el-descriptions :column="3" border>
<el-descriptions-item label="姓名">{{ studentData.studentName || studentData.name || '-' }}</el-descriptions-item>
<el-descriptions-item label="身份证号">{{ formatIdCard(studentData.idCard) }}</el-descriptions-item>
<el-descriptions-item label="性别">{{ studentData.gender === 'M' ? '男' : '女' }}</el-descriptions-item>
<el-descriptions-item label="出生日期">{{ formatDate(studentData.birthDate) }}</el-descriptions-item>
<el-descriptions-item label="联系电话">{{ studentData.phone1 || '-' }}</el-descriptions-item>
<el-descriptions-item label="备用电话">{{ studentData.phone2 || '-' }}</el-descriptions-item>
<el-descriptions-item label="民族">{{ studentData.nation || '-' }}</el-descriptions-item>
<el-descriptions-item label="是否住宿">{{ studentData.isBoarding === 1 || studentData.isBoarding === '1' ? '是' : '否' }}</el-descriptions-item>
<el-descriptions-item label="健康状况">{{ studentData.healthStatus || '-' }}</el-descriptions-item>
<el-descriptions-item label="家庭住址" :span="3">{{ studentData.homeAddress || '-' }}</el-descriptions-item>
</el-descriptions>
</el-card>
<!-- 学业信息 -->
<el-card class="detail-card" shadow="never">
<template #header>
<div class="card-header">
<span class="section-title">学业信息</span>
</div>
</template>
<el-descriptions :column="3" border>
<el-descriptions-item label="毕业中学">{{ studentData.middleSchool || '-' }}</el-descriptions-item>
<el-descriptions-item label="准考证号">{{ studentData.examNumber || '-' }}</el-descriptions-item>
<el-descriptions-item label="中考地区">{{ studentData.examRegion || studentData.province || '-' }}</el-descriptions-item>
<el-descriptions-item label="中考满分">{{ studentData.totalScoreFull || '-' }}</el-descriptions-item>
<el-descriptions-item label="中考成绩">{{ studentData.totalScore || '-' }}</el-descriptions-item>
<el-descriptions-item label="语文成绩">{{ studentData.chineseScore || '-' }}</el-descriptions-item>
<el-descriptions-item label="数学成绩">{{ studentData.mathScore || '-' }}</el-descriptions-item>
<el-descriptions-item label="英语成绩">{{ studentData.englishScore || '-' }}</el-descriptions-item>
<el-descriptions-item label="科学成绩">{{ studentData.scienceScore || '-' }}</el-descriptions-item>
<el-descriptions-item label="社会成绩">{{ studentData.socialScore || '-' }}</el-descriptions-item>
<el-descriptions-item label="体育成绩">{{ studentData.peScore || '-' }}</el-descriptions-item>
</el-descriptions>
</el-card>
<!-- 报考信息 -->
<el-card class="detail-card" shadow="never">
<template #header>
<div class="card-header">
<span class="section-title">报考信息</span>
</div>
</template>
<el-descriptions :column="2" border>
<el-descriptions-item label="报考专业">{{ studentData.majorName || studentData.appliedMajor || '-' }}</el-descriptions-item>
<el-descriptions-item label="专业代码">{{ studentData.majorCode || '-' }}</el-descriptions-item>
<el-descriptions-item label="校服尺码">{{ studentData.uniformSize || '-' }}</el-descriptions-item>
</el-descriptions>
</el-card>
<!-- 其他信息 -->
<el-card class="detail-card" shadow="never" v-if="studentData.specialties || studentData.awards">
<template #header>
<div class="card-header">
<span class="section-title">其他信息</span>
</div>
</template>
<el-descriptions :column="1" border>
<el-descriptions-item label="特长爱好" v-if="studentData.specialties">{{ studentData.specialties }}</el-descriptions-item>
<el-descriptions-item label="获奖情况" v-if="studentData.awards">{{ studentData.awards }}</el-descriptions-item>
</el-descriptions>
</el-card>
<!-- 录取流程信息 -->
<el-card class="detail-card" shadow="never">
<template #header>
<div class="card-header">
<span class="section-title">录取流程信息</span>
</div>
</template>
<el-descriptions :column="2" border>
<el-descriptions-item label="当前状态">
<el-tag :type="getStatusType(studentData.currentStatus || studentData.enrollmentStatus)">
{{ getStatusText(studentData.currentStatus || studentData.enrollmentStatus) }}
</el-tag>
</el-descriptions-item>
<el-descriptions-item label="处理人">{{ studentData.currentHandlerName || '-' }}</el-descriptions-item>
<el-descriptions-item label="缴费状态">
<span v-if="studentData.paymentStatus === '1'">
<el-tag type="success">已缴费</el-tag>
</span>
<span v-else>
<el-tag type="info">未缴费</el-tag>
</span>
</el-descriptions-item>
<el-descriptions-item label="完成状态">
<span v-if="isStudentCompleted">
<el-tag type="success">已完成</el-tag>
</span>
<span v-else>
<el-tag type="info">未完成</el-tag>
</span>
</el-descriptions-item>
<el-descriptions-item label="报名时间">{{ formatTime(studentData.createTime || studentData.applicationTime) }}</el-descriptions-item>
<el-descriptions-item label="最后更新时间">{{ formatTime(studentData.updateTime) }}</el-descriptions-item>
</el-descriptions>
</el-card>
<!-- 备注信息 -->
<el-card class="detail-card" shadow="never" v-if="studentData.remark">
<template #header>
<div class="card-header">
<span class="section-title">备注信息</span>
</div>
</template>
<div class="remark-content">
{{ studentData.remark }}
</div>
</el-card>
</div>
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogVisible = false">关闭</el-button>
</span>
</template>
</el-dialog>
</template>
<script setup lang="ts">
import { ref, computed } from 'vue';
import type { EnrollmentProcessVO } from '@/api/zsjy/enrollmentProcess';
import type { EnrollmentInfoVO } from '@/api/zsjy/enrollment/types';
// 合并类型,处理可能存在的字段
type StudentDataType = Partial<EnrollmentProcessVO> & Partial<EnrollmentInfoVO> & {
// 额外可能存在的字段
studentName?: string;
majorName?: string;
province?: string;
}
const props = defineProps({
visible: {
type: Boolean,
default: false
},
studentData: {
type: Object as () => StudentDataType,
default: () => ({})
}
});
const emit = defineEmits(['update:visible']);
// 对话框可见性
const dialogVisible = computed({
get: () => props.visible,
set: (value) => {
emit('update:visible', value);
}
});
// 判断学生是否已完成
const isStudentCompleted = computed(() => {
const isCompleted = props.studentData.isCompleted;
// 显式检查字符串和数字类型的值
return String(isCompleted) === '1';
});
// 格式化身份证号(隐藏中间部分)
const formatIdCard = (idCard: string | undefined) => {
if (!idCard) return '-';
if (idCard.length >= 18) {
return idCard.substring(0, 6) + '********' + idCard.substring(14);
}
return idCard;
};
// 格式化日期
const formatDate = (date: string | Date | undefined) => {
if (!date) return '-';
const d = new Date(date);
return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-${String(d.getDate()).padStart(2, '0')}`;
};
// 格式化时间
const formatTime = (time: string | Date | undefined) => {
if (!time) return '-';
const date = new Date(time);
return date.toLocaleString('zh-CN', {
year: 'numeric',
month: '2-digit',
day: '2-digit',
hour: '2-digit',
minute: '2-digit',
second: '2-digit'
});
};
// 获取状态类型
const getStatusType = (status: string | undefined) => {
if (!status) return 'info';
switch (status) {
case '0': return 'info'; // 待审核
case '1': return 'warning'; // 信息审核中
case '2': return 'warning'; // 录取处理中
case '3': return 'warning'; // 待最终确认
case '4': return 'success'; // 录取完成
case '9': return 'danger'; // 已驳回
default: return 'info';
}
};
// 获取状态文本
const getStatusText = (status: string | undefined) => {
if (!status) return '未知状态';
switch (status) {
case '0': return '待审核';
case '1': return '信息审核中';
case '2': return '录取处理中';
case '3': return '待最终确认';
case '4': return '录取完成';
case '9': return '已驳回';
default: return '未知状态';
}
};
</script>
<style scoped>
.student-detail-dialog :deep(.el-dialog__header) {
background: linear-gradient(135deg, rgb(93, 135, 255) 0%, rgb(73, 190, 255) 100%);
color: white;
padding: 20px 24px;
margin: 0;
}
.student-detail-dialog :deep(.el-dialog__title) {
color: white;
font-size: 18px;
font-weight: 600;
}
.student-detail-dialog :deep(.el-dialog__body) {
padding: 20px 24px;
}
.detail-container {
max-height: 70vh;
overflow-y: auto;
padding-right: 5px;
}
.detail-card {
margin-bottom: 16px;
border-radius: 8px;
}
.detail-card:last-child {
margin-bottom: 0;
}
.card-header {
display: flex;
justify-content: space-between;
align-items: center;
}
.section-title {
font-size: 16px;
font-weight: 600;
position: relative;
padding-left: 10px;
}
.section-title::before {
content: '';
width: 3px;
height: 16px;
background: linear-gradient(135deg, rgb(93, 135, 255), rgb(73, 190, 255));
border-radius: 2px;
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
}
.remark-content {
background-color: #f8f9fa;
padding: 12px;
border-radius: 4px;
border-left: 3px solid #409eff;
}
:deep(.el-descriptions__label) {
width: 120px;
background-color: #f7f7f7 !important;
}
/* 美化滚动条 */
.detail-container::-webkit-scrollbar {
width: 6px;
height: 6px;
}
.detail-container::-webkit-scrollbar-thumb {
border-radius: 3px;
background-color: #c0c4cc;
}
.detail-container::-webkit-scrollbar-track {
border-radius: 3px;
background-color: #f2f2f2;
}
</style>