wuzhen update2
This commit is contained in:
commit
2272bb7eb1
155 files changed
+30832
-4551
No files matched your search
@@ -8,6 +8,9 @@ import {
|
||||
ScholarshipAttachmentVO
|
||||
} from './types';
|
||||
|
||||
// 导出贫困申请审核相关API
|
||||
export * from './povertyApplicationReview';
|
||||
|
||||
/**
|
||||
* 查询奖学金申请记录列表
|
||||
* @param query 查询参数
|
||||
|
||||
@@ -1,34 +1,34 @@
|
||||
import request from '@/utils/request'
|
||||
import { AxiosPromise } from 'axios'
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
|
||||
/**
|
||||
* 贫困生认定申请查询对象类型
|
||||
*/
|
||||
export interface JcbtPovertyApplicationQuery extends PageQuery {
|
||||
/** 申请编号 */
|
||||
applicationNo?: string
|
||||
applicationNo?: string;
|
||||
/** 学生姓名 */
|
||||
studentName?: string
|
||||
studentName?: string;
|
||||
/** 学号 */
|
||||
studentNo?: string
|
||||
studentNo?: string;
|
||||
/** 班级名称 */
|
||||
className?: string
|
||||
className?: string;
|
||||
/** 认定类型ID */
|
||||
recognitionTypeId?: number
|
||||
recognitionTypeId?: number;
|
||||
/** 认定类型名称 */
|
||||
recognitionTypeName?: string
|
||||
recognitionTypeName?: string;
|
||||
/** 学年 */
|
||||
academicYear?: string
|
||||
academicYear?: string;
|
||||
/** 申请状态 */
|
||||
status?: string
|
||||
status?: string;
|
||||
/** 家庭经济情况 */
|
||||
familyEconomyStatus?: string
|
||||
familyEconomyStatus?: string;
|
||||
/** 申请自助类型ID数组 */
|
||||
assistanceTypeIds?: string
|
||||
assistanceTypeIds?: string;
|
||||
/** 创建时间范围 */
|
||||
createTime?: [string, string]
|
||||
createTime?: [string, string];
|
||||
/** 申请时间范围 */
|
||||
applicationTime?: [string, string]
|
||||
applicationTime?: [string, string];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -36,73 +36,77 @@ export interface JcbtPovertyApplicationQuery extends PageQuery {
|
||||
*/
|
||||
export interface JcbtPovertyApplicationForm {
|
||||
/** 主键 */
|
||||
id?: string | number
|
||||
id?: string | number;
|
||||
/** 申请编号 */
|
||||
applicationNo?: string
|
||||
applicationNo?: string;
|
||||
/** 学年 */
|
||||
academicYear?: string
|
||||
academicYear?: string;
|
||||
/** 学期 */
|
||||
term?: number
|
||||
term?: number;
|
||||
/** 学生ID */
|
||||
studentId?: number
|
||||
studentId?: number;
|
||||
/** 学号 */
|
||||
studentNo?: string
|
||||
studentNo?: string;
|
||||
/** 学生姓名 */
|
||||
studentName?: string
|
||||
studentName?: string;
|
||||
/** 性别 */
|
||||
gender?: string
|
||||
gender?: string;
|
||||
/** 学院ID */
|
||||
collegeId?: number
|
||||
collegeId?: number;
|
||||
/** 学院名称 */
|
||||
collegeName?: string
|
||||
collegeName?: string;
|
||||
/** 专业ID */
|
||||
majorId?: number
|
||||
majorId?: number;
|
||||
/** 专业名称 */
|
||||
majorName?: string
|
||||
majorName?: string;
|
||||
/** 班级ID */
|
||||
classId?: number
|
||||
classId?: number;
|
||||
/** 班级名称 */
|
||||
className?: string
|
||||
className?: string;
|
||||
/** 班主任教师ID */
|
||||
teacherId?: number;
|
||||
/** 班主任教师姓名 */
|
||||
teacherName?: string;
|
||||
/** 认定群体 */
|
||||
recognitionGroup?: string
|
||||
recognitionGroup?: string;
|
||||
/** 认定类型ID */
|
||||
recognitionTypeId?: number
|
||||
recognitionTypeId?: number;
|
||||
/** 认定类型编码 */
|
||||
recognitionTypeCode?: string
|
||||
recognitionTypeCode?: string;
|
||||
/** 认定类型名称 */
|
||||
recognitionTypeName?: string
|
||||
recognitionTypeName?: string;
|
||||
/** 申请状态 */
|
||||
status?: string
|
||||
status?: string;
|
||||
/** 家庭经济情况 */
|
||||
familyEconomyStatus?: string
|
||||
familyEconomyStatus?: string;
|
||||
/** 家庭经济情况摘要 */
|
||||
familyEconomySummary?: string
|
||||
familyEconomySummary?: string;
|
||||
/** 申请理由 */
|
||||
applicationReason?: string
|
||||
applicationReason?: string;
|
||||
/** 申请时间 */
|
||||
applicationTime?: string
|
||||
applicationTime?: string;
|
||||
/** 审核时间 */
|
||||
auditTime?: string
|
||||
auditTime?: string;
|
||||
/** 审核人ID */
|
||||
auditUserId?: number
|
||||
auditUserId?: number;
|
||||
/** 审核人姓名 */
|
||||
auditUserName?: string
|
||||
auditUserName?: string;
|
||||
/** 审核意见 */
|
||||
auditOpinion?: string
|
||||
auditOpinion?: string;
|
||||
/** 申请自助类型ID数组 */
|
||||
assistanceTypeIds?: string
|
||||
assistanceTypeIds?: string;
|
||||
/** 申请自助类型名称 */
|
||||
assistanceTypeNames?: string
|
||||
assistanceTypeNames?: string;
|
||||
/** 备注 */
|
||||
remark?: string
|
||||
remark?: string;
|
||||
/** 申请表附件URL */
|
||||
attachApplicationFormUrl?: string
|
||||
attachApplicationFormUrl?: string;
|
||||
/** 申请表附件ID */
|
||||
attachApplicationFormId?: number
|
||||
attachApplicationFormId?: number;
|
||||
/** 调查表附件URL */
|
||||
attachSurveyFormUrl?: string
|
||||
attachSurveyFormUrl?: string;
|
||||
/** 调查表附件ID */
|
||||
attachSurveyFormId?: number
|
||||
attachSurveyFormId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -110,81 +114,85 @@ export interface JcbtPovertyApplicationForm {
|
||||
*/
|
||||
export interface JcbtPovertyApplicationVo {
|
||||
/** 主键 */
|
||||
id: string | number
|
||||
id: string | number;
|
||||
/** 申请编号 */
|
||||
applicationNo: string
|
||||
applicationNo: string;
|
||||
/** 学年 */
|
||||
academicYear: string
|
||||
academicYear: string;
|
||||
/** 学期 */
|
||||
term: number
|
||||
term: number;
|
||||
/** 学生ID */
|
||||
studentId: number
|
||||
studentId: number;
|
||||
/** 学号 */
|
||||
studentNo: string
|
||||
studentNo: string;
|
||||
/** 学生姓名 */
|
||||
studentName: string
|
||||
studentName: string;
|
||||
/** 性别 */
|
||||
gender: string
|
||||
gender: string;
|
||||
/** 学院ID */
|
||||
collegeId: number
|
||||
collegeId: number;
|
||||
/** 学院名称 */
|
||||
collegeName: string
|
||||
collegeName: string;
|
||||
/** 专业ID */
|
||||
majorId: number
|
||||
majorId: number;
|
||||
/** 专业名称 */
|
||||
majorName: string
|
||||
majorName: string;
|
||||
/** 班级ID */
|
||||
classId: number
|
||||
classId: number;
|
||||
/** 班级名称 */
|
||||
className: string
|
||||
className: string;
|
||||
/** 班主任教师ID */
|
||||
teacherId: number;
|
||||
/** 班主任教师姓名 */
|
||||
teacherName: string;
|
||||
/** 认定群体 */
|
||||
recognitionGroup: string
|
||||
recognitionGroup: string;
|
||||
/** 认定类型ID */
|
||||
recognitionTypeId: number
|
||||
recognitionTypeId: number;
|
||||
/** 认定类型编码 */
|
||||
recognitionTypeCode: string
|
||||
recognitionTypeCode: string;
|
||||
/** 认定类型名称 */
|
||||
recognitionTypeName: string
|
||||
recognitionTypeName: string;
|
||||
/** 申请状态 */
|
||||
status: string
|
||||
status: string;
|
||||
/** 家庭经济情况 */
|
||||
familyEconomyStatus: string
|
||||
familyEconomyStatus: string;
|
||||
/** 申请自助类型ID数组 */
|
||||
assistanceTypeIds: string
|
||||
assistanceTypeIds: string;
|
||||
/** 申请自助类型名称 */
|
||||
assistanceTypeNames: string
|
||||
assistanceTypeNames: string;
|
||||
/** 家庭经济情况摘要 */
|
||||
familyEconomySummary: string
|
||||
familyEconomySummary: string;
|
||||
/** 申请理由 */
|
||||
applicationReason: string
|
||||
applicationReason: string;
|
||||
/** 申请时间 */
|
||||
applicationTime: string
|
||||
applicationTime: string;
|
||||
/** 审核时间 */
|
||||
auditTime: string
|
||||
auditTime: string;
|
||||
/** 审核人ID */
|
||||
auditUserId: number
|
||||
auditUserId: number;
|
||||
/** 审核人姓名 */
|
||||
auditUserName: string
|
||||
auditUserName: string;
|
||||
/** 审核意见 */
|
||||
auditOpinion: string
|
||||
auditOpinion: string;
|
||||
/** 备注 */
|
||||
remark: string
|
||||
remark: string;
|
||||
/** 创建者 */
|
||||
createBy: number
|
||||
createBy: number;
|
||||
/** 创建时间 */
|
||||
createTime: string
|
||||
createTime: string;
|
||||
/** 更新者 */
|
||||
updateBy: number
|
||||
updateBy: number;
|
||||
/** 更新时间 */
|
||||
updateTime: string
|
||||
updateTime: string;
|
||||
/** 申请表附件URL */
|
||||
attachApplicationFormUrl: string
|
||||
attachApplicationFormUrl: string;
|
||||
/** 申请表附件ID */
|
||||
attachApplicationFormId: number
|
||||
attachApplicationFormId: number;
|
||||
/** 调查表附件URL */
|
||||
attachSurveyFormUrl: string
|
||||
attachSurveyFormUrl: string;
|
||||
/** 调查表附件ID */
|
||||
attachSurveyFormId: number
|
||||
attachSurveyFormId: number;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -192,9 +200,9 @@ export interface JcbtPovertyApplicationVo {
|
||||
*/
|
||||
export interface AuditRequestForm {
|
||||
/** 申请ID */
|
||||
id: string | number
|
||||
id: string | number;
|
||||
/** 审核意见 */
|
||||
auditOpinion: string
|
||||
auditOpinion: string;
|
||||
}
|
||||
|
||||
// ========== 基础管理接口(6个) ==========
|
||||
@@ -208,7 +216,7 @@ export function listPovertyApplication(query: JcbtPovertyApplicationQuery): Axio
|
||||
url: '/jcbt/povertyApplication/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -219,19 +227,19 @@ export function getPovertyApplication(id: string | number): AxiosPromise<JcbtPov
|
||||
return request({
|
||||
url: '/jcbt/povertyApplication/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增贫困生认定申请
|
||||
* @param data 申请表单数据
|
||||
*/
|
||||
export function addPovertyApplication(data: JcbtPovertyApplicationForm): AxiosPromise<void> {
|
||||
export function addPovertyApplication(data: JcbtPovertyApplicationForm): AxiosPromise<number> {
|
||||
return request({
|
||||
url: '/jcbt/povertyApplication',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -243,7 +251,7 @@ export function updatePovertyApplication(data: JcbtPovertyApplicationForm): Axio
|
||||
url: '/jcbt/povertyApplication',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -254,7 +262,7 @@ export function delPovertyApplication(ids: (string | number)[]): AxiosPromise<vo
|
||||
return request({
|
||||
url: '/jcbt/povertyApplication/' + ids.join(','),
|
||||
method: 'delete'
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -267,7 +275,20 @@ export function exportPovertyApplication(query: JcbtPovertyApplicationQuery): Ax
|
||||
method: 'post',
|
||||
data: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出我的申请列表(班主任导出自己提交的申请)
|
||||
* @param query 查询参数
|
||||
*/
|
||||
export function exportMyPovertyApplication(query: JcbtPovertyApplicationQuery): AxiosPromise<any> {
|
||||
return request({
|
||||
url: '/jcbt/povertyApplication/myExport',
|
||||
method: 'post',
|
||||
data: query,
|
||||
responseType: 'blob'
|
||||
});
|
||||
}
|
||||
|
||||
// ========== 业务功能接口(4个) ==========
|
||||
@@ -281,7 +302,7 @@ export function listMyPovertyApplication(query: JcbtPovertyApplicationQuery): Ax
|
||||
url: '/jcbt/povertyApplication/myList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -293,7 +314,7 @@ export function listPendingPovertyApplication(query: JcbtPovertyApplicationQuery
|
||||
url: '/jcbt/povertyApplication/pendingList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -304,7 +325,7 @@ export function submitPovertyApplication(id: string | number): AxiosPromise<void
|
||||
return request({
|
||||
url: '/jcbt/povertyApplication/submit/' + id,
|
||||
method: 'put'
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -315,7 +336,7 @@ export function cancelPovertyApplication(id: string | number): AxiosPromise<void
|
||||
return request({
|
||||
url: '/jcbt/povertyApplication/cancel/' + id,
|
||||
method: 'put'
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
// ========== 辅助功能接口(6个) ==========
|
||||
@@ -328,7 +349,7 @@ export function getPovertyApplicationByNo(applicationNo: string): AxiosPromise<J
|
||||
return request({
|
||||
url: '/jcbt/povertyApplication/byApplicationNo/' + applicationNo,
|
||||
method: 'get'
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -340,7 +361,7 @@ export function saveDraftPovertyApplication(data: JcbtPovertyApplicationForm): A
|
||||
url: '/jcbt/povertyApplication/saveDraft',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -352,7 +373,7 @@ export function approvePovertyApplication(data: AuditRequestForm): AxiosPromise<
|
||||
url: '/jcbt/povertyApplication/approve',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -364,7 +385,7 @@ export function rejectPovertyApplication(data: AuditRequestForm): AxiosPromise<v
|
||||
url: '/jcbt/povertyApplication/reject',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -374,7 +395,7 @@ export function generateApplicationNo(): AxiosPromise<string> {
|
||||
return request({
|
||||
url: '/jcbt/povertyApplication/generateApplicationNo',
|
||||
method: 'get'
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -382,16 +403,16 @@ export function generateApplicationNo(): AxiosPromise<string> {
|
||||
* @param params 检查参数
|
||||
*/
|
||||
export function checkDuplicate(params: {
|
||||
studentId: number
|
||||
academicYear: string
|
||||
recognitionTypeId: number
|
||||
excludeId?: number
|
||||
studentId: number;
|
||||
academicYear: string;
|
||||
recognitionTypeId: number;
|
||||
excludeId?: number;
|
||||
}): AxiosPromise<boolean> {
|
||||
return request({
|
||||
url: '/jcbt/povertyApplication/checkDuplicate',
|
||||
method: 'get',
|
||||
params: params
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
// ========== 统计分析接口(2个) ==========
|
||||
@@ -405,7 +426,7 @@ export function getPovertyApplicationStatistics(teacherId?: number): AxiosPromis
|
||||
url: '/jcbt/povertyApplication/statistics',
|
||||
method: 'get',
|
||||
params: teacherId ? { teacherId } : {}
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -415,7 +436,7 @@ export function getMyPovertyApplicationStatistics(): AxiosPromise<any> {
|
||||
return request({
|
||||
url: '/jcbt/povertyApplication/myStatistics',
|
||||
method: 'get'
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
// ========== 班级和学生相关接口(2个) ==========
|
||||
@@ -427,7 +448,7 @@ export function getCurrentUserClasses(): AxiosPromise<any[]> {
|
||||
return request({
|
||||
url: '/jcbt/povertyApplication/user/classes',
|
||||
method: 'get'
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -438,5 +459,5 @@ export function getClassStudents(classId: number | string): AxiosPromise<any[]>
|
||||
return request({
|
||||
url: `/jcbt/povertyApplication/class/${classId}/students`,
|
||||
method: 'get'
|
||||
})
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,235 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
|
||||
// 审核查询参数
|
||||
export interface PovertyApplicationReviewQuery {
|
||||
pageNum?: number;
|
||||
pageSize?: number;
|
||||
applicationNo?: string;
|
||||
studentName?: string;
|
||||
studentNo?: string;
|
||||
className?: string;
|
||||
recognitionGroup?: string;
|
||||
academicYear?: string;
|
||||
status?: string;
|
||||
auditOpinion?: string;
|
||||
auditorName?: string;
|
||||
createTime?: string;
|
||||
auditTime?: string;
|
||||
params?: any;
|
||||
}
|
||||
|
||||
// 审核VO
|
||||
export interface PovertyApplicationReviewVo {
|
||||
id: number;
|
||||
applicationNo: string;
|
||||
academicYear: string;
|
||||
term: number;
|
||||
studentId: number;
|
||||
studentNo: string;
|
||||
studentName: string;
|
||||
gender: string;
|
||||
collegeId: number;
|
||||
collegeName: string;
|
||||
majorId: number;
|
||||
majorName: string;
|
||||
classId: number;
|
||||
className: string;
|
||||
teacherId: number;
|
||||
teacherName: string;
|
||||
recognitionGroup: string;
|
||||
recognitionTypeId: number;
|
||||
recognitionTypeCode: string;
|
||||
recognitionTypeName: string;
|
||||
assistanceTypeIds: string;
|
||||
assistanceTypeNames: string;
|
||||
familyEconomyStatus: string;
|
||||
familyEconomySummary: string;
|
||||
applicationReason: string;
|
||||
attachApplicationFormUrl: string;
|
||||
attachApplicationFormId: number;
|
||||
attachSurveyFormUrl: string;
|
||||
attachSurveyFormId: number;
|
||||
status: string;
|
||||
submitTime: string;
|
||||
auditorId: number;
|
||||
auditorName: string;
|
||||
auditTime: string;
|
||||
auditOpinion: string;
|
||||
remark: string;
|
||||
createBy: number;
|
||||
createTime: string;
|
||||
updateBy: number;
|
||||
updateTime: string;
|
||||
}
|
||||
|
||||
// 审核表单
|
||||
export interface PovertyApplicationReviewForm {
|
||||
id: number;
|
||||
auditOpinion: string;
|
||||
}
|
||||
|
||||
// 批量审核表单
|
||||
export interface BatchReviewForm {
|
||||
ids: number[];
|
||||
auditOpinion: string;
|
||||
}
|
||||
|
||||
// 审核统计响应
|
||||
export interface ReviewStatistics {
|
||||
totalCount: number;
|
||||
statusCount: {
|
||||
SUBMITTED?: number;
|
||||
APPROVED?: number;
|
||||
REJECTED?: number;
|
||||
[key: string]: number | undefined;
|
||||
};
|
||||
}
|
||||
|
||||
// 审核人员工作量统计
|
||||
export interface AuditorWorkloadStatistics {
|
||||
auditorName: string;
|
||||
totalCount: number;
|
||||
approvedCount: number;
|
||||
rejectedCount: number;
|
||||
}
|
||||
|
||||
// 审核历史记录
|
||||
export interface AuditHistoryRecord {
|
||||
action: string;
|
||||
operator: string;
|
||||
operateTime: string;
|
||||
status: string;
|
||||
remark: string;
|
||||
}
|
||||
|
||||
// 附件预览信息
|
||||
export interface AttachmentPreview {
|
||||
applicationFormUrl?: string;
|
||||
surveyFormUrl?: string;
|
||||
hasApplicationForm: boolean;
|
||||
hasSurveyForm: boolean;
|
||||
}
|
||||
|
||||
// 查询待审核申请列表
|
||||
export function listPendingReview(query: PovertyApplicationReviewQuery): AxiosPromise<PovertyApplicationReviewVo[]> {
|
||||
return request({
|
||||
url: '/jcbt/povertyApplicationReview/pendingList',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
}
|
||||
|
||||
// 查询所有申请列表(支持多状态筛选)
|
||||
export function listAllReview(query: PovertyApplicationReviewQuery): AxiosPromise<PovertyApplicationReviewVo[]> {
|
||||
return request({
|
||||
url: '/jcbt/povertyApplicationReview/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
}
|
||||
|
||||
// 查询申请详情
|
||||
export function getReviewDetail(id: string | number): AxiosPromise<PovertyApplicationReviewVo> {
|
||||
return request({
|
||||
url: '/jcbt/povertyApplicationReview/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
// 审核通过
|
||||
export function approveApplication(data: PovertyApplicationReviewForm): AxiosPromise<void> {
|
||||
return request({
|
||||
url: '/jcbt/povertyApplicationReview/approve',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
// 审核驳回
|
||||
export function rejectApplication(data: PovertyApplicationReviewForm): AxiosPromise<void> {
|
||||
return request({
|
||||
url: '/jcbt/povertyApplicationReview/reject',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
// 打回修改
|
||||
export function returnToDraft(data: PovertyApplicationReviewForm): AxiosPromise<void> {
|
||||
return request({
|
||||
url: '/jcbt/povertyApplicationReview/returnToDraft',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
// 批量审核通过
|
||||
export function batchApproveApplications(data: BatchReviewForm): AxiosPromise<void> {
|
||||
return request({
|
||||
url: '/jcbt/povertyApplicationReview/batchApprove',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
// 批量审核驳回
|
||||
export function batchRejectApplications(data: BatchReviewForm): AxiosPromise<void> {
|
||||
return request({
|
||||
url: '/jcbt/povertyApplicationReview/batchReject',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
// 获取审核统计信息
|
||||
export function getReviewStatistics(academicYear?: string, collegeId?: number): AxiosPromise<ReviewStatistics> {
|
||||
return request({
|
||||
url: '/jcbt/povertyApplicationReview/statistics',
|
||||
method: 'get',
|
||||
params: { academicYear, collegeId }
|
||||
});
|
||||
}
|
||||
|
||||
// 获取审核人员工作量统计
|
||||
export function getAuditorWorkloadStatistics(startTime?: string, endTime?: string): AxiosPromise<AuditorWorkloadStatistics[]> {
|
||||
return request({
|
||||
url: '/jcbt/povertyApplicationReview/workloadStatistics',
|
||||
method: 'get',
|
||||
params: { startTime, endTime }
|
||||
});
|
||||
}
|
||||
|
||||
// 获取申请附件预览信息
|
||||
export function getAttachmentPreview(id: string | number): AxiosPromise<AttachmentPreview> {
|
||||
return request({
|
||||
url: '/jcbt/povertyApplicationReview/' + id + '/attachments',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
// 获取申请审核历史记录
|
||||
export function getAuditHistory(id: string | number): AxiosPromise<AuditHistoryRecord[]> {
|
||||
return request({
|
||||
url: '/jcbt/povertyApplicationReview/' + id + '/history',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
// 导出申请数据
|
||||
export function exportReviewData(query: PovertyApplicationReviewQuery): AxiosPromise<void> {
|
||||
return request({
|
||||
url: '/jcbt/povertyApplicationReview/export',
|
||||
method: 'post',
|
||||
data: query
|
||||
});
|
||||
}
|
||||
|
||||
// 导出待审核申请数据
|
||||
export function exportPendingReviewData(query: PovertyApplicationReviewQuery): AxiosPromise<void> {
|
||||
return request({
|
||||
url: '/jcbt/povertyApplicationReview/exportPending',
|
||||
method: 'post',
|
||||
data: query
|
||||
});
|
||||
}
|
||||
@@ -17,7 +17,7 @@ export {
|
||||
getAvailableReviewers,
|
||||
// 为了与页面中的函数名保持一致,添加别名
|
||||
performReviewAction as approveScholarshipReview
|
||||
} from '../scholarshipReview'
|
||||
} from '../scholarshipReview';
|
||||
|
||||
// 重新导出类型定义
|
||||
export type {
|
||||
@@ -27,4 +27,4 @@ export type {
|
||||
ReviewActionForm,
|
||||
ReviewHistoryQuery,
|
||||
ReviewStatistics
|
||||
} from '../scholarshipReview'
|
||||
} from '../scholarshipReview';
|
||||
@@ -6,7 +6,6 @@ export interface ScholarshipApplicationVO {
|
||||
id?: string | number;
|
||||
/** 批次ID */
|
||||
batchId?: string | number;
|
||||
<<<<<<< HEAD
|
||||
/** 批次名称 */
|
||||
batchName?: string;
|
||||
/** 奖学金类型ID */
|
||||
@@ -17,12 +16,6 @@ export interface ScholarshipApplicationVO {
|
||||
applicationNo?: string;
|
||||
/** 学生学号 */
|
||||
studentNo?: string;
|
||||
=======
|
||||
/** 奖学金类型ID */
|
||||
scholarshipTypeId?: string | number;
|
||||
/** 学生学号 */
|
||||
studentCode?: string;
|
||||
>>>>>>> 4b9dbe40fb94a83d379f7d16211dec6d78c23755
|
||||
/** 学生姓名 */
|
||||
studentName?: string;
|
||||
/** 学生ID */
|
||||
@@ -31,11 +24,10 @@ export interface ScholarshipApplicationVO {
|
||||
deptId?: string | number;
|
||||
/** 学院名称 */
|
||||
deptName?: string;
|
||||
<<<<<<< HEAD
|
||||
/** 专业ID */
|
||||
majorId?: string | number;
|
||||
=======
|
||||
>>>>>>> 4b9dbe40fb94a83d379f7d16211dec6d78c23755
|
||||
/** 专业名称 */
|
||||
majorName?: string;
|
||||
/** 班级ID */
|
||||
classId?: string | number;
|
||||
/** 班级名称 */
|
||||
@@ -52,7 +44,6 @@ export interface ScholarshipApplicationVO {
|
||||
applicationReason?: string;
|
||||
/** 申请说明 */
|
||||
applicationDescription?: string;
|
||||
<<<<<<< HEAD
|
||||
/** 系统计算分数 */
|
||||
calculatedScore?: number;
|
||||
/** 最终评定分数 */
|
||||
@@ -73,12 +64,6 @@ export interface ScholarshipApplicationVO {
|
||||
updateBy?: string | number;
|
||||
/** 更新时间 */
|
||||
updateTime?: string;
|
||||
=======
|
||||
/** 状态 */
|
||||
status?: string;
|
||||
/** 创建时间 */
|
||||
createTime?: string;
|
||||
>>>>>>> 4b9dbe40fb94a83d379f7d16211dec6d78c23755
|
||||
}
|
||||
|
||||
export interface ScholarshipApplicationForm {
|
||||
@@ -110,11 +95,7 @@ export interface ScholarshipApplicationQuery extends PageQuery {
|
||||
/** 奖学金类型ID */
|
||||
scholarshipTypeId?: string | number;
|
||||
/** 学生学号 */
|
||||
<<<<<<< HEAD
|
||||
studentNo?: string;
|
||||
=======
|
||||
studentCode?: string;
|
||||
>>>>>>> 4b9dbe40fb94a83d379f7d16211dec6d78c23755
|
||||
/** 学生姓名 */
|
||||
studentName?: string;
|
||||
/** 申请人ID */
|
||||
@@ -223,16 +204,12 @@ export function confirmClassSelection(teacherId: string | number, classId: strin
|
||||
}
|
||||
|
||||
// 班主任批量申请提交
|
||||
<<<<<<< HEAD
|
||||
export function batchSubmitByTeacher(
|
||||
batchId: string | number,
|
||||
scholarshipTypeId: string | number,
|
||||
classId: string | number,
|
||||
studentApplications: any[]
|
||||
) {
|
||||
=======
|
||||
export function batchSubmitByTeacher(batchId: string | number, scholarshipTypeId: string | number, classId: string | number, studentApplications: any[]) {
|
||||
>>>>>>> 4b9dbe40fb94a83d379f7d16211dec6d78c23755
|
||||
return request({
|
||||
url: '/jcbt/scholarshipApplication/batch',
|
||||
method: 'post',
|
||||
|
||||
@@ -220,4 +220,3 @@ export function getAvailableReviewers(auditLevel: string): AxiosPromise<any[]> {
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
// 查询勤工俭学申请信息列表
|
||||
export function listWorkStudyApplication(query) {
|
||||
return request({
|
||||
url: '/jcbt/workStudyApplication/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
}
|
||||
|
||||
// 查询勤工俭学申请信息详细
|
||||
export function getWorkStudyApplication(id) {
|
||||
return request({
|
||||
url: '/jcbt/workStudyApplication/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
// 新增勤工俭学申请信息
|
||||
export function addWorkStudyApplication(data) {
|
||||
return request({
|
||||
url: '/jcbt/workStudyApplication',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
// 修改勤工俭学申请信息
|
||||
export function updateWorkStudyApplication(data) {
|
||||
return request({
|
||||
url: '/jcbt/workStudyApplication',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
// 删除勤工俭学申请信息
|
||||
export function delWorkStudyApplication(id) {
|
||||
return request({
|
||||
url: '/jcbt/workStudyApplication/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
|
||||
// 检查学生是否已申请该岗位
|
||||
export function checkDuplicateApplication(studentId, positionId) {
|
||||
return request({
|
||||
url: '/jcbt/workStudyApplication/hasApplied',
|
||||
method: 'get',
|
||||
params: {
|
||||
studentId: studentId,
|
||||
positionId: positionId
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 提交申请
|
||||
export function submitApplication(id) {
|
||||
return request({
|
||||
url: '/jcbt/workStudyApplication/submit/' + id,
|
||||
method: 'post'
|
||||
});
|
||||
}
|
||||
|
||||
// 撤销申请
|
||||
export function cancelApplication(id) {
|
||||
return request({
|
||||
url: '/jcbt/workStudyApplication/cancel/' + id,
|
||||
method: 'post'
|
||||
});
|
||||
}
|
||||
|
||||
// 学院审核
|
||||
export function collegeReview(data) {
|
||||
return request({
|
||||
url: '/jcbt/workStudyApplication/collegeReview',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
// 学生处审核
|
||||
export function finalReview(data) {
|
||||
return request({
|
||||
url: '/jcbt/workStudyApplication/finalReview',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
// 获取当前用户学生信息
|
||||
export function getCurrentStudentInfo() {
|
||||
return request({
|
||||
url: '/jcbt/workStudyApplication/currentStudentInfo',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
// 导出勤工俭学申请信息
|
||||
export function exportWorkStudyApplication(query) {
|
||||
return request({
|
||||
url: '/jcbt/workStudyApplication/export',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
});
|
||||
}
|
||||
|
||||
// 获取岗位申请统计信息
|
||||
export function getApplicationStatistics(positionId) {
|
||||
return request({
|
||||
url: '/jcbt/workStudyApplication/statistics/' + positionId,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,453 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
|
||||
/**
|
||||
* 勤工俭学申请查询对象类型
|
||||
*/
|
||||
export interface WorkStudyApplicationQuery extends PageQuery {
|
||||
/** 学生姓名 */
|
||||
studentName?: string;
|
||||
/** 学号 */
|
||||
studentNumber?: string;
|
||||
/** 身份证号 */
|
||||
idCard?: string;
|
||||
/** 联系电话 */
|
||||
contactPhone?: string;
|
||||
/** 学院名称 */
|
||||
collegeName?: string;
|
||||
/** 专业名称 */
|
||||
majorName?: string;
|
||||
/** 班级名称 */
|
||||
className?: string;
|
||||
/** 年级 */
|
||||
grade?: string;
|
||||
/** 岗位ID */
|
||||
positionId?: number;
|
||||
/** 岗位名称 */
|
||||
positionName?: string;
|
||||
/** 岗位类型 */
|
||||
positionType?: string;
|
||||
/** 工作地点 */
|
||||
workLocation?: string;
|
||||
/** 申请状态 */
|
||||
applicationStatus?: string;
|
||||
/** 学院审核状态 */
|
||||
collegeReviewStatus?: string;
|
||||
/** 学生处审核状态 */
|
||||
finalReviewStatus?: string;
|
||||
/** 家庭经济情况 */
|
||||
familyFinancialStatus?: string;
|
||||
/** 申请时间范围 */
|
||||
params?: {
|
||||
beginCreateTime?: string;
|
||||
endCreateTime?: string;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 勤工俭学申请对象类型
|
||||
*/
|
||||
export interface WorkStudyApplicationForm {
|
||||
/** 主键ID */
|
||||
id?: number;
|
||||
/** 学生ID */
|
||||
studentId?: number;
|
||||
/** 学生姓名 */
|
||||
studentName: string;
|
||||
/** 学生所在学院ID */
|
||||
collegeId?: number;
|
||||
/** 学号 */
|
||||
studentNumber: string;
|
||||
/** 身份证号 */
|
||||
idCard: string;
|
||||
/** 联系电话 */
|
||||
contactPhone: string;
|
||||
/** 学院名称 */
|
||||
collegeName: string;
|
||||
/** 专业名称 */
|
||||
majorName: string;
|
||||
/** 班级名称 */
|
||||
className: string;
|
||||
/** 年级 */
|
||||
grade?: string;
|
||||
/** 岗位ID */
|
||||
positionId?: number;
|
||||
/** 岗位名称 */
|
||||
positionName: string;
|
||||
/** 岗位类型 */
|
||||
positionType: string;
|
||||
/** 工作地点 */
|
||||
workLocation: string;
|
||||
/** 计划工作时长 */
|
||||
plannedWorkHours?: number;
|
||||
/** 家庭经济情况 */
|
||||
familyFinancialStatus: string;
|
||||
/** 申请理由 */
|
||||
applicationReason: string;
|
||||
/** 个人能力及经验 */
|
||||
personalAbility: string;
|
||||
/** 时间安排 */
|
||||
timeArrangement: string;
|
||||
/** 备注 */
|
||||
remark?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 勤工俭学申请展示对象类型
|
||||
*/
|
||||
export interface WorkStudyApplicationVO {
|
||||
/** 主键ID */
|
||||
id: number;
|
||||
/** 学生姓名 */
|
||||
studentName: string;
|
||||
/** 学号 */
|
||||
studentNumber: string;
|
||||
/** 身份证号 */
|
||||
idCard: string;
|
||||
/** 联系电话 */
|
||||
contactPhone: string;
|
||||
/** 学院名称 */
|
||||
collegeName: string;
|
||||
/** 专业名称 */
|
||||
majorName: string;
|
||||
/** 班级名称 */
|
||||
className: string;
|
||||
/** 年级 */
|
||||
grade: string;
|
||||
/** 岗位ID */
|
||||
positionId?: number;
|
||||
/** 岗位名称 */
|
||||
positionName: string;
|
||||
/** 岗位类型 */
|
||||
positionType: string;
|
||||
/** 工作地点 */
|
||||
workLocation: string;
|
||||
/** 计划工作时长 */
|
||||
plannedWorkHours: number;
|
||||
/** 家庭经济情况 */
|
||||
familyFinancialStatus: string;
|
||||
/** 申请理由 */
|
||||
applicationReason: string;
|
||||
/** 个人能力及经验 */
|
||||
personalAbility: string;
|
||||
/** 时间安排 */
|
||||
timeArrangement: string;
|
||||
/** 备注 */
|
||||
remark?: string;
|
||||
/** 申请状态 */
|
||||
applicationStatus: string;
|
||||
/** 学院审核状态 */
|
||||
collegeReviewStatus?: string;
|
||||
/** 学院审核时间 */
|
||||
collegeReviewTime?: string;
|
||||
/** 学院审核人姓名 */
|
||||
collegeReviewerName?: string;
|
||||
/** 学院审核意见 */
|
||||
collegeReviewComment?: string;
|
||||
/** 学生处审核状态 */
|
||||
finalReviewStatus?: string;
|
||||
/** 学生处审核时间 */
|
||||
finalReviewTime?: string;
|
||||
/** 学生处审核人姓名 */
|
||||
finalReviewerName?: string;
|
||||
/** 学生处审核意见 */
|
||||
finalReviewComment?: string;
|
||||
/** 创建时间 */
|
||||
createTime: string;
|
||||
/** 更新时间 */
|
||||
updateTime: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核请求对象类型
|
||||
*/
|
||||
export interface ReviewRequestForm {
|
||||
/** 申请ID */
|
||||
applicationId: number;
|
||||
/** 审核结果 */
|
||||
reviewStatus: string;
|
||||
/** 审核意见 */
|
||||
reviewComment: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 申请选项对象类型
|
||||
*/
|
||||
export interface ApplicationOptions {
|
||||
/** 年级选项 */
|
||||
gradeOptions: Array<{ label: string; value: string }>;
|
||||
/** 岗位类型选项 */
|
||||
positionTypeOptions: Array<{ label: string; value: string }>;
|
||||
/** 家庭经济情况选项 */
|
||||
familyFinancialStatusOptions: Array<{ label: string; value: string }>;
|
||||
/** 申请状态选项 */
|
||||
applicationStatusOptions: Array<{ label: string; value: string }>;
|
||||
/** 审核状态选项 */
|
||||
reviewStatusOptions: Array<{ label: string; value: string }>;
|
||||
}
|
||||
|
||||
// ========== 基础管理接口(6个) ==========
|
||||
|
||||
/**
|
||||
* 查询学生可申请的岗位列表(替代原申请列表)
|
||||
* @param query 查询参数
|
||||
*/
|
||||
export function listWorkStudyApplication(query: any): AxiosPromise<any[]> {
|
||||
return request({
|
||||
url: '/jcbt/workStudyApplication/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询勤工俭学申请详细
|
||||
* @param id 申请ID
|
||||
*/
|
||||
export function getWorkStudyApplication(id: string | number): AxiosPromise<WorkStudyApplicationVO> {
|
||||
return request({
|
||||
url: '/jcbt/workStudyApplication/detail/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增勤工俭学申请
|
||||
* @param data 申请数据
|
||||
*/
|
||||
export function addWorkStudyApplication(data: WorkStudyApplicationForm): AxiosPromise<void> {
|
||||
return request({
|
||||
url: '/jcbt/workStudyApplication',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改勤工俭学申请
|
||||
* @param data 申请数据
|
||||
*/
|
||||
export function updateWorkStudyApplication(data: WorkStudyApplicationForm): AxiosPromise<void> {
|
||||
return request({
|
||||
url: '/jcbt/workStudyApplication',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除勤工俭学申请
|
||||
* @param ids 申请ID数组
|
||||
*/
|
||||
export function delWorkStudyApplication(ids: string | number | Array<string | number>): AxiosPromise<void> {
|
||||
return request({
|
||||
url: '/jcbt/workStudyApplication/' + ids,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出勤工俭学申请数据
|
||||
* @param query 查询参数
|
||||
*/
|
||||
export function exportWorkStudyApplication(query: WorkStudyApplicationQuery): AxiosPromise<any> {
|
||||
return request({
|
||||
url: '/jcbt/workStudyApplication/export',
|
||||
method: 'post',
|
||||
data: query,
|
||||
responseType: 'blob'
|
||||
});
|
||||
}
|
||||
|
||||
// ========== 业务功能接口(4个) ==========
|
||||
|
||||
/**
|
||||
* 查询我的申请列表
|
||||
* @param query 查询参数
|
||||
*/
|
||||
export function listMyWorkStudyApplication(query: WorkStudyApplicationQuery): AxiosPromise<WorkStudyApplicationVO[]> {
|
||||
return request({
|
||||
url: '/jcbt/workStudyApplication/myList',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询待学院审核列表
|
||||
* @param query 查询参数
|
||||
*/
|
||||
export function listPendingCollegeReview(query: WorkStudyApplicationQuery): AxiosPromise<WorkStudyApplicationVO[]> {
|
||||
return request({
|
||||
url: '/jcbt/workStudyApplication/pendingCollegeReview',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询待学生处审核列表
|
||||
* @param query 查询参数
|
||||
*/
|
||||
export function listPendingFinalReview(query: WorkStudyApplicationQuery): AxiosPromise<WorkStudyApplicationVO[]> {
|
||||
return request({
|
||||
url: '/jcbt/workStudyApplication/pendingFinalReview',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取岗位申请统计信息
|
||||
* @param positionId 岗位ID
|
||||
*/
|
||||
export function getApplicationStatistics(positionId: string | number): AxiosPromise<{ [key: string]: any }> {
|
||||
return request({
|
||||
url: '/jcbt/workStudyApplication/statistics/' + positionId,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
// ========== 申请流程接口(6个) ==========
|
||||
|
||||
/**
|
||||
* 提交申请
|
||||
* @param id 申请ID
|
||||
*/
|
||||
export function submitApplication(id: string | number): AxiosPromise<void> {
|
||||
return request({
|
||||
url: '/jcbt/workStudyApplication/submit/' + id,
|
||||
method: 'post'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 撤销申请
|
||||
* @param id 申请ID
|
||||
*/
|
||||
export function cancelApplication(id: string | number): AxiosPromise<void> {
|
||||
return request({
|
||||
url: '/jcbt/workStudyApplication/cancel/' + id,
|
||||
method: 'post'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 学院审核
|
||||
* @param data 审核数据
|
||||
*/
|
||||
export function collegeReview(data: ReviewRequestForm): AxiosPromise<void> {
|
||||
return request({
|
||||
url: '/jcbt/workStudyApplication/collegeReview',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 学生处审核
|
||||
* @param data 审核数据
|
||||
*/
|
||||
export function finalReview(data: ReviewRequestForm): AxiosPromise<void> {
|
||||
return request({
|
||||
url: '/jcbt/workStudyApplication/finalReview',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量学院审核
|
||||
* @param ids 申请ID数组
|
||||
* @param reviewResult 审核结果
|
||||
* @param reviewComment 审核意见
|
||||
*/
|
||||
export function batchCollegeReview(ids: Array<string | number>, reviewResult: string, reviewComment?: string): AxiosPromise<void> {
|
||||
return request({
|
||||
url: '/jcbt/workStudyApplication/batchCollegeReview',
|
||||
method: 'post',
|
||||
params: {
|
||||
ids: ids,
|
||||
reviewResult: reviewResult,
|
||||
reviewComment: reviewComment
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量学生处审核
|
||||
* @param ids 申请ID数组
|
||||
* @param reviewResult 审核结果
|
||||
* @param reviewComment 审核意见
|
||||
*/
|
||||
export function batchFinalReview(ids: Array<string | number>, reviewResult: string, reviewComment?: string): AxiosPromise<void> {
|
||||
return request({
|
||||
url: '/jcbt/workStudyApplication/batchFinalReview',
|
||||
method: 'post',
|
||||
params: {
|
||||
ids: ids,
|
||||
reviewResult: reviewResult,
|
||||
reviewComment: reviewComment
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// ========== 辅助功能接口(4个) ==========
|
||||
|
||||
/**
|
||||
* 获取申请选项数据
|
||||
*/
|
||||
export function getApplicationOptions(): AxiosPromise<ApplicationOptions> {
|
||||
return request({
|
||||
url: '/jcbt/workStudyApplication/options',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查重复申请
|
||||
* @param studentNumber 学号
|
||||
* @param positionId 岗位ID
|
||||
*/
|
||||
export function checkDuplicateApplication(studentNumber: string, positionId: number): AxiosPromise<{ isDuplicate: boolean }> {
|
||||
return request({
|
||||
url: '/jcbt/workStudyApplication/checkDuplicate',
|
||||
method: 'get',
|
||||
params: {
|
||||
studentNumber: studentNumber,
|
||||
positionId: positionId
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取申请详情(用于审核展示)
|
||||
* @param id 申请ID
|
||||
*/
|
||||
export function getApplicationForReview(id: string | number): AxiosPromise<WorkStudyApplicationVO> {
|
||||
return request({
|
||||
url: '/jcbt/workStudyApplication/review/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入申请数据模板下载
|
||||
*/
|
||||
export function downloadTemplate(): AxiosPromise<any> {
|
||||
return request({
|
||||
url: '/jcbt/workStudyApplication/importTemplate',
|
||||
method: 'get',
|
||||
responseType: 'blob'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前用户学生信息
|
||||
*/
|
||||
export function getCurrentStudentInfo(): AxiosPromise<any> {
|
||||
return request({
|
||||
url: '/jcbt/workStudyApplication/currentStudentInfo',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,183 @@
|
||||
import request from '@/utils/request';
|
||||
import { TableDataInfo, R } from '@/api/types';
|
||||
|
||||
// 勤工俭学申请VO类型
|
||||
export interface WorkStudyApplicationVO {
|
||||
id?: string | number;
|
||||
positionId?: string | number;
|
||||
positionName?: string;
|
||||
studentId?: string | number;
|
||||
studentName?: string;
|
||||
studentNo?: string;
|
||||
collegeId?: string | number;
|
||||
collegeName?: string;
|
||||
majorName?: string;
|
||||
grade?: string;
|
||||
className?: string;
|
||||
contactPhone?: string;
|
||||
email?: string;
|
||||
workExperience?: string;
|
||||
applicationReason?: string;
|
||||
status?: string;
|
||||
statusName?: string;
|
||||
applicationDate?: string;
|
||||
collegeReviewBy?: string | number;
|
||||
collegeReviewByName?: string;
|
||||
collegeReviewTime?: string;
|
||||
collegeReviewComment?: string;
|
||||
finalReviewBy?: string | number;
|
||||
finalReviewByName?: string;
|
||||
finalReviewTime?: string;
|
||||
finalReviewComment?: string;
|
||||
createBy?: string | number;
|
||||
createTime?: string;
|
||||
updateBy?: string | number;
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
// 查询参数
|
||||
export interface WorkStudyApplicationQuery {
|
||||
pageNum?: number;
|
||||
pageSize?: number;
|
||||
positionName?: string;
|
||||
studentName?: string;
|
||||
studentNo?: string;
|
||||
collegeName?: string;
|
||||
status?: string;
|
||||
applicationDate?: string;
|
||||
params?: any;
|
||||
}
|
||||
|
||||
// 审核表单
|
||||
export interface ReviewForm {
|
||||
applicationId: string | number;
|
||||
reviewResult: string;
|
||||
reviewComment?: string;
|
||||
}
|
||||
|
||||
// 统计数据
|
||||
export interface StatisticsVO {
|
||||
pendingCount?: number;
|
||||
approvedCount?: number;
|
||||
rejectedCount?: number;
|
||||
finalApprovedCount?: number;
|
||||
totalCount?: number;
|
||||
}
|
||||
|
||||
// 选项数据
|
||||
export interface OptionsVO {
|
||||
statusOptions?: Array<{ label: string; value: string }>;
|
||||
reviewStatusOptions?: Array<{ label: string; value: string }>;
|
||||
}
|
||||
|
||||
// 查询本学院待审核申请列表
|
||||
export function listPendingApplications(query: WorkStudyApplicationQuery) {
|
||||
return request<TableDataInfo<WorkStudyApplicationVO>>({
|
||||
url: '/jcbt/workStudyApplicationCollegeReview/pendingList',
|
||||
method: 'get',
|
||||
params: query,
|
||||
headers: {
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 查询本学院所有申请列表
|
||||
export function listCollegeApplications(query: WorkStudyApplicationQuery) {
|
||||
return request<TableDataInfo<WorkStudyApplicationVO>>({
|
||||
url: '/jcbt/workStudyApplicationCollegeReview/list',
|
||||
method: 'get',
|
||||
params: query,
|
||||
headers: {
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 获取本学院申请详情
|
||||
export function getCollegeApplication(id: string | number) {
|
||||
return request<R<WorkStudyApplicationVO>>({
|
||||
url: '/jcbt/workStudyApplicationCollegeReview/' + id,
|
||||
method: 'get',
|
||||
headers: {
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 学院审核
|
||||
export function reviewApplication(data: ReviewForm) {
|
||||
return request<R<any>>({
|
||||
url: '/jcbt/workStudyApplicationCollegeReview/review',
|
||||
method: 'post',
|
||||
data: data,
|
||||
headers: {
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 批量学院审核
|
||||
export function batchReviewApplications(ids: Array<string | number>, reviewResult: string, reviewComment?: string) {
|
||||
return request<R<any>>({
|
||||
url: '/jcbt/workStudyApplicationCollegeReview/batchReview',
|
||||
method: 'post',
|
||||
params: {
|
||||
reviewResult,
|
||||
reviewComment
|
||||
},
|
||||
data: ids,
|
||||
headers: {
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 获取本学院申请统计信息
|
||||
export function getCollegeStatistics() {
|
||||
return request<R<StatisticsVO>>({
|
||||
url: '/jcbt/workStudyApplicationCollegeReview/statistics',
|
||||
method: 'get',
|
||||
headers: {
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 获取本学院申请统计信息(调试版本)
|
||||
export function getCollegeStatisticsDebug() {
|
||||
return request<R<any>>({
|
||||
url: '/jcbt/workStudyApplicationCollegeReview/debug/statistics',
|
||||
method: 'get',
|
||||
headers: {
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 通过列表API获取统计信息(作为备用方案)
|
||||
export function getCollegeStatisticsByList() {
|
||||
return request<TableDataInfo<WorkStudyApplicationVO>>({
|
||||
url: '/jcbt/workStudyApplicationCollegeReview/list',
|
||||
method: 'get',
|
||||
params: {
|
||||
pageNum: 1,
|
||||
pageSize: 1,
|
||||
status: 'SUBMITTED'
|
||||
},
|
||||
headers: {
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 获取可用选项
|
||||
export function getApplicationOptions() {
|
||||
return request<R<OptionsVO>>({
|
||||
url: '/jcbt/workStudyApplicationCollegeReview/options',
|
||||
method: 'get',
|
||||
headers: {
|
||||
isEncrypt: 'true'
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,306 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
|
||||
/**
|
||||
* 勤工俭学岗位查询对象类型
|
||||
*/
|
||||
export interface WorkStudyPositionQuery extends PageQuery {
|
||||
/** 岗位名称 */
|
||||
positionName?: string;
|
||||
/** 发布范围 */
|
||||
positionScope?: string;
|
||||
/** 联系老师 */
|
||||
contactTeacher?: string;
|
||||
/** 学院ID */
|
||||
collegeId?: number | string;
|
||||
/** 岗位状态 */
|
||||
status?: string;
|
||||
/** 创建时间范围 */
|
||||
createTime?: [string, string];
|
||||
/** 有效期范围 */
|
||||
validPeriod?: [string, string];
|
||||
}
|
||||
|
||||
/**
|
||||
* 勤工俭学岗位表单类型
|
||||
*/
|
||||
export interface WorkStudyPositionForm {
|
||||
/** 主键 */
|
||||
id?: string | number;
|
||||
/** 岗位名称 */
|
||||
positionName?: string;
|
||||
/** 发布范围 */
|
||||
positionScope?: string;
|
||||
/** 需求人数 */
|
||||
requiredCount?: number;
|
||||
/** 工作时间 */
|
||||
workTime?: string;
|
||||
/** 开始日期 */
|
||||
startDate?: string;
|
||||
/** 结束日期 */
|
||||
endDate?: string;
|
||||
/** 岗位要求 */
|
||||
positionRequirements?: string;
|
||||
/** 薪资情况 */
|
||||
salaryInfo?: string;
|
||||
/** 联系老师 */
|
||||
contactTeacher?: string;
|
||||
/** 联系电话 */
|
||||
contactPhone?: string;
|
||||
/** 学院ID */
|
||||
collegeId?: number | string;
|
||||
/** 学院名称 */
|
||||
collegeName?: string;
|
||||
/** 岗位状态 */
|
||||
status?: string;
|
||||
/** 当前申请通过人数 */
|
||||
currentCount?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 勤工俭学岗位视图对象类型
|
||||
*/
|
||||
export interface WorkStudyPositionVO {
|
||||
/** 主键 */
|
||||
id?: string | number;
|
||||
/** 岗位名称 */
|
||||
positionName?: string;
|
||||
/** 发布范围 */
|
||||
positionScope?: string;
|
||||
/** 发布范围名称 */
|
||||
positionScopeName?: string;
|
||||
/** 需求人数 */
|
||||
requiredCount?: number;
|
||||
/** 工作时间 */
|
||||
workTime?: string;
|
||||
/** 开始日期 */
|
||||
startDate?: string;
|
||||
/** 结束日期 */
|
||||
endDate?: string;
|
||||
/** 岗位要求 */
|
||||
positionRequirements?: string;
|
||||
/** 薪资情况 */
|
||||
salaryInfo?: string;
|
||||
/** 联系老师 */
|
||||
contactTeacher?: string;
|
||||
/** 联系电话 */
|
||||
contactPhone?: string;
|
||||
/** 学院ID */
|
||||
collegeId?: number | string;
|
||||
/** 学院名称 */
|
||||
collegeName?: string;
|
||||
/** 岗位状态 */
|
||||
status?: string;
|
||||
/** 岗位状态名称 */
|
||||
statusName?: string;
|
||||
/** 当前申请通过人数 */
|
||||
currentCount?: number;
|
||||
/** 创建者 */
|
||||
createBy?: number;
|
||||
/** 创建时间 */
|
||||
createTime?: string;
|
||||
/** 更新者 */
|
||||
updateBy?: number;
|
||||
/** 更新时间 */
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 岗位统计数据类型
|
||||
*/
|
||||
export interface PositionStatisticsVO {
|
||||
/** 岗位总数 */
|
||||
totalCount?: number;
|
||||
/** 按状态统计 */
|
||||
statusCount?: {
|
||||
DRAFT?: number;
|
||||
PUBLISHED?: number;
|
||||
RECRUITING?: number;
|
||||
FULL?: number;
|
||||
EXPIRED?: number;
|
||||
SUSPENDED?: number;
|
||||
CANCELLED?: number;
|
||||
};
|
||||
/** 按发布范围统计 */
|
||||
scopeCount?: {
|
||||
COLLEGE?: number;
|
||||
UNIVERSITY?: number;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询勤工俭学岗位列表
|
||||
*/
|
||||
export function listWorkStudyPosition(query: WorkStudyPositionQuery): AxiosPromise<TableDataInfo<WorkStudyPositionVO>> {
|
||||
return request({
|
||||
url: '/jcbt/workStudyPosition/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询勤工俭学岗位信息详细
|
||||
* @param id 岗位ID
|
||||
*/
|
||||
export function getWorkStudyPosition(id: string | number): AxiosPromise<WorkStudyPositionVO> {
|
||||
return request({
|
||||
url: '/jcbt/workStudyPosition/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取岗位详情及当前用户申请状态
|
||||
* @param id 岗位ID
|
||||
*/
|
||||
export function getWorkStudyPositionWithApplicationStatus(id: string | number): AxiosPromise<{
|
||||
position: WorkStudyPositionVO;
|
||||
applicationStatus: {
|
||||
applicationStatusText: string;
|
||||
applicationStatus: string;
|
||||
hasApplication: number;
|
||||
canCancel: number;
|
||||
canEdit: number;
|
||||
applicationId?: number;
|
||||
lastApplicationTime?: string;
|
||||
};
|
||||
}> {
|
||||
return request({
|
||||
url: '/jcbt/workStudyPosition/' + id + '/withApplicationStatus',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增勤工俭学岗位
|
||||
*/
|
||||
export function addWorkStudyPosition(data: WorkStudyPositionForm) {
|
||||
return request({
|
||||
url: '/jcbt/workStudyPosition',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改勤工俭学岗位
|
||||
*/
|
||||
export function updateWorkStudyPosition(data: WorkStudyPositionForm) {
|
||||
return request({
|
||||
url: '/jcbt/workStudyPosition',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除勤工俭学岗位
|
||||
*/
|
||||
export function delWorkStudyPosition(id: string | number | Array<string | number>) {
|
||||
return request({
|
||||
url: '/jcbt/workStudyPosition/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取岗位统计数据
|
||||
*/
|
||||
export function getPositionStatistics(): AxiosPromise<PositionStatisticsVO> {
|
||||
return request({
|
||||
url: '/jcbt/workStudyPosition/statistics',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 发布岗位
|
||||
*/
|
||||
export function publishPosition(id: string | number) {
|
||||
return request({
|
||||
url: `/jcbt/workStudyPosition/publish/${id}`,
|
||||
method: 'put'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 暂停岗位招录
|
||||
*/
|
||||
export function suspendPosition(id: string | number) {
|
||||
return request({
|
||||
url: `/jcbt/workStudyPosition/suspend/${id}`,
|
||||
method: 'put'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 恢复岗位招录
|
||||
*/
|
||||
export function resumePosition(id: string | number) {
|
||||
return request({
|
||||
url: `/jcbt/workStudyPosition/resume/${id}`,
|
||||
method: 'put'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消岗位
|
||||
*/
|
||||
export function cancelPosition(id: string | number) {
|
||||
return request({
|
||||
url: `/jcbt/workStudyPosition/cancel/${id}`,
|
||||
method: 'put'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出勤工俭学岗位
|
||||
*/
|
||||
export function exportWorkStudyPosition(query: WorkStudyPositionQuery) {
|
||||
return request({
|
||||
url: '/jcbt/workStudyPosition/export',
|
||||
method: 'post',
|
||||
data: query
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取可用的学院选项
|
||||
*/
|
||||
export function getCollegeOptions(): AxiosPromise<any[]> {
|
||||
return request({
|
||||
url: '/system/dict/data/type/college_list',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询可见岗位列表(学院可见的岗位:本学院岗位 + 全校范围岗位)
|
||||
* @param query 查询参数
|
||||
* @param excludeApplied 是否排除已申请岗位
|
||||
*/
|
||||
export function listVisiblePositions(
|
||||
query: WorkStudyPositionQuery,
|
||||
excludeApplied: boolean = false
|
||||
): AxiosPromise<TableDataInfo<WorkStudyPositionVO>> {
|
||||
return request({
|
||||
url: '/jcbt/workStudyPosition/visibleList',
|
||||
method: 'get',
|
||||
params: {
|
||||
...query,
|
||||
excludeApplied
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 学生查看可申请的岗位列表(公开接口,无需权限)
|
||||
*/
|
||||
export function listAvailablePositionsForStudent(query: WorkStudyPositionQuery): AxiosPromise<WorkStudyPositionVO[]> {
|
||||
return request({
|
||||
url: '/jcbt/workStudyPosition/student/available',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
}
|
||||
@@ -57,3 +57,20 @@ export interface TenantInfo {
|
||||
tenantEnabled: boolean;
|
||||
voList: TenantVO[];
|
||||
}
|
||||
|
||||
/**
|
||||
* 通用响应结构
|
||||
*/
|
||||
export interface R<T = any> {
|
||||
code: number;
|
||||
msg: string;
|
||||
data: T;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页数据信息
|
||||
*/
|
||||
export interface TableDataInfo<T = any> {
|
||||
total: number;
|
||||
rows: T;
|
||||
}
|
||||
@@ -168,7 +168,6 @@ export interface StudentCancelLeaveVO {
|
||||
* 学生请假表id
|
||||
*/
|
||||
leaveId: string | number;
|
||||
|
||||
}
|
||||
|
||||
export interface StudentCancelLeaveForm extends BaseEntity {
|
||||
@@ -341,11 +340,9 @@ export interface StudentCancelLeaveForm extends BaseEntity {
|
||||
* 学生请假表id
|
||||
*/
|
||||
leaveId?: string | number;
|
||||
|
||||
}
|
||||
|
||||
export interface StudentCancelLeaveQuery extends PageQuery {
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
@@ -511,11 +508,8 @@ export interface StudentCancelLeaveQuery extends PageQuery {
|
||||
*/
|
||||
leaveId?: string | number;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="认定群体" prop="recognitionGroup">
|
||||
<el-select v-model="form.recognitionGroup" placeholder="请选择认定群体" style="width: 100%" @change="handleRecognitionGroupChange">
|
||||
<el-select v-model="form.recognitionGroup" placeholder="请选择认定群体" style="width: 100%" @change="handleRecognitionGroupChange">
|
||||
<el-option v-for="group in recognitionGroupOptions" :key="group.value" :label="group.label" :value="group.value" />
|
||||
</el-select>
|
||||
<!-- 群体介绍说明 -->
|
||||
@@ -128,7 +128,7 @@
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注信息" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" :rows="3" placeholder="其他需要说明的情况(200字以内)" maxlength="200" show-word-limit />
|
||||
<el-input v-model="form.remark" type="textarea" :rows="3" placeholder="其他需要说明的情况(200字以内)" maxlength="200" show-word-limit />
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
@@ -192,8 +192,8 @@
|
||||
<!-- 表单操作按钮 -->
|
||||
<div class="form-footer">
|
||||
<el-button @click="cancel">取消</el-button>
|
||||
<el-button type="info" @click="saveDraft" v-if="!isEdit">保存草稿</el-button>
|
||||
<el-button type="primary" @click="submitForm">{{ isEdit ? '确认修改' : '提交申请' }}</el-button>
|
||||
<el-button type="info" @click="handleSaveDraft" v-if="!isEdit">保存草稿</el-button>
|
||||
<el-button type="primary" @click="isEdit ? submitForm : submitAndApprove">{{ isEdit ? '确认修改' : '提交申请' }}</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
@@ -227,12 +227,14 @@ const recognitionGroupOptions = ref([
|
||||
{
|
||||
value: '特殊群体',
|
||||
label: '特殊群体',
|
||||
description: '低保家庭学生、特困供养学生、孤儿、烈士子女、残疾学生、低保边缘家庭学生、脱贫家庭学生(原建档立卡)、其他经济困难农户、其他群体(临时救助)。需提供相应政府部门出具的证明。'
|
||||
description:
|
||||
'低保家庭学生、特困供养学生、孤儿、烈士子女、残疾学生、低保边缘家庭学生、脱贫家庭学生(原建档立卡)、其他经济困难农户、其他群体(临时救助)。需提供相应政府部门出具的证明。'
|
||||
},
|
||||
{
|
||||
value: '其他群体',
|
||||
label: '其他群体',
|
||||
description: '因遭受自然灾害、意外事件、重大疾病等情况导致家庭经济困难的学生。需提供学生所在街道(乡镇)级以上政府部门出具的相关证明,属于重大疾病导致家庭经济困难的还需要提供当年度医药费相关凭证。'
|
||||
description:
|
||||
'因遭受自然灾害、意外事件、重大疾病等情况导致家庭经济困难的学生。需提供学生所在街道(乡镇)级以上政府部门出具的相关证明,属于重大疾病导致家庭经济困难的还需要提供当年度医药费相关凭证。'
|
||||
}
|
||||
]);
|
||||
|
||||
@@ -241,6 +243,8 @@ const selectedGroupDescription = ref('');
|
||||
|
||||
// 文件上传
|
||||
const fileList = ref([]);
|
||||
const applicationFormFileList = ref([]);
|
||||
const surveyFormFileList = ref([]);
|
||||
|
||||
// 文件上传相关
|
||||
const uploadHeaders = computed(() => {
|
||||
@@ -255,14 +259,14 @@ const filteredStudents = ref([]);
|
||||
const studentSearchLoading = ref(false);
|
||||
const allStudents = ref([
|
||||
// 模拟班级学生数据
|
||||
{ studentNo: '20241001', studentName: '张三' },
|
||||
{ studentNo: '20241002', studentName: '李四' },
|
||||
{ studentNo: '20241003', studentName: '王五' },
|
||||
{ studentNo: '20241011', studentName: '赵六' },
|
||||
{ studentNo: '20241021', studentName: '钱七' },
|
||||
{ studentNo: '20241031', studentName: '孙八' },
|
||||
{ studentNo: '20242001', studentName: '周九' },
|
||||
{ studentNo: '20242011', studentName: '吴十' },
|
||||
{ studentNo: '20241001', studentName: '张三', className: '软件工程2024-1班', teacherName: '张老师' },
|
||||
{ studentNo: '20241002', studentName: '李四', className: '软件工程2024-1班', teacherName: '张老师' },
|
||||
{ studentNo: '20241003', studentName: '王五', className: '软件工程2024-2班', teacherName: '李老师' },
|
||||
{ studentNo: '20241011', studentName: '赵六', className: '软件工程2024-2班', teacherName: '李老师' },
|
||||
{ studentNo: '20241021', studentName: '钱七', className: '计算机科学2024-1班', teacherName: '王老师' },
|
||||
{ studentNo: '20241031', studentName: '孙八', className: '计算机科学2024-1班', teacherName: '王老师' },
|
||||
{ studentNo: '20242001', studentName: '周九', className: '网络工程2024-1班', teacherName: '赵老师' },
|
||||
{ studentNo: '20242011', studentName: '吴十', className: '网络工程2024-1班', teacherName: '赵老师' }
|
||||
]);
|
||||
|
||||
// 重复申请检查
|
||||
@@ -280,11 +284,15 @@ const form = ref({
|
||||
studentNo: '',
|
||||
classId: null,
|
||||
className: '',
|
||||
teacherId: null,
|
||||
teacherName: '',
|
||||
recognitionGroup: null,
|
||||
academicYear: '2024-2025',
|
||||
familyEconomyStatus: '',
|
||||
familyEconomySummary: '',
|
||||
applicationReason: '',
|
||||
attachApplicationFormUrl: '',
|
||||
attachSurveyFormUrl: '',
|
||||
remark: '',
|
||||
status: 'DRAFT'
|
||||
});
|
||||
@@ -299,18 +307,10 @@ const rules = {
|
||||
{ required: true, message: '学号不能为空', trigger: 'blur' },
|
||||
{ pattern: /^[0-9]{8,12}$/, message: '学号格式不正确', trigger: 'blur' }
|
||||
],
|
||||
className: [
|
||||
{ required: true, message: '班级不能为空', trigger: 'blur' }
|
||||
],
|
||||
recognitionGroup: [
|
||||
{ required: true, message: '认定群体不能为空', trigger: 'change' }
|
||||
],
|
||||
academicYear: [
|
||||
{ required: true, message: '学年不能为空', trigger: 'change' }
|
||||
],
|
||||
familyEconomyStatus: [
|
||||
{ required: true, message: '家庭经济情况不能为空', trigger: 'change' }
|
||||
],
|
||||
className: [{ required: true, message: '班级不能为空', trigger: 'blur' }],
|
||||
recognitionGroup: [{ required: true, message: '认定群体不能为空', trigger: 'change' }],
|
||||
academicYear: [{ required: true, message: '学年不能为空', trigger: 'change' }],
|
||||
familyEconomyStatus: [{ required: true, message: '家庭经济情况不能为空', trigger: 'change' }],
|
||||
familyEconomySummary: [
|
||||
{ required: true, message: '家庭情况摘要不能为空', trigger: 'blur' },
|
||||
{ min: 50, message: '家庭情况摘要至少50字', trigger: 'blur' }
|
||||
@@ -319,12 +319,12 @@ const rules = {
|
||||
{ required: true, message: '申请理由不能为空', trigger: 'blur' },
|
||||
{ min: 30, message: '申请理由至少30字', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
/** 检查学生信息 */
|
||||
async function checkStudentInfo() {
|
||||
if (!form.value.studentNo || !form.value.academicYear || !form.value.recognitionGroup) {
|
||||
return
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -333,198 +333,251 @@ async function checkStudentInfo() {
|
||||
academicYear: form.value.academicYear,
|
||||
recognitionGroup: form.value.recognitionGroup,
|
||||
excludeId: form.value.id
|
||||
})
|
||||
});
|
||||
|
||||
if (response.data) {
|
||||
duplicateCheck.value = {
|
||||
show: true,
|
||||
message: '该学生在当前学年已有相同类型的认定申请,请检查是否重复申请',
|
||||
type: 'warning'
|
||||
}
|
||||
};
|
||||
} else {
|
||||
duplicateCheck.value.show = false
|
||||
duplicateCheck.value.show = false;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('检查重复申请失败:', error)
|
||||
console.error('检查重复申请失败:', error);
|
||||
}
|
||||
}
|
||||
|
||||
/** 处理认定群体选择变化 */
|
||||
function handleRecognitionGroupChange(value) {
|
||||
const selectedGroup = recognitionGroupOptions.value.find(group => group.value === value)
|
||||
selectedGroupDescription.value = selectedGroup ? selectedGroup.description : ''
|
||||
const selectedGroup = recognitionGroupOptions.value.find((group) => group.value === value);
|
||||
selectedGroupDescription.value = selectedGroup ? selectedGroup.description : '';
|
||||
|
||||
// 检查重复申请
|
||||
checkStudentInfo()
|
||||
checkStudentInfo();
|
||||
}
|
||||
|
||||
/** 搜索学生 */
|
||||
function searchStudents(query) {
|
||||
if (!query) {
|
||||
filteredStudents.value = []
|
||||
return
|
||||
filteredStudents.value = [];
|
||||
return;
|
||||
}
|
||||
|
||||
studentSearchLoading.value = true
|
||||
studentSearchLoading.value = true;
|
||||
|
||||
// 模拟异步搜索延迟
|
||||
setTimeout(() => {
|
||||
// 根据学号进行模糊搜索
|
||||
filteredStudents.value = allStudents.value.filter(student =>
|
||||
student.studentNo.includes(query) || student.studentName.includes(query)
|
||||
)
|
||||
studentSearchLoading.value = false
|
||||
}, 200)
|
||||
filteredStudents.value = allStudents.value.filter((student) => student.studentNo.includes(query) || student.studentName.includes(query));
|
||||
studentSearchLoading.value = false;
|
||||
}, 200);
|
||||
}
|
||||
|
||||
/** 处理学生选择 */
|
||||
function handleStudentSelect(studentNo) {
|
||||
if (!studentNo) {
|
||||
form.value.studentName = ''
|
||||
form.value.studentId = null
|
||||
return
|
||||
form.value.studentName = '';
|
||||
form.value.studentId = null;
|
||||
form.value.className = '';
|
||||
form.value.teacherName = '';
|
||||
return;
|
||||
}
|
||||
|
||||
const selectedStudent = allStudents.value.find(student => student.studentNo === studentNo)
|
||||
const selectedStudent = allStudents.value.find((student) => student.studentNo === studentNo);
|
||||
if (selectedStudent) {
|
||||
form.value.studentName = selectedStudent.studentName
|
||||
form.value.studentId = selectedStudent.studentId || null
|
||||
form.value.studentName = selectedStudent.studentName;
|
||||
form.value.studentId = selectedStudent.studentId || null;
|
||||
// 设置班级和老师信息(模拟数据,实际应该从学生信息中获取)
|
||||
form.value.className = selectedStudent.className || '软件工程2024-1班';
|
||||
form.value.teacherName = selectedStudent.teacherName || '张老师';
|
||||
|
||||
// 检查重复申请
|
||||
checkStudentInfo()
|
||||
checkStudentInfo();
|
||||
}
|
||||
}
|
||||
|
||||
/** 文件上传前检查 */
|
||||
function beforeUpload(file) {
|
||||
const isValidType = ['image/jpeg', 'image/png', 'application/pdf'].includes(file.type)
|
||||
const isLt5M = file.size / 1024 / 1024 < 5
|
||||
const isValidType = ['image/jpeg', 'image/png', 'application/pdf'].includes(file.type);
|
||||
const isLt5M = file.size / 1024 / 1024 < 5;
|
||||
|
||||
if (!isValidType) {
|
||||
proxy.$modal.msgError('上传文件只能是 JPG/PNG/PDF 格式!')
|
||||
return false
|
||||
proxy.$modal.msgError('上传文件只能是 JPG/PNG/PDF 格式!');
|
||||
return false;
|
||||
}
|
||||
if (!isLt5M) {
|
||||
proxy.$modal.msgError('上传文件大小不能超过 5MB!')
|
||||
return false
|
||||
proxy.$modal.msgError('上传文件大小不能超过 5MB!');
|
||||
return false;
|
||||
}
|
||||
return true
|
||||
return true;
|
||||
}
|
||||
|
||||
/** 申请表附件上传成功 */
|
||||
function handleApplicationFormUploadSuccess(response, file) {
|
||||
if (response.code === 200) {
|
||||
form.value.attachApplicationFormUrl = response.data.url;
|
||||
applicationFormFileList.value = [
|
||||
{
|
||||
name: file.name,
|
||||
url: response.data.url
|
||||
}
|
||||
];
|
||||
proxy.$modal.msgSuccess('申请表附件上传成功');
|
||||
} else {
|
||||
proxy.$modal.msgError('申请表附件上传失败:' + response.msg);
|
||||
}
|
||||
}
|
||||
|
||||
/** 调查表附件上传成功 */
|
||||
function handleSurveyFormUploadSuccess(response, file) {
|
||||
if (response.code === 200) {
|
||||
form.value.attachSurveyFormUrl = response.data.url;
|
||||
surveyFormFileList.value = [
|
||||
{
|
||||
name: file.name,
|
||||
url: response.data.url
|
||||
}
|
||||
];
|
||||
proxy.$modal.msgSuccess('调查表附件上传成功');
|
||||
} else {
|
||||
proxy.$modal.msgError('调查表附件上传失败:' + response.msg);
|
||||
}
|
||||
}
|
||||
|
||||
/** 申请表附件删除 */
|
||||
function handleApplicationFormRemove(file) {
|
||||
form.value.attachApplicationFormUrl = '';
|
||||
applicationFormFileList.value = [];
|
||||
proxy.$modal.msgSuccess('申请表附件删除成功');
|
||||
}
|
||||
|
||||
/** 调查表附件删除 */
|
||||
function handleSurveyFormRemove(file) {
|
||||
form.value.attachSurveyFormUrl = '';
|
||||
surveyFormFileList.value = [];
|
||||
proxy.$modal.msgSuccess('调查表附件删除成功');
|
||||
}
|
||||
|
||||
/** 文件上传成功 */
|
||||
function handleUploadSuccess(response, file) {
|
||||
proxy.$modal.msgSuccess('文件上传成功')
|
||||
proxy.$modal.msgSuccess('文件上传成功');
|
||||
}
|
||||
|
||||
/** 文件删除 */
|
||||
function handleRemove(file) {
|
||||
proxy.$modal.msgSuccess('文件删除成功')
|
||||
proxy.$modal.msgSuccess('文件删除成功');
|
||||
}
|
||||
|
||||
/** 保存草稿 */
|
||||
function handleSaveDraft() {
|
||||
// 基本验证
|
||||
if (!form.value.studentName || !form.value.studentNo) {
|
||||
proxy.$modal.msgError('请至少填写学生姓名和学号')
|
||||
return
|
||||
proxy.$modal.msgError('请至少填写学生姓名和学号');
|
||||
return;
|
||||
}
|
||||
|
||||
saveDraftPovertyApplication(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess('草稿保存成功')
|
||||
goBack()
|
||||
}).catch(error => {
|
||||
proxy.$modal.msgError('草稿保存失败')
|
||||
})
|
||||
saveDraftPovertyApplication(form.value)
|
||||
.then((response) => {
|
||||
proxy.$modal.msgSuccess('草稿保存成功');
|
||||
goBack();
|
||||
})
|
||||
.catch((error) => {
|
||||
proxy.$modal.msgError('草稿保存失败');
|
||||
});
|
||||
}
|
||||
|
||||
/** 提交表单 */
|
||||
function submitForm() {
|
||||
proxy.$refs.applicationFormRef.validate(valid => {
|
||||
proxy.$refs.applicationFormRef.validate((valid) => {
|
||||
if (valid) {
|
||||
if (duplicateCheck.value.show) {
|
||||
proxy.$modal.confirm('检测到可能的重复申请,是否继续提交?').then(() => {
|
||||
doSubmit()
|
||||
})
|
||||
doSubmit();
|
||||
});
|
||||
} else {
|
||||
doSubmit()
|
||||
doSubmit();
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/** 执行提交 */
|
||||
function doSubmit() {
|
||||
const submitFunction = isEdit.value ? updatePovertyApplication : addPovertyApplication
|
||||
const successMessage = isEdit.value ? '修改成功' : '申请提交成功'
|
||||
const submitFunction = isEdit.value ? updatePovertyApplication : addPovertyApplication;
|
||||
const successMessage = isEdit.value ? '修改成功' : '申请提交成功';
|
||||
|
||||
submitFunction(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess(successMessage)
|
||||
goBack()
|
||||
}).catch(error => {
|
||||
proxy.$modal.msgError(isEdit.value ? '修改失败' : '申请提交失败')
|
||||
})
|
||||
submitFunction(form.value)
|
||||
.then((response) => {
|
||||
proxy.$modal.msgSuccess(successMessage);
|
||||
goBack();
|
||||
})
|
||||
.catch((error) => {
|
||||
proxy.$modal.msgError(isEdit.value ? '修改失败' : '申请提交失败');
|
||||
});
|
||||
}
|
||||
|
||||
/** 提交并申请审核 */
|
||||
function submitAndApprove() {
|
||||
proxy.$refs.applicationFormRef.validate(valid => {
|
||||
proxy.$refs.applicationFormRef.validate((valid) => {
|
||||
if (valid) {
|
||||
if (duplicateCheck.value.show) {
|
||||
proxy.$modal.confirm('检测到可能的重复申请,是否继续提交?').then(() => {
|
||||
doSubmitAndApprove()
|
||||
})
|
||||
doSubmitAndApprove();
|
||||
});
|
||||
} else {
|
||||
doSubmitAndApprove()
|
||||
doSubmitAndApprove();
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/** 执行提交并申请审核 */
|
||||
async function doSubmitAndApprove() {
|
||||
try {
|
||||
// 先保存/更新申请
|
||||
const submitFunction = isEdit.value ? updatePovertyApplication : addPovertyApplication
|
||||
const response = await submitFunction(form.value)
|
||||
const submitFunction = isEdit.value ? updatePovertyApplication : addPovertyApplication;
|
||||
const response = await submitFunction(form.value);
|
||||
|
||||
// 如果是新增,需要获取返回的ID
|
||||
let applicationId = form.value.id
|
||||
let applicationId = form.value.id;
|
||||
if (!isEdit.value && response.data) {
|
||||
applicationId = response.data
|
||||
applicationId = response.data;
|
||||
}
|
||||
|
||||
// 然后提交审核
|
||||
if (applicationId) {
|
||||
await submitPovertyApplication(applicationId)
|
||||
proxy.$modal.msgSuccess('申请已提交,等待审核')
|
||||
await submitPovertyApplication(applicationId);
|
||||
proxy.$modal.msgSuccess('申请已提交,等待审核');
|
||||
} else {
|
||||
proxy.$modal.msgSuccess('申请保存成功')
|
||||
proxy.$modal.msgSuccess('申请保存成功');
|
||||
}
|
||||
|
||||
goBack()
|
||||
goBack();
|
||||
} catch (error) {
|
||||
proxy.$modal.msgError('操作失败')
|
||||
proxy.$modal.msgError('操作失败');
|
||||
}
|
||||
}
|
||||
|
||||
/** 返回列表 */
|
||||
function goBack() {
|
||||
router.push('/jcbt/poverty/Application')
|
||||
router.push('/jcbt/poverty/Application');
|
||||
}
|
||||
|
||||
/** 初始化数据 */
|
||||
async function initData() {
|
||||
// 检查是否为编辑模式
|
||||
if (route.params.id) {
|
||||
isEdit.value = true
|
||||
applicationId.value = route.params.id
|
||||
isEdit.value = true;
|
||||
applicationId.value = route.params.id;
|
||||
|
||||
try {
|
||||
const response = await getPovertyApplication(applicationId.value)
|
||||
form.value = response.data
|
||||
const response = await getPovertyApplication(applicationId.value);
|
||||
form.value = response.data;
|
||||
} catch (error) {
|
||||
proxy.$modal.msgError('获取申请信息失败')
|
||||
goBack()
|
||||
proxy.$modal.msgError('获取申请信息失败');
|
||||
goBack();
|
||||
}
|
||||
} else {
|
||||
// 新增模式,生成申请编号
|
||||
@@ -533,8 +586,8 @@ async function initData() {
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
initData()
|
||||
})
|
||||
initData();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,312 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="detail-card" shadow="never">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span class="title">助学金申请审核详情</span>
|
||||
<div class="actions">
|
||||
<el-button @click="handleBack">返回</el-button>
|
||||
<el-button
|
||||
type="success"
|
||||
v-if="applicationData.status === 'SUBMITTED'"
|
||||
@click="handleApprove"
|
||||
v-hasPermi="['jcbt:povertyApplication:approve']"
|
||||
>
|
||||
审核通过
|
||||
</el-button>
|
||||
<el-button
|
||||
type="danger"
|
||||
v-if="applicationData.status === 'SUBMITTED'"
|
||||
@click="handleReject"
|
||||
v-hasPermi="['jcbt:povertyApplication:reject']"
|
||||
>
|
||||
审核驳回
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="申请编号">{{ applicationData.applicationNo }}</el-descriptions-item>
|
||||
<el-descriptions-item label="学年">{{ applicationData.academicYear }}</el-descriptions-item>
|
||||
<el-descriptions-item label="学号">{{ applicationData.studentNo }}</el-descriptions-item>
|
||||
<el-descriptions-item label="学生姓名">{{ applicationData.studentName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="班级">{{ applicationData.className }}</el-descriptions-item>
|
||||
<el-descriptions-item label="认定群体">{{ applicationData.recognitionGroup }}</el-descriptions-item>
|
||||
<el-descriptions-item label="认定类型">{{ applicationData.recognitionTypeName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="资助类型">{{ applicationData.assistanceTypeNames }}</el-descriptions-item>
|
||||
<el-descriptions-item label="经济情况">{{ applicationData.familyEconomyStatus }}</el-descriptions-item>
|
||||
<el-descriptions-item label="审核状态">
|
||||
<el-tag :type="getStatusTagType(applicationData.status)">
|
||||
{{ getStatusText(applicationData.status) }}
|
||||
</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="申请时间" :span="2">
|
||||
{{ applicationData.submitTime || parseTime(applicationData.createTime, '{y}-{m}-{d} {h}:{i}') }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="家庭情况摘要" :span="2">
|
||||
<div class="text-content">{{ applicationData.familyEconomySummary }}</div>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="申请理由" :span="2">
|
||||
<div class="text-content">{{ applicationData.applicationReason || '暂无申请理由' }}</div>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
<!-- 附件信息 -->
|
||||
<div class="section-title">申请附件</div>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<div class="attachment-item">
|
||||
<h4>申请表附件</h4>
|
||||
<div v-if="applicationData.attachApplicationFormUrl">
|
||||
<el-button type="primary" @click="previewFile(applicationData.attachApplicationFormUrl)">
|
||||
<el-icon><View /></el-icon>
|
||||
预览申请表
|
||||
</el-button>
|
||||
</div>
|
||||
<div v-else class="no-attachment">
|
||||
<el-text type="info">暂无申请表附件</el-text>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="attachment-item">
|
||||
<h4>调查表附件</h4>
|
||||
<div v-if="applicationData.attachSurveyFormUrl">
|
||||
<el-button type="primary" @click="previewFile(applicationData.attachSurveyFormUrl)">
|
||||
<el-icon><View /></el-icon>
|
||||
预览调查表
|
||||
</el-button>
|
||||
</div>
|
||||
<div v-else class="no-attachment">
|
||||
<el-text type="info">暂无调查表附件</el-text>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 审核信息 -->
|
||||
<div class="section-title" v-if="applicationData.auditorName">审核信息</div>
|
||||
<el-descriptions :column="2" border v-if="applicationData.auditorName">
|
||||
<el-descriptions-item label="审核人">{{ applicationData.auditorName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="审核时间">{{ applicationData.auditTime }}</el-descriptions-item>
|
||||
<el-descriptions-item label="审核意见" :span="2">
|
||||
<div class="text-content">{{ applicationData.auditOpinion }}</div>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
|
||||
<!-- 审核对话框 -->
|
||||
<el-dialog :title="auditTitle" v-model="auditOpen" width="600px" append-to-body>
|
||||
<el-form ref="auditFormRef" :model="auditForm" :rules="auditRules" label-width="100px">
|
||||
<el-form-item label="申请编号">
|
||||
<el-input v-model="applicationData.applicationNo" readonly />
|
||||
</el-form-item>
|
||||
<el-form-item label="学生姓名">
|
||||
<el-input v-model="applicationData.studentName" readonly />
|
||||
</el-form-item>
|
||||
<el-form-item label="审核意见" prop="auditOpinion">
|
||||
<el-input
|
||||
v-model="auditForm.auditOpinion"
|
||||
type="textarea"
|
||||
:rows="4"
|
||||
placeholder="请输入审核意见(1000字以内)"
|
||||
maxlength="1000"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer-right">
|
||||
<el-button @click="auditOpen = false">取消</el-button>
|
||||
<el-button type="primary" @click="confirmAudit">确定</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="JcbtPovertyApplicationReviewDetail">
|
||||
import { getCurrentInstance, ref, onMounted } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { getReviewDetail, approveApplication, rejectApplication } from '@/api/jcbt/povertyApplicationReview';
|
||||
|
||||
// 路由相关
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
// 数据定义
|
||||
const applicationData = ref({});
|
||||
const auditOpen = ref(false);
|
||||
const auditTitle = ref('');
|
||||
const auditType = ref('');
|
||||
const auditForm = ref({
|
||||
auditOpinion: ''
|
||||
});
|
||||
const auditRules = {
|
||||
auditOpinion: [{ required: true, message: '审核意见不能为空', trigger: 'blur' }]
|
||||
};
|
||||
|
||||
/** 获取状态标签类型 */
|
||||
function getStatusTagType(status) {
|
||||
const types = {
|
||||
'SUBMITTED': 'warning',
|
||||
'APPROVED': 'success',
|
||||
'REJECTED': 'danger',
|
||||
'DRAFT': 'info',
|
||||
'WITHDRAWN': 'info'
|
||||
};
|
||||
return types[status] || 'info';
|
||||
}
|
||||
|
||||
/** 获取状态文本 */
|
||||
function getStatusText(status) {
|
||||
const texts = {
|
||||
'SUBMITTED': '待审核',
|
||||
'APPROVED': '已通过',
|
||||
'REJECTED': '已驳回',
|
||||
'DRAFT': '草稿',
|
||||
'WITHDRAWN': '已撤回'
|
||||
};
|
||||
return texts[status] || status;
|
||||
}
|
||||
|
||||
/** 获取详情数据 */
|
||||
function getDetail() {
|
||||
const id = route.params.id;
|
||||
if (id) {
|
||||
getReviewDetail(id).then((response) => {
|
||||
applicationData.value = response.data;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/** 返回列表 */
|
||||
function handleBack() {
|
||||
router.back();
|
||||
}
|
||||
|
||||
/** 审核通过 */
|
||||
function handleApprove() {
|
||||
auditForm.value = { auditOpinion: '' };
|
||||
auditType.value = 'approve';
|
||||
auditTitle.value = '审核通过';
|
||||
auditOpen.value = true;
|
||||
}
|
||||
|
||||
/** 审核驳回 */
|
||||
function handleReject() {
|
||||
auditForm.value = { auditOpinion: '' };
|
||||
auditType.value = 'reject';
|
||||
auditTitle.value = '审核驳回';
|
||||
auditOpen.value = true;
|
||||
}
|
||||
|
||||
/** 确认审核 */
|
||||
function confirmAudit() {
|
||||
proxy.$refs.auditFormRef.validate((valid) => {
|
||||
if (valid) {
|
||||
const auditData = {
|
||||
id: applicationData.value.id,
|
||||
auditOpinion: auditForm.value.auditOpinion
|
||||
};
|
||||
|
||||
const auditFunction = auditType.value === 'approve' ? approveApplication : rejectApplication;
|
||||
const successMsg = auditType.value === 'approve' ? '审核通过成功' : '审核驳回成功';
|
||||
|
||||
auditFunction(auditData).then(() => {
|
||||
auditOpen.value = false;
|
||||
getDetail(); // 重新获取数据
|
||||
proxy.$modal.msgSuccess(successMsg);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** 文件预览 */
|
||||
function previewFile(url) {
|
||||
if (url) {
|
||||
window.open(url, '_blank');
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getDetail();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.app-container {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.detail-card {
|
||||
.card-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.title {
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
.actions {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
margin: 20px 0 15px 0;
|
||||
padding-bottom: 8px;
|
||||
border-bottom: 2px solid #e4e7ed;
|
||||
}
|
||||
|
||||
.text-content {
|
||||
line-height: 1.6;
|
||||
word-break: break-all;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
.attachment-item {
|
||||
text-align: center;
|
||||
padding: 20px;
|
||||
border: 1px solid #e4e7ed;
|
||||
border-radius: 4px;
|
||||
|
||||
h4 {
|
||||
margin-bottom: 15px;
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
.no-attachment {
|
||||
padding: 20px;
|
||||
color: #909399;
|
||||
}
|
||||
}
|
||||
|
||||
.dialog-footer-right {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
:deep(.el-descriptions) {
|
||||
.el-descriptions__label {
|
||||
font-weight: 600;
|
||||
color: #606266;
|
||||
background-color: #fafafa;
|
||||
}
|
||||
|
||||
.el-descriptions__content {
|
||||
color: #303133;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
File diff suppressed because it is too large.
Load diff
@@ -5,14 +5,7 @@
|
||||
<div class="detail-header">
|
||||
<span class="detail-title">奖学金申请详情</span>
|
||||
<div class="header-actions">
|
||||
<el-button
|
||||
v-if="canEdit"
|
||||
type="primary"
|
||||
icon="Edit"
|
||||
@click="handleEdit"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button v-if="canEdit" type="primary" icon="Edit" @click="handleEdit"> 编辑 </el-button>
|
||||
<el-button @click="goBack" class="back-button">
|
||||
<el-icon><ArrowLeft /></el-icon>
|
||||
返回
|
||||
@@ -197,14 +190,7 @@
|
||||
<el-table-column label="上传时间" prop="uploadTime" width="180" align="center" />
|
||||
<el-table-column label="操作" width="100" align="center">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
icon="Download"
|
||||
@click="handleDownload(scope.row)"
|
||||
>
|
||||
下载
|
||||
</el-button>
|
||||
<el-button type="primary" link icon="Download" @click="handleDownload(scope.row)"> 下载 </el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -217,11 +203,7 @@
|
||||
操作记录
|
||||
</div>
|
||||
<el-timeline>
|
||||
<el-timeline-item
|
||||
v-if="detail.createTime"
|
||||
:timestamp="detail.createTime"
|
||||
type="primary"
|
||||
>
|
||||
<el-timeline-item v-if="detail.createTime" :timestamp="detail.createTime" type="primary">
|
||||
<div class="timeline-content">
|
||||
<div class="timeline-title">创建申请</div>
|
||||
<div class="timeline-desc">申请记录已创建</div>
|
||||
@@ -237,11 +219,7 @@
|
||||
<div class="timeline-desc">申请已提交,等待审核</div>
|
||||
</div>
|
||||
</el-timeline-item>
|
||||
<el-timeline-item
|
||||
v-if="detail.auditTime"
|
||||
:timestamp="detail.auditTime"
|
||||
:type="detail.auditStatus === 'approved' ? 'success' : 'danger'"
|
||||
>
|
||||
<el-timeline-item v-if="detail.auditTime" :timestamp="detail.auditTime" :type="detail.auditStatus === 'approved' ? 'success' : 'danger'">
|
||||
<div class="timeline-content">
|
||||
<div class="timeline-title">
|
||||
{{ detail.auditStatus === 'approved' ? '审核通过' : '审核驳回' }}
|
||||
@@ -252,11 +230,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</el-timeline-item>
|
||||
<el-timeline-item
|
||||
v-if="detail.awardTime"
|
||||
:timestamp="detail.awardTime"
|
||||
type="warning"
|
||||
>
|
||||
<el-timeline-item v-if="detail.awardTime" :timestamp="detail.awardTime" type="warning">
|
||||
<div class="timeline-content">
|
||||
<div class="timeline-title">获得奖学金</div>
|
||||
<div class="timeline-desc">恭喜获得奖学金</div>
|
||||
@@ -302,7 +276,6 @@ const getDetail = async () => {
|
||||
// 获取附件列表
|
||||
const attachmentRes = await listScholarshipAttachment(id);
|
||||
attachmentList.value = attachmentRes.data;
|
||||
|
||||
} catch (error) {
|
||||
proxy?.$modal.msgError('获取详情失败');
|
||||
} finally {
|
||||
|
||||
@@ -11,13 +11,7 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
label-width="140px"
|
||||
v-loading="formLoading"
|
||||
>
|
||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="140px" v-loading="formLoading">
|
||||
<!-- 批次选择 -->
|
||||
<div class="form-section">
|
||||
<div class="section-title">
|
||||
@@ -27,19 +21,8 @@
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="申报批次" prop="batchId">
|
||||
<el-select
|
||||
v-model="form.batchId"
|
||||
placeholder="请选择申报批次"
|
||||
style="width: 100%"
|
||||
:disabled="isView"
|
||||
@change="handleBatchChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="batch in batchList"
|
||||
:key="batch.id"
|
||||
:label="batch.batchName"
|
||||
:value="batch.id"
|
||||
/>
|
||||
<el-select v-model="form.batchId" placeholder="请选择申报批次" style="width: 100%" :disabled="isView" @change="handleBatchChange">
|
||||
<el-option v-for="batch in batchList" :key="batch.id" :label="batch.batchName" :value="batch.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -52,33 +35,16 @@
|
||||
:disabled="isView || !form.batchId"
|
||||
@change="handleScholarshipTypeChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="type in scholarshipTypes"
|
||||
:key="type.id"
|
||||
:value="type.id"
|
||||
:disabled="type.quotaStatus === 'full'"
|
||||
>
|
||||
<el-option v-for="type in scholarshipTypes" :key="type.id" :value="type.id" :disabled="type.quotaStatus === 'full'">
|
||||
<div class="scholarship-type-option">
|
||||
<span
|
||||
:class="[
|
||||
'type-name',
|
||||
type.quotaStatus === 'available' || type.quotaStatus === 'unlimited' ? 'available' : 'full'
|
||||
]"
|
||||
>
|
||||
<span :class="['type-name', type.quotaStatus === 'available' || type.quotaStatus === 'unlimited' ? 'available' : 'full']">
|
||||
{{ type.name }}
|
||||
</span>
|
||||
<span class="quota-info" v-if="type.quotaStatus === 'unlimited'">
|
||||
<span class="quota-badge available">
|
||||
无限制
|
||||
</span>
|
||||
<span class="quota-badge available"> 无限制 </span>
|
||||
</span>
|
||||
<span class="quota-info" v-else>
|
||||
<span
|
||||
:class="[
|
||||
'quota-badge',
|
||||
type.quotaStatus === 'available' ? 'available' : 'full'
|
||||
]"
|
||||
>
|
||||
<span :class="['quota-badge', type.quotaStatus === 'available' ? 'available' : 'full']">
|
||||
{{ type.availableQuota || 0 }}/{{ type.totalQuota || 0 }}
|
||||
</span>
|
||||
</span>
|
||||
@@ -132,9 +98,7 @@
|
||||
<div class="section-title">
|
||||
<el-icon><User /></el-icon>
|
||||
学生选择
|
||||
<span v-if="selectedStudents.length > 0" class="selection-count">
|
||||
(已选择 {{ selectedStudents.length }} 人)
|
||||
</span>
|
||||
<span v-if="selectedStudents.length > 0" class="selection-count"> (已选择 {{ selectedStudents.length }} 人) </span>
|
||||
</div>
|
||||
|
||||
<!-- 学生选择表格 -->
|
||||
@@ -143,17 +107,14 @@
|
||||
:data="filteredStudents"
|
||||
v-loading="studentsLoading"
|
||||
@selection-change="handleStudentSelectionChange"
|
||||
style="width: 100%; margin-bottom: 20px;"
|
||||
style="width: 100%; margin-bottom: 20px"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="studentCode" label="学号" width="120" />
|
||||
<el-table-column prop="studentName" label="姓名" width="100" />
|
||||
<el-table-column prop="gender" label="性别" width="80" />
|
||||
<<<<<<< HEAD
|
||||
<el-table-column prop="collegeName" label="学院" width="120" />
|
||||
<el-table-column prop="majorName" label="专业" width="120" />
|
||||
=======
|
||||
>>>>>>> 4b9dbe40fb94a83d379f7d16211dec6d78c23755
|
||||
<el-table-column prop="phone" label="联系方式" width="130" />
|
||||
<el-table-column prop="email" label="邮箱" />
|
||||
<el-table-column label="在校状态" width="100">
|
||||
@@ -167,12 +128,7 @@
|
||||
|
||||
<!-- 学生搜索 -->
|
||||
<div class="student-search">
|
||||
<el-input
|
||||
v-model="studentSearchKeyword"
|
||||
placeholder="搜索学生姓名或学号"
|
||||
style="width: 300px;"
|
||||
clearable
|
||||
/>
|
||||
<el-input v-model="studentSearchKeyword" placeholder="搜索学生姓名或学号" style="width: 300px" clearable />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -185,12 +141,7 @@
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="申请类型" prop="applicationType">
|
||||
<el-select
|
||||
v-model="form.applicationType"
|
||||
placeholder="请选择申请类型"
|
||||
style="width: 300px"
|
||||
:disabled="isView"
|
||||
>
|
||||
<el-select v-model="form.applicationType" placeholder="请选择申请类型" style="width: 300px" :disabled="isView">
|
||||
<el-option label="教师推荐" value="RECOMMEND" />
|
||||
<el-option label="直接指定" value="DIRECT" />
|
||||
</el-select>
|
||||
@@ -244,12 +195,7 @@
|
||||
<div class="class-selector">
|
||||
<p class="tip">检测到您是多个班级的班主任,请选择要进行奖学金申请的班级:</p>
|
||||
<el-radio-group v-model="selectedClassId" class="class-options">
|
||||
<el-radio
|
||||
v-for="option in classOptions"
|
||||
:key="option.classId"
|
||||
:value="option.classId"
|
||||
class="class-option"
|
||||
>
|
||||
<el-radio v-for="option in classOptions" :key="option.classId" :value="option.classId" class="class-option">
|
||||
<div class="class-info">
|
||||
<div class="class-name">{{ option.className }}</div>
|
||||
<div class="class-detail">{{ option.collegeName }} - {{ option.majorName }} - {{ option.grade }}</div>
|
||||
@@ -343,9 +289,8 @@ const formTitle = computed(() => {
|
||||
const filteredStudents = computed(() => {
|
||||
if (!studentSearchKeyword.value) return studentList.value;
|
||||
const keyword = studentSearchKeyword.value.toLowerCase();
|
||||
return studentList.value.filter(student =>
|
||||
student.studentName.toLowerCase().includes(keyword) ||
|
||||
student.studentCode.toLowerCase().includes(keyword)
|
||||
return studentList.value.filter(
|
||||
(student) => student.studentName.toLowerCase().includes(keyword) || student.studentCode.toLowerCase().includes(keyword)
|
||||
);
|
||||
});
|
||||
|
||||
@@ -473,7 +418,7 @@ const handleBatchChange = async () => {
|
||||
const types = response.data || [];
|
||||
|
||||
// 确保每个类型都有必要的字段
|
||||
scholarshipTypes.value = types.map(type => ({
|
||||
scholarshipTypes.value = types.map((type) => ({
|
||||
...type,
|
||||
hasQuota: type.hasQuota !== undefined ? type.hasQuota : true,
|
||||
totalQuota: type.totalQuota || 0,
|
||||
@@ -497,7 +442,7 @@ const handleScholarshipTypeChange = () => {
|
||||
// 学生选择变更处理
|
||||
const handleStudentSelectionChange = (selection) => {
|
||||
selectedStudents.value = selection;
|
||||
form.studentIds = selection.map(student => student.id);
|
||||
form.studentIds = selection.map((student) => student.id);
|
||||
};
|
||||
|
||||
// 加载申请详情(编辑模式)
|
||||
@@ -546,13 +491,13 @@ const submitForm = async () => {
|
||||
if (form.id) {
|
||||
await updateScholarshipApplication(submitData);
|
||||
ElMessage.success('更新成功');
|
||||
} else {
|
||||
} else {
|
||||
// 使用班主任批量申请接口
|
||||
await batchSubmitByTeacher({
|
||||
batchId: form.batchId,
|
||||
scholarshipTypeId: form.scholarshipTypeId,
|
||||
classId: classInfo.classId,
|
||||
studentApplications: form.studentIds.map(studentId => ({
|
||||
studentApplications: form.studentIds.map((studentId) => ({
|
||||
studentId,
|
||||
applicationType: form.applicationType,
|
||||
applicationReason: form.applicationReason,
|
||||
@@ -562,13 +507,13 @@ const submitForm = async () => {
|
||||
ElMessage.success('申请提交成功');
|
||||
}
|
||||
|
||||
goBack();
|
||||
} catch (error) {
|
||||
goBack();
|
||||
} catch (error) {
|
||||
console.error('提交失败:', error);
|
||||
ElMessage.error('提交失败');
|
||||
} finally {
|
||||
submitLoading.value = false;
|
||||
}
|
||||
} finally {
|
||||
submitLoading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 返回
|
||||
|
||||
@@ -5,41 +5,17 @@
|
||||
<el-col :span="24" class="search-container">
|
||||
<el-form :model="queryParams" ref="queryFormRef" :inline="true" v-show="showSearch" label-width="80px">
|
||||
<el-form-item label="学生姓名" prop="studentName">
|
||||
<el-input
|
||||
v-model="queryParams.studentName"
|
||||
placeholder="请输入学生姓名"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.studentName" placeholder="请输入学生姓名" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<<<<<<< HEAD
|
||||
<el-form-item label="学号" prop="studentNo">
|
||||
<el-input
|
||||
v-model="queryParams.studentNo"
|
||||
=======
|
||||
<el-form-item label="学号" prop="studentCode">
|
||||
<el-input
|
||||
v-model="queryParams.studentCode"
|
||||
>>>>>>> 4b9dbe40fb94a83d379f7d16211dec6d78c23755
|
||||
placeholder="请输入学号"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.studentNo" placeholder="请输入学号" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<<<<<<< HEAD
|
||||
<el-form-item label="申请状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择申请状态" clearable>
|
||||
<el-option label="草稿" value="draft" />
|
||||
<el-option label="待审核" value="waiting" />
|
||||
<el-option label="已完成" value="complete" />
|
||||
<el-option label="已拒绝" value="rejected" />
|
||||
=======
|
||||
<el-form-item label="申请状态" prop="applicationStatus">
|
||||
<el-select v-model="queryParams.applicationStatus" placeholder="请选择申请状态" clearable>
|
||||
<el-option label="草稿" value="draft" />
|
||||
<el-option label="已提交" value="submitted" />
|
||||
<el-option label="已审核" value="reviewed" />
|
||||
>>>>>>> 4b9dbe40fb94a83d379f7d16211dec6d78c23755
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
@@ -53,23 +29,12 @@
|
||||
<el-col :span="24">
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['jcbt:scholarshipApplication:add']"
|
||||
>班主任批量申请</el-button>
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['jcbt:scholarshipApplication:add']">班主任批量申请</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="Edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate()"
|
||||
v-hasPermi="['jcbt:scholarshipApplication:edit']"
|
||||
>修改</el-button>
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['jcbt:scholarshipApplication:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
@@ -79,7 +44,8 @@
|
||||
:disabled="multiple"
|
||||
@click="handleDelete()"
|
||||
v-hasPermi="['jcbt:scholarshipApplication:remove']"
|
||||
>删除</el-button>
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
@@ -89,10 +55,9 @@
|
||||
<el-col :span="24">
|
||||
<el-table v-loading="loading" :data="applicationList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<<<<<<< HEAD
|
||||
<el-table-column label="学号" align="center" prop="studentNo" min-width="120" />
|
||||
<el-table-column label="学生姓名" align="center" prop="studentName" min-width="100" />
|
||||
<el-table-column label="学院" align="center" prop="collegeName" min-width="120" />
|
||||
<el-table-column label="学院" align="center" prop="deptName" min-width="120" />
|
||||
<el-table-column label="专业" align="center" prop="majorName" min-width="120" />
|
||||
<el-table-column label="班级" align="center" prop="className" min-width="120" />
|
||||
<el-table-column label="奖学金类型" align="center" prop="scholarshipTypeName" min-width="120" />
|
||||
@@ -119,41 +84,11 @@
|
||||
<el-table-column label="申请时间" align="center" prop="createTime" min-width="160">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
||||
=======
|
||||
<el-table-column label="学号" align="center" prop="studentCode" min-width="120" />
|
||||
<el-table-column label="学生姓名" align="center" prop="studentName" min-width="100" />
|
||||
<el-table-column label="班级" align="center" prop="className" min-width="120" />
|
||||
<el-table-column label="奖学金类型" align="center" prop="scholarshipType" min-width="120" />
|
||||
<el-table-column label="等级" align="center" prop="scholarshipLevel" min-width="80" />
|
||||
<el-table-column label="金额" align="center" prop="amount" min-width="100">
|
||||
<template #default="scope">
|
||||
<span class="text-primary font-bold">¥{{ scope.row.amount }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="申请状态" align="center" prop="applicationStatus" min-width="100">
|
||||
<template #default="scope">
|
||||
<el-tag v-if="scope.row.applicationStatus === 'draft'" type="info">草稿</el-tag>
|
||||
<el-tag v-else-if="scope.row.applicationStatus === 'submitted'" type="warning">已提交</el-tag>
|
||||
<el-tag v-else-if="scope.row.applicationStatus === 'reviewed'" type="success">已审核</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="审核状态" align="center" prop="auditStatus" min-width="100">
|
||||
<template #default="scope">
|
||||
<el-tag v-if="scope.row.auditStatus === 'pending'" type="warning">待审核</el-tag>
|
||||
<el-tag v-else-if="scope.row.auditStatus === 'approved'" type="success">通过</el-tag>
|
||||
<el-tag v-else-if="scope.row.auditStatus === 'rejected'" type="danger">拒绝</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="申请时间" align="center" prop="applicationTime" min-width="160">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.applicationTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
||||
>>>>>>> 4b9dbe40fb94a83d379f7d16211dec6d78c23755
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="160">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<<<<<<< HEAD
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@@ -161,24 +96,21 @@
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['jcbt:scholarshipApplication:edit']"
|
||||
></el-button>
|
||||
=======
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['jcbt:scholarshipApplication:edit']"></el-button>
|
||||
>>>>>>> 4b9dbe40fb94a83d379f7d16211dec6d78c23755
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['jcbt:scholarshipApplication:remove']"></el-button>
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
icon="Delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['jcbt:scholarshipApplication:remove']"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
@@ -191,12 +123,7 @@
|
||||
<span>第一步:选择申报批次</span>
|
||||
</template>
|
||||
<el-form-item label="申报批次" prop="batchId" required>
|
||||
<el-select
|
||||
v-model="selectedBatch"
|
||||
placeholder="请选择申报批次"
|
||||
@change="handleBatchChange"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-select v-model="selectedBatch" placeholder="请选择申报批次" @change="handleBatchChange" style="width: 100%">
|
||||
<el-option
|
||||
v-for="batch in batchList"
|
||||
:key="batch.id"
|
||||
@@ -213,13 +140,7 @@
|
||||
<p><strong>申请时间:</strong>{{ selectedBatch.startTime }} 至 {{ selectedBatch.endTime }}</p>
|
||||
<p><strong>可申请奖学金类型:</strong></p>
|
||||
<div class="mt-2">
|
||||
<el-tag
|
||||
v-for="type in availableScholarshipTypes"
|
||||
:key="type.id"
|
||||
class="mr-2 mb-2"
|
||||
<<<<<<< HEAD
|
||||
:type="getQuotaStatusType(type)"
|
||||
>
|
||||
<el-tag v-for="type in availableScholarshipTypes" :key="type.id" class="mr-2 mb-2" :type="getQuotaStatusType(type)">
|
||||
<div class="flex flex-col">
|
||||
<span>{{ type.name }} - {{ type.levelType }} (¥{{ type.amount }})</span>
|
||||
<div class="text-xs mt-1">
|
||||
@@ -247,23 +168,11 @@
|
||||
剩余: {{ getRemainingQuota(type) === 999 ? '无限制' : getRemainingQuota(type) }}
|
||||
</span>
|
||||
</div>
|
||||
<div v-if="getSelectedCount(type) > 0 && getRemainingQuota(type) === 0" class="text-red-600 font-medium mt-1">
|
||||
⚠️ 名额已满
|
||||
</div>
|
||||
<div v-if="getSelectedCount(type) > 0 && getRemainingQuota(type) === 0" class="text-red-600 font-medium mt-1">⚠️ 名额已满</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-2 text-xs text-gray-600">
|
||||
总选择学生数: {{ selectedStudents.length }} 人
|
||||
</div>
|
||||
<div class="mt-2 text-xs text-gray-600">总选择学生数: {{ selectedStudents.length }} 人</div>
|
||||
</div>
|
||||
=======
|
||||
type="success"
|
||||
>
|
||||
{{ type.name }} - {{ type.levelType }} (¥{{ type.amount }})
|
||||
</el-tag>
|
||||
</div>
|
||||
</div>
|
||||
>>>>>>> 4b9dbe40fb94a83d379f7d16211dec6d78c23755
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
@@ -302,20 +211,12 @@
|
||||
<div class="flex justify-between items-center">
|
||||
<span>第三步:选择申请学生</span>
|
||||
<div class="flex items-center space-x-4">
|
||||
<el-input
|
||||
v-model="studentKeyword"
|
||||
placeholder="搜索学生姓名或学号"
|
||||
@input="filterStudents"
|
||||
style="width: 200px"
|
||||
clearable
|
||||
>
|
||||
<el-input v-model="studentKeyword" placeholder="搜索学生姓名或学号" @input="filterStudents" style="width: 200px" clearable>
|
||||
<template #prefix>
|
||||
<el-icon><Search /></el-icon>
|
||||
</template>
|
||||
</el-input>
|
||||
<div class="text-sm text-gray-600">
|
||||
已选择:{{ selectedStudents.length }} 人
|
||||
</div>
|
||||
<div class="text-sm text-gray-600">已选择:{{ selectedStudents.length }} 人</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -333,18 +234,10 @@
|
||||
:class="{ 'border-blue-500 bg-blue-50': isStudentSelected(student.id) }"
|
||||
>
|
||||
<div class="flex items-start space-x-4">
|
||||
<el-checkbox
|
||||
:model-value="isStudentSelected(student.id)"
|
||||
<<<<<<< HEAD
|
||||
@change="(val) => toggleStudentSelection(student, !!val)"
|
||||
=======
|
||||
@change="toggleStudentSelection(student, $event)"
|
||||
>>>>>>> 4b9dbe40fb94a83d379f7d16211dec6d78c23755
|
||||
/>
|
||||
<el-checkbox :model-value="isStudentSelected(student.id)" @change="(val) => toggleStudentSelection(student, !!val)" />
|
||||
<div class="flex-1">
|
||||
<div class="student-basic-info flex items-center space-x-4 mb-2">
|
||||
<span class="font-bold">{{ student.studentName }}</span>
|
||||
<<<<<<< HEAD
|
||||
<span class="text-gray-600">{{ student.studentNo }}</span>
|
||||
<span class="text-gray-500">{{ student.gender }}</span>
|
||||
<span class="text-gray-500">{{ student.phone }}</span>
|
||||
@@ -355,12 +248,6 @@
|
||||
<span v-if="student.className">{{ student.className }}</span>
|
||||
<span v-if="student.grade">{{ student.grade }}级</span>
|
||||
</div>
|
||||
=======
|
||||
<span class="text-gray-600">{{ student.studentCode }}</span>
|
||||
<span class="text-gray-500">{{ student.gender }}</span>
|
||||
<span class="text-gray-500">{{ student.phone }}</span>
|
||||
</div>
|
||||
>>>>>>> 4b9dbe40fb94a83d379f7d16211dec6d78c23755
|
||||
|
||||
<div v-if="isStudentSelected(student.id)" class="scholarship-selection mt-3 p-3 bg-gray-50 rounded">
|
||||
<div class="grid grid-cols-3 gap-4">
|
||||
@@ -377,32 +264,17 @@
|
||||
:key="type.id"
|
||||
:label="`${type.name} (¥${type.amount})`"
|
||||
:value="type"
|
||||
<<<<<<< HEAD
|
||||
:disabled="isScholarshipTypeDisabled(student, type)"
|
||||
=======
|
||||
>>>>>>> 4b9dbe40fb94a83d379f7d16211dec6d78c23755
|
||||
/>
|
||||
</el-select>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-medium mb-1">等级</label>
|
||||
<el-input
|
||||
v-model="student.selectedLevel"
|
||||
<<<<<<< HEAD
|
||||
:value="String(student.selectedScholarshipType?.levelType || '')"
|
||||
=======
|
||||
:value="student.selectedScholarshipType?.levelType || ''"
|
||||
>>>>>>> 4b9dbe40fb94a83d379f7d16211dec6d78c23755
|
||||
readonly
|
||||
/>
|
||||
<el-input v-model="student.selectedLevel" :value="String(student.selectedScholarshipType?.levelType || '')" readonly />
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-medium mb-1">金额(元)</label>
|
||||
<el-input
|
||||
v-model="student.selectedAmount"
|
||||
:value="student.selectedScholarshipType?.amount || ''"
|
||||
readonly
|
||||
/>
|
||||
<el-input v-model="student.selectedAmount" :value="student.selectedScholarshipType?.amount || ''" readonly />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -411,21 +283,14 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="filteredStudents.length === 0" class="text-center text-gray-500 py-8">
|
||||
暂无学生信息,请检查班级设置
|
||||
</div>
|
||||
<div v-if="filteredStudents.length === 0" class="text-center text-gray-500 py-8">暂无学生信息,请检查班级设置</div>
|
||||
</el-card>
|
||||
</el-form>
|
||||
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="dialog.visible = false">取 消</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="submitBatchApplication"
|
||||
:disabled="selectedStudents.length === 0"
|
||||
:loading="submitLoading"
|
||||
>
|
||||
<el-button type="primary" @click="submitBatchApplication" :disabled="selectedStudents.length === 0" :loading="submitLoading">
|
||||
提交申请 ({{ selectedStudents.length }}人)
|
||||
</el-button>
|
||||
</div>
|
||||
@@ -436,11 +301,8 @@
|
||||
|
||||
<script setup name="ScholarshipApplication" lang="ts">
|
||||
import { ref, reactive, computed, getCurrentInstance, ComponentInternalInstance, onMounted, nextTick } from 'vue';
|
||||
<<<<<<< HEAD
|
||||
import { useRouter } from 'vue-router';
|
||||
import { ElMessage } from 'element-plus';
|
||||
=======
|
||||
>>>>>>> 4b9dbe40fb94a83d379f7d16211dec6d78c23755
|
||||
import type { FormInstance, DateModelType } from 'element-plus';
|
||||
import { Search, Plus, Edit, Delete, Refresh } from '@element-plus/icons-vue';
|
||||
|
||||
@@ -455,57 +317,33 @@ import {
|
||||
getClassInfoByTeacher,
|
||||
getClassStudents,
|
||||
getScholarshipTypesByBatch,
|
||||
<<<<<<< HEAD
|
||||
getScholarshipTypesWithQuota,
|
||||
=======
|
||||
>>>>>>> 4b9dbe40fb94a83d379f7d16211dec6d78c23755
|
||||
batchSubmitByTeacher
|
||||
} from '@/api/jcbt/scholarshipApplication';
|
||||
|
||||
import {
|
||||
listScholarshipBatch,
|
||||
getScholarshipBatchByStatus
|
||||
} from '@/api/jcbt/scholarshipBatch';
|
||||
import { listScholarshipBatch, getScholarshipBatchByStatus } from '@/api/jcbt/scholarshipBatch';
|
||||
|
||||
<<<<<<< HEAD
|
||||
// 导入用户状态管理
|
||||
import { useUserStore } from '@/store/modules/user';
|
||||
|
||||
// 导入路由
|
||||
const router = useRouter();
|
||||
|
||||
=======
|
||||
// 导入通用类型
|
||||
import type { PageQuery } from '@/utils/ruoyi';
|
||||
|
||||
// 导入用户状态管理
|
||||
import { useUserStore } from '@/store/modules/user';
|
||||
|
||||
>>>>>>> 4b9dbe40fb94a83d379f7d16211dec6d78c23755
|
||||
// 本地类型定义
|
||||
interface ScholarshipApplicationVO {
|
||||
id?: number | string;
|
||||
batchId?: number | string;
|
||||
<<<<<<< HEAD
|
||||
studentId?: string | number;
|
||||
studentName?: string;
|
||||
studentNo?: string;
|
||||
=======
|
||||
studentId?: string;
|
||||
studentName?: string;
|
||||
studentCode?: string;
|
||||
>>>>>>> 4b9dbe40fb94a83d379f7d16211dec6d78c23755
|
||||
classId?: number | string;
|
||||
scholarshipTypeId?: number | string;
|
||||
scholarshipLevel?: string;
|
||||
amount?: number;
|
||||
applicationStatus?: string;
|
||||
auditStatus?: string;
|
||||
<<<<<<< HEAD
|
||||
currentStatus?: string;
|
||||
status?: string; // 前端兼容字段,与currentStatus保持一致
|
||||
=======
|
||||
>>>>>>> 4b9dbe40fb94a83d379f7d16211dec6d78c23755
|
||||
status?: string; // 前端兼容字段,与currentStatus保持一致
|
||||
applicationTime?: string;
|
||||
createTime?: string;
|
||||
}
|
||||
@@ -514,7 +352,6 @@ interface QueryParams {
|
||||
pageNum: number;
|
||||
pageSize: number;
|
||||
studentName?: string;
|
||||
<<<<<<< HEAD
|
||||
studentNo?: string;
|
||||
status?: string;
|
||||
}
|
||||
@@ -534,15 +371,6 @@ interface ScholarshipApplicationQuery {
|
||||
studentNo?: string;
|
||||
studentName?: string;
|
||||
applicantId?: string | number;
|
||||
=======
|
||||
studentCode?: string;
|
||||
status?: string;
|
||||
}
|
||||
|
||||
interface BatchQuery {
|
||||
pageNum?: number;
|
||||
pageSize?: number;
|
||||
>>>>>>> 4b9dbe40fb94a83d379f7d16211dec6d78c23755
|
||||
status?: string;
|
||||
}
|
||||
|
||||
@@ -557,15 +385,6 @@ interface ScholarshipBatchVO {
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
interface ScholarshipBatchQuery {
|
||||
pageNum?: number;
|
||||
pageSize?: number;
|
||||
status?: string;
|
||||
}
|
||||
|
||||
>>>>>>> 4b9dbe40fb94a83d379f7d16211dec6d78c23755
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
|
||||
// 用户状态管理
|
||||
@@ -585,11 +404,7 @@ const queryParams = ref<QueryParams>({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
studentName: '',
|
||||
<<<<<<< HEAD
|
||||
studentNo: '',
|
||||
=======
|
||||
studentCode: '',
|
||||
>>>>>>> 4b9dbe40fb94a83d379f7d16211dec6d78c23755
|
||||
status: ''
|
||||
});
|
||||
|
||||
@@ -650,7 +465,6 @@ const rules = reactive({
|
||||
/** 查询奖学金申请列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
<<<<<<< HEAD
|
||||
const res = await listScholarshipApplication(queryParams.value);
|
||||
console.log('=== API响应调试 ===');
|
||||
console.log('完整响应:', res);
|
||||
@@ -658,23 +472,7 @@ const getList = async () => {
|
||||
console.log('第一条记录:', res.rows?.[0]);
|
||||
applicationList.value = res.rows || [];
|
||||
total.value = res.total || 0;
|
||||
loading.value = false;
|
||||
=======
|
||||
try {
|
||||
const res: any = await listScholarshipApplication(queryParams.value);
|
||||
// 处理响应数据结构
|
||||
if (res.data) {
|
||||
applicationList.value = res.data.rows || res.data.list || res.data || [];
|
||||
total.value = res.data.total || 0;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取列表失败:', error);
|
||||
applicationList.value = [];
|
||||
total.value = 0;
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
>>>>>>> 4b9dbe40fb94a83d379f7d16211dec6d78c23755
|
||||
loading.value = false;
|
||||
};
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
@@ -727,7 +525,7 @@ const resetBatchForm = () => {
|
||||
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: ScholarshipApplicationVO[]) => {
|
||||
ids.value = selection.map(item => item.id);
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length !== 1;
|
||||
multiple.value = !selection.length;
|
||||
};
|
||||
@@ -736,7 +534,7 @@ const handleSelectionChange = (selection: ScholarshipApplicationVO[]) => {
|
||||
const handleAdd = async () => {
|
||||
resetBatchForm();
|
||||
dialog.value.visible = true;
|
||||
dialog.value.title = "班主任批量申请奖学金";
|
||||
dialog.value.title = '班主任批量申请奖学金';
|
||||
|
||||
// 获取批次列表
|
||||
await getBatchList();
|
||||
@@ -747,7 +545,6 @@ const handleAdd = async () => {
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = async (row?: ScholarshipApplicationVO) => {
|
||||
<<<<<<< HEAD
|
||||
if (!row || !row.id) {
|
||||
ElMessage.error('请选择要修改的申请记录');
|
||||
return;
|
||||
@@ -761,9 +558,6 @@ const handleUpdate = async (row?: ScholarshipApplicationVO) => {
|
||||
|
||||
// 跳转到编辑页面
|
||||
router.push(`/jcbt/scholarship/application/form/${row.id}`);
|
||||
=======
|
||||
console.log('修改功能暂未实现', row);
|
||||
>>>>>>> 4b9dbe40fb94a83d379f7d16211dec6d78c23755
|
||||
};
|
||||
|
||||
/** 删除按钮操作 */
|
||||
@@ -844,11 +638,7 @@ const getTeacherClassInfo = async () => {
|
||||
/** 设置默认的班级信息 */
|
||||
const setDefaultClassInfo = () => {
|
||||
classInfo.value = {
|
||||
<<<<<<< HEAD
|
||||
teacherId: String(userStore.userId || ''),
|
||||
=======
|
||||
teacherId: userStore.userId || '',
|
||||
>>>>>>> 4b9dbe40fb94a83d379f7d16211dec6d78c23755
|
||||
collegeName: '',
|
||||
majorName: '',
|
||||
className: '',
|
||||
@@ -910,7 +700,6 @@ const handleBatchChange = async (batch: ScholarshipBatchVO) => {
|
||||
if (batch) {
|
||||
form.value.batchId = batch.id;
|
||||
|
||||
<<<<<<< HEAD
|
||||
// 获取该批次可申请的奖学金类型(带名额信息)
|
||||
try {
|
||||
console.log('🎯 获取奖学金类型,批次ID:', batch.id, '班级ID:', classInfo.value.classId);
|
||||
@@ -928,20 +717,11 @@ const handleBatchChange = async (batch: ScholarshipBatchVO) => {
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('❌ 获取奖学金类型失败:', error);
|
||||
=======
|
||||
// 获取该批次可申请的奖学金类型
|
||||
try {
|
||||
const res: any = await getScholarshipTypesByBatch(batch.id);
|
||||
availableScholarshipTypes.value = res.data || [];
|
||||
} catch (error) {
|
||||
console.error('获取奖学金类型失败:', error);
|
||||
>>>>>>> 4b9dbe40fb94a83d379f7d16211dec6d78c23755
|
||||
availableScholarshipTypes.value = [];
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
<<<<<<< HEAD
|
||||
/** 获取名额状态对应的标签类型 */
|
||||
const getQuotaStatusType = (type: any) => {
|
||||
if (!type.hasQuota && type.quotaStatus === 'unlimited') {
|
||||
@@ -949,9 +729,12 @@ const getQuotaStatusType = (type: any) => {
|
||||
}
|
||||
|
||||
switch (type.quotaStatus) {
|
||||
case 'available': return 'success';
|
||||
case 'full': return 'warning';
|
||||
default: return 'danger';
|
||||
case 'available':
|
||||
return 'success';
|
||||
case 'full':
|
||||
return 'warning';
|
||||
default:
|
||||
return 'danger';
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1032,8 +815,8 @@ const isScholarshipTypeSelectable = (type: any) => {
|
||||
const getRemainingQuota = (scholarshipType: any) => {
|
||||
if (!scholarshipType) return 0;
|
||||
|
||||
const selectedCount = selectedStudents.value.filter((s: any) =>
|
||||
s.selectedScholarshipType && s.selectedScholarshipType.id === scholarshipType.id
|
||||
const selectedCount = selectedStudents.value.filter(
|
||||
(s: any) => s.selectedScholarshipType && s.selectedScholarshipType.id === scholarshipType.id
|
||||
).length;
|
||||
|
||||
// 根据后端实际返回的数据结构进行判断
|
||||
@@ -1065,9 +848,7 @@ const getRemainingQuota = (scholarshipType: any) => {
|
||||
/** 获取已选择特定奖学金类型的学生数量 */
|
||||
const getSelectedCount = (scholarshipType: any) => {
|
||||
if (!scholarshipType) return 0;
|
||||
return selectedStudents.value.filter((s: any) =>
|
||||
s.selectedScholarshipType && s.selectedScholarshipType.id === scholarshipType.id
|
||||
).length;
|
||||
return selectedStudents.value.filter((s: any) => s.selectedScholarshipType && s.selectedScholarshipType.id === scholarshipType.id).length;
|
||||
};
|
||||
|
||||
/** 检查学生是否可以选择特定奖学金类型 */
|
||||
@@ -1103,20 +884,13 @@ const isScholarshipTypeDisabled = (student: any, scholarshipType: any) => {
|
||||
return false;
|
||||
};
|
||||
|
||||
=======
|
||||
>>>>>>> 4b9dbe40fb94a83d379f7d16211dec6d78c23755
|
||||
/** 筛选学生 */
|
||||
const filterStudents = () => {
|
||||
if (!studentKeyword.value) {
|
||||
filteredStudents.value = classStudents.value;
|
||||
} else {
|
||||
filteredStudents.value = classStudents.value.filter((student: any) =>
|
||||
student.studentName?.includes(studentKeyword.value) ||
|
||||
<<<<<<< HEAD
|
||||
student.studentNo?.includes(studentKeyword.value)
|
||||
=======
|
||||
student.studentCode?.includes(studentKeyword.value)
|
||||
>>>>>>> 4b9dbe40fb94a83d379f7d16211dec6d78c23755
|
||||
filteredStudents.value = classStudents.value.filter(
|
||||
(student: any) => student.studentName?.includes(studentKeyword.value) || student.studentNo?.includes(studentKeyword.value)
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -1131,7 +905,6 @@ const toggleStudentSelection = (student: any, checked: boolean) => {
|
||||
console.log('🔄 切换学生选择状态:', { student, checked });
|
||||
|
||||
if (checked) {
|
||||
<<<<<<< HEAD
|
||||
// 直接使用原始学生对象,初始化奖学金相关字段
|
||||
student.selectedScholarshipType = null;
|
||||
student.selectedLevel = '';
|
||||
@@ -1150,22 +923,12 @@ const toggleStudentSelection = (student: any, checked: boolean) => {
|
||||
ElMessage.warning(`${scholarshipType.name} 名额已满,无法自动选择`);
|
||||
}
|
||||
}
|
||||
=======
|
||||
selectedStudents.value.push({
|
||||
...student,
|
||||
selectedScholarshipType: null,
|
||||
selectedLevel: '',
|
||||
selectedAmount: ''
|
||||
});
|
||||
console.log('✅ 添加学生到选择列表:', student.studentName);
|
||||
>>>>>>> 4b9dbe40fb94a83d379f7d16211dec6d78c23755
|
||||
} else {
|
||||
const index = selectedStudents.value.findIndex((s: any) => s.id === student.id);
|
||||
if (index > -1) {
|
||||
selectedStudents.value.splice(index, 1);
|
||||
console.log('❌ 从选择列表移除学生:', student.studentName);
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
// 清理原始学生对象的奖学金相关字段
|
||||
student.selectedScholarshipType = null;
|
||||
student.selectedLevel = '';
|
||||
@@ -1178,11 +941,6 @@ const toggleStudentSelection = (student: any, checked: boolean) => {
|
||||
nextTick(() => {
|
||||
// 强制更新响应式数据
|
||||
});
|
||||
=======
|
||||
}
|
||||
|
||||
console.log('📊 当前选择的学生数量:', selectedStudents.value.length);
|
||||
>>>>>>> 4b9dbe40fb94a83d379f7d16211dec6d78c23755
|
||||
};
|
||||
|
||||
/** 全选学生 */
|
||||
@@ -1211,7 +969,6 @@ const clearSelectedStudents = () => {
|
||||
|
||||
/** 更新奖学金信息 */
|
||||
const updateScholarshipInfo = (student: any) => {
|
||||
<<<<<<< HEAD
|
||||
console.log('🔄 更新奖学金信息:', { studentName: student.studentName, selectedType: student.selectedScholarshipType?.name });
|
||||
|
||||
if (student.selectedScholarshipType) {
|
||||
@@ -1234,7 +991,8 @@ const updateScholarshipInfo = (student: any) => {
|
||||
selectedCount: getSelectedCount(student.selectedScholarshipType)
|
||||
});
|
||||
|
||||
if (remaining <= 5 && remaining > 0) { // 名额紧张时提醒
|
||||
if (remaining <= 5 && remaining > 0) {
|
||||
// 名额紧张时提醒
|
||||
ElMessage.info(`${student.selectedScholarshipType.name} 剩余名额:${remaining}`);
|
||||
}
|
||||
}
|
||||
@@ -1242,29 +1000,20 @@ const updateScholarshipInfo = (student: any) => {
|
||||
// 清空选择时也要清空相关字段
|
||||
student.selectedLevel = '';
|
||||
student.selectedAmount = '';
|
||||
=======
|
||||
if (student.selectedScholarshipType) {
|
||||
student.selectedLevel = student.selectedScholarshipType.level;
|
||||
student.selectedAmount = student.selectedScholarshipType.amount;
|
||||
>>>>>>> 4b9dbe40fb94a83d379f7d16211dec6d78c23755
|
||||
}
|
||||
};
|
||||
|
||||
/** 提交批量申请 */
|
||||
const submitBatchApplication = async () => {
|
||||
try {
|
||||
<<<<<<< HEAD
|
||||
console.log('🚀 开始批量申请提交流程');
|
||||
console.log('📊 当前选择的学生数据:', selectedStudents.value);
|
||||
console.log('📋 可用奖学金类型数据:', availableScholarshipTypes.value);
|
||||
|
||||
=======
|
||||
>>>>>>> 4b9dbe40fb94a83d379f7d16211dec6d78c23755
|
||||
// 表单验证
|
||||
await scholarshipApplicationRef.value?.validate();
|
||||
|
||||
if (selectedStudents.value.length === 0) {
|
||||
<<<<<<< HEAD
|
||||
console.error('❌ 请至少选择一名学生');
|
||||
return;
|
||||
}
|
||||
@@ -1281,24 +1030,11 @@ const submitBatchApplication = async () => {
|
||||
|
||||
console.log('✅ 奖学金类型选择验证通过');
|
||||
|
||||
=======
|
||||
console.error('请至少选择一名学生');
|
||||
return;
|
||||
}
|
||||
|
||||
// 检查每个学生是否都选择了奖学金类型
|
||||
const invalidStudents = selectedStudents.value.filter((s: any) => !s.selectedScholarshipType);
|
||||
if (invalidStudents.length > 0) {
|
||||
console.error('请为所有选择的学生指定奖学金类型');
|
||||
return;
|
||||
}
|
||||
|
||||
>>>>>>> 4b9dbe40fb94a83d379f7d16211dec6d78c23755
|
||||
submitLoading.value = true;
|
||||
|
||||
// 检查是否所有学生都选择了相同的奖学金类型(根据后端接口要求)
|
||||
const scholarshipTypeId = selectedStudents.value[0].selectedScholarshipType.id;
|
||||
const allSameType = selectedStudents.value.every(s => s.selectedScholarshipType.id === scholarshipTypeId);
|
||||
const allSameType = selectedStudents.value.every((s) => s.selectedScholarshipType.id === scholarshipTypeId);
|
||||
|
||||
if (!allSameType) {
|
||||
console.error('批量申请要求所有学生选择相同的奖学金类型');
|
||||
@@ -1309,20 +1045,12 @@ const submitBatchApplication = async () => {
|
||||
const batchId = form.value.batchId;
|
||||
const classId = classInfo.value.classId;
|
||||
const studentApplications = selectedStudents.value.map((s: any) => ({
|
||||
<<<<<<< HEAD
|
||||
studentId: String(s.studentId || s.id),
|
||||
studentName: s.studentName,
|
||||
studentNo: s.studentNo,
|
||||
scholarshipTypeId: s.selectedScholarshipType.id,
|
||||
deptId: classInfo.value.deptId,
|
||||
applicationReason: `班主任批量申请 - ${s.selectedScholarshipType.name}`,
|
||||
=======
|
||||
studentId: s.studentId,
|
||||
studentName: s.studentName,
|
||||
studentCode: s.studentCode,
|
||||
scholarshipTypeId: s.selectedScholarshipType.id,
|
||||
applicationReason: `班主任批量申请 - ${s.selectedScholarshipType.name}`,
|
||||
>>>>>>> 4b9dbe40fb94a83d379f7d16211dec6d78c23755
|
||||
applicationDescription: `申请等级:${s.selectedScholarshipType.levelType},金额:${s.selectedScholarshipType.amount}元`
|
||||
}));
|
||||
|
||||
@@ -1330,21 +1058,14 @@ const submitBatchApplication = async () => {
|
||||
await batchSubmitByTeacher(batchId, scholarshipTypeId, classId, studentApplications);
|
||||
|
||||
console.log('批量申请提交成功');
|
||||
<<<<<<< HEAD
|
||||
ElMessage.success('批量申请提交成功');
|
||||
=======
|
||||
>>>>>>> 4b9dbe40fb94a83d379f7d16211dec6d78c23755
|
||||
dialog.value.visible = false;
|
||||
|
||||
// 刷新列表
|
||||
await getList();
|
||||
|
||||
} catch (error) {
|
||||
console.error('提交失败:', error);
|
||||
<<<<<<< HEAD
|
||||
ElMessage.error('提交失败,请重试');
|
||||
=======
|
||||
>>>>>>> 4b9dbe40fb94a83d379f7d16211dec6d78c23755
|
||||
} finally {
|
||||
submitLoading.value = false;
|
||||
}
|
||||
@@ -1470,7 +1191,6 @@ onMounted(() => {
|
||||
padding-top: 2rem;
|
||||
padding-bottom: 2rem;
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
|
||||
.flex-col {
|
||||
flex-direction: column;
|
||||
@@ -1531,6 +1251,4 @@ onMounted(() => {
|
||||
.flex-1 {
|
||||
flex: 1;
|
||||
}
|
||||
=======
|
||||
>>>>>>> 4b9dbe40fb94a83d379f7d16211dec6d78c23755
|
||||
</style>
|
||||
@@ -197,7 +197,7 @@
|
||||
<template #default="scope">
|
||||
<div v-if="scope.row.applyStartTime && scope.row.applyEndTime">
|
||||
<div>{{ parseTime(scope.row.applyStartTime, '{y}-{m}-{d}') }}</div>
|
||||
<div style="color: #909399; font-size: 12px;">至 {{ parseTime(scope.row.applyEndTime, '{y}-{m}-{d}') }}</div>
|
||||
<div style="color: #909399; font-size: 12px">至 {{ parseTime(scope.row.applyEndTime, '{y}-{m}-{d}') }}</div>
|
||||
</div>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
@@ -206,7 +206,7 @@
|
||||
<template #default="scope">
|
||||
<div v-if="scope.row.reviewStartTime && scope.row.reviewEndTime">
|
||||
<div>{{ parseTime(scope.row.reviewStartTime, '{y}-{m}-{d}') }}</div>
|
||||
<div style="color: #909399; font-size: 12px;">至 {{ parseTime(scope.row.reviewEndTime, '{y}-{m}-{d}') }}</div>
|
||||
<div style="color: #909399; font-size: 12px">至 {{ parseTime(scope.row.reviewEndTime, '{y}-{m}-{d}') }}</div>
|
||||
</div>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
@@ -407,16 +407,9 @@
|
||||
collapse-tags-tooltip
|
||||
:max-collapse-tags="3"
|
||||
>
|
||||
<el-option
|
||||
v-for="option in scholarshipTypeOptions"
|
||||
:key="option.value"
|
||||
:label="option.label"
|
||||
:value="option.value"
|
||||
/>
|
||||
<el-option v-for="option in scholarshipTypeOptions" :key="option.value" :label="option.label" :value="option.value" />
|
||||
</el-select>
|
||||
<div class="form-help-text">
|
||||
选择该批次支持申请的奖学金类型,可多选
|
||||
</div>
|
||||
<div class="form-help-text">选择该批次支持申请的奖学金类型,可多选</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -446,7 +439,6 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
@@ -512,15 +504,10 @@
|
||||
<el-descriptions-item label="审核结束时间">{{ parseTime(viewData.reviewEndTime) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="批次描述" :span="2">{{ viewData.description || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="奖学金类型" :span="2">
|
||||
<el-tag v-for="typeName in getScholarshipTypeNames(viewData.scholarshipTypeIds)"
|
||||
:key="typeName"
|
||||
type="primary"
|
||||
class="mr-2">
|
||||
<el-tag v-for="typeName in getScholarshipTypeNames(viewData.scholarshipTypeIds)" :key="typeName" type="primary" class="mr-2">
|
||||
{{ typeName }}
|
||||
</el-tag>
|
||||
<span v-if="!viewData.scholarshipTypeIds || viewData.scholarshipTypeIds.length === 0" class="text-gray-400">
|
||||
暂无关联奖学金类型
|
||||
</span>
|
||||
<span v-if="!viewData.scholarshipTypeIds || viewData.scholarshipTypeIds.length === 0" class="text-gray-400"> 暂无关联奖学金类型 </span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="通知内容" :span="2">{{ viewData.noticeContent || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="创建时间">{{ parseTime(viewData.createTime) }}</el-descriptions-item>
|
||||
@@ -546,7 +533,6 @@ import {
|
||||
} from '@/api/jcbt/scholarshipBatch';
|
||||
import { listScholarshipType, type ScholarshipTypeVO } from '@/api/jcbt/scholarshipType';
|
||||
|
||||
|
||||
const { proxy } = getCurrentInstance()!;
|
||||
const { sys_normal_disable } = toRefs<any>(proxy?.useDict('sys_normal_disable'));
|
||||
|
||||
@@ -610,36 +596,16 @@ const data = reactive<PageData<ScholarshipBatchForm, ScholarshipBatchQuery>>({
|
||||
createTime: ''
|
||||
},
|
||||
rules: {
|
||||
batchCode: [
|
||||
{ required: true, message: '批次编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
batchName: [
|
||||
{ required: true, message: '批次名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
academicYear: [
|
||||
{ required: true, message: '学年不能为空', trigger: 'change' }
|
||||
],
|
||||
semester: [
|
||||
{ required: true, message: '学期不能为空', trigger: 'change' }
|
||||
],
|
||||
batchType: [
|
||||
{ required: true, message: '批次类型不能为空', trigger: 'change' }
|
||||
],
|
||||
startTime: [
|
||||
{ required: true, message: '开始时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
endTime: [
|
||||
{ required: true, message: '结束时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
applyStartTime: [
|
||||
{ required: true, message: '申请开始时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
applyEndTime: [
|
||||
{ required: true, message: '申请结束时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
scholarshipTypeIds: [
|
||||
{ required: true, message: '请至少选择一个奖学金类型', trigger: 'change' }
|
||||
]
|
||||
batchCode: [{ required: true, message: '批次编码不能为空', trigger: 'blur' }],
|
||||
batchName: [{ required: true, message: '批次名称不能为空', trigger: 'blur' }],
|
||||
academicYear: [{ required: true, message: '学年不能为空', trigger: 'change' }],
|
||||
semester: [{ required: true, message: '学期不能为空', trigger: 'change' }],
|
||||
batchType: [{ required: true, message: '批次类型不能为空', trigger: 'change' }],
|
||||
startTime: [{ required: true, message: '开始时间不能为空', trigger: 'blur' }],
|
||||
endTime: [{ required: true, message: '结束时间不能为空', trigger: 'blur' }],
|
||||
applyStartTime: [{ required: true, message: '申请开始时间不能为空', trigger: 'blur' }],
|
||||
applyEndTime: [{ required: true, message: '申请结束时间不能为空', trigger: 'blur' }],
|
||||
scholarshipTypeIds: [{ required: true, message: '请至少选择一个奖学金类型', trigger: 'change' }]
|
||||
}
|
||||
});
|
||||
|
||||
@@ -669,8 +635,6 @@ const statistics = ref({
|
||||
// 奖学金类型选项
|
||||
const scholarshipTypeOptions = ref<Array<{ value: string | number; label: string }>>([]);
|
||||
|
||||
|
||||
|
||||
/** 查询批次列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
@@ -683,7 +647,7 @@ function getList() {
|
||||
queryParams.value.params = {};
|
||||
}
|
||||
|
||||
listScholarshipBatch(queryParams.value).then(response => {
|
||||
listScholarshipBatch(queryParams.value).then((response) => {
|
||||
batchList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
@@ -696,9 +660,9 @@ function getList() {
|
||||
/** 更新统计数据 */
|
||||
function updateStatistics() {
|
||||
statistics.value.totalBatches = batchList.value.length;
|
||||
statistics.value.activeBatches = batchList.value.filter(item => item.status === 'ACTIVE').length;
|
||||
statistics.value.draftBatches = batchList.value.filter(item => item.status === 'DRAFT').length;
|
||||
statistics.value.completedBatches = batchList.value.filter(item => item.status === 'COMPLETED').length;
|
||||
statistics.value.activeBatches = batchList.value.filter((item) => item.status === 'ACTIVE').length;
|
||||
statistics.value.draftBatches = batchList.value.filter((item) => item.status === 'DRAFT').length;
|
||||
statistics.value.completedBatches = batchList.value.filter((item) => item.status === 'COMPLETED').length;
|
||||
}
|
||||
|
||||
/** 获取奖学金类型选项 */
|
||||
@@ -742,7 +706,7 @@ function resetQuery() {
|
||||
|
||||
/** 多选框选中数据 */
|
||||
function handleSelectionChange(selection: ScholarshipBatchVO[]) {
|
||||
ids.value = selection.map(item => item.id!);
|
||||
ids.value = selection.map((item) => item.id!);
|
||||
single.value = selection.length !== 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
@@ -783,7 +747,7 @@ async function handleView(row: ScholarshipBatchVO) {
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
batchFormRef.value?.validate(async valid => {
|
||||
batchFormRef.value?.validate(async (valid) => {
|
||||
if (!valid) return;
|
||||
|
||||
buttonLoading.value = true;
|
||||
@@ -865,8 +829,8 @@ function reset() {
|
||||
function getScholarshipTypeNames(typeIds: Array<string | number> | undefined): string[] {
|
||||
if (!typeIds || typeIds.length === 0) return [];
|
||||
|
||||
return typeIds.map(id => {
|
||||
const option = scholarshipTypeOptions.value.find(opt => opt.value === id);
|
||||
return typeIds.map((id) => {
|
||||
const option = scholarshipTypeOptions.value.find((opt) => opt.value === id);
|
||||
return option ? option.label : `未知类型(${id})`;
|
||||
});
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -32,53 +32,25 @@
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item
|
||||
label="下一审核人"
|
||||
prop="nextReviewerId"
|
||||
v-if="form.action === 'approve' && needNextReviewer"
|
||||
>
|
||||
<el-form-item label="下一审核人" prop="nextReviewerId" v-if="form.action === 'approve' && needNextReviewer">
|
||||
<el-select v-model="form.nextReviewerId" placeholder="请选择下一审核人" style="width: 100%">
|
||||
<el-option
|
||||
v-for="reviewer in availableReviewers"
|
||||
:key="reviewer.userId"
|
||||
:label="reviewer.userName"
|
||||
:value="reviewer.userId"
|
||||
/>
|
||||
<el-option v-for="reviewer in availableReviewers" :key="reviewer.userId" :label="reviewer.userName" :value="reviewer.userId" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="审核意见" prop="reviewComment">
|
||||
<el-input
|
||||
v-model="form.reviewComment"
|
||||
type="textarea"
|
||||
:rows="4"
|
||||
:placeholder="getCommentPlaceholder()"
|
||||
show-word-limit
|
||||
maxlength="500"
|
||||
/>
|
||||
<el-input v-model="form.reviewComment" type="textarea" :rows="4" :placeholder="getCommentPlaceholder()" show-word-limit maxlength="500" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item v-if="form.action">
|
||||
<el-alert
|
||||
:title="getActionTip()"
|
||||
:type="getActionType()"
|
||||
:closable="false"
|
||||
show-icon
|
||||
/>
|
||||
<el-alert :title="getActionTip()" :type="getActionType()" :closable="false" show-icon />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="handleClose">取 消</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="handleConfirm"
|
||||
:loading="loading"
|
||||
:disabled="!form.action"
|
||||
>
|
||||
确 定
|
||||
</el-button>
|
||||
<el-button type="primary" @click="handleConfirm" :loading="loading" :disabled="!form.action"> 确 定 </el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
@@ -102,7 +74,7 @@ interface Emits {
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
visible: false,
|
||||
reviewData: () => ({} as ScholarshipReviewVo)
|
||||
reviewData: () => ({}) as ScholarshipReviewVo
|
||||
});
|
||||
|
||||
const emit = defineEmits<Emits>();
|
||||
@@ -133,9 +105,7 @@ const form = ref<ReviewActionForm>({
|
||||
|
||||
// 表单验证规则
|
||||
const rules = reactive({
|
||||
action: [
|
||||
{ required: true, message: '请选择审核操作', trigger: 'change' }
|
||||
],
|
||||
action: [{ required: true, message: '请选择审核操作', trigger: 'change' }],
|
||||
reviewComment: [
|
||||
{ required: true, message: '请输入审核意见', trigger: 'blur' },
|
||||
{ min: 5, message: '审核意见至少5个字符', trigger: 'blur' }
|
||||
@@ -159,14 +129,18 @@ const rules = reactive({
|
||||
const formRef = ref<ElFormInstance>();
|
||||
|
||||
// 监听数据变化
|
||||
watch(() => props.reviewData, (newData) => {
|
||||
if (newData && newData.reviewId) {
|
||||
form.value.reviewId = newData.reviewId;
|
||||
form.value.action = '' as any;
|
||||
form.value.reviewComment = '';
|
||||
form.value.nextReviewerId = undefined;
|
||||
}
|
||||
}, { immediate: true });
|
||||
watch(
|
||||
() => props.reviewData,
|
||||
(newData) => {
|
||||
if (newData && newData.reviewId) {
|
||||
form.value.reviewId = newData.reviewId;
|
||||
form.value.action = '' as any;
|
||||
form.value.reviewComment = '';
|
||||
form.value.nextReviewerId = undefined;
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
// 监听操作类型变化
|
||||
const handleActionChange = (action: string) => {
|
||||
|
||||
@@ -115,13 +115,7 @@
|
||||
|
||||
<!-- 表格区域 -->
|
||||
<div class="table-container">
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
border
|
||||
:data="historyList"
|
||||
style="width: 100%"
|
||||
class="scroll-table"
|
||||
>
|
||||
<el-table v-loading="loading" border :data="historyList" style="width: 100%" class="scroll-table">
|
||||
<el-table-column label="申请编号" align="center" prop="orderNo" width="140" show-overflow-tooltip fixed="left" />
|
||||
<el-table-column label="申请人" align="center" prop="applicantName" width="120" show-overflow-tooltip />
|
||||
<el-table-column label="奖学金类型" align="center" prop="scholarshipType" min-width="200" show-overflow-tooltip />
|
||||
@@ -178,13 +172,7 @@
|
||||
|
||||
<!-- 分页 -->
|
||||
<div class="pagination-container">
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
@@ -224,13 +212,7 @@
|
||||
|
||||
<div class="mt-4">
|
||||
<h4>审核意见</h4>
|
||||
<el-input
|
||||
v-model="detailDialog.data.reviewComment"
|
||||
type="textarea"
|
||||
:rows="4"
|
||||
readonly
|
||||
placeholder="无审核意见"
|
||||
/>
|
||||
<el-input v-model="detailDialog.data.reviewComment" type="textarea" :rows="4" readonly placeholder="无审核意见" />
|
||||
</div>
|
||||
|
||||
<div class="mt-4" v-if="detailDialog.data.attachments">
|
||||
@@ -327,7 +309,7 @@ const calculateStats = () => {
|
||||
returnedCount: 0
|
||||
};
|
||||
|
||||
historyList.value.forEach(item => {
|
||||
historyList.value.forEach((item) => {
|
||||
switch (item.auditStatus) {
|
||||
case 'APPROVED':
|
||||
stats.approvedCount++;
|
||||
|
||||
@@ -99,24 +99,14 @@
|
||||
<el-col :span="6">
|
||||
<el-form-item label="奖学金类型" prop="scholarshipTypeId">
|
||||
<el-select v-model="queryParams.scholarshipTypeId" placeholder="请选择奖学金类型" clearable style="width: 100%">
|
||||
<el-option
|
||||
v-for="type in scholarshipTypes"
|
||||
:key="type.id"
|
||||
:label="type.typeName"
|
||||
:value="type.id"
|
||||
/>
|
||||
<el-option v-for="type in scholarshipTypes" :key="type.id" :label="type.typeName" :value="type.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="申请批次" prop="batchId">
|
||||
<el-select v-model="queryParams.batchId" placeholder="请选择申请批次" clearable style="width: 100%">
|
||||
<el-option
|
||||
v-for="batch in scholarshipBatches"
|
||||
:key="batch.id"
|
||||
:label="batch.batchName"
|
||||
:value="batch.id"
|
||||
/>
|
||||
<el-option v-for="batch in scholarshipBatches" :key="batch.id" :label="batch.batchName" :value="batch.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -168,9 +158,7 @@
|
||||
<el-button type="success" plain icon="Check" :disabled="multiple" @click="handleBatchApprove" v-hasPermi="['jcbt:review:batchApprove']">
|
||||
批量通过
|
||||
</el-button>
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['jcbt:review:export']">
|
||||
导出
|
||||
</el-button>
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['jcbt:review:export']"> 导出 </el-button>
|
||||
<right-toolbar :showSearch="showSearch" @update:showSearch="showSearch = $event" @queryTable="getList"></right-toolbar>
|
||||
</div>
|
||||
</div>
|
||||
@@ -305,24 +293,17 @@
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page="queryParams.pageNum"
|
||||
:limit="queryParams.pageSize"
|
||||
@update:page="queryParams.pageNum = $event"
|
||||
@update:limit="queryParams.pageSize = $event"
|
||||
:page="queryParams.pageNum"
|
||||
:limit="queryParams.pageSize"
|
||||
@update:page="queryParams.pageNum = $event"
|
||||
@update:limit="queryParams.pageSize = $event"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<!-- 审核对话框 -->
|
||||
<el-drawer
|
||||
ref="drawerRef"
|
||||
v-model="reviewOpen"
|
||||
title="奖学金申请审核"
|
||||
direction="rtl"
|
||||
size="50%"
|
||||
:before-close="handleReviewClose"
|
||||
>
|
||||
<el-drawer ref="drawerRef" v-model="reviewOpen" title="奖学金申请审核" direction="rtl" size="50%" :before-close="handleReviewClose">
|
||||
<template #default>
|
||||
<div class="drawer-content">
|
||||
<!-- 申请信息展示 -->
|
||||
@@ -375,14 +356,7 @@
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="审核意见" prop="reviewComment">
|
||||
<el-input
|
||||
v-model="reviewForm.reviewComment"
|
||||
type="textarea"
|
||||
placeholder="请输入审核意见"
|
||||
:rows="4"
|
||||
maxlength="500"
|
||||
show-word-limit
|
||||
/>
|
||||
<el-input v-model="reviewForm.reviewComment" type="textarea" placeholder="请输入审核意见" :rows="4" maxlength="500" show-word-limit />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
@@ -434,24 +408,24 @@
|
||||
</template>
|
||||
|
||||
<script setup name="ScholarshipReview">
|
||||
import { listScholarshipApplication, getScholarshipApplication, updateScholarshipApplication } from '@/api/jcbt/scholarshipApplication'
|
||||
import { listScholarshipType } from '@/api/jcbt/scholarshipType'
|
||||
import { listScholarshipBatch } from '@/api/jcbt/scholarshipBatch'
|
||||
import { listScholarshipApplication, getScholarshipApplication, updateScholarshipApplication } from '@/api/jcbt/scholarshipApplication';
|
||||
import { listScholarshipType } from '@/api/jcbt/scholarshipType';
|
||||
import { listScholarshipBatch } from '@/api/jcbt/scholarshipBatch';
|
||||
|
||||
const { proxy } = getCurrentInstance()
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
const reviewList = ref([])
|
||||
const reviewOpen = ref(false)
|
||||
const detailOpen = ref(false)
|
||||
const loading = ref(true)
|
||||
const showSearch = ref(true)
|
||||
const ids = ref([])
|
||||
const single = ref(true)
|
||||
const multiple = ref(true)
|
||||
const total = ref(0)
|
||||
const daterangeSubmitTime = ref([])
|
||||
const scholarshipTypes = ref([])
|
||||
const scholarshipBatches = ref([])
|
||||
const reviewList = ref([]);
|
||||
const reviewOpen = ref(false);
|
||||
const detailOpen = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const daterangeSubmitTime = ref([]);
|
||||
const scholarshipTypes = ref([]);
|
||||
const scholarshipBatches = ref([]);
|
||||
|
||||
// 统计数据
|
||||
const reviewStats = ref({
|
||||
@@ -459,7 +433,7 @@ const reviewStats = ref({
|
||||
approvedCount: 0,
|
||||
rejectedCount: 0,
|
||||
totalCount: 0
|
||||
})
|
||||
});
|
||||
|
||||
const data = reactive({
|
||||
queryParams: {
|
||||
@@ -478,120 +452,119 @@ const data = reactive({
|
||||
reviewForm: {},
|
||||
detailForm: {},
|
||||
reviewRules: {
|
||||
status: [
|
||||
{ required: true, message: "请选择审核结果", trigger: "change" }
|
||||
],
|
||||
reviewComment: [
|
||||
{ required: true, message: "请输入审核意见", trigger: "blur" }
|
||||
]
|
||||
status: [{ required: true, message: '请选择审核结果', trigger: 'change' }],
|
||||
reviewComment: [{ required: true, message: '请输入审核意见', trigger: 'blur' }]
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
const { queryParams, reviewForm, detailForm, reviewRules } = toRefs(data)
|
||||
const { queryParams, reviewForm, detailForm, reviewRules } = toRefs(data);
|
||||
|
||||
/** 初始化数据 */
|
||||
function initData() {
|
||||
// 加载奖学金类型
|
||||
listScholarshipType().then(response => {
|
||||
scholarshipTypes.value = response.rows || response.data || []
|
||||
})
|
||||
listScholarshipType().then((response) => {
|
||||
scholarshipTypes.value = response.rows || response.data || [];
|
||||
});
|
||||
|
||||
// 加载申请批次
|
||||
listScholarshipBatch().then(response => {
|
||||
scholarshipBatches.value = response.rows || response.data || []
|
||||
})
|
||||
listScholarshipBatch().then((response) => {
|
||||
scholarshipBatches.value = response.rows || response.data || [];
|
||||
});
|
||||
}
|
||||
|
||||
/** 查询申请记录列表 */
|
||||
function getList() {
|
||||
loading.value = true
|
||||
loading.value = true;
|
||||
// 处理时间范围
|
||||
queryParams.value.submitTimeStart = null
|
||||
queryParams.value.submitTimeEnd = null
|
||||
queryParams.value.submitTimeStart = null;
|
||||
queryParams.value.submitTimeEnd = null;
|
||||
if (null != daterangeSubmitTime && '' != daterangeSubmitTime) {
|
||||
queryParams.value.submitTimeStart = daterangeSubmitTime.value[0]
|
||||
queryParams.value.submitTimeEnd = daterangeSubmitTime.value[1]
|
||||
queryParams.value.submitTimeStart = daterangeSubmitTime.value[0];
|
||||
queryParams.value.submitTimeEnd = daterangeSubmitTime.value[1];
|
||||
}
|
||||
|
||||
listScholarshipApplication(queryParams.value).then(response => {
|
||||
reviewList.value = response.rows
|
||||
total.value = response.total
|
||||
listScholarshipApplication(queryParams.value).then((response) => {
|
||||
reviewList.value = response.rows;
|
||||
total.value = response.total;
|
||||
|
||||
// 统计数据
|
||||
reviewStats.value = {
|
||||
pendingCount: reviewList.value.filter(item => item.status === 'SUBMITTED').length,
|
||||
approvedCount: reviewList.value.filter(item => item.status === 'APPROVED').length,
|
||||
rejectedCount: reviewList.value.filter(item => item.status === 'REJECTED').length,
|
||||
pendingCount: reviewList.value.filter((item) => item.status === 'SUBMITTED').length,
|
||||
approvedCount: reviewList.value.filter((item) => item.status === 'APPROVED').length,
|
||||
rejectedCount: reviewList.value.filter((item) => item.status === 'REJECTED').length,
|
||||
totalCount: total.value
|
||||
}
|
||||
};
|
||||
|
||||
loading.value = false
|
||||
})
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1
|
||||
getList()
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
daterangeSubmitTime.value = []
|
||||
proxy.resetForm("queryFormRef")
|
||||
handleQuery()
|
||||
daterangeSubmitTime.value = [];
|
||||
proxy.resetForm('queryFormRef');
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
/** 多选框选中数据 */
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.id)
|
||||
single.value = selection.length != 1
|
||||
multiple.value = !selection.length
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/** 提交审核 */
|
||||
|
||||
|
||||
/** 批量通过按钮操作 */
|
||||
function handleBatchApprove() {
|
||||
const reviewIds = ids.value
|
||||
const reviewIds = ids.value;
|
||||
if (reviewIds.length === 0) {
|
||||
proxy.$modal.msgError("请选择要审核的记录")
|
||||
return
|
||||
proxy.$modal.msgError('请选择要审核的记录');
|
||||
return;
|
||||
}
|
||||
proxy.$modal.confirm('是否确认批量通过选中的审核记录?').then(function() {
|
||||
return batchApproveScholarshipReview(reviewIds)
|
||||
}).then(() => {
|
||||
getList()
|
||||
proxy.$modal.msgSuccess("批量审核成功")
|
||||
}).catch(() => {})
|
||||
proxy.$modal
|
||||
.confirm('是否确认批量通过选中的审核记录?')
|
||||
.then(function () {
|
||||
return batchApproveScholarshipReview(reviewIds);
|
||||
})
|
||||
.then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess('批量审核成功');
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download('jcbt/scholarship/review/export', {
|
||||
...queryParams.value
|
||||
}, `scholarship_review_${new Date().getTime()}.xlsx`)
|
||||
proxy.download(
|
||||
'jcbt/scholarship/review/export',
|
||||
{
|
||||
...queryParams.value
|
||||
},
|
||||
`scholarship_review_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
}
|
||||
|
||||
/** 根据状态筛选 */
|
||||
function handleFilterByStatus(status) {
|
||||
if (status === 'PENDING') {
|
||||
queryParams.value.status = 'SUBMITTED'
|
||||
queryParams.value.status = 'SUBMITTED';
|
||||
} else {
|
||||
queryParams.value.status = status
|
||||
queryParams.value.status = status;
|
||||
}
|
||||
handleQuery()
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
/** 关闭审核对话框 */
|
||||
function handleReviewClose() {
|
||||
reviewOpen.value = false
|
||||
reset()
|
||||
reviewOpen.value = false;
|
||||
reset();
|
||||
}
|
||||
|
||||
/** 表单重置 */
|
||||
@@ -600,132 +573,144 @@ function reset() {
|
||||
id: null,
|
||||
status: null,
|
||||
reviewComment: null
|
||||
}
|
||||
detailForm.value = {}
|
||||
proxy.resetForm("reviewFormRef")
|
||||
};
|
||||
detailForm.value = {};
|
||||
proxy.resetForm('reviewFormRef');
|
||||
}
|
||||
|
||||
/** 直接批准申请 */
|
||||
function handleApprove(row) {
|
||||
console.log('🔍 [DEBUG] handleApprove 开始执行')
|
||||
console.log('🔍 [DEBUG] 传入的row数据:', JSON.stringify(row, null, 2))
|
||||
|
||||
proxy.$modal.confirm(`确认批准 ${row.studentName} 的奖学金申请吗?`).then(function() {
|
||||
console.log('🔍 [DEBUG] 用户确认批准,准备获取完整数据')
|
||||
console.log('🔍 [DEBUG] 调用 getScholarshipApplication,ID:', row.id)
|
||||
|
||||
// 先获取完整的申请记录,然后更新状态
|
||||
return getScholarshipApplication(row.id)
|
||||
}).then(response => {
|
||||
console.log('🔍 [DEBUG] getScholarshipApplication 响应:', JSON.stringify(response, null, 2))
|
||||
|
||||
const fullData = response.data
|
||||
console.log('🔍 [DEBUG] 提取的fullData:', JSON.stringify(fullData, null, 2))
|
||||
|
||||
const updateData = {
|
||||
...fullData,
|
||||
status: 'APPROVED',
|
||||
reviewComment: '管理员直接批准'
|
||||
}
|
||||
|
||||
console.log('🔍 [DEBUG] 准备更新的数据 updateData:', JSON.stringify(updateData, null, 2))
|
||||
console.log('🔍 [DEBUG] 关键字段检查:')
|
||||
console.log(' - id:', updateData.id)
|
||||
console.log(' - studentNo:', updateData.studentNo)
|
||||
console.log(' - studentName:', updateData.studentName)
|
||||
console.log(' - status:', updateData.status)
|
||||
|
||||
console.log('🔍 [DEBUG] 调用 updateScholarshipApplication')
|
||||
return updateScholarshipApplication(updateData)
|
||||
}).then((updateResponse) => {
|
||||
console.log('🔍 [DEBUG] updateScholarshipApplication 响应:', JSON.stringify(updateResponse, null, 2))
|
||||
proxy.$modal.msgSuccess("批准成功")
|
||||
getList()
|
||||
}).catch((error) => {
|
||||
console.error('❌ [ERROR] handleApprove 出错:', error)
|
||||
console.error('❌ [ERROR] 错误详情:', JSON.stringify(error, null, 2))
|
||||
if (error.response) {
|
||||
console.error('❌ [ERROR] 响应状态:', error.response.status)
|
||||
console.error('❌ [ERROR] 响应数据:', JSON.stringify(error.response.data, null, 2))
|
||||
}
|
||||
})
|
||||
console.log('🔍 [DEBUG] handleApprove 开始执行');
|
||||
console.log('🔍 [DEBUG] 传入的row数据:', JSON.stringify(row, null, 2));
|
||||
|
||||
proxy.$modal
|
||||
.confirm(`确认批准 ${row.studentName} 的奖学金申请吗?`)
|
||||
.then(function () {
|
||||
console.log('🔍 [DEBUG] 用户确认批准,准备获取完整数据');
|
||||
console.log('🔍 [DEBUG] 调用 getScholarshipApplication,ID:', row.id);
|
||||
|
||||
// 先获取完整的申请记录,然后更新状态
|
||||
return getScholarshipApplication(row.id);
|
||||
})
|
||||
.then((response) => {
|
||||
console.log('🔍 [DEBUG] getScholarshipApplication 响应:', JSON.stringify(response, null, 2));
|
||||
|
||||
const fullData = response.data;
|
||||
console.log('🔍 [DEBUG] 提取的fullData:', JSON.stringify(fullData, null, 2));
|
||||
|
||||
const updateData = {
|
||||
...fullData,
|
||||
status: 'APPROVED',
|
||||
reviewComment: '管理员直接批准'
|
||||
};
|
||||
|
||||
console.log('🔍 [DEBUG] 准备更新的数据 updateData:', JSON.stringify(updateData, null, 2));
|
||||
console.log('🔍 [DEBUG] 关键字段检查:');
|
||||
console.log(' - id:', updateData.id);
|
||||
console.log(' - studentNo:', updateData.studentNo);
|
||||
console.log(' - studentName:', updateData.studentName);
|
||||
console.log(' - status:', updateData.status);
|
||||
|
||||
console.log('🔍 [DEBUG] 调用 updateScholarshipApplication');
|
||||
return updateScholarshipApplication(updateData);
|
||||
})
|
||||
.then((updateResponse) => {
|
||||
console.log('🔍 [DEBUG] updateScholarshipApplication 响应:', JSON.stringify(updateResponse, null, 2));
|
||||
proxy.$modal.msgSuccess('批准成功');
|
||||
getList();
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('❌ [ERROR] handleApprove 出错:', error);
|
||||
console.error('❌ [ERROR] 错误详情:', JSON.stringify(error, null, 2));
|
||||
if (error.response) {
|
||||
console.error('❌ [ERROR] 响应状态:', error.response.status);
|
||||
console.error('❌ [ERROR] 响应数据:', JSON.stringify(error.response.data, null, 2));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** 直接拒绝申请 */
|
||||
function handleReject(row) {
|
||||
console.log('🔍 [DEBUG] handleReject 开始执行')
|
||||
console.log('🔍 [DEBUG] 传入的row数据:', JSON.stringify(row, null, 2))
|
||||
|
||||
proxy.$modal.confirm(`确认拒绝 ${row.studentName} 的奖学金申请吗?`).then(function() {
|
||||
console.log('🔍 [DEBUG] 用户确认拒绝,准备获取完整数据')
|
||||
console.log('🔍 [DEBUG] 调用 getScholarshipApplication,ID:', row.id)
|
||||
|
||||
// 先获取完整的申请记录,然后更新状态
|
||||
return getScholarshipApplication(row.id)
|
||||
}).then(response => {
|
||||
console.log('🔍 [DEBUG] getScholarshipApplication 响应:', JSON.stringify(response, null, 2))
|
||||
|
||||
const fullData = response.data
|
||||
console.log('🔍 [DEBUG] 提取的fullData:', JSON.stringify(fullData, null, 2))
|
||||
|
||||
const updateData = {
|
||||
...fullData,
|
||||
status: 'REJECTED',
|
||||
reviewComment: '管理员直接拒绝'
|
||||
}
|
||||
|
||||
console.log('🔍 [DEBUG] 准备更新的数据 updateData:', JSON.stringify(updateData, null, 2))
|
||||
console.log('🔍 [DEBUG] 关键字段检查:')
|
||||
console.log(' - id:', updateData.id)
|
||||
console.log(' - studentNo:', updateData.studentNo)
|
||||
console.log(' - studentName:', updateData.studentName)
|
||||
console.log(' - status:', updateData.status)
|
||||
|
||||
console.log('🔍 [DEBUG] 调用 updateScholarshipApplication')
|
||||
return updateScholarshipApplication(updateData)
|
||||
}).then((updateResponse) => {
|
||||
console.log('🔍 [DEBUG] updateScholarshipApplication 响应:', JSON.stringify(updateResponse, null, 2))
|
||||
proxy.$modal.msgSuccess("拒绝成功")
|
||||
getList()
|
||||
}).catch((error) => {
|
||||
console.error('❌ [ERROR] handleReject 出错:', error)
|
||||
console.error('❌ [ERROR] 错误详情:', JSON.stringify(error, null, 2))
|
||||
if (error.response) {
|
||||
console.error('❌ [ERROR] 响应状态:', error.response.status)
|
||||
console.error('❌ [ERROR] 响应数据:', JSON.stringify(error.response.data, null, 2))
|
||||
}
|
||||
})
|
||||
console.log('🔍 [DEBUG] handleReject 开始执行');
|
||||
console.log('🔍 [DEBUG] 传入的row数据:', JSON.stringify(row, null, 2));
|
||||
|
||||
proxy.$modal
|
||||
.confirm(`确认拒绝 ${row.studentName} 的奖学金申请吗?`)
|
||||
.then(function () {
|
||||
console.log('🔍 [DEBUG] 用户确认拒绝,准备获取完整数据');
|
||||
console.log('🔍 [DEBUG] 调用 getScholarshipApplication,ID:', row.id);
|
||||
|
||||
// 先获取完整的申请记录,然后更新状态
|
||||
return getScholarshipApplication(row.id);
|
||||
})
|
||||
.then((response) => {
|
||||
console.log('🔍 [DEBUG] getScholarshipApplication 响应:', JSON.stringify(response, null, 2));
|
||||
|
||||
const fullData = response.data;
|
||||
console.log('🔍 [DEBUG] 提取的fullData:', JSON.stringify(fullData, null, 2));
|
||||
|
||||
const updateData = {
|
||||
...fullData,
|
||||
status: 'REJECTED',
|
||||
reviewComment: '管理员直接拒绝'
|
||||
};
|
||||
|
||||
console.log('🔍 [DEBUG] 准备更新的数据 updateData:', JSON.stringify(updateData, null, 2));
|
||||
console.log('🔍 [DEBUG] 关键字段检查:');
|
||||
console.log(' - id:', updateData.id);
|
||||
console.log(' - studentNo:', updateData.studentNo);
|
||||
console.log(' - studentName:', updateData.studentName);
|
||||
console.log(' - status:', updateData.status);
|
||||
|
||||
console.log('🔍 [DEBUG] 调用 updateScholarshipApplication');
|
||||
return updateScholarshipApplication(updateData);
|
||||
})
|
||||
.then((updateResponse) => {
|
||||
console.log('🔍 [DEBUG] updateScholarshipApplication 响应:', JSON.stringify(updateResponse, null, 2));
|
||||
proxy.$modal.msgSuccess('拒绝成功');
|
||||
getList();
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('❌ [ERROR] handleReject 出错:', error);
|
||||
console.error('❌ [ERROR] 错误详情:', JSON.stringify(error, null, 2));
|
||||
if (error.response) {
|
||||
console.error('❌ [ERROR] 响应状态:', error.response.status);
|
||||
console.error('❌ [ERROR] 响应数据:', JSON.stringify(error.response.data, null, 2));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** 详细审核申请 */
|
||||
function handleReview(row) {
|
||||
console.log('🔍 [DEBUG] handleReview 开始执行')
|
||||
console.log('🔍 [DEBUG] 传入的row数据:', JSON.stringify(row, null, 2))
|
||||
|
||||
console.log('🔍 [DEBUG] handleReview 开始执行');
|
||||
console.log('🔍 [DEBUG] 传入的row数据:', JSON.stringify(row, null, 2));
|
||||
|
||||
reviewForm.value = {
|
||||
id: row.id,
|
||||
status: 'APPROVED',
|
||||
reviewComment: ''
|
||||
}
|
||||
|
||||
console.log('🔍 [DEBUG] 设置的reviewForm:', JSON.stringify(reviewForm.value, null, 2))
|
||||
reviewOpen.value = true
|
||||
};
|
||||
|
||||
console.log('🔍 [DEBUG] 设置的reviewForm:', JSON.stringify(reviewForm.value, null, 2));
|
||||
reviewOpen.value = true;
|
||||
}
|
||||
|
||||
/** 查看详情 */
|
||||
function handleView(row) {
|
||||
console.log('查看详情 - 传入的row:', row)
|
||||
getScholarshipApplication(row.id).then(response => {
|
||||
console.log('API返回完整数据:', response)
|
||||
console.log('API返回数据结构:', response.data)
|
||||
console.log('奖学金类型名称:', response.data?.scholarshipTypeName)
|
||||
console.log('班级名称:', response.data?.className)
|
||||
detailForm.value = response.data
|
||||
detailOpen.value = true
|
||||
}).catch(error => {
|
||||
console.error('获取详情失败:', error)
|
||||
proxy.$modal.msgError('获取详情失败')
|
||||
})
|
||||
console.log('查看详情 - 传入的row:', row);
|
||||
getScholarshipApplication(row.id)
|
||||
.then((response) => {
|
||||
console.log('API返回完整数据:', response);
|
||||
console.log('API返回数据结构:', response.data);
|
||||
console.log('奖学金类型名称:', response.data?.scholarshipTypeName);
|
||||
console.log('班级名称:', response.data?.className);
|
||||
detailForm.value = response.data;
|
||||
detailOpen.value = true;
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('获取详情失败:', error);
|
||||
proxy.$modal.msgError('获取详情失败');
|
||||
});
|
||||
}
|
||||
|
||||
/** 修改申请 */
|
||||
@@ -734,65 +719,68 @@ function handleUpdate(row) {
|
||||
proxy.$router.push({
|
||||
path: '/jcbt/scholarship/application',
|
||||
query: { id: row.id }
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/** 提交审核结果 */
|
||||
function submitReview() {
|
||||
console.log('🔍 [DEBUG] submitReview 开始执行')
|
||||
console.log('🔍 [DEBUG] 当前reviewForm:', JSON.stringify(reviewForm.value, null, 2))
|
||||
|
||||
proxy.$refs["reviewFormRef"].validate(valid => {
|
||||
console.log('🔍 [DEBUG] submitReview 开始执行');
|
||||
console.log('🔍 [DEBUG] 当前reviewForm:', JSON.stringify(reviewForm.value, null, 2));
|
||||
|
||||
proxy.$refs['reviewFormRef'].validate((valid) => {
|
||||
if (valid) {
|
||||
console.log('🔍 [DEBUG] 表单验证通过,准备获取完整数据')
|
||||
console.log('🔍 [DEBUG] 调用 getScholarshipApplication,ID:', reviewForm.value.id)
|
||||
|
||||
getScholarshipApplication(reviewForm.value.id).then(response => {
|
||||
console.log('🔍 [DEBUG] getScholarshipApplication 响应:', JSON.stringify(response, null, 2))
|
||||
|
||||
const fullData = response.data
|
||||
console.log('🔍 [DEBUG] 提取的fullData:', JSON.stringify(fullData, null, 2))
|
||||
|
||||
const updateData = {
|
||||
...fullData,
|
||||
status: reviewForm.value.status,
|
||||
reviewComment: reviewForm.value.reviewComment
|
||||
}
|
||||
|
||||
console.log('🔍 [DEBUG] 准备更新的数据 updateData:', JSON.stringify(updateData, null, 2))
|
||||
console.log('🔍 [DEBUG] 关键字段检查:')
|
||||
console.log(' - id:', updateData.id)
|
||||
console.log(' - studentNo:', updateData.studentNo)
|
||||
console.log(' - studentName:', updateData.studentName)
|
||||
console.log(' - status:', updateData.status)
|
||||
console.log(' - reviewComment:', updateData.reviewComment)
|
||||
|
||||
console.log('🔍 [DEBUG] 调用 updateScholarshipApplication')
|
||||
return updateScholarshipApplication(updateData)
|
||||
}).then((updateResponse) => {
|
||||
console.log('🔍 [DEBUG] updateScholarshipApplication 响应:', JSON.stringify(updateResponse, null, 2))
|
||||
proxy.$modal.msgSuccess("审核成功")
|
||||
reviewOpen.value = false
|
||||
getList()
|
||||
}).catch((error) => {
|
||||
console.error('❌ [ERROR] submitReview 出错:', error)
|
||||
console.error('❌ [ERROR] 错误详情:', JSON.stringify(error, null, 2))
|
||||
if (error.response) {
|
||||
console.error('❌ [ERROR] 响应状态:', error.response.status)
|
||||
console.error('❌ [ERROR] 响应数据:', JSON.stringify(error.response.data, null, 2))
|
||||
}
|
||||
})
|
||||
console.log('🔍 [DEBUG] 表单验证通过,准备获取完整数据');
|
||||
console.log('🔍 [DEBUG] 调用 getScholarshipApplication,ID:', reviewForm.value.id);
|
||||
|
||||
getScholarshipApplication(reviewForm.value.id)
|
||||
.then((response) => {
|
||||
console.log('🔍 [DEBUG] getScholarshipApplication 响应:', JSON.stringify(response, null, 2));
|
||||
|
||||
const fullData = response.data;
|
||||
console.log('🔍 [DEBUG] 提取的fullData:', JSON.stringify(fullData, null, 2));
|
||||
|
||||
const updateData = {
|
||||
...fullData,
|
||||
status: reviewForm.value.status,
|
||||
reviewComment: reviewForm.value.reviewComment
|
||||
};
|
||||
|
||||
console.log('🔍 [DEBUG] 准备更新的数据 updateData:', JSON.stringify(updateData, null, 2));
|
||||
console.log('🔍 [DEBUG] 关键字段检查:');
|
||||
console.log(' - id:', updateData.id);
|
||||
console.log(' - studentNo:', updateData.studentNo);
|
||||
console.log(' - studentName:', updateData.studentName);
|
||||
console.log(' - status:', updateData.status);
|
||||
console.log(' - reviewComment:', updateData.reviewComment);
|
||||
|
||||
console.log('🔍 [DEBUG] 调用 updateScholarshipApplication');
|
||||
return updateScholarshipApplication(updateData);
|
||||
})
|
||||
.then((updateResponse) => {
|
||||
console.log('🔍 [DEBUG] updateScholarshipApplication 响应:', JSON.stringify(updateResponse, null, 2));
|
||||
proxy.$modal.msgSuccess('审核成功');
|
||||
reviewOpen.value = false;
|
||||
getList();
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('❌ [ERROR] submitReview 出错:', error);
|
||||
console.error('❌ [ERROR] 错误详情:', JSON.stringify(error, null, 2));
|
||||
if (error.response) {
|
||||
console.error('❌ [ERROR] 响应状态:', error.response.status);
|
||||
console.error('❌ [ERROR] 响应数据:', JSON.stringify(error.response.data, null, 2));
|
||||
}
|
||||
});
|
||||
} else {
|
||||
console.warn('⚠️ [WARN] 表单验证失败')
|
||||
console.warn('⚠️ [WARN] 表单验证失败');
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/** 初始化 */
|
||||
onMounted(() => {
|
||||
initData()
|
||||
getList()
|
||||
})
|
||||
initData();
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
@@ -110,18 +110,10 @@
|
||||
<span class="card-title">我的审核任务</span>
|
||||
<div class="card-extra">
|
||||
<el-button-group>
|
||||
<el-button
|
||||
:type="activeTab === 'pending' ? 'primary' : ''"
|
||||
@click="switchTab('pending')"
|
||||
icon="Clock"
|
||||
>
|
||||
<el-button :type="activeTab === 'pending' ? 'primary' : ''" @click="switchTab('pending')" icon="Clock">
|
||||
待审核 ({{ taskStats.pendingCount }})
|
||||
</el-button>
|
||||
<el-button
|
||||
:type="activeTab === 'processed' ? 'primary' : ''"
|
||||
@click="switchTab('processed')"
|
||||
icon="CircleCheck"
|
||||
>
|
||||
<el-button :type="activeTab === 'processed' ? 'primary' : ''" @click="switchTab('processed')" icon="CircleCheck">
|
||||
已处理 ({{ taskStats.processedCount }})
|
||||
</el-button>
|
||||
</el-button-group>
|
||||
@@ -132,14 +124,7 @@
|
||||
|
||||
<!-- 表格区域 -->
|
||||
<div class="table-container">
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
border
|
||||
:data="taskList"
|
||||
@selection-change="handleSelectionChange"
|
||||
style="width: 100%"
|
||||
class="scroll-table"
|
||||
>
|
||||
<el-table v-loading="loading" border :data="taskList" @selection-change="handleSelectionChange" style="width: 100%" class="scroll-table">
|
||||
<el-table-column type="selection" width="55" align="center" fixed="left" v-if="activeTab === 'pending'" />
|
||||
<el-table-column label="申请编号" align="center" prop="orderNo" width="140" show-overflow-tooltip fixed="left" />
|
||||
<el-table-column label="申请人" align="center" prop="applicantName" width="120" show-overflow-tooltip />
|
||||
@@ -220,33 +205,19 @@
|
||||
<span>已选择 {{ selectedIds.length }} 条记录</span>
|
||||
</div>
|
||||
<div class="batch-actions">
|
||||
<el-button type="success" icon="Check" @click="handleBatchApprove" v-hasPermi="['jcbt:review:approve']">
|
||||
批量通过
|
||||
</el-button>
|
||||
<el-button type="danger" icon="Close" @click="handleBatchReject" v-hasPermi="['jcbt:review:approve']">
|
||||
批量拒绝
|
||||
</el-button>
|
||||
<el-button type="success" icon="Check" @click="handleBatchApprove" v-hasPermi="['jcbt:review:approve']"> 批量通过 </el-button>
|
||||
<el-button type="danger" icon="Close" @click="handleBatchReject" v-hasPermi="['jcbt:review:approve']"> 批量拒绝 </el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 分页 -->
|
||||
<div class="pagination-container">
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<!-- 审核操作对话框 -->
|
||||
<ReviewActionDialog
|
||||
v-model:visible="reviewDialog.visible"
|
||||
:review-data="reviewDialog.data"
|
||||
@confirm="handleReviewConfirm"
|
||||
/>
|
||||
<ReviewActionDialog v-model:visible="reviewDialog.visible" :review-data="reviewDialog.data" @confirm="handleReviewConfirm" />
|
||||
|
||||
<!-- 批量操作对话框 -->
|
||||
<el-dialog :title="batchDialog.title" v-model="batchDialog.visible" width="600px" append-to-body>
|
||||
@@ -262,11 +233,7 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-alert
|
||||
:title="batchDialog.alertText"
|
||||
:type="batchDialog.alertType"
|
||||
:closable="false"
|
||||
/>
|
||||
<el-alert :title="batchDialog.alertText" :type="batchDialog.alertType" :closable="false" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
@@ -389,14 +356,12 @@ const updateTaskStats = async () => {
|
||||
// 获取已处理数量
|
||||
const processedQuery = { ...queryParams.value, auditStatus: '' };
|
||||
const processedRes = await getMyReviewTasks(processedQuery);
|
||||
const processedCount = processedRes.rows.filter(item => item.auditStatus !== 'PENDING').length;
|
||||
const processedCount = processedRes.rows.filter((item) => item.auditStatus !== 'PENDING').length;
|
||||
taskStats.value.processedCount = processedCount;
|
||||
|
||||
// 计算总数和效率
|
||||
taskStats.value.totalCount = taskStats.value.pendingCount + taskStats.value.processedCount;
|
||||
taskStats.value.efficiency = taskStats.value.totalCount > 0
|
||||
? Math.round((taskStats.value.processedCount / taskStats.value.totalCount) * 100)
|
||||
: 0;
|
||||
taskStats.value.efficiency = taskStats.value.totalCount > 0 ? Math.round((taskStats.value.processedCount / taskStats.value.totalCount) * 100) : 0;
|
||||
} catch (error) {
|
||||
console.error('更新统计失败:', error);
|
||||
}
|
||||
@@ -432,9 +397,9 @@ const getWaitingTimeClass = (createTime: string): string => {
|
||||
const create = new Date(createTime).getTime();
|
||||
const hours = (now - create) / (1000 * 60 * 60);
|
||||
|
||||
if (hours >= 72) return 'urgent'; // 3天以上
|
||||
if (hours >= 48) return 'warning'; // 2天以上
|
||||
if (hours >= 24) return 'attention'; // 1天以上
|
||||
if (hours >= 72) return 'urgent'; // 3天以上
|
||||
if (hours >= 48) return 'warning'; // 2天以上
|
||||
if (hours >= 24) return 'attention'; // 1天以上
|
||||
return 'normal';
|
||||
};
|
||||
|
||||
@@ -485,7 +450,7 @@ const resetQuery = () => {
|
||||
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: ScholarshipReviewVo[]) => {
|
||||
selectedIds.value = selection.map(item => item.id);
|
||||
selectedIds.value = selection.map((item) => item.id);
|
||||
};
|
||||
|
||||
/** 查看详情 */
|
||||
@@ -718,8 +683,14 @@ onMounted(() => {
|
||||
}
|
||||
|
||||
@keyframes blink {
|
||||
0%, 50% { opacity: 1; }
|
||||
51%, 100% { opacity: 0.5; }
|
||||
0%,
|
||||
50% {
|
||||
opacity: 1;
|
||||
}
|
||||
51%,
|
||||
100% {
|
||||
opacity: 0.5;
|
||||
}
|
||||
}
|
||||
|
||||
/* 批量操作工具栏 */
|
||||
|
||||
@@ -147,8 +147,12 @@
|
||||
</div>
|
||||
<div class="button-group">
|
||||
<el-button v-hasPermi="['jcbt:scholarshipType:add']" type="primary" plain icon="Plus" @click="handleAdd">新增</el-button>
|
||||
<el-button v-hasPermi="['jcbt:scholarshipType:edit']" type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" >修改</el-button>
|
||||
<el-button v-hasPermi="['jcbt:scholarshipType:remove']" type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()">删除</el-button>
|
||||
<el-button v-hasPermi="['jcbt:scholarshipType:edit']" type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()"
|
||||
>修改</el-button
|
||||
>
|
||||
<el-button v-hasPermi="['jcbt:scholarshipType:remove']" type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()"
|
||||
>删除</el-button
|
||||
>
|
||||
<el-button v-hasPermi="['jcbt:scholarshipType:export']" type="warning" plain icon="Download" @click="handleExport">导出</el-button>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</div>
|
||||
@@ -198,12 +202,7 @@
|
||||
<el-table-column label="排序" prop="sortOrder" width="80" align="center" />
|
||||
<el-table-column label="状态" prop="status" width="80" align="center">
|
||||
<template #default="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.status"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
@change="handleStatusChange(scope.row)"
|
||||
/>
|
||||
<el-switch v-model="scope.row.status" :active-value="1" :inactive-value="0" @change="handleStatusChange(scope.row)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" prop="createTime" width="160" align="center" />
|
||||
@@ -228,24 +227,12 @@
|
||||
|
||||
<!-- 分页 -->
|
||||
<div class="pagination-container">
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
<pagination v-show="total > 0" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" :total="total" @pagination="getList" />
|
||||
</div>
|
||||
|
||||
<!-- 添加或修改奖学金类型对话框 -->
|
||||
<el-dialog v-model="dialogOpen" :title="dialogTitle" width="800px" append-to-body>
|
||||
<el-form
|
||||
ref="scholarshipTypeFormRef"
|
||||
:model="form"
|
||||
:rules="dataRules"
|
||||
label-width="120px"
|
||||
class="dialog-form"
|
||||
>
|
||||
<el-form ref="scholarshipTypeFormRef" :model="form" :rules="dataRules" label-width="120px" class="dialog-form">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="类型编码" prop="typeCode">
|
||||
@@ -306,28 +293,14 @@
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="奖学金描述" prop="description">
|
||||
<el-input
|
||||
v-model="form.description"
|
||||
type="textarea"
|
||||
placeholder="请输入奖学金描述"
|
||||
:rows="3"
|
||||
maxlength="500"
|
||||
show-word-limit
|
||||
/>
|
||||
<el-input v-model="form.description" type="textarea" placeholder="请输入奖学金描述" :rows="3" maxlength="500" show-word-limit />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="申请指南" prop="applicationGuide">
|
||||
<el-input
|
||||
v-model="form.applicationGuide"
|
||||
type="textarea"
|
||||
placeholder="请输入申请指南"
|
||||
:rows="3"
|
||||
maxlength="500"
|
||||
show-word-limit
|
||||
/>
|
||||
<el-input v-model="form.applicationGuide" type="textarea" placeholder="请输入申请指南" :rows="3" maxlength="500" show-word-limit />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -369,45 +342,41 @@
|
||||
<el-row v-if="form.compatibilityType === 'CUSTOM'">
|
||||
<el-col :span="24">
|
||||
<!-- 当前兼容性配置显示 -->
|
||||
<div v-if="form.id && currentCompatibilityConfig" class="current-compatibility-info" style="margin-bottom: 16px; padding: 12px; background: #f5f7fa; border-radius: 4px;">
|
||||
<div style="margin-bottom: 8px; font-weight: 500; color: #606266;">当前兼容性配置:</div>
|
||||
<div v-if="currentCompatibilityConfig.exclusiveTypes?.length > 0" style="margin-bottom: 8px;">
|
||||
<span style="color: #909399; margin-right: 8px;">互斥奖学金:</span>
|
||||
<el-tag
|
||||
v-for="type in currentCompatibilityConfig.exclusiveTypes"
|
||||
:key="type.id"
|
||||
type="danger"
|
||||
size="small"
|
||||
style="margin-right: 6px;"
|
||||
>
|
||||
<div
|
||||
v-if="form.id && currentCompatibilityConfig"
|
||||
class="current-compatibility-info"
|
||||
style="margin-bottom: 16px; padding: 12px; background: #f5f7fa; border-radius: 4px"
|
||||
>
|
||||
<div style="margin-bottom: 8px; font-weight: 500; color: #606266">当前兼容性配置:</div>
|
||||
<div v-if="currentCompatibilityConfig.exclusiveTypes?.length > 0" style="margin-bottom: 8px">
|
||||
<span style="color: #909399; margin-right: 8px">互斥奖学金:</span>
|
||||
<el-tag v-for="type in currentCompatibilityConfig.exclusiveTypes" :key="type.id" type="danger" size="small" style="margin-right: 6px">
|
||||
{{ type.typeName }}
|
||||
</el-tag>
|
||||
</div>
|
||||
<div v-if="currentCompatibilityConfig.compatibleTypes?.length > 0">
|
||||
<span style="color: #909399; margin-right: 8px;">兼容奖学金:</span>
|
||||
<span style="color: #909399; margin-right: 8px">兼容奖学金:</span>
|
||||
<el-tag
|
||||
v-for="type in currentCompatibilityConfig.compatibleTypes"
|
||||
:key="type.id"
|
||||
type="success"
|
||||
size="small"
|
||||
style="margin-right: 6px;"
|
||||
style="margin-right: 6px"
|
||||
>
|
||||
{{ type.typeName }}
|
||||
</el-tag>
|
||||
</div>
|
||||
<div v-if="!currentCompatibilityConfig.exclusiveTypes?.length && !currentCompatibilityConfig.compatibleTypes?.length" style="color: #909399;">
|
||||
<div
|
||||
v-if="!currentCompatibilityConfig.exclusiveTypes?.length && !currentCompatibilityConfig.compatibleTypes?.length"
|
||||
style="color: #909399"
|
||||
>
|
||||
暂无配置
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-form-item label="互斥奖学金" prop="exclusiveTypeIds">
|
||||
<el-select v-model="form.exclusiveTypeIds" multiple placeholder="请选择互斥的奖学金类型" style="width: 100%">
|
||||
<el-option
|
||||
v-for="type in availableScholarshipTypes"
|
||||
:key="type.id"
|
||||
:label="type.typeName"
|
||||
:value="type.id"
|
||||
/>
|
||||
<el-option v-for="type in availableScholarshipTypes" :key="type.id" :label="type.typeName" :value="type.id" />
|
||||
</el-select>
|
||||
<div class="form-tip">选择与当前奖学金互斥的其他奖学金类型</div>
|
||||
</el-form-item>
|
||||
@@ -416,42 +385,21 @@
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="申请条件" prop="applicationConditions">
|
||||
<el-input
|
||||
v-model="form.applicationConditions"
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
placeholder="请输入申请条件"
|
||||
maxlength="500"
|
||||
show-word-limit
|
||||
/>
|
||||
<el-input v-model="form.applicationConditions" type="textarea" :rows="3" placeholder="请输入申请条件" maxlength="500" show-word-limit />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="评定标准" prop="evaluationCriteria">
|
||||
<el-input
|
||||
v-model="form.evaluationCriteria"
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
placeholder="请输入评定标准"
|
||||
maxlength="500"
|
||||
show-word-limit
|
||||
/>
|
||||
<el-input v-model="form.evaluationCriteria" type="textarea" :rows="3" placeholder="请输入评定标准" maxlength="500" show-word-limit />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input
|
||||
v-model="form.remark"
|
||||
type="textarea"
|
||||
:rows="2"
|
||||
placeholder="请输入备注"
|
||||
maxlength="200"
|
||||
show-word-limit
|
||||
/>
|
||||
<el-input v-model="form.remark" type="textarea" :rows="2" placeholder="请输入备注" maxlength="200" show-word-limit />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -513,7 +461,7 @@
|
||||
v-for="type in viewData.compatibilityConfig.exclusiveTypes"
|
||||
:key="type.id"
|
||||
type="danger"
|
||||
style="margin-right: 8px; margin-bottom: 4px;"
|
||||
style="margin-right: 8px; margin-bottom: 4px"
|
||||
>
|
||||
{{ type.typeName }}
|
||||
</el-tag>
|
||||
@@ -526,7 +474,7 @@
|
||||
v-for="type in viewData.compatibilityConfig.compatibleTypes"
|
||||
:key="type.id"
|
||||
type="success"
|
||||
style="margin-right: 8px; margin-bottom: 4px;"
|
||||
style="margin-right: 8px; margin-bottom: 4px"
|
||||
>
|
||||
{{ type.typeName }}
|
||||
</el-tag>
|
||||
@@ -706,10 +654,10 @@ const getCompatibilityTagType = (value: string) => {
|
||||
|
||||
// 处理空值情况
|
||||
if (!value || value === 'null' || value === 'undefined') {
|
||||
return 'info'; // 灰色标签表示未设置
|
||||
return 'info'; // 灰色标签表示未设置
|
||||
}
|
||||
|
||||
return typeMap[value] || 'warning'; // 未知类型用橙色警告标签
|
||||
return typeMap[value] || 'warning'; // 未知类型用橙色警告标签
|
||||
};
|
||||
|
||||
/** 查询奖学金类型列表 */
|
||||
@@ -722,7 +670,7 @@ const getList = async () => {
|
||||
queryParams.value.params.endCreateTime = daterangeCreateTime.value[1];
|
||||
}
|
||||
|
||||
try {
|
||||
try {
|
||||
const response = await listScholarshipType(queryParams.value);
|
||||
|
||||
// 添加详细调试信息 - 检查原始API响应
|
||||
@@ -756,10 +704,10 @@ const getList = async () => {
|
||||
const calculateStatistics = () => {
|
||||
const list = scholarshipTypeList.value;
|
||||
statistics.value.totalTypes = list.length;
|
||||
statistics.value.activeTypes = list.filter(item => item.status === 1).length;
|
||||
statistics.value.activeTypes = list.filter((item) => item.status === 1).length;
|
||||
|
||||
const totalAmount = list.reduce((sum, item) => sum + (parseFloat(item.awardAmount as any) || 0), 0);
|
||||
statistics.value.totalAmount = Math.round(totalAmount / 10000 * 100) / 100; // 转换为万元
|
||||
statistics.value.totalAmount = Math.round((totalAmount / 10000) * 100) / 100; // 转换为万元
|
||||
statistics.value.avgAmount = list.length > 0 ? Math.round(totalAmount / list.length) : 0;
|
||||
};
|
||||
|
||||
@@ -779,7 +727,7 @@ const resetQuery = () => {
|
||||
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: ScholarshipTypeVO[]) => {
|
||||
ids.value = selection.map(item => item.id!);
|
||||
ids.value = selection.map((item) => item.id!);
|
||||
single.value = selection.length !== 1;
|
||||
multiple.value = !selection.length;
|
||||
};
|
||||
@@ -848,7 +796,9 @@ const handleView = async (row: ScholarshipTypeVO) => {
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: ScholarshipTypeVO) => {
|
||||
const typeIds = row?.id ? [row.id] : ids.value;
|
||||
const typeNames = row?.typeName ? [row.typeName] : scholarshipTypeList.value.filter(item => typeIds.includes(item.id!)).map(item => item.typeName);
|
||||
const typeNames = row?.typeName
|
||||
? [row.typeName]
|
||||
: scholarshipTypeList.value.filter((item) => typeIds.includes(item.id!)).map((item) => item.typeName);
|
||||
|
||||
try {
|
||||
await proxy?.$modal.confirm(`是否确认删除奖学金类型"${typeNames.join('、')}"?`);
|
||||
@@ -942,7 +892,7 @@ const handleCompatibilityTypeChange = async (value: string) => {
|
||||
const loadAvailableScholarshipTypes = async () => {
|
||||
try {
|
||||
const response = await listScholarshipType({ status: 1 });
|
||||
availableScholarshipTypes.value = response.rows.filter(type => type.id !== form.value.id);
|
||||
availableScholarshipTypes.value = response.rows.filter((type) => type.id !== form.value.id);
|
||||
} catch (error) {
|
||||
console.error('加载奖学金类型列表失败', error);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,303 @@
|
||||
<template>
|
||||
<div class="all-applications">
|
||||
<!-- 搜索表单 -->
|
||||
<el-card class="search-card" shadow="never">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" class="search-form">
|
||||
<el-form-item label="岗位名称" prop="positionName">
|
||||
<el-input v-model="queryParams.positionName" placeholder="请输入岗位名称" clearable style="width: 200px" @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="学生姓名" prop="studentName">
|
||||
<el-input v-model="queryParams.studentName" placeholder="请输入学生姓名" clearable style="width: 200px" @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="学号" prop="studentNo">
|
||||
<el-input v-model="queryParams.studentNo" placeholder="请输入学号" clearable style="width: 200px" @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="申请状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择申请状态" clearable style="width: 200px">
|
||||
<el-option v-for="option in statusOptions" :key="option.value" :label="option.label" :value="option.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="申请日期" prop="applicationDate">
|
||||
<el-date-picker
|
||||
v-model="queryParams.applicationDate"
|
||||
type="daterange"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
style="width: 240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<!-- 数据表格 -->
|
||||
<el-card class="table-card" shadow="never">
|
||||
<div class="table-header">
|
||||
<div class="table-title">
|
||||
<el-icon><List /></el-icon>
|
||||
所有申请列表
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-table v-loading="loading" :data="applicationList" row-key="id" stripe>
|
||||
<el-table-column label="序号" type="index" width="60" align="center" />
|
||||
<el-table-column label="岗位名称" prop="positionName" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column label="学生信息" min-width="160">
|
||||
<template #default="{ row }">
|
||||
<div class="student-info">
|
||||
<div class="name">{{ row.studentName }}</div>
|
||||
<div class="detail">{{ row.studentNo }} | {{ row.className }}</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="专业年级" min-width="140">
|
||||
<template #default="{ row }">
|
||||
<div>{{ row.majorName }}</div>
|
||||
<div class="text-gray">{{ row.grade }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="联系方式" min-width="120">
|
||||
<template #default="{ row }">
|
||||
<div>{{ row.contactPhone }}</div>
|
||||
<div class="text-gray">{{ row.email }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="申请理由" prop="applicationReason" min-width="200" show-overflow-tooltip />
|
||||
<el-table-column label="申请状态" width="120" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="getStatusTagType(row.status)" effect="plain" size="small">
|
||||
{{ getStatusText(row.status) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="申请时间" prop="applicationDate" width="110" align="center" />
|
||||
<el-table-column label="审核时间" width="130" align="center">
|
||||
<template #default="{ row }">
|
||||
<span v-if="row.collegeReviewTime">{{ row.collegeReviewTime }}</span>
|
||||
<span v-else class="text-gray">-</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="审核意见" min-width="150" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<span v-if="row.collegeReviewComment">{{ row.collegeReviewComment }}</span>
|
||||
<span v-else class="text-gray">-</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" width="120" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-button type="primary" size="small" icon="View" @click="handleDetail(row)"> 详情 </el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 分页 -->
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</el-card>
|
||||
|
||||
<!-- 详情对话框 -->
|
||||
<ApplicationDetail v-model:visible="detailDialog.visible" :application-id="detailDialog.applicationId" @refresh="getList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="AllApplications">
|
||||
import { ref, reactive, onMounted } from 'vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { Search, List, View } from '@element-plus/icons-vue';
|
||||
import {
|
||||
listCollegeApplications,
|
||||
getApplicationOptions,
|
||||
type WorkStudyApplicationVO,
|
||||
type WorkStudyApplicationQuery,
|
||||
type OptionsVO
|
||||
} from '@/api/jcbt/workStudyApplicationCollegeReview';
|
||||
import ApplicationDetail from './ApplicationDetail.vue';
|
||||
|
||||
// 响应式数据
|
||||
const loading = ref(false);
|
||||
const applicationList = ref<WorkStudyApplicationVO[]>([]);
|
||||
const total = ref(0);
|
||||
const statusOptions = ref<Array<{ label: string; value: string }>>([]);
|
||||
const queryRef = ref();
|
||||
|
||||
// 查询参数
|
||||
const queryParams = ref<WorkStudyApplicationQuery>({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
positionName: '',
|
||||
studentName: '',
|
||||
studentNo: '',
|
||||
status: '',
|
||||
applicationDate: ''
|
||||
});
|
||||
|
||||
// 详情对话框数据
|
||||
const detailDialog = reactive({
|
||||
visible: false,
|
||||
applicationId: ''
|
||||
});
|
||||
|
||||
// 获取所有申请列表
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
try {
|
||||
const { data } = await listCollegeApplications(queryParams.value);
|
||||
applicationList.value = data.rows || [];
|
||||
total.value = data.total || 0;
|
||||
} catch (error) {
|
||||
console.error('获取申请列表失败:', error);
|
||||
ElMessage.error('获取数据失败');
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 获取选项数据
|
||||
const getOptions = async () => {
|
||||
try {
|
||||
const { data } = await getApplicationOptions();
|
||||
statusOptions.value = data.statusOptions || [];
|
||||
} catch (error) {
|
||||
console.error('获取选项数据失败:', error);
|
||||
}
|
||||
};
|
||||
|
||||
// 搜索
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
};
|
||||
|
||||
// 重置搜索
|
||||
const resetQuery = () => {
|
||||
queryRef.value.resetFields();
|
||||
queryParams.value = {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
positionName: '',
|
||||
studentName: '',
|
||||
studentNo: '',
|
||||
status: '',
|
||||
applicationDate: ''
|
||||
};
|
||||
getList();
|
||||
};
|
||||
|
||||
// 查看详情
|
||||
const handleDetail = (row: WorkStudyApplicationVO) => {
|
||||
detailDialog.visible = true;
|
||||
detailDialog.applicationId = row.id as string;
|
||||
};
|
||||
|
||||
// 获取状态标签类型
|
||||
const getStatusTagType = (status: string) => {
|
||||
const typeMap: Record<string, string> = {
|
||||
'SUBMITTED': 'info',
|
||||
'COLLEGE_APPROVED': 'success',
|
||||
'COLLEGE_REJECTED': 'danger',
|
||||
'FINAL_APPROVED': 'success',
|
||||
'FINAL_REJECTED': 'danger',
|
||||
'CANCELLED': 'info'
|
||||
};
|
||||
return typeMap[status] || 'info';
|
||||
};
|
||||
|
||||
// 获取状态文本
|
||||
const getStatusText = (status: string) => {
|
||||
const textMap: Record<string, string> = {
|
||||
'SUBMITTED': '已提交',
|
||||
'COLLEGE_APPROVED': '学院已通过',
|
||||
'COLLEGE_REJECTED': '学院已拒绝',
|
||||
'FINAL_APPROVED': '最终通过',
|
||||
'FINAL_REJECTED': '最终拒绝',
|
||||
'CANCELLED': '已取消'
|
||||
};
|
||||
return textMap[status] || status;
|
||||
};
|
||||
|
||||
// 暴露方法给父组件调用
|
||||
defineExpose({
|
||||
getList
|
||||
});
|
||||
|
||||
// 初始化
|
||||
onMounted(() => {
|
||||
getOptions();
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.all-applications {
|
||||
.search-card {
|
||||
margin-bottom: 16px;
|
||||
border: none;
|
||||
|
||||
:deep(.el-card__body) {
|
||||
padding: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.search-form {
|
||||
.el-form-item {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.table-card {
|
||||
border: none;
|
||||
|
||||
:deep(.el-card__body) {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.table-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 20px 20px 16px;
|
||||
border-bottom: 1px solid #ebeef5;
|
||||
|
||||
.table-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
|
||||
.el-icon {
|
||||
margin-right: 8px;
|
||||
color: #409eff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.el-table {
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
.student-info {
|
||||
.name {
|
||||
font-weight: 500;
|
||||
color: #303133;
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
|
||||
.detail {
|
||||
font-size: 12px;
|
||||
color: #909399;
|
||||
}
|
||||
}
|
||||
|
||||
.text-gray {
|
||||
color: #909399;
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
+391
@@ -0,0 +1,391 @@
|
||||
<template>
|
||||
<el-dialog v-model="dialogVisible" title="申请详情" width="800px" append-to-body :close-on-click-modal="false" @closed="handleClose">
|
||||
<div v-loading="loading" class="application-detail">
|
||||
<template v-if="applicationData">
|
||||
<!-- 基本信息 -->
|
||||
<div class="detail-section">
|
||||
<div class="section-title">
|
||||
<el-icon><User /></el-icon>
|
||||
基本信息
|
||||
</div>
|
||||
<div class="section-content">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<div class="info-item">
|
||||
<label>学生姓名:</label>
|
||||
<span>{{ applicationData.studentName }}</span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="info-item">
|
||||
<label>学号:</label>
|
||||
<span>{{ applicationData.studentNo }}</span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="info-item">
|
||||
<label>学院:</label>
|
||||
<span>{{ applicationData.collegeName }}</span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="info-item">
|
||||
<label>专业:</label>
|
||||
<span>{{ applicationData.majorName }}</span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="info-item">
|
||||
<label>年级:</label>
|
||||
<span>{{ applicationData.grade }}</span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="info-item">
|
||||
<label>班级:</label>
|
||||
<span>{{ applicationData.className }}</span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="info-item">
|
||||
<label>联系电话:</label>
|
||||
<span>{{ applicationData.contactPhone }}</span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="info-item">
|
||||
<label>邮箱:</label>
|
||||
<span>{{ applicationData.email }}</span>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 岗位信息 -->
|
||||
<div class="detail-section">
|
||||
<div class="section-title">
|
||||
<el-icon><Briefcase /></el-icon>
|
||||
岗位信息
|
||||
</div>
|
||||
<div class="section-content">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
<div class="info-item">
|
||||
<label>岗位名称:</label>
|
||||
<span>{{ applicationData.positionName }}</span>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 申请信息 -->
|
||||
<div class="detail-section">
|
||||
<div class="section-title">
|
||||
<el-icon><Document /></el-icon>
|
||||
申请信息
|
||||
</div>
|
||||
<div class="section-content">
|
||||
<div class="info-item full-width">
|
||||
<label>工作经验:</label>
|
||||
<div class="text-content">{{ applicationData.workExperience || '无' }}</div>
|
||||
</div>
|
||||
<div class="info-item full-width">
|
||||
<label>申请理由:</label>
|
||||
<div class="text-content">{{ applicationData.applicationReason || '无' }}</div>
|
||||
</div>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<div class="info-item">
|
||||
<label>申请状态:</label>
|
||||
<el-tag :type="getStatusTagType(applicationData.status)" effect="plain">
|
||||
{{ getStatusText(applicationData.status) }}
|
||||
</el-tag>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="info-item">
|
||||
<label>申请时间:</label>
|
||||
<span>{{ applicationData.applicationDate }}</span>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 审核记录 -->
|
||||
<div class="detail-section">
|
||||
<div class="section-title">
|
||||
<el-icon><Clock /></el-icon>
|
||||
审核记录
|
||||
</div>
|
||||
<div class="section-content">
|
||||
<!-- 学院审核记录 -->
|
||||
<div v-if="applicationData.collegeReviewTime" class="review-record">
|
||||
<div class="review-header">
|
||||
<div class="review-type">学院审核</div>
|
||||
<div class="review-time">{{ applicationData.collegeReviewTime }}</div>
|
||||
</div>
|
||||
<div class="review-content">
|
||||
<div class="reviewer">审核人:{{ applicationData.collegeReviewByName || '未知' }}</div>
|
||||
<div class="review-comment">
|
||||
<label>审核意见:</label>
|
||||
<span>{{ applicationData.collegeReviewComment || '无' }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 最终审核记录 -->
|
||||
<div v-if="applicationData.finalReviewTime" class="review-record">
|
||||
<div class="review-header">
|
||||
<div class="review-type">最终审核</div>
|
||||
<div class="review-time">{{ applicationData.finalReviewTime }}</div>
|
||||
</div>
|
||||
<div class="review-content">
|
||||
<div class="reviewer">审核人:{{ applicationData.finalReviewByName || '未知' }}</div>
|
||||
<div class="review-comment">
|
||||
<label>审核意见:</label>
|
||||
<span>{{ applicationData.finalReviewComment || '无' }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 无审核记录 -->
|
||||
<div v-if="!applicationData.collegeReviewTime && !applicationData.finalReviewTime" class="no-review">暂无审核记录</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="handleClose">关闭</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="ApplicationDetail">
|
||||
import { ref, computed, watch } from 'vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { User, Document, Clock, Briefcase } from '@element-plus/icons-vue';
|
||||
import { getCollegeApplication, type WorkStudyApplicationVO } from '@/api/jcbt/workStudyApplicationCollegeReview';
|
||||
|
||||
// 定义属性
|
||||
interface Props {
|
||||
visible: boolean;
|
||||
applicationId: string | number;
|
||||
}
|
||||
|
||||
const props = defineProps<Props>();
|
||||
|
||||
// 定义事件
|
||||
const emit = defineEmits<{
|
||||
'update:visible': [value: boolean];
|
||||
'refresh': [];
|
||||
}>();
|
||||
|
||||
// 响应式数据
|
||||
const loading = ref(false);
|
||||
const applicationData = ref<WorkStudyApplicationVO>();
|
||||
|
||||
// 计算属性
|
||||
const dialogVisible = computed({
|
||||
get: () => props.visible,
|
||||
set: (value) => emit('update:visible', value)
|
||||
});
|
||||
|
||||
// 获取申请详情
|
||||
const getApplicationDetail = async () => {
|
||||
if (!props.applicationId) return;
|
||||
|
||||
loading.value = true;
|
||||
try {
|
||||
const { data } = await getCollegeApplication(props.applicationId);
|
||||
applicationData.value = data;
|
||||
} catch (error) {
|
||||
console.error('获取申请详情失败:', error);
|
||||
ElMessage.error('获取详情失败');
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 获取状态标签类型
|
||||
const getStatusTagType = (status: string) => {
|
||||
const typeMap: Record<string, string> = {
|
||||
'SUBMITTED': 'info',
|
||||
'COLLEGE_APPROVED': 'success',
|
||||
'COLLEGE_REJECTED': 'danger',
|
||||
'FINAL_APPROVED': 'success',
|
||||
'FINAL_REJECTED': 'danger',
|
||||
'CANCELLED': 'info'
|
||||
};
|
||||
return typeMap[status] || 'info';
|
||||
};
|
||||
|
||||
// 获取状态文本
|
||||
const getStatusText = (status: string) => {
|
||||
const textMap: Record<string, string> = {
|
||||
'SUBMITTED': '已提交',
|
||||
'COLLEGE_APPROVED': '学院已通过',
|
||||
'COLLEGE_REJECTED': '学院已拒绝',
|
||||
'FINAL_APPROVED': '最终通过',
|
||||
'FINAL_REJECTED': '最终拒绝',
|
||||
'CANCELLED': '已取消'
|
||||
};
|
||||
return textMap[status] || status;
|
||||
};
|
||||
|
||||
// 关闭对话框
|
||||
const handleClose = () => {
|
||||
dialogVisible.value = false;
|
||||
applicationData.value = undefined;
|
||||
};
|
||||
|
||||
// 监听对话框显示状态
|
||||
watch(
|
||||
() => props.visible,
|
||||
(visible) => {
|
||||
if (visible && props.applicationId) {
|
||||
getApplicationDetail();
|
||||
}
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.application-detail {
|
||||
max-height: 600px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.detail-section {
|
||||
margin-bottom: 24px;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
margin-bottom: 16px;
|
||||
padding-bottom: 8px;
|
||||
border-bottom: 2px solid #e4e7ed;
|
||||
|
||||
.el-icon {
|
||||
margin-right: 8px;
|
||||
color: #409eff;
|
||||
}
|
||||
}
|
||||
|
||||
.section-content {
|
||||
.info-item {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
margin-bottom: 12px;
|
||||
|
||||
&.full-width {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
label {
|
||||
min-width: 80px;
|
||||
color: #606266;
|
||||
font-weight: 500;
|
||||
margin-right: 12px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
span {
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
.text-content {
|
||||
margin-top: 4px;
|
||||
line-height: 1.6;
|
||||
color: #303133;
|
||||
padding: 8px 12px;
|
||||
background: #f5f7fa;
|
||||
border-radius: 4px;
|
||||
border-left: 3px solid #409eff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.review-record {
|
||||
margin-bottom: 16px;
|
||||
padding: 16px;
|
||||
background: #f8f9fa;
|
||||
border-radius: 8px;
|
||||
border-left: 4px solid #409eff;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.review-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 12px;
|
||||
|
||||
.review-type {
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.review-time {
|
||||
color: #909399;
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
.review-content {
|
||||
.reviewer {
|
||||
color: #606266;
|
||||
font-size: 12px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.review-comment {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
|
||||
label {
|
||||
min-width: 70px;
|
||||
color: #606266;
|
||||
font-size: 13px;
|
||||
margin-right: 8px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
span {
|
||||
color: #303133;
|
||||
font-size: 13px;
|
||||
line-height: 1.6;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.no-review {
|
||||
text-align: center;
|
||||
color: #c0c4cc;
|
||||
font-size: 14px;
|
||||
padding: 20px;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.dialog-footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,252 @@
|
||||
<template>
|
||||
<el-card class="debug-panel" shadow="never">
|
||||
<template #header>
|
||||
<div class="debug-header">
|
||||
<el-icon><Tools /></el-icon>
|
||||
<span>数据一致性调试面板</span>
|
||||
<el-button type="primary" size="small" @click="runDebug" :loading="debugging">
|
||||
{{ debugging ? '检查中...' : '开始检查' }}
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div v-if="debugResult" class="debug-content">
|
||||
<el-row :gutter="20">
|
||||
<!-- 统计API结果 -->
|
||||
<el-col :span="12">
|
||||
<div class="debug-section">
|
||||
<h4>📊 统计API结果</h4>
|
||||
<el-descriptions :column="1" size="small" border>
|
||||
<el-descriptions-item label="待审核数量">
|
||||
<el-tag :type="debugResult.statistics.pendingCount > 0 ? 'warning' : 'info'">
|
||||
{{ debugResult.statistics.pendingCount }}
|
||||
</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="已通过数量">
|
||||
<el-tag type="success">{{ debugResult.statistics.approvedCount }}</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="已拒绝数量">
|
||||
<el-tag type="danger">{{ debugResult.statistics.rejectedCount }}</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="最终通过数量">
|
||||
<el-tag type="primary">{{ debugResult.statistics.finalApprovedCount }}</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="总数量">
|
||||
<el-tag>{{ debugResult.statistics.totalCount }}</el-tag>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
</el-col>
|
||||
|
||||
<!-- 列表API结果 -->
|
||||
<el-col :span="12">
|
||||
<div class="debug-section">
|
||||
<h4>📋 列表API结果</h4>
|
||||
<el-descriptions :column="1" size="small" border>
|
||||
<el-descriptions-item label="待审核列表总数">
|
||||
<el-tag :type="debugResult.pendingList.total > 0 ? 'warning' : 'info'">
|
||||
{{ debugResult.pendingList.total }}
|
||||
</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="所有申请总数">
|
||||
<el-tag>{{ debugResult.allList.total }}</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="当前页记录数">
|
||||
<el-tag type="info">{{ debugResult.pendingList.rows?.length || 0 }}</el-tag>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 一致性检查结果 -->
|
||||
<div class="consistency-check">
|
||||
<h4>🔍 一致性检查结果</h4>
|
||||
<el-alert
|
||||
:type="debugResult.isConsistent ? 'success' : 'error'"
|
||||
:title="debugResult.isConsistent ? '数据一致' : '数据不一致'"
|
||||
:description="debugResult.message"
|
||||
show-icon
|
||||
:closable="false"
|
||||
/>
|
||||
|
||||
<div v-if="!debugResult.isConsistent" class="inconsistency-details">
|
||||
<el-tag type="danger">
|
||||
统计API待审核: {{ debugResult.statistics.pendingCount }}
|
||||
</el-tag>
|
||||
<span class="vs">VS</span>
|
||||
<el-tag type="warning">
|
||||
列表API待审核: {{ debugResult.pendingList.total }}
|
||||
</el-tag>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 详细数据 -->
|
||||
<el-collapse class="debug-details">
|
||||
<el-collapse-item title="📊 统计API原始数据" name="stats">
|
||||
<pre>{{ JSON.stringify(debugResult.statistics, null, 2) }}</pre>
|
||||
</el-collapse-item>
|
||||
<el-collapse-item title="📋 待审核列表API原始数据" name="pending">
|
||||
<pre>{{ JSON.stringify(debugResult.pendingList, null, 2) }}</pre>
|
||||
</el-collapse-item>
|
||||
<el-collapse-item title="📄 所有申请列表API原始数据" name="all">
|
||||
<pre>{{ JSON.stringify(debugResult.allList, null, 2) }}</pre>
|
||||
</el-collapse-item>
|
||||
</el-collapse>
|
||||
</div>
|
||||
|
||||
<div v-else class="no-debug">
|
||||
<el-empty description="点击"开始检查"按钮来诊断数据一致性问题" />
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="DebugPanel">
|
||||
import { ref } from 'vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { Tools } from '@element-plus/icons-vue';
|
||||
import {
|
||||
getCollegeStatistics,
|
||||
listPendingApplications,
|
||||
listCollegeApplications,
|
||||
type StatisticsVO,
|
||||
type WorkStudyApplicationVO
|
||||
} from '@/api/jcbt/workStudyApplicationCollegeReview';
|
||||
|
||||
// 响应式数据
|
||||
const debugging = ref(false);
|
||||
const debugResult = ref<any>(null);
|
||||
|
||||
// 运行调试检查
|
||||
const runDebug = async () => {
|
||||
debugging.value = true;
|
||||
debugResult.value = null;
|
||||
|
||||
try {
|
||||
console.log('🔍 开始数据一致性调试...');
|
||||
|
||||
// 1. 获取统计数据
|
||||
const statsResponse = await getCollegeStatistics();
|
||||
const statistics = statsResponse.data;
|
||||
|
||||
// 2. 获取待审核列表数据
|
||||
const pendingResponse = await listPendingApplications({
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
});
|
||||
const pendingList = pendingResponse.data;
|
||||
|
||||
// 3. 获取所有申请列表数据
|
||||
const allResponse = await listCollegeApplications({
|
||||
pageNum: 1,
|
||||
pageSize: 1
|
||||
});
|
||||
const allList = allResponse.data;
|
||||
|
||||
// 4. 检查一致性
|
||||
const isConsistent = statistics.pendingCount === pendingList.total;
|
||||
const message = isConsistent
|
||||
? '统计数据与列表数据一致,没有发现问题。'
|
||||
: `数据不一致:统计API显示${statistics.pendingCount}条待审核记录,但列表API显示${pendingList.total}条记录。`;
|
||||
|
||||
debugResult.value = {
|
||||
statistics,
|
||||
pendingList,
|
||||
allList,
|
||||
isConsistent,
|
||||
message,
|
||||
timestamp: new Date().toLocaleString()
|
||||
};
|
||||
|
||||
console.log('✅ 调试检查完成:', debugResult.value);
|
||||
|
||||
if (!isConsistent) {
|
||||
ElMessage.warning('发现数据不一致问题,请查看详细信息');
|
||||
} else {
|
||||
ElMessage.success('数据一致性检查通过');
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
console.error('❌ 调试检查失败:', error);
|
||||
ElMessage.error('调试检查失败,请查看控制台日志');
|
||||
} finally {
|
||||
debugging.value = false;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.debug-panel {
|
||||
margin-bottom: 20px;
|
||||
border: 2px dashed #e6a23c;
|
||||
|
||||
.debug-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
.el-icon {
|
||||
margin-right: 8px;
|
||||
color: #e6a23c;
|
||||
}
|
||||
|
||||
span {
|
||||
flex: 1;
|
||||
font-weight: 600;
|
||||
color: #606266;
|
||||
}
|
||||
}
|
||||
|
||||
.debug-content {
|
||||
.debug-section {
|
||||
margin-bottom: 20px;
|
||||
|
||||
h4 {
|
||||
margin: 0 0 12px 0;
|
||||
color: #303133;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
|
||||
.consistency-check {
|
||||
margin: 20px 0;
|
||||
|
||||
h4 {
|
||||
margin: 0 0 12px 0;
|
||||
color: #303133;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.inconsistency-details {
|
||||
margin-top: 12px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
|
||||
.vs {
|
||||
color: #f56c6c;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.debug-details {
|
||||
margin-top: 20px;
|
||||
|
||||
pre {
|
||||
background: #f5f7fa;
|
||||
padding: 12px;
|
||||
border-radius: 4px;
|
||||
font-size: 12px;
|
||||
max-height: 300px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.no-debug {
|
||||
text-align: center;
|
||||
padding: 40px 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
+401
@@ -0,0 +1,401 @@
|
||||
<template>
|
||||
<div class="pending-applications">
|
||||
<!-- 搜索表单 -->
|
||||
<el-card class="search-card" shadow="never">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" class="search-form">
|
||||
<el-form-item label="岗位名称" prop="positionName">
|
||||
<el-input v-model="queryParams.positionName" placeholder="请输入岗位名称" clearable style="width: 200px" @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="学生姓名" prop="studentName">
|
||||
<el-input v-model="queryParams.studentName" placeholder="请输入学生姓名" clearable style="width: 200px" @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="学号" prop="studentNo">
|
||||
<el-input v-model="queryParams.studentNo" placeholder="请输入学号" clearable style="width: 200px" @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="申请日期" prop="applicationDate">
|
||||
<el-date-picker
|
||||
v-model="queryParams.applicationDate"
|
||||
type="date"
|
||||
placeholder="选择申请日期"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
style="width: 200px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<!-- 操作按钮和数据表格 -->
|
||||
<el-card class="table-card" shadow="never">
|
||||
<!-- 操作按钮 -->
|
||||
<div class="table-header">
|
||||
<div class="table-title">
|
||||
<el-icon><Clock /></el-icon>
|
||||
待审核申请列表
|
||||
</div>
|
||||
<div class="table-actions">
|
||||
<el-button type="success" plain icon="Check" :disabled="multiple" @click="handleBatchReview('APPROVED')"> 批量通过 </el-button>
|
||||
<el-button type="danger" plain icon="Close" :disabled="multiple" @click="handleBatchReview('REJECTED')"> 批量拒绝 </el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 数据表格 -->
|
||||
<el-table v-loading="loading" :data="applicationList" @selection-change="handleSelectionChange" row-key="id" stripe>
|
||||
<el-table-column type="selection" width="50" align="center" />
|
||||
<el-table-column label="序号" type="index" width="60" align="center" />
|
||||
<el-table-column label="岗位名称" prop="positionName" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column label="学生信息" min-width="160">
|
||||
<template #default="{ row }">
|
||||
<div class="student-info">
|
||||
<div class="name">{{ row.studentName }}</div>
|
||||
<div class="detail">{{ row.studentNo }} | {{ row.className }}</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="专业年级" min-width="140">
|
||||
<template #default="{ row }">
|
||||
<div>{{ row.majorName }}</div>
|
||||
<div class="text-gray">{{ row.grade }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="联系方式" min-width="120">
|
||||
<template #default="{ row }">
|
||||
<div>{{ row.contactPhone }}</div>
|
||||
<div class="text-gray">{{ row.email }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="申请理由" prop="applicationReason" min-width="200" show-overflow-tooltip />
|
||||
<el-table-column label="申请时间" prop="applicationDate" width="110" align="center" />
|
||||
<el-table-column label="操作" fixed="right" width="200" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-button type="primary" size="small" icon="View" @click="handleDetail(row)"> 详情 </el-button>
|
||||
<el-button type="success" size="small" icon="Check" @click="handleReview(row, 'APPROVED')"> 通过 </el-button>
|
||||
<el-button type="danger" size="small" icon="Close" @click="handleReview(row, 'REJECTED')"> 拒绝 </el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 分页 -->
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</el-card>
|
||||
|
||||
<!-- 审核对话框 -->
|
||||
<el-dialog v-model="reviewDialog.visible" :title="reviewDialog.title" width="600px" append-to-body :close-on-click-modal="false">
|
||||
<el-form ref="reviewFormRef" :model="reviewDialog.form" :rules="reviewRules" label-width="100px">
|
||||
<el-form-item label="审核结果" prop="reviewResult">
|
||||
<el-radio-group v-model="reviewDialog.form.reviewResult">
|
||||
<el-radio value="APPROVED">
|
||||
<el-icon color="#67c23a"><Check /></el-icon>
|
||||
通过
|
||||
</el-radio>
|
||||
<el-radio value="REJECTED">
|
||||
<el-icon color="#f56c6c"><Close /></el-icon>
|
||||
拒绝
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="审核意见" prop="reviewComment">
|
||||
<el-input v-model="reviewDialog.form.reviewComment" type="textarea" :rows="4" placeholder="请输入审核意见(必填)" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="reviewDialog.visible = false">取消</el-button>
|
||||
<el-button type="primary" :loading="reviewDialog.submitting" @click="submitReview"> 确认审核 </el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 详情对话框 -->
|
||||
<ApplicationDetail v-model:visible="detailDialog.visible" :application-id="detailDialog.applicationId" @refresh="getList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="PendingApplications">
|
||||
import { ref, reactive, onMounted } from 'vue';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { Search, Clock, Check, Close, View } from '@element-plus/icons-vue';
|
||||
import {
|
||||
listPendingApplications,
|
||||
reviewApplication,
|
||||
batchReviewApplications,
|
||||
type WorkStudyApplicationVO,
|
||||
type WorkStudyApplicationQuery,
|
||||
type ReviewForm
|
||||
} from '@/api/jcbt/workStudyApplicationCollegeReview';
|
||||
import ApplicationDetail from './ApplicationDetail.vue';
|
||||
|
||||
// 定义事件
|
||||
const emit = defineEmits<{
|
||||
'refresh-statistics': [];
|
||||
}>();
|
||||
|
||||
// 响应式数据
|
||||
const loading = ref(false);
|
||||
const applicationList = ref<WorkStudyApplicationVO[]>([]);
|
||||
const total = ref(0);
|
||||
const ids = ref<Array<string | number>>([]);
|
||||
const multiple = ref(true);
|
||||
const queryRef = ref();
|
||||
const reviewFormRef = ref();
|
||||
|
||||
// 查询参数
|
||||
const queryParams = ref<WorkStudyApplicationQuery>({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
positionName: '',
|
||||
studentName: '',
|
||||
studentNo: '',
|
||||
applicationDate: ''
|
||||
});
|
||||
|
||||
// 审核对话框数据
|
||||
const reviewDialog = reactive({
|
||||
visible: false,
|
||||
title: '',
|
||||
type: 'single', // single | batch
|
||||
submitting: false,
|
||||
form: {
|
||||
applicationId: '',
|
||||
reviewResult: '',
|
||||
reviewComment: ''
|
||||
}
|
||||
});
|
||||
|
||||
// 详情对话框数据
|
||||
const detailDialog = reactive({
|
||||
visible: false,
|
||||
applicationId: ''
|
||||
});
|
||||
|
||||
// 审核表单验证规则
|
||||
const reviewRules = {
|
||||
reviewResult: [{ required: true, message: '请选择审核结果', trigger: 'change' }],
|
||||
reviewComment: [{ required: true, message: '请输入审核意见', trigger: 'blur' }]
|
||||
};
|
||||
|
||||
// 获取待审核申请列表
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
try {
|
||||
console.log('🔍 开始获取待审核申请列表...');
|
||||
console.log('📝 查询参数:', queryParams.value);
|
||||
|
||||
const { data } = await listPendingApplications(queryParams.value);
|
||||
console.log('📋 列表API返回数据:', data);
|
||||
|
||||
applicationList.value = data.rows || [];
|
||||
total.value = data.total || 0;
|
||||
|
||||
console.log('✅ 待审核申请列表获取成功 - 总数:', total.value, '当前页数据:', applicationList.value.length);
|
||||
|
||||
// 如果列表为空但有查询条件,提示用户
|
||||
if (total.value === 0 && applicationList.value.length === 0) {
|
||||
const hasSearchConditions = queryParams.value.positionName ||
|
||||
queryParams.value.studentName ||
|
||||
queryParams.value.studentNo ||
|
||||
queryParams.value.applicationDate;
|
||||
|
||||
if (hasSearchConditions) {
|
||||
console.log('📝 当前有搜索条件,列表为空可能是正常的');
|
||||
} else {
|
||||
console.log('📝 无搜索条件但列表为空,可能确实没有待审核数据');
|
||||
}
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
console.error('❌ 获取待审核申请列表失败:', error);
|
||||
ElMessage.error('获取数据失败');
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 搜索
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
};
|
||||
|
||||
// 重置搜索
|
||||
const resetQuery = () => {
|
||||
queryRef.value.resetFields();
|
||||
queryParams.value = {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
positionName: '',
|
||||
studentName: '',
|
||||
studentNo: '',
|
||||
applicationDate: ''
|
||||
};
|
||||
getList();
|
||||
};
|
||||
|
||||
// 多选框选中数据
|
||||
const handleSelectionChange = (selection: WorkStudyApplicationVO[]) => {
|
||||
ids.value = selection.map((item) => item.id!);
|
||||
multiple.value = !selection.length;
|
||||
};
|
||||
|
||||
// 查看详情
|
||||
const handleDetail = (row: WorkStudyApplicationVO) => {
|
||||
detailDialog.visible = true;
|
||||
detailDialog.applicationId = row.id as string;
|
||||
};
|
||||
|
||||
// 单个审核
|
||||
const handleReview = (row: WorkStudyApplicationVO, result: string) => {
|
||||
reviewDialog.visible = true;
|
||||
reviewDialog.title = `审核申请 - ${row.studentName}`;
|
||||
reviewDialog.type = 'single';
|
||||
reviewDialog.form = {
|
||||
applicationId: row.id as string,
|
||||
reviewResult: result,
|
||||
reviewComment: ''
|
||||
};
|
||||
};
|
||||
|
||||
// 批量审核
|
||||
const handleBatchReview = (result: string) => {
|
||||
if (!ids.value.length) {
|
||||
ElMessage.warning('请选择要审核的申请');
|
||||
return;
|
||||
}
|
||||
|
||||
reviewDialog.visible = true;
|
||||
reviewDialog.title = `批量${result === 'APPROVED' ? '通过' : '拒绝'}申请`;
|
||||
reviewDialog.type = 'batch';
|
||||
reviewDialog.form = {
|
||||
applicationId: '',
|
||||
reviewResult: result,
|
||||
reviewComment: ''
|
||||
};
|
||||
};
|
||||
|
||||
// 提交审核
|
||||
const submitReview = async () => {
|
||||
if (!reviewFormRef.value) return;
|
||||
|
||||
const valid = await reviewFormRef.value.validate();
|
||||
if (!valid) return;
|
||||
|
||||
try {
|
||||
reviewDialog.submitting = true;
|
||||
|
||||
if (reviewDialog.type === 'single') {
|
||||
await reviewApplication(reviewDialog.form);
|
||||
} else {
|
||||
await batchReviewApplications(ids.value, reviewDialog.form.reviewResult, reviewDialog.form.reviewComment);
|
||||
}
|
||||
|
||||
ElMessage.success('审核成功');
|
||||
reviewDialog.visible = false;
|
||||
getList();
|
||||
emit('refresh-statistics');
|
||||
} catch (error) {
|
||||
console.error('审核失败:', error);
|
||||
ElMessage.error('审核失败');
|
||||
} finally {
|
||||
reviewDialog.submitting = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 暴露方法给父组件调用
|
||||
defineExpose({
|
||||
getList
|
||||
});
|
||||
|
||||
// 初始化
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.pending-applications {
|
||||
.search-card {
|
||||
margin-bottom: 16px;
|
||||
border: none;
|
||||
|
||||
:deep(.el-card__body) {
|
||||
padding: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.search-form {
|
||||
.el-form-item {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.table-card {
|
||||
border: none;
|
||||
|
||||
:deep(.el-card__body) {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.table-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 20px 20px 16px;
|
||||
border-bottom: 1px solid #ebeef5;
|
||||
|
||||
.table-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
|
||||
.el-icon {
|
||||
margin-right: 8px;
|
||||
color: #e6a23c;
|
||||
}
|
||||
}
|
||||
|
||||
.table-actions {
|
||||
.el-button + .el-button {
|
||||
margin-left: 8px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.el-table {
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
.student-info {
|
||||
.name {
|
||||
font-weight: 500;
|
||||
color: #303133;
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
|
||||
.detail {
|
||||
font-size: 12px;
|
||||
color: #909399;
|
||||
}
|
||||
}
|
||||
|
||||
.text-gray {
|
||||
color: #909399;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.dialog-footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
|
||||
.el-button + .el-button {
|
||||
margin-left: 12px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,360 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 页面标题 -->
|
||||
<div class="page-header">
|
||||
<h2 class="page-title">
|
||||
<el-icon class="page-icon"><User /></el-icon>
|
||||
学院审核
|
||||
</h2>
|
||||
<p class="page-description">管理本学院学生的勤工俭学申请审核</p>
|
||||
</div>
|
||||
|
||||
<!-- 统计卡片 -->
|
||||
<el-row :gutter="20" class="statistics-row">
|
||||
<el-col :span="6">
|
||||
<el-card class="statistics-card pending" shadow="hover">
|
||||
<div class="card-content">
|
||||
<div class="card-icon">
|
||||
<el-icon><Clock /></el-icon>
|
||||
</div>
|
||||
<div class="card-info">
|
||||
<div class="card-title">待审核</div>
|
||||
<div class="card-value">{{ statistics.pendingCount || 0 }}</div>
|
||||
<div class="card-desc">需要处理的申请</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-card class="statistics-card approved" shadow="hover">
|
||||
<div class="card-content">
|
||||
<div class="card-icon">
|
||||
<el-icon><Check /></el-icon>
|
||||
</div>
|
||||
<div class="card-info">
|
||||
<div class="card-title">已通过</div>
|
||||
<div class="card-value">{{ statistics.approvedCount || 0 }}</div>
|
||||
<div class="card-desc">学院审核通过</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-card class="statistics-card rejected" shadow="hover">
|
||||
<div class="card-content">
|
||||
<div class="card-icon">
|
||||
<el-icon><Close /></el-icon>
|
||||
</div>
|
||||
<div class="card-info">
|
||||
<div class="card-title">已拒绝</div>
|
||||
<div class="card-value">{{ statistics.rejectedCount || 0 }}</div>
|
||||
<div class="card-desc">学院审核拒绝</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-card class="statistics-card final-approved" shadow="hover">
|
||||
<div class="card-content">
|
||||
<div class="card-icon">
|
||||
<el-icon><Trophy /></el-icon>
|
||||
</div>
|
||||
<div class="card-info">
|
||||
<div class="card-title">最终通过</div>
|
||||
<div class="card-value">{{ statistics.finalApprovedCount || 0 }}</div>
|
||||
<div class="card-desc">最终审核通过</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 内容标签页 -->
|
||||
<el-card class="main-content" shadow="never">
|
||||
<el-tabs v-model="activeTab" @tab-change="handleTabChange" class="review-tabs">
|
||||
<el-tab-pane name="pending">
|
||||
<template #label>
|
||||
<span class="tab-label">
|
||||
<el-icon><Clock /></el-icon>
|
||||
待审核申请
|
||||
<el-badge v-if="statistics.pendingCount" :value="statistics.pendingCount" class="tab-badge" />
|
||||
</span>
|
||||
</template>
|
||||
<PendingApplications ref="pendingRef" @refresh-statistics="getStatistics" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane name="all">
|
||||
<template #label>
|
||||
<span class="tab-label">
|
||||
<el-icon><List /></el-icon>
|
||||
所有申请
|
||||
</span>
|
||||
</template>
|
||||
<AllApplications ref="allRef" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane name="debug" v-if="showDebugPanel">
|
||||
<template #label>
|
||||
<span class="tab-label">
|
||||
<el-icon><Tools /></el-icon>
|
||||
调试面板
|
||||
</span>
|
||||
</template>
|
||||
<DebugPanel />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="CollegeReview">
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { Clock, Check, Close, Trophy, User, List, Tools } from '@element-plus/icons-vue';
|
||||
import { getCollegeStatistics, getCollegeStatisticsByList, listCollegeApplications, type StatisticsVO } from '@/api/jcbt/workStudyApplicationCollegeReview';
|
||||
import PendingApplications from './components/PendingApplications.vue';
|
||||
import AllApplications from './components/AllApplications.vue';
|
||||
import DebugPanel from './components/DebugPanel.vue';
|
||||
|
||||
// 响应式数据
|
||||
const activeTab = ref('pending');
|
||||
const statistics = ref<StatisticsVO>({});
|
||||
const pendingRef = ref();
|
||||
const allRef = ref();
|
||||
const showDebugPanel = ref(false); // Added ref for debug panel visibility
|
||||
|
||||
// 获取统计数据
|
||||
const getStatistics = async () => {
|
||||
try {
|
||||
console.log('🔍 开始获取学院审核统计数据...');
|
||||
|
||||
// 方案1:使用原始统计API
|
||||
const { data } = await getCollegeStatistics();
|
||||
console.log('📊 统计API返回数据:', data);
|
||||
|
||||
// 方案2:通过列表API验证待审核数量
|
||||
try {
|
||||
const listResult = await listCollegeApplications({
|
||||
pageNum: 1,
|
||||
pageSize: 1,
|
||||
status: 'SUBMITTED'
|
||||
});
|
||||
console.log('📋 列表API验证 - 待审核数量:', listResult.data.total);
|
||||
|
||||
// 如果统计API的待审核数量与列表API不一致,使用列表API的数据
|
||||
if (data.pendingCount !== listResult.data.total) {
|
||||
console.warn('⚠️ 统计数据不一致!统计API:', data.pendingCount, '列表API:', listResult.data.total);
|
||||
data.pendingCount = listResult.data.total;
|
||||
console.log('✅ 已使用列表API数据修正待审核数量:', data.pendingCount);
|
||||
}
|
||||
} catch (listError) {
|
||||
console.warn('📋 列表API验证失败:', listError);
|
||||
}
|
||||
|
||||
statistics.value = data;
|
||||
console.log('✅ 最终统计数据:', statistics.value);
|
||||
|
||||
} catch (error) {
|
||||
console.error('❌ 获取统计数据失败:', error);
|
||||
statistics.value = {
|
||||
pendingCount: 0,
|
||||
approvedCount: 0,
|
||||
rejectedCount: 0,
|
||||
finalApprovedCount: 0,
|
||||
totalCount: 0
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
// 标签页切换
|
||||
const handleTabChange = (tabName: string) => {
|
||||
activeTab.value = tabName;
|
||||
if (tabName === 'pending' && pendingRef.value) {
|
||||
pendingRef.value.getList();
|
||||
} else if (tabName === 'all' && allRef.value) {
|
||||
allRef.value.getList();
|
||||
}
|
||||
};
|
||||
|
||||
// 页面初始化
|
||||
onMounted(() => {
|
||||
getStatistics();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.app-container {
|
||||
padding: 24px;
|
||||
background: #f5f7fa;
|
||||
min-height: calc(100vh - 84px);
|
||||
}
|
||||
|
||||
.page-header {
|
||||
margin-bottom: 24px;
|
||||
|
||||
.page-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin: 0 0 8px 0;
|
||||
font-size: 24px;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
|
||||
.page-icon {
|
||||
margin-right: 12px;
|
||||
color: #409eff;
|
||||
}
|
||||
}
|
||||
|
||||
.page-description {
|
||||
margin: 0;
|
||||
color: #909399;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
|
||||
.statistics-row {
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.statistics-card {
|
||||
border: none;
|
||||
transition: all 0.3s ease;
|
||||
|
||||
&:hover {
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
.card-content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 20px 0;
|
||||
}
|
||||
|
||||
.card-icon {
|
||||
margin-right: 16px;
|
||||
width: 56px;
|
||||
height: 56px;
|
||||
border-radius: 12px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
.card-info {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.card-title {
|
||||
font-size: 14px;
|
||||
color: #909399;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.card-value {
|
||||
font-size: 28px;
|
||||
font-weight: 600;
|
||||
margin-bottom: 2px;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.card-desc {
|
||||
font-size: 12px;
|
||||
color: #c0c4cc;
|
||||
}
|
||||
|
||||
&.pending {
|
||||
.card-icon {
|
||||
background: linear-gradient(135deg, #ffeaa7 0%, #fab1a0 100%);
|
||||
color: #d63031;
|
||||
}
|
||||
.card-value {
|
||||
color: #e17055;
|
||||
}
|
||||
}
|
||||
|
||||
&.approved {
|
||||
.card-icon {
|
||||
background: linear-gradient(135deg, #55efc4 0%, #00b894 100%);
|
||||
color: #00695c;
|
||||
}
|
||||
.card-value {
|
||||
color: #00b894;
|
||||
}
|
||||
}
|
||||
|
||||
&.rejected {
|
||||
.card-icon {
|
||||
background: linear-gradient(135deg, #fd79a8 0%, #e84393 100%);
|
||||
color: #ad1457;
|
||||
}
|
||||
.card-value {
|
||||
color: #e84393;
|
||||
}
|
||||
}
|
||||
|
||||
&.final-approved {
|
||||
.card-icon {
|
||||
background: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%);
|
||||
color: #4527a0;
|
||||
}
|
||||
.card-value {
|
||||
color: #6c5ce7;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.main-content {
|
||||
border: none;
|
||||
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
||||
|
||||
:deep(.el-card__body) {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.review-tabs {
|
||||
:deep(.el-tabs__header) {
|
||||
padding: 20px 20px 0;
|
||||
margin: 0;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
:deep(.el-tabs__nav-wrap::after) {
|
||||
background: #e4e7ed;
|
||||
}
|
||||
|
||||
:deep(.el-tabs__item) {
|
||||
padding: 0 20px;
|
||||
font-size: 16px;
|
||||
color: #606266;
|
||||
|
||||
&.is-active {
|
||||
color: #409eff;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.el-tabs__content) {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.tab-label {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.el-icon {
|
||||
margin-right: 6px;
|
||||
}
|
||||
|
||||
.tab-badge {
|
||||
margin-left: 8px;
|
||||
|
||||
:deep(.el-badge__content) {
|
||||
font-size: 11px;
|
||||
height: 16px;
|
||||
line-height: 16px;
|
||||
padding: 0 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,612 @@
|
||||
<template>
|
||||
<el-dialog v-model="dialogVisible" :title="dialogTitle" width="80%" :close-on-click-modal="false" class="application-detail-dialog">
|
||||
<div class="detail-container" v-loading="loading">
|
||||
<!-- 申请基本信息 -->
|
||||
<el-card class="info-card" shadow="never" v-if="applicationData">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<el-icon><User /></el-icon>
|
||||
申请信息
|
||||
</span>
|
||||
<el-tag :type="getStatusType(applicationData.applicationStatus)" size="large">
|
||||
{{ getStatusText(applicationData.applicationStatus) }}
|
||||
</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<el-descriptions :column="2" border size="default">
|
||||
<el-descriptions-item label="学生姓名">
|
||||
{{ applicationData.studentName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="学号">
|
||||
{{ applicationData.studentNumber }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="联系电话">
|
||||
{{ applicationData.contactPhone }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="年级">
|
||||
{{ applicationData.grade }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="学院">
|
||||
{{ applicationData.collegeName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="专业">
|
||||
{{ applicationData.majorName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="班级">
|
||||
{{ applicationData.className }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="家庭经济情况">
|
||||
<el-tag :type="getEconomicStatusType(applicationData.familyFinancialStatus)" size="small">
|
||||
{{ applicationData.familyFinancialStatus }}
|
||||
</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="计划工作时长">
|
||||
<span class="work-hours">{{ applicationData.plannedWorkHours }}小时/周</span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="申请时间">
|
||||
{{ applicationData.createTime }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
|
||||
<!-- 岗位信息 -->
|
||||
<el-card class="info-card" shadow="never" v-if="applicationData">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<el-icon><Briefcase /></el-icon>
|
||||
岗位信息
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<el-descriptions :column="2" border size="default">
|
||||
<el-descriptions-item label="岗位名称" :span="2">
|
||||
<el-tag type="primary" size="default">{{ applicationData.positionName }}</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="工作地点">
|
||||
{{ applicationData.workLocation }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="岗位类型">
|
||||
{{ applicationData.positionType }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
|
||||
<!-- 申请详情 -->
|
||||
<el-card class="info-card" shadow="never" v-if="applicationData">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<el-icon><Document /></el-icon>
|
||||
申请详情
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div class="detail-content">
|
||||
<div class="detail-item">
|
||||
<div class="detail-label">申请理由</div>
|
||||
<div class="detail-value">{{ applicationData.applicationReason }}</div>
|
||||
</div>
|
||||
|
||||
<div class="detail-item">
|
||||
<div class="detail-label">个人能力及经验</div>
|
||||
<div class="detail-value">{{ applicationData.personalAbility }}</div>
|
||||
</div>
|
||||
|
||||
<div class="detail-item">
|
||||
<div class="detail-label">时间安排</div>
|
||||
<div class="detail-value">{{ applicationData.timeArrangement }}</div>
|
||||
</div>
|
||||
|
||||
<div class="detail-item" v-if="applicationData.remark">
|
||||
<div class="detail-label">备注</div>
|
||||
<div class="detail-value">{{ applicationData.remark }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<!-- 审核流程 -->
|
||||
<el-card class="info-card" shadow="never" v-if="applicationData">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<el-icon><Operation /></el-icon>
|
||||
审核流程
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<el-steps :active="getStepActive()" align-center class="review-steps">
|
||||
<el-step title="申请提交" :description="applicationData.createTime">
|
||||
<template #icon>
|
||||
<el-icon class="step-icon submitted"><EditPen /></el-icon>
|
||||
</template>
|
||||
</el-step>
|
||||
|
||||
<el-step title="学院审核" :description="getStepDescription('college')" :status="getStepStatus('college')">
|
||||
<template #icon>
|
||||
<el-icon class="step-icon" :class="getStepIconClass('college')"><School /></el-icon>
|
||||
</template>
|
||||
</el-step>
|
||||
|
||||
<el-step title="学生处审核" :description="getStepDescription('final')" :status="getStepStatus('final')">
|
||||
<template #icon>
|
||||
<el-icon class="step-icon" :class="getStepIconClass('final')"><OfficeBuilding /></el-icon>
|
||||
</template>
|
||||
</el-step>
|
||||
|
||||
<el-step title="审核完成" :description="getFinalDescription()" :status="getFinalStatus()">
|
||||
<template #icon>
|
||||
<el-icon class="step-icon" :class="getFinalIconClass()"><CircleCheck /></el-icon>
|
||||
</template>
|
||||
</el-step>
|
||||
</el-steps>
|
||||
|
||||
<!-- 审核意见 -->
|
||||
<div class="review-comments" v-if="hasReviewComments()">
|
||||
<div class="comment-item" v-if="applicationData.collegeReviewComment">
|
||||
<div class="comment-header">
|
||||
<span class="comment-title">学院审核意见</span>
|
||||
<span class="comment-time">{{ applicationData.collegeReviewTime }}</span>
|
||||
</div>
|
||||
<div class="comment-content">{{ applicationData.collegeReviewComment }}</div>
|
||||
<div class="comment-reviewer">审核人:{{ applicationData.collegeReviewerName }}</div>
|
||||
</div>
|
||||
|
||||
<div class="comment-item" v-if="applicationData.finalReviewComment">
|
||||
<div class="comment-header">
|
||||
<span class="comment-title">学生处审核意见</span>
|
||||
<span class="comment-time">{{ applicationData.finalReviewTime }}</span>
|
||||
</div>
|
||||
<div class="comment-content">{{ applicationData.finalReviewComment }}</div>
|
||||
<div class="comment-reviewer">审核人:{{ applicationData.finalReviewerName }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">关闭</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue';
|
||||
import { getWorkStudyApplication } from '@/api/jcbt/workStudyApplication';
|
||||
import { getWorkStudyPosition } from '@/api/jcbt/workStudyPosition';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import type { WorkStudyApplicationVO } from '@/api/jcbt/workStudyApplication';
|
||||
|
||||
// 响应式数据
|
||||
const dialogVisible = ref(false);
|
||||
const loading = ref(false);
|
||||
const applicationData = ref<WorkStudyApplicationVO | null>(null);
|
||||
const currentMode = ref<'application' | 'position'>('application');
|
||||
|
||||
// 计算属性
|
||||
const dialogTitle = computed(() => {
|
||||
if (currentMode.value === 'application') {
|
||||
return '申请详情';
|
||||
} else {
|
||||
return '岗位详情';
|
||||
}
|
||||
});
|
||||
|
||||
/** 获取状态类型 */
|
||||
const getStatusType = (status: string) => {
|
||||
const typeMap: Record<string, string> = {
|
||||
DRAFT: 'info',
|
||||
SUBMITTED: 'warning',
|
||||
COLLEGE_APPROVED: 'success',
|
||||
COLLEGE_REJECTED: 'danger',
|
||||
FINAL_APPROVED: 'success',
|
||||
FINAL_REJECTED: 'danger',
|
||||
CANCELLED: 'info'
|
||||
};
|
||||
return typeMap[status] || 'info';
|
||||
};
|
||||
|
||||
/** 获取状态文本 */
|
||||
const getStatusText = (status: string) => {
|
||||
const textMap: Record<string, string> = {
|
||||
DRAFT: '草稿',
|
||||
SUBMITTED: '已提交',
|
||||
COLLEGE_APPROVED: '学院审核通过',
|
||||
COLLEGE_REJECTED: '学院审核不通过',
|
||||
FINAL_APPROVED: '最终审核通过',
|
||||
FINAL_REJECTED: '最终审核不通过',
|
||||
CANCELLED: '已取消'
|
||||
};
|
||||
return textMap[status] || '未知状态';
|
||||
};
|
||||
|
||||
/** 获取经济状况类型 */
|
||||
const getEconomicStatusType = (status: string) => {
|
||||
const typeMap: Record<string, string> = {
|
||||
'特困': 'danger',
|
||||
'贫困': 'warning',
|
||||
'一般': 'info',
|
||||
'良好': 'success'
|
||||
};
|
||||
return typeMap[status] || 'info';
|
||||
};
|
||||
|
||||
/** 获取步骤激活状态 */
|
||||
const getStepActive = () => {
|
||||
if (!applicationData.value) return 0;
|
||||
|
||||
const status = applicationData.value.applicationStatus;
|
||||
switch (status) {
|
||||
case 'DRAFT':
|
||||
case 'SUBMITTED':
|
||||
return 1;
|
||||
case 'COLLEGE_APPROVED':
|
||||
return 2;
|
||||
case 'FINAL_APPROVED':
|
||||
case 'FINAL_REJECTED':
|
||||
case 'COLLEGE_REJECTED':
|
||||
return 3;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
/** 获取步骤状态 */
|
||||
const getStepStatus = (step: 'college' | 'final') => {
|
||||
if (!applicationData.value) return 'wait';
|
||||
|
||||
const status = applicationData.value.applicationStatus;
|
||||
|
||||
if (step === 'college') {
|
||||
if (status === 'COLLEGE_APPROVED') return 'finish';
|
||||
if (status === 'COLLEGE_REJECTED') return 'error';
|
||||
if (['SUBMITTED'].includes(status)) return 'process';
|
||||
return 'wait';
|
||||
}
|
||||
|
||||
if (step === 'final') {
|
||||
if (status === 'FINAL_APPROVED') return 'finish';
|
||||
if (status === 'FINAL_REJECTED') return 'error';
|
||||
if (status === 'COLLEGE_APPROVED') return 'process';
|
||||
return 'wait';
|
||||
}
|
||||
|
||||
return 'wait';
|
||||
};
|
||||
|
||||
/** 获取步骤描述 */
|
||||
const getStepDescription = (step: 'college' | 'final') => {
|
||||
if (!applicationData.value) return '';
|
||||
|
||||
if (step === 'college') {
|
||||
if (applicationData.value.collegeReviewTime) {
|
||||
return applicationData.value.collegeReviewTime;
|
||||
}
|
||||
if (['SUBMITTED'].includes(applicationData.value.applicationStatus)) {
|
||||
return '待审核';
|
||||
}
|
||||
}
|
||||
|
||||
if (step === 'final') {
|
||||
if (applicationData.value.finalReviewTime) {
|
||||
return applicationData.value.finalReviewTime;
|
||||
}
|
||||
if (applicationData.value.applicationStatus === 'COLLEGE_APPROVED') {
|
||||
return '待审核';
|
||||
}
|
||||
}
|
||||
|
||||
return '';
|
||||
};
|
||||
|
||||
/** 获取步骤图标类名 */
|
||||
const getStepIconClass = (step: 'college' | 'final') => {
|
||||
const status = getStepStatus(step);
|
||||
return (
|
||||
{
|
||||
'finish': 'approved',
|
||||
'error': 'rejected',
|
||||
'process': 'processing',
|
||||
'wait': 'waiting'
|
||||
}[status] || 'waiting'
|
||||
);
|
||||
};
|
||||
|
||||
/** 获取最终状态 */
|
||||
const getFinalStatus = () => {
|
||||
if (!applicationData.value) return 'wait';
|
||||
|
||||
const status = applicationData.value.applicationStatus;
|
||||
if (status === 'FINAL_APPROVED') return 'finish';
|
||||
if (['FINAL_REJECTED', 'COLLEGE_REJECTED'].includes(status)) return 'error';
|
||||
return 'wait';
|
||||
};
|
||||
|
||||
/** 获取最终描述 */
|
||||
const getFinalDescription = () => {
|
||||
if (!applicationData.value) return '';
|
||||
|
||||
const status = applicationData.value.applicationStatus;
|
||||
if (status === 'FINAL_APPROVED') return '申请通过';
|
||||
if (status === 'FINAL_REJECTED') return '申请被拒绝';
|
||||
if (status === 'COLLEGE_REJECTED') return '申请被拒绝';
|
||||
return '';
|
||||
};
|
||||
|
||||
/** 获取最终图标类名 */
|
||||
const getFinalIconClass = () => {
|
||||
return (
|
||||
{
|
||||
'finish': 'approved',
|
||||
'error': 'rejected',
|
||||
'wait': 'waiting'
|
||||
}[getFinalStatus()] || 'waiting'
|
||||
);
|
||||
};
|
||||
|
||||
/** 是否有审核意见 */
|
||||
const hasReviewComments = () => {
|
||||
return applicationData.value?.collegeReviewComment || applicationData.value?.finalReviewComment;
|
||||
};
|
||||
|
||||
/** 显示详情 */
|
||||
const handleDetail = async (id: string | number, mode: 'application' | 'position' = 'application') => {
|
||||
currentMode.value = mode;
|
||||
dialogVisible.value = true;
|
||||
loading.value = true;
|
||||
|
||||
try {
|
||||
if (mode === 'application') {
|
||||
const res = await getWorkStudyApplication(id);
|
||||
applicationData.value = res.data;
|
||||
} else {
|
||||
// 岗位模式 - 显示岗位信息
|
||||
const res = await getWorkStudyPosition(id);
|
||||
// 将岗位信息转换为申请信息格式用于显示
|
||||
applicationData.value = {
|
||||
...res.data,
|
||||
applicationStatus: 'NOT_APPLIED'
|
||||
// 其他字段根据需要添加
|
||||
} as WorkStudyApplicationVO;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取详情失败:', error);
|
||||
ElMessage.error('获取详情失败');
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 暴露方法供父组件调用
|
||||
defineExpose({
|
||||
handleDetail
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.application-detail-dialog :deep(.el-dialog) {
|
||||
border-radius: 12px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.application-detail-dialog :deep(.el-dialog__header) {
|
||||
background: linear-gradient(135deg, rgb(93, 135, 255) 0%, rgb(73, 190, 255) 100%);
|
||||
color: white;
|
||||
padding: 20px 24px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.application-detail-dialog :deep(.el-dialog__title) {
|
||||
color: white;
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.application-detail-dialog :deep(.el-dialog__headerbtn .el-dialog__close) {
|
||||
color: white;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.application-detail-dialog :deep(.el-dialog__headerbtn .el-dialog__close):hover {
|
||||
color: rgba(255, 255, 255, 0.8);
|
||||
}
|
||||
|
||||
.application-detail-dialog :deep(.el-dialog__body) {
|
||||
padding: 20px 24px;
|
||||
max-height: 70vh;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.detail-container {
|
||||
.info-card {
|
||||
margin-bottom: 20px;
|
||||
border-radius: 8px;
|
||||
border: 1px solid #e4e7ed;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
border-color: rgba(93, 135, 255, 0.2);
|
||||
box-shadow: 0 2px 8px rgba(93, 135, 255, 0.08);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.card-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.card-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
font-weight: 600;
|
||||
font-size: 14px;
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
.card-title .el-icon {
|
||||
color: rgb(93, 135, 255);
|
||||
}
|
||||
|
||||
:deep(.el-card__header) {
|
||||
background: #fafbfc;
|
||||
border-bottom: 1px solid #e4e7ed;
|
||||
padding: 12px 16px;
|
||||
}
|
||||
|
||||
:deep(.el-card__body) {
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.work-hours {
|
||||
color: rgb(93, 135, 255);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
/* 申请详情内容 */
|
||||
.detail-content {
|
||||
.detail-item {
|
||||
margin-bottom: 20px;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.detail-label {
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
margin-bottom: 8px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.detail-value {
|
||||
color: #606266;
|
||||
line-height: 1.6;
|
||||
padding: 12px;
|
||||
background: #f8f9fa;
|
||||
border-radius: 6px;
|
||||
border-left: 3px solid rgb(93, 135, 255);
|
||||
}
|
||||
}
|
||||
|
||||
/* 审核流程样式 */
|
||||
.review-steps {
|
||||
margin-bottom: 24px;
|
||||
|
||||
:deep(.el-step__title) {
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
:deep(.el-step__description) {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
.step-icon {
|
||||
font-size: 18px;
|
||||
|
||||
&.submitted {
|
||||
color: rgb(93, 135, 255);
|
||||
}
|
||||
|
||||
&.approved {
|
||||
color: rgb(19, 222, 185);
|
||||
}
|
||||
|
||||
&.rejected {
|
||||
color: #f56c6c;
|
||||
}
|
||||
|
||||
&.processing {
|
||||
color: rgb(255, 174, 31);
|
||||
}
|
||||
|
||||
&.waiting {
|
||||
color: #c0c4cc;
|
||||
}
|
||||
}
|
||||
|
||||
/* 审核意见样式 */
|
||||
.review-comments {
|
||||
.comment-item {
|
||||
margin-bottom: 16px;
|
||||
padding: 16px;
|
||||
background: #f8f9fa;
|
||||
border-radius: 8px;
|
||||
border-left: 4px solid rgb(93, 135, 255);
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.comment-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.comment-title {
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.comment-time {
|
||||
color: #909399;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.comment-content {
|
||||
color: #606266;
|
||||
line-height: 1.5;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.comment-reviewer {
|
||||
color: #909399;
|
||||
font-size: 12px;
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
|
||||
.dialog-footer {
|
||||
text-align: center;
|
||||
padding: 16px 0;
|
||||
}
|
||||
|
||||
/* 响应式布局 */
|
||||
@media (max-width: 768px) {
|
||||
.application-detail-dialog :deep(.el-dialog) {
|
||||
width: 95% !important;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.card-header {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
:deep(.el-descriptions) {
|
||||
.el-descriptions__cell {
|
||||
padding: 8px !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,543 @@
|
||||
<template>
|
||||
<div class="position-detail" v-loading="loading">
|
||||
<!-- 岗位基本信息 -->
|
||||
<el-card class="position-info-card" shadow="never">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<el-icon><Briefcase /></el-icon>
|
||||
岗位信息
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<el-descriptions :column="2" border size="large">
|
||||
<el-descriptions-item label="岗位名称" :span="2">
|
||||
<el-tag type="primary" size="large">{{ positionData.positionName }}</el-tag>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="发布范围">
|
||||
<el-tag :type="positionData.positionScope === 'UNIVERSITY' ? 'success' : 'info'">
|
||||
{{ positionData.positionScopeName }}
|
||||
</el-tag>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="岗位状态">
|
||||
<el-tag :type="getStatusType(positionData.status)">
|
||||
{{ positionData.statusName }}
|
||||
</el-tag>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="需求人数">
|
||||
<span class="number-display">{{ positionData.requiredCount }}</span>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="当前人数">
|
||||
<span class="number-display" :class="{ 'text-success': (positionData.currentCount || 0) >= (positionData.requiredCount || 0) }">
|
||||
{{ positionData.currentCount || 0 }}
|
||||
</span>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="工作地点" v-if="positionData.workLocation">
|
||||
<div class="location-info">
|
||||
<el-icon><Location /></el-icon>
|
||||
{{ positionData.workLocation }}
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="工作时间" :span="positionData.workLocation ? 1 : 2">
|
||||
<div class="content-display">{{ positionData.workTime }}</div>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="有效期开始">
|
||||
<div class="date-display">{{ positionData.startDate }}</div>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="有效期结束">
|
||||
<div class="date-display">{{ positionData.endDate }}</div>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="联系老师">
|
||||
<div class="contact-info">
|
||||
<el-icon><User /></el-icon>
|
||||
{{ positionData.contactTeacher }}
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="联系电话">
|
||||
<div class="contact-info">
|
||||
<el-icon><Phone /></el-icon>
|
||||
{{ positionData.contactPhone }}
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="薪资情况" :span="2">
|
||||
<div class="content-display salary-info">
|
||||
<el-icon><Money /></el-icon>
|
||||
{{ positionData.salaryInfo }}
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="岗位要求" :span="2">
|
||||
<div class="requirements-content">
|
||||
<pre>{{ positionData.positionRequirements }}</pre>
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="发布学院" v-if="positionData.collegeName">
|
||||
<div class="college-info">
|
||||
<el-icon><School /></el-icon>
|
||||
{{ positionData.collegeName }}
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="创建时间">
|
||||
<div class="date-display">{{ positionData.createTime }}</div>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="更新时间" v-if="positionData.updateTime">
|
||||
<div class="date-display">{{ positionData.updateTime }}</div>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
|
||||
<!-- 申请状态卡片 -->
|
||||
<el-card class="application-status-card" shadow="never" v-if="applicationStatus">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<el-icon><DocumentChecked /></el-icon>
|
||||
我的申请状态
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div class="application-status-content">
|
||||
<div class="status-item">
|
||||
<span class="status-label">申请状态:</span>
|
||||
<el-tag :type="getApplicationStatusType(applicationStatus.applicationStatus)" size="large" class="status-tag">
|
||||
{{ applicationStatus.applicationStatusText }}
|
||||
</el-tag>
|
||||
</div>
|
||||
|
||||
<div class="status-item" v-if="applicationStatus.lastApplicationTime">
|
||||
<span class="status-label">申请时间:</span>
|
||||
<span class="status-value">{{ applicationStatus.lastApplicationTime }}</span>
|
||||
</div>
|
||||
|
||||
<div class="action-buttons" v-if="applicationStatus.hasApplication">
|
||||
<el-button type="primary" icon="View" @click="viewApplicationDetail" v-if="applicationStatus.applicationId">查看申请详情</el-button>
|
||||
<el-button type="warning" icon="Edit" @click="editApplication" v-if="applicationStatus.canEdit">编辑申请</el-button>
|
||||
<el-button type="danger" icon="Close" @click="cancelApplication" v-if="applicationStatus.canCancel">取消申请</el-button>
|
||||
</div>
|
||||
|
||||
<div class="action-buttons" v-else>
|
||||
<el-button type="success" icon="Plus" size="large" @click="applyForPosition" :disabled="!canApplyForPosition"> 申请此岗位 </el-button>
|
||||
<div class="apply-tip" v-if="!canApplyForPosition">
|
||||
<el-text type="info" size="small">
|
||||
{{ getApplyDisabledReason() }}
|
||||
</el-text>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<!-- 岗位进度展示 -->
|
||||
<el-card class="progress-card" shadow="never" v-if="positionData.requiredCount">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<el-icon><TrendCharts /></el-icon>
|
||||
招录进度
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<el-progress :percentage="progressPercentage" :color="progressColor" :stroke-width="20" text-inside :format="formatProgress" />
|
||||
<div class="progress-info">
|
||||
<span>已招录:{{ positionData.currentCount || 0 }}人</span>
|
||||
<span>目标:{{ positionData.requiredCount }}人</span>
|
||||
<span>剩余:{{ Math.max(0, (positionData.requiredCount || 0) - (positionData.currentCount || 0)) }}人</span>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<!-- 申请详情对话框 -->
|
||||
<ApplicationDetail ref="applicationDetailRef" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, onMounted, defineEmits } from 'vue';
|
||||
import { getWorkStudyPositionWithApplicationStatus } from '@/api/jcbt/workStudyPosition';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import ApplicationDetail from './components/ApplicationDetail.vue';
|
||||
import type { WorkStudyPositionVO } from '@/api/jcbt/workStudyPosition';
|
||||
|
||||
// 定义 props
|
||||
const props = defineProps<{
|
||||
positionId: string | number;
|
||||
}>();
|
||||
|
||||
// 定义 emits
|
||||
const emit = defineEmits<{
|
||||
apply: [position: WorkStudyPositionVO];
|
||||
}>();
|
||||
|
||||
// 响应式数据
|
||||
const loading = ref(false);
|
||||
const positionData = ref<WorkStudyPositionVO>({});
|
||||
const applicationStatus = ref<any>(null);
|
||||
const applicationDetailRef = ref();
|
||||
|
||||
/** 获取状态标签类型 */
|
||||
const getStatusType = (status?: string) => {
|
||||
const typeMap: Record<string, string> = {
|
||||
DRAFT: 'info',
|
||||
PUBLISHED: 'warning',
|
||||
RECRUITING: 'success',
|
||||
FULL: 'primary',
|
||||
EXPIRED: 'danger',
|
||||
SUSPENDED: 'warning',
|
||||
CANCELLED: 'danger'
|
||||
};
|
||||
return typeMap[status || ''] || 'info';
|
||||
};
|
||||
|
||||
/** 获取申请状态标签类型 */
|
||||
const getApplicationStatusType = (status?: string) => {
|
||||
const typeMap: Record<string, string> = {
|
||||
NOT_APPLIED: 'info',
|
||||
DRAFT: 'warning',
|
||||
SUBMITTED: 'primary',
|
||||
COLLEGE_APPROVED: 'success',
|
||||
COLLEGE_REJECTED: 'danger',
|
||||
FINAL_APPROVED: 'success',
|
||||
FINAL_REJECTED: 'danger',
|
||||
CANCELLED: 'info'
|
||||
};
|
||||
return typeMap[status || ''] || 'info';
|
||||
};
|
||||
|
||||
/** 计算招录进度百分比 */
|
||||
const progressPercentage = computed(() => {
|
||||
if (!positionData.value.requiredCount) return 0;
|
||||
const current = positionData.value.currentCount || 0;
|
||||
const required = positionData.value.requiredCount || 0;
|
||||
return Math.min(100, Math.round((current / required) * 100));
|
||||
});
|
||||
|
||||
/** 进度条颜色 */
|
||||
const progressColor = computed(() => {
|
||||
const percentage = progressPercentage.value;
|
||||
if (percentage >= 100) return '#67c23a';
|
||||
if (percentage >= 80) return '#e6a23c';
|
||||
if (percentage >= 50) return '#409eff';
|
||||
return '#f56c6c';
|
||||
});
|
||||
|
||||
/** 格式化进度显示 */
|
||||
const formatProgress = (percentage: number) => {
|
||||
return `${percentage}%`;
|
||||
};
|
||||
|
||||
/** 判断是否可以申请岗位 */
|
||||
const canApplyForPosition = computed(() => {
|
||||
if (!positionData.value.id) return false;
|
||||
|
||||
// 检查岗位状态
|
||||
if (!['PUBLISHED', 'RECRUITING'].includes(positionData.value.status || '')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 检查是否还有空缺
|
||||
const current = positionData.value.currentCount || 0;
|
||||
const required = positionData.value.requiredCount || 0;
|
||||
if (current >= required) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 检查有效期
|
||||
if (positionData.value.endDate) {
|
||||
const endDate = new Date(positionData.value.endDate);
|
||||
if (endDate < new Date()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
/** 获取不能申请的原因 */
|
||||
const getApplyDisabledReason = () => {
|
||||
if (!positionData.value.id) return '岗位信息加载中...';
|
||||
|
||||
if (!['PUBLISHED', 'RECRUITING'].includes(positionData.value.status || '')) {
|
||||
return '岗位当前不接受申请';
|
||||
}
|
||||
|
||||
const current = positionData.value.currentCount || 0;
|
||||
const required = positionData.value.requiredCount || 0;
|
||||
if (current >= required) {
|
||||
return '岗位已满员';
|
||||
}
|
||||
|
||||
if (positionData.value.endDate) {
|
||||
const endDate = new Date(positionData.value.endDate);
|
||||
if (endDate < new Date()) {
|
||||
return '岗位申请已截止';
|
||||
}
|
||||
}
|
||||
|
||||
return '暂不可申请';
|
||||
};
|
||||
|
||||
/** 获取岗位详情和申请状态 */
|
||||
const getPositionDetail = async () => {
|
||||
if (!props.positionId) return;
|
||||
|
||||
loading.value = true;
|
||||
try {
|
||||
const res = await getWorkStudyPositionWithApplicationStatus(props.positionId);
|
||||
positionData.value = res.data.position;
|
||||
applicationStatus.value = res.data.applicationStatus;
|
||||
} catch (error) {
|
||||
console.error('获取岗位详情失败:', error);
|
||||
ElMessage.error('获取岗位详情失败');
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
/** 申请岗位 */
|
||||
const applyForPosition = () => {
|
||||
emit('apply', positionData.value);
|
||||
};
|
||||
|
||||
/** 查看申请详情 */
|
||||
const viewApplicationDetail = () => {
|
||||
if (applicationDetailRef.value) {
|
||||
if (applicationStatus.value?.applicationId) {
|
||||
// 如果有申请记录,使用申请详情模式
|
||||
applicationDetailRef.value.handleDetail(applicationStatus.value.applicationId, 'application');
|
||||
} else {
|
||||
// 如果没有申请记录,使用岗位详情模式
|
||||
applicationDetailRef.value.handleDetail(props.positionId, 'position');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/** 编辑申请 */
|
||||
const editApplication = () => {
|
||||
if (applicationStatus.value?.applicationId) {
|
||||
// TODO: 跳转到编辑申请页面
|
||||
ElMessage.info('编辑申请功能开发中...');
|
||||
}
|
||||
};
|
||||
|
||||
/** 取消申请 */
|
||||
const cancelApplication = async () => {
|
||||
try {
|
||||
await ElMessageBox.confirm('确定要取消申请吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
});
|
||||
|
||||
// TODO: 调用取消申请接口
|
||||
ElMessage.info('取消申请功能开发中...');
|
||||
} catch {
|
||||
// 用户取消操作
|
||||
}
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getPositionDetail();
|
||||
});
|
||||
|
||||
// 暴露方法供父组件调用
|
||||
defineExpose({
|
||||
getPositionDetail
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.position-detail {
|
||||
padding: 20px;
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.position-info-card,
|
||||
.application-status-card,
|
||||
.progress-card {
|
||||
margin-bottom: 20px;
|
||||
border-radius: 12px;
|
||||
border: 1px solid #e4e7ed;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.position-info-card:hover,
|
||||
.application-status-card:hover,
|
||||
.progress-card:hover {
|
||||
border-color: rgba(93, 135, 255, 0.2);
|
||||
box-shadow: 0 4px 16px rgba(93, 135, 255, 0.08);
|
||||
}
|
||||
|
||||
.card-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.card-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
font-weight: 600;
|
||||
font-size: 16px;
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
.card-title .el-icon {
|
||||
color: rgb(93, 135, 255);
|
||||
}
|
||||
|
||||
:deep(.el-card__header) {
|
||||
background: linear-gradient(135deg, #fafbff 0%, #f8fafc 100%);
|
||||
border-bottom: 1px solid rgba(93, 135, 255, 0.1);
|
||||
padding: 16px 20px;
|
||||
}
|
||||
|
||||
:deep(.el-card__body) {
|
||||
padding: 24px 20px;
|
||||
}
|
||||
|
||||
.number-display {
|
||||
font-weight: 600;
|
||||
font-size: 16px;
|
||||
color: rgb(93, 135, 255);
|
||||
}
|
||||
|
||||
.number-display.text-success {
|
||||
color: rgb(19, 222, 185);
|
||||
}
|
||||
|
||||
.content-display {
|
||||
line-height: 1.5;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
.date-display {
|
||||
color: #606266;
|
||||
font-family: monospace;
|
||||
}
|
||||
|
||||
.contact-info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.contact-info .el-icon {
|
||||
color: rgb(93, 135, 255);
|
||||
}
|
||||
|
||||
.salary-info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
font-weight: 500;
|
||||
color: rgb(255, 174, 31);
|
||||
}
|
||||
|
||||
.salary-info .el-icon {
|
||||
color: rgb(255, 174, 31);
|
||||
}
|
||||
|
||||
.requirements-content pre {
|
||||
margin: 0;
|
||||
white-space: pre-wrap;
|
||||
word-wrap: break-word;
|
||||
font-family: inherit;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.college-info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.college-info .el-icon {
|
||||
color: rgb(19, 222, 185);
|
||||
}
|
||||
|
||||
.location-info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.location-info .el-icon {
|
||||
color: rgb(93, 135, 255);
|
||||
}
|
||||
|
||||
.application-status-content .status-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.application-status-content .status-label {
|
||||
font-weight: 500;
|
||||
margin-right: 12px;
|
||||
min-width: 80px;
|
||||
}
|
||||
|
||||
.application-status-content .status-value {
|
||||
color: #606266;
|
||||
}
|
||||
|
||||
.application-status-content .status-tag {
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.application-status-content .action-buttons {
|
||||
margin-top: 20px;
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.application-status-content .apply-tip {
|
||||
margin-left: 12px;
|
||||
}
|
||||
|
||||
.progress-card :deep(.el-progress) {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.progress-card .progress-info {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
color: #606266;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
/* 响应式布局 */
|
||||
@media (max-width: 768px) {
|
||||
.position-detail {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
:deep(.el-descriptions) {
|
||||
.el-descriptions__body .el-descriptions__table .el-descriptions__cell {
|
||||
padding-bottom: 12px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,500 @@
|
||||
<template>
|
||||
<div class="application-form" v-loading="loading">
|
||||
<!-- 岗位信息展示 -->
|
||||
<el-card class="position-preview-card" shadow="never">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<el-icon><Briefcase /></el-icon>
|
||||
申请岗位信息
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div class="position-preview">
|
||||
<div class="preview-item">
|
||||
<span class="preview-label">岗位名称:</span>
|
||||
<el-tag type="primary" size="large">{{ position?.positionName }}</el-tag>
|
||||
</div>
|
||||
<div class="preview-item">
|
||||
<span class="preview-label">工作地点:</span>
|
||||
<span class="preview-value">{{ position?.workLocation }}</span>
|
||||
</div>
|
||||
<div class="preview-item">
|
||||
<span class="preview-label">工作时间:</span>
|
||||
<span class="preview-value">{{ position?.workTime }}</span>
|
||||
</div>
|
||||
<div class="preview-item">
|
||||
<span class="preview-label">薪资情况:</span>
|
||||
<span class="preview-value salary">{{ position?.salaryInfo }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<!-- 申请表单 -->
|
||||
<el-card class="form-card" shadow="never">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<el-icon><EditPen /></el-icon>
|
||||
申请信息填写
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<el-form ref="formRef" :model="formData" :rules="formRules" label-width="120px" size="large" class="application-form-content">
|
||||
<!-- 基本信息 -->
|
||||
<div class="form-section">
|
||||
<div class="section-title">
|
||||
<el-icon><User /></el-icon>
|
||||
基本信息
|
||||
</div>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="学生姓名" prop="studentName">
|
||||
<el-input v-model="formData.studentName" placeholder="请输入学生姓名" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="学号" prop="studentNumber">
|
||||
<el-input v-model="formData.studentNumber" placeholder="请输入学号" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="身份证号" prop="idCard">
|
||||
<el-input v-model="formData.idCard" placeholder="请输入身份证号" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系电话" prop="contactPhone">
|
||||
<el-input v-model="formData.contactPhone" placeholder="请输入联系电话" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="学院" prop="collegeName">
|
||||
<el-input v-model="formData.collegeName" placeholder="学院名称" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="专业" prop="majorName">
|
||||
<el-input v-model="formData.majorName" placeholder="专业名称" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="班级" prop="className">
|
||||
<el-input v-model="formData.className" placeholder="班级名称" readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<!-- 申请信息 -->
|
||||
<div class="form-section">
|
||||
<div class="section-title">
|
||||
<el-icon><Document /></el-icon>
|
||||
申请信息
|
||||
</div>
|
||||
|
||||
<el-form-item label="家庭经济情况" prop="familyFinancialStatus">
|
||||
<el-radio-group v-model="formData.familyFinancialStatus">
|
||||
<el-radio value="特困">特困</el-radio>
|
||||
<el-radio value="贫困">贫困</el-radio>
|
||||
<el-radio value="一般">一般</el-radio>
|
||||
<el-radio value="良好">良好</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="申请理由" prop="applicationReason">
|
||||
<el-input
|
||||
v-model="formData.applicationReason"
|
||||
type="textarea"
|
||||
:rows="4"
|
||||
placeholder="请详细说明您申请此岗位的理由,包括经济需要、学习动机等..."
|
||||
maxlength="500"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="个人能力及经验" prop="personalAbility">
|
||||
<el-input
|
||||
v-model="formData.personalAbility"
|
||||
type="textarea"
|
||||
:rows="4"
|
||||
placeholder="请描述您的个人能力、相关经验、技能特长等,以证明您能胜任此岗位..."
|
||||
maxlength="500"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="时间安排" prop="timeArrangement">
|
||||
<el-input
|
||||
v-model="formData.timeArrangement"
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
placeholder="请说明您的时间安排,如何平衡学习与工作..."
|
||||
maxlength="300"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="formData.remark" type="textarea" :rows="2" placeholder="其他需要说明的情况(选填)" maxlength="200" show-word-limit />
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
<!-- 提交按钮 -->
|
||||
<div class="form-actions">
|
||||
<el-button size="large" @click="handleCancel">取消</el-button>
|
||||
<el-button type="primary" size="large" @click="handleSubmit" :loading="submitting"> 提交申请 </el-button>
|
||||
</div>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, onMounted, defineEmits } from 'vue';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { addWorkStudyApplication, getCurrentStudentInfo } from '@/api/jcbt/workStudyApplication';
|
||||
import type { WorkStudyPositionVO } from '@/api/jcbt/workStudyPosition';
|
||||
import type { WorkStudyApplicationForm } from '@/api/jcbt/workStudyApplication';
|
||||
|
||||
// 定义 props
|
||||
const props = defineProps<{
|
||||
position: WorkStudyPositionVO;
|
||||
}>();
|
||||
|
||||
// 定义 emits
|
||||
const emit = defineEmits<{
|
||||
success: [];
|
||||
cancel: [];
|
||||
}>();
|
||||
|
||||
// 组件引用
|
||||
const formRef = ref();
|
||||
|
||||
// 响应式数据
|
||||
const loading = ref(false);
|
||||
const submitting = ref(false);
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive<WorkStudyApplicationForm>({
|
||||
studentName: '',
|
||||
studentNumber: '',
|
||||
idCard: '',
|
||||
contactPhone: '',
|
||||
collegeName: '',
|
||||
majorName: '',
|
||||
className: '',
|
||||
positionId: 0,
|
||||
positionName: '',
|
||||
positionType: '',
|
||||
workLocation: '',
|
||||
familyFinancialStatus: '',
|
||||
applicationReason: '',
|
||||
personalAbility: '',
|
||||
timeArrangement: '',
|
||||
remark: ''
|
||||
});
|
||||
|
||||
// 表单验证规则
|
||||
const formRules = reactive({
|
||||
studentName: [{ required: true, message: '学生姓名不能为空', trigger: 'blur' }],
|
||||
studentNumber: [{ required: true, message: '学号不能为空', trigger: 'blur' }],
|
||||
idCard: [
|
||||
{ required: true, message: '身份证号不能为空', trigger: 'blur' },
|
||||
{
|
||||
pattern: /^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,
|
||||
message: '身份证号格式不正确',
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
contactPhone: [
|
||||
{ required: true, message: '联系电话不能为空', trigger: 'blur' },
|
||||
{ pattern: /^1[3-9]\d{9}$/, message: '手机号格式不正确', trigger: 'blur' }
|
||||
],
|
||||
collegeName: [{ required: true, message: '学院名称不能为空', trigger: 'blur' }],
|
||||
majorName: [{ required: true, message: '专业名称不能为空', trigger: 'blur' }],
|
||||
className: [{ required: true, message: '班级名称不能为空', trigger: 'blur' }],
|
||||
timeArrangement: [
|
||||
{ required: true, message: '时间安排不能为空', trigger: 'blur' },
|
||||
{ min: 10, max: 500, message: '时间安排须在10-500字符之间', trigger: 'blur' }
|
||||
]
|
||||
});
|
||||
|
||||
/** 初始化表单数据 */
|
||||
const initFormData = async () => {
|
||||
// 从岗位信息中获取相关数据
|
||||
if (props.position) {
|
||||
formData.positionId = props.position.id as number;
|
||||
formData.positionName = props.position.positionName || '';
|
||||
formData.positionType = '勤工俭学'; // 默认类型
|
||||
// 使用学院名称作为工作地点
|
||||
formData.workLocation = props.position.collegeName || '待确定';
|
||||
}
|
||||
|
||||
try {
|
||||
// 获取当前登录用户的学生信息
|
||||
loading.value = true;
|
||||
const response = await getCurrentStudentInfo();
|
||||
|
||||
if (response.code === 200 && response.data) {
|
||||
const studentInfo = response.data;
|
||||
// 将学生信息映射到表单数据
|
||||
formData.studentName = studentInfo.name || '';
|
||||
formData.studentNumber = studentInfo.studentNo || '';
|
||||
formData.idCard = studentInfo.idCard || '';
|
||||
formData.contactPhone = studentInfo.phone || '';
|
||||
formData.collegeName = studentInfo.collegeName || '';
|
||||
formData.majorName = studentInfo.majorName || '';
|
||||
formData.className = studentInfo.className || '';
|
||||
} else {
|
||||
// 如果获取不到学生信息,说明当前用户不是学生身份
|
||||
ElMessage.error('当前登录用户不是学生身份,无法申请勤工俭学岗位');
|
||||
emit('cancel');
|
||||
return;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取学生信息失败:', error);
|
||||
ElMessage.error('获取学生信息失败,请重试或联系管理员');
|
||||
emit('cancel');
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
/** 提交申请 */
|
||||
const handleSubmit = async () => {
|
||||
try {
|
||||
// 表单验证
|
||||
await formRef.value?.validate();
|
||||
|
||||
// 确认提交
|
||||
await ElMessageBox.confirm('确定要提交申请吗?提交后将无法修改。', '确认提交', {
|
||||
confirmButtonText: '确定提交',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
});
|
||||
|
||||
submitting.value = true;
|
||||
|
||||
// 提交申请
|
||||
await addWorkStudyApplication(formData);
|
||||
|
||||
ElMessage.success('申请提交成功!');
|
||||
emit('success');
|
||||
} catch (error) {
|
||||
if (error !== 'cancel') {
|
||||
// 不是用户取消操作
|
||||
console.error('提交申请失败:', error);
|
||||
ElMessage.error('提交申请失败,请重试');
|
||||
}
|
||||
} finally {
|
||||
submitting.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
/** 取消申请 */
|
||||
const handleCancel = async () => {
|
||||
try {
|
||||
await ElMessageBox.confirm('确定要取消申请吗?', '取消确认', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '继续填写',
|
||||
type: 'warning'
|
||||
});
|
||||
|
||||
emit('cancel');
|
||||
} catch {
|
||||
// 用户选择继续填写
|
||||
}
|
||||
};
|
||||
|
||||
// 生命周期钩子
|
||||
onMounted(async () => {
|
||||
await initFormData();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.application-form {
|
||||
max-width: 900px;
|
||||
margin: 0 auto;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.position-preview-card,
|
||||
.form-card {
|
||||
margin-bottom: 20px;
|
||||
border-radius: 12px;
|
||||
border: 1px solid #e4e7ed;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.position-preview-card:hover,
|
||||
.form-card:hover {
|
||||
border-color: rgba(93, 135, 255, 0.2);
|
||||
box-shadow: 0 4px 16px rgba(93, 135, 255, 0.08);
|
||||
}
|
||||
|
||||
.card-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.card-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
font-weight: 600;
|
||||
font-size: 16px;
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
.card-title .el-icon {
|
||||
color: rgb(93, 135, 255);
|
||||
}
|
||||
|
||||
:deep(.el-card__header) {
|
||||
background: linear-gradient(135deg, #fafbff 0%, #f8fafc 100%);
|
||||
border-bottom: 1px solid rgba(93, 135, 255, 0.1);
|
||||
padding: 16px 20px;
|
||||
}
|
||||
|
||||
:deep(.el-card__body) {
|
||||
padding: 24px 20px;
|
||||
}
|
||||
|
||||
/* 岗位预览样式 */
|
||||
.position-preview {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
|
||||
gap: 16px;
|
||||
padding: 16px;
|
||||
background: linear-gradient(135deg, rgba(93, 135, 255, 0.05) 0%, rgba(73, 190, 255, 0.05) 100%);
|
||||
border-radius: 8px;
|
||||
border: 1px solid rgba(93, 135, 255, 0.1);
|
||||
}
|
||||
|
||||
.preview-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.preview-label {
|
||||
font-weight: 500;
|
||||
color: #606266;
|
||||
min-width: 80px;
|
||||
}
|
||||
|
||||
.preview-value {
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
.preview-value.salary {
|
||||
color: rgb(255, 174, 31);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
/* 表单样式 */
|
||||
.application-form-content {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.form-section {
|
||||
margin-bottom: 32px;
|
||||
padding: 20px;
|
||||
background: #fafbfc;
|
||||
border-radius: 8px;
|
||||
border: 1px solid #f0f2f5;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
margin-bottom: 20px;
|
||||
padding-bottom: 8px;
|
||||
border-bottom: 2px solid rgba(93, 135, 255, 0.2);
|
||||
}
|
||||
|
||||
.section-title .el-icon {
|
||||
color: rgb(93, 135, 255);
|
||||
}
|
||||
|
||||
.input-suffix {
|
||||
margin-left: 8px;
|
||||
color: #909399;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
:deep(.el-form-item__label) {
|
||||
font-weight: 500;
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
:deep(.el-input__inner) {
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
:deep(.el-textarea__inner) {
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
:deep(.el-input__inner:focus),
|
||||
:deep(.el-textarea__inner:focus) {
|
||||
border-color: rgb(93, 135, 255);
|
||||
box-shadow: 0 0 0 2px rgba(93, 135, 255, 0.1);
|
||||
}
|
||||
|
||||
/* 提交按钮样式 */
|
||||
.form-actions {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
gap: 16px;
|
||||
margin-top: 32px;
|
||||
padding-top: 24px;
|
||||
border-top: 1px solid #f0f2f5;
|
||||
}
|
||||
|
||||
.form-actions .el-button {
|
||||
min-width: 120px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
/* 响应式布局 */
|
||||
@media (max-width: 768px) {
|
||||
.application-form {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.position-preview {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
:deep(.el-col) {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.form-actions {
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.form-actions .el-button {
|
||||
width: 100%;
|
||||
max-width: 200px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,498 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 搜索卡片 -->
|
||||
<el-card class="search-card" shadow="never">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span class="search-title">
|
||||
<el-icon><Search /></el-icon>
|
||||
岗位搜索
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true" label-width="auto">
|
||||
<el-form-item label="岗位名称" prop="positionName">
|
||||
<el-input v-model="queryParams.positionName" placeholder="请输入岗位名称" clearable @keyup.enter="handleQuery" style="width: 200px" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="发布范围" prop="positionScope">
|
||||
<el-select v-model="queryParams.positionScope" placeholder="请选择发布范围" clearable style="width: 200px">
|
||||
<el-option label="全校" value="UNIVERSITY" />
|
||||
<el-option label="本学院" value="COLLEGE" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="联系老师" prop="contactTeacher">
|
||||
<el-input v-model="queryParams.contactTeacher" placeholder="请输入联系老师" clearable @keyup.enter="handleQuery" style="width: 200px" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<!-- 岗位列表卡片 -->
|
||||
<el-card class="table-card" shadow="never">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span class="table-title">
|
||||
<el-icon><List /></el-icon>
|
||||
可申请岗位列表
|
||||
</span>
|
||||
<div class="header-actions">
|
||||
<el-button type="primary" icon="RefreshRight" @click="handleQuery">刷新</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<el-table ref="tableRef" v-loading="loading" :data="positionList" :height="tableHeight" class="position-table" stripe border>
|
||||
<el-table-column label="岗位名称" prop="positionName" min-width="150" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<div class="position-name">
|
||||
<el-tag type="primary" size="small">{{ row.positionName }}</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="发布范围" prop="positionScopeName" width="100" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="row.positionScope === 'UNIVERSITY' ? 'success' : 'info'" size="small">
|
||||
{{ row.positionScopeName }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="需求人数" prop="requiredCount" width="100" align="center">
|
||||
<template #default="{ row }">
|
||||
<span class="number-display">{{ row.requiredCount }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="当前人数" prop="currentCount" width="100" align="center">
|
||||
<template #default="{ row }">
|
||||
<span class="number-display" :class="{ 'text-success': row.currentCount >= row.requiredCount }">
|
||||
{{ row.currentCount || 0 }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="工作时间" prop="workTime" min-width="150" show-overflow-tooltip />
|
||||
|
||||
<el-table-column label="薪资情况" prop="salaryInfo" min-width="120" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<div class="salary-info">
|
||||
<el-icon><Money /></el-icon>
|
||||
{{ row.salaryInfo }}
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="联系老师" prop="contactTeacher" width="100" show-overflow-tooltip />
|
||||
|
||||
<el-table-column label="联系电话" prop="contactPhone" width="120" show-overflow-tooltip />
|
||||
|
||||
<el-table-column label="有效期" min-width="160">
|
||||
<template #default="{ row }">
|
||||
<div class="date-range">
|
||||
<div class="date-item">{{ row.startDate }}</div>
|
||||
<div class="date-separator">至</div>
|
||||
<div class="date-item">{{ row.endDate }}</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="岗位状态" prop="statusName" width="100" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="getStatusType(row.status)" size="small">
|
||||
{{ row.statusName }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" width="160" align="center" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<div class="action-buttons">
|
||||
<el-button type="primary" icon="View" size="small" @click="handleViewDetail(row)" title="查看详情"> 查看 </el-button>
|
||||
<el-button type="success" icon="Plus" size="small" @click="handleApply(row)" :disabled="!canApply(row)" title="申请岗位">
|
||||
申请
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 分页 -->
|
||||
<div class="pagination-container">
|
||||
<el-pagination
|
||||
v-show="total > 0"
|
||||
v-model:current-page="queryParams.pageNum"
|
||||
v-model:page-size="queryParams.pageSize"
|
||||
:total="total"
|
||||
:page-sizes="[10, 20, 30, 50]"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
/>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<!-- 岗位详情对话框 -->
|
||||
<el-dialog v-model="detailDialogVisible" title="岗位详情" width="80%" :close-on-click-modal="false" class="position-detail-dialog">
|
||||
<PositionDetail v-if="detailDialogVisible && selectedPositionId" :position-id="selectedPositionId" @apply="handleApplyFromDetail" />
|
||||
<template #footer>
|
||||
<el-button @click="detailDialogVisible = false">关闭</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 申请表单对话框 -->
|
||||
<el-dialog v-model="applyDialogVisible" title="申请岗位" width="70%" :close-on-click-modal="false" class="apply-dialog">
|
||||
<ApplicationForm
|
||||
v-if="applyDialogVisible && selectedPosition"
|
||||
:position="selectedPosition"
|
||||
@success="handleApplySuccess"
|
||||
@cancel="applyDialogVisible = false"
|
||||
/>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, onMounted, computed } from 'vue';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { listVisiblePositions } from '@/api/jcbt/workStudyPosition';
|
||||
import type { WorkStudyPositionVO } from '@/api/jcbt/workStudyPosition';
|
||||
import PositionDetail from './detail.vue';
|
||||
import ApplicationForm from './form.vue';
|
||||
|
||||
// 组件引用
|
||||
const queryFormRef = ref();
|
||||
const tableRef = ref();
|
||||
|
||||
// 响应式数据
|
||||
const loading = ref(false);
|
||||
const positionList = ref<WorkStudyPositionVO[]>([]);
|
||||
const total = ref(0);
|
||||
const detailDialogVisible = ref(false);
|
||||
const applyDialogVisible = ref(false);
|
||||
const selectedPositionId = ref<number>();
|
||||
const selectedPosition = ref<WorkStudyPositionVO>();
|
||||
|
||||
// 查询参数
|
||||
const queryParams = reactive({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
positionName: '',
|
||||
positionScope: '',
|
||||
contactTeacher: ''
|
||||
});
|
||||
|
||||
// 计算属性
|
||||
const tableHeight = computed(() => {
|
||||
return window.innerHeight - 400;
|
||||
});
|
||||
|
||||
/** 获取状态类型 */
|
||||
const getStatusType = (status: string) => {
|
||||
const typeMap: Record<string, string> = {
|
||||
DRAFT: 'info',
|
||||
PUBLISHED: 'warning',
|
||||
RECRUITING: 'success',
|
||||
FULL: 'primary',
|
||||
EXPIRED: 'danger',
|
||||
SUSPENDED: 'warning',
|
||||
CANCELLED: 'danger'
|
||||
};
|
||||
return typeMap[status] || 'info';
|
||||
};
|
||||
|
||||
/** 判断是否可以申请 */
|
||||
const canApply = (position: WorkStudyPositionVO) => {
|
||||
// 检查岗位状态
|
||||
if (!['PUBLISHED', 'RECRUITING'].includes(position.status || '')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 检查是否还有空缺
|
||||
const current = position.currentCount || 0;
|
||||
const required = position.requiredCount || 0;
|
||||
if (current >= required) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 检查有效期
|
||||
if (position.endDate) {
|
||||
const endDate = new Date(position.endDate);
|
||||
if (endDate < new Date()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
/** 查询岗位列表 */
|
||||
const getPositionList = async () => {
|
||||
loading.value = true;
|
||||
try {
|
||||
// 调用可见岗位接口,排除已申请的岗位
|
||||
const response = await listVisiblePositions(queryParams, true);
|
||||
// 后端返回 TableDataInfo 结构,响应拦截器已解包,直接使用 response.rows
|
||||
positionList.value = response.rows || [];
|
||||
total.value = response.total || 0;
|
||||
} catch (error) {
|
||||
console.error('获取岗位列表失败:', error);
|
||||
ElMessage.error('获取岗位列表失败');
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.pageNum = 1;
|
||||
getPositionList();
|
||||
};
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
/** 分页大小变化 */
|
||||
const handleSizeChange = (size: number) => {
|
||||
queryParams.pageSize = size;
|
||||
getPositionList();
|
||||
};
|
||||
|
||||
/** 当前页变化 */
|
||||
const handleCurrentChange = (page: number) => {
|
||||
queryParams.pageNum = page;
|
||||
getPositionList();
|
||||
};
|
||||
|
||||
/** 查看详情 */
|
||||
const handleViewDetail = (position: WorkStudyPositionVO) => {
|
||||
selectedPositionId.value = position.id as number;
|
||||
detailDialogVisible.value = true;
|
||||
};
|
||||
|
||||
/** 申请岗位 */
|
||||
const handleApply = (position: WorkStudyPositionVO) => {
|
||||
if (!canApply(position)) {
|
||||
ElMessage.warning('该岗位当前不可申请');
|
||||
return;
|
||||
}
|
||||
|
||||
selectedPosition.value = position;
|
||||
applyDialogVisible.value = true;
|
||||
};
|
||||
|
||||
/** 从详情页申请 */
|
||||
const handleApplyFromDetail = (position: WorkStudyPositionVO) => {
|
||||
detailDialogVisible.value = false;
|
||||
selectedPosition.value = position;
|
||||
applyDialogVisible.value = true;
|
||||
};
|
||||
|
||||
/** 申请成功回调 */
|
||||
const handleApplySuccess = () => {
|
||||
applyDialogVisible.value = false;
|
||||
ElMessage.success('申请提交成功!');
|
||||
// 刷新列表
|
||||
getPositionList();
|
||||
};
|
||||
|
||||
// 生命周期
|
||||
onMounted(() => {
|
||||
getPositionList();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.app-container {
|
||||
padding: 20px;
|
||||
background-color: #f5f7fa;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.search-card,
|
||||
.table-card {
|
||||
margin-bottom: 20px;
|
||||
border-radius: 12px;
|
||||
border: 1px solid #e4e7ed;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.search-card:hover,
|
||||
.table-card:hover {
|
||||
border-color: rgba(93, 135, 255, 0.2);
|
||||
box-shadow: 0 4px 16px rgba(93, 135, 255, 0.08);
|
||||
}
|
||||
|
||||
.card-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.search-title,
|
||||
.table-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
font-weight: 600;
|
||||
font-size: 16px;
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
.search-title .el-icon,
|
||||
.table-title .el-icon {
|
||||
color: rgb(93, 135, 255);
|
||||
}
|
||||
|
||||
.header-actions {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
:deep(.el-card__header) {
|
||||
background: linear-gradient(135deg, #fafbff 0%, #f8fafc 100%);
|
||||
border-bottom: 1px solid rgba(93, 135, 255, 0.1);
|
||||
padding: 16px 20px;
|
||||
}
|
||||
|
||||
:deep(.el-card__body) {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
/* 表格样式 */
|
||||
.position-table {
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
:deep(.el-table__header) {
|
||||
th {
|
||||
background: linear-gradient(135deg, #fafbff 0%, #f8fafc 100%);
|
||||
color: #303133;
|
||||
font-weight: 600;
|
||||
border-color: rgba(93, 135, 255, 0.1);
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.el-table__row:hover) {
|
||||
background-color: rgba(93, 135, 255, 0.05) !important;
|
||||
}
|
||||
|
||||
/* 内容样式 */
|
||||
.position-name {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.number-display {
|
||||
font-weight: 600;
|
||||
color: rgb(93, 135, 255);
|
||||
|
||||
&.text-success {
|
||||
color: rgb(19, 222, 185);
|
||||
}
|
||||
}
|
||||
|
||||
.salary-info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
color: rgb(255, 174, 31);
|
||||
font-weight: 500;
|
||||
|
||||
.el-icon {
|
||||
color: rgb(255, 174, 31);
|
||||
}
|
||||
}
|
||||
|
||||
.date-range {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2px;
|
||||
font-size: 12px;
|
||||
|
||||
.date-item {
|
||||
color: #606266;
|
||||
font-family: monospace;
|
||||
}
|
||||
|
||||
.date-separator {
|
||||
color: #909399;
|
||||
text-align: center;
|
||||
font-size: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.action-buttons {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
/* 分页样式 */
|
||||
.pagination-container {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
padding: 16px 0 0 0;
|
||||
margin-top: 16px;
|
||||
border-top: 1px solid #f0f2f5;
|
||||
}
|
||||
|
||||
/* 对话框样式 */
|
||||
.position-detail-dialog :deep(.el-dialog),
|
||||
.apply-dialog :deep(.el-dialog) {
|
||||
border-radius: 12px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.position-detail-dialog :deep(.el-dialog__header),
|
||||
.apply-dialog :deep(.el-dialog__header) {
|
||||
background: linear-gradient(135deg, rgb(93, 135, 255) 0%, rgb(73, 190, 255) 100%);
|
||||
color: white;
|
||||
padding: 20px 24px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.position-detail-dialog :deep(.el-dialog__title),
|
||||
.apply-dialog :deep(.el-dialog__title) {
|
||||
color: white;
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.position-detail-dialog :deep(.el-dialog__headerbtn .el-dialog__close),
|
||||
.apply-dialog :deep(.el-dialog__headerbtn .el-dialog__close) {
|
||||
color: white;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.position-detail-dialog :deep(.el-dialog__headerbtn .el-dialog__close):hover,
|
||||
.apply-dialog :deep(.el-dialog__headerbtn .el-dialog__close):hover {
|
||||
color: rgba(255, 255, 255, 0.8);
|
||||
}
|
||||
|
||||
/* 响应式布局 */
|
||||
@media (max-width: 1200px) {
|
||||
.app-container {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
:deep(.el-form--inline .el-form-item) {
|
||||
margin-right: 10px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,331 @@
|
||||
<template>
|
||||
<div class="position-detail" v-loading="loading">
|
||||
<div v-if="positionData" class="detail-content">
|
||||
<!-- 基本信息 -->
|
||||
<el-card class="detail-card" shadow="never">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span class="card-title">基本信息</span>
|
||||
<el-tag :type="getStatusType(positionData.status)">
|
||||
{{ getStatusText(positionData.status) }}
|
||||
</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<div class="detail-item">
|
||||
<label>岗位名称:</label>
|
||||
<span>{{ positionData.positionName || '-' }}</span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="detail-item">
|
||||
<label>发布范围:</label>
|
||||
<span>{{ getScopeText(positionData.positionScope) }}</span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="detail-item">
|
||||
<label>发布学院:</label>
|
||||
<span>{{ positionData.collegeName || '-' }}</span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="detail-item">
|
||||
<label>需求人数:</label>
|
||||
<span>{{ positionData.requiredCount || 0 }} 人</span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="detail-item">
|
||||
<label>当前人数:</label>
|
||||
<span class="text-success">{{ positionData.currentCount || 0 }} 人</span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="detail-item">
|
||||
<label>联系老师:</label>
|
||||
<span>{{ positionData.contactTeacher || '-' }}</span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="detail-item">
|
||||
<label>联系电话:</label>
|
||||
<span>{{ positionData.contactPhone || '-' }}</span>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
|
||||
<!-- 工作详情 -->
|
||||
<el-card class="detail-card" shadow="never">
|
||||
<template #header>
|
||||
<span class="card-title">工作详情</span>
|
||||
</template>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<div class="detail-item">
|
||||
<label>工作时间:</label>
|
||||
<span>{{ positionData.workTime || '-' }}</span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="detail-item">
|
||||
<label>薪资情况:</label>
|
||||
<span class="text-primary">{{ positionData.salaryInfo || '-' }}</span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<div class="detail-item">
|
||||
<label>岗位要求:</label>
|
||||
<div class="detail-text">{{ positionData.positionRequirements || '-' }}</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
|
||||
<!-- 时间信息 -->
|
||||
<el-card class="detail-card" shadow="never">
|
||||
<template #header>
|
||||
<span class="card-title">时间信息</span>
|
||||
</template>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<div class="detail-item">
|
||||
<label>开始日期:</label>
|
||||
<span>{{ formatDate(positionData.startDate) }}</span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="detail-item">
|
||||
<label>结束日期:</label>
|
||||
<span>{{ formatDate(positionData.endDate) }}</span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="detail-item">
|
||||
<label>创建时间:</label>
|
||||
<span>{{ formatDateTime(positionData.createTime) }}</span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="detail-item">
|
||||
<label>更新时间:</label>
|
||||
<span>{{ formatDateTime(positionData.updateTime) }}</span>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
|
||||
<!-- 备注信息 -->
|
||||
<el-card v-if="positionData.remark" class="detail-card" shadow="never">
|
||||
<template #header>
|
||||
<span class="card-title">备注信息</span>
|
||||
</template>
|
||||
<div class="detail-text">{{ positionData.remark }}</div>
|
||||
</el-card>
|
||||
</div>
|
||||
|
||||
<div v-else-if="!loading" class="no-data">
|
||||
<el-empty description="暂无数据" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="PositionDetail">
|
||||
import { ref, watch, onMounted } from 'vue';
|
||||
import { getWorkStudyPosition } from '@/api/jcbt/workStudyPosition';
|
||||
import { parseTime } from '@/utils/ruoyi';
|
||||
|
||||
const props = defineProps({
|
||||
positionId: {
|
||||
type: [String, Number],
|
||||
required: true
|
||||
}
|
||||
});
|
||||
|
||||
// 数据状态
|
||||
const loading = ref(false);
|
||||
const positionData = ref(null);
|
||||
|
||||
// 岗位范围映射(与表单选项保持一致)
|
||||
const scopeMap = {
|
||||
'COLLEGE': '本学院',
|
||||
'UNIVERSITY': '全校'
|
||||
};
|
||||
|
||||
// 状态映射(与表单选项保持一致)
|
||||
const statusMap = {
|
||||
'DRAFT': '草稿',
|
||||
'PUBLISHED': '已发布',
|
||||
'RECRUITING': '招录中',
|
||||
'FULL': '已满员',
|
||||
'EXPIRED': '已过期',
|
||||
'SUSPENDED': '已暂停',
|
||||
'CANCELLED': '已取消'
|
||||
};
|
||||
|
||||
// 状态类型映射
|
||||
const statusTypeMap = {
|
||||
'DRAFT': 'info',
|
||||
'PUBLISHED': 'success',
|
||||
'RECRUITING': 'primary',
|
||||
'FULL': 'warning',
|
||||
'EXPIRED': 'danger',
|
||||
'SUSPENDED': 'warning',
|
||||
'CANCELLED': 'danger'
|
||||
};
|
||||
|
||||
/** 获取岗位详情 */
|
||||
async function getDetail() {
|
||||
if (!props.positionId) return;
|
||||
|
||||
loading.value = true;
|
||||
try {
|
||||
const response = await getWorkStudyPosition(props.positionId);
|
||||
positionData.value = response.data;
|
||||
console.log('岗位详情数据:', response.data); // 调试用,查看实际数据结构
|
||||
} catch (error) {
|
||||
console.error('获取岗位详情失败:', error);
|
||||
positionData.value = null;
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
/** 获取范围文本 */
|
||||
function getScopeText(scope) {
|
||||
return scopeMap[scope] || scope || '-';
|
||||
}
|
||||
|
||||
/** 获取状态文本 */
|
||||
function getStatusText(status) {
|
||||
return statusMap[status] || status || '-';
|
||||
}
|
||||
|
||||
/** 获取状态类型 */
|
||||
function getStatusType(status) {
|
||||
return statusTypeMap[status] || 'info';
|
||||
}
|
||||
|
||||
/** 格式化日期 */
|
||||
function formatDate(date) {
|
||||
if (!date) return '-';
|
||||
return parseTime(date, '{y}-{m}-{d}');
|
||||
}
|
||||
|
||||
/** 格式化日期时间 */
|
||||
function formatDateTime(dateTime) {
|
||||
if (!dateTime) return '-';
|
||||
return parseTime(dateTime, '{y}-{m}-{d} {h}:{i}:{s}');
|
||||
}
|
||||
|
||||
// 监听positionId变化
|
||||
watch(
|
||||
() => props.positionId,
|
||||
(newId) => {
|
||||
if (newId) {
|
||||
getDetail();
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
onMounted(() => {
|
||||
if (props.positionId) {
|
||||
getDetail();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.position-detail {
|
||||
.detail-content {
|
||||
.detail-card {
|
||||
margin-bottom: 16px;
|
||||
border: 1px solid #e4e7ed;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.card-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.card-title {
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
}
|
||||
}
|
||||
|
||||
.detail-item {
|
||||
margin-bottom: 16px;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
label {
|
||||
min-width: 120px;
|
||||
color: #606266;
|
||||
font-weight: 500;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
span {
|
||||
color: #303133;
|
||||
flex: 1;
|
||||
|
||||
&.text-success {
|
||||
color: #67c23a;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
&.text-primary {
|
||||
color: #409eff;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
|
||||
.detail-text {
|
||||
color: #303133;
|
||||
line-height: 1.6;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-word;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.no-data {
|
||||
text-align: center;
|
||||
padding: 40px 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* 响应式设计 */
|
||||
@media (max-width: 768px) {
|
||||
.position-detail {
|
||||
.detail-content {
|
||||
.detail-card {
|
||||
.detail-item {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
|
||||
label {
|
||||
margin-bottom: 4px;
|
||||
min-width: auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,646 @@
|
||||
<template>
|
||||
<div class="position-detail-container">
|
||||
<!-- 头部区域 -->
|
||||
<div class="detail-header">
|
||||
<el-page-header @back="handleBack" class="page-header">
|
||||
<template #content>
|
||||
<div class="header-content">
|
||||
<span class="header-title">岗位详情</span>
|
||||
<div class="header-actions">
|
||||
<el-button v-if="canEdit" type="primary" size="default" @click="handleEdit">
|
||||
<el-icon><Edit /></el-icon>
|
||||
编辑岗位
|
||||
</el-button>
|
||||
<el-button v-if="canPublish" type="success" size="default" @click="handlePublish">
|
||||
<el-icon><Position /></el-icon>
|
||||
发布岗位
|
||||
</el-button>
|
||||
<el-button v-if="canStop" type="warning" size="default" @click="handleStop">
|
||||
<el-icon><VideoPause /></el-icon>
|
||||
停止招录
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-page-header>
|
||||
</div>
|
||||
|
||||
<!-- 主要内容区域 -->
|
||||
<div class="detail-content" v-loading="loading">
|
||||
<el-row :gutter="20" v-if="positionData">
|
||||
<!-- 左侧:岗位信息 -->
|
||||
<el-col :span="16">
|
||||
<!-- 基本信息卡片 -->
|
||||
<el-card class="info-card" shadow="never">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<el-icon><Briefcase /></el-icon>
|
||||
基本信息
|
||||
</span>
|
||||
<el-tag :type="getStatusType(positionData.positionStatus)" size="large">
|
||||
{{ getStatusText(positionData.positionStatus) }}
|
||||
</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<el-descriptions :column="2" border size="default">
|
||||
<el-descriptions-item label="岗位名称" :span="2">
|
||||
<div class="position-name">{{ positionData.positionName }}</div>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="岗位类型">
|
||||
<el-tag type="primary">{{ positionData.positionType }}</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="发布范围">
|
||||
<el-tag type="success">{{ positionData.publishScope }}</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="工作地点">
|
||||
<span class="location">
|
||||
<el-icon><MapPin /></el-icon>
|
||||
{{ positionData.workLocation }}
|
||||
</span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="工作时间">
|
||||
{{ positionData.workTime }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="联系老师">
|
||||
{{ positionData.contactTeacher }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="联系电话">
|
||||
{{ positionData.contactPhone }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="薪资情况">
|
||||
<span class="salary">{{ positionData.salaryInfo }}</span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="招录人数">
|
||||
<span class="count">{{ positionData.recruitmentCount }}人</span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="有效期"> {{ positionData.validStartDate }} 至 {{ positionData.validEndDate }} </el-descriptions-item>
|
||||
<el-descriptions-item label="创建时间">
|
||||
{{ positionData.createTime }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
|
||||
<!-- 岗位要求卡片 -->
|
||||
<el-card class="info-card" shadow="never">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<el-icon><UserFilled /></el-icon>
|
||||
岗位要求
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div class="content-section">
|
||||
<div class="requirement-content">
|
||||
{{ positionData.positionRequirements || '暂无要求说明' }}
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<!-- 工作内容卡片 -->
|
||||
<el-card class="info-card" shadow="never">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<el-icon><Document /></el-icon>
|
||||
工作内容
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div class="content-section">
|
||||
<div class="work-content">
|
||||
{{ positionData.workContent || '暂无工作内容说明' }}
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<!-- 备注信息卡片 -->
|
||||
<el-card class="info-card" shadow="never" v-if="positionData.remark">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<el-icon><ChatDotRound /></el-icon>
|
||||
备注信息
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div class="content-section">
|
||||
<div class="remark-content">
|
||||
{{ positionData.remark }}
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
|
||||
<!-- 右侧:申请统计 -->
|
||||
<el-col :span="8">
|
||||
<!-- 申请统计卡片 -->
|
||||
<el-card class="stat-card" shadow="never">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<el-icon><DataAnalysis /></el-icon>
|
||||
申请统计
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div class="stat-list">
|
||||
<div class="stat-item">
|
||||
<div class="stat-label">申请总数</div>
|
||||
<div class="stat-value primary">{{ applicationStats.totalCount || 0 }}</div>
|
||||
</div>
|
||||
<div class="stat-item">
|
||||
<div class="stat-label">待审核</div>
|
||||
<div class="stat-value warning">{{ applicationStats.pendingCount || 0 }}</div>
|
||||
</div>
|
||||
<div class="stat-item">
|
||||
<div class="stat-label">已通过</div>
|
||||
<div class="stat-value success">{{ applicationStats.approvedCount || 0 }}</div>
|
||||
</div>
|
||||
<div class="stat-item">
|
||||
<div class="stat-label">已拒绝</div>
|
||||
<div class="stat-value danger">{{ applicationStats.rejectedCount || 0 }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 申请进度条 -->
|
||||
<div class="progress-section">
|
||||
<div class="progress-label">招录进度</div>
|
||||
<el-progress :percentage="getProgressPercentage()" :color="getProgressColor()" :stroke-width="12" text-inside />
|
||||
<div class="progress-text">已录取 {{ applicationStats.approvedCount || 0 }} / {{ positionData.recruitmentCount }} 人</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<!-- 操作历史卡片 -->
|
||||
<el-card class="history-card" shadow="never">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<el-icon><Clock /></el-icon>
|
||||
操作历史
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<el-timeline class="history-timeline">
|
||||
<el-timeline-item
|
||||
v-for="(record, index) in operationHistory"
|
||||
:key="index"
|
||||
:timestamp="record.operationTime"
|
||||
:type="getTimelineType(record.operationType)"
|
||||
>
|
||||
<div class="timeline-content">
|
||||
<div class="timeline-title">{{ record.operationName }}</div>
|
||||
<div class="timeline-desc">{{ record.operationDesc }}</div>
|
||||
<div class="timeline-user">操作人:{{ record.operatorName }}</div>
|
||||
</div>
|
||||
</el-timeline-item>
|
||||
</el-timeline>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, onMounted } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { getWorkStudyPosition, updateWorkStudyPosition } from '@/api/jcbt/workStudyPosition';
|
||||
import { getApplicationStatistics } from '@/api/jcbt/workStudyApplication';
|
||||
import type { WorkStudyPositionVO } from '@/api/jcbt/workStudyPosition';
|
||||
|
||||
// 路由相关
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
|
||||
// 响应式数据
|
||||
const loading = ref(false);
|
||||
const positionData = ref<WorkStudyPositionVO | null>(null);
|
||||
const applicationStats = ref({
|
||||
totalCount: 0,
|
||||
pendingCount: 0,
|
||||
approvedCount: 0,
|
||||
rejectedCount: 0
|
||||
});
|
||||
const operationHistory = ref([
|
||||
{
|
||||
operationType: 'CREATE',
|
||||
operationName: '创建岗位',
|
||||
operationDesc: '岗位创建完成',
|
||||
operationTime: '2024-01-15 10:30:00',
|
||||
operatorName: '张老师'
|
||||
}
|
||||
]);
|
||||
|
||||
// 计算属性
|
||||
const positionId = computed(() => route.params.id as string);
|
||||
|
||||
const canEdit = computed(() => {
|
||||
return positionData.value && ['DRAFT', 'PUBLISHED'].includes(positionData.value.positionStatus);
|
||||
});
|
||||
|
||||
const canPublish = computed(() => {
|
||||
return positionData.value && positionData.value.positionStatus === 'DRAFT';
|
||||
});
|
||||
|
||||
const canStop = computed(() => {
|
||||
return positionData.value && positionData.value.positionStatus === 'RECRUITING';
|
||||
});
|
||||
|
||||
/** 获取状态类型 */
|
||||
const getStatusType = (status: string) => {
|
||||
const typeMap: Record<string, string> = {
|
||||
DRAFT: 'info',
|
||||
PUBLISHED: 'warning',
|
||||
RECRUITING: 'success',
|
||||
STOPPED: 'danger',
|
||||
COMPLETED: 'success'
|
||||
};
|
||||
return typeMap[status] || 'info';
|
||||
};
|
||||
|
||||
/** 获取状态文本 */
|
||||
const getStatusText = (status: string) => {
|
||||
const textMap: Record<string, string> = {
|
||||
DRAFT: '草稿',
|
||||
PUBLISHED: '已发布',
|
||||
RECRUITING: '招录中',
|
||||
STOPPED: '已停止',
|
||||
COMPLETED: '已完成'
|
||||
};
|
||||
return textMap[status] || '未知状态';
|
||||
};
|
||||
|
||||
/** 获取进度百分比 */
|
||||
const getProgressPercentage = () => {
|
||||
if (!positionData.value || !positionData.value.recruitmentCount) return 0;
|
||||
const approved = applicationStats.value.approvedCount || 0;
|
||||
const total = positionData.value.recruitmentCount;
|
||||
return Math.round((approved / total) * 100);
|
||||
};
|
||||
|
||||
/** 获取进度颜色 */
|
||||
const getProgressColor = () => {
|
||||
const percentage = getProgressPercentage();
|
||||
if (percentage >= 100) return '#67C23A';
|
||||
if (percentage >= 80) return '#E6A23C';
|
||||
if (percentage >= 50) return '#409EFF';
|
||||
return '#F56C6C';
|
||||
};
|
||||
|
||||
/** 获取时间轴类型 */
|
||||
const getTimelineType = (type: string) => {
|
||||
const typeMap: Record<string, string> = {
|
||||
CREATE: 'primary',
|
||||
PUBLISH: 'success',
|
||||
STOP: 'warning',
|
||||
COMPLETE: 'success'
|
||||
};
|
||||
return typeMap[type] || 'primary';
|
||||
};
|
||||
|
||||
/** 加载岗位详情 */
|
||||
const loadPositionDetail = async () => {
|
||||
if (!positionId.value) return;
|
||||
|
||||
loading.value = true;
|
||||
try {
|
||||
// 加载岗位详情
|
||||
const positionRes = await getWorkStudyPosition(positionId.value);
|
||||
positionData.value = positionRes.data;
|
||||
|
||||
// 加载申请统计
|
||||
const statsRes = await getApplicationStatistics(positionId.value);
|
||||
applicationStats.value = statsRes.data;
|
||||
} catch (error) {
|
||||
console.error('加载岗位详情失败:', error);
|
||||
ElMessage.error('加载岗位详情失败');
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
/** 返回上一页 */
|
||||
const handleBack = () => {
|
||||
router.back();
|
||||
};
|
||||
|
||||
/** 编辑岗位 */
|
||||
const handleEdit = () => {
|
||||
router.push(`/jcbt/workstudy/position/edit/${positionId.value}`);
|
||||
};
|
||||
|
||||
/** 发布岗位 */
|
||||
const handlePublish = async () => {
|
||||
try {
|
||||
await ElMessageBox.confirm('确定要发布此岗位吗?发布后学生可以申请。', '确认发布', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
});
|
||||
|
||||
loading.value = true;
|
||||
await updateWorkStudyPosition({
|
||||
...positionData.value,
|
||||
positionStatus: 'PUBLISHED'
|
||||
});
|
||||
|
||||
ElMessage.success('岗位发布成功');
|
||||
await loadPositionDetail(); // 重新加载数据
|
||||
} catch (error) {
|
||||
if (error !== 'cancel') {
|
||||
console.error('发布岗位失败:', error);
|
||||
ElMessage.error('发布岗位失败');
|
||||
}
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
/** 停止招录 */
|
||||
const handleStop = async () => {
|
||||
try {
|
||||
await ElMessageBox.confirm('确定要停止此岗位的招录吗?停止后将无法再接受新申请。', '确认停止', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
});
|
||||
|
||||
loading.value = true;
|
||||
await updateWorkStudyPosition({
|
||||
...positionData.value,
|
||||
positionStatus: 'STOPPED'
|
||||
});
|
||||
|
||||
ElMessage.success('已停止招录');
|
||||
await loadPositionDetail(); // 重新加载数据
|
||||
} catch (error) {
|
||||
if (error !== 'cancel') {
|
||||
console.error('停止招录失败:', error);
|
||||
ElMessage.error('停止招录失败');
|
||||
}
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 生命周期
|
||||
onMounted(() => {
|
||||
loadPositionDetail();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.position-detail-container {
|
||||
padding: 20px;
|
||||
max-width: 1400px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
/* 头部样式 */
|
||||
.detail-header {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.page-header {
|
||||
background: white;
|
||||
padding: 16px 20px;
|
||||
border-radius: 8px;
|
||||
border: 1px solid #e4e7ed;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
|
||||
}
|
||||
|
||||
.header-content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.header-title {
|
||||
font-size: 20px;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
.header-actions {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
/* 卡片样式 */
|
||||
.info-card,
|
||||
.stat-card,
|
||||
.history-card {
|
||||
margin-bottom: 20px;
|
||||
border-radius: 12px;
|
||||
border: 1px solid #e4e7ed;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.info-card:hover,
|
||||
.stat-card:hover,
|
||||
.history-card:hover {
|
||||
border-color: rgba(93, 135, 255, 0.2);
|
||||
box-shadow: 0 4px 16px rgba(93, 135, 255, 0.08);
|
||||
}
|
||||
|
||||
.card-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.card-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
font-weight: 600;
|
||||
font-size: 16px;
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
.card-title .el-icon {
|
||||
color: rgb(93, 135, 255);
|
||||
}
|
||||
|
||||
:deep(.el-card__header) {
|
||||
background: linear-gradient(135deg, #fafbff 0%, #f8fafc 100%);
|
||||
border-bottom: 1px solid rgba(93, 135, 255, 0.1);
|
||||
padding: 16px 20px;
|
||||
}
|
||||
|
||||
:deep(.el-card__body) {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
/* 内容样式 */
|
||||
.position-name {
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
color: rgb(93, 135, 255);
|
||||
}
|
||||
|
||||
.location {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.location .el-icon {
|
||||
color: rgb(255, 174, 31);
|
||||
}
|
||||
|
||||
.salary {
|
||||
color: rgb(255, 174, 31);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.count {
|
||||
color: rgb(93, 135, 255);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.content-section {
|
||||
padding: 16px;
|
||||
background: #f8f9fa;
|
||||
border-radius: 8px;
|
||||
border-left: 4px solid rgb(93, 135, 255);
|
||||
}
|
||||
|
||||
.requirement-content,
|
||||
.work-content,
|
||||
.remark-content {
|
||||
color: #606266;
|
||||
line-height: 1.8;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
/* 统计样式 */
|
||||
.stat-list {
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.stat-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 12px 0;
|
||||
border-bottom: 1px solid #f0f2f5;
|
||||
}
|
||||
|
||||
.stat-item:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.stat-label {
|
||||
color: #606266;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.stat-value {
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
|
||||
&.primary {
|
||||
color: rgb(93, 135, 255);
|
||||
}
|
||||
|
||||
&.warning {
|
||||
color: rgb(255, 174, 31);
|
||||
}
|
||||
|
||||
&.success {
|
||||
color: rgb(19, 222, 185);
|
||||
}
|
||||
|
||||
&.danger {
|
||||
color: #f56c6c;
|
||||
}
|
||||
}
|
||||
|
||||
.progress-section {
|
||||
padding-top: 16px;
|
||||
border-top: 1px solid #f0f2f5;
|
||||
}
|
||||
|
||||
.progress-label {
|
||||
color: #303133;
|
||||
font-weight: 500;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.progress-text {
|
||||
text-align: center;
|
||||
color: #909399;
|
||||
font-size: 12px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
/* 历史记录样式 */
|
||||
.history-timeline {
|
||||
max-height: 400px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.timeline-content {
|
||||
.timeline-title {
|
||||
font-weight: 500;
|
||||
color: #303133;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.timeline-desc {
|
||||
color: #606266;
|
||||
font-size: 14px;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.timeline-user {
|
||||
color: #909399;
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
/* 响应式布局 */
|
||||
@media (max-width: 1200px) {
|
||||
.position-detail-container {
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
:deep(.el-col) {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.position-detail-container {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.header-content {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.header-actions {
|
||||
width: 100%;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
:deep(.el-descriptions) {
|
||||
.el-descriptions__cell {
|
||||
padding: 8px !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,404 @@
|
||||
<template>
|
||||
<div class="form-container">
|
||||
<el-form ref="workStudyPositionFormRef" :model="form" :rules="rules" label-width="120px" v-loading="loading">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="岗位名称" prop="positionName">
|
||||
<el-input v-model="form.positionName" placeholder="请输入岗位名称" maxlength="50" show-word-limit />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="发布范围" prop="positionScope">
|
||||
<el-select v-model="form.positionScope" placeholder="请选择发布范围" style="width: 100%">
|
||||
<el-option v-for="option in positionScopeOptions" :key="option.value" :label="option.label" :value="option.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="发布学院" prop="collegeId">
|
||||
<el-select v-model="form.collegeId" placeholder="请选择发布学院" style="width: 100%" @change="handleCollegeChange">
|
||||
<el-option v-for="college in collegeOptions" :key="college.deptId" :label="college.deptName" :value="college.deptId" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="需求人数" prop="requiredCount">
|
||||
<el-input-number v-model="form.requiredCount" :min="1" :max="999" placeholder="请输入需求人数" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="工作时间" prop="workTime">
|
||||
<el-input v-model="form.workTime" placeholder="例如:周一至周五 9:00-17:00" maxlength="100" show-word-limit />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="开始日期" prop="startDate">
|
||||
<el-date-picker v-model="form.startDate" type="date" placeholder="选择开始日期" style="width: 100%" value-format="YYYY-MM-DD" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="结束日期" prop="endDate">
|
||||
<el-date-picker v-model="form.endDate" type="date" placeholder="选择结束日期" style="width: 100%" value-format="YYYY-MM-DD" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系老师" prop="contactTeacher">
|
||||
<el-input v-model="form.contactTeacher" placeholder="请输入联系老师姓名" maxlength="20" show-word-limit />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系电话" prop="contactPhone">
|
||||
<el-input v-model="form.contactPhone" placeholder="请输入联系电话" maxlength="20" show-word-limit />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="薪资情况" prop="salaryInfo">
|
||||
<el-input
|
||||
v-model="form.salaryInfo"
|
||||
type="textarea"
|
||||
:rows="2"
|
||||
placeholder="请输入薪资情况,例如:20元/小时,按月发放"
|
||||
maxlength="200"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="岗位要求" prop="positionRequirements">
|
||||
<el-input
|
||||
v-model="form.positionRequirements"
|
||||
type="textarea"
|
||||
:rows="4"
|
||||
placeholder="请详细描述岗位要求,包括专业要求、技能要求、工作内容等"
|
||||
maxlength="1000"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20" v-if="form.id">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="岗位状态" prop="status">
|
||||
<el-select v-model="form.status" placeholder="请选择岗位状态" style="width: 100%">
|
||||
<el-option v-for="option in statusOptions" :key="option.value" :label="option.label" :value="option.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="当前人数" prop="currentCount">
|
||||
<el-input-number
|
||||
v-model="form.currentCount"
|
||||
:min="0"
|
||||
:max="form.requiredCount || 999"
|
||||
placeholder="当前申请人数"
|
||||
style="width: 100%"
|
||||
disabled
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<div class="form-footer">
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, watch, getCurrentInstance, onMounted } from 'vue';
|
||||
import { getWorkStudyPosition, addWorkStudyPosition, updateWorkStudyPosition } from '@/api/jcbt/workStudyPosition';
|
||||
import { listColleges } from '@/api/xg/xsjcxx/classMsg/college';
|
||||
|
||||
const props = defineProps({
|
||||
positionId: {
|
||||
type: [String, Number],
|
||||
default: undefined
|
||||
}
|
||||
});
|
||||
|
||||
const emit = defineEmits(['success', 'cancel']);
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
const loading = ref(false);
|
||||
const workStudyPositionFormRef = ref();
|
||||
|
||||
// 学院选项数据
|
||||
const collegeOptions = ref([]);
|
||||
|
||||
// 表单数据
|
||||
const form = ref({
|
||||
id: undefined,
|
||||
positionName: '',
|
||||
positionScope: 'COLLEGE',
|
||||
requiredCount: 1,
|
||||
workTime: '',
|
||||
startDate: '',
|
||||
endDate: '',
|
||||
positionRequirements: '',
|
||||
salaryInfo: '',
|
||||
contactTeacher: '',
|
||||
contactPhone: '',
|
||||
status: 'DRAFT',
|
||||
currentCount: 0,
|
||||
collegeId: undefined,
|
||||
collegeName: ''
|
||||
});
|
||||
|
||||
// 表单验证规则
|
||||
const rules = reactive({
|
||||
positionName: [
|
||||
{ required: true, message: '岗位名称不能为空', trigger: 'blur' },
|
||||
{ min: 2, max: 50, message: '岗位名称长度在 2 到 50 个字符', trigger: 'blur' }
|
||||
],
|
||||
positionScope: [{ required: true, message: '请选择发布范围', trigger: 'change' }],
|
||||
collegeId: [{ required: true, message: '发布学院不能为空', trigger: 'change' }],
|
||||
requiredCount: [
|
||||
{ required: true, message: '需求人数不能为空', trigger: 'blur' },
|
||||
{ type: 'number', min: 1, max: 999, message: '需求人数必须在 1 到 999 之间', trigger: 'blur' }
|
||||
],
|
||||
workTime: [
|
||||
{ required: true, message: '工作时间不能为空', trigger: 'blur' },
|
||||
{ max: 100, message: '工作时间长度不能超过 100 个字符', trigger: 'blur' }
|
||||
],
|
||||
startDate: [{ required: true, message: '开始日期不能为空', trigger: 'change' }],
|
||||
endDate: [
|
||||
{ required: true, message: '结束日期不能为空', trigger: 'change' },
|
||||
{
|
||||
validator: (rule, value, callback) => {
|
||||
if (value && form.value.startDate && value <= form.value.startDate) {
|
||||
callback(new Error('结束日期必须大于开始日期'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
trigger: 'change'
|
||||
}
|
||||
],
|
||||
contactTeacher: [
|
||||
{ required: true, message: '联系老师不能为空', trigger: 'blur' },
|
||||
{ max: 20, message: '联系老师长度不能超过 20 个字符', trigger: 'blur' }
|
||||
],
|
||||
contactPhone: [
|
||||
{ required: true, message: '联系电话不能为空', trigger: 'blur' },
|
||||
{ pattern: /^1[3-9]\d{9}$/, message: '请输入正确的手机号码', trigger: 'blur' }
|
||||
],
|
||||
salaryInfo: [
|
||||
{ required: true, message: '薪资情况不能为空', trigger: 'blur' },
|
||||
{ max: 200, message: '薪资情况长度不能超过 200 个字符', trigger: 'blur' }
|
||||
],
|
||||
positionRequirements: [
|
||||
{ required: true, message: '岗位要求不能为空', trigger: 'blur' },
|
||||
{ max: 1000, message: '岗位要求长度不能超过 1000 个字符', trigger: 'blur' }
|
||||
]
|
||||
});
|
||||
|
||||
// 选项数据
|
||||
const positionScopeOptions = ref([
|
||||
{ label: '本学院', value: 'COLLEGE' },
|
||||
{ label: '全校', value: 'UNIVERSITY' }
|
||||
]);
|
||||
|
||||
const statusOptions = ref([
|
||||
{ label: '草稿', value: 'DRAFT' },
|
||||
{ label: '已发布', value: 'PUBLISHED' },
|
||||
{ label: '招录中', value: 'RECRUITING' },
|
||||
{ label: '已满员', value: 'FULL' },
|
||||
{ label: '已过期', value: 'EXPIRED' },
|
||||
{ label: '已暂停', value: 'SUSPENDED' },
|
||||
{ label: '已取消', value: 'CANCELLED' }
|
||||
]);
|
||||
|
||||
/** 取消按钮 */
|
||||
const cancel = () => {
|
||||
emit('cancel');
|
||||
};
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = {
|
||||
id: undefined,
|
||||
positionName: '',
|
||||
positionScope: 'COLLEGE',
|
||||
requiredCount: 1,
|
||||
workTime: '',
|
||||
startDate: '',
|
||||
endDate: '',
|
||||
positionRequirements: '',
|
||||
salaryInfo: '',
|
||||
contactTeacher: '',
|
||||
contactPhone: '',
|
||||
status: 'DRAFT',
|
||||
currentCount: 0,
|
||||
collegeId: undefined,
|
||||
collegeName: ''
|
||||
};
|
||||
workStudyPositionFormRef.value?.resetFields();
|
||||
};
|
||||
|
||||
/** 提交表单 */
|
||||
const submitForm = async () => {
|
||||
const valid = await workStudyPositionFormRef.value?.validate();
|
||||
if (!valid) return;
|
||||
|
||||
loading.value = true;
|
||||
try {
|
||||
if (form.value.id) {
|
||||
await updateWorkStudyPosition(form.value);
|
||||
proxy?.$modal.msgSuccess('修改成功');
|
||||
} else {
|
||||
await addWorkStudyPosition(form.value);
|
||||
proxy?.$modal.msgSuccess('新增成功');
|
||||
}
|
||||
emit('success');
|
||||
} catch (error) {
|
||||
console.error('提交失败:', error);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
/** 获取岗位详细信息 */
|
||||
const getPosition = async (id) => {
|
||||
loading.value = true;
|
||||
try {
|
||||
const res = await getWorkStudyPosition(id);
|
||||
Object.assign(form.value, res.data);
|
||||
} catch (error) {
|
||||
console.error('获取岗位信息失败:', error);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
/** 获取学院列表 */
|
||||
const getCollegeList = async () => {
|
||||
loading.value = true;
|
||||
try {
|
||||
const res = await listColleges();
|
||||
collegeOptions.value = res.data;
|
||||
if (form.value.collegeId) {
|
||||
const college = collegeOptions.value.find((item) => item.deptId === form.value.collegeId);
|
||||
if (college) {
|
||||
form.value.collegeName = college.deptName;
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取学院列表失败:', error);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
/** 处理学院选择变化 */
|
||||
const handleCollegeChange = (value) => {
|
||||
const college = collegeOptions.value.find((item) => item.deptId === value);
|
||||
if (college) {
|
||||
form.value.collegeName = college.deptName;
|
||||
} else {
|
||||
form.value.collegeName = '';
|
||||
}
|
||||
};
|
||||
|
||||
// 监听props变化
|
||||
watch(
|
||||
() => props.positionId,
|
||||
(newVal) => {
|
||||
reset();
|
||||
if (newVal) {
|
||||
getPosition(newVal);
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
// 组件挂载时初始化数据
|
||||
onMounted(() => {
|
||||
getCollegeList();
|
||||
});
|
||||
|
||||
// 暴露方法
|
||||
defineExpose({
|
||||
reset
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.form-container {
|
||||
padding: 20px;
|
||||
|
||||
.form-footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 10px;
|
||||
margin-top: 20px;
|
||||
padding-top: 20px;
|
||||
border-top: 1px solid #ebeef5;
|
||||
}
|
||||
|
||||
/* 表单样式美化 */
|
||||
:deep(.el-form-item__label) {
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
:deep(.el-input__inner) {
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
:deep(.el-textarea__inner) {
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
:deep(.el-select) {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
:deep(.el-date-editor) {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* 必填项标识 */
|
||||
:deep(.el-form-item.is-required .el-form-item__label::before) {
|
||||
color: #f56c6c;
|
||||
}
|
||||
}
|
||||
|
||||
/* 响应式设计 */
|
||||
@media (max-width: 768px) {
|
||||
.form-container {
|
||||
padding: 15px;
|
||||
|
||||
:deep(.el-col) {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.form-footer {
|
||||
flex-direction: column;
|
||||
|
||||
.el-button {
|
||||
width: 100%;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,921 @@
|
||||
<template>
|
||||
<div class="p-2 page-container">
|
||||
<!-- 统计卡片区域 -->
|
||||
<div class="mb-10px">
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="6">
|
||||
<el-card shadow="hover" class="stat-card stat-card-primary">
|
||||
<div class="stat-content">
|
||||
<div class="stat-icon">
|
||||
<el-icon><Briefcase /></el-icon>
|
||||
</div>
|
||||
<div class="stat-info">
|
||||
<div class="stat-value">{{ statisticsData.totalCount || 0 }}</div>
|
||||
<div class="stat-label">岗位总数</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-card shadow="hover" class="stat-card stat-card-success">
|
||||
<div class="stat-content">
|
||||
<div class="stat-icon">
|
||||
<el-icon><CircleCheck /></el-icon>
|
||||
</div>
|
||||
<div class="stat-info">
|
||||
<div class="stat-value">{{ statisticsData.statusCount?.RECRUITING || 0 }}</div>
|
||||
<div class="stat-label">招录中</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-card shadow="hover" class="stat-card stat-card-warning">
|
||||
<div class="stat-content">
|
||||
<div class="stat-icon">
|
||||
<el-icon><Clock /></el-icon>
|
||||
</div>
|
||||
<div class="stat-info">
|
||||
<div class="stat-value">{{ statisticsData.statusCount?.PUBLISHED || 0 }}</div>
|
||||
<div class="stat-label">已发布</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-card shadow="hover" class="stat-card stat-card-info">
|
||||
<div class="stat-content">
|
||||
<div class="stat-icon">
|
||||
<el-icon><EditPen /></el-icon>
|
||||
</div>
|
||||
<div class="stat-info">
|
||||
<div class="stat-value">{{ statisticsData.statusCount?.DRAFT || 0 }}</div>
|
||||
<div class="stat-label">草稿</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<!-- 搜索区域 -->
|
||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||
<div v-show="showSearch" class="mb-10px">
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" :model="queryParams" label-width="100px">
|
||||
<!-- 第一行:4个搜索条件 -->
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="岗位名称" prop="positionName">
|
||||
<el-input v-model="queryParams.positionName" placeholder="请输入岗位名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="发布范围" prop="positionScope">
|
||||
<el-select v-model="queryParams.positionScope" placeholder="请选择发布范围" clearable style="width: 100%">
|
||||
<el-option label="本学院" value="COLLEGE" />
|
||||
<el-option label="全校" value="UNIVERSITY" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="联系老师" prop="contactTeacher">
|
||||
<el-input v-model="queryParams.contactTeacher" placeholder="请输入联系老师" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="岗位状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择岗位状态" clearable style="width: 100%">
|
||||
<el-option v-for="status in statusOptions" :key="status.value" :label="status.label" :value="status.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 第二行:2个搜索条件 + 操作按钮 -->
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="创建时间">
|
||||
<el-date-picker
|
||||
v-model="queryParams.createTime"
|
||||
type="daterange"
|
||||
value-format="YYYY-MM-DD"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="有效期">
|
||||
<el-date-picker
|
||||
v-model="queryParams.validPeriod"
|
||||
type="daterange"
|
||||
value-format="YYYY-MM-DD"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div style="display: flex; align-items: center; justify-content: flex-end; margin-top: 32px">
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
<el-button type="info" plain icon="Search" @click="showSearch = !showSearch"> {{ showSearch ? '隐藏' : '显示' }}搜索 </el-button>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
<!-- 工具栏 -->
|
||||
<el-row :gutter="10" class="mb-8px">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['jcbt:workStudyPosition:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['jcbt:workStudyPosition:edit']">
|
||||
修改
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['jcbt:workStudyPosition:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['jcbt:workStudyPosition:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<!-- 表格数据 -->
|
||||
<el-card shadow="hover" class="table-card">
|
||||
<el-table v-loading="loading" :data="positionList" @selection-change="handleSelectionChange" border stripe size="small" style="width: 100%">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="岗位名称" align="center" prop="positionName" min-width="150" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<el-link type="primary" @click="handleView(scope.row)" :underline="false">
|
||||
{{ scope.row.positionName }}
|
||||
</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="发布范围" align="center" prop="positionScopeName" min-width="100">
|
||||
<template #default="scope">
|
||||
<el-tag :type="scope.row.positionScope === 'UNIVERSITY' ? 'success' : 'info'" size="small">
|
||||
{{ scope.row.positionScopeName }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="需求人数" align="center" prop="requiredCount" min-width="100" />
|
||||
<el-table-column label="当前人数" align="center" prop="currentCount" min-width="100">
|
||||
<template #default="scope">
|
||||
<span :class="{ 'text-success': scope.row.currentCount >= scope.row.requiredCount }">
|
||||
{{ scope.row.currentCount || 0 }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="工作时间" align="center" prop="workTime" min-width="150" show-overflow-tooltip />
|
||||
<el-table-column label="有效期" align="center" min-width="180">
|
||||
<template #default="scope">
|
||||
<div class="date-range">
|
||||
<div>{{ scope.row.startDate }}</div>
|
||||
<div>至 {{ scope.row.endDate }}</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="联系老师" align="center" prop="contactTeacher" min-width="120" />
|
||||
<el-table-column label="联系电话" align="center" prop="contactPhone" min-width="130" />
|
||||
<el-table-column label="岗位状态" align="center" prop="statusName" min-width="120">
|
||||
<template #default="scope">
|
||||
<el-tag :type="getStatusType(scope.row?.status)" size="small">
|
||||
{{ scope.row?.statusName || '-' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" min-width="180" />
|
||||
<el-table-column label="操作" align="center" width="200" class-name="small-padding fixed-width" fixed="right">
|
||||
<template #default="scope">
|
||||
<div class="operation-buttons">
|
||||
<el-tooltip content="查看详情" placement="top">
|
||||
<el-button link type="primary" icon="View" @click="handleView(scope.row)" v-hasPermi="['jcbt:workStudyPosition:query']" />
|
||||
</el-tooltip>
|
||||
<el-tooltip content="编辑" placement="top">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['jcbt:workStudyPosition:edit']" />
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['jcbt:workStudyPosition:remove']" />
|
||||
</el-tooltip>
|
||||
<el-dropdown
|
||||
v-if="scope.row?.id"
|
||||
@command="(command) => handleCommand(command, scope.row)"
|
||||
:disabled="!scope.row?.id"
|
||||
trigger="click"
|
||||
placement="bottom-end"
|
||||
>
|
||||
<el-button link type="primary" icon="MoreFilled" />
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item
|
||||
v-if="hasPermission('jcbt:workStudyPosition:publish')"
|
||||
command="publish"
|
||||
:disabled="getRowStatus(scope.row) !== 'DRAFT'"
|
||||
>
|
||||
<el-icon><Upload /></el-icon>发布岗位
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
v-if="hasPermission('jcbt:workStudyPosition:suspend')"
|
||||
command="suspend"
|
||||
:disabled="!['PUBLISHED', 'RECRUITING'].includes(getRowStatus(scope.row))"
|
||||
>
|
||||
<el-icon><VideoPause /></el-icon>暂停招录
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
v-if="hasPermission('jcbt:workStudyPosition:resume')"
|
||||
command="resume"
|
||||
:disabled="getRowStatus(scope.row) !== 'SUSPENDED'"
|
||||
>
|
||||
<el-icon><VideoPlay /></el-icon>恢复招录
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
v-if="hasPermission('jcbt:workStudyPosition:cancel')"
|
||||
command="cancel"
|
||||
:disabled="['CANCELLED', 'EXPIRED'].includes(getRowStatus(scope.row))"
|
||||
>
|
||||
<el-icon><Close /></el-icon>取消岗位
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
|
||||
<!-- 分页 -->
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
<!-- 添加或修改岗位对话框 -->
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="900px" append-to-body>
|
||||
<PositionForm ref="positionFormRef" :position-id="dialog.positionId" @success="handleFormSuccess" @cancel="handleFormCancel" />
|
||||
</el-dialog>
|
||||
|
||||
<!-- 岗位详情对话框 -->
|
||||
<el-dialog title="岗位详情" v-model="detailDialog.visible" width="700px" append-to-body>
|
||||
<PositionDetail v-if="detailDialog.visible" :position-id="detailDialog.positionId" />
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="detailDialog.visible = false">关 闭</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="WorkStudyPosition">
|
||||
import { ref, reactive, getCurrentInstance, onMounted, computed } from 'vue';
|
||||
import {
|
||||
listWorkStudyPosition,
|
||||
listAvailablePositionsForStudent,
|
||||
getWorkStudyPosition,
|
||||
delWorkStudyPosition,
|
||||
exportWorkStudyPosition,
|
||||
getPositionStatistics,
|
||||
publishPosition,
|
||||
suspendPosition,
|
||||
resumePosition,
|
||||
cancelPosition
|
||||
} from '@/api/jcbt/workStudyPosition';
|
||||
import { checkPermi } from '@/utils/permission';
|
||||
import { useUserStore } from '@/store/modules/user';
|
||||
import PositionForm from './form.vue';
|
||||
import PositionDetail from './components/PositionDetail.vue';
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const userStore = useUserStore();
|
||||
|
||||
// 数据状态
|
||||
const positionList = ref([]);
|
||||
const loading = ref(true);
|
||||
|
||||
// 判断是否为学生用户(没有岗位管理权限)
|
||||
const isStudent = computed(() => {
|
||||
return !checkPermi(['jcbt:workStudyPosition:list']);
|
||||
});
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const statisticsData = ref({});
|
||||
|
||||
// 查询参数
|
||||
const queryParams = ref({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
positionName: undefined,
|
||||
positionScope: undefined,
|
||||
contactTeacher: undefined,
|
||||
status: undefined,
|
||||
createTime: undefined,
|
||||
validPeriod: undefined
|
||||
});
|
||||
|
||||
// 表单引用
|
||||
const queryFormRef = ref();
|
||||
const positionFormRef = ref();
|
||||
|
||||
// 对话框状态
|
||||
const dialog = reactive({
|
||||
visible: false,
|
||||
title: '',
|
||||
positionId: undefined
|
||||
});
|
||||
|
||||
const detailDialog = reactive({
|
||||
visible: false,
|
||||
positionId: undefined
|
||||
});
|
||||
|
||||
// 状态选项
|
||||
const statusOptions = ref([
|
||||
{ label: '草稿', value: 'DRAFT' },
|
||||
{ label: '已发布', value: 'PUBLISHED' },
|
||||
{ label: '招录中', value: 'RECRUITING' },
|
||||
{ label: '已满员', value: 'FULL' },
|
||||
{ label: '已过期', value: 'EXPIRED' },
|
||||
{ label: '已暂停', value: 'SUSPENDED' },
|
||||
{ label: '已取消', value: 'CANCELLED' }
|
||||
]);
|
||||
|
||||
/** 查询岗位列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
|
||||
// 防止重复调用
|
||||
if (getList._running) {
|
||||
return;
|
||||
}
|
||||
getList._running = true;
|
||||
|
||||
// 根据用户角色选择不同的API
|
||||
const apiCall = isStudent.value ? listAvailablePositionsForStudent(queryParams.value) : listWorkStudyPosition(queryParams.value);
|
||||
|
||||
apiCall
|
||||
.then((response) => {
|
||||
try {
|
||||
// 验证返回数据格式
|
||||
if (response && typeof response === 'object') {
|
||||
const newRows = Array.isArray(response.rows) ? response.rows : [];
|
||||
const newTotal = Number(response.total) || 0;
|
||||
|
||||
// 使用nextTick确保DOM更新的安全性
|
||||
proxy?.$nextTick(() => {
|
||||
positionList.value = newRows;
|
||||
total.value = newTotal;
|
||||
});
|
||||
} else {
|
||||
proxy?.$nextTick(() => {
|
||||
positionList.value = [];
|
||||
total.value = 0;
|
||||
});
|
||||
console.error('获取岗位列表返回数据格式异常:', response);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('处理岗位列表数据失败:', error);
|
||||
proxy?.$nextTick(() => {
|
||||
positionList.value = [];
|
||||
total.value = 0;
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('获取岗位列表失败:', error);
|
||||
proxy?.$nextTick(() => {
|
||||
positionList.value = [];
|
||||
total.value = 0;
|
||||
});
|
||||
proxy?.$modal.msgError('获取岗位列表失败');
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false;
|
||||
getList._running = false;
|
||||
});
|
||||
}
|
||||
|
||||
/** 查询统计数据 */
|
||||
function getStatistics() {
|
||||
getPositionStatistics()
|
||||
.then((response) => {
|
||||
if (response && response.data && typeof response.data === 'object') {
|
||||
statisticsData.value = response.data;
|
||||
} else {
|
||||
statisticsData.value = {};
|
||||
console.error('获取统计数据返回格式异常:', response);
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('获取统计数据失败:', error);
|
||||
statisticsData.value = {};
|
||||
});
|
||||
}
|
||||
|
||||
/** 取消按钮 */
|
||||
function cancel() {
|
||||
dialog.visible = false;
|
||||
reset();
|
||||
}
|
||||
|
||||
/** 表单重置 */
|
||||
function reset() {
|
||||
dialog.positionId = undefined;
|
||||
dialog.title = '';
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
/** 多选框选中数据 */
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length !== 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset();
|
||||
dialog.visible = true;
|
||||
dialog.title = '添加勤工俭学岗位';
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
const positionId = row?.id || ids.value[0];
|
||||
dialog.positionId = positionId;
|
||||
dialog.visible = true;
|
||||
dialog.title = '修改勤工俭学岗位';
|
||||
}
|
||||
|
||||
/** 查看详情 */
|
||||
function handleView(row) {
|
||||
detailDialog.positionId = row.id;
|
||||
detailDialog.visible = true;
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
async function handleDelete(row) {
|
||||
const positionIds = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除岗位编号为"' + positionIds + '"的数据项?');
|
||||
|
||||
try {
|
||||
await delWorkStudyPosition(positionIds);
|
||||
await getList();
|
||||
await getStatistics();
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
} catch (error) {
|
||||
console.error('删除失败:', error);
|
||||
}
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy?.$download.excel(exportWorkStudyPosition, queryParams.value, `workstudy_position_${new Date().getTime()}.xlsx`);
|
||||
}
|
||||
|
||||
/** 操作命令处理 */
|
||||
async function handleCommand(command, row) {
|
||||
// 验证必要参数
|
||||
if (!command || !row || !row.id) {
|
||||
console.error('handleCommand参数无效:', { command, row });
|
||||
proxy?.$modal.msgError('操作参数错误');
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
let operationSuccess = false;
|
||||
|
||||
switch (command) {
|
||||
case 'publish':
|
||||
await proxy?.$modal.confirm('确认发布此岗位?发布后学生可以申请此岗位。');
|
||||
await publishPosition(row.id);
|
||||
proxy?.$modal.msgSuccess('发布成功');
|
||||
operationSuccess = true;
|
||||
break;
|
||||
case 'suspend':
|
||||
await proxy?.$modal.confirm('确认暂停此岗位的招录?暂停后学生无法申请此岗位。');
|
||||
await suspendPosition(row.id);
|
||||
proxy?.$modal.msgSuccess('暂停成功');
|
||||
operationSuccess = true;
|
||||
break;
|
||||
case 'resume':
|
||||
await proxy?.$modal.confirm('确认恢复此岗位的招录?恢复后学生可以继续申请此岗位。');
|
||||
await resumePosition(row.id);
|
||||
proxy?.$modal.msgSuccess('恢复成功');
|
||||
operationSuccess = true;
|
||||
break;
|
||||
case 'cancel':
|
||||
await proxy?.$modal.confirm('确认取消此岗位?取消后将无法恢复,请谨慎操作。');
|
||||
await cancelPosition(row.id);
|
||||
proxy?.$modal.msgSuccess('取消成功');
|
||||
operationSuccess = true;
|
||||
break;
|
||||
default:
|
||||
console.error('未知操作命令:', command);
|
||||
proxy?.$modal.msgError('未知操作');
|
||||
return;
|
||||
}
|
||||
|
||||
// 只有操作成功后才刷新数据
|
||||
if (operationSuccess) {
|
||||
// 使用setTimeout延迟刷新,避免渲染冲突
|
||||
setTimeout(() => {
|
||||
getList();
|
||||
getStatistics();
|
||||
}, 100);
|
||||
}
|
||||
} catch (error) {
|
||||
// 区分用户取消和真正的错误
|
||||
if (error === 'cancel') {
|
||||
// 用户取消操作,不显示错误信息
|
||||
return;
|
||||
}
|
||||
console.error('操作失败:', error);
|
||||
proxy?.$modal.msgError(`操作失败: ${error.message || error}`);
|
||||
}
|
||||
}
|
||||
|
||||
/** 表单成功回调 */
|
||||
function handleFormSuccess() {
|
||||
dialog.visible = false;
|
||||
getList();
|
||||
getStatistics();
|
||||
}
|
||||
|
||||
/** 表单取消回调 */
|
||||
function handleFormCancel() {
|
||||
dialog.visible = false;
|
||||
}
|
||||
|
||||
/** 获取状态标签类型 */
|
||||
function getStatusType(status) {
|
||||
const typeMap = {
|
||||
DRAFT: 'info',
|
||||
PUBLISHED: 'warning',
|
||||
RECRUITING: 'success',
|
||||
FULL: 'primary',
|
||||
EXPIRED: 'danger',
|
||||
SUSPENDED: 'warning',
|
||||
CANCELLED: 'danger'
|
||||
};
|
||||
return typeMap[status] || 'info';
|
||||
}
|
||||
|
||||
/** 安全获取行数据状态 */
|
||||
function getRowStatus(row) {
|
||||
try {
|
||||
return row?.status || '';
|
||||
} catch (error) {
|
||||
console.warn('获取行状态失败:', error);
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
/** 安全的权限检查函数 */
|
||||
function hasPermission(permission) {
|
||||
try {
|
||||
if (!permission || typeof permission !== 'string') {
|
||||
return false;
|
||||
}
|
||||
return checkPermi([permission]);
|
||||
} catch (error) {
|
||||
console.warn('权限检查失败:', error);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// 生命周期
|
||||
onMounted(() => {
|
||||
getList();
|
||||
getStatistics();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.page-container {
|
||||
background-color: #f0f2f5;
|
||||
min-height: calc(100vh - 84px);
|
||||
}
|
||||
|
||||
/* 统计卡片样式 */
|
||||
.stat-card {
|
||||
border-radius: 8px;
|
||||
border: none;
|
||||
|
||||
.stat-content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.stat-icon {
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-right: 16px;
|
||||
|
||||
.el-icon {
|
||||
font-size: 24px;
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
|
||||
.stat-info {
|
||||
flex: 1;
|
||||
|
||||
.stat-value {
|
||||
font-size: 28px;
|
||||
font-weight: bold;
|
||||
line-height: 1;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.stat-label {
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
line-height: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.stat-card-primary {
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
color: white;
|
||||
|
||||
.stat-icon {
|
||||
background-color: rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
|
||||
.stat-value {
|
||||
color: white;
|
||||
}
|
||||
|
||||
.stat-label {
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
|
||||
&.stat-card-success {
|
||||
background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
|
||||
color: white;
|
||||
|
||||
.stat-icon {
|
||||
background-color: rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
|
||||
.stat-value {
|
||||
color: white;
|
||||
}
|
||||
|
||||
.stat-label {
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
|
||||
&.stat-card-warning {
|
||||
background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
|
||||
color: white;
|
||||
|
||||
.stat-icon {
|
||||
background-color: rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
|
||||
.stat-value {
|
||||
color: white;
|
||||
}
|
||||
|
||||
.stat-label {
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
|
||||
&.stat-card-info {
|
||||
background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
|
||||
color: white;
|
||||
|
||||
.stat-icon {
|
||||
background-color: rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
|
||||
.stat-value {
|
||||
color: white;
|
||||
}
|
||||
|
||||
.stat-label {
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 表格卡片样式 */
|
||||
.table-card {
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
||||
margin-bottom: 20px;
|
||||
|
||||
.el-card__body {
|
||||
padding: 0;
|
||||
overflow-x: auto;
|
||||
}
|
||||
}
|
||||
|
||||
/* 表格样式 */
|
||||
.el-table {
|
||||
border-radius: 0;
|
||||
overflow: hidden;
|
||||
width: 100% !important;
|
||||
min-width: 1200px; /* 确保表格有最小宽度 */
|
||||
|
||||
.text-success {
|
||||
color: #67c23a;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.date-range {
|
||||
font-size: 12px;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.operation-buttons {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
/* 表格头部样式 */
|
||||
.el-table__header-wrapper {
|
||||
.el-table__header {
|
||||
th {
|
||||
background-color: #fafafa;
|
||||
color: #333;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 表格行样式 */
|
||||
.el-table__body-wrapper {
|
||||
.el-table__body {
|
||||
tr {
|
||||
&:hover {
|
||||
background-color: #f5f7fa;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 搜索表单样式 */
|
||||
.el-card {
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
/* 页面容器样式 */
|
||||
.page-container {
|
||||
width: 100%;
|
||||
max-width: none;
|
||||
margin: 0;
|
||||
padding: 16px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* 响应式设计 */
|
||||
@media (max-width: 1200px) {
|
||||
.page-container {
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.table-card {
|
||||
.el-card__body {
|
||||
overflow-x: auto;
|
||||
}
|
||||
}
|
||||
|
||||
.el-table {
|
||||
min-width: 1000px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.page-container {
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
.stat-card {
|
||||
margin-bottom: 10px;
|
||||
|
||||
.stat-content {
|
||||
.stat-icon {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
margin-right: 12px;
|
||||
|
||||
.el-icon {
|
||||
font-size: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.stat-info {
|
||||
.stat-value {
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
.stat-label {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.el-table {
|
||||
min-width: 800px;
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
/* 动画效果 */
|
||||
.el-table tbody tr:hover {
|
||||
background-color: #f5f7fa;
|
||||
}
|
||||
|
||||
.operation-buttons .el-button {
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.operation-buttons .el-button:hover {
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
/* 对话框样式优化 */
|
||||
:deep(.el-dialog) {
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
|
||||
.el-dialog__header {
|
||||
background-color: #f8f9fa;
|
||||
border-bottom: 1px solid #e9ecef;
|
||||
padding: 16px 20px;
|
||||
|
||||
.el-dialog__title {
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
.el-dialog__body {
|
||||
padding: 20px;
|
||||
max-height: 70vh;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.el-dialog__footer {
|
||||
border-top: 1px solid #e9ecef;
|
||||
padding: 12px 20px;
|
||||
text-align: right;
|
||||
background-color: #f8f9fa;
|
||||
|
||||
.dialog-footer {
|
||||
.el-button {
|
||||
min-width: 80px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 详情对话框特殊样式 */
|
||||
:deep(.el-dialog[aria-label='岗位详情']) {
|
||||
.el-dialog__body {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,359 @@
|
||||
<template>
|
||||
<div class="all-applications">
|
||||
<!-- 搜索表单 -->
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" class="search-form">
|
||||
<el-form-item label="岗位名称" prop="positionName">
|
||||
<el-input v-model="queryParams.positionName" placeholder="请输入岗位名称" clearable style="width: 200px" @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="学生姓名" prop="studentName">
|
||||
<el-input v-model="queryParams.studentName" placeholder="请输入学生姓名" clearable style="width: 200px" @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="学号" prop="studentNo">
|
||||
<el-input v-model="queryParams.studentNo" placeholder="请输入学号" clearable style="width: 200px" @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="审核状态" prop="reviewStatus">
|
||||
<el-select v-model="queryParams.reviewStatus" placeholder="请选择审核状态" clearable style="width: 200px">
|
||||
<el-option label="待审核" value="pending" />
|
||||
<el-option label="已通过" value="approved" />
|
||||
<el-option label="已拒绝" value="rejected" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="申请日期" prop="applicationDate">
|
||||
<el-date-picker
|
||||
v-model="queryParams.applicationDate"
|
||||
type="daterange"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
style="width: 240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<!-- 数据表格 -->
|
||||
<el-table v-loading="loading" :data="applicationList" row-key="id">
|
||||
<el-table-column label="序号" type="index" width="60" align="center" />
|
||||
<el-table-column label="岗位名称" prop="positionName" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column label="学生信息" min-width="160">
|
||||
<template #default="{ row }">
|
||||
<div class="student-info">
|
||||
<div class="name">{{ row.studentName }}</div>
|
||||
<div class="detail">{{ row.studentNo }} | {{ row.className }}</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="专业年级" min-width="140">
|
||||
<template #default="{ row }">
|
||||
<div>{{ row.majorName }}</div>
|
||||
<div class="text-gray">{{ row.grade }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="联系方式" min-width="120">
|
||||
<template #default="{ row }">
|
||||
<div>{{ row.contactPhone }}</div>
|
||||
<div class="text-gray">{{ row.email }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="申请理由" prop="applicationReason" min-width="200" show-overflow-tooltip />
|
||||
<el-table-column label="申请时间" prop="applicationDate" width="110" align="center" />
|
||||
<el-table-column label="审核状态" width="100" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="getStatusTagType(row.reviewStatus)" effect="plain">
|
||||
{{ getStatusText(row.reviewStatus) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="审核人" prop="reviewerName" width="100" align="center" />
|
||||
<el-table-column label="审核时间" prop="reviewTime" width="110" align="center" />
|
||||
<el-table-column label="操作" fixed="right" width="160" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-button type="primary" size="small" icon="View" @click="handleDetail(row)"> 详情 </el-button>
|
||||
<el-button v-if="row.reviewStatus === 'pending'" type="warning" size="small" icon="Edit" @click="handleReview(row)"> 审核 </el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 分页 -->
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
<!-- 审核对话框 -->
|
||||
<el-dialog v-model="reviewDialog.visible" :title="reviewDialog.title" width="600px" append-to-body>
|
||||
<el-form ref="reviewFormRef" :model="reviewDialog.form" :rules="reviewRules" label-width="100px">
|
||||
<el-form-item label="审核结果" prop="reviewResult">
|
||||
<el-radio-group v-model="reviewDialog.form.reviewResult">
|
||||
<el-radio value="approved">通过</el-radio>
|
||||
<el-radio value="rejected">拒绝</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="审核意见" prop="reviewComment">
|
||||
<el-input v-model="reviewDialog.form.reviewComment" type="textarea" :rows="4" placeholder="请输入审核意见" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="reviewDialog.visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="submitReview">确认</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 详情对话框 -->
|
||||
<ApplicationDetail v-model:visible="detailDialog.visible" :application-id="detailDialog.applicationId" @refresh="getList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="AllApplications">
|
||||
import { ref, reactive, onMounted } from 'vue';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { Search } from '@element-plus/icons-vue';
|
||||
import {
|
||||
listCollegeApplications,
|
||||
reviewApplication,
|
||||
type WorkStudyApplicationVO,
|
||||
type WorkStudyApplicationQuery,
|
||||
type ReviewForm
|
||||
} from '@/api/jcbt/workStudyApplicationCollegeReview';
|
||||
import ApplicationDetail from './ApplicationDetail.vue';
|
||||
|
||||
// 响应式数据
|
||||
const loading = ref(false);
|
||||
const applicationList = ref<WorkStudyApplicationVO[]>([]);
|
||||
const total = ref(0);
|
||||
|
||||
// 查询参数
|
||||
const queryParams = reactive<WorkStudyApplicationQuery>({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
positionName: '',
|
||||
studentName: '',
|
||||
studentNo: '',
|
||||
reviewStatus: '',
|
||||
applicationDate: []
|
||||
});
|
||||
|
||||
// 审核对话框
|
||||
const reviewDialog = reactive({
|
||||
visible: false,
|
||||
title: '',
|
||||
form: {
|
||||
applicationId: '',
|
||||
reviewResult: 'approved',
|
||||
reviewComment: ''
|
||||
} as ReviewForm
|
||||
});
|
||||
|
||||
// 详情对话框
|
||||
const detailDialog = reactive({
|
||||
visible: false,
|
||||
applicationId: ''
|
||||
});
|
||||
|
||||
// 表单验证规则
|
||||
const reviewRules = {
|
||||
reviewResult: [{ required: true, message: '请选择审核结果', trigger: 'change' }],
|
||||
reviewComment: [
|
||||
{ required: true, message: '请输入审核意见', trigger: 'blur' },
|
||||
{ min: 5, max: 500, message: '审核意见长度在 5 到 500 个字符', trigger: 'blur' }
|
||||
]
|
||||
};
|
||||
|
||||
// 表单引用
|
||||
const queryRef = ref();
|
||||
const reviewFormRef = ref();
|
||||
|
||||
// 获取列表数据
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
try {
|
||||
const params = { ...queryParams };
|
||||
// 处理日期范围
|
||||
if (params.applicationDate && params.applicationDate.length === 2) {
|
||||
params.startDate = params.applicationDate[0];
|
||||
params.endDate = params.applicationDate[1];
|
||||
}
|
||||
delete params.applicationDate;
|
||||
|
||||
const response = await listCollegeApplications(params);
|
||||
console.log('API响应:', response);
|
||||
|
||||
// 处理不同的响应格式
|
||||
if (response.data) {
|
||||
// 如果是标准的TableDataInfo格式
|
||||
if (response.data.rows !== undefined) {
|
||||
applicationList.value = response.data.rows || [];
|
||||
total.value = response.data.total || 0;
|
||||
}
|
||||
// 如果是包装在R<TableDataInfo>格式中
|
||||
else if (response.data.data && response.data.data.rows !== undefined) {
|
||||
applicationList.value = response.data.data.rows || [];
|
||||
total.value = response.data.data.total || 0;
|
||||
}
|
||||
// 如果直接是数组数据
|
||||
else if (Array.isArray(response.data)) {
|
||||
applicationList.value = response.data;
|
||||
total.value = response.data.length;
|
||||
}
|
||||
// 其他情况
|
||||
else {
|
||||
console.warn('未识别的响应格式:', response.data);
|
||||
applicationList.value = [];
|
||||
total.value = 0;
|
||||
}
|
||||
} else {
|
||||
applicationList.value = [];
|
||||
total.value = 0;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取申请列表失败:', error);
|
||||
if (error.message.includes('404')) {
|
||||
ElMessage.error('无法获取申请列表,请检查您是否有学院审核权限');
|
||||
} else if (error.message.includes('403')) {
|
||||
ElMessage.error('权限不足,无法访问学院审核功能');
|
||||
} else {
|
||||
ElMessage.error('获取申请列表失败,请稍后重试');
|
||||
}
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 搜索
|
||||
const handleQuery = () => {
|
||||
queryParams.pageNum = 1;
|
||||
getList();
|
||||
};
|
||||
|
||||
// 重置搜索
|
||||
const resetQuery = () => {
|
||||
queryRef.value?.resetFields();
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
// 查看详情
|
||||
const handleDetail = (row: WorkStudyApplicationVO) => {
|
||||
detailDialog.applicationId = row.id!;
|
||||
detailDialog.visible = true;
|
||||
};
|
||||
|
||||
// 审核
|
||||
const handleReview = (row: WorkStudyApplicationVO) => {
|
||||
reviewDialog.visible = true;
|
||||
reviewDialog.title = `审核申请 - ${row.studentName}`;
|
||||
reviewDialog.form = {
|
||||
applicationId: row.id!,
|
||||
reviewResult: 'approved',
|
||||
reviewComment: ''
|
||||
};
|
||||
};
|
||||
|
||||
// 提交审核
|
||||
const submitReview = async () => {
|
||||
if (!reviewFormRef.value) return;
|
||||
|
||||
const valid = await reviewFormRef.value.validate();
|
||||
if (!valid) return;
|
||||
|
||||
try {
|
||||
await reviewApplication(reviewDialog.form);
|
||||
ElMessage.success('审核成功');
|
||||
reviewDialog.visible = false;
|
||||
getList();
|
||||
} catch (error) {
|
||||
console.error('审核失败:', error);
|
||||
ElMessage.error('审核失败');
|
||||
}
|
||||
};
|
||||
|
||||
// 导出
|
||||
const handleExport = async () => {
|
||||
try {
|
||||
ElMessage.info('正在导出数据,请稍候...');
|
||||
const params = { ...queryParams };
|
||||
// 处理日期范围
|
||||
if (params.applicationDate && params.applicationDate.length === 2) {
|
||||
params.startDate = params.applicationDate[0];
|
||||
params.endDate = params.applicationDate[1];
|
||||
}
|
||||
delete params.applicationDate;
|
||||
|
||||
const response = await exportApplications(params);
|
||||
download.excel(response, '勤工俭学申请列表.xlsx');
|
||||
} catch (error) {
|
||||
console.error('导出失败:', error);
|
||||
ElMessage.error('导出失败');
|
||||
}
|
||||
};
|
||||
|
||||
// 获取状态标签类型
|
||||
const getStatusTagType = (status: string) => {
|
||||
switch (status) {
|
||||
case 'pending':
|
||||
return 'warning';
|
||||
case 'approved':
|
||||
return 'success';
|
||||
case 'rejected':
|
||||
return 'danger';
|
||||
default:
|
||||
return 'info';
|
||||
}
|
||||
};
|
||||
|
||||
// 获取状态文本
|
||||
const getStatusText = (status: string) => {
|
||||
switch (status) {
|
||||
case 'pending':
|
||||
return '待审核';
|
||||
case 'approved':
|
||||
return '已通过';
|
||||
case 'rejected':
|
||||
return '已拒绝';
|
||||
default:
|
||||
return '未知';
|
||||
}
|
||||
};
|
||||
|
||||
// 暴露方法给父组件调用
|
||||
defineExpose({
|
||||
getList
|
||||
});
|
||||
|
||||
// 初始化
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.all-applications {
|
||||
.search-form {
|
||||
background: #f8f9fa;
|
||||
padding: 20px;
|
||||
border-radius: 8px;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.student-info {
|
||||
.name {
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.detail {
|
||||
font-size: 12px;
|
||||
color: #666;
|
||||
margin-top: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
.text-gray {
|
||||
color: #666;
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,204 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-model="dialogVisible"
|
||||
title="申请详情"
|
||||
width="80%"
|
||||
:before-close="handleClose"
|
||||
>
|
||||
<div v-loading="loading" class="application-detail">
|
||||
<template v-if="applicationData">
|
||||
<!-- 基本信息 -->
|
||||
<el-card class="mb-20">
|
||||
<template #header>
|
||||
<span class="card-title">基本信息</span>
|
||||
</template>
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="学生姓名">{{ applicationData.studentName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="学号">{{ applicationData.studentNo }}</el-descriptions-item>
|
||||
<el-descriptions-item label="学院">{{ applicationData.collegeName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="专业">{{ applicationData.majorName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="年级">{{ applicationData.grade }}</el-descriptions-item>
|
||||
<el-descriptions-item label="班级">{{ applicationData.className }}</el-descriptions-item>
|
||||
<el-descriptions-item label="联系电话">{{ applicationData.contactPhone }}</el-descriptions-item>
|
||||
<el-descriptions-item label="邮箱">{{ applicationData.email }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
|
||||
<!-- 岗位信息 -->
|
||||
<el-card class="mb-20">
|
||||
<template #header>
|
||||
<span class="card-title">岗位信息</span>
|
||||
</template>
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="岗位名称">{{ applicationData.positionName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="申请时间">{{ applicationData.applicationDate }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
|
||||
<!-- 申请内容 -->
|
||||
<el-card class="mb-20">
|
||||
<template #header>
|
||||
<span class="card-title">申请内容</span>
|
||||
</template>
|
||||
<el-descriptions :column="1" border>
|
||||
<el-descriptions-item label="工作经验">
|
||||
<div class="content-text">{{ applicationData.workExperience || '无' }}</div>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="申请理由">
|
||||
<div class="content-text">{{ applicationData.applicationReason || '无' }}</div>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
|
||||
<!-- 审核状态 -->
|
||||
<el-card class="mb-20">
|
||||
<template #header>
|
||||
<span class="card-title">审核状态</span>
|
||||
</template>
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="当前状态">
|
||||
<el-tag :type="getStatusType(applicationData.status)">
|
||||
{{ applicationData.statusName }}
|
||||
</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="申请时间">{{ applicationData.applicationDate }}</el-descriptions-item>
|
||||
<el-descriptions-item label="学院审核人" v-if="applicationData.collegeReviewByName">
|
||||
{{ applicationData.collegeReviewByName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="学院审核时间" v-if="applicationData.collegeReviewTime">
|
||||
{{ applicationData.collegeReviewTime }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="学院审核意见" v-if="applicationData.collegeReviewComment" span="2">
|
||||
<div class="content-text">{{ applicationData.collegeReviewComment }}</div>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="最终审核人" v-if="applicationData.finalReviewByName">
|
||||
{{ applicationData.finalReviewByName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="最终审核时间" v-if="applicationData.finalReviewTime">
|
||||
{{ applicationData.finalReviewTime }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="最终审核意见" v-if="applicationData.finalReviewComment" span="2">
|
||||
<div class="content-text">{{ applicationData.finalReviewComment }}</div>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="handleClose">关闭</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, watch } from 'vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { getCollegeApplication, type WorkStudyApplicationVO } from '@/api/jcbt/workStudyApplicationCollegeReview';
|
||||
|
||||
// 定义 props
|
||||
const props = defineProps<{
|
||||
visible: boolean;
|
||||
applicationId: string | number;
|
||||
}>();
|
||||
|
||||
// 定义 emits
|
||||
const emit = defineEmits<{
|
||||
'update:visible': [value: boolean];
|
||||
refresh: [];
|
||||
}>();
|
||||
|
||||
// 响应式数据
|
||||
const loading = ref(false);
|
||||
const applicationData = ref<WorkStudyApplicationVO>();
|
||||
const dialogVisible = ref(false);
|
||||
|
||||
// 监听 visible 变化
|
||||
watch(() => props.visible, (newVal) => {
|
||||
dialogVisible.value = newVal;
|
||||
if (newVal && props.applicationId) {
|
||||
getDetail();
|
||||
}
|
||||
});
|
||||
|
||||
// 监听 dialogVisible 变化
|
||||
watch(dialogVisible, (newVal) => {
|
||||
emit('update:visible', newVal);
|
||||
});
|
||||
|
||||
// 获取详情
|
||||
const getDetail = async () => {
|
||||
if (!props.applicationId) return;
|
||||
|
||||
loading.value = true;
|
||||
try {
|
||||
const response = await getCollegeApplication(props.applicationId);
|
||||
console.log('详情API响应:', response);
|
||||
|
||||
// 处理不同的响应格式
|
||||
if (response.data) {
|
||||
if (response.data.data) {
|
||||
applicationData.value = response.data.data;
|
||||
} else {
|
||||
applicationData.value = response.data;
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取申请详情失败:', error);
|
||||
if (error.message.includes('404')) {
|
||||
ElMessage.error('申请不存在或您无权查看此申请');
|
||||
} else if (error.message.includes('403')) {
|
||||
ElMessage.error('权限不足,无法查看申请详情');
|
||||
} else {
|
||||
ElMessage.error('获取申请详情失败,请稍后重试');
|
||||
}
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 关闭对话框
|
||||
const handleClose = () => {
|
||||
dialogVisible.value = false;
|
||||
applicationData.value = undefined;
|
||||
};
|
||||
|
||||
// 获取状态类型
|
||||
const getStatusType = (status: string) => {
|
||||
const statusMap = {
|
||||
'DRAFT': 'info',
|
||||
'SUBMITTED': 'warning',
|
||||
'COLLEGE_APPROVED': 'success',
|
||||
'COLLEGE_REJECTED': 'danger',
|
||||
'FINAL_APPROVED': 'success',
|
||||
'FINAL_REJECTED': 'danger',
|
||||
'CANCELLED': 'info'
|
||||
};
|
||||
return statusMap[status] || 'info';
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.application-detail {
|
||||
.card-title {
|
||||
font-weight: bold;
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
.content-text {
|
||||
line-height: 1.6;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.mb-20 {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.dialog-footer {
|
||||
text-align: right;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,336 @@
|
||||
<template>
|
||||
<div class="pending-applications">
|
||||
<!-- 搜索表单 -->
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" class="search-form">
|
||||
<el-form-item label="岗位名称" prop="positionName">
|
||||
<el-input v-model="queryParams.positionName" placeholder="请输入岗位名称" clearable style="width: 200px" @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="学生姓名" prop="studentName">
|
||||
<el-input v-model="queryParams.studentName" placeholder="请输入学生姓名" clearable style="width: 200px" @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="学号" prop="studentNo">
|
||||
<el-input v-model="queryParams.studentNo" placeholder="请输入学号" clearable style="width: 200px" @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="申请日期" prop="applicationDate">
|
||||
<el-date-picker
|
||||
v-model="queryParams.applicationDate"
|
||||
type="date"
|
||||
placeholder="选择申请日期"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
style="width: 200px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<!-- 操作按钮 -->
|
||||
<el-row :gutter="10" class="mb-8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Check" :disabled="multiple" @click="handleBatchReview('approved')"> 批量通过 </el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Close" :disabled="multiple" @click="handleBatchReview('rejected')"> 批量拒绝 </el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 数据表格 -->
|
||||
<el-table v-loading="loading" :data="applicationList" @selection-change="handleSelectionChange" row-key="id">
|
||||
<el-table-column type="selection" width="50" align="center" />
|
||||
<el-table-column label="序号" type="index" width="60" align="center" />
|
||||
<el-table-column label="岗位名称" prop="positionName" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column label="学生信息" min-width="160">
|
||||
<template #default="{ row }">
|
||||
<div class="student-info">
|
||||
<div class="name">{{ row.studentName }}</div>
|
||||
<div class="detail">{{ row.studentNo }} | {{ row.className }}</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="专业年级" min-width="140">
|
||||
<template #default="{ row }">
|
||||
<div>{{ row.majorName }}</div>
|
||||
<div class="text-gray">{{ row.grade }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="联系方式" min-width="120">
|
||||
<template #default="{ row }">
|
||||
<div>{{ row.contactPhone }}</div>
|
||||
<div class="text-gray">{{ row.email }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="申请理由" prop="applicationReason" min-width="200" show-overflow-tooltip />
|
||||
<el-table-column label="申请时间" prop="applicationDate" width="110" align="center" />
|
||||
<el-table-column label="操作" fixed="right" width="200" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-button type="primary" size="small" icon="View" @click="handleDetail(row)"> 详情 </el-button>
|
||||
<el-button type="success" size="small" icon="Check" @click="handleReview(row, 'approved')"> 通过 </el-button>
|
||||
<el-button type="danger" size="small" icon="Close" @click="handleReview(row, 'rejected')"> 拒绝 </el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 分页 -->
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
<!-- 审核对话框 -->
|
||||
<el-dialog v-model="reviewDialog.visible" :title="reviewDialog.title" width="600px" append-to-body>
|
||||
<el-form ref="reviewFormRef" :model="reviewDialog.form" :rules="reviewRules" label-width="100px">
|
||||
<el-form-item label="审核结果" prop="reviewResult">
|
||||
<el-radio-group v-model="reviewDialog.form.reviewResult">
|
||||
<el-radio value="approved">通过</el-radio>
|
||||
<el-radio value="rejected">拒绝</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="审核意见" prop="reviewComment">
|
||||
<el-input v-model="reviewDialog.form.reviewComment" type="textarea" :rows="4" placeholder="请输入审核意见" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="reviewDialog.visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="submitReview">确认</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 详情对话框 -->
|
||||
<ApplicationDetail v-model:visible="detailDialog.visible" :application-id="detailDialog.applicationId" @refresh="getList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="PendingApplications">
|
||||
import { ref, reactive, onMounted } from 'vue';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { Search } from '@element-plus/icons-vue';
|
||||
import {
|
||||
listPendingApplications,
|
||||
reviewApplication,
|
||||
batchReviewApplications,
|
||||
type WorkStudyApplicationVO,
|
||||
type WorkStudyApplicationQuery,
|
||||
type ReviewForm
|
||||
} from '@/api/jcbt/workStudyApplicationCollegeReview';
|
||||
import ApplicationDetail from './ApplicationDetail.vue';
|
||||
|
||||
const emit = defineEmits(['refresh-statistics']);
|
||||
|
||||
// 响应式数据
|
||||
const loading = ref(false);
|
||||
const applicationList = ref<WorkStudyApplicationVO[]>([]);
|
||||
const total = ref(0);
|
||||
const ids = ref<Array<string | number>>([]);
|
||||
const multiple = ref(true);
|
||||
|
||||
// 查询参数
|
||||
const queryParams = reactive<WorkStudyApplicationQuery>({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
positionName: '',
|
||||
studentName: '',
|
||||
studentNo: '',
|
||||
applicationDate: ''
|
||||
});
|
||||
|
||||
// 审核对话框
|
||||
const reviewDialog = reactive({
|
||||
visible: false,
|
||||
title: '',
|
||||
type: 'single' as 'single' | 'batch',
|
||||
form: {
|
||||
applicationId: '',
|
||||
reviewResult: 'approved',
|
||||
reviewComment: ''
|
||||
} as ReviewForm
|
||||
});
|
||||
|
||||
// 详情对话框
|
||||
const detailDialog = reactive({
|
||||
visible: false,
|
||||
applicationId: ''
|
||||
});
|
||||
|
||||
// 表单验证规则
|
||||
const reviewRules = {
|
||||
reviewResult: [{ required: true, message: '请选择审核结果', trigger: 'change' }],
|
||||
reviewComment: [
|
||||
{ required: true, message: '请输入审核意见', trigger: 'blur' },
|
||||
{ min: 5, max: 500, message: '审核意见长度在 5 到 500 个字符', trigger: 'blur' }
|
||||
]
|
||||
};
|
||||
|
||||
// 表单引用
|
||||
const queryRef = ref();
|
||||
const reviewFormRef = ref();
|
||||
|
||||
// 获取列表数据
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
try {
|
||||
const response = await listPendingApplications(queryParams);
|
||||
console.log('API响应:', response);
|
||||
|
||||
// 处理不同的响应格式
|
||||
if (response.data) {
|
||||
// 如果是标准的TableDataInfo格式
|
||||
if (response.data.rows !== undefined) {
|
||||
applicationList.value = response.data.rows || [];
|
||||
total.value = response.data.total || 0;
|
||||
}
|
||||
// 如果是包装在R<TableDataInfo>格式中
|
||||
else if (response.data.data && response.data.data.rows !== undefined) {
|
||||
applicationList.value = response.data.data.rows || [];
|
||||
total.value = response.data.data.total || 0;
|
||||
}
|
||||
// 如果直接是数组数据
|
||||
else if (Array.isArray(response.data)) {
|
||||
applicationList.value = response.data;
|
||||
total.value = response.data.length;
|
||||
}
|
||||
// 其他情况
|
||||
else {
|
||||
console.warn('未识别的响应格式:', response.data);
|
||||
applicationList.value = [];
|
||||
total.value = 0;
|
||||
}
|
||||
} else {
|
||||
applicationList.value = [];
|
||||
total.value = 0;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取待审核申请列表失败:', error);
|
||||
if (error.message.includes('404')) {
|
||||
ElMessage.error('无法获取待审核申请列表,请检查您是否有学院审核权限');
|
||||
} else if (error.message.includes('403')) {
|
||||
ElMessage.error('权限不足,无法访问学院审核功能');
|
||||
} else {
|
||||
ElMessage.error('获取待审核申请列表失败,请稍后重试');
|
||||
}
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 搜索
|
||||
const handleQuery = () => {
|
||||
queryParams.pageNum = 1;
|
||||
getList();
|
||||
};
|
||||
|
||||
// 重置搜索
|
||||
const resetQuery = () => {
|
||||
queryRef.value?.resetFields();
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
// 多选框选中数据
|
||||
const handleSelectionChange = (selection: WorkStudyApplicationVO[]) => {
|
||||
ids.value = selection.map((item) => item.id!);
|
||||
multiple.value = !selection.length;
|
||||
};
|
||||
|
||||
// 查看详情
|
||||
const handleDetail = (row: WorkStudyApplicationVO) => {
|
||||
detailDialog.applicationId = row.id!;
|
||||
detailDialog.visible = true;
|
||||
};
|
||||
|
||||
// 单个审核
|
||||
const handleReview = (row: WorkStudyApplicationVO, result: string) => {
|
||||
reviewDialog.visible = true;
|
||||
reviewDialog.title = `审核申请 - ${row.studentName}`;
|
||||
reviewDialog.type = 'single';
|
||||
reviewDialog.form = {
|
||||
applicationId: row.id!,
|
||||
reviewResult: result,
|
||||
reviewComment: ''
|
||||
};
|
||||
};
|
||||
|
||||
// 批量审核
|
||||
const handleBatchReview = (result: string) => {
|
||||
if (!ids.value.length) {
|
||||
ElMessage.warning('请选择要审核的申请');
|
||||
return;
|
||||
}
|
||||
|
||||
reviewDialog.visible = true;
|
||||
reviewDialog.title = `批量${result === 'approved' ? '通过' : '拒绝'}申请`;
|
||||
reviewDialog.type = 'batch';
|
||||
reviewDialog.form = {
|
||||
applicationId: '',
|
||||
reviewResult: result,
|
||||
reviewComment: ''
|
||||
};
|
||||
};
|
||||
|
||||
// 提交审核
|
||||
const submitReview = async () => {
|
||||
if (!reviewFormRef.value) return;
|
||||
|
||||
const valid = await reviewFormRef.value.validate();
|
||||
if (!valid) return;
|
||||
|
||||
try {
|
||||
if (reviewDialog.type === 'single') {
|
||||
await reviewApplication(reviewDialog.form);
|
||||
} else {
|
||||
await batchReviewApplications(ids.value, reviewDialog.form.reviewResult, reviewDialog.form.reviewComment);
|
||||
}
|
||||
|
||||
ElMessage.success('审核成功');
|
||||
reviewDialog.visible = false;
|
||||
getList();
|
||||
emit('refresh-statistics');
|
||||
} catch (error) {
|
||||
console.error('审核失败:', error);
|
||||
ElMessage.error('审核失败');
|
||||
}
|
||||
};
|
||||
|
||||
// 暴露方法给父组件调用
|
||||
defineExpose({
|
||||
getList
|
||||
});
|
||||
|
||||
// 初始化
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.pending-applications {
|
||||
.search-form {
|
||||
background: #f8f9fa;
|
||||
padding: 20px;
|
||||
border-radius: 8px;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.student-info {
|
||||
.name {
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.detail {
|
||||
font-size: 12px;
|
||||
color: #666;
|
||||
margin-top: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
.text-gray {
|
||||
color: #666;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.mb-8 {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,210 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 统计卡片 -->
|
||||
<el-row :gutter="20" class="mb-20">
|
||||
<el-col :span="6">
|
||||
<el-card class="statistics-card pending">
|
||||
<div class="card-content">
|
||||
<div class="card-icon">
|
||||
<el-icon><Clock /></el-icon>
|
||||
</div>
|
||||
<div class="card-info">
|
||||
<div class="card-title">待审核</div>
|
||||
<div class="card-value">{{ statistics.pendingCount || 0 }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-card class="statistics-card approved">
|
||||
<div class="card-content">
|
||||
<div class="card-icon">
|
||||
<el-icon><Check /></el-icon>
|
||||
</div>
|
||||
<div class="card-info">
|
||||
<div class="card-title">已通过</div>
|
||||
<div class="card-value">{{ statistics.approvedCount || 0 }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-card class="statistics-card rejected">
|
||||
<div class="card-content">
|
||||
<div class="card-icon">
|
||||
<el-icon><Close /></el-icon>
|
||||
</div>
|
||||
<div class="card-info">
|
||||
<div class="card-title">已拒绝</div>
|
||||
<div class="card-value">{{ statistics.rejectedCount || 0 }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-card class="statistics-card total">
|
||||
<div class="card-content">
|
||||
<div class="card-icon">
|
||||
<el-icon><DataLine /></el-icon>
|
||||
</div>
|
||||
<div class="card-info">
|
||||
<div class="card-title">总计</div>
|
||||
<div class="card-value">{{ statistics.totalCount || 0 }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 标签页 -->
|
||||
<el-tabs v-model="activeTab" @tab-change="handleTabChange">
|
||||
<el-tab-pane label="待审核申请" name="pending">
|
||||
<PendingApplications ref="pendingRef" @refresh-statistics="getStatistics" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="所有申请" name="all">
|
||||
<AllApplications ref="allRef" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="WorkStudyCollegeReview">
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { Clock, Check, Close, DataLine } from '@element-plus/icons-vue';
|
||||
import { getCollegeStatistics, type StatisticsVO } from '@/api/jcbt/workStudyApplicationCollegeReview';
|
||||
import PendingApplications from './components/PendingApplications.vue';
|
||||
import AllApplications from './components/AllApplications.vue';
|
||||
|
||||
// 响应式数据
|
||||
const activeTab = ref('pending');
|
||||
const statistics = ref<StatisticsVO>({});
|
||||
const pendingRef = ref();
|
||||
const allRef = ref();
|
||||
|
||||
// 获取统计数据
|
||||
const getStatistics = async () => {
|
||||
try {
|
||||
const { data } = await getCollegeStatistics();
|
||||
statistics.value = data;
|
||||
} catch (error) {
|
||||
console.error('获取统计数据失败:', error);
|
||||
if (error.message.includes('404')) {
|
||||
ElMessage.error('无法获取统计数据,请检查您是否有学院审核权限');
|
||||
} else if (error.message.includes('403')) {
|
||||
ElMessage.error('权限不足,无法访问学院审核功能');
|
||||
} else {
|
||||
ElMessage.error('获取统计数据失败,请稍后重试');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// 标签页切换
|
||||
const handleTabChange = (tabName: string) => {
|
||||
activeTab.value = tabName;
|
||||
if (tabName === 'pending' && pendingRef.value) {
|
||||
pendingRef.value.getList();
|
||||
} else if (tabName === 'all' && allRef.value) {
|
||||
allRef.value.getList();
|
||||
}
|
||||
};
|
||||
|
||||
// 初始化
|
||||
onMounted(() => {
|
||||
getStatistics();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.app-container {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.mb-20 {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.statistics-card {
|
||||
border: none;
|
||||
border-radius: 12px;
|
||||
overflow: hidden;
|
||||
transition: all 0.3s ease;
|
||||
|
||||
&:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.card-content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.card-icon {
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
border-radius: 12px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-right: 16px;
|
||||
font-size: 24px;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.card-info {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.card-title {
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.card-value {
|
||||
font-size: 28px;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
&.pending .card-icon {
|
||||
background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
|
||||
}
|
||||
|
||||
&.approved .card-icon {
|
||||
background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
|
||||
}
|
||||
|
||||
&.rejected .card-icon {
|
||||
background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
|
||||
}
|
||||
|
||||
&.total .card-icon {
|
||||
background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.el-tabs__header) {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
:deep(.el-tabs__nav-wrap::after) {
|
||||
height: 1px;
|
||||
background-color: #e4e7ed;
|
||||
}
|
||||
|
||||
:deep(.el-tabs__active-bar) {
|
||||
background-color: #409eff;
|
||||
}
|
||||
|
||||
:deep(.el-tabs__item) {
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
|
||||
&.is-active {
|
||||
color: #409eff;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -118,16 +118,25 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="紧急联系人" prop="emergencyContact">
|
||||
<el-input v-model="form.emergencyContact" placeholder="请输入紧急联系人" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="紧急电话" prop="emergencyPhone">
|
||||
<el-input v-model="form.emergencyPhone" placeholder="请输入紧急联系电话" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="8">
|
||||
<el-form-item label="请假位置" prop="leaveLocation">
|
||||
<el-input v-model="form.leaveLocation" placeholder="请假位置" disabled>
|
||||
<template #append>
|
||||
<el-button type="primary" @click="openLocationMap" :icon="LocationFilled" title="地图定位"> 定位 </el-button>
|
||||
</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
</el-row>
|
||||
<el-form-item label="请假原因" prop="leaveReason">
|
||||
<el-input v-model="form.leaveReason" type="textarea" :rows="2" placeholder="请输入请假原因" />
|
||||
@@ -224,6 +233,61 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 地图定位弹窗 -->
|
||||
<el-dialog v-model="mapDialogVisible" title="请假位置" width="80%" top="5vh" :before-close="closeMapDialog">
|
||||
<div class="map-container">
|
||||
<div v-if="!form.leaveLocation || form.leaveLocation.trim() === ''" class="no-location-tip">
|
||||
<el-empty description="暂无位置信息">
|
||||
<el-button type="primary" @click="closeMapDialog">关闭</el-button>
|
||||
</el-empty>
|
||||
</div>
|
||||
<div v-else class="location-info">
|
||||
<div class="location-text">
|
||||
<el-tag type="info" size="large">
|
||||
<el-icon><LocationFilled /></el-icon>
|
||||
{{ form.leaveLocation }}
|
||||
</el-tag>
|
||||
</div>
|
||||
<div class="map-placeholder">
|
||||
<div class="map-tips">
|
||||
<el-alert
|
||||
title="地图功能提示"
|
||||
type="info"
|
||||
:closable="false"
|
||||
description="地图组件可集成百度地图、高德地图等第三方地图服务来显示具体位置。当前显示位置信息文本。"
|
||||
>
|
||||
</el-alert>
|
||||
<div class="coordinates-display" v-if="parsedLocation">
|
||||
<p><strong>位置解析:</strong></p>
|
||||
<p v-if="parsedLocation.type === 'coordinates'">
|
||||
<span>纬度:{{ parsedLocation.latitude }}</span
|
||||
><br />
|
||||
<span>经度:{{ parsedLocation.longitude }}</span>
|
||||
</p>
|
||||
<p v-else>
|
||||
<span>位置描述:{{ parsedLocation.address }}</span>
|
||||
</p>
|
||||
</div>
|
||||
<!-- 这里可以集成真实的地图组件 -->
|
||||
<div class="mock-map">
|
||||
<div class="map-icon">🗺️</div>
|
||||
<p>地图显示区域</p>
|
||||
<small>(可集成百度地图、高德地图等)</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="closeMapDialog">关闭</el-button>
|
||||
<el-button type="primary" @click="openExternalMap" v-if="parsedLocation && parsedLocation.type === 'coordinates'">
|
||||
在外部地图中查看
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -233,7 +297,7 @@ import { ref, computed, onMounted, reactive, toRefs, nextTick, getCurrentInstanc
|
||||
import ElMessage from 'element-plus/es/components/message/index';
|
||||
import ElMessageBox from 'element-plus/es/components/message-box/index';
|
||||
import ElLoading from 'element-plus/es/components/loading/index';
|
||||
import { UploadFilled, Document, Loading, Download, Delete } from '@element-plus/icons-vue';
|
||||
import { UploadFilled, Document, Loading, Download, Delete, LocationFilled } from '@element-plus/icons-vue';
|
||||
import { getToken } from '@/utils/auth';
|
||||
import ImagePreview from '@/components/ImagePreview/index.vue';
|
||||
import request from '@/utils/request';
|
||||
@@ -362,6 +426,48 @@ const dialogVisible = reactive<DialogOption>({
|
||||
title: '流程定义'
|
||||
});
|
||||
|
||||
// 地图弹窗状态
|
||||
const mapDialogVisible = ref(false);
|
||||
|
||||
// 解析后的位置信息
|
||||
const parsedLocation = computed(() => {
|
||||
if (!form.leaveLocation || form.leaveLocation.trim() === '') {
|
||||
return null;
|
||||
}
|
||||
|
||||
const location = form.leaveLocation.trim();
|
||||
|
||||
// 尝试解析经纬度格式: "纬度: xxx, 经度: xxx"
|
||||
const coordsRegex = /纬度:\s*([\d.-]+),\s*经度:\s*([\d.-]+)/;
|
||||
const coordsMatch = location.match(coordsRegex);
|
||||
|
||||
if (coordsMatch) {
|
||||
return {
|
||||
type: 'coordinates',
|
||||
latitude: parseFloat(coordsMatch[1]),
|
||||
longitude: parseFloat(coordsMatch[2])
|
||||
};
|
||||
}
|
||||
|
||||
// 尝试解析简单经纬度格式: "lat,lng" 或 "lat, lng"
|
||||
const simpleRegex = /^([\d.-]+),\s*([\d.-]+)$/;
|
||||
const simpleMatch = location.match(simpleRegex);
|
||||
|
||||
if (simpleMatch) {
|
||||
return {
|
||||
type: 'coordinates',
|
||||
latitude: parseFloat(simpleMatch[1]),
|
||||
longitude: parseFloat(simpleMatch[2])
|
||||
};
|
||||
}
|
||||
|
||||
// 其他情况当作地址处理
|
||||
return {
|
||||
type: 'address',
|
||||
address: location
|
||||
};
|
||||
});
|
||||
|
||||
//提交组件
|
||||
const submitVerifyRef = ref<InstanceType<typeof SubmitVerify>>();
|
||||
//审批记录组件
|
||||
@@ -594,8 +700,21 @@ const handleDownloadAttachment = async (file: any) => {
|
||||
if (!response) {
|
||||
throw new Error('响应数据为空');
|
||||
}
|
||||
console.log('response', response);
|
||||
|
||||
const url = window.URL.createObjectURL(response.data as Blob);
|
||||
// 检查response的结构,判断是直接的Blob还是包含data属性的响应对象
|
||||
let blobData: Blob;
|
||||
if (response instanceof Blob) {
|
||||
// 如果response本身就是Blob对象
|
||||
blobData = response;
|
||||
} else if (response.data instanceof Blob) {
|
||||
// 如果response.data是Blob对象
|
||||
blobData = response.data;
|
||||
} else {
|
||||
throw new Error('无效的响应数据格式');
|
||||
}
|
||||
|
||||
const url = window.URL.createObjectURL(blobData);
|
||||
|
||||
const link = document.createElement('a');
|
||||
link.href = url;
|
||||
@@ -975,6 +1094,51 @@ const cancel = () => {
|
||||
emit('cancel');
|
||||
};
|
||||
|
||||
// 打开地图定位弹窗
|
||||
const openLocationMap = () => {
|
||||
if (!form.leaveLocation || form.leaveLocation.trim() === '') {
|
||||
ElMessage.warning('暂无位置信息可显示');
|
||||
return;
|
||||
}
|
||||
mapDialogVisible.value = true;
|
||||
};
|
||||
|
||||
// 关闭地图弹窗
|
||||
const closeMapDialog = () => {
|
||||
mapDialogVisible.value = false;
|
||||
};
|
||||
|
||||
// 在外部地图中查看
|
||||
const openExternalMap = () => {
|
||||
if (!parsedLocation.value || parsedLocation.value.type !== 'coordinates') {
|
||||
ElMessage.warning('无法获取有效的坐标信息');
|
||||
return;
|
||||
}
|
||||
|
||||
const { latitude, longitude } = parsedLocation.value;
|
||||
|
||||
// 提供多种地图选择
|
||||
ElMessageBox.confirm('选择要使用的地图服务:', '打开外部地图', {
|
||||
confirmButtonText: '百度地图',
|
||||
cancelButtonText: '高德地图',
|
||||
type: 'info',
|
||||
distinguishCancelAndClose: true
|
||||
})
|
||||
.then(() => {
|
||||
// 百度地图
|
||||
const baiduUrl = `https://api.map.baidu.com/marker?location=${latitude},${longitude}&title=请假位置&content=${encodeURIComponent(form.leaveLocation)}&output=html&src=webapp`;
|
||||
window.open(baiduUrl, '_blank');
|
||||
})
|
||||
.catch((action) => {
|
||||
if (action === 'cancel') {
|
||||
// 高德地图
|
||||
const gaodeUrl = `https://uri.amap.com/marker?position=${longitude},${latitude}&name=请假位置&src=webapp`;
|
||||
window.open(gaodeUrl, '_blank');
|
||||
}
|
||||
// 如果是 close,则不执行任何操作
|
||||
});
|
||||
};
|
||||
|
||||
// 监听 isLeaveSchool 字段变化,更新销假状态
|
||||
// watch(
|
||||
// () => form.isLeaveSchool,
|
||||
@@ -1627,4 +1791,93 @@ onMounted(() => {
|
||||
:deep(.el-card .el-card__header) {
|
||||
border-bottom: 0px !important;
|
||||
}
|
||||
|
||||
/* 地图弹窗样式 */
|
||||
.map-container {
|
||||
min-height: 500px;
|
||||
max-height: 70vh;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.no-location-tip {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 300px;
|
||||
}
|
||||
|
||||
.location-info {
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.location-text {
|
||||
margin-bottom: 16px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.location-text .el-tag {
|
||||
padding: 8px 16px;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.location-text .el-icon {
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.map-placeholder {
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
.map-tips {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.coordinates-display {
|
||||
margin: 16px 0;
|
||||
padding: 12px;
|
||||
background: #f8f9fa;
|
||||
border-radius: 6px;
|
||||
border-left: 4px solid #409eff;
|
||||
}
|
||||
|
||||
.coordinates-display p {
|
||||
margin: 8px 0;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.coordinates-display strong {
|
||||
color: #303133;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.mock-map {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 200px;
|
||||
background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
|
||||
border: 2px dashed #d0d7de;
|
||||
border-radius: 8px;
|
||||
color: #666;
|
||||
text-align: center;
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
.map-icon {
|
||||
font-size: 48px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.mock-map p {
|
||||
margin: 4px 0;
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.mock-map small {
|
||||
color: #999;
|
||||
font-size: 12px;
|
||||
}
|
||||
</style>
|
||||
@@ -238,20 +238,18 @@
|
||||
<el-table-column label="销假地理位置" align="center" prop="cancelLocation" />
|
||||
<el-table-column label="销假照片OSS文件ID" align="center" prop="cancelPhotoOssIds" />
|
||||
<el-table-column label="销假备注" align="center" prop="cancelRemark" /> -->
|
||||
<el-table-column label="操作" align="center" width="150px" class-name="small-padding fixed-width" fixed="right">
|
||||
<el-table-column label="操作" align="center" width="200px" class-name="small-padding fixed-width" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['studentLeave:studentLeave:edit']"></el-button>
|
||||
<el-tooltip :content="['draft', 'cancel', 'back'].includes(scope.row.approvalStatus) ? '修改' : '查看'" placement="top">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['studentLeave:studentLeave:edit']">
|
||||
{{ ['draft', 'cancel', 'back'].includes(scope.row.approvalStatus) ? '修改' : '查看' }}
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
<!-- 删除按钮:仅草稿状态可见 -->
|
||||
<el-tooltip content="删除" placement="top" v-if="scope.row.approvalStatus === 'draft'">
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
icon="Delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['studentLeave:studentLeave:remove']"
|
||||
></el-button>
|
||||
<el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['studentLeave:studentLeave:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-tooltip>
|
||||
<!-- 销假按钮:仅已完成状态且需要销假时可见 -->
|
||||
<el-tooltip content="销假" placement="top" v-if="scope.row.approvalStatus === 'finish' && scope.row.needCancel === '1'">
|
||||
@@ -261,7 +259,8 @@
|
||||
icon="CircleCheck"
|
||||
@click="handleCancelLeave(scope.row)"
|
||||
v-hasPermi="['studentLeave:studentLeave:cancel']"
|
||||
></el-button>
|
||||
>销假</el-button
|
||||
>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
Reference in new issue
Block a user