|
|
@@ -268,14 +268,16 @@
|
|
|
<el-descriptions-item label="现岗位">{{ applicationDetail.currentPosition || '暂无' }}</el-descriptions-item>
|
|
|
<el-descriptions-item label="参加工作时间">{{ parseTime(applicationDetail.workStartTime) || '暂无' }}</el-descriptions-item>
|
|
|
<el-descriptions-item label="联系电话">{{ applicationDetail.phone || '暂无' }}</el-descriptions-item>
|
|
|
-
|
|
|
+
|
|
|
<!-- 培训情况信息 -->
|
|
|
<el-descriptions-item label="主办单位">{{ applicationDetail.organizerUnit || applicationDetail.courseName || '暂无' }}</el-descriptions-item>
|
|
|
<el-descriptions-item label="培训地点">{{ applicationDetail.location }}</el-descriptions-item>
|
|
|
<el-descriptions-item label="开始时间">{{ parseTime(applicationDetail.startTime) }}</el-descriptions-item>
|
|
|
<el-descriptions-item label="结束时间">{{ parseTime(applicationDetail.endTime) }}</el-descriptions-item>
|
|
|
<el-descriptions-item label="培训类型">{{ applicationDetail.trainingType || '暂无' }}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="培训费用">{{ applicationDetail.trainingFee ? `${applicationDetail.trainingFee}元` : '暂无' }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="培训费用">{{
|
|
|
+ applicationDetail.trainingFee ? `${applicationDetail.trainingFee}元` : '暂无'
|
|
|
+ }}</el-descriptions-item>
|
|
|
<el-descriptions-item label="申请状态">
|
|
|
<el-tag
|
|
|
:type="
|
|
|
@@ -293,7 +295,9 @@
|
|
|
</el-descriptions-item>
|
|
|
<el-descriptions-item label="申请时间">{{ parseTime(applicationDetail.applyTime) }}</el-descriptions-item>
|
|
|
<el-descriptions-item label="同行人" :span="2">{{ getCompanionNames(applicationDetail.companions) || '无' }}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="培训目的" :span="2">{{ applicationDetail.trainingPurpose || applicationDetail.reason || '暂无' }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="培训目的" :span="2">{{
|
|
|
+ applicationDetail.trainingPurpose || applicationDetail.reason || '暂无'
|
|
|
+ }}</el-descriptions-item>
|
|
|
<el-descriptions-item label="备注" :span="2">{{ applicationDetail.remark || '无' }}</el-descriptions-item>
|
|
|
|
|
|
<!-- 显示拒绝原因,如果申请被拒绝 -->
|
|
|
@@ -313,9 +317,9 @@
|
|
|
</el-descriptions>
|
|
|
|
|
|
<!-- 申请附件显示区域 -->
|
|
|
- <div v-if="applicationDetailAttachmentList.length > 0" class="attachment-section" style="margin-top: 20px;">
|
|
|
- <div class="section-title" style="margin-bottom: 15px; padding: 10px; border-left: 4px solid #409eff; background-color: #f5f7fa;">
|
|
|
- <el-icon style="margin-right: 8px;"><Paperclip /></el-icon>
|
|
|
+ <div v-if="applicationDetailAttachmentList.length > 0" class="attachment-section" style="margin-top: 20px">
|
|
|
+ <div class="section-title" style="margin-bottom: 15px; padding: 10px; border-left: 4px solid #409eff; background-color: #f5f7fa">
|
|
|
+ <el-icon style="margin-right: 8px"><Paperclip /></el-icon>
|
|
|
<strong>申请附件</strong>
|
|
|
</div>
|
|
|
<el-table :data="applicationDetailAttachmentList" border size="small">
|
|
|
@@ -328,9 +332,7 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column label="操作" width="100" align="center">
|
|
|
<template #default="scope">
|
|
|
- <el-button type="primary" link icon="Download" @click="handleDownloadApplicationAttachment(scope.row)" size="small">
|
|
|
- 下载
|
|
|
- </el-button>
|
|
|
+ <el-button type="primary" link icon="Download" @click="handleDownloadApplicationAttachment(scope.row)" size="small"> 下载 </el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
@@ -398,14 +400,18 @@
|
|
|
<el-descriptions-item label="现岗位">{{ approvalRecordDetail.currentPosition || '暂无' }}</el-descriptions-item>
|
|
|
<el-descriptions-item label="参加工作时间">{{ parseTime(approvalRecordDetail.workStartTime) || '暂无' }}</el-descriptions-item>
|
|
|
<el-descriptions-item label="联系电话">{{ approvalRecordDetail.phone || '暂无' }}</el-descriptions-item>
|
|
|
-
|
|
|
+
|
|
|
<!-- 培训情况信息 -->
|
|
|
- <el-descriptions-item label="主办单位">{{ approvalRecordDetail.organizerUnit || approvalRecordDetail.courseName || '暂无' }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="主办单位">{{
|
|
|
+ approvalRecordDetail.organizerUnit || approvalRecordDetail.courseName || '暂无'
|
|
|
+ }}</el-descriptions-item>
|
|
|
<el-descriptions-item label="培训地点">{{ approvalRecordDetail.location }}</el-descriptions-item>
|
|
|
<el-descriptions-item label="开始时间">{{ parseTime(approvalRecordDetail.startTime) }}</el-descriptions-item>
|
|
|
<el-descriptions-item label="结束时间">{{ parseTime(approvalRecordDetail.endTime) }}</el-descriptions-item>
|
|
|
<el-descriptions-item label="培训类型">{{ approvalRecordDetail.trainingType || '暂无' }}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="培训费用">{{ approvalRecordDetail.trainingFee ? `${approvalRecordDetail.trainingFee}元` : '暂无' }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="培训费用">{{
|
|
|
+ approvalRecordDetail.trainingFee ? `${approvalRecordDetail.trainingFee}元` : '暂无'
|
|
|
+ }}</el-descriptions-item>
|
|
|
<el-descriptions-item label="审批状态">
|
|
|
<el-tag
|
|
|
:type="
|
|
|
@@ -423,7 +429,9 @@
|
|
|
</el-descriptions-item>
|
|
|
<el-descriptions-item label="申请时间">{{ parseTime(approvalRecordDetail.applyTime) }}</el-descriptions-item>
|
|
|
<el-descriptions-item label="同行人" :span="2">{{ getCompanionNames(approvalRecordDetail.companions) || '无' }}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="培训目的" :span="2">{{ approvalRecordDetail.trainingPurpose || approvalRecordDetail.reason || '暂无' }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="培训目的" :span="2">{{
|
|
|
+ approvalRecordDetail.trainingPurpose || approvalRecordDetail.reason || '暂无'
|
|
|
+ }}</el-descriptions-item>
|
|
|
<el-descriptions-item label="备注" :span="2">{{ approvalRecordDetail.remark || '无' }}</el-descriptions-item>
|
|
|
|
|
|
<!-- 显示拒绝原因,如果申请被拒绝 -->
|
|
|
@@ -440,9 +448,9 @@
|
|
|
</el-descriptions>
|
|
|
|
|
|
<!-- 申请附件显示区域 -->
|
|
|
- <div v-if="approvalRecordDetailAttachmentList.length > 0" class="attachment-section" style="margin-top: 20px;">
|
|
|
- <div class="section-title" style="margin-bottom: 15px; padding: 10px; border-left: 4px solid #409eff; background-color: #f5f7fa;">
|
|
|
- <el-icon style="margin-right: 8px;"><Paperclip /></el-icon>
|
|
|
+ <div v-if="approvalRecordDetailAttachmentList.length > 0" class="attachment-section" style="margin-top: 20px">
|
|
|
+ <div class="section-title" style="margin-bottom: 15px; padding: 10px; border-left: 4px solid #409eff; background-color: #f5f7fa">
|
|
|
+ <el-icon style="margin-right: 8px"><Paperclip /></el-icon>
|
|
|
<strong>申请附件</strong>
|
|
|
</div>
|
|
|
<el-table :data="approvalRecordDetailAttachmentList" border size="small">
|
|
|
@@ -464,9 +472,9 @@
|
|
|
</div>
|
|
|
|
|
|
<!-- 审批历史记录 -->
|
|
|
- <div v-if="approvalHistoryList.length > 0" style="margin-top: 20px;">
|
|
|
- <div class="section-title" style="margin-bottom: 15px; padding: 10px; border-left: 4px solid #409eff; background-color: #f5f7fa;">
|
|
|
- <el-icon style="margin-right: 8px;"><Clock /></el-icon>
|
|
|
+ <div v-if="approvalHistoryList.length > 0" style="margin-top: 20px">
|
|
|
+ <div class="section-title" style="margin-bottom: 15px; padding: 10px; border-left: 4px solid #409eff; background-color: #f5f7fa">
|
|
|
+ <el-icon style="margin-right: 8px"><Clock /></el-icon>
|
|
|
<strong>审批历史</strong>
|
|
|
</div>
|
|
|
<el-table :data="approvalHistoryList" style="width: 100%" border stripe>
|
|
|
@@ -604,6 +612,7 @@ import {
|
|
|
processTrainingApproval
|
|
|
} from '@/api/rs/training';
|
|
|
import { listClassTeacherCounselorRel } from '@/api/xg/classTeacherCounselorRel';
|
|
|
+import { listUser } from '@/api/system/user';
|
|
|
import request from '@/utils/request';
|
|
|
|
|
|
// 动画配置
|
|
|
@@ -895,16 +904,16 @@ const getApprovalRecordList = async () => {
|
|
|
// status: '1,2', // 暂时注释掉状态过滤,获取所有记录
|
|
|
includeApprovedApplications: true // 确保包含已通过状态的培训申请数据
|
|
|
};
|
|
|
-
|
|
|
+
|
|
|
console.log('开始获取审批记录列表,查询参数:', queryParams);
|
|
|
const response = await listAllApprovalRecords(queryParams);
|
|
|
-
|
|
|
+
|
|
|
if (response && response.rows) {
|
|
|
approvalRecordList.value = response.rows;
|
|
|
approvalRecordTotal.value = response.total || 0;
|
|
|
console.log('获取审批记录列表成功,数据条数:', response.rows.length, '总数:', response.total);
|
|
|
console.log('审批记录数据详情:', response.rows);
|
|
|
-
|
|
|
+
|
|
|
// 详细检查前3条记录的字段
|
|
|
if (response.rows.length > 0) {
|
|
|
console.log('=== 审批记录字段详细检查 ===');
|
|
|
@@ -921,12 +930,12 @@ const getApprovalRecordList = async () => {
|
|
|
console.log('applicationUserName:', record.applicationUserName);
|
|
|
console.log('approvalTime:', record.approvalTime);
|
|
|
console.log('status:', record.status);
|
|
|
-
|
|
|
+
|
|
|
// 检查字段是否为空字符串或null
|
|
|
const targetFields = ['organizerUnit', 'location', 'trainingType', 'companions'];
|
|
|
- const emptyFields = targetFields.filter(field => !record[field]);
|
|
|
- const hasDataFields = targetFields.filter(field => record[field]);
|
|
|
-
|
|
|
+ const emptyFields = targetFields.filter((field) => !record[field]);
|
|
|
+ const hasDataFields = targetFields.filter((field) => record[field]);
|
|
|
+
|
|
|
console.log('空字段:', emptyFields);
|
|
|
console.log('有数据字段:', hasDataFields);
|
|
|
console.log('完整对象键:', Object.keys(record));
|
|
|
@@ -1195,12 +1204,19 @@ const teacherList = ref<any[]>([]);
|
|
|
/** 异步加载教师列表用于详情显示 */
|
|
|
async function loadTeacherListForDisplay() {
|
|
|
try {
|
|
|
- const response = await listClassTeacherCounselorRel({});
|
|
|
- const teachers = response.rows || [];
|
|
|
- teacherList.value = teachers.map((item: any) => ({
|
|
|
- teacherId: item.teacherId,
|
|
|
- teacherName: item.teacherName,
|
|
|
- teacherType: item.teacherType
|
|
|
+ // 使用系统用户API获取完整的教师/用户列表
|
|
|
+ // 查询所有正常状态的用户作为候选教师
|
|
|
+ const response = await listUser({
|
|
|
+ status: '0', // 0表示正常状态
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 9999 // 获取所有用户
|
|
|
+ });
|
|
|
+
|
|
|
+ const users = response.rows || [];
|
|
|
+ teacherList.value = users.map((item: any) => ({
|
|
|
+ teacherId: item.userId, // 使用userId作为teacherId
|
|
|
+ teacherName: item.nickName, // 使用nickName作为教师姓名
|
|
|
+ teacherType: 'teacher' // 统一标记为教师类型
|
|
|
}));
|
|
|
console.log('教师列表加载完成:', teacherList.value.length, '位教师');
|
|
|
} catch (error) {
|
|
|
@@ -1214,9 +1230,9 @@ function getCompanionNames(companions: (string | number)[] | string | null | und
|
|
|
if (!companions) {
|
|
|
return '';
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
let companionArray: (string | number)[] = [];
|
|
|
-
|
|
|
+
|
|
|
// 如果是字符串,尝试解析JSON
|
|
|
if (typeof companions === 'string') {
|
|
|
try {
|
|
|
@@ -1226,29 +1242,31 @@ function getCompanionNames(companions: (string | number)[] | string | null | und
|
|
|
}
|
|
|
} catch (e) {
|
|
|
// 如果JSON解析失败,可能是逗号分隔的字符串
|
|
|
- companionArray = companions.split(',').map(id => id.trim()).filter(id => id);
|
|
|
+ companionArray = companions
|
|
|
+ .split(',')
|
|
|
+ .map((id) => id.trim())
|
|
|
+ .filter((id) => id);
|
|
|
}
|
|
|
} else if (Array.isArray(companions)) {
|
|
|
companionArray = companions;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (companionArray.length === 0) {
|
|
|
return '';
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// 如果教师列表还未加载,显示"加载中..."
|
|
|
if (teacherList.value.length === 0) {
|
|
|
return '加载中...';
|
|
|
}
|
|
|
-
|
|
|
- return companionArray.map(teacherId => {
|
|
|
- // 确保teacherId转换为正确的类型进行比较
|
|
|
- const teacher = teacherList.value.find(t =>
|
|
|
- String(t.teacherId) === String(teacherId) ||
|
|
|
- Number(t.teacherId) === Number(teacherId)
|
|
|
- );
|
|
|
- return teacher ? teacher.teacherName : `未知教师(ID:${teacherId})`;
|
|
|
- }).join('、');
|
|
|
+
|
|
|
+ return companionArray
|
|
|
+ .map((teacherId) => {
|
|
|
+ // 确保teacherId转换为正确的类型进行比较
|
|
|
+ const teacher = teacherList.value.find((t) => String(t.teacherId) === String(teacherId) || Number(t.teacherId) === Number(teacherId));
|
|
|
+ return teacher ? teacher.teacherName : `未知教师(ID:${teacherId})`;
|
|
|
+ })
|
|
|
+ .join('、');
|
|
|
}
|
|
|
|
|
|
/** 查看审批历史 */
|
|
|
@@ -1279,14 +1297,14 @@ async function handleDownloadApplicationAttachment(file: any) {
|
|
|
|
|
|
try {
|
|
|
console.log('开始下载申请附件:', file);
|
|
|
-
|
|
|
+
|
|
|
// 通过OSS下载API获取文件二进制数据
|
|
|
- const response = await request({
|
|
|
+ const response = (await request({
|
|
|
url: `/resource/oss/download/${file.ossId}`,
|
|
|
method: 'get',
|
|
|
responseType: 'blob',
|
|
|
timeout: 300000 // 300秒超时
|
|
|
- }) as Blob;
|
|
|
+ })) as Blob;
|
|
|
|
|
|
// 验证响应数据
|
|
|
if (!response) {
|
|
|
@@ -1309,7 +1327,7 @@ async function handleDownloadApplicationAttachment(file: any) {
|
|
|
// 释放Blob URL
|
|
|
window.URL.revokeObjectURL(url);
|
|
|
loading.close();
|
|
|
-
|
|
|
+
|
|
|
console.log('下载申请附件成功:', file.name);
|
|
|
ElMessage.success('文件下载成功');
|
|
|
} catch (error) {
|
|
|
@@ -1334,14 +1352,14 @@ async function handleDownloadApprovalRecordAttachment(file: any) {
|
|
|
|
|
|
try {
|
|
|
console.log('开始下载审批记录附件:', file);
|
|
|
-
|
|
|
+
|
|
|
// 通过OSS下载API获取文件二进制数据
|
|
|
- const response = await request({
|
|
|
+ const response = (await request({
|
|
|
url: `/resource/oss/download/${file.ossId}`,
|
|
|
method: 'get',
|
|
|
responseType: 'blob',
|
|
|
timeout: 300000 // 300秒超时
|
|
|
- }) as Blob;
|
|
|
+ })) as Blob;
|
|
|
|
|
|
// 验证响应数据
|
|
|
if (!response) {
|
|
|
@@ -1364,7 +1382,7 @@ async function handleDownloadApprovalRecordAttachment(file: any) {
|
|
|
// 释放Blob URL
|
|
|
window.URL.revokeObjectURL(url);
|
|
|
loading.close();
|
|
|
-
|
|
|
+
|
|
|
console.log('下载审批记录附件成功:', file.name);
|
|
|
ElMessage.success('文件下载成功');
|
|
|
} catch (error) {
|