学生页面补全
This commit is contained in:
@@ -62,8 +62,8 @@
|
||||
<el-option label="否" value="0" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="姓名/学号/身份证号" prop="keyword">
|
||||
<el-input v-model="searchForm.keyword" placeholder="请输入姓名/学号/身份证号" clearable style="width: 200px" />
|
||||
<el-form-item label="姓名/学号/身份证号" prop="total">
|
||||
<el-input v-model="searchForm.total" placeholder="请输入姓名/学号/身份证号" clearable style="width: 200px" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" plain icon="Search" @click="handleSearch">查询</el-button>
|
||||
@@ -199,7 +199,16 @@
|
||||
取消班干部
|
||||
</el-button>
|
||||
<el-button v-else icon="User" text type="success" @click="handleSetLeader(scope.row)"> 设为班干部 </el-button>
|
||||
<el-button icon="Lock" text type="danger" @click="handleForbidInout(scope.row)"> 禁止进出 </el-button>
|
||||
<el-button
|
||||
v-if="scope.row.isInout == 1 || scope.row.isInout === '1'"
|
||||
icon="Lock"
|
||||
text
|
||||
type="danger"
|
||||
@click="handleForbidInout(scope.row)"
|
||||
>
|
||||
禁止进出
|
||||
</el-button>
|
||||
<el-button v-else icon="Unlock" text type="success" @click="handleForbidInout(scope.row)"> 允许进出 </el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -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(`
|
||||
<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 handleResetPassword = async (row: any) => {
|
||||
useMessage().warning('功能开发中');
|
||||
try {
|
||||
await useMessageBox().confirm(`确定要重置学生【${row.realName}】的密码吗?重置后密码将变为默认密码。`);
|
||||
await resetPassWord(row);
|
||||
useMessage().success('密码重置成功');
|
||||
} catch (err: any) {
|
||||
if (err !== 'cancel') {
|
||||
useMessage().error(err.msg || '密码重置失败');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// 设为班干部
|
||||
const handleSetLeader = async (row: any) => {
|
||||
useMessage().warning('功能开发中');
|
||||
try {
|
||||
await useMessageBox().confirm(`确定要将学生【${row.realName}】设为班干部吗?`);
|
||||
await editIsleader({
|
||||
id: row.id,
|
||||
stuNo: row.stuNo,
|
||||
isClassLeader: 1
|
||||
});
|
||||
useMessage().success('设置成功');
|
||||
getDataList();
|
||||
} catch (err: any) {
|
||||
if (err !== 'cancel') {
|
||||
useMessage().error(err.msg || '设置失败');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// 取消班干部
|
||||
const handleCancelLeader = async (row: any) => {
|
||||
useMessage().warning('功能开发中');
|
||||
try {
|
||||
await useMessageBox().confirm(`确定要取消学生【${row.realName}】的班干部身份吗?`);
|
||||
await editIsleader({
|
||||
id: row.id,
|
||||
stuNo: row.stuNo,
|
||||
isClassLeader: 0
|
||||
});
|
||||
useMessage().success('取消成功');
|
||||
getDataList();
|
||||
} catch (err: any) {
|
||||
if (err !== 'cancel') {
|
||||
useMessage().error(err.msg || '取消失败');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// 禁止进出
|
||||
// 禁止进出/允许进出
|
||||
const handleForbidInout = async (row: any) => {
|
||||
useMessage().warning('功能开发中');
|
||||
const isForbid = row.isInout === 1 || row.isInout === '1';
|
||||
const action = isForbid ? '禁止' : '允许';
|
||||
try {
|
||||
await useMessageBox().confirm(`确定要${action}学生【${row.realName}】进出吗?`);
|
||||
await updateInout({
|
||||
stuNo: row.stuNo,
|
||||
isInout: isForbid ? 0 : 1
|
||||
});
|
||||
useMessage().success(`${action}进出设置成功`);
|
||||
getDataList();
|
||||
} catch (err: any) {
|
||||
if (err !== 'cancel') {
|
||||
useMessage().error(err.msg || '设置失败');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// 获取学院列表
|
||||
|
||||
Reference in New Issue
Block a user