This commit is contained in:
parent
18be83519d
commit
0490b88cc7
|
|
@ -1,4 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings" defaultProject="true" />
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 学生注册状态列表
|
||||
export function stuRegistrationLists(params?: Record<string, any>) {
|
||||
return request.get({ url: '/stuRegistration/list', params })
|
||||
}
|
||||
|
||||
// 学生待录取状态列表
|
||||
export function stuRegistrationAdmissionLists(params?: Record<string, any>) {
|
||||
return request.get({ url: '/stuRegistration/list.admission', params })
|
||||
}
|
||||
|
||||
// 学生待入学状态列表
|
||||
export function stuRegistrationEnrollmentLists(params?: Record<string, any>) {
|
||||
return request.get({ url: '/stuRegistration/list.enrollment', params })
|
||||
}
|
||||
|
||||
// 学生待缴费状态列表
|
||||
export function stuRegistrationPaymentLists(params?: Record<string, any>) {
|
||||
return request.get({ url: '/stuRegistration/list.payment', params })
|
||||
}
|
||||
|
||||
// 学生待审核状态列表
|
||||
export function stuRegistrationRegistrationLists(params?: Record<string, any>) {
|
||||
return request.get({ url: '/stuRegistration/list.registration', params })
|
||||
}
|
||||
|
||||
// 学生注册状态详情
|
||||
export function stuRegistrationDetail(params: Record<string, any>) {
|
||||
return request.get({ url: '/stuRegistration/detail', params })
|
||||
}
|
||||
|
||||
// 学生注册状态新增
|
||||
export function stuRegistrationAdd(params: Record<string, any>) {
|
||||
return request.post({ url: '/stuRegistration/add', params })
|
||||
}
|
||||
|
||||
// 学生注册状态编辑
|
||||
export function stuRegistrationEdit(params: Record<string, any>) {
|
||||
return request.post({ url: '/stuRegistration/edit', params })
|
||||
}
|
||||
|
||||
// 学生注册状态删除
|
||||
export function stuRegistrationDelete(params: Record<string, any>) {
|
||||
return request.post({ url: '/stuRegistration/del', params })
|
||||
}
|
||||
|
|
@ -0,0 +1,263 @@
|
|||
<template>
|
||||
<div class="edit-popup">
|
||||
<popup
|
||||
ref="popupRef"
|
||||
:title="popupTitle"
|
||||
:async="true"
|
||||
width="550px"
|
||||
:clickModalClose="true"
|
||||
@confirm="handleSubmit"
|
||||
@close="handleClose"
|
||||
>
|
||||
<el-form ref="formRef" :model="formData" label-width="84px" :rules="formRules">
|
||||
<el-form-item label="报名编号" prop="applicationNumber">
|
||||
<el-input v-model="formData.applicationNumber" placeholder="请输入报名编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="邀请码" prop="invitationCode">
|
||||
<el-input v-model="formData.invitationCode" placeholder="请输入邀请码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="录取状态" prop="admissionStatus">
|
||||
<el-radio-group v-model="formData.admissionStatus" placeholder="请选择录取状态">
|
||||
<el-radio :label="0">待审核</el-radio>
|
||||
<el-radio :label="1">已录取</el-radio>
|
||||
<el-radio :label="2">未录取</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="缴费状态" prop="paymentStatus">
|
||||
<el-radio-group v-model="formData.paymentStatus" placeholder="请选择缴费状态">
|
||||
<el-radio :label="0">未缴费</el-radio>
|
||||
<el-radio :label="1">已缴费</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="入学状态" prop="registrationStatus">
|
||||
<el-radio-group
|
||||
v-model="formData.registrationStatus"
|
||||
placeholder="请选择入学状态"
|
||||
>
|
||||
<el-radio :label="0">未入学</el-radio>
|
||||
<el-radio :label="1">已入学</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="审核状态" prop="approvalStatus">
|
||||
<el-radio-group v-model="formData.approvalStatus" placeholder="请选择审核状态">
|
||||
<el-radio :label="0">待审核</el-radio>
|
||||
<el-radio :label="1">审核通过</el-radio>
|
||||
<el-radio :label="2">审核不通过</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="拒绝原因" prop="rejectionReason">
|
||||
<el-input
|
||||
v-model="formData.rejectionReason"
|
||||
placeholder="请输入拒绝原因"
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 4, maxRows: 6 }"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="报名时间" prop="applicationTime">
|
||||
<el-date-picker
|
||||
class="flex-1 !flex"
|
||||
v-model="formData.applicationTime"
|
||||
type="datetime"
|
||||
clearable
|
||||
value-format="YYYY-MM-DD hh:mm:ss"
|
||||
placeholder="请选择报名时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="录取时间" prop="admissionTime">
|
||||
<el-date-picker
|
||||
class="flex-1 !flex"
|
||||
v-model="formData.admissionTime"
|
||||
type="datetime"
|
||||
clearable
|
||||
value-format="YYYY-MM-DD hh:mm:ss"
|
||||
placeholder="请选择录取时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="缴费时间" prop="paymentTime">
|
||||
<el-date-picker
|
||||
class="flex-1 !flex"
|
||||
v-model="formData.paymentTime"
|
||||
type="datetime"
|
||||
clearable
|
||||
value-format="YYYY-MM-DD hh:mm:ss"
|
||||
placeholder="请选择缴费时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="入学登记时间" prop="registrationTime">
|
||||
<el-date-picker
|
||||
class="flex-1 !flex"
|
||||
v-model="formData.registrationTime"
|
||||
type="datetime"
|
||||
clearable
|
||||
value-format="YYYY-MM-DD hh:mm:ss"
|
||||
placeholder="请选择入学登记时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import type { PropType } from 'vue'
|
||||
|
||||
import {
|
||||
stuRegistrationAdd,
|
||||
stuRegistrationDetail,
|
||||
stuRegistrationEdit
|
||||
} from '@/api/stuRegistration'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import feedback from '@/utils/feedback'
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const mode = ref('add')
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑学生注册状态' : '新增学生注册状态'
|
||||
})
|
||||
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
userId: '',
|
||||
baseInfoId: '',
|
||||
applicationNumber: '',
|
||||
invitationCode: '',
|
||||
intendedCollegeId: '',
|
||||
intendedMajorId: '',
|
||||
admissionStatus: '',
|
||||
paymentStatus: '',
|
||||
registrationStatus: '',
|
||||
approvalStatus: '',
|
||||
rejectionReason: '',
|
||||
applicationTime: '',
|
||||
admissionTime: '',
|
||||
paymentTime: '',
|
||||
registrationTime: ''
|
||||
})
|
||||
|
||||
const formRules = {
|
||||
id: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入主键ID',
|
||||
trigger: ['blur']
|
||||
}
|
||||
],
|
||||
userId: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入用户ID',
|
||||
trigger: ['blur']
|
||||
}
|
||||
],
|
||||
baseInfoId: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入关联基本信息ID',
|
||||
trigger: ['blur']
|
||||
}
|
||||
],
|
||||
applicationNumber: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入报名编号',
|
||||
trigger: ['blur']
|
||||
}
|
||||
],
|
||||
intendedCollegeId: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入意向学院ID',
|
||||
trigger: ['blur']
|
||||
}
|
||||
],
|
||||
intendedMajorId: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入意向专业ID',
|
||||
trigger: ['blur']
|
||||
}
|
||||
],
|
||||
admissionStatus: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择录取状态:0-待审核 1-已录取 2-未录取',
|
||||
trigger: ['blur']
|
||||
}
|
||||
],
|
||||
paymentStatus: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择缴费状态:0-未缴费 1-部分缴费 2-已缴费',
|
||||
trigger: ['blur']
|
||||
}
|
||||
],
|
||||
registrationStatus: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择入学状态:0-未入学 1-已入学',
|
||||
trigger: ['blur']
|
||||
}
|
||||
],
|
||||
approvalStatus: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择审核状态:0-待审核 1-审核通过 2-审核不通过',
|
||||
trigger: ['blur']
|
||||
}
|
||||
],
|
||||
applicationTime: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择报名时间',
|
||||
trigger: ['blur']
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate()
|
||||
const data: any = { ...formData }
|
||||
mode.value == 'edit' ? await stuRegistrationEdit(data) : await stuRegistrationAdd(data)
|
||||
popupRef.value?.close()
|
||||
feedback.msgSuccess('操作成功')
|
||||
emit('success')
|
||||
}
|
||||
|
||||
const open = (type = 'add') => {
|
||||
mode.value = type
|
||||
popupRef.value?.open()
|
||||
}
|
||||
|
||||
const setFormData = async (data: Record<string, any>) => {
|
||||
for (const key in formData) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await stuRegistrationDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
||||
|
|
@ -0,0 +1,232 @@
|
|||
<template>
|
||||
<div class="index-lists">
|
||||
<el-card class="!border-none" shadow="never">
|
||||
<el-form ref="formRef" class="mb-[-16px]" :model="queryParams" :inline="true">
|
||||
<el-form-item label="报名编号" prop="applicationNumber">
|
||||
<el-input class="w-[280px]" v-model="queryParams.applicationNumber" />
|
||||
</el-form-item>
|
||||
<el-form-item label="邀请码" prop="invitationCode">
|
||||
<el-input class="w-[280px]" v-model="queryParams.invitationCode" />
|
||||
</el-form-item>
|
||||
<el-form-item label="录取状态" prop="admissionStatus">
|
||||
<el-select v-model="queryParams.admissionStatus" class="w-[280px]" clearable>
|
||||
<el-option label="待审核" :value="0" />
|
||||
<el-option label="已录取" :value="1" />
|
||||
<el-option label="未录取" :value="2" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="缴费状态" prop="paymentStatus">
|
||||
<el-select v-model="queryParams.paymentStatus" class="w-[280px]" clearable>
|
||||
<el-option label="未缴费" :value="0" />
|
||||
<el-option label="已缴费" :value="1" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="入学状态" prop="registrationStatus">
|
||||
<el-select v-model="queryParams.registrationStatus" class="w-[280px]" clearable>
|
||||
<el-option label="未入学" :value="0" />
|
||||
<el-option label="已入学" :value="1" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="审核状态" prop="approvalStatus">
|
||||
<el-select v-model="queryParams.approvalStatus" class="w-[280px]" clearable>
|
||||
<el-option label="待审核" :value="0" />
|
||||
<el-option label="审核通过" :value="1" />
|
||||
<el-option label="审核不通过" :value="2" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="报名时间" prop="applicationTime">
|
||||
<daterange-picker
|
||||
v-model:startTime="queryParams.applicationTimeStart"
|
||||
v-model:endTime="queryParams.applicationTimeEnd"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="录取时间" prop="admissionTime">
|
||||
<daterange-picker
|
||||
v-model:startTime="queryParams.admissionTimeStart"
|
||||
v-model:endTime="queryParams.admissionTimeEnd"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="缴费时间" prop="paymentTime">
|
||||
<daterange-picker
|
||||
v-model:startTime="queryParams.paymentTimeStart"
|
||||
v-model:endTime="queryParams.paymentTimeEnd"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="入学登记时间" prop="registrationTime">
|
||||
<daterange-picker
|
||||
v-model:startTime="queryParams.registrationTimeStart"
|
||||
v-model:endTime="queryParams.registrationTimeEnd"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none mt-4" shadow="never">
|
||||
<div>
|
||||
<el-button v-perms="['stuRegistration/add']" type="primary" @click="handleAdd()">
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<el-form-item
|
||||
v-perms="['stuRegistration/list']"
|
||||
class="ml-4"
|
||||
label="当前权限:ALL"
|
||||
/>
|
||||
<el-form-item
|
||||
v-perms="['stuRegistration/list.admission']"
|
||||
class="ml-4"
|
||||
label="当前权限:录取管理"
|
||||
/>
|
||||
<el-form-item
|
||||
v-perms="['stuRegistration/list.enrollment']"
|
||||
class="ml-4"
|
||||
label="当前权限:入学管理"
|
||||
/>
|
||||
<el-form-item
|
||||
v-perms="['stuRegistration/list.payment']"
|
||||
class="ml-4"
|
||||
label="当前权限:缴费管理"
|
||||
/>
|
||||
<el-form-item
|
||||
v-perms="['stuRegistration/list.registration']"
|
||||
class="ml-4"
|
||||
label="当前权限:审核管理"
|
||||
/>
|
||||
</div>
|
||||
<el-table class="mt-4" size="large" v-loading="pager.loading" :data="pager.lists">
|
||||
<el-table-column label="用户ID" prop="userId" min-width="100" />
|
||||
<el-table-column label="关联基本信息ID" prop="baseInfoId" min-width="100" />
|
||||
<el-table-column label="报名编号" prop="applicationNumber" min-width="100" />
|
||||
<el-table-column label="邀请码" prop="invitationCode" min-width="100" />
|
||||
<el-table-column label="意向学院ID" prop="intendedCollegeId" min-width="100" />
|
||||
<el-table-column label="意向专业ID" prop="intendedMajorId" min-width="100" />
|
||||
<el-table-column label="录取状态" prop="admissionStatus" min-width="100" />
|
||||
<el-table-column label="缴费状态" prop="paymentStatus" min-width="100" />
|
||||
<el-table-column label="入学状态" prop="registrationStatus" min-width="100" />
|
||||
<el-table-column label="审核状态" prop="approvalStatus" min-width="100" />
|
||||
<el-table-column label="审核人ID" prop="approvedBy" min-width="100" />
|
||||
<el-table-column label="审核时间" prop="approvedTime" min-width="100" />
|
||||
<el-table-column label="拒绝原因" prop="rejectionReason" min-width="100" />
|
||||
<el-table-column label="报名时间" prop="applicationTime" min-width="100" />
|
||||
<el-table-column label="录取时间" prop="admissionTime" min-width="100" />
|
||||
<el-table-column label="缴费时间" prop="paymentTime" min-width="100" />
|
||||
<el-table-column label="入学登记时间" prop="registrationTime" min-width="100" />
|
||||
<el-table-column label="创建时间" prop="createTime" min-width="100" />
|
||||
<el-table-column label="更新时间" prop="updateTime" min-width="100" />
|
||||
<el-table-column label="操作" width="120" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
v-perms="['stuRegistration/edit']"
|
||||
type="primary"
|
||||
link
|
||||
@click="handleEdit(row)"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
v-perms="['stuRegistration/del']"
|
||||
type="danger"
|
||||
link
|
||||
@click="handleDelete(row.id)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="flex justify-end mt-4">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
<edit-popup v-if="showEdit" ref="editRef" @success="getLists" @close="showEdit = false" />
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup name="stuRegistration">
|
||||
import {
|
||||
stuRegistrationAdmissionLists,
|
||||
stuRegistrationDelete,
|
||||
stuRegistrationEnrollmentLists,
|
||||
stuRegistrationLists,
|
||||
stuRegistrationPaymentLists,
|
||||
stuRegistrationRegistrationLists
|
||||
} from '@/api/stuRegistration'
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import useUserStore from '@/stores/modules/user'
|
||||
import feedback from '@/utils/feedback'
|
||||
|
||||
import EditPopup from './edit.vue'
|
||||
const userStore = useUserStore()
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
||||
const showEdit = ref(false)
|
||||
const queryParams = reactive({
|
||||
userId: '',
|
||||
baseInfoId: '',
|
||||
applicationNumber: '',
|
||||
invitationCode: '',
|
||||
intendedCollegeId: '',
|
||||
intendedMajorId: '',
|
||||
admissionStatus: '',
|
||||
paymentStatus: '',
|
||||
registrationStatus: '',
|
||||
approvalStatus: '',
|
||||
approvedBy: '',
|
||||
applicationTimeStart: '',
|
||||
applicationTimeEnd: '',
|
||||
admissionTimeStart: '',
|
||||
admissionTimeEnd: '',
|
||||
paymentTimeStart: '',
|
||||
paymentTimeEnd: '',
|
||||
registrationTimeStart: '',
|
||||
registrationTimeEnd: ''
|
||||
})
|
||||
|
||||
// 根据权限选择对应的 API
|
||||
const getFetchFun = () => {
|
||||
const { perms } = userStore
|
||||
if (perms.includes('stuRegistration/list.admission')) {
|
||||
return stuRegistrationAdmissionLists
|
||||
} else if (perms.includes('stuRegistration/list.enrollment')) {
|
||||
return stuRegistrationEnrollmentLists
|
||||
} else if (perms.includes('stuRegistration/list.payment')) {
|
||||
return stuRegistrationPaymentLists
|
||||
} else if (perms.includes('stuRegistration/list.registration')) {
|
||||
return stuRegistrationRegistrationLists
|
||||
} else if (perms.includes('stuRegistration/list')) {
|
||||
return stuRegistrationLists
|
||||
}
|
||||
// 默认返回基础列表接口
|
||||
return stuRegistrationLists
|
||||
}
|
||||
|
||||
const { pager, getLists, resetPage, resetParams } = usePaging({
|
||||
fetchFun: getFetchFun(), // 使用动态选择的 API
|
||||
params: queryParams
|
||||
})
|
||||
|
||||
const handleAdd = async () => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('add')
|
||||
}
|
||||
|
||||
const handleEdit = async (data: any) => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('edit')
|
||||
editRef.value?.getDetail(data)
|
||||
}
|
||||
|
||||
const handleDelete = async (id: number) => {
|
||||
await feedback.confirm('确定要删除?')
|
||||
await stuRegistrationDelete({ id })
|
||||
feedback.msgSuccess('删除成功')
|
||||
getLists()
|
||||
}
|
||||
|
||||
getLists()
|
||||
</script>
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
|
||||
node_modules
|
||||
.DS_Store
|
||||
dist
|
||||
dist-ssr
|
||||
coverage
|
||||
*.local
|
||||
|
||||
# Editor directories and files
|
||||
.vscode/*
|
||||
!.vscode/extensions.json
|
||||
.idea
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
|
||||
*.tsbuildinfo
|
||||
|
||||
.eslintcache
|
||||
|
||||
# Cypress
|
||||
/cypress/videos/
|
||||
/cypress/screenshots/
|
||||
|
||||
# Vitest
|
||||
__screenshots__/
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"recommendations": ["Vue.volar"]
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
# stu
|
||||
|
||||
This template should help get you started developing with Vue 3 in Vite.
|
||||
|
||||
## Recommended IDE Setup
|
||||
|
||||
[VS Code](https://code.visualstudio.com/) + [Vue (Official)](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur).
|
||||
|
||||
## Recommended Browser Setup
|
||||
|
||||
- Chromium-based browsers (Chrome, Edge, Brave, etc.):
|
||||
- [Vue.js devtools](https://chromewebstore.google.com/detail/vuejs-devtools/nhdogjmejiglipccpnnnanhbledajbpd)
|
||||
- [Turn on Custom Object Formatter in Chrome DevTools](http://bit.ly/object-formatters)
|
||||
- Firefox:
|
||||
- [Vue.js devtools](https://addons.mozilla.org/en-US/firefox/addon/vue-js-devtools/)
|
||||
- [Turn on Custom Object Formatter in Firefox DevTools](https://fxdx.dev/firefox-devtools-custom-object-formatters/)
|
||||
|
||||
## Customize configuration
|
||||
|
||||
See [Vite Configuration Reference](https://vite.dev/config/).
|
||||
|
||||
## Project Setup
|
||||
|
||||
```sh
|
||||
npm install
|
||||
```
|
||||
|
||||
### Compile and Hot-Reload for Development
|
||||
|
||||
```sh
|
||||
npm run dev
|
||||
```
|
||||
|
||||
### Compile and Minify for Production
|
||||
|
||||
```sh
|
||||
npm run build
|
||||
```
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="icon" href="/favicon.ico">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Vite App</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"paths": {
|
||||
"@/*": ["./src/*"]
|
||||
}
|
||||
},
|
||||
"exclude": ["node_modules", "dist"]
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
"name": "stu",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"engines": {
|
||||
"node": "^20.19.0 || >=22.12.0"
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"vue": "^3.5.25",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-plugin-simple-import-sort": "^12.1.1",
|
||||
"eslint-plugin-vue": "^9.27.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vitejs/plugin-vue": "^6.0.2",
|
||||
"vite": "^7.2.4",
|
||||
"element-plus": "2.5.2",
|
||||
"vite-plugin-vue-devtools": "^8.0.5"
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 4.2 KiB |
|
|
@ -0,0 +1,38 @@
|
|||
<script setup>
|
||||
import enrollment from './components/enrollment.vue'
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<main>
|
||||
<enrollment />
|
||||
</main>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
header {
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.logo {
|
||||
display: block;
|
||||
margin: 0 auto 2rem;
|
||||
}
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
header {
|
||||
display: flex;
|
||||
place-items: center;
|
||||
padding-right: calc(var(--section-gap) / 2);
|
||||
}
|
||||
|
||||
.logo {
|
||||
margin: 0 2rem 0 0;
|
||||
}
|
||||
|
||||
header .wrapper {
|
||||
display: flex;
|
||||
place-items: flex-start;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
/**
|
||||
* @description 获取学生基本信息
|
||||
* @return { Promise } 包含学生基本信息的响应
|
||||
*/
|
||||
export function getStudentBaseInfo() {
|
||||
return $request.get({ url: '/enrollment/studentBaseInfo' })
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 更新学生基本信息(对应"保存信息"按钮)
|
||||
* @param {Object} params - 学生基本信息对象
|
||||
* @return { Promise } 更新结果
|
||||
*/
|
||||
export function updateStudentBaseInfo(params: any) {
|
||||
return $request.post({ url: '/enrollment/studentBaseInfo', params })
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 提交报名信息(对应"提交报名"按钮)
|
||||
*/
|
||||
export function submitEnrollmentInfo() {
|
||||
return $request.post({ url: '/enrollment/submit' })
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 获取完整报名流程状态
|
||||
* @return { Promise } 包含所有步骤状态的响应
|
||||
*/
|
||||
export function getEnrollmentProcessStatus() {
|
||||
return $request.get({ url: '/enrollment/processStatus' })
|
||||
}
|
||||
|
|
@ -0,0 +1,86 @@
|
|||
/* color palette from <https://github.com/vuejs/theme> */
|
||||
:root {
|
||||
--vt-c-white: #ffffff;
|
||||
--vt-c-white-soft: #f8f8f8;
|
||||
--vt-c-white-mute: #f2f2f2;
|
||||
|
||||
--vt-c-black: #181818;
|
||||
--vt-c-black-soft: #222222;
|
||||
--vt-c-black-mute: #282828;
|
||||
|
||||
--vt-c-indigo: #2c3e50;
|
||||
|
||||
--vt-c-divider-light-1: rgba(60, 60, 60, 0.29);
|
||||
--vt-c-divider-light-2: rgba(60, 60, 60, 0.12);
|
||||
--vt-c-divider-dark-1: rgba(84, 84, 84, 0.65);
|
||||
--vt-c-divider-dark-2: rgba(84, 84, 84, 0.48);
|
||||
|
||||
--vt-c-text-light-1: var(--vt-c-indigo);
|
||||
--vt-c-text-light-2: rgba(60, 60, 60, 0.66);
|
||||
--vt-c-text-dark-1: var(--vt-c-white);
|
||||
--vt-c-text-dark-2: rgba(235, 235, 235, 0.64);
|
||||
}
|
||||
|
||||
/* semantic color variables for this project */
|
||||
:root {
|
||||
--color-background: var(--vt-c-white);
|
||||
--color-background-soft: var(--vt-c-white-soft);
|
||||
--color-background-mute: var(--vt-c-white-mute);
|
||||
|
||||
--color-border: var(--vt-c-divider-light-2);
|
||||
--color-border-hover: var(--vt-c-divider-light-1);
|
||||
|
||||
--color-heading: var(--vt-c-text-light-1);
|
||||
--color-text: var(--vt-c-text-light-1);
|
||||
|
||||
--section-gap: 160px;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root {
|
||||
--color-background: var(--vt-c-black);
|
||||
--color-background-soft: var(--vt-c-black-soft);
|
||||
--color-background-mute: var(--vt-c-black-mute);
|
||||
|
||||
--color-border: var(--vt-c-divider-dark-2);
|
||||
--color-border-hover: var(--vt-c-divider-dark-1);
|
||||
|
||||
--color-heading: var(--vt-c-text-dark-1);
|
||||
--color-text: var(--vt-c-text-dark-2);
|
||||
}
|
||||
}
|
||||
|
||||
*,
|
||||
*::before,
|
||||
*::after {
|
||||
box-sizing: border-box;
|
||||
margin: 0;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
body {
|
||||
min-height: 100vh;
|
||||
color: var(--color-text);
|
||||
background: var(--color-background);
|
||||
transition:
|
||||
color 0.5s,
|
||||
background-color 0.5s;
|
||||
line-height: 1.6;
|
||||
font-family:
|
||||
Inter,
|
||||
-apple-system,
|
||||
BlinkMacSystemFont,
|
||||
'Segoe UI',
|
||||
Roboto,
|
||||
Oxygen,
|
||||
Ubuntu,
|
||||
Cantarell,
|
||||
'Fira Sans',
|
||||
'Droid Sans',
|
||||
'Helvetica Neue',
|
||||
sans-serif;
|
||||
font-size: 15px;
|
||||
text-rendering: optimizeLegibility;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 261.76 226.69"><path d="M161.096.001l-30.225 52.351L100.647.001H-.005l130.877 226.688L261.749.001z" fill="#41b883"/><path d="M161.096.001l-30.225 52.351L100.647.001H52.346l78.526 136.01L209.398.001z" fill="#34495e"/></svg>
|
||||
|
After Width: | Height: | Size: 276 B |
|
|
@ -0,0 +1,35 @@
|
|||
@import './base.css';
|
||||
|
||||
#app {
|
||||
max-width: 1280px;
|
||||
margin: 0 auto;
|
||||
padding: 2rem;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
a,
|
||||
.green {
|
||||
text-decoration: none;
|
||||
color: hsla(160, 100%, 37%, 1);
|
||||
transition: 0.4s;
|
||||
padding: 3px;
|
||||
}
|
||||
|
||||
@media (hover: hover) {
|
||||
a:hover {
|
||||
background-color: hsla(160, 100%, 37%, 0.2);
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
body {
|
||||
display: flex;
|
||||
place-items: center;
|
||||
}
|
||||
|
||||
#app {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
padding: 0 2rem;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,600 @@
|
|||
<template>
|
||||
<div class="px-[30px] py-5 user-info min-h-full flex flex-col">
|
||||
<div v-if="submission" class="border-b border-br pb-5">
|
||||
<span class="text-2xl font-medium">注册状态</span>
|
||||
</div>
|
||||
<el-card
|
||||
v-if="submission"
|
||||
class="!border-none mb-4 flex-1"
|
||||
shadow="never"
|
||||
>
|
||||
<div class="status-info mt-4">
|
||||
<!-- 改为步骤条展示 -->
|
||||
<div class="mb-6">
|
||||
<div class="text-tx-secondary text-sm mb-4">状态进度</div>
|
||||
<el-steps
|
||||
:active="activeStep"
|
||||
finish-status="success"
|
||||
class="w-full"
|
||||
>
|
||||
<el-step
|
||||
v-for="(step, index) in statusConfig.steps"
|
||||
:key="index"
|
||||
:title="stepTitles[index]"
|
||||
:description="getStepDescription(index)"
|
||||
:status="getStepStatus(index)"
|
||||
/>
|
||||
</el-steps>
|
||||
</div>
|
||||
<!-- 显示拒绝原因 -->
|
||||
<div v-if="rejectionReason" class="text-danger mt-4">
|
||||
<i class="el-icon-error mr-2"></i>
|
||||
拒绝原因:{{ rejectionReason }}
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
<div class="border-b border-br pb-5">
|
||||
<span class="text-2xl font-medium">{{
|
||||
submission ? '信息查看' : '新生报名'
|
||||
}}</span>
|
||||
</div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<div class="lg:flex gap-6">
|
||||
<!-- 基本信息表单 -->
|
||||
<el-card class="!border-none flex-1" shadow="never">
|
||||
<el-form
|
||||
layout="vertical"
|
||||
:model="studentData.baseInfo"
|
||||
class="mt-4"
|
||||
>
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
<el-form-item label="学生姓名">
|
||||
<el-input
|
||||
v-model="studentData.baseInfo.name"
|
||||
placeholder="请输入姓名"
|
||||
:disabled="submission"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="性别">
|
||||
<el-radio-group
|
||||
v-model="studentData.baseInfo.gender"
|
||||
:disabled="submission"
|
||||
>
|
||||
<el-radio :label="0">男</el-radio>
|
||||
<el-radio :label="1">女</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="身份证号">
|
||||
<el-input
|
||||
v-model="studentData.baseInfo.idCard"
|
||||
placeholder="请输入18位身份证号"
|
||||
:disabled="submission"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="出生日期">
|
||||
<el-date-picker
|
||||
v-model="studentData.baseInfo.birthday"
|
||||
type="datetime"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="请输入出生日期"
|
||||
:disabled="submission"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="联系方式">
|
||||
<el-input
|
||||
v-model="studentData.baseInfo.phone"
|
||||
placeholder="请输入手机号码"
|
||||
:disabled="submission"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="电子邮箱">
|
||||
<el-input
|
||||
v-model="studentData.baseInfo.email"
|
||||
placeholder="请输入电子邮箱"
|
||||
:disabled="submission"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="籍贯">
|
||||
<el-input
|
||||
v-model="studentData.baseInfo.nativePlace"
|
||||
placeholder="请输入籍贯"
|
||||
:disabled="submission"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="民族">
|
||||
<el-input
|
||||
v-model="studentData.baseInfo.nationality"
|
||||
placeholder="请输入民族"
|
||||
:disabled="submission"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="政治面貌">
|
||||
<el-select
|
||||
v-model="
|
||||
studentData.baseInfo.politicalStatus
|
||||
"
|
||||
clearable
|
||||
:disabled="submission"
|
||||
>
|
||||
<el-option label="群众" :value="0" />
|
||||
<el-option label="团员" :value="1" />
|
||||
<el-option label="党员" :value="2" />
|
||||
<el-option label="其他" :value="3" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="毕业年份">
|
||||
<el-input-number
|
||||
v-model="
|
||||
studentData.baseInfo.graduationYear
|
||||
"
|
||||
placeholder="请输入毕业年份"
|
||||
:disabled="submission"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="毕业院校">
|
||||
<el-input
|
||||
v-model="
|
||||
studentData.baseInfo.previousSchool
|
||||
"
|
||||
placeholder="请输入毕业院校"
|
||||
:disabled="submission"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="学校类型">
|
||||
<el-select
|
||||
v-model="studentData.baseInfo.schoolType"
|
||||
clearable
|
||||
:disabled="submission"
|
||||
>
|
||||
<el-option label="普通高中" :value="1" />
|
||||
<el-option label="职业高中" :value="2" />
|
||||
<el-option label="中专" :value="3" />
|
||||
<el-option label="大专" :value="4" />
|
||||
<el-option label="本科" :value="5" />
|
||||
<el-option label="其他" :value="6" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="学历">
|
||||
<el-select
|
||||
v-model="
|
||||
studentData.baseInfo
|
||||
.academicQualification
|
||||
"
|
||||
clearable
|
||||
:disabled="submission"
|
||||
>
|
||||
<el-option label="初中" :value="1" />
|
||||
<el-option label="高中" :value="2" />
|
||||
<el-option label="中专" :value="3" />
|
||||
<el-option label="大专" :value="4" />
|
||||
<el-option label="本科" :value="5" />
|
||||
<el-option label="硕士" :value="6" />
|
||||
<el-option label="博士" :value="7" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="邮政编码">
|
||||
<el-input
|
||||
v-model="studentData.baseInfo.postalCode"
|
||||
placeholder="请输入邮政编码"
|
||||
:disabled="submission"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="家庭住址"
|
||||
class="md:col-span-2"
|
||||
>
|
||||
<el-input
|
||||
v-model="studentData.baseInfo.homeAddress"
|
||||
placeholder="请输入详细家庭住址"
|
||||
type="textarea"
|
||||
rows="3"
|
||||
:disabled="submission"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="紧急联系人">
|
||||
<el-input
|
||||
v-model="
|
||||
studentData.baseInfo.emergencyContact
|
||||
"
|
||||
placeholder="请输入紧急联系人姓名"
|
||||
:disabled="submission"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="紧急联系电话">
|
||||
<el-input
|
||||
v-model="
|
||||
studentData.baseInfo.emergencyPhone
|
||||
"
|
||||
placeholder="请输入紧急联系人电话"
|
||||
:disabled="submission"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="与紧急联系人关系">
|
||||
<el-input
|
||||
v-model="studentData.baseInfo.relationship"
|
||||
placeholder="请输入与紧急联系人的关系"
|
||||
:disabled="submission"
|
||||
/>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</el-card>
|
||||
<!-- 注册状态信息 -->
|
||||
<el-card class="!border-none mb-4 flex-1" shadow="never">
|
||||
<div v-if="!submission" class="mt-6">
|
||||
<el-button type="primary" block @click="handleSave">
|
||||
保存信息
|
||||
</el-button>
|
||||
<el-button
|
||||
class="ml-4"
|
||||
type="success"
|
||||
block
|
||||
@click="handleShowConfirmDialog"
|
||||
:disabled="statusConfig.steps[0].completed"
|
||||
>
|
||||
提交报名
|
||||
</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
<!-- 确认弹窗 -->
|
||||
<el-dialog
|
||||
title="确认提交"
|
||||
v-model="showConfirmDialog"
|
||||
width="600px"
|
||||
:before-close="handleCloseDialog"
|
||||
>
|
||||
<div class="mb-4 text-warning">
|
||||
<i class="el-icon-warning mr-2"></i>
|
||||
提交信息后不可修改,请检查后确认
|
||||
</div>
|
||||
<el-descriptions :column="1" border>
|
||||
<el-descriptions-item label="学生姓名">{{
|
||||
confirmInfo.name
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="性别">{{
|
||||
confirmInfo.gender === 0 ? '男' : '女'
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="身份证号">{{
|
||||
confirmInfo.idCard
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="出生日期">{{
|
||||
confirmInfo.birthday
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="民族">{{
|
||||
confirmInfo.nationality
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="联系方式"
|
||||
>电话:{{ confirmInfo.phone }} 邮箱:{{
|
||||
confirmInfo.email
|
||||
}}</el-descriptions-item
|
||||
>
|
||||
<el-descriptions-item label="籍贯">{{
|
||||
confirmInfo.nativePlace
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="政治面貌">
|
||||
{{
|
||||
confirmInfo.politicalStatus === 0
|
||||
? '群众'
|
||||
: confirmInfo.politicalStatus === 1
|
||||
? '团员'
|
||||
: confirmInfo.politicalStatus === 2
|
||||
? '党员'
|
||||
: '其他'
|
||||
}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="家庭住址">{{
|
||||
confirmInfo.homeAddress
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="毕业年份">{{
|
||||
confirmInfo.graduationYear
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="毕业院校">{{
|
||||
confirmInfo.previousSchool
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="学校类型">
|
||||
{{
|
||||
confirmInfo.schoolType === 1
|
||||
? '普通高中'
|
||||
: confirmInfo.schoolType === 2
|
||||
? '职业高中'
|
||||
: confirmInfo.schoolType === 3
|
||||
? '中专'
|
||||
: confirmInfo.schoolType === 4
|
||||
? '大专'
|
||||
: confirmInfo.schoolType === 5
|
||||
? '本科'
|
||||
: '其他'
|
||||
}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="学历">
|
||||
{{
|
||||
confirmInfo.academicQualification === 1
|
||||
? '初中'
|
||||
: confirmInfo.academicQualification === 2
|
||||
? '高中'
|
||||
: confirmInfo.academicQualification === 3
|
||||
? '中专'
|
||||
: confirmInfo.academicQualification === 4
|
||||
? '大专'
|
||||
: confirmInfo.academicQualification === 5
|
||||
? '本科'
|
||||
: confirmInfo.academicQualification === 6
|
||||
? '硕士'
|
||||
: '博士'
|
||||
}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="邮政编码">{{
|
||||
confirmInfo.postalCode
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="紧急联系人">{{
|
||||
confirmInfo.emergencyContact
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="紧急联系电话">{{
|
||||
confirmInfo.emergencyPhone
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="与紧急联系人关系">{{
|
||||
confirmInfo.relationship
|
||||
}}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
<template #footer>
|
||||
<el-button @click="handleCloseDialog">取消</el-button>
|
||||
<el-button type="primary" @click="handleConfirmSubmit">
|
||||
确认提交
|
||||
</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { reactive, computed, onMounted, ref } from 'vue'
|
||||
import { ElButton, ElMessage } from 'element-plus'
|
||||
import {
|
||||
getStudentBaseInfo,
|
||||
updateStudentBaseInfo,
|
||||
getEnrollmentProcessStatus,
|
||||
submitEnrollmentInfo
|
||||
} from '@/api/enrollment'
|
||||
|
||||
// 步骤标题与后端状态对应
|
||||
const stepTitles = ['报名', '材料审核', '录取', '缴费']
|
||||
const showConfirmDialog = ref(false)
|
||||
const submission = ref(false) // 提交状态
|
||||
const rejectionReason = ref('') // 拒绝原因
|
||||
const confirmInfo = ref({
|
||||
name: '',
|
||||
gender: 0,
|
||||
idCard: '',
|
||||
birthday: '',
|
||||
nationality: '',
|
||||
phone: '',
|
||||
email: '',
|
||||
homeAddress: '',
|
||||
nativePlace: '',
|
||||
politicalStatus: 0,
|
||||
previousSchool: '',
|
||||
schoolType: null,
|
||||
academicQualification: null,
|
||||
postalCode: '',
|
||||
graduationYear: 2025,
|
||||
emergencyContact: '',
|
||||
emergencyPhone: '',
|
||||
relationship: ''
|
||||
})
|
||||
|
||||
// 学生信息数据
|
||||
const studentData = reactive({
|
||||
baseInfo: {
|
||||
id: '',
|
||||
name: '',
|
||||
gender: 0,
|
||||
idCard: '',
|
||||
birthday: '',
|
||||
nationality: '',
|
||||
phone: '',
|
||||
email: '',
|
||||
homeAddress: '',
|
||||
nativePlace: '',
|
||||
politicalStatus: 0,
|
||||
previousSchool: '',
|
||||
schoolType: '',
|
||||
academicQualification: '',
|
||||
postalCode: '',
|
||||
graduationYear: 2025,
|
||||
emergencyContact: '',
|
||||
emergencyPhone: '',
|
||||
relationship: ''
|
||||
},
|
||||
additionalInfo: {
|
||||
enrollYear: '',
|
||||
major: '',
|
||||
education: ''
|
||||
}
|
||||
})
|
||||
|
||||
// 状态配置 - 与后端返回字段对应
|
||||
const statusConfig = reactive({
|
||||
steps: [
|
||||
{ completed: false, time: 0, status: 0 }, // 报名
|
||||
{ completed: false, time: 0, status: 0 }, // 材料审核
|
||||
{ completed: false, time: 0, status: 0 }, // 录取
|
||||
{ completed: false, time: 0, status: 0 } // 缴费
|
||||
],
|
||||
applicationNumber: '' // 报名编号
|
||||
})
|
||||
|
||||
// 格式化时间戳为日期
|
||||
const formatTime = (timestamp: number) => {
|
||||
if (!timestamp) return ''
|
||||
const date = new Date(timestamp)
|
||||
return date.toLocaleDateString()
|
||||
}
|
||||
|
||||
// 获取步骤描述
|
||||
const getStepDescription = (index: number) => {
|
||||
const step = statusConfig.steps[index]
|
||||
const timeStr = formatTime(step.time)
|
||||
if (index === 0) {
|
||||
return step.completed ? `已完成${timeStr}` : '状态异常'
|
||||
} else if (index === 1) {
|
||||
if (step.status === 0) return '待审核'
|
||||
if (step.status === 1) return `审核通过 ${timeStr}`
|
||||
if (step.status === 2) return `审核不通过 ${timeStr}`
|
||||
} else if (index === 2) {
|
||||
if (step.status === 0) return '待审核'
|
||||
if (step.status === 1) return `已录取 ${timeStr}`
|
||||
if (step.status === 2) return `未录取 ${timeStr}`
|
||||
} else if (index === 3) {
|
||||
if (step.status === 0) return '未缴费'
|
||||
if (step.status === 1) return `已缴费 ${timeStr}`
|
||||
}
|
||||
return ''
|
||||
}
|
||||
|
||||
// 显示确认弹窗并加载信息
|
||||
const handleShowConfirmDialog = async () => {
|
||||
try {
|
||||
const info = await getStudentBaseInfo()
|
||||
confirmInfo.value = info
|
||||
showConfirmDialog.value = true
|
||||
} catch (error) {
|
||||
ElMessage.error('获取信息失败,请稍后重试')
|
||||
console.error('获取确认信息失败:', error)
|
||||
}
|
||||
}
|
||||
|
||||
// 关闭弹窗
|
||||
const handleCloseDialog = () => {
|
||||
showConfirmDialog.value = false
|
||||
}
|
||||
|
||||
// 确认提交
|
||||
const handleConfirmSubmit = async () => {
|
||||
try {
|
||||
await submitEnrollmentInfo()
|
||||
showConfirmDialog.value = false
|
||||
// 刷新状态
|
||||
await loadProcessStatus()
|
||||
submission.value = true
|
||||
ElMessage.success('报名提交成功')
|
||||
} catch (error) {
|
||||
ElMessage.error('报名提交失败,请稍后重试')
|
||||
console.error('提交报名信息失败:', error)
|
||||
}
|
||||
}
|
||||
|
||||
// 加载流程状态
|
||||
const loadProcessStatus = async () => {
|
||||
try {
|
||||
const statusRes = await getEnrollmentProcessStatus()
|
||||
if (statusRes) {
|
||||
submission.value = true
|
||||
// 保存报名编号
|
||||
statusConfig.applicationNumber = statusRes.applicationNumber || ''
|
||||
// 处理拒绝原因
|
||||
rejectionReason.value = statusRes.rejectionReason || ''
|
||||
// 映射状态到步骤
|
||||
// 步骤1: 报名
|
||||
statusConfig.steps[0] = {
|
||||
completed: statusRes.applicationNumber,
|
||||
time: statusRes.applicationTime,
|
||||
status: statusRes.applicationTime > 0 ? 1 : 0
|
||||
}
|
||||
// 步骤2: 材料审核
|
||||
statusConfig.steps[1] = {
|
||||
completed: statusRes.approvalStatus === 1,
|
||||
time: statusRes.applicationTime,
|
||||
status: statusRes.approvalStatus
|
||||
}
|
||||
// 步骤3: 录取
|
||||
statusConfig.steps[2] = {
|
||||
completed: statusRes.admissionStatus === 1,
|
||||
time: statusRes.admissionTime,
|
||||
status: statusRes.admissionStatus
|
||||
}
|
||||
// 步骤4: 缴费入学
|
||||
statusConfig.steps[3] = {
|
||||
completed: statusRes.paymentStatus === 1,
|
||||
time: statusRes.paymentTime,
|
||||
status: statusRes.paymentStatus
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('刷新状态失败:', error)
|
||||
}
|
||||
}
|
||||
|
||||
// 动态推导当前激活的步骤
|
||||
const activeStep = computed(() => {
|
||||
// 检查是否有步骤被拒绝
|
||||
if (
|
||||
statusConfig.steps[1].status === 2 ||
|
||||
statusConfig.steps[2].status === 2
|
||||
) {
|
||||
return statusConfig.steps[1].status === 2 ? 1 : 2
|
||||
}
|
||||
|
||||
const count = completedStepCount.value
|
||||
// 如果所有步骤都完成,激活最后一步;否则激活下一个待完成的步骤
|
||||
return count >= statusConfig.steps.length
|
||||
? statusConfig.steps.length - 1
|
||||
: count
|
||||
})
|
||||
|
||||
// 获取步骤状态
|
||||
const getStepStatus = (index: number) => {
|
||||
// 已完成步骤
|
||||
if (statusConfig.steps[index].completed) {
|
||||
return 'finish'
|
||||
}
|
||||
|
||||
// 被拒绝的步骤
|
||||
if (
|
||||
(index === 1 && statusConfig.steps[index].status === 2) ||
|
||||
(index === 2 && statusConfig.steps[index].status === 2)
|
||||
) {
|
||||
return 'error'
|
||||
}
|
||||
|
||||
// 当前激活步骤
|
||||
return index === activeStep.value ? 'process' : 'wait'
|
||||
}
|
||||
|
||||
// 计算已完成的步骤数量
|
||||
const completedStepCount = computed(() => {
|
||||
return statusConfig.steps.filter((step) => step.completed).length
|
||||
})
|
||||
|
||||
// 保存信息
|
||||
const handleSave = async () => {
|
||||
try {
|
||||
await updateStudentBaseInfo(studentData.baseInfo)
|
||||
ElMessage.success('信息保存成功')
|
||||
} catch (error) {
|
||||
ElMessage.error('保存失败,请稍后重试')
|
||||
console.error('更新信息失败:', error)
|
||||
}
|
||||
}
|
||||
|
||||
// 页面挂载时加载数据
|
||||
onMounted(async () => {
|
||||
try {
|
||||
// 1. 加载学生基本信息
|
||||
const studentInfoRes = await getStudentBaseInfo()
|
||||
Object.assign(studentData.baseInfo, studentInfoRes)
|
||||
if (studentInfoRes.id) {
|
||||
studentData.baseInfo.id = studentInfoRes.id
|
||||
}
|
||||
|
||||
// 2. 加载报名流程状态
|
||||
await loadProcessStatus()
|
||||
} catch (error) {
|
||||
ElMessage.error('数据加载失败,请稍后重试')
|
||||
console.error('获取初始数据失败:', error)
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
import './assets/main.css'
|
||||
|
||||
import { createApp } from 'vue'
|
||||
import App from './App.vue'
|
||||
|
||||
createApp(App).mount('#app')
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
import { fileURLToPath, URL } from 'node:url'
|
||||
|
||||
import { defineConfig } from 'vite'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
import vueDevTools from 'vite-plugin-vue-devtools'
|
||||
|
||||
// https://vite.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
vue(),
|
||||
vueDevTools(),
|
||||
],
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': fileURLToPath(new URL('./src', import.meta.url))
|
||||
},
|
||||
},
|
||||
})
|
||||
Loading…
Reference in New Issue