This commit is contained in:
zlwu committed 2025-07-28 01:26:18 +08:00
1 parent e5113f1bec
commit 50ecada4d4
31 files changed
+9822 -35

No files matched your search

+63
View File
@@ -0,0 +1,63 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { StuColBatchVO, StuColBatchForm, StuColBatchQuery } from '@/api/stuMsgAudit/types';
/**
* 查询学生信息收集批次列表
* @param query
* @returns {*}
*/
export const listStuColBatch = (query?: StuColBatchQuery): AxiosPromise<StuColBatchVO[]> => {
return request({
url: '/XgStuColBatch/stuColBatch/list',
method: 'get',
params: query
});
};
/**
* 查询学生信息收集批次详细
* @param id
*/
export const getStuColBatch = (id: string | number): AxiosPromise<StuColBatchVO> => {
return request({
url: '/XgStuColBatch/stuColBatch/' + id,
method: 'get'
});
};
/**
* 新增学生信息收集批次
* @param data
*/
export const addStuColBatch = (data: StuColBatchForm) => {
return request({
url: '/XgStuColBatch/stuColBatch',
method: 'post',
data: data
});
};
/**
* 修改学生信息收集批次
* @param data
*/
export const updateStuColBatch = (data: StuColBatchForm) => {
return request({
url: '/XgStuColBatch/stuColBatch',
method: 'put',
data: data
});
};
/**
* 删除学生信息收集批次
* @param id
*/
export const delStuColBatch = (id: string | number | Array<string | number>) => {
return request({
url: '/XgStuColBatch/stuColBatch/' + id,
method: 'delete'
});
};
+101
View File
@@ -0,0 +1,101 @@
export interface StuColBatchVO {
/**
* 批次ID
*/
id: string | number;
/**
* 批次名称
*/
batchName: string;
/**
* 批次描述
*/
description: string;
/**
* 开始时间
*/
startTime: string;
/**
* 结束时间
*/
endTime: string;
/**
* 状态(0正常 1停用)
*/
status: string;
/**
* 收集类型 1 - 新学期收集 2 - 其他
*/
collectionType: string;
}
export interface StuColBatchForm extends BaseEntity {
/**
* 批次ID
*/
id?: string | number;
/**
* 批次名称
*/
batchName?: string;
/**
* 批次描述
*/
description?: string;
/**
* 开始时间
*/
startTime?: string;
/**
* 结束时间
*/
endTime?: string;
/**
* 状态(0正常 1停用)
*/
status?: string;
/**
* 收集类型 1 - 新学期收集 2 - 其他
*/
collectionType?: string;
}
export interface StuColBatchQuery extends PageQuery {
/**
* 批次名称
*/
batchName?: string;
/**
* 状态(0正常 1停用)
*/
status?: string;
/**
* 收集类型 1 - 新学期收集 2 - 其他
*/
collectionType?: string;
/**
* 日期范围参数
*/
params?: any;
}
+889
View File
@@ -0,0 +1,889 @@
<template>
<div class="audit-dialog">
<el-dialog v-model="visible" :title="title" width="80%" append-to-body :before-close="handleClose" top="5vh" class="audit-dialog-container">
<div class="layout-container">
<!-- 部门树 -->
<div class="left-panel">
<el-card shadow="hover">
<el-input v-model="deptName" placeholder="请输入院系名称" prefix-icon="Search" clearable />
<el-tree
ref="deptTreeRef"
class="mt-2 dept-tree"
node-key="id"
:data="deptOptions"
:props="{ label: 'label', children: 'children', disabled: 'disabled' }"
:expand-on-click-node="false"
:filter-node-method="filterNode"
highlight-current
default-expand-all
@node-click="handleNodeClick"
/>
</el-card>
</div>
<!-- 右侧内容区域 -->
<div class="right-panel">
<!-- 搜索表单 -->
<div class="mb-[10px]">
<el-card shadow="hover">
<el-form ref="queryFormRef" :model="queryParams">
<el-row :gutter="20">
<el-col :span="6">
<el-form-item label="学生姓名" prop="name">
<el-input v-model="queryParams.name" placeholder="请输入学生姓名" clearable @keyup.enter="handleQuery" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="学号" prop="studentNo">
<el-input v-model="queryParams.studentNo" placeholder="请输入学号" clearable @keyup.enter="handleQuery" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="手机号码" prop="phone">
<el-input v-model="queryParams.phone" placeholder="请输入手机号码" clearable @keyup.enter="handleQuery" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="提交状态" prop="submitStatus">
<el-select v-model="queryParams.submitStatus" placeholder="提交状态" clearable>
<!-- 3-审核中,4-已驳回,5-已锁定 -->
<el-option label="审核中" value="3" />
<el-option label="已驳回" value="4" />
<el-option label="已锁定" value="5" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24" class="search-btn-container">
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
</div>
<!-- 学生信息表格 -->
<el-card shadow="hover">
<!-- <template #header>
<div class="card-header">
<span>学生信息审核 - {{ batchInfo?.batchName || '未知批次' }}</span>
<div class="header-actions">
<el-button type="success" icon="Check" :disabled="!hasSelected" @click="handleBatchApprove"> 批量通过 </el-button>
<el-button type="danger" icon="Close" :disabled="!hasSelected" @click="handleBatchReject"> 批量拒绝 </el-button>
</div>
</div>
</template> -->
<el-table v-loading="loading" border :data="studentList" @selection-change="handleSelectionChange" class="right-table">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="学号" align="center" prop="studentNo" :show-overflow-tooltip="true" />
<el-table-column label="姓名" align="center" prop="name" :show-overflow-tooltip="true" />
<el-table-column label="院系" align="center" prop="collegeName" :show-overflow-tooltip="true" />
<el-table-column label="专业" align="center" prop="majorName" :show-overflow-tooltip="true" />
<el-table-column label="班级" align="center" prop="className" :show-overflow-tooltip="true" />
<el-table-column label="手机号码" align="center" prop="phone" width="120" />
<el-table-column label="提交状态" align="center" width="120">
<template #default="scope">
<el-tag :type="getSubmitStatusType(scope.row.infoStatus)">
{{ getSubmitStatusLabel(scope.row.infoStatus) }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="提交时间" align="center" prop="createTime" width="160">
<template #default="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="180" class-name="small-padding fixed-right" fixed="right">
<template #default="scope">
<el-tooltip content="审核" placement="top">
<el-button link type="primary" icon="View" @click="handleAuditStudent(scope.row)" :disabled="scope.row.submitStatus === '0'">
审核
</el-button>
</el-tooltip>
<el-tooltip content="查看详情" placement="top">
<el-button link type="info" icon="Document" @click="handleViewDetail(scope.row)"> 详情 </el-button>
</el-tooltip>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" :page="queryParams.pageNum" :limit="queryParams.pageSize" @pagination="getList" />
</el-card>
</div>
</div>
<!-- <template #footer>
<div class="dialog-footer">
<el-button @click="handleClose">关 闭</el-button>
</div>
</template> -->
</el-dialog>
<!-- 学生审核详情弹窗 -->
<el-dialog v-model="auditDetailDialog.visible" :title="auditDetailDialog.title" width="800px" append-to-body>
<div v-if="currentAuditStudent">
<el-descriptions :column="2" border>
<el-descriptions-item label="学号">{{ currentAuditStudent.studentNo }}</el-descriptions-item>
<el-descriptions-item label="姓名">{{ currentAuditStudent.name }}</el-descriptions-item>
<el-descriptions-item label="院系">{{ currentAuditStudent.collegeName }}</el-descriptions-item>
<el-descriptions-item label="专业">{{ currentAuditStudent.majorName }}</el-descriptions-item>
<el-descriptions-item label="班级">{{ currentAuditStudent.className }}</el-descriptions-item>
<el-descriptions-item label="手机号码">{{ currentAuditStudent.phone }}</el-descriptions-item>
<el-descriptions-item label="提交状态" :span="2">
<el-tag :type="getSubmitStatusType(currentAuditStudent.submitStatus)">
{{ getSubmitStatusLabel(currentAuditStudent.submitStatus) }}
</el-tag>
</el-descriptions-item>
<el-descriptions-item label="提交时间" :span="2">
{{ parseTime(currentAuditStudent.submitTime, '{y}-{m}-{d} {h}:{i}:{s}') }}
</el-descriptions-item>
</el-descriptions>
<div class="mt-4">
<el-form ref="auditFormRef" :model="auditForm" label-width="100px">
<el-form-item label="审核结果" prop="auditResult">
<el-radio-group v-model="auditForm.auditResult">
<el-radio label="2">通过</el-radio>
<el-radio label="3">不通过</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="审核意见" prop="auditRemark">
<el-input v-model="auditForm.auditRemark" type="textarea" :rows="4" placeholder="请输入审核意见" />
</el-form-item>
</el-form>
</div>
</div>
<template #footer>
<div class="dialog-footer">
<el-button :loading="auditLoading" type="primary" @click="submitAudit">确定审核</el-button>
<el-button @click="auditDetailDialog.visible = false">取 消</el-button>
</div>
</template>
</el-dialog>
<!-- 学生信息详情弹窗 -->
<component
:is="StuMsgDialogComponent"
:visible="stuMsgDialogVisible"
:title="stuMsgDialogTitle"
:batchInfo="stuMsgBatchInfo"
@update:visible="stuMsgDialogVisible = $event"
@confirm="handleStuMsgConfirm"
v-if="StuMsgDialogComponent"
/>
<!-- 学生详情查看弹窗 -->
<component
:is="StuMsgDetailDialogComponent"
:visible="stuMsgDetailDialogVisible"
:title="stuMsgDetailDialogTitle"
:batchInfo="stuMsgDetailBatchInfo"
@update:visible="stuMsgDetailDialogVisible = $event"
v-if="StuMsgDetailDialogComponent"
/>
</div>
</template>
<script setup lang="ts">
import { getCurrentInstance, ComponentInternalInstance, ref, reactive, computed, watch, onMounted, nextTick, defineAsyncComponent } from 'vue';
import ElMessage from 'element-plus/es/components/message/index';
import ElMessageBox from 'element-plus/es/components/message-box/index';
// @ts-ignore
import request from '@/utils/request';
// 动态加载StuMsgDialog组件
const StuMsgDialogComponent = defineAsyncComponent(() => import('./stuMsgDialog.vue'));
// 动态加载学生详情弹窗组件
const StuMsgDetailDialogComponent = defineAsyncComponent(() => import('./stuMsgDetailDialog.vue'));
interface StudentAuditInfo {
id: string | number;
studentNo: string;
name: string;
collegeName: string;
majorName: string;
className: string;
phone: string;
submitStatus: string;
submitTime: string;
auditResult?: string;
auditRemark?: string;
auditTime?: string;
}
interface QueryParams {
pageNum: number;
pageSize: number;
name: string;
studentNo: string;
phone: string;
submitStatus: string;
deptId?: number;
}
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
// Props
const props = defineProps<{
visible: boolean;
title: string;
batchInfo: any;
}>();
// Emits
const emit = defineEmits<{
'update:visible': [value: boolean];
confirm: [data: any];
}>();
// 响应式数据
const visible = computed({
get: () => props.visible,
set: (value: boolean) => emit('update:visible', value)
});
const loading = ref(false);
const total = ref(0);
const studentList = ref<StudentAuditInfo[]>([]);
const selectedStudents = ref<StudentAuditInfo[]>([]);
const deptName = ref('');
const deptOptions = ref<any[]>([]);
const currentSelectedNode = ref<any>(null);
// 计算属性
const hasSelected = computed(() => selectedStudents.value.length > 0);
// 查询参数
const queryParams = reactive<QueryParams>({
pageNum: 1,
pageSize: 10,
name: '',
studentNo: '',
phone: '',
submitStatus: '',
deptId: undefined
});
// 审核详情弹窗
const auditDetailDialog = reactive({
visible: false,
title: '学生信息审核'
});
const currentAuditStudent = ref<StudentAuditInfo | null>(null);
const auditLoading = ref(false);
const auditForm = reactive({
auditResult: '2',
auditRemark: ''
});
// Refs
const deptTreeRef = ref();
const queryFormRef = ref();
const auditFormRef = ref();
// 学生信息详情弹窗相关数据
const stuMsgDialogVisible = ref(false);
const stuMsgDialogTitle = ref('学生信息审核');
const stuMsgBatchInfo = ref<any>(null);
// 学生详情查看弹窗相关数据
const stuMsgDetailDialogVisible = ref(false);
const stuMsgDetailDialogTitle = ref('学生信息详情查看');
const stuMsgDetailBatchInfo = ref<any>(null);
/** 通过条件过滤节点 */
const filterNode = (value: string, data: any) => {
if (!value) return true;
return data.label.indexOf(value) !== -1;
};
/** 获取提交状态标签 */
const getSubmitStatusLabel = (status: string) => {
// 3-审核中,4-已驳回,5-已锁定
const statusMap: Record<string, string> = {
'3': '审核中',
'4': '已驳回',
'5': '已锁定'
};
return statusMap[status] || status;
};
/** 获取提交状态标签类型 */
const getSubmitStatusType = (status: string): 'success' | 'info' | 'warning' | 'danger' => {
const typeMap: Record<string, 'success' | 'info' | 'warning' | 'danger'> = {
'3': 'info',
'5': 'success',
'4': 'danger'
};
return typeMap[status] || 'info';
};
/** 格式化时间 */
const parseTime = (time: any, pattern?: string): string => {
if (!time) return '';
let date: Date;
if (typeof time === 'object') {
date = time;
} else {
if (typeof time === 'string' && /^[0-9]+$/.test(time)) {
time = parseInt(time);
}
if (typeof time === 'number' && time.toString().length === 10) {
time = time * 1000;
}
date = new Date(time);
}
const formatObj: Record<string, number> = {
y: date.getFullYear(),
m: date.getMonth() + 1,
d: date.getDate(),
h: date.getHours(),
i: date.getMinutes(),
s: date.getSeconds(),
a: date.getDay()
};
const time_str = pattern || '{y}-{m}-{d} {h}:{i}:{s}';
return time_str.replace(/{([ymdhisa])+}/g, (result, key) => {
const value = formatObj[key];
if (key === 'a') {
return ['日', '一', '二', '三', '四', '五', '六'][value];
}
return value.toString().padStart(2, '0');
});
};
/** 查询学生列表 */
const getList = async () => {
if (!props.batchInfo?.id) return;
// 如果没有选择部门,则不查询
if (!queryParams.deptId) {
ElMessage.warning('请先选择部门');
return;
}
loading.value = true;
try {
const params = {
batchId: props.batchInfo.id,
deptId: queryParams.deptId,
name: queryParams.name || undefined,
studentNo: queryParams.studentNo || undefined,
phone: queryParams.phone || undefined,
infoStatus: queryParams.submitStatus || undefined,
pageNum: queryParams.pageNum,
pageSize: queryParams.pageSize
};
const res = await request({
url: '/studentMsgBatch/studentMsgBatch/listByDept',
method: 'get',
params
});
if (res && res.code === 200) {
studentList.value = res.rows || [];
total.value = res.total || 0;
} else {
ElMessage.error(res?.msg || '获取学生列表失败');
studentList.value = [];
total.value = 0;
}
} catch (error) {
console.error('获取学生列表失败:', error);
ElMessage.error('获取学生列表失败');
studentList.value = [];
total.value = 0;
} finally {
loading.value = false;
}
};
/** 查询部门下拉树结构 */
const getDeptTree = async () => {
try {
if (!props.batchInfo?.id) {
console.warn('批次ID不存在,无法获取部门树');
return;
}
const res = await request({
url: `/stuColBatchClass/stuColBatchClass/getBatchAuthScope/${props.batchInfo.id}`,
method: 'get'
});
if (res && res.code === 200 && res.data && Array.isArray(res.data)) {
deptOptions.value = res.data;
// 设置根节点为默认选中节点
setDefaultRootNode(res.data);
} else {
console.warn('部门树数据格式不符合预期:', res);
deptOptions.value = [];
}
} catch (error) {
console.error('获取部门树失败:', error);
deptOptions.value = [];
}
};
/** 设置默认根节点并触发查询 */
const setDefaultRootNode = (treeData: any[]) => {
if (treeData && treeData.length > 0) {
// 找到第一个可用的根节点(不是disabled的节点)
const findFirstAvailableNode = (nodes: any[]): any => {
for (const node of nodes) {
if (!node.disabled) {
return node;
}
if (node.children && node.children.length > 0) {
const childNode = findFirstAvailableNode(node.children);
if (childNode) {
return childNode;
}
}
}
return null;
};
const rootNode = findFirstAvailableNode(treeData);
if (rootNode) {
// 设置当前选中的节点
currentSelectedNode.value = rootNode;
queryParams.deptId = rootNode.id;
// 设置树形控件的当前选中项
setTimeout(() => {
deptTreeRef.value?.setCurrentKey(rootNode.id);
}, 100);
// 触发数据查询
getList();
} else {
// 如果没有找到可用节点,则直接查询全部数据
getList();
}
} else {
// 如果没有树数据,则直接查询全部数据
getList();
}
};
/** 节点单击事件 */
const handleNodeClick = (data: any) => {
// alert(1);
// console.log('handleNodeClick', data);
// 只有班级节点才可以点击(disabled=false的节点)
if (data.disabled) {
ElMessage.warning('没有该节点权限,请联系管理员');
return;
}
// 保存当前选中的节点信息
currentSelectedNode.value = data;
queryParams.deptId = data.id;
handleQuery();
};
// /** 节点单击事件 */
// const handleNodeClick = (data: any) => {
// currentSelectedNode.value = data;
// queryParams.deptId = data.id;
// handleQuery();
// };
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.pageNum = 1;
getList();
};
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value?.resetFields();
queryParams.pageNum = 1;
queryParams.name = '';
queryParams.studentNo = '';
queryParams.phone = '';
queryParams.submitStatus = '';
handleQuery();
};
/** 多选框选中数据 */
const handleSelectionChange = (selection: StudentAuditInfo[]) => {
selectedStudents.value = selection;
};
/** 审核学生 */
const handleAuditStudent = (row: StudentAuditInfo) => {
// 打开学生信息详情弹窗进行审核
stuMsgBatchInfo.value = {
batchId: props.batchInfo?.id,
userId: row.id,
...props.batchInfo
};
stuMsgDialogTitle.value = `学生信息审核 - ${row.name}`;
stuMsgDialogVisible.value = true;
};
/** 查看学生详情 */
const handleViewDetail = (row: StudentAuditInfo) => {
// 设置详情弹窗数据
stuMsgDetailBatchInfo.value = {
id: props.batchInfo?.id,
batchId: props.batchInfo?.id,
userId: row.id,
studentId: row.id,
batchName: props.batchInfo?.batchName,
...props.batchInfo
};
stuMsgDetailDialogTitle.value = `学生信息详情 - ${row.name}`;
stuMsgDetailDialogVisible.value = true;
};
/** 批量通过 */
const handleBatchApprove = async () => {
if (selectedStudents.value.length === 0) {
ElMessage.warning('请选择要审核的学生');
return;
}
try {
await ElMessageBox.confirm('确认批量通过选中的学生信息?', '提示');
loading.value = true;
const studentIds = selectedStudents.value.map((item) => item.id);
const res = await request({
url: '/stuColBatchClass/stuColBatchClass/batchAudit',
method: 'post',
data: {
studentIds,
auditResult: '2',
auditRemark: '批量审核通过'
}
});
if (res && res.code === 200) {
ElMessage.success('批量审核成功');
await getList();
} else {
ElMessage.error(res?.msg || '批量审核失败');
}
} catch (error) {
if (error !== 'cancel') {
console.error('批量审核失败:', error);
ElMessage.error('批量审核失败');
}
} finally {
loading.value = false;
}
};
/** 批量拒绝 */
const handleBatchReject = async () => {
if (selectedStudents.value.length === 0) {
ElMessage.warning('请选择要审核的学生');
return;
}
try {
const { value: remark } = await ElMessageBox.prompt('请输入拒绝理由', '批量拒绝', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputPlaceholder: '请输入拒绝理由',
inputValidator: (val) => {
if (!val || val.trim() === '') {
return '拒绝理由不能为空';
}
return true;
}
});
loading.value = true;
const studentIds = selectedStudents.value.map((item) => item.id);
const res = await request({
url: '/stuColBatchClass/stuColBatchClass/batchAudit',
method: 'post',
data: {
studentIds,
auditResult: '3',
auditRemark: remark
}
});
if (res && res.code === 200) {
ElMessage.success('批量审核成功');
await getList();
} else {
ElMessage.error(res?.msg || '批量审核失败');
}
} catch (error) {
if (error !== 'cancel') {
console.error('批量审核失败:', error);
ElMessage.error('批量审核失败');
}
} finally {
loading.value = false;
}
};
/** 提交审核 */
const submitAudit = async () => {
if (!currentAuditStudent.value) return;
auditFormRef.value?.validate(async (valid: boolean) => {
if (valid) {
try {
auditLoading.value = true;
const res = await request({
url: '/stuColBatchClass/stuColBatchClass/auditStudent',
method: 'post',
data: {
studentId: currentAuditStudent.value!.id,
auditResult: auditForm.auditResult,
auditRemark: auditForm.auditRemark
}
});
if (res && res.code === 200) {
ElMessage.success('审核成功');
auditDetailDialog.visible = false;
await getList();
} else {
ElMessage.error(res?.msg || '审核失败');
}
} catch (error) {
console.error('审核失败:', error);
ElMessage.error('审核失败');
} finally {
auditLoading.value = false;
}
}
});
};
/** 关闭弹窗 */
const handleClose = () => {
visible.value = false;
// 重置数据
studentList.value = [];
selectedStudents.value = [];
queryParams.pageNum = 1;
queryParams.name = '';
queryParams.studentNo = '';
queryParams.phone = '';
queryParams.submitStatus = '';
currentSelectedNode.value = null;
};
// 监听弹窗显示状态
watch(
() => props.visible,
(newVal) => {
if (newVal && props.batchInfo?.id) {
// 弹窗打开时初始化数据
getDeptTree().then(() => {
getList();
});
}
}
);
// 监听部门名称筛选
watch(deptName, (val) => {
deptTreeRef.value?.filter(val);
});
/** 学生信息确认回调 */
const handleStuMsgConfirm = (data: any) => {
console.log('学生信息已更新:', data);
ElMessage.success('学生信息已更新');
// 刷新学生列表
getList();
};
</script>
<style scoped>
/* 审核弹窗样式 */
.audit-dialog :deep(.el-dialog) {
margin-top: 5vh !important;
margin-bottom: 5vh !important;
height: 700px;
max-height: 700px;
display: flex;
flex-direction: column;
}
.audit-dialog :deep(.el-dialog__body) {
flex: 1;
padding: 15px 20px;
overflow: hidden;
height: calc(100% - 120px);
}
/* 主布局容器 */
.layout-container {
display: flex;
gap: 20px;
height: 600px;
overflow: hidden;
}
/* 左侧面板 - 固定宽度300px */
.left-panel {
width: 350px;
flex-shrink: 0;
overflow: hidden;
}
/* 左侧面板内的卡片容器 */
.left-panel .el-card {
min-width: 330px;
height: 600px;
display: flex;
flex-direction: column;
}
.left-panel .el-card :deep(.el-card__body) {
flex: 1;
display: flex;
flex-direction: column;
padding: 20px;
gap: 10px;
overflow: hidden;
}
/* 部门树组件样式 */
.dept-tree {
height: 520px;
overflow-y: auto;
overflow-x: hidden;
width: 100%;
border: 1px solid #dcdfe6;
border-radius: 4px;
}
/* 强制覆盖el-tree的默认样式 */
.dept-tree :deep(.el-tree-node) {
white-space: nowrap !important;
}
.dept-tree :deep(.el-tree-node__content) {
white-space: nowrap !important;
overflow: hidden !important;
text-overflow: ellipsis !important;
padding-right: 10px !important;
}
.dept-tree :deep(.el-tree-node__content:hover) {
background-color: var(--el-tree-node-hover-bg-color, #f5f7fa) !important;
}
.dept-tree :deep(.el-tree-node__label) {
white-space: nowrap !important;
overflow: hidden !important;
text-overflow: ellipsis !important;
flex: 1 !important;
}
/* 右侧面板 - 占据剩余空间 */
.right-panel {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
height: 600px;
overflow: hidden;
}
/* 搜索按钮容器样式 */
.search-btn-container {
display: flex;
justify-content: flex-end;
margin-top: 10px;
}
.search-btn-container .el-form-item {
margin-bottom: 0 !important;
}
/* 右侧面板内容区域样式 */
.right-panel .mb-\[10px\] {
flex-shrink: 0;
margin-bottom: 10px;
}
.right-panel .el-card:last-child {
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
}
.right-panel .el-card:last-child :deep(.el-card__body) {
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
padding: 15px;
}
.right-panel .el-table {
flex: 1;
margin-bottom: 10px;
}
/* 右侧表格样式 */
.right-table {
height: 420px;
}
.right-table :deep(.el-table__body-wrapper) {
overflow-y: auto;
max-height: 350px;
}
/* 卡片头部样式 */
.card-header {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
}
.header-actions {
display: flex;
gap: 10px;
}
/* 响应式适配 */
@media (max-width: 1200px) {
.layout-container {
flex-direction: column;
}
.left-panel {
width: 100%;
}
.left-panel .el-card {
height: 400px;
}
.dept-tree {
height: 320px;
}
}
</style>
+773
View File
@@ -0,0 +1,773 @@
<template>
<div class="p-2">
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
<div v-show="showSearch" class="mb-[10px]">
<el-card shadow="hover">
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
<el-form-item label="批次名称" prop="batchName">
<el-input v-model="queryParams.batchName" placeholder="请输入批次名称" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
</el-card>
</div>
</transition>
<el-card shadow="never">
<template #header>
<el-row :gutter="10" class="mb8">
<!-- <el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['XgStuColBatch:stuColBatch:add']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['XgStuColBatch:stuColBatch:edit']"
>修改</el-button
>
</el-col> -->
<!-- <el-col :span="1.5">
<el-button
type="danger"
plain
icon="Delete"
:disabled="multiple"
@click="handleDelete()"
v-hasPermi="['XgStuColBatch:stuColBatch:remove']"
>删除</el-button
>
</el-col> -->
<!-- <el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['XgStuColBatch:stuColBatch:export']">导出</el-button>
</el-col> -->
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
</template>
<el-table v-loading="loading" border :data="stuColBatchList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="批次ID" align="center" prop="id" v-if="true" />
<el-table-column label="批次名称" align="center" prop="batchName" />
<el-table-column label="批次描述" align="center" prop="description" />
<el-table-column label="开始时间" align="center" prop="startTime" width="200">
<template #default="scope">
<span>{{ parseTime(scope.row.startTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="结束时间" align="center" prop="endTime" width="200">
<template #default="scope">
<span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="status">
<template #default="scope">
<el-tag :type="scope.row.status === '0' ? 'success' : 'danger'">
{{ scope.row.status === '0' ? '正常' : '停用' }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="收集类型" align="center" prop="collectionType">
<template #default="scope">
<el-tag :type="scope.row.collectionType === '1' ? 'primary' : 'info'">
{{ scope.row.collectionType === '1' ? '新学期收集' : '其他' }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="200" class-name="small-padding fixed-right">
<template #default="scope">
<el-tooltip content="查看详细" placement="top">
<el-button link type="info" plain icon="View" @click="handleView(scope.row)"></el-button>
</el-tooltip>
<el-tooltip content="审核管理" placement="top">
<el-button link type="warning" plain icon="Document" @click="handleAudit(scope.row)"></el-button>
</el-tooltip>
<!-- <el-tooltip content="信息完善" placement="top" v-if="isBatchValid(scope.row)">
<el-button link type="success" plain icon="Edit" @click="handleInfoComplete(scope.row)"></el-button>
</el-tooltip>
<el-tooltip content="查看提交历史" placement="top">
<el-button link type="info" plain icon="Clock" @click="handleViewHistory(scope.row)"></el-button>
</el-tooltip> -->
<!-- <el-tooltip content="修改" placement="top">
<el-button
link
type="primary"
plain
icon="Edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['XgStuColBatch:stuColBatch:edit']"
></el-button>
</el-tooltip>
<el-tooltip content="收集范围" placement="top">
<el-button
link
type="warning"
plain
icon="Setting"
@click="handleScope(scope.row)"
v-hasPermi="['XgStuColBatch:stuColBatch:scope']"
></el-button>
</el-tooltip>
<el-tooltip content="删除" placement="top">
<el-button
link
plain
type="danger"
icon="Delete"
@click="handleDelete(scope.row)"
v-hasPermi="['XgStuColBatch:stuColBatch:remove']"
></el-button>
</el-tooltip> -->
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
</el-card>
<!-- 添加或修改学生信息收集批次对话框 -->
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
<el-form ref="stuColBatchFormRef" :model="form" :rules="rules" label-width="80px">
<el-form-item label="批次名称" prop="batchName">
<el-input v-model="form.batchName" placeholder="请输入批次名称" />
</el-form-item>
<el-form-item label="批次描述" prop="description">
<el-input v-model="form.description" type="textarea" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="开始时间" prop="startTime">
<el-date-picker
clearable
style="width: 100%"
v-model="form.startTime"
type="datetime"
value-format="YYYY-MM-DD HH:mm:ss"
placeholder="请选择开始时间"
>
</el-date-picker>
</el-form-item>
<el-form-item label="结束时间" prop="endTime">
<el-date-picker
clearable
style="width: 100%"
v-model="form.endTime"
type="datetime"
value-format="YYYY-MM-DD HH:mm:ss"
placeholder="请选择结束时间"
>
</el-date-picker>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select v-model="form.status" placeholder="请选择状态">
<el-option label="正常" value="0" />
<el-option label="停用" value="1" />
</el-select>
</el-form-item>
<el-form-item label="收集类型" prop="collectionType">
<el-select v-model="form.collectionType" placeholder="请选择收集类型">
<el-option label="新学期收集" value="1" />
<el-option label="其他" value="2" />
</el-select>
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</template>
</el-dialog>
<!-- 收集范围设置对话框 -->
<el-dialog title="设置收集范围" v-model="scopeDialog.visible" width="500px" append-to-body @close="handleScopeDialogClose">
<div class="scope-content">
<el-tree
ref="scopeTreeRef"
:data="deptTreeData"
show-checkbox
default-expand-all
node-key="id"
:props="{ children: 'children', label: 'label' }"
:check-strictly="false"
/>
</div>
<template #footer>
<div class="dialog-footer">
<el-button :loading="scopeButtonLoading" type="primary" @click="submitScope">确 定</el-button>
<el-button @click="cancelScope">取 消</el-button>
</div>
</template>
</el-dialog>
<!-- 查看详细对话框 -->
<el-dialog title="批次详细信息" v-model="viewDialog.visible" width="800px" append-to-body>
<el-tabs v-model="viewActiveTab" type="border-card">
<el-tab-pane label="基本信息" name="basic">
<el-descriptions :column="2" border>
<el-descriptions-item label="批次ID">{{ viewForm.id }}</el-descriptions-item>
<el-descriptions-item label="批次名称">{{ viewForm.batchName }}</el-descriptions-item>
<el-descriptions-item label="批次描述" :span="2">{{ viewForm.description || '暂无描述' }}</el-descriptions-item>
<el-descriptions-item label="开始时间">{{ parseTime(viewForm.startTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</el-descriptions-item>
<el-descriptions-item label="结束时间">{{ parseTime(viewForm.endTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</el-descriptions-item>
<el-descriptions-item label="状态">
<el-tag :type="viewForm.status === '0' ? 'success' : 'danger'">
{{ viewForm.status === '0' ? '正常' : '停用' }}
</el-tag>
</el-descriptions-item>
<el-descriptions-item label="收集类型">
<el-tag :type="viewForm.collectionType === '1' ? 'primary' : 'info'">
{{ viewForm.collectionType === '1' ? '新学期收集' : '其他' }}
</el-tag>
</el-descriptions-item>
<el-descriptions-item label="创建时间">{{ parseTime(viewForm.createTime || '', '{y}-{m}-{d} {h}:{i}:{s}') }}</el-descriptions-item>
<el-descriptions-item label="更新时间">{{ parseTime(viewForm.updateTime || '', '{y}-{m}-{d} {h}:{i}:{s}') }}</el-descriptions-item>
</el-descriptions>
</el-tab-pane>
<!-- <el-tab-pane label="权限范围" name="scope">
<div class="scope-detail-content">
<div v-if="scopeDetailList.length === 0" class="no-data">
<el-empty description="暂无权限范围配置" />
</div>
<div v-else>
<el-alert title="权限范围说明" type="info" :closable="false" show-icon class="mb-3">
<template #default> 该批次配置了 {{ scopeDetailList.length }} 个班级的收集权限,具体如下: </template>
</el-alert>
<el-table :data="scopeDetailList" border stripe>
<el-table-column label="序号" type="index" width="60" align="center" />
<el-table-column label="学院名称" prop="collegeName" align="center" />
<el-table-column label="专业名称" prop="majorName" align="center" />
<el-table-column label="班级名称" prop="className" align="center" />
<el-table-column label="配置时间" align="center" width="180">
<template #default="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
</el-table>
</div>
</div>
</el-tab-pane> -->
</el-tabs>
<template #footer>
<div class="dialog-footer">
<el-button @click="cancelView">关 闭</el-button>
</div>
</template>
</el-dialog>
<!-- 学生信息完善弹窗 -->
<StuMsgDialog
v-model:visible="stuMsgDialog.visible"
:title="stuMsgDialog.title"
:batch-info="stuMsgDialog.batchInfo"
@confirm="handleStuMsgConfirm"
@update:visible="handleStuMsgClose"
/>
<!-- 学生信息提交历史详情弹窗 -->
<StuMsgDetailDialog
v-model:visible="historyDialog.visible"
:title="historyDialog.title"
:batch-info="historyDialog.batchInfo"
@update:visible="handleHistoryDialogClose"
/>
<!-- 审核管理弹窗 -->
<AuditDialog
v-model:visible="auditDialog.visible"
:title="auditDialog.title"
:batch-info="auditDialog.batchInfo"
@update:visible="handleAuditDialogClose"
@confirm="handleAuditConfirm"
/>
</div>
</template>
<script setup name="StuColBatch" lang="ts">
import { getCurrentInstance, ComponentInternalInstance, ref, reactive, toRefs, onMounted, nextTick } from 'vue';
import { getStuColBatch, delStuColBatch, addStuColBatch, updateStuColBatch } from '@/api/stuMsgAudit';
import { StuColBatchVO, StuColBatchQuery, StuColBatchForm } from '@/api/stuMsgAudit/types';
import { setScope, getScope, getScopeDetail } from '@/api/stuColBatchClass/stuColBatchClass';
import request from '@/utils/request';
import { ElMessage, ElMessageBox } from 'element-plus';
import type { FormInstance as ElFormInstance } from 'element-plus';
import StuMsgDialog from './stuMsgDialog.vue';
import StuMsgDetailDialog from './stuMsgDetailDialog.vue';
import AuditDialog from './auditDialog.vue';
interface DialogOption {
visible: boolean;
title: string;
}
interface PageData<T, Q> {
form: T;
queryParams: Q;
rules: Record<string, any[]>;
}
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const stuColBatchList = ref<StuColBatchVO[]>([]);
const buttonLoading = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const ids = ref<Array<string | number>>([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const queryFormRef = ref<ElFormInstance>();
const stuColBatchFormRef = ref<ElFormInstance>();
const dialog = reactive<DialogOption>({
visible: false,
title: ''
});
// 收集范围弹窗相关数据
const scopeDialog = reactive({
visible: false
});
const scopeButtonLoading = ref(false);
const currentBatch = ref<StuColBatchVO | null>(null);
const deptTreeData = ref<any[]>([]);
const checkedDeptIds = ref<number[]>([]);
const scopeTreeRef = ref();
// 查看详细弹窗相关数据
const viewDialog = reactive({
visible: false
});
const viewForm = ref<StuColBatchVO>({} as StuColBatchVO);
const viewActiveTab = ref('basic');
const scopeDetailList = ref<any[]>([]);
// 学生信息完善弹窗相关数据
const stuMsgDialog = reactive({
visible: false,
title: '学生信息完善',
batchInfo: null as StuColBatchVO | null
});
// 学生信息提交历史详情弹窗相关数据
const historyDialog = reactive({
visible: false,
title: '学生信息提交历史',
batchInfo: null as StuColBatchVO | null
});
// 审核管理弹窗相关数据
const auditDialog = reactive({
visible: false,
title: '审核管理',
batchInfo: null as StuColBatchVO | null
});
const initFormData: StuColBatchForm = {
id: undefined,
batchName: undefined,
description: undefined,
startTime: new Date()
.toLocaleString('zh-CN', {
year: 'numeric',
month: '2-digit',
day: '2-digit',
hour: '2-digit',
minute: '2-digit',
second: '2-digit',
hour12: false
})
.replace(/\//g, '-'),
endTime: undefined,
status: '0',
collectionType: '1'
};
const data = reactive<PageData<StuColBatchForm, StuColBatchQuery>>({
form: { ...initFormData },
queryParams: {
pageNum: 1,
pageSize: 10,
batchName: undefined,
status: undefined,
collectionType: undefined,
params: {}
},
rules: {
id: [{ required: true, message: '批次ID不能为空', trigger: 'blur' }],
batchName: [{ required: true, message: '批次名称不能为空', trigger: 'blur' }],
startTime: [{ required: true, message: '开始时间不能为空', trigger: 'blur' }],
endTime: [{ required: true, message: '结束时间不能为空', trigger: 'blur' }],
status: [{ required: true, message: '状态不能为空', trigger: 'change' }],
collectionType: [{ required: true, message: '收集类型 1 - 新学期收集 2 - 其他 不能为空', trigger: 'change' }]
}
});
const { queryParams, form, rules } = toRefs(data);
/** 查询学生信息收集批次列表 */
const getList = async () => {
loading.value = true;
console.log('queryParams.value.batchName', queryParams.value.batchName);
try {
const res = await request({
url: '/stuColBatchClass/stuColBatchClass/getTeacherRelatedBatches',
method: 'get',
params: {
batchName: queryParams.value.batchName || ''
}
});
if (res && res.code === 200) {
// 将返回的数据转换为表格需要的格式
stuColBatchList.value = res.data || [];
total.value = res.data ? res.data.length : 0;
} else {
stuColBatchList.value = [];
total.value = 0;
proxy?.$modal.msgError(res?.msg || '获取数据失败');
}
} catch (error) {
console.error('获取学生可参与批次信息失败:', error);
stuColBatchList.value = [];
total.value = 0;
proxy?.$modal.msgError('获取数据失败');
} finally {
loading.value = false;
}
};
/** 取消按钮 */
const cancel = () => {
reset();
dialog.visible = false;
};
/** 表单重置 */
const reset = () => {
form.value = { ...initFormData };
stuColBatchFormRef.value?.resetFields();
};
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.value.pageNum = 1;
getList();
};
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value?.resetFields();
handleQuery();
};
/** 多选框选中数据 */
const handleSelectionChange = (selection: StuColBatchVO[]) => {
ids.value = selection.map((item) => item.id);
single.value = selection.length != 1;
multiple.value = !selection.length;
};
/** 新增按钮操作 */
const handleAdd = () => {
reset();
dialog.visible = true;
dialog.title = '添加学生信息收集批次';
};
/** 修改按钮操作 */
const handleUpdate = async (row?: StuColBatchVO) => {
reset();
const _id = row?.id || ids.value[0];
const res = await getStuColBatch(_id);
Object.assign(form.value, res.data);
dialog.visible = true;
dialog.title = '修改学生信息收集批次';
};
/** 提交按钮 */
const submitForm = () => {
stuColBatchFormRef.value?.validate(async (valid: boolean) => {
if (valid) {
buttonLoading.value = true;
if (form.value.id) {
await updateStuColBatch(form.value).finally(() => (buttonLoading.value = false));
} else {
await addStuColBatch(form.value).finally(() => (buttonLoading.value = false));
}
proxy?.$modal.msgSuccess('操作成功');
dialog.visible = false;
await getList();
}
});
};
/** 删除按钮操作 */
const handleDelete = async (row?: StuColBatchVO) => {
const _ids = row?.id || ids.value;
await proxy?.$modal.confirm('是否确认删除学生信息收集批次编号为"' + row?.batchName + '"的数据项?').finally(() => (loading.value = false));
await delStuColBatch(_ids);
proxy?.$modal.msgSuccess('删除成功');
await getList();
};
/** 导出按钮操作 */
const handleExport = () => {
proxy?.download(
'XgStuColBatch/stuColBatch/export',
{
...queryParams.value
},
`stuColBatch_${new Date().getTime()}.xlsx`
);
};
/** 收集范围按钮操作 */
const handleScope = async (row: StuColBatchVO) => {
currentBatch.value = row;
// 先清空勾选状态
checkedDeptIds.value = [];
await loadDeptTree();
await loadCurrentScope(row.id);
scopeDialog.visible = true;
// 使用nextTick确保DOM更新完成后再设置勾选状态
await nextTick();
if (scopeTreeRef.value && checkedDeptIds.value.length > 0) {
scopeTreeRef.value.setCheckedKeys(checkedDeptIds.value);
}
};
/** 加载部门树数据 */
const loadDeptTree = async () => {
try {
loading.value = true;
const response = await request({
url: '/system/user/deptTree',
method: 'get',
params: {
belongDeptId: 101
}
});
if (response && response.code === 200) {
deptTreeData.value = response.data || [];
}
} catch (error) {
console.error('获取部门树数据失败:', error);
ElMessage.error('获取范围选项失败');
} finally {
loading.value = false;
}
};
/** 加载当前批次的收集范围 */
const loadCurrentScope = async (batchId: string | number) => {
try {
checkedDeptIds.value = [];
const response = await getScope(batchId);
if (response && response.code === 200) {
checkedDeptIds.value = response.data || [];
} else {
checkedDeptIds.value = [];
}
} catch (error) {
console.error('加载收集范围失败:', error);
checkedDeptIds.value = [];
}
};
/** 构建树形数据 */
const buildTree = (data: any[]) => {
// 如果数据已经是树形结构,直接转换格式
const convertToTreeNode = (item: any): any => {
return {
id: item.deptId,
label: item.deptName,
children: item.children ? item.children.map(convertToTreeNode) : []
};
};
return data.map(convertToTreeNode);
};
/** 提交收集范围 */
const submitScope = async () => {
if (!currentBatch.value) return;
try {
scopeButtonLoading.value = true;
const checkedNodes = scopeTreeRef.value.getCheckedNodes();
const checkedIds = checkedNodes.map((node: any) => node.id);
// 调用后端API设置收集范围
const response = await setScope(currentBatch.value.id, checkedIds);
if (response && response.code === 200) {
ElMessage.success(response.msg || '收集范围设置成功');
scopeDialog.visible = false;
// 提交成功后清空状态
handleScopeDialogClose();
} else {
ElMessage.error(response?.msg || '设置收集范围失败');
}
} catch (error) {
console.error('设置收集范围失败:', error);
ElMessage.error('设置收集范围失败');
} finally {
scopeButtonLoading.value = false;
}
};
/** 取消收集范围设置 */
const cancelScope = () => {
scopeDialog.visible = false;
currentBatch.value = null;
checkedDeptIds.value = [];
// 清空树形组件的勾选状态
if (scopeTreeRef.value) {
scopeTreeRef.value.setCheckedKeys([]);
}
};
/** 处理收集范围弹窗关闭 */
const handleScopeDialogClose = () => {
// 清空相关状态
currentBatch.value = null;
checkedDeptIds.value = [];
// 清空树形组件的勾选状态
if (scopeTreeRef.value) {
scopeTreeRef.value.setCheckedKeys([]);
}
};
/** 查看详细按钮操作 */
const handleView = async (row: StuColBatchVO) => {
try {
// 获取批次基本信息
const res = await getStuColBatch(row?.id);
viewForm.value = res.data;
// 获取权限范围详细信息
// await loadScopeDetail(row.id);
viewDialog.visible = true;
viewActiveTab.value = 'basic';
} catch (error) {
console.error('获取批次详情失败:', error);
proxy?.$modal.msgError('获取批次详情失败');
}
};
/** 加载权限范围详细信息 */
const loadScopeDetail = async (batchId: string | number) => {
try {
const response = await getScopeDetail(batchId);
if (response && response.code === 200) {
scopeDetailList.value = response.data || [];
} else {
scopeDetailList.value = [];
}
} catch (error) {
console.error('加载权限范围详情失败:', error);
scopeDetailList.value = [];
}
};
/** 取消查看详细 */
const cancelView = () => {
viewDialog.visible = false;
viewForm.value = {} as StuColBatchVO;
scopeDetailList.value = [];
viewActiveTab.value = 'basic';
};
/** 信息完善按钮操作 */
const handleInfoComplete = (row: StuColBatchVO) => {
console.log('信息完善按钮点击,批次ID:', row.id, '批次名称:', row.batchName);
stuMsgDialog.batchInfo = row;
stuMsgDialog.title = `信息完善 - ${row.batchName}`;
stuMsgDialog.visible = true;
};
/** 学生信息完善弹窗确认 */
const handleStuMsgConfirm = (formData: any) => {
console.log('学生信息完善提交:', formData);
// TODO: 调用API保存学生信息
ElMessage.success('学生信息完善成功');
};
/** 关闭学生信息完善弹窗 */
const handleStuMsgClose = () => {
stuMsgDialog.visible = false;
stuMsgDialog.batchInfo = null;
};
/** 查看提交历史按钮操作 */
const handleViewHistory = (row: StuColBatchVO) => {
console.log('查看提交历史按钮点击,批次ID:', row.id, '批次名称:', row.batchName);
historyDialog.batchInfo = row;
historyDialog.title = `学生信息提交历史 - ${row.batchName}`;
historyDialog.visible = true;
};
/** 关闭学生信息提交历史详情弹窗 */
const handleHistoryDialogClose = () => {
historyDialog.visible = false;
historyDialog.batchInfo = null;
};
/** 审核管理按钮操作 */
const handleAudit = (row: StuColBatchVO) => {
console.log('审核管理按钮点击,批次ID:', row.id, '批次名称:', row.batchName);
auditDialog.batchInfo = row;
auditDialog.title = `审核管理 - ${row.batchName}`;
auditDialog.visible = true;
};
/** 审核弹窗确认 */
const handleAuditConfirm = (data: any) => {
console.log('审核弹窗确认:', data);
ElMessage.success('审核操作成功');
};
/** 关闭审核管理弹窗 */
const handleAuditDialogClose = () => {
auditDialog.visible = false;
auditDialog.batchInfo = null;
};
/** 检查批次是否有效(在有效时间内且状态正常) */
const isBatchValid = (row: StuColBatchVO): boolean => {
// 检查状态是否为正常
if (row.status !== '0') {
return false;
}
// 检查是否在有效时间内
const now = new Date();
const startTime = new Date(row.startTime);
const endTime = new Date(row.endTime);
return now >= startTime && now <= endTime;
};
onMounted(() => {
getList();
});
</script>
<style scoped>
.scope-detail-content {
padding: 10px 0;
}
.no-data {
text-align: center;
padding: 40px 0;
}
.mb-3 {
margin-bottom: 12px;
}
</style>
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -20,7 +20,7 @@
<div class="right-arrow">→</div>
</div>
<div class="history-card">
<div class="history-card" :class="{ 'rejected-card': record.infoStatus === '4', 'approved-card': record.infoStatus === '5' }">
<div class="card-header">
<span class="operator">{{ record.createByName || '系统' }}</span>
<span class="operate-time">{{ formatDateTime(record.createTime) }}</span>
@@ -719,7 +719,7 @@
<script setup lang="ts" name="StuMsgDetailDialog">
import { ref, reactive, getCurrentInstance, nextTick, watch, toRefs } from 'vue';
import { ElMessage } from 'element-plus';
import ElMessage from 'element-plus/es/components/message/index';
// @ts-ignore
import request from '@/utils/request';
// 获取当前组件实例
@@ -1305,6 +1305,28 @@ const handleClose = () => {
transform: translateY(-2px);
}
/* 驳回状态卡片样式 */
.rejected-card {
background-color: #fef0f0 !important;
border-color: #fbc4c4 !important;
}
.rejected-card:hover {
background-color: #fde2e2 !important;
border-color: #f87171 !important;
}
/* 通过状态卡片样式 */
.approved-card {
background-color: #f0fdf4 !important;
border-color: #a7f3d0 !important;
}
.approved-card:hover {
background-color: #ecfdf5 !important;
border-color: #34d399 !important;
}
.card-header {
display: flex;
justify-content: space-between;
+24 -2
View File
@@ -20,7 +20,7 @@
<div class="right-arrow">→</div>
</div>
<div class="history-card">
<div class="history-card" :class="{ 'rejected-card': record.infoStatus === '4', 'approved-card': record.infoStatus === '5' }">
<div class="card-header">
<span class="operator">{{ record.createByName || '系统' }}</span>
<span class="operate-time">{{ formatDateTime(record.createTime) }}</span>
@@ -724,7 +724,7 @@
<script setup lang="ts" name="StuMsgDialog">
import { ref, reactive, getCurrentInstance, nextTick, watch, toRefs } from 'vue';
import { ElMessage } from 'element-plus';
import ElMessage from 'element-plus/es/components/message/index';
import request from '@/utils/request';
// 获取当前组件实例
const { proxy } = getCurrentInstance() as any;
@@ -1416,6 +1416,28 @@ const handleClose = () => {
transform: translateY(-2px);
}
/* 驳回状态卡片样式 */
.rejected-card {
background-color: #fef0f0 !important;
border-color: #fbc4c4 !important;
}
.rejected-card:hover {
background-color: #fde2e2 !important;
border-color: #f87171 !important;
}
/* 通过状态卡片样式 */
.approved-card {
background-color: #f0fdf4 !important;
border-color: #a7f3d0 !important;
}
.approved-card:hover {
background-color: #ecfdf5 !important;
border-color: #34d399 !important;
}
.card-header {
display: flex;
justify-content: space-between;