Merge branch 'developer' of ssh://code.cyweb.top:30033/scj/zhxy/v3/cloud-ui into developer
This commit is contained in:
91
src/api/basic/graduverify.ts
Normal file
91
src/api/basic/graduverify.ts
Normal file
@@ -0,0 +1,91 @@
|
||||
import request from '/@/utils/request';
|
||||
|
||||
/**
|
||||
* 分页查询毕业学生核对数据
|
||||
* @param query 查询参数
|
||||
*/
|
||||
export const fetchList = (query?: any) => {
|
||||
return request({
|
||||
url: '/basic/graduverify/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 导入毕业学籍回流数据并核对
|
||||
* @param file 文件
|
||||
*/
|
||||
export const importData = (file: File) => {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
return request({
|
||||
url: '/basic/graduverify/import',
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 导出核对数据
|
||||
* @param data 查询条件
|
||||
*/
|
||||
export const exportData = (data: any) => {
|
||||
return request({
|
||||
url: '/basic/graduverify/export',
|
||||
method: 'post',
|
||||
data,
|
||||
responseType: 'blob'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 下发至班主任核对
|
||||
* @param batchNo 批次号
|
||||
*/
|
||||
export const sendToClassMaster = (batchNo: string) => {
|
||||
return request({
|
||||
url: '/basic/graduverify/send',
|
||||
method: 'post',
|
||||
params: { batchNo }
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 提交核对结果
|
||||
* @param id 记录ID
|
||||
* @param verifyResult 核对结果
|
||||
*/
|
||||
export const submitVerify = (id: string, verifyResult: string) => {
|
||||
return request({
|
||||
url: '/basic/graduverify/verify',
|
||||
method: 'post',
|
||||
params: { id, verifyResult }
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取待核对统计
|
||||
* @param classMasterCode 班主任工号
|
||||
*/
|
||||
export const getPendingCount = (classMasterCode?: string) => {
|
||||
return request({
|
||||
url: '/basic/graduverify/pending-count',
|
||||
method: 'get',
|
||||
params: { classMasterCode }
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 下载导入模板
|
||||
*/
|
||||
export const downloadTemplate = () => {
|
||||
return request({
|
||||
url: '/basic/graduverify/template',
|
||||
method: 'get',
|
||||
responseType: 'blob'
|
||||
});
|
||||
};
|
||||
@@ -32,7 +32,7 @@ export const importComment = (file: File) => {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
return request({
|
||||
url: '/ems/emsqualityreport/importComment',
|
||||
url: '/ems/file/importStudentComment',
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
@@ -47,7 +47,7 @@ export const importComment = (file: File) => {
|
||||
*/
|
||||
export const setClassStartTime = (data: any) => {
|
||||
return request({
|
||||
url: '/ems/emsqualityreport/setClassStartTime',
|
||||
url: '/ems/emsopenschooltime/edit',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
@@ -66,3 +66,14 @@ export const exportExcel = (query?: any) => {
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 导出学生评语模板
|
||||
*/
|
||||
export const exportStudentCommentTemplate = () => {
|
||||
return request({
|
||||
url: '/ems/file/exportStudentCommentTemplate',
|
||||
method: 'get',
|
||||
responseType: 'blob'
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
702
src/api/stuwork/file.ts
Normal file
702
src/api/stuwork/file.ts
Normal file
@@ -0,0 +1,702 @@
|
||||
import request from '/@/utils/request';
|
||||
import { useMessage } from '/@/hooks/message';
|
||||
|
||||
/**
|
||||
* 通用的 blob 文件下载辅助函数
|
||||
* @param promise 请求 Promise
|
||||
* @param fileName 下载文件名
|
||||
*/
|
||||
export const downloadBlobFile = async (promise: Promise<any>, fileName: string) => {
|
||||
try {
|
||||
const res = await promise;
|
||||
// 检查响应数据
|
||||
if (!res.data) {
|
||||
useMessage().error('响应数据为空');
|
||||
return false;
|
||||
}
|
||||
|
||||
// 检查是否是错误响应(JSON 格式的错误信息)
|
||||
const contentType = res.headers?.['content-type'] || '';
|
||||
if (contentType.includes('application/json')) {
|
||||
// 后端返回了 JSON 格式的错误信息
|
||||
const reader = new FileReader();
|
||||
reader.onload = () => {
|
||||
try {
|
||||
const errorData = JSON.parse(reader.result as string);
|
||||
useMessage().error(errorData.msg || '下载失败');
|
||||
} catch {
|
||||
useMessage().error('下载失败');
|
||||
}
|
||||
};
|
||||
reader.readAsText(res.data);
|
||||
return false;
|
||||
}
|
||||
|
||||
// 创建 blob 对象
|
||||
const blob = res.data instanceof Blob ? res.data : new Blob([res.data]);
|
||||
|
||||
// 检查 blob 大小
|
||||
if (blob.size === 0) {
|
||||
useMessage().error('文件内容为空');
|
||||
return false;
|
||||
}
|
||||
|
||||
// 创建下载链接
|
||||
const url = window.URL.createObjectURL(blob);
|
||||
const link = document.createElement('a');
|
||||
link.href = url;
|
||||
link.download = fileName;
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
// 清理
|
||||
window.URL.revokeObjectURL(url);
|
||||
document.body.removeChild(link);
|
||||
useMessage().success('下载成功');
|
||||
return true;
|
||||
} catch (error: any) {
|
||||
console.error('文件下载失败:', error);
|
||||
useMessage().error(error.msg || '下载失败');
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
// ==================== 教室日卫生 ====================
|
||||
|
||||
/**
|
||||
* 下载教室日卫生导入模板
|
||||
*/
|
||||
export const downloadClassRoomHygieneDailyTemplate = () => {
|
||||
return request({
|
||||
url: '/stuwork/classRoomHygieneDaily/import/template',
|
||||
method: 'get',
|
||||
responseType: 'blob'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 教室日卫生导入
|
||||
* @param formData 文件表单数据
|
||||
*/
|
||||
export const importClassRoomHygieneDaily = (formData: FormData) => {
|
||||
return request({
|
||||
url: '/stuwork/classRoomHygieneDaily/import',
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 创建导出教室日卫生异步任务
|
||||
* @param query 查询参数
|
||||
*/
|
||||
export const makeExportClassRoomHygieneDailyTask = (query?: any) => {
|
||||
return request({
|
||||
url: '/stuwork/file/makeExportClassRoomHygieneDailyTask',
|
||||
method: 'post',
|
||||
data: query
|
||||
});
|
||||
};
|
||||
|
||||
// ==================== 教室月卫生 ====================
|
||||
|
||||
/**
|
||||
* 下载教室月卫生导入模板
|
||||
*/
|
||||
export const downloadClassRoomHygieneMonthlyTemplate = () => {
|
||||
return request({
|
||||
url: '/stuwork/classroomhygienemonthly/import/template',
|
||||
method: 'get',
|
||||
responseType: 'blob'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 教室月卫生导入
|
||||
* @param formData 文件表单数据
|
||||
*/
|
||||
export const importClassRoomHygieneMonthly = (formData: FormData) => {
|
||||
return request({
|
||||
url: '/stuwork/classroomhygienemonthly/import',
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 创建导出教室月卫生异步任务
|
||||
* @param query 查询参数
|
||||
*/
|
||||
export const makeExportClassRoomHygieneMonthlyTask = (query?: any) => {
|
||||
return request({
|
||||
url: '/stuwork/file/makeExportClassRoomHygieneMonthlyTask',
|
||||
method: 'post',
|
||||
data: query
|
||||
});
|
||||
};
|
||||
|
||||
// ==================== 日常巡检 ====================
|
||||
|
||||
/**
|
||||
* 下载日常巡检导入模板
|
||||
*/
|
||||
export const downloadClassCheckDailyTemplate = () => {
|
||||
return request({
|
||||
url: '/stuwork/classcheckdaily/importTemplate',
|
||||
method: 'get',
|
||||
responseType: 'blob'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 日常巡检导入
|
||||
* @param formData 文件表单数据
|
||||
*/
|
||||
export const importClassCheckDaily = (formData: FormData) => {
|
||||
return request({
|
||||
url: '/stuwork/classcheckdaily/import',
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 创建导出日常巡检异步任务
|
||||
* @param query 查询参数
|
||||
*/
|
||||
export const makeExportClassCheckDailyTask = (query?: any) => {
|
||||
return request({
|
||||
url: '/stuwork/file/makeExportClassCheckDailyTask',
|
||||
method: 'post',
|
||||
data: query
|
||||
});
|
||||
};
|
||||
|
||||
// ==================== 日常行为 ====================
|
||||
|
||||
/**
|
||||
* 下载日常行为导入模板
|
||||
*/
|
||||
export const downloadClassHygieneDailyTemplate = () => {
|
||||
return request({
|
||||
url: '/stuwork/classhygienedaily/importTemplate',
|
||||
method: 'get',
|
||||
responseType: 'blob'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 日常行为导入
|
||||
* @param formData 文件表单数据
|
||||
*/
|
||||
export const importClassHygieneDaily = (formData: FormData) => {
|
||||
return request({
|
||||
url: '/stuwork/classhygienedaily/import',
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 创建导出日常行为异步任务
|
||||
* @param query 查询参数
|
||||
*/
|
||||
export const makeExportClassHygieneDailyTask = (query?: any) => {
|
||||
return request({
|
||||
url: '/stuwork/file/makeExportClassHygieneDailyTask',
|
||||
method: 'post',
|
||||
data: query
|
||||
});
|
||||
};
|
||||
|
||||
// ==================== 班级概况 / 学生信息 ====================
|
||||
|
||||
/**
|
||||
* 创建导出班级概况异步任务
|
||||
* @param query 查询参数
|
||||
*/
|
||||
export const makeExportClassOverviewTask = (query?: any) => {
|
||||
return request({
|
||||
url: '/basic/basicFile/makeExportClassOverviewTask',
|
||||
method: 'post',
|
||||
data: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 创建导出学生信息异步任务
|
||||
* @param query 查询参数
|
||||
*/
|
||||
export const makeExportStudentDataTask = (query?: any) => {
|
||||
return request({
|
||||
url: '/basic/basicFile/makeExportStudentDataTask',
|
||||
method: 'post',
|
||||
data: query
|
||||
});
|
||||
};
|
||||
|
||||
// ==================== 班主任考核 ====================
|
||||
|
||||
/**
|
||||
* 下载班主任考核导入模板
|
||||
*/
|
||||
export const downloadClassMasterEvaluationTemplate = () => {
|
||||
return request({
|
||||
url: '/stuwork/file/getClassMasterEvaluationImportTemplate',
|
||||
method: 'get',
|
||||
responseType: 'blob'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 班主任考核导入
|
||||
* @param formData 文件表单数据
|
||||
*/
|
||||
export const importClassMasterEvaluation = (formData: FormData) => {
|
||||
return request({
|
||||
url: '/stuwork/file/importClassMasterEvaluation',
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 创建导出班主任考核异步任务
|
||||
* @param query 查询参数
|
||||
*/
|
||||
export const makeExportClassMasterEvaluationTask = (query?: any) => {
|
||||
return request({
|
||||
url: '/stuwork/file/makeExportClassMasterEvaluationTask',
|
||||
method: 'post',
|
||||
data: query
|
||||
});
|
||||
};
|
||||
|
||||
// ==================== 住宿管理 ====================
|
||||
|
||||
/**
|
||||
* 创建导出住宿名单异步任务
|
||||
* @param query 查询参数
|
||||
*/
|
||||
export const makeExportDormStudentTask = (query?: any) => {
|
||||
return request({
|
||||
url: '/stuwork/file/makeExportDormStudentTask',
|
||||
method: 'post',
|
||||
data: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 创建导出住宿情况统计表异步任务
|
||||
* @param query 查询参数
|
||||
*/
|
||||
export const makeExportDormStatisticsTask = (query?: any) => {
|
||||
return request({
|
||||
url: '/stuwork/file/makeExportDormStatisticsTask',
|
||||
method: 'post',
|
||||
data: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 创建导出宿舍房间异步任务
|
||||
* @param query 查询参数
|
||||
*/
|
||||
export const makeExportDormRoomTask = (query?: any) => {
|
||||
return request({
|
||||
url: '/stuwork/file/makeExportDormRoomTask',
|
||||
method: 'post',
|
||||
data: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 创建导出异常住宿异步任务
|
||||
* @param query 查询参数
|
||||
*/
|
||||
export const makeExportDormStudentAbnormalTask = (query?: any) => {
|
||||
return request({
|
||||
url: '/stuwork/file/makeExportDormStudentAbnormalTask',
|
||||
method: 'post',
|
||||
data: query
|
||||
});
|
||||
};
|
||||
|
||||
// ==================== 宿舍月卫生 ====================
|
||||
|
||||
/**
|
||||
* 导出宿舍月卫生模板
|
||||
* @param query 查询参数
|
||||
*/
|
||||
export const exportDormHygieneMonthlyTemplate = (query?: any) => {
|
||||
return request({
|
||||
url: '/stuwork/file/exportDormHygieneMonthlyTemplate',
|
||||
method: 'post',
|
||||
data: query,
|
||||
responseType: 'blob'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 导入宿舍月卫生数据
|
||||
* @param formData 文件表单数据
|
||||
*/
|
||||
export const importDormHygieneMonthly = (formData: FormData) => {
|
||||
return request({
|
||||
url: '/stuwork/file/importDormHygieneMonthly',
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// ==================== 宿舍整改 ====================
|
||||
|
||||
/**
|
||||
* 创建导出宿舍整改异步任务
|
||||
* @param query 查询参数
|
||||
*/
|
||||
export const makeExportDormReformTask = (query?: any) => {
|
||||
return request({
|
||||
url: '/stuwork/file/makeExportDormReformTask',
|
||||
method: 'post',
|
||||
data: query
|
||||
});
|
||||
};
|
||||
|
||||
// ==================== 宿舍水电 ====================
|
||||
|
||||
/**
|
||||
* 创建导出宿舍水电异步任务
|
||||
* @param query 查询参数
|
||||
*/
|
||||
export const makeExportDormWaterElectricityTask = (query?: any) => {
|
||||
return request({
|
||||
url: '/stuwork/file/makeExportDormWaterElectricityTask',
|
||||
method: 'post',
|
||||
data: query
|
||||
});
|
||||
};
|
||||
|
||||
// ==================== 学籍异动 ====================
|
||||
|
||||
/**
|
||||
* 创建导出学籍异动异步任务
|
||||
* @param query 查询参数
|
||||
*/
|
||||
export const makeExportStudentChangeTask = (query?: any) => {
|
||||
return request({
|
||||
url: '/stuwork/file/makeExportStudentChangeTask',
|
||||
method: 'post',
|
||||
data: query
|
||||
});
|
||||
};
|
||||
|
||||
// ==================== 学生违纪 ====================
|
||||
|
||||
/**
|
||||
* 创建导出学生违纪异步任务
|
||||
* @param query 查询参数
|
||||
*/
|
||||
export const makeExportStudentDisciplineTask = (query?: any) => {
|
||||
return request({
|
||||
url: '/stuwork/file/makeExportStudentDisciplineTask',
|
||||
method: 'post',
|
||||
data: query
|
||||
});
|
||||
};
|
||||
|
||||
// ==================== 学生请假 ====================
|
||||
|
||||
/**
|
||||
* 创建导出学生请假异步任务
|
||||
* @param query 查询参数
|
||||
*/
|
||||
export const makeExportStudentLeaveTask = (query?: any) => {
|
||||
return request({
|
||||
url: '/stuwork/file/makeExportStudentLeaveTask',
|
||||
method: 'post',
|
||||
data: query
|
||||
});
|
||||
};
|
||||
|
||||
// ==================== 学生评优评先 ====================
|
||||
|
||||
/**
|
||||
* 创建导出学生评优评先异步任务
|
||||
* @param query 查询参数
|
||||
*/
|
||||
export const makeExportStudentPraiseTask = (query?: any) => {
|
||||
return request({
|
||||
url: '/stuwork/file/makeExportStudentPraiseTask',
|
||||
method: 'post',
|
||||
data: query
|
||||
});
|
||||
};
|
||||
|
||||
// ==================== 班费 ====================
|
||||
|
||||
/**
|
||||
* 创建导出班费异步任务
|
||||
* @param query 查询参数
|
||||
*/
|
||||
export const makeExportClassFundTask = (query?: any) => {
|
||||
return request({
|
||||
url: '/stuwork/file/makeExportClassFundTask',
|
||||
method: 'post',
|
||||
data: query
|
||||
});
|
||||
};
|
||||
|
||||
// ==================== 操行考核 ====================
|
||||
|
||||
/**
|
||||
* 导出操行考核模板
|
||||
*/
|
||||
export const exportConductAssessmentTemplate = () => {
|
||||
return request({
|
||||
url: '/stuwork/file/exportConductAssessmentTemplate',
|
||||
method: 'get',
|
||||
responseType: 'blob'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 导入操行考核数据
|
||||
* @param formData 文件表单数据
|
||||
*/
|
||||
export const importConductAssessment = (formData: FormData) => {
|
||||
return request({
|
||||
url: '/stuwork/file/importConductAssessment',
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// ==================== 安全教育 ====================
|
||||
|
||||
/**
|
||||
* 创建导出安全教育异步任务
|
||||
* @param query 查询参数
|
||||
*/
|
||||
export const makeExportSafetyEducationTask = (query?: any) => {
|
||||
return request({
|
||||
url: '/stuwork/file/makeExportSafetyEducationTask',
|
||||
method: 'post',
|
||||
data: query
|
||||
});
|
||||
};
|
||||
|
||||
// ==================== 文明班级 ====================
|
||||
|
||||
/**
|
||||
* 导出文明班级模板
|
||||
*/
|
||||
export const exportRewardClassTemplate = () => {
|
||||
return request({
|
||||
url: '/stuwork/file/exportRewardClassTemplate',
|
||||
method: 'get',
|
||||
responseType: 'blob'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 导入文明班级数据
|
||||
* @param formData 文件表单数据
|
||||
*/
|
||||
export const importRewardClass = (formData: FormData) => {
|
||||
return request({
|
||||
url: '/stuwork/file/importRewardClass',
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// ==================== 文明宿舍 ====================
|
||||
|
||||
/**
|
||||
* 导出文明宿舍模板
|
||||
*/
|
||||
export const exportRewardDormTemplate = () => {
|
||||
return request({
|
||||
url: '/stuwork/file/exportRewardDormTemplate',
|
||||
method: 'get',
|
||||
responseType: 'blob'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 导入文明宿舍数据
|
||||
* @param formData 文件表单数据
|
||||
*/
|
||||
export const importRewardDorm = (formData: FormData) => {
|
||||
return request({
|
||||
url: '/stuwork/file/importRewardDorm',
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// ==================== 班级学生评语 ====================
|
||||
|
||||
/**
|
||||
* 导出班级学生评语文档(单人/班级)
|
||||
* @param query 查询参数
|
||||
*/
|
||||
export const exportClassAssetsIntroduction = (query?: any) => {
|
||||
return request({
|
||||
url: '/stuwork/classassets/exportIntroduction',
|
||||
method: 'post',
|
||||
data: query,
|
||||
responseType: 'blob'
|
||||
});
|
||||
};
|
||||
|
||||
// ==================== 学生评语 ====================
|
||||
|
||||
/**
|
||||
* 导出学生评语模板
|
||||
*/
|
||||
export const exportStudentCommentTemplate = () => {
|
||||
return request({
|
||||
url: '/ems/file/exportStudentCommentTemplate',
|
||||
method: 'get',
|
||||
responseType: 'blob'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 导入学生评语数据
|
||||
* @param formData 文件表单数据
|
||||
*/
|
||||
export const importStudentComment = (formData: FormData) => {
|
||||
return request({
|
||||
url: '/ems/file/importStudentComment',
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// ==================== 教室公物 ====================
|
||||
|
||||
/**
|
||||
* 创建导出教室公物异步任务
|
||||
* @param query 查询参数
|
||||
*/
|
||||
export const makeExportClassAssetsTask = (query?: any) => {
|
||||
return request({
|
||||
url: '/stuwork/file/makeExportClassAssetsTask',
|
||||
method: 'post',
|
||||
data: query
|
||||
});
|
||||
};
|
||||
|
||||
// ==================== 活动报名详情 ====================
|
||||
|
||||
/**
|
||||
* 创建导出活动报名详情异步任务
|
||||
* @param query 查询参数
|
||||
*/
|
||||
export const makeExportActivitySignUpDetailTask = (query?: any) => {
|
||||
return request({
|
||||
url: '/stuwork/file/makeExportActivitySignUpDetailTask',
|
||||
method: 'post',
|
||||
data: query
|
||||
});
|
||||
};
|
||||
|
||||
// ==================== 活动获奖 ====================
|
||||
|
||||
/**
|
||||
* 导出活动获奖模板
|
||||
*/
|
||||
export const exportActivityAwardsTemplate = () => {
|
||||
return request({
|
||||
url: '/stuwork/file/exportActivityAwardsTemplate',
|
||||
method: 'get',
|
||||
responseType: 'blob'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 导入活动获奖数据
|
||||
* @param formData 文件表单数据
|
||||
*/
|
||||
export const importActivityAwards = (formData: FormData) => {
|
||||
return request({
|
||||
url: '/stuwork/file/importActivityAwards',
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// ==================== 团员信息 ====================
|
||||
|
||||
/**
|
||||
* 导出团员数据模板
|
||||
*/
|
||||
export const exportStuUnionLeagueTemplate = () => {
|
||||
return request({
|
||||
url: '/stuwork/file/exportStuUnionLeagueTemplate',
|
||||
method: 'get',
|
||||
responseType: 'blob'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 导入团员数据
|
||||
* @param formData 文件表单数据
|
||||
*/
|
||||
export const importStuUnionLeague = (formData: FormData) => {
|
||||
return request({
|
||||
url: '/stuwork/file/importStuUnionLeague',
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 创建导出团员信息异步任务
|
||||
* @param query 查询参数
|
||||
*/
|
||||
export const makeExportStuUnionLeagueTask = (query?: any) => {
|
||||
return request({
|
||||
url: '/stuwork/file/makeExportStuUnionLeagueTask',
|
||||
method: 'post',
|
||||
data: query
|
||||
});
|
||||
};
|
||||
@@ -106,11 +106,13 @@ const downExcelTemp = async () => {
|
||||
window.URL.revokeObjectURL(url);
|
||||
document.body.removeChild(link);
|
||||
} else {
|
||||
// 使用后端接口下载
|
||||
const fileName = prop.tempUrl?.split('/').pop() || 'template.xlsx';
|
||||
// 使用后端接口下载,文件名使用导入功能名称
|
||||
const title = prop.title?.replace('导入', '') || '导入模板';
|
||||
const fileName = `${title}模板.xlsx`;
|
||||
await other.downBlobFile(other.adaptationUrl(prop.tempUrl), {}, fileName);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('模板下载失败:', error);
|
||||
useMessage().error('模板下载失败,请先维护模板文件');
|
||||
}
|
||||
};
|
||||
|
||||
@@ -285,8 +285,8 @@ export function downBlobFile(url: any, query: any, fileName: string) {
|
||||
* @returns
|
||||
*/
|
||||
export function handleBlobFile(response: any, fileName: string) {
|
||||
// 处理返回的文件流
|
||||
const blob = response;
|
||||
// 处理返回的文件流,支持 axios 响应结构 { data: blob } 或直接 blob
|
||||
const blob = response?.data || response;
|
||||
if (blob && blob.size === 0) {
|
||||
useMessage().error('内容为空,无法下载');
|
||||
return;
|
||||
@@ -295,7 +295,7 @@ export function handleBlobFile(response: any, fileName: string) {
|
||||
|
||||
// 兼容一下 入参不是 File Blob 类型情况
|
||||
var binaryData = [] as any;
|
||||
binaryData.push(response);
|
||||
binaryData.push(blob);
|
||||
link.href = window.URL.createObjectURL(new Blob(binaryData));
|
||||
link.download = fileName;
|
||||
document.body.appendChild(link);
|
||||
|
||||
@@ -278,9 +278,9 @@ import { ref, reactive, defineAsyncComponent, computed, onMounted } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table";
|
||||
import { fetchList, delObj, putObjs, classExportData, getDeptList, getClassListByRole } from "/@/api/basic/basicclass";
|
||||
import { makeExportClassOverviewTask } from "/@/api/stuwork/file";
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||
import { fetchList as getRuleList } from "/@/api/stuwork/entrancerule";
|
||||
import { downBlobFile, adaptationUrl } from "/@/utils/other";
|
||||
import TableColumnControl from '/@/components/TableColumnControl/index.vue'
|
||||
import { List, OfficeBuilding, Grid, Document, UserFilled, Phone, User, Lock, CircleCheck, TrendCharts, Setting, Menu, Search } from '@element-plus/icons-vue'
|
||||
import { useTableColumnControl } from '/@/hooks/tableColumn'
|
||||
@@ -467,8 +467,8 @@ const confirmLinkRule = async () => {
|
||||
// 导出
|
||||
const handleExport = async () => {
|
||||
try {
|
||||
await downBlobFile(adaptationUrl('/basic/basicclass/classExportData'), searchForm, '班级信息.xlsx')
|
||||
useMessage().success('导出成功')
|
||||
await makeExportClassOverviewTask(searchForm)
|
||||
useMessage().success('导出任务已创建,请在文件管理中下载')
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg || '导出失败')
|
||||
}
|
||||
|
||||
@@ -388,10 +388,10 @@
|
||||
<SimpleEditDialog ref="simpleEditDialogRef" @refresh="getDataList(false)" />
|
||||
|
||||
<!-- 段段清证书导入对话框 -->
|
||||
<el-dialog
|
||||
title="段段清证书导入"
|
||||
<el-dialog
|
||||
title="段段清证书导入"
|
||||
v-model="importCertificateDialogVisible"
|
||||
:close-on-click-modal="false"
|
||||
:close-on-click-modal="false"
|
||||
draggable
|
||||
width="500px">
|
||||
<el-upload
|
||||
@@ -416,6 +416,44 @@
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 学生信息导出字段选择弹窗 -->
|
||||
<el-dialog
|
||||
title="选择导出字段"
|
||||
v-model="exportFieldDialogVisible"
|
||||
:close-on-click-modal="false"
|
||||
draggable
|
||||
width="600px">
|
||||
<div class="export-field-container">
|
||||
<div class="field-header">
|
||||
<el-checkbox
|
||||
v-model="exportFieldCheckAll"
|
||||
:indeterminate="exportFieldIndeterminate"
|
||||
@change="handleExportFieldCheckAllChange">
|
||||
全选
|
||||
</el-checkbox>
|
||||
<el-button type="primary" link @click="handleExportFieldReset">重置</el-button>
|
||||
</div>
|
||||
<el-divider />
|
||||
<el-checkbox-group v-model="selectedExportFields" class="field-checkbox-group">
|
||||
<el-checkbox
|
||||
v-for="field in exportFieldOptions"
|
||||
:key="field.value"
|
||||
:label="field.value"
|
||||
class="field-checkbox">
|
||||
{{ field.label }}
|
||||
</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</div>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="exportFieldDialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="handleExportFieldConfirm" :loading="exportFieldLoading" :disabled="selectedExportFields.length === 0">
|
||||
确认导出
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -448,6 +486,7 @@ import { downBlobFile, adaptationUrl } from "/@/utils/other";
|
||||
import { Session } from "/@/utils/storage";
|
||||
import TableColumnControl from '/@/components/TableColumnControl/index.vue'
|
||||
import GenderTag from '/@/components/GenderTag/index.vue'
|
||||
import {makeExportClassRoomHygieneMonthlyTask} from "/@/api/stuwork/file";
|
||||
|
||||
// 引入组件
|
||||
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
|
||||
@@ -472,6 +511,12 @@ const selectedRows = ref<any[]>([])
|
||||
const importCertificateDialogVisible = ref(false)
|
||||
const uploadLoading = ref(false)
|
||||
const fileList = ref<any[]>([])
|
||||
// 导出字段选择相关
|
||||
const exportFieldDialogVisible = ref(false)
|
||||
const exportFieldLoading = ref(false)
|
||||
const selectedExportFields = ref<string[]>([])
|
||||
const exportFieldCheckAll = ref(false)
|
||||
const exportFieldIndeterminate = ref(false)
|
||||
|
||||
// 表格列配置
|
||||
const tableColumns = [
|
||||
@@ -499,6 +544,36 @@ const visibleColumns = ref<string[]>([])
|
||||
// 列排序顺序
|
||||
const columnOrder = ref<string[]>([])
|
||||
|
||||
// 导出字段选项
|
||||
const exportFieldOptions = [
|
||||
{ value: 'deptName', label: '学院' },
|
||||
{ value: 'majorName', label: '专业' },
|
||||
{ value: 'className', label: '班级' },
|
||||
{ value: 'classNo', label: '班号' },
|
||||
{ value: 'stuNo', label: '学号' },
|
||||
{ value: 'realName', label: '姓名' },
|
||||
{ value: 'gender', label: '性别' },
|
||||
{ value: 'idCard', label: '身份证号' },
|
||||
{ value: 'birthday', label: '出生日期' },
|
||||
{ value: 'nation', label: '民族' },
|
||||
{ value: 'politicalStatus', label: '政治面貌' },
|
||||
{ value: 'phone', label: '个人电话' },
|
||||
{ value: 'parentPhone', label: '家长电话' },
|
||||
{ value: 'education', label: '文化程度' },
|
||||
{ value: 'householdType', label: '户口性质' },
|
||||
{ value: 'householdAddress', label: '户籍所在地' },
|
||||
{ value: 'currentAddress', label: '现住址' },
|
||||
{ value: 'isDorm', label: '是否住宿' },
|
||||
{ value: 'dormNo', label: '宿舍号' },
|
||||
{ value: 'enrollStatus', label: '学籍状态' },
|
||||
{ value: 'stuStatus', label: '学生状态' },
|
||||
{ value: 'teacherName', label: '班主任' },
|
||||
{ value: 'isClassLeader', label: '是否班干部' },
|
||||
{ value: 'bankCard', label: '银行卡号' },
|
||||
{ value: 'bankName', label: '开户行' },
|
||||
{ value: 'remark', label: '备注' }
|
||||
]
|
||||
|
||||
// 从本地统一存储加载配置
|
||||
const loadSavedConfig = () => {
|
||||
const routePath = route.path.replace(/^\//, '').replace(/\//g, '-')
|
||||
@@ -654,8 +729,56 @@ const handleSelectionChange = (selection: any[]) => {
|
||||
}
|
||||
|
||||
// 学生信息导出
|
||||
const handleExportStudent = async () => {
|
||||
useMessage().warning('功能开发中')
|
||||
const handleExportStudent = () => {
|
||||
// 打开字段选择弹窗
|
||||
exportFieldDialogVisible.value = true
|
||||
// 默认选中常用字段
|
||||
if (selectedExportFields.value.length === 0) {
|
||||
selectedExportFields.value = ['deptName', 'majorName', 'className', 'stuNo', 'realName', 'gender', 'idCard', 'phone', 'education', 'enrollStatus']
|
||||
}
|
||||
updateExportFieldCheckAll()
|
||||
}
|
||||
|
||||
// 全选/取消全选
|
||||
const handleExportFieldCheckAllChange = (val: boolean) => {
|
||||
selectedExportFields.value = val ? exportFieldOptions.map(item => item.value) : []
|
||||
exportFieldIndeterminate.value = false
|
||||
}
|
||||
|
||||
// 更新全选状态
|
||||
const updateExportFieldCheckAll = () => {
|
||||
const total = exportFieldOptions.length
|
||||
const selected = selectedExportFields.value.length
|
||||
exportFieldCheckAll.value = selected === total
|
||||
exportFieldIndeterminate.value = selected > 0 && selected < total
|
||||
}
|
||||
|
||||
// 重置选择
|
||||
const handleExportFieldReset = () => {
|
||||
selectedExportFields.value = ['deptName', 'majorName', 'className', 'stuNo', 'realName', 'gender', 'idCard', 'phone', 'education', 'enrollStatus']
|
||||
updateExportFieldCheckAll()
|
||||
}
|
||||
|
||||
// 确认导出
|
||||
const handleExportFieldConfirm = async () => {
|
||||
if (selectedExportFields.value.length === 0) {
|
||||
useMessage().warning('请至少选择一个导出字段')
|
||||
return
|
||||
}
|
||||
|
||||
exportFieldLoading.value = true
|
||||
try {
|
||||
const params = {
|
||||
...searchForm,
|
||||
fields: selectedExportFields.value.join(',')
|
||||
}
|
||||
await exportStudentData(params)
|
||||
useMessage().success('导出任务已创建,请在文件管理中下载')
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg || '导出失败')
|
||||
} finally {
|
||||
exportFieldLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 申请顶岗
|
||||
@@ -889,3 +1012,30 @@ onMounted(() => {
|
||||
getStuStatusListData()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.export-field-container {
|
||||
.field-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
.field-checkbox-group {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 12px;
|
||||
padding: 10px;
|
||||
|
||||
.field-checkbox {
|
||||
width: calc(25% - 12px);
|
||||
margin-right: 0;
|
||||
|
||||
@media (max-width: 768px) {
|
||||
width: calc(50% - 12px);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
495
src/views/basic/graduverify/index.vue
Normal file
495
src/views/basic/graduverify/index.vue
Normal file
@@ -0,0 +1,495 @@
|
||||
<template>
|
||||
<div class="modern-page-container">
|
||||
<div class="page-wrapper">
|
||||
<!-- 搜索表单卡片 -->
|
||||
<el-card v-show="showSearch" class="search-card" shadow="never">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<el-icon class="title-icon"><Search /></el-icon>
|
||||
筛选条件
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
<el-form :model="searchForm" ref="searchFormRef" :inline="true" @keyup.enter="handleSearch" class="search-form">
|
||||
<el-form-item label="批次号" prop="batchNo">
|
||||
<el-input
|
||||
v-model="searchForm.batchNo"
|
||||
placeholder="请输入批次号"
|
||||
clearable
|
||||
style="width: 180px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="学号" prop="stuNo">
|
||||
<el-input
|
||||
v-model="searchForm.stuNo"
|
||||
placeholder="请输入学号"
|
||||
clearable
|
||||
style="width: 150px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="姓名" prop="systemRealName">
|
||||
<el-input
|
||||
v-model="searchForm.systemRealName"
|
||||
placeholder="请输入姓名"
|
||||
clearable
|
||||
style="width: 120px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="入学年份" prop="enterYear">
|
||||
<el-date-picker
|
||||
v-model="searchForm.enterYear"
|
||||
type="year"
|
||||
placeholder="选择年份"
|
||||
value-format="YYYY"
|
||||
style="width: 120px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否一致" prop="isMatch">
|
||||
<el-select
|
||||
v-model="searchForm.isMatch"
|
||||
placeholder="请选择"
|
||||
clearable
|
||||
style="width: 120px">
|
||||
<el-option label="一致" value="1" />
|
||||
<el-option label="不一致" value="0" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="核对状态" prop="verifyStatus">
|
||||
<el-select
|
||||
v-model="searchForm.verifyStatus"
|
||||
placeholder="请选择核对状态"
|
||||
clearable
|
||||
style="width: 120px">
|
||||
<el-option label="待核对" value="0" />
|
||||
<el-option label="已核对" value="1" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleSearch">查询</el-button>
|
||||
<el-button icon="Refresh" @click="handleReset">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<!-- 内容卡片 -->
|
||||
<el-card class="content-card" shadow="never">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<el-icon class="title-icon"><User /></el-icon>
|
||||
毕业学生信息核对
|
||||
</span>
|
||||
<div class="header-actions">
|
||||
<el-upload
|
||||
:show-file-list="false"
|
||||
:before-upload="beforeUpload"
|
||||
:http-request="handleImport"
|
||||
accept=".xlsx,.xls"
|
||||
class="upload-btn">
|
||||
<el-button type="primary" icon="Upload" :loading="importLoading">导入核对</el-button>
|
||||
</el-upload>
|
||||
<el-button type="success" icon="Download" @click="handleDownloadTemplate">下载模板</el-button>
|
||||
<el-button type="warning" icon="Download" @click="handleExport">导出数据</el-button>
|
||||
<el-button type="info" icon="Bell" @click="handleSend" :disabled="!searchForm.batchNo">下发班主任</el-button>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
class="ml10"
|
||||
@queryTable="getDataList" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- 统计卡片 -->
|
||||
<el-row :gutter="16" class="stat-row">
|
||||
<el-col :span="4">
|
||||
<el-statistic title="总核对数" :value="statistics.total" />
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-statistic title="信息一致" :value="statistics.matched">
|
||||
<template #suffix>
|
||||
<span class="text-success">人</span>
|
||||
</template>
|
||||
</el-statistic>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-statistic title="信息不一致" :value="statistics.mismatched">
|
||||
<template #suffix>
|
||||
<span class="text-danger">人</span>
|
||||
</template>
|
||||
</el-statistic>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-statistic title="待核对" :value="statistics.pending" />
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-statistic title="已核对" :value="statistics.verified" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 表格 -->
|
||||
<el-table
|
||||
:data="dataList"
|
||||
v-loading="loading"
|
||||
stripe
|
||||
:cell-style="tableStyle.cellStyle"
|
||||
:header-cell-style="tableStyle.headerCellStyle"
|
||||
class="modern-table">
|
||||
<el-table-column type="index" label="序号" width="70" align="center">
|
||||
<template #default="{ $index }">
|
||||
{{ (page.currentPage - 1) * page.pageSize + $index + 1 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="batchNo" label="批次号" width="160" align="center" />
|
||||
<el-table-column prop="stuNo" label="学号" width="120" align="center" />
|
||||
<el-table-column label="姓名" width="180" align="center">
|
||||
<template #default="{ row }">
|
||||
<div>
|
||||
<span v-if="row.systemRealName">系统:{{ row.systemRealName }}</span>
|
||||
<span v-if="row.systemRealName && row.enrollRealName && row.systemRealName !== row.enrollRealName"
|
||||
class="text-danger">
|
||||
<br />回流:{{ row.enrollRealName }}
|
||||
</span>
|
||||
<span v-else-if="row.enrollRealName && !row.systemRealName">回流:{{ row.enrollRealName }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="身份证号" width="220" align="center">
|
||||
<template #default="{ row }">
|
||||
<div v-if="row.systemIdCard || row.enrollIdCard">
|
||||
<div v-if="row.systemIdCard">系统:{{ row.systemIdCard }}</div>
|
||||
<div v-if="row.enrollIdCard && row.enrollIdCard !== row.systemIdCard" class="text-warning">
|
||||
回流:{{ row.enrollIdCard }}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="enrollNo" label="学籍号" width="180" align="center" />
|
||||
<el-table-column prop="className" label="班级" width="150" />
|
||||
<el-table-column prop="classMasterName" label="班主任" width="100" align="center" />
|
||||
<el-table-column prop="enterYear" label="入学年份" width="100" align="center" />
|
||||
<el-table-column prop="isMatch" label="是否一致" width="100" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="row.isMatch === '1' ? 'success' : 'danger'" size="small">
|
||||
{{ row.isMatch === '1' ? '一致' : '不一致' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="verifyStatus" label="核对状态" width="100" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="row.verifyStatus === '1' ? 'success' : 'warning'" size="small">
|
||||
{{ row.verifyStatus === '1' ? '已核对' : '待核对' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="verifyResult" label="核对结果" width="150" show-overflow-tooltip />
|
||||
<el-table-column prop="remarks" label="备注" width="150" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="120" align="center" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
v-if="row.verifyStatus === '0'"
|
||||
icon="Edit"
|
||||
link
|
||||
type="primary"
|
||||
@click="handleVerify(row)">
|
||||
核对
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<template #empty>
|
||||
<el-empty description="暂无数据" :image-size="120" />
|
||||
</template>
|
||||
</el-table>
|
||||
|
||||
<!-- 分页 -->
|
||||
<el-pagination
|
||||
v-model:current-page="page.currentPage"
|
||||
v-model:page-size="page.pageSize"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:total="page.total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
class="pagination"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange" />
|
||||
</el-card>
|
||||
</div>
|
||||
|
||||
<!-- 核对弹窗 -->
|
||||
<el-dialog
|
||||
v-model="verifyDialogVisible"
|
||||
title="毕业学生信息核对"
|
||||
width="600px"
|
||||
:close-on-click-modal="false">
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="学号">{{ verifyData.stuNo }}</el-descriptions-item>
|
||||
<el-descriptions-item label="入学年份">{{ verifyData.enterYear }}</el-descriptions-item>
|
||||
<el-descriptions-item label="系统姓名">{{ verifyData.systemRealName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="回流姓名">{{ verifyData.enrollRealName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="系统身份证">{{ verifyData.systemIdCard }}</el-descriptions-item>
|
||||
<el-descriptions-item label="回流身份证">{{ verifyData.enrollIdCard }}</el-descriptions-item>
|
||||
<el-descriptions-item label="学籍号">{{ verifyData.enrollNo }}</el-descriptions-item>
|
||||
<el-descriptions-item label="班级">{{ verifyData.className }}</el-descriptions-item>
|
||||
<el-descriptions-item label="信息是否一致" :span="2">
|
||||
<el-tag :type="verifyData.isMatch === '1' ? 'success' : 'danger'">
|
||||
{{ verifyData.isMatch === '1' ? '一致' : '不一致' }}
|
||||
</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item v-if="verifyData.remarks" label="备注" :span="2">{{ verifyData.remarks }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-form :model="verifyForm" label-width="80px" class="verify-form">
|
||||
<el-form-item label="核对结果">
|
||||
<el-radio-group v-model="verifyForm.verifyResult">
|
||||
<el-radio label="信息无误">信息无误</el-radio>
|
||||
<el-radio label="需修改系统">需修改系统</el-radio>
|
||||
<el-radio label="需修改回流">需修改回流</el-radio>
|
||||
<el-radio label="其他问题">其他问题</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="verifyDialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="submitVerify" :loading="verifyLoading">确定</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="GraduVerify">
|
||||
import { reactive, ref, onMounted } from 'vue'
|
||||
import { fetchList, importData, exportData, sendToClassMaster, submitVerify as submitVerifyApi, downloadTemplate } from '/@/api/basic/graduverify'
|
||||
import { useMessage, useMessageBox } from '/@/hooks/message'
|
||||
import { Search, User, Upload, Download, Bell, Edit } from '@element-plus/icons-vue'
|
||||
|
||||
// 定义变量内容
|
||||
const searchFormRef = ref()
|
||||
const showSearch = ref(true)
|
||||
const loading = ref(false)
|
||||
const importLoading = ref(false)
|
||||
const verifyLoading = ref(false)
|
||||
const dataList = ref<any[]>([])
|
||||
const verifyDialogVisible = ref(false)
|
||||
const verifyData = ref<any>({})
|
||||
const verifyForm = reactive({
|
||||
id: '',
|
||||
verifyResult: '信息无误'
|
||||
})
|
||||
|
||||
// 统计数据
|
||||
const statistics = reactive({
|
||||
total: 0,
|
||||
matched: 0,
|
||||
mismatched: 0,
|
||||
pending: 0,
|
||||
verified: 0
|
||||
})
|
||||
|
||||
// 分页
|
||||
const page = reactive({
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
total: 0
|
||||
})
|
||||
|
||||
// 搜索表单
|
||||
const searchForm = reactive({
|
||||
batchNo: '',
|
||||
stuNo: '',
|
||||
systemRealName: '',
|
||||
enterYear: undefined as number | undefined,
|
||||
isMatch: '',
|
||||
verifyStatus: ''
|
||||
})
|
||||
|
||||
// 表格样式
|
||||
const tableStyle = {
|
||||
cellStyle: { textAlign: 'center' },
|
||||
headerCellStyle: {
|
||||
textAlign: 'center',
|
||||
background: 'var(--el-table-row-hover-bg-color)',
|
||||
color: 'var(--el-text-color-primary)'
|
||||
}
|
||||
}
|
||||
|
||||
// 查询
|
||||
const handleSearch = () => {
|
||||
page.currentPage = 1
|
||||
getDataList()
|
||||
}
|
||||
|
||||
// 重置
|
||||
const handleReset = () => {
|
||||
searchFormRef.value?.resetFields()
|
||||
getDataList()
|
||||
}
|
||||
|
||||
// 分页
|
||||
const handleSizeChange = (val: number) => {
|
||||
page.pageSize = val
|
||||
getDataList()
|
||||
}
|
||||
|
||||
const handleCurrentChange = (val: number) => {
|
||||
page.currentPage = val
|
||||
getDataList()
|
||||
}
|
||||
|
||||
// 获取数据列表
|
||||
const getDataList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const res = await fetchList({
|
||||
current: page.currentPage,
|
||||
size: page.pageSize,
|
||||
...searchForm,
|
||||
enterYear: searchForm.enterYear ? parseInt(searchForm.enterYear as any) : undefined
|
||||
})
|
||||
if (res.data && res.data.records) {
|
||||
dataList.value = res.data.records
|
||||
page.total = res.data.total
|
||||
|
||||
// 计算统计数据
|
||||
statistics.total = res.data.total
|
||||
statistics.matched = dataList.value.filter((item: any) => item.isMatch === '1').length
|
||||
statistics.mismatched = dataList.value.filter((item: any) => item.isMatch === '0').length
|
||||
statistics.pending = dataList.value.filter((item: any) => item.verifyStatus === '0').length
|
||||
statistics.verified = dataList.value.filter((item: any) => item.verifyStatus === '1').length
|
||||
} else {
|
||||
dataList.value = []
|
||||
page.total = 0
|
||||
}
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg || '获取数据失败')
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 上传前验证
|
||||
const beforeUpload = (file: File) => {
|
||||
const isExcel = file.name.endsWith('.xlsx') || file.name.endsWith('.xls')
|
||||
if (!isExcel) {
|
||||
useMessage().error('只能上传Excel文件')
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// 导入核对
|
||||
const handleImport = async (options: any) => {
|
||||
importLoading.value = true
|
||||
try {
|
||||
const res = await importData(options.file)
|
||||
useMessage().success(res.msg || '导入核对成功')
|
||||
if (res.data) {
|
||||
searchForm.batchNo = ''
|
||||
}
|
||||
getDataList()
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg || '导入失败')
|
||||
} finally {
|
||||
importLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 下载模板
|
||||
const handleDownloadTemplate = async () => {
|
||||
try {
|
||||
const res = await downloadTemplate()
|
||||
const blob = new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' })
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
const link = document.createElement('a')
|
||||
link.href = url
|
||||
link.download = '毕业学籍回流导入模板.xlsx'
|
||||
link.click()
|
||||
window.URL.revokeObjectURL(url)
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg || '下载失败')
|
||||
}
|
||||
}
|
||||
|
||||
// 导出
|
||||
const handleExport = async () => {
|
||||
try {
|
||||
const res = await exportData(searchForm)
|
||||
const blob = new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' })
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
const link = document.createElement('a')
|
||||
link.href = url
|
||||
link.download = '毕业学生核对数据.xlsx'
|
||||
link.click()
|
||||
window.URL.revokeObjectURL(url)
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg || '导出失败')
|
||||
}
|
||||
}
|
||||
|
||||
// 下发班主任
|
||||
const handleSend = async () => {
|
||||
if (!searchForm.batchNo) {
|
||||
useMessage().warning('请先选择批次号')
|
||||
return
|
||||
}
|
||||
try {
|
||||
await useMessageBox().confirm('确定要将该批次数据下发至班主任核对吗?')
|
||||
await sendToClassMaster(searchForm.batchNo)
|
||||
useMessage().success('下发成功')
|
||||
} catch (err: any) {
|
||||
if (err !== 'cancel') {
|
||||
useMessage().error(err.msg || '下发失败')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 核对
|
||||
const handleVerify = (row: any) => {
|
||||
verifyData.value = row
|
||||
verifyForm.id = row.id
|
||||
verifyForm.verifyResult = '信息无误'
|
||||
verifyDialogVisible.value = true
|
||||
}
|
||||
|
||||
// 提交核对
|
||||
const submitVerify = async () => {
|
||||
verifyLoading.value = true
|
||||
try {
|
||||
await submitVerifyApi(verifyForm.id, verifyForm.verifyResult)
|
||||
useMessage().success('核对成功')
|
||||
verifyDialogVisible.value = false
|
||||
getDataList()
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg || '核对失败')
|
||||
} finally {
|
||||
verifyLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 初始化
|
||||
onMounted(() => {
|
||||
getDataList()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@import '/@/assets/styles/modern-page.scss';
|
||||
|
||||
.stat-row {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.upload-btn {
|
||||
display: inline-block;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.text-danger {
|
||||
color: var(--el-color-danger);
|
||||
}
|
||||
|
||||
.text-warning {
|
||||
color: var(--el-color-warning);
|
||||
}
|
||||
|
||||
.text-success {
|
||||
color: var(--el-color-success);
|
||||
}
|
||||
|
||||
.verify-form {
|
||||
margin-top: 16px;
|
||||
}
|
||||
</style>
|
||||
@@ -88,25 +88,25 @@
|
||||
<!-- 操作按钮 -->
|
||||
<el-row>
|
||||
<div class="mb8" style="width: 100%">
|
||||
<el-button
|
||||
icon="Upload"
|
||||
type="primary"
|
||||
class="ml10"
|
||||
<el-button
|
||||
icon="Upload"
|
||||
type="primary"
|
||||
class="ml10"
|
||||
@click="handleImportComment">
|
||||
评语导入
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="Calendar"
|
||||
type="primary"
|
||||
class="ml10"
|
||||
<el-button
|
||||
icon="Calendar"
|
||||
type="primary"
|
||||
class="ml10"
|
||||
@click="handleSetClassStartTime">
|
||||
设置班级开学时间
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="Download"
|
||||
type="primary"
|
||||
class="ml10"
|
||||
@click="handleExport">
|
||||
<el-button
|
||||
icon="Download"
|
||||
type="primary"
|
||||
class="ml10"
|
||||
@click="handleExportIntroduction">
|
||||
名单导出
|
||||
</el-button>
|
||||
<right-toolbar
|
||||
@@ -131,15 +131,22 @@
|
||||
<el-table-column prop="realName" label="姓名" show-overflow-tooltip align="center" />
|
||||
<el-table-column prop="comment" label="评语" show-overflow-tooltip align="center" min-width="200" />
|
||||
<el-table-column prop="parentalMsg" label="家长寄语" show-overflow-tooltip align="center" min-width="200" />
|
||||
<el-table-column label="操作" width="150" align="center" fixed="right">
|
||||
<el-table-column label="操作" width="200" align="center" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
icon="Edit"
|
||||
text
|
||||
type="primary"
|
||||
<el-button
|
||||
icon="Edit"
|
||||
text
|
||||
type="primary"
|
||||
@click="handleEdit(scope.row)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="Document"
|
||||
text
|
||||
type="success"
|
||||
@click="handleExportSingle(scope.row)">
|
||||
导出评语
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -155,12 +162,15 @@
|
||||
<edit-dialog ref="editDialogRef" @refresh="getDataList" />
|
||||
|
||||
<!-- 评语导入弹窗 -->
|
||||
<el-dialog
|
||||
title="评语导入"
|
||||
v-model="importDialogVisible"
|
||||
:width="500"
|
||||
:close-on-click-modal="false"
|
||||
<el-dialog
|
||||
title="评语导入"
|
||||
v-model="importDialogVisible"
|
||||
:width="500"
|
||||
:close-on-click-modal="false"
|
||||
draggable>
|
||||
<div style="text-align: center; margin-bottom: 20px">
|
||||
<el-button type="success" :icon="Download" @click="handleDownloadTemplate">下载模板</el-button>
|
||||
</div>
|
||||
<el-upload
|
||||
ref="uploadRef"
|
||||
:auto-upload="false"
|
||||
@@ -187,11 +197,11 @@
|
||||
</el-dialog>
|
||||
|
||||
<!-- 设置班级开学时间弹窗 -->
|
||||
<el-dialog
|
||||
title="设置班级开学时间"
|
||||
v-model="startTimeDialogVisible"
|
||||
:width="500"
|
||||
:close-on-click-modal="false"
|
||||
<el-dialog
|
||||
title="设置班级开学时间"
|
||||
v-model="startTimeDialogVisible"
|
||||
:width="500"
|
||||
:close-on-click-modal="false"
|
||||
draggable>
|
||||
<el-form
|
||||
ref="startTimeFormRef"
|
||||
@@ -199,6 +209,35 @@
|
||||
:rules="startTimeRules"
|
||||
label-width="120px"
|
||||
v-loading="startTimeLoading">
|
||||
<el-form-item label="学年" prop="schoolYear">
|
||||
<el-select
|
||||
v-model="startTimeForm.schoolYear"
|
||||
placeholder="请选择学年"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in schoolYearList"
|
||||
:key="item.year"
|
||||
:label="item.year"
|
||||
:value="item.year">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="学期" prop="schoolTerm">
|
||||
<el-select
|
||||
v-model="startTimeForm.schoolTerm"
|
||||
placeholder="请选择学期"
|
||||
clearable
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in schoolTermList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="班级" prop="classCode">
|
||||
<el-select
|
||||
v-model="startTimeForm.classCode"
|
||||
@@ -217,10 +256,10 @@
|
||||
<el-form-item label="开学时间" prop="startTime">
|
||||
<el-date-picker
|
||||
v-model="startTimeForm.startTime"
|
||||
type="date"
|
||||
type="datetime"
|
||||
placeholder="选择开学时间"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
format="YYYY-MM-DD HH:mm"
|
||||
value-format="YYYY-MM-DD HH:mm"
|
||||
style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@@ -237,13 +276,14 @@
|
||||
<script setup lang="ts" name="QualityReport">
|
||||
import { reactive, ref, onMounted } from 'vue'
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table";
|
||||
import { fetchList, importComment, setClassStartTime, exportExcel } from "/@/api/ems/qualityReport";
|
||||
import { fetchList, importComment, setClassStartTime, exportExcel, exportStudentCommentTemplate } from "/@/api/ems/qualityReport";
|
||||
import { exportClassAssetsIntroduction, downloadBlobFile } from "/@/api/stuwork/file";
|
||||
import { getDeptList } from "/@/api/basic/basicclass";
|
||||
import { getClassListByRole } from "/@/api/basic/basicclass";
|
||||
import { queryAllSchoolYear } from "/@/api/basic/basicyear";
|
||||
import { getDicts } from "/@/api/admin/dict";
|
||||
import { useMessage } from "/@/hooks/message";
|
||||
import { UploadFilled } from '@element-plus/icons-vue'
|
||||
import { UploadFilled, Download } from '@element-plus/icons-vue'
|
||||
import EditDialog from './edit.vue'
|
||||
|
||||
// 定义变量内容
|
||||
@@ -265,14 +305,23 @@ const startTimeLoading = ref(false)
|
||||
// 设置班级开学时间表单
|
||||
const startTimeForm = reactive({
|
||||
classCode: '',
|
||||
classNo: '',
|
||||
schoolYear: '',
|
||||
schoolTerm: '',
|
||||
startTime: ''
|
||||
})
|
||||
|
||||
// 设置班级开学时间表单验证规则
|
||||
const startTimeRules = {
|
||||
schoolYear: [
|
||||
{ required: true, message: '请选择学年', trigger: 'change' }
|
||||
],
|
||||
classCode: [
|
||||
{ required: true, message: '请选择班级', trigger: 'change' }
|
||||
],
|
||||
schoolTerm: [
|
||||
{ required: true, message: '请选择学期', trigger: 'change' }
|
||||
],
|
||||
startTime: [
|
||||
{ required: true, message: '请选择开学时间', trigger: 'change' }
|
||||
]
|
||||
@@ -339,6 +388,24 @@ const handleFileChange = (file: any) => {
|
||||
importFile.value = file.raw
|
||||
}
|
||||
|
||||
// 下载模板
|
||||
const handleDownloadTemplate = async () => {
|
||||
try {
|
||||
const res = await exportStudentCommentTemplate()
|
||||
const blob = res instanceof Blob ? res : (res.data instanceof Blob ? res.data : new Blob([res.data || res]))
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
const link = document.createElement('a')
|
||||
link.href = url
|
||||
link.download = '学生评语导入模板.xlsx'
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
window.URL.revokeObjectURL(url)
|
||||
document.body.removeChild(link)
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg || '下载模板失败')
|
||||
}
|
||||
}
|
||||
|
||||
// 提交导入
|
||||
const handleImportSubmit = async () => {
|
||||
if (!importFile.value) {
|
||||
@@ -365,6 +432,9 @@ const handleImportSubmit = async () => {
|
||||
const handleSetClassStartTime = () => {
|
||||
startTimeDialogVisible.value = true
|
||||
startTimeForm.classCode = ''
|
||||
startTimeForm.classNo = ''
|
||||
startTimeForm.schoolYear = ''
|
||||
startTimeForm.schoolTerm = ''
|
||||
startTimeForm.startTime = ''
|
||||
startTimeFormRef.value?.resetFields()
|
||||
}
|
||||
@@ -372,15 +442,29 @@ const handleSetClassStartTime = () => {
|
||||
// 提交设置班级开学时间
|
||||
const handleStartTimeSubmit = async () => {
|
||||
if (!startTimeFormRef.value) return
|
||||
|
||||
|
||||
await startTimeFormRef.value.validate(async (valid: boolean) => {
|
||||
if (!valid) return
|
||||
|
||||
|
||||
startTimeLoading.value = true
|
||||
try {
|
||||
// 解析开学时间
|
||||
const dateTime = startTimeForm.startTime.split(' ')
|
||||
const dateParts = dateTime[0].split('-')
|
||||
const timeParts = dateTime[1] ? dateTime[1].split(':') : ['00', '00']
|
||||
|
||||
// 查找选中班级的 classNo
|
||||
const selectedClass = classList.value.find(item => item.classCode === startTimeForm.classCode)
|
||||
const classNo = selectedClass ? selectedClass.classCode : ''
|
||||
|
||||
await setClassStartTime({
|
||||
classCode: startTimeForm.classCode,
|
||||
startTime: startTimeForm.startTime
|
||||
classNo: classNo, // 班级代码
|
||||
schoolYear: startTimeForm.schoolYear,
|
||||
schoolTerm: startTimeForm.schoolTerm || '',
|
||||
openYear: dateParts[0], // 开学年
|
||||
openMonth: dateParts[1], // 开学月
|
||||
openDate: dateParts[2], // 开学日
|
||||
openHour: timeParts[0] // 开学时
|
||||
})
|
||||
useMessage().success('设置成功')
|
||||
startTimeDialogVisible.value = false
|
||||
@@ -396,29 +480,29 @@ const handleStartTimeSubmit = async () => {
|
||||
const handleExport = async () => {
|
||||
try {
|
||||
const res = await exportExcel(state.queryForm)
|
||||
|
||||
|
||||
// 创建blob对象
|
||||
const blob = new Blob([res as unknown as BlobPart], {
|
||||
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
||||
const blob = new Blob([res as unknown as BlobPart], {
|
||||
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
||||
})
|
||||
|
||||
|
||||
// 创建下载链接
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
const link = document.createElement('a')
|
||||
link.href = url
|
||||
|
||||
|
||||
// 设置文件名
|
||||
const fileName = `素质报告单名单_${new Date().getTime()}.xlsx`
|
||||
link.setAttribute('download', fileName)
|
||||
|
||||
|
||||
// 触发下载
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
|
||||
|
||||
// 清理
|
||||
document.body.removeChild(link)
|
||||
window.URL.revokeObjectURL(url)
|
||||
|
||||
|
||||
useMessage().success('导出成功')
|
||||
} catch (err: any) {
|
||||
console.error('导出失败', err)
|
||||
@@ -426,6 +510,107 @@ const handleExport = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 检查 blob 是否包含错误信息(后端可能将错误以 blob 格式返回)
|
||||
const checkBlobError = async (blob: Blob): Promise<boolean> => {
|
||||
// 尝试读取 blob 内容检查是否为 JSON 错误信息
|
||||
try {
|
||||
const text = await blob.text()
|
||||
// 尝试解析为 JSON
|
||||
const errorData = JSON.parse(text)
|
||||
// 检查是否有错误标识(code 不为 0 或有 msg 字段)
|
||||
if (errorData.code !== undefined && errorData.code !== 0) {
|
||||
useMessage().error(errorData.msg || errorData.message || '操作失败')
|
||||
return true
|
||||
}
|
||||
// 如果有 msg 字段且不是成功状态
|
||||
if (errorData.msg && errorData.code !== 0) {
|
||||
useMessage().error(errorData.msg)
|
||||
return true
|
||||
}
|
||||
} catch {
|
||||
// 解析失败,不是 JSON,继续当作文件处理
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// 导出班级评语(整班)
|
||||
const handleExportIntroduction = async () => {
|
||||
// 验证是否选择了班级
|
||||
if (!state.queryForm.classCode || !state.queryForm.schoolYear || !state.queryForm.schoolTerm) {
|
||||
useMessage().warning('请先选择班级 学年 学期')
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
const params = {
|
||||
classCode: state.queryForm.classCode,
|
||||
schoolYear: state.queryForm.schoolYear,
|
||||
schoolTerm: state.queryForm.schoolTerm,
|
||||
classNo: state.queryForm.classCode
|
||||
// 不传 stuNo 则整班导出
|
||||
}
|
||||
|
||||
const res = await exportClassAssetsIntroduction(params)
|
||||
|
||||
// 创建 blob 对象(docx 格式)- response 直接包含文件数据
|
||||
const blob = res instanceof Blob ? res : (res.data instanceof Blob ? res.data : new Blob([res.data || res]))
|
||||
|
||||
// 检查是否是错误响应(blob 中包含 JSON 错误信息)
|
||||
const isError = await checkBlobError(blob)
|
||||
if (isError) return
|
||||
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
const link = document.createElement('a')
|
||||
link.href = url
|
||||
link.download = `班级评语_${state.queryForm.classCode}.docx`
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
window.URL.revokeObjectURL(url)
|
||||
document.body.removeChild(link)
|
||||
|
||||
useMessage().success('导出成功')
|
||||
} catch (err: any) {
|
||||
console.error('导出班级评语失败', err)
|
||||
useMessage().error(err.msg || '导出失败')
|
||||
}
|
||||
}
|
||||
|
||||
// 导出单个学生评语
|
||||
const handleExportSingle = async (row: any) => {
|
||||
try {
|
||||
const params = {
|
||||
classCode: row.classCode || state.queryForm.classCode,
|
||||
schoolYear: state.queryForm.schoolYear,
|
||||
schoolTerm: state.queryForm.schoolTerm,
|
||||
classNo: state.queryForm.classCode,
|
||||
stuNo: row.stuNo // 传学号则是单人导出
|
||||
}
|
||||
|
||||
const res = await exportClassAssetsIntroduction(params)
|
||||
|
||||
// 创建 blob 对象(docx 格式)- response 直接包含文件数据
|
||||
const blob = res instanceof Blob ? res : (res.data instanceof Blob ? res.data : new Blob([res.data || res]))
|
||||
|
||||
// 检查是否是错误响应(blob 中包含 JSON 错误信息)
|
||||
const isError = await checkBlobError(blob)
|
||||
if (isError) return
|
||||
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
const link = document.createElement('a')
|
||||
link.href = url
|
||||
link.download = `学生评语_${row.realName || row.stuNo}.docx`
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
window.URL.revokeObjectURL(url)
|
||||
document.body.removeChild(link)
|
||||
|
||||
useMessage().success('导出成功')
|
||||
} catch (err: any) {
|
||||
console.error('导出学生评语失败', err)
|
||||
useMessage().error(err.msg || '导出失败')
|
||||
}
|
||||
}
|
||||
|
||||
// 编辑
|
||||
const handleEdit = (row: any) => {
|
||||
editDialogRef.value?.openDialog(row)
|
||||
|
||||
@@ -10,19 +10,26 @@
|
||||
获奖活动信息列表
|
||||
</span>
|
||||
<div class="header-actions">
|
||||
<el-button
|
||||
icon="Plus"
|
||||
type="primary"
|
||||
<el-button
|
||||
icon="Plus"
|
||||
type="primary"
|
||||
@click="formDialogRef.openDialog()">
|
||||
新增
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="Upload"
|
||||
type="primary"
|
||||
class="ml10"
|
||||
<el-button
|
||||
icon="Upload"
|
||||
type="success"
|
||||
class="ml10"
|
||||
@click="handleImport">
|
||||
导入
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="Download"
|
||||
type="warning"
|
||||
class="ml10"
|
||||
@click="handleExport">
|
||||
导出
|
||||
</el-button>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
class="ml10"
|
||||
@@ -178,7 +185,8 @@
|
||||
<script setup lang="ts" name="ActivityAwards">
|
||||
import { reactive, ref } from 'vue'
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table";
|
||||
import { fetchList, delObj, importExcel } from "/@/api/stuwork/activityawards";
|
||||
import { fetchList, delObj } from "/@/api/stuwork/activityawards";
|
||||
import { exportActivityAwardsTemplate, importActivityAwards, downloadBlobFile } from "/@/api/stuwork/file";
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||
import { parseTime } from "/@/utils/formatTime";
|
||||
import TableColumnControl from '/@/components/TableColumnControl/index.vue'
|
||||
@@ -266,28 +274,14 @@ const handleImport = () => {
|
||||
uploadRef.value?.clearFiles()
|
||||
}
|
||||
|
||||
// 导出
|
||||
const handleExport = async () => {
|
||||
await downloadBlobFile(exportActivityAwardsTemplate(), '活动获奖导入模板.xlsx')
|
||||
}
|
||||
|
||||
// 下载模板
|
||||
const handleDownloadTemplate = async () => {
|
||||
try {
|
||||
const fileName = '获奖活动信息导入模板.xlsx'
|
||||
const fileUrl = new URL(`../../../assets/file/${fileName}`, import.meta.url).href
|
||||
const response = await fetch(fileUrl)
|
||||
if (!response.ok) {
|
||||
throw new Error('文件下载失败')
|
||||
}
|
||||
const blob = await response.blob()
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
const link = document.createElement('a')
|
||||
link.href = url
|
||||
link.download = fileName
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
window.URL.revokeObjectURL(url)
|
||||
document.body.removeChild(link)
|
||||
useMessage().success('模板下载成功')
|
||||
} catch (error) {
|
||||
useMessage().error('模板下载失败,请检查模板文件是否存在')
|
||||
}
|
||||
await downloadBlobFile(exportActivityAwardsTemplate(), '活动获奖导入模板.xlsx')
|
||||
}
|
||||
|
||||
// 文件变化
|
||||
@@ -301,10 +295,12 @@ const handleImportSubmit = async () => {
|
||||
useMessage().warning('请选择要导入的文件')
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
importLoading.value = true
|
||||
try {
|
||||
await importExcel(importFile.value)
|
||||
const formData = new FormData()
|
||||
formData.append('file', importFile.value)
|
||||
await importActivityAwards(formData)
|
||||
useMessage().success('导入成功')
|
||||
importDialogVisible.value = false
|
||||
importFile.value = null
|
||||
|
||||
@@ -93,23 +93,30 @@
|
||||
日常巡检列表
|
||||
</span>
|
||||
<div class="header-actions">
|
||||
<el-button
|
||||
icon="FolderAdd"
|
||||
type="primary"
|
||||
<el-button
|
||||
icon="FolderAdd"
|
||||
type="primary"
|
||||
@click="formDialogRef.openDialog()">
|
||||
新增
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="Download"
|
||||
type="success"
|
||||
class="ml10"
|
||||
<el-button
|
||||
icon="Upload"
|
||||
type="success"
|
||||
class="ml10"
|
||||
@click="handleImport">
|
||||
导入
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="Download"
|
||||
type="warning"
|
||||
class="ml10"
|
||||
@click="handleExport">
|
||||
导出
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="DataAnalysis"
|
||||
type="info"
|
||||
class="ml10"
|
||||
<el-button
|
||||
icon="DataAnalysis"
|
||||
type="info"
|
||||
class="ml10"
|
||||
@click="handleRank">
|
||||
学期统计
|
||||
</el-button>
|
||||
@@ -212,7 +219,15 @@
|
||||
|
||||
<!-- 编辑、新增 -->
|
||||
<FormDialog ref="formDialogRef" @refresh="getDataList(false)" />
|
||||
|
||||
|
||||
<!-- 导入对话框 -->
|
||||
<upload-excel
|
||||
ref="uploadExcelRef"
|
||||
:title="'导入日常巡检'"
|
||||
:url="'/stuwork/classcheckdaily/import'"
|
||||
:temp-url="templateUrl"
|
||||
@refreshDataList="getDataList" />
|
||||
|
||||
<!-- 学期统计对话框 -->
|
||||
<el-dialog
|
||||
title="学期统计"
|
||||
@@ -271,6 +286,7 @@
|
||||
import { ref, reactive, defineAsyncComponent, computed, onMounted } from 'vue'
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table";
|
||||
import { fetchList, delObjs, exportData, getRank } from "/@/api/stuwork/classcheckdaily";
|
||||
import { makeExportClassCheckDailyTask } from "/@/api/stuwork/file";
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||
import { getDeptList } from '/@/api/basic/basicclass'
|
||||
import { getClassListByRole } from '/@/api/basic/basicclass'
|
||||
@@ -281,15 +297,19 @@ import { useTableColumnControl } from '/@/hooks/tableColumn'
|
||||
|
||||
// 引入组件
|
||||
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
|
||||
const UploadExcel = defineAsyncComponent(() => import('/@/components/Upload/Excel.vue'));
|
||||
|
||||
// 定义变量内容
|
||||
const formDialogRef = ref()
|
||||
const searchFormRef = ref()
|
||||
const columnControlRef = ref()
|
||||
const uploadExcelRef = ref()
|
||||
const showSearch = ref(true)
|
||||
const deptList = ref<any[]>([])
|
||||
const classList = ref<any[]>([])
|
||||
const schoolYearList = ref<any[]>([])
|
||||
// 模板文件URL
|
||||
const templateUrl = ref('/stuwork/classcheckdaily/importTemplate')
|
||||
|
||||
// 表格列配置
|
||||
const tableColumns = [
|
||||
@@ -402,22 +422,20 @@ const handleDelete = async (ids: string[]) => {
|
||||
// 导出
|
||||
const handleExport = async () => {
|
||||
try {
|
||||
const res = await exportData(searchForm)
|
||||
const blob = new Blob([res.data])
|
||||
const elink = document.createElement('a')
|
||||
elink.download = '日常巡检.xlsx'
|
||||
elink.style.display = 'none'
|
||||
elink.href = URL.createObjectURL(blob)
|
||||
document.body.appendChild(elink)
|
||||
elink.click()
|
||||
URL.revokeObjectURL(elink.href)
|
||||
document.body.removeChild(elink)
|
||||
useMessage().success('导出成功')
|
||||
await makeExportClassCheckDailyTask(searchForm)
|
||||
useMessage().success('导出任务已创建,请在文件管理中下载')
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg || '导出失败')
|
||||
}
|
||||
}
|
||||
|
||||
// 导入
|
||||
const handleImport = () => {
|
||||
if (uploadExcelRef.value) {
|
||||
uploadExcelRef.value.show()
|
||||
}
|
||||
}
|
||||
|
||||
// 打开学期统计对话框
|
||||
const handleRank = () => {
|
||||
rankDialogVisible.value = true
|
||||
|
||||
@@ -82,12 +82,26 @@
|
||||
班级卫生日常检查列表
|
||||
</span>
|
||||
<div class="header-actions">
|
||||
<el-button
|
||||
icon="FolderAdd"
|
||||
type="primary"
|
||||
<el-button
|
||||
icon="FolderAdd"
|
||||
type="primary"
|
||||
@click="formDialogRef.openDialog()">
|
||||
新增
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="Upload"
|
||||
type="success"
|
||||
class="ml10"
|
||||
@click="handleImport">
|
||||
导入
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="Download"
|
||||
type="warning"
|
||||
class="ml10"
|
||||
@click="handleExport">
|
||||
导出
|
||||
</el-button>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
class="ml10"
|
||||
@@ -194,6 +208,14 @@
|
||||
|
||||
<!-- 编辑、新增 -->
|
||||
<FormDialog ref="formDialogRef" @refresh="getDataList(false)" />
|
||||
|
||||
<!-- 导入对话框 -->
|
||||
<upload-excel
|
||||
ref="uploadExcelRef"
|
||||
:title="'导入日常行为'"
|
||||
:url="'/stuwork/classhygienedaily/import'"
|
||||
:temp-url="templateUrl"
|
||||
@refreshDataList="getDataList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -201,6 +223,7 @@
|
||||
import { ref, reactive, defineAsyncComponent, computed, onMounted } from 'vue'
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table";
|
||||
import { fetchList, delObjs } from "/@/api/stuwork/classhygienedaily";
|
||||
import { downloadClassHygieneDailyTemplate, makeExportClassHygieneDailyTask } from "/@/api/stuwork/file";
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||
import { getDeptList } from '/@/api/basic/basicclass'
|
||||
import { getClassListByRole } from '/@/api/basic/basicclass'
|
||||
@@ -210,14 +233,18 @@ import { useTableColumnControl } from '/@/hooks/tableColumn'
|
||||
|
||||
// 引入组件
|
||||
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
|
||||
const UploadExcel = defineAsyncComponent(() => import('/@/components/Upload/Excel.vue'));
|
||||
|
||||
// 定义变量内容
|
||||
const formDialogRef = ref()
|
||||
const searchFormRef = ref()
|
||||
const columnControlRef = ref()
|
||||
const uploadExcelRef = ref()
|
||||
const showSearch = ref(true)
|
||||
const deptList = ref<any[]>([])
|
||||
const classList = ref<any[]>([])
|
||||
// 模板文件URL
|
||||
const templateUrl = ref('/stuwork/classhygienedaily/importTemplate')
|
||||
|
||||
// 表格列配置
|
||||
const tableColumns = [
|
||||
@@ -292,6 +319,23 @@ const handleReset = () => {
|
||||
getDataList()
|
||||
}
|
||||
|
||||
// 导入
|
||||
const handleImport = () => {
|
||||
if (uploadExcelRef.value) {
|
||||
uploadExcelRef.value.show()
|
||||
}
|
||||
}
|
||||
|
||||
// 导出
|
||||
const handleExport = async () => {
|
||||
try {
|
||||
await makeExportClassHygieneDailyTask(searchForm)
|
||||
useMessage().success('导出任务已创建,请在文件管理中下载')
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg || '导出失败')
|
||||
}
|
||||
}
|
||||
|
||||
// 删除
|
||||
const handleDelete = async (ids: string[]) => {
|
||||
try {
|
||||
|
||||
@@ -274,7 +274,7 @@
|
||||
<upload-excel
|
||||
ref="uploadExcelRef"
|
||||
:title="'导入班主任考核'"
|
||||
:url="'/stuwork/classmasterevaluation/importData'"
|
||||
:url="'/stuwork/file/importClassMasterEvaluation'"
|
||||
:temp-url="templateUrl"
|
||||
@refreshDataList="getDataList" />
|
||||
|
||||
@@ -323,7 +323,8 @@
|
||||
<script setup lang="ts" name="ClassMasterEvaluation">
|
||||
import { ref, reactive, defineAsyncComponent, computed, onMounted } from 'vue'
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table";
|
||||
import { fetchList, delObjs, exportData } from "/@/api/stuwork/classmasterevaluation";
|
||||
import { fetchList, delObjs } from "/@/api/stuwork/classmasterevaluation";
|
||||
import { downloadClassMasterEvaluationTemplate, makeExportClassMasterEvaluationTask } from "/@/api/stuwork/file";
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||
import { getDeptList } from '/@/api/basic/basicclass'
|
||||
import { getClassListByRole } from '/@/api/basic/basicclass'
|
||||
@@ -347,7 +348,7 @@ const classList = ref<any[]>([])
|
||||
const assessmentCategoryList = ref<any[]>([])
|
||||
const assessmentPointList = ref<any[]>([])
|
||||
const appealDialogVisible = ref(false)
|
||||
const templateUrl = ref('assets/file/班主任考核导入模板.xlsx')
|
||||
const templateUrl = ref('/stuwork/file/getClassMasterEvaluationImportTemplate')
|
||||
const appealForm = reactive({
|
||||
id: '',
|
||||
virtualClassNo: '',
|
||||
@@ -472,17 +473,8 @@ const handleImport = () => {
|
||||
// 导出
|
||||
const handleExport = async () => {
|
||||
try {
|
||||
const res = await exportData(searchForm)
|
||||
const blob = new Blob([res.data])
|
||||
const elink = document.createElement('a')
|
||||
elink.download = '班主任考核.xlsx'
|
||||
elink.style.display = 'none'
|
||||
elink.href = URL.createObjectURL(blob)
|
||||
document.body.appendChild(elink)
|
||||
elink.click()
|
||||
URL.revokeObjectURL(elink.href)
|
||||
document.body.removeChild(elink)
|
||||
useMessage().success('导出成功')
|
||||
await makeExportClassMasterEvaluationTask(searchForm)
|
||||
useMessage().success('导出任务已创建,请在文件管理中下载')
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg || '导出失败')
|
||||
}
|
||||
|
||||
@@ -81,12 +81,26 @@
|
||||
教室日常卫生列表
|
||||
</span>
|
||||
<div class="header-actions">
|
||||
<el-button
|
||||
icon="FolderAdd"
|
||||
type="primary"
|
||||
<el-button
|
||||
icon="FolderAdd"
|
||||
type="primary"
|
||||
@click="formDialogRef.openDialog()">
|
||||
新增
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="Upload"
|
||||
type="success"
|
||||
class="ml10"
|
||||
@click="handleImport">
|
||||
导入
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="Download"
|
||||
type="warning"
|
||||
class="ml10"
|
||||
@click="handleExport">
|
||||
导出
|
||||
</el-button>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
:export="'stuwork_classRoomHygieneDaily_export'"
|
||||
@@ -195,6 +209,14 @@
|
||||
|
||||
<!-- 编辑、新增 -->
|
||||
<FormDialog ref="formDialogRef" @refresh="getDataList(false)" />
|
||||
|
||||
<!-- 导入对话框 -->
|
||||
<upload-excel
|
||||
ref="uploadExcelRef"
|
||||
:title="'导入教室日卫生'"
|
||||
:url="'/stuwork/classRoomHygieneDaily/import'"
|
||||
:temp-url="templateUrl"
|
||||
@refreshDataList="getDataList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -202,6 +224,7 @@
|
||||
import { ref, reactive, defineAsyncComponent, onMounted } from 'vue'
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table";
|
||||
import { fetchList, delObjs } from "/@/api/stuwork/classroomhygienedaily";
|
||||
import { downloadClassRoomHygieneDailyTemplate, makeExportClassRoomHygieneDailyTask, downloadBlobFile } from "/@/api/stuwork/file";
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||
import { getDeptList } from '/@/api/basic/basicclass'
|
||||
import { getClassListByRole } from '/@/api/basic/basicclass'
|
||||
@@ -211,15 +234,19 @@ import { useTableColumnControl } from '/@/hooks/tableColumn'
|
||||
|
||||
// 引入组件
|
||||
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
|
||||
const UploadExcel = defineAsyncComponent(() => import('/@/components/Upload/Excel.vue'));
|
||||
|
||||
// 定义变量内容
|
||||
const formDialogRef = ref()
|
||||
const searchFormRef = ref()
|
||||
const columnControlRef = ref()
|
||||
const uploadExcelRef = ref()
|
||||
// 搜索变量
|
||||
const showSearch = ref(true)
|
||||
const deptList = ref<any[]>([])
|
||||
const classList = ref<any[]>([])
|
||||
// 模板文件URL
|
||||
const templateUrl = ref('/stuwork/classRoomHygieneDaily/import/template')
|
||||
|
||||
// 表格列配置
|
||||
const tableColumns = [
|
||||
@@ -310,12 +337,29 @@ const getClassListData = async () => {
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile(
|
||||
'/stuwork/classRoomHygieneDaily/export',
|
||||
searchForm,
|
||||
'/stuwork/classRoomHygieneDaily/export',
|
||||
searchForm,
|
||||
'教室卫生.xlsx'
|
||||
)
|
||||
}
|
||||
|
||||
// 导入
|
||||
const handleImport = () => {
|
||||
if (uploadExcelRef.value) {
|
||||
uploadExcelRef.value.show()
|
||||
}
|
||||
}
|
||||
|
||||
// 导出
|
||||
const handleExport = async () => {
|
||||
try {
|
||||
await makeExportClassRoomHygieneDailyTask(searchForm)
|
||||
useMessage().success('导出任务已创建,请在文件管理中下载')
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg || '导出失败')
|
||||
}
|
||||
}
|
||||
|
||||
// 删除操作
|
||||
const handleDelete = async (ids: string[]) => {
|
||||
try {
|
||||
|
||||
@@ -89,16 +89,23 @@
|
||||
教室卫生月度分析列表
|
||||
</span>
|
||||
<div class="header-actions">
|
||||
<el-button
|
||||
icon="Upload"
|
||||
type="primary"
|
||||
<el-button
|
||||
icon="Upload"
|
||||
type="primary"
|
||||
@click="handleImport">
|
||||
导入
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="DocumentChecked"
|
||||
type="success"
|
||||
class="ml10"
|
||||
<el-button
|
||||
icon="Download"
|
||||
type="warning"
|
||||
class="ml10"
|
||||
@click="handleExport">
|
||||
导出
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="DocumentChecked"
|
||||
type="success"
|
||||
class="ml10"
|
||||
@click="handleCheck">
|
||||
考核
|
||||
</el-button>
|
||||
@@ -271,6 +278,7 @@ import { ref, reactive, defineAsyncComponent, computed, onMounted } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table";
|
||||
import { fetchList, delObjs, checkClassRoomHygieneMonthly } from "/@/api/stuwork/classroomhygienemonthly";
|
||||
import { makeExportClassRoomHygieneMonthlyTask } from "/@/api/stuwork/file";
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||
import { queryAllSchoolYear } from '/@/api/basic/basicyear'
|
||||
import { getDeptList } from '/@/api/basic/basicclass'
|
||||
@@ -299,8 +307,8 @@ const schoolTermList = ref<any[]>([])
|
||||
const deptList = ref<any[]>([])
|
||||
const classList = ref<any[]>([])
|
||||
const checkDialogVisible = ref(false)
|
||||
// 模板文件URL
|
||||
const templateUrl = ref('assets/file/教室月卫生导入模板.xlsx')
|
||||
// 模板文件URL - 使用后端接口
|
||||
const templateUrl = ref('/stuwork/classroomhygienemonthly/import/template')
|
||||
|
||||
// 表格列配置
|
||||
const tableColumns = [
|
||||
@@ -457,6 +465,16 @@ const handleImport = () => {
|
||||
(uploadExcelRef.value as any)?.show()
|
||||
}
|
||||
|
||||
// 导出
|
||||
const handleExport = async () => {
|
||||
try {
|
||||
await makeExportClassRoomHygieneMonthlyTask(searchForm)
|
||||
useMessage().success('导出任务已创建,请在文件管理中下载')
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg || '导出失败')
|
||||
}
|
||||
}
|
||||
|
||||
// 考核
|
||||
const handleCheck = () => {
|
||||
checkDialogVisible.value = true
|
||||
|
||||
@@ -59,6 +59,19 @@
|
||||
宿舍月卫生列表
|
||||
</span>
|
||||
<div class="header-actions">
|
||||
<el-button
|
||||
icon="Upload"
|
||||
type="primary"
|
||||
@click="handleImport">
|
||||
导入
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="Download"
|
||||
type="warning"
|
||||
class="ml10"
|
||||
@click="handleExport">
|
||||
导出
|
||||
</el-button>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
class="ml10"
|
||||
@@ -195,20 +208,33 @@
|
||||
<el-button type="primary" @click="submitEvaluation" :loading="evalLoading">确定评比</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 导入对话框 -->
|
||||
<upload-excel
|
||||
ref="uploadExcelRef"
|
||||
:title="'导入宿舍月卫生'"
|
||||
:url="'/stuwork/file/importDormHygieneMonthly'"
|
||||
:temp-url="templateUrl"
|
||||
@refreshDataList="getDataList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="DormHygieneMonthly">
|
||||
import { reactive, ref, onMounted } from 'vue'
|
||||
import { reactive, ref, onMounted, defineAsyncComponent } from 'vue'
|
||||
import { fetchList, addObj, editObj, delObj, triggerEvaluation } from '/@/api/stuwork/dormhygienemonthly'
|
||||
import { exportDormHygieneMonthlyTemplate, downloadBlobFile } from '/@/api/stuwork/file'
|
||||
import { getBuildingList } from '/@/api/stuwork/dormbuilding'
|
||||
import { useMessage } from '/@/hooks/message'
|
||||
import { Search, Document, Plus, Edit, Delete, Promotion } from '@element-plus/icons-vue'
|
||||
|
||||
// 引入组件
|
||||
const UploadExcel = defineAsyncComponent(() => import('/@/components/Upload/Excel.vue'));
|
||||
|
||||
// 定义变量内容
|
||||
const searchFormRef = ref()
|
||||
const formRef = ref()
|
||||
const evalFormRef = ref()
|
||||
const uploadExcelRef = ref()
|
||||
const showSearch = ref(true)
|
||||
const loading = ref(false)
|
||||
const submitLoading = ref(false)
|
||||
@@ -218,6 +244,8 @@ const buildingList = ref<any[]>([])
|
||||
const dialogVisible = ref(false)
|
||||
const evalDialogVisible = ref(false)
|
||||
const dialogTitle = ref('新增宿舍月卫生')
|
||||
// 模板文件URL
|
||||
const templateUrl = ref('/stuwork/file/exportDormHygieneMonthlyTemplate')
|
||||
|
||||
// 分页
|
||||
const page = reactive({
|
||||
@@ -361,6 +389,18 @@ const handleEvaluation = () => {
|
||||
evalDialogVisible.value = true
|
||||
}
|
||||
|
||||
// 导入
|
||||
const handleImport = () => {
|
||||
if (uploadExcelRef.value) {
|
||||
uploadExcelRef.value.show()
|
||||
}
|
||||
}
|
||||
|
||||
// 导出
|
||||
const handleExport = async () => {
|
||||
await downloadBlobFile(exportDormHygieneMonthlyTemplate(searchForm), '宿舍月卫生.xlsx')
|
||||
}
|
||||
|
||||
// 提交评比
|
||||
const submitEvaluation = async () => {
|
||||
evalLoading.value = true
|
||||
|
||||
@@ -88,19 +88,26 @@
|
||||
文明班级列表
|
||||
</span>
|
||||
<div class="header-actions">
|
||||
<el-button
|
||||
icon="Plus"
|
||||
type="primary"
|
||||
<el-button
|
||||
icon="Plus"
|
||||
type="primary"
|
||||
@click="formDialogRef.openDialog()">
|
||||
新增
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="Upload"
|
||||
type="success"
|
||||
class="ml10"
|
||||
<el-button
|
||||
icon="Upload"
|
||||
type="success"
|
||||
class="ml10"
|
||||
@click="handleImport">
|
||||
导入
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="Download"
|
||||
type="warning"
|
||||
class="ml10"
|
||||
@click="handleExport">
|
||||
导出
|
||||
</el-button>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
class="ml10"
|
||||
@@ -254,7 +261,8 @@
|
||||
<script setup lang="ts" name="RewardClass">
|
||||
import { reactive, ref, onMounted } from 'vue'
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table";
|
||||
import { fetchList, delObj, importExcel } from "/@/api/stuwork/rewardclass";
|
||||
import { fetchList, delObj } from "/@/api/stuwork/rewardclass";
|
||||
import { exportRewardClassTemplate, importRewardClass, downloadBlobFile } from "/@/api/stuwork/file";
|
||||
import { getDeptList } from "/@/api/basic/basicclass";
|
||||
import { getClassListByRole } from "/@/api/basic/basicclass";
|
||||
import { queryAllSchoolYear } from "/@/api/basic/basicyear";
|
||||
@@ -360,29 +368,14 @@ const handleImport = () => {
|
||||
uploadRef.value?.clearFiles()
|
||||
}
|
||||
|
||||
// 导出
|
||||
const handleExport = async () => {
|
||||
await downloadBlobFile(exportRewardClassTemplate(), '文明班级导入模板.xlsx')
|
||||
}
|
||||
|
||||
// 下载模板
|
||||
const handleDownloadTemplate = async () => {
|
||||
try {
|
||||
const fileName = '文明班级导入模板.xlsx'
|
||||
// 使用动态导入获取文件URL,从 views/stuwork/rewardclass 到 assets/file 的相对路径
|
||||
const fileUrl = new URL(`../../../assets/file/${fileName}`, import.meta.url).href
|
||||
const response = await fetch(fileUrl)
|
||||
if (!response.ok) {
|
||||
throw new Error('文件下载失败')
|
||||
}
|
||||
const blob = await response.blob()
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
const link = document.createElement('a')
|
||||
link.href = url
|
||||
link.download = fileName
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
window.URL.revokeObjectURL(url)
|
||||
document.body.removeChild(link)
|
||||
useMessage().success('模板下载成功')
|
||||
} catch (error) {
|
||||
useMessage().error('模板下载失败,请检查模板文件是否存在')
|
||||
}
|
||||
await downloadBlobFile(exportRewardClassTemplate(), '文明班级导入模板.xlsx')
|
||||
}
|
||||
|
||||
// 文件变化
|
||||
@@ -396,10 +389,12 @@ const handleImportSubmit = async () => {
|
||||
useMessage().warning('请选择要导入的文件')
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
importLoading.value = true
|
||||
try {
|
||||
await importExcel(importFile.value)
|
||||
const formData = new FormData()
|
||||
formData.append('file', importFile.value)
|
||||
await importRewardClass(formData)
|
||||
useMessage().success('导入成功')
|
||||
importDialogVisible.value = false
|
||||
importFile.value = null
|
||||
|
||||
@@ -71,19 +71,26 @@
|
||||
文明宿舍列表
|
||||
</span>
|
||||
<div class="header-actions">
|
||||
<el-button
|
||||
icon="Plus"
|
||||
type="primary"
|
||||
<el-button
|
||||
icon="Plus"
|
||||
type="primary"
|
||||
@click="formDialogRef.openDialog()">
|
||||
新增
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="Upload"
|
||||
type="success"
|
||||
class="ml10"
|
||||
<el-button
|
||||
icon="Upload"
|
||||
type="success"
|
||||
class="ml10"
|
||||
@click="handleImport">
|
||||
导入
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="Download"
|
||||
type="warning"
|
||||
class="ml10"
|
||||
@click="handleExport">
|
||||
导出
|
||||
</el-button>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
class="ml10"
|
||||
@@ -235,7 +242,8 @@
|
||||
import { reactive, ref, onMounted, computed } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table";
|
||||
import { fetchList, delObj, importExcel } from "/@/api/stuwork/rewarddorm";
|
||||
import { fetchList, delObj } from "/@/api/stuwork/rewarddorm";
|
||||
import { exportRewardDormTemplate, importRewardDorm, downloadBlobFile } from "/@/api/stuwork/file";
|
||||
import { queryAllSchoolYear } from "/@/api/basic/basicyear";
|
||||
import { getDicts } from "/@/api/admin/dict";
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||
@@ -332,29 +340,14 @@ const handleImport = () => {
|
||||
uploadRef.value?.clearFiles()
|
||||
}
|
||||
|
||||
// 导出
|
||||
const handleExport = async () => {
|
||||
await downloadBlobFile(exportRewardDormTemplate(), '文明宿舍导入模板.xlsx')
|
||||
}
|
||||
|
||||
// 下载模板
|
||||
const handleDownloadTemplate = async () => {
|
||||
try {
|
||||
const fileName = '文明宿舍导入模板.xlsx'
|
||||
// 模板文件位于 views/stuwork/rewarddorm 下的 assets/file 目录
|
||||
const fileUrl = new URL(`../../../assets/file/${fileName}`, import.meta.url).href
|
||||
const response = await fetch(fileUrl)
|
||||
if (!response.ok) {
|
||||
throw new Error('下载失败')
|
||||
}
|
||||
const blob = await response.blob()
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
const link = document.createElement('a')
|
||||
link.href = url
|
||||
link.download = fileName
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
window.URL.revokeObjectURL(url)
|
||||
document.body.removeChild(link)
|
||||
useMessage().success('下载成功')
|
||||
} catch (error) {
|
||||
useMessage().error('下载失败')
|
||||
}
|
||||
await downloadBlobFile(exportRewardDormTemplate(), '文明宿舍导入模板.xlsx')
|
||||
}
|
||||
|
||||
// 文件变化
|
||||
@@ -368,10 +361,12 @@ const handleImportSubmit = async () => {
|
||||
useMessage().warning('请先选择要上传的文件')
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
importLoading.value = true
|
||||
try {
|
||||
await importExcel(importFile.value)
|
||||
const formData = new FormData()
|
||||
formData.append('file', importFile.value)
|
||||
await importRewardDorm(formData)
|
||||
useMessage().success('导入成功')
|
||||
importDialogVisible.value = false
|
||||
importFile.value = null
|
||||
|
||||
@@ -289,7 +289,8 @@
|
||||
import { reactive, ref, onMounted, computed, nextTick } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table";
|
||||
import { fetchList, delObj, importExcel, exportExcel, getStatistics } from "/@/api/stuwork/stuunionleague";
|
||||
import { fetchList, delObj, getStatistics } from "/@/api/stuwork/stuunionleague";
|
||||
import { exportStuUnionLeagueTemplate, importStuUnionLeague, makeExportStuUnionLeagueTask } from "/@/api/stuwork/file";
|
||||
import { getClassListByRole } from "/@/api/basic/basicclass";
|
||||
import { getGradeList } from "/@/api/basic/basicclass";
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||
@@ -439,16 +440,18 @@ const handleImportSubmit = async () => {
|
||||
useMessage().warning('请先选择要上传的文件')
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
const file = fileList.value[0].raw
|
||||
if (!file) {
|
||||
useMessage().warning('文件无效')
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
importLoading.value = true
|
||||
try {
|
||||
await importExcel(file as File)
|
||||
const formData = new FormData()
|
||||
formData.append('file', file as File)
|
||||
await importStuUnionLeague(formData)
|
||||
useMessage().success('导入成功')
|
||||
importDialogVisible.value = false
|
||||
fileList.value = []
|
||||
@@ -463,17 +466,8 @@ const handleImportSubmit = async () => {
|
||||
// 导出
|
||||
const handleExport = async () => {
|
||||
try {
|
||||
const res = await exportExcel(state.queryForm)
|
||||
const blob = new Blob([res.data as BlobPart])
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
const link = document.createElement('a')
|
||||
link.href = url
|
||||
link.download = `学生团组织_${parseTime(new Date(), '{y}{m}{d}{h}{i}{s}')}.xlsx`
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
document.body.removeChild(link)
|
||||
window.URL.revokeObjectURL(url)
|
||||
useMessage().success('导出成功')
|
||||
await makeExportStuUnionLeagueTask(state.queryForm)
|
||||
useMessage().success('导出任务已创建,请在文件管理中下载')
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg || '导出失败')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user