From d92cb8634bb438633371a95cfd3d4bc9b130ce08 Mon Sep 17 00:00:00 2001 From: yaojian <1161995598@qq.com> Date: Tue, 10 Mar 2026 14:27:36 +0800 Subject: [PATCH 1/8] 1 --- src/views/stuwork/stuconduct/index.vue | 134 ++------------------- src/views/stuwork/stuunionleague/index.vue | 92 ++------------ 2 files changed, 24 insertions(+), 202 deletions(-) diff --git a/src/views/stuwork/stuconduct/index.vue b/src/views/stuwork/stuconduct/index.vue index ef8989f..46885eb 100644 --- a/src/views/stuwork/stuconduct/index.vue +++ b/src/views/stuwork/stuconduct/index.vue @@ -64,9 +64,7 @@
新增 - 导入行为记录 - 导入考核模板 - 导入考核 + 导入考核 - - - - -
将文件拖到此处,或点击上传
- -
- -
- - -
- 下载模板 -
- - -
将文件拖到此处,或点击上传
- -
- -
+
@@ -211,8 +181,7 @@ import { reactive, ref, onMounted, computed, nextTick } from 'vue'; import { useRoute } from 'vue-router'; import { BasicTableProps, useTable } from '/@/hooks/table'; -import { fetchList, delObj, importExcel } from '/@/api/stuwork/stuconduct'; -import { exportConductAssessmentTemplate, importConductAssessment, downloadBlobFile } from '/@/api/stuwork/file'; +import { fetchList, delObj } from '/@/api/stuwork/stuconduct'; import { getDeptList } from '/@/api/basic/basicclass'; import { queryAllSchoolYear } from '/@/api/basic/basicyear'; import { getClassListByRole } from '/@/api/basic/basicclass'; @@ -220,7 +189,6 @@ import { getDicts } from '/@/api/admin/dict'; import { useMessage, useMessageBox } from '/@/hooks/message'; import TableColumnControl from '/@/components/TableColumnControl/index.vue'; import { - UploadFilled, List, CreditCard, Calendar, @@ -242,7 +210,6 @@ import FormDialog from './form.vue'; const route = useRoute(); const formDialogRef = ref(); const columnControlRef = ref(); -const uploadRef = ref(); const searchFormRef = ref(); const showSearch = ref(true); const schoolYearList = ref([]); @@ -250,12 +217,7 @@ const schoolTermList = ref([]); const deptList = ref([]); const classList = ref([]); const typeList = ref([]); -const importDialogVisible = ref(false); -const importFile = ref(null); -const importLoading = ref(false); -const conductImportDialogVisible = ref(false); -const conductImportFile = ref(null); -const conductImportLoading = ref(false); +const conductUploadExcelRef = ref(); // 表格列配置 const tableColumns = [ @@ -357,81 +319,9 @@ const handleViewAttachment = (row: any) => { } }; -// 导入 -const handleImport = () => { - importDialogVisible.value = true; - importFile.value = null; - uploadRef.value?.clearFiles(); -}; - -// 文件变化 -const handleFileChange = (file: any) => { - importFile.value = file.raw; -}; - -// 提交导入 -const handleImportSubmit = async () => { - if (!importFile.value) { - useMessage().warning('请先选择要上传的文件'); - return; - } - - importLoading.value = true; - try { - await importExcel(importFile.value); - useMessage().success('导入成功'); - importDialogVisible.value = false; - importFile.value = null; - uploadRef.value?.clearFiles(); - getDataList(); - } catch (err: any) { - useMessage().error(err.msg || '导入失败'); - } finally { - importLoading.value = false; - } -}; - -// 下载操行考核导入模板 -const handleDownloadConductTemplate = async () => { - try { - await downloadBlobFile(exportConductAssessmentTemplate(), `操行考核导入模板_${Date.now()}.xlsx`); - } catch (err: any) { - useMessage().error(err?.msg || '下载模板失败'); - } -}; - -// 打开操行考核导入弹窗 +// 导入操行考核 const handleConductImport = () => { - conductImportDialogVisible.value = true; - conductImportFile.value = null; -}; - -// 操行考核文件变化 -const handleConductFileChange = (file: any) => { - conductImportFile.value = file.raw; -}; - -// 提交操行考核导入 -const handleConductImportSubmit = async () => { - if (!conductImportFile.value) { - useMessage().warning('请先选择要上传的文件'); - return; - } - - conductImportLoading.value = true; - try { - const formData = new FormData(); - formData.append('file', conductImportFile.value); - await importConductAssessment(formData); - useMessage().success('导入成功'); - conductImportDialogVisible.value = false; - conductImportFile.value = null; - getDataList(); - } catch (err: any) { - useMessage().error(err.msg || '导入失败'); - } finally { - conductImportLoading.value = false; - } + conductUploadExcelRef.value?.show(); }; // 编辑 diff --git a/src/views/stuwork/stuunionleague/index.vue b/src/views/stuwork/stuunionleague/index.vue index f731baf..ad8dfa3 100644 --- a/src/views/stuwork/stuunionleague/index.vue +++ b/src/views/stuwork/stuunionleague/index.vue @@ -208,39 +208,15 @@ - + - - - -
- 将文件拖到此处,或点击上传 -
- -
- -
+ () const searchFormRef = ref() -const uploadRef = ref() +const uploadExcelRef = ref() const showSearch = ref(true) const classList = ref([]) const gradeList = ref([]) -const importDialogVisible = ref(false) -const importLoading = ref(false) -const fileList = ref([]) // 统计相关变量 const statisticsDialogVisible = ref(false) @@ -420,47 +392,7 @@ const handleDelete = async (row: any) => { // 导入 const handleImport = () => { - importDialogVisible.value = true - fileList.value = [] -} - -// 文件变化 -const handleFileChange = (file: UploadFile, files: UploadFiles) => { - fileList.value = [file] -} - -// 文件超出限制 -const handleExceed = () => { - useMessage().warning('文件数量超出限制') -} - -// 提交导入 -const handleImportSubmit = async () => { - if (fileList.value.length === 0) { - useMessage().warning('请先选择要上传的文件') - return - } - - const file = fileList.value[0].raw - if (!file) { - useMessage().warning('文件无效') - return - } - - importLoading.value = true - try { - const formData = new FormData() - formData.append('file', file as File) - await importStuUnionLeague(formData) - useMessage().success('导入成功') - importDialogVisible.value = false - fileList.value = [] - getDataList() - } catch (err: any) { - useMessage().error(err.msg || '导入失败') - } finally { - importLoading.value = false - } + uploadExcelRef.value?.show() } // 导出 From 7e4f5e1e9b231997a9ffcff72adb8ba4f513d649 Mon Sep 17 00:00:00 2001 From: yaojian <1161995598@qq.com> Date: Tue, 10 Mar 2026 17:09:43 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E5=AD=A6=E7=94=9F=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E8=A1=A5=E5=85=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/basic/basicstudent.ts | 12 + .../basicstudent/components/SimpleEdit.vue | 2 + .../basicstudent/components/StudentDetail.vue | 333 ++++++++++++++++++ src/views/basic/basicstudent/index.vue | 116 +++++- 4 files changed, 449 insertions(+), 14 deletions(-) create mode 100644 src/views/basic/basicstudent/components/StudentDetail.vue diff --git a/src/api/basic/basicstudent.ts b/src/api/basic/basicstudent.ts index bed758c..8d948c1 100644 --- a/src/api/basic/basicstudent.ts +++ b/src/api/basic/basicstudent.ts @@ -52,6 +52,18 @@ export const getObj = (id: string | number) => { }); }; +/** + * 根据学号获取学生详细信息(用于详情页面) + * @param query + */ +export const getStudentInfoDetail = (query: any) => { + return request({ + url: '/basic/basicstudentinfo/page', + method: 'get', + params: query, + }); +}; + /** * 根据学号获取信息 * @param stuNo diff --git a/src/views/basic/basicstudent/components/SimpleEdit.vue b/src/views/basic/basicstudent/components/SimpleEdit.vue index 555e9b9..7e9717e 100644 --- a/src/views/basic/basicstudent/components/SimpleEdit.vue +++ b/src/views/basic/basicstudent/components/SimpleEdit.vue @@ -35,6 +35,7 @@ const loading = ref(false); // 提交表单数据 const form = reactive({ id: '', + stuNo: '', realName: '', oldName: '', idCard: '', @@ -58,6 +59,7 @@ const openDialog = (rowData: any) => { Object.assign(form, { id: rowData.id || '', realName: rowData.realName || '', + stuNo: rowData.stuNo || '', oldName: rowData.oldName || '', idCard: rowData.idCard || '', }); diff --git a/src/views/basic/basicstudent/components/StudentDetail.vue b/src/views/basic/basicstudent/components/StudentDetail.vue new file mode 100644 index 0000000..491582e --- /dev/null +++ b/src/views/basic/basicstudent/components/StudentDetail.vue @@ -0,0 +1,333 @@ + + + + + \ No newline at end of file diff --git a/src/views/basic/basicstudent/index.vue b/src/views/basic/basicstudent/index.vue index 4d52197..446e089 100644 --- a/src/views/basic/basicstudent/index.vue +++ b/src/views/basic/basicstudent/index.vue @@ -62,8 +62,8 @@ - - + + 查询 @@ -199,7 +199,16 @@ 取消班干部 设为班干部 - 禁止进出 + + 禁止进出 + + 允许进出 @@ -291,6 +300,7 @@ import { Tickets, Medal, Lock, + Unlock, DataAnalysis, Setting, Menu, @@ -324,7 +334,7 @@ import { makeExportClassRoomHygieneMonthlyTask } from '/@/api/stuwork/file'; // 引入组件 const FormDialog = defineAsyncComponent(() => import('./form.vue')); -const DetailDialog = defineAsyncComponent(() => import('./detail.vue')); +const DetailDialog = defineAsyncComponent(() => import('./components/StudentDetail.vue')); const SimpleEditDialog = defineAsyncComponent(() => import('./components/SimpleEdit.vue')); // 定义变量内容 @@ -504,7 +514,7 @@ const searchForm = reactive({ parkingCard: '', completion: '', isUnionClass: '', - keyword: '', + total: '', }); // 配置 useTable @@ -546,7 +556,7 @@ const handleReset = () => { parkingCard: '', completion: '', isUnionClass: '', - keyword: '', + total: '', }); getDataList(); }; @@ -692,37 +702,115 @@ const handleExportCertificate = async () => { // 简单信息维护 const handleSimpleEdit = (row: any) => { - useMessage().warning('功能开发中'); + simpleEditDialogRef.value?.openDialog(row); }; // 查看详情 const handleViewDetail = (row: any) => { - useMessage().warning('功能开发中'); + detailDialogRef.value?.openDialog(row); }; // 打印证件照 const handlePrintPhoto = async (row: any) => { - useMessage().warning('功能开发中'); + if (!row.stuNo) { + useMessage().warning('学号不存在'); + return; + } + try { + const res = await prePrint(row.stuNo); + if (res.data) { + // 打开新窗口进行打印 + const printWindow = window.open('', '_blank'); + if (printWindow) { + printWindow.document.write(` + + 学生证件照打印 + +

学生证打印

+
+

姓名:${res.data.realName || row.realName || '-'}

+

学号:${res.data.stuNo || row.stuNo || '-'}

+

班级:${res.data.className || row.className || '-'}

+

身份证号:${res.data.idCard || row.idCard || '-'}

+
+ + + \ No newline at end of file diff --git a/src/views/basic/basicstudent/index.vue b/src/views/basic/basicstudent/index.vue index df47feb..24e1b8b 100644 --- a/src/views/basic/basicstudent/index.vue +++ b/src/views/basic/basicstudent/index.vue @@ -226,6 +226,9 @@ + + + import('./form.vue')); const DetailDialog = defineAsyncComponent(() => import('./components/StudentDetail.vue')); const SimpleEditDialog = defineAsyncComponent(() => import('./components/SimpleEdit.vue')); +const PrintDialog = defineAsyncComponent(() => import('./components/StudentIdCardPrint.vue')); // 定义变量内容 const route = useRoute(); const formDialogRef = ref(); const detailDialogRef = ref(); const simpleEditDialogRef = ref(); +const printDialogRef = ref(); const searchFormRef = ref(); const uploadRef = ref(); const columnControlRef = ref(); @@ -731,8 +736,12 @@ const handleExportAvatar = async () => { }; // 批量打印 -const handleBatchPrint = async () => { - useMessage().warning('功能开发中'); +const handleBatchPrint = () => { + if (selectedRows.value.length === 0) { + useMessage().warning('请先选择要打印的学生'); + return; + } + printDialogRef.value?.openDialog(selectedRows.value); }; // 段段清证书导入 @@ -808,7 +817,15 @@ const handleExportStudentCard = async () => { // 证书导出 const handleExportCertificate = async () => { - useMessage().warning('功能开发中'); + try { + await makeExportSkillLevelTask({ + deptCode: searchForm.deptCode, + classCode: searchForm.classCode, + }); + useMessage().success('导出任务已创建,请在文件管理中下载'); + } catch (err: any) { + useMessage().error(err.msg || '创建导出任务失败'); + } }; // 简单信息维护 @@ -822,38 +839,8 @@ const handleViewDetail = (row: any) => { }; // 打印证件照 -const handlePrintPhoto = async (row: any) => { - if (!row.stuNo) { - useMessage().warning('学号不存在'); - return; - } - try { - const res = await prePrint(row.stuNo); - if (res.data) { - // 打开新窗口进行打印 - const printWindow = window.open('', '_blank'); - if (printWindow) { - printWindow.document.write(` - - 学生证件照打印 - -

学生证打印

-
-

姓名:${res.data.realName || row.realName || '-'}

-

学号:${res.data.stuNo || row.stuNo || '-'}

-

班级:${res.data.className || row.className || '-'}

-

身份证号:${res.data.idCard || row.idCard || '-'}

-
-