学生信息页面完善
This commit is contained in:
@@ -226,6 +226,9 @@
|
||||
<!-- 简单信息维护对话框 -->
|
||||
<SimpleEditDialog ref="simpleEditDialogRef" @refresh="getDataList(false)" />
|
||||
|
||||
<!-- 学生证件照打印 -->
|
||||
<PrintDialog ref="printDialogRef" />
|
||||
|
||||
<!-- 段段清证书导入对话框 -->
|
||||
<el-dialog title="段段清证书导入" v-model="importCertificateDialogVisible" :close-on-click-modal="false" draggable width="500px">
|
||||
<el-upload
|
||||
@@ -335,7 +338,7 @@ import {
|
||||
preBatchPrint,
|
||||
importCertificate,
|
||||
exportStuInfoCard,
|
||||
exportCertificate,
|
||||
makeExportSkillLevelTask,
|
||||
resetPassWord,
|
||||
editIsleader,
|
||||
updateInout,
|
||||
@@ -355,12 +358,14 @@ import { makeExportClassRoomHygieneMonthlyTask } from '/@/api/stuwork/file';
|
||||
const FormDialog = defineAsyncComponent(() => 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(`
|
||||
<html>
|
||||
<head><title>学生证件照打印</title></head>
|
||||
<body>
|
||||
<h2 style="text-align:center;">学生证打印</h2>
|
||||
<div style="text-align:center;">
|
||||
<p><strong>姓名:</strong>${res.data.realName || row.realName || '-'}</p>
|
||||
<p><strong>学号:</strong>${res.data.stuNo || row.stuNo || '-'}</p>
|
||||
<p><strong>班级:</strong>${res.data.className || row.className || '-'}</p>
|
||||
<p><strong>身份证号:</strong>${res.data.idCard || row.idCard || '-'}</p>
|
||||
</div>
|
||||
<script>window.onload = function() { window.print(); }<\/script>
|
||||
</body>
|
||||
</html>
|
||||
`);
|
||||
printWindow.document.close();
|
||||
}
|
||||
}
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg || '获取打印信息失败');
|
||||
}
|
||||
const handlePrintPhoto = (row: any) => {
|
||||
printDialogRef.value?.openSingleDialog(row);
|
||||
};
|
||||
|
||||
// 重置密码
|
||||
|
||||
Reference in New Issue
Block a user