This commit is contained in:
zhoutianchi
2026-02-26 16:08:25 +08:00
parent 1ce6db425e
commit a9e5e2b368
10 changed files with 619 additions and 171 deletions

View File

@@ -61,7 +61,8 @@ const uploadRef = ref<{ clearFiles?: () => void }>()
const titleMap: Record<string, string> = {
R10001: '计划专业导入',
R10002: '地区分数导入',
R10003: '中招平台数据导入'
R10003: '中招平台数据导入',
R10004: '学校维护导入',
}
// 方法
const init = (type: any) => {

View File

@@ -10,23 +10,42 @@
</el-col>
<el-col :span="24" class="mb20">
<el-form-item label="文件地址" prop="fileUrl">
<el-upload
:action="uploadUrl"
class="avatar-uploader"
name="file"
:headers="headers"
:data="uploadData"
:show-file-list="false"
:before-upload="beforeUpload"
:http-request="httpRequest"
:limit="1"
:accept="['.jpg,.jpeg,.png,.gif,.pdf']"
:on-success="handleUploadSuccess">
<div v-if="form.fileUrl" class="avatar-wrapper">
<img :src="baseUrl + form.fileUrl" class="avatar"/>
</div>
<el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon>
:action="uploadUrl"
:file-list="fileList"
:on-success="handleUploadSuccess"
:accept="'.pdf'"
>
<el-button size="small" type="primary">点击上传</el-button>
<template #tip>
<div style="margin-top: 8px;">
<el-tag>仅支持pdf后缀的文件上传</el-tag>
</div>
</template>
</el-upload>
<!-- <el-upload-->
<!-- :action="uploadUrl"-->
<!-- class="avatar-uploader"-->
<!-- name="file"-->
<!-- :headers="headers"-->
<!-- :data="uploadData"-->
<!-- :file-list="fileList"-->
<!-- :before-upload="beforeUpload"-->
<!-- :http-request="httpRequest"-->
<!-- :limit="1"-->
<!-- :accept="['.jpg,.jpeg,.png,.pdf']"-->
<!-- :on-success="handleUploadSuccess">-->
<!-- <el-button size="small" type="primary">点击上传</el-button>-->
<!-- <template #tip>-->
<!-- <div style="margin-top: 8px;">-->
<!-- <el-tag>仅支持jpg,jpeg,png,pdf后缀的文件上传</el-tag>-->
<!-- </div>-->
<!-- </template>-->
<!-- </el-upload>-->
</el-form-item>
</el-col>
@@ -54,6 +73,7 @@ import {Plus} from "@element-plus/icons-vue";
import {reactive, ref} from "vue";
import axios from "axios";
import { Session } from '/@/utils/storage'
const fileList = ref<any[]>([])
// ========== 2. 组件定义 ==========
// 定义组件事件
@@ -74,7 +94,7 @@ const form = reactive({
type: '', // 1 资助政策文件
});
const uploadUrl = baseUrl + '/recruit/file/uploadAttachment'
const uploadUrl = baseUrl + '/recruit/file/uploadPdf'
// 请求头
const headers = computed(() => {
return {
@@ -84,35 +104,6 @@ const headers = computed(() => {
const uploadData = reactive({})
const fileReader = ref<FileReader | null>(null)
const httpRequest = (options: any) => {
const file = options.file
if (file && fileReader.value) {
fileReader.value.readAsDataURL(file)
fileReader.value.onload = () => {
const base64Str = fileReader.value?.result as string
const config = {
url: uploadUrl,
method: 'post',
headers: headers.value,
data: {
base64Str: base64Str.split(',')[1]
},
timeout: 10000,
onUploadProgress: function (progressEvent: any) {
progressEvent.percent = progressEvent.loaded / progressEvent.total * 100
options.onProgress(progressEvent, file)
},
}
axios(config)
.then((res: any) => {
options.onSuccess(res, file)
})
.catch((err: any) => {
options.onError(err)
})
}
}
}
// 上传前验证
@@ -126,7 +117,7 @@ const beforeUpload = (file: File) => {
}
// 通用上传成功回调(单文件 - avatar模式
const handleUploadSuccess = (res:any) => {
const fileUrl = res.data.fileUrl
const fileUrl = res.fileUrl
form['fileUrl'] = fileUrl
}
// ========== 4. 字典数据处理 ==========
@@ -213,30 +204,30 @@ defineExpose({
</script>
<style lang="scss" scoped>
.avatar-uploader {
:deep(.el-upload) {
border: 1px dashed var(--el-border-color);
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
transition: var(--el-transition-duration-fast);
width: 148px;
height: 148px;
&:hover {
border-color: var(--el-color-primary);
}
}
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 148px;
height: 148px;
line-height: 148px;
text-align: center;
}
//.avatar-uploader {
// :deep(.el-upload) {
// border: 1px dashed var(--el-border-color);
// border-radius: 6px;
// cursor: pointer;
// position: relative;
// overflow: hidden;
// transition: var(--el-transition-duration-fast);
// width: 148px;
// height: 148px;
// &:hover {
// border-color: var(--el-color-primary);
// }
// }
//}
//
//.avatar-uploader-icon {
// font-size: 28px;
// color: #8c939d;
// width: 148px;
// height: 148px;
// line-height: 148px;
// text-align: center;
//}
.avatar-wrapper {
width: 148px;

View File

@@ -53,17 +53,13 @@
show-overflow-tooltip
>
<template #default="scope">
<el-image
style="width: 100px; height: 100px;"
:src="baseUrl+scope.row.fileUrl"
:preview-src-list="[baseUrl+scope.row.fileUrl]"
:z-index="9999"
fit="cover"
>
<template #progress="{ activeIndex, total }">
<span>{{ activeIndex + 1 + '-' + total }}</span>
</template>
</el-image>
<el-button
type="primary"
link
icon="Document"
@click="handlePreview(scope.row.fileUrl)"
>查看
</el-button>
</template>
</el-table-column>
@@ -120,6 +116,9 @@
temp-url="/admin/sys-file/local/file/recruitPolicyFile.xlsx"
@refreshDataList="getDataList"
/>
<preview-file v-for="src in imgUrl" :key="src.title" :authSrc="src.url" dialog-title="职称材料" />
</div>
</template>
@@ -129,11 +128,13 @@ import { BasicTableProps, useTable } from "/@/hooks/table";
import { fetchList, delObjs } from "/@/api/recruit/recruitPolicyFile";
import { useMessage, useMessageBox } from "/@/hooks/message";
import { useDict } from '/@/hooks/dict';
const baseUrl = import.meta.env.VITE_API_URL
import {defineAsyncComponent, ref} from "vue";
const previewFile = defineAsyncComponent(() => import('/@/components/tools/preview-file.vue'));
// ========== 组件声明 ==========
// 异步加载表单弹窗组件
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
const baseUrl = import.meta.env.VITE_API_URL
// ========== 字典数据 ==========
@@ -152,6 +153,7 @@ const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {}, // 查询参数
pageList: fetchList // 分页查询方法
});
const imgUrl = ref<Array<{ title: string; url: string }>>([]);
// ========== Hook引用 ==========
// 表格相关Hook
@@ -197,6 +199,17 @@ const selectionChangHandle = (objs: { id: string }[]) => {
multiple.value = !objs.length;
};
// 预览材料
const handlePreview = (url: string) => {
imgUrl.value = [];
nextTick(() => {
imgUrl.value.push({
title: '',
url: baseUrl+url,
});
});
};
/**
* 删除数据处理
* @param ids 要删除的数据ID数组

View File

@@ -0,0 +1,129 @@
<!--
- Copyright (c) 2018-2025, cyweb All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- Neither the name of the pig4cloud.com developer nor the names of its
- contributors may be used to endorse or promote products derived from
- this software without specific prior written permission.
-
-->
<template>
<el-dialog v-model="dialogVisible" title="保存审核人员" width="600px" append-to-body @close="handleClose">
<el-form :model="{ belongTeacherNos }" label-width="100px">
<el-form-item label="选择教师:">
<el-select
v-model="belongTeacherNos"
filterable
remote
clearable
reserve-keyword
placeholder="请选择或输入教师姓名"
:remote-method="remoteTeacherByQuery"
style="width: 100%"
>
<el-option
v-for="item in teacherList"
:key="item.teacherNo"
:label="item.realName"
:value="item.teacherNo"
/>
</el-select>
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button @click="handleClose">取消</el-button>
<el-button type="primary" @click="handleSave">保存</el-button>
</div>
</template>
</el-dialog>
</template>
<script setup lang="ts" name="AddExamPeopleForm">
import { ref, watch } from 'vue'
import {getTeacherInfoCommon} from '/@/api/professional/professionaluser/teacherbase'
// Props
const props = defineProps<{
visible: boolean
timeRange: string[]
}>()
// Emits
const emit = defineEmits<{
(e: 'update:visible', value: boolean): void
(e: 'save', data: { teacherNo: string; startTime: string; endTime: string }): void
}>()
// 弹窗显示状态
const dialogVisible = ref(false)
const belongTeacherNos = ref('')
const teacherList = ref<any[]>([])
// 监听 visible 变化
watch(() => props.visible, (newVal) => {
dialogVisible.value = newVal
if (newVal) {
belongTeacherNos.value = ''
teacherList.value = []
}
})
// 监听 dialogVisible 变化,同步到父组件
watch(dialogVisible, (newVal) => {
emit('update:visible', newVal)
})
// 检索教师
const remoteTeacherByQuery = (query: string) => {
teacherList.value = []
if (query !== '') {
setTimeout(() => {
getTeacherInfoCommon({searchKeywords:query,tied:"0"}).then(response => {
teacherList.value = response.data
})
}, 200)
}
}
// 关闭窗口
const handleClose = () => {
belongTeacherNos.value = ''
dialogVisible.value = false
}
// 保存
const handleSave = () => {
if (props.timeRange.length === 0) {
emit('save', {
teacherNo: belongTeacherNos.value,
startTime: '',
endTime: ''
})
return
}
emit('save', {
teacherNo: belongTeacherNos.value,
startTime: props.timeRange[0],
endTime: props.timeRange[1]
})
handleClose()
}
</script>
<style lang="scss" scoped>
.dialog-footer {
display: flex;
justify-content: flex-end;
gap: 10px;
}
</style>

View File

@@ -0,0 +1,225 @@
<!--
- Copyright (c) 2018-2025, cyweb All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- Neither the name of the pig4cloud.com developer nor the names of its
- contributors may be used to endorse or promote products derived from
- this software without specific prior written permission.
-
-->
<template>
<el-dialog
title="招生审核人员管理"
:close-on-click-modal="false"
v-model="visible"
width="800"
:append-to-body="true"
destroy-on-close
>
<div class="dialog-content">
<!-- 时间选择器和操作按钮 -->
<el-form :inline="true" :model="queryForm">
<el-form-item label="审核时间范围:">
<el-time-picker
is-range
v-model="form.time1"
format="HH:mm:ss"
value-format="HH:mm:ss"
range-separator=""
start-placeholder="开始时间"
end-placeholder="结束时间"
placeholder="选择时间范围"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="getDataList">查询</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<div class="mb15" v-if="hasAuth('recruit_recruitexampeople_add')">
<el-button
type="primary"
icon="FolderAdd"
@click="handleAdd"
>
</el-button>
</div>
<!-- 表格 -->
<div class="table-wrapper">
<el-table
ref="tableRef"
:data="state.dataList || []"
v-loading="state.loading"
border
stripe
:cell-style="tableStyle.cellStyle"
:header-cell-style="tableStyle.headerCellStyle"
empty-text="暂无数据"
>
<el-table-column type="index" label="序号" width="60" align="center" />
<el-table-column label="工号" align="center" prop="teacherNo" show-overflow-tooltip>
</el-table-column>
<el-table-column label="姓名" align="center" prop="teacherName" show-overflow-tooltip>
</el-table-column>
<el-table-column label="操作" align="center" width="150px" fixed="right">
<template #default="scope">
<el-button
v-if="hasAuth('recruit_recruitexampeople_del')"
type="danger"
link
icon="Delete"
@click="handleDel(scope.row)"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
</div>
<!-- 分页 -->
<div class="pagination-wrapper">
<pagination
v-bind="state.pagination"
@current-change="currentChangeHandle"
@size-change="sizeChangeHandle"
/>
</div>
</div>
<!-- 保存审核人员弹窗 -->
<add-form
v-model:visible="setTeachNoFormVisible"
:time-range="form.time1"
@save="handleSave"
/>
</el-dialog>
</template>
<script setup lang="ts" name="recruitexampeople">
import { ref, reactive, nextTick, defineAsyncComponent } from 'vue'
import { useAuth } from '/@/hooks/auth'
import { BasicTableProps, useTable } from '/@/hooks/table'
import { useMessage, useMessageBox } from '/@/hooks/message'
import { addObj, delObj, fetchList } from '/@/api/recruit/recruitPreexamPeople'
const AddForm = defineAsyncComponent(() => import('./add-form.vue'))
const { hasAuth } = useAuth()
// 消息提示 hooks
const message = useMessage()
const messageBox = useMessageBox()
// 表格引用
const tableRef = ref()
// 弹窗状态
const visible = ref(false)
const setTeachNoFormVisible = ref(false)
// 表单数据
const form = reactive({
time1: [] as string[]
})
// 查询表单
const queryForm = reactive<Record<string, any>>({})
// 表格状态
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: queryForm,
pageList: async (params: any) => {
const response = await fetchList(params)
return {
data: {
records: response.data.records || [],
total: response.data.total || 0
}
}
},
createdIsNeed: false, // 弹窗组件,不在挂载时自动加载数据
dataList: [], // 确保 dataList 初始化为空数组
loading: false, // 确保 loading 初始化为 false
onLoaded: async (state: any) => {
// 如果有数据,设置时间范围
if (state.dataList && state.dataList.length > 0) {
form.time1 = [state.dataList[0].startTime, state.dataList[0].endTime]
}
}
})
// 使用 table hook
// 注意useTable 会直接修改传入的 state 对象,所以不需要从返回值中获取 state
const { getDataList, currentChangeHandle, sizeChangeHandle, tableStyle } = useTable(state)
// 初始化
const init = () => {
visible.value = true
form.time1 = []
// 等待弹窗显示后再加载数据
nextTick(() => {
getDataList()
})
}
// 新增
const handleAdd = () => {
setTeachNoFormVisible.value = true
}
// 保存审核人员
const handleSave = async (data: { teacherNo: string; startTime: string; endTime: string }) => {
if (form.time1.length === 0) {
message.error('审核时间不能为空')
return
}
try {
await addObj({
teacherNo: data.teacherNo,
startTime: data.startTime,
endTime: data.endTime
})
message.success('添加成功')
getDataList()
} catch (error: any) {
message.error(error.msg || '添加失败')
}
}
// 删除
const handleDel = async (row: any) => {
try {
await messageBox.confirm(`是否确认删除工号为${row.teacherNo}的记录?`)
await delObj(row.id)
message.success('删除成功')
getDataList()
} catch {
// 用户取消
}
}
// 重置查询
const resetQuery = () => {
Object.keys(queryForm).forEach(key => {
queryForm[key] = ''
})
getDataList()
}
// 暴露方法
defineExpose({
init
})
</script>
<style lang="scss" scoped>
</style>

View File

@@ -102,6 +102,10 @@
>
导出
</el-button>
<el-button v-if="hasAuth('recruit_preexamPeople_add')" type="primary" plain icon="UserFilled" class="ml10" @click="editExam">
审核人员管理
</el-button>
</div>
<!-- 表格 -->
@@ -191,6 +195,8 @@
:planMajorList="planMajorList"
:schoolList="schoolList"
/>
<pre-exam-people-index ref="PreExamPeopleIndexRef"></pre-exam-people-index>
</div>
</div>
</template>
@@ -208,6 +214,9 @@ import { listcz } from '/@/api/recruit/recruitstudentplan'
import { queryByGroupId as schoolListApi} from '/@/api/recruit/recruitstudentschool'
import { getDeptListByLevelTwo } from '/@/api/basic/basicdept'
const PreExamPeopleIndex = defineAsyncComponent(() => import('@/views/recruit/recruitPreexamPeople/index.vue'));
const PreExamPeopleIndexRef=ref()
const TableForm = defineAsyncComponent(() => import('./enrolplantemplate-form.vue'))
const { hasAuth } = useAuth()
// 消息提示 hooks
@@ -380,6 +389,22 @@ const dataExportHandle = async () => {
}
}
// 编辑审核人员
const editExam = () => {
// 如果组件已经加载,立即初始化
if (PreExamPeopleIndexRef.value && typeof PreExamPeopleIndexRef.value.init === 'function') {
nextTick(() => {
try {
PreExamPeopleIndexRef.value.init();
} catch (error: any) {
message.error('初始化预登记人员弹窗失败:' + (error.message || '未知错误'));
}
});
}
// 否则等待 watch 监听器处理
};
onMounted(() => {
init()
})

View File

@@ -42,13 +42,29 @@
<!-- 操作按钮 -->
<div class="mb15">
<el-button
v-if="hasAuth('recruit_recruitstudentplangroup_add')"
v-if="hasAuth('recruit_recruitstudentschool_add')"
type="primary"
icon="FolderAdd"
@click="addOrUpdateHandle"
>
</el-button>
<el-button
v-auth="'recruit_studentschool_import'"
type="primary"
plain
icon="UploadFilled"
@click="handleImportDialog"
>导入信息
</el-button>
<el-button
v-if="hasAuth('recruit_schoolhistory_view')"
type="plain"
icon="View"
@click="handleShowHistory"
>
变更历史
</el-button>
</div>
<!-- 表格 -->
@@ -109,6 +125,11 @@
<!-- 弹窗, 新增 / 修改 -->
<table-form ref="addOrUpdateRef" @refreshDataList="getDataList" />
<major-group-by-dept-form v-if="majorGroupByDeptVisible" ref="majorGroupByDeptRef" />
<school-history ref="SchoolHistoryRef"></school-history>
<import-recruit-info ref="ImportRecruitInfoRef" @refreshDataList="getDataList"></import-recruit-info>
</div>
</div>
</template>
@@ -124,11 +145,16 @@ import { getDeptList } from '/@/api/basic/basicclass'
const TableForm = defineAsyncComponent(() => import('./detaiform.vue'))
const MajorGroupByDeptForm = defineAsyncComponent(() => import('/@/views/recruit/recruitplanmajor/majorGroupByDept.vue'))
const ImportRecruitInfo = defineAsyncComponent(() => import('/@/views/recruit/common/import-recruit-info.vue'));
const SchoolHistory = defineAsyncComponent(() => import('/@/views/recruit/recruitstudentschool/school-history.vue'))
const { hasAuth } = useAuth()
// 消息提示 hooks
const message = useMessage()
const messageBox = useMessageBox()
const ImportRecruitInfoRef=ref<any>();
const SchoolHistoryRef=ref()
// 表格引用
const tableRef = ref()
const searchFormRef = ref()
@@ -236,6 +262,14 @@ const resetQuery = () => {
getDataList()
}
const handleShowHistory=()=>{
SchoolHistoryRef.value?.init()
}
const handleImportDialog = () => {
ImportRecruitInfoRef.value?.init("R10004");
};
onMounted(() => {
init()
})

View File

@@ -0,0 +1,63 @@
<template>
<el-dialog v-model="visible" width="80%" title="学校变更历史">
<el-table ref="tableRef"
:data="state.dataList"
v-loading="state.loading"
border
stripe
row-key="id"
:cell-style="tableStyle.cellStyle"
:header-cell-style="tableStyle.headerCellStyle">
<el-table-column label="学校代码" prop="schoolCode"></el-table-column>
<el-table-column label="旧名称" prop="oldName"></el-table-column>
<el-table-column label="新名称" prop="newName"></el-table-column>
<el-table-column label="变动时间" prop="createTime"></el-table-column>
</el-table>
<pagination
v-bind="state.pagination"
@current-change="currentChangeHandle"
@size-change="sizeChangeHandle"
/>
</el-dialog>
</template>
<script setup lang="ts">
import {useTable,BasicTableProps} from "/@/hooks/table";
import {fetchList} from "/@/api/recruit/recruitSchoolHistory";
// 表格状态
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {},
createdIsNeed: false,
pageList: async (params: any) => {
const response = await fetchList(params)
return {
data: {
records: response.data.records,
total: response.data.total
}
}
},
createdIsNeed: false
})
const visible = ref(false)
const { getDataList, currentChangeHandle, sizeChangeHandle, tableStyle } = useTable(state)
const init=()=>{
visible.value = true
getDataList()
}
defineExpose({
init
})
</script>
<style scoped lang="scss">
</style>