SYN/admin/src/views/student/freshman/stuRegistration.registration/index.vue

174 lines
6.2 KiB
Vue
Raw Normal View History

2025-12-08 07:17:59 +00:00
<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="approvalStatus">
2025-12-10 01:13:06 +00:00
<el-select
v-model="queryParams.approvalStatus"
class="w-[280px]"
clearable
@change="getLists()"
>
2025-12-08 07:17:59 +00:00
<el-option label="待审核" :value="0" />
2025-12-10 01:13:06 +00:00
<el-option label="已审核" :value="1" />
2025-12-08 07:17:59 +00:00
<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>
<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">
2025-12-10 01:13:06 +00:00
<el-table
class="mt-4"
size="large"
v-loading="pager.loading"
:data="pager.lists"
border
>
<el-table-column label="报名编号" min-width="100">
<template #default="{ row }">
<el-button
type="primary"
link
@click="handleShowDetail(row.baseInfoId)"
style="text-decoration: underline"
>
{{ row.applicationNumber }}
</el-button>
2025-12-08 07:17:59 +00:00
</template>
2025-12-10 01:13:06 +00:00
</el-table-column>
2025-12-08 07:17:59 +00:00
<el-table-column
label="审核状态"
prop="approvalStatus"
min-width="100"
2025-12-10 01:13:06 +00:00
:formatter="formatRegistrationStatus"
2025-12-08 07:17:59 +00:00
/>
<el-table-column label="报名时间" prop="applicationTime" min-width="100" />
2025-12-10 01:13:06 +00:00
<el-table-column label="操作" width="240" fixed="right">
2025-12-08 07:17:59 +00:00
<template #default="{ row }">
<el-button
v-perms="['stuRegistration/edit']"
2025-12-10 01:13:06 +00:00
@click="handleRoEdit(row)"
:disabled="row.approvalStatus == 0"
2025-12-08 07:17:59 +00:00
>
2025-12-10 01:13:06 +00:00
撤销
2025-12-08 07:17:59 +00:00
</el-button>
<el-button
2025-12-10 01:13:06 +00:00
v-perms="['stuRegistration/edit']"
type="success"
@click="handleYesEdit(row)"
:disabled="row.approvalStatus != 0"
>
通过
</el-button>
<el-button
v-perms="['stuRegistration/edit']"
2025-12-08 07:17:59 +00:00
type="danger"
2025-12-10 01:13:06 +00:00
@click="handleNoEdit(row)"
:disabled="row.approvalStatus != 0"
2025-12-08 07:17:59 +00:00
>
2025-12-10 01:13:06 +00:00
拒绝
2025-12-08 07:17:59 +00:00
</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" />
2025-12-10 01:13:06 +00:00
<base-popup ref="detailRef" />
2025-12-08 07:17:59 +00:00
</div>
</template>
<script lang="ts" setup name="stuRegistration">
2025-12-10 01:13:06 +00:00
import {
stuRegistrationRegistration,
stuRegistrationRegistrationLists
} from '@/api/stuRegistration'
2025-12-08 07:17:59 +00:00
import { usePaging } from '@/hooks/usePaging'
2025-12-10 01:13:06 +00:00
import BasePopup from '../Base.vue'
2025-12-08 07:17:59 +00:00
import EditPopup from './edit.vue'
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
2025-12-10 01:13:06 +00:00
const detailRef = shallowRef<InstanceType<typeof BasePopup>>()
2025-12-08 07:17:59 +00:00
const showEdit = ref(false)
const queryParams = reactive({
baseInfoId: '',
2025-12-10 01:13:06 +00:00
approvalStatus: '',
2025-12-08 07:17:59 +00:00
applicationNumber: '',
2025-12-10 01:13:06 +00:00
rejectionReason: '',
2025-12-08 07:17:59 +00:00
admissionStatus: '',
paymentStatus: '',
2025-12-10 01:13:06 +00:00
registrationStatus: 0,
2025-12-08 07:17:59 +00:00
applicationTimeStart: '',
2025-12-10 01:13:06 +00:00
applicationTimeEnd: ''
2025-12-08 07:17:59 +00:00
})
2025-12-10 01:13:06 +00:00
const formData = reactive({
id: '',
operation: 0,
reason: ''
})
2025-12-08 07:17:59 +00:00
const formatRegistrationStatus = (row: any, column: any, cellValue: any) => {
const statusMap: Record<string | number, string> = {
'0': '待审核',
'1': '已审核',
'2': '审核不通过'
}
2025-12-10 01:13:06 +00:00
const statusText = statusMap[String(cellValue)] || cellValue
// 当审核状态为2不通过显示拒绝原因
if (cellValue === 2 && row.rejectionReason) {
return `${statusText} ${row.rejectionReason}`
}
return statusText
2025-12-08 07:17:59 +00:00
}
const { pager, getLists, resetPage, resetParams } = usePaging({
fetchFun: stuRegistrationRegistrationLists,
params: queryParams
})
2025-12-10 01:13:06 +00:00
const handleShowDetail = async (id: number) => {
2025-12-08 07:17:59 +00:00
await nextTick()
2025-12-10 01:13:06 +00:00
detailRef.value?.open(id)
2025-12-08 07:17:59 +00:00
}
2025-12-10 01:13:06 +00:00
const handleRoEdit = async (data: any) => {
formData.id = data.id
formData.operation = 0
const editData: any = { ...formData }
await stuRegistrationRegistration(editData)
getLists()
2025-12-08 07:17:59 +00:00
}
2025-12-10 01:13:06 +00:00
const handleYesEdit = async (data: any) => {
formData.id = data.id
formData.operation = 1
const editData: any = { ...formData }
await stuRegistrationRegistration(editData)
2025-12-08 07:17:59 +00:00
getLists()
}
2025-12-10 01:13:06 +00:00
const handleNoEdit = async (data: any) => {
showEdit.value = true
await nextTick()
editRef.value?.open()
editRef.value?.getDetail(data)
}
2025-12-08 07:17:59 +00:00
getLists()
</script>