Merge branch 'master' of http://47.99.164.66:3000/hzdyjs-xg/all-project
This commit is contained in:
commit
465c284d4a
244 files changed
+28906
-5725
No files matched your search
@@ -1,6 +1,12 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { AssessmentApprovalQuery, AssessmentApprovalVO, AssessmentApprovalDetailVO, AssessmentApprovalSubmitBO, EvaluationLevelStatsVO } from './types';
|
||||
import {
|
||||
AssessmentApprovalQuery,
|
||||
AssessmentApprovalVO,
|
||||
AssessmentApprovalDetailVO,
|
||||
AssessmentApprovalSubmitBO,
|
||||
EvaluationLevelStatsVO
|
||||
} from './types';
|
||||
|
||||
/**
|
||||
* 查询班主任考核审核列表
|
||||
|
||||
@@ -224,11 +224,12 @@ export interface AssessmentApprovalSpecialWorkSubmitVO {
|
||||
* 评价等级统计数据
|
||||
*/
|
||||
export interface EvaluationLevelStatsVO {
|
||||
totalTeachers: number; // 总班主任数量
|
||||
totalTeachers: number; // 总班主任数量
|
||||
scoreRankings: ScoreRankingVO[]; // 分数排名列表
|
||||
evaluationLevelRules: { // 评价等级规则
|
||||
aLevelMaxPercentage: number; // A等最大占比(如20%)
|
||||
passScore: number; // 及格分数(如60分)
|
||||
evaluationLevelRules: {
|
||||
// 评价等级规则
|
||||
aLevelMaxPercentage: number; // A等最大占比(如20%)
|
||||
passScore: number; // 及格分数(如60分)
|
||||
};
|
||||
}
|
||||
|
||||
@@ -236,8 +237,8 @@ export interface EvaluationLevelStatsVO {
|
||||
* 分数排名VO
|
||||
*/
|
||||
export interface ScoreRankingVO {
|
||||
score: number; // 考核得分
|
||||
ranking: number; // 排名(从1开始)
|
||||
percentage: number; // 百分比排名(前X%)
|
||||
score: number; // 考核得分
|
||||
ranking: number; // 排名(从1开始)
|
||||
percentage: number; // 百分比排名(前X%)
|
||||
evaluatedUserId?: string | number; // 被评价用户ID(可选,用于标识当前用户)
|
||||
}
|
||||
@@ -0,0 +1,217 @@
|
||||
import request from '@/utils/request';
|
||||
import type { AxiosPromise } from 'axios';
|
||||
import type { PageQuery, TableDataInfo } from '@/api/types';
|
||||
|
||||
/**
|
||||
* 项目审批流程查询参数
|
||||
*/
|
||||
export interface CwProjectApprovalQuery extends PageQuery {
|
||||
applicationNo?: string;
|
||||
projectName?: string;
|
||||
processStatus?: string;
|
||||
submitterName?: string;
|
||||
startTime?: string[];
|
||||
}
|
||||
|
||||
/**
|
||||
* 项目审批流程VO
|
||||
*/
|
||||
export interface CwProjectApprovalProcessVO {
|
||||
id: string | number;
|
||||
applicationId: string | number;
|
||||
applicationNo: string;
|
||||
processName: string;
|
||||
processStatus: string;
|
||||
totalNodes: number;
|
||||
currentNode: number;
|
||||
startTime: string;
|
||||
endTime: string;
|
||||
submitterId: string | number;
|
||||
submitterName: string;
|
||||
createTime: string;
|
||||
updateTime: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 审批记录VO
|
||||
*/
|
||||
export interface CwApprovalRecordVO {
|
||||
id: string | number;
|
||||
applicationId: string | number;
|
||||
applicationNo: string;
|
||||
processId: string | number;
|
||||
nodeCode: string;
|
||||
nodeName: string;
|
||||
customNodeName: string;
|
||||
nodeOrder: number;
|
||||
approverId: string | number;
|
||||
approverName: string;
|
||||
nodeStatus: string;
|
||||
approveAction: string;
|
||||
approveOpinion: string;
|
||||
startTime: string;
|
||||
endTime: string;
|
||||
isCustomProcess: boolean;
|
||||
createTime: string;
|
||||
updateTime: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 自定义审批流程启动请求
|
||||
*/
|
||||
export interface CwCustomApprovalRequest {
|
||||
applicationId: string | number;
|
||||
applicationNo: string;
|
||||
auditorIds: Array<string | number>;
|
||||
processName: string;
|
||||
submitterId: string | number;
|
||||
submitterName: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 审批操作请求
|
||||
*/
|
||||
export interface CwApprovalActionRequest {
|
||||
recordId: string | number;
|
||||
action: string; // approve | reject
|
||||
opinion: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询项目审批流程列表
|
||||
*/
|
||||
export function listProjectApproval(query: CwProjectApprovalQuery): AxiosPromise<TableDataInfo<CwProjectApprovalProcessVO>> {
|
||||
return request({
|
||||
url: '/cw/projectApproval/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取项目审批流程详细信息
|
||||
*/
|
||||
export function getProjectApproval(id: string | number): AxiosPromise<CwProjectApprovalProcessVO> {
|
||||
return request({
|
||||
url: '/cw/projectApproval/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 启动自定义审批流程
|
||||
*/
|
||||
export function startCustomApprovalProcess(data: CwCustomApprovalRequest): AxiosPromise<void> {
|
||||
return request({
|
||||
url: '/cw/projectApproval/start',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行审批操作(统一接口)
|
||||
*/
|
||||
export function approveProcess(data: CwApprovalActionRequest): AxiosPromise<void> {
|
||||
return request({
|
||||
url: '/cw/projectApproval/approve',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 打回申请(统一接口)
|
||||
*/
|
||||
export function rejectProcess(data: CwApprovalActionRequest): AxiosPromise<void> {
|
||||
return request({
|
||||
url: '/cw/projectApproval/approve',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 终止审批流程
|
||||
*/
|
||||
export function terminateProcess(id: string | number): AxiosPromise<void> {
|
||||
return request({
|
||||
url: '/cw/projectApproval/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取我的待审批列表
|
||||
*/
|
||||
export function getMyPendingApprovals(query?: CwProjectApprovalQuery): AxiosPromise<any> {
|
||||
return request({
|
||||
url: '/cw/projectApproval/pending',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取我的已审批列表
|
||||
*/
|
||||
export function getMyProcessedApprovals(query?: CwProjectApprovalQuery): AxiosPromise<any> {
|
||||
return request({
|
||||
url: '/cw/projectApproval/processed',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取审批记录
|
||||
*/
|
||||
export function getApprovalRecords(applicationId: string | number): AxiosPromise<CwApprovalRecordVO[]> {
|
||||
return request({
|
||||
url: '/cw/projectApproval/records/' + applicationId,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证审批流程
|
||||
*/
|
||||
export function validateApprovalProcess(data: CwCustomApprovalRequest): AxiosPromise<any> {
|
||||
return request({
|
||||
url: '/cw/projectApproval/validate',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取审批流程统计数据
|
||||
*/
|
||||
export function getApprovalStatistics(): AxiosPromise<any> {
|
||||
return request({
|
||||
url: '/cw/projectApproval/statistics',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出项目审批流程
|
||||
*/
|
||||
export function exportProjectApproval(query: CwProjectApprovalQuery): AxiosPromise<void> {
|
||||
return request({
|
||||
url: '/cw/projectApproval/export',
|
||||
method: 'post',
|
||||
data: query,
|
||||
responseType: 'blob'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取可用审核人选项
|
||||
*/
|
||||
export function getAuditorOptions(): AxiosPromise<any[]> {
|
||||
return request({
|
||||
url: '/cw/projectAuditor/options',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,274 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
|
||||
/**
|
||||
* 项目审核人配置VO对象
|
||||
*/
|
||||
export interface CwProjectAuditorVO {
|
||||
id: string | number;
|
||||
userId: string | number;
|
||||
userName: string;
|
||||
nickName: string;
|
||||
deptId: string | number;
|
||||
deptName: string;
|
||||
phoneNumber: string;
|
||||
email: string;
|
||||
status: string;
|
||||
remark: string;
|
||||
configBy: string | number;
|
||||
configByName: string;
|
||||
createTime: string;
|
||||
updateTime: string;
|
||||
createBy: string | number;
|
||||
updateBy: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 项目审核人配置表单对象
|
||||
*/
|
||||
export interface CwProjectAuditorForm {
|
||||
id?: string | number;
|
||||
userId: string | number;
|
||||
userName: string;
|
||||
nickName: string;
|
||||
deptId: string | number;
|
||||
deptName: string;
|
||||
phoneNumber?: string;
|
||||
email?: string;
|
||||
status: string;
|
||||
remark?: string;
|
||||
configBy?: string | number;
|
||||
configByName?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 项目审核人配置查询对象
|
||||
*/
|
||||
export interface CwProjectAuditorQuery {
|
||||
pageNum: number;
|
||||
pageSize: number;
|
||||
userName?: string;
|
||||
nickName?: string;
|
||||
deptId?: string | number;
|
||||
status?: string;
|
||||
configBy?: string | number;
|
||||
createTime?: string[];
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量添加请求对象
|
||||
*/
|
||||
export interface BatchAddRequest {
|
||||
userIds: Array<string | number>;
|
||||
remark?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量添加审核人详细请求对象(包含完整用户信息)
|
||||
*/
|
||||
export interface BatchAddDetailRequest {
|
||||
users: Array<{
|
||||
userId: string | number;
|
||||
userName: string;
|
||||
nickName: string;
|
||||
deptId: string | number;
|
||||
deptName: string;
|
||||
phoneNumber: string; // 注意:这里使用驼峰命名,确保与数据库字段映射
|
||||
email: string;
|
||||
}>;
|
||||
remark?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 状态更新请求对象
|
||||
*/
|
||||
export interface StatusUpdateRequest {
|
||||
ids: Array<string | number>;
|
||||
status: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 部门用户对象
|
||||
*/
|
||||
export interface DeptUserVO {
|
||||
userId: string | number;
|
||||
userName: string;
|
||||
nickName: string;
|
||||
deptId: string | number;
|
||||
deptName: string;
|
||||
phonenumber: string;
|
||||
email: string;
|
||||
status: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询项目审核人配置列表
|
||||
*/
|
||||
export function listProjectAuditor(query: CwProjectAuditorQuery): AxiosPromise<{ rows: CwProjectAuditorVO[]; total: number }> {
|
||||
return request({
|
||||
url: '/cw/projectAuditor/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询项目审核人配置详细
|
||||
*/
|
||||
export function getProjectAuditor(id: string | number): AxiosPromise<CwProjectAuditorVO> {
|
||||
return request({
|
||||
url: '/cw/projectAuditor/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增项目审核人配置
|
||||
*/
|
||||
export function addProjectAuditor(data: CwProjectAuditorForm): AxiosPromise<void> {
|
||||
return request({
|
||||
url: '/cw/projectAuditor',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改项目审核人配置
|
||||
*/
|
||||
export function updateProjectAuditor(data: CwProjectAuditorForm): AxiosPromise<void> {
|
||||
return request({
|
||||
url: '/cw/projectAuditor',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除项目审核人配置
|
||||
*/
|
||||
export function delProjectAuditor(ids: Array<string | number>): AxiosPromise<void> {
|
||||
return request({
|
||||
url: '/cw/projectAuditor/' + ids.join(','),
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量添加审核人
|
||||
*/
|
||||
export function batchAddProjectAuditor(data: BatchAddRequest): AxiosPromise<void> {
|
||||
return request({
|
||||
url: '/cw/projectAuditor/batchAdd',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
// 注释掉:后端暂不支持带完整用户信息的批量添加接口
|
||||
// 使用 batchAddProjectAuditor 接口,后端会自动查询用户完整信息
|
||||
/**
|
||||
* 批量添加审核人(带完整用户信息)- 已弃用
|
||||
* 改用 batchAddProjectAuditor,后端会自动获取用户完整信息
|
||||
*/
|
||||
// export function batchAddProjectAuditorWithDetails(data: BatchAddDetailRequest): AxiosPromise<void> {
|
||||
// return request({
|
||||
// url: '/cw/projectAuditor/batchAddWithDetails',
|
||||
// method: 'post',
|
||||
// data: data
|
||||
// });
|
||||
// }
|
||||
|
||||
/**
|
||||
* 获取可用审核人列表
|
||||
*/
|
||||
export function listAvailableAuditors(): AxiosPromise<CwProjectAuditorVO[]> {
|
||||
return request({
|
||||
url: '/cw/projectAuditor/available',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据部门ID获取用户列表
|
||||
*/
|
||||
export function listUserByDeptId(deptId: string | number): AxiosPromise<DeptUserVO[]> {
|
||||
return request({
|
||||
url: '/cw/projectAuditor/deptUsers/' + deptId,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量更新状态
|
||||
*/
|
||||
export function updateAuditorStatus(data: StatusUpdateRequest): AxiosPromise<void> {
|
||||
return request({
|
||||
url: '/cw/projectAuditor/status',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 我配置的审核人
|
||||
*/
|
||||
export function listMyConfigAuditors(query: CwProjectAuditorQuery): AxiosPromise<{ rows: CwProjectAuditorVO[]; total: number }> {
|
||||
return request({
|
||||
url: '/cw/projectAuditor/myConfig',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取审核人选项(用于下拉选择)
|
||||
*/
|
||||
export function listAuditorOptions(): AxiosPromise<CwProjectAuditorVO[]> {
|
||||
return request({
|
||||
url: '/cw/projectAuditor/options',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量启用
|
||||
*/
|
||||
export function enableAuditors(ids: Array<string | number>): AxiosPromise<void> {
|
||||
return request({
|
||||
url: '/cw/projectAuditor/enable/' + ids.join(','),
|
||||
method: 'put'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量停用
|
||||
*/
|
||||
export function disableAuditors(ids: Array<string | number>): AxiosPromise<void> {
|
||||
return request({
|
||||
url: '/cw/projectAuditor/disable/' + ids.join(','),
|
||||
method: 'put'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出项目审核人配置
|
||||
*/
|
||||
export function exportProjectAuditor(query: CwProjectAuditorQuery): AxiosPromise<void> {
|
||||
return request({
|
||||
url: '/cw/projectAuditor/export',
|
||||
method: 'post',
|
||||
data: query,
|
||||
responseType: 'blob'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取审核人统计数据
|
||||
*/
|
||||
export function getAuditorStatistics(): AxiosPromise<any> {
|
||||
return request({
|
||||
url: '/cw/projectAuditor/statistics',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
@@ -203,3 +203,183 @@ export interface StatusDistribution {
|
||||
count: number;
|
||||
percentage: number;
|
||||
}
|
||||
|
||||
// ==================== 项目审批人配置相关类型 ====================
|
||||
|
||||
// 项目审批人配置查询对象
|
||||
export interface CwProjectAuditorQuery {
|
||||
pageNum?: number;
|
||||
pageSize?: number;
|
||||
userName?: string;
|
||||
nickName?: string;
|
||||
deptId?: string | number;
|
||||
status?: string;
|
||||
configTime?: [string, string];
|
||||
configBy?: string | number;
|
||||
}
|
||||
|
||||
// 项目审批人配置视图对象
|
||||
export interface CwProjectAuditorVO {
|
||||
id?: string | number;
|
||||
userId?: string | number;
|
||||
userName?: string;
|
||||
nickName?: string;
|
||||
deptId?: string | number;
|
||||
deptName?: string;
|
||||
phoneNumber?: string;
|
||||
email?: string;
|
||||
status?: string;
|
||||
remark?: string;
|
||||
configBy?: string | number;
|
||||
configByName?: string;
|
||||
createBy?: string | number;
|
||||
createTime?: string;
|
||||
updateBy?: string | number;
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
// 项目审批人配置表单对象
|
||||
export interface CwProjectAuditorForm {
|
||||
id?: string | number;
|
||||
userId?: string | number;
|
||||
userName?: string;
|
||||
nickName?: string;
|
||||
deptId?: string | number;
|
||||
deptName?: string;
|
||||
phoneNumber?: string;
|
||||
email?: string;
|
||||
status?: string;
|
||||
remark?: string;
|
||||
}
|
||||
|
||||
// 批量添加审批人业务对象
|
||||
export interface CwProjectAuditorBatchBo {
|
||||
userIds: Array<string | number>;
|
||||
configBy: string | number;
|
||||
configByName: string;
|
||||
remark?: string;
|
||||
}
|
||||
|
||||
// ==================== 项目审批流程相关类型 ====================
|
||||
|
||||
// 审批流程查询对象
|
||||
export interface CwProjectApprovalProcessQuery {
|
||||
pageNum?: number;
|
||||
pageSize?: number;
|
||||
applicationNo?: string;
|
||||
processName?: string;
|
||||
processStatus?: string;
|
||||
submitterId?: string | number;
|
||||
submitterName?: string;
|
||||
startTime?: [string, string];
|
||||
endTime?: [string, string];
|
||||
}
|
||||
|
||||
// 审批流程视图对象
|
||||
export interface CwProjectApprovalProcessVO {
|
||||
id?: string | number;
|
||||
applicationId?: string | number;
|
||||
applicationNo?: string;
|
||||
processName?: string;
|
||||
processStatus?: string;
|
||||
totalNodes?: number;
|
||||
currentNode?: number;
|
||||
startTime?: string;
|
||||
endTime?: string;
|
||||
submitterId?: string | number;
|
||||
submitterName?: string;
|
||||
createBy?: string | number;
|
||||
createTime?: string;
|
||||
updateBy?: string | number;
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
// 审批流程表单对象
|
||||
export interface CwProjectApprovalProcessForm {
|
||||
id?: string | number;
|
||||
applicationId?: string | number;
|
||||
applicationNo?: string;
|
||||
processName?: string;
|
||||
processStatus?: string;
|
||||
totalNodes?: number;
|
||||
currentNode?: number;
|
||||
startTime?: string;
|
||||
endTime?: string;
|
||||
submitterId?: string | number;
|
||||
submitterName?: string;
|
||||
}
|
||||
|
||||
// 审批记录查询对象
|
||||
export interface CwApprovalRecordQuery {
|
||||
pageNum?: number;
|
||||
pageSize?: number;
|
||||
applicationId?: string | number;
|
||||
applicationNo?: string;
|
||||
processId?: string | number;
|
||||
approverId?: string | number;
|
||||
nodeStatus?: string;
|
||||
approveAction?: string;
|
||||
isCustomProcess?: boolean;
|
||||
startTime?: [string, string];
|
||||
endTime?: [string, string];
|
||||
}
|
||||
|
||||
// 审批记录视图对象
|
||||
export interface CwApprovalRecordVO {
|
||||
id?: string | number;
|
||||
applicationId?: string | number;
|
||||
applicationNo?: string;
|
||||
processId?: string | number;
|
||||
nodeCode?: string;
|
||||
nodeName?: string;
|
||||
customNodeName?: string;
|
||||
nodeOrder?: number;
|
||||
approverId?: string | number;
|
||||
approverName?: string;
|
||||
nodeStatus?: string;
|
||||
approveAction?: string;
|
||||
approveOpinion?: string;
|
||||
startTime?: string;
|
||||
endTime?: string;
|
||||
isCustomProcess?: boolean;
|
||||
createBy?: string | number;
|
||||
createTime?: string;
|
||||
updateBy?: string | number;
|
||||
updateTime?: string;
|
||||
// 关联的申请信息
|
||||
projectName?: string;
|
||||
submitterName?: string;
|
||||
totalInvestment?: number;
|
||||
}
|
||||
|
||||
// 自定义审批业务对象
|
||||
export interface CwCustomApprovalBo {
|
||||
applicationId: string | number;
|
||||
auditorIds: Array<string | number>;
|
||||
processName?: string;
|
||||
submitterId?: string | number;
|
||||
submitterName?: string;
|
||||
}
|
||||
|
||||
// 审批操作业务对象
|
||||
export interface CwApprovalActionBo {
|
||||
recordId: string | number;
|
||||
action: string; // 'approve' | 'reject'
|
||||
opinion: string;
|
||||
approverId?: string | number;
|
||||
approverName?: string;
|
||||
}
|
||||
|
||||
// =====================================================
|
||||
// 扩展审批记录视图对象
|
||||
// =====================================================
|
||||
export interface CwApprovalRecordExtendedVO extends CwApprovalRecordVO {
|
||||
processId?: string | number;
|
||||
customNodeName?: string;
|
||||
isCustomProcess?: boolean;
|
||||
|
||||
// 关联项目信息(用于显示)
|
||||
projectName?: string;
|
||||
totalInvestment?: number;
|
||||
applicantName?: string;
|
||||
}
|
||||
@@ -59,4 +59,4 @@ export function getTeamsByActivityId(activityId: string | number) {
|
||||
url: '/stgl/activityteaminfo/activity/' + activityId,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -238,4 +238,4 @@ export interface StglActivityTeamInfoVo {
|
||||
* 更新时间
|
||||
*/
|
||||
updateTime?: string;
|
||||
}
|
||||
}
|
||||
@@ -61,4 +61,4 @@ export function exportStglClass(query: StglClassQuery) {
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -299,4 +299,4 @@ export interface StglClassDetailVO {
|
||||
* 年级
|
||||
*/
|
||||
grade: string;
|
||||
}
|
||||
}
|
||||
@@ -71,3 +71,11 @@ export const delDept = (deptId: number | string) => {
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
|
||||
// 查询部门选项列表 (实际调用 list 接口)
|
||||
export const listDeptOptions = (): AxiosPromise<DeptVO[]> => {
|
||||
return request({
|
||||
url: '/system/dept/list',
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
@@ -67,6 +67,14 @@ export interface R<T = any> {
|
||||
data: T;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询基础接口
|
||||
*/
|
||||
export interface PageQuery {
|
||||
pageNum?: number;
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页数据信息
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export interface StudentStatisticsBo {
|
||||
startTime: string
|
||||
endTime: string
|
||||
collegeId?: number
|
||||
majorId?: number
|
||||
classId?: number
|
||||
}
|
||||
|
||||
export interface StatisticsChartData {
|
||||
name: string
|
||||
dormDeductionCount: number
|
||||
dormViolationCount: number
|
||||
dormViolationDeduction: number
|
||||
teachingViolationCount: number
|
||||
teachingViolationDeduction: number
|
||||
}
|
||||
|
||||
export interface StatisticsDetailData {
|
||||
id: number
|
||||
name: string
|
||||
parentName: string
|
||||
dormDeductionCount: number
|
||||
dormViolationCount: number
|
||||
dormViolationDeduction: number
|
||||
teachingViolationCount: number
|
||||
teachingViolationDeduction: number
|
||||
totalDeduction: number
|
||||
}
|
||||
|
||||
export interface StudentStatisticsVo {
|
||||
dimension: string
|
||||
chartData: StatisticsChartData[]
|
||||
detailData: StatisticsDetailData[]
|
||||
}
|
||||
|
||||
export interface CascadeOptionVo {
|
||||
id: number
|
||||
label: string
|
||||
value: string
|
||||
sort: number
|
||||
}
|
||||
|
||||
// 获取统计数据
|
||||
export function getStatistics(data: StudentStatisticsBo) {
|
||||
return request({
|
||||
url: '/xg/studentStatistics/statistics',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 导出统计数据
|
||||
export function exportStatistics(data: StudentStatisticsBo) {
|
||||
return request({
|
||||
url: '/xg/studentStatistics/export',
|
||||
method: 'post',
|
||||
data: data,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
// 获取二级学院列表
|
||||
export function getColleges() {
|
||||
return request({
|
||||
url: '/xg/studentStatistics/colleges',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 根据学院ID获取专业列表
|
||||
export function getMajorsByCollegeId(collegeId: number) {
|
||||
return request({
|
||||
url: `/xg/studentStatistics/majors/${collegeId}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 根据专业ID获取班级列表
|
||||
export function getClassesByMajorId(majorId: number) {
|
||||
return request({
|
||||
url: `/xg/studentStatistics/classes/${majorId}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { TableDataInfo } from '@/api/types';
|
||||
import {
|
||||
DormHygieneCheckVO,
|
||||
DormHygieneCheckForm,
|
||||
@@ -16,7 +17,7 @@ import {
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listDormHygieneCheck = (query?: DormHygieneCheckQuery): AxiosPromise<DormHygieneCheckVO[]> => {
|
||||
export const listDormHygieneCheck = (query?: DormHygieneCheckQuery): AxiosPromise<TableDataInfo<DormHygieneCheckVO[]>> => {
|
||||
return request({
|
||||
url: '/dormHygieneCheck/dormHygieneCheck/list',
|
||||
method: 'get',
|
||||
|
||||
@@ -49,6 +49,11 @@ export interface DormRoomVO {
|
||||
*/
|
||||
roomStatus: string;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
sort: number;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
@@ -106,6 +111,11 @@ export interface DormRoomForm extends BaseEntity {
|
||||
*/
|
||||
roomStatus?: string;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
sort?: number;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
@@ -158,6 +168,11 @@ export interface DormRoomQuery extends PageQuery {
|
||||
*/
|
||||
roomStatus?: string;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
sort?: number;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,156 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { HolidayStayVO, HolidayStayForm, HolidayStayQuery, StudentOptionVO, StudentOptionQuery } from '@/api/xg/xgss/holidayStay/holidayStay/types-sg';
|
||||
|
||||
/**
|
||||
* 查询假期留宿管理列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listHolidayStay = (query?: HolidayStayQuery): AxiosPromise<HolidayStayVO[]> => {
|
||||
return request({
|
||||
url: '/holidayStay/holidayStay/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询假期留宿管理详细
|
||||
* @param id
|
||||
*/
|
||||
export const getHolidayStay = (id: string | number): AxiosPromise<HolidayStayVO> => {
|
||||
return request({
|
||||
url: '/holidayStay/holidayStay/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增假期留宿管理
|
||||
* @param data
|
||||
*/
|
||||
export const addHolidayStay = (data: HolidayStayForm) => {
|
||||
return request({
|
||||
url: '/holidayStay/holidayStay',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改假期留宿管理
|
||||
* @param data
|
||||
*/
|
||||
export const updateHolidayStay = (data: HolidayStayForm) => {
|
||||
return request({
|
||||
url: '/holidayStay/holidayStay',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除假期留宿管理
|
||||
* @param id
|
||||
*/
|
||||
export const delHolidayStay = (id: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/holidayStay/holidayStay/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取学生选择器选项列表(支持按学号、姓名检索)
|
||||
* @param query 查询参数
|
||||
* @returns 学生选项列表
|
||||
*/
|
||||
export const getStudentOptions = (
|
||||
query?: StudentOptionQuery
|
||||
): AxiosPromise<{
|
||||
total: number;
|
||||
rows: StudentOptionVO[];
|
||||
}> => {
|
||||
return request({
|
||||
url: '/holidayStay/holidayStay/studentOptions',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询单人留宿有效数据
|
||||
* 获取所有有效的假期留宿数据,筛选出在同一时间段内该宿舍只有一个学生留宿的记录
|
||||
* @returns 单人留宿有效数据列表
|
||||
*/
|
||||
export const getSinglePersonValidStay = (): AxiosPromise<HolidayStayVO[]> => {
|
||||
return request({
|
||||
url: '/holidayStay/holidayStay/singlePersonValidStay',
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取校区选项列表
|
||||
* @returns 校区选项列表
|
||||
*/
|
||||
export const getCampusOptions = (): AxiosPromise<any[]> => {
|
||||
return request({
|
||||
url: '/xqxx/dormCampus/list',
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取指定校区的宿舍区选项列表
|
||||
* @param campusId 校区ID
|
||||
* @returns 宿舍区选项列表
|
||||
*/
|
||||
export const getAreaOptions = (campusId?: string | number): AxiosPromise<any[]> => {
|
||||
return request({
|
||||
url: '/ssqxx/dormArea/list',
|
||||
method: 'get',
|
||||
params: campusId ? { campusId } : undefined
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取指定宿舍区的宿舍楼选项列表
|
||||
* @param areaId 宿舍区ID
|
||||
* @returns 宿舍楼选项列表
|
||||
*/
|
||||
export const getBuildingOptions = (areaId?: string | number): AxiosPromise<any[]> => {
|
||||
return request({
|
||||
url: '/sslxx/dormBuilding/list',
|
||||
method: 'get',
|
||||
params: areaId ? { areaId } : undefined
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取指定宿舍楼的房间选项列表
|
||||
* @param buildingId 宿舍楼ID
|
||||
* @returns 房间选项列表
|
||||
*/
|
||||
export const getRoomOptions = (buildingId?: string | number): AxiosPromise<any[]> => {
|
||||
return request({
|
||||
url: '/xgss/dormRoom/list',
|
||||
method: 'get',
|
||||
params: buildingId ? { buildingId } : undefined
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取指定房间的床位选项列表
|
||||
* @param roomId 房间ID
|
||||
* @returns 床位选项列表
|
||||
*/
|
||||
export const getBedOptions = (roomId?: string | number): AxiosPromise<any[]> => {
|
||||
return request({
|
||||
url: '/dormbed/dormBed/list',
|
||||
method: 'get',
|
||||
params: roomId ? { roomId } : undefined
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,751 @@
|
||||
export interface HolidayStayVO {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
deleted: number;
|
||||
|
||||
/**
|
||||
* 学生ID,关联xg_student_msg.id
|
||||
*/
|
||||
studentId: string | number;
|
||||
|
||||
/**
|
||||
* 学生姓名
|
||||
*/
|
||||
studentName: string;
|
||||
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
studentNo: string;
|
||||
|
||||
/**
|
||||
* 班级ID
|
||||
*/
|
||||
classId: string | number;
|
||||
|
||||
/**
|
||||
* 班级名称
|
||||
*/
|
||||
className: string;
|
||||
|
||||
/**
|
||||
* 专业ID
|
||||
*/
|
||||
majorId: string | number;
|
||||
|
||||
/**
|
||||
* 专业名称
|
||||
*/
|
||||
majorName: string;
|
||||
|
||||
/**
|
||||
* 学院ID
|
||||
*/
|
||||
collegeId: string | number;
|
||||
|
||||
/**
|
||||
* 学院名称
|
||||
*/
|
||||
collegeName: string;
|
||||
|
||||
/**
|
||||
* 校区ID,关联xg_dorm_campus.id
|
||||
*/
|
||||
campusId: string | number;
|
||||
|
||||
/**
|
||||
* 校区名称
|
||||
*/
|
||||
campusName: string;
|
||||
|
||||
/**
|
||||
* 宿舍区ID,关联xg_dorm_area.id
|
||||
*/
|
||||
areaId: string | number;
|
||||
|
||||
/**
|
||||
* 宿舍区名称
|
||||
*/
|
||||
areaName: string;
|
||||
|
||||
/**
|
||||
* 宿舍楼ID,关联xg_dorm_building.id
|
||||
*/
|
||||
buildingId: string | number;
|
||||
|
||||
/**
|
||||
* 宿舍楼名称
|
||||
*/
|
||||
buildingName: string;
|
||||
|
||||
/**
|
||||
* 房间ID,关联xg_dorm_room.id
|
||||
*/
|
||||
roomId: string | number;
|
||||
|
||||
/**
|
||||
* 房间名称
|
||||
*/
|
||||
roomName: string;
|
||||
|
||||
/**
|
||||
* 床位ID,关联xg_dorm_bed.id
|
||||
*/
|
||||
bedId: string | number;
|
||||
|
||||
/**
|
||||
* 床位名称
|
||||
*/
|
||||
bedName: string;
|
||||
|
||||
/**
|
||||
* 假期类型(寒假、暑假、春节假期、国庆假期等)
|
||||
*/
|
||||
holidayType: string | number;
|
||||
|
||||
/**
|
||||
* 申请留宿开始日期
|
||||
*/
|
||||
applyStartDate: string;
|
||||
|
||||
/**
|
||||
* 申请留宿结束日期
|
||||
*/
|
||||
applyEndDate: string;
|
||||
|
||||
/**
|
||||
* 留宿原因(必填)
|
||||
*/
|
||||
stayReason: string;
|
||||
|
||||
/**
|
||||
* 留宿原因类型(学习、实习、家庭困难、其他)
|
||||
*/
|
||||
stayReasonType: string;
|
||||
|
||||
/**
|
||||
* 学生联系电话
|
||||
*/
|
||||
studentPhone: string;
|
||||
|
||||
/**
|
||||
* 紧急联系人姓名
|
||||
*/
|
||||
emergencyContact: string;
|
||||
|
||||
/**
|
||||
* 紧急联系人电话
|
||||
*/
|
||||
emergencyPhone: string;
|
||||
|
||||
/**
|
||||
* 家长同意(0否 1是)
|
||||
*/
|
||||
parentConsent: string;
|
||||
|
||||
/**
|
||||
* 附件OSS文件ID,多个用逗号分隔(申请材料、证明文件等)
|
||||
*/
|
||||
attachmentOssIds: string | number;
|
||||
|
||||
/**
|
||||
* 扩展字段1
|
||||
*/
|
||||
extField1: string;
|
||||
|
||||
/**
|
||||
* 扩展字段2
|
||||
*/
|
||||
extField2: string;
|
||||
|
||||
/**
|
||||
* 扩展字段3
|
||||
*/
|
||||
extField3: string;
|
||||
|
||||
/**
|
||||
* 备注信息
|
||||
*/
|
||||
remark: string;
|
||||
}
|
||||
|
||||
export interface HolidayStayForm extends BaseEntity {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
deleted?: number;
|
||||
|
||||
/**
|
||||
* 学生ID,关联xg_student_msg.id
|
||||
*/
|
||||
studentId?: string | number;
|
||||
|
||||
/**
|
||||
* 学生姓名
|
||||
*/
|
||||
studentName?: string;
|
||||
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
studentNo?: string;
|
||||
|
||||
/**
|
||||
* 班级ID
|
||||
*/
|
||||
classId?: string | number;
|
||||
|
||||
/**
|
||||
* 班级名称
|
||||
*/
|
||||
className?: string;
|
||||
|
||||
/**
|
||||
* 专业ID
|
||||
*/
|
||||
majorId?: string | number;
|
||||
|
||||
/**
|
||||
* 专业名称
|
||||
*/
|
||||
majorName?: string;
|
||||
|
||||
/**
|
||||
* 学院ID
|
||||
*/
|
||||
collegeId?: string | number;
|
||||
|
||||
/**
|
||||
* 学院名称
|
||||
*/
|
||||
collegeName?: string;
|
||||
|
||||
/**
|
||||
* 校区ID,关联xg_dorm_campus.id
|
||||
*/
|
||||
campusId?: string | number;
|
||||
|
||||
/**
|
||||
* 校区名称
|
||||
*/
|
||||
campusName?: string;
|
||||
|
||||
/**
|
||||
* 宿舍区ID,关联xg_dorm_area.id
|
||||
*/
|
||||
areaId?: string | number;
|
||||
|
||||
/**
|
||||
* 宿舍区名称
|
||||
*/
|
||||
areaName?: string;
|
||||
|
||||
/**
|
||||
* 宿舍楼ID,关联xg_dorm_building.id
|
||||
*/
|
||||
buildingId?: string | number;
|
||||
|
||||
/**
|
||||
* 宿舍楼名称
|
||||
*/
|
||||
buildingName?: string;
|
||||
|
||||
/**
|
||||
* 房间ID,关联xg_dorm_room.id
|
||||
*/
|
||||
roomId?: string | number;
|
||||
|
||||
/**
|
||||
* 房间名称
|
||||
*/
|
||||
roomName?: string;
|
||||
|
||||
/**
|
||||
* 床位ID,关联xg_dorm_bed.id
|
||||
*/
|
||||
bedId?: string | number;
|
||||
|
||||
/**
|
||||
* 床位名称
|
||||
*/
|
||||
bedName?: string;
|
||||
|
||||
/**
|
||||
* 假期类型(寒假、暑假、春节假期、国庆假期等)
|
||||
*/
|
||||
holidayType?: string | number;
|
||||
|
||||
/**
|
||||
* 申请留宿开始日期
|
||||
*/
|
||||
applyStartDate?: string;
|
||||
|
||||
/**
|
||||
* 申请留宿结束日期
|
||||
*/
|
||||
applyEndDate?: string;
|
||||
|
||||
/**
|
||||
* 留宿原因(必填)
|
||||
*/
|
||||
stayReason?: string;
|
||||
|
||||
/**
|
||||
* 留宿原因类型(学习、实习、家庭困难、其他)
|
||||
*/
|
||||
stayReasonType?: string;
|
||||
|
||||
/**
|
||||
* 学生联系电话
|
||||
*/
|
||||
studentPhone?: string;
|
||||
|
||||
/**
|
||||
* 紧急联系人姓名
|
||||
*/
|
||||
emergencyContact?: string;
|
||||
|
||||
/**
|
||||
* 紧急联系人电话
|
||||
*/
|
||||
emergencyPhone?: string;
|
||||
|
||||
/**
|
||||
* 家长同意(0否 1是)
|
||||
*/
|
||||
parentConsent?: string;
|
||||
|
||||
/**
|
||||
* 附件OSS文件ID,多个用逗号分隔(申请材料、证明文件等)
|
||||
*/
|
||||
attachmentOssIds?: string | number;
|
||||
|
||||
/**
|
||||
* 扩展字段1
|
||||
*/
|
||||
extField1?: string;
|
||||
|
||||
/**
|
||||
* 扩展字段2
|
||||
*/
|
||||
extField2?: string;
|
||||
|
||||
/**
|
||||
* 扩展字段3
|
||||
*/
|
||||
extField3?: string;
|
||||
|
||||
/**
|
||||
* 备注信息
|
||||
*/
|
||||
remark?: string;
|
||||
}
|
||||
|
||||
export interface HolidayStayQuery extends PageQuery {
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
deleted?: number;
|
||||
|
||||
/**
|
||||
* 学生ID,关联xg_student_msg.id
|
||||
*/
|
||||
studentId?: string | number;
|
||||
|
||||
/**
|
||||
* 学生姓名
|
||||
*/
|
||||
studentName?: string;
|
||||
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
studentNo?: string;
|
||||
|
||||
/**
|
||||
* 班级ID
|
||||
*/
|
||||
classId?: string | number;
|
||||
|
||||
/**
|
||||
* 班级名称
|
||||
*/
|
||||
className?: string;
|
||||
|
||||
/**
|
||||
* 专业ID
|
||||
*/
|
||||
majorId?: string | number;
|
||||
|
||||
/**
|
||||
* 专业名称
|
||||
*/
|
||||
majorName?: string;
|
||||
|
||||
/**
|
||||
* 学院ID
|
||||
*/
|
||||
collegeId?: string | number;
|
||||
|
||||
/**
|
||||
* 学院名称
|
||||
*/
|
||||
collegeName?: string;
|
||||
|
||||
/**
|
||||
* 校区ID,关联xg_dorm_campus.id
|
||||
*/
|
||||
campusId?: string | number;
|
||||
|
||||
/**
|
||||
* 校区名称
|
||||
*/
|
||||
campusName?: string;
|
||||
|
||||
/**
|
||||
* 宿舍区ID,关联xg_dorm_area.id
|
||||
*/
|
||||
areaId?: string | number;
|
||||
|
||||
/**
|
||||
* 宿舍区名称
|
||||
*/
|
||||
areaName?: string;
|
||||
|
||||
/**
|
||||
* 宿舍楼ID,关联xg_dorm_building.id
|
||||
*/
|
||||
buildingId?: string | number;
|
||||
|
||||
/**
|
||||
* 宿舍楼名称
|
||||
*/
|
||||
buildingName?: string;
|
||||
|
||||
/**
|
||||
* 房间ID,关联xg_dorm_room.id
|
||||
*/
|
||||
roomId?: string | number;
|
||||
|
||||
/**
|
||||
* 房间名称
|
||||
*/
|
||||
roomName?: string;
|
||||
|
||||
/**
|
||||
* 床位ID,关联xg_dorm_bed.id
|
||||
*/
|
||||
bedId?: string | number;
|
||||
|
||||
/**
|
||||
* 床位名称
|
||||
*/
|
||||
bedName?: string;
|
||||
|
||||
/**
|
||||
* 假期类型(寒假、暑假、春节假期、国庆假期等)
|
||||
*/
|
||||
holidayType?: string | number;
|
||||
|
||||
/**
|
||||
* 申请留宿开始日期
|
||||
*/
|
||||
applyStartDate?: string;
|
||||
|
||||
/**
|
||||
* 申请留宿结束日期
|
||||
*/
|
||||
applyEndDate?: string;
|
||||
|
||||
/**
|
||||
* 留宿原因(必填)
|
||||
*/
|
||||
stayReason?: string;
|
||||
|
||||
/**
|
||||
* 留宿原因类型(学习、实习、家庭困难、其他)
|
||||
*/
|
||||
stayReasonType?: string;
|
||||
|
||||
/**
|
||||
* 学生联系电话
|
||||
*/
|
||||
studentPhone?: string;
|
||||
|
||||
/**
|
||||
* 紧急联系人姓名
|
||||
*/
|
||||
emergencyContact?: string;
|
||||
|
||||
/**
|
||||
* 紧急联系人电话
|
||||
*/
|
||||
emergencyPhone?: string;
|
||||
|
||||
/**
|
||||
* 家长同意(0否 1是)
|
||||
*/
|
||||
parentConsent?: string;
|
||||
|
||||
/**
|
||||
* 附件OSS文件ID,多个用逗号分隔(申请材料、证明文件等)
|
||||
*/
|
||||
attachmentOssIds?: string | number;
|
||||
|
||||
/**
|
||||
* 扩展字段1
|
||||
*/
|
||||
extField1?: string;
|
||||
|
||||
/**
|
||||
* 扩展字段2
|
||||
*/
|
||||
extField2?: string;
|
||||
|
||||
/**
|
||||
* 扩展字段3
|
||||
*/
|
||||
extField3?: string;
|
||||
|
||||
/**
|
||||
* 状态过滤(valid-有效,invalid-失效)
|
||||
*/
|
||||
status?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* 学生选择器选项
|
||||
*/
|
||||
export interface StudentOptionVO {
|
||||
/**
|
||||
* 学生ID
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
studentNo: string;
|
||||
|
||||
/**
|
||||
* 学生姓名
|
||||
*/
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* 性别:0-男,1-女
|
||||
*/
|
||||
gender: string;
|
||||
|
||||
/**
|
||||
* 学院ID
|
||||
*/
|
||||
collegeId?: string | number;
|
||||
|
||||
/**
|
||||
* 学院名称
|
||||
*/
|
||||
collegeName?: string;
|
||||
|
||||
/**
|
||||
* 专业ID
|
||||
*/
|
||||
majorId?: string | number;
|
||||
|
||||
/**
|
||||
* 专业名称
|
||||
*/
|
||||
majorName?: string;
|
||||
|
||||
/**
|
||||
* 班级ID
|
||||
*/
|
||||
classId?: string | number;
|
||||
|
||||
/**
|
||||
* 班级名称
|
||||
*/
|
||||
className?: string;
|
||||
|
||||
/**
|
||||
* 学生联系电话
|
||||
*/
|
||||
phone?: string;
|
||||
|
||||
/**
|
||||
* 宿舍信息
|
||||
*/
|
||||
dormInfo?: {
|
||||
campusId?: string | number;
|
||||
campusName?: string;
|
||||
areaId?: string | number;
|
||||
areaName?: string;
|
||||
buildingId?: string | number;
|
||||
buildingName?: string;
|
||||
roomId?: string | number;
|
||||
roomName?: string;
|
||||
bedId?: string | number;
|
||||
bedName?: string;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 学生选择器查询参数
|
||||
*/
|
||||
export interface StudentOptionQuery {
|
||||
/**
|
||||
* 搜索关键字(学号或姓名)
|
||||
*/
|
||||
keyword?: string;
|
||||
|
||||
/**
|
||||
* 页码
|
||||
*/
|
||||
pageNum?: number;
|
||||
|
||||
/**
|
||||
* 每页大小
|
||||
*/
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校区选项
|
||||
*/
|
||||
export interface CampusOptionVO {
|
||||
/**
|
||||
* 校区ID
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 校区名称
|
||||
*/
|
||||
campusName: string;
|
||||
|
||||
/**
|
||||
* 校区编码
|
||||
*/
|
||||
campusCode?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 宿舍区选项
|
||||
*/
|
||||
export interface AreaOptionVO {
|
||||
/**
|
||||
* 宿舍区ID
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 宿舍区名称
|
||||
*/
|
||||
areaName: string;
|
||||
|
||||
/**
|
||||
* 校区ID
|
||||
*/
|
||||
campusId: string | number;
|
||||
|
||||
/**
|
||||
* 校区名称
|
||||
*/
|
||||
campusName?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 宿舍楼选项
|
||||
*/
|
||||
export interface BuildingOptionVO {
|
||||
/**
|
||||
* 宿舍楼ID
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 宿舍楼名称
|
||||
*/
|
||||
buildingName: string;
|
||||
|
||||
/**
|
||||
* 宿舍区ID
|
||||
*/
|
||||
areaId: string | number;
|
||||
|
||||
/**
|
||||
* 宿舍区名称
|
||||
*/
|
||||
areaName?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 房间选项
|
||||
*/
|
||||
export interface RoomOptionVO {
|
||||
/**
|
||||
* 房间ID
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 房间名称
|
||||
*/
|
||||
roomName: string;
|
||||
|
||||
/**
|
||||
* 宿舍楼ID
|
||||
*/
|
||||
buildingId: string | number;
|
||||
|
||||
/**
|
||||
* 宿舍楼名称
|
||||
*/
|
||||
buildingName?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 床位选项
|
||||
*/
|
||||
export interface BedOptionVO {
|
||||
/**
|
||||
* 床位ID
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 床位名称
|
||||
*/
|
||||
bedName: string;
|
||||
|
||||
/**
|
||||
* 房间ID
|
||||
*/
|
||||
roomId: string | number;
|
||||
|
||||
/**
|
||||
* 房间名称
|
||||
*/
|
||||
roomName?: string;
|
||||
|
||||
/**
|
||||
* 床位状态(0-空闲,1-已分配,2-已入住)
|
||||
*/
|
||||
bedStatus?: string;
|
||||
}
|
||||
@@ -1,5 +1,10 @@
|
||||
import request from '@/utils/request';
|
||||
import { XskhAssessmentApplicationApprovalQuery, XskhAssessmentApplicationApprovalBo, XskhAssessmentApplicationApprovalVo, AvailableScheduleOption } from './types';
|
||||
import {
|
||||
XskhAssessmentApplicationApprovalQuery,
|
||||
XskhAssessmentApplicationApprovalBo,
|
||||
XskhAssessmentApplicationApprovalVo,
|
||||
AvailableScheduleOption
|
||||
} from './types';
|
||||
|
||||
// 查询学生考核申请列表
|
||||
export function listAssessmentApplication(query: XskhAssessmentApplicationApprovalQuery) {
|
||||
@@ -91,4 +96,4 @@ export function getIndicatorsByScheduleId(scheduleId: string | number) {
|
||||
url: `/assessment/application/indicators/${scheduleId}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -71,4 +71,4 @@ export function getAvailableAssessmentSchedules() {
|
||||
url: '/assessment/approval/available',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -138,4 +138,4 @@ export interface RewardTypeOption {
|
||||
typeCode: string;
|
||||
/** 类型名称 */
|
||||
typeName: string;
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,12 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { TableDataInfo, R } from '@/api/types';
|
||||
import { XskhAssessmentIndicatorTypeVo, XskhAssessmentIndicatorTypeBo, XskhAssessmentIndicatorTypeQuery, XskhAssessmentIndicatorTypeForm } from './types';
|
||||
import {
|
||||
XskhAssessmentIndicatorTypeVo,
|
||||
XskhAssessmentIndicatorTypeBo,
|
||||
XskhAssessmentIndicatorTypeQuery,
|
||||
XskhAssessmentIndicatorTypeForm
|
||||
} from './types';
|
||||
|
||||
/**
|
||||
* 查询学生考核指标类型列表
|
||||
@@ -75,4 +80,4 @@ export function getEnabledAssessmentIndicatorTypes(): AxiosPromise<R<XskhAssessm
|
||||
url: '/assessment/indicatorType/enabled',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -86,4 +86,4 @@ export interface XskhAssessmentIndicatorTypeForm extends BaseEntity {
|
||||
status?: string;
|
||||
/** 排序号 */
|
||||
sortOrder?: number;
|
||||
}
|
||||
}
|
||||
@@ -75,4 +75,4 @@ export function getEnabledAssessmentPlans(): AxiosPromise<R<XskhAssessmentPlanVo
|
||||
url: '/assessment/plan/enabled',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -140,4 +140,4 @@ export interface AssessmentIndicatorOption {
|
||||
indicatorDescription: string;
|
||||
/** 最高分值 */
|
||||
maxScore: number;
|
||||
}
|
||||
}
|
||||
@@ -124,4 +124,4 @@ export function getEnabledAssessmentPlans(): AxiosPromise<R<any[]>> {
|
||||
url: '/assessment/plan/enabled',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -142,4 +142,4 @@ export interface AssessmentPlanOption {
|
||||
planName: string;
|
||||
/** 方案说明 */
|
||||
planDescription: string;
|
||||
}
|
||||
}
|
||||
@@ -98,12 +98,50 @@ export const applyDisciplineRevoke = (data: DisciplineRevokeForm) => {
|
||||
};
|
||||
|
||||
/**
|
||||
* 审核撤销申请
|
||||
* 查询班主任待审核的撤销申请列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
export const listClassTeacherDisciplineRevoke = (query?: DisciplineRevokeQuery): AxiosPromise<DisciplineRevokeVO[]> => {
|
||||
return request({
|
||||
url: '/disciplineRevoke/disciplineRevoke/classTeacherList',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 班主任审核撤销申请
|
||||
* @param data
|
||||
*/
|
||||
export const approveDisciplineRevoke = (data: DisciplineRevokeForm) => {
|
||||
export const teacherApproveDisciplineRevoke = (data: DisciplineRevokeForm) => {
|
||||
return request({
|
||||
url: '/disciplineRevoke/disciplineRevoke/approve',
|
||||
url: '/disciplineRevoke/disciplineRevoke/teacherApprove',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询学工处待审核的撤销申请列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
export const listStudentAffairsDisciplineRevoke = (query?: DisciplineRevokeQuery): AxiosPromise<DisciplineRevokeVO[]> => {
|
||||
return request({
|
||||
url: '/disciplineRevoke/disciplineRevoke/studentAffairsList',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 学工处审核撤销申请
|
||||
* @param data
|
||||
*/
|
||||
export const studentAffairsApproveDisciplineRevoke = (data: DisciplineRevokeForm) => {
|
||||
return request({
|
||||
url: '/disciplineRevoke/disciplineRevoke/studentAffairsApprove',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
|
||||
@@ -37,27 +37,47 @@ export interface DisciplineRevokeVO {
|
||||
applyTime: string;
|
||||
|
||||
/**
|
||||
* 状态(1-待审核 2-审核通过 3-审核拒绝)
|
||||
* 状态(1-待班主任审核 2-待学工处审核 3-审核通过 4-班主任审核拒绝 5-学工处审核拒绝)
|
||||
*/
|
||||
status: string;
|
||||
|
||||
/**
|
||||
* 审核人ID
|
||||
* 班主任审核人ID
|
||||
*/
|
||||
teacherApprovalBy: string | number;
|
||||
|
||||
/**
|
||||
* 班主任审核人姓名
|
||||
*/
|
||||
teacherApprovalByName: string;
|
||||
|
||||
/**
|
||||
* 班主任审核时间
|
||||
*/
|
||||
teacherApprovalTime: string;
|
||||
|
||||
/**
|
||||
* 班主任审核备注
|
||||
*/
|
||||
teacherApprovalRemark: string;
|
||||
|
||||
/**
|
||||
* 学工处审核人ID
|
||||
*/
|
||||
approvalBy: string | number;
|
||||
|
||||
/**
|
||||
* 审核人姓名
|
||||
* 学工处审核人姓名
|
||||
*/
|
||||
approvalByName: string;
|
||||
|
||||
/**
|
||||
* 审核时间
|
||||
* 学工处审核时间
|
||||
*/
|
||||
approvalTime: string;
|
||||
|
||||
/**
|
||||
* 审核备注
|
||||
* 学工处审核备注
|
||||
*/
|
||||
approvalRemark: string;
|
||||
|
||||
@@ -80,6 +100,22 @@ export interface DisciplineRevokeVO {
|
||||
* 更新时间
|
||||
*/
|
||||
updateTime: string;
|
||||
|
||||
// 扩展字段(用于关联查询显示)
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
studentNo?: string;
|
||||
|
||||
/**
|
||||
* 违纪类型名称
|
||||
*/
|
||||
disciplineTypeName?: string;
|
||||
|
||||
/**
|
||||
* 违纪日期
|
||||
*/
|
||||
disciplineDate?: string;
|
||||
}
|
||||
|
||||
export interface DisciplineRevokeForm {
|
||||
@@ -119,22 +155,37 @@ export interface DisciplineRevokeForm {
|
||||
applyTime?: string;
|
||||
|
||||
/**
|
||||
* 状态(1-待审核 2-审核通过 3-审核拒绝)
|
||||
* 状态(1-待班主任审核 2-待学工处审核 3-审核通过 4-班主任审核拒绝 5-学工处审核拒绝)
|
||||
*/
|
||||
status?: string;
|
||||
|
||||
/**
|
||||
* 审核人ID
|
||||
* 班主任审核人ID
|
||||
*/
|
||||
teacherApprovalBy?: string | number;
|
||||
|
||||
/**
|
||||
* 班主任审核时间
|
||||
*/
|
||||
teacherApprovalTime?: string;
|
||||
|
||||
/**
|
||||
* 班主任审核备注
|
||||
*/
|
||||
teacherApprovalRemark?: string;
|
||||
|
||||
/**
|
||||
* 学工处审核人ID
|
||||
*/
|
||||
approvalBy?: string | number;
|
||||
|
||||
/**
|
||||
* 审核时间
|
||||
* 学工处审核时间
|
||||
*/
|
||||
approvalTime?: string;
|
||||
|
||||
/**
|
||||
* 审核备注
|
||||
* 学工处审核备注
|
||||
*/
|
||||
approvalRemark?: string;
|
||||
}
|
||||
@@ -155,6 +206,11 @@ export interface DisciplineRevokeQuery extends PageQuery {
|
||||
*/
|
||||
studentName?: string;
|
||||
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
studentNo?: string;
|
||||
|
||||
/**
|
||||
* 撤销申请原因
|
||||
*/
|
||||
@@ -166,25 +222,30 @@ export interface DisciplineRevokeQuery extends PageQuery {
|
||||
applyTime?: string;
|
||||
|
||||
/**
|
||||
* 状态(1-待审核 2-审核通过 3-审核拒绝)
|
||||
* 状态(1-待班主任审核 2-待学工处审核 3-审核通过 4-班主任审核拒绝 5-学工处审核拒绝)
|
||||
*/
|
||||
status?: string;
|
||||
|
||||
/**
|
||||
* 审核人ID
|
||||
* 班主任审核人ID
|
||||
*/
|
||||
teacherApprovalBy?: string | number;
|
||||
|
||||
/**
|
||||
* 班主任审核时间
|
||||
*/
|
||||
teacherApprovalTime?: string;
|
||||
|
||||
/**
|
||||
* 学工处审核人ID
|
||||
*/
|
||||
approvalBy?: string | number;
|
||||
|
||||
/**
|
||||
* 审核时间
|
||||
* 学工处审核时间
|
||||
*/
|
||||
approvalTime?: string;
|
||||
|
||||
/**
|
||||
* 审核备注
|
||||
*/
|
||||
approvalRemark?: string;
|
||||
|
||||
/**
|
||||
* 其他参数
|
||||
*/
|
||||
|
||||
@@ -19,6 +19,31 @@ export interface DisciplineTypeVO {
|
||||
*/
|
||||
typeCategory: string;
|
||||
|
||||
/**
|
||||
* 区域类型(1-宿舍区违纪 2-教学区违纪)
|
||||
*/
|
||||
areaType: string;
|
||||
|
||||
/**
|
||||
* 最低扣分
|
||||
*/
|
||||
minScore: number;
|
||||
|
||||
/**
|
||||
* 最高扣分
|
||||
*/
|
||||
maxScore: number;
|
||||
|
||||
/**
|
||||
* 是否均化(0-否 1-是)
|
||||
*/
|
||||
isEqualized: string;
|
||||
|
||||
/**
|
||||
* 均化阈值
|
||||
*/
|
||||
equalizedThreshold: number;
|
||||
|
||||
/**
|
||||
* 类型说明
|
||||
*/
|
||||
@@ -61,6 +86,31 @@ export interface DisciplineTypeForm extends BaseEntity {
|
||||
*/
|
||||
typeCategory?: string;
|
||||
|
||||
/**
|
||||
* 区域类型(1-宿舍区违纪 2-教学区违纪)
|
||||
*/
|
||||
areaType?: string;
|
||||
|
||||
/**
|
||||
* 最低扣分
|
||||
*/
|
||||
minScore?: number;
|
||||
|
||||
/**
|
||||
* 最高扣分
|
||||
*/
|
||||
maxScore?: number;
|
||||
|
||||
/**
|
||||
* 是否均化(0-否 1-是)
|
||||
*/
|
||||
isEqualized?: string;
|
||||
|
||||
/**
|
||||
* 均化阈值
|
||||
*/
|
||||
equalizedThreshold?: number;
|
||||
|
||||
/**
|
||||
* 类型说明
|
||||
*/
|
||||
@@ -98,6 +148,11 @@ export interface DisciplineTypeQuery extends PageQuery {
|
||||
*/
|
||||
typeCategory?: string;
|
||||
|
||||
/**
|
||||
* 区域类型(1-宿舍区违纪 2-教学区违纪)
|
||||
*/
|
||||
areaType?: string;
|
||||
|
||||
/**
|
||||
* 状态(0-正常 1-停用)
|
||||
*/
|
||||
|
||||
@@ -19,6 +19,16 @@ export interface RewardTypeVO {
|
||||
*/
|
||||
description: string;
|
||||
|
||||
/**
|
||||
* 是否均化(0-否 1-是)
|
||||
*/
|
||||
isEqualized: string;
|
||||
|
||||
/**
|
||||
* 均化阈值
|
||||
*/
|
||||
equalizedThreshold: number;
|
||||
|
||||
/**
|
||||
* 状态(0-正常 1-停用)
|
||||
*/
|
||||
@@ -56,6 +66,16 @@ export interface RewardTypeForm extends BaseEntity {
|
||||
*/
|
||||
description?: string;
|
||||
|
||||
/**
|
||||
* 是否均化(0-否 1-是)
|
||||
*/
|
||||
isEqualized?: string;
|
||||
|
||||
/**
|
||||
* 均化阈值
|
||||
*/
|
||||
equalizedThreshold?: number;
|
||||
|
||||
/**
|
||||
* 状态(0-正常 1-停用)
|
||||
*/
|
||||
@@ -88,6 +108,16 @@ export interface RewardTypeQuery extends PageQuery {
|
||||
*/
|
||||
description?: string;
|
||||
|
||||
/**
|
||||
* 是否均化(0-否 1-是)
|
||||
*/
|
||||
isEqualized?: string;
|
||||
|
||||
/**
|
||||
* 均化阈值
|
||||
*/
|
||||
equalizedThreshold?: number;
|
||||
|
||||
/**
|
||||
* 状态(0-正常 1-停用)
|
||||
*/
|
||||
|
||||
@@ -15,9 +15,9 @@
|
||||
<el-row :gutter="2" align="middle">
|
||||
<el-col :span="5">
|
||||
<el-form-item label="姓名" :prop="`advisors.${index}.name`">
|
||||
<TeacherSelector
|
||||
:model-value="advisor.teacher"
|
||||
placeholder="选择指导老师"
|
||||
<TeacherSelector
|
||||
:model-value="advisor.teacher"
|
||||
placeholder="选择指导老师"
|
||||
@update:model-value="(teacher) => handleTeacherChange(advisor, teacher)"
|
||||
/>
|
||||
</el-form-item>
|
||||
@@ -119,7 +119,7 @@ const removeAdvisor = (index: number) => {
|
||||
// 监听teacher选择变化,自动填充相关信息
|
||||
const handleTeacherChange = (advisor: AdvisorVO, teacher: TeacherVO | null) => {
|
||||
console.log('handleTeacherChange called with teacher:', teacher);
|
||||
|
||||
|
||||
if (teacher) {
|
||||
// 自动填充老师信息
|
||||
advisor.name = teacher.nickName || '';
|
||||
@@ -127,7 +127,7 @@ const handleTeacherChange = (advisor: AdvisorVO, teacher: TeacherVO | null) => {
|
||||
advisor.dept = teacher.deptName || '';
|
||||
advisor.email = teacher.email || '暂无邮箱';
|
||||
advisor.userId = teacher.userId?.toString() || '';
|
||||
|
||||
|
||||
console.log('Updated advisor:', {
|
||||
name: advisor.name,
|
||||
phone: advisor.phone,
|
||||
|
||||
@@ -14,7 +14,12 @@
|
||||
value-key="uniqueKey"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option v-for="option in options" :key="option.uniqueKey || `${option.relatedType}-${option.relatedClubId}`" :label="formatOptionLabel(option)" :value="option">
|
||||
<el-option
|
||||
v-for="option in options"
|
||||
:key="option.uniqueKey || `${option.relatedType}-${option.relatedClubId}`"
|
||||
:label="formatOptionLabel(option)"
|
||||
:value="option"
|
||||
>
|
||||
<div class="option-content">
|
||||
<span class="option-name">{{ option.relatedClubName }}</span>
|
||||
<span class="option-type">{{ getTypeLabel(option.relatedType) }}</span>
|
||||
@@ -98,9 +103,13 @@ const selectedOption = ref<ClubOption | null>(null);
|
||||
|
||||
// 监听 modelValue 变化
|
||||
import { watch } from 'vue';
|
||||
watch(() => props.modelValue, (newValue) => {
|
||||
console.log('ClubSelector - modelValue changed:', newValue);
|
||||
}, { immediate: true });
|
||||
watch(
|
||||
() => props.modelValue,
|
||||
(newValue) => {
|
||||
console.log('ClubSelector - modelValue changed:', newValue);
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
// 格式化选项标签
|
||||
const formatOptionLabel = (option: ClubOption): string => {
|
||||
@@ -172,7 +181,7 @@ const loadOptions = async () => {
|
||||
uniqueKey: `${item.relatedType}-${item.relatedClubId}`
|
||||
}));
|
||||
options.value = [...clubOptions.value, ...volunteerOptions.value];
|
||||
|
||||
|
||||
console.log('ClubSelector - 加载选项数据完成:', {
|
||||
clubCount: clubOptions.value.length,
|
||||
volunteerCount: volunteerOptions.value.length,
|
||||
|
||||
@@ -267,11 +267,11 @@
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="自我总体评价">
|
||||
<el-input
|
||||
:value="monthlyScoreForm.selfOverallComment || '暂无自我总体评价'"
|
||||
type="textarea"
|
||||
:rows="4"
|
||||
readonly
|
||||
<el-input
|
||||
:value="monthlyScoreForm.selfOverallComment || '暂无自我总体评价'"
|
||||
type="textarea"
|
||||
:rows="4"
|
||||
readonly
|
||||
placeholder="暂无自我总体评价内容"
|
||||
/>
|
||||
</el-form-item>
|
||||
@@ -457,7 +457,7 @@ const loadApprovalDetail = async () => {
|
||||
if (approvalDetail.value?.routineWorkIndicators && Array.isArray(approvalDetail.value.routineWorkIndicators)) {
|
||||
routineWorkScores.value = approvalDetail.value.routineWorkIndicators.map((item) => {
|
||||
const mappedItem = {
|
||||
...item,
|
||||
...item,
|
||||
// 确保数值字段不为空
|
||||
selfScore: Number(item.selfScore) || 0,
|
||||
superiorScore: Number(item.superiorScore) || Number(item.selfScore) || 0, // 默认使用自评分数
|
||||
@@ -517,7 +517,7 @@ const loadApprovalDetail = async () => {
|
||||
if (approvalDetail.value?.specialWorkIndicators && Array.isArray(approvalDetail.value.specialWorkIndicators)) {
|
||||
specialWorkScores.value = approvalDetail.value.specialWorkIndicators.map((item) => {
|
||||
const mappedItem = {
|
||||
...item,
|
||||
...item,
|
||||
// 自评分数字段处理 - 兼容不同字段名,确保数值类型
|
||||
score: Number(item.score || item.selfScore) || 0,
|
||||
selfScore: Number(item.selfScore || item.score) || 0,
|
||||
@@ -557,18 +557,17 @@ const loadApprovalDetail = async () => {
|
||||
approvalForm.auditComment = '';
|
||||
|
||||
console.log('=== 审批详情数据加载完成 ===');
|
||||
|
||||
|
||||
// 验证数据完整性
|
||||
if (routineWorkScores.value.length === 0) {
|
||||
console.warn('⚠️ 警告:班主任常规工作数据为空,可能存在数据问题');
|
||||
proxy?.$modal.msgWarning('班主任常规工作数据为空,请检查数据是否正确');
|
||||
}
|
||||
|
||||
|
||||
if (specialWorkScores.value.length === 0) {
|
||||
console.warn('⚠️ 警告:特色工作数据为空,可能存在数据问题');
|
||||
proxy?.$modal.msgWarning('特色工作数据为空,请检查数据是否正确');
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
console.error('加载审批详情失败:', error);
|
||||
proxy?.$modal.msgError('加载审批详情失败');
|
||||
|
||||
@@ -241,15 +241,13 @@
|
||||
</template>
|
||||
<el-descriptions :column="3" border>
|
||||
<el-descriptions-item label="评价等级">
|
||||
<div style="display: flex; align-items: center; gap: 8px;">
|
||||
<div style="display: flex; align-items: center; gap: 8px">
|
||||
<dict-tag :options="getEvaluationLevelOptions()" :value="calculateEvaluationLevel()" />
|
||||
<el-tooltip placement="top">
|
||||
<template #content>
|
||||
<div>
|
||||
<div>{{ evaluationStats ? '基于占比规则的精准评级' : '基于分数阈值的简化评级' }}</div>
|
||||
<div v-if="isDictDataMissing" style="color: #f56c6c; margin-top: 4px;">
|
||||
⚠️ 字典数据缺失,使用默认数据
|
||||
</div>
|
||||
<div v-if="isDictDataMissing" style="color: #f56c6c; margin-top: 4px">⚠️ 字典数据缺失,使用默认数据</div>
|
||||
</div>
|
||||
</template>
|
||||
<el-icon :color="evaluationStats ? '#67c23a' : '#e6a23c'" size="16">
|
||||
@@ -259,9 +257,7 @@
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="考核得分">
|
||||
{{ calculateMonthlyScore().toFixed(2) }}分
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="考核得分"> {{ calculateMonthlyScore().toFixed(2) }}分 </el-descriptions-item>
|
||||
<el-descriptions-item label="审批时间">
|
||||
{{ parseTime(currentRow?.createTime, '{y}-{m}-{d} {h}:{i}:{s}') || '-' }}
|
||||
</el-descriptions-item>
|
||||
@@ -310,9 +306,10 @@ const getEvaluationLevelOptions = (): DictDataOption[] => {
|
||||
console.log('✅ 使用数据库字典数据:', bmzr_evaluation_level.value);
|
||||
return bmzr_evaluation_level.value;
|
||||
}
|
||||
|
||||
|
||||
// 字典数据未加载或为空时的处理
|
||||
if (visible.value) { // 只在弹窗打开时输出警告
|
||||
if (visible.value) {
|
||||
// 只在弹窗打开时输出警告
|
||||
console.warn('⚠️ 字典数据为空,使用备用数据,当前状态:', {
|
||||
弹窗是否打开: visible.value,
|
||||
字典对象存在: !!bmzr_evaluation_level.value,
|
||||
@@ -321,7 +318,7 @@ const getEvaluationLevelOptions = (): DictDataOption[] => {
|
||||
字典数据内容: bmzr_evaluation_level.value
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
return fallbackEvaluationLevelOptions.value;
|
||||
};
|
||||
|
||||
@@ -363,10 +360,10 @@ const dialogTitle = computed(() => {
|
||||
const isDictDataMissing = computed(() => {
|
||||
// 如果还没有尝试加载字典数据,不显示警告
|
||||
if (!visible.value) return false;
|
||||
|
||||
|
||||
// 如果字典数据已经加载成功,不显示警告
|
||||
if (isDictLoaded.value) return false;
|
||||
|
||||
|
||||
// 只有在弹窗打开且字典数据为空时才显示警告
|
||||
return !bmzr_evaluation_level.value || bmzr_evaluation_level.value.length === 0;
|
||||
});
|
||||
@@ -434,7 +431,7 @@ const calculateEvaluationLevel = () => {
|
||||
console.log('💯 考核得分:', score);
|
||||
console.log('📈 是否有统计数据:', !!evaluationStats.value);
|
||||
console.log('👤 当前用户ID:', currentRow.value?.evaluatedUserId);
|
||||
|
||||
|
||||
if (evaluationStats.value) {
|
||||
console.log('📊 统计数据详情:', {
|
||||
总教师数: evaluationStats.value.totalTeachers,
|
||||
@@ -443,15 +440,17 @@ const calculateEvaluationLevel = () => {
|
||||
及格分数: evaluationStats.value.evaluationLevelRules?.passScore
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
let level = '';
|
||||
let calculationMethod = '';
|
||||
|
||||
|
||||
// 如果有统计数据且用户ID存在,使用严格的占比规则
|
||||
if (evaluationStats.value &&
|
||||
evaluationStats.value.totalTeachers > 0 &&
|
||||
evaluationStats.value.scoreRankings.length > 0 &&
|
||||
currentRow.value?.evaluatedUserId) {
|
||||
if (
|
||||
evaluationStats.value &&
|
||||
evaluationStats.value.totalTeachers > 0 &&
|
||||
evaluationStats.value.scoreRankings.length > 0 &&
|
||||
currentRow.value?.evaluatedUserId
|
||||
) {
|
||||
level = calculateEvaluationLevelByStats(score, currentRow.value.evaluatedUserId);
|
||||
calculationMethod = '📈 严格占比规则评级';
|
||||
} else {
|
||||
@@ -464,17 +463,17 @@ const calculateEvaluationLevel = () => {
|
||||
level = 'B'; // B等(合格):60-85分
|
||||
}
|
||||
calculationMethod = '🔢 简化分数评级';
|
||||
|
||||
|
||||
// 输出使用简化评级的原因
|
||||
const reasons = [];
|
||||
if (!evaluationStats.value) reasons.push('统计数据为空');
|
||||
if (evaluationStats.value?.totalTeachers === 0) reasons.push('总教师数为0');
|
||||
if (evaluationStats.value?.scoreRankings?.length === 0) reasons.push('排名数据为空');
|
||||
if (!currentRow.value?.evaluatedUserId) reasons.push('用户ID缺失');
|
||||
|
||||
|
||||
console.warn('⚠️ 使用简化评级的原因:', reasons.join('、'));
|
||||
}
|
||||
|
||||
|
||||
console.log('🎯 计算方法:', calculationMethod);
|
||||
console.log('📋 最终评价等级:', level);
|
||||
console.log('=== 📊 评价等级计算调试结束 ===');
|
||||
@@ -486,32 +485,30 @@ const calculateEvaluationLevelByStats = (score: number, evaluatedUserId: string
|
||||
const stats = evaluationStats.value;
|
||||
if (!stats) {
|
||||
console.warn('统计数据不可用,使用简单评级');
|
||||
return score < 60 ? 'C' : (score >= 85 ? 'A' : 'B');
|
||||
return score < 60 ? 'C' : score >= 85 ? 'A' : 'B';
|
||||
}
|
||||
|
||||
|
||||
const { totalTeachers, scoreRankings, evaluationLevelRules } = stats;
|
||||
const { aLevelMaxPercentage, passScore } = evaluationLevelRules;
|
||||
|
||||
|
||||
// C等:不及格
|
||||
if (score < passScore) {
|
||||
return 'C';
|
||||
}
|
||||
|
||||
|
||||
// 查找当前用户的排名
|
||||
const currentRanking = scoreRankings.find(item =>
|
||||
item.evaluatedUserId === evaluatedUserId || item.score === score
|
||||
);
|
||||
|
||||
const currentRanking = scoreRankings.find((item) => item.evaluatedUserId === evaluatedUserId || item.score === score);
|
||||
|
||||
if (!currentRanking) {
|
||||
console.warn('找不到当前用户的排名信息,使用简单评级');
|
||||
return score < 60 ? 'C' : (score >= 85 ? 'A' : 'B');
|
||||
return score < 60 ? 'C' : score >= 85 ? 'A' : 'B';
|
||||
}
|
||||
|
||||
|
||||
// A等:及格且排名在前20%内
|
||||
if (score >= passScore && currentRanking.percentage <= aLevelMaxPercentage) {
|
||||
return 'A';
|
||||
}
|
||||
|
||||
|
||||
// B等:其余及格的
|
||||
return 'B';
|
||||
};
|
||||
@@ -525,28 +522,28 @@ const open = async (row: AssessmentApprovalVO) => {
|
||||
|
||||
currentRow.value = row;
|
||||
visible.value = true;
|
||||
|
||||
|
||||
// 检查字典数据加载状态
|
||||
console.log('🔍 打开弹窗时字典数据状态:', {
|
||||
字典对象存在: !!bmzr_evaluation_level.value,
|
||||
字典数据长度: bmzr_evaluation_level.value?.length || 0,
|
||||
字典数据内容: bmzr_evaluation_level.value
|
||||
});
|
||||
|
||||
|
||||
// 等待字典数据加载完成(最多等待2秒)
|
||||
let waitCount = 0;
|
||||
while ((!bmzr_evaluation_level.value || bmzr_evaluation_level.value.length === 0) && waitCount < 20) {
|
||||
await new Promise(resolve => setTimeout(resolve, 100));
|
||||
await new Promise((resolve) => setTimeout(resolve, 100));
|
||||
waitCount++;
|
||||
}
|
||||
|
||||
|
||||
if (bmzr_evaluation_level.value && bmzr_evaluation_level.value.length > 0) {
|
||||
console.log('✅ 字典数据加载完成:', bmzr_evaluation_level.value);
|
||||
isDictLoaded.value = true;
|
||||
} else {
|
||||
console.warn('⚠️ 字典数据加载超时,使用备用数据');
|
||||
}
|
||||
|
||||
|
||||
await loadViewDetail();
|
||||
};
|
||||
|
||||
@@ -577,11 +574,15 @@ const loadViewDetail = async () => {
|
||||
if (statsRes.status === 'fulfilled') {
|
||||
evaluationStats.value = statsRes.value.data;
|
||||
console.log('✅ 评价等级统计数据加载成功:', evaluationStats.value);
|
||||
|
||||
|
||||
// 检查统计数据的完整性
|
||||
if (!evaluationStats.value.totalTeachers || evaluationStats.value.scoreRankings.length === 0) {
|
||||
console.warn('⚠️ 统计数据不完整,总教师数:', evaluationStats.value.totalTeachers,
|
||||
'排名数据条数:', evaluationStats.value.scoreRankings.length);
|
||||
console.warn(
|
||||
'⚠️ 统计数据不完整,总教师数:',
|
||||
evaluationStats.value.totalTeachers,
|
||||
'排名数据条数:',
|
||||
evaluationStats.value.scoreRankings.length
|
||||
);
|
||||
proxy?.$modal.msgWarning('统计数据不完整,可能影响等级评定准确性');
|
||||
}
|
||||
} else {
|
||||
@@ -696,18 +697,17 @@ const loadViewDetail = async () => {
|
||||
approvalData.auditComment = '';
|
||||
|
||||
console.log('=== 查看详情数据加载完成 ===');
|
||||
|
||||
|
||||
// 验证数据完整性
|
||||
if (routineWorkScores.value.length === 0) {
|
||||
console.warn('⚠️ 警告:班主任常规工作数据为空,可能存在数据问题');
|
||||
proxy?.$modal.msgWarning('班主任常规工作数据为空,请检查数据是否正确');
|
||||
}
|
||||
|
||||
|
||||
if (specialWorkScores.value.length === 0) {
|
||||
console.warn('⚠️ 警告:特色工作数据为空,可能存在数据问题');
|
||||
proxy?.$modal.msgWarning('特色工作数据为空,请检查数据是否正确');
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
console.error('加载查看详情失败:', error);
|
||||
proxy?.$modal.msgError('加载查看详情失败');
|
||||
@@ -724,8 +724,8 @@ const handleClose = () => {
|
||||
routineWorkScores.value = [];
|
||||
specialWorkScores.value = [];
|
||||
evaluationStats.value = undefined;
|
||||
isDictLoaded.value = false; // 重置字典加载状态
|
||||
|
||||
isDictLoaded.value = false; // 重置字典加载状态
|
||||
|
||||
Object.assign(managementEffectivenessData, {
|
||||
classDeduction: 0,
|
||||
classDeductionHalf: 0,
|
||||
@@ -802,7 +802,7 @@ defineExpose({
|
||||
max-height: 150px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
|
||||
.el-table__row {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
@@ -7,12 +7,22 @@
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="指标类型编码" prop="indicatorTypeCode">
|
||||
<el-input v-model="queryParams.indicatorTypeCode" placeholder="请输入指标类型编码(支持模糊搜索)" clearable @keyup.enter="handleQuery" />
|
||||
<el-input
|
||||
v-model="queryParams.indicatorTypeCode"
|
||||
placeholder="请输入指标类型编码(支持模糊搜索)"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="指标类型名称" prop="indicatorTypeName">
|
||||
<el-input v-model="queryParams.indicatorTypeName" placeholder="请输入指标类型名称(支持模糊搜索)" clearable @keyup.enter="handleQuery" />
|
||||
<el-input
|
||||
v-model="queryParams.indicatorTypeName"
|
||||
placeholder="请输入指标类型名称(支持模糊搜索)"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
@@ -194,7 +204,7 @@ const handleQuery = () => {
|
||||
pageNum: queryParams.value.pageNum,
|
||||
pageSize: queryParams.value.pageSize
|
||||
});
|
||||
|
||||
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
};
|
||||
@@ -202,24 +212,26 @@ const handleQuery = () => {
|
||||
/** 查询班主任考核指标类型列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
|
||||
|
||||
// 构建查询参数,正确处理空字符串和undefined/null值
|
||||
const queryData = {
|
||||
pageNum: queryParams.value.pageNum,
|
||||
pageSize: queryParams.value.pageSize,
|
||||
// 修复:正确处理空字符串,只过滤undefined和null
|
||||
...(queryParams.value.indicatorTypeCode !== undefined && queryParams.value.indicatorTypeCode !== null && { indicatorTypeCode: queryParams.value.indicatorTypeCode }),
|
||||
...(queryParams.value.indicatorTypeName !== undefined && queryParams.value.indicatorTypeName !== null && { indicatorTypeName: queryParams.value.indicatorTypeName }),
|
||||
...(queryParams.value.indicatorTypeCode !== undefined &&
|
||||
queryParams.value.indicatorTypeCode !== null && { indicatorTypeCode: queryParams.value.indicatorTypeCode }),
|
||||
...(queryParams.value.indicatorTypeName !== undefined &&
|
||||
queryParams.value.indicatorTypeName !== null && { indicatorTypeName: queryParams.value.indicatorTypeName }),
|
||||
...(queryParams.value.status !== undefined && queryParams.value.status !== null && { status: queryParams.value.status })
|
||||
};
|
||||
|
||||
|
||||
console.log('📋 发送查询请求,参数:', queryData);
|
||||
console.log('🔍 原始查询参数:', {
|
||||
indicatorTypeCode: `"${queryParams.value.indicatorTypeCode}"`,
|
||||
indicatorTypeName: `"${queryParams.value.indicatorTypeName}"`,
|
||||
status: `"${queryParams.value.status}"`
|
||||
});
|
||||
|
||||
|
||||
try {
|
||||
const res = await listAssessmentIndicatorType(queryData);
|
||||
console.log('📊 查询结果:', {
|
||||
@@ -227,7 +239,7 @@ const getList = async () => {
|
||||
dataCount: res.rows?.length,
|
||||
firstItem: res.rows?.[0]
|
||||
});
|
||||
|
||||
|
||||
assessmentIndicatorTypeList.value = res.rows;
|
||||
total.value = res.total;
|
||||
} catch (error) {
|
||||
@@ -253,23 +265,23 @@ const reset = () => {
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
console.log('🔄 重置查询参数');
|
||||
|
||||
|
||||
// 重置表单字段
|
||||
queryFormRef.value?.resetFields();
|
||||
|
||||
|
||||
// 手动重置查询参数对象,确保清空所有搜索条件
|
||||
queryParams.value.indicatorTypeCode = undefined;
|
||||
queryParams.value.indicatorTypeName = undefined;
|
||||
queryParams.value.status = undefined;
|
||||
queryParams.value.pageNum = 1;
|
||||
|
||||
|
||||
console.log('🔄 重置后的查询参数:', {
|
||||
indicatorTypeCode: queryParams.value.indicatorTypeCode,
|
||||
indicatorTypeName: queryParams.value.indicatorTypeName,
|
||||
status: queryParams.value.status,
|
||||
pageNum: queryParams.value.pageNum
|
||||
});
|
||||
|
||||
|
||||
// 重新查询
|
||||
getList();
|
||||
};
|
||||
@@ -349,7 +361,7 @@ onMounted(() => {
|
||||
pageNum: queryParams.value.pageNum,
|
||||
pageSize: queryParams.value.pageSize
|
||||
});
|
||||
|
||||
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -454,7 +454,7 @@ const submitForm = () => {
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: AssessmentPlanVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
|
||||
|
||||
let confirmMessage = '';
|
||||
if (row) {
|
||||
const semesterText = row.semester === '1' ? '上学期' : '下学期';
|
||||
@@ -462,7 +462,7 @@ const handleDelete = async (row?: AssessmentPlanVO) => {
|
||||
} else {
|
||||
confirmMessage = `是否确认删除选中的${ids.value.length}条考核计划?`;
|
||||
}
|
||||
|
||||
|
||||
await proxy?.$modal.confirm(confirmMessage).then(async () => {
|
||||
await delAssessmentPlan(_ids).then(() => {
|
||||
getList();
|
||||
|
||||
@@ -382,14 +382,14 @@ const submitForm = () => {
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: BmzrAssessmentSchemeVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
|
||||
|
||||
let confirmMessage = '';
|
||||
if (row) {
|
||||
confirmMessage = `是否确认删除考核方案"${row.schemeName}"(${row.academicYear}学年第${row.semester}学期)?`;
|
||||
} else {
|
||||
confirmMessage = `是否确认删除选中的${ids.value.length}条考核方案?`;
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
await proxy?.$modal.confirm(confirmMessage);
|
||||
await delBmzrAssessmentScheme(_ids);
|
||||
|
||||
@@ -95,14 +95,14 @@
|
||||
<!-- 未提交状态、草稿状态或审核不通过状态:显示提交考核按钮 -->
|
||||
<template v-if="!scope.row.submitted || scope.row.auditStatus === '9' || scope.row.auditStatus === '2'">
|
||||
<el-tooltip content="提交考核" placement="top">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="Edit"
|
||||
:disabled="loading || !isDataReady"
|
||||
@click="handleSubmitAssessment(scope.row)"
|
||||
v-hasPermi="['bzrkh:teacherAssessment:submit']"
|
||||
></el-button>
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="Edit"
|
||||
:disabled="loading || !isDataReady"
|
||||
@click="handleSubmitAssessment(scope.row)"
|
||||
v-hasPermi="['bzrkh:teacherAssessment:submit']"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
<!-- 待审核状态:显示查看考核和撤销按钮 -->
|
||||
@@ -155,7 +155,7 @@
|
||||
|
||||
<!-- 考核提交弹窗 -->
|
||||
<SubmitDialog ref="submitDialogRef" :plan-id="currentPlanId" :class-id="currentClassId" @success="handleSubmitSuccess" />
|
||||
|
||||
|
||||
<!-- 考核查看弹窗 -->
|
||||
<ViewDialog ref="viewDialogRef" :plan-id="currentPlanId" :class-id="currentClassId" />
|
||||
</div>
|
||||
@@ -241,13 +241,13 @@ const getTeacherClasses = async () => {
|
||||
queryParams.value.planName = undefined; // 确保搜索条件被重置
|
||||
queryParams.value.pageNum = 1;
|
||||
queryParams.value.classId = activeTab.value;
|
||||
|
||||
|
||||
console.log('🔄 初始化完成:', {
|
||||
activeTab: activeTab.value,
|
||||
classId: queryParams.value.classId,
|
||||
planName: queryParams.value.planName
|
||||
});
|
||||
|
||||
|
||||
// 等待activeTab设置完成后再获取列表
|
||||
await nextTick();
|
||||
await getList();
|
||||
@@ -270,9 +270,9 @@ const getList = async () => {
|
||||
teacherId: userStore.userId, // 确保包含teacherId
|
||||
planStatus: '1' // 确保包含planStatus
|
||||
};
|
||||
|
||||
|
||||
console.log('📋 查询参数:', queryData);
|
||||
|
||||
|
||||
const res = await listTeacherAssessmentPlans(queryData);
|
||||
console.log('📊 查询结果:', {
|
||||
total: res.total,
|
||||
@@ -280,7 +280,7 @@ const getList = async () => {
|
||||
firstItemStatus: res.rows?.[0]?.auditStatus,
|
||||
firstItemSubmitted: res.rows?.[0]?.submitted
|
||||
});
|
||||
|
||||
|
||||
assessmentPlanList.value = res.rows || [];
|
||||
total.value = res.total || 0;
|
||||
} catch (error) {
|
||||
@@ -298,18 +298,18 @@ const handleTabChange = async (tabName: string) => {
|
||||
activeTab: activeTab.value,
|
||||
oldPlanName: queryParams.value.planName
|
||||
});
|
||||
|
||||
|
||||
// 重置分页和搜索条件,设置新的班级ID
|
||||
queryParams.value.pageNum = 1;
|
||||
queryParams.value.planName = undefined; // 重置搜索条件,避免标签页间共享
|
||||
queryParams.value.classId = tabName;
|
||||
|
||||
|
||||
console.log('🔄 参数设置完成:', {
|
||||
classId: queryParams.value.classId,
|
||||
activeTab: activeTab.value,
|
||||
planName: queryParams.value.planName
|
||||
});
|
||||
|
||||
|
||||
// 等待参数设置完成后再查询
|
||||
await nextTick();
|
||||
getList();
|
||||
@@ -332,20 +332,20 @@ const handleQuery = () => {
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
console.log('🔄 开始重置查询参数');
|
||||
|
||||
|
||||
try {
|
||||
// 保存当前班级ID和计划状态(这些不应该被重置)
|
||||
const currentClassId = queryParams.value.classId;
|
||||
const currentPlanStatus = queryParams.value.planStatus;
|
||||
|
||||
|
||||
// 手动重置查询参数到初始状态
|
||||
queryParams.value.planName = undefined;
|
||||
queryParams.value.pageNum = 1;
|
||||
|
||||
|
||||
// 恢复不应该被重置的参数
|
||||
queryParams.value.classId = currentClassId;
|
||||
queryParams.value.planStatus = currentPlanStatus;
|
||||
|
||||
|
||||
console.log('🔄 重置后的查询参数:', {
|
||||
planName: queryParams.value.planName,
|
||||
pageNum: queryParams.value.pageNum,
|
||||
@@ -353,7 +353,7 @@ const resetQuery = () => {
|
||||
planStatus: queryParams.value.planStatus,
|
||||
teacherId: userStore.userId
|
||||
});
|
||||
|
||||
|
||||
// 等待DOM更新完成后再刷新数据
|
||||
nextTick(() => {
|
||||
console.log('🔄 开始强制刷新数据');
|
||||
@@ -367,8 +367,6 @@ const resetQuery = () => {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
/** 排序触发事件 */
|
||||
const sortChange = (column: any) => {
|
||||
const { prop, order } = column;
|
||||
|
||||
@@ -192,7 +192,7 @@
|
||||
<span>特色工作(加20分)</span>
|
||||
</div>
|
||||
</template>
|
||||
<el-form :model="specialWorkForm" class="special-work-form">
|
||||
<el-form :model="specialWorkForm" class="special-work-form">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="及时并妥善处理好学生违纪事件" label-width="240px" class="no-wrap-label">
|
||||
@@ -210,7 +210,15 @@
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="自评意见" label-width="80px">
|
||||
<el-input v-model="specialWorkForm.comment1" type="textarea" :rows="1" placeholder="请输入自评意见" maxlength="200" show-word-limit class="special-comment-input" />
|
||||
<el-input
|
||||
v-model="specialWorkForm.comment1"
|
||||
type="textarea"
|
||||
:rows="1"
|
||||
placeholder="请输入自评意见"
|
||||
maxlength="200"
|
||||
show-word-limit
|
||||
class="special-comment-input"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -231,7 +239,15 @@
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="自评意见" label-width="80px">
|
||||
<el-input v-model="specialWorkForm.comment2" type="textarea" :rows="1" placeholder="请输入自评意见" maxlength="200" show-word-limit class="special-comment-input" />
|
||||
<el-input
|
||||
v-model="specialWorkForm.comment2"
|
||||
type="textarea"
|
||||
:rows="1"
|
||||
placeholder="请输入自评意见"
|
||||
maxlength="200"
|
||||
show-word-limit
|
||||
class="special-comment-input"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -252,7 +268,15 @@
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="自评意见" label-width="80px">
|
||||
<el-input v-model="specialWorkForm.comment3" type="textarea" :rows="1" placeholder="请输入自评意见" maxlength="200" show-word-limit class="special-comment-input" />
|
||||
<el-input
|
||||
v-model="specialWorkForm.comment3"
|
||||
type="textarea"
|
||||
:rows="1"
|
||||
placeholder="请输入自评意见"
|
||||
maxlength="200"
|
||||
show-word-limit
|
||||
class="special-comment-input"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -273,15 +297,23 @@
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="自评意见" label-width="80px">
|
||||
<el-input v-model="specialWorkForm.comment4" type="textarea" :rows="1" placeholder="请输入自评意见" maxlength="200" show-word-limit class="special-comment-input" />
|
||||
<el-input
|
||||
v-model="specialWorkForm.comment4"
|
||||
type="textarea"
|
||||
:rows="1"
|
||||
placeholder="请输入自评意见"
|
||||
maxlength="200"
|
||||
show-word-limit
|
||||
class="special-comment-input"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="总分值" label-width="240px">
|
||||
<el-input :value="specialWorkForm.totalScore?.toFixed(2) || '0.00'" readonly style="width: 150px; text-align: center" />
|
||||
</el-form-item>
|
||||
<el-input :value="specialWorkForm.totalScore?.toFixed(2) || '0.00'" readonly style="width: 150px; text-align: center" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
@@ -323,7 +355,9 @@
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button :loading="saveLoading" type="primary" @click="handleSubmit">保存</el-button>
|
||||
<el-button :loading="submitLoading" type="success" @click="handleSubmitForApproval" v-hasPermi="['bzrkh:teacherAssessment:submit']">提交</el-button>
|
||||
<el-button :loading="submitLoading" type="success" @click="handleSubmitForApproval" v-hasPermi="['bzrkh:teacherAssessment:submit']"
|
||||
>提交</el-button
|
||||
>
|
||||
<el-button @click="handleClose">取消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
@@ -560,7 +594,7 @@ const calculateMonthlyScore = () => {
|
||||
|
||||
// 检查是否有实际评分数据(避免空白状态显示50分)
|
||||
const hasAnyScore = routineWorkTotal > 0 || deductionHalf > 0 || specialWorkTotal > 0;
|
||||
|
||||
|
||||
if (!hasAnyScore || totalCoefficient === 0) {
|
||||
return 0; // 没有评分数据时显示0
|
||||
}
|
||||
@@ -569,7 +603,7 @@ const calculateMonthlyScore = () => {
|
||||
const classDeductionMaxScore = 50;
|
||||
|
||||
// 修正后的考核得分公式 = 总系数(K)* ((班主任常规工作自评分之和 + 班级扣分项满分值) - 按班级扣分50%计的分值 + 特色工作总分值)
|
||||
return totalCoefficient * ((routineWorkTotal + classDeductionMaxScore) - deductionHalf + specialWorkTotal);
|
||||
return totalCoefficient * (routineWorkTotal + classDeductionMaxScore - deductionHalf + specialWorkTotal);
|
||||
};
|
||||
|
||||
/** 打开弹窗 */
|
||||
@@ -1071,7 +1105,7 @@ defineExpose({
|
||||
font-weight: 400;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
||||
/* 覆盖small尺寸的字体大小,与特色工作输入框保持一致 */
|
||||
.el-input-number--small.score-input .el-input-number__input {
|
||||
font-size: 14px !important;
|
||||
|
||||
@@ -55,9 +55,7 @@
|
||||
</template>
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="班级总人数">{{ getCurrentClassDetail()?.totalStudentCount || 0 }}人</el-descriptions-item>
|
||||
<el-descriptions-item label="人数系数">{{
|
||||
formatNumber(getCurrentCoefficient()?.studentCountCoefficient, 3)
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="人数系数">{{ formatNumber(getCurrentCoefficient()?.studentCountCoefficient, 3) }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
</el-col>
|
||||
@@ -70,9 +68,7 @@
|
||||
</template>
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="住校生人数">{{ getCurrentClassDetail()?.boardingStudentCount || 0 }}人</el-descriptions-item>
|
||||
<el-descriptions-item label="住校生系数">{{
|
||||
formatNumber(getCurrentCoefficient()?.boardingCoefficient, 3)
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="住校生系数">{{ formatNumber(getCurrentCoefficient()?.boardingCoefficient, 3) }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
</el-col>
|
||||
@@ -165,10 +161,10 @@
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="上级评分">
|
||||
<el-input
|
||||
:value="approvalManagementEffectivenessData.superiorScore?.toFixed(2) || '-'"
|
||||
readonly
|
||||
style="width: 100%; text-align: center"
|
||||
<el-input
|
||||
:value="approvalManagementEffectivenessData.superiorScore?.toFixed(2) || '-'"
|
||||
readonly
|
||||
style="width: 100%; text-align: center"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -176,12 +172,12 @@
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="自评意见">
|
||||
<el-input :value="approvalManagementEffectivenessData.selfComment" readonly style="height: 24px;" />
|
||||
<el-input :value="approvalManagementEffectivenessData.selfComment" readonly style="height: 24px" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="审批意见">
|
||||
<el-input :value="approvalManagementEffectivenessData.superiorComment" readonly style="height: 24px;" />
|
||||
<el-input :value="approvalManagementEffectivenessData.superiorComment" readonly style="height: 24px" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -280,17 +276,17 @@
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="考核得分">
|
||||
<el-input :value="calculateMonthlyScore().toFixed(2)" readonly style="width: 100%; text-align: center; height: 24px;" />
|
||||
<el-input :value="calculateMonthlyScore().toFixed(2)" readonly style="width: 100%; text-align: center; height: 24px" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="自我总体评价">
|
||||
<el-input :value="approvalMonthlyScoreData.selfOverallComment" readonly style="height: 24px;" />
|
||||
<el-input :value="approvalMonthlyScoreData.selfOverallComment" readonly style="height: 24px" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="上级总体评价">
|
||||
<el-input :value="approvalMonthlyScoreData.superiorOverallComment" readonly style="height: 24px;" />
|
||||
<el-input :value="approvalMonthlyScoreData.superiorOverallComment" readonly style="height: 24px" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -307,15 +303,13 @@
|
||||
</template>
|
||||
<el-descriptions :column="3" border>
|
||||
<el-descriptions-item label="评价等级">
|
||||
<div style="display: flex; align-items: center; gap: 8px;">
|
||||
<div style="display: flex; align-items: center; gap: 8px">
|
||||
<dict-tag :options="getEvaluationLevelOptions()" :value="calculateEvaluationLevel()" />
|
||||
<el-tooltip placement="top">
|
||||
<template #content>
|
||||
<div>
|
||||
<div>{{ evaluationStats ? '基于占比规则的精准评级' : '基于分数阈值的简化评级' }}</div>
|
||||
<div v-if="isDictDataMissing" style="color: #f56c6c; margin-top: 4px;">
|
||||
⚠️ 字典数据缺失,使用默认数据
|
||||
</div>
|
||||
<div v-if="isDictDataMissing" style="color: #f56c6c; margin-top: 4px">⚠️ 字典数据缺失,使用默认数据</div>
|
||||
</div>
|
||||
</template>
|
||||
<el-icon :color="evaluationStats ? '#67c23a' : '#e6a23c'" size="16">
|
||||
@@ -325,16 +319,14 @@
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="考核得分">
|
||||
{{ calculateMonthlyScore().toFixed(2) }}分
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="考核得分"> {{ calculateMonthlyScore().toFixed(2) }}分 </el-descriptions-item>
|
||||
<el-descriptions-item label="审批时间">
|
||||
{{ parseTime(approvalDetail?.submitTime, '{y}-{m}-{d} {h}:{i}:{s}') || '-' }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-form label-width="100px" style="margin-top: 20px" v-if="approvalMonthlyScoreData.superiorOverallComment">
|
||||
<el-form-item label="审批意见">
|
||||
<el-input :value="approvalMonthlyScoreData.superiorOverallComment" readonly style="height: 24px;" />
|
||||
<el-input :value="approvalMonthlyScoreData.superiorOverallComment" readonly style="height: 24px" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
@@ -434,11 +426,7 @@
|
||||
import { InfoFilled, WarningFilled } from '@element-plus/icons-vue';
|
||||
import { getAssessmentSubmitDetail, getClassStudentRecords } from '@/api/bzrkh/teacherAssessment';
|
||||
import { getAssessmentApprovalDetail, getEvaluationLevelStats } from '@/api/bzrkh/assessmentApproval';
|
||||
import {
|
||||
AssessmentDetailVO,
|
||||
AssessmentIndicatorVO,
|
||||
ClassStudentRecordsVO
|
||||
} from '@/api/bzrkh/teacherAssessment/types';
|
||||
import { AssessmentDetailVO, AssessmentIndicatorVO, ClassStudentRecordsVO } from '@/api/bzrkh/teacherAssessment/types';
|
||||
import {
|
||||
AssessmentApprovalDetailVO,
|
||||
AssessmentApprovalIndicatorVO,
|
||||
@@ -471,9 +459,10 @@ const getEvaluationLevelOptions = (): DictDataOption[] => {
|
||||
console.log('✅ 使用数据库字典数据:', bmzr_evaluation_level.value);
|
||||
return bmzr_evaluation_level.value;
|
||||
}
|
||||
|
||||
|
||||
// 字典数据未加载或为空时的处理
|
||||
if (visible.value) { // 只在弹窗打开时输出警告
|
||||
if (visible.value) {
|
||||
// 只在弹窗打开时输出警告
|
||||
console.warn('⚠️ 字典数据为空,使用备用数据,当前状态:', {
|
||||
弹窗是否打开: visible.value,
|
||||
字典对象存在: !!bmzr_evaluation_level.value,
|
||||
@@ -482,7 +471,7 @@ const getEvaluationLevelOptions = (): DictDataOption[] => {
|
||||
字典数据内容: bmzr_evaluation_level.value
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
return fallbackEvaluationLevelOptions.value;
|
||||
};
|
||||
|
||||
@@ -511,10 +500,10 @@ const isDictLoaded = ref(false);
|
||||
const isDictDataMissing = computed(() => {
|
||||
// 如果还没有尝试加载字典数据,不显示警告
|
||||
if (!visible.value) return false;
|
||||
|
||||
|
||||
// 如果字典数据已经加载成功,不显示警告
|
||||
if (isDictLoaded.value) return false;
|
||||
|
||||
|
||||
// 只有在弹窗打开且字典数据为空时才显示警告
|
||||
return !bmzr_evaluation_level.value || bmzr_evaluation_level.value.length === 0;
|
||||
});
|
||||
@@ -556,16 +545,16 @@ const specialWorkForm = reactive({
|
||||
totalScore: 0
|
||||
});
|
||||
|
||||
// 考核得分表单(只读)
|
||||
const monthlyScoreForm = reactive({
|
||||
overallComment: ''
|
||||
});
|
||||
// 考核得分表单(只读)
|
||||
const monthlyScoreForm = reactive({
|
||||
overallComment: ''
|
||||
});
|
||||
|
||||
// 审批模式下的考核得分数据
|
||||
const approvalMonthlyScoreData = reactive({
|
||||
selfOverallComment: '',
|
||||
superiorOverallComment: ''
|
||||
});
|
||||
// 审批模式下的考核得分数据
|
||||
const approvalMonthlyScoreData = reactive({
|
||||
selfOverallComment: '',
|
||||
superiorOverallComment: ''
|
||||
});
|
||||
|
||||
// 学生违纪记录和奖励记录弹窗相关
|
||||
const studentRecordsVisible = ref(false);
|
||||
@@ -666,7 +655,7 @@ const calculateMonthlyScore = () => {
|
||||
|
||||
// 检查是否有实际评分数据(避免空白状态显示50分)
|
||||
const hasAnyScore = routineWorkTotal > 0 || deductionHalf > 0 || specialWorkTotal > 0;
|
||||
|
||||
|
||||
if (!hasAnyScore || totalCoefficient === 0) {
|
||||
return 0; // 没有评分数据时显示0
|
||||
}
|
||||
@@ -675,7 +664,7 @@ const calculateMonthlyScore = () => {
|
||||
const classDeductionMaxScore = 50;
|
||||
|
||||
// 修正后的考核得分公式 = 总系数(K)* ((班主任常规工作自评分之和 + 班级扣分项满分值) - 按班级扣分50%计的分值 + 特色工作总分值)
|
||||
return totalCoefficient * ((routineWorkTotal + classDeductionMaxScore) - deductionHalf + specialWorkTotal);
|
||||
return totalCoefficient * (routineWorkTotal + classDeductionMaxScore - deductionHalf + specialWorkTotal);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -685,7 +674,7 @@ const calculateEvaluationLevel = () => {
|
||||
console.log('=== 📊 评价等级计算调试 ===');
|
||||
console.log('💯 考核得分:', score);
|
||||
console.log('📈 是否有统计数据:', !!evaluationStats.value);
|
||||
|
||||
|
||||
if (evaluationStats.value) {
|
||||
console.log('📊 统计数据详情:', {
|
||||
总教师数: evaluationStats.value.totalTeachers,
|
||||
@@ -694,14 +683,12 @@ const calculateEvaluationLevel = () => {
|
||||
及格分数: evaluationStats.value.evaluationLevelRules?.passScore
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
let level = '';
|
||||
let calculationMethod = '';
|
||||
|
||||
|
||||
// 如果有统计数据,使用严格的占比规则
|
||||
if (evaluationStats.value &&
|
||||
evaluationStats.value.totalTeachers > 0 &&
|
||||
evaluationStats.value.scoreRankings.length > 0) {
|
||||
if (evaluationStats.value && evaluationStats.value.totalTeachers > 0 && evaluationStats.value.scoreRankings.length > 0) {
|
||||
level = calculateEvaluationLevelByStats(score);
|
||||
calculationMethod = '📈 严格占比规则评级';
|
||||
} else {
|
||||
@@ -714,16 +701,16 @@ const calculateEvaluationLevel = () => {
|
||||
level = 'B'; // B等(合格):60-85分
|
||||
}
|
||||
calculationMethod = '🔢 简化分数评级';
|
||||
|
||||
|
||||
// 输出使用简化评级的原因
|
||||
const reasons = [];
|
||||
if (!evaluationStats.value) reasons.push('统计数据为空');
|
||||
if (evaluationStats.value?.totalTeachers === 0) reasons.push('总教师数为0');
|
||||
if (evaluationStats.value?.scoreRankings?.length === 0) reasons.push('排名数据为空');
|
||||
|
||||
|
||||
console.warn('⚠️ 使用简化评级的原因:', reasons.join('、'));
|
||||
}
|
||||
|
||||
|
||||
console.log('🎯 计算方法:', calculationMethod);
|
||||
console.log('📋 最终评价等级:', level);
|
||||
console.log('=== 📊 评价等级计算调试结束 ===');
|
||||
@@ -735,30 +722,30 @@ const calculateEvaluationLevelByStats = (score: number) => {
|
||||
const stats = evaluationStats.value;
|
||||
if (!stats) {
|
||||
console.warn('统计数据不可用,使用简单评级');
|
||||
return score < 60 ? 'C' : (score >= 85 ? 'A' : 'B');
|
||||
return score < 60 ? 'C' : score >= 85 ? 'A' : 'B';
|
||||
}
|
||||
|
||||
|
||||
const { totalTeachers, scoreRankings, evaluationLevelRules } = stats;
|
||||
const { aLevelMaxPercentage, passScore } = evaluationLevelRules;
|
||||
|
||||
|
||||
// C等:不及格
|
||||
if (score < passScore) {
|
||||
return 'C';
|
||||
}
|
||||
|
||||
|
||||
// 查找当前分数的排名
|
||||
const currentRanking = scoreRankings.find(item => item.score === score);
|
||||
|
||||
const currentRanking = scoreRankings.find((item) => item.score === score);
|
||||
|
||||
if (!currentRanking) {
|
||||
console.warn('找不到当前分数的排名信息,使用简单评级');
|
||||
return score < 60 ? 'C' : (score >= 85 ? 'A' : 'B');
|
||||
return score < 60 ? 'C' : score >= 85 ? 'A' : 'B';
|
||||
}
|
||||
|
||||
|
||||
// A等:及格且排名在前20%内
|
||||
if (score >= passScore && currentRanking.percentage <= aLevelMaxPercentage) {
|
||||
return 'A';
|
||||
}
|
||||
|
||||
|
||||
// B等:其余及格的
|
||||
return 'B';
|
||||
};
|
||||
@@ -783,7 +770,7 @@ const open = async (auditStatus?: string) => {
|
||||
routineWorkScores.value = [];
|
||||
approvalRoutineWorkScores.value = [];
|
||||
approvalSpecialWorkScores.value = [];
|
||||
|
||||
|
||||
Object.assign(managementEffectivenessForm, {
|
||||
classDeduction: 0,
|
||||
classDeductionHalf: 0,
|
||||
@@ -816,7 +803,7 @@ const open = async (auditStatus?: string) => {
|
||||
});
|
||||
|
||||
visible.value = true;
|
||||
|
||||
|
||||
// 检查字典数据加载状态
|
||||
console.log('🔍 打开弹窗时字典数据状态:', {
|
||||
字典对象存在: !!bmzr_evaluation_level.value,
|
||||
@@ -824,21 +811,21 @@ const open = async (auditStatus?: string) => {
|
||||
字典加载状态: isDictLoaded.value,
|
||||
字典数据内容: bmzr_evaluation_level.value
|
||||
});
|
||||
|
||||
|
||||
// 等待字典数据加载完成(最多等待2秒)
|
||||
let waitCount = 0;
|
||||
while ((!bmzr_evaluation_level.value || bmzr_evaluation_level.value.length === 0) && waitCount < 20) {
|
||||
await new Promise(resolve => setTimeout(resolve, 100));
|
||||
await new Promise((resolve) => setTimeout(resolve, 100));
|
||||
waitCount++;
|
||||
}
|
||||
|
||||
|
||||
if (bmzr_evaluation_level.value && bmzr_evaluation_level.value.length > 0) {
|
||||
console.log('✅ 字典数据加载完成:', bmzr_evaluation_level.value);
|
||||
isDictLoaded.value = true;
|
||||
} else {
|
||||
console.warn('⚠️ 字典数据加载超时,使用备用数据');
|
||||
}
|
||||
|
||||
|
||||
// 根据显示模式加载不同的数据
|
||||
if (viewMode.value === 'approval') {
|
||||
await loadApprovalDetail();
|
||||
@@ -854,7 +841,7 @@ const loadApprovalDetail = async () => {
|
||||
// 从userStore获取当前用户ID作为被评价用户ID
|
||||
const userStore = useUserStore();
|
||||
const evaluatedUserId = userStore.userId;
|
||||
|
||||
|
||||
if (!evaluatedUserId) {
|
||||
proxy?.$modal.msgError('获取用户信息失败');
|
||||
return;
|
||||
@@ -925,7 +912,6 @@ const loadApprovalDetail = async () => {
|
||||
}
|
||||
|
||||
console.log('=== 审批详情数据加载完成 ===');
|
||||
|
||||
} catch (error) {
|
||||
console.error('加载审批详情失败:', error);
|
||||
proxy?.$modal.msgError('加载审批详情失败,请检查网络连接或刷新页面重试');
|
||||
@@ -981,7 +967,7 @@ const loadAssessmentDetail = async () => {
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// 计算特色工作总分
|
||||
specialWorkForm.totalScore =
|
||||
(specialWorkForm.score1 || 0) + (specialWorkForm.score2 || 0) + (specialWorkForm.score3 || 0) + (specialWorkForm.score4 || 0);
|
||||
@@ -1033,8 +1019,8 @@ const handleClose = () => {
|
||||
approvalRoutineWorkScores.value = [];
|
||||
approvalSpecialWorkScores.value = [];
|
||||
evaluationStats.value = undefined;
|
||||
isDictLoaded.value = false; // 重置字典加载状态
|
||||
|
||||
isDictLoaded.value = false; // 重置字典加载状态
|
||||
|
||||
Object.assign(managementEffectivenessForm, {
|
||||
classDeduction: 0,
|
||||
classDeductionHalf: 0,
|
||||
@@ -1128,13 +1114,13 @@ defineExpose({
|
||||
.total-score {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #409EFF;
|
||||
color: #409eff;
|
||||
}
|
||||
|
||||
.monthly-score {
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
color: #67C23A;
|
||||
color: #67c23a;
|
||||
}
|
||||
|
||||
/* 表格样式 */
|
||||
@@ -1183,7 +1169,7 @@ defineExpose({
|
||||
max-height: 150px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
|
||||
.el-table__row {
|
||||
height: auto;
|
||||
}
|
||||
@@ -1280,4 +1266,4 @@ defineExpose({
|
||||
padding: 16px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
+194
-36
@@ -1,55 +1,213 @@
|
||||
# 财务管理模块 - 前端界面
|
||||
# 财务管理模块 (CW) - 项目申报审批功能
|
||||
|
||||
## 📋 模块说明
|
||||
## 🎯 功能概述
|
||||
|
||||
- **模块名称**: 财务管理 (Financial Management)
|
||||
- **模块简称**: cw
|
||||
- **对应后端**: backend/ruoyi-modules/ruoyi-cw/
|
||||
本次开发实现了项目申报管理模块的审批流程变更,从固定的三级审批改为支持用户自定义的灵活审批流程。
|
||||
|
||||
## 📁 目录结构
|
||||
|
||||
此目录用于存放财务管理模块的所有前端界面组件,包括:
|
||||
```
|
||||
web/src/views/cw/
|
||||
├── projectAuditor/ # 项目审批人配置模块
|
||||
│ ├── index.vue # 审批人配置主页面
|
||||
│ └── README.md # 功能说明文档
|
||||
├── projectApproval/ # 项目审批模块
|
||||
│ ├── index.vue # 审批流程管理页面(待实现)
|
||||
│ ├── pending.vue # 我的待审批页面
|
||||
│ ├── components/
|
||||
│ │ └── ApprovalProcessSelector.vue # 审批流程选择组件
|
||||
│ └── README.md # 功能说明文档(待创建)
|
||||
├── application/ # 项目申报模块(已修改)
|
||||
│ ├── form.vue # 申报表单(已集成审批流程选择)
|
||||
│ └── ... # 其他文件保持不变
|
||||
└── README.md # 总体说明文档(本文件)
|
||||
```
|
||||
|
||||
### 💰 会计核算
|
||||
```
|
||||
web/src/api/cw/
|
||||
├── projectAuditor.ts # 审批人配置API
|
||||
├── projectApproval.ts # 项目审批API
|
||||
└── types.ts # TypeScript类型定义(已扩展)
|
||||
```
|
||||
|
||||
- 科目管理
|
||||
- 凭证管理
|
||||
- 账簿管理
|
||||
## 🚀 核心功能
|
||||
|
||||
### 📊 预算管理
|
||||
### 1. 项目审批人配置管理 (`projectAuditor/`)
|
||||
|
||||
- 预算编制
|
||||
- 预算执行
|
||||
- 预算分析
|
||||
- **审批人池管理**: 从系统用户中选择并配置审批人员
|
||||
- **批量添加**: 通过部门树选择用户,支持批量添加审批人
|
||||
- **跨部门选择**: 支持在不同部门间选择用户,选择状态会自动保持
|
||||
- **信息维护**: 修改审批人联系信息、状态管理
|
||||
- **权限控制**: 基于RBAC的细粒度权限控制
|
||||
|
||||
### 💳 资产管理
|
||||
### 2. 项目审批流程管理 (`projectApproval/`)
|
||||
|
||||
- 固定资产
|
||||
- 流动资产
|
||||
- 资产盘点
|
||||
- **流程监控**: 查看所有审批流程状态和进度(待实现)
|
||||
- **流程详情**: 查看审批记录和时间轴展示(待实现)
|
||||
- **流程终止**: 管理员可终止进行中的审批流程(待实现)
|
||||
|
||||
### 📈 财务报表
|
||||
### 3. 我的待审批 (`projectApproval/pending.vue`)
|
||||
|
||||
- 资产负债表
|
||||
- 损益表
|
||||
- 现金流量表
|
||||
- **待审批列表**: 显示当前用户需要审批的项目
|
||||
- **项目详情**: 查看项目完整信息和审批历史
|
||||
- **审批操作**: 支持通过/拒绝,必填审批意见
|
||||
- **批量审批**: 支持批量通过或拒绝多个项目(待实现)
|
||||
|
||||
### 💸 费用管理
|
||||
### 4. 审批流程选择组件 (`components/ApprovalProcessSelector.vue`)
|
||||
|
||||
- 费用申请
|
||||
- 费用审批
|
||||
- 费用报销
|
||||
- **自定义流程配置**: 支持用户从审批人池中选择审核人
|
||||
- **可视化流程预览**: 直观展示审批顺序和流程走向
|
||||
- **审核人管理**: 支持添加、删除、排序审核人
|
||||
- **流程验证**: 验证审批流程的合理性和完整性
|
||||
|
||||
## 🎯 开发规范
|
||||
### 5. 项目申报集成 (`application/form.vue` - 已修改)
|
||||
|
||||
- 遵循Vue 3 + TypeScript + Element Plus开发规范
|
||||
- 组件命名采用PascalCase
|
||||
- 文件命名采用kebab-case
|
||||
- 统一使用Composition API
|
||||
- **流程选择对话框**: 在提交时弹出审批流程选择界面
|
||||
- **数据保存**: 先保存申报数据,再配置审批流程
|
||||
- **流程启动**: 自动启动配置的审批流程
|
||||
- **用户体验**: 平滑的提交流程,清晰的操作提示
|
||||
|
||||
## 📝 注意事项
|
||||
## 📋 实现特色
|
||||
|
||||
- 新增页面需要配置对应的路由
|
||||
- API接口统一调用@/api/cw/目录下的接口
|
||||
- 权限控制使用v-hasPermi指令,权限编码格式:cw:功能:操作
|
||||
- 财务数据需要特别注意精度和安全性
|
||||
### 🔧 技术特色
|
||||
|
||||
1. **Vue 3.5.13 Composition API**: 使用最新的组合式API,代码结构清晰
|
||||
2. **TypeScript支持**: 完整的类型定义,提供良好的开发体验
|
||||
3. **Element Plus UI**: 统一的UI组件库,符合后勤管理模块设计规范
|
||||
4. **响应式设计**: 支持移动端和桌面端,适配不同屏幕尺寸
|
||||
5. **组件化开发**: 高度复用的组件设计,易于维护和扩展
|
||||
|
||||
### 🎨 用户体验特色
|
||||
|
||||
1. **跨部门选择**: 审批人选择支持在多个部门间切换,保持选择状态
|
||||
2. **可视化流程**: 审批流程以图形化方式展示,直观易懂
|
||||
3. **实时验证**: 表单验证和流程验证,及时提供反馈
|
||||
4. **操作引导**: 清晰的操作提示和帮助信息
|
||||
5. **状态恢复**: 切换部门后自动恢复之前的选择状态
|
||||
|
||||
### 🚀 性能特色
|
||||
|
||||
1. **按需加载**: 组件和API按需加载,优化性能
|
||||
2. **智能缓存**: 合理的数据缓存策略,减少重复请求
|
||||
3. **批量操作**: 支持批量添加、删除等操作,提升效率
|
||||
4. **异步处理**: 异步API调用,不阻塞用户界面
|
||||
|
||||
## 🔄 核心流程
|
||||
|
||||
### 审批人配置流程
|
||||
|
||||
```
|
||||
管理员登录 → 进入审批人配置 → 选择部门 → 批量选择用户 → 确认添加 → 配置完成
|
||||
```
|
||||
|
||||
### 项目申报审批流程
|
||||
|
||||
```
|
||||
填写申报信息 → 点击提交 → 选择审批流程 → 配置审核人 → 确认提交 → 流程启动
|
||||
```
|
||||
|
||||
### 审批执行流程
|
||||
|
||||
```
|
||||
审核人收到通知 → 查看待审批列表 → 查看项目详情 → 执行审批操作 → 填写意见 → 提交审批
|
||||
```
|
||||
|
||||
## 🛠️ 后端支持
|
||||
|
||||
### 数据库设计
|
||||
|
||||
1. **cw_project_auditor**: 项目审核人配置表
|
||||
2. **cw_project_approval_process**: 项目审批流程表
|
||||
3. **cw_approval_record**: 审批记录表(已扩展支持自定义流程)
|
||||
|
||||
### API接口
|
||||
|
||||
1. **审核人配置**: 16个标准API接口(CRUD + 业务功能 + 辅助功能)
|
||||
2. **审批流程**: 10个核心API接口(流程管理 + 审批执行)
|
||||
3. **权限控制**: 基于Sa-Token的权限管理
|
||||
|
||||
### 数据安全
|
||||
|
||||
1. **多租户隔离**: 严格的数据隔离机制
|
||||
2. **权限控制**: 细粒度的功能权限控制
|
||||
3. **操作日志**: 完整的操作记录和审计
|
||||
|
||||
## 📊 技术规范
|
||||
|
||||
### 前端规范
|
||||
|
||||
- **组件命名**: PascalCase,清晰的语义化命名
|
||||
- **文件组织**: 按功能模块组织,层次分明
|
||||
- **样式管理**: Scoped CSS,避免样式冲突
|
||||
- **状态管理**: Reactive响应式状态,简洁高效
|
||||
|
||||
### 后端规范
|
||||
|
||||
- **接口设计**: RESTful风格,统一响应格式
|
||||
- **数据验证**: Bean Validation参数校验
|
||||
- **异常处理**: 统一的异常处理机制
|
||||
- **事务管理**: 合理的事务边界控制
|
||||
|
||||
### 代码质量
|
||||
|
||||
- **TypeScript**: 完整的类型检查
|
||||
- **ESLint**: 代码风格检查
|
||||
- **Prettier**: 代码格式化
|
||||
- **单元测试**: 核心逻辑单元测试(待实现)
|
||||
|
||||
## 🎯 后续优化
|
||||
|
||||
### 功能扩展
|
||||
|
||||
1. **审批流程管理页面**: 完整的流程监控和管理界面
|
||||
2. **批量审批功能**: 支持批量处理多个项目
|
||||
3. **审批历史查询**: 完整的审批记录查询功能
|
||||
4. **移动端支持**: 基于uni-app的移动端审批应用
|
||||
|
||||
### 性能优化
|
||||
|
||||
1. **虚拟滚动**: 大数据量列表的性能优化
|
||||
2. **缓存策略**: 更智能的数据缓存机制
|
||||
3. **懒加载**: 按需加载组件和数据
|
||||
4. **CDN集成**: 静态资源CDN加速
|
||||
|
||||
### 用户体验
|
||||
|
||||
1. **快捷操作**: 键盘快捷键支持
|
||||
2. **拖拽排序**: 审核人拖拽排序功能
|
||||
3. **消息通知**: 实时消息推送
|
||||
4. **离线支持**: PWA离线功能支持
|
||||
|
||||
## 🚀 部署说明
|
||||
|
||||
### 开发环境
|
||||
|
||||
1. 确保Node.js 20.15.x+,npm 10.7.x+
|
||||
2. 安装依赖:`npm install`
|
||||
3. 启动开发服务器:`npm run dev`
|
||||
4. 访问:http://localhost
|
||||
|
||||
### 生产环境
|
||||
|
||||
1. 构建项目:`npm run build`
|
||||
2. 部署到Nginx或其他Web服务器
|
||||
3. 配置反向代理到后端API
|
||||
4. 确保数据库脚本已执行
|
||||
|
||||
### 数据库部署
|
||||
|
||||
1. 执行数据库脚本:`docs/数据库修复脚本.sql`
|
||||
2. 配置权限菜单和角色权限
|
||||
3. 创建测试用户和审核人数据
|
||||
|
||||
## 📞 技术支持
|
||||
|
||||
如有任何技术问题或建议,请联系开发团队。
|
||||
|
||||
---
|
||||
|
||||
**🎯 目标达成**: 成功实现了从固定三级审批到灵活自定义审批流程的完整改造,提供了良好的用户体验和技术架构!
|
||||
|
||||
**📝 维护日期**: 2025-01-03
|
||||
**📁 文件**: 完整的前后端实现 + 数据库脚本 + API文档
|
||||
**🔄 状态**: 核心功能完成,待进一步测试和优化
|
||||
@@ -215,53 +215,56 @@
|
||||
<el-col :span="6">
|
||||
<el-form-item label="项目总投资" prop="totalInvestment">
|
||||
<el-input-number
|
||||
v-model="form.totalInvestment"
|
||||
:model-value="totalInvestmentCalculated"
|
||||
:precision="2"
|
||||
:min="0"
|
||||
:max="99999999"
|
||||
placeholder="万元"
|
||||
size="large"
|
||||
style="width: 100%"
|
||||
@change="calculateTotalInvestment"
|
||||
:disabled="true"
|
||||
readonly
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="市财政资金" prop="totalMunicipalFiscal">
|
||||
<el-input-number
|
||||
v-model="form.totalMunicipalFiscal"
|
||||
:model-value="totalMunicipalFiscalCalculated"
|
||||
:precision="2"
|
||||
:min="0"
|
||||
placeholder="万元"
|
||||
size="large"
|
||||
style="width: 100%"
|
||||
@change="calculateTotalInvestment"
|
||||
disabled="true"
|
||||
readonly
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="单位自筹" prop="totalSelfFunding">
|
||||
<el-input-number
|
||||
v-model="form.totalSelfFunding"
|
||||
:model-value="totalSelfFundingCalculated"
|
||||
:precision="2"
|
||||
:min="0"
|
||||
placeholder="万元"
|
||||
size="large"
|
||||
style="width: 100%"
|
||||
@change="calculateTotalInvestment"
|
||||
disabled="true"
|
||||
readonly
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="其他资金" prop="totalOtherFunding">
|
||||
<el-input-number
|
||||
v-model="form.totalOtherFunding"
|
||||
:model-value="totalOtherFundingCalculated"
|
||||
:precision="2"
|
||||
:min="0"
|
||||
placeholder="万元"
|
||||
size="large"
|
||||
style="width: 100%"
|
||||
@change="calculateTotalInvestment"
|
||||
disabled="true"
|
||||
readonly
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -480,17 +483,59 @@
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<!-- 审批流程选择对话框 -->
|
||||
<el-dialog
|
||||
title="选择审批流程"
|
||||
v-model="approvalDialog.visible"
|
||||
width="70%"
|
||||
append-to-body
|
||||
destroy-on-close
|
||||
:close-on-click-modal="false"
|
||||
:close-on-press-escape="false"
|
||||
>
|
||||
<div class="approval-dialog-content">
|
||||
<el-alert
|
||||
title="请选择审批流程"
|
||||
description="项目申报提交后将按照您选择的审批流程进行审批,请仔细选择审核人员。"
|
||||
type="info"
|
||||
:closable="false"
|
||||
show-icon
|
||||
style="margin-bottom: 20px"
|
||||
/>
|
||||
|
||||
<ApprovalProcessSelector ref="approvalProcessRef" v-model="approvalDialog.selectedAuditors" @change="handleApprovalProcessChange" />
|
||||
</div>
|
||||
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="cancelApprovalSubmit">取消</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="confirmApprovalSubmit"
|
||||
:loading="approvalDialog.submitting"
|
||||
:disabled="approvalDialog.selectedAuditors.length === 0"
|
||||
>
|
||||
<el-icon><Check /></el-icon>
|
||||
确认提交 ({{ approvalDialog.selectedAuditors.length }} 个审核人)
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, computed, onMounted, nextTick, watch } from 'vue';
|
||||
import { useRouter, useRoute } from 'vue-router';
|
||||
import { useUserStore } from '@/store/modules/user';
|
||||
import { ElMessage, ElMessageBox, FormInstance } from 'element-plus';
|
||||
import { Document, User, Phone, Money, TrendCharts, Check, Calendar, ArrowLeft, ArrowRight } from '@element-plus/icons-vue';
|
||||
import * as echarts from 'echarts';
|
||||
import { getProjectApplication, addProjectApplication, updateProjectApplication, submitApplication, saveDraft } from '@/api/cw/projectApplication';
|
||||
import { startCustomApprovalProcess } from '@/api/cw/projectApproval';
|
||||
import PerformanceIndicators from './components/PerformanceIndicators.vue';
|
||||
import ApprovalProcessSelector from '../projectApproval/components/ApprovalProcessSelector.vue';
|
||||
|
||||
// 接收父组件传递的数据
|
||||
const props = defineProps<{
|
||||
@@ -499,6 +544,7 @@ const props = defineProps<{
|
||||
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const userStore = useUserStore();
|
||||
|
||||
// 表单引用
|
||||
const basicFormRef = ref();
|
||||
@@ -506,6 +552,7 @@ const contentFormRef = ref();
|
||||
const budgetFormRef = ref();
|
||||
const performanceFormRef = ref();
|
||||
const performanceIndicatorsRef = ref();
|
||||
const approvalProcessRef = ref();
|
||||
|
||||
// 当前步骤
|
||||
const currentStep = ref(0);
|
||||
@@ -515,6 +562,13 @@ const activeTab = ref('quantity');
|
||||
const savingDraft = ref(false);
|
||||
const submitting = ref(false);
|
||||
|
||||
// 审批流程对话框
|
||||
const approvalDialog = reactive({
|
||||
visible: false,
|
||||
submitting: false,
|
||||
selectedAuditors: [] as any[]
|
||||
});
|
||||
|
||||
// 图表引用
|
||||
const budgetChart = ref();
|
||||
let budgetChartInstance: echarts.ECharts | null = null;
|
||||
@@ -659,14 +713,13 @@ const rules = {
|
||||
startDate: [{ required: true, message: '请选择项目开始日期', trigger: 'change' }],
|
||||
endDate: [{ required: true, message: '请选择项目结束日期', trigger: 'change' }],
|
||||
totalInvestment: [
|
||||
{ required: true, message: '请填写项目总投资', trigger: 'blur' },
|
||||
{ type: 'number' as const, min: 0.01, message: '投资金额必须大于0', trigger: 'blur' }
|
||||
]
|
||||
};
|
||||
|
||||
// 计算属性
|
||||
const canSubmit = computed(() => {
|
||||
return form.projectName && form.principal && form.totalInvestment > 0;
|
||||
return form.projectName && form.principal && totalInvestmentCalculated.value > 0;
|
||||
});
|
||||
|
||||
const hasBudgetData = computed(() => {
|
||||
@@ -683,6 +736,26 @@ const yearlyTotals = computed(() => {
|
||||
};
|
||||
});
|
||||
|
||||
// 市财政资金总额(基于分年度明细自动汇总)
|
||||
const totalMunicipalFiscalCalculated = computed(() => {
|
||||
return (form.currentYearMunicipal || 0) + (form.nextYearMunicipal || 0) + (form.futureYearMunicipal || 0);
|
||||
});
|
||||
|
||||
// 单位自筹总额(基于分年度明细自动汇总)
|
||||
const totalSelfFundingCalculated = computed(() => {
|
||||
return (form.currentYearSelf || 0) + (form.nextYearSelf || 0) + (form.futureYearSelf || 0);
|
||||
});
|
||||
|
||||
// 其他资金总额(基于分年度明细自动汇总)
|
||||
const totalOtherFundingCalculated = computed(() => {
|
||||
return (form.currentYearOther || 0) + (form.nextYearOther || 0) + (form.futureYearOther || 0);
|
||||
});
|
||||
|
||||
// 项目总投资(基于三个汇总字段自动计算)
|
||||
const totalInvestmentCalculated = computed(() => {
|
||||
return totalMunicipalFiscalCalculated.value + totalSelfFundingCalculated.value + totalOtherFundingCalculated.value;
|
||||
});
|
||||
|
||||
// 分年度预算明细数据
|
||||
const budgetBreakdownData = computed(() => {
|
||||
const currentYear = parseInt(form.year) || new Date().getFullYear();
|
||||
@@ -733,30 +806,22 @@ const updateBudgetBreakdown = (index: number) => {
|
||||
recalculateTotalFromBreakdown();
|
||||
};
|
||||
|
||||
// 从分年度明细重新计算总投资
|
||||
// 从分年度明细重新计算总投资(使用计算属性)
|
||||
const recalculateTotalFromBreakdown = () => {
|
||||
const totalMunicipal = (form.currentYearMunicipal || 0) + (form.nextYearMunicipal || 0) + (form.futureYearMunicipal || 0);
|
||||
const totalSelf = (form.currentYearSelf || 0) + (form.nextYearSelf || 0) + (form.futureYearSelf || 0);
|
||||
const totalOther = (form.currentYearOther || 0) + (form.nextYearOther || 0) + (form.futureYearOther || 0);
|
||||
|
||||
form.totalMunicipalFiscal = totalMunicipal;
|
||||
form.totalSelfFunding = totalSelf;
|
||||
form.totalOtherFunding = totalOther;
|
||||
form.totalInvestment = totalMunicipal + totalSelf + totalOther;
|
||||
// 使用计算属性自动同步到表单字段
|
||||
form.totalMunicipalFiscal = totalMunicipalFiscalCalculated.value;
|
||||
form.totalSelfFunding = totalSelfFundingCalculated.value;
|
||||
form.totalOtherFunding = totalOtherFundingCalculated.value;
|
||||
form.totalInvestment = totalInvestmentCalculated.value;
|
||||
};
|
||||
|
||||
// 计算预算汇总
|
||||
// 计算预算汇总(使用计算属性)
|
||||
const calculateBudgetSummary = () => {
|
||||
// 计算各类资金的总和
|
||||
const totalMunicipal = (form.currentYearMunicipal || 0) + (form.nextYearMunicipal || 0) + (form.futureYearMunicipal || 0);
|
||||
const totalSelf = (form.currentYearSelf || 0) + (form.nextYearSelf || 0) + (form.futureYearSelf || 0);
|
||||
const totalOther = (form.currentYearOther || 0) + (form.nextYearOther || 0) + (form.futureYearOther || 0);
|
||||
|
||||
// 更新总投资字段
|
||||
form.totalMunicipalFiscal = totalMunicipal;
|
||||
form.totalSelfFunding = totalSelf;
|
||||
form.totalOtherFunding = totalOther;
|
||||
form.totalInvestment = totalMunicipal + totalSelf + totalOther;
|
||||
// 使用计算属性自动同步到表单字段
|
||||
form.totalMunicipalFiscal = totalMunicipalFiscalCalculated.value;
|
||||
form.totalSelfFunding = totalSelfFundingCalculated.value;
|
||||
form.totalOtherFunding = totalOtherFundingCalculated.value;
|
||||
form.totalInvestment = totalInvestmentCalculated.value;
|
||||
|
||||
// 更新图表
|
||||
if (budgetChartInstance && hasBudgetData.value) {
|
||||
@@ -769,9 +834,13 @@ const formatAmount = (amount: number): string => {
|
||||
return amount ? amount.toFixed(2) : '0.00';
|
||||
};
|
||||
|
||||
// 计算总投资
|
||||
const calculateTotalInvestment = () => {
|
||||
form.totalInvestment = (form.totalMunicipalFiscal || 0) + (form.totalSelfFunding || 0) + (form.totalOtherFunding || 0);
|
||||
// 更新所有总投资相关字段(从分年度明细计算)
|
||||
const updateTotalInvestmentFromSubItems = () => {
|
||||
// 自动同步所有计算值到表单字段(用于后端提交)
|
||||
form.totalMunicipalFiscal = totalMunicipalFiscalCalculated.value;
|
||||
form.totalSelfFunding = totalSelfFundingCalculated.value;
|
||||
form.totalOtherFunding = totalOtherFundingCalculated.value;
|
||||
form.totalInvestment = totalInvestmentCalculated.value;
|
||||
|
||||
// 更新图表
|
||||
if (budgetChartInstance && hasBudgetData.value) {
|
||||
@@ -779,6 +848,26 @@ const calculateTotalInvestment = () => {
|
||||
}
|
||||
};
|
||||
|
||||
// 保留原函数名以兼容其他调用
|
||||
const calculateTotalInvestment = updateTotalInvestmentFromSubItems;
|
||||
|
||||
// 监听分年度字段变化,自动同步所有总计字段
|
||||
watch(
|
||||
() => [
|
||||
form.currentYearMunicipal, form.nextYearMunicipal, form.futureYearMunicipal,
|
||||
form.currentYearSelf, form.nextYearSelf, form.futureYearSelf,
|
||||
form.currentYearOther, form.nextYearOther, form.futureYearOther
|
||||
],
|
||||
() => {
|
||||
// 同步计算值到表单字段(用于后端提交)
|
||||
form.totalMunicipalFiscal = totalMunicipalFiscalCalculated.value;
|
||||
form.totalSelfFunding = totalSelfFundingCalculated.value;
|
||||
form.totalOtherFunding = totalOtherFundingCalculated.value;
|
||||
form.totalInvestment = totalInvestmentCalculated.value;
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
// 渲染预算图表
|
||||
const renderBudgetChart = () => {
|
||||
if (!budgetChartInstance) return;
|
||||
@@ -948,6 +1037,9 @@ const handleSaveDraft = async () => {
|
||||
try {
|
||||
savingDraft.value = true;
|
||||
|
||||
// 同步计算的总投资到表单字段
|
||||
form.totalInvestment = totalInvestmentCalculated.value;
|
||||
|
||||
// 如果当前在绩效指标步骤(第3步),校验分值占比总和
|
||||
if (currentStep.value === 3 && form.performanceIndicators && form.performanceIndicators.length > 0) {
|
||||
const validationResult = validatePerformanceIndicators();
|
||||
@@ -981,6 +1073,9 @@ const handleSubmit = async () => {
|
||||
try {
|
||||
submitting.value = true;
|
||||
|
||||
// 同步计算的总投资到表单字段
|
||||
form.totalInvestment = totalInvestmentCalculated.value;
|
||||
|
||||
console.log('开始提交申报流程,form.id:', form.id);
|
||||
|
||||
// 先保存数据
|
||||
@@ -1024,17 +1119,9 @@ const handleSubmit = async () => {
|
||||
return;
|
||||
}
|
||||
|
||||
console.log('开始提交审批,ID:', form.id);
|
||||
const submitResult = await submitApplication(form.id);
|
||||
console.log('提交审批结果:', submitResult);
|
||||
|
||||
if (submitResult.code === 200) {
|
||||
ElMessage.success('申报提交成功');
|
||||
router.push('/cw/application');
|
||||
} else {
|
||||
console.error('提交审批失败:', submitResult);
|
||||
ElMessage.error('提交申报失败: ' + (submitResult.msg || '未知错误'));
|
||||
}
|
||||
// 显示审批流程选择对话框
|
||||
console.log('准备显示审批流程选择对话框,ID:', form.id);
|
||||
showApprovalProcessDialog();
|
||||
} catch (error) {
|
||||
console.error('提交申报失败详细错误:', error);
|
||||
|
||||
@@ -1061,6 +1148,105 @@ const handleSubmit = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
// 显示审批流程选择对话框
|
||||
const showApprovalProcessDialog = () => {
|
||||
approvalDialog.visible = true;
|
||||
approvalDialog.selectedAuditors = [];
|
||||
approvalDialog.submitting = false;
|
||||
};
|
||||
|
||||
// 审批流程变化处理
|
||||
const handleApprovalProcessChange = (auditors: any[]) => {
|
||||
approvalDialog.selectedAuditors = auditors;
|
||||
};
|
||||
|
||||
// 取消审批提交
|
||||
const cancelApprovalSubmit = () => {
|
||||
approvalDialog.visible = false;
|
||||
submitting.value = false;
|
||||
ElMessage.info('已取消提交');
|
||||
};
|
||||
|
||||
// 确认审批提交
|
||||
const confirmApprovalSubmit = async () => {
|
||||
try {
|
||||
// 验证审批流程
|
||||
if (!approvalProcessRef.value) {
|
||||
ElMessage.error('审批流程组件初始化失败');
|
||||
return;
|
||||
}
|
||||
|
||||
const validation = approvalProcessRef.value.validateProcess();
|
||||
if (!validation.valid) {
|
||||
ElMessage.warning(validation.message);
|
||||
return;
|
||||
}
|
||||
|
||||
approvalDialog.submitting = true;
|
||||
|
||||
// 确保用户信息已加载
|
||||
if (!userStore.userId || !userStore.name) {
|
||||
ElMessage.error('用户信息未加载,请刷新页面重试');
|
||||
return;
|
||||
}
|
||||
|
||||
// 确保申报编号存在
|
||||
if (!form.applicationNo) {
|
||||
ElMessage.error('申报编号未生成,请先保存申报信息');
|
||||
return;
|
||||
}
|
||||
|
||||
// 获取审批流程配置
|
||||
const processConfig = approvalProcessRef.value.getProcessConfig();
|
||||
|
||||
// 构建审批流程数据
|
||||
const approvalData = {
|
||||
applicationId: form.id,
|
||||
applicationNo: form.applicationNo, // 新增:申报编号
|
||||
auditorIds: processConfig.auditorIds,
|
||||
processName: processConfig.processName || `${form.projectName}审批流程`,
|
||||
submitterId: userStore.userId,
|
||||
submitterName: userStore.name
|
||||
};
|
||||
|
||||
console.log('启动审批流程,数据:', approvalData);
|
||||
|
||||
// 启动审批流程
|
||||
const result = await startCustomApprovalProcess(approvalData);
|
||||
console.log('启动审批流程结果:', result);
|
||||
|
||||
if (result.code === 200) {
|
||||
ElMessage.success('项目申报提交成功,审批流程已启动');
|
||||
approvalDialog.visible = false;
|
||||
router.push('/cw/application');
|
||||
} else {
|
||||
console.error('启动审批流程失败:', result);
|
||||
ElMessage.error('启动审批流程失败: ' + (result.msg || '未知错误'));
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('启动审批流程失败详细错误:', error);
|
||||
|
||||
let errorMessage = '启动审批流程失败';
|
||||
if (error && typeof error === 'object' && 'response' in error) {
|
||||
const axiosError = error as any;
|
||||
if (axiosError.response?.data?.msg) {
|
||||
errorMessage += ': ' + axiosError.response.data.msg;
|
||||
}
|
||||
} else if (error && typeof error === 'object' && 'message' in error) {
|
||||
const generalError = error as any;
|
||||
if (generalError.message) {
|
||||
errorMessage += ': ' + generalError.message;
|
||||
}
|
||||
} else if (typeof error === 'string') {
|
||||
errorMessage += ': ' + error;
|
||||
}
|
||||
|
||||
ElMessage.error(errorMessage);
|
||||
} finally {
|
||||
approvalDialog.submitting = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 取消操作
|
||||
const handleCancel = () => {
|
||||
ElMessageBox.confirm('确认取消吗?未保存的数据将丢失。', '提示', {
|
||||
|
||||
@@ -1,61 +1,5 @@
|
||||
<template>
|
||||
<div class="page-container">
|
||||
<!-- 统计卡片区域 -->
|
||||
<el-row :gutter="20" class="stats-row">
|
||||
<el-col :span="6">
|
||||
<div class="stat-card stat-card-primary">
|
||||
<div class="stat-content">
|
||||
<div class="stat-icon">
|
||||
<el-icon><Document /></el-icon>
|
||||
</div>
|
||||
<div class="stat-info">
|
||||
<div class="stat-value">{{ totalCount }}</div>
|
||||
<div class="stat-label">总申报数</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<div class="stat-card stat-card-success">
|
||||
<div class="stat-content">
|
||||
<div class="stat-icon">
|
||||
<el-icon><Check /></el-icon>
|
||||
</div>
|
||||
<div class="stat-info">
|
||||
<div class="stat-value">{{ approvedCount }}</div>
|
||||
<div class="stat-label">已通过</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<div 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">{{ pendingCount }}</div>
|
||||
<div class="stat-label">审批中</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<div 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">{{ draftCount }}</div>
|
||||
<div class="stat-label">草稿</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 搜索区域 -->
|
||||
<el-card class="button-card" v-show="showSearch">
|
||||
<template #header>
|
||||
@@ -122,10 +66,14 @@
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate" v-hasPermi="['cw:application:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete" v-hasPermi="['cw:application:remove']">删除</el-button>
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete" v-hasPermi="['cw:application:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="info" plain icon="Upload" @click="handleSubmit" :disabled="multiple" v-hasPermi="['cw:application:submit']">提交审批</el-button>
|
||||
<el-button type="info" plain icon="Upload" @click="handleSubmit" :disabled="multiple" v-hasPermi="['cw:application:submit']"
|
||||
>提交审批</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['cw:application:export']">导出</el-button>
|
||||
@@ -135,7 +83,15 @@
|
||||
</template>
|
||||
|
||||
<div class="table-container">
|
||||
<el-table v-loading="loading" border :data="applicationList" @selection-change="handleSelectionChange" style="width: 100%" :scroll-x="true" class="scroll-table">
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
border
|
||||
:data="applicationList"
|
||||
@selection-change="handleSelectionChange"
|
||||
style="width: 100%"
|
||||
:scroll-x="true"
|
||||
class="scroll-table"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" fixed="left" />
|
||||
<el-table-column label="申报编号" align="center" prop="applicationNo" min-width="140" />
|
||||
<el-table-column label="项目名称" align="center" prop="projectName" min-width="180" show-overflow-tooltip />
|
||||
@@ -169,31 +125,13 @@
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['cw:application:edit']" />
|
||||
</el-tooltip>
|
||||
<el-tooltip content="提交审批" placement="top" v-if="['draft', 'returned'].includes(scope.row.approvalStatus)">
|
||||
<el-button
|
||||
link
|
||||
type="warning"
|
||||
icon="Upload"
|
||||
@click="handleSubmit(scope.row)"
|
||||
v-hasPermi="['cw:application:submit']"
|
||||
/>
|
||||
<el-button link type="warning" icon="Upload" @click="handleSubmit(scope.row)" v-hasPermi="['cw:application:submit']" />
|
||||
</el-tooltip>
|
||||
<el-tooltip content="撤回" placement="top" v-if="scope.row.approvalStatus === 'submitted'">
|
||||
<el-button
|
||||
link
|
||||
type="info"
|
||||
icon="RefreshLeft"
|
||||
@click="handleWithdraw(scope.row)"
|
||||
v-hasPermi="['cw:application:withdraw']"
|
||||
/>
|
||||
<el-button link type="info" icon="RefreshLeft" @click="handleWithdraw(scope.row)" v-hasPermi="['cw:application:withdraw']" />
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top" v-if="['draft', 'cancelled', 'returned'].includes(scope.row.approvalStatus)">
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
icon="Delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['cw:application:remove']"
|
||||
/>
|
||||
<el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['cw:application:remove']" />
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</template>
|
||||
@@ -234,6 +172,20 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 审批流程选择对话框 -->
|
||||
<el-dialog title="选择审批流程" v-model="approvalProcessDialog.visible" width="800px" append-to-body :close-on-click-modal="false">
|
||||
<ApprovalProcessSelector
|
||||
ref="approvalProcessSelectorRef"
|
||||
v-model="approvalProcessDialog.selectedAuditors"
|
||||
/>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="cancelSubmitApproval">取 消</el-button>
|
||||
<el-button type="primary" @click="confirmSubmitApproval">确认提交</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -244,11 +196,13 @@ import {
|
||||
delProjectApplication,
|
||||
addProjectApplication,
|
||||
updateProjectApplication,
|
||||
submitApplication,
|
||||
getApplicationStatistics
|
||||
submitApplication
|
||||
} from '@/api/cw/projectApplication';
|
||||
import { startCustomApprovalProcess, type CwCustomApprovalRequest } from '@/api/cw/projectApproval';
|
||||
import { getInfo } from '@/api/login';
|
||||
import ApplicationForm from './form.vue';
|
||||
import ApplicationSummary from './summary.vue';
|
||||
import ApprovalProcessSelector from '../projectApproval/components/ApprovalProcessSelector.vue';
|
||||
import Pagination from '@/components/Pagination/index.vue';
|
||||
|
||||
export default {
|
||||
@@ -256,6 +210,7 @@ export default {
|
||||
components: {
|
||||
ApplicationForm,
|
||||
ApplicationSummary,
|
||||
ApprovalProcessSelector,
|
||||
Pagination
|
||||
},
|
||||
data() {
|
||||
@@ -296,16 +251,17 @@ export default {
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {},
|
||||
// 统计数据
|
||||
totalCount: 0,
|
||||
approvedCount: 0,
|
||||
pendingCount: 0,
|
||||
draftCount: 0
|
||||
// 审批流程选择对话框
|
||||
approvalProcessDialog: {
|
||||
visible: false,
|
||||
applicationId: null,
|
||||
applicationNo: null,
|
||||
selectedAuditors: []
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.getStatistics();
|
||||
},
|
||||
methods: {
|
||||
/** 查询项目申报列表 */
|
||||
@@ -326,27 +282,6 @@ export default {
|
||||
this.$message.error('获取数据失败,请检查网络连接或联系管理员');
|
||||
});
|
||||
},
|
||||
/** 获取统计数据 */
|
||||
getStatistics() {
|
||||
// 调用专门的统计API接口
|
||||
const year = this.queryParams.year ? parseInt(this.queryParams.year) : null;
|
||||
getApplicationStatistics(year)
|
||||
.then((response) => {
|
||||
const data = response.data;
|
||||
this.totalCount = data.totalCount || 0;
|
||||
this.approvedCount = data.approvedCount || 0;
|
||||
this.pendingCount = data.approvingCount || 0; // 注意:后端返回的是approvingCount
|
||||
this.draftCount = data.draftCount || 0;
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('获取统计数据失败:', error);
|
||||
// 如果API失败,使用本地计算作为后备方案
|
||||
this.totalCount = this.applicationList.length;
|
||||
this.approvedCount = this.applicationList.filter((item) => item.approvalStatus === 'approved').length;
|
||||
this.pendingCount = this.applicationList.filter((item) => item.approvalStatus === 'approving').length;
|
||||
this.draftCount = this.applicationList.filter((item) => item.approvalStatus === 'draft').length;
|
||||
});
|
||||
},
|
||||
/** 取消按钮 */
|
||||
cancel() {
|
||||
this.open = false;
|
||||
@@ -397,7 +332,6 @@ export default {
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
this.getStatistics(); // 搜索时也更新统计数据
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
@@ -444,14 +378,12 @@ export default {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
this.getStatistics(); // 修改后更新统计
|
||||
});
|
||||
} else {
|
||||
addProjectApplication(this.form).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
this.getStatistics(); // 新增后更新统计
|
||||
});
|
||||
}
|
||||
} else {
|
||||
@@ -469,28 +401,97 @@ export default {
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.getStatistics(); // 删除后更新统计
|
||||
this.$modal.msgSuccess('删除成功');
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
/** 提交审批 */
|
||||
handleSubmit(row) {
|
||||
const applications = row?.applicationNo
|
||||
? [row.applicationNo]
|
||||
: this.applicationList.filter((item) => this.ids.includes(item.id)).map((item) => item.applicationNo);
|
||||
if (row) {
|
||||
// 单个提交
|
||||
this.approvalProcessDialog.applicationId = row.id;
|
||||
this.approvalProcessDialog.applicationNo = row.applicationNo;
|
||||
this.approvalProcessDialog.visible = true;
|
||||
this.approvalProcessDialog.selectedAuditors = [];
|
||||
} else {
|
||||
// 批量提交 - 暂不支持
|
||||
this.$modal.msgWarning('批量提交审批功能暂未开放,请单个提交');
|
||||
}
|
||||
},
|
||||
/** 确认提交审批 */
|
||||
async confirmSubmitApproval() {
|
||||
try {
|
||||
const processSelector = this.$refs.approvalProcessSelectorRef;
|
||||
if (!processSelector) {
|
||||
this.$modal.msgError('审批流程选择组件未加载');
|
||||
return;
|
||||
}
|
||||
|
||||
this.$modal
|
||||
.confirm('是否确认提交申报编号为"' + applications.join('", "') + '"的数据项?')
|
||||
.then(() => {
|
||||
return submitApplication(row?.id || this.ids);
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.getStatistics(); // 提交后更新统计
|
||||
this.$modal.msgSuccess('提交成功');
|
||||
})
|
||||
.catch(() => {});
|
||||
// 验证审批流程
|
||||
const validation = processSelector.validateProcess();
|
||||
if (!validation.valid) {
|
||||
this.$modal.msgError(validation.message);
|
||||
return;
|
||||
}
|
||||
|
||||
// 获取当前用户信息
|
||||
let userInfo = null;
|
||||
try {
|
||||
const userResponse = await getInfo();
|
||||
if (userResponse.code === 200 && userResponse.data && userResponse.data.user) {
|
||||
userInfo = userResponse.data.user;
|
||||
}
|
||||
} catch (userError) {
|
||||
console.error('获取用户信息失败:', userError);
|
||||
this.$modal.msgError('获取用户信息失败,请重新登录');
|
||||
return;
|
||||
}
|
||||
|
||||
if (!userInfo || !userInfo.userId) {
|
||||
this.$modal.msgError('用户信息不完整,请重新登录');
|
||||
return;
|
||||
}
|
||||
|
||||
// 获取审批流程配置
|
||||
const processConfig = processSelector.getProcessConfig();
|
||||
|
||||
// 构建请求数据
|
||||
const approvalData: CwCustomApprovalRequest = {
|
||||
applicationId: this.approvalProcessDialog.applicationId,
|
||||
applicationNo: this.approvalProcessDialog.applicationNo,
|
||||
processName: processConfig.processName,
|
||||
auditorIds: processConfig.auditorIds,
|
||||
submitterId: userInfo.userId,
|
||||
submitterName: userInfo.nickName || userInfo.userName
|
||||
};
|
||||
|
||||
console.log('启动审批流程数据:', approvalData);
|
||||
|
||||
// 启动审批流程
|
||||
const result = await startCustomApprovalProcess(approvalData);
|
||||
console.log('启动审批流程结果:', result);
|
||||
|
||||
// 关闭对话框
|
||||
this.approvalProcessDialog.visible = false;
|
||||
this.approvalProcessDialog.applicationId = null;
|
||||
this.approvalProcessDialog.applicationNo = null;
|
||||
this.approvalProcessDialog.selectedAuditors = [];
|
||||
|
||||
// 刷新列表
|
||||
this.getList();
|
||||
|
||||
this.$modal.msgSuccess('审批流程启动成功');
|
||||
} catch (error) {
|
||||
console.error('启动审批流程失败:', error);
|
||||
this.$modal.msgError('启动审批流程失败:' + (error.message || '未知错误'));
|
||||
}
|
||||
},
|
||||
/** 取消提交审批 */
|
||||
cancelSubmitApproval() {
|
||||
this.approvalProcessDialog.visible = false;
|
||||
this.approvalProcessDialog.applicationId = null;
|
||||
this.approvalProcessDialog.applicationNo = null;
|
||||
this.approvalProcessDialog.selectedAuditors = [];
|
||||
},
|
||||
/** 撤回申请 */
|
||||
handleWithdraw(row) {
|
||||
@@ -500,7 +501,6 @@ export default {
|
||||
// 调用撤回接口
|
||||
this.$modal.msgSuccess('撤回成功');
|
||||
this.getList();
|
||||
this.getStatistics(); // 撤回后更新统计
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
@@ -560,74 +560,6 @@ export default {
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
/* 统计卡片样式 */
|
||||
.stats-row {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.stat-card {
|
||||
border-radius: 12px;
|
||||
transition: all 0.3s ease;
|
||||
height: 90px;
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
|
||||
.stat-content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 5px 16px;
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
|
||||
.stat-icon {
|
||||
font-size: 28px;
|
||||
margin-right: 15px;
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
.stat-info {
|
||||
flex: 1;
|
||||
|
||||
.stat-value {
|
||||
font-size: 24px;
|
||||
font-weight: bold;
|
||||
line-height: 1;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.stat-label {
|
||||
font-size: 14px;
|
||||
opacity: 0.8;
|
||||
line-height: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.stat-card-primary {
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
color: white;
|
||||
}
|
||||
|
||||
&.stat-card-success {
|
||||
background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
|
||||
color: white;
|
||||
}
|
||||
|
||||
&.stat-card-warning {
|
||||
background: linear-gradient(135deg, #ff9a56 0%, #ffad56 100%);
|
||||
color: white;
|
||||
}
|
||||
|
||||
&.stat-card-info {
|
||||
background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
/* 搜索按钮居中样式 */
|
||||
.search-btn-container {
|
||||
display: flex;
|
||||
@@ -642,7 +574,9 @@ export default {
|
||||
/* 卡片样式 */
|
||||
:deep(.el-card) {
|
||||
border: 1px solid #e4e7ed;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04);
|
||||
box-shadow:
|
||||
0 2px 4px rgba(0, 0, 0, 0.12),
|
||||
0 0 6px rgba(0, 0, 0, 0.04);
|
||||
}
|
||||
|
||||
/* 表格卡片头部样式 */
|
||||
@@ -792,11 +726,6 @@ export default {
|
||||
.page-container {
|
||||
padding: 10px;
|
||||
|
||||
.stats-row {
|
||||
.stat-card {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -98,7 +98,15 @@
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="pagination-container">
|
||||
<pagination v-show="total > 0" :total="total" :page="queryParams.pageNum" :limit="queryParams.pageSize" @update:page="queryParams.pageNum = $event" @update:limit="queryParams.pageSize = $event" @pagination="getList" />
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page="queryParams.pageNum"
|
||||
:limit="queryParams.pageSize"
|
||||
@update:page="queryParams.pageNum = $event"
|
||||
@update:limit="queryParams.pageSize = $event"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
@@ -377,7 +385,9 @@ export default {
|
||||
.table-card {
|
||||
margin-top: 0;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04);
|
||||
box-shadow:
|
||||
0 2px 4px rgba(0, 0, 0, 0.12),
|
||||
0 0 6px rgba(0, 0, 0, 0.04);
|
||||
}
|
||||
|
||||
.table-card :deep(.el-card__body) {
|
||||
|
||||
@@ -245,13 +245,13 @@
|
||||
步骤 {{ index + 1 }}: {{ step.stepName || '未命名步骤' }}
|
||||
</span>
|
||||
<div class="step-actions">
|
||||
<el-button type="text" size="small" @click="moveStepUp(index)" :disabled="index === 0">
|
||||
<el-button link size="small" @click="moveStepUp(index)" :disabled="index === 0">
|
||||
<el-icon><ArrowUp /></el-icon>
|
||||
</el-button>
|
||||
<el-button type="text" size="small" @click="moveStepDown(index)" :disabled="index === form.steps.length - 1">
|
||||
<el-button link size="small" @click="moveStepDown(index)" :disabled="index === form.steps.length - 1">
|
||||
<el-icon><ArrowDown /></el-icon>
|
||||
</el-button>
|
||||
<el-button type="text" size="small" @click="removeStep(index)">
|
||||
<el-button link size="small" @click="removeStep(index)">
|
||||
<el-icon><Delete /></el-icon>
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
@@ -157,8 +157,8 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="审批决定" prop="approvalResult" required>
|
||||
<el-radio-group v-model="approvalForm.approvalResult">
|
||||
<el-radio label="approve">通过</el-radio>
|
||||
<el-radio label="reject">退回申请人</el-radio>
|
||||
<el-radio value="approve">通过</el-radio>
|
||||
<el-radio value="reject">退回申请人</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="审批意见" prop="approvalComment">
|
||||
|
||||
@@ -0,0 +1,149 @@
|
||||
# 项目审批管理模块
|
||||
|
||||
## 功能概述
|
||||
|
||||
项目审批管理模块用于管理项目申报的审批流程,支持自定义审批流程配置、审批执行、流程跟踪等功能。
|
||||
|
||||
## 主要功能
|
||||
|
||||
### 1. 审批流程管理
|
||||
|
||||
- 查询审批流程列表(支持分页)
|
||||
- 按申报编号、流程状态、提交人等条件筛选
|
||||
- 显示审批进度和流程状态
|
||||
- 支持终止正在进行的审批流程
|
||||
|
||||
### 2. 待我审批
|
||||
|
||||
- 查看分配给当前用户的待审批任务
|
||||
- 执行审批操作(通过/打回)
|
||||
- 填写审批意见
|
||||
- 查看申报详情和审批记录
|
||||
|
||||
### 3. 我的已审批
|
||||
|
||||
- 查看当前用户已完成的审批记录
|
||||
- 显示审批动作和意见
|
||||
- 统计审批效率和处理时长
|
||||
|
||||
### 4. 审批记录跟踪
|
||||
|
||||
- 完整的审批时间线展示
|
||||
- 每个审批节点的详细信息
|
||||
- 审批意见和处理结果记录
|
||||
|
||||
## 页面结构
|
||||
|
||||
```
|
||||
web/src/views/cw/projectApproval/
|
||||
├── index.vue # 主页面组件
|
||||
└── README.md # 功能说明文档
|
||||
```
|
||||
|
||||
## 功能特性
|
||||
|
||||
### 1. 多标签页设计
|
||||
|
||||
- **审批流程管理**: 查看所有审批流程的整体情况
|
||||
- **待我审批**: 专注于当前用户需要处理的审批任务
|
||||
- **我的已审批**: 查看历史审批记录和统计
|
||||
|
||||
### 2. 统计卡片
|
||||
|
||||
- 总流程数、等待开始、进行中、已完成等状态统计
|
||||
- 平均处理时长、待我审批数量等关键指标
|
||||
- 本月完成数量、已终止流程等趋势数据
|
||||
|
||||
### 3. 审批操作
|
||||
|
||||
- 支持批量审批和单个审批
|
||||
- 必填审批意见,确保审批质量
|
||||
- 实时更新审批状态和流程进度
|
||||
|
||||
### 4. 流程可视化
|
||||
|
||||
- 进度条显示审批进度
|
||||
- 时间线展示审批历史
|
||||
- 状态标签清晰标识各阶段
|
||||
|
||||
## API接口
|
||||
|
||||
使用的主要API接口:
|
||||
|
||||
- `listProjectApproval` - 查询审批流程列表
|
||||
- `listPendingApprovals` - 查询待我审批列表
|
||||
- `listProcessedApprovals` - 查询我的已审批列表
|
||||
- `processApproval` - 执行审批操作
|
||||
- `rejectApproval` - 打回申请
|
||||
- `terminateApproval` - 终止审批流程
|
||||
- `listApprovalRecordsByApplicationId` - 查询审批记录
|
||||
|
||||
## 权限控制
|
||||
|
||||
页面功能对应的权限标识:
|
||||
|
||||
- `cw:projectApproval:list` - 查询权限
|
||||
- `cw:projectApproval:add` - 启动流程权限
|
||||
- `cw:projectApproval:approve` - 审批权限
|
||||
- `cw:projectApproval:remove` - 终止流程权限
|
||||
- `cw:projectApproval:export` - 导出权限
|
||||
|
||||
## 状态说明
|
||||
|
||||
### 流程状态
|
||||
|
||||
- `waiting` - 等待开始
|
||||
- `running` - 进行中
|
||||
- `completed` - 已完成
|
||||
- `terminated` - 已终止
|
||||
|
||||
### 节点状态
|
||||
|
||||
- `waiting` - 等待审批
|
||||
- `approved` - 已通过
|
||||
- `rejected` - 已拒绝
|
||||
- `pending` - 待处理
|
||||
|
||||
### 审批动作
|
||||
|
||||
- `approve` - 审批通过
|
||||
- `reject` - 打回申请
|
||||
|
||||
## 技术实现
|
||||
|
||||
- 基于Vue 3 Composition API
|
||||
- 使用Element Plus UI组件库
|
||||
- 集成项目标准的权限控制和国际化
|
||||
- 遵循项目统一的代码规范和样式风格
|
||||
- 参考后勤管理模块的设计风格和布局
|
||||
|
||||
## 数据流程
|
||||
|
||||
1. **流程启动**: 项目申报提交后,根据配置的审核人启动审批流程
|
||||
2. **节点推进**: 当前节点审批完成后,自动推进到下一节点
|
||||
3. **流程完结**: 所有节点审批完成或被打回时,流程结束
|
||||
4. **状态同步**: 审批状态实时同步到项目申报主表
|
||||
|
||||
## 使用说明
|
||||
|
||||
### 审批人员操作流程
|
||||
|
||||
1. 登录系统,进入项目审批管理页面
|
||||
2. 点击"待我审批"标签页查看待处理任务
|
||||
3. 点击具体记录查看申报详情
|
||||
4. 选择审批动作(通过/打回)并填写审批意见
|
||||
5. 提交审批结果,系统自动推进流程
|
||||
|
||||
### 管理员操作流程
|
||||
|
||||
1. 在"审批流程管理"标签页查看所有流程状态
|
||||
2. 可以终止异常或不需要的审批流程
|
||||
3. 通过统计卡片监控审批效率和积压情况
|
||||
4. 导出审批数据进行分析和存档
|
||||
|
||||
## 注意事项
|
||||
|
||||
1. 审批意见为必填项,且至少5个字符
|
||||
2. 审批操作不可撤销,请谨慎操作
|
||||
3. 终止流程会影响项目申报状态,需谨慎使用
|
||||
4. 导出功能需要相应权限,请联系管理员配置
|
||||
@@ -0,0 +1,462 @@
|
||||
<template>
|
||||
<div class="approval-process-selector">
|
||||
<el-form-item label="审批流程" required>
|
||||
<el-radio-group v-model="processType" @change="handleProcessTypeChange">
|
||||
<el-radio value="custom">自定义审批流程</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 自定义审批流程配置 -->
|
||||
<div v-if="processType === 'custom'" class="custom-process-config">
|
||||
<el-form-item label="选择审核人" required>
|
||||
<div class="auditor-selector">
|
||||
<div class="selector-header">
|
||||
<el-button type="primary" icon="Plus" @click="showAuditorSelect">添加审核人</el-button>
|
||||
<el-text v-if="selectedAuditors.length > 0" type="info" size="small">
|
||||
已选择 {{ selectedAuditors.length }} 个审核人,将按添加顺序进行审批
|
||||
</el-text>
|
||||
</div>
|
||||
|
||||
<!-- 已选择的审核人列表 -->
|
||||
<div v-if="selectedAuditors.length > 0" class="selected-auditors">
|
||||
<div class="auditor-flow">
|
||||
<div v-for="(auditor, index) in selectedAuditors" :key="auditor.userId" class="auditor-node">
|
||||
<div class="node-content">
|
||||
<span class="node-index">{{ index + 1 }}</span>
|
||||
<div class="auditor-info">
|
||||
<div class="auditor-name">{{ auditor.userName }}</div>
|
||||
<div class="auditor-dept">{{ auditor.deptName }}</div>
|
||||
</div>
|
||||
<el-button type="danger" icon="Delete" size="small" circle @click="removeAuditor(index)" :disabled="disabled" />
|
||||
</div>
|
||||
<div v-if="index < selectedAuditors.length - 1" class="flow-arrow">
|
||||
<el-icon><ArrowRight /></el-icon>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 流程预览说明 -->
|
||||
<div class="flow-description">
|
||||
<el-alert type="info" :closable="false" show-icon>
|
||||
<template #title>
|
||||
<span>审批流程预览:项目提交后将按上述顺序进行逐级审批,每个节点审批通过后自动流转到下一节点</span>
|
||||
</template>
|
||||
</el-alert>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 空状态提示 -->
|
||||
<div v-else class="empty-state">
|
||||
<el-empty description="暂未选择审核人">
|
||||
<el-button type="primary" @click="showAuditorSelect" :disabled="disabled">选择审核人</el-button>
|
||||
</el-empty>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
<!-- 审核人选择对话框 -->
|
||||
<el-dialog title="选择审核人" v-model="auditorSelectDialog.visible" width="70%" append-to-body destroy-on-close :close-on-click-modal="false">
|
||||
<div class="auditor-select-content">
|
||||
<!-- 搜索区域 -->
|
||||
<div class="search-section">
|
||||
<el-input v-model="searchKeyword" placeholder="搜索审核人姓名或部门" clearable @input="handleSearch" style="width: 300px">
|
||||
<template #prefix>
|
||||
<el-icon><Search /></el-icon>
|
||||
</template>
|
||||
</el-input>
|
||||
</div>
|
||||
|
||||
<!-- 审核人表格 -->
|
||||
<el-table
|
||||
ref="auditorTableRef"
|
||||
:data="filteredAuditors"
|
||||
@selection-change="handleAuditorSelectionChange"
|
||||
max-height="400"
|
||||
empty-text="暂无可用审核人"
|
||||
>
|
||||
<el-table-column type="selection" width="55" :selectable="isAuditorSelectable" />
|
||||
<el-table-column label="序号" type="index" width="60" />
|
||||
<el-table-column label="姓名" prop="userName" width="100" />
|
||||
<el-table-column label="部门" prop="deptName" />
|
||||
<el-table-column label="联系电话" prop="phoneNumber" width="130" />
|
||||
<el-table-column label="邮箱" prop="email" show-overflow-tooltip />
|
||||
<el-table-column label="状态" prop="status" width="80" align="center">
|
||||
<template #default="scope">
|
||||
<el-tag :type="scope.row.status === '1' ? 'success' : 'danger'" size="small">
|
||||
{{ scope.row.status === '1' ? '正常' : '停用' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-text type="info" size="small"> 已选择 {{ auditorSelectDialog.selectedRows.length }} 个审核人 </el-text>
|
||||
<div class="footer-buttons">
|
||||
<el-button @click="auditorSelectDialog.visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="confirmAuditorSelect" :disabled="auditorSelectDialog.selectedRows.length === 0"> 确定添加 </el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, computed, watch, onMounted } from 'vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { listAvailableAuditors } from '@/api/cw/projectAuditor';
|
||||
import type { CwProjectAuditorVO } from '@/api/cw/projectAuditor';
|
||||
|
||||
interface Props {
|
||||
modelValue: any[];
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
interface Emits {
|
||||
(e: 'update:modelValue', value: any[]): void;
|
||||
(e: 'change', value: any[]): void;
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
disabled: false
|
||||
});
|
||||
|
||||
const emit = defineEmits<Emits>();
|
||||
|
||||
const processType = ref('custom');
|
||||
const selectedAuditors = ref<CwProjectAuditorVO[]>(props.modelValue || []);
|
||||
const availableAuditors = ref<CwProjectAuditorVO[]>([]);
|
||||
const searchKeyword = ref('');
|
||||
|
||||
// 审核人选择对话框
|
||||
const auditorSelectDialog = reactive({
|
||||
visible: false,
|
||||
selectedRows: [] as CwProjectAuditorVO[]
|
||||
});
|
||||
|
||||
const auditorTableRef = ref();
|
||||
|
||||
// 过滤后的审核人列表
|
||||
const filteredAuditors = computed(() => {
|
||||
if (!searchKeyword.value) {
|
||||
return availableAuditors.value;
|
||||
}
|
||||
|
||||
const keyword = searchKeyword.value.toLowerCase();
|
||||
return availableAuditors.value.filter(
|
||||
(auditor) => auditor.userName.toLowerCase().includes(keyword) || auditor.deptName.toLowerCase().includes(keyword)
|
||||
);
|
||||
});
|
||||
|
||||
// 监听选中审核人变化
|
||||
watch(
|
||||
selectedAuditors,
|
||||
(newValue) => {
|
||||
emit('update:modelValue', newValue);
|
||||
emit('change', newValue);
|
||||
},
|
||||
{ deep: true }
|
||||
);
|
||||
|
||||
// 监听外部值变化
|
||||
watch(
|
||||
() => props.modelValue,
|
||||
(newValue) => {
|
||||
selectedAuditors.value = newValue || [];
|
||||
},
|
||||
{ deep: true }
|
||||
);
|
||||
|
||||
// 流程类型变化处理
|
||||
const handleProcessTypeChange = () => {
|
||||
// 预留扩展,当前只支持自定义流程
|
||||
};
|
||||
|
||||
// 显示审核人选择对话框
|
||||
const showAuditorSelect = async () => {
|
||||
if (props.disabled) return;
|
||||
|
||||
try {
|
||||
const { data } = await listAvailableAuditors();
|
||||
availableAuditors.value = data || [];
|
||||
searchKeyword.value = '';
|
||||
auditorSelectDialog.visible = true;
|
||||
auditorSelectDialog.selectedRows = [];
|
||||
} catch (error) {
|
||||
ElMessage.error('加载审核人列表失败');
|
||||
}
|
||||
};
|
||||
|
||||
// 判断审核人是否可选择(避免重复选择)
|
||||
const isAuditorSelectable = (auditor: CwProjectAuditorVO) => {
|
||||
return !selectedAuditors.value.some((selected) => selected.userId === auditor.userId);
|
||||
};
|
||||
|
||||
// 审核人选择变化
|
||||
const handleAuditorSelectionChange = (selection: CwProjectAuditorVO[]) => {
|
||||
auditorSelectDialog.selectedRows = selection;
|
||||
};
|
||||
|
||||
// 搜索处理
|
||||
const handleSearch = () => {
|
||||
// 搜索时清空选择
|
||||
if (auditorTableRef.value) {
|
||||
auditorTableRef.value.clearSelection();
|
||||
}
|
||||
auditorSelectDialog.selectedRows = [];
|
||||
};
|
||||
|
||||
// 确认选择审核人
|
||||
const confirmAuditorSelect = () => {
|
||||
if (auditorSelectDialog.selectedRows.length === 0) {
|
||||
ElMessage.warning('请选择审核人');
|
||||
return;
|
||||
}
|
||||
|
||||
// 过滤掉已存在的审核人
|
||||
const newAuditors = auditorSelectDialog.selectedRows.filter(
|
||||
(auditor) => !selectedAuditors.value.some((selected) => selected.userId === auditor.userId)
|
||||
);
|
||||
|
||||
if (newAuditors.length === 0) {
|
||||
ElMessage.warning('所选审核人已存在');
|
||||
return;
|
||||
}
|
||||
|
||||
// 添加到已选列表
|
||||
selectedAuditors.value.push(...newAuditors);
|
||||
|
||||
auditorSelectDialog.visible = false;
|
||||
ElMessage.success(`已添加 ${newAuditors.length} 个审核人`);
|
||||
};
|
||||
|
||||
// 移除审核人
|
||||
const removeAuditor = (index: number) => {
|
||||
if (props.disabled) return;
|
||||
|
||||
selectedAuditors.value.splice(index, 1);
|
||||
ElMessage.success('已移除审核人');
|
||||
};
|
||||
|
||||
// 验证审批流程
|
||||
const validateProcess = () => {
|
||||
if (processType.value === 'custom') {
|
||||
if (selectedAuditors.value.length === 0) {
|
||||
return { valid: false, message: '请选择审核人' };
|
||||
}
|
||||
if (selectedAuditors.value.length > 10) {
|
||||
return { valid: false, message: '审核人数量不能超过10个' };
|
||||
}
|
||||
}
|
||||
return { valid: true, message: '' };
|
||||
};
|
||||
|
||||
// 获取审批流程配置
|
||||
const getProcessConfig = () => {
|
||||
return {
|
||||
processType: processType.value,
|
||||
auditorIds: selectedAuditors.value.map((auditor) => auditor.userId),
|
||||
processName: `${selectedAuditors.value.map((a) => a.userName).join('→')}审批流程`
|
||||
};
|
||||
};
|
||||
|
||||
// 定义组件名称
|
||||
defineOptions({
|
||||
name: 'ApprovalProcessSelector'
|
||||
});
|
||||
|
||||
// 暴露方法供父组件调用
|
||||
defineExpose({
|
||||
validateProcess,
|
||||
getProcessConfig
|
||||
});
|
||||
|
||||
// 组件挂载时加载数据
|
||||
onMounted(() => {
|
||||
if (props.modelValue && props.modelValue.length > 0) {
|
||||
selectedAuditors.value = props.modelValue;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.approval-process-selector {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.custom-process-config {
|
||||
margin-top: 20px;
|
||||
padding: 24px;
|
||||
border: 1px solid #e4e7ed;
|
||||
border-radius: 8px;
|
||||
background-color: #fafbfc;
|
||||
}
|
||||
|
||||
.auditor-selector {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.selector-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.selected-auditors {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.auditor-flow {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: 12px;
|
||||
margin-bottom: 20px;
|
||||
padding: 20px;
|
||||
background: white;
|
||||
border-radius: 8px;
|
||||
border: 1px solid #e4e7ed;
|
||||
}
|
||||
|
||||
.auditor-node {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.node-content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 12px 16px;
|
||||
background: white;
|
||||
border: 2px solid #409eff;
|
||||
border-radius: 8px;
|
||||
gap: 12px;
|
||||
transition: all 0.3s;
|
||||
box-shadow: 0 2px 8px rgba(64, 158, 255, 0.1);
|
||||
}
|
||||
|
||||
.node-content:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 4px 12px rgba(64, 158, 255, 0.2);
|
||||
}
|
||||
|
||||
.node-index {
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
background: #409eff;
|
||||
color: white;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.auditor-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-width: 100px;
|
||||
}
|
||||
|
||||
.auditor-name {
|
||||
font-weight: 600;
|
||||
color: #1f2329;
|
||||
font-size: 14px;
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
|
||||
.auditor-dept {
|
||||
font-size: 12px;
|
||||
color: #86909c;
|
||||
}
|
||||
|
||||
.flow-arrow {
|
||||
color: #409eff;
|
||||
font-size: 18px;
|
||||
margin: 0 4px;
|
||||
}
|
||||
|
||||
.flow-description {
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
.empty-state {
|
||||
text-align: center;
|
||||
padding: 40px 20px;
|
||||
}
|
||||
|
||||
/* 对话框内容样式 */
|
||||
.auditor-select-content {
|
||||
max-height: 500px;
|
||||
}
|
||||
|
||||
.search-section {
|
||||
margin-bottom: 16px;
|
||||
padding-bottom: 16px;
|
||||
border-bottom: 1px solid #e4e7ed;
|
||||
}
|
||||
|
||||
/* 对话框底部样式 */
|
||||
.dialog-footer {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.footer-buttons {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
/* 响应式设计 */
|
||||
@media (max-width: 768px) {
|
||||
.auditor-flow {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.auditor-node {
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.flow-arrow {
|
||||
transform: rotate(90deg);
|
||||
align-self: center;
|
||||
}
|
||||
|
||||
.selector-header {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
gap: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
/* 深色模式兼容 */
|
||||
@media (prefers-color-scheme: dark) {
|
||||
.custom-process-config {
|
||||
background-color: #2a2a2a;
|
||||
border-color: #404040;
|
||||
}
|
||||
|
||||
.auditor-flow {
|
||||
background: #1a1a1a;
|
||||
border-color: #404040;
|
||||
}
|
||||
|
||||
.node-content {
|
||||
background: #1a1a1a;
|
||||
border-color: #409eff;
|
||||
}
|
||||
|
||||
.auditor-name {
|
||||
color: #e5e5e5;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,403 @@
|
||||
<template>
|
||||
<div class="p-2 page-container">
|
||||
<!-- 页面头部 -->
|
||||
<el-card shadow="never" class="header-card">
|
||||
<div class="header-content">
|
||||
<div class="header-info">
|
||||
<h2 class="page-title">
|
||||
<el-icon><Memo /></el-icon>
|
||||
我的待审批
|
||||
</h2>
|
||||
<p class="page-desc">查看和处理需要我审批的项目申报</p>
|
||||
</div>
|
||||
<div class="header-stats">
|
||||
<div class="stat-item">
|
||||
<div class="stat-number">{{ pendingCount }}</div>
|
||||
<div class="stat-label">待审批</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<!-- 数据表格 -->
|
||||
<el-card shadow="never" class="table-card">
|
||||
<el-table v-loading="loading" :data="pendingList" @row-dblclick="handleView">
|
||||
<el-table-column label="序号" type="index" width="80" align="center" />
|
||||
<el-table-column label="申报编号" prop="applicationNo" width="160" />
|
||||
<el-table-column label="项目名称" prop="projectName" show-overflow-tooltip />
|
||||
<el-table-column label="申请人" prop="applicantName" width="120" />
|
||||
<el-table-column label="总投资(万元)" prop="totalInvestment" width="130" align="right">
|
||||
<template #default="scope">
|
||||
<span class="amount-text">{{ formatAmount(scope.row.totalInvestment) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="审批节点" prop="customNodeName" width="120" />
|
||||
<el-table-column label="提交时间" prop="startTime" width="180" />
|
||||
<el-table-column label="状态" prop="nodeStatus" width="100" align="center">
|
||||
<template #default>
|
||||
<el-tag type="warning">等待审批</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" width="200" align="center" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="View" @click="handleView(scope.row)" v-hasPermi="['cw:projectApproval:query']">查看详情</el-button>
|
||||
<el-button link type="success" icon="Check" @click="handleApprove(scope.row)" v-hasPermi="['cw:projectApproval:approve']">审批</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 分页组件 -->
|
||||
<el-pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:current-page="queryParams.pageNum"
|
||||
:page-size="queryParams.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
/>
|
||||
</el-card>
|
||||
|
||||
<!-- 审批操作对话框 -->
|
||||
<el-dialog title="审批操作" v-model="approvalDialog.visible" width="600px" append-to-body destroy-on-close>
|
||||
<div class="approval-content">
|
||||
<!-- 项目信息 -->
|
||||
<div class="project-info">
|
||||
<h4>项目信息</h4>
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="申报编号">{{ currentRecord.applicationNo }}</el-descriptions-item>
|
||||
<el-descriptions-item label="项目名称">{{ currentRecord.projectName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="申请人">{{ currentRecord.applicantName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="总投资">{{ formatAmount(currentRecord.totalInvestment) }} 万元</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
|
||||
<!-- 审批表单 -->
|
||||
<el-form ref="approvalFormRef" :model="approvalForm" :rules="approvalRules" label-width="100px">
|
||||
<el-form-item label="审批操作" prop="action">
|
||||
<el-radio-group v-model="approvalForm.action">
|
||||
<el-radio value="approve">
|
||||
<el-icon><Check /></el-icon>
|
||||
审批通过
|
||||
</el-radio>
|
||||
<el-radio value="reject">
|
||||
<el-icon><Close /></el-icon>
|
||||
审批拒绝
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="审批意见" prop="opinion">
|
||||
<el-input v-model="approvalForm.opinion" type="textarea" :rows="4" placeholder="请输入审批意见" maxlength="500" show-word-limit />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="approvalDialog.visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="submitApproval" :loading="approvalDialog.submitting"> 确认审批 </el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 详情查看对话框 -->
|
||||
<el-dialog title="项目申报详情" v-model="detailDialog.visible" width="1200px" append-to-body destroy-on-close top="20px">
|
||||
<div v-loading="detailDialog.loading">
|
||||
<ApplicationSummary v-if="detailDialog.visible && currentApplicationId" :applicationId="currentApplicationId" />
|
||||
</div>
|
||||
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="detailDialog.visible = false">关闭</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="CwProjectApprovalPending">
|
||||
import { ref, reactive, onMounted } from 'vue';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { Check, Close, Memo, View } from '@element-plus/icons-vue';
|
||||
import { getMyPendingApprovals, approveProcess, rejectProcess } from '@/api/cw/projectApproval';
|
||||
import ApplicationSummary from '@/views/cw/application/summary.vue';
|
||||
|
||||
// 数据结构用注释说明即可
|
||||
|
||||
// 查询参数
|
||||
const queryParams = reactive({
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
});
|
||||
|
||||
// 表格数据
|
||||
const pendingList = ref([]);
|
||||
const loading = ref(false);
|
||||
const total = ref(0);
|
||||
const pendingCount = ref(0);
|
||||
|
||||
// 当前审批记录
|
||||
const currentRecord = ref({});
|
||||
|
||||
// 审批对话框
|
||||
const approvalDialog = reactive({
|
||||
visible: false,
|
||||
submitting: false
|
||||
});
|
||||
|
||||
// 详情对话框
|
||||
const detailDialog = reactive({
|
||||
visible: false,
|
||||
loading: false
|
||||
});
|
||||
|
||||
// 当前查看的申请ID
|
||||
const currentApplicationId = ref('');
|
||||
|
||||
// 审批表单
|
||||
const approvalForm = reactive({
|
||||
action: 'approve',
|
||||
opinion: ''
|
||||
});
|
||||
|
||||
const approvalFormRef = ref();
|
||||
|
||||
// 审批表单验证规则
|
||||
const approvalRules = {
|
||||
action: [{ required: true, message: '请选择审批操作', trigger: 'change' }],
|
||||
opinion: [{ required: true, message: '请输入审批意见', trigger: 'blur' }]
|
||||
};
|
||||
|
||||
// 查询待审批列表
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
try {
|
||||
const response = await getMyPendingApprovals(queryParams);
|
||||
console.log('API响应数据:', response);
|
||||
|
||||
// 后端返回的是R<List<CwApprovalRecordVo>>格式
|
||||
if (response.code === 200 && response.data) {
|
||||
// R格式:{ code: 200, data: [...], msg: 'success' }
|
||||
pendingList.value = response.data || [];
|
||||
total.value = response.data.length || 0;
|
||||
pendingCount.value = response.data.length || 0;
|
||||
} else if (Array.isArray(response)) {
|
||||
// 直接数组格式
|
||||
pendingList.value = response;
|
||||
total.value = response.length;
|
||||
pendingCount.value = response.length;
|
||||
} else if (response.rows) {
|
||||
// TableDataInfo格式
|
||||
pendingList.value = response.rows || [];
|
||||
total.value = response.total || 0;
|
||||
pendingCount.value = response.total || 0;
|
||||
} else {
|
||||
// 默认情况
|
||||
pendingList.value = [];
|
||||
total.value = 0;
|
||||
pendingCount.value = 0;
|
||||
}
|
||||
|
||||
console.log('解析后的数据:', {
|
||||
count: pendingList.value.length,
|
||||
data: pendingList.value
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('加载待审批列表失败:', error);
|
||||
ElMessage.error('加载待审批列表失败');
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 查看详情
|
||||
const handleView = (row) => {
|
||||
console.log('查看详情:', row);
|
||||
if (!row.applicationId) {
|
||||
ElMessage.warning('申请ID不存在,无法查看详情');
|
||||
return;
|
||||
}
|
||||
|
||||
currentApplicationId.value = row.applicationId;
|
||||
detailDialog.visible = true;
|
||||
};
|
||||
|
||||
// 审批操作
|
||||
const handleApprove = (row) => {
|
||||
currentRecord.value = row;
|
||||
approvalForm.action = 'approve';
|
||||
approvalForm.opinion = '';
|
||||
approvalDialog.visible = true;
|
||||
};
|
||||
|
||||
// 提交审批
|
||||
const submitApproval = async () => {
|
||||
if (!approvalFormRef.value) return;
|
||||
|
||||
await approvalFormRef.value.validate(async (valid) => {
|
||||
if (valid) {
|
||||
try {
|
||||
approvalDialog.submitting = true;
|
||||
|
||||
const approvalData = {
|
||||
recordId: currentRecord.value.id,
|
||||
action: approvalForm.action,
|
||||
opinion: approvalForm.opinion
|
||||
};
|
||||
|
||||
// 统一使用 approveProcess 接口(后端会根据 action 参数处理)
|
||||
await approveProcess(approvalData);
|
||||
|
||||
ElMessage.success('审批操作成功');
|
||||
approvalDialog.visible = false;
|
||||
|
||||
// 重新加载列表
|
||||
getList();
|
||||
} catch (error) {
|
||||
ElMessage.error('审批操作失败');
|
||||
} finally {
|
||||
approvalDialog.submitting = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 格式化金额
|
||||
const formatAmount = (amount) => {
|
||||
if (!amount) return '0.00';
|
||||
return amount.toLocaleString('zh-CN', { minimumFractionDigits: 2, maximumFractionDigits: 2 });
|
||||
};
|
||||
|
||||
// 分页事件处理
|
||||
const handleSizeChange = (size) => {
|
||||
queryParams.pageSize = size;
|
||||
getList();
|
||||
};
|
||||
|
||||
const handleCurrentChange = (page) => {
|
||||
queryParams.pageNum = page;
|
||||
getList();
|
||||
};
|
||||
|
||||
// 页面挂载
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* 页面容器样式 */
|
||||
.page-container {
|
||||
background-color: #f5f7fa;
|
||||
min-height: calc(100vh - 84px);
|
||||
}
|
||||
|
||||
/* 卡片样式 */
|
||||
.header-card,
|
||||
.table-card {
|
||||
margin-bottom: 10px;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
/* 页面头部样式 */
|
||||
.header-content {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.header-info {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.page-title {
|
||||
margin: 0 0 8px 0;
|
||||
font-size: 20px;
|
||||
font-weight: 600;
|
||||
color: #1f2329;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.page-desc {
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
color: #86909c;
|
||||
}
|
||||
|
||||
.header-stats {
|
||||
display: flex;
|
||||
gap: 24px;
|
||||
}
|
||||
|
||||
.stat-item {
|
||||
text-align: center;
|
||||
padding: 12px 20px;
|
||||
background: linear-gradient(135deg, #409eff, #66b3ff);
|
||||
border-radius: 8px;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.stat-number {
|
||||
font-size: 24px;
|
||||
font-weight: 600;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.stat-label {
|
||||
font-size: 12px;
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
/* 金额文本样式 */
|
||||
.amount-text {
|
||||
font-weight: 600;
|
||||
color: #409eff;
|
||||
}
|
||||
|
||||
/* 审批对话框样式 */
|
||||
.approval-content {
|
||||
max-height: 500px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.project-info {
|
||||
margin-bottom: 24px;
|
||||
padding: 16px;
|
||||
background: #f8f9fa;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.project-info h4 {
|
||||
margin: 0 0 16px 0;
|
||||
color: #1f2329;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
/* 响应式设计 */
|
||||
@media (max-width: 768px) {
|
||||
.header-content {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.header-stats {
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
|
||||
/* 深色模式兼容 */
|
||||
@media (prefers-color-scheme: dark) {
|
||||
.page-container {
|
||||
background-color: #1a1a1a;
|
||||
}
|
||||
|
||||
.project-info {
|
||||
background: #2a2a2a;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,168 @@
|
||||
# 项目审批人批量添加功能Bug修复报告
|
||||
|
||||
## 🐛 问题描述
|
||||
|
||||
用户反馈:批量添加审批人时,选择用户后点击提交,页面提示添加成功,但后台数据库中没有新增数据。
|
||||
|
||||
## 🔍 问题分析
|
||||
|
||||
### 根本原因
|
||||
|
||||
1. **前端使用模拟API函数**:`index.vue` 中第354-378行定义了模拟的API函数,而不是真实的API调用
|
||||
2. **缺少正确的API导入**:没有导入真实的 `batchAddProjectAuditor` 等API函数
|
||||
3. **数据格式不匹配**:前端传递的数据格式与后端期望格式存在差异
|
||||
|
||||
### 问题代码
|
||||
|
||||
```javascript
|
||||
// 错误:使用模拟函数
|
||||
const batchAddProjectAuditor = (data: any) => {
|
||||
return Promise.resolve() // 直接返回成功,不实际调用后端
|
||||
}
|
||||
```
|
||||
|
||||
## 🔧 修复方案
|
||||
|
||||
### 1. 导入真实API函数
|
||||
|
||||
```javascript
|
||||
import {
|
||||
listProjectAuditor,
|
||||
getProjectAuditor,
|
||||
updateProjectAuditor,
|
||||
delProjectAuditor,
|
||||
batchAddProjectAuditor
|
||||
} from '@/api/cw/projectAuditor'
|
||||
import type { CwProjectAuditorVO, CwProjectAuditorForm, CwProjectAuditorQuery, CwProjectAuditorBatchBo } from '@/api/cw/types'
|
||||
```
|
||||
|
||||
### 2. 修复数据类型定义
|
||||
|
||||
```typescript
|
||||
// 修正数据类型
|
||||
const auditorList = ref<CwProjectAuditorVO[]>([])
|
||||
const queryParams = ref<CwProjectAuditorQuery>({...})
|
||||
const editDialog = reactive({
|
||||
form: {} as CwProjectAuditorForm
|
||||
})
|
||||
```
|
||||
|
||||
### 3. 修复批量添加数据格式
|
||||
|
||||
```javascript
|
||||
const confirmBatchAdd = async () => {
|
||||
const userIds = batchDialog.selectedUsers.map((user) => user.userId as number)
|
||||
const data: CwProjectAuditorBatchBo = {
|
||||
userIds: userIds,
|
||||
remark: '批量添加'
|
||||
}
|
||||
|
||||
const response = await batchAddProjectAuditor(data)
|
||||
// ... 处理响应
|
||||
}
|
||||
```
|
||||
|
||||
### 4. 修复后端数据解析
|
||||
|
||||
```javascript
|
||||
const response = await listProjectAuditor(queryParams.value);
|
||||
// 后端返回的是TableDataInfo格式
|
||||
auditorList.value = response.data?.rows || [];
|
||||
total.value = response.data?.total || 0;
|
||||
```
|
||||
|
||||
## ✅ 修复内容清单
|
||||
|
||||
### 前端修复
|
||||
|
||||
- [x] 移除模拟API函数,导入真实API
|
||||
- [x] 修复TypeScript类型定义
|
||||
- [x] 修复批量添加数据格式
|
||||
- [x] 修复后端响应数据解析
|
||||
- [x] 改进错误处理和用户反馈
|
||||
- [x] 修复按钮事件类型问题
|
||||
|
||||
### 后端验证
|
||||
|
||||
- [x] 确认后端API接口正常工作
|
||||
- [x] 确认数据库表结构正确
|
||||
- [x] 确认权限控制配置
|
||||
|
||||
## 🧪 测试验证
|
||||
|
||||
### 测试用例
|
||||
|
||||
1. **批量添加功能测试**
|
||||
|
||||
- 选择部门
|
||||
- 选择多个用户
|
||||
- 点击确认添加
|
||||
- 验证数据库是否成功插入数据
|
||||
|
||||
2. **查询列表功能测试**
|
||||
|
||||
- 验证API调用正常
|
||||
- 验证数据格式解析正确
|
||||
- 验证分页功能
|
||||
|
||||
3. **错误处理测试**
|
||||
- 测试网络错误情况
|
||||
- 测试用户已存在情况
|
||||
- 测试权限不足情况
|
||||
|
||||
### 测试脚本
|
||||
|
||||
提供了 `test-api.js` 文件用于功能验证测试。
|
||||
|
||||
## 📋 技术规范遵循
|
||||
|
||||
### 符合项目规范
|
||||
|
||||
- ✅ **前端开发规范**:符合Vue 3.5.13 + TypeScript + Element Plus架构
|
||||
- ✅ **API接口规范**:使用统一的request工具和错误处理
|
||||
- ✅ **UI设计规范**:继承后勤管理模块的样式风格和颜色主题
|
||||
- ✅ **数据库规范**:使用雪花ID、逻辑删除、多租户等标准字段
|
||||
- ✅ **权限控制**:使用@SaCheckPermission注解控制接口权限
|
||||
|
||||
### 代码质量
|
||||
|
||||
- ✅ **类型安全**:完整的TypeScript类型定义
|
||||
- ✅ **错误处理**:完善的异常捕获和用户提示
|
||||
- ✅ **用户体验**:优化的加载状态和反馈信息
|
||||
- ✅ **响应式设计**:保持左右布局在不同屏幕下的表现
|
||||
|
||||
## 🚀 部署说明
|
||||
|
||||
### 验证步骤
|
||||
|
||||
1. 确保后端服务正常运行
|
||||
2. 检查数据库表 `cw_project_auditor` 是否存在
|
||||
3. 验证用户权限配置 `cw:projectAuditor:add`
|
||||
4. 测试前端页面功能
|
||||
|
||||
### 预期结果
|
||||
|
||||
- 批量添加功能正常工作
|
||||
- 数据成功写入数据库
|
||||
- 页面显示准确的成功/失败提示
|
||||
- 列表数据正确刷新
|
||||
|
||||
## 📝 修复日志
|
||||
|
||||
| 时间 | 修复内容 | 影响范围 |
|
||||
| ---------- | ---------------- | ------------------ |
|
||||
| 2025-01-03 | 修复API调用问题 | 批量添加功能 |
|
||||
| 2025-01-03 | 修复数据格式问题 | 前后端数据传递 |
|
||||
| 2025-01-03 | 修复类型定义问题 | TypeScript类型安全 |
|
||||
| 2025-01-03 | 修复响应解析问题 | 列表查询功能 |
|
||||
|
||||
## 🎯 总结
|
||||
|
||||
本次修复解决了批量添加审批人功能的根本问题,确保:
|
||||
|
||||
1. **功能正常**:批量添加能够真实地向后端发送请求并保存数据
|
||||
2. **类型安全**:完整的TypeScript类型定义和检查
|
||||
3. **用户体验**:准确的成功/失败提示和数据刷新
|
||||
4. **代码质量**:符合项目开发规范和最佳实践
|
||||
|
||||
修复后的功能完全符合需求分析文档的要求,并遵循项目的前后端开发规范。
|
||||
@@ -0,0 +1,63 @@
|
||||
# 项目审批人配置模块
|
||||
|
||||
## 功能概述
|
||||
|
||||
项目审批人配置模块用于管理项目申报审批流程中的审批人员池,支持从系统用户中选择并配置审批人员,为自定义审批流程提供人员支持。
|
||||
|
||||
## 主要功能
|
||||
|
||||
### 1. 审批人列表管理
|
||||
|
||||
- 查询审批人列表(支持分页)
|
||||
- 按用户姓名、部门、状态等条件筛选
|
||||
- 显示审批人基本信息(姓名、部门、联系方式等)
|
||||
- 支持审批人状态管理(正常/停用)
|
||||
|
||||
### 2. 批量添加审批人
|
||||
|
||||
- 通过部门树选择部门
|
||||
- 展示部门下的可用用户列表
|
||||
- 支持多选用户批量添加为审批人
|
||||
- 自动过滤已存在的审批人
|
||||
|
||||
### 3. 审批人信息维护
|
||||
|
||||
- 修改审批人联系信息
|
||||
- 更新审批人状态
|
||||
- 添加备注信息
|
||||
- 删除审批人配置
|
||||
|
||||
## 文件结构
|
||||
|
||||
```
|
||||
web/src/views/cw/projectAuditor/
|
||||
├── index.vue # 主页面组件
|
||||
└── README.md # 功能说明文档
|
||||
```
|
||||
|
||||
## API接口
|
||||
|
||||
使用的主要API接口:
|
||||
|
||||
- `listProjectAuditor` - 查询审批人列表
|
||||
- `getProjectAuditor` - 获取审批人详情
|
||||
- `updateProjectAuditor` - 更新审批人信息
|
||||
- `delProjectAuditor` - 删除审批人
|
||||
- `batchAddProjectAuditor` - 批量添加审批人
|
||||
- `getDeptUsers` - 获取部门用户列表
|
||||
|
||||
## 权限控制
|
||||
|
||||
页面功能对应的权限标识:
|
||||
|
||||
- `cw:projectAuditor:query` - 查询权限
|
||||
- `cw:projectAuditor:add` - 新增权限
|
||||
- `cw:projectAuditor:edit` - 编辑权限
|
||||
- `cw:projectAuditor:remove` - 删除权限
|
||||
|
||||
## 技术实现
|
||||
|
||||
- 基于Vue 3 Composition API
|
||||
- 使用Element Plus UI组件库
|
||||
- 集成项目标准的权限控制和国际化
|
||||
- 遵循项目统一的代码规范和样式风格
|
||||
@@ -0,0 +1,149 @@
|
||||
<template>
|
||||
<div class="debug-container">
|
||||
<h3>API调试页面</h3>
|
||||
|
||||
<el-card>
|
||||
<template #header>
|
||||
<span>测试审核人列表API</span>
|
||||
<el-button @click="testAuditorList" type="primary" style="float: right">测试API</el-button>
|
||||
</template>
|
||||
|
||||
<div v-if="loading">加载中...</div>
|
||||
|
||||
<div v-if="apiResponse">
|
||||
<h4>原始API响应:</h4>
|
||||
<pre>{{ JSON.stringify(apiResponse, null, 2) }}</pre>
|
||||
</div>
|
||||
|
||||
<div v-if="processedData">
|
||||
<h4>处理后的数据:</h4>
|
||||
<pre>{{ JSON.stringify(processedData, null, 2) }}</pre>
|
||||
</div>
|
||||
|
||||
<div v-if="auditorList.length > 0">
|
||||
<h4>审核人列表 ({{ auditorList.length }}条):</h4>
|
||||
<el-table :data="auditorList" border>
|
||||
<el-table-column prop="id" label="ID" width="80" />
|
||||
<el-table-column prop="userName" label="用户名" />
|
||||
<el-table-column prop="nickName" label="昵称" />
|
||||
<el-table-column prop="deptName" label="部门" />
|
||||
<el-table-column prop="status" label="状态" />
|
||||
</el-table>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card style="margin-top: 20px">
|
||||
<template #header>
|
||||
<span>测试部门数据API</span>
|
||||
<el-button @click="testDeptList" type="success" style="float: right">测试部门API</el-button>
|
||||
</template>
|
||||
|
||||
<div v-if="deptLoading">加载中...</div>
|
||||
|
||||
<div v-if="deptResponse">
|
||||
<h4>部门API响应:</h4>
|
||||
<pre>{{ JSON.stringify(deptResponse, null, 2) }}</pre>
|
||||
</div>
|
||||
|
||||
<div v-if="deptList.length > 0">
|
||||
<h4>部门列表 ({{ deptList.length }}条):</h4>
|
||||
<el-tree :data="deptList" :props="{ label: 'label', children: 'children' }" />
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import { listProjectAuditor } from '@/api/cw/projectAuditor';
|
||||
import { listDeptOptions } from '@/api/system/dept';
|
||||
|
||||
const loading = ref(false);
|
||||
const apiResponse = ref(null);
|
||||
const processedData = ref(null);
|
||||
const auditorList = ref([]);
|
||||
|
||||
const deptLoading = ref(false);
|
||||
const deptResponse = ref(null);
|
||||
const deptList = ref([]);
|
||||
|
||||
const testAuditorList = async () => {
|
||||
loading.value = true;
|
||||
try {
|
||||
const queryParams = {
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
};
|
||||
|
||||
const response = await listProjectAuditor(queryParams);
|
||||
apiResponse.value = response;
|
||||
console.log('审核人API原始响应:', response);
|
||||
|
||||
// 处理数据结构
|
||||
let responseData;
|
||||
if (response.data) {
|
||||
responseData = response.data;
|
||||
} else {
|
||||
responseData = response;
|
||||
}
|
||||
|
||||
processedData.value = responseData;
|
||||
|
||||
// 尝试不同的数据结构
|
||||
if (responseData.rows && Array.isArray(responseData.rows)) {
|
||||
auditorList.value = responseData.rows;
|
||||
} else if (Array.isArray(responseData)) {
|
||||
auditorList.value = responseData;
|
||||
} else if (responseData.data && Array.isArray(responseData.data)) {
|
||||
auditorList.value = responseData.data;
|
||||
} else {
|
||||
auditorList.value = [];
|
||||
}
|
||||
|
||||
console.log('处理后的审核人列表:', auditorList.value);
|
||||
} catch (error) {
|
||||
console.error('测试审核人API失败:', error);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
const testDeptList = async () => {
|
||||
deptLoading.value = true;
|
||||
try {
|
||||
const response = await listDeptOptions();
|
||||
deptResponse.value = response;
|
||||
console.log('部门API原始响应:', response);
|
||||
|
||||
// 处理数据结构
|
||||
let deptData;
|
||||
if (response.data) {
|
||||
deptData = response.data;
|
||||
} else {
|
||||
deptData = response;
|
||||
}
|
||||
|
||||
deptList.value = Array.isArray(deptData) ? deptData : [];
|
||||
console.log('处理后的部门列表:', deptList.value);
|
||||
} catch (error) {
|
||||
console.error('测试部门API失败:', error);
|
||||
} finally {
|
||||
deptLoading.value = false;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.debug-container {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
pre {
|
||||
background: #f5f5f5;
|
||||
padding: 10px;
|
||||
border-radius: 4px;
|
||||
max-height: 300px;
|
||||
overflow: auto;
|
||||
font-size: 12px;
|
||||
}
|
||||
</style>
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,142 @@
|
||||
<template>
|
||||
<div class="test-container">
|
||||
<h2>项目审核人配置页面测试</h2>
|
||||
|
||||
<div class="test-section">
|
||||
<h3>1. 数据初始化测试</h3>
|
||||
<p>部门选项: {{ deptOptions.length }} 个</p>
|
||||
<p>审核人列表: {{ auditorList.length }} 个</p>
|
||||
<p>加载状态: {{ loading ? '加载中...' : '已完成' }}</p>
|
||||
</div>
|
||||
|
||||
<div class="test-section">
|
||||
<h3>2. API响应测试</h3>
|
||||
<el-button @click="testAPI" type="primary">测试API调用</el-button>
|
||||
<pre>{{ apiResult }}</pre>
|
||||
</div>
|
||||
|
||||
<div class="test-section">
|
||||
<h3>3. 部门选择测试</h3>
|
||||
<el-tree-select v-model="selectedDept" :data="deptOptions" placeholder="选择部门" clearable style="width: 300px" />
|
||||
<p>选中部门: {{ selectedDept }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="ProjectAuditorTest">
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
|
||||
// 测试数据
|
||||
const deptOptions = ref<any[]>([]);
|
||||
const auditorList = ref<any[]>([]);
|
||||
const loading = ref(false);
|
||||
const selectedDept = ref();
|
||||
const apiResult = ref('');
|
||||
|
||||
// 模拟部门数据
|
||||
const mockDeptOptions = [
|
||||
{
|
||||
value: '1',
|
||||
label: '总公司',
|
||||
children: [
|
||||
{ value: '2', label: '财务部' },
|
||||
{ value: '3', label: '人事部' }
|
||||
]
|
||||
},
|
||||
{
|
||||
value: '4',
|
||||
label: '分公司',
|
||||
children: [
|
||||
{ value: '5', label: '技术部' },
|
||||
{ value: '6', label: '市场部' }
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
// 模拟API响应数据
|
||||
const mockApiResponse = {
|
||||
code: 200,
|
||||
msg: '操作成功',
|
||||
data: {
|
||||
rows: [
|
||||
{
|
||||
id: '1',
|
||||
userId: '1001',
|
||||
userName: '张三',
|
||||
deptName: '财务部',
|
||||
status: '1',
|
||||
createTime: '2025-01-03 10:00:00'
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
userId: '1002',
|
||||
userName: '李四',
|
||||
deptName: '人事部',
|
||||
status: '1',
|
||||
createTime: '2025-01-03 11:00:00'
|
||||
}
|
||||
],
|
||||
total: 2
|
||||
}
|
||||
};
|
||||
|
||||
// 测试API调用
|
||||
const testAPI = () => {
|
||||
loading.value = true;
|
||||
|
||||
// 模拟异步API调用
|
||||
setTimeout(() => {
|
||||
try {
|
||||
const { data } = mockApiResponse;
|
||||
auditorList.value = data?.rows || [];
|
||||
apiResult.value = JSON.stringify(data, null, 2);
|
||||
|
||||
ElMessage.success('API调用成功');
|
||||
} catch (error) {
|
||||
console.error('API调用失败:', error);
|
||||
ElMessage.error('API调用失败');
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
}, 1000);
|
||||
};
|
||||
|
||||
// 初始化数据
|
||||
const initData = () => {
|
||||
deptOptions.value = mockDeptOptions;
|
||||
ElMessage.info('测试页面初始化完成');
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
initData();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.test-container {
|
||||
padding: 20px;
|
||||
max-width: 800px;
|
||||
}
|
||||
|
||||
.test-section {
|
||||
margin-bottom: 30px;
|
||||
padding: 20px;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 8px;
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
|
||||
.test-section h3 {
|
||||
margin-top: 0;
|
||||
color: #409eff;
|
||||
}
|
||||
|
||||
pre {
|
||||
background-color: #f4f4f4;
|
||||
padding: 10px;
|
||||
border-radius: 4px;
|
||||
overflow-x: auto;
|
||||
font-size: 12px;
|
||||
}
|
||||
</style>
|
||||
@@ -148,7 +148,7 @@
|
||||
<!-- 操作按钮行 -->
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="24" class="search-btn-container">
|
||||
<el-form-item style="margin-bottom: 0;">
|
||||
<el-form-item style="margin-bottom: 0">
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
@@ -167,10 +167,14 @@
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['jcbt:povertyApplication:add']">新增申请</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate" v-hasPermi="['jcbt:povertyApplication:edit']">修改</el-button>
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate" v-hasPermi="['jcbt:povertyApplication:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete" v-hasPermi="['jcbt:povertyApplication:remove']">删除</el-button>
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete" v-hasPermi="['jcbt:povertyApplication:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['jcbt:povertyApplication:export']">导出</el-button>
|
||||
|
||||
@@ -164,7 +164,14 @@
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Close" :disabled="multiple" @click="handleBatchReject" v-hasPermi="['jcbt:povertyApplication:reject']">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Close"
|
||||
:disabled="multiple"
|
||||
@click="handleBatchReject"
|
||||
v-hasPermi="['jcbt:povertyApplication:reject']"
|
||||
>
|
||||
批量驳回
|
||||
</el-button>
|
||||
</el-col>
|
||||
|
||||
@@ -44,12 +44,7 @@
|
||||
<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 scholarshipTypeList"
|
||||
:key="type.id"
|
||||
:label="type.typeName"
|
||||
:value="type.id"
|
||||
/>
|
||||
<el-option v-for="type in scholarshipTypeList" :key="type.id" :label="type.typeName" :value="type.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -68,9 +63,9 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="10" class="mb8" >
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="24" class="search-btn-container">
|
||||
<el-form-item style="margin-bottom: 0;">
|
||||
<el-form-item style="margin-bottom: 0">
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
@@ -89,14 +84,9 @@
|
||||
<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
|
||||
@@ -106,7 +96,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>
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
</el-row>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="24" class="search-btn-container">
|
||||
<el-form-item style="margin-bottom: 0;">
|
||||
<el-form-item style="margin-bottom: 0">
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
@@ -153,33 +153,17 @@
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['jcbt:scholarshipBatch:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="Edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate()"
|
||||
v-hasPermi="['jcbt:scholarshipBatch:edit']"
|
||||
>修改</el-button>
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['jcbt:scholarshipBatch:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete()"
|
||||
v-hasPermi="['jcbt:scholarshipBatch:remove']"
|
||||
>删除</el-button>
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['jcbt:scholarshipBatch:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="Download"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['jcbt:scholarshipBatch:export']"
|
||||
>导出</el-button>
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['jcbt:scholarshipBatch:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
@@ -254,22 +238,10 @@
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="280" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="查看" placement="top">
|
||||
<el-button
|
||||
link
|
||||
type="info"
|
||||
icon="View"
|
||||
@click="handleView(scope.row)"
|
||||
v-hasPermi="['jcbt:scholarshipBatch:query']"
|
||||
></el-button>
|
||||
<el-button link type="info" icon="View" @click="handleView(scope.row)" v-hasPermi="['jcbt:scholarshipBatch:query']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="Edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['jcbt:scholarshipBatch:edit']"
|
||||
></el-button>
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['jcbt:scholarshipBatch:edit']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="状态变更" placement="top">
|
||||
<el-button
|
||||
@@ -772,7 +744,7 @@ async function handleUpdate(row?: ScholarshipBatchVO) {
|
||||
// 关键修复:不调用reset(),直接赋值数据,确保ID不会被重置为undefined
|
||||
form.value = {
|
||||
...res.data,
|
||||
id: String(_id) // 🔧 修复:确保ID为字符串格式,避免精度丢失
|
||||
id: String(_id) // 🔧 修复:确保ID为字符串格式,避免精度丢失
|
||||
};
|
||||
|
||||
// 确保scholarshipTypeIds正确赋值
|
||||
@@ -828,7 +800,7 @@ function submitForm() {
|
||||
// 不再使用parseInt(),直接使用字符串格式的ID
|
||||
const updateData = {
|
||||
...form.value,
|
||||
id: String(form.value.id) // 确保ID始终为字符串格式
|
||||
id: String(form.value.id) // 确保ID始终为字符串格式
|
||||
};
|
||||
console.log('发送到后端的修改数据:', JSON.stringify(updateData, null, 2));
|
||||
await updateScholarshipBatch(updateData);
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
</el-row>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="24" class="search-btn-container">
|
||||
<el-form-item style="margin-bottom: 0;">
|
||||
<el-form-item style="margin-bottom: 0">
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
@@ -85,45 +85,23 @@
|
||||
<el-row ref="toolbarRef" :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['jcbt:scholarshipQuota:add']">新增</el-button>
|
||||
</el-col>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="Edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate()"
|
||||
v-hasPermi="['jcbt:scholarshipQuota:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['jcbt:scholarshipQuota:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete()"
|
||||
v-hasPermi="['jcbt:scholarshipQuota:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['jcbt:scholarshipQuota:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="Download"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['jcbt:scholarshipQuota:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['jcbt:scholarshipQuota:export']">导出</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="info"
|
||||
plain
|
||||
icon="Operation"
|
||||
@click="handleBatchAllocate"
|
||||
v-hasPermi="['jcbt:scholarshipQuota:add']"
|
||||
>批量分配</el-button>
|
||||
</el-col>
|
||||
<el-button type="info" plain icon="Operation" @click="handleBatchAllocate" v-hasPermi="['jcbt:scholarshipQuota:add']">批量分配</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
@@ -178,18 +156,45 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="280" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['jcbt:scholarshipQuota:edit']" :disabled="scope.row.isLocked === 1"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['jcbt:scholarshipQuota:remove']" :disabled="scope.row.isLocked === 1"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="锁定/解锁" placement="top">
|
||||
<el-button link :type="scope.row.isLocked === 1 ? 'warning' : 'info'" :icon="scope.row.isLocked === 1 ? 'Unlock' : 'Lock'" @click="handleLock(scope.row)" v-hasPermi="['jcbt:scholarshipQuota:edit']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="调整名额" placement="top">
|
||||
<el-button link type="success" icon="Switch" @click="handleAdjust(scope.row)" v-hasPermi="['jcbt:scholarshipQuota:edit']" :disabled="scope.row.isLocked === 1"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="Edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['jcbt:scholarshipQuota:edit']"
|
||||
:disabled="scope.row.isLocked === 1"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
icon="Delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['jcbt:scholarshipQuota:remove']"
|
||||
:disabled="scope.row.isLocked === 1"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="锁定/解锁" placement="top">
|
||||
<el-button
|
||||
link
|
||||
:type="scope.row.isLocked === 1 ? 'warning' : 'info'"
|
||||
:icon="scope.row.isLocked === 1 ? 'Unlock' : 'Lock'"
|
||||
@click="handleLock(scope.row)"
|
||||
v-hasPermi="['jcbt:scholarshipQuota:edit']"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="调整名额" placement="top">
|
||||
<el-button
|
||||
link
|
||||
type="success"
|
||||
icon="Switch"
|
||||
@click="handleAdjust(scope.row)"
|
||||
v-hasPermi="['jcbt:scholarshipQuota:edit']"
|
||||
:disabled="scope.row.isLocked === 1"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -977,13 +982,13 @@ onMounted(() => {
|
||||
}
|
||||
|
||||
/* 表格卡片布局 */
|
||||
.table-card {
|
||||
margin-top: 0;
|
||||
}
|
||||
.table-card {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.table-card :deep(.el-card__body) {
|
||||
padding: 0px 20px 20px 20px !important;
|
||||
}
|
||||
.table-card :deep(.el-card__body) {
|
||||
padding: 0px 20px 20px 20px !important;
|
||||
}
|
||||
|
||||
/* 表格容器 - 支持横向滚动 */
|
||||
.table-container {
|
||||
@@ -1013,29 +1018,29 @@ onMounted(() => {
|
||||
}
|
||||
|
||||
/* Webkit 浏览器的横向滚动条样式 */
|
||||
.scroll-table :deep(.el-table__body-wrapper)::-webkit-scrollbar {
|
||||
.scroll-table :deep(.el-table__body-wrapper)::-webkit-scrollbar {
|
||||
height: 12px !important; /* 增加滚动条高度 */
|
||||
width: 12px !important;
|
||||
}
|
||||
}
|
||||
|
||||
.scroll-table :deep(.el-table__body-wrapper)::-webkit-scrollbar-track {
|
||||
.scroll-table :deep(.el-table__body-wrapper)::-webkit-scrollbar-track {
|
||||
background: #f0f0f0 !important;
|
||||
border-radius: 6px !important;
|
||||
border: 1px solid #e4e7ed !important; /* 添加边框使其更明显 */
|
||||
}
|
||||
}
|
||||
|
||||
.scroll-table :deep(.el-table__body-wrapper)::-webkit-scrollbar-thumb {
|
||||
.scroll-table :deep(.el-table__body-wrapper)::-webkit-scrollbar-thumb {
|
||||
background: #409eff !important; /* 使用主题色,更明显 */
|
||||
border-radius: 6px !important;
|
||||
border: 2px solid #f0f0f0 !important; /* 添加白色边框 */
|
||||
min-height: 20px !important; /* 确保最小高度 */
|
||||
}
|
||||
}
|
||||
|
||||
.scroll-table :deep(.el-table__body-wrapper)::-webkit-scrollbar-thumb:hover {
|
||||
.scroll-table :deep(.el-table__body-wrapper)::-webkit-scrollbar-thumb:hover {
|
||||
background: #337ecc !important; /* 悬停时更深的蓝色 */
|
||||
}
|
||||
}
|
||||
|
||||
.scroll-table :deep(.el-table__body-wrapper)::-webkit-scrollbar-thumb:active {
|
||||
.scroll-table :deep(.el-table__body-wrapper)::-webkit-scrollbar-thumb:active {
|
||||
background: #2b6cb0 !important; /* 点击时的颜色 */
|
||||
}
|
||||
|
||||
@@ -1065,13 +1070,13 @@ onMounted(() => {
|
||||
}
|
||||
|
||||
/* 分页容器样式 */
|
||||
.pagination-container {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
padding: 16px 20px 0 0 !important;
|
||||
background-color: #fff;
|
||||
margin-top: 0px !important;
|
||||
}
|
||||
.pagination-container {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
padding: 16px 20px 0 0 !important;
|
||||
background-color: #fff;
|
||||
margin-top: 0px !important;
|
||||
}
|
||||
|
||||
/* 移除按钮栏底部边框 */
|
||||
.button-card :deep(.el-card__header) {
|
||||
|
||||
@@ -140,7 +140,7 @@
|
||||
<!-- 操作按钮行 -->
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="24" class="search-btn-container">
|
||||
<el-form-item style="margin-bottom: 0;">
|
||||
<el-form-item style="margin-bottom: 0">
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
|
||||
@@ -69,9 +69,9 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="10" class="mb8" >
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="24" class="search-btn-container">
|
||||
<el-form-item style="margin-bottom: 0;">
|
||||
<el-form-item style="margin-bottom: 0">
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
@@ -88,36 +88,20 @@
|
||||
<el-row ref="toolbarRef" :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['jcbt:scholarshipType:add']">新增</el-button>
|
||||
</el-col>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="Edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate()"
|
||||
v-hasPermi="['jcbt:scholarshipType:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['jcbt:scholarshipType:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete()"
|
||||
v-hasPermi="['jcbt:scholarshipType:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['jcbt:scholarshipType:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="Download"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['jcbt:scholarshipType:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['jcbt:scholarshipType:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
@@ -180,15 +164,15 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="280" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="查看" placement="top">
|
||||
<el-tooltip content="查看" placement="top">
|
||||
<el-button link type="info" icon="View" @click="handleView(scope.row)" v-hasPermi="['jcbt:scholarshipType:query']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="修改" placement="top">
|
||||
</el-tooltip>
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['jcbt:scholarshipType:edit']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['jcbt:scholarshipType:remove']"></el-button>
|
||||
</el-tooltip>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -646,19 +630,21 @@ const getExclusiveRelationText = (scholarshipTypeId: string | number): string =>
|
||||
}
|
||||
|
||||
// 异步获取并缓存
|
||||
getExclusiveRelationDisplay(scholarshipTypeId).then(response => {
|
||||
exclusiveRelationCache.value.set(scholarshipTypeId, response.data);
|
||||
}).catch(error => {
|
||||
console.warn('获取互斥关系显示文本失败:', error);
|
||||
exclusiveRelationCache.value.set(scholarshipTypeId, '互斥(无)');
|
||||
});
|
||||
getExclusiveRelationDisplay(scholarshipTypeId)
|
||||
.then((response) => {
|
||||
exclusiveRelationCache.value.set(scholarshipTypeId, response.data);
|
||||
})
|
||||
.catch((error) => {
|
||||
console.warn('获取互斥关系显示文本失败:', error);
|
||||
exclusiveRelationCache.value.set(scholarshipTypeId, '互斥(无)');
|
||||
});
|
||||
|
||||
return '加载中...';
|
||||
};
|
||||
|
||||
/** 预加载互斥关系显示文本 */
|
||||
const preloadExclusiveRelations = async () => {
|
||||
const customTypes = scholarshipTypeList.value.filter(item => item.compatibilityType === 'CUSTOM');
|
||||
const customTypes = scholarshipTypeList.value.filter((item) => item.compatibilityType === 'CUSTOM');
|
||||
|
||||
for (const type of customTypes) {
|
||||
if (type.id && !exclusiveRelationCache.value.has(type.id)) {
|
||||
@@ -967,13 +953,13 @@ onMounted(() => {
|
||||
}
|
||||
|
||||
/* 表格卡片布局 */
|
||||
.table-card {
|
||||
margin-top: 0;
|
||||
}
|
||||
.table-card {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.table-card :deep(.el-card__body) {
|
||||
padding: 0px 20px 20px 20px !important;
|
||||
}
|
||||
.table-card :deep(.el-card__body) {
|
||||
padding: 0px 20px 20px 20px !important;
|
||||
}
|
||||
|
||||
/* 表格容器 - 支持横向滚动 */
|
||||
.table-container {
|
||||
@@ -1003,29 +989,29 @@ onMounted(() => {
|
||||
}
|
||||
|
||||
/* Webkit 浏览器的横向滚动条样式 */
|
||||
.scroll-table :deep(.el-table__body-wrapper)::-webkit-scrollbar {
|
||||
.scroll-table :deep(.el-table__body-wrapper)::-webkit-scrollbar {
|
||||
height: 12px !important; /* 增加滚动条高度 */
|
||||
width: 12px !important;
|
||||
}
|
||||
}
|
||||
|
||||
.scroll-table :deep(.el-table__body-wrapper)::-webkit-scrollbar-track {
|
||||
.scroll-table :deep(.el-table__body-wrapper)::-webkit-scrollbar-track {
|
||||
background: #f0f0f0 !important;
|
||||
border-radius: 6px !important;
|
||||
border: 1px solid #e4e7ed !important; /* 添加边框使其更明显 */
|
||||
}
|
||||
}
|
||||
|
||||
.scroll-table :deep(.el-table__body-wrapper)::-webkit-scrollbar-thumb {
|
||||
.scroll-table :deep(.el-table__body-wrapper)::-webkit-scrollbar-thumb {
|
||||
background: #409eff !important; /* 使用主题色,更明显 */
|
||||
border-radius: 6px !important;
|
||||
border: 2px solid #f0f0f0 !important; /* 添加白色边框 */
|
||||
min-height: 20px !important; /* 确保最小高度 */
|
||||
}
|
||||
}
|
||||
|
||||
.scroll-table :deep(.el-table__body-wrapper)::-webkit-scrollbar-thumb:hover {
|
||||
.scroll-table :deep(.el-table__body-wrapper)::-webkit-scrollbar-thumb:hover {
|
||||
background: #337ecc !important; /* 悬停时更深的蓝色 */
|
||||
}
|
||||
}
|
||||
|
||||
.scroll-table :deep(.el-table__body-wrapper)::-webkit-scrollbar-thumb:active {
|
||||
.scroll-table :deep(.el-table__body-wrapper)::-webkit-scrollbar-thumb:active {
|
||||
background: #2b6cb0 !important; /* 点击时的颜色 */
|
||||
}
|
||||
|
||||
@@ -1055,13 +1041,13 @@ onMounted(() => {
|
||||
}
|
||||
|
||||
/* 分页容器样式 */
|
||||
.pagination-container {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
padding: 16px 20px 0 0 !important;
|
||||
background-color: #fff;
|
||||
margin-top: 0px !important;
|
||||
}
|
||||
.pagination-container {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
padding: 16px 20px 0 0 !important;
|
||||
background-color: #fff;
|
||||
margin-top: 0px !important;
|
||||
}
|
||||
|
||||
/* 移除按钮栏底部边框 */
|
||||
.button-card :deep(.el-card__header) {
|
||||
@@ -1074,23 +1060,23 @@ onMounted(() => {
|
||||
color: #e74c3c;
|
||||
}
|
||||
|
||||
/* 对话框样式 */
|
||||
.dialog-footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 10px;
|
||||
/* 对话框样式 */
|
||||
.dialog-footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.dialog-form {
|
||||
.el-form-item {
|
||||
margin-bottom: 18px;
|
||||
}
|
||||
|
||||
.dialog-form {
|
||||
.el-form-item {
|
||||
margin-bottom: 18px;
|
||||
}
|
||||
|
||||
.form-tip {
|
||||
font-size: 12px;
|
||||
color: #909399;
|
||||
margin-top: 4px;
|
||||
line-height: 1.4;
|
||||
.form-tip {
|
||||
font-size: 12px;
|
||||
color: #909399;
|
||||
margin-top: 4px;
|
||||
line-height: 1.4;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -227,7 +227,9 @@
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button icon="Download" @click="handleExportApplications" v-hasPermi="['rs:application:export']" style="display: none">导出</el-button>
|
||||
<el-button icon="Download" @click="handleExportApplications" v-hasPermi="['rs:application:export']" style="display: none"
|
||||
>导出</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button icon="Printer" @click="handlePrintApplications" style="display: none">打印</el-button>
|
||||
@@ -424,8 +426,16 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="application-table mt-4">
|
||||
<el-table v-loading="applicationLoading" :data="applicationList" border size="small" class="compact-table" :row-style="{ height: '32px' }" :cell-style="{ padding: '2px 0' }">
|
||||
<div class="application-table mt-4">
|
||||
<el-table
|
||||
v-loading="applicationLoading"
|
||||
:data="applicationList"
|
||||
border
|
||||
size="small"
|
||||
class="compact-table"
|
||||
:row-style="{ height: '32px' }"
|
||||
:cell-style="{ padding: '2px 0' }"
|
||||
>
|
||||
<el-table-column label="应聘者" align="center" prop="applicantName" width="110" />
|
||||
<el-table-column label="申请状态" align="center" prop="status" width="110">
|
||||
<template #default="scope">
|
||||
@@ -1996,7 +2006,7 @@ onMounted(() => {
|
||||
/* 紧凑表格样式 */
|
||||
.compact-table {
|
||||
font-size: 13px;
|
||||
|
||||
|
||||
:deep(.el-table__header) {
|
||||
th {
|
||||
padding: 4px 0;
|
||||
@@ -2004,14 +2014,14 @@ onMounted(() => {
|
||||
height: 32px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
:deep(.el-table__body) {
|
||||
td {
|
||||
padding: 4px 0;
|
||||
font-size: 13px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
:deep(.cell) {
|
||||
padding: 0 4px;
|
||||
line-height: 1.3;
|
||||
|
||||
@@ -69,9 +69,9 @@
|
||||
</template>
|
||||
|
||||
<!-- 待审批申请表格 -->
|
||||
<el-table v-loading="pendingLoading" border :data="pendingList" @row-dblclick="handleViewApplication" v-hasPermi="['rs:overseas:list']">
|
||||
<el-table-column label="申请人" align="center" prop="applicantName" width="100" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="所属部门" align="center" prop="department" width="140" :show-overflow-tooltip="true" />
|
||||
<el-table v-loading="pendingLoading" border :data="pendingList" @row-dblclick="handleViewApplication" v-hasPermi="['rs:overseas:list']">
|
||||
<el-table-column label="申请人" align="center" prop="applicantName" width="100" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="所属部门" align="center" prop="department" width="140" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="出国目的" align="center" prop="purposeText" width="100" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="目的地" align="center" prop="destination" width="120" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="出国时间" align="center" min-width="220" :show-overflow-tooltip="true">
|
||||
@@ -198,11 +198,11 @@
|
||||
</template>
|
||||
|
||||
<!-- 审批记录表格 -->
|
||||
<el-table v-loading="recordLoading" border :data="recordList" @row-dblclick="handleViewRecord" v-hasPermi="['rs:overseas:list']">
|
||||
<el-table-column label="申请人" align="center" prop="applicantName" width="100" :show-overflow-tooltip="true" />
|
||||
<el-table v-loading="recordLoading" border :data="recordList" @row-dblclick="handleViewRecord" v-hasPermi="['rs:overseas:list']">
|
||||
<el-table-column label="申请人" align="center" prop="applicantName" width="100" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="出国目的" align="center" prop="purposeText" width="100" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="目的地" align="center" prop="destination" width="120" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="所属部门" align="center" prop="department" width="140" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="所属部门" align="center" prop="department" width="140" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="出国时间" align="center" min-width="220" :show-overflow-tooltip="true">
|
||||
<template #default="scope"> {{ formatDate(scope.row.startDate) }} 至 {{ formatDate(scope.row.endDate) }} </template>
|
||||
</el-table-column>
|
||||
@@ -634,7 +634,6 @@ const resetRecordQuery = () => {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// 查看申请详情
|
||||
const handleViewApplication = async (row: OverseasApplicationVO) => {
|
||||
try {
|
||||
@@ -821,8 +820,6 @@ const getApprovalStatusTagType = (status: string): 'success' | 'warning' | 'dang
|
||||
};
|
||||
return typeMap[status] || 'info';
|
||||
};
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
@@ -55,7 +54,9 @@
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAddApplication" v-hasPermi="['rs:overseas:add']">新增申请</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button icon="Download" @click="handleExportApplication" v-hasPermi="['rs:overseas:export']" style="display: none">导出</el-button>
|
||||
<el-button icon="Download" @click="handleExportApplication" v-hasPermi="['rs:overseas:export']" style="display: none"
|
||||
>导出</el-button
|
||||
>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showApplicationSearch" @queryTable="getApplicationList"></right-toolbar>
|
||||
</el-row>
|
||||
@@ -316,12 +317,13 @@
|
||||
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button
|
||||
type="primary"
|
||||
:loading="state.submitLoading"
|
||||
<el-button
|
||||
type="primary"
|
||||
:loading="state.submitLoading"
|
||||
@click="submitApplicationForm"
|
||||
v-hasPermi="state.applicationForm.applicationId ? ['rs:overseas:edit'] : ['rs:overseas:add', 'rs:overseas:submit']"
|
||||
>确 定</el-button>
|
||||
>确 定</el-button
|
||||
>
|
||||
<el-button @click="cancelApplicationForm">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
@@ -543,8 +545,6 @@ const state = reactive({
|
||||
status: '0'
|
||||
},
|
||||
|
||||
|
||||
|
||||
// 字典数据
|
||||
statusOptions: [
|
||||
{ label: '待审核', value: '0' },
|
||||
@@ -723,8 +723,6 @@ const resetRecordQuery = () => {
|
||||
getRecordList();
|
||||
};
|
||||
|
||||
|
||||
|
||||
// 新增申请
|
||||
const handleAddApplication = () => {
|
||||
resetApplicationForm();
|
||||
|
||||
@@ -64,7 +64,9 @@
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['rs:overseas:export']" style="display: none">导出</el-button>
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['rs:overseas:export']" style="display: none"
|
||||
>导出</el-button
|
||||
>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
@@ -534,7 +536,7 @@ function resetQuery() {
|
||||
} catch (error) {
|
||||
console.error('重置查询条件时发生错误:', error);
|
||||
// 即使出错也要重新查询
|
||||
handleQuery();
|
||||
handleQuery();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -565,7 +567,7 @@ function resetRecordQuery() {
|
||||
} catch (error) {
|
||||
console.error('重置查询条件时发生错误:', error);
|
||||
// 即使出错也要重新查询
|
||||
handleRecordQuery();
|
||||
handleRecordQuery();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -663,14 +665,14 @@ function submitForm() {
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const _approvalIds = row.approvalId || ids.value;
|
||||
|
||||
|
||||
let confirmMessage = '';
|
||||
if (row) {
|
||||
confirmMessage = `是否确认删除申请人"${row.applicantName}"前往"${row.destination}"的审批记录?`;
|
||||
} else {
|
||||
confirmMessage = `是否确认删除选中的${ids.value.length}条审批记录?`;
|
||||
}
|
||||
|
||||
|
||||
proxy.$modal
|
||||
.confirm(confirmMessage)
|
||||
.then(function () {
|
||||
|
||||
@@ -420,13 +420,13 @@ onMounted(() => {
|
||||
.el-breadcrumb {
|
||||
margin: 0 auto;
|
||||
padding: 0 30px;
|
||||
|
||||
|
||||
:deep(.el-breadcrumb__item) {
|
||||
.el-breadcrumb__inner {
|
||||
color: #666;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
|
||||
&:last-child .el-breadcrumb__inner {
|
||||
color: #2d5a3d;
|
||||
font-weight: 500;
|
||||
@@ -488,10 +488,10 @@ onMounted(() => {
|
||||
font-size: 1rem;
|
||||
position: relative;
|
||||
border: none;
|
||||
|
||||
|
||||
// 默认状态 - 普通导航项
|
||||
background: #004e48;
|
||||
|
||||
|
||||
&:hover {
|
||||
background: #006157;
|
||||
}
|
||||
@@ -501,7 +501,7 @@ onMounted(() => {
|
||||
background: #003a37;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
|
||||
|
||||
// 创建右箭头效果
|
||||
&::after {
|
||||
content: '';
|
||||
@@ -516,7 +516,7 @@ onMounted(() => {
|
||||
border-bottom: 15px solid transparent;
|
||||
z-index: 3;
|
||||
}
|
||||
|
||||
|
||||
// 箭头阴影效果
|
||||
&::before {
|
||||
content: '';
|
||||
@@ -539,7 +539,7 @@ onMounted(() => {
|
||||
color: #ffffff;
|
||||
transition: color 0.2s ease;
|
||||
}
|
||||
|
||||
|
||||
span {
|
||||
font-size: 1rem;
|
||||
letter-spacing: 0.5px;
|
||||
@@ -558,18 +558,18 @@ onMounted(() => {
|
||||
border-radius: 8px;
|
||||
border: 1px solid #e8e8e8;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
|
||||
|
||||
|
||||
:deep(.el-card__header) {
|
||||
background: #fafafa;
|
||||
border-bottom: 1px solid #e8e8e8;
|
||||
padding: 16px 20px;
|
||||
}
|
||||
|
||||
|
||||
:deep(.el-card__body) {
|
||||
padding: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.list-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
@@ -596,19 +596,19 @@ onMounted(() => {
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.view-options {
|
||||
:deep(.el-radio-group) {
|
||||
.el-radio-button__inner {
|
||||
background: #fff;
|
||||
border-color: #2d5a3d;
|
||||
color: #2d5a3d;
|
||||
|
||||
|
||||
&:hover {
|
||||
color: #2d5a3d;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.el-radio-button__original-radio:checked + .el-radio-button__inner {
|
||||
background: #2d5a3d;
|
||||
border-color: #2d5a3d;
|
||||
@@ -622,21 +622,21 @@ onMounted(() => {
|
||||
:deep(.el-table) {
|
||||
.el-table__header {
|
||||
background: #fafafa;
|
||||
|
||||
|
||||
th {
|
||||
background: #fafafa !important;
|
||||
color: #333;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.el-table__row {
|
||||
&:hover {
|
||||
background: #f8f9fa;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.job-title-link {
|
||||
font-weight: 500;
|
||||
color: #2d5a3d;
|
||||
@@ -672,12 +672,12 @@ onMounted(() => {
|
||||
.el-button {
|
||||
background: #2d5a3d;
|
||||
border-color: #2d5a3d;
|
||||
|
||||
|
||||
&:hover {
|
||||
background: #4a7c59;
|
||||
border-color: #4a7c59;
|
||||
}
|
||||
|
||||
|
||||
&:disabled {
|
||||
background: #ccc;
|
||||
border-color: #ccc;
|
||||
@@ -692,11 +692,11 @@ onMounted(() => {
|
||||
// 对话框样式优化
|
||||
:deep(.el-dialog) {
|
||||
border-radius: 8px;
|
||||
|
||||
|
||||
.el-dialog__header {
|
||||
background: #fafafa;
|
||||
border-bottom: 1px solid #e8e8e8;
|
||||
|
||||
|
||||
.el-dialog__title {
|
||||
color: #2d5a3d;
|
||||
font-weight: 600;
|
||||
@@ -723,7 +723,7 @@ onMounted(() => {
|
||||
color: #666;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
|
||||
.el-tag {
|
||||
&.el-tag--success {
|
||||
background: #e8f5e8;
|
||||
@@ -771,11 +771,11 @@ onMounted(() => {
|
||||
|
||||
.el-button {
|
||||
margin-left: 10px;
|
||||
|
||||
|
||||
&.el-button--primary {
|
||||
background: #2d5a3d;
|
||||
border-color: #2d5a3d;
|
||||
|
||||
|
||||
&:hover {
|
||||
background: #4a7c59;
|
||||
border-color: #4a7c59;
|
||||
|
||||
+269
-262
File diff suppressed because it is too large.
Load diff
@@ -57,7 +57,13 @@
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button icon="Download" @click="handleExportTrainingApplication" v-hasPermi="['rs:trainingapproval:export']" style="display: none">导出</el-button>
|
||||
<el-button
|
||||
icon="Download"
|
||||
@click="handleExportTrainingApplication"
|
||||
v-hasPermi="['rs:trainingapproval:export']"
|
||||
style="display: none"
|
||||
>导出</el-button
|
||||
>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showApplicationSearch" @queryTable="getApplicationList"></right-toolbar>
|
||||
</el-row>
|
||||
@@ -120,7 +126,7 @@
|
||||
</el-tab-pane>
|
||||
|
||||
<!-- 审批记录选项卡 -->
|
||||
<el-tab-pane label="审批记录" name="approvalRecord" v-hasPermi="['rs:trainingapproval:query']">
|
||||
<el-tab-pane label="审批记录" name="approvalRecord" v-hasPermi="['rs:trainingapproval:query']">
|
||||
<!-- 搜索区域 -->
|
||||
<transition :enter-active-class="animate.searchAnimate.enter" :leave-active-class="animate.searchAnimate.leave">
|
||||
<div v-show="showApprovalRecordSearch" class="mb-[10px]">
|
||||
@@ -167,7 +173,9 @@
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button icon="Download" @click="handleExportApprovalRecord" v-hasPermi="['rs:trainingapproval:export']" style="display: none">导出</el-button>
|
||||
<el-button icon="Download" @click="handleExportApprovalRecord" v-hasPermi="['rs:trainingapproval:export']" style="display: none"
|
||||
>导出</el-button
|
||||
>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showApprovalRecordSearch" @queryTable="getApprovalRecordList"></right-toolbar>
|
||||
</el-row>
|
||||
@@ -704,12 +712,12 @@ const getApplicationList = async () => {
|
||||
// 排除已通过状态的数据,只显示待审核、已拒绝、已取消等状态
|
||||
excludeStatus: '1' // 1表示已通过状态
|
||||
};
|
||||
|
||||
|
||||
const response = await listTrainingApplication(queryParams);
|
||||
|
||||
|
||||
// 前端二次过滤,确保不显示已通过的数据
|
||||
const filteredApplications = response.rows.filter(app => app.status !== '1');
|
||||
|
||||
const filteredApplications = response.rows.filter((app) => app.status !== '1');
|
||||
|
||||
applicationList.value = filteredApplications;
|
||||
applicationTotal.value = filteredApplications.length;
|
||||
} catch (error) {
|
||||
|
||||
@@ -38,9 +38,15 @@
|
||||
<!-- 主办方信息区域 -->
|
||||
<el-divider content-position="left">主办方信息</el-divider>
|
||||
<el-descriptions :column="3" border class="organizer-info-section custom-width-organizer">
|
||||
<el-descriptions-item label="主办方名称" :label-style="{ width: '13%' }" :content-style="{ width: '35%' }">{{ activity.organizerName || '暂无' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="联系人" :label-style="{ width: '10%' }" :content-style="{ width: '15%' }">{{ activity.organizerContact || '暂无' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="联系电话" :label-style="{ width: '10%' }" :content-style="{ width: '17%' }">{{ activity.organizerPhone || '暂无' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="主办方名称" :label-style="{ width: '13%' }" :content-style="{ width: '35%' }">{{
|
||||
activity.organizerName || '暂无'
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="联系人" :label-style="{ width: '10%' }" :content-style="{ width: '15%' }">{{
|
||||
activity.organizerContact || '暂无'
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="联系电话" :label-style="{ width: '10%' }" :content-style="{ width: '17%' }">{{
|
||||
activity.organizerPhone || '暂无'
|
||||
}}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
<!-- 承办方信息区域 -->
|
||||
@@ -48,9 +54,15 @@
|
||||
<div v-if="coOrganizerList.length > 0">
|
||||
<div v-for="(organizer, index) in coOrganizerList" :key="index" class="co-organizer-item custom-width-co-organizer">
|
||||
<el-descriptions :column="3" border>
|
||||
<el-descriptions-item label="承办方名称" :label-style="{ width: '12%' }" :content-style="{ width: '36%' }">{{ organizer.name || '暂无' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="联系人" :label-style="{ width: '10%' }" :content-style="{ width: '16%' }">{{ organizer.contact || '暂无' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="联系电话" :label-style="{ width: '10%' }" :content-style="{ width: '16%' }">{{ organizer.phone || '暂无' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="承办方名称" :label-style="{ width: '12%' }" :content-style="{ width: '36%' }">{{
|
||||
organizer.name || '暂无'
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="联系人" :label-style="{ width: '10%' }" :content-style="{ width: '16%' }">{{
|
||||
organizer.contact || '暂无'
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="联系电话" :label-style="{ width: '10%' }" :content-style="{ width: '16%' }">{{
|
||||
organizer.phone || '暂无'
|
||||
}}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
</div>
|
||||
@@ -61,10 +73,18 @@
|
||||
<div v-if="instructorList.length > 0">
|
||||
<div v-for="(instructor, index) in instructorList" :key="index" class="instructor-item custom-width-instructor">
|
||||
<el-descriptions :column="4" border size="small">
|
||||
<el-descriptions-item label="姓名" :label-style="{ width: '8%' }" :content-style="{ width: '15%' }">{{ instructor.name || '暂无' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="部门" :label-style="{ width: '8%' }" :content-style="{ width: '17%' }">{{ instructor.dept || '暂无' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="电话" :label-style="{ width: '8%' }" :content-style="{ width: '15%' }">{{ instructor.phone || '暂无' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="邮箱" :label-style="{ width: '8%' }" :content-style="{ width: '17%' }">{{ instructor.email || '暂无' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="姓名" :label-style="{ width: '8%' }" :content-style="{ width: '15%' }">{{
|
||||
instructor.name || '暂无'
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="部门" :label-style="{ width: '8%' }" :content-style="{ width: '17%' }">{{
|
||||
instructor.dept || '暂无'
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="电话" :label-style="{ width: '8%' }" :content-style="{ width: '15%' }">{{
|
||||
instructor.phone || '暂无'
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="邮箱" :label-style="{ width: '8%' }" :content-style="{ width: '17%' }">{{
|
||||
instructor.email || '暂无'
|
||||
}}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
</div>
|
||||
@@ -203,11 +223,16 @@ const props = defineProps<Props>();
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { stgl_activity_type, stgl_activity_status, stgl_registration_type, stgl_registration_status, stgl_activity_range, sys_yes_no } = toRefs<any>(
|
||||
proxy?.useDict('stgl_activity_type', 'stgl_activity_status', 'stgl_registration_type', 'stgl_registration_status', 'stgl_activity_range', 'sys_yes_no')
|
||||
proxy?.useDict(
|
||||
'stgl_activity_type',
|
||||
'stgl_activity_status',
|
||||
'stgl_registration_type',
|
||||
'stgl_registration_status',
|
||||
'stgl_activity_range',
|
||||
'sys_yes_no'
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
|
||||
// 当前激活的Tab页签
|
||||
const activeTab = ref('basic');
|
||||
|
||||
@@ -585,25 +610,25 @@ onMounted(() => {
|
||||
.el-descriptions__header {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
|
||||
.el-descriptions__title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
|
||||
.el-descriptions__body {
|
||||
.el-descriptions__table {
|
||||
.el-descriptions__cell {
|
||||
padding: 12px 16px;
|
||||
}
|
||||
|
||||
|
||||
.el-descriptions__label {
|
||||
font-weight: 500;
|
||||
color: #606266;
|
||||
background-color: #fafafa;
|
||||
}
|
||||
|
||||
|
||||
.el-descriptions__content {
|
||||
color: #303133;
|
||||
}
|
||||
@@ -624,7 +649,7 @@ onMounted(() => {
|
||||
.activity-detail-view {
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
|
||||
:deep(.el-descriptions) {
|
||||
.el-descriptions__body {
|
||||
.el-descriptions__table {
|
||||
@@ -634,7 +659,7 @@ onMounted(() => {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.co-organizer-item,
|
||||
.instructor-item {
|
||||
padding: 12px;
|
||||
|
||||
@@ -3,24 +3,15 @@
|
||||
<el-tabs v-model="activeTab" type="border-card" @tab-change="handleTabChange">
|
||||
<!-- 已报名标签页 -->
|
||||
<el-tab-pane label="已报名" name="registered">
|
||||
<RegisteredMembersTab
|
||||
:activity-id="activityId"
|
||||
:activity-name="activityName"
|
||||
ref="registeredTabRef"
|
||||
/>
|
||||
<RegisteredMembersTab :activity-id="activityId" :activity-name="activityName" ref="registeredTabRef" />
|
||||
</el-tab-pane>
|
||||
|
||||
|
||||
<!-- 待审核标签页 -->
|
||||
<el-tab-pane label="待审核" name="pending">
|
||||
<PendingMembersTab
|
||||
:activity-id="activityId"
|
||||
:activity-name="activityName"
|
||||
ref="pendingTabRef"
|
||||
@refresh-other-tabs="handleRefreshOtherTabs"
|
||||
/>
|
||||
<PendingMembersTab :activity-id="activityId" :activity-name="activityName" ref="pendingTabRef" @refresh-other-tabs="handleRefreshOtherTabs" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="handleClose">关 闭</el-button>
|
||||
@@ -57,18 +48,21 @@ const handleVisibleChange = (value: boolean) => {
|
||||
};
|
||||
|
||||
// 监听弹窗显示状态,当弹窗打开时刷新数据
|
||||
watch(() => props.visible, (newVal) => {
|
||||
if (newVal) {
|
||||
// 弹窗打开时刷新当前标签页数据
|
||||
nextTick(() => {
|
||||
if (activeTab.value === 'registered' && registeredTabRef.value) {
|
||||
registeredTabRef.value.getList();
|
||||
} else if (activeTab.value === 'pending' && pendingTabRef.value) {
|
||||
pendingTabRef.value.getList();
|
||||
}
|
||||
});
|
||||
watch(
|
||||
() => props.visible,
|
||||
(newVal) => {
|
||||
if (newVal) {
|
||||
// 弹窗打开时刷新当前标签页数据
|
||||
nextTick(() => {
|
||||
if (activeTab.value === 'registered' && registeredTabRef.value) {
|
||||
registeredTabRef.value.getList();
|
||||
} else if (activeTab.value === 'pending' && pendingTabRef.value) {
|
||||
pendingTabRef.value.getList();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
);
|
||||
|
||||
// 标签页切换时刷新数据
|
||||
const handleTabChange = (tabName: string) => {
|
||||
@@ -127,4 +121,4 @@ defineExpose({
|
||||
:deep(.el-tabs__content) {
|
||||
padding: 20px 0;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
<div v-else>
|
||||
<!-- 移除统计信息部分 -->
|
||||
|
||||
|
||||
<el-table :data="ratings" height="600" border stripe>
|
||||
<!-- 基本信息 - 减少宽度 -->
|
||||
<el-table-column label="评分人信息" width="160" fixed="left">
|
||||
@@ -18,7 +18,7 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<!-- 所属信息 - 减少宽度 -->
|
||||
<el-table-column label="所属信息" width="140">
|
||||
<template #default="scope">
|
||||
@@ -117,19 +117,23 @@ const averageRating = computed(() => {
|
||||
// 计算最高评分
|
||||
const maxRating = computed(() => {
|
||||
if (ratings.value.length === 0) return 0;
|
||||
return Math.max(...ratings.value.map((rating) => {
|
||||
const score = typeof rating.ratingScore === 'string' ? parseFloat(rating.ratingScore) : rating.ratingScore;
|
||||
return isNaN(score) ? 0 : score;
|
||||
}));
|
||||
return Math.max(
|
||||
...ratings.value.map((rating) => {
|
||||
const score = typeof rating.ratingScore === 'string' ? parseFloat(rating.ratingScore) : rating.ratingScore;
|
||||
return isNaN(score) ? 0 : score;
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
// 计算最低评分
|
||||
const minRating = computed(() => {
|
||||
if (ratings.value.length === 0) return 0;
|
||||
return Math.min(...ratings.value.map((rating) => {
|
||||
const score = typeof rating.ratingScore === 'string' ? parseFloat(rating.ratingScore) : rating.ratingScore;
|
||||
return isNaN(score) ? 0 : score;
|
||||
}));
|
||||
return Math.min(
|
||||
...ratings.value.map((rating) => {
|
||||
const score = typeof rating.ratingScore === 'string' ? parseFloat(rating.ratingScore) : rating.ratingScore;
|
||||
return isNaN(score) ? 0 : score;
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
// 简化的日期时间格式化
|
||||
@@ -171,12 +175,16 @@ const loadRatings = async () => {
|
||||
};
|
||||
|
||||
// 监听 activityId 变化,自动重新加载评分数据
|
||||
watch(() => props.activityId, (newId, oldId) => {
|
||||
console.log('活动ID发生变化:', oldId, '->', newId);
|
||||
if (newId && newId !== oldId) {
|
||||
loadRatings();
|
||||
}
|
||||
}, { immediate: true }); // immediate: true 确保组件挂载时也会执行一次
|
||||
watch(
|
||||
() => props.activityId,
|
||||
(newId, oldId) => {
|
||||
console.log('活动ID发生变化:', oldId, '->', newId);
|
||||
if (newId && newId !== oldId) {
|
||||
loadRatings();
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
); // immediate: true 确保组件挂载时也会执行一次
|
||||
|
||||
// 移除 onMounted,因为 watch 的 immediate: true 已经覆盖了这个功能
|
||||
</script>
|
||||
|
||||
@@ -3,26 +3,26 @@
|
||||
<!-- 搜索区域 -->
|
||||
<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="always" style="padding: 8px 16px;">
|
||||
<el-form ref="queryFormRef" :model="queryParams" label-width="80px" style="padding: 0;">
|
||||
<el-card shadow="always" style="padding: 8px 16px">
|
||||
<el-form ref="queryFormRef" :model="queryParams" label-width="80px" style="padding: 0">
|
||||
<el-row :gutter="16" align="middle">
|
||||
<el-col :span="5">
|
||||
<el-form-item label="姓名" prop="studentName" style="margin-bottom: 0;">
|
||||
<el-form-item label="姓名" prop="studentName" style="margin-bottom: 0">
|
||||
<el-input v-model="queryParams.studentName" placeholder="请输入姓名" clearable size="small" @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="学号" prop="studentNo" style="margin-bottom: 0;">
|
||||
<el-form-item label="学号" prop="studentNo" style="margin-bottom: 0">
|
||||
<el-input v-model="queryParams.studentNo" placeholder="请输入学号" clearable size="small" @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="联系方式" prop="phone" style="margin-bottom: 0;">
|
||||
<el-form-item label="联系方式" prop="phone" style="margin-bottom: 0">
|
||||
<el-input v-model="queryParams.phone" placeholder="请输入联系方式" clearable size="small" @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item style="margin-bottom: 0;">
|
||||
<el-form-item style="margin-bottom: 0">
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
@@ -94,13 +94,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="签到时间" align="center" width="120">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
v-if="scope.row.latestSignInTime"
|
||||
link
|
||||
type="primary"
|
||||
@click="showSignRecords(scope.row)"
|
||||
class="time-button"
|
||||
>
|
||||
<el-button v-if="scope.row.latestSignInTime" link type="primary" @click="showSignRecords(scope.row)" class="time-button">
|
||||
{{ formatSignTime(scope.row.latestSignInTime) }}
|
||||
</el-button>
|
||||
<span v-else class="text-gray-400">未签到</span>
|
||||
@@ -108,13 +102,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="签退时间" align="center" width="120">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
v-if="scope.row.latestSignOutTime"
|
||||
link
|
||||
type="primary"
|
||||
@click="showSignRecords(scope.row)"
|
||||
class="time-button"
|
||||
>
|
||||
<el-button v-if="scope.row.latestSignOutTime" link type="primary" @click="showSignRecords(scope.row)" class="time-button">
|
||||
{{ formatSignTime(scope.row.latestSignOutTime) }}
|
||||
</el-button>
|
||||
<span v-else class="text-gray-400">未签退</span>
|
||||
@@ -309,7 +297,7 @@
|
||||
是否更新已经存在的报名数据
|
||||
</div>
|
||||
<span>仅允许导入xls、xlsx格式文件。</span>
|
||||
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate">下载模板</el-link>
|
||||
<el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline" @click="importTemplate">下载模板</el-link>
|
||||
</div>
|
||||
</template>
|
||||
</el-upload>
|
||||
@@ -493,15 +481,15 @@ const getList = async () => {
|
||||
try {
|
||||
// 构建查询参数,查询已审核通过的报名记录
|
||||
const queryData = { ...queryParams.value };
|
||||
|
||||
|
||||
// 如果状态字段为空或未选择,则查询已通过(approvalStatus=1)的报名记录
|
||||
if (!queryData.approvalStatus) {
|
||||
queryData.approvalStatus = 1;
|
||||
}
|
||||
|
||||
|
||||
console.log('ActivityRegistrationView: getList 开始查询,参数:', queryData);
|
||||
console.log('ActivityRegistrationView: props.activityId:', props.activityId);
|
||||
|
||||
|
||||
const res = await listActivityRegister(queryData);
|
||||
console.log('ActivityRegistrationView: 查询结果完整对象:', res);
|
||||
console.log('ActivityRegistrationView: res 的类型:', typeof res);
|
||||
@@ -510,7 +498,7 @@ const getList = async () => {
|
||||
console.log('ActivityRegistrationView: res.rows 的类型:', typeof res.rows);
|
||||
console.log('ActivityRegistrationView: res.total:', res.total);
|
||||
console.log('ActivityRegistrationView: res 的所有属性:', Object.keys(res || {}));
|
||||
|
||||
|
||||
// 检查 res.rows 是否存在且为数组
|
||||
if (!res || !res.rows) {
|
||||
console.error('ActivityRegistrationView: API返回数据异常 - res.rows 不存在');
|
||||
@@ -520,7 +508,7 @@ const getList = async () => {
|
||||
total.value = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (!Array.isArray(res.rows)) {
|
||||
console.error('ActivityRegistrationView: API返回数据异常 - res.rows 不是数组');
|
||||
console.error('ActivityRegistrationView: res.rows 实际值:', res.rows);
|
||||
@@ -530,9 +518,9 @@ const getList = async () => {
|
||||
total.value = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
console.log('ActivityRegistrationView: res.rows 数组长度:', res.rows.length);
|
||||
|
||||
|
||||
// 为每个成员添加签到信息
|
||||
const membersWithSignInfo = await Promise.all(
|
||||
res.rows.map(async (member) => {
|
||||
@@ -546,17 +534,17 @@ const getList = async () => {
|
||||
studentNo: member.studentNo
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
if (signRes.code === 200 && signRes.data && signRes.data.length > 0) {
|
||||
// 获取最新的签到和签退时间
|
||||
const latestSignIn = signRes.data
|
||||
.filter((record: any) => record.signInTime)
|
||||
.sort((a: any, b: any) => new Date(b.signInTime).getTime() - new Date(a.signInTime).getTime())[0];
|
||||
|
||||
|
||||
const latestSignOut = signRes.data
|
||||
.filter((record: any) => record.signOutTime)
|
||||
.sort((a: any, b: any) => new Date(b.signOutTime).getTime() - new Date(a.signOutTime).getTime())[0];
|
||||
|
||||
|
||||
return {
|
||||
...member,
|
||||
latestSignInTime: latestSignIn?.signInTime,
|
||||
@@ -566,7 +554,7 @@ const getList = async () => {
|
||||
} catch (error) {
|
||||
console.warn('获取签到信息失败:', error);
|
||||
}
|
||||
|
||||
|
||||
return {
|
||||
...member,
|
||||
latestSignInTime: undefined,
|
||||
@@ -574,7 +562,7 @@ const getList = async () => {
|
||||
};
|
||||
})
|
||||
);
|
||||
|
||||
|
||||
memberList.value = membersWithSignInfo;
|
||||
total.value = res.total;
|
||||
} catch (error: any) {
|
||||
@@ -586,7 +574,7 @@ const getList = async () => {
|
||||
request: error?.request,
|
||||
config: error?.config
|
||||
});
|
||||
|
||||
|
||||
// 检查是否是网络错误
|
||||
if (error?.code === 'NETWORK_ERROR' || error?.code === 'ECONNABORTED') {
|
||||
proxy?.$modal.msgError('网络连接失败,请检查网络状态');
|
||||
@@ -603,7 +591,7 @@ const getList = async () => {
|
||||
// 其他错误(如代码逻辑错误)
|
||||
proxy?.$modal.msgError(`查询成员列表失败: ${error?.message || '未知错误'}`);
|
||||
}
|
||||
|
||||
|
||||
// 确保在错误情况下清空数据
|
||||
memberList.value = [];
|
||||
total.value = 0;
|
||||
@@ -617,7 +605,7 @@ const showSignRecords = async (member: ExtendedActivityRegisterVO) => {
|
||||
signRecordsDialog.visible = true;
|
||||
signRecordsDialog.title = `${member.studentName}(${member.studentNo})的签到记录`;
|
||||
signRecordsLoading.value = true;
|
||||
|
||||
|
||||
try {
|
||||
const res = await request({
|
||||
url: '/stgl/activityAttendance/getAllByActivityAndUser',
|
||||
@@ -627,7 +615,7 @@ const showSignRecords = async (member: ExtendedActivityRegisterVO) => {
|
||||
studentNo: member.studentNo
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
if (res.code === 200) {
|
||||
signRecords.value = res.data || [];
|
||||
} else {
|
||||
@@ -708,7 +696,7 @@ const handleUpdate = async (row?: ExtendedActivityRegisterVO) => {
|
||||
const _id = row?.id || ids.value[0];
|
||||
const res = await getActivityRegister(_id);
|
||||
Object.assign(form.value, res.data);
|
||||
|
||||
|
||||
// 设置学生选择器数据
|
||||
if (res.data.studentName) {
|
||||
form.value.selectedStudent = {
|
||||
@@ -722,7 +710,7 @@ const handleUpdate = async (row?: ExtendedActivityRegisterVO) => {
|
||||
className: res.data.className || ''
|
||||
} as StudentVO;
|
||||
}
|
||||
|
||||
|
||||
dialog.visible = true;
|
||||
dialog.title = '修改活动报名';
|
||||
};
|
||||
@@ -732,14 +720,14 @@ const submitForm = () => {
|
||||
memberFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
|
||||
|
||||
// 创建提交数据,排除selectedStudent字段
|
||||
const { selectedStudent, ...submitData } = form.value;
|
||||
|
||||
|
||||
// 确保包含必要字段
|
||||
submitData.activityId = props.activityId;
|
||||
submitData.approvalStatus = 1; // 新增的报名默认为已通过状态
|
||||
|
||||
|
||||
try {
|
||||
if (form.value.id) {
|
||||
await updateActivityRegister(submitData as ActivityRegisterForm);
|
||||
@@ -762,14 +750,14 @@ const submitForm = () => {
|
||||
const handleDelete = async (row?: ExtendedActivityRegisterVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除选中的活动报名记录?');
|
||||
|
||||
|
||||
try {
|
||||
if (Array.isArray(_ids)) {
|
||||
await delActivityRegister(_ids.join(','));
|
||||
} else {
|
||||
await delActivityRegister(_ids);
|
||||
}
|
||||
|
||||
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
await getList();
|
||||
} catch (error) {
|
||||
@@ -911,4 +899,4 @@ onMounted(() => {
|
||||
.text-gray-400 {
|
||||
color: #909399;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
@@ -3,21 +3,21 @@
|
||||
<!-- 搜索区域 -->
|
||||
<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="always" style="padding: 8px 16px;">
|
||||
<el-form ref="queryFormRef" :model="queryParams" label-width="80px" style="padding: 0;">
|
||||
<el-card shadow="always" style="padding: 8px 16px">
|
||||
<el-form ref="queryFormRef" :model="queryParams" label-width="80px" style="padding: 0">
|
||||
<el-row :gutter="16" align="middle">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="姓名" prop="studentName" style="margin-bottom: 0;">
|
||||
<el-form-item label="姓名" prop="studentName" style="margin-bottom: 0">
|
||||
<el-input v-model="queryParams.studentName" placeholder="请输入姓名" clearable size="small" @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="学号" prop="studentNo" style="margin-bottom: 0;">
|
||||
<el-form-item label="学号" prop="studentNo" style="margin-bottom: 0">
|
||||
<el-input v-model="queryParams.studentNo" placeholder="请输入学号" clearable size="small" @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item style="margin-bottom: 0;">
|
||||
<el-form-item style="margin-bottom: 0">
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
@@ -33,10 +33,14 @@
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Check" :disabled="single" @click="handleApprove()" v-hasPermi="['stgl:activityRegister:approve']">批量通过</el-button>
|
||||
<el-button type="success" plain icon="Check" :disabled="single" @click="handleApprove()" v-hasPermi="['stgl:activityRegister:approve']"
|
||||
>批量通过</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Close" :disabled="single" @click="handleReject()" v-hasPermi="['stgl:activityRegister:approve']">批量拒绝</el-button>
|
||||
<el-button type="danger" plain icon="Close" :disabled="single" @click="handleReject()" v-hasPermi="['stgl:activityRegister:approve']"
|
||||
>批量拒绝</el-button
|
||||
>
|
||||
</el-col>
|
||||
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
@@ -86,9 +90,15 @@
|
||||
<el-button link type="primary" icon="View" @click="handleView(scope.row)" v-hasPermi="['stgl:activityRegister:query']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="通过" placement="top">
|
||||
<el-button link type="success" icon="Check" @click="handleApprove(scope.row)" v-hasPermi="['stgl:activityRegister:approve']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="拒绝" placement="top">
|
||||
<el-button
|
||||
link
|
||||
type="success"
|
||||
icon="Check"
|
||||
@click="handleApprove(scope.row)"
|
||||
v-hasPermi="['stgl:activityRegister:approve']"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="拒绝" placement="top">
|
||||
<el-button link type="danger" icon="Close" @click="handleReject(scope.row)" v-hasPermi="['stgl:activityRegister:approve']"></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
@@ -123,7 +133,7 @@
|
||||
<el-divider content-position="left">
|
||||
<span class="text-lg font-medium">团队信息</span>
|
||||
</el-divider>
|
||||
|
||||
|
||||
<el-descriptions :column="2" border class="mb-4">
|
||||
<el-descriptions-item label="团队名称">{{ teamInfo.teamName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="团队人数">{{ teamInfo.teamSize || 0 }}人</el-descriptions-item>
|
||||
@@ -160,7 +170,7 @@
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="cancelView">关 闭</el-button>
|
||||
@@ -178,9 +188,9 @@
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="审核意见" prop="approvalRemark">
|
||||
<el-input
|
||||
v-model="approvalForm.approvalRemark"
|
||||
type="textarea"
|
||||
<el-input
|
||||
v-model="approvalForm.approvalRemark"
|
||||
type="textarea"
|
||||
:rows="4"
|
||||
:placeholder="approvalForm.approvalStatus === 1 ? '请输入通过意见(可选)' : '请输入拒绝原因(必填)'"
|
||||
/>
|
||||
@@ -299,9 +309,9 @@ const approvalForm = reactive({
|
||||
const approvalRules = reactive({
|
||||
approvalStatus: [{ required: true, message: '请选择审核结果', trigger: 'change' }],
|
||||
approvalRemark: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入拒绝原因',
|
||||
{
|
||||
required: true,
|
||||
message: '请输入拒绝原因',
|
||||
trigger: 'blur',
|
||||
validator: (rule: any, value: any, callback: any) => {
|
||||
if (approvalForm.approvalStatus === 2 && !value) {
|
||||
@@ -332,15 +342,15 @@ const { queryParams } = toRefs(data);
|
||||
/** 查询成员列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
|
||||
|
||||
try {
|
||||
const queryData = { ...queryParams.value };
|
||||
|
||||
|
||||
// 确保查询待审核状态(approvalStatus='0')
|
||||
queryData.approvalStatus = '0';
|
||||
|
||||
|
||||
const res = await listActivityRegister(queryData);
|
||||
|
||||
|
||||
memberList.value = res.rows;
|
||||
total.value = res.total;
|
||||
} catch (error) {
|
||||
@@ -385,7 +395,7 @@ const handleApprove = (row?: ExtendedStglActivityRegistrationVo) => {
|
||||
proxy?.$modal.msgError('请选择要审核的记录');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
approvalForm.ids = _ids;
|
||||
approvalForm.approvalStatus = 1;
|
||||
approvalForm.approvalRemark = '';
|
||||
@@ -400,7 +410,7 @@ const handleReject = (row?: ExtendedStglActivityRegistrationVo) => {
|
||||
proxy?.$modal.msgError('请选择要审核的记录');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
approvalForm.ids = _ids;
|
||||
approvalForm.approvalStatus = 2;
|
||||
approvalForm.approvalRemark = '';
|
||||
@@ -413,29 +423,21 @@ const submitApproval = () => {
|
||||
approvalFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
|
||||
|
||||
try {
|
||||
if (approvalForm.ids.length === 1) {
|
||||
// 单个审核
|
||||
await approveActivityRegister(
|
||||
approvalForm.ids[0],
|
||||
approvalForm.approvalStatus,
|
||||
approvalForm.approvalRemark
|
||||
);
|
||||
await approveActivityRegister(approvalForm.ids[0], approvalForm.approvalStatus, approvalForm.approvalRemark);
|
||||
} else {
|
||||
// 批量审核
|
||||
await batchApproveActivityRegister(
|
||||
approvalForm.ids,
|
||||
approvalForm.approvalStatus,
|
||||
approvalForm.approvalRemark
|
||||
);
|
||||
await batchApproveActivityRegister(approvalForm.ids, approvalForm.approvalStatus, approvalForm.approvalRemark);
|
||||
}
|
||||
|
||||
|
||||
const actionText = approvalForm.approvalStatus === 1 ? '通过' : '拒绝';
|
||||
proxy?.$modal.msgSuccess(`批量${actionText}成功`);
|
||||
approvalDialog.visible = false;
|
||||
await getList();
|
||||
|
||||
|
||||
// 通知父组件刷新其他标签页
|
||||
notifyRefreshOtherTabs();
|
||||
} catch (error) {
|
||||
@@ -457,14 +459,14 @@ const cancelApproval = () => {
|
||||
const handleDelete = async (row?: ExtendedStglActivityRegistrationVo) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除选中的活动报名记录?');
|
||||
|
||||
|
||||
try {
|
||||
if (Array.isArray(_ids)) {
|
||||
await delActivityRegister(_ids.join(','));
|
||||
} else {
|
||||
await delActivityRegister(_ids);
|
||||
}
|
||||
|
||||
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
await getList();
|
||||
} catch (error) {
|
||||
@@ -478,7 +480,7 @@ const handleView = async (row: ExtendedStglActivityRegistrationVo) => {
|
||||
Object.assign(viewForm, res.data);
|
||||
viewDialog.visible = true;
|
||||
viewDialog.title = '查看活动报名详情';
|
||||
|
||||
|
||||
// 如果是团队报名,获取团队信息
|
||||
if (Number(viewForm.registrationType) === 2 && viewForm.teamId) {
|
||||
await loadTeamInfo(viewForm.teamId);
|
||||
@@ -494,39 +496,37 @@ const loadTeamInfo = async (teamId: string | number) => {
|
||||
if (!teamId) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
loadingTeamInfo.value = true;
|
||||
|
||||
|
||||
try {
|
||||
// 尝试调用团队信息API获取完整信息
|
||||
try {
|
||||
const response = await getTeamsByActivityId(viewForm.activityId);
|
||||
console.log('PendingMembersTab: 团队信息API响应:', response);
|
||||
|
||||
|
||||
if (response.data && Array.isArray(response.data)) {
|
||||
// 从团队列表中查找当前团队
|
||||
const teamData = response.data.find((team: any) => {
|
||||
return team.id == teamId || team.id.toString() === teamId || team.id === parseInt(teamId as string);
|
||||
});
|
||||
|
||||
|
||||
console.log('PendingMembersTab: 找到的团队数据:', teamData);
|
||||
|
||||
|
||||
if (teamData) {
|
||||
// 优先从teamMembers中查找队长信息
|
||||
let leaderPhone = '暂无联系方式';
|
||||
let leaderDepartment = '暂无院系信息';
|
||||
let leaderMajor = '';
|
||||
let leaderClassName = '';
|
||||
|
||||
|
||||
try {
|
||||
if (teamData.teamMembers) {
|
||||
const membersData = JSON.parse(teamData.teamMembers);
|
||||
if (Array.isArray(membersData)) {
|
||||
// 查找队长信息(isLeader: 1 或者 userId 匹配 leaderUserId)
|
||||
const leaderMember = membersData.find((member: any) =>
|
||||
member.isLeader === 1 || member.userId === teamData.leaderUserId
|
||||
);
|
||||
|
||||
const leaderMember = membersData.find((member: any) => member.isLeader === 1 || member.userId === teamData.leaderUserId);
|
||||
|
||||
if (leaderMember) {
|
||||
leaderPhone = leaderMember.phone || '暂无联系方式';
|
||||
leaderDepartment = leaderMember.department || '暂无院系信息';
|
||||
@@ -539,7 +539,7 @@ const loadTeamInfo = async (teamId: string | number) => {
|
||||
} catch (parseError) {
|
||||
console.error('PendingMembersTab: 解析团队成员JSON失败:', parseError);
|
||||
}
|
||||
|
||||
|
||||
// 如果从teamMembers中没有找到队长信息,尝试通过leaderUserId获取
|
||||
if (leaderPhone === '暂无联系方式' || leaderDepartment === '暂无院系信息') {
|
||||
try {
|
||||
@@ -547,7 +547,7 @@ const loadTeamInfo = async (teamId: string | number) => {
|
||||
console.log('PendingMembersTab: 通过leaderUserId获取队长详细信息:', teamData.leaderUserId);
|
||||
const studentResponse = await getStudent(teamData.leaderUserId);
|
||||
console.log('PendingMembersTab: getStudent API响应:', studentResponse);
|
||||
|
||||
|
||||
if (studentResponse.data) {
|
||||
const studentData = studentResponse.data;
|
||||
console.log('PendingMembersTab: 学生数据详情:', studentData);
|
||||
@@ -557,7 +557,7 @@ const loadTeamInfo = async (teamId: string | number) => {
|
||||
majorName: studentData.majorName,
|
||||
className: studentData.className
|
||||
});
|
||||
|
||||
|
||||
// 只有在teamMembers中没有找到时才使用API获取的信息
|
||||
if (leaderPhone === '暂无联系方式') {
|
||||
leaderPhone = studentData.phone || '暂无联系方式';
|
||||
@@ -580,7 +580,7 @@ const loadTeamInfo = async (teamId: string | number) => {
|
||||
console.log('PendingMembersTab: 获取队长详细信息失败:', studentError);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 如果仍然没有获取到队长信息,尝试从报名详情中获取
|
||||
if (leaderPhone === '暂无联系方式' && viewForm.phone) {
|
||||
leaderPhone = viewForm.phone;
|
||||
@@ -590,17 +590,15 @@ const loadTeamInfo = async (teamId: string | number) => {
|
||||
leaderDepartment = viewForm.department;
|
||||
console.log('PendingMembersTab: 使用报名详情中的院系信息:', leaderDepartment);
|
||||
}
|
||||
|
||||
|
||||
// 最后的备用方案:如果还是没有获取到,尝试从teamMembers中查找匹配leaderUserId的成员
|
||||
if ((leaderPhone === '暂无联系方式' || leaderDepartment === '暂无院系信息') && teamData.teamMembers) {
|
||||
try {
|
||||
const membersData = JSON.parse(teamData.teamMembers);
|
||||
if (Array.isArray(membersData)) {
|
||||
// 查找与leaderUserId匹配的成员
|
||||
const leaderMember = membersData.find((member: any) =>
|
||||
member.userId === teamData.leaderUserId
|
||||
);
|
||||
|
||||
const leaderMember = membersData.find((member: any) => member.userId === teamData.leaderUserId);
|
||||
|
||||
if (leaderMember) {
|
||||
if (leaderPhone === '暂无联系方式') {
|
||||
leaderPhone = leaderMember.phone || '暂无联系方式';
|
||||
@@ -621,7 +619,7 @@ const loadTeamInfo = async (teamId: string | number) => {
|
||||
console.error('PendingMembersTab: 备用方案解析团队成员JSON失败:', parseError);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 更新团队信息
|
||||
teamInfo.value = {
|
||||
id: teamData.id,
|
||||
@@ -636,9 +634,9 @@ const loadTeamInfo = async (teamId: string | number) => {
|
||||
description: teamData.description || '',
|
||||
teamMembers: teamData.teamMembers || '[]'
|
||||
};
|
||||
|
||||
|
||||
console.log('PendingMembersTab: 最终设置的团队信息:', teamInfo.value);
|
||||
|
||||
|
||||
// 解析团队成员信息
|
||||
if (teamData.teamMembers) {
|
||||
try {
|
||||
@@ -674,13 +672,13 @@ const loadTeamInfo = async (teamId: string | number) => {
|
||||
}
|
||||
} catch (apiError) {
|
||||
console.log('PendingMembersTab: 团队信息API调用失败,使用报名详情中的信息:', apiError);
|
||||
|
||||
|
||||
// 如果API调用失败,使用报名详情中的信息
|
||||
if (viewForm.teamName) {
|
||||
// 尝试获取队长的详细信息
|
||||
let leaderPhone = '暂无联系方式';
|
||||
let leaderDepartment = '暂无院系信息';
|
||||
|
||||
|
||||
try {
|
||||
if (viewForm.userId) {
|
||||
const studentResponse = await getStudent(viewForm.userId);
|
||||
@@ -701,7 +699,7 @@ const loadTeamInfo = async (teamId: string | number) => {
|
||||
leaderDepartment = viewForm.department;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 构造团队信息对象,优先使用获取到的详细信息
|
||||
teamInfo.value = {
|
||||
id: viewForm.teamId,
|
||||
@@ -716,10 +714,10 @@ const loadTeamInfo = async (teamId: string | number) => {
|
||||
description: viewForm.remark || '暂无团队简介',
|
||||
teamMembers: '[]' // JSON格式的字符串
|
||||
};
|
||||
|
||||
|
||||
// 团队成员信息暂时为空,因为报名详情中没有这个字段
|
||||
teamMembers.value = [] as TeamMemberInfo[];
|
||||
|
||||
|
||||
console.log('PendingMembersTab: 使用报名详情构造的团队信息:', teamInfo.value);
|
||||
} else {
|
||||
teamInfo.value = null;
|
||||
@@ -744,8 +742,6 @@ const cancelView = () => {
|
||||
teamMembers.value = [] as TeamMemberInfo[];
|
||||
};
|
||||
|
||||
|
||||
|
||||
// 暴露给父组件的方法
|
||||
defineExpose({
|
||||
getList
|
||||
@@ -753,7 +749,7 @@ defineExpose({
|
||||
|
||||
// 定义事件
|
||||
const emit = defineEmits<{
|
||||
refreshOtherTabs: []
|
||||
refreshOtherTabs: [];
|
||||
}>();
|
||||
|
||||
// 通知父组件刷新其他标签页
|
||||
@@ -803,4 +799,4 @@ onMounted(() => {
|
||||
.mb-4 {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
@@ -3,21 +3,21 @@
|
||||
<!-- 搜索区域 -->
|
||||
<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="always" style="padding: 8px 16px;">
|
||||
<el-form ref="queryFormRef" :model="queryParams" label-width="80px" style="padding: 0;">
|
||||
<el-card shadow="always" style="padding: 8px 16px">
|
||||
<el-form ref="queryFormRef" :model="queryParams" label-width="80px" style="padding: 0">
|
||||
<el-row :gutter="16" align="middle">
|
||||
<el-col :span="5">
|
||||
<el-form-item label="姓名" prop="studentName" style="margin-bottom: 0;">
|
||||
<el-form-item label="姓名" prop="studentName" style="margin-bottom: 0">
|
||||
<el-input v-model="queryParams.studentName" placeholder="请输入姓名" clearable size="small" @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="学号" prop="studentNo" style="margin-bottom: 0;">
|
||||
<el-form-item label="学号" prop="studentNo" style="margin-bottom: 0">
|
||||
<el-input v-model="queryParams.studentNo" placeholder="请输入学号" clearable size="small" @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item style="margin-bottom: 0;">
|
||||
<el-form-item style="margin-bottom: 0">
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
@@ -36,10 +36,14 @@
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['stgl:activityRegister:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['stgl:activityRegister:edit']">修改</el-button>
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['stgl:activityRegister:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['stgl:activityRegister:remove']">删除</el-button>
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['stgl:activityRegister:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="info" plain icon="Download" @click="handleExport" v-hasPermi="['stgl:activityRegister:export']">导出数据</el-button>
|
||||
@@ -98,7 +102,7 @@
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['stgl:activityRegister:edit']"></el-button>
|
||||
</el-tooltip>
|
||||
|
||||
|
||||
<!-- 审核通过状态显示成绩录入按钮 -->
|
||||
<template v-if="Number(scope.row.approvalStatus) === 1">
|
||||
<el-tooltip content="录入成绩" placement="top">
|
||||
@@ -111,7 +115,7 @@
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
|
||||
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['stgl:activityRegister:remove']"></el-button>
|
||||
</el-tooltip>
|
||||
@@ -216,7 +220,7 @@
|
||||
<el-divider content-position="left">
|
||||
<span class="text-lg font-medium">团队信息</span>
|
||||
</el-divider>
|
||||
|
||||
|
||||
<el-descriptions :column="2" border class="mb-4">
|
||||
<el-descriptions-item label="团队名称">{{ teamInfo.teamName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="团队人数">{{ teamInfo.teamSize || 0 }}人</el-descriptions-item>
|
||||
@@ -253,7 +257,7 @@
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="cancelView">关 闭</el-button>
|
||||
@@ -306,7 +310,7 @@
|
||||
是否更新已经存在的报名数据
|
||||
</div>
|
||||
<span>仅允许导入xls、xlsx格式文件。</span>
|
||||
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate">下载模板</el-link>
|
||||
<el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline" @click="importTemplate">下载模板</el-link>
|
||||
</div>
|
||||
</template>
|
||||
</el-upload>
|
||||
@@ -508,18 +512,22 @@ const data = reactive<PageData<ExtendedActivityRegisterForm, StglActivityRegistr
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
// 监听activityId变化,同步更新查询参数
|
||||
watch(() => props.activityId, (newActivityId) => {
|
||||
if (newActivityId) {
|
||||
console.log('RegisteredMembersTab: activityId发生变化,从', queryParams.value.activityId, '更新为', newActivityId);
|
||||
queryParams.value.activityId = newActivityId;
|
||||
// 重置分页到第一页
|
||||
queryParams.value.pageNum = 1;
|
||||
// 如果组件已经挂载,则立即重新查询
|
||||
if (memberList.value.length > 0 || loading.value === false) {
|
||||
getList();
|
||||
watch(
|
||||
() => props.activityId,
|
||||
(newActivityId) => {
|
||||
if (newActivityId) {
|
||||
console.log('RegisteredMembersTab: activityId发生变化,从', queryParams.value.activityId, '更新为', newActivityId);
|
||||
queryParams.value.activityId = newActivityId;
|
||||
// 重置分页到第一页
|
||||
queryParams.value.pageNum = 1;
|
||||
// 如果组件已经挂载,则立即重新查询
|
||||
if (memberList.value.length > 0 || loading.value === false) {
|
||||
getList();
|
||||
}
|
||||
}
|
||||
}
|
||||
}, { immediate: true });
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
// 上传相关
|
||||
const uploadRef = ref<UploadInstance>();
|
||||
@@ -544,23 +552,23 @@ const getList = async () => {
|
||||
loading.value = true;
|
||||
try {
|
||||
// 构建查询参数,确保使用最新的activityId
|
||||
const queryData = {
|
||||
const queryData = {
|
||||
...queryParams.value,
|
||||
activityId: props.activityId // 强制使用最新的props值
|
||||
activityId: props.activityId // 强制使用最新的props值
|
||||
};
|
||||
|
||||
|
||||
// 如果状态字段为空或未选择,则查询已通过(approvalStatus=1)的报名记录
|
||||
if (!queryData.approvalStatus) {
|
||||
queryData.approvalStatus = '1';
|
||||
}
|
||||
|
||||
|
||||
console.log('RegisteredMembersTab: getList 开始查询,参数:', queryData);
|
||||
console.log('RegisteredMembersTab: props.activityId:', props.activityId);
|
||||
console.log('RegisteredMembersTab: queryParams.activityId:', queryParams.value.activityId);
|
||||
|
||||
|
||||
const res = await listActivityRegister(queryData);
|
||||
console.log('RegisteredMembersTab: 查询结果:', res);
|
||||
|
||||
|
||||
memberList.value = res.rows;
|
||||
total.value = res.total;
|
||||
} catch (error) {
|
||||
@@ -579,9 +587,9 @@ const cancel = () => {
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = {
|
||||
...initFormData,
|
||||
activityId: props.activityId // 确保使用最新的activityId
|
||||
form.value = {
|
||||
...initFormData,
|
||||
activityId: props.activityId // 确保使用最新的activityId
|
||||
};
|
||||
memberFormRef.value?.resetFields();
|
||||
};
|
||||
@@ -626,7 +634,7 @@ const handleUpdate = async (row?: ExtendedStglActivityRegistrationVo) => {
|
||||
const _id = row?.id || ids.value[0];
|
||||
const res = await getActivityRegister(_id);
|
||||
Object.assign(form.value, res.data);
|
||||
|
||||
|
||||
// 设置学生选择器数据
|
||||
if (res.data.studentName) {
|
||||
// 使用扩展类型来访问额外字段
|
||||
@@ -642,7 +650,7 @@ const handleUpdate = async (row?: ExtendedStglActivityRegistrationVo) => {
|
||||
className: extendedData.className || ''
|
||||
} as StudentVO;
|
||||
}
|
||||
|
||||
|
||||
dialog.visible = true;
|
||||
dialog.title = '修改活动报名';
|
||||
};
|
||||
@@ -652,14 +660,14 @@ const submitForm = () => {
|
||||
memberFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
|
||||
|
||||
// 创建提交数据,排除selectedStudent字段
|
||||
const { selectedStudent, ...submitData } = form.value;
|
||||
|
||||
|
||||
// 确保包含必要字段
|
||||
submitData.activityId = props.activityId; // 使用最新的activityId
|
||||
submitData.activityId = props.activityId; // 使用最新的activityId
|
||||
submitData.approvalStatus = 1; // 新增的报名默认为已通过状态
|
||||
|
||||
|
||||
try {
|
||||
if (form.value.id) {
|
||||
await updateActivityRegister(submitData as StglActivityRegistrationForm);
|
||||
@@ -682,14 +690,14 @@ const submitForm = () => {
|
||||
const handleDelete = async (row?: ExtendedStglActivityRegistrationVo) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除选中的活动报名记录?');
|
||||
|
||||
|
||||
try {
|
||||
if (Array.isArray(_ids)) {
|
||||
await delActivityRegister(_ids.join(','));
|
||||
} else {
|
||||
await delActivityRegister(_ids);
|
||||
}
|
||||
|
||||
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
await getList();
|
||||
} catch (error) {
|
||||
@@ -703,7 +711,7 @@ const handleView = async (row: ExtendedStglActivityRegistrationVo) => {
|
||||
Object.assign(viewForm, res.data);
|
||||
viewDialog.visible = true;
|
||||
viewDialog.title = '查看活动报名详情';
|
||||
|
||||
|
||||
// 如果是团队报名,获取团队信息
|
||||
if (Number(viewForm.registrationType) === 2 && viewForm.teamId) {
|
||||
await loadTeamInfo(viewForm.teamId);
|
||||
@@ -719,39 +727,37 @@ const loadTeamInfo = async (teamId: string | number) => {
|
||||
if (!teamId) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
loadingTeamInfo.value = true;
|
||||
|
||||
|
||||
try {
|
||||
// 尝试调用团队信息API获取完整信息
|
||||
try {
|
||||
const response = await getTeamsByActivityId(viewForm.activityId);
|
||||
console.log('RegisteredMembersTab: 团队信息API响应:', response);
|
||||
|
||||
|
||||
if (response.data && Array.isArray(response.data)) {
|
||||
// 从团队列表中查找当前团队
|
||||
const teamData = response.data.find((team: any) => {
|
||||
return team.id == teamId || team.id.toString() === teamId || team.id === parseInt(teamId as string);
|
||||
});
|
||||
|
||||
|
||||
console.log('RegisteredMembersTab: 找到的团队数据:', teamData);
|
||||
|
||||
|
||||
if (teamData) {
|
||||
// 优先从teamMembers中查找队长信息
|
||||
let leaderPhone = '暂无联系方式';
|
||||
let leaderDepartment = '暂无院系信息';
|
||||
let leaderMajor = '';
|
||||
let leaderClassName = '';
|
||||
|
||||
|
||||
try {
|
||||
if (teamData.teamMembers) {
|
||||
const membersData = JSON.parse(teamData.teamMembers);
|
||||
if (Array.isArray(membersData)) {
|
||||
// 查找队长信息(isLeader: 1 或者 userId 匹配 leaderUserId)
|
||||
const leaderMember = membersData.find((member: any) =>
|
||||
member.isLeader === 1 || member.userId === teamData.leaderUserId
|
||||
);
|
||||
|
||||
const leaderMember = membersData.find((member: any) => member.isLeader === 1 || member.userId === teamData.leaderUserId);
|
||||
|
||||
if (leaderMember) {
|
||||
leaderPhone = leaderMember.phone || '暂无联系方式';
|
||||
leaderDepartment = leaderMember.department || '暂无院系信息';
|
||||
@@ -764,7 +770,7 @@ const loadTeamInfo = async (teamId: string | number) => {
|
||||
} catch (parseError) {
|
||||
console.error('RegisteredMembersTab: 解析团队成员JSON失败:', parseError);
|
||||
}
|
||||
|
||||
|
||||
// 如果从teamMembers中没有找到队长信息,尝试通过leaderUserId获取
|
||||
if (leaderPhone === '暂无联系方式' || leaderDepartment === '暂无院系信息') {
|
||||
try {
|
||||
@@ -772,7 +778,7 @@ const loadTeamInfo = async (teamId: string | number) => {
|
||||
console.log('RegisteredMembersTab: 通过leaderUserId获取队长详细信息:', teamData.leaderUserId);
|
||||
const studentResponse = await getStudent(teamData.leaderUserId);
|
||||
console.log('RegisteredMembersTab: getStudent API响应:', studentResponse);
|
||||
|
||||
|
||||
if (studentResponse.data) {
|
||||
const studentData = studentResponse.data;
|
||||
console.log('RegisteredMembersTab: 学生数据详情:', studentData);
|
||||
@@ -782,7 +788,7 @@ const loadTeamInfo = async (teamId: string | number) => {
|
||||
majorName: studentData.majorName,
|
||||
className: studentData.className
|
||||
});
|
||||
|
||||
|
||||
// 只有在teamMembers中没有找到时才使用API获取的信息
|
||||
if (leaderPhone === '暂无联系方式') {
|
||||
leaderPhone = studentData.phone || '暂无联系方式';
|
||||
@@ -805,7 +811,7 @@ const loadTeamInfo = async (teamId: string | number) => {
|
||||
console.log('RegisteredMembersTab: 获取队长详细信息失败:', studentError);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 如果仍然没有获取到队长信息,尝试从报名详情中获取
|
||||
if (leaderPhone === '暂无联系方式' && viewForm.phone) {
|
||||
leaderPhone = viewForm.phone;
|
||||
@@ -815,17 +821,15 @@ const loadTeamInfo = async (teamId: string | number) => {
|
||||
leaderDepartment = viewForm.department;
|
||||
console.log('RegisteredMembersTab: 使用报名详情中的院系信息:', leaderDepartment);
|
||||
}
|
||||
|
||||
|
||||
// 最后的备用方案:如果还是没有获取到,尝试从teamMembers中查找匹配leaderUserId的成员
|
||||
if ((leaderPhone === '暂无联系方式' || leaderDepartment === '暂无院系信息') && teamData.teamMembers) {
|
||||
try {
|
||||
const membersData = JSON.parse(teamData.teamMembers);
|
||||
if (Array.isArray(membersData)) {
|
||||
// 查找与leaderUserId匹配的成员
|
||||
const leaderMember = membersData.find((member: any) =>
|
||||
member.userId === teamData.leaderUserId
|
||||
);
|
||||
|
||||
const leaderMember = membersData.find((member: any) => member.userId === teamData.leaderUserId);
|
||||
|
||||
if (leaderMember) {
|
||||
if (leaderPhone === '暂无联系方式') {
|
||||
leaderPhone = leaderMember.phone || '暂无联系方式';
|
||||
@@ -846,7 +850,7 @@ const loadTeamInfo = async (teamId: string | number) => {
|
||||
console.error('RegisteredMembersTab: 备用方案解析团队成员JSON失败:', parseError);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 更新团队信息
|
||||
teamInfo.value = {
|
||||
id: teamData.id,
|
||||
@@ -861,9 +865,9 @@ const loadTeamInfo = async (teamId: string | number) => {
|
||||
description: teamData.description || '',
|
||||
teamMembers: teamData.teamMembers || '[]'
|
||||
};
|
||||
|
||||
|
||||
console.log('RegisteredMembersTab: 最终设置的团队信息:', teamInfo.value);
|
||||
|
||||
|
||||
// 解析团队成员信息
|
||||
if (teamData.teamMembers) {
|
||||
try {
|
||||
@@ -899,13 +903,13 @@ const loadTeamInfo = async (teamId: string | number) => {
|
||||
}
|
||||
} catch (apiError) {
|
||||
console.log('RegisteredMembersTab: 团队信息API调用失败,使用报名详情中的信息:', apiError);
|
||||
|
||||
|
||||
// 如果API调用失败,使用报名详情中的信息
|
||||
if (viewForm.teamName) {
|
||||
// 尝试获取队长的详细信息
|
||||
let leaderPhone = '暂无联系方式';
|
||||
let leaderDepartment = '暂无院系信息';
|
||||
|
||||
|
||||
try {
|
||||
if (viewForm.userId) {
|
||||
const studentResponse = await getStudent(viewForm.userId);
|
||||
@@ -926,7 +930,7 @@ const loadTeamInfo = async (teamId: string | number) => {
|
||||
leaderDepartment = viewForm.department;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 构造团队信息对象,优先使用获取到的详细信息
|
||||
teamInfo.value = {
|
||||
id: viewForm.teamId,
|
||||
@@ -941,10 +945,10 @@ const loadTeamInfo = async (teamId: string | number) => {
|
||||
description: viewForm.remark || '暂无团队简介',
|
||||
teamMembers: '[]' // JSON格式的字符串
|
||||
};
|
||||
|
||||
|
||||
// 团队成员信息暂时为空,因为报名详情中没有这个字段
|
||||
teamMembers.value = [] as TeamMemberInfo[];
|
||||
|
||||
|
||||
console.log('RegisteredMembersTab: 使用报名详情构造的团队信息:', teamInfo.value);
|
||||
} else {
|
||||
teamInfo.value = null;
|
||||
@@ -1124,4 +1128,4 @@ onMounted(() => {
|
||||
.mb-4 {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
@@ -147,7 +147,7 @@
|
||||
<!-- 查看活动详细信息对话框 -->
|
||||
<el-dialog :title="viewDialog.title" v-model="viewDialog.visible" width="1200px" append-to-body>
|
||||
<ActivityDetailView :activity="viewForm" />
|
||||
|
||||
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="handleRegister(viewForm)" v-if="canRegister(viewForm)">立即报名</el-button>
|
||||
@@ -484,7 +484,7 @@ const checkUserRegistrationStatus = async () => {
|
||||
console.warn('活动数据不完整,跳过报名状态检查:', activity);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
const registered = await checkRegistration(activity.id as number);
|
||||
userRegistrationStatus.value[activity.id as number] = registered.data;
|
||||
} catch (error) {
|
||||
@@ -591,7 +591,7 @@ const handleRegistrationTypeChange = async (value: number) => {
|
||||
} else if (value === 2) {
|
||||
// 团队报名,自动填充当前用户信息作为团队负责人
|
||||
await loadUserInfoToForm();
|
||||
|
||||
|
||||
// 设置团队负责人为学生对象(用于StudentSelector组件)
|
||||
// 使用类型断言避免类型错误,因为我们只需要这些字段用于显示
|
||||
registerForm.presidentStudent = {
|
||||
@@ -747,14 +747,14 @@ const submitRegister = () => {
|
||||
// 个人报名时不发送任何团队相关字段
|
||||
|
||||
await registerActivity(submitData);
|
||||
|
||||
|
||||
// 根据审核设置显示不同的成功消息
|
||||
if (selectedActivity.value.needApproval === 0) {
|
||||
proxy?.$modal.msgSuccess('报名成功!您的报名已自动通过审核');
|
||||
} else {
|
||||
proxy?.$modal.msgSuccess('报名成功,请等待审核');
|
||||
}
|
||||
|
||||
|
||||
registerDialog.visible = false;
|
||||
|
||||
// 更新报名状态
|
||||
|
||||
@@ -84,18 +84,41 @@
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['stgl:activity:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5" v-if="!single && selectedActivity && ['0', '7', '6'].includes(getOriginalActivityStatus(selectedActivity)) && hasActivityOperationPermission(selectedActivity)">
|
||||
<el-button icon="Edit" @click="handleUpdate()" v-hasPermi="['stgl:activity:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5" v-if="!single && selectedActivity && getOriginalActivityStatus(selectedActivity) === '0' && hasActivityOperationPermission(selectedActivity)">
|
||||
<el-button type="success" icon="Upload" @click="handleSubmit()" v-hasPermi="['stgl:activity:edit']">提交</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5" v-if="!single && selectedActivity && getOriginalActivityStatus(selectedActivity) === '2' && hasActivityOperationPermission(selectedActivity)">
|
||||
<el-button type="warning" icon="Check" @click="handleApprove()" v-hasPermi="['stgl:activity:approve']">审批</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5" v-if="!single && selectedActivity && ['3', '4'].includes(selectedActivity.activityStatus) && hasActivityOperationPermission(selectedActivity)">
|
||||
<el-button type="danger" icon="Close" @click="handleCancel()" v-hasPermi="['stgl:activity:edit']">取消活动</el-button>
|
||||
</el-col>
|
||||
<el-col
|
||||
:span="1.5"
|
||||
v-if="
|
||||
!single &&
|
||||
selectedActivity &&
|
||||
['0', '7', '6'].includes(getOriginalActivityStatus(selectedActivity)) &&
|
||||
hasActivityOperationPermission(selectedActivity)
|
||||
"
|
||||
>
|
||||
<el-button icon="Edit" @click="handleUpdate()" v-hasPermi="['stgl:activity:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col
|
||||
:span="1.5"
|
||||
v-if="
|
||||
!single && selectedActivity && getOriginalActivityStatus(selectedActivity) === '0' && hasActivityOperationPermission(selectedActivity)
|
||||
"
|
||||
>
|
||||
<el-button type="success" icon="Upload" @click="handleSubmit()" v-hasPermi="['stgl:activity:edit']">提交</el-button>
|
||||
</el-col>
|
||||
<el-col
|
||||
:span="1.5"
|
||||
v-if="
|
||||
!single && selectedActivity && getOriginalActivityStatus(selectedActivity) === '2' && hasActivityOperationPermission(selectedActivity)
|
||||
"
|
||||
>
|
||||
<el-button type="warning" icon="Check" @click="handleApprove()" v-hasPermi="['stgl:activity:approve']">审批</el-button>
|
||||
</el-col>
|
||||
<el-col
|
||||
:span="1.5"
|
||||
v-if="
|
||||
!single && selectedActivity && ['3', '4'].includes(selectedActivity.activityStatus) && hasActivityOperationPermission(selectedActivity)
|
||||
"
|
||||
>
|
||||
<el-button type="danger" icon="Close" @click="handleCancel()" v-hasPermi="['stgl:activity:edit']">取消活动</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button icon="CopyDocument" :disabled="single" @click="handleCopy()" v-hasPermi="['stgl:activity:add']">复制</el-button>
|
||||
</el-col>
|
||||
@@ -105,7 +128,9 @@
|
||||
:disabled="multiple || !['0', '7'].includes(getOriginalActivityStatus(selectedActivity) || '')"
|
||||
@click="handleDelete()"
|
||||
v-hasPermi="['stgl:activity:remove']"
|
||||
:title="selectedActivity && !['0', '7'].includes(getOriginalActivityStatus(selectedActivity)) ? '只有草稿和已驳回状态的活动可以删除' : ''"
|
||||
:title="
|
||||
selectedActivity && !['0', '7'].includes(getOriginalActivityStatus(selectedActivity)) ? '只有草稿和已驳回状态的活动可以删除' : ''
|
||||
"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
@@ -209,7 +234,11 @@
|
||||
v-hasPermi="['stgl:activity:query']"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="修改" placement="top" v-if="['0', '7', '6'].includes(getOriginalActivityStatus(scope.row)) && hasActivityOperationPermission(scope.row)">
|
||||
<el-tooltip
|
||||
content="修改"
|
||||
placement="top"
|
||||
v-if="['0', '7', '6'].includes(getOriginalActivityStatus(scope.row)) && hasActivityOperationPermission(scope.row)"
|
||||
>
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@@ -220,7 +249,11 @@
|
||||
v-hasPermi="['stgl:activity:edit']"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="提交" placement="top" v-if="getOriginalActivityStatus(scope.row) === '0' && hasActivityOperationPermission(scope.row)">
|
||||
<el-tooltip
|
||||
content="提交"
|
||||
placement="top"
|
||||
v-if="getOriginalActivityStatus(scope.row) === '0' && hasActivityOperationPermission(scope.row)"
|
||||
>
|
||||
<el-button
|
||||
link
|
||||
type="success"
|
||||
@@ -231,7 +264,11 @@
|
||||
v-hasPermi="['stgl:activity:edit']"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="审批" placement="top" v-if="getOriginalActivityStatus(scope.row) === '2' && hasActivityOperationPermission(scope.row)">
|
||||
<el-tooltip
|
||||
content="审批"
|
||||
placement="top"
|
||||
v-if="getOriginalActivityStatus(scope.row) === '2' && hasActivityOperationPermission(scope.row)"
|
||||
>
|
||||
<el-button
|
||||
link
|
||||
type="warning"
|
||||
@@ -242,7 +279,11 @@
|
||||
v-hasPermi="['stgl:activity:approve']"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="取消活动" placement="top" v-if="['3', '4'].includes(scope.row.activityStatus) && hasActivityOperationPermission(scope.row)">
|
||||
<el-tooltip
|
||||
content="取消活动"
|
||||
placement="top"
|
||||
v-if="['3', '4'].includes(scope.row.activityStatus) && hasActivityOperationPermission(scope.row)"
|
||||
>
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
@@ -286,7 +327,11 @@
|
||||
v-hasPermi="['stgl:activity:query']"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top" v-if="['0', '7'].includes(getOriginalActivityStatus(scope.row)) && hasActivityOperationPermission(scope.row)">
|
||||
<el-tooltip
|
||||
content="删除"
|
||||
placement="top"
|
||||
v-if="['0', '7'].includes(getOriginalActivityStatus(scope.row)) && hasActivityOperationPermission(scope.row)"
|
||||
>
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
@@ -409,9 +454,9 @@
|
||||
<div class="section-divider">
|
||||
<h4 class="section-title">指导老师信息</h4>
|
||||
</div>
|
||||
<AdvisorManager
|
||||
<AdvisorManager
|
||||
:key="`advisor-manager-${form.id || 'new'}-${formKey}`"
|
||||
v-model="form.advisors"
|
||||
v-model="form.advisors"
|
||||
@change="handleAdvisorsChange"
|
||||
:initial-advisors="form.advisors"
|
||||
/>
|
||||
@@ -495,10 +540,6 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-tab-pane>
|
||||
|
||||
|
||||
|
||||
|
||||
</el-tabs>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
@@ -565,7 +606,7 @@
|
||||
</el-dialog>
|
||||
|
||||
<!-- 成员审核弹窗 -->
|
||||
<ActivityMembersDialog
|
||||
<ActivityMembersDialog
|
||||
v-model:visible="membersDialog.visible"
|
||||
:activity-id="selectedActivity?.id"
|
||||
:activity-name="selectedActivity?.activityName"
|
||||
@@ -585,14 +626,7 @@
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="驳回原因" prop="rejectReason" v-if="approveForm.approvalResult === 'reject'">
|
||||
<el-input
|
||||
v-model="approveForm.rejectReason"
|
||||
type="textarea"
|
||||
placeholder="请输入驳回原因"
|
||||
:rows="3"
|
||||
:maxlength="200"
|
||||
show-word-limit
|
||||
/>
|
||||
<el-input v-model="approveForm.rejectReason" type="textarea" placeholder="请输入驳回原因" :rows="3" :maxlength="200" show-word-limit />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
@@ -636,7 +670,14 @@ const route = useRoute();
|
||||
const router = useRouter();
|
||||
const userStore = useUserStore();
|
||||
const { stgl_activity_type, stgl_activity_status, stgl_registration_type, stgl_registration_status, stgl_activity_range, sys_yes_no } = toRefs<any>(
|
||||
proxy?.useDict('stgl_activity_type', 'stgl_activity_status', 'stgl_registration_type', 'stgl_registration_status', 'stgl_activity_range', 'sys_yes_no')
|
||||
proxy?.useDict(
|
||||
'stgl_activity_type',
|
||||
'stgl_activity_status',
|
||||
'stgl_registration_type',
|
||||
'stgl_registration_status',
|
||||
'stgl_activity_range',
|
||||
'sys_yes_no'
|
||||
)
|
||||
);
|
||||
|
||||
const activityList = ref<StglActivityVO[]>([]);
|
||||
@@ -790,8 +831,6 @@ const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
const viewForm = ref<StglActivityVO>({} as StglActivityVO);
|
||||
|
||||
|
||||
|
||||
/** 初始化URL参数 */
|
||||
const initUrlParams = () => {
|
||||
const { relatedClubId, relatedClubName, relatedTeamId, relatedTeamName, from } = route.query;
|
||||
@@ -897,27 +936,27 @@ const reset = () => {
|
||||
form.value.advisors = [];
|
||||
form.value.instructorList = [];
|
||||
form.value.instructors = '[]';
|
||||
|
||||
|
||||
// 重置关联社团禁用状态
|
||||
isRelatedClubDisabled.value = false;
|
||||
|
||||
|
||||
// 重置审批表单
|
||||
approveForm.id = undefined;
|
||||
approveForm.activityName = '';
|
||||
approveForm.approvalResult = 'approve';
|
||||
approveForm.rejectReason = '';
|
||||
|
||||
|
||||
// 更新formKey以强制重新渲染组件
|
||||
formKey.value++;
|
||||
|
||||
|
||||
activeTab.value = 'basic';
|
||||
|
||||
|
||||
console.log('表单重置后的状态:', {
|
||||
advisors: form.value.advisors,
|
||||
instructorList: form.value.instructorList,
|
||||
instructors: form.value.instructors
|
||||
});
|
||||
|
||||
|
||||
// 延迟重置表单字段,避免递归更新
|
||||
setTimeout(() => {
|
||||
activityFormRef.value?.resetFields();
|
||||
@@ -950,37 +989,37 @@ const handleAdd = () => {
|
||||
// 先重置表单
|
||||
form.value = { ...initFormData };
|
||||
activeTab.value = 'basic';
|
||||
|
||||
|
||||
// 确保指导老师字段被正确初始化
|
||||
form.value.advisors = [];
|
||||
form.value.instructorList = [];
|
||||
form.value.instructors = '[]';
|
||||
|
||||
|
||||
// 更新formKey以强制重新渲染组件
|
||||
formKey.value++;
|
||||
|
||||
|
||||
console.log('新增活动 - 初始化表单数据:', {
|
||||
advisors: form.value.advisors,
|
||||
instructorList: form.value.instructorList,
|
||||
instructors: form.value.instructors,
|
||||
formKey: formKey.value
|
||||
});
|
||||
|
||||
|
||||
// 如果有查询条件中的关联组织(社团或志愿者队伍),自动填充关联信息
|
||||
if (queryParams.value.relatedClub) {
|
||||
form.value.relatedClub = queryParams.value.relatedClub;
|
||||
form.value.relatedClubId = queryParams.value.relatedClub.relatedClubId;
|
||||
form.value.relatedType = queryParams.value.relatedClub.relatedType;
|
||||
|
||||
|
||||
// 设置关联社团字段为禁用状态(不允许修改)
|
||||
isRelatedClubDisabled.value = true;
|
||||
|
||||
|
||||
console.log('新增活动 - 自动填充关联组织信息:', {
|
||||
relatedType: queryParams.value.relatedClub.relatedType,
|
||||
relatedClubId: queryParams.value.relatedClub.relatedClubId,
|
||||
relatedClubName: queryParams.value.relatedClub.relatedClubName
|
||||
});
|
||||
|
||||
|
||||
// 确保表单数据正确设置
|
||||
console.log('新增活动 - 表单数据设置后:', {
|
||||
formRelatedClub: form.value.relatedClub,
|
||||
@@ -994,7 +1033,7 @@ const handleAdd = () => {
|
||||
|
||||
dialog.visible = true;
|
||||
dialog.title = '添加活动信息';
|
||||
|
||||
|
||||
// 确保对话框完全打开后再检查表单状态
|
||||
nextTick(() => {
|
||||
console.log('新增活动 - 对话框打开后的表单状态:', {
|
||||
@@ -1036,7 +1075,7 @@ const handleUpdate = async (row?: StglActivityVO) => {
|
||||
relatedType: res.data.relatedType,
|
||||
uniqueKey: `${res.data.relatedType}-${res.data.relatedClubId}`
|
||||
};
|
||||
|
||||
|
||||
// 修改时,如果是从URL参数进入的,则禁用关联社团字段
|
||||
if (queryParams.value.relatedClub && queryParams.value.relatedClub.relatedClubId === res.data.relatedClubId) {
|
||||
isRelatedClubDisabled.value = true;
|
||||
@@ -1074,7 +1113,7 @@ const handleUpdate = async (row?: StglActivityVO) => {
|
||||
try {
|
||||
const instructorsData = JSON.parse(res.data.instructors);
|
||||
console.log('解析的指导老师数据:', instructorsData);
|
||||
|
||||
|
||||
// 确保数据格式正确
|
||||
if (Array.isArray(instructorsData)) {
|
||||
(res.data as any).advisors = instructorsData.map((advisor: any) => ({
|
||||
@@ -1098,12 +1137,12 @@ const handleUpdate = async (row?: StglActivityVO) => {
|
||||
}
|
||||
|
||||
Object.assign(form.value, res.data);
|
||||
|
||||
|
||||
// 确保数据类型正确
|
||||
if (form.value.registrationType !== undefined) {
|
||||
form.value.registrationType = String(form.value.registrationType);
|
||||
}
|
||||
|
||||
|
||||
// 确保指导老师数据正确设置
|
||||
console.log('修改活动 - 设置表单数据后的状态:', {
|
||||
advisors: form.value.advisors,
|
||||
@@ -1111,10 +1150,10 @@ const handleUpdate = async (row?: StglActivityVO) => {
|
||||
instructors: form.value.instructors,
|
||||
registrationType: form.value.registrationType
|
||||
});
|
||||
|
||||
|
||||
// 更新formKey以强制重新渲染组件
|
||||
formKey.value++;
|
||||
|
||||
|
||||
dialog.visible = true;
|
||||
dialog.title = '修改活动信息';
|
||||
};
|
||||
@@ -1122,7 +1161,7 @@ const handleUpdate = async (row?: StglActivityVO) => {
|
||||
/** 显示验证错误提示 */
|
||||
const showValidationErrors = (invalidFields: any) => {
|
||||
if (!invalidFields) return;
|
||||
|
||||
|
||||
const errorMessages: string[] = [];
|
||||
const tabMapping = {
|
||||
// 基本信息标签页字段
|
||||
@@ -1135,20 +1174,23 @@ const showValidationErrors = (invalidFields: any) => {
|
||||
'registrationType': { tab: 'registration', label: '报名方式' },
|
||||
'activityRange': { tab: 'registration', label: '报名范围' }
|
||||
};
|
||||
|
||||
|
||||
let needSwitchTab = '';
|
||||
let currentTabErrors: string[] = [];
|
||||
let otherTabErrors: string[] = [];
|
||||
|
||||
|
||||
// 分类错误信息
|
||||
Object.keys(invalidFields).forEach(fieldName => {
|
||||
Object.keys(invalidFields).forEach((fieldName) => {
|
||||
const fieldInfo = tabMapping[fieldName];
|
||||
if (fieldInfo) {
|
||||
const errorMsg = invalidFields[fieldName][0]?.message || '验证失败';
|
||||
// 去掉重复的"不能为空"等文字,只保留核心提示
|
||||
const cleanMessage = errorMsg.replace(/不能为空$/, '').replace(/^请选择/, '').replace(/^请输入/, '');
|
||||
const cleanMessage = errorMsg
|
||||
.replace(/不能为空$/, '')
|
||||
.replace(/^请选择/, '')
|
||||
.replace(/^请输入/, '');
|
||||
const errorMessage = cleanMessage ? `${fieldInfo.label}:${cleanMessage}` : `${fieldInfo.label}为必填项`;
|
||||
|
||||
|
||||
if (fieldInfo.tab === activeTab.value) {
|
||||
currentTabErrors.push(errorMessage);
|
||||
} else {
|
||||
@@ -1159,17 +1201,17 @@ const showValidationErrors = (invalidFields: any) => {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// 构建提示消息
|
||||
if (currentTabErrors.length > 0) {
|
||||
errorMessages.push(`【当前页面】${currentTabErrors.join(';')}`);
|
||||
}
|
||||
|
||||
|
||||
if (otherTabErrors.length > 0) {
|
||||
const tabName = needSwitchTab === 'registration' ? '报名设置' : '基本信息';
|
||||
errorMessages.push(`【${tabName}页面】${otherTabErrors.join(';')}`);
|
||||
}
|
||||
|
||||
|
||||
if (errorMessages.length > 0) {
|
||||
// 使用Notification在浏览器顶部显示提示
|
||||
ElNotification({
|
||||
@@ -1180,11 +1222,11 @@ const showValidationErrors = (invalidFields: any) => {
|
||||
position: 'top-right',
|
||||
showClose: true
|
||||
});
|
||||
|
||||
|
||||
// 如果其他标签页有错误,自动切换到第一个有错误的标签页
|
||||
if (needSwitchTab && needSwitchTab !== activeTab.value) {
|
||||
activeTab.value = needSwitchTab;
|
||||
|
||||
|
||||
// 切换标签页后延迟一下再次验证,确保用户能看到错误字段
|
||||
nextTick(() => {
|
||||
activityFormRef.value?.validate(() => {});
|
||||
@@ -1201,7 +1243,7 @@ const submitForm = () => {
|
||||
|
||||
// 准备提交的数据
|
||||
const submitData = { ...form.value } as any;
|
||||
|
||||
|
||||
console.log('提交前 - 原始表单数据:', {
|
||||
advisors: submitData.advisors,
|
||||
instructorList: submitData.instructorList,
|
||||
@@ -1234,7 +1276,7 @@ const submitForm = () => {
|
||||
if (submitData.coOrganizerList && submitData.coOrganizerList.length > 0) {
|
||||
submitData.coOrganizers = JSON.stringify(submitData.coOrganizerList);
|
||||
} else {
|
||||
submitData.coOrganizers = '[]'; // 修复:使用空JSON数组而不是undefined
|
||||
submitData.coOrganizers = '[]'; // 修复:使用空JSON数组而不是undefined
|
||||
}
|
||||
|
||||
// 处理指导老师数据
|
||||
@@ -1245,24 +1287,24 @@ const submitForm = () => {
|
||||
submitData.advisors = [];
|
||||
}
|
||||
|
||||
try {
|
||||
if (form.value.id) {
|
||||
await updateStglActivity(submitData);
|
||||
} else {
|
||||
await addStglActivity(submitData);
|
||||
}
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
dialog.visible = false;
|
||||
|
||||
// 提交成功后重置表单
|
||||
reset();
|
||||
|
||||
await getList();
|
||||
} catch (error) {
|
||||
console.error('提交失败:', error);
|
||||
} finally {
|
||||
buttonLoading.value = false;
|
||||
try {
|
||||
if (form.value.id) {
|
||||
await updateStglActivity(submitData);
|
||||
} else {
|
||||
await addStglActivity(submitData);
|
||||
}
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
dialog.visible = false;
|
||||
|
||||
// 提交成功后重置表单
|
||||
reset();
|
||||
|
||||
await getList();
|
||||
} catch (error) {
|
||||
console.error('提交失败:', error);
|
||||
} finally {
|
||||
buttonLoading.value = false;
|
||||
}
|
||||
} else {
|
||||
// 验证失败,显示必填项提示
|
||||
showValidationErrors(invalidFields);
|
||||
@@ -1459,7 +1501,7 @@ const handleRelatedClubChange = (club: ClubOption | null) => {
|
||||
form.value.relatedClub = club;
|
||||
form.value.relatedClubId = club?.relatedClubId;
|
||||
form.value.relatedType = club?.relatedType; // 修复:同时设置关联类型
|
||||
|
||||
|
||||
console.log('活动表单 - 更新后的表单数据:', {
|
||||
relatedClub: form.value.relatedClub,
|
||||
relatedClubId: form.value.relatedClubId,
|
||||
@@ -1473,8 +1515,6 @@ const handleQueryRelatedClubChange = (club: ClubOption | null) => {
|
||||
queryParams.value.relatedClubId = club?.relatedClubId;
|
||||
};
|
||||
|
||||
|
||||
|
||||
/** 承办方变化处理 */
|
||||
const handleCoOrganizersChange = (coOrganizers: CoOrganizerInfo[]) => {
|
||||
form.value.coOrganizerList = coOrganizers;
|
||||
@@ -1525,14 +1565,14 @@ const handleSubmit = async (row?: StglActivityVO) => {
|
||||
|
||||
try {
|
||||
await proxy?.$modal.confirm(`是否确认提交活动"${activity.activityName}"?提交后将进入审批流程。`);
|
||||
|
||||
|
||||
// 调用后端接口更新活动状态为2(待审批)
|
||||
// 传递完整的活动数据,避免后端验证失败
|
||||
await updateStglActivity({
|
||||
...activity,
|
||||
activityStatus: '2'
|
||||
});
|
||||
|
||||
|
||||
proxy?.$modal.msgSuccess('提交成功');
|
||||
await getList();
|
||||
} catch (error) {
|
||||
@@ -1564,14 +1604,14 @@ const handleCancel = async (row?: StglActivityVO) => {
|
||||
|
||||
try {
|
||||
await proxy?.$modal.confirm(`是否确认取消活动"${activity.activityName}"?取消后将无法恢复。`);
|
||||
|
||||
|
||||
// 调用后端接口更新活动状态为6(已取消)
|
||||
// 传递完整的活动数据,避免后端验证失败
|
||||
await updateStglActivity({
|
||||
...activity,
|
||||
activityStatus: '6'
|
||||
});
|
||||
|
||||
|
||||
proxy?.$modal.msgSuccess('取消活动成功');
|
||||
await getList();
|
||||
} catch (error) {
|
||||
@@ -1588,7 +1628,7 @@ const confirmApprove = async () => {
|
||||
|
||||
approveLoading.value = true;
|
||||
try {
|
||||
const activity = activityList.value.find(item => item.id === approveForm.id);
|
||||
const activity = activityList.value.find((item) => item.id === approveForm.id);
|
||||
if (!activity) {
|
||||
proxy?.$modal.msgError('活动信息不存在');
|
||||
return;
|
||||
@@ -1677,7 +1717,7 @@ const hasInstructorPermission = computed(() => {
|
||||
// 检查当前用户是否为指定活动的指导老师
|
||||
const isCurrentUserAdvisor = (activity: StglActivityVO): boolean => {
|
||||
if (!activity.instructors) return false;
|
||||
|
||||
|
||||
try {
|
||||
const advisors = JSON.parse(activity.instructors);
|
||||
if (Array.isArray(advisors)) {
|
||||
@@ -1690,7 +1730,7 @@ const isCurrentUserAdvisor = (activity: StglActivityVO): boolean => {
|
||||
} catch (error) {
|
||||
console.warn('解析活动指导老师数据失败:', error);
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
@@ -1700,22 +1740,22 @@ const hasActivityOperationPermission = (activity: StglActivityVO): boolean => {
|
||||
if (proxy?.$auth.hasRole('admin') || proxy?.$auth.hasRole('common')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// 指导老师只能操作自己指导的活动
|
||||
if (proxy?.$auth.hasRole('stgl_instructor')) {
|
||||
return isCurrentUserAdvisor(activity);
|
||||
}
|
||||
|
||||
|
||||
// 社长只能操作自己创建的活动
|
||||
if (proxy?.$auth.hasRole('stgl_president')) {
|
||||
return activity.createBy === userStore.userId;
|
||||
}
|
||||
|
||||
|
||||
// 志愿者队长只能操作自己创建的活动
|
||||
if (proxy?.$auth.hasRole('stgl_volunteer_captain')) {
|
||||
return activity.createBy === userStore.userId;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
@@ -1844,6 +1884,4 @@ onMounted(() => {
|
||||
border: 1px solid #dcdfe6;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
@@ -43,7 +43,6 @@
|
||||
新增
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['stgl:clubmember:edit']"
|
||||
@@ -421,7 +420,7 @@ const { queryParams, form, rules } = toRefs(data);
|
||||
const isAddButtonDisabled = computed(() => {
|
||||
// 使用本地成员数量,确保实时更新
|
||||
const currentCount = memberList.value.length;
|
||||
|
||||
|
||||
if (!props.memberLimit || props.memberLimit <= 0) {
|
||||
return false; // 没有设置上限,允许新增
|
||||
}
|
||||
@@ -431,7 +430,7 @@ const isAddButtonDisabled = computed(() => {
|
||||
// 计算属性:新增按钮的提示信息
|
||||
const getAddButtonTooltip = computed(() => {
|
||||
const currentCount = memberList.value.length;
|
||||
|
||||
|
||||
if (!props.memberLimit || props.memberLimit <= 0) {
|
||||
return '该社团未设置成员上限';
|
||||
}
|
||||
@@ -441,7 +440,7 @@ const getAddButtonTooltip = computed(() => {
|
||||
// 计算属性:成员数量标签的类型
|
||||
const getMemberCountTagType = computed(() => {
|
||||
const currentCount = memberList.value.length;
|
||||
|
||||
|
||||
if (!props.memberLimit || props.memberLimit <= 0) {
|
||||
return 'info'; // 无上限时显示信息标签
|
||||
}
|
||||
@@ -812,7 +811,7 @@ defineExpose({
|
||||
|
||||
// 定义事件,用于通知父组件数据变化
|
||||
const emit = defineEmits<{
|
||||
memberCountChanged: [newCount: number]
|
||||
memberCountChanged: [newCount: number];
|
||||
}>();
|
||||
|
||||
// 通知父组件成员数量变化
|
||||
@@ -838,6 +837,4 @@ const notifyMemberCountChange = () => {
|
||||
white-space: pre-wrap;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
@@ -3,27 +3,22 @@
|
||||
<el-tabs v-model="activeTab" type="border-card" :key="clubId" @tab-change="handleTabChange">
|
||||
<!-- 已加入标签页 -->
|
||||
<el-tab-pane label="已加入" name="joined">
|
||||
<JoinedMembersTab
|
||||
<JoinedMembersTab
|
||||
ref="joinedTabRef"
|
||||
:club-id="clubId"
|
||||
:club-name="clubName"
|
||||
:club-id="clubId"
|
||||
:club-name="clubName"
|
||||
:member-limit="memberLimit"
|
||||
:current-member-count="currentMemberCount"
|
||||
:key="`joined-${clubId}`"
|
||||
:key="`joined-${clubId}`"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
|
||||
|
||||
<!-- 待审核标签页 -->
|
||||
<el-tab-pane label="待审核" name="pending">
|
||||
<PendingMembersTab
|
||||
ref="pendingTabRef"
|
||||
:club-id="clubId"
|
||||
:club-name="clubName"
|
||||
:key="`pending-${clubId}`"
|
||||
/>
|
||||
<PendingMembersTab ref="pendingTabRef" :club-id="clubId" :club-name="clubName" :key="`pending-${clubId}`" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="handleClose">关 闭</el-button>
|
||||
@@ -58,27 +53,33 @@ const joinedTabRef = ref();
|
||||
const pendingTabRef = ref();
|
||||
|
||||
// 监听visible变化
|
||||
watch(() => props.visible, (newVal) => {
|
||||
if (newVal) {
|
||||
activeTab.value = 'joined';
|
||||
// 当弹窗打开时,触发当前标签页的数据加载
|
||||
nextTick(() => {
|
||||
if (activeTab.value === 'joined' && joinedTabRef.value) {
|
||||
joinedTabRef.value.getList();
|
||||
} else if (activeTab.value === 'pending' && pendingTabRef.value) {
|
||||
pendingTabRef.value.getList();
|
||||
}
|
||||
});
|
||||
watch(
|
||||
() => props.visible,
|
||||
(newVal) => {
|
||||
if (newVal) {
|
||||
activeTab.value = 'joined';
|
||||
// 当弹窗打开时,触发当前标签页的数据加载
|
||||
nextTick(() => {
|
||||
if (activeTab.value === 'joined' && joinedTabRef.value) {
|
||||
joinedTabRef.value.getList();
|
||||
} else if (activeTab.value === 'pending' && pendingTabRef.value) {
|
||||
pendingTabRef.value.getList();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
);
|
||||
|
||||
// 监听clubId变化,重置标签页
|
||||
watch(() => props.clubId, (newClubId) => {
|
||||
console.log('MemberManagementDialog: clubId 变化:', newClubId);
|
||||
if (newClubId) {
|
||||
activeTab.value = 'joined';
|
||||
watch(
|
||||
() => props.clubId,
|
||||
(newClubId) => {
|
||||
console.log('MemberManagementDialog: clubId 变化:', newClubId);
|
||||
if (newClubId) {
|
||||
activeTab.value = 'joined';
|
||||
}
|
||||
}
|
||||
});
|
||||
);
|
||||
|
||||
const handleClose = () => {
|
||||
emit('update:visible', false);
|
||||
@@ -91,7 +92,7 @@ const handleVisibleChange = (value: boolean) => {
|
||||
/** 标签页切换处理 */
|
||||
const handleTabChange = (tabName: string) => {
|
||||
console.log('标签页切换到:', tabName);
|
||||
|
||||
|
||||
// 根据当前激活的标签页,调用对应组件的刷新方法
|
||||
if (tabName === 'joined' && joinedTabRef.value) {
|
||||
// 调用已加入成员Tab的刷新方法
|
||||
@@ -111,4 +112,4 @@ const handleTabChange = (tabName: string) => {
|
||||
.dialog-footer {
|
||||
text-align: right;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
@@ -3,26 +3,26 @@
|
||||
<!-- 搜索区域 -->
|
||||
<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="always" style="padding: 8px 16px;">
|
||||
<el-form ref="queryFormRef" :model="queryParams" label-width="80px" style="padding: 0;">
|
||||
<el-card shadow="always" style="padding: 8px 16px">
|
||||
<el-form ref="queryFormRef" :model="queryParams" label-width="80px" style="padding: 0">
|
||||
<el-row :gutter="16" align="middle">
|
||||
<el-col :span="5">
|
||||
<el-form-item label="姓名" prop="studentName" style="margin-bottom: 0;">
|
||||
<el-form-item label="姓名" prop="studentName" style="margin-bottom: 0">
|
||||
<el-input v-model="queryParams.studentName" placeholder="请输入姓名" clearable size="small" @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="学号" prop="studentNo" style="margin-bottom: 0;">
|
||||
<el-form-item label="学号" prop="studentNo" style="margin-bottom: 0">
|
||||
<el-input v-model="queryParams.studentNo" placeholder="请输入学号" clearable size="small" @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="联系方式" prop="params.phone" style="margin-bottom: 0;">
|
||||
<el-form-item label="联系方式" prop="params.phone" style="margin-bottom: 0">
|
||||
<el-input v-model="queryParams.params.phone" placeholder="请输入联系方式" clearable size="small" @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" class="search-btn-container">
|
||||
<el-form-item style="margin-bottom: 0;">
|
||||
<el-form-item style="margin-bottom: 0">
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
@@ -38,13 +38,7 @@
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="info"
|
||||
plain
|
||||
icon="Check"
|
||||
:disabled="multiple"
|
||||
@click="handleBatchApprove()"
|
||||
v-hasPermi="['stgl:clubmember:approve']"
|
||||
<el-button type="info" plain icon="Check" :disabled="multiple" @click="handleBatchApprove()" v-hasPermi="['stgl:clubmember:approve']"
|
||||
>批量审核</el-button
|
||||
>
|
||||
</el-col>
|
||||
@@ -280,9 +274,9 @@ const getList = async () => {
|
||||
try {
|
||||
// 构建查询参数,支持多状态查询
|
||||
const queryData = { ...queryParams.value };
|
||||
|
||||
|
||||
console.log('PendingMembersTab: getList 开始查询,参数:', queryData);
|
||||
|
||||
|
||||
// 待审核页面:查询待审核(status=0)和已驳回(status=3)的成员
|
||||
// 字典配置:0-待审核,1-审核中,2-已加入,3-已驳回,4-已退出
|
||||
if (!queryData.status) {
|
||||
@@ -290,19 +284,19 @@ const getList = async () => {
|
||||
queryData.params = { ...queryData.params, statusList: ['0', '3'] } as any;
|
||||
delete queryData.status; // 删除单个status字段
|
||||
}
|
||||
|
||||
|
||||
// 确保phone参数正确传递到params中
|
||||
if (queryData.params.phone) {
|
||||
// 保持phone参数在params中,后端会从params中读取
|
||||
console.log('PendingMembersTab: phone参数:', queryData.params.phone);
|
||||
}
|
||||
|
||||
|
||||
console.log('PendingMembersTab: 最终查询参数:', queryData);
|
||||
console.log('PendingMembersTab: phone参数值:', queryData.params?.phone);
|
||||
|
||||
|
||||
const res = await listStglMember(queryData);
|
||||
console.log('PendingMembersTab: 查询结果:', res);
|
||||
|
||||
|
||||
memberList.value = res.rows;
|
||||
total.value = res.total;
|
||||
} catch (error) {
|
||||
@@ -363,25 +357,25 @@ const validateMemberData = (member: StglMemberVO, operation: string): boolean =>
|
||||
console.error(`${operation}失败 - 用户ID缺失:`, member);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (!member.relationId && !props.clubId) {
|
||||
proxy?.$modal.msgError(`${operation}失败:关联ID(社团ID)不能为空`);
|
||||
console.error(`${operation}失败 - 关联ID缺失:`, member);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (!member.memberType) {
|
||||
proxy?.$modal.msgError(`${operation}失败:成员类型不能为空`);
|
||||
console.error(`${operation}失败 - 成员类型缺失:`, member);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (!member.studentNo || !member.studentName) {
|
||||
proxy?.$modal.msgError(`${operation}失败:学号和姓名不能为空`);
|
||||
console.error(`${operation}失败 - 基础信息缺失:`, member);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
@@ -391,7 +385,7 @@ const handleApprove = (row: StglMemberVO) => {
|
||||
if (!validateMemberData(row, '审核')) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
approvalForm.id = row.id;
|
||||
approvalForm.approvalStatus = undefined;
|
||||
approvalForm.approvalRemark = '';
|
||||
@@ -408,11 +402,11 @@ const handleBatchApprove = () => {
|
||||
|
||||
// 验证所有选中成员的数据完整性
|
||||
const invalidMembers = memberList.value
|
||||
.filter(member => ids.value.includes(member.id))
|
||||
.filter(member => !validateMemberData(member, '批量审核'));
|
||||
|
||||
.filter((member) => ids.value.includes(member.id))
|
||||
.filter((member) => !validateMemberData(member, '批量审核'));
|
||||
|
||||
if (invalidMembers.length > 0) {
|
||||
const invalidNames = invalidMembers.map(m => m.studentName || '未知成员').join('、');
|
||||
const invalidNames = invalidMembers.map((m) => m.studentName || '未知成员').join('、');
|
||||
proxy.$modal.msgError(`以下成员数据不完整,无法审核:${invalidNames}`);
|
||||
return;
|
||||
}
|
||||
@@ -432,41 +426,43 @@ const submitApproval = () => {
|
||||
if (valid) {
|
||||
if (approvalForm.id) {
|
||||
// 单个审核 - 再次验证数据完整性
|
||||
const member = memberList.value.find(m => m.id === approvalForm.id);
|
||||
const member = memberList.value.find((m) => m.id === approvalForm.id);
|
||||
if (member && !validateMemberData(member, '审核')) {
|
||||
return;
|
||||
}
|
||||
|
||||
approveMember(approvalForm.id, approvalForm.approvalStatus === 2).then(() => {
|
||||
proxy.$modal.msgSuccess('审核成功');
|
||||
approvalOpen.value = false;
|
||||
getList();
|
||||
}).catch((error) => {
|
||||
console.error('审核失败:', error);
|
||||
proxy.$modal.msgError('审核失败,请检查数据完整性');
|
||||
});
|
||||
|
||||
approveMember(approvalForm.id, approvalForm.approvalStatus === 2)
|
||||
.then(() => {
|
||||
proxy.$modal.msgSuccess('审核成功');
|
||||
approvalOpen.value = false;
|
||||
getList();
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('审核失败:', error);
|
||||
proxy.$modal.msgError('审核失败,请检查数据完整性');
|
||||
});
|
||||
} else {
|
||||
// 批量审核 - 再次验证数据完整性
|
||||
const selectedMembers = memberList.value.filter(m => ids.value.includes(m.id));
|
||||
const invalidMembers = selectedMembers.filter(member => !validateMemberData(member, '批量审核'));
|
||||
|
||||
const selectedMembers = memberList.value.filter((m) => ids.value.includes(m.id));
|
||||
const invalidMembers = selectedMembers.filter((member) => !validateMemberData(member, '批量审核'));
|
||||
|
||||
if (invalidMembers.length > 0) {
|
||||
const invalidNames = invalidMembers.map(m => m.studentName || '未知成员').join('、');
|
||||
const invalidNames = invalidMembers.map((m) => m.studentName || '未知成员').join('、');
|
||||
proxy.$modal.msgError(`以下成员数据不完整,无法审核:${invalidNames}`);
|
||||
return;
|
||||
}
|
||||
|
||||
const promises = ids.value.map(id =>
|
||||
approveMember(id, approvalForm.approvalStatus === 2)
|
||||
);
|
||||
Promise.all(promises).then(() => {
|
||||
proxy.$modal.msgSuccess('批量审核成功');
|
||||
approvalOpen.value = false;
|
||||
getList();
|
||||
}).catch((error) => {
|
||||
console.error('批量审核失败:', error);
|
||||
proxy.$modal.msgError('批量审核失败,请检查数据完整性');
|
||||
});
|
||||
|
||||
const promises = ids.value.map((id) => approveMember(id, approvalForm.approvalStatus === 2));
|
||||
Promise.all(promises)
|
||||
.then(() => {
|
||||
proxy.$modal.msgSuccess('批量审核成功');
|
||||
approvalOpen.value = false;
|
||||
getList();
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('批量审核失败:', error);
|
||||
proxy.$modal.msgError('批量审核失败,请检查数据完整性');
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -519,4 +515,4 @@ defineExpose({
|
||||
white-space: pre-wrap;
|
||||
word-break: break-word;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
@@ -26,8 +26,6 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24" class="search-btn-container">
|
||||
<el-form-item>
|
||||
@@ -238,7 +236,14 @@
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="成员规模上限" prop="memberLimit" required>
|
||||
<el-input-number v-model="form.memberLimit" :min="1" :max="9999" placeholder="请输入成员规模上限" style="width: 100%" :disabled="!hasInstructorPermission" />
|
||||
<el-input-number
|
||||
v-model="form.memberLimit"
|
||||
:min="1"
|
||||
:max="9999"
|
||||
placeholder="请输入成员规模上限"
|
||||
style="width: 100%"
|
||||
:disabled="!hasInstructorPermission"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -307,8 +312,6 @@
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!-- 指导老师信息 -->
|
||||
<div class="personnel-section">
|
||||
<h4 class="section-title">指导老师信息</h4>
|
||||
@@ -439,8 +442,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!-- 指导老师信息 -->
|
||||
<div class="position-group">
|
||||
<div class="position-title">指导老师:</div>
|
||||
@@ -623,12 +624,12 @@
|
||||
<script setup name="StglClub" lang="ts">
|
||||
/**
|
||||
* 社团信息管理
|
||||
*
|
||||
*
|
||||
* 权限控制说明:
|
||||
* - stgl_president角色:可以操作自己担任社长的社团(无论是否为创建者)
|
||||
* - stgl_instructor角色:指导老师,有部分字段的只读权限
|
||||
* - 管理员角色:可以操作所有社团
|
||||
*
|
||||
*
|
||||
* 业务逻辑:
|
||||
* 管理员创建社团后选择社长,被选中的社长(stgl_president角色)
|
||||
* 需要能够看到和操作自己担任社长的社团,不再受限于创建者身份
|
||||
@@ -663,8 +664,6 @@ const hasInstructorPermission = computed(() => {
|
||||
return proxy?.$auth.hasRoleOr(['stgl_instructor', 'stgl_stgl_admin', 'superadmin']);
|
||||
});
|
||||
|
||||
|
||||
|
||||
// 社长权限控制 - 检查用户是否为各社团的社长(无论是否为创建者)
|
||||
// 用于控制转让按钮显示和社长相关操作权限
|
||||
const presidentRoles = ref<Record<string | number, boolean>>({});
|
||||
@@ -974,8 +973,6 @@ const handleUpdate = async (row?: StglClubVO) => {
|
||||
vicePresidentPhone: res.data.vicePresidentPhone
|
||||
});
|
||||
|
||||
|
||||
|
||||
// 处理指导老师信息:优先从JSON字段读取,如果没有则使用单一字段
|
||||
// 🔥 优先从JSON字段读取指导老师数据
|
||||
if (res.data.advisorsJson) {
|
||||
@@ -1040,8 +1037,6 @@ const submitForm = () => {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 🔥 新增:同时保存JSON字段和兼容性字段
|
||||
submitData.advisorsJson = JSON.stringify(submitData.advisors || []);
|
||||
|
||||
@@ -1109,8 +1104,6 @@ const handleView = async (row: StglClubVO) => {
|
||||
(viewData as any).sighOpen = String(viewData.sighOpen);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 🔥 处理指导老师信息:优先从JSON字段读取,如果没有则使用单一字段
|
||||
console.log('handleView: 指导老师原始数据:', {
|
||||
advisorsJson: viewData.advisorsJson,
|
||||
@@ -1263,8 +1256,6 @@ const handlePresidentChange = (student: StudentVO | null) => {
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
// 防止递归更新的锁
|
||||
const syncLock = ref(false);
|
||||
|
||||
@@ -1486,9 +1477,9 @@ const handleMemberCountChanged = (newCount: number) => {
|
||||
if (currentClub.value) {
|
||||
// 更新当前社团的成员数量
|
||||
currentClub.value.memberCount = newCount;
|
||||
|
||||
|
||||
// 同时更新列表中的对应社团数据
|
||||
const clubIndex = clubList.value.findIndex(club => club.id === currentClub.value?.id);
|
||||
const clubIndex = clubList.value.findIndex((club) => club.id === currentClub.value?.id);
|
||||
if (clubIndex !== -1) {
|
||||
clubList.value[clubIndex].memberCount = newCount;
|
||||
console.log('handleMemberCountChanged: 已更新列表中的成员数量:', clubList.value[clubIndex]);
|
||||
@@ -1552,8 +1543,6 @@ onMounted(() => {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.member-count {
|
||||
font-weight: bold;
|
||||
color: #409eff;
|
||||
@@ -1706,8 +1695,6 @@ onMounted(() => {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* 人员信息部分样式 */
|
||||
.personnel-section {
|
||||
margin-bottom: 24px;
|
||||
|
||||
@@ -12,19 +12,9 @@
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="活动类型" prop="activityType">
|
||||
<el-select
|
||||
v-model="queryParams.activityType"
|
||||
placeholder="请选择活动类型"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-select v-model="queryParams.activityType" placeholder="请选择活动类型" clearable style="width: 100%">
|
||||
<el-option label="全部" value="" />
|
||||
<el-option
|
||||
v-for="dict in stgl_activity_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
<el-option v-for="dict in stgl_activity_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -44,7 +34,7 @@
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
</el-row>
|
||||
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24" class="search-btn-container">
|
||||
<el-form-item>
|
||||
@@ -106,7 +96,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="报名状态" align="center" prop="myRegistrationStatus" width="100">
|
||||
<template #default="scope">
|
||||
<el-tag
|
||||
<el-tag
|
||||
:type="scope.row.myRegistrationStatus === '1' ? 'success' : scope.row.myRegistrationStatus === '2' ? 'danger' : 'warning'"
|
||||
size="small"
|
||||
>
|
||||
@@ -217,7 +207,9 @@
|
||||
<span class="rating-text">{{ detailForm.myRatingScore }}</span>
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="评分时间" v-if="detailForm.myRatingTime">{{ parseTime(detailForm.myRatingTime, '{y}-{m}-{d} {h}:{i}') }}</el-descriptions-item>
|
||||
<el-descriptions-item label="评分时间" v-if="detailForm.myRatingTime">{{
|
||||
parseTime(detailForm.myRatingTime, '{y}-{m}-{d} {h}:{i}')
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="活动平均评分" v-if="detailForm.averageRating">
|
||||
<div class="rating-cell">
|
||||
<el-rate :model-value="detailForm.averageRating" disabled size="small" />
|
||||
@@ -305,10 +297,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="身份" align="center" width="80">
|
||||
<template #default="{ row }">
|
||||
<el-tag
|
||||
:type="row.isLeader === 1 ? 'success' : 'info'"
|
||||
size="small"
|
||||
>
|
||||
<el-tag :type="row.isLeader === 1 ? 'success' : 'info'" size="small">
|
||||
{{ row.isLeader === 1 ? '队长' : '队员' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
@@ -321,14 +310,12 @@
|
||||
</div>
|
||||
<div v-else class="no-team-info">
|
||||
<el-empty description="未找到队伍信息" :image-size="60">
|
||||
<el-button type="primary" size="small" @click="getTeamInfo(detailForm.id)">
|
||||
重新获取
|
||||
</el-button>
|
||||
<el-button type="primary" size="small" @click="getTeamInfo(detailForm.id)"> 重新获取 </el-button>
|
||||
</el-empty>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="detailOpen = false">关 闭</el-button>
|
||||
@@ -382,10 +369,10 @@
|
||||
</el-dialog>
|
||||
|
||||
<!-- 签到对话框 -->
|
||||
<el-dialog
|
||||
title="活动签到"
|
||||
v-model="attendanceOpen"
|
||||
width="560px"
|
||||
<el-dialog
|
||||
title="活动签到"
|
||||
v-model="attendanceOpen"
|
||||
width="560px"
|
||||
append-to-body
|
||||
:close-on-click-modal="false"
|
||||
:close-on-press-escape="true"
|
||||
@@ -393,25 +380,11 @@
|
||||
>
|
||||
<div class="attendance-content">
|
||||
<div class="attendance-actions">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="large"
|
||||
:loading="signInLoading"
|
||||
:disabled="!canSignIn"
|
||||
@click="handleSignIn"
|
||||
class="action-btn"
|
||||
>
|
||||
<el-button type="primary" size="large" :loading="signInLoading" :disabled="!canSignIn" @click="handleSignIn" class="action-btn">
|
||||
{{ signInButtonText }}
|
||||
</el-button>
|
||||
|
||||
<el-button
|
||||
type="warning"
|
||||
size="large"
|
||||
:loading="signOutLoading"
|
||||
:disabled="!canSignOut"
|
||||
@click="handleSignOut"
|
||||
class="action-btn"
|
||||
>
|
||||
|
||||
<el-button type="warning" size="large" :loading="signOutLoading" :disabled="!canSignOut" @click="handleSignOut" class="action-btn">
|
||||
签 退
|
||||
</el-button>
|
||||
</div>
|
||||
@@ -420,24 +393,10 @@
|
||||
<div class="attendance-records" v-if="attendanceRecords.length > 0">
|
||||
<div class="records-header">
|
||||
<span class="records-title">签到记录</span>
|
||||
<el-button
|
||||
type="text"
|
||||
size="small"
|
||||
@click="refreshRecords"
|
||||
:loading="recordsLoading"
|
||||
>
|
||||
刷新
|
||||
</el-button>
|
||||
<el-button type="text" size="small" @click="refreshRecords" :loading="recordsLoading"> 刷新 </el-button>
|
||||
</div>
|
||||
|
||||
<el-table
|
||||
:data="attendanceRecords"
|
||||
stripe
|
||||
size="small"
|
||||
class="records-table"
|
||||
v-loading="recordsLoading"
|
||||
:max-height="getTableMaxHeight()"
|
||||
>
|
||||
|
||||
<el-table :data="attendanceRecords" stripe size="small" class="records-table" v-loading="recordsLoading" :max-height="getTableMaxHeight()">
|
||||
<el-table-column prop="signInTime" label="签到时间" width="200">
|
||||
<template #default="{ row }">
|
||||
{{ formatDateTime(row.signInTime) }}
|
||||
@@ -451,10 +410,7 @@
|
||||
|
||||
<el-table-column prop="status" label="状态" width="100">
|
||||
<template #default="{ row }">
|
||||
<el-tag
|
||||
:type="row.signOutTime ? 'success' : 'warning'"
|
||||
size="small"
|
||||
>
|
||||
<el-tag :type="row.signOutTime ? 'success' : 'warning'" size="small">
|
||||
{{ row.signOutTime ? '已完成' : '进行中' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
@@ -549,23 +505,23 @@ const getList = async () => {
|
||||
const params = Object.fromEntries(
|
||||
Object.entries(queryParams.value).filter(([_, value]) => value !== '' && value !== undefined && value !== null)
|
||||
);
|
||||
|
||||
|
||||
// 直接使用getMyActivities接口,后端已经处理了所有情况(包括用户作为队员参与的活动)
|
||||
const res = await getMyActivities(params);
|
||||
const activities = res.data || [];
|
||||
|
||||
|
||||
// 按报名时间排序
|
||||
activities.sort((a, b) => {
|
||||
const timeA = a.myRegistrationTime ? new Date(a.myRegistrationTime).getTime() : 0;
|
||||
const timeB = b.myRegistrationTime ? new Date(b.myRegistrationTime).getTime() : 0;
|
||||
return timeB - timeA; // 降序排列
|
||||
});
|
||||
|
||||
|
||||
activityList.value = activities;
|
||||
|
||||
|
||||
console.log('我的活动列表数据:', {
|
||||
totalCount: activities.length,
|
||||
activities: activities.map(activity => ({
|
||||
activities: activities.map((activity) => ({
|
||||
id: activity.id,
|
||||
activityName: activity.activityName,
|
||||
registrationType: activity.registrationType,
|
||||
@@ -580,8 +536,6 @@ const getList = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
getList();
|
||||
@@ -597,7 +551,7 @@ const resetQuery = () => {
|
||||
const handleView = async (row: MyActivityVO) => {
|
||||
detailForm.value = { ...row };
|
||||
detailOpen.value = true;
|
||||
|
||||
|
||||
// 如果是团队报名,获取队伍信息
|
||||
if (row.registrationType === '2') {
|
||||
await getTeamInfo(row.id);
|
||||
@@ -609,7 +563,7 @@ const handleView = async (row: MyActivityVO) => {
|
||||
/** 获取队伍信息 */
|
||||
const getTeamInfo = async (activityId: string | number) => {
|
||||
if (!activityId) return;
|
||||
|
||||
|
||||
teamInfoLoading.value = true;
|
||||
try {
|
||||
const res = await getTeamsByActivityId(activityId);
|
||||
@@ -621,7 +575,7 @@ const getTeamInfo = async (activityId: string | number) => {
|
||||
teamInfo.value = null;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
const currentUserTeam = res.data.find((team: StglActivityTeamInfoVo) => {
|
||||
// 检查是否为队长
|
||||
if (team.leaderStudentNo === userInfo.userName) {
|
||||
@@ -639,9 +593,9 @@ const getTeamInfo = async (activityId: string | number) => {
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
teamInfo.value = currentUserTeam || null;
|
||||
|
||||
|
||||
if (currentUserTeam) {
|
||||
console.log('获取到队伍信息:', {
|
||||
teamName: currentUserTeam.teamName,
|
||||
@@ -681,14 +635,12 @@ const parseTeamMembers = (teamMembersStr: string): any[] => {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
/** 活动评分按钮操作 */
|
||||
const handleRate = async (row: MyActivityVO) => {
|
||||
try {
|
||||
// 获取当前用户详细信息
|
||||
const userInfo = await getCurrentUserDetailInfo();
|
||||
|
||||
|
||||
ratingForm.value = {
|
||||
activityId: row.id,
|
||||
activityName: row.activityName,
|
||||
@@ -699,7 +651,7 @@ const handleRate = async (row: MyActivityVO) => {
|
||||
experienceScore: 0,
|
||||
ratingComment: ''
|
||||
};
|
||||
|
||||
|
||||
console.log('评分表单数据:', ratingForm.value);
|
||||
ratingOpen.value = true;
|
||||
} catch (error) {
|
||||
@@ -711,7 +663,7 @@ const handleRate = async (row: MyActivityVO) => {
|
||||
/** 提交评分 */
|
||||
const submitRating = async () => {
|
||||
if (!ratingFormRef.value) return;
|
||||
|
||||
|
||||
await ratingFormRef.value.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
ratingLoading.value = true;
|
||||
@@ -821,8 +773,8 @@ const attendanceHistory = ref<any[]>([]);
|
||||
const currentAttendance = ref<any>(null);
|
||||
|
||||
// 签到记录相关数据
|
||||
const attendanceRecords = ref<any[]>([])
|
||||
const recordsLoading = ref(false)
|
||||
const attendanceRecords = ref<any[]>([]);
|
||||
const recordsLoading = ref(false);
|
||||
|
||||
// 计算属性 - 简化状态判断
|
||||
const canSignIn = computed(() => {
|
||||
@@ -830,37 +782,35 @@ const canSignIn = computed(() => {
|
||||
if (!currentAttendance.value) {
|
||||
return true; // 没有记录时可以签到
|
||||
}
|
||||
|
||||
|
||||
// 如果最新记录已签到已签退,则可以重新签到
|
||||
if (currentAttendance.value.signInStatus === 1 && currentAttendance.value.signOutStatus === 1) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// 如果最新记录已签到未签退,则不能签到
|
||||
if (currentAttendance.value.signInStatus === 1 && currentAttendance.value.signOutStatus === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// 其他情况允许签到
|
||||
return true;
|
||||
});
|
||||
|
||||
const canSignOut = computed(() => {
|
||||
// 如果有记录且已签到未签退,则可以签退
|
||||
return currentAttendance.value &&
|
||||
currentAttendance.value.signInStatus === 1 &&
|
||||
currentAttendance.value.signOutStatus === 0;
|
||||
return currentAttendance.value && currentAttendance.value.signInStatus === 1 && currentAttendance.value.signOutStatus === 0;
|
||||
});
|
||||
|
||||
const signInButtonText = computed(() => {
|
||||
if (!currentAttendance.value) {
|
||||
return '签到';
|
||||
}
|
||||
|
||||
|
||||
if (currentAttendance.value.signInStatus === 1 && currentAttendance.value.signOutStatus === 0) {
|
||||
return '已签到';
|
||||
}
|
||||
|
||||
|
||||
return '签到';
|
||||
});
|
||||
|
||||
@@ -868,7 +818,7 @@ const signInButtonText = computed(() => {
|
||||
const handleAttendance = async (row: MyActivityVO) => {
|
||||
try {
|
||||
const userInfo = await getCurrentUserDetailInfo();
|
||||
|
||||
|
||||
// 填充活动信息
|
||||
attendanceForm.value = {
|
||||
activityId: row.id,
|
||||
@@ -929,13 +879,13 @@ const handleSignIn = async () => {
|
||||
};
|
||||
|
||||
await createSignInRecord(signInData);
|
||||
|
||||
|
||||
// 签到成功消息
|
||||
proxy?.$modal.msgSuccess('签到成功');
|
||||
|
||||
// 刷新签到状态和历史记录
|
||||
await refreshAttendanceData();
|
||||
|
||||
|
||||
// 强制更新计算属性
|
||||
nextTick(() => {
|
||||
console.log('签到后状态更新:', {
|
||||
@@ -980,7 +930,7 @@ const handleSignOut = async () => {
|
||||
|
||||
// 刷新签到状态和历史记录
|
||||
await refreshAttendanceData();
|
||||
|
||||
|
||||
// 强制更新计算属性
|
||||
nextTick(() => {
|
||||
console.log('签退后状态更新:', {
|
||||
@@ -1003,19 +953,17 @@ const refreshAttendanceData = async () => {
|
||||
try {
|
||||
// 获取最新的签到记录
|
||||
const recordRes = await getAllAttendanceRecords(attendanceForm.value.activityId, attendanceForm.value.studentNo);
|
||||
|
||||
|
||||
if (recordRes.data && recordRes.data.length > 0) {
|
||||
// 按创建时间排序,取最新的一条作为当前记录
|
||||
const sortedRecords = recordRes.data.sort((a: any, b: any) =>
|
||||
new Date(b.createTime).getTime() - new Date(a.createTime).getTime()
|
||||
);
|
||||
|
||||
const sortedRecords = recordRes.data.sort((a: any, b: any) => new Date(b.createTime).getTime() - new Date(a.createTime).getTime());
|
||||
|
||||
currentAttendance.value = sortedRecords[0];
|
||||
attendanceHistory.value = sortedRecords;
|
||||
|
||||
|
||||
// 同时更新签到记录表格数据
|
||||
attendanceRecords.value = sortedRecords;
|
||||
|
||||
|
||||
console.log('获取到签到记录:', {
|
||||
total: sortedRecords.length,
|
||||
current: currentAttendance.value,
|
||||
@@ -1030,7 +978,7 @@ const refreshAttendanceData = async () => {
|
||||
|
||||
// 强制触发计算属性重新计算
|
||||
await nextTick();
|
||||
|
||||
|
||||
console.log('刷新签到数据完成:', {
|
||||
history: attendanceHistory.value,
|
||||
current: currentAttendance.value,
|
||||
@@ -1050,7 +998,7 @@ const refreshAttendanceData = async () => {
|
||||
/** 刷新签到记录 */
|
||||
const refreshRecords = async () => {
|
||||
if (!attendanceForm.value.activityId || !attendanceForm.value.studentNo) return;
|
||||
|
||||
|
||||
recordsLoading.value = true;
|
||||
try {
|
||||
await refreshAttendanceData();
|
||||
@@ -1093,14 +1041,14 @@ const getTableMaxHeight = () => {
|
||||
const calculateDuration = (signInTime: string, signOutTime: string): string => {
|
||||
if (!signInTime) return '-';
|
||||
if (!signOutTime) return '进行中';
|
||||
|
||||
|
||||
const start = new Date(signInTime);
|
||||
const end = new Date(signOutTime);
|
||||
const diffMs = end.getTime() - start.getTime();
|
||||
|
||||
|
||||
const hours = Math.floor(diffMs / (1000 * 60 * 60));
|
||||
const minutes = Math.floor((diffMs % (1000 * 60 * 60)) / (1000 * 60));
|
||||
|
||||
|
||||
if (hours > 0) {
|
||||
return `${hours}小时${minutes}分钟`;
|
||||
} else {
|
||||
@@ -1111,9 +1059,9 @@ const calculateDuration = (signInTime: string, signOutTime: string): string => {
|
||||
/** 提取指导老师姓名 */
|
||||
const getInstructorNames = (instructors: string | any[]): string => {
|
||||
if (!instructors) return '暂无';
|
||||
|
||||
|
||||
let instructorArray: any[] = [];
|
||||
|
||||
|
||||
// 如果是字符串,尝试解析JSON
|
||||
if (typeof instructors === 'string') {
|
||||
try {
|
||||
@@ -1127,12 +1075,12 @@ const getInstructorNames = (instructors: string | any[]): string => {
|
||||
} else {
|
||||
return '暂无';
|
||||
}
|
||||
|
||||
|
||||
if (!instructorArray || instructorArray.length === 0) return '暂无';
|
||||
|
||||
|
||||
return instructorArray
|
||||
.map(instructor => instructor.name || instructor.nickName || '未知')
|
||||
.filter(name => name && name !== '未知')
|
||||
.map((instructor) => instructor.name || instructor.nickName || '未知')
|
||||
.filter((name) => name && name !== '未知')
|
||||
.join('、');
|
||||
};
|
||||
|
||||
@@ -1423,4 +1371,4 @@ onMounted(() => {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
@@ -17,16 +17,9 @@
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="名称" prop="name">
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
placeholder="请输入名称"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.name" placeholder="请输入名称" clearable style="width: 100%" @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
@@ -228,8 +221,6 @@ const getRegistrationTypeTag = (type: string) => {
|
||||
return tagMap[type as keyof typeof tagMap] || ('info' as const);
|
||||
};
|
||||
|
||||
|
||||
|
||||
/** 获取当前状态标签样式 */
|
||||
const getCurrentStatusTag = (status: string) => {
|
||||
const tagMap = {
|
||||
|
||||
@@ -202,9 +202,7 @@ import {
|
||||
import { StglClassQuery, StglClassVO, StglClassDetailVO, ClubDetailVO, VolunteerTeamDetailVO, ActivityDetailVO } from '@/api/stgl/stclass/types';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { sys_user_sex, stgl_club_type, stgl_activity_type } = toRefs<any>(
|
||||
proxy?.useDict('sys_user_sex', 'stgl_club_type', 'stgl_activity_type')
|
||||
);
|
||||
const { sys_user_sex, stgl_club_type, stgl_activity_type } = toRefs<any>(proxy?.useDict('sys_user_sex', 'stgl_club_type', 'stgl_activity_type'));
|
||||
|
||||
const loading = ref(false);
|
||||
const showSearch = ref(true);
|
||||
@@ -308,7 +306,7 @@ const handleClassChange = () => {
|
||||
|
||||
/** 查看按钮操作 */
|
||||
const handleView = (row?: StglClassVO) => {
|
||||
const _row = row || studentList.value.find(item => item.id === ids.value[0]);
|
||||
const _row = row || studentList.value.find((item) => item.id === ids.value[0]);
|
||||
if (!_row) {
|
||||
proxy?.$modal.msgError('请选择要查看的学生');
|
||||
return;
|
||||
@@ -364,11 +362,7 @@ const handleViewActivities = async (row: StglClassVO) => {
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = () => {
|
||||
proxy?.download(
|
||||
'stgl/stclass/export',
|
||||
queryParams.value,
|
||||
`班级学生参与情况_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
proxy?.download('stgl/stclass/export', queryParams.value, `班级学生参与情况_${new Date().getTime()}.xlsx`);
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
@@ -452,4 +446,4 @@ onMounted(() => {
|
||||
.activity-item:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
@@ -3,26 +3,26 @@
|
||||
<!-- 搜索区域 -->
|
||||
<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="always" style="padding: 8px 16px;">
|
||||
<el-form ref="queryFormRef" :model="queryParams" label-width="80px" style="padding: 0;">
|
||||
<el-card shadow="always" style="padding: 8px 16px">
|
||||
<el-form ref="queryFormRef" :model="queryParams" label-width="80px" style="padding: 0">
|
||||
<el-row :gutter="16" align="middle">
|
||||
<el-col :span="5">
|
||||
<el-form-item label="姓名" prop="studentName" style="margin-bottom: 0;">
|
||||
<el-form-item label="姓名" prop="studentName" style="margin-bottom: 0">
|
||||
<el-input v-model="queryParams.studentName" placeholder="请输入姓名" clearable size="small" @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="学号" prop="studentNo" style="margin-bottom: 0;">
|
||||
<el-form-item label="学号" prop="studentNo" style="margin-bottom: 0">
|
||||
<el-input v-model="queryParams.studentNo" placeholder="请输入学号" clearable size="small" @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="联系方式" prop="phone" style="margin-bottom: 0;">
|
||||
<el-form-item label="联系方式" prop="phone" style="margin-bottom: 0">
|
||||
<el-input v-model="queryParams.phone" placeholder="请输入联系方式" clearable size="small" @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item style="margin-bottom: 0;">
|
||||
<el-form-item style="margin-bottom: 0">
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
@@ -39,16 +39,27 @@
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-tooltip :content="getAddButtonTooltip" placement="top" :disabled="!isAddButtonDisabled">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" :disabled="isAddButtonDisabled" v-hasPermi="['stgl:volunteermember:add']">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
:disabled="isAddButtonDisabled"
|
||||
v-hasPermi="['stgl:volunteermember:add']"
|
||||
>
|
||||
新增
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['stgl:volunteermember:edit']">修改</el-button>
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['stgl:volunteermember:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['stgl:volunteermember:remove']">删除</el-button>
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['stgl:volunteermember:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-dropdown class="mt-[1px]">
|
||||
@@ -259,7 +270,7 @@
|
||||
是否更新已经存在的志愿者成员数据
|
||||
</div>
|
||||
<span>仅允许导入xls、xlsx格式文件。</span>
|
||||
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate">下载模板</el-link>
|
||||
<el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline" @click="importTemplate">下载模板</el-link>
|
||||
</div>
|
||||
</template>
|
||||
</el-upload>
|
||||
@@ -308,7 +319,9 @@ interface ExtendedVolunteerMemberForm extends VolunteerMemberForm {
|
||||
const props = defineProps<Props>();
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { sys_user_sex, sys_normal_disable, stgl_member_status } = toRefs<any>(proxy?.useDict('sys_user_sex', 'sys_normal_disable', 'stgl_member_status'));
|
||||
const { sys_user_sex, sys_normal_disable, stgl_member_status } = toRefs<any>(
|
||||
proxy?.useDict('sys_user_sex', 'sys_normal_disable', 'stgl_member_status')
|
||||
);
|
||||
|
||||
const memberList = ref<VolunteerMemberVO[]>([]);
|
||||
const buttonLoading = ref(false);
|
||||
@@ -401,7 +414,7 @@ const { queryParams, form, rules } = toRefs(data);
|
||||
const isAddButtonDisabled = computed(() => {
|
||||
// 使用本地成员数量,确保实时更新
|
||||
const currentCount = memberList.value.length;
|
||||
|
||||
|
||||
if (!props.memberLimit || props.memberLimit <= 0) {
|
||||
return false; // 没有设置上限,允许新增
|
||||
}
|
||||
@@ -411,7 +424,7 @@ const isAddButtonDisabled = computed(() => {
|
||||
// 计算属性:新增按钮的提示信息
|
||||
const getAddButtonTooltip = computed(() => {
|
||||
const currentCount = memberList.value.length;
|
||||
|
||||
|
||||
if (!props.memberLimit || props.memberLimit <= 0) {
|
||||
return '该团队未设置成员上限';
|
||||
}
|
||||
@@ -442,30 +455,30 @@ const getList = async () => {
|
||||
try {
|
||||
// 构建查询参数,支持多状态查询
|
||||
const queryData = { ...queryParams.value };
|
||||
|
||||
|
||||
console.log('JoinedMembersTab: getList 开始查询,参数:', queryData);
|
||||
|
||||
|
||||
// 构建params对象,包含所有需要在params中的查询条件
|
||||
queryData.params = { ...queryData.params } as any;
|
||||
|
||||
|
||||
// 将phone等查询条件放入params中(后端期望params.phone)
|
||||
if (queryData.phone) {
|
||||
(queryData.params as any).phone = queryData.phone;
|
||||
delete queryData.phone; // 删除顶级phone字段
|
||||
}
|
||||
|
||||
|
||||
// 如果状态字段为空或未选择,则查询已加入(status=2)和已退出(status=4)的成员
|
||||
if (!queryData.status) {
|
||||
// 使用params传递多状态查询,传递字符串格式
|
||||
(queryData.params as any).statusList = '2,4';
|
||||
delete queryData.status; // 删除单个status字段
|
||||
}
|
||||
|
||||
|
||||
console.log('JoinedMembersTab: 最终查询参数:', queryData);
|
||||
|
||||
|
||||
const res = await listVolunteerMember(queryData);
|
||||
console.log('JoinedMembersTab: 查询结果:', res);
|
||||
|
||||
|
||||
memberList.value = res.rows;
|
||||
total.value = res.total;
|
||||
} catch (error) {
|
||||
@@ -520,7 +533,7 @@ const handleSelectionChange = (selection: VolunteerMemberVO[]) => {
|
||||
const handleAdd = () => {
|
||||
// 检查人员上限 - 使用本地成员数量,确保实时更新
|
||||
const currentCount = memberList.value.length;
|
||||
|
||||
|
||||
if (props.memberLimit && props.memberLimit > 0) {
|
||||
if (currentCount >= props.memberLimit) {
|
||||
proxy?.$modal.msgError(`该团队成员已满,当前成员数量:${currentCount},成员上限:${props.memberLimit},无法再新增成员`);
|
||||
@@ -569,20 +582,20 @@ const submitForm = () => {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
buttonLoading.value = true;
|
||||
|
||||
|
||||
// 创建提交数据,排除selectedStudent字段,确保包含userId和memberType
|
||||
const { selectedStudent, ...submitData } = form.value;
|
||||
|
||||
|
||||
// 确保memberType为2(志愿者成员)
|
||||
submitData.memberType = 2;
|
||||
|
||||
|
||||
// 确保status为2(已加入状态)
|
||||
if (!submitData.status) {
|
||||
submitData.status = '2';
|
||||
}
|
||||
|
||||
|
||||
if (form.value.id) {
|
||||
await updateVolunteerMember(submitData as VolunteerMemberForm).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
@@ -601,14 +614,14 @@ const submitForm = () => {
|
||||
const handleDelete = async (row?: VolunteerMemberVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除选中的志愿者成员?');
|
||||
|
||||
|
||||
// 处理单个删除或批量删除
|
||||
if (Array.isArray(_ids)) {
|
||||
await delVolunteerMember(_ids.join(','));
|
||||
} else {
|
||||
await delVolunteerMember(_ids);
|
||||
}
|
||||
|
||||
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
await getList();
|
||||
// 通知父组件成员数量变化
|
||||
@@ -693,7 +706,7 @@ const handleFileSuccess = (response: any) => {
|
||||
getList();
|
||||
// 通知父组件成员数量变化
|
||||
notifyMemberCountChange();
|
||||
|
||||
|
||||
// 检查导入后是否超过成员上限
|
||||
setTimeout(() => {
|
||||
const currentCount = memberList.value.length;
|
||||
@@ -711,7 +724,7 @@ defineExpose({
|
||||
|
||||
// 定义事件,用于通知父组件数据变化
|
||||
const emit = defineEmits<{
|
||||
memberCountChanged: [newCount: number]
|
||||
memberCountChanged: [newCount: number];
|
||||
}>();
|
||||
|
||||
// 通知父组件成员数量变化
|
||||
@@ -741,4 +754,4 @@ onMounted(() => {
|
||||
white-space: pre-wrap;
|
||||
word-break: break-word;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
@@ -3,28 +3,23 @@
|
||||
<el-tabs v-model="activeTab" type="border-card" :key="teamId" @tab-change="handleTabChange">
|
||||
<!-- 已加入标签页 -->
|
||||
<el-tab-pane label="已加入" name="joined">
|
||||
<JoinedMembersTab
|
||||
<JoinedMembersTab
|
||||
ref="joinedTabRef"
|
||||
:team-id="teamId"
|
||||
:team-name="teamName"
|
||||
:team-id="teamId"
|
||||
:team-name="teamName"
|
||||
:member-limit="memberLimit"
|
||||
:current-member-count="currentMemberCount"
|
||||
:key="`joined-${teamId}`"
|
||||
:key="`joined-${teamId}`"
|
||||
@member-count-changed="handleMemberCountChanged"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
|
||||
|
||||
<!-- 待审核标签页 -->
|
||||
<el-tab-pane label="待审核" name="pending">
|
||||
<PendingMembersTab
|
||||
ref="pendingTabRef"
|
||||
:team-id="teamId"
|
||||
:team-name="teamName"
|
||||
:key="`pending-${teamId}`"
|
||||
/>
|
||||
<PendingMembersTab ref="pendingTabRef" :team-id="teamId" :team-name="teamName" :key="`pending-${teamId}`" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="handleClose">关 闭</el-button>
|
||||
@@ -59,27 +54,33 @@ const joinedTabRef = ref();
|
||||
const pendingTabRef = ref();
|
||||
|
||||
// 监听visible变化
|
||||
watch(() => props.visible, (newVal) => {
|
||||
if (newVal) {
|
||||
activeTab.value = 'joined';
|
||||
// 当弹窗打开时,触发当前标签页的数据加载
|
||||
nextTick(() => {
|
||||
if (activeTab.value === 'joined' && joinedTabRef.value) {
|
||||
joinedTabRef.value.getList();
|
||||
} else if (activeTab.value === 'pending' && pendingTabRef.value) {
|
||||
pendingTabRef.value.getList();
|
||||
}
|
||||
});
|
||||
watch(
|
||||
() => props.visible,
|
||||
(newVal) => {
|
||||
if (newVal) {
|
||||
activeTab.value = 'joined';
|
||||
// 当弹窗打开时,触发当前标签页的数据加载
|
||||
nextTick(() => {
|
||||
if (activeTab.value === 'joined' && joinedTabRef.value) {
|
||||
joinedTabRef.value.getList();
|
||||
} else if (activeTab.value === 'pending' && pendingTabRef.value) {
|
||||
pendingTabRef.value.getList();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
);
|
||||
|
||||
// 监听teamId变化,重置标签页
|
||||
watch(() => props.teamId, (newTeamId) => {
|
||||
console.log('MemberManagementDialog: teamId 变化:', newTeamId);
|
||||
if (newTeamId) {
|
||||
activeTab.value = 'joined';
|
||||
watch(
|
||||
() => props.teamId,
|
||||
(newTeamId) => {
|
||||
console.log('MemberManagementDialog: teamId 变化:', newTeamId);
|
||||
if (newTeamId) {
|
||||
activeTab.value = 'joined';
|
||||
}
|
||||
}
|
||||
});
|
||||
);
|
||||
|
||||
const handleClose = () => {
|
||||
emit('update:visible', false);
|
||||
@@ -98,7 +99,7 @@ const handleMemberCountChanged = (newCount: number) => {
|
||||
/** 标签页切换处理 */
|
||||
const handleTabChange = (tabName: string) => {
|
||||
console.log('标签页切换到:', tabName);
|
||||
|
||||
|
||||
// 根据当前激活的标签页,调用对应组件的刷新方法
|
||||
if (tabName === 'joined' && joinedTabRef.value) {
|
||||
// 调用已加入成员Tab的刷新方法
|
||||
@@ -118,4 +119,4 @@ const handleTabChange = (tabName: string) => {
|
||||
.dialog-footer {
|
||||
text-align: right;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
@@ -3,26 +3,26 @@
|
||||
<!-- 搜索区域 -->
|
||||
<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="always" style="padding: 8px 16px;">
|
||||
<el-form ref="queryFormRef" :model="queryParams" label-width="80px" style="padding: 0;">
|
||||
<el-card shadow="always" style="padding: 8px 16px">
|
||||
<el-form ref="queryFormRef" :model="queryParams" label-width="80px" style="padding: 0">
|
||||
<el-row :gutter="16" align="middle">
|
||||
<el-col :span="5">
|
||||
<el-form-item label="姓名" prop="studentName" style="margin-bottom: 0;">
|
||||
<el-form-item label="姓名" prop="studentName" style="margin-bottom: 0">
|
||||
<el-input v-model="queryParams.studentName" placeholder="请输入姓名" clearable size="small" @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="学号" prop="studentNo" style="margin-bottom: 0;">
|
||||
<el-form-item label="学号" prop="studentNo" style="margin-bottom: 0">
|
||||
<el-input v-model="queryParams.studentNo" placeholder="请输入学号" clearable size="small" @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="联系方式" prop="phone" style="margin-bottom: 0;">
|
||||
<el-form-item label="联系方式" prop="phone" style="margin-bottom: 0">
|
||||
<el-input v-model="queryParams.phone" placeholder="请输入联系方式" clearable size="small" @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item style="margin-bottom: 0;">
|
||||
<el-form-item style="margin-bottom: 0">
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
@@ -38,10 +38,14 @@
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Select" :disabled="multiple" @click="handleBatchApprove" v-hasPermi="['stgl:volunteermember:edit']">批量通过</el-button>
|
||||
<el-button type="success" plain icon="Select" :disabled="multiple" @click="handleBatchApprove" v-hasPermi="['stgl:volunteermember:edit']"
|
||||
>批量通过</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Close" :disabled="multiple" @click="handleBatchReject" v-hasPermi="['stgl:volunteermember:edit']">批量拒绝</el-button>
|
||||
<el-button type="danger" plain icon="Close" :disabled="multiple" @click="handleBatchReject" v-hasPermi="['stgl:volunteermember:edit']"
|
||||
>批量拒绝</el-button
|
||||
>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
@@ -130,12 +134,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { getCurrentInstance, onMounted, reactive, ref, toRefs } from 'vue';
|
||||
import {
|
||||
listVolunteerMember,
|
||||
getVolunteerMember,
|
||||
updateVolunteerMember,
|
||||
approveVolunteerMember
|
||||
} from '@/api/stgl/volunteermember';
|
||||
import { listVolunteerMember, getVolunteerMember, updateVolunteerMember, approveVolunteerMember } from '@/api/stgl/volunteermember';
|
||||
import { VolunteerMemberVO, VolunteerMemberQuery } from '@/api/stgl/volunteermember/types';
|
||||
import { parseTime } from '@/utils/ruoyi';
|
||||
|
||||
@@ -147,7 +146,9 @@ interface Props {
|
||||
const props = defineProps<Props>();
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { sys_user_sex, sys_normal_disable, stgl_member_status } = toRefs<any>(proxy?.useDict('sys_user_sex', 'sys_normal_disable', 'stgl_member_status'));
|
||||
const { sys_user_sex, sys_normal_disable, stgl_member_status } = toRefs<any>(
|
||||
proxy?.useDict('sys_user_sex', 'sys_normal_disable', 'stgl_member_status')
|
||||
);
|
||||
|
||||
const memberList = ref<VolunteerMemberVO[]>([]);
|
||||
const loading = ref(true);
|
||||
@@ -204,19 +205,19 @@ const validateMemberData = (member: VolunteerMemberVO, operation: string): boole
|
||||
console.error(`${operation}失败 - 用户ID缺失:`, member);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (!member.relationId && !props.teamId) {
|
||||
proxy?.$modal.msgError(`${operation}失败:关联ID(志愿者队伍ID)不能为空`);
|
||||
console.error(`${operation}失败 - 关联ID缺失:`, member);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (!member.studentNo || !member.studentName) {
|
||||
proxy?.$modal.msgError(`${operation}失败:学号和姓名不能为空`);
|
||||
console.error(`${operation}失败 - 基础信息缺失:`, member);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
@@ -226,31 +227,31 @@ const getList = async () => {
|
||||
try {
|
||||
// 构建查询参数,支持多状态查询
|
||||
const queryData = { ...queryParams.value };
|
||||
|
||||
|
||||
console.log('PendingMembersTab: getList 开始查询,参数:', queryData);
|
||||
|
||||
|
||||
// 构建params对象,包含所有需要在params中的查询条件
|
||||
queryData.params = { ...queryData.params } as any;
|
||||
|
||||
|
||||
// 将phone等查询条件放入params中(后端期望params.phone)
|
||||
if (queryData.phone) {
|
||||
(queryData.params as any).phone = queryData.phone;
|
||||
console.log('PendingMembersTab: phone参数放入params:', queryData.phone);
|
||||
delete queryData.phone; // 删除顶级phone字段
|
||||
}
|
||||
|
||||
|
||||
// 如果状态字段为空或未选择,则查询待审核(status=0)和已驳回(status=3)的成员
|
||||
if (!queryData.status) {
|
||||
// 使用params传递多状态查询,保留现有params内容,传递字符串格式
|
||||
(queryData.params as any).statusList = '0,3';
|
||||
delete queryData.status; // 删除单个status字段
|
||||
}
|
||||
|
||||
|
||||
console.log('PendingMembersTab: 最终查询参数:', queryData);
|
||||
|
||||
|
||||
const res = await listVolunteerMember(queryData);
|
||||
console.log('PendingMembersTab: 查询结果:', res);
|
||||
|
||||
|
||||
// 防御性编程:检查响应数据结构
|
||||
if (!res || !res.rows) {
|
||||
console.warn('PendingMembersTab: API返回数据格式异常:', res);
|
||||
@@ -259,7 +260,7 @@ const getList = async () => {
|
||||
} else {
|
||||
memberList.value = res.rows;
|
||||
total.value = res.total;
|
||||
|
||||
|
||||
// 调试:检查数据完整性
|
||||
if (memberList.value.length > 0) {
|
||||
console.log('PendingMembersTab: 第一条成员数据:', memberList.value[0]);
|
||||
@@ -322,9 +323,9 @@ const handleApprove = async (row: VolunteerMemberVO) => {
|
||||
if (!validateMemberData(row, '审核通过')) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
await proxy?.$modal.confirm(`确认通过"${row.studentName}"的入队申请?`);
|
||||
|
||||
|
||||
await approveVolunteerMember(row.id, true);
|
||||
proxy?.$modal.msgSuccess('审核通过成功');
|
||||
await getList();
|
||||
@@ -336,9 +337,9 @@ const handleReject = async (row: VolunteerMemberVO) => {
|
||||
if (!validateMemberData(row, '审核拒绝')) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
await proxy?.$modal.confirm(`确认拒绝"${row.studentName}"的入队申请?`);
|
||||
|
||||
|
||||
await approveVolunteerMember(row.id, false);
|
||||
proxy?.$modal.msgSuccess('审核拒绝成功');
|
||||
await getList();
|
||||
@@ -350,25 +351,25 @@ const handleBatchApprove = async () => {
|
||||
proxy?.$modal.msgWarning('请选择要审核的成员');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
await proxy?.$modal.confirm(`确认批量通过所选成员的入队申请?`);
|
||||
|
||||
const promises = ids.value.map(id => {
|
||||
|
||||
const promises = ids.value.map((id) => {
|
||||
// 根据ID找到对应的成员记录,进行数据验证
|
||||
const member = memberList.value.find(m => m.id === id);
|
||||
const member = memberList.value.find((m) => m.id === id);
|
||||
if (!member) {
|
||||
proxy?.$modal.msgError(`未找到ID为${id}的成员记录`);
|
||||
return Promise.reject(new Error(`未找到ID为${id}的成员记录`));
|
||||
}
|
||||
|
||||
|
||||
// 验证数据完整性
|
||||
if (!validateMemberData(member, '批量审核通过')) {
|
||||
return Promise.reject(new Error(`成员${member.studentName}数据不完整`));
|
||||
}
|
||||
|
||||
|
||||
return approveVolunteerMember(id, true);
|
||||
});
|
||||
|
||||
|
||||
await Promise.all(promises);
|
||||
proxy?.$modal.msgSuccess('批量审核通过成功');
|
||||
await getList();
|
||||
@@ -380,25 +381,25 @@ const handleBatchReject = async () => {
|
||||
proxy?.$modal.msgWarning('请选择要审核的成员');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
await proxy?.$modal.confirm(`确认批量拒绝所选成员的入队申请?`);
|
||||
|
||||
const promises = ids.value.map(id => {
|
||||
|
||||
const promises = ids.value.map((id) => {
|
||||
// 根据ID找到对应的成员记录,进行数据验证
|
||||
const member = memberList.value.find(m => m.id === id);
|
||||
const member = memberList.value.find((m) => m.id === id);
|
||||
if (!member) {
|
||||
proxy?.$modal.msgError(`未找到ID为${id}的成员记录`);
|
||||
return Promise.reject(new Error(`未找到ID为${id}的成员记录`));
|
||||
}
|
||||
|
||||
|
||||
// 验证数据完整性
|
||||
if (!validateMemberData(member, '批量审核拒绝')) {
|
||||
return Promise.reject(new Error(`成员${member.studentName}数据不完整`));
|
||||
}
|
||||
|
||||
|
||||
return approveVolunteerMember(id, false);
|
||||
});
|
||||
|
||||
|
||||
await Promise.all(promises);
|
||||
proxy?.$modal.msgSuccess('批量审核拒绝成功');
|
||||
await getList();
|
||||
@@ -486,4 +487,4 @@ onMounted(() => {
|
||||
min-width: auto;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
@@ -1199,7 +1199,7 @@ const handleActivityManagement = (row) => {
|
||||
relatedTeamName: row.teamName,
|
||||
from: 'team'
|
||||
});
|
||||
|
||||
|
||||
router.push({
|
||||
path: '/stgl/activity/info',
|
||||
query: {
|
||||
|
||||
@@ -0,0 +1,459 @@
|
||||
<template>
|
||||
<div class="p-2 page-container">
|
||||
<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="120px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="统计开始时间" prop="startTime" required>
|
||||
<el-date-picker
|
||||
v-model="queryParams.startTime"
|
||||
type="datetime"
|
||||
placeholder="选择开始时间"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="统计结束时间" prop="endTime" required>
|
||||
<el-date-picker
|
||||
v-model="queryParams.endTime"
|
||||
type="datetime"
|
||||
placeholder="选择结束时间"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="二级学院" prop="collegeId">
|
||||
<el-select v-model="queryParams.collegeId" placeholder="请选择学院" clearable style="width: 100%" @change="onCollegeChange">
|
||||
<el-option v-for="item in collegeOptions" :key="item.id" :label="item.label" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="专业" prop="majorId">
|
||||
<el-select
|
||||
v-model="queryParams.majorId"
|
||||
placeholder="请选择专业"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
:disabled="!queryParams.collegeId"
|
||||
@change="onMajorChange"
|
||||
>
|
||||
<el-option v-for="item in majorOptions" :key="item.id" :label="item.label" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="班级" prop="classId">
|
||||
<el-select v-model="queryParams.classId" placeholder="请选择班级" clearable style="width: 100%" :disabled="!queryParams.majorId">
|
||||
<el-option v-for="item in classOptions" :key="item.id" :label="item.label" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="18">
|
||||
<el-form-item class="search-btn-container">
|
||||
<el-button type="primary" icon="Search" @click="handleQuery" :loading="loading">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
<!-- <el-button type="success" icon="Download" @click="handleExport" :loading="exportLoading" v-if="statisticsData">导出</el-button> -->
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
<!-- 无数据提示 -->
|
||||
<el-card shadow="never" v-if="!statisticsData && !loading">
|
||||
<el-empty description="暂无数据" style="padding: 60px 0">
|
||||
<template #description>
|
||||
<p style="color: #909399; font-size: 14px">请设置统计时间范围和筛选条件,然后点击【搜索】按钮查看统计数据</p>
|
||||
</template>
|
||||
</el-empty>
|
||||
</el-card>
|
||||
|
||||
<!-- 统计图表 -->
|
||||
<el-card shadow="never" v-if="statisticsData">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<div class="card-header">
|
||||
<span>{{ getChartTitle() }}</span>
|
||||
</div>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch="showSearch" @update:showSearch="showSearch = $event" @queryTable="handleQuery"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
<div ref="chartRef" style="height: 400px"></div>
|
||||
</el-card>
|
||||
|
||||
<!-- 统计明细 -->
|
||||
<el-card shadow="never" v-if="statisticsData">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span>明细数据</span>
|
||||
<el-button type="success" icon="Download" @click="handleExport" :loading="exportLoading">导出Excel</el-button>
|
||||
</div>
|
||||
</template>
|
||||
<el-table :data="statisticsData.detailData" style="width: 100%" border>
|
||||
<el-table-column prop="name" label="名称" width="200" />
|
||||
<el-table-column prop="parentName" label="上级" width="150" v-if="statisticsData.dimension !== 'college'" />
|
||||
<el-table-column prop="dormDeductionCount" label="宿舍扣分总数" min-width="120" align="center">
|
||||
<template #default="scope">
|
||||
{{ scope.row.dormDeductionCount && scope.row.dormDeductionCount !== 0 ? `-${scope.row.dormDeductionCount}` : '0' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="dormViolationCount" label="宿舍违纪记录总数" min-width="140" align="center" />
|
||||
<el-table-column prop="dormViolationDeduction" label="宿舍违纪记录扣分总数" min-width="160" align="center">
|
||||
<template #default="scope">
|
||||
{{
|
||||
scope.row.dormViolationDeduction && scope.row.dormViolationDeduction !== 0 ? `-${scope.row.dormViolationDeduction.toFixed(2)}` : '0.00'
|
||||
}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="teachingViolationCount" label="教学区违纪记录总数" min-width="160" align="center" />
|
||||
<el-table-column prop="teachingViolationDeduction" label="教学区违纪记录扣分总数" min-width="180" align="center">
|
||||
<template #default="scope">
|
||||
{{
|
||||
scope.row.teachingViolationDeduction && scope.row.teachingViolationDeduction !== 0
|
||||
? `-${scope.row.teachingViolationDeduction.toFixed(2)}`
|
||||
: '0.00'
|
||||
}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="totalDeduction" label="违纪合计扣分" min-width="140" align="center">
|
||||
<template #default="scope">
|
||||
{{ scope.row.totalDeduction && scope.row.totalDeduction !== 0 ? `-${scope.row.totalDeduction.toFixed(2)}` : '0.00' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, onMounted, nextTick, getCurrentInstance, ComponentInternalInstance } from 'vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import * as echarts from 'echarts';
|
||||
import {
|
||||
getStatistics,
|
||||
exportStatistics,
|
||||
getColleges,
|
||||
getMajorsByCollegeId,
|
||||
getClassesByMajorId,
|
||||
type StudentStatisticsBo,
|
||||
type StudentStatisticsVo,
|
||||
type CascadeOptionVo
|
||||
} from '@/api/xg/studentStatistics';
|
||||
|
||||
defineOptions({
|
||||
name: 'StudentStatistics'
|
||||
});
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
|
||||
const queryFormRef = ref();
|
||||
const chartRef = ref<HTMLDivElement>();
|
||||
const loading = ref(false);
|
||||
const exportLoading = ref(false);
|
||||
const showSearch = ref(true);
|
||||
|
||||
// 查询参数
|
||||
const queryParams = reactive<StudentStatisticsBo>({
|
||||
startTime: '',
|
||||
endTime: '',
|
||||
collegeId: undefined,
|
||||
majorId: undefined,
|
||||
classId: undefined
|
||||
});
|
||||
|
||||
// 级联选择器选项
|
||||
const collegeOptions = ref<CascadeOptionVo[]>([]);
|
||||
const majorOptions = ref<CascadeOptionVo[]>([]);
|
||||
const classOptions = ref<CascadeOptionVo[]>([]);
|
||||
|
||||
// 统计数据
|
||||
const statisticsData = ref<StudentStatisticsVo>();
|
||||
|
||||
// 图表实例
|
||||
let chart: echarts.ECharts | null = null;
|
||||
|
||||
/** 设置默认时间范围(当前月第一天到最后一天) */
|
||||
const setDefaultTimeRange = () => {
|
||||
const now = new Date();
|
||||
const year = now.getFullYear();
|
||||
const month = now.getMonth();
|
||||
|
||||
// 当前月第一天 00:00:00
|
||||
const firstDay = new Date(year, month, 1);
|
||||
const startTime = `${firstDay.getFullYear()}-${String(firstDay.getMonth() + 1).padStart(2, '0')}-${String(firstDay.getDate()).padStart(2, '0')} 00:00:00`;
|
||||
|
||||
// 当前月最后一天 23:59:59
|
||||
const lastDay = new Date(year, month + 1, 0);
|
||||
const endTime = `${lastDay.getFullYear()}-${String(lastDay.getMonth() + 1).padStart(2, '0')}-${String(lastDay.getDate()).padStart(2, '0')} 23:59:59`;
|
||||
|
||||
queryParams.startTime = startTime;
|
||||
queryParams.endTime = endTime;
|
||||
};
|
||||
|
||||
/** 查询学院列表 */
|
||||
const getCollegeList = async () => {
|
||||
try {
|
||||
const res = await getColleges();
|
||||
collegeOptions.value = res.data || [];
|
||||
} catch (error) {
|
||||
console.error('获取学院列表失败:', error);
|
||||
}
|
||||
};
|
||||
|
||||
/** 学院变化事件 */
|
||||
const onCollegeChange = async (collegeId?: number) => {
|
||||
queryParams.majorId = undefined;
|
||||
queryParams.classId = undefined;
|
||||
majorOptions.value = [];
|
||||
classOptions.value = [];
|
||||
|
||||
if (collegeId) {
|
||||
try {
|
||||
const res = await getMajorsByCollegeId(collegeId);
|
||||
majorOptions.value = res.data || [];
|
||||
} catch (error) {
|
||||
console.error('获取专业列表失败:', error);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/** 专业变化事件 */
|
||||
const onMajorChange = async (majorId?: number) => {
|
||||
queryParams.classId = undefined;
|
||||
classOptions.value = [];
|
||||
|
||||
if (majorId) {
|
||||
try {
|
||||
const res = await getClassesByMajorId(majorId);
|
||||
classOptions.value = res.data || [];
|
||||
} catch (error) {
|
||||
console.error('获取班级列表失败:', error);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = async () => {
|
||||
if (!queryParams.startTime || !queryParams.endTime) {
|
||||
ElMessage.warning('请填写统计开始时间和结束时间');
|
||||
return;
|
||||
}
|
||||
|
||||
loading.value = true;
|
||||
try {
|
||||
const res = await getStatistics(queryParams);
|
||||
statisticsData.value = res.data;
|
||||
|
||||
// 渲染图表
|
||||
await nextTick();
|
||||
renderChart();
|
||||
} catch (error) {
|
||||
console.error('获取统计数据失败:', error);
|
||||
ElMessage.error('获取统计数据失败');
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields();
|
||||
// 重置为默认时间范围
|
||||
setDefaultTimeRange();
|
||||
queryParams.collegeId = undefined;
|
||||
queryParams.majorId = undefined;
|
||||
queryParams.classId = undefined;
|
||||
majorOptions.value = [];
|
||||
classOptions.value = [];
|
||||
statisticsData.value = undefined;
|
||||
|
||||
if (chart) {
|
||||
chart.clear();
|
||||
}
|
||||
};
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = async () => {
|
||||
if (!statisticsData.value) {
|
||||
ElMessage.warning('暂无数据可导出');
|
||||
return;
|
||||
}
|
||||
|
||||
exportLoading.value = true;
|
||||
try {
|
||||
const response = await exportStatistics(queryParams);
|
||||
|
||||
let blobData: Blob;
|
||||
if (response instanceof Blob) {
|
||||
blobData = response;
|
||||
} else if (response.data instanceof Blob) {
|
||||
blobData = response.data;
|
||||
} else {
|
||||
throw new Error('无效的响应数据格式');
|
||||
}
|
||||
|
||||
// 创建下载链接
|
||||
const url = window.URL.createObjectURL(blobData);
|
||||
const link = document.createElement('a');
|
||||
link.href = url;
|
||||
|
||||
// 生成文件名
|
||||
const now = new Date();
|
||||
const dateStr = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, '0')}-${String(now.getDate()).padStart(2, '0')}`;
|
||||
const timeStr = `${String(now.getHours()).padStart(2, '0')}_${String(now.getMinutes()).padStart(2, '0')}_${String(now.getSeconds()).padStart(2, '0')}`;
|
||||
link.download = `学生统计数据_${dateStr}_${timeStr}.xlsx`;
|
||||
|
||||
link.style.display = 'none';
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
window.URL.revokeObjectURL(url);
|
||||
|
||||
ElMessage.success('导出成功');
|
||||
} catch (error) {
|
||||
console.error('导出失败:', error);
|
||||
ElMessage.error('导出失败');
|
||||
} finally {
|
||||
exportLoading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
/** 获取图表标题 */
|
||||
const getChartTitle = () => {
|
||||
if (!statisticsData.value) return '';
|
||||
|
||||
const dimension = statisticsData.value.dimension;
|
||||
switch (dimension) {
|
||||
case 'college':
|
||||
return '二级学院统计';
|
||||
case 'major':
|
||||
return '专业统计';
|
||||
case 'class':
|
||||
return '班级统计';
|
||||
case 'classDetail':
|
||||
return '班级详情统计';
|
||||
default:
|
||||
return '统计图表';
|
||||
}
|
||||
};
|
||||
|
||||
/** 渲染图表 */
|
||||
const renderChart = () => {
|
||||
if (!chartRef.value || !statisticsData.value) return;
|
||||
|
||||
// 销毁现有图表
|
||||
if (chart) {
|
||||
chart.dispose();
|
||||
}
|
||||
|
||||
// 创建新图表
|
||||
chart = echarts.init(chartRef.value);
|
||||
|
||||
const chartData = statisticsData.value.chartData || [];
|
||||
const names = chartData.map((item) => item.name);
|
||||
|
||||
const option = {
|
||||
title: {
|
||||
text: getChartTitle(),
|
||||
left: 'center'
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'shadow'
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
data: ['宿舍扣分总数', '宿舍违纪记录总数', '宿舍违纪记录扣分总数', '教学区违纪记录总数', '教学区违纪记录扣分总数'],
|
||||
top: 30
|
||||
},
|
||||
grid: {
|
||||
left: '3%',
|
||||
right: '4%',
|
||||
bottom: '3%',
|
||||
top: '15%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: names,
|
||||
axisTick: {
|
||||
alignWithLabel: true
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value'
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '宿舍扣分总数',
|
||||
type: 'bar',
|
||||
data: chartData.map((item) => item.dormDeductionCount)
|
||||
},
|
||||
{
|
||||
name: '宿舍违纪记录总数',
|
||||
type: 'bar',
|
||||
data: chartData.map((item) => item.dormViolationCount)
|
||||
},
|
||||
{
|
||||
name: '宿舍违纪记录扣分总数',
|
||||
type: 'bar',
|
||||
data: chartData.map((item) => item.dormViolationDeduction)
|
||||
},
|
||||
{
|
||||
name: '教学区违纪记录总数',
|
||||
type: 'bar',
|
||||
data: chartData.map((item) => item.teachingViolationCount)
|
||||
},
|
||||
{
|
||||
name: '教学区违纪记录扣分总数',
|
||||
type: 'bar',
|
||||
data: chartData.map((item) => item.teachingViolationDeduction)
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
chart.setOption(option);
|
||||
|
||||
// 监听窗口大小变化
|
||||
window.addEventListener('resize', () => {
|
||||
chart?.resize();
|
||||
});
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
// 设置默认时间范围
|
||||
setDefaultTimeRange();
|
||||
// 获取学院列表
|
||||
getCollegeList();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.page-container {
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
.search-btn-container {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.card-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
+60
-125
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<el-dialog :title="dialogTitle" v-model="dialogVisible" width="1200px" append-to-body @close="handleClose">
|
||||
<el-form ref="dormHygieneCheckFormRef" :model="form" :rules="rules" label-width="120px">
|
||||
<!-- 第一行:检查标题、校区名称、宿舍区名称 -->
|
||||
<!-- 第一行:检查标题、校区名称、宿舍楼名称 -->
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="检查标题" prop="checkTitle">
|
||||
@@ -23,26 +23,6 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="宿舍区名称" prop="areaId">
|
||||
<el-select
|
||||
v-model="form.areaId"
|
||||
placeholder="请选择宿舍区"
|
||||
clearable
|
||||
filterable
|
||||
:loading="dormLoading"
|
||||
@change="handleAreaChange"
|
||||
style="width: 100%"
|
||||
:disabled="!form.campusId"
|
||||
>
|
||||
<el-option v-for="area in areaOptions" :key="area.id" :label="area.areaName" :value="area.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 第二行:宿舍楼名称、房间名称、宿舍总分 -->
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="宿舍楼名称" prop="buildingId">
|
||||
<el-select
|
||||
@@ -53,12 +33,16 @@
|
||||
:loading="dormLoading"
|
||||
@change="handleBuildingChange"
|
||||
style="width: 100%"
|
||||
:disabled="!form.areaId"
|
||||
:disabled="!form.campusId"
|
||||
>
|
||||
<el-option v-for="building in buildingOptions" :key="building.id" :label="building.buildingName" :value="building.id" />
|
||||
<el-option v-for="building in buildingOptions" :key="building.id" :label="getBuildingDisplayName(building)" :value="building.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 第二行:房间名称、宿舍扣分、卫生等级 -->
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="房间名称" prop="roomId">
|
||||
<el-select
|
||||
@@ -76,10 +60,10 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="宿舍总分" prop="totalScore">
|
||||
<el-form-item label="宿舍扣分" prop="totalScore">
|
||||
<el-input
|
||||
v-model="form.totalScore"
|
||||
placeholder="请输入宿舍总分(0-100分)"
|
||||
placeholder="请输入宿舍扣分(默认0分)"
|
||||
type="number"
|
||||
:min="0"
|
||||
:max="100"
|
||||
@@ -88,10 +72,6 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 第三行:卫生等级、检查类型、检查级别 -->
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="卫生等级" prop="hygieneGrade">
|
||||
<el-select v-model="form.hygieneGrade" placeholder="请选择卫生等级" style="width: 100%" @change="handleHygieneGradeChange">
|
||||
@@ -99,6 +79,10 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 第三行:检查类型、检查级别、检查员姓名 -->
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="检查类型" prop="checkType">
|
||||
<el-select v-model="form.checkType" placeholder="请选择检查类型" style="width: 100%">
|
||||
@@ -113,10 +97,6 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 第四行:检查员姓名、检查日期 -->
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="检查员姓名" prop="checkerName">
|
||||
<el-select
|
||||
@@ -140,6 +120,10 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 第四行:检查日期 -->
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="检查日期" prop="checkDate">
|
||||
<el-date-picker
|
||||
@@ -167,12 +151,12 @@
|
||||
<div class="room-students-container">
|
||||
<div class="room-students-table-wrapper">
|
||||
<el-table :data="roomStudents" stripe size="small" table-layout="auto">
|
||||
<!-- 学生个人得分 -->
|
||||
<el-table-column label="个人得分" width="120" fixed="left">
|
||||
<!-- 学生个人扣分 -->
|
||||
<el-table-column label="个人扣分" width="120" fixed="left">
|
||||
<template #default="scope">
|
||||
<el-input
|
||||
v-model="scope.row.student_score"
|
||||
placeholder="0-100分"
|
||||
placeholder="默认0分"
|
||||
size="small"
|
||||
type="number"
|
||||
:min="0"
|
||||
@@ -415,14 +399,10 @@ interface CampusOptionVO {
|
||||
campusName: string;
|
||||
}
|
||||
|
||||
interface AreaOptionVO {
|
||||
id: string | number;
|
||||
areaName: string;
|
||||
}
|
||||
|
||||
interface BuildingOptionVO {
|
||||
id: string | number;
|
||||
buildingName: string;
|
||||
buildingType?: string; // 宿舍楼类型(1男生楼 2女生楼 3混合楼)
|
||||
}
|
||||
|
||||
interface RoomOptionVO {
|
||||
@@ -457,7 +437,6 @@ const dormHygieneCheckFormRef = ref();
|
||||
|
||||
// 宿舍级联选择器相关状态
|
||||
const campusOptions = ref<CampusOptionVO[]>([]);
|
||||
const areaOptions = ref<AreaOptionVO[]>([]);
|
||||
const buildingOptions = ref<BuildingOptionVO[]>([]);
|
||||
const roomOptions = ref<RoomOptionVO[]>([]);
|
||||
const dormLoading = ref(false);
|
||||
@@ -517,11 +496,9 @@ const initFormData: DormHygieneCheckForm = {
|
||||
roomName: undefined,
|
||||
buildingId: undefined,
|
||||
buildingName: undefined,
|
||||
areaId: undefined,
|
||||
areaName: undefined,
|
||||
campusId: undefined,
|
||||
campusName: undefined,
|
||||
totalScore: undefined,
|
||||
totalScore: 0,
|
||||
hygieneGrade: 'A', // 默认 A - 优秀
|
||||
attachmentIds: undefined,
|
||||
checkSummary: undefined,
|
||||
@@ -722,8 +699,7 @@ const resetForm = () => {
|
||||
attachmentList.value = [];
|
||||
roomStudents.value = [];
|
||||
|
||||
// 清空宿舍级联选项
|
||||
areaOptions.value = [];
|
||||
// 清空宿舍级联选项 - 移除宿舍区相关
|
||||
buildingOptions.value = [];
|
||||
roomOptions.value = [];
|
||||
|
||||
@@ -812,15 +788,12 @@ const loadCampusOptions = async () => {
|
||||
/** 校区选择变化处理 */
|
||||
const handleCampusChange = async (campusId: string | number) => {
|
||||
console.log('校区选择变化处理', campusId);
|
||||
// 清空下级选项
|
||||
form.areaId = undefined;
|
||||
form.areaName = undefined;
|
||||
// 清空下级选项 - 移除宿舍区相关字段
|
||||
form.buildingId = undefined;
|
||||
form.buildingName = undefined;
|
||||
form.roomId = undefined;
|
||||
form.roomName = undefined;
|
||||
|
||||
areaOptions.value = [];
|
||||
buildingOptions.value = [];
|
||||
roomOptions.value = [];
|
||||
|
||||
@@ -832,77 +805,22 @@ const handleCampusChange = async (campusId: string | number) => {
|
||||
form.campusName = selectedCampus.campusName;
|
||||
}
|
||||
|
||||
// 加载宿舍区选项
|
||||
await loadAreaOptions(campusId);
|
||||
// 直接加载宿舍楼选项(根据校区过滤)
|
||||
await loadBuildingOptions(campusId);
|
||||
} else {
|
||||
form.campusId = undefined;
|
||||
form.campusName = undefined;
|
||||
}
|
||||
};
|
||||
|
||||
/** 加载宿舍区选项 */
|
||||
const loadAreaOptions = async (campusId: string | number) => {
|
||||
try {
|
||||
const cacheKey = `area_${campusId}`;
|
||||
const cachedData = getCachedData(cacheKey);
|
||||
|
||||
if (cachedData) {
|
||||
areaOptions.value = cachedData;
|
||||
return;
|
||||
}
|
||||
|
||||
dormLoading.value = true;
|
||||
const res = await request({
|
||||
url: '/ssqxx/dormArea/list',
|
||||
method: 'get',
|
||||
params: { campusId }
|
||||
});
|
||||
const data = res.rows || [];
|
||||
areaOptions.value = data;
|
||||
setCachedData(cacheKey, data);
|
||||
} catch (error) {
|
||||
console.error('加载宿舍区选项失败:', error);
|
||||
areaOptions.value = [];
|
||||
} finally {
|
||||
dormLoading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
/** 宿舍区选择变化处理 */
|
||||
const handleAreaChange = async (areaId: string | number) => {
|
||||
// 清空下级选项
|
||||
form.buildingId = undefined;
|
||||
form.buildingName = undefined;
|
||||
form.roomId = undefined;
|
||||
form.roomName = undefined;
|
||||
|
||||
buildingOptions.value = [];
|
||||
roomOptions.value = [];
|
||||
|
||||
if (areaId) {
|
||||
// 设置宿舍区名称
|
||||
const selectedArea = areaOptions.value.find((area) => area.id === areaId);
|
||||
if (selectedArea) {
|
||||
form.areaId = areaId;
|
||||
form.areaName = selectedArea.areaName;
|
||||
}
|
||||
|
||||
// 加载宿舍楼选项
|
||||
await loadBuildingOptions(areaId);
|
||||
} else {
|
||||
form.areaId = undefined;
|
||||
form.areaName = undefined;
|
||||
}
|
||||
};
|
||||
|
||||
/** 加载宿舍楼选项 */
|
||||
const loadBuildingOptions = async (areaId: string | number) => {
|
||||
/** 加载宿舍楼选项 - 修改为直接根据校区ID过滤 */
|
||||
const loadBuildingOptions = async (campusId: string | number) => {
|
||||
try {
|
||||
dormLoading.value = true;
|
||||
const res = await request({
|
||||
url: '/sslxx/dormBuilding/list',
|
||||
method: 'get',
|
||||
params: { areaId }
|
||||
params: { campusId } // 直接使用校区ID过滤,不再使用areaId
|
||||
});
|
||||
buildingOptions.value = res.rows || [];
|
||||
} catch (error) {
|
||||
@@ -1075,18 +993,13 @@ const loadCascadeOptionsForUpdate = async (formData: DormHygieneCheckForm) => {
|
||||
// 并行加载所有需要的宿舍选项,提升性能
|
||||
const loadTasks = [];
|
||||
|
||||
// 如果有校区ID,加载宿舍区选项
|
||||
// 如果有校区ID,加载宿舍楼选项
|
||||
if (formData.campusId) {
|
||||
loadTasks.push(loadAreaOptions(formData.campusId));
|
||||
loadTasks.push(loadBuildingOptions(formData.campusId));
|
||||
|
||||
// 如果有宿舍区ID,加载宿舍楼选项
|
||||
if (formData.areaId) {
|
||||
loadTasks.push(loadBuildingOptions(formData.areaId));
|
||||
|
||||
// 如果有宿舍楼ID,加载房间选项
|
||||
if (formData.buildingId) {
|
||||
loadTasks.push(loadRoomOptions(formData.buildingId));
|
||||
}
|
||||
// 如果有宿舍楼ID,加载房间选项
|
||||
if (formData.buildingId) {
|
||||
loadTasks.push(loadRoomOptions(formData.buildingId));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1163,7 +1076,7 @@ const loadRoomStudents = async () => {
|
||||
// 为每个学生设置默认值
|
||||
roomStudents.value = res.data.map((student: any) => ({
|
||||
...student,
|
||||
student_score: student.student_score || null, // 个人得分,默认为空
|
||||
student_score: 0, // 个人得分,新增时默认为0
|
||||
attendance_status: student.attendance_status || '1', // 出勤状态,默认1-在寝
|
||||
student_grade: student.student_grade || 'A' // 学生评级,默认A-优秀
|
||||
}));
|
||||
@@ -1414,6 +1327,20 @@ const handleAttachmentData = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
// 宿舍楼选项显示格式
|
||||
const getBuildingDisplayName = (building: BuildingOptionVO) => {
|
||||
let displayName = building.buildingName;
|
||||
if (building.buildingType) {
|
||||
if (building.buildingType === '1') {
|
||||
displayName = `(男)${displayName}`;
|
||||
} else if (building.buildingType === '2') {
|
||||
displayName = `(女)${displayName}`;
|
||||
}
|
||||
// 混合楼(3)不显示性别标识
|
||||
}
|
||||
return displayName;
|
||||
};
|
||||
|
||||
// 组件挂载时加载校区选项
|
||||
const initCampusOptions = async () => {
|
||||
await loadCampusOptions();
|
||||
@@ -1482,21 +1409,29 @@ const handleStudentGradeChange = (student: any) => {
|
||||
// 处理宿舍总分变化 - 自动填写学生个人得分
|
||||
const handleTotalScoreChange = () => {
|
||||
// 验证宿舍总分范围
|
||||
if (form.totalScore !== null && form.totalScore !== undefined && form.totalScore !== 0 && String(form.totalScore) !== '0') {
|
||||
if (form.totalScore !== null && form.totalScore !== undefined && form.totalScore !== '') {
|
||||
const score = parseFloat(form.totalScore.toString());
|
||||
if (isNaN(score) || score < 0 || score > 100) {
|
||||
ElMessage.warning('宿舍总分必须在0-100分之间');
|
||||
form.totalScore = null;
|
||||
form.totalScore = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
// 如果分数有效且有学生,自动为所有学生设置相同的个人得分
|
||||
// 如果分数有效且有学生,自动为所有学生设置相同的个人得分(包括0分)
|
||||
if (roomStudents.value.length > 0) {
|
||||
roomStudents.value.forEach((student: any) => {
|
||||
student.student_score = score;
|
||||
});
|
||||
ElMessage.success(`已自动为${roomStudents.value.length}名学生设置个人得分:${score}分`);
|
||||
}
|
||||
} else if (form.totalScore === 0 || form.totalScore === '0') {
|
||||
// 特别处理0分的情况
|
||||
if (roomStudents.value.length > 0) {
|
||||
roomStudents.value.forEach((student: any) => {
|
||||
student.student_score = 0;
|
||||
});
|
||||
ElMessage.success(`已自动为${roomStudents.value.length}名学生设置个人得分:0分`);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
+1735
File diff suppressed because it is too large.
Load diff
+804
@@ -0,0 +1,804 @@
|
||||
<template>
|
||||
<el-dialog :title="dialogTitle" v-model="dialogVisible" width="1400px" append-to-body @close="handleClose">
|
||||
<!-- 基础信息选择区域 -->
|
||||
<el-form ref="mainFormRef" :model="form" :rules="rules" label-width="120px">
|
||||
<el-card shadow="never" style="margin-bottom: 20px">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span>检查基础信息</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- 第一行:检查标题、检查日期、检查员 -->
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="检查标题" prop="checkTitle">
|
||||
<el-input v-model="form.checkTitle" placeholder="请输入检查标题" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="检查日期" prop="checkDate">
|
||||
<el-date-picker
|
||||
v-model="form.checkDate"
|
||||
type="datetime"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
placeholder="请选择检查日期"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="检查员" prop="checkerName">
|
||||
<el-select
|
||||
v-model="form.checkerName"
|
||||
placeholder="请选择检查员"
|
||||
filterable
|
||||
remote
|
||||
:remote-method="handleCheckerSearch"
|
||||
:loading="checkerLoading"
|
||||
@change="handleCheckerChange"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="checker in checkerOptions"
|
||||
:key="checker.userId"
|
||||
:label="`${checker.nickName || checker.userName}`"
|
||||
:value="checker.nickName || checker.userName"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 第二行:检查类型、检查级别 -->
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="检查类型" prop="checkType">
|
||||
<el-select v-model="form.checkType" placeholder="请选择检查类型" style="width: 100%">
|
||||
<el-option v-for="dict in xg_dorm_hygiene_check_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="检查级别" prop="checkLevel">
|
||||
<el-select v-model="form.checkLevel" placeholder="请选择检查级别" style="width: 100%">
|
||||
<el-option v-for="dict in xg_dorm_hygiene_check_level" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 第三行:校区、宿舍楼选择 -->
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="校区名称" prop="campusId">
|
||||
<el-select
|
||||
v-model="form.campusId"
|
||||
placeholder="请选择校区"
|
||||
filterable
|
||||
:loading="dormLoading"
|
||||
@change="handleCampusChange"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option v-for="campus in campusOptions" :key="campus.id" :label="campus.campusName" :value="campus.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="宿舍楼名称" prop="buildingId">
|
||||
<el-select
|
||||
v-model="form.buildingId"
|
||||
placeholder="请选择宿舍楼"
|
||||
filterable
|
||||
:loading="dormLoading"
|
||||
@change="handleBuildingChange"
|
||||
style="width: 100%"
|
||||
:disabled="!form.campusId"
|
||||
>
|
||||
<el-option v-for="building in buildingOptions" :key="building.id" :label="getBuildingDisplayName(building)" :value="building.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</el-form>
|
||||
|
||||
<!-- 房间选择区域 -->
|
||||
<el-card shadow="never" v-if="form.buildingId && floorRooms.length > 0">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span>宿舍房间列表</span>
|
||||
<div class="header-actions">
|
||||
<el-tag type="info" size="small">{{ getBuildingName() }}</el-tag>
|
||||
<el-divider direction="vertical" />
|
||||
<span class="room-stats"> 总房间数: {{ totalRoomsCount }} | 已检查: {{ completedRooms.size }} </span>
|
||||
<el-divider direction="vertical" />
|
||||
<el-text type="primary" size="small">双击房间开始检查</el-text>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- 楼层和房间展示 -->
|
||||
<div class="floors-container">
|
||||
<div v-for="floorData in floorRooms" :key="floorData.floor" class="floor-section">
|
||||
<div class="floor-header">
|
||||
<h4>{{ floorData.floor }}楼</h4>
|
||||
<div class="floor-actions">
|
||||
<span class="floor-stats"> 已检查: {{ getFloorCompletedCount(floorData.floor) }} / {{ floorData.rooms.length }} </span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="rooms-grid">
|
||||
<div
|
||||
v-for="room in floorData.rooms"
|
||||
:key="room.id"
|
||||
class="room-card"
|
||||
:class="{
|
||||
'completed': completedRooms.has(room.id),
|
||||
'pending': !completedRooms.has(room.id)
|
||||
}"
|
||||
@dblclick="handleRoomDoubleClick(room)"
|
||||
>
|
||||
<div class="room-card-content">
|
||||
<div class="room-name">{{ room.roomName }}</div>
|
||||
<div class="room-info">
|
||||
<span class="room-code">{{ room.roomCode || room.roomName }}</span>
|
||||
</div>
|
||||
<div class="room-status">
|
||||
<el-icon v-if="completedRooms.has(room.id)" class="completed-icon">
|
||||
<Check />
|
||||
</el-icon>
|
||||
<el-icon v-else class="pending-icon">
|
||||
<Calendar />
|
||||
</el-icon>
|
||||
</div>
|
||||
</div>
|
||||
<div class="room-hint">
|
||||
<span v-if="completedRooms.has(room.id)" class="completed-text">已检查</span>
|
||||
<span v-else class="pending-text">双击检查</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 空状态 -->
|
||||
<el-empty v-if="floorRooms.length === 0 && !roomsLoading" description="该宿舍楼暂无房间信息" />
|
||||
|
||||
<!-- 加载状态 -->
|
||||
<div v-if="roomsLoading" class="loading-container">
|
||||
<el-skeleton :rows="3" animated />
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="handleClose">关 闭</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- 单个房间检查弹窗 -->
|
||||
<DormHygieneCheckSingleDialog
|
||||
:visible="singleCheckVisible"
|
||||
:room-info="currentRoom"
|
||||
:check-info="form"
|
||||
:title="singleCheckTitle"
|
||||
@update:visible="(value) => (singleCheckVisible = value)"
|
||||
@submit="handleSingleCheckSubmit"
|
||||
@close="handleSingleCheckClose"
|
||||
/>
|
||||
|
||||
<!-- 编辑房间检查弹窗 -->
|
||||
<DormHygieneCheckEditDialog
|
||||
:visible="editCheckVisible"
|
||||
:form-data="currentEditData"
|
||||
:title="editCheckTitle"
|
||||
@update:visible="(value) => (editCheckVisible = value)"
|
||||
@submit="handleEditCheckSubmit"
|
||||
@close="handleEditCheckClose"
|
||||
/>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup name="DormHygieneCheckMainDialog" lang="ts">
|
||||
import { ref, reactive, computed, watch, getCurrentInstance, ComponentInternalInstance } from 'vue';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { Check, Calendar } from '@element-plus/icons-vue';
|
||||
import DormHygieneCheckSingleDialog from './DormHygieneCheckSingleDialog.vue';
|
||||
import DormHygieneCheckEditDialog from './DormHygieneCheckEditDialog.vue';
|
||||
import request from '@/utils/request';
|
||||
|
||||
// 组件实例
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
|
||||
// 组件属性
|
||||
interface Props {
|
||||
visible: boolean;
|
||||
title: string;
|
||||
}
|
||||
|
||||
// 组件事件
|
||||
interface Emits {
|
||||
(e: 'update:visible', value: boolean): void;
|
||||
(e: 'submit', data: any): void;
|
||||
(e: 'close'): void;
|
||||
}
|
||||
|
||||
const props = defineProps<Props>();
|
||||
const emit = defineEmits<Emits>();
|
||||
|
||||
// 响应式数据
|
||||
const mainFormRef = ref();
|
||||
const dormLoading = ref(false);
|
||||
const roomsLoading = ref(false);
|
||||
const checkerLoading = ref(false);
|
||||
|
||||
// 基础表单数据
|
||||
const form = reactive({
|
||||
checkTitle: '',
|
||||
checkDate: '',
|
||||
checkerId: undefined,
|
||||
checkerName: '',
|
||||
checkType: '1',
|
||||
checkLevel: '1',
|
||||
campusId: undefined,
|
||||
campusName: '',
|
||||
buildingId: undefined,
|
||||
buildingName: ''
|
||||
});
|
||||
|
||||
// 表单验证规则
|
||||
const rules = reactive({
|
||||
checkTitle: [{ required: true, message: '检查标题不能为空', trigger: 'blur' }],
|
||||
checkDate: [{ required: true, message: '检查日期不能为空', trigger: 'change' }],
|
||||
checkerName: [{ required: true, message: '请选择检查员', trigger: 'change' }],
|
||||
checkType: [{ required: true, message: '请选择检查类型', trigger: 'change' }],
|
||||
checkLevel: [{ required: true, message: '请选择检查级别', trigger: 'change' }],
|
||||
campusId: [{ required: true, message: '请选择校区', trigger: 'change' }],
|
||||
buildingId: [{ required: true, message: '请选择宿舍楼', trigger: 'change' }]
|
||||
});
|
||||
|
||||
// 选项数据
|
||||
const campusOptions = ref<any[]>([]);
|
||||
const buildingOptions = ref<any[]>([]);
|
||||
const checkerOptions = ref<any[]>([]);
|
||||
|
||||
// 房间相关数据
|
||||
const floorRooms = ref<any[]>([]);
|
||||
const completedRooms = ref<Set<string | number>>(new Set());
|
||||
const allRooms = ref<any[]>([]);
|
||||
const roomCheckIds = ref<Map<string | number, string | number>>(new Map()); // 存储房间对应的检查记录ID
|
||||
|
||||
// 单个房间检查弹窗相关
|
||||
const singleCheckVisible = ref(false);
|
||||
const currentRoom = ref<any>(null);
|
||||
|
||||
// 编辑弹窗相关
|
||||
const editCheckVisible = ref(false);
|
||||
const currentEditData = ref<any>(null);
|
||||
|
||||
// 字典数据
|
||||
const xg_dorm_hygiene_check_level = ref<any[]>([]);
|
||||
const xg_dorm_hygiene_check_type = ref<any[]>([]);
|
||||
|
||||
// 初始化字典数据
|
||||
const initDict = () => {
|
||||
if (proxy && (proxy as any).useDict) {
|
||||
const dictData = (proxy as any).useDict('xg_dorm_hygiene_check_level', 'xg_dorm_hygiene_check_type');
|
||||
xg_dorm_hygiene_check_level.value = dictData.xg_dorm_hygiene_check_level;
|
||||
xg_dorm_hygiene_check_type.value = dictData.xg_dorm_hygiene_check_type;
|
||||
}
|
||||
};
|
||||
|
||||
// 计算属性
|
||||
const dialogVisible = computed({
|
||||
get: () => props.visible,
|
||||
set: (value) => emit('update:visible', value)
|
||||
});
|
||||
|
||||
const dialogTitle = computed(() => props.title);
|
||||
|
||||
const totalRoomsCount = computed(() => allRooms.value.length);
|
||||
|
||||
const singleCheckTitle = computed(() => {
|
||||
return currentRoom.value ? `${currentRoom.value.roomName} - 卫生检查` : '房间卫生检查';
|
||||
});
|
||||
|
||||
const editCheckTitle = computed(() => {
|
||||
return currentRoom.value ? `${currentRoom.value.roomName} - 编辑检查记录` : '编辑检查记录';
|
||||
});
|
||||
|
||||
// 生成默认检查标题
|
||||
const generateDefaultCheckTitle = () => {
|
||||
const now = new Date();
|
||||
const year = now.getFullYear();
|
||||
const month = String(now.getMonth() + 1).padStart(2, '0');
|
||||
const day = String(now.getDate()).padStart(2, '0');
|
||||
return `${year}${month}${day}宿舍卫生检查`;
|
||||
};
|
||||
|
||||
// 初始化表单
|
||||
const initForm = () => {
|
||||
Object.assign(form, {
|
||||
checkTitle: generateDefaultCheckTitle(),
|
||||
checkDate: new Date().toISOString().slice(0, 19).replace('T', ' '),
|
||||
checkType: '1',
|
||||
checkLevel: '1',
|
||||
checkerId: undefined,
|
||||
checkerName: '',
|
||||
campusId: undefined,
|
||||
campusName: '',
|
||||
buildingId: undefined,
|
||||
buildingName: ''
|
||||
});
|
||||
|
||||
completedRooms.value.clear();
|
||||
floorRooms.value = [];
|
||||
allRooms.value = [];
|
||||
roomCheckIds.value.clear(); // 清空房间检查记录ID映射
|
||||
|
||||
// 获取当前用户信息
|
||||
fetchCurrentUserInfo();
|
||||
};
|
||||
|
||||
// 获取当前用户信息
|
||||
const fetchCurrentUserInfo = async () => {
|
||||
try {
|
||||
const response = await request({
|
||||
url: '/system/user/getInfo',
|
||||
method: 'get'
|
||||
});
|
||||
|
||||
if (response.code === 200 && response.data?.user) {
|
||||
const user = response.data.user;
|
||||
form.checkerId = user.userId;
|
||||
form.checkerName = user.nickName || user.userName;
|
||||
}
|
||||
} catch (error) {
|
||||
console.warn('获取用户信息失败:', error);
|
||||
}
|
||||
};
|
||||
|
||||
// 加载校区选项
|
||||
const loadCampusOptions = async () => {
|
||||
try {
|
||||
dormLoading.value = true;
|
||||
const res = await request({
|
||||
url: '/xqxx/dormCampus/list',
|
||||
method: 'get'
|
||||
});
|
||||
campusOptions.value = res.rows || [];
|
||||
} catch (error) {
|
||||
console.error('加载校区选项失败:', error);
|
||||
ElMessage.error('加载校区选项失败');
|
||||
} finally {
|
||||
dormLoading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 校区选择变化处理
|
||||
const handleCampusChange = async (campusId: string | number) => {
|
||||
// 清空下级选项
|
||||
form.buildingId = undefined;
|
||||
form.buildingName = '';
|
||||
buildingOptions.value = [];
|
||||
floorRooms.value = [];
|
||||
allRooms.value = [];
|
||||
completedRooms.value.clear();
|
||||
roomCheckIds.value.clear(); // 清空房间检查记录ID映射
|
||||
|
||||
if (campusId) {
|
||||
const selectedCampus = campusOptions.value.find((campus) => campus.id === campusId);
|
||||
if (selectedCampus) {
|
||||
form.campusId = campusId;
|
||||
form.campusName = selectedCampus.campusName;
|
||||
}
|
||||
await loadBuildingOptions(campusId);
|
||||
} else {
|
||||
form.campusId = undefined;
|
||||
form.campusName = '';
|
||||
}
|
||||
};
|
||||
|
||||
// 加载宿舍楼选项
|
||||
const loadBuildingOptions = async (campusId: string | number) => {
|
||||
try {
|
||||
dormLoading.value = true;
|
||||
const res = await request({
|
||||
url: '/sslxx/dormBuilding/list',
|
||||
method: 'get',
|
||||
params: { campusId }
|
||||
});
|
||||
buildingOptions.value = res.rows || [];
|
||||
} catch (error) {
|
||||
console.error('加载宿舍楼选项失败:', error);
|
||||
ElMessage.error('加载宿舍楼选项失败');
|
||||
} finally {
|
||||
dormLoading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 宿舍楼选择变化处理
|
||||
const handleBuildingChange = async (buildingId: string | number) => {
|
||||
floorRooms.value = [];
|
||||
allRooms.value = [];
|
||||
completedRooms.value.clear();
|
||||
roomCheckIds.value.clear(); // 清空房间检查记录ID映射
|
||||
|
||||
if (buildingId) {
|
||||
const selectedBuilding = buildingOptions.value.find((building) => building.id === buildingId);
|
||||
if (selectedBuilding) {
|
||||
form.buildingId = buildingId;
|
||||
form.buildingName = selectedBuilding.buildingName;
|
||||
}
|
||||
await loadRoomsByFloor(buildingId);
|
||||
} else {
|
||||
form.buildingId = undefined;
|
||||
form.buildingName = '';
|
||||
}
|
||||
};
|
||||
|
||||
// 按楼层加载房间
|
||||
const loadRoomsByFloor = async (buildingId: string | number) => {
|
||||
try {
|
||||
roomsLoading.value = true;
|
||||
const res = await request({
|
||||
url: '/xgss/dormRoom/list',
|
||||
method: 'get',
|
||||
params: { buildingId }
|
||||
});
|
||||
|
||||
if (res.code === 200 && res.rows) {
|
||||
allRooms.value = res.rows;
|
||||
|
||||
// 按楼层分组
|
||||
const floorMap = new Map();
|
||||
res.rows.forEach((room: any) => {
|
||||
// 使用房间数据中的floorNum字段作为楼层
|
||||
const floor = room.floorNum || '1';
|
||||
if (!floorMap.has(floor)) {
|
||||
floorMap.set(floor, []);
|
||||
}
|
||||
floorMap.get(floor).push(room);
|
||||
});
|
||||
|
||||
// 转换为数组并排序
|
||||
floorRooms.value = Array.from(floorMap.entries())
|
||||
.map(([floor, rooms]) => ({ floor, rooms }))
|
||||
.sort((a, b) => parseInt(a.floor) - parseInt(b.floor));
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('加载房间失败:', error);
|
||||
ElMessage.error('加载房间失败');
|
||||
} finally {
|
||||
roomsLoading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 加载检查员选项
|
||||
const loadCheckerOptions = async (searchKeyword?: string) => {
|
||||
try {
|
||||
checkerLoading.value = true;
|
||||
const params: any = {
|
||||
pageNum: 1,
|
||||
pageSize: 50,
|
||||
status: '0'
|
||||
};
|
||||
|
||||
if (searchKeyword?.trim()) {
|
||||
params.nickName = searchKeyword.trim();
|
||||
}
|
||||
|
||||
const res = await request({
|
||||
url: '/system/user/list',
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
|
||||
checkerOptions.value = res.rows || [];
|
||||
} catch (error) {
|
||||
console.error('加载检查员选项失败:', error);
|
||||
} finally {
|
||||
checkerLoading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 检查员搜索处理
|
||||
const handleCheckerSearch = (query: string) => {
|
||||
if (query) {
|
||||
loadCheckerOptions(query);
|
||||
} else {
|
||||
loadCheckerOptions();
|
||||
}
|
||||
};
|
||||
|
||||
// 检查员选择变化处理
|
||||
const handleCheckerChange = (checkerName: string) => {
|
||||
const selectedChecker = checkerOptions.value.find((checker) => (checker.nickName || checker.userName) === checkerName);
|
||||
|
||||
if (selectedChecker) {
|
||||
form.checkerId = selectedChecker.userId;
|
||||
form.checkerName = selectedChecker.nickName || selectedChecker.userName;
|
||||
}
|
||||
};
|
||||
|
||||
// 房间双击处理
|
||||
const handleRoomDoubleClick = async (room: any) => {
|
||||
// 验证基础信息是否完整
|
||||
if (!form.checkTitle || !form.checkDate || !form.checkerName || !form.checkType || !form.checkLevel) {
|
||||
ElMessage.warning('请先完善检查基础信息');
|
||||
return;
|
||||
}
|
||||
|
||||
// 检查是否已有记录ID(新增成功后会保存ID)
|
||||
const checkId = roomCheckIds.value.get(room.id);
|
||||
|
||||
if (checkId) {
|
||||
// 有记录ID,说明已经检查过,打开编辑弹窗
|
||||
try {
|
||||
const response = await request({
|
||||
url: `/dormHygieneCheck/dormHygieneCheck/${checkId}`,
|
||||
method: 'get'
|
||||
});
|
||||
|
||||
if (response.code === 200 && response.data) {
|
||||
currentRoom.value = room;
|
||||
currentEditData.value = response.data;
|
||||
editCheckVisible.value = true;
|
||||
return;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('查询检查记录详情失败:', error);
|
||||
ElMessage.error('查询检查记录失败');
|
||||
}
|
||||
}
|
||||
|
||||
// 没有记录ID,打开新增检查弹窗
|
||||
openSingleCheckDialog(room);
|
||||
};
|
||||
|
||||
// 打开单个房间检查弹窗
|
||||
const openSingleCheckDialog = (room: any) => {
|
||||
currentRoom.value = room;
|
||||
singleCheckVisible.value = true;
|
||||
};
|
||||
|
||||
// 单个房间检查提交处理
|
||||
const handleSingleCheckSubmit = (data: any) => {
|
||||
// 标记房间为已完成
|
||||
completedRooms.value.add(currentRoom.value.id);
|
||||
|
||||
// 保存检查记录ID(如果有返回)
|
||||
if (data.id) {
|
||||
roomCheckIds.value.set(currentRoom.value.id, data.id);
|
||||
}
|
||||
|
||||
ElMessage.success(`${currentRoom.value.roomName} 检查完成`);
|
||||
singleCheckVisible.value = false;
|
||||
};
|
||||
|
||||
// 单个房间检查关闭处理
|
||||
const handleSingleCheckClose = () => {
|
||||
singleCheckVisible.value = false;
|
||||
};
|
||||
|
||||
// 编辑弹窗提交处理
|
||||
const handleEditCheckSubmit = async (data: any) => {
|
||||
try {
|
||||
// 调用后端API更新检查记录
|
||||
const response = await request({
|
||||
url: '/dormHygieneCheck/dormHygieneCheck/updateCompleteData',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
|
||||
if (response.code === 200) {
|
||||
// 标记房间为已完成
|
||||
completedRooms.value.add(currentRoom.value.id);
|
||||
roomCheckIds.value.set(currentRoom.value.id, data.id);
|
||||
|
||||
ElMessage.success(`${currentRoom.value.roomName} 检查记录更新完成`);
|
||||
editCheckVisible.value = false;
|
||||
} else {
|
||||
ElMessage.error(response.msg || '更新失败');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('更新检查记录失败:', error);
|
||||
ElMessage.error('更新失败,请重试');
|
||||
}
|
||||
};
|
||||
|
||||
// 编辑弹窗关闭处理
|
||||
const handleEditCheckClose = () => {
|
||||
editCheckVisible.value = false;
|
||||
currentEditData.value = null;
|
||||
};
|
||||
|
||||
// 获取楼层已完成数量
|
||||
const getFloorCompletedCount = (floor: string) => {
|
||||
const floorData = floorRooms.value.find((f) => f.floor === floor);
|
||||
if (!floorData) return 0;
|
||||
return floorData.rooms.filter((room: any) => completedRooms.value.has(room.id)).length;
|
||||
};
|
||||
|
||||
// 获取宿舍楼名称
|
||||
const getBuildingName = () => {
|
||||
const building = buildingOptions.value.find((b) => b.id === form.buildingId);
|
||||
return building ? getBuildingDisplayName(building) : '';
|
||||
};
|
||||
|
||||
// 宿舍楼显示名称
|
||||
const getBuildingDisplayName = (building: any) => {
|
||||
let displayName = building.buildingName;
|
||||
if (building.buildingType) {
|
||||
if (building.buildingType === '1') {
|
||||
displayName = `(男)${displayName}`;
|
||||
} else if (building.buildingType === '2') {
|
||||
displayName = `(女)${displayName}`;
|
||||
}
|
||||
}
|
||||
return displayName;
|
||||
};
|
||||
|
||||
// 关闭弹窗
|
||||
const handleClose = () => {
|
||||
emit('close');
|
||||
initForm();
|
||||
};
|
||||
|
||||
// 监听弹窗显示状态
|
||||
watch(
|
||||
() => props.visible,
|
||||
(visible) => {
|
||||
if (visible) {
|
||||
initForm();
|
||||
initDict();
|
||||
loadCampusOptions();
|
||||
loadCheckerOptions();
|
||||
}
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.card-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.header-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.room-stats {
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.floors-container {
|
||||
/* 移除高度限制,让内容自然撑开 */
|
||||
}
|
||||
|
||||
.floor-section {
|
||||
margin-bottom: 32px;
|
||||
padding: 16px;
|
||||
background: #fafafa;
|
||||
border-radius: 8px;
|
||||
border: 1px solid #e4e7ed;
|
||||
}
|
||||
|
||||
.floor-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 16px;
|
||||
padding-bottom: 12px;
|
||||
border-bottom: 2px solid #409eff;
|
||||
}
|
||||
|
||||
.floor-header h4 {
|
||||
margin: 0;
|
||||
color: #409eff;
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.floor-actions {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.floor-stats {
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.rooms-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.room-card {
|
||||
border: 2px solid #e4e7ed;
|
||||
border-radius: 8px;
|
||||
padding: 16px;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s;
|
||||
background: #fff;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.room-card:hover {
|
||||
border-color: #409eff;
|
||||
box-shadow: 0 2px 12px rgba(64, 158, 255, 0.15);
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
.room-card.pending {
|
||||
border-color: #e4e7ed;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.room-card.completed {
|
||||
border-color: #67c23a;
|
||||
background: #f0f9ff;
|
||||
}
|
||||
|
||||
.room-card-content {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.room-name {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.room-info {
|
||||
font-size: 12px;
|
||||
color: #909399;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.room-status {
|
||||
position: absolute;
|
||||
top: 8px;
|
||||
right: 8px;
|
||||
}
|
||||
|
||||
.pending-icon {
|
||||
color: #909399;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.completed-icon {
|
||||
color: #67c23a;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.room-hint {
|
||||
position: absolute;
|
||||
bottom: 8px;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.completed-text {
|
||||
color: #67c23a;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.pending-text {
|
||||
color: #909399;
|
||||
}
|
||||
|
||||
.loading-container {
|
||||
padding: 20px;
|
||||
}
|
||||
</style>
|
||||
+1604
File diff suppressed because it is too large.
Load diff
+322
@@ -0,0 +1,322 @@
|
||||
<template>
|
||||
<el-dialog v-model="dialogVisible" title="请假流程信息" width="800px" append-to-body @close="handleClose">
|
||||
<div v-loading="loading" class="leave-process-container">
|
||||
<div v-if="studentInfo" class="student-info-header">
|
||||
<div class="student-basic">
|
||||
<h4>{{ studentInfo.studentName }}</h4>
|
||||
<span class="student-no">{{ studentInfo.studentNo }}</span>
|
||||
</div>
|
||||
<div class="leave-basic">
|
||||
<el-tag type="warning" size="small">请假中</el-tag>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="leaveInfo" class="leave-detail-info">
|
||||
<div class="leave-item">
|
||||
<span class="leave-label">请假类型:</span>
|
||||
<span class="leave-value">{{ leaveInfo.leaveTypeName }}</span>
|
||||
</div>
|
||||
<div class="leave-item">
|
||||
<span class="leave-label">请假时间:</span>
|
||||
<span class="leave-value"> {{ formatDateTime(leaveInfo.startTime) }} 至 {{ formatDateTime(leaveInfo.endTime) }} </span>
|
||||
</div>
|
||||
<div class="leave-item">
|
||||
<span class="leave-label">请假原因:</span>
|
||||
<span class="leave-value">{{ leaveInfo.reason || '无' }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="approval-records">
|
||||
<h5>审批记录</h5>
|
||||
<el-table :data="approvalList" border style="width: 100%">
|
||||
<el-table-column type="index" label="序号" align="center" width="60" />
|
||||
<el-table-column prop="nodeName" label="任务名称" align="center" />
|
||||
<el-table-column prop="approveName" label="办理人" align="center">
|
||||
<template #default="scope">
|
||||
<template v-if="scope.row.approveName">
|
||||
<el-tag v-for="(item, index) in scope.row.approveName.split(',')" :key="index" type="success" size="small">
|
||||
{{ item }}
|
||||
</el-tag>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-tag type="info" size="small">无</el-tag>
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="approverPhone" label="办理人电话" width="130" align="center">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.approverPhone && scope.row.approverPhone !== '未录入'">{{ scope.row.approverPhone }}</span>
|
||||
<el-tag v-else type="info" size="small">未录入</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="flowStatus" label="状态" width="100" align="center">
|
||||
<template #default="scope">
|
||||
<el-tag :type="getStatusType(scope.row.flowStatus)" size="small">
|
||||
{{ getStatusText(scope.row.flowStatus) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="message" label="审批意见" align="center">
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.message || '无' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createTime" label="开始时间" width="160" align="center" />
|
||||
<el-table-column prop="updateTime" label="结束时间" width="160" align="center">
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.updateTime || '进行中' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="handleClose">关 闭</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup name="LeaveProcessDialog" lang="ts">
|
||||
import { ref, computed } from 'vue';
|
||||
import request from '@/utils/request';
|
||||
|
||||
// 组件属性
|
||||
interface Props {
|
||||
visible: boolean;
|
||||
studentInfo: any;
|
||||
leaveInfo: any;
|
||||
}
|
||||
|
||||
// 组件事件
|
||||
interface Emits {
|
||||
(e: 'update:visible', value: boolean): void;
|
||||
(e: 'close'): void;
|
||||
}
|
||||
|
||||
const props = defineProps<Props>();
|
||||
const emit = defineEmits<Emits>();
|
||||
|
||||
// 响应式数据
|
||||
const loading = ref(false);
|
||||
const approvalList = ref<any[]>([]);
|
||||
|
||||
// 计算属性
|
||||
const dialogVisible = computed({
|
||||
get: () => props.visible,
|
||||
set: (value) => emit('update:visible', value)
|
||||
});
|
||||
|
||||
// 格式化日期时间
|
||||
const formatDateTime = (dateStr: string) => {
|
||||
if (!dateStr) return '';
|
||||
return new Date(dateStr).toLocaleString();
|
||||
};
|
||||
|
||||
// 获取状态类型
|
||||
const getStatusType = (status: string) => {
|
||||
switch (status) {
|
||||
case 'pass':
|
||||
return 'success';
|
||||
case 'waiting':
|
||||
return 'warning';
|
||||
case 'reject':
|
||||
return 'danger';
|
||||
case 'draft':
|
||||
return 'info';
|
||||
default:
|
||||
return 'info';
|
||||
}
|
||||
};
|
||||
|
||||
// 获取状态文本
|
||||
const getStatusText = (status: string) => {
|
||||
switch (status) {
|
||||
case 'pass':
|
||||
return '通过';
|
||||
case 'waiting':
|
||||
return '待审批';
|
||||
case 'reject':
|
||||
return '拒绝';
|
||||
case 'draft':
|
||||
return '草稿';
|
||||
default:
|
||||
return status || '未知';
|
||||
}
|
||||
};
|
||||
|
||||
// 获取用户电话信息
|
||||
const getUserPhones = async (userIds: string[]) => {
|
||||
if (!userIds || userIds.length === 0) {
|
||||
return {};
|
||||
}
|
||||
|
||||
try {
|
||||
// 过滤掉空值和重复值
|
||||
const validUserIds = [...new Set(userIds.filter((id) => id && id.trim()))];
|
||||
if (validUserIds.length === 0) {
|
||||
return {};
|
||||
}
|
||||
|
||||
const response = await request({
|
||||
url: `/system/user/optionselect?userIds=${validUserIds.join(',')}`,
|
||||
method: 'get'
|
||||
});
|
||||
|
||||
if (response.code === 200 && response.data) {
|
||||
const phoneMap: Record<string, string> = {};
|
||||
response.data.forEach((user: any) => {
|
||||
if (user.userId) {
|
||||
// 如果用户有手机号则使用,否则标记为"未录入"
|
||||
phoneMap[user.userId.toString()] = user.phonenumber || '未录入';
|
||||
}
|
||||
});
|
||||
return phoneMap;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取用户电话失败:', error);
|
||||
}
|
||||
return {};
|
||||
};
|
||||
|
||||
// 加载审批记录
|
||||
const loadApprovalRecords = async (businessId: string | number) => {
|
||||
if (!businessId) {
|
||||
console.warn('businessId为空,无法加载审批记录');
|
||||
return;
|
||||
}
|
||||
|
||||
loading.value = true;
|
||||
try {
|
||||
const response = await request({
|
||||
url: `/workflow/instance/flowHisTaskList/${businessId}`,
|
||||
method: 'get'
|
||||
});
|
||||
|
||||
if (response.code === 200 && response.data?.list) {
|
||||
approvalList.value = response.data.list;
|
||||
console.log('审批记录加载成功:', approvalList.value.length, '条');
|
||||
|
||||
// 提取所有办理人ID
|
||||
const approverIds: string[] = [];
|
||||
approvalList.value.forEach((item: any) => {
|
||||
if (item.approver) {
|
||||
// approver可能包含多个用户ID,用逗号分隔
|
||||
const ids = item.approver.split(',').map((id: string) => id.trim());
|
||||
approverIds.push(...ids);
|
||||
}
|
||||
});
|
||||
|
||||
// 获取办理人电话信息
|
||||
if (approverIds.length > 0) {
|
||||
const phoneMap = await getUserPhones(approverIds);
|
||||
|
||||
// 为每条审批记录设置办理人电话
|
||||
approvalList.value.forEach((item: any) => {
|
||||
if (item.approver) {
|
||||
const ids = item.approver.split(',').map((id: string) => id.trim());
|
||||
const phones = ids.map((id: string) => phoneMap[id] || '未录入');
|
||||
item.approverPhone = phones.length > 0 ? phones.join(', ') : '未录入';
|
||||
} else {
|
||||
item.approverPhone = '未录入';
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
approvalList.value = [];
|
||||
console.warn('审批记录数据为空');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('加载审批记录失败:', error);
|
||||
approvalList.value = [];
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 关闭弹窗
|
||||
const handleClose = () => {
|
||||
emit('close');
|
||||
// 清空数据
|
||||
approvalList.value = [];
|
||||
};
|
||||
|
||||
// 对外暴露方法
|
||||
const init = async (businessId: string | number) => {
|
||||
console.log('初始化请假流程对话框,businessId:', businessId);
|
||||
await loadApprovalRecords(businessId);
|
||||
};
|
||||
|
||||
defineExpose({
|
||||
init
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.leave-process-container {
|
||||
min-height: 400px;
|
||||
}
|
||||
|
||||
.student-info-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 16px;
|
||||
background: #f8f9fa;
|
||||
border-radius: 6px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.student-basic h4 {
|
||||
margin: 0 0 4px 0;
|
||||
color: #303133;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.student-no {
|
||||
color: #666;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.leave-detail-info {
|
||||
background: #fff;
|
||||
border: 1px solid #e4e7ed;
|
||||
border-radius: 6px;
|
||||
padding: 16px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.leave-item {
|
||||
display: flex;
|
||||
margin-bottom: 8px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.leave-item:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.leave-label {
|
||||
color: #666;
|
||||
min-width: 80px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.leave-value {
|
||||
color: #303133;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.approval-records h5 {
|
||||
margin: 0 0 16px 0;
|
||||
color: #303133;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.dialog-footer {
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
+1156
File diff suppressed because it is too large.
Load diff
@@ -46,7 +46,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="18">
|
||||
<el-col :span="18" style="display: flex; justify-content: flex-end; align-items: center">
|
||||
<el-form-item class="search-buttons">
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
@@ -76,11 +76,11 @@
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['dormHygieneCheck:dormHygieneCheck:export']"
|
||||
>导出</el-button
|
||||
>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
<right-toolbar v-model="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
@@ -106,9 +106,12 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="房间名称" align="center" prop="roomName" />
|
||||
<el-table-column label="宿舍楼名称" align="center" prop="buildingName" />
|
||||
<el-table-column label="宿舍区名称" align="center" prop="areaName" />
|
||||
<el-table-column label="校区名称" align="center" prop="campusName" />
|
||||
<el-table-column label="宿舍总分" align="center" prop="totalScore" />
|
||||
<el-table-column label="宿舍扣分" align="center" prop="totalScore">
|
||||
<template #default="scope">
|
||||
<span>-{{ scope.row.totalScore }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="卫生等级" align="center" prop="hygieneGrade">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="xg_dorm_hygiene_grade" :value="scope.row.hygieneGrade" />
|
||||
@@ -138,16 +141,34 @@
|
||||
</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"
|
||||
:page="queryParams.pageNum"
|
||||
:limit="queryParams.pageSize"
|
||||
@update:page="(val) => (queryParams.pageNum = val)"
|
||||
@update:limit="(val) => (queryParams.pageSize = val)"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-card>
|
||||
|
||||
<!-- 宿舍卫生检查弹窗组件 -->
|
||||
<DormHygieneCheckDialog
|
||||
v-model="dialog.visible"
|
||||
:title="dialog.title"
|
||||
:form-data="form"
|
||||
@submit="handleDialogSubmit"
|
||||
@close="handleDialogClose"
|
||||
<!-- 宿舍卫生检查主弹窗组件(新增使用) -->
|
||||
<DormHygieneCheckMainDialog
|
||||
:visible="mainDialog.visible"
|
||||
:title="mainDialog.title"
|
||||
@submit="handleMainDialogSubmit"
|
||||
@close="handleMainDialogClose"
|
||||
@update:visible="(value) => (mainDialog.visible = value)"
|
||||
/>
|
||||
|
||||
<!-- 编辑宿舍卫生检查弹窗组件(修改使用) -->
|
||||
<DormHygieneCheckEditDialog
|
||||
:visible="editDialog.visible"
|
||||
:title="editDialog.title"
|
||||
:form-data="currentEditData"
|
||||
@submit="handleEditDialogSubmit"
|
||||
@close="handleEditDialogClose"
|
||||
@update:visible="(value) => (editDialog.visible = value)"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
@@ -157,6 +178,8 @@ import { ref, reactive, toRefs, onMounted, getCurrentInstance, ComponentInternal
|
||||
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';
|
||||
// @ts-expect-error: request util import
|
||||
import request from '@/utils/request';
|
||||
import {
|
||||
listDormHygieneCheck,
|
||||
getDormHygieneCheck,
|
||||
@@ -164,14 +187,15 @@ import {
|
||||
addDormHygieneCheck,
|
||||
updateDormHygieneCheck,
|
||||
exportDormHygieneCheck
|
||||
} from '@/api/xg/xgss/dormHygieneCheck/dormHygieneCheck';
|
||||
} from '@/api/xg/xgss/dormHygieneCheck/dormHygieneCheck/index';
|
||||
import {
|
||||
DormHygieneCheckVO,
|
||||
DormHygieneCheckQuery,
|
||||
DormHygieneCheckForm,
|
||||
DormHygieneCheckCompleteForm
|
||||
} from '@/api/xg/xgss/dormHygieneCheck/dormHygieneCheck/types';
|
||||
import DormHygieneCheckDialog from './DormHygieneCheckDialog.vue';
|
||||
import DormHygieneCheckMainDialog from './DormHygieneCheckMainDialog.vue';
|
||||
import DormHygieneCheckEditDialog from './DormHygieneCheckEditDialog.vue';
|
||||
|
||||
// 类型定义
|
||||
interface DialogOption {
|
||||
@@ -200,11 +224,21 @@ const total = ref(0);
|
||||
|
||||
const queryFormRef = ref();
|
||||
|
||||
const dialog = reactive<DialogOption>({
|
||||
// 主弹窗(新增)
|
||||
const mainDialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
|
||||
// 编辑宿舍卫生检查弹窗(修改)
|
||||
const editDialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
|
||||
// 存储当前编辑的数据
|
||||
const currentEditData = ref<any>(null);
|
||||
|
||||
const initFormData: DormHygieneCheckForm = {
|
||||
id: undefined,
|
||||
deleted: undefined,
|
||||
@@ -223,7 +257,7 @@ const initFormData: DormHygieneCheckForm = {
|
||||
areaName: undefined,
|
||||
campusId: undefined,
|
||||
campusName: undefined,
|
||||
totalScore: undefined,
|
||||
totalScore: 0,
|
||||
hygieneGrade: 'A',
|
||||
attachmentIds: undefined,
|
||||
checkSummary: undefined,
|
||||
@@ -287,22 +321,45 @@ const getList = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
/** 弹窗关闭事件处理 */
|
||||
const handleDialogClose = () => {
|
||||
dialog.visible = false;
|
||||
/** 主弹窗关闭事件处理 */
|
||||
const handleMainDialogClose = async () => {
|
||||
mainDialog.visible = false;
|
||||
reset();
|
||||
// 弹窗关闭时自动刷新列表数据
|
||||
await getList();
|
||||
};
|
||||
|
||||
/** 弹窗提交事件处理 */
|
||||
const handleDialogSubmit = async (formData: DormHygieneCheckCompleteForm) => {
|
||||
/** 编辑弹窗关闭事件处理 */
|
||||
const handleEditDialogClose = () => {
|
||||
editDialog.visible = false;
|
||||
currentEditData.value = null;
|
||||
};
|
||||
|
||||
/** 主弹窗提交事件处理 */
|
||||
const handleMainDialogSubmit = async (formData: any) => {
|
||||
try {
|
||||
if (formData.id) {
|
||||
await updateDormHygieneCheck(formData);
|
||||
} else {
|
||||
await addDormHygieneCheck(formData);
|
||||
}
|
||||
// 主弹窗提交的是新增数据
|
||||
await addDormHygieneCheck(formData);
|
||||
ElMessage.success('操作成功');
|
||||
dialog.visible = false;
|
||||
mainDialog.visible = false;
|
||||
await getList();
|
||||
} catch (error) {
|
||||
console.error('提交失败:', error);
|
||||
ElMessage.error('操作失败');
|
||||
}
|
||||
};
|
||||
|
||||
/** 编辑弹窗提交事件处理 */
|
||||
const handleEditDialogSubmit = async (formData: any) => {
|
||||
try {
|
||||
// 编辑弹窗提交的是修改数据,调用完整更新接口
|
||||
await request({
|
||||
url: '/dormHygieneCheck/dormHygieneCheck/updateCompleteData',
|
||||
method: 'put',
|
||||
data: formData
|
||||
});
|
||||
ElMessage.success('操作成功');
|
||||
editDialog.visible = false;
|
||||
await getList();
|
||||
} catch (error) {
|
||||
console.error('提交失败:', error);
|
||||
@@ -344,14 +401,14 @@ const handleSelectionChange = (selection: DormHygieneCheckVO[]) => {
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = () => {
|
||||
reset();
|
||||
dialog.visible = true;
|
||||
dialog.title = '添加宿舍卫生检查';
|
||||
mainDialog.visible = true;
|
||||
mainDialog.title = '添加宿舍卫生检查';
|
||||
};
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = async (row?: DormHygieneCheckVO) => {
|
||||
dialog.visible = true;
|
||||
dialog.title = '修改宿舍卫生检查';
|
||||
editDialog.visible = true;
|
||||
editDialog.title = '修改宿舍卫生检查';
|
||||
|
||||
const loadingInstance = ElLoading.service({
|
||||
target: '.el-dialog__body',
|
||||
@@ -360,14 +417,13 @@ const handleUpdate = async (row?: DormHygieneCheckVO) => {
|
||||
});
|
||||
|
||||
try {
|
||||
reset();
|
||||
const _id = row?.id || ids.value[0];
|
||||
const res = await getDormHygieneCheck(_id);
|
||||
Object.assign(form.value, res.data);
|
||||
currentEditData.value = res.data;
|
||||
} catch (error) {
|
||||
console.error('加载编辑数据失败:', error);
|
||||
ElMessage.error('加载数据失败,请重试');
|
||||
dialog.visible = false;
|
||||
editDialog.visible = false;
|
||||
} finally {
|
||||
loadingInstance.close();
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -582,6 +582,7 @@ import { UploadFilled, Document, Loading, Download, Delete } from '@element-plus
|
||||
import { getToken } from '@/utils/auth';
|
||||
import ImagePreview from '@/components/ImagePreview/index.vue';
|
||||
import request from '@/utils/request';
|
||||
import { useUserStore } from '@/store/modules/user';
|
||||
import {
|
||||
listHolidayStay,
|
||||
getHolidayStay,
|
||||
@@ -611,6 +612,9 @@ import {
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { xg_holiday_type, xg_stay_reason_type, sys_yesno } = toRefs<any>(proxy?.useDict('xg_holiday_type', 'xg_stay_reason_type', 'sys_yesno'));
|
||||
|
||||
// 用户store - 用于获取当前登录用户信息,实现权限控制
|
||||
const userStore = useUserStore();
|
||||
|
||||
const holidayStayList = ref<HolidayStayVO[]>([]);
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
@@ -719,7 +723,7 @@ const data = reactive<PageData<HolidayStayForm, HolidayStayQuery>>({
|
||||
extField1: undefined,
|
||||
extField2: undefined,
|
||||
extField3: undefined,
|
||||
status: undefined,
|
||||
status: 'valid', // 默认显示有效状态的记录
|
||||
params: {}
|
||||
},
|
||||
rules: {
|
||||
@@ -756,9 +760,17 @@ const uploadData = computed(() => {
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
|
||||
// 确保用户信息已加载
|
||||
if (!userStore.userId) {
|
||||
await userStore.getInfo();
|
||||
}
|
||||
|
||||
// 处理状态过滤逻辑
|
||||
const requestParams = { ...queryParams.value };
|
||||
|
||||
// 添加创建人过滤条件 - 班主任只能看到自己创建的数据
|
||||
(requestParams as any).createBy = userStore.userId;
|
||||
|
||||
// 根据状态设置时间过滤条件
|
||||
if (requestParams.status) {
|
||||
const currentTime = new Date().toISOString().slice(0, 19).replace('T', ' ');
|
||||
@@ -843,6 +855,44 @@ const handleUpdate = async (row?: HolidayStayVO) => {
|
||||
const res = await getHolidayStay(_id);
|
||||
Object.assign(form.value, res.data);
|
||||
|
||||
// 确保当前学生信息在选项中(修复学生选择器显示问题)
|
||||
if (form.value.studentId && form.value.studentName && form.value.studentNo) {
|
||||
const currentStudent: StudentOptionVO = {
|
||||
id: form.value.studentId,
|
||||
name: form.value.studentName,
|
||||
studentNo: form.value.studentNo,
|
||||
gender: '0', // 默认值,实际不影响显示
|
||||
phone: form.value.studentPhone,
|
||||
collegeId: form.value.collegeId,
|
||||
collegeName: form.value.collegeName,
|
||||
majorId: form.value.majorId,
|
||||
majorName: form.value.majorName,
|
||||
classId: form.value.classId,
|
||||
className: form.value.className,
|
||||
dormInfo: {
|
||||
campusId: form.value.campusId,
|
||||
campusName: form.value.campusName,
|
||||
areaId: form.value.areaId,
|
||||
areaName: form.value.areaName,
|
||||
buildingId: form.value.buildingId,
|
||||
buildingName: form.value.buildingName,
|
||||
roomId: form.value.roomId,
|
||||
roomName: form.value.roomName,
|
||||
bedId: form.value.bedId,
|
||||
bedName: form.value.bedName
|
||||
}
|
||||
};
|
||||
|
||||
// 检查是否已经存在,避免重复添加
|
||||
const existingStudent = studentOptions.value.find((s) => s.id === form.value.studentId);
|
||||
if (!existingStudent) {
|
||||
studentOptions.value = [currentStudent];
|
||||
} else {
|
||||
// 更新现有学生信息
|
||||
Object.assign(existingStudent, currentStudent);
|
||||
}
|
||||
}
|
||||
|
||||
// 根据已有数据级联加载宿舍选项
|
||||
await loadCascadeOptionsForUpdate(form.value);
|
||||
|
||||
@@ -909,7 +959,7 @@ const remoteSearchStudents = async (query: string) => {
|
||||
const res = await getStudentOptions(params);
|
||||
// 根据实际接口返回格式调整数据获取方式
|
||||
console.log('学生搜索响应:', res);
|
||||
studentOptions.value = res.rows || [];
|
||||
studentOptions.value = (res as any).rows || [];
|
||||
|
||||
// 调试:检查第一个学生的数据
|
||||
if (studentOptions.value.length > 0) {
|
||||
@@ -952,7 +1002,7 @@ const loadInitialStudents = async () => {
|
||||
const res = await getStudentOptions(params);
|
||||
// 根据实际接口返回格式调整数据获取方式
|
||||
console.log('初始学生数据响应:', res);
|
||||
studentOptions.value = res.rows || [];
|
||||
studentOptions.value = (res as any).rows || [];
|
||||
|
||||
// 调试:检查第一个学生的数据
|
||||
if (studentOptions.value.length > 0) {
|
||||
@@ -1530,6 +1580,7 @@ const handleAttachmentData = async () => {
|
||||
|
||||
// 将逗号分隔的字符串转换为数组
|
||||
const ossIdsArray = form.value.attachmentOssIds
|
||||
.toString()
|
||||
.split(',')
|
||||
.map((id) => id.trim())
|
||||
.filter((id) => id);
|
||||
|
||||
@@ -17,24 +17,11 @@
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="所属校区" prop="campusId">
|
||||
<el-select v-model="queryParams.campusId" placeholder="请选择所属校区" clearable @change="handleCampusChange">
|
||||
<el-select v-model="queryParams.campusId" placeholder="请选择所属校区" clearable>
|
||||
<el-option v-for="item in campusList" :key="item.id" :label="item.campusName" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="所属宿舍区" prop="areaId">
|
||||
<el-tree-select
|
||||
v-model="queryParams.areaId"
|
||||
:data="areaTreeData"
|
||||
:props="{ label: 'areaName', value: 'id' }"
|
||||
placeholder="请选择所属宿舍区"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="宿舍楼类型" prop="buildingType">
|
||||
<el-select v-model="queryParams.buildingType" placeholder="请选择宿舍楼类型" clearable>
|
||||
@@ -72,9 +59,6 @@
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['sslxx:dormBuilding:export']">导出</el-button>
|
||||
</el-col> -->
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
@@ -85,7 +69,6 @@
|
||||
<el-table-column label="宿舍楼编码" align="center" prop="buildingCode" />
|
||||
<el-table-column label="宿舍楼名称" align="center" prop="buildingName" />
|
||||
<el-table-column label="所属校区" align="center" prop="campusName" />
|
||||
<el-table-column label="所属宿舍区" align="center" prop="areaName" />
|
||||
<el-table-column label="总楼层数" align="center" prop="floors" />
|
||||
<el-table-column label="宿舍楼类型" align="center" prop="buildingType">
|
||||
<template #default="scope">
|
||||
@@ -112,19 +95,10 @@
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
||||
<el-form ref="dormBuildingFormRef" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form-item label="所属校区" prop="campusId">
|
||||
<el-select v-model="form.campusId" placeholder="请选择所属校区" clearable @change="handleFormCampusChange">
|
||||
<el-select v-model="form.campusId" placeholder="请选择所属校区" clearable>
|
||||
<el-option v-for="item in campusList" :key="item.id" :label="item.campusName" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属宿舍区" prop="areaId">
|
||||
<el-tree-select
|
||||
v-model="form.areaId"
|
||||
:data="formAreaTreeData"
|
||||
:props="{ label: 'areaName', value: 'id' }"
|
||||
placeholder="请选择所属宿舍区"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="宿舍楼编码" prop="buildingCode">
|
||||
<el-input v-model="form.buildingCode" placeholder="请输入宿舍楼编码" />
|
||||
</el-form-item>
|
||||
@@ -171,13 +145,12 @@ import {
|
||||
delDormBuilding,
|
||||
addDormBuilding,
|
||||
updateDormBuilding,
|
||||
listCampusOptions,
|
||||
listAreaTreeData
|
||||
listCampusOptions
|
||||
} from '@/api/xg/xgss/sslxx/dormBuilding';
|
||||
import { DormBuildingVO, DormBuildingQuery, DormBuildingForm } from '@/api/xg/xgss/sslxx/dormBuilding/types';
|
||||
import { DormCampusVO } from '@/api/xg/xgss/xqxx/dormCampus/types';
|
||||
import { DormAreaVO } from '@/api/xg/xgss/ssqxx/dormArea/types';
|
||||
import { getCurrentInstance, ComponentInternalInstance, ref, reactive, toRefs, onMounted } from 'vue';
|
||||
import { ElForm, ElMessageBox, ElMessage } from 'element-plus';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { dorm_type } = toRefs<any>(proxy?.useDict('dorm_type'));
|
||||
@@ -191,11 +164,9 @@ const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const campusList = ref<DormCampusVO[]>([]); // 校区列表
|
||||
const areaTreeData = ref<any[]>([]); // 宿舍区树形数据
|
||||
const formAreaTreeData = ref<any[]>([]); // 表单宿舍区树形数据
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const dormBuildingFormRef = ref<ElFormInstance>();
|
||||
const queryFormRef = ref<InstanceType<typeof ElForm>>();
|
||||
const dormBuildingFormRef = ref<InstanceType<typeof ElForm>>();
|
||||
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
@@ -206,7 +177,6 @@ const initFormData: DormBuildingForm = {
|
||||
id: undefined,
|
||||
buildingCode: undefined,
|
||||
buildingName: undefined,
|
||||
areaId: undefined,
|
||||
campusId: undefined,
|
||||
buildingType: undefined,
|
||||
buildingDescription: undefined,
|
||||
@@ -220,7 +190,6 @@ const data = reactive<PageData<DormBuildingForm, DormBuildingQuery>>({
|
||||
pageSize: 10,
|
||||
buildingCode: undefined,
|
||||
buildingName: undefined,
|
||||
areaId: undefined,
|
||||
campusId: undefined,
|
||||
buildingType: undefined,
|
||||
sortOrder: undefined,
|
||||
@@ -230,7 +199,6 @@ const data = reactive<PageData<DormBuildingForm, DormBuildingQuery>>({
|
||||
id: [{ required: true, message: '主键ID不能为空', trigger: 'blur' }],
|
||||
buildingCode: [{ required: true, message: '宿舍楼编码不能为空', trigger: 'blur' }],
|
||||
buildingName: [{ required: true, message: '宿舍楼名称不能为空', trigger: 'blur' }],
|
||||
areaId: [{ required: true, message: '所属宿舍区ID不能为空', trigger: 'blur' }],
|
||||
campusId: [{ required: true, message: '所属校区ID不能为空', trigger: 'blur' }]
|
||||
}
|
||||
});
|
||||
@@ -252,102 +220,6 @@ const loadCampusOptions = async () => {
|
||||
campusList.value = res.rows || [];
|
||||
};
|
||||
|
||||
/** 加载宿舍区树形数据 */
|
||||
const loadAreaTreeData = async (campusId?: string | number) => {
|
||||
const res = await listAreaTreeData(campusId);
|
||||
if (campusId) {
|
||||
// 如果指定了校区ID,只展示该校区的宿舍区
|
||||
areaTreeData.value = res.rows || [];
|
||||
formAreaTreeData.value = res.rows || []; // 同时更新表单树形数据
|
||||
} else {
|
||||
// 如果没有指定校区ID,按照校区分组展示宿舍区
|
||||
const campusMap = new Map();
|
||||
|
||||
// 先将校区列表转为Map
|
||||
campusList.value.forEach((campus) => {
|
||||
campusMap.set(campus.id, {
|
||||
id: campus.id,
|
||||
areaName: campus.campusName,
|
||||
children: []
|
||||
});
|
||||
});
|
||||
|
||||
// 将宿舍区按校区分组
|
||||
const areas = res.rows || [];
|
||||
areas.forEach((area: DormAreaVO) => {
|
||||
if (campusMap.has(area.campusId)) {
|
||||
campusMap.get(area.campusId).children.push({
|
||||
id: area.id,
|
||||
areaName: area.areaName
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// 转换为树形结构
|
||||
areaTreeData.value = Array.from(campusMap.values());
|
||||
formAreaTreeData.value = Array.from(campusMap.values());
|
||||
}
|
||||
};
|
||||
|
||||
/** 校区选择变化处理函数 */
|
||||
const handleCampusChange = (value: string | number) => {
|
||||
queryParams.value.areaId = undefined; // 清空已选择的宿舍区
|
||||
loadAreaTreeData(value);
|
||||
};
|
||||
|
||||
/** 表单校区选择变化处理函数 */
|
||||
const handleFormCampusChange = (value: string | number) => {
|
||||
form.value.areaId = undefined; // 清空已选择的宿舍区
|
||||
loadFormAreaTreeData(value);
|
||||
};
|
||||
|
||||
/** 加载表单宿舍区树形数据 */
|
||||
const loadFormAreaTreeData = async (campusId?: string | number) => {
|
||||
const res = await listAreaTreeData(campusId);
|
||||
if (campusId) {
|
||||
// 如果指定了校区ID,只展示该校区的宿舍区
|
||||
formAreaTreeData.value = res.rows || [];
|
||||
} else {
|
||||
// 如果没有指定校区ID,按照校区分组展示宿舍区
|
||||
const campusMap = new Map();
|
||||
|
||||
// 先将校区列表转为Map
|
||||
campusList.value.forEach((campus) => {
|
||||
campusMap.set(campus.id, {
|
||||
id: campus.id,
|
||||
areaName: campus.campusName,
|
||||
children: []
|
||||
});
|
||||
});
|
||||
|
||||
// 将宿舍区按校区分组
|
||||
const areas = res.rows || [];
|
||||
areas.forEach((area: DormAreaVO) => {
|
||||
if (campusMap.has(area.campusId)) {
|
||||
campusMap.get(area.campusId).children.push({
|
||||
id: area.id,
|
||||
areaName: area.areaName
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// 转换为树形结构
|
||||
formAreaTreeData.value = Array.from(campusMap.values());
|
||||
}
|
||||
};
|
||||
|
||||
/** 取消按钮 */
|
||||
const cancel = () => {
|
||||
reset();
|
||||
dialog.visible = false;
|
||||
};
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = { ...initFormData };
|
||||
dormBuildingFormRef.value?.resetFields();
|
||||
};
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
@@ -363,7 +235,7 @@ const resetQuery = () => {
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: DormBuildingVO[]) => {
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length != 1;
|
||||
single.value = selection.length !== 1;
|
||||
multiple.value = !selection.length;
|
||||
};
|
||||
|
||||
@@ -380,10 +252,6 @@ const handleUpdate = async (row?: DormBuildingVO) => {
|
||||
const _id = row?.id || ids.value[0];
|
||||
const res = await getDormBuilding(_id);
|
||||
Object.assign(form.value, res.data);
|
||||
// 加载表单中的宿舍区数据
|
||||
if (form.value.campusId) {
|
||||
loadFormAreaTreeData(form.value.campusId);
|
||||
}
|
||||
dialog.visible = true;
|
||||
dialog.title = '修改宿舍楼信息';
|
||||
};
|
||||
@@ -394,13 +262,22 @@ const submitForm = () => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
if (form.value.id) {
|
||||
await updateDormBuilding(form.value).finally(() => (buttonLoading.value = false));
|
||||
await updateDormBuilding(form.value)
|
||||
.then(() => {
|
||||
ElMessage.success('修改成功');
|
||||
dialog.visible = false;
|
||||
getList();
|
||||
})
|
||||
.finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
await addDormBuilding(form.value).finally(() => (buttonLoading.value = false));
|
||||
await addDormBuilding(form.value)
|
||||
.then(() => {
|
||||
ElMessage.success('新增成功');
|
||||
dialog.visible = false;
|
||||
getList();
|
||||
})
|
||||
.finally(() => (buttonLoading.value = false));
|
||||
}
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
dialog.visible = false;
|
||||
await getList();
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -408,148 +285,48 @@ const submitForm = () => {
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: DormBuildingVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
|
||||
let confirmMsg = '';
|
||||
if (row) {
|
||||
confirmMsg = `是否确认删除宿舍楼信息编号为"${row?.buildingName}"的数据项?`;
|
||||
} else if (Array.isArray(ids.value) && ids.value.length > 1) {
|
||||
confirmMsg = `是否确认删除选中的${ids.value.length}个宿舍楼信息?`;
|
||||
} else {
|
||||
confirmMsg = '是否确认删除选中的宿舍楼信息?';
|
||||
}
|
||||
await proxy?.$modal.confirm(confirmMsg).finally(() => (loading.value = false));
|
||||
|
||||
await delDormBuilding(_ids);
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
await getList();
|
||||
await ElMessageBox.confirm('是否确认删除宿舍楼信息编号为"' + _ids + '"的数据项?')
|
||||
.then(() => {
|
||||
loading.value = true;
|
||||
return delDormBuilding(_ids);
|
||||
})
|
||||
.then(() => {
|
||||
loading.value = false;
|
||||
getList();
|
||||
ElMessage.success('删除成功');
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
};
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = () => {
|
||||
proxy?.download(
|
||||
'sslxx/dormBuilding/export',
|
||||
{
|
||||
...queryParams.value
|
||||
},
|
||||
`dormBuilding_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
/** 重置操作表单 */
|
||||
const reset = () => {
|
||||
form.value = { ...initFormData };
|
||||
dormBuildingFormRef.value?.resetFields();
|
||||
};
|
||||
|
||||
/** 取消按钮 */
|
||||
const cancel = () => {
|
||||
dialog.visible = false;
|
||||
reset();
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
loadCampusOptions().then(() => {
|
||||
loadAreaTreeData();
|
||||
});
|
||||
loadCampusOptions();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* 页面容器样式 */
|
||||
.page-container {
|
||||
padding: 8px;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
/* 表格卡片布局 */
|
||||
.table-card {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.table-card :deep(.el-card__body) {
|
||||
padding: 0px 20px 20px 20px !important;
|
||||
}
|
||||
|
||||
/* 移除按钮栏底部边框 */
|
||||
.button-card :deep(.el-card__header) {
|
||||
border-bottom: none !important;
|
||||
}
|
||||
|
||||
.image-gallery {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 12px;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
.image-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border: 1px solid #dcdfe6;
|
||||
border-radius: 6px;
|
||||
background-color: #fff;
|
||||
padding: 4px;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.image-item:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
|
||||
.no-image {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 120px;
|
||||
height: 80px;
|
||||
border: 1px dashed #dcdfe6;
|
||||
border-radius: 4px;
|
||||
background-color: #fafafa;
|
||||
}
|
||||
|
||||
.no-image-text {
|
||||
color: #909399;
|
||||
font-size: 12px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.table-no-image {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
border: 1px dashed #dcdfe6;
|
||||
border-radius: 4px;
|
||||
background-color: #fafafa;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.table-no-image-text {
|
||||
color: #909399;
|
||||
font-size: 10px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.view-text {
|
||||
font-size: 14px;
|
||||
color: #303133;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.view-description {
|
||||
padding: 12px;
|
||||
border: 1px solid #e4e7ed;
|
||||
border-radius: 4px;
|
||||
width: 100%;
|
||||
height: 200px;
|
||||
font-size: 14px;
|
||||
color: #303133;
|
||||
line-height: 1.6;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-word;
|
||||
overflow-y: auto;
|
||||
}
|
||||
/* 搜索按钮容器样式 */
|
||||
.search-btn-container {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-top: 10px;
|
||||
|
||||
.el-form-item {
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.fixed-width-input {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
@@ -34,6 +34,16 @@
|
||||
<el-radio label="2">停用</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="排序号" prop="sort">
|
||||
<el-input-number
|
||||
v-model="form.sort"
|
||||
:min="0"
|
||||
:max="9999"
|
||||
controls-position="right"
|
||||
style="width: 100%"
|
||||
placeholder="排序号,数字越小越靠前"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入备注内容" />
|
||||
</el-form-item>
|
||||
@@ -78,6 +88,7 @@ const initFormData: DormRoomForm = {
|
||||
roomArea: 0,
|
||||
roomType: '1',
|
||||
roomStatus: '0',
|
||||
sort: 0,
|
||||
remark: ''
|
||||
};
|
||||
|
||||
|
||||
@@ -98,51 +98,73 @@
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<!-- 楼层卡片 -->
|
||||
<div v-for="floor in floorList" :key="floor" class="mb-4">
|
||||
<el-divider>
|
||||
<el-tag type="success" effect="dark" class="mr-2">{{ floor }}层</el-tag>
|
||||
<el-button type="primary" icon="Plus" size="small" @click="handleAddAllRoom(floor)">自动添加房间</el-button>
|
||||
<el-button type="primary" icon="Plus" size="small" @click="handleAddRoom(floor)">添加房间</el-button>
|
||||
</el-divider>
|
||||
|
||||
<div class="room-container">
|
||||
<el-empty v-if="getRoomsByFloor(floor).length === 0" description="暂无房间数据" />
|
||||
<div v-else class="room-grid">
|
||||
<el-card
|
||||
v-for="room in getRoomsByFloor(floor)"
|
||||
:key="room.id"
|
||||
class="room-card"
|
||||
:class="{ 'room-disabled': room.roomStatus !== '0' }"
|
||||
>
|
||||
<template #header>
|
||||
<div class="flex items-center justify-between">
|
||||
<span class="font-bold">{{ room.roomName }}</span>
|
||||
<div>
|
||||
<el-tag v-if="room.roomStatus === '0'" type="success" size="small">正常</el-tag>
|
||||
<el-tag v-else-if="room.roomStatus === '1'" type="warning" size="small">维修中</el-tag>
|
||||
<el-tag v-else type="danger" size="small">停用</el-tag>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<div class="room-info">
|
||||
<div class="mb-2">
|
||||
<span class="text-gray-500">类型:</span>{{ room.roomType === '1' ? '标准间' : room.roomType === '2' ? '单人间' : '套间' }}
|
||||
</div>
|
||||
<div class="mb-2"><span class="text-gray-500">床位:</span>{{ room.currentBeds || 0 }}/{{ room.actualBeds }}</div>
|
||||
<div class="flex justify-between mt-4">
|
||||
<div>
|
||||
<el-button type="primary" link size="small" @click="handleManageBeds(room)">床位管理</el-button>
|
||||
</div>
|
||||
<div>
|
||||
<el-button type="primary" link icon="Edit" @click="handleEditRoom(room)" />
|
||||
<el-button type="danger" link icon="Delete" @click="handleDeleteRoom(room)" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
<!-- 右侧房间信息区域 -->
|
||||
<div class="room-info-area">
|
||||
<!-- 加载状态 -->
|
||||
<div v-if="roomLoading" class="loading-container">
|
||||
<div class="loading-content">
|
||||
<el-icon class="loading-icon" :size="32">
|
||||
<Loading />
|
||||
</el-icon>
|
||||
<p class="loading-text">正在加载房间数据...</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 房间数据展示 -->
|
||||
<div v-else-if="roomList.length > 0" class="room-display">
|
||||
<div v-for="floor in floorList" :key="floor" class="mb-4">
|
||||
<el-divider>
|
||||
<el-tag type="success" effect="dark" class="mr-2">{{ floor }}层</el-tag>
|
||||
<el-button type="primary" icon="Plus" size="small" @click="handleAddAllRoom(floor)">自动添加房间</el-button>
|
||||
<el-button type="primary" icon="Plus" size="small" @click="handleAddRoom(floor)">添加房间</el-button>
|
||||
</el-divider>
|
||||
|
||||
<div class="room-container">
|
||||
<el-empty v-if="getRoomsByFloor(floor).length === 0" description="暂无房间数据" />
|
||||
<div v-else class="room-grid">
|
||||
<el-card
|
||||
v-for="room in getRoomsByFloor(floor)"
|
||||
:key="room.id"
|
||||
class="room-card"
|
||||
:class="{ 'room-disabled': room.roomStatus !== '0' }"
|
||||
>
|
||||
<template #header>
|
||||
<div class="flex items-center justify-between">
|
||||
<span class="font-bold">{{ room.roomName }}</span>
|
||||
<div>
|
||||
<el-tag v-if="room.roomStatus === '0'" type="success" size="small">正常</el-tag>
|
||||
<el-tag v-else-if="room.roomStatus === '1'" type="warning" size="small">维修中</el-tag>
|
||||
<el-tag v-else type="danger" size="small">停用</el-tag>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<div class="room-info">
|
||||
<div class="mb-2">
|
||||
<span class="text-gray-500">类型:</span
|
||||
>{{ room.roomType === '1' ? '标准间' : room.roomType === '2' ? '单人间' : '套间' }}
|
||||
</div>
|
||||
<div class="mb-2"><span class="text-gray-500">床位:</span>{{ room.currentBeds || 0 }}/{{ room.actualBeds }}</div>
|
||||
<div class="mb-2"><span class="text-gray-500">排序:</span>{{ room.sort || 0 }}</div>
|
||||
<div class="flex justify-between mt-4">
|
||||
<div>
|
||||
<el-button type="primary" size="small" @click="handleManageBeds(room)">床位管理</el-button>
|
||||
</div>
|
||||
<div>
|
||||
<el-button type="primary" link size="small" icon="Edit" @click="handleEditRoom(room)" />
|
||||
<el-button type="danger" link size="small" icon="Delete" @click="handleDeleteRoom(room)" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 空状态展示 -->
|
||||
<div v-else class="empty-state">
|
||||
<el-empty description="请先选择左侧宿舍楼查看房间信息" />
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
@@ -212,7 +234,7 @@
|
||||
<script setup name="DormRoomManagement" lang="ts">
|
||||
import { ref, computed, reactive, onMounted, nextTick, watch } from 'vue';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { InfoFilled, Search } from '@element-plus/icons-vue';
|
||||
import { InfoFilled, Search, Loading } from '@element-plus/icons-vue';
|
||||
import { DormTreeNode, BedInfo, DormQuery, BedForm } from '@/api/xg/xgss/xsssfjgl/types';
|
||||
import { DormRoomVO, DormRoomQuery } from '@/api/xg/xgss/dormRoom/types';
|
||||
import { getDormTree } from '@/api/xg/xgss/xsssfjgl';
|
||||
@@ -229,6 +251,8 @@ const dormTreeRef = ref();
|
||||
const queryFormRef = ref();
|
||||
const buildingName = ref('');
|
||||
const showSearch = ref(true);
|
||||
// 添加房间数据加载状态
|
||||
const roomLoading = ref(false);
|
||||
const animate = reactive({
|
||||
searchAnimate: {
|
||||
enter: 'animate__animated animate__fadeInDown',
|
||||
@@ -355,6 +379,9 @@ const handleNodeClick = (data: DormTreeNode) => {
|
||||
const loadRoomData = async () => {
|
||||
if (!queryParams.buildingId) return;
|
||||
|
||||
// 开始加载,设置loading状态
|
||||
roomLoading.value = true;
|
||||
|
||||
try {
|
||||
const res = await listDormRoom(queryParams);
|
||||
roomList.value = res?.rows;
|
||||
@@ -374,6 +401,9 @@ const loadRoomData = async () => {
|
||||
);
|
||||
} catch (error) {
|
||||
console.error('获取房间列表失败', error);
|
||||
} finally {
|
||||
// 加载完成,取消loading状态
|
||||
roomLoading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -861,4 +891,53 @@ watch(
|
||||
min-width: 100%; /* 确保树至少占满容器宽度 */
|
||||
width: max-content; /* 允许内容扩展 */
|
||||
}
|
||||
|
||||
/* 加载状态样式 */
|
||||
.loading-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 400px;
|
||||
background: #fafafa;
|
||||
border-radius: 8px;
|
||||
border: 1px dashed #d9d9d9;
|
||||
margin: 20px 0;
|
||||
}
|
||||
|
||||
.loading-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.loading-icon {
|
||||
color: var(--el-color-primary);
|
||||
animation: rotate 1s linear infinite;
|
||||
}
|
||||
|
||||
@keyframes rotate {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.loading-text {
|
||||
font-size: 14px;
|
||||
color: var(--el-text-color-regular);
|
||||
margin: 0;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
/* 空状态样式 */
|
||||
.empty-state {
|
||||
min-height: 400px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
</style>
|
||||
Loaded 100 of 244 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user