From 33b228da9a6ac298a5bdf8ba68f8b0649072a0b8 Mon Sep 17 00:00:00 2001 From: yaojian <1161995598@qq.com> Date: Tue, 10 Mar 2026 17:50:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E5=87=BA=E5=A4=B4=E5=83=8F=20?= =?UTF-8?q?=E5=AD=A6=E7=B1=8D=E5=8D=A1=E5=AF=BC=E5=87=BA=20=E9=A1=B6?= =?UTF-8?q?=E5=B2=97=E7=94=B3=E8=AF=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/basic/basicstudent.ts | 3 +- src/views/basic/basicstudent/index.vue | 117 ++++++++++++++++++++++++- 2 files changed, 115 insertions(+), 5 deletions(-) diff --git a/src/api/basic/basicstudent.ts b/src/api/basic/basicstudent.ts index 8d948c1..dc008d4 100644 --- a/src/api/basic/basicstudent.ts +++ b/src/api/basic/basicstudent.ts @@ -504,11 +504,10 @@ export const exportStudentData = (data: any) => { /** * 申请顶岗 * @param data - * TODO: 接口文档中未找到此接口,请提供正确的接口地址 */ export const applyInternship = (data: any) => { return request({ - url: '/basic/basicstudent/applyInternship', // TODO: 接口文档中未找到此接口 + url: '/work/jobfairstu/batchSaveJobFairStu', method: 'post', data: data, }); diff --git a/src/views/basic/basicstudent/index.vue b/src/views/basic/basicstudent/index.vue index 446e089..df47feb 100644 --- a/src/views/basic/basicstudent/index.vue +++ b/src/views/basic/basicstudent/index.vue @@ -277,6 +277,25 @@ + + + + + + + + + + + + @@ -361,6 +380,13 @@ const exportFieldLoading = ref(false); const selectedExportFields = ref([]); const exportFieldCheckAll = ref(false); const exportFieldIndeterminate = ref(false); +// 申请顶岗相关 +const applyInternshipDialogVisible = ref(false); +const applyInternshipLoading = ref(false); +const workYearList = ref([]); +const applyInternshipForm = reactive({ + year: '', +}); // 表格列配置 const tableColumns = [ @@ -632,12 +658,76 @@ const handleExportFieldConfirm = async () => { // 申请顶岗 const handleApplyInternship = async () => { - useMessage().warning('功能开发中'); + if (selectedRows.value.length === 0) { + useMessage().warning('请先选择要申请顶岗的学生'); + return; + } + + // 获取顶岗年份字典 + try { + const yearRes = await getDicts('work_year'); + if (yearRes.data && Array.isArray(yearRes.data)) { + workYearList.value = yearRes.data.map((item: any) => ({ + label: item.label || item.dictLabel || item.name, + value: item.value || item.dictValue || item.code, + })); + } + // 重置表单并打开弹窗 + applyInternshipForm.year = ''; + applyInternshipDialogVisible.value = true; + } catch (err: any) { + useMessage().error(err.msg || '获取顶岗年份失败'); + } +}; + +// 确认申请顶岗 +const handleApplyInternshipConfirm = async () => { + if (!applyInternshipForm.year) { + useMessage().warning('请选择顶岗年份'); + return; + } + + applyInternshipLoading.value = true; + try { + // 构建请求数据 + const stuList = selectedRows.value.map((row) => ({ stuNo: row.stuNo })); + await applyInternship({ stuList, year: applyInternshipForm.year }); + useMessage().success('申请顶岗成功'); + applyInternshipDialogVisible.value = false; + getDataList(); + } catch (err: any) { + useMessage().error(err.msg || '申请顶岗失败'); + } finally { + applyInternshipLoading.value = false; + } }; // 导出头像 const handleExportAvatar = async () => { - useMessage().warning('功能开发中'); + if (!searchForm.classCode) { + useMessage().warning('请先选择班级'); + return; + } + + try { + const res = await getDownPic({ + classCode: searchForm.classCode, + stuStatus: searchForm.stuStatus || '1', + }); + // 处理blob下载 + const blob = new Blob([res], { type: 'application/zip' }); + const url = window.URL.createObjectURL(blob); + const link = document.createElement('a'); + link.href = url; + link.download = `学生头像_${searchForm.classCode}.zip`; + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + window.URL.revokeObjectURL(url); + useMessage().success('导出成功'); + } catch (err: any) { + useMessage().error(err.msg || '导出失败'); + } }; // 批量打印 @@ -692,7 +782,28 @@ const handleUploadError = (err: any) => { // 学籍卡导出 const handleExportStudentCard = async () => { - useMessage().warning('功能开发中'); + if (selectedRows.value.length === 0) { + useMessage().warning('请先选择要导出学籍卡的学生'); + return; + } + + try { + const stuNoList = selectedRows.value.map((row) => row.stuNo); + const res = await exportStuInfoCard({ stuNoList }); + // 处理blob下载 + const blob = new Blob([res], { type: 'application/zip' }); + const url = window.URL.createObjectURL(blob); + const link = document.createElement('a'); + link.href = url; + link.download = '学籍卡.zip'; + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + window.URL.revokeObjectURL(url); + useMessage().success('学籍卡导出成功'); + } catch (err: any) { + useMessage().error(err.msg || '学籍卡导出失败'); + } }; // 证书导出