wuzhen updat
This commit is contained in:
1 parent
3e4642c624
commit
e4e4679da9
173 files changed
+37924
-325
No files matched your search
@@ -0,0 +1,185 @@
|
||||
/**
|
||||
* 财务审批记录管理 - API服务
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-01-28
|
||||
*/
|
||||
|
||||
import request from '@/utils/request';
|
||||
import type { AxiosPromise } from 'axios';
|
||||
|
||||
// 审批记录查询参数
|
||||
export interface CwApprovalRecordQuery {
|
||||
pageNum?: number;
|
||||
pageSize?: number;
|
||||
applicationNo?: string;
|
||||
projectName?: string;
|
||||
applicantName?: string;
|
||||
approvalStatus?: string;
|
||||
approverName?: string;
|
||||
currentApprover?: string;
|
||||
deptId?: string;
|
||||
submitTimeBegin?: string;
|
||||
submitTimeEnd?: string;
|
||||
needApproval?: boolean;
|
||||
}
|
||||
|
||||
// 审批记录VO
|
||||
export interface CwApprovalRecordVO {
|
||||
id: string | number;
|
||||
applicationId: string | number;
|
||||
applicationNo: string;
|
||||
projectName: string;
|
||||
applicantName: string;
|
||||
deptName: string;
|
||||
totalInvestment: number;
|
||||
currentApproverName: string;
|
||||
approvalStatus: string;
|
||||
submitTime: string;
|
||||
approvalTime?: string;
|
||||
approverName?: string;
|
||||
approvalComment?: string;
|
||||
approvalResult?: string;
|
||||
}
|
||||
|
||||
// 审批表单
|
||||
export interface CwApprovalForm {
|
||||
applicationId?: string | number;
|
||||
applicationIds?: Array<string | number>;
|
||||
approvalResult: string;
|
||||
approvalComment: string;
|
||||
nextApprover?: string | number;
|
||||
}
|
||||
|
||||
// 审批历史记录
|
||||
export interface CwApprovalHistoryVO {
|
||||
id: string | number;
|
||||
applicationId: string | number;
|
||||
approverName: string;
|
||||
approvalResult: string;
|
||||
approvalComment: string;
|
||||
approvalTime: string;
|
||||
stepName: string;
|
||||
stepOrder: number;
|
||||
}
|
||||
|
||||
// 查询审批记录列表
|
||||
export const listApprovalRecord = (query: CwApprovalRecordQuery): AxiosPromise<CwApprovalRecordVO[]> => {
|
||||
return request({
|
||||
url: '/cw/approval/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
// 查询审批记录详情
|
||||
export const getApprovalRecord = (id: string | number): AxiosPromise<CwApprovalRecordVO> => {
|
||||
return request({
|
||||
url: '/cw/approval/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
// 审批申报(单个)
|
||||
export const approveApplication = (data: CwApprovalForm) => {
|
||||
return request({
|
||||
url: '/cw/approval/process',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
// 批量审批申报
|
||||
export const batchApproveApplication = (data: CwApprovalForm) => {
|
||||
return request({
|
||||
url: '/cw/approval/batchApprove',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
// 获取审批历史记录
|
||||
export const getApprovalHistory = (applicationId: string | number): AxiosPromise<CwApprovalHistoryVO[]> => {
|
||||
return request({
|
||||
url: '/cw/approval/byApplication/' + applicationId,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
// 获取当前用户待审批列表
|
||||
export const getPendingApprovals = (query: CwApprovalRecordQuery): AxiosPromise<CwApprovalRecordVO[]> => {
|
||||
return request({
|
||||
url: '/cw/approval/pending',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
// 获取当前用户已审批列表
|
||||
export const getMyApprovals = (query: CwApprovalRecordQuery): AxiosPromise<CwApprovalRecordVO[]> => {
|
||||
return request({
|
||||
url: '/cw/approval/my',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
// 获取部门审批列表
|
||||
export const getDepartmentApprovals = (query: CwApprovalRecordQuery): AxiosPromise<CwApprovalRecordVO[]> => {
|
||||
return request({
|
||||
url: '/cw/approval/dept/pending',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
// 获取可选审批人列表
|
||||
export const getAvailableApprovers = (applicationId: string | number): AxiosPromise<any[]> => {
|
||||
return request({
|
||||
url: '/cw/approval/approvers/' + applicationId,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
// 导出审批记录
|
||||
export const exportApprovalRecord = (query: CwApprovalRecordQuery) => {
|
||||
return request({
|
||||
url: '/cw/approval/export',
|
||||
method: 'post',
|
||||
data: query
|
||||
});
|
||||
};
|
||||
|
||||
// 获取审批统计数据
|
||||
export const getApprovalStatistics = (year?: number) => {
|
||||
return request({
|
||||
url: '/cw/approval/statistics',
|
||||
method: 'get',
|
||||
params: { year }
|
||||
});
|
||||
};
|
||||
|
||||
// 按部门统计审批数据
|
||||
export const getApprovalStatsByDept = () => {
|
||||
return request({
|
||||
url: '/cw/approval/statsByDept',
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
// 按月份统计审批数据
|
||||
export const getApprovalStatsByMonth = (year?: number) => {
|
||||
return request({
|
||||
url: '/cw/approval/statsByMonth',
|
||||
method: 'get',
|
||||
params: { query: { year } }
|
||||
});
|
||||
};
|
||||
|
||||
// 获取审批效率统计
|
||||
export const getApprovalEfficiency = () => {
|
||||
return request({
|
||||
url: '/cw/approval/efficiency',
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,89 @@
|
||||
/**
|
||||
* 绩效指标管理 - API服务
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-08-01
|
||||
*/
|
||||
|
||||
import request from '@/utils/request';
|
||||
import type { AxiosPromise } from 'axios';
|
||||
|
||||
// 绩效指标类型定义
|
||||
export interface PerformanceIndicatorForm {
|
||||
id?: number;
|
||||
applicationId: number;
|
||||
applicationNo: string;
|
||||
indicatorType: string;
|
||||
indicatorTypeName: string;
|
||||
goalName: string;
|
||||
targetValue: string;
|
||||
weightPercentage: number;
|
||||
description?: string;
|
||||
unit?: string;
|
||||
measurementMethod?: string;
|
||||
dataSource?: string;
|
||||
}
|
||||
|
||||
// 查询绩效指标列表
|
||||
export const listPerformanceIndicator = (query: any): AxiosPromise<PerformanceIndicatorForm[]> => {
|
||||
return request({
|
||||
url: '/cw/performance/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
// 根据申报ID查询绩效指标
|
||||
export const getPerformanceByApplicationId = (applicationId: number): AxiosPromise<PerformanceIndicatorForm[]> => {
|
||||
return request({
|
||||
url: `/cw/performance/application/${applicationId}`,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
// 批量保存绩效指标
|
||||
export const batchSavePerformanceIndicator = (applicationId: number, applicationNo: string, data: PerformanceIndicatorForm[]) => {
|
||||
return request({
|
||||
url: '/cw/performance/batchSave',
|
||||
method: 'post',
|
||||
data: {
|
||||
applicationId,
|
||||
applicationNo,
|
||||
indicators: data
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 新增绩效指标
|
||||
export const addPerformanceIndicator = (data: PerformanceIndicatorForm) => {
|
||||
return request({
|
||||
url: '/cw/performance',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
// 修改绩效指标
|
||||
export const updatePerformanceIndicator = (data: PerformanceIndicatorForm) => {
|
||||
return request({
|
||||
url: '/cw/performance',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
// 删除绩效指标
|
||||
export const delPerformanceIndicator = (id: string | number) => {
|
||||
return request({
|
||||
url: '/cw/performance/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
|
||||
// 根据申报ID删除绩效指标
|
||||
export const delPerformanceByApplicationId = (applicationId: number) => {
|
||||
return request({
|
||||
url: `/cw/performance/application/${applicationId}`,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,217 @@
|
||||
/**
|
||||
* 财务项目预算审批 - API服务
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-01-26
|
||||
*/
|
||||
|
||||
import request from '@/utils/request';
|
||||
import type { AxiosPromise } from 'axios';
|
||||
import type {
|
||||
CwProjectApplicationQuery,
|
||||
CwProjectApplicationVO,
|
||||
CwProjectApplicationForm,
|
||||
CwApproverConfigQuery,
|
||||
CwApproverConfigVO,
|
||||
CwApproverConfigForm,
|
||||
CwApplicationStatistics
|
||||
} from '@/api/cw/types';
|
||||
|
||||
// 查询项目预算申报列表
|
||||
export const listProjectApplication = (query: CwProjectApplicationQuery): AxiosPromise<CwProjectApplicationVO[]> => {
|
||||
return request({
|
||||
url: '/cw/application/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
// 查询项目预算申报详情
|
||||
export const getProjectApplication = (id: string | number): AxiosPromise<CwProjectApplicationVO> => {
|
||||
return request({
|
||||
url: '/cw/application/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
// 新增项目预算申报
|
||||
export const addProjectApplication = (data: CwProjectApplicationForm) => {
|
||||
return request({
|
||||
url: '/cw/application',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
// 修改项目预算申报
|
||||
export const updateProjectApplication = (data: CwProjectApplicationForm) => {
|
||||
return request({
|
||||
url: '/cw/application',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
// 删除项目预算申报
|
||||
export const delProjectApplication = (id: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/cw/application/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
|
||||
// 保存草稿
|
||||
export const saveDraft = (data: CwProjectApplicationForm) => {
|
||||
return request({
|
||||
url: '/cw/application/saveDraft',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
// 提交申报
|
||||
export const submitApplication = (id: string | number) => {
|
||||
return request({
|
||||
url: '/cw/application/submit/' + id,
|
||||
method: 'post'
|
||||
});
|
||||
};
|
||||
|
||||
// 撤回申报
|
||||
export const withdrawApplication = (id: string | number) => {
|
||||
return request({
|
||||
url: '/cw/application/withdraw/' + id,
|
||||
method: 'put'
|
||||
});
|
||||
};
|
||||
|
||||
// 取消申报
|
||||
export const cancelApplication = (id: string | number) => {
|
||||
return request({
|
||||
url: '/cw/application/cancel/' + id,
|
||||
method: 'put'
|
||||
});
|
||||
};
|
||||
|
||||
// 查询我的申报
|
||||
export const getMyApplications = (query: CwProjectApplicationQuery): AxiosPromise<CwProjectApplicationVO[]> => {
|
||||
return request({
|
||||
url: '/cw/application/my',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
// 查询部门申报
|
||||
export const getDepartmentApplications = (query: CwProjectApplicationQuery): AxiosPromise<CwProjectApplicationVO[]> => {
|
||||
return request({
|
||||
url: '/cw/application/dept',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
// 查询待处理申报
|
||||
export const getPendingApplications = (query: CwProjectApplicationQuery): AxiosPromise<CwProjectApplicationVO[]> => {
|
||||
return request({
|
||||
url: '/cw/application/pending',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
// 导出项目预算申报
|
||||
export const exportProjectApplication = (query: CwProjectApplicationQuery) => {
|
||||
return request({
|
||||
url: '/cw/application/export',
|
||||
method: 'post',
|
||||
data: query
|
||||
});
|
||||
};
|
||||
|
||||
// 获取申报统计数据
|
||||
export const getApplicationStatistics = (year?: number): AxiosPromise<CwApplicationStatistics> => {
|
||||
return request({
|
||||
url: '/cw/application/statistics',
|
||||
method: 'get',
|
||||
params: { year }
|
||||
});
|
||||
};
|
||||
|
||||
// 申报数量统计
|
||||
export const getApplicationCount = (): AxiosPromise<number> => {
|
||||
return request({
|
||||
url: '/cw/application/count',
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
// 申报金额汇总
|
||||
export const getApplicationAmountSum = (): AxiosPromise<number> => {
|
||||
return request({
|
||||
url: '/cw/application/amountSum',
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
// 按部门统计
|
||||
export const getStatisticsByDept = () => {
|
||||
return request({
|
||||
url: '/cw/application/statisticsByDept',
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
// 按月份统计
|
||||
export const getStatisticsByMonth = (year?: number) => {
|
||||
return request({
|
||||
url: '/cw/application/statisticsByMonth',
|
||||
method: 'get',
|
||||
params: { year }
|
||||
});
|
||||
};
|
||||
|
||||
// ==================== 审批人配置相关 API ====================
|
||||
|
||||
// 查询审批人配置列表
|
||||
export const listApproverConfig = (query: CwApproverConfigQuery): AxiosPromise<CwApproverConfigVO[]> => {
|
||||
return request({
|
||||
url: '/cw/approverConfig/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
// 查询审批人配置详情
|
||||
export const getApproverConfig = (id: string | number): AxiosPromise<CwApproverConfigVO> => {
|
||||
return request({
|
||||
url: '/cw/approverConfig/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
// 新增审批人配置
|
||||
export const addApproverConfig = (data: CwApproverConfigForm) => {
|
||||
return request({
|
||||
url: '/cw/approverConfig',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
// 修改审批人配置
|
||||
export const updateApproverConfig = (data: CwApproverConfigForm) => {
|
||||
return request({
|
||||
url: '/cw/approverConfig',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
// 删除审批人配置
|
||||
export const delApproverConfig = (id: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/cw/approverConfig/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,202 @@
|
||||
/**
|
||||
* 财务项目预算审批 - TypeScript类型定义
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-01-26
|
||||
*/
|
||||
|
||||
// 项目预算申报查询对象
|
||||
export interface CwProjectApplicationQuery {
|
||||
pageNum?: number;
|
||||
pageSize?: number;
|
||||
applicationNo?: string;
|
||||
projectName?: string;
|
||||
principal?: string;
|
||||
approvalStatus?: string;
|
||||
departmentId?: number;
|
||||
startDate?: string;
|
||||
endDate?: string;
|
||||
year?: number;
|
||||
}
|
||||
|
||||
// 项目预算申报视图对象
|
||||
export interface CwProjectApplicationVO {
|
||||
id?: number;
|
||||
applicationNo?: string;
|
||||
projectName?: string;
|
||||
principal?: string;
|
||||
contactPhone?: string;
|
||||
startDate?: string;
|
||||
endDate?: string;
|
||||
targetSme?: boolean;
|
||||
targetMicroSme?: boolean;
|
||||
importEquipment?: boolean;
|
||||
applicationReason?: string;
|
||||
constructionContent?: string;
|
||||
totalPerformanceGoal?: string;
|
||||
currentYearGoal?: string;
|
||||
totalInvestment?: number;
|
||||
totalMunicipalFiscal?: number;
|
||||
totalSelfFunding?: number;
|
||||
totalOtherFunding?: number;
|
||||
currentYearTotal?: number;
|
||||
currentYearMunicipal?: number;
|
||||
currentYearSelf?: number;
|
||||
currentYearOther?: number;
|
||||
nextYearTotal?: number;
|
||||
nextYearMunicipal?: number;
|
||||
nextYearSelf?: number;
|
||||
nextYearOther?: number;
|
||||
futureYearTotal?: number;
|
||||
futureYearMunicipal?: number;
|
||||
futureYearSelf?: number;
|
||||
futureYearOther?: number;
|
||||
applicantId?: number;
|
||||
applicantName?: string;
|
||||
departmentId?: number;
|
||||
departmentName?: string;
|
||||
approvalStatus?: string;
|
||||
submitTime?: string;
|
||||
approveTime?: string;
|
||||
year?: number;
|
||||
createBy?: number;
|
||||
createTime?: string;
|
||||
updateBy?: number;
|
||||
updateTime?: string;
|
||||
remark?: string;
|
||||
}
|
||||
|
||||
// 项目预算申报表单对象
|
||||
export interface CwProjectApplicationForm {
|
||||
id?: number;
|
||||
applicationNo?: string;
|
||||
projectName?: string;
|
||||
principal?: string;
|
||||
contactPhone?: string;
|
||||
startDate?: string;
|
||||
endDate?: string;
|
||||
targetSme?: boolean;
|
||||
targetMicroSme?: boolean;
|
||||
importEquipment?: boolean;
|
||||
applicationReason?: string;
|
||||
constructionContent?: string;
|
||||
totalPerformanceGoal?: string;
|
||||
currentYearGoal?: string;
|
||||
totalInvestment?: number;
|
||||
totalMunicipalFiscal?: number;
|
||||
totalSelfFunding?: number;
|
||||
totalOtherFunding?: number;
|
||||
currentYearTotal?: number;
|
||||
currentYearMunicipal?: number;
|
||||
currentYearSelf?: number;
|
||||
currentYearOther?: number;
|
||||
nextYearTotal?: number;
|
||||
nextYearMunicipal?: number;
|
||||
nextYearSelf?: number;
|
||||
nextYearOther?: number;
|
||||
futureYearTotal?: number;
|
||||
futureYearMunicipal?: number;
|
||||
futureYearSelf?: number;
|
||||
futureYearOther?: number;
|
||||
applicantId?: number;
|
||||
applicantName?: string;
|
||||
departmentId?: number;
|
||||
departmentName?: string;
|
||||
approvalStatus?: string;
|
||||
year?: number;
|
||||
remark?: string;
|
||||
performanceIndicators?: any[]; // 绩效指标数据
|
||||
}
|
||||
|
||||
// 审批人配置查询对象
|
||||
export interface CwApproverConfigQuery {
|
||||
pageNum?: number;
|
||||
pageSize?: number;
|
||||
configType?: string;
|
||||
deptId?: number;
|
||||
status?: string;
|
||||
}
|
||||
|
||||
// 审批人配置视图对象
|
||||
export interface CwApproverConfigVO {
|
||||
id?: number;
|
||||
configType?: string;
|
||||
deptId?: number;
|
||||
minAmount?: number;
|
||||
maxAmount?: number;
|
||||
deptApproverId?: number;
|
||||
deptApproverName?: string;
|
||||
financeApproverId?: number;
|
||||
financeApproverName?: string;
|
||||
leaderApproverId?: number;
|
||||
leaderApproverName?: string;
|
||||
deptDelegateId?: number;
|
||||
deptDelegateName?: string;
|
||||
financeDelegateId?: number;
|
||||
financeDelegateName?: string;
|
||||
leaderDelegateId?: number;
|
||||
leaderDelegateName?: string;
|
||||
status?: string;
|
||||
remark?: string;
|
||||
createTime?: string;
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
// 审批人配置表单对象
|
||||
export interface CwApproverConfigForm {
|
||||
id?: number;
|
||||
configType?: string;
|
||||
deptId?: number;
|
||||
minAmount?: number;
|
||||
maxAmount?: number;
|
||||
deptApproverId?: number;
|
||||
deptApproverName?: string;
|
||||
financeApproverId?: number;
|
||||
financeApproverName?: string;
|
||||
leaderApproverId?: number;
|
||||
leaderApproverName?: string;
|
||||
deptDelegateId?: number;
|
||||
deptDelegateName?: string;
|
||||
financeDelegateId?: number;
|
||||
financeDelegateName?: string;
|
||||
leaderDelegateId?: number;
|
||||
leaderDelegateName?: string;
|
||||
status?: string;
|
||||
remark?: string;
|
||||
}
|
||||
|
||||
// 项目申报统计对象
|
||||
export interface CwApplicationStatistics {
|
||||
totalCount: number;
|
||||
approvingCount: number;
|
||||
approvedCount: number;
|
||||
rejectedCount: number;
|
||||
totalAmount: number;
|
||||
monthlyTrend: MonthlyTrend[];
|
||||
deptStatistics: DeptStatistics[];
|
||||
statusDistribution: StatusDistribution[];
|
||||
}
|
||||
|
||||
// 部门统计对象
|
||||
export interface DeptStatistics {
|
||||
deptName: string;
|
||||
totalCount: number;
|
||||
totalAmount: number;
|
||||
approvedCount: number;
|
||||
approvedAmount: number;
|
||||
}
|
||||
|
||||
// 月度趋势对象
|
||||
export interface MonthlyTrend {
|
||||
month: string;
|
||||
count: number;
|
||||
amount: number;
|
||||
}
|
||||
|
||||
// 状态分布对象
|
||||
export interface StatusDistribution {
|
||||
status: string;
|
||||
statusName: string;
|
||||
count: number;
|
||||
percentage: number;
|
||||
}
|
||||
@@ -0,0 +1,297 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import {
|
||||
GraduateInfoVO,
|
||||
GraduateInfoForm,
|
||||
GraduateInfoQuery,
|
||||
GraduateStatisticsVO
|
||||
} from '@/api/zsjy/types';
|
||||
|
||||
/**
|
||||
* 查询毕业生信息列表
|
||||
* @param query 查询参数
|
||||
*/
|
||||
export const listGraduateInfo = (query?: GraduateInfoQuery): AxiosPromise<GraduateInfoVO[]> => {
|
||||
return request({
|
||||
url: '/zsjy/graduate/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询毕业生信息详细信息
|
||||
* @param id 毕业生信息ID
|
||||
*/
|
||||
export const getGraduateInfo = (id: string | number): AxiosPromise<GraduateInfoVO> => {
|
||||
return request({
|
||||
url: `/zsjy/graduate/${id}`,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增毕业生信息
|
||||
* @param data 毕业生信息数据
|
||||
*/
|
||||
export const addGraduateInfo = (data: GraduateInfoForm) => {
|
||||
return request({
|
||||
url: '/zsjy/graduate',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改毕业生信息
|
||||
* @param data 毕业生信息数据
|
||||
*/
|
||||
export const updateGraduateInfo = (data: GraduateInfoForm) => {
|
||||
return request({
|
||||
url: '/zsjy/graduate',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除毕业生信息
|
||||
* @param id 毕业生信息ID
|
||||
*/
|
||||
export const delGraduateInfo = (id: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: `/zsjy/graduate/${id}`,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 导出毕业生信息列表
|
||||
* @param query 查询参数
|
||||
*/
|
||||
export const exportGraduateInfo = (query: GraduateInfoQuery) => {
|
||||
return request({
|
||||
url: '/zsjy/graduate/export',
|
||||
method: 'post',
|
||||
data: query,
|
||||
responseType: 'blob'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 根据学号查询毕业生信息
|
||||
* @param studentNo 学号
|
||||
*/
|
||||
export const getGraduateInfoByStudentNo = (studentNo: string): AxiosPromise<GraduateInfoVO> => {
|
||||
return request({
|
||||
url: `/zsjy/graduate/student/${studentNo}`,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 根据身份证号查询毕业生信息
|
||||
* @param idCard 身份证号
|
||||
*/
|
||||
export const getGraduateInfoByIdCard = (idCard: string): AxiosPromise<GraduateInfoVO> => {
|
||||
return request({
|
||||
url: `/zsjy/graduate/idcard/${idCard}`,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 校验学号是否唯一
|
||||
* @param studentNo 学号
|
||||
* @param id 主键ID(修改时传入)
|
||||
*/
|
||||
export const checkStudentNoUnique = (studentNo: string, id?: string | number): AxiosPromise<boolean> => {
|
||||
return request({
|
||||
url: '/zsjy/graduate/checkStudentNo',
|
||||
method: 'get',
|
||||
params: { studentNo, id }
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 校验身份证号是否唯一
|
||||
* @param idCard 身份证号
|
||||
* @param id 主键ID(修改时传入)
|
||||
*/
|
||||
export const checkIdCardUnique = (idCard: string, id?: string | number): AxiosPromise<boolean> => {
|
||||
return request({
|
||||
url: '/zsjy/graduate/checkIdCard',
|
||||
method: 'get',
|
||||
params: { idCard, id }
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 审核毕业生信息
|
||||
* @param id 主键
|
||||
* @param auditStatus 审核状态
|
||||
* @param auditRemark 审核意见
|
||||
*/
|
||||
export const auditGraduateInfo = (id: string | number, auditStatus: string, auditRemark?: string) => {
|
||||
return request({
|
||||
url: `/zsjy/graduate/audit/${id}`,
|
||||
method: 'put',
|
||||
params: { auditStatus, auditRemark }
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 批量审核毕业生信息
|
||||
* @param ids 主键数组
|
||||
* @param auditStatus 审核状态
|
||||
* @param auditRemark 审核意见
|
||||
*/
|
||||
export const batchAuditGraduateInfo = (ids: (string | number)[], auditStatus: string, auditRemark?: string) => {
|
||||
return request({
|
||||
url: '/zsjy/graduate/batchAudit',
|
||||
method: 'put',
|
||||
data: ids,
|
||||
params: { auditStatus, auditRemark }
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 统计总体就业情况
|
||||
*/
|
||||
export const getOverallStatistics = (): AxiosPromise<GraduateStatisticsVO> => {
|
||||
return request({
|
||||
url: '/zsjy/graduate/statistics/overall',
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 按专业统计就业情况
|
||||
* @param graduationYear 毕业年份
|
||||
*/
|
||||
export const getStatisticsByMajor = (graduationYear?: number): AxiosPromise<GraduateStatisticsVO[]> => {
|
||||
return request({
|
||||
url: '/zsjy/graduate/statistics/major',
|
||||
method: 'get',
|
||||
params: { graduationYear }
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 按学院统计就业情况
|
||||
* @param graduationYear 毕业年份
|
||||
*/
|
||||
export const getStatisticsByCollege = (graduationYear?: number): AxiosPromise<GraduateStatisticsVO[]> => {
|
||||
return request({
|
||||
url: '/zsjy/graduate/statistics/college',
|
||||
method: 'get',
|
||||
params: { graduationYear }
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 按就业状态统计
|
||||
* @param graduationYear 毕业年份
|
||||
*/
|
||||
export const getStatisticsByEmploymentStatus = (graduationYear?: number): AxiosPromise<GraduateStatisticsVO[]> => {
|
||||
return request({
|
||||
url: '/zsjy/graduate/statistics/employment',
|
||||
method: 'get',
|
||||
params: { graduationYear }
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 按单位性质统计
|
||||
* @param graduationYear 毕业年份
|
||||
*/
|
||||
export const getStatisticsByCompanyType = (graduationYear?: number): AxiosPromise<GraduateStatisticsVO[]> => {
|
||||
return request({
|
||||
url: '/zsjy/graduate/statistics/company',
|
||||
method: 'get',
|
||||
params: { graduationYear }
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 按地域分布统计
|
||||
* @param graduationYear 毕业年份
|
||||
*/
|
||||
export const getStatisticsByRegion = (graduationYear?: number): AxiosPromise<GraduateStatisticsVO[]> => {
|
||||
return request({
|
||||
url: '/zsjy/graduate/statistics/region',
|
||||
method: 'get',
|
||||
params: { graduationYear }
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 按薪资范围统计
|
||||
* @param graduationYear 毕业年份
|
||||
*/
|
||||
export const getStatisticsBySalaryRange = (graduationYear?: number): AxiosPromise<GraduateStatisticsVO[]> => {
|
||||
return request({
|
||||
url: '/zsjy/graduate/statistics/salary',
|
||||
method: 'get',
|
||||
params: { graduationYear }
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 按年份统计历年就业情况
|
||||
*/
|
||||
export const getStatisticsByYear = (): AxiosPromise<GraduateStatisticsVO[]> => {
|
||||
return request({
|
||||
url: '/zsjy/graduate/statistics/year',
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询待审核的毕业生信息数量
|
||||
*/
|
||||
export const getPendingAuditCount = (): AxiosPromise<number> => {
|
||||
return request({
|
||||
url: '/zsjy/graduate/pendingCount',
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询指定学院的毕业生信息列表
|
||||
* @param collegeId 学院ID
|
||||
* @param query 查询条件
|
||||
*/
|
||||
export const getListByCollegeId = (collegeId: string | number, query?: GraduateInfoQuery): AxiosPromise<GraduateInfoVO[]> => {
|
||||
return request({
|
||||
url: `/zsjy/graduate/college/${collegeId}`,
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询指定专业的毕业生信息列表
|
||||
* @param majorId 专业ID
|
||||
* @param query 查询条件
|
||||
*/
|
||||
export const getListByMajorId = (majorId: string | number, query?: GraduateInfoQuery): AxiosPromise<GraduateInfoVO[]> => {
|
||||
return request({
|
||||
url: `/zsjy/graduate/major/${majorId}`,
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询指定班级的毕业生信息列表
|
||||
* @param classId 班级ID
|
||||
* @param query 查询条件
|
||||
*/
|
||||
export const getListByClassId = (classId: string | number, query?: GraduateInfoQuery): AxiosPromise<GraduateInfoVO[]> => {
|
||||
return request({
|
||||
url: `/zsjy/graduate/class/${classId}`,
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,461 @@
|
||||
<template>
|
||||
<div class="poster-preview">
|
||||
<!-- 海报画布容器 -->
|
||||
<div
|
||||
ref="posterRef"
|
||||
class="poster-canvas"
|
||||
:style="canvasStyle"
|
||||
>
|
||||
<!-- 企业信息叠加 -->
|
||||
<div class="info-overlay">
|
||||
<!-- 顶部企业标题 -->
|
||||
<div class="company-header">
|
||||
<h1 class="company-name">{{ posterData.enterpriseName }}</h1>
|
||||
<div class="company-tagline">诚聘英才 · 共创未来</div>
|
||||
</div>
|
||||
|
||||
<!-- 中间内容区域 - 根据海报类型显示不同内容 -->
|
||||
|
||||
<!-- 企业海报:展示企业文化和优势 -->
|
||||
<div v-if="posterData.posterType === '1'" class="position-info">
|
||||
<div class="position-title">加入我们 · 共创辉煌</div>
|
||||
<div v-if="enterpriseDetail" class="position-details">
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
|
||||
<div class="detail-item" v-if="enterpriseDetail.mainBusiness">
|
||||
<span class="icon">🏢</span>
|
||||
<span>{{ enterpriseDetail.mainBusiness }}</span>
|
||||
</div>
|
||||
<div class="detail-item" v-if="enterpriseDetail.enterpriseScale">
|
||||
<span class="icon">👥</span>
|
||||
<span>{{ getScaleLabel(enterpriseDetail.enterpriseScale) }}</span>
|
||||
</div>
|
||||
<div class="detail-item" v-if="enterpriseDetail.address">
|
||||
<span class="icon">📍</span>
|
||||
<span>{{ enterpriseDetail.address }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 岗位海报:展示具体岗位信息 -->
|
||||
<div v-else-if="posterData.posterType === '2'" class="position-info">
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<div class="position-title">
|
||||
{{ posterData.positionName || positionDetail?.positionName || '招聘岗位' }}
|
||||
</div>
|
||||
<div v-if="positionDetail && Object.keys(positionDetail).length > 0" class="position-details">
|
||||
<div class="position-details-grid">
|
||||
<div class="detail-item" v-if="positionDetail.workAddress">
|
||||
<span class="icon">📍</span>
|
||||
<span>{{ positionDetail.workAddress }}</span>
|
||||
</div>
|
||||
<div class="detail-item" v-if="positionDetail.salary">
|
||||
<span class="icon">💰</span>
|
||||
<span>{{ positionDetail.salary }}</span>
|
||||
</div>
|
||||
<div class="detail-item" v-if="positionDetail.workTime">
|
||||
<span class="icon">⏰</span>
|
||||
<span>{{ positionDetail.workTime }}</span>
|
||||
</div>
|
||||
<div class="detail-item" v-if="positionDetail.requiredSkills">
|
||||
<span class="icon">🎯</span>
|
||||
<span>{{ positionDetail.requiredSkills }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 如果没有岗位详情,显示提示 -->
|
||||
<div v-else class="position-details">
|
||||
<div class="detail-item">
|
||||
<span class="icon">💼</span>
|
||||
<span>岗位详情加载中或暂无数据</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 底部联系信息 - 根据海报类型显示不同内容 -->
|
||||
<div class="company-footer">
|
||||
<div v-if="enterpriseDetail" class="company-info">
|
||||
|
||||
<!-- 企业海报:重点显示联系方式 -->
|
||||
<template v-if="posterData.posterType === '1'">
|
||||
<div class="info-row" v-if="enterpriseDetail.contactPhone">
|
||||
<span class="label">📞 联系电话:</span>
|
||||
<span class="value">{{ enterpriseDetail.contactPhone }}</span>
|
||||
</div>
|
||||
<div class="info-row" v-if="enterpriseDetail.email">
|
||||
<span class="label">📧 电子邮箱:</span>
|
||||
<span class="value">{{ enterpriseDetail.email }}</span>
|
||||
</div>
|
||||
<div class="info-row" v-if="enterpriseDetail.address">
|
||||
<span class="label">🏢 公司地址:</span>
|
||||
<span class="value">{{ enterpriseDetail.address }}</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- 岗位海报:显示企业背景信息 -->
|
||||
<template v-else-if="posterData.posterType === '2'">
|
||||
<div class="info-row" v-if="enterpriseDetail.mainBusiness">
|
||||
<span class="label">主营业务:</span>
|
||||
<span class="value">{{ enterpriseDetail.mainBusiness }}</span>
|
||||
</div>
|
||||
<div class="info-row" v-if="enterpriseDetail.enterpriseScale">
|
||||
<span class="label">企业规模:</span>
|
||||
<span class="value">{{ getScaleLabel(enterpriseDetail.enterpriseScale) }}</span>
|
||||
</div>
|
||||
<div class="info-row" v-if="enterpriseDetail.contactPhone">
|
||||
<span class="label">联系电话:</span>
|
||||
<span class="value">{{ enterpriseDetail.contactPhone }}</span>
|
||||
</div>
|
||||
<div class="info-row" v-if="enterpriseDetail.email">
|
||||
<span class="label">电子邮箱:</span>
|
||||
<span class="value">{{ enterpriseDetail.email }}</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 操作按钮 -->
|
||||
<div class="action-buttons">
|
||||
<el-button type="primary" icon="Download" @click="exportToPDF" :loading="exporting">
|
||||
导出PDF
|
||||
</el-button>
|
||||
<el-button icon="Picture" @click="exportToImage" :loading="exporting">
|
||||
导出图片
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue'
|
||||
import html2canvas from 'html2canvas'
|
||||
import jsPDF from 'jspdf'
|
||||
import { ElMessage } from 'element-plus'
|
||||
|
||||
// 定义接口
|
||||
interface PosterData {
|
||||
posterPath: string
|
||||
enterpriseName: string
|
||||
positionName?: string
|
||||
posterType: string
|
||||
}
|
||||
|
||||
interface EnterpriseDetail {
|
||||
mainBusiness?: string
|
||||
enterpriseScale?: string
|
||||
contactPhone?: string
|
||||
email?: string
|
||||
address?: string
|
||||
}
|
||||
|
||||
interface PositionDetail {
|
||||
positionName?: string
|
||||
workAddress?: string
|
||||
salary?: string
|
||||
workTime?: string
|
||||
requiredSkills?: string
|
||||
}
|
||||
|
||||
// Props定义
|
||||
const props = defineProps<{
|
||||
posterData: PosterData
|
||||
enterpriseDetail?: EnterpriseDetail
|
||||
positionDetail?: PositionDetail
|
||||
}>()
|
||||
|
||||
// 响应式数据
|
||||
const posterRef = ref<HTMLElement>()
|
||||
const exporting = ref(false)
|
||||
|
||||
// 计算样式
|
||||
const canvasStyle = computed(() => ({
|
||||
backgroundImage: `url(${props.posterData.posterPath})`,
|
||||
backgroundSize: 'cover',
|
||||
backgroundPosition: 'center',
|
||||
backgroundRepeat: 'no-repeat'
|
||||
}))
|
||||
|
||||
// 企业规模字典
|
||||
const scaleDict = {
|
||||
'1': '50人以下',
|
||||
'2': '50-200人',
|
||||
'3': '200-500人',
|
||||
'4': '500-1000人',
|
||||
'5': '1000人以上'
|
||||
}
|
||||
|
||||
// 获取规模标签
|
||||
const getScaleLabel = (value: string) => {
|
||||
return scaleDict[value as keyof typeof scaleDict] || value
|
||||
}
|
||||
|
||||
// 导出为PDF
|
||||
const exportToPDF = async () => {
|
||||
if (!posterRef.value) return
|
||||
|
||||
try {
|
||||
exporting.value = true
|
||||
|
||||
const canvas = await html2canvas(posterRef.value, {
|
||||
backgroundColor: null,
|
||||
scale: 2,
|
||||
useCORS: true,
|
||||
allowTaint: true,
|
||||
foreignObjectRendering: false
|
||||
})
|
||||
|
||||
const imgData = canvas.toDataURL('image/png')
|
||||
const pdf = new jsPDF({
|
||||
orientation: 'portrait',
|
||||
unit: 'mm',
|
||||
format: 'a4'
|
||||
})
|
||||
|
||||
const imgWidth = 190
|
||||
const imgHeight = (canvas.height * imgWidth) / canvas.width
|
||||
|
||||
pdf.addImage(imgData, 'PNG', 10, 10, imgWidth, imgHeight)
|
||||
|
||||
const fileName = `${props.posterData.enterpriseName}_招聘海报_${new Date().getTime()}.pdf`
|
||||
pdf.save(fileName)
|
||||
|
||||
ElMessage.success('PDF导出成功')
|
||||
} catch (error) {
|
||||
console.error('PDF导出失败:', error)
|
||||
ElMessage.error('PDF导出失败,请重试')
|
||||
} finally {
|
||||
exporting.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 导出为图片
|
||||
const exportToImage = async () => {
|
||||
if (!posterRef.value) return
|
||||
|
||||
try {
|
||||
exporting.value = true
|
||||
|
||||
const canvas = await html2canvas(posterRef.value, {
|
||||
backgroundColor: null,
|
||||
scale: 2,
|
||||
useCORS: true,
|
||||
allowTaint: true
|
||||
})
|
||||
|
||||
const link = document.createElement('a')
|
||||
link.download = `${props.posterData.enterpriseName}_招聘海报_${new Date().getTime()}.png`
|
||||
link.href = canvas.toDataURL('image/png')
|
||||
link.click()
|
||||
|
||||
ElMessage.success('图片导出成功')
|
||||
} catch (error) {
|
||||
console.error('图片导出失败:', error)
|
||||
ElMessage.error('图片导出失败,请重试')
|
||||
} finally {
|
||||
exporting.value = false
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.poster-preview {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.poster-canvas {
|
||||
position: relative;
|
||||
width: 600px;
|
||||
height: 800px;
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
}
|
||||
|
||||
.info-overlay {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
padding: 40px;
|
||||
color: white;
|
||||
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
|
||||
background: linear-gradient(
|
||||
180deg,
|
||||
rgba(0, 0, 0, 0.3) 0%,
|
||||
rgba(0, 0, 0, 0.1) 50%,
|
||||
rgba(0, 0, 0, 0.4) 100%
|
||||
);
|
||||
}
|
||||
|
||||
.company-header {
|
||||
text-align: center;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.company-name {
|
||||
font-size: 48px;
|
||||
font-weight: 700;
|
||||
margin: 0 0 10px 0;
|
||||
letter-spacing: 2px;
|
||||
background: linear-gradient(135deg, #ffd700, #ffed4e);
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
background-clip: text;
|
||||
text-shadow: none;
|
||||
filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.8));
|
||||
}
|
||||
|
||||
.company-tagline {
|
||||
font-size: 18px;
|
||||
font-weight: 300;
|
||||
letter-spacing: 4px;
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
.position-info {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.position-title {
|
||||
font-size: 36px;
|
||||
font-weight: 600;
|
||||
margin-bottom: 30px;
|
||||
background: linear-gradient(135deg, #ff6b6b, #ffd93d);
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
background-clip: text;
|
||||
text-shadow: none;
|
||||
filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.8));
|
||||
}
|
||||
|
||||
.position-details {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
font-size: 14px;
|
||||
max-width: 500px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.position-details-grid {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 10px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.detail-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 8px;
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
padding: 8px 15px;
|
||||
border-radius: 20px;
|
||||
backdrop-filter: blur(10px);
|
||||
border: 1px solid rgba(255, 255, 255, 0.2);
|
||||
font-size: 14px;
|
||||
min-height: 36px;
|
||||
}
|
||||
|
||||
.icon {
|
||||
font-size: 16px;
|
||||
margin-right: 3px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.company-footer {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.company-info {
|
||||
background: rgba(0, 0, 0, 0.6);
|
||||
padding: 25px;
|
||||
border-radius: 15px;
|
||||
backdrop-filter: blur(10px);
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
.info-row {
|
||||
display: flex;
|
||||
margin-bottom: 12px;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.info-row:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.label {
|
||||
font-weight: 600;
|
||||
min-width: 80px;
|
||||
color: #ffd700;
|
||||
}
|
||||
|
||||
.value {
|
||||
flex: 1;
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
.action-buttons {
|
||||
display: flex;
|
||||
gap: 15px;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.poster-canvas {
|
||||
width: 90vw;
|
||||
height: calc(90vw * 4 / 3);
|
||||
max-width: 450px;
|
||||
max-height: 600px;
|
||||
}
|
||||
|
||||
.info-overlay {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.company-name {
|
||||
font-size: 32px;
|
||||
}
|
||||
|
||||
.position-title {
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
.detail-item {
|
||||
font-size: 14px;
|
||||
padding: 8px 15px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,748 @@
|
||||
<template>
|
||||
<div class="performance-indicators">
|
||||
<el-alert
|
||||
title="绩效指标设置"
|
||||
type="info"
|
||||
show-icon
|
||||
description="请按需要填写各类绩效指标,未使用的指标可以不填写。分值占比总和必须等于100%。"
|
||||
:closable="false"
|
||||
style="margin-bottom: 20px"
|
||||
/>
|
||||
|
||||
<!-- 产出指标 -->
|
||||
<el-card class="indicator-category" style="margin-bottom: 20px">
|
||||
<template #header>
|
||||
<div class="category-header">
|
||||
<el-icon><TrendCharts /></el-icon>
|
||||
<span>产出指标</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- 数量指标 -->
|
||||
<div class="indicator-item">
|
||||
<h4 class="indicator-title">数量指标</h4>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="绩效目标名称">
|
||||
<el-input
|
||||
v-model="indicators.quantity.goalName"
|
||||
placeholder="请输入绩效目标名称"
|
||||
maxlength="200"
|
||||
@input="emitChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-form-item label="目标值">
|
||||
<el-input
|
||||
v-model="indicators.quantity.targetValue"
|
||||
placeholder="目标值"
|
||||
maxlength="100"
|
||||
@input="emitChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-form-item label="单位">
|
||||
<el-input
|
||||
v-model="indicators.quantity.unit"
|
||||
placeholder="单位"
|
||||
maxlength="20"
|
||||
@input="emitChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-form-item label="分值占比(%)">
|
||||
<el-input-number
|
||||
v-model="indicators.quantity.weightPercentage"
|
||||
:min="0"
|
||||
:max="100"
|
||||
:precision="1"
|
||||
placeholder="分值占比"
|
||||
style="width: 100%"
|
||||
@change="emitChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="详细说明">
|
||||
<el-input
|
||||
v-model="indicators.quantity.description"
|
||||
placeholder="详细说明"
|
||||
maxlength="500"
|
||||
@input="emitChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<!-- 质量指标 -->
|
||||
<div class="indicator-item">
|
||||
<h4 class="indicator-title">质量指标</h4>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="绩效目标名称">
|
||||
<el-input
|
||||
v-model="indicators.quality.goalName"
|
||||
placeholder="请输入绩效目标名称"
|
||||
maxlength="200"
|
||||
@input="emitChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-form-item label="目标值">
|
||||
<el-input
|
||||
v-model="indicators.quality.targetValue"
|
||||
placeholder="目标值"
|
||||
maxlength="100"
|
||||
@input="emitChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-form-item label="单位">
|
||||
<el-input
|
||||
v-model="indicators.quality.unit"
|
||||
placeholder="单位"
|
||||
maxlength="20"
|
||||
@input="emitChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-form-item label="分值占比(%)">
|
||||
<el-input-number
|
||||
v-model="indicators.quality.weightPercentage"
|
||||
:min="0"
|
||||
:max="100"
|
||||
:precision="1"
|
||||
placeholder="分值占比"
|
||||
style="width: 100%"
|
||||
@change="emitChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="详细说明">
|
||||
<el-input
|
||||
v-model="indicators.quality.description"
|
||||
placeholder="详细说明"
|
||||
maxlength="500"
|
||||
@input="emitChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<!-- 时效指标 -->
|
||||
<div class="indicator-item">
|
||||
<h4 class="indicator-title">时效指标</h4>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="绩效目标名称">
|
||||
<el-input
|
||||
v-model="indicators.timeliness.goalName"
|
||||
placeholder="请输入绩效目标名称"
|
||||
maxlength="200"
|
||||
@input="emitChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-form-item label="目标值">
|
||||
<el-input
|
||||
v-model="indicators.timeliness.targetValue"
|
||||
placeholder="目标值"
|
||||
maxlength="100"
|
||||
@input="emitChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-form-item label="单位">
|
||||
<el-input
|
||||
v-model="indicators.timeliness.unit"
|
||||
placeholder="单位"
|
||||
maxlength="20"
|
||||
@input="emitChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-form-item label="分值占比(%)">
|
||||
<el-input-number
|
||||
v-model="indicators.timeliness.weightPercentage"
|
||||
:min="0"
|
||||
:max="100"
|
||||
:precision="1"
|
||||
placeholder="分值占比"
|
||||
style="width: 100%"
|
||||
@change="emitChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="详细说明">
|
||||
<el-input
|
||||
v-model="indicators.timeliness.description"
|
||||
placeholder="详细说明"
|
||||
maxlength="500"
|
||||
@input="emitChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<!-- 成本指标 -->
|
||||
<div class="indicator-item">
|
||||
<h4 class="indicator-title">成本指标</h4>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="绩效目标名称">
|
||||
<el-input
|
||||
v-model="indicators.cost.goalName"
|
||||
placeholder="请输入绩效目标名称"
|
||||
maxlength="200"
|
||||
@input="emitChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-form-item label="目标值">
|
||||
<el-input
|
||||
v-model="indicators.cost.targetValue"
|
||||
placeholder="目标值"
|
||||
maxlength="100"
|
||||
@input="emitChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-form-item label="单位">
|
||||
<el-input
|
||||
v-model="indicators.cost.unit"
|
||||
placeholder="单位"
|
||||
maxlength="20"
|
||||
@input="emitChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-form-item label="分值占比(%)">
|
||||
<el-input-number
|
||||
v-model="indicators.cost.weightPercentage"
|
||||
:min="0"
|
||||
:max="100"
|
||||
:precision="1"
|
||||
placeholder="分值占比"
|
||||
style="width: 100%"
|
||||
@change="emitChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="详细说明">
|
||||
<el-input
|
||||
v-model="indicators.cost.description"
|
||||
placeholder="详细说明"
|
||||
maxlength="500"
|
||||
@input="emitChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<!-- 效益指标 -->
|
||||
<el-card class="indicator-category" style="margin-bottom: 20px">
|
||||
<template #header>
|
||||
<div class="category-header">
|
||||
<el-icon><Money /></el-icon>
|
||||
<span>效益指标</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- 经济效益指标 -->
|
||||
<div class="indicator-item">
|
||||
<h4 class="indicator-title">经济效益指标</h4>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="绩效目标名称">
|
||||
<el-input
|
||||
v-model="indicators.economic.goalName"
|
||||
placeholder="请输入绩效目标名称"
|
||||
maxlength="200"
|
||||
@input="emitChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-form-item label="目标值">
|
||||
<el-input
|
||||
v-model="indicators.economic.targetValue"
|
||||
placeholder="目标值"
|
||||
maxlength="100"
|
||||
@input="emitChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-form-item label="单位">
|
||||
<el-input
|
||||
v-model="indicators.economic.unit"
|
||||
placeholder="单位"
|
||||
maxlength="20"
|
||||
@input="emitChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-form-item label="分值占比(%)">
|
||||
<el-input-number
|
||||
v-model="indicators.economic.weightPercentage"
|
||||
:min="0"
|
||||
:max="100"
|
||||
:precision="1"
|
||||
placeholder="分值占比"
|
||||
style="width: 100%"
|
||||
@change="emitChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="详细说明">
|
||||
<el-input
|
||||
v-model="indicators.economic.description"
|
||||
placeholder="详细说明"
|
||||
maxlength="500"
|
||||
@input="emitChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<!-- 社会效益指标 -->
|
||||
<div class="indicator-item">
|
||||
<h4 class="indicator-title">社会效益指标</h4>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="绩效目标名称">
|
||||
<el-input
|
||||
v-model="indicators.social.goalName"
|
||||
placeholder="请输入绩效目标名称"
|
||||
maxlength="200"
|
||||
@input="emitChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-form-item label="目标值">
|
||||
<el-input
|
||||
v-model="indicators.social.targetValue"
|
||||
placeholder="目标值"
|
||||
maxlength="100"
|
||||
@input="emitChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-form-item label="单位">
|
||||
<el-input
|
||||
v-model="indicators.social.unit"
|
||||
placeholder="单位"
|
||||
maxlength="20"
|
||||
@input="emitChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-form-item label="分值占比(%)">
|
||||
<el-input-number
|
||||
v-model="indicators.social.weightPercentage"
|
||||
:min="0"
|
||||
:max="100"
|
||||
:precision="1"
|
||||
placeholder="分值占比"
|
||||
style="width: 100%"
|
||||
@change="emitChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="详细说明">
|
||||
<el-input
|
||||
v-model="indicators.social.description"
|
||||
placeholder="详细说明"
|
||||
maxlength="500"
|
||||
@input="emitChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<!-- 生态效益指标 -->
|
||||
<div class="indicator-item">
|
||||
<h4 class="indicator-title">生态效益指标</h4>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="绩效目标名称">
|
||||
<el-input
|
||||
v-model="indicators.ecological.goalName"
|
||||
placeholder="请输入绩效目标名称"
|
||||
maxlength="200"
|
||||
@input="emitChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-form-item label="目标值">
|
||||
<el-input
|
||||
v-model="indicators.ecological.targetValue"
|
||||
placeholder="目标值"
|
||||
maxlength="100"
|
||||
@input="emitChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-form-item label="单位">
|
||||
<el-input
|
||||
v-model="indicators.ecological.unit"
|
||||
placeholder="单位"
|
||||
maxlength="20"
|
||||
@input="emitChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-form-item label="分值占比(%)">
|
||||
<el-input-number
|
||||
v-model="indicators.ecological.weightPercentage"
|
||||
:min="0"
|
||||
:max="100"
|
||||
:precision="1"
|
||||
placeholder="分值占比"
|
||||
style="width: 100%"
|
||||
@change="emitChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="详细说明">
|
||||
<el-input
|
||||
v-model="indicators.ecological.description"
|
||||
placeholder="详细说明"
|
||||
maxlength="500"
|
||||
@input="emitChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<!-- 满意度指标 -->
|
||||
<el-card class="indicator-category" style="margin-bottom: 20px">
|
||||
<template #header>
|
||||
<div class="category-header">
|
||||
<el-icon><Star /></el-icon>
|
||||
<span>满意度指标</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- 服务对象满意度指标 -->
|
||||
<div class="indicator-item">
|
||||
<h4 class="indicator-title">服务对象满意度指标</h4>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="绩效目标名称">
|
||||
<el-input
|
||||
v-model="indicators.service_satisfaction.goalName"
|
||||
placeholder="请输入绩效目标名称"
|
||||
maxlength="200"
|
||||
@input="emitChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-form-item label="目标值">
|
||||
<el-input
|
||||
v-model="indicators.service_satisfaction.targetValue"
|
||||
placeholder="目标值"
|
||||
maxlength="100"
|
||||
@input="emitChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-form-item label="单位">
|
||||
<el-input
|
||||
v-model="indicators.service_satisfaction.unit"
|
||||
placeholder="单位"
|
||||
maxlength="20"
|
||||
@input="emitChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-form-item label="分值占比(%)">
|
||||
<el-input-number
|
||||
v-model="indicators.service_satisfaction.weightPercentage"
|
||||
:min="0"
|
||||
:max="100"
|
||||
:precision="1"
|
||||
placeholder="分值占比"
|
||||
style="width: 100%"
|
||||
@change="emitChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="详细说明">
|
||||
<el-input
|
||||
v-model="indicators.service_satisfaction.description"
|
||||
placeholder="详细说明"
|
||||
maxlength="500"
|
||||
@input="emitChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<!-- 分值占比统计 -->
|
||||
<el-alert
|
||||
:title="`当前分值占比总和:${totalWeight}%`"
|
||||
:type="totalWeight === 100 ? 'success' : totalWeight === 0 ? 'info' : 'warning'"
|
||||
show-icon
|
||||
:description="totalWeight === 100 ? '分值占比设置正确' : totalWeight === 0 ? '请填写绩效指标的分值占比' : '分值占比总和必须等于100%'"
|
||||
:closable="false"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent, ref, computed, watch } from 'vue'
|
||||
import { TrendCharts, Money, Star } from '@element-plus/icons-vue'
|
||||
|
||||
interface PerformanceIndicator {
|
||||
indicatorType: string
|
||||
indicatorTypeName: string
|
||||
goalName: string
|
||||
targetValue: string
|
||||
unit: string
|
||||
weightPercentage: number
|
||||
description: string
|
||||
measurementMethod: string
|
||||
dataSource: string
|
||||
isQuantitative: boolean
|
||||
sortOrder: number
|
||||
status: string
|
||||
}
|
||||
|
||||
export default defineComponent({
|
||||
name: 'PerformanceIndicators',
|
||||
components: {
|
||||
TrendCharts,
|
||||
Money,
|
||||
Star
|
||||
},
|
||||
props: {
|
||||
modelValue: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
readonly: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
emits: ['update:modelValue', 'change'],
|
||||
setup(props, { emit }) {
|
||||
// 创建默认指标对象
|
||||
const createIndicator = (type: string, typeName: string): PerformanceIndicator => ({
|
||||
indicatorType: type,
|
||||
indicatorTypeName: typeName,
|
||||
goalName: '',
|
||||
targetValue: '',
|
||||
unit: '',
|
||||
weightPercentage: 0,
|
||||
description: '',
|
||||
measurementMethod: '',
|
||||
dataSource: '',
|
||||
isQuantitative: true,
|
||||
sortOrder: 0,
|
||||
status: '1'
|
||||
})
|
||||
|
||||
// 8种固定的指标类型
|
||||
const indicators = ref({
|
||||
quantity: createIndicator('quantity', '数量指标'),
|
||||
quality: createIndicator('quality', '质量指标'),
|
||||
timeliness: createIndicator('timeliness', '时效指标'),
|
||||
cost: createIndicator('cost', '成本指标'),
|
||||
economic: createIndicator('economic', '经济效益指标'),
|
||||
social: createIndicator('social', '社会效益指标'),
|
||||
ecological: createIndicator('ecological', '生态效益指标'),
|
||||
service_satisfaction: createIndicator('service_satisfaction', '服务对象满意度指标')
|
||||
})
|
||||
|
||||
// 计算总分值占比
|
||||
const totalWeight = computed(() => {
|
||||
let total = 0
|
||||
Object.values(indicators.value).forEach(indicator => {
|
||||
total += indicator.weightPercentage || 0
|
||||
})
|
||||
return Math.round(total * 10) / 10
|
||||
})
|
||||
|
||||
// 收集有效的指标数据
|
||||
const collectValidIndicators = () => {
|
||||
const validIndicators: PerformanceIndicator[] = []
|
||||
let sortOrder = 0
|
||||
|
||||
Object.values(indicators.value).forEach(indicator => {
|
||||
// 只有填写了目标名称的指标才被认为是有效的
|
||||
if (indicator.goalName?.trim()) {
|
||||
validIndicators.push({
|
||||
...indicator,
|
||||
sortOrder: sortOrder++
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
return validIndicators
|
||||
}
|
||||
|
||||
// 发出变化事件
|
||||
const emitChange = () => {
|
||||
const validIndicators = collectValidIndicators()
|
||||
emit('update:modelValue', validIndicators)
|
||||
emit('change', validIndicators)
|
||||
}
|
||||
|
||||
// 从传入的数据初始化指标
|
||||
const initializeFromData = (data: any[]) => {
|
||||
if (!data || data.length === 0) return
|
||||
|
||||
// 重置所有指标
|
||||
indicators.value = {
|
||||
quantity: createIndicator('quantity', '数量指标'),
|
||||
quality: createIndicator('quality', '质量指标'),
|
||||
timeliness: createIndicator('timeliness', '时效指标'),
|
||||
cost: createIndicator('cost', '成本指标'),
|
||||
economic: createIndicator('economic', '经济效益指标'),
|
||||
social: createIndicator('social', '社会效益指标'),
|
||||
ecological: createIndicator('ecological', '生态效益指标'),
|
||||
service_satisfaction: createIndicator('service_satisfaction', '服务对象满意度指标')
|
||||
}
|
||||
|
||||
// 将数据填入对应的指标类型
|
||||
data.forEach(item => {
|
||||
if (indicators.value[item.indicatorType]) {
|
||||
indicators.value[item.indicatorType] = { ...item }
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 监听外部数据变化
|
||||
watch(() => props.modelValue, (newValue) => {
|
||||
initializeFromData(newValue)
|
||||
}, { deep: true, immediate: true })
|
||||
|
||||
// 校验方法
|
||||
const validate = () => {
|
||||
const validIndicators = collectValidIndicators()
|
||||
const errors = []
|
||||
|
||||
if (validIndicators.length === 0) {
|
||||
errors.push('请至少填写一个绩效指标')
|
||||
}
|
||||
|
||||
validIndicators.forEach((indicator, index) => {
|
||||
if (!indicator.goalName?.trim()) {
|
||||
errors.push(`第${index + 1}个指标未填写绩效目标名称`)
|
||||
}
|
||||
if (!indicator.targetValue?.trim()) {
|
||||
errors.push(`第${index + 1}个指标未填写目标值`)
|
||||
}
|
||||
if (!indicator.weightPercentage || indicator.weightPercentage <= 0) {
|
||||
errors.push(`第${index + 1}个指标未设置分值占比`)
|
||||
}
|
||||
})
|
||||
|
||||
if (Math.abs(totalWeight.value - 100) > 0.1) {
|
||||
errors.push(`分值占比总和必须等于100%,当前为${totalWeight.value}%`)
|
||||
}
|
||||
|
||||
if (errors.length > 0) {
|
||||
return { valid: false, message: errors.join(';') }
|
||||
}
|
||||
|
||||
return { valid: true }
|
||||
}
|
||||
|
||||
// 获取所有有效指标数据
|
||||
const getAllIndicators = () => {
|
||||
return collectValidIndicators()
|
||||
}
|
||||
|
||||
return {
|
||||
indicators,
|
||||
totalWeight,
|
||||
emitChange,
|
||||
validate,
|
||||
getAllIndicators
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.performance-indicators {
|
||||
.category-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
font-weight: bold;
|
||||
font-size: 16px;
|
||||
|
||||
.el-icon {
|
||||
font-size: 18px;
|
||||
}
|
||||
}
|
||||
|
||||
.indicator-item {
|
||||
margin-bottom: 20px;
|
||||
padding: 15px;
|
||||
background-color: #fafafa;
|
||||
border-radius: 6px;
|
||||
border-left: 4px solid #409eff;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.indicator-title {
|
||||
margin: 0 0 15px 0;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
color: #606266;
|
||||
}
|
||||
|
||||
.el-form-item {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,280 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card>
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span>项目预算申报详情</span>
|
||||
<el-tag :type="getStatusType(detail.approvalStatus)" class="ml10">
|
||||
{{ getStatusText(detail.approvalStatus) }}
|
||||
</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- 申报摘要 -->
|
||||
<application-summary :application="detail" />
|
||||
|
||||
<!-- 审批流程 -->
|
||||
<el-divider content-position="left">审批流程</el-divider>
|
||||
<el-timeline>
|
||||
<el-timeline-item
|
||||
v-for="(item, index) in approvalTimeline"
|
||||
:key="index"
|
||||
:type="item.type"
|
||||
:timestamp="item.timestamp"
|
||||
>
|
||||
<div class="timeline-content">
|
||||
<h4>{{ item.title }}</h4>
|
||||
<p>{{ item.description }}</p>
|
||||
<span class="timeline-user" v-if="item.user">{{ item.user }}</span>
|
||||
</div>
|
||||
</el-timeline-item>
|
||||
</el-timeline>
|
||||
|
||||
<!-- 操作日志 -->
|
||||
<el-divider content-position="left">操作日志</el-divider>
|
||||
<el-table :data="operationLogs" style="width: 100%">
|
||||
<el-table-column prop="operation" label="操作" width="120"/>
|
||||
<el-table-column prop="operator" label="操作人" width="100"/>
|
||||
<el-table-column prop="operateTime" label="操作时间" width="180">
|
||||
<template #default="scope">
|
||||
{{ parseTime(scope.row.operateTime, '{y}-{m}-{d} {h}:{i}:{s}') }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注" show-overflow-tooltip/>
|
||||
</el-table>
|
||||
|
||||
<!-- 操作按钮 -->
|
||||
<div class="operation-buttons">
|
||||
<el-button
|
||||
v-if="detail.approvalStatus === 'draft'"
|
||||
type="primary"
|
||||
@click="handleEdit"
|
||||
v-hasPermi="['cw:application:edit']"
|
||||
>编辑</el-button>
|
||||
<el-button
|
||||
v-if="detail.approvalStatus === 'draft'"
|
||||
type="success"
|
||||
@click="handleSubmit"
|
||||
v-hasPermi="['cw:application:submit']"
|
||||
>提交</el-button>
|
||||
<el-button
|
||||
v-if="detail.approvalStatus === 'pending'"
|
||||
type="warning"
|
||||
@click="handleWithdraw"
|
||||
v-hasPermi="['cw:application:withdraw']"
|
||||
>撤回</el-button>
|
||||
<el-button @click="goBack">返回</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="CwApplicationDetail">
|
||||
import { ref, getCurrentInstance, onMounted } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { getProjectApplication, submitApplication, withdrawApplication } from "@/api/cw/projectApplication";
|
||||
import ApplicationSummary from "./summary.vue";
|
||||
import { parseTime } from "@/utils/ruoyi";
|
||||
|
||||
console.log('=== detail.vue 组件开始加载 ===');
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
|
||||
const detail = ref({});
|
||||
const approvalTimeline = ref([]);
|
||||
const operationLogs = ref([]);
|
||||
|
||||
console.log('=== detail.vue 组件初始化完成 ===');
|
||||
console.log('route对象:', route);
|
||||
console.log('初始查询参数:', route.query);
|
||||
|
||||
/** 获取状态类型 */
|
||||
function getStatusType(status) {
|
||||
const statusMap = {
|
||||
'draft': 'info',
|
||||
'pending': 'warning',
|
||||
'approving': 'primary',
|
||||
'approved': 'success',
|
||||
'rejected': 'danger',
|
||||
'withdrawn': 'info',
|
||||
'cancelled': 'info'
|
||||
};
|
||||
return statusMap[status] || 'info';
|
||||
}
|
||||
|
||||
/** 获取状态文本 */
|
||||
function getStatusText(status) {
|
||||
const statusMap = {
|
||||
'draft': '草稿',
|
||||
'pending': '待审批',
|
||||
'approving': '审批中',
|
||||
'approved': '已通过',
|
||||
'rejected': '已拒绝',
|
||||
'withdrawn': '已撤回',
|
||||
'cancelled': '已取消'
|
||||
};
|
||||
return statusMap[status] || '未知';
|
||||
}
|
||||
|
||||
/** 编辑按钮操作 */
|
||||
function handleEdit() {
|
||||
router.push("/cw/application/form?id=" + detail.value.id);
|
||||
}
|
||||
|
||||
/** 提交按钮操作 */
|
||||
function handleSubmit() {
|
||||
proxy.$modal.confirm('是否确认提交申报编号为"' + detail.value.applicationNo + '"的数据项?').then(function() {
|
||||
return submitApplication(detail.value.id);
|
||||
}).then(() => {
|
||||
getDetail();
|
||||
proxy.$modal.msgSuccess("提交成功");
|
||||
}).catch(() => {});
|
||||
}
|
||||
|
||||
/** 撤回按钮操作 */
|
||||
function handleWithdraw() {
|
||||
proxy.$modal.confirm('是否确认撤回申报编号为"' + detail.value.applicationNo + '"的数据项?').then(function() {
|
||||
return withdrawApplication(detail.value.id);
|
||||
}).then(() => {
|
||||
getDetail();
|
||||
proxy.$modal.msgSuccess("撤回成功");
|
||||
}).catch(() => {});
|
||||
}
|
||||
|
||||
/** 返回按钮操作 */
|
||||
function goBack() {
|
||||
router.push("/cw/application");
|
||||
}
|
||||
|
||||
/** 获取详情数据 */
|
||||
function getDetail() {
|
||||
const id = route.query.id;
|
||||
console.log('=== 开始获取详情数据 ===');
|
||||
console.log('URL参数中的ID:', id);
|
||||
console.log('完整query参数:', route.query);
|
||||
|
||||
if (id) {
|
||||
console.log('开始调用API:getProjectApplication, ID:', id);
|
||||
getProjectApplication(id).then(response => {
|
||||
console.log('=== API调用成功 ===');
|
||||
console.log('API响应:', response);
|
||||
console.log('响应代码:', response.code);
|
||||
console.log('响应数据:', response.data);
|
||||
|
||||
detail.value = response.data;
|
||||
|
||||
// 调试日志:查看返回的数据
|
||||
console.log('=== 项目申报详情数据 ===');
|
||||
console.log('完整数据:', response.data);
|
||||
console.log('绩效指标数据:', response.data.performanceIndicators);
|
||||
console.log('绩效指标数量:', response.data.performanceIndicators ? response.data.performanceIndicators.length : 0);
|
||||
|
||||
// 模拟审批流程数据
|
||||
approvalTimeline.value = [
|
||||
{
|
||||
type: 'success',
|
||||
timestamp: detail.value.createTime,
|
||||
title: '申报提交',
|
||||
description: '申报人提交预算申报',
|
||||
user: detail.value.applicantName
|
||||
}
|
||||
];
|
||||
|
||||
if (detail.value.submitTime) {
|
||||
approvalTimeline.value.push({
|
||||
type: 'primary',
|
||||
timestamp: detail.value.submitTime,
|
||||
title: '提交审批',
|
||||
description: '申报已提交,等待部门审批',
|
||||
user: detail.value.applicantName
|
||||
});
|
||||
}
|
||||
|
||||
if (detail.value.approveTime && detail.value.approvalStatus === 'approved') {
|
||||
approvalTimeline.value.push({
|
||||
type: 'success',
|
||||
timestamp: detail.value.approveTime,
|
||||
title: '审批通过',
|
||||
description: '所有审批节点已通过',
|
||||
user: '系统管理员'
|
||||
});
|
||||
}
|
||||
|
||||
// 模拟操作日志数据
|
||||
operationLogs.value = [
|
||||
{
|
||||
operation: '创建申报',
|
||||
operator: detail.value.applicantName,
|
||||
operateTime: detail.value.createTime,
|
||||
remark: '创建项目预算申报'
|
||||
}
|
||||
];
|
||||
|
||||
if (detail.value.submitTime) {
|
||||
operationLogs.value.push({
|
||||
operation: '提交审批',
|
||||
operator: detail.value.applicantName,
|
||||
operateTime: detail.value.submitTime,
|
||||
remark: '提交预算申报进入审批流程'
|
||||
});
|
||||
}
|
||||
}).catch(error => {
|
||||
console.error('=== API调用失败 ===');
|
||||
console.error('错误信息:', error);
|
||||
console.error('错误响应:', error.response);
|
||||
proxy.$modal.msgError('获取申报详情失败:' + (error.message || '未知错误'));
|
||||
});
|
||||
} else {
|
||||
console.error('=== URL参数错误 ===');
|
||||
console.error('缺少ID参数,无法获取详情数据');
|
||||
proxy.$modal.msgError('缺少申报ID参数');
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
console.log('=== detail.vue 页面已挂载 ===');
|
||||
console.log('当前路由:', route);
|
||||
console.log('当前路由路径:', route.path);
|
||||
console.log('当前路由查询参数:', route.query);
|
||||
getDetail();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.card-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.ml10 {
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.timeline-content h4 {
|
||||
margin: 0 0 8px 0;
|
||||
font-size: 16px;
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
.timeline-content p {
|
||||
margin: 0 0 8px 0;
|
||||
color: #606266;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.timeline-user {
|
||||
color: #909399;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.operation-buttons {
|
||||
margin-top: 30px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.operation-buttons .el-button {
|
||||
margin: 0 10px;
|
||||
}
|
||||
</style>
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,767 @@
|
||||
<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>
|
||||
<div class="card-header">
|
||||
<span class="toolbar-title">项目申报查询</span>
|
||||
</div>
|
||||
</template>
|
||||
<el-form :model="queryParams" ref="queryRef" label-width="100px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="申报编号" prop="applicationNo">
|
||||
<el-input
|
||||
v-model="queryParams.applicationNo"
|
||||
placeholder="请输入申报编号"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="项目名称" prop="projectName">
|
||||
<el-input
|
||||
v-model="queryParams.projectName"
|
||||
placeholder="请输入项目名称"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="项目负责人" prop="principal">
|
||||
<el-input
|
||||
v-model="queryParams.principal"
|
||||
placeholder="请输入项目负责人"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="审批状态" prop="approvalStatus">
|
||||
<el-select v-model="queryParams.approvalStatus" placeholder="请选择审批状态" clearable style="width: 100%">
|
||||
<el-option label="草稿" value="draft"/>
|
||||
<el-option label="已提交" value="submitted"/>
|
||||
<el-option label="审批中" value="approving"/>
|
||||
<el-option label="已通过" value="approved"/>
|
||||
<el-option label="已拒绝" value="rejected"/>
|
||||
<el-option label="已退回" value="returned"/>
|
||||
<el-option label="已取消" value="cancelled"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="预算年度" prop="year">
|
||||
<el-date-picker
|
||||
v-model="queryParams.year"
|
||||
type="year"
|
||||
placeholder="选择年份"
|
||||
value-format="YYYY"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="18">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<!-- 操作按钮区域 -->
|
||||
<el-card class="button-card">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span class="toolbar-title">项目申报管理</span>
|
||||
<div class="toolbar-actions">
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['cw:application:add']"
|
||||
>新增申报</el-button>
|
||||
<el-button
|
||||
type="success"
|
||||
icon="Edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['cw:application:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
type="danger"
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['cw:application:remove']"
|
||||
>删除</el-button>
|
||||
<el-button
|
||||
type="info"
|
||||
icon="Upload"
|
||||
@click="handleSubmit"
|
||||
:disabled="multiple"
|
||||
v-hasPermi="['cw:application:submit']"
|
||||
>提交审批</el-button>
|
||||
<el-button
|
||||
type="warning"
|
||||
icon="Download"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['cw:application:export']"
|
||||
>导出</el-button>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-card>
|
||||
|
||||
<!-- 数据表格区域 -->
|
||||
<el-card class="table-card">
|
||||
<div class="table-container">
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="applicationList"
|
||||
@selection-change="handleSelectionChange"
|
||||
class="scroll-table"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<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 />
|
||||
<el-table-column label="项目负责人" align="center" prop="principal" min-width="100" />
|
||||
<el-table-column label="所属部门" align="center" prop="departmentName" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column label="预算年度" align="center" prop="year" width="100" />
|
||||
<el-table-column label="项目总投资" align="center" prop="totalInvestment" min-width="120">
|
||||
<template #default="scope">
|
||||
<span class="amount-text">{{ formatAmount(scope.row.totalInvestment) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="审批状态" align="center" prop="approvalStatus" width="100">
|
||||
<template #default="scope">
|
||||
<el-tag
|
||||
:type="getStatusTagType(scope.row.approvalStatus)"
|
||||
effect="light"
|
||||
>
|
||||
{{ getStatusText(scope.row.approvalStatus) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" min-width="160">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="280" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<div class="action-buttons">
|
||||
<el-tooltip content="查看详情" placement="top">
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="View"
|
||||
circle
|
||||
size="small"
|
||||
@click="handleView(scope.row)"
|
||||
v-hasPermi="['cw:application:query']"
|
||||
/>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="编辑" placement="top" v-if="scope.row.approvalStatus === 'draft'">
|
||||
<el-button
|
||||
type="success"
|
||||
icon="Edit"
|
||||
circle
|
||||
size="small"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['cw:application:edit']"
|
||||
/>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="提交审批" placement="top" v-if="scope.row.approvalStatus === 'draft'">
|
||||
<el-button
|
||||
type="warning"
|
||||
icon="Upload"
|
||||
circle
|
||||
size="small"
|
||||
@click="handleSubmit(scope.row)"
|
||||
v-hasPermi="['cw:application:submit']"
|
||||
/>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="撤回" placement="top" v-if="scope.row.approvalStatus === 'submitted'">
|
||||
<el-button
|
||||
type="info"
|
||||
icon="RefreshLeft"
|
||||
circle
|
||||
size="small"
|
||||
@click="handleWithdraw(scope.row)"
|
||||
v-hasPermi="['cw:application:withdraw']"
|
||||
/>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top" v-if="['draft', 'cancelled'].includes(scope.row.approvalStatus)">
|
||||
<el-button
|
||||
type="danger"
|
||||
icon="Delete"
|
||||
circle
|
||||
size="small"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['cw:application:remove']"
|
||||
/>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
<!-- 分页 -->
|
||||
<div class="pagination-container">
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<!-- 添加或修改项目申报对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="1200px" append-to-body>
|
||||
<ApplicationForm ref="applicationFormRef" :form-data="form" @submit="submitForm" />
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 查看详情对话框 -->
|
||||
<el-dialog title="项目申报详情" v-model="viewOpen" width="1200px" append-to-body>
|
||||
<ApplicationSummary :application-id="currentId" />
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="viewOpen = false">关 闭</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listProjectApplication, getProjectApplication, delProjectApplication, addProjectApplication, updateProjectApplication, submitApplication } from "@/api/cw/projectApplication"
|
||||
import ApplicationForm from "./form.vue"
|
||||
import ApplicationSummary from "./summary.vue"
|
||||
|
||||
export default {
|
||||
name: "ProjectApplication",
|
||||
components: {
|
||||
ApplicationForm,
|
||||
ApplicationSummary
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 项目申报表格数据
|
||||
applicationList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 是否显示查看对话框
|
||||
viewOpen: false,
|
||||
// 当前查看的ID
|
||||
currentId: null,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
applicationNo: null,
|
||||
projectName: null,
|
||||
principal: null,
|
||||
approvalStatus: null,
|
||||
year: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {},
|
||||
// 统计数据
|
||||
totalCount: 0,
|
||||
approvedCount: 0,
|
||||
pendingCount: 0,
|
||||
draftCount: 0
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
this.getStatistics()
|
||||
},
|
||||
methods: {
|
||||
/** 查询项目申报列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
listProjectApplication(this.queryParams).then(response => {
|
||||
this.applicationList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
/** 获取统计数据 */
|
||||
getStatistics() {
|
||||
// 这里可以调用统计接口,暂时从列表数据计算
|
||||
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
|
||||
this.reset()
|
||||
},
|
||||
/** 表单重置 */
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
applicationNo: null,
|
||||
projectName: null,
|
||||
principal: null,
|
||||
year: new Date().getFullYear(),
|
||||
departmentId: null,
|
||||
departmentName: null,
|
||||
projectCategory: null,
|
||||
implementationPeriod: null,
|
||||
projectBackground: null,
|
||||
projectObjective: null,
|
||||
projectScope: null,
|
||||
projectContent: null,
|
||||
implementationPlan: null,
|
||||
expectedResults: null,
|
||||
riskAssessment: null,
|
||||
totalPerformanceGoal: null,
|
||||
currentYearGoal: null,
|
||||
totalInvestment: 0,
|
||||
totalMunicipalFiscal: 0,
|
||||
totalSelfFunding: 0,
|
||||
totalOtherFunding: 0,
|
||||
currentYearTotal: 0,
|
||||
currentYearMunicipal: 0,
|
||||
currentYearSelf: 0,
|
||||
currentYearOther: 0,
|
||||
nextYearTotal: 0,
|
||||
nextYearMunicipal: 0,
|
||||
nextYearSelf: 0,
|
||||
nextYearOther: 0,
|
||||
futureYearTotal: 0,
|
||||
futureYearMunicipal: 0,
|
||||
futureYearSelf: 0,
|
||||
futureYearOther: 0,
|
||||
performanceIndicators: [],
|
||||
approvalStatus: 'draft'
|
||||
}
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryRef")
|
||||
this.handleQuery()
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset()
|
||||
this.open = true
|
||||
this.title = "添加项目申报"
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset()
|
||||
const id = row.id || this.ids
|
||||
getProjectApplication(id).then(response => {
|
||||
this.form = response.data
|
||||
this.open = true
|
||||
this.title = "修改项目申报"
|
||||
})
|
||||
},
|
||||
/** 查看详情 */
|
||||
handleView(row) {
|
||||
this.currentId = row.id
|
||||
this.viewOpen = true
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["applicationFormRef"].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateProjectApplication(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
addProjectApplication(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids
|
||||
this.$modal.confirm('是否确认删除项目申报编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delProjectApplication(ids)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
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)
|
||||
|
||||
this.$modal.confirm('是否确认提交申报编号为"' + applications.join('", "') + '"的数据项?').then(() => {
|
||||
return submitApplication(row?.id || this.ids)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
this.$modal.msgSuccess("提交成功")
|
||||
}).catch(() => {})
|
||||
},
|
||||
/** 撤回申请 */
|
||||
handleWithdraw(row) {
|
||||
this.$modal.confirm('是否确认撤回该申报?').then(() => {
|
||||
// 调用撤回接口
|
||||
this.$modal.msgSuccess("撤回成功")
|
||||
this.getList()
|
||||
}).catch(() => {})
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('cw/application/export', {
|
||||
...this.queryParams
|
||||
}, `application_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
/** 格式化金额 */
|
||||
formatAmount(amount) {
|
||||
if (!amount) return '0.00'
|
||||
return parseFloat(amount).toLocaleString('zh-CN', {
|
||||
minimumFractionDigits: 2,
|
||||
maximumFractionDigits: 2
|
||||
})
|
||||
},
|
||||
/** 获取状态标签类型 */
|
||||
getStatusTagType(status) {
|
||||
const statusMap = {
|
||||
draft: 'info',
|
||||
submitted: 'warning',
|
||||
approving: 'warning',
|
||||
approved: 'success',
|
||||
rejected: 'danger',
|
||||
returned: 'warning',
|
||||
cancelled: 'info'
|
||||
}
|
||||
return statusMap[status] || 'info'
|
||||
},
|
||||
/** 获取状态文本 */
|
||||
getStatusText(status) {
|
||||
const statusMap = {
|
||||
draft: '草稿',
|
||||
submitted: '已提交',
|
||||
approving: '审批中',
|
||||
approved: '已通过',
|
||||
rejected: '已拒绝',
|
||||
returned: '已退回',
|
||||
cancelled: '已取消'
|
||||
}
|
||||
return statusMap[status] || '未知'
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
/* 继承后勤管理模块的样式风格 */
|
||||
.page-container {
|
||||
padding: 20px;
|
||||
|
||||
/* 统计卡片样式 */
|
||||
.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;
|
||||
}
|
||||
}
|
||||
|
||||
/* 卡片样式 */
|
||||
.button-card, .table-card {
|
||||
margin-bottom: 20px;
|
||||
border-radius: 12px;
|
||||
border: 1px solid #e4e7ed;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
|
||||
|
||||
:deep(.el-card__header) {
|
||||
border-bottom: 1px solid rgba(93, 135, 255, 0.1);
|
||||
background: linear-gradient(135deg, #fafbff 0%, #f8fafc 100%);
|
||||
padding: 16px 20px;
|
||||
}
|
||||
|
||||
:deep(.el-card__body) {
|
||||
padding: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.card-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.toolbar-title {
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
color: #1e293b;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
width: 4px;
|
||||
height: 20px;
|
||||
background: linear-gradient(135deg, rgb(93, 135, 255), rgb(73, 190, 255));
|
||||
border-radius: 2px;
|
||||
margin-right: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
.toolbar-actions {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
/* 表格样式 */
|
||||
.table-container {
|
||||
width: 100%;
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.scroll-table {
|
||||
width: 100%;
|
||||
|
||||
:deep(.el-table__header-wrapper) {
|
||||
.el-table__header {
|
||||
th {
|
||||
background-color: #f8f9fa;
|
||||
color: #333;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.el-table__body-wrapper) {
|
||||
.el-table__row {
|
||||
&:hover {
|
||||
background-color: #f5f7fa;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 操作按钮样式 */
|
||||
.action-buttons {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
white-space: nowrap;
|
||||
|
||||
.el-button {
|
||||
width: 32px !important;
|
||||
height: 32px !important;
|
||||
padding: 0 !important;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
|
||||
/* 金额文本样式 */
|
||||
.amount-text {
|
||||
font-weight: 600;
|
||||
color: #e74c3c;
|
||||
}
|
||||
|
||||
/* 分页容器样式 */
|
||||
.pagination-container {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
padding: 16px 0 0 0;
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
/* 对话框样式 */
|
||||
.dialog-footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
/* 响应式设计 */
|
||||
@media (max-width: 768px) {
|
||||
.page-container {
|
||||
padding: 10px;
|
||||
|
||||
.stats-row {
|
||||
.stat-card {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.toolbar-actions {
|
||||
flex-direction: column;
|
||||
gap: 8px !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,505 @@
|
||||
<template>
|
||||
<div class="application-summary" v-loading="loading">
|
||||
<!-- 基本信息 -->
|
||||
<el-card class="summary-card">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span>项目基本信息</span>
|
||||
</div>
|
||||
</template>
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="申报编号">
|
||||
{{ currentApplication.applicationNo || '系统自动生成' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="项目名称">
|
||||
{{ currentApplication.projectName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="项目负责人">
|
||||
{{ currentApplication.principal }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="联系电话">
|
||||
{{ currentApplication.contactPhone }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="预算年度">
|
||||
{{ currentApplication.year }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="项目周期">
|
||||
{{ formatDateRange(currentApplication.startDate, currentApplication.endDate) }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
|
||||
<!-- 项目特征 -->
|
||||
<el-card class="summary-card">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span>项目特征</span>
|
||||
</div>
|
||||
</template>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-tag :type="currentApplication.targetSme ? 'success' : 'info'">
|
||||
小微企业发展: {{ currentApplication.targetSme ? '是' : '否' }}
|
||||
</el-tag>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-tag :type="currentApplication.targetMicroSme ? 'success' : 'info'">
|
||||
微小企业成长: {{ currentApplication.targetMicroSme ? '是' : '否' }}
|
||||
</el-tag>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-tag :type="currentApplication.importEquipment ? 'success' : 'info'">
|
||||
进口设备: {{ currentApplication.importEquipment ? '是' : '否' }}
|
||||
</el-tag>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
|
||||
<!-- 项目内容 -->
|
||||
<el-card class="summary-card" v-if="hasProjectContent">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span>项目内容</span>
|
||||
</div>
|
||||
</template>
|
||||
<el-descriptions :column="1" border>
|
||||
<el-descriptions-item label="申报理由" v-if="currentApplication.applicationReason">
|
||||
<div class="content-text">{{ currentApplication.applicationReason }}</div>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="建设内容" v-if="currentApplication.constructionContent">
|
||||
<div class="content-text">{{ currentApplication.constructionContent }}</div>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="总体绩效目标" v-if="currentApplication.totalPerformanceGoal">
|
||||
<div class="content-text">{{ currentApplication.totalPerformanceGoal }}</div>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="当年完成目标" v-if="currentApplication.currentYearGoal">
|
||||
<div class="content-text">{{ currentApplication.currentYearGoal }}</div>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
|
||||
<!-- 资金预算汇总 -->
|
||||
<el-card class="summary-card">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span>资金预算汇总</span>
|
||||
<el-tag type="warning" size="small">单位:万元</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- 总体预算 -->
|
||||
<div class="budget-section">
|
||||
<h4>总体预算</h4>
|
||||
<el-row :gutter="20" class="budget-row">
|
||||
<el-col :span="6">
|
||||
<div class="budget-item">
|
||||
<div class="budget-label">总投资</div>
|
||||
<div class="budget-value highlight">{{ formatAmount(currentApplication.totalInvestment) }}</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<div class="budget-item">
|
||||
<div class="budget-label">市财政资金</div>
|
||||
<div class="budget-value">{{ formatAmount(currentApplication.totalMunicipalFiscal) }}</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<div class="budget-item">
|
||||
<div class="budget-label">单位自筹</div>
|
||||
<div class="budget-value">{{ formatAmount(currentApplication.totalSelfFunding) }}</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<div class="budget-item">
|
||||
<div class="budget-label">其他资金</div>
|
||||
<div class="budget-value">{{ formatAmount(currentApplication.totalOtherFunding) }}</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<!-- 分年度预算 -->
|
||||
<div class="budget-section">
|
||||
<h4>分年度预算明细</h4>
|
||||
<el-table :data="budgetBreakdown" border>
|
||||
<el-table-column prop="year" label="年度" width="120" align="center"/>
|
||||
<el-table-column prop="total" label="总投资" align="right">
|
||||
<template #default="scope">
|
||||
{{ formatAmount(scope.row.total) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="municipal" label="市财政资金" align="right">
|
||||
<template #default="scope">
|
||||
{{ formatAmount(scope.row.municipal) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="self" label="单位自筹" align="right">
|
||||
<template #default="scope">
|
||||
{{ formatAmount(scope.row.self) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="other" label="其他资金" align="right">
|
||||
<template #default="scope">
|
||||
{{ formatAmount(scope.row.other) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<!-- 绩效指标设置 -->
|
||||
<el-card class="summary-card" v-if="hasPerformanceIndicators">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span>绩效指标设置</span>
|
||||
<el-tag type="warning" size="small">分值占比总和:{{ performanceIndicatorTotal }}%</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<el-table :data="validPerformanceIndicators" border style="width: 100%">
|
||||
<el-table-column label="指标类型" width="120" align="center">
|
||||
<template #default="scope">
|
||||
<el-tag>{{ scope.row.indicatorTypeName }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="绩效目标名称" min-width="200">
|
||||
<template #default="scope">
|
||||
<div class="content-text">{{ scope.row.goalName }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="目标值" width="120" align="center">
|
||||
<template #default="scope">
|
||||
<div class="content-text">{{ scope.row.targetValue }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="分值占比" width="100" align="center">
|
||||
<template #default="scope">
|
||||
<el-tag type="primary">{{ parseFloat(scope.row.weightPercentage) || 0 }}%</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="详细说明" min-width="150">
|
||||
<template #default="scope">
|
||||
<div class="content-text" v-if="scope.row.description">{{ scope.row.description }}</div>
|
||||
<span v-else class="text-muted">-</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
|
||||
<!-- 备注信息 -->
|
||||
<el-card class="summary-card" v-if="currentApplication.remark">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span>备注信息</span>
|
||||
</div>
|
||||
</template>
|
||||
<div class="content-text">{{ currentApplication.remark }}</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed, ref, watch, onMounted } from 'vue';
|
||||
import { getProjectApplication } from '@/api/cw/projectApplication';
|
||||
|
||||
defineOptions({
|
||||
name: 'ApplicationSummary'
|
||||
});
|
||||
|
||||
const props = defineProps({
|
||||
application: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
applicationId: {
|
||||
type: [String, Number],
|
||||
default: null
|
||||
}
|
||||
});
|
||||
|
||||
// 内部数据状态
|
||||
const internalApplication = ref({});
|
||||
const loading = ref(false);
|
||||
|
||||
// 计算属性:优先使用传入的application,如果没有则使用内部获取的数据
|
||||
const currentApplication = computed(() => {
|
||||
// 如果直接传入了application对象且不为空,则使用它
|
||||
if (props.application && Object.keys(props.application).length > 0) {
|
||||
console.log('=== 使用传入的application对象 ===');
|
||||
console.log('application数据:', props.application);
|
||||
return props.application;
|
||||
}
|
||||
|
||||
// 否则使用内部获取的数据
|
||||
console.log('=== 使用内部获取的application数据 ===');
|
||||
console.log('internalApplication数据:', internalApplication.value);
|
||||
return internalApplication.value;
|
||||
});
|
||||
|
||||
// 获取申报详情数据
|
||||
const fetchApplicationData = async (id) => {
|
||||
if (!id) return;
|
||||
|
||||
console.log('=== ApplicationSummary 开始获取数据 ===');
|
||||
console.log('applicationId:', id);
|
||||
|
||||
loading.value = true;
|
||||
try {
|
||||
const response = await getProjectApplication(id);
|
||||
console.log('=== ApplicationSummary API调用成功 ===');
|
||||
console.log('API响应:', response);
|
||||
console.log('响应数据:', response.data);
|
||||
console.log('响应数据类型:', typeof response.data);
|
||||
|
||||
// 特别检查绩效指标字段
|
||||
if (response.data) {
|
||||
console.log('=== API响应中的绩效指标检查 ===');
|
||||
console.log('response.data.performanceIndicators:', response.data.performanceIndicators);
|
||||
console.log('performanceIndicators类型:', typeof response.data.performanceIndicators);
|
||||
console.log('是否为数组:', Array.isArray(response.data.performanceIndicators));
|
||||
|
||||
// 检查所有可能的绩效指标字段名
|
||||
console.log('可能的字段名检查:');
|
||||
console.log('- performanceIndicators:', response.data.performanceIndicators);
|
||||
console.log('- performance_indicators:', response.data.performance_indicators);
|
||||
console.log('- indicators:', response.data.indicators);
|
||||
console.log('- performanceIndicatorList:', response.data.performanceIndicatorList);
|
||||
|
||||
// 列出所有字段
|
||||
console.log('响应数据的所有字段:', Object.keys(response.data));
|
||||
}
|
||||
|
||||
internalApplication.value = response.data || {};
|
||||
} catch (error) {
|
||||
console.error('=== ApplicationSummary API调用失败 ===');
|
||||
console.error('错误信息:', error);
|
||||
internalApplication.value = {};
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 监听applicationId变化
|
||||
watch(() => props.applicationId, (newId) => {
|
||||
if (newId && (!props.application || Object.keys(props.application).length === 0)) {
|
||||
fetchApplicationData(newId);
|
||||
}
|
||||
}, { immediate: true });
|
||||
|
||||
// 组件挂载时检查是否需要获取数据
|
||||
onMounted(() => {
|
||||
console.log('=== ApplicationSummary 组件挂载 ===');
|
||||
console.log('props.application:', props.application);
|
||||
console.log('props.applicationId:', props.applicationId);
|
||||
|
||||
// 如果没有传入application但有applicationId,则获取数据
|
||||
if (props.applicationId && (!props.application || Object.keys(props.application).length === 0)) {
|
||||
fetchApplicationData(props.applicationId);
|
||||
}
|
||||
});
|
||||
|
||||
// 判断是否有项目内容
|
||||
const hasProjectContent = computed(() => {
|
||||
const app = currentApplication.value;
|
||||
return app.applicationReason ||
|
||||
app.constructionContent ||
|
||||
app.totalPerformanceGoal ||
|
||||
app.currentYearGoal;
|
||||
});
|
||||
|
||||
// 判断是否有绩效指标
|
||||
const hasPerformanceIndicators = computed(() => {
|
||||
const app = currentApplication.value;
|
||||
console.log('=== 绩效指标详细检查 ===');
|
||||
console.log('完整app对象:', app);
|
||||
console.log('app.performanceIndicators类型:', typeof app.performanceIndicators);
|
||||
console.log('app.performanceIndicators值:', app.performanceIndicators);
|
||||
console.log('是否为数组:', Array.isArray(app.performanceIndicators));
|
||||
|
||||
if (app.performanceIndicators) {
|
||||
console.log('绩效指标数组长度:', app.performanceIndicators.length);
|
||||
console.log('绩效指标数组内容:', JSON.stringify(app.performanceIndicators, null, 2));
|
||||
} else {
|
||||
console.log('绩效指标数据为空或未定义');
|
||||
}
|
||||
|
||||
const hasIndicators = app.performanceIndicators && app.performanceIndicators.length > 0;
|
||||
console.log('最终判断 - 是否有绩效指标:', hasIndicators);
|
||||
return hasIndicators;
|
||||
});
|
||||
|
||||
// 计算绩效指标总分值占比
|
||||
const performanceIndicatorTotal = computed(() => {
|
||||
const app = currentApplication.value;
|
||||
if (!app.performanceIndicators || app.performanceIndicators.length === 0) {
|
||||
return 0;
|
||||
}
|
||||
const total = app.performanceIndicators.reduce((sum, indicator) => {
|
||||
const weight = parseFloat(indicator.weightPercentage) || 0;
|
||||
return sum + weight;
|
||||
}, 0);
|
||||
return Math.round(total * 100) / 100; // 保留两位小数
|
||||
});
|
||||
|
||||
// 过滤掉无效的绩效指标(分值占比为0的)
|
||||
const validPerformanceIndicators = computed(() => {
|
||||
const app = currentApplication.value;
|
||||
console.log('=== validPerformanceIndicators 计算 ===');
|
||||
console.log('app.performanceIndicators:', app.performanceIndicators);
|
||||
|
||||
if (!app.performanceIndicators) {
|
||||
console.log('没有绩效指标数据,返回空数组');
|
||||
return [];
|
||||
}
|
||||
|
||||
const validIndicators = app.performanceIndicators.filter(indicator => {
|
||||
const weight = parseFloat(indicator.weightPercentage) || 0;
|
||||
console.log(`指标 ${indicator.goalName}: 权重=${indicator.weightPercentage}, 解析后权重=${weight}, 是否有效=${weight > 0}`);
|
||||
return weight > 0;
|
||||
});
|
||||
|
||||
console.log('有效绩效指标数量:', validIndicators.length);
|
||||
console.log('有效绩效指标详情:', validIndicators);
|
||||
return validIndicators;
|
||||
});
|
||||
|
||||
// 分年度预算明细
|
||||
const budgetBreakdown = computed(() => {
|
||||
const app = currentApplication.value;
|
||||
const currentYear = app.year || new Date().getFullYear();
|
||||
console.log('=== 预算数据检查 ===');
|
||||
console.log('application数据:', app);
|
||||
console.log('当年预算字段:', {
|
||||
currentYearTotal: app.currentYearTotal,
|
||||
currentYearMunicipal: app.currentYearMunicipal,
|
||||
currentYearSelf: app.currentYearSelf,
|
||||
currentYearOther: app.currentYearOther
|
||||
});
|
||||
return [
|
||||
{
|
||||
year: `${currentYear}年`,
|
||||
total: app.currentYearTotal || 0,
|
||||
municipal: app.currentYearMunicipal || 0,
|
||||
self: app.currentYearSelf || 0,
|
||||
other: app.currentYearOther || 0
|
||||
},
|
||||
{
|
||||
year: `${parseInt(currentYear) + 1}年`,
|
||||
total: app.nextYearTotal || 0,
|
||||
municipal: app.nextYearMunicipal || 0,
|
||||
self: app.nextYearSelf || 0,
|
||||
other: app.nextYearOther || 0
|
||||
},
|
||||
{
|
||||
year: '以后年度',
|
||||
total: app.futureYearTotal || 0,
|
||||
municipal: app.futureYearMunicipal || 0,
|
||||
self: app.futureYearSelf || 0,
|
||||
other: app.futureYearOther || 0
|
||||
}
|
||||
].filter(item => item.total > 0); // 只显示有预算的年度
|
||||
});
|
||||
|
||||
// 格式化金额
|
||||
const formatAmount = (amount) => {
|
||||
if (!amount || amount === 0) return '0.00';
|
||||
return Number(amount).toFixed(2);
|
||||
};
|
||||
|
||||
// 格式化日期范围
|
||||
const formatDateRange = (startDate, endDate) => {
|
||||
if (!startDate && !endDate) return '未设置';
|
||||
if (!startDate) return `截止 ${endDate}`;
|
||||
if (!endDate) return `${startDate} 开始`;
|
||||
return `${startDate} 至 ${endDate}`;
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.application-summary {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.summary-card {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.summary-card:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.card-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.content-text {
|
||||
line-height: 1.6;
|
||||
word-break: break-word;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
.budget-section {
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.budget-section:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.budget-section h4 {
|
||||
margin: 0 0 16px 0;
|
||||
font-size: 16px;
|
||||
color: #333;
|
||||
border-left: 4px solid #409eff;
|
||||
padding-left: 12px;
|
||||
}
|
||||
|
||||
.budget-row {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.budget-item {
|
||||
text-align: center;
|
||||
padding: 16px;
|
||||
border: 1px solid #ebeef5;
|
||||
border-radius: 4px;
|
||||
background-color: #fafafa;
|
||||
}
|
||||
|
||||
.budget-label {
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.budget-value {
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.budget-value.highlight {
|
||||
color: #409eff;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.el-tag {
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
:deep(.el-descriptions__label) {
|
||||
width: 120px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
:deep(.el-table td, .el-table th) {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
:deep(.el-table .cell) {
|
||||
padding: 0 8px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,869 @@
|
||||
<template>
|
||||
<div class="p-2 page-container">
|
||||
<!-- 搜索区域 -->
|
||||
<transition :enter-active-class="animate.searchAnimate.enter" :leave-active-class="animate.searchAnimate.leave">
|
||||
<div v-show="showSearch" class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" :model="queryParams" label-width="100px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="申报编号" prop="applicationNo">
|
||||
<el-input v-model="queryParams.applicationNo" placeholder="请输入申报编号" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="项目名称" prop="projectName">
|
||||
<el-input v-model="queryParams.projectName" placeholder="请输入项目名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="申报人" prop="applicantName">
|
||||
<el-input v-model="queryParams.applicantName" placeholder="请输入申报人姓名" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="审批状态" prop="approvalStatus">
|
||||
<el-select v-model="queryParams.approvalStatus" placeholder="请选择审批状态" clearable style="width: 100%">
|
||||
<template v-if="cw_approval_status && cw_approval_status.length > 0">
|
||||
<el-option v-for="dict in cw_approval_status" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</template>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="审批人" prop="approverName">
|
||||
<el-input v-model="queryParams.approverName" placeholder="请输入审批人姓名" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="提交时间">
|
||||
<el-date-picker
|
||||
v-model="daterangeSubmitTime"
|
||||
value-format="YYYY-MM-DD"
|
||||
type="daterange"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
@change="handleQuery"
|
||||
style="width: 100%"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
<!-- 快捷操作按钮 -->
|
||||
<el-row :gutter="10" class="mb-[10px]">
|
||||
<el-col :span="6">
|
||||
<el-card shadow="hover" class="quick-action-card">
|
||||
<div class="quick-action" @click="showPendingApprovals">
|
||||
<el-icon class="quick-icon"><Clock /></el-icon>
|
||||
<span>待我审批</span>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-card shadow="hover" class="quick-action-card">
|
||||
<div class="quick-action" @click="showMyApprovals">
|
||||
<el-icon class="quick-icon"><User /></el-icon>
|
||||
<span>我已审批</span>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-card shadow="hover" class="quick-action-card">
|
||||
<div class="quick-action" @click="showDepartmentApprovals">
|
||||
<el-icon class="quick-icon"><OfficeBuilding /></el-icon>
|
||||
<span>部门审批</span>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-card shadow="hover" class="quick-action-card">
|
||||
<div class="quick-action" @click="showApprovalStatistics">
|
||||
<el-icon class="quick-icon"><DataAnalysis /></el-icon>
|
||||
<span>审批统计</span>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 表格区域 -->
|
||||
<el-card shadow="never" class="button-card table-card">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="Check"
|
||||
:disabled="multiple"
|
||||
@click="handleBatchApprove"
|
||||
v-hasPermi="['cw:application:approve']"
|
||||
>批量通过</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Close"
|
||||
:disabled="multiple"
|
||||
@click="handleBatchReject"
|
||||
v-hasPermi="['cw:application:approve']"
|
||||
>批量拒绝</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button icon="Download" @click="handleExport" v-hasPermi="['cw:approvalRecord:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch="showSearch" @update:showSearch="showSearch = $event" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
border
|
||||
:data="approvalList"
|
||||
@selection-change="handleSelectionChange"
|
||||
@row-dblclick="handleView"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="申报编号" align="center" prop="applicationNo" width="140" show-overflow-tooltip />
|
||||
<el-table-column label="项目名称" align="center" prop="projectName" min-width="200" show-overflow-tooltip />
|
||||
<el-table-column label="申报人" align="center" prop="applicantName" width="100" />
|
||||
<el-table-column label="申报部门" align="center" prop="deptName" width="120" show-overflow-tooltip />
|
||||
<el-table-column label="总投资(万元)" align="center" prop="totalInvestment" width="120">
|
||||
<template #default="scope">
|
||||
<span class="amount-text">{{ formatAmount(scope.row.totalInvestment) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="当前审批人" align="center" prop="currentApproverName" width="120" />
|
||||
<el-table-column label="审批状态" align="center" prop="approvalStatus" width="100">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="cw_approval_status" :value="scope.row.approvalStatus" v-if="cw_approval_status && cw_approval_status.length > 0" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="提交时间" align="center" prop="submitTime" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.submitTime, '{y}-{m}-{d} {h}:{i}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="审批时间" align="center" prop="approvalTime" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.approvalTime ? parseTime(scope.row.approvalTime, '{y}-{m}-{d} {h}:{i}') : '-' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="220" class-name="small-padding fixed-width" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="查看详情" placement="top">
|
||||
<el-button link type="info" icon="View" @click="handleView(scope.row)"></el-button>
|
||||
</el-tooltip>
|
||||
|
||||
<!-- 待审批状态可以进行审批操作 -->
|
||||
<template v-if="scope.row.approvalStatus === 'submitted' || scope.row.approvalStatus === 'approving'">
|
||||
<el-tooltip content="通过" placement="top">
|
||||
<el-button
|
||||
link
|
||||
type="success"
|
||||
icon="Check"
|
||||
@click="handleApprove(scope.row)"
|
||||
v-hasPermi="['cw:application:approve']"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="拒绝" placement="top">
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
icon="Close"
|
||||
@click="handleReject(scope.row)"
|
||||
v-hasPermi="['cw:application:approve']"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="退回" placement="top">
|
||||
<el-button
|
||||
link
|
||||
type="warning"
|
||||
icon="RefreshLeft"
|
||||
@click="handleReturn(scope.row)"
|
||||
v-hasPermi="['cw:application:approve']"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
|
||||
<!-- 所有状态都可以查看审批记录 -->
|
||||
<el-tooltip content="审批记录" placement="top">
|
||||
<el-button link type="primary" icon="Document" @click="handleApprovalHistory(scope.row)"></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page="queryParams.pageNum"
|
||||
:limit="queryParams.pageSize"
|
||||
@update:page="queryParams.pageNum = $event"
|
||||
@update:limit="queryParams.pageSize = $event"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-card>
|
||||
|
||||
<!-- 审批对话框 -->
|
||||
<el-dialog
|
||||
v-model="approvalDialog.visible"
|
||||
:title="approvalDialog.title"
|
||||
width="800px"
|
||||
append-to-body
|
||||
@close="closeApprovalDialog"
|
||||
>
|
||||
<el-form ref="approvalFormRef" :model="approvalForm" :rules="approvalRules" label-width="120px">
|
||||
<!-- 申报信息展示 -->
|
||||
<el-form-item label="申报信息">
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="申报编号">{{ currentApplication.applicationNo }}</el-descriptions-item>
|
||||
<el-descriptions-item label="项目名称">{{ currentApplication.projectName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="申报人">{{ currentApplication.applicantName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="申报部门">{{ currentApplication.deptName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="总投资">{{ formatAmount(currentApplication.totalInvestment) }} 万元</el-descriptions-item>
|
||||
<el-descriptions-item label="预算年度">{{ currentApplication.year }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 审批决定 -->
|
||||
<el-form-item label="审批决定" prop="approvalResult">
|
||||
<el-radio-group v-model="approvalForm.approvalResult">
|
||||
<el-radio value="approved">
|
||||
<el-icon class="approve-icon"><Check /></el-icon>
|
||||
通过
|
||||
</el-radio>
|
||||
<el-radio value="rejected">
|
||||
<el-icon class="reject-icon"><Close /></el-icon>
|
||||
拒绝
|
||||
</el-radio>
|
||||
<el-radio value="returned">
|
||||
<el-icon class="return-icon"><RefreshLeft /></el-icon>
|
||||
退回
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 审批意见 -->
|
||||
<el-form-item label="审批意见" prop="approvalComment">
|
||||
<el-input
|
||||
v-model="approvalForm.approvalComment"
|
||||
type="textarea"
|
||||
:rows="4"
|
||||
placeholder="请输入审批意见(必填)"
|
||||
maxlength="500"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 下一审批人(如果需要) -->
|
||||
<el-form-item label="下一审批人" prop="nextApprover" v-if="showNextApprover">
|
||||
<el-select v-model="approvalForm.nextApprover" placeholder="请选择下一审批人" style="width: 100%">
|
||||
<el-option
|
||||
v-for="approver in approverList"
|
||||
:key="approver.userId"
|
||||
:label="approver.userName"
|
||||
:value="approver.userId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="closeApprovalDialog">取消</el-button>
|
||||
<el-button type="primary" @click="submitApproval" :loading="approvalSubmitting">确定</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 详情对话框 -->
|
||||
<el-dialog
|
||||
v-model="detailDialog.visible"
|
||||
:title="detailDialog.title"
|
||||
width="90%"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<application-summary :application="currentApplication" />
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button
|
||||
v-if="canApprove(currentApplication)"
|
||||
type="primary"
|
||||
@click="approveFromDetail"
|
||||
>审批</el-button>
|
||||
<el-button @click="detailDialog.visible = false">关闭</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 审批记录对话框 -->
|
||||
<el-dialog
|
||||
v-model="historyDialog.visible"
|
||||
title="审批记录"
|
||||
width="900px"
|
||||
append-to-body
|
||||
>
|
||||
<el-timeline>
|
||||
<el-timeline-item
|
||||
v-for="(record, index) in approvalHistory"
|
||||
:key="index"
|
||||
:icon="getHistoryIcon(record.approvalResult)"
|
||||
:type="getHistoryType(record.approvalResult)"
|
||||
:timestamp="parseTime(record.approvalTime, '{y}-{m}-{d} {h}:{i}')"
|
||||
placement="top"
|
||||
>
|
||||
<el-card shadow="hover">
|
||||
<div class="history-header">
|
||||
<span class="approver-name">{{ record.approverName }}</span>
|
||||
<el-tag :type="getStatusTagType(record.approvalResult)">
|
||||
{{ getApprovalResultText(record.approvalResult) }}
|
||||
</el-tag>
|
||||
</div>
|
||||
<div class="history-content" v-if="record.approvalComment">
|
||||
<p>{{ record.approvalComment }}</p>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-timeline-item>
|
||||
</el-timeline>
|
||||
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="historyDialog.visible = false">关闭</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listApprovalRecord,
|
||||
getApprovalRecord,
|
||||
approveApplication,
|
||||
batchApproveApplication,
|
||||
getApprovalHistory,
|
||||
getPendingApprovals,
|
||||
getMyApprovals,
|
||||
getDepartmentApprovals,
|
||||
getAvailableApprovers,
|
||||
exportApprovalRecord
|
||||
} from "@/api/cw/approvalRecord";
|
||||
import { useDict } from "@/utils/dict";
|
||||
import ApplicationSummary from "../application/summary.vue";
|
||||
|
||||
export default {
|
||||
name: 'CwApprovalRecord',
|
||||
components: {
|
||||
ApplicationSummary
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 审批列表
|
||||
approvalList: [],
|
||||
// 时间范围
|
||||
daterangeSubmitTime: [],
|
||||
// 动画配置
|
||||
animate: {
|
||||
searchAnimate: {
|
||||
enter: 'animate__animated animate__fadeIn',
|
||||
leave: 'animate__animated animate__fadeOut'
|
||||
}
|
||||
},
|
||||
// 字典数据
|
||||
cw_approval_status: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
applicationNo: '',
|
||||
projectName: '',
|
||||
applicantName: '',
|
||||
approvalStatus: '',
|
||||
approverName: '',
|
||||
submitTimeBegin: '',
|
||||
submitTimeEnd: ''
|
||||
},
|
||||
// 审批对话框
|
||||
approvalDialog: {
|
||||
visible: false,
|
||||
title: ''
|
||||
},
|
||||
// 详情对话框
|
||||
detailDialog: {
|
||||
visible: false,
|
||||
title: ''
|
||||
},
|
||||
// 历史记录对话框
|
||||
historyDialog: {
|
||||
visible: false
|
||||
},
|
||||
// 当前申报信息
|
||||
currentApplication: {},
|
||||
// 审批表单
|
||||
approvalForm: {
|
||||
applicationId: null,
|
||||
approvalResult: '',
|
||||
approvalComment: '',
|
||||
nextApprover: null
|
||||
},
|
||||
// 审批表单验证
|
||||
approvalRules: {
|
||||
approvalResult: [
|
||||
{ required: true, message: '请选择审批结果', trigger: 'change' }
|
||||
],
|
||||
approvalComment: [
|
||||
{ required: true, message: '请输入审批意见', trigger: 'blur' },
|
||||
{ min: 5, max: 500, message: '审批意见长度在 5 到 500 个字符', trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
// 审批提交状态
|
||||
approvalSubmitting: false,
|
||||
// 审批人列表
|
||||
approverList: [],
|
||||
// 审批历史
|
||||
approvalHistory: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
// 是否显示下一审批人选择
|
||||
showNextApprover() {
|
||||
return this.approvalForm.approvalResult === 'approved';
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.loadDictData();
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 加载字典数据 */
|
||||
async loadDictData() {
|
||||
try {
|
||||
const dictData = useDict('cw_approval_status');
|
||||
// 监听字典数据变化
|
||||
this.$watch(() => dictData.cw_approval_status, (newVal) => {
|
||||
this.cw_approval_status = newVal || [];
|
||||
}, { immediate: true });
|
||||
} catch (error) {
|
||||
console.error('加载审批状态字典数据失败:', error);
|
||||
}
|
||||
},
|
||||
|
||||
/** 查询审批列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
// 处理时间范围
|
||||
this.queryParams.submitTimeBegin = this.daterangeSubmitTime[0] || '';
|
||||
this.queryParams.submitTimeEnd = this.daterangeSubmitTime[1] || '';
|
||||
|
||||
listApprovalRecord(this.queryParams).then(response => {
|
||||
this.approvalList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
}).catch(error => {
|
||||
console.error('获取审批列表失败:', error);
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.daterangeSubmitTime = [];
|
||||
this.$refs.queryFormRef.resetFields();
|
||||
this.handleQuery();
|
||||
},
|
||||
|
||||
/** 多选框选中数据 */
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id);
|
||||
this.single = selection.length !== 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
|
||||
/** 快捷操作 */
|
||||
showPendingApprovals() {
|
||||
this.queryParams = {
|
||||
...this.queryParams,
|
||||
approvalStatus: 'submitted',
|
||||
currentApprover: 'current'
|
||||
};
|
||||
this.handleQuery();
|
||||
},
|
||||
|
||||
showMyApprovals() {
|
||||
this.queryParams = {
|
||||
...this.queryParams,
|
||||
approverName: 'current'
|
||||
};
|
||||
this.handleQuery();
|
||||
},
|
||||
|
||||
showDepartmentApprovals() {
|
||||
this.queryParams = {
|
||||
...this.queryParams,
|
||||
deptId: 'current'
|
||||
};
|
||||
this.handleQuery();
|
||||
},
|
||||
|
||||
showApprovalStatistics() {
|
||||
this.$router.push('/cw/approvalRecord/statistics');
|
||||
},
|
||||
|
||||
/** 查看详情 */
|
||||
handleView(row) {
|
||||
const id = row.id || row.applicationId;
|
||||
getApprovalRecord(id).then(response => {
|
||||
this.currentApplication = response.data;
|
||||
this.detailDialog.visible = true;
|
||||
this.detailDialog.title = "申报详情";
|
||||
}).catch(error => {
|
||||
console.error('获取详情失败:', error);
|
||||
this.$modal.msgError('获取详情失败');
|
||||
});
|
||||
},
|
||||
|
||||
/** 从详情页审批 */
|
||||
approveFromDetail() {
|
||||
this.detailDialog.visible = false;
|
||||
this.handleApprove(this.currentApplication);
|
||||
},
|
||||
|
||||
/** 单个审批通过 */
|
||||
handleApprove(row) {
|
||||
this.openApprovalDialog('approved', row, '审批通过');
|
||||
},
|
||||
|
||||
/** 单个审批拒绝 */
|
||||
handleReject(row) {
|
||||
this.openApprovalDialog('rejected', row, '审批拒绝');
|
||||
},
|
||||
|
||||
/** 单个审批退回 */
|
||||
handleReturn(row) {
|
||||
this.openApprovalDialog('returned', row, '审批退回');
|
||||
},
|
||||
|
||||
/** 批量审批通过 */
|
||||
handleBatchApprove() {
|
||||
if (this.ids.length === 0) {
|
||||
this.$modal.msgWarning('请选择要审批的记录');
|
||||
return;
|
||||
}
|
||||
this.openBatchApprovalDialog('approved', '批量审批通过');
|
||||
},
|
||||
|
||||
/** 批量审批拒绝 */
|
||||
handleBatchReject() {
|
||||
if (this.ids.length === 0) {
|
||||
this.$modal.msgWarning('请选择要审批的记录');
|
||||
return;
|
||||
}
|
||||
this.openBatchApprovalDialog('rejected', '批量审批拒绝');
|
||||
},
|
||||
|
||||
/** 打开审批对话框 */
|
||||
openApprovalDialog(result, row, title) {
|
||||
this.currentApplication = row;
|
||||
this.approvalForm = {
|
||||
applicationId: row.id,
|
||||
approvalResult: result,
|
||||
approvalComment: '',
|
||||
nextApprover: null
|
||||
};
|
||||
|
||||
// 如果是通过状态,加载可选审批人
|
||||
if (result === 'approved') {
|
||||
this.loadAvailableApprovers(row.id);
|
||||
}
|
||||
|
||||
this.approvalDialog.visible = true;
|
||||
this.approvalDialog.title = title;
|
||||
},
|
||||
|
||||
/** 打开批量审批对话框 */
|
||||
openBatchApprovalDialog(result, title) {
|
||||
this.approvalForm = {
|
||||
applicationIds: this.ids,
|
||||
approvalResult: result,
|
||||
approvalComment: '',
|
||||
nextApprover: null
|
||||
};
|
||||
this.approvalDialog.visible = true;
|
||||
this.approvalDialog.title = title;
|
||||
},
|
||||
|
||||
/** 加载可选审批人 */
|
||||
loadAvailableApprovers(applicationId) {
|
||||
getAvailableApprovers(applicationId).then(response => {
|
||||
this.approverList = response.data || [];
|
||||
}).catch(error => {
|
||||
console.error('获取审批人列表失败:', error);
|
||||
this.approverList = [];
|
||||
});
|
||||
},
|
||||
|
||||
/** 关闭审批对话框 */
|
||||
closeApprovalDialog() {
|
||||
this.approvalDialog.visible = false;
|
||||
this.approvalForm = {
|
||||
applicationId: null,
|
||||
approvalResult: '',
|
||||
approvalComment: '',
|
||||
nextApprover: null
|
||||
};
|
||||
this.approverList = [];
|
||||
if (this.$refs.approvalFormRef) {
|
||||
this.$refs.approvalFormRef.resetFields();
|
||||
}
|
||||
},
|
||||
|
||||
/** 提交审批 */
|
||||
submitApproval() {
|
||||
this.$refs.approvalFormRef.validate(valid => {
|
||||
if (valid) {
|
||||
this.approvalSubmitting = true;
|
||||
|
||||
const apiCall = this.approvalForm.applicationIds
|
||||
? batchApproveApplication(this.approvalForm)
|
||||
: approveApplication(this.approvalForm);
|
||||
|
||||
apiCall.then(response => {
|
||||
this.$modal.msgSuccess("审批成功");
|
||||
this.closeApprovalDialog();
|
||||
this.getList();
|
||||
}).catch(error => {
|
||||
console.error('审批失败:', error);
|
||||
this.$modal.msgError('审批失败');
|
||||
}).finally(() => {
|
||||
this.approvalSubmitting = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/** 查看审批历史 */
|
||||
handleApprovalHistory(row) {
|
||||
getApprovalHistory(row.id || row.applicationId).then(response => {
|
||||
this.approvalHistory = response.data || [];
|
||||
this.historyDialog.visible = true;
|
||||
}).catch(error => {
|
||||
console.error('获取审批历史失败:', error);
|
||||
this.$modal.msgError('获取审批历史失败');
|
||||
// 显示模拟数据
|
||||
this.approvalHistory = [
|
||||
{
|
||||
approverName: '系统',
|
||||
approvalResult: 'submitted',
|
||||
approvalComment: '申报材料已提交,等待审批',
|
||||
approvalTime: new Date().toISOString(),
|
||||
stepName: '申报提交',
|
||||
stepOrder: 1
|
||||
}
|
||||
];
|
||||
this.historyDialog.visible = true;
|
||||
});
|
||||
},
|
||||
|
||||
/** 导出 */
|
||||
handleExport() {
|
||||
exportApprovalRecord(this.queryParams).then(() => {
|
||||
this.$modal.msgSuccess('导出成功');
|
||||
}).catch(error => {
|
||||
console.error('导出失败:', error);
|
||||
this.$modal.msgError('导出失败');
|
||||
});
|
||||
},
|
||||
|
||||
/** 判断是否可以审批 */
|
||||
canApprove(row) {
|
||||
return row.approvalStatus === 'submitted' || row.approvalStatus === 'approving';
|
||||
},
|
||||
|
||||
/** 格式化金额 */
|
||||
formatAmount(amount) {
|
||||
return amount ? amount.toFixed(2) : '0.00';
|
||||
},
|
||||
|
||||
/** 获取历史记录图标 */
|
||||
getHistoryIcon(result) {
|
||||
const iconMap = {
|
||||
'submitted': 'Upload',
|
||||
'approved': 'Check',
|
||||
'rejected': 'Close',
|
||||
'returned': 'RefreshLeft'
|
||||
};
|
||||
return iconMap[result] || 'Document';
|
||||
},
|
||||
|
||||
/** 获取历史记录类型 */
|
||||
getHistoryType(result) {
|
||||
const typeMap = {
|
||||
'submitted': 'primary',
|
||||
'approved': 'success',
|
||||
'rejected': 'danger',
|
||||
'returned': 'warning'
|
||||
};
|
||||
return typeMap[result] || 'info';
|
||||
},
|
||||
|
||||
/** 获取状态标签类型 */
|
||||
getStatusTagType(status) {
|
||||
const statusMap = {
|
||||
'submitted': 'warning',
|
||||
'approved': 'success',
|
||||
'rejected': 'danger',
|
||||
'returned': 'warning'
|
||||
};
|
||||
return statusMap[status] || 'info';
|
||||
},
|
||||
|
||||
/** 获取审批结果文本 */
|
||||
getApprovalResultText(result) {
|
||||
const textMap = {
|
||||
'submitted': '已提交',
|
||||
'approved': '通过',
|
||||
'rejected': '拒绝',
|
||||
'returned': '退回'
|
||||
};
|
||||
return textMap[result] || result;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.page-container {
|
||||
min-height: calc(100vh - 84px);
|
||||
}
|
||||
|
||||
// 快捷操作卡片
|
||||
.quick-action-card {
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
border: 1px solid #e4e7ed;
|
||||
|
||||
&:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
|
||||
border-color: #409EFF;
|
||||
}
|
||||
|
||||
.quick-action {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 20px;
|
||||
|
||||
.quick-icon {
|
||||
font-size: 28px;
|
||||
color: #409EFF;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
span {
|
||||
font-size: 14px;
|
||||
color: #606266;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 表格卡片
|
||||
.button-card.table-card {
|
||||
border-radius: 8px;
|
||||
border: 1px solid #e4e7ed;
|
||||
}
|
||||
|
||||
// 金额文本
|
||||
.amount-text {
|
||||
font-weight: 600;
|
||||
color: #E6A23C;
|
||||
}
|
||||
|
||||
// 审批对话框样式
|
||||
.approve-icon {
|
||||
color: #67C23A;
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
.reject-icon {
|
||||
color: #F56C6C;
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
.return-icon {
|
||||
color: #E6A23C;
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
// 审批历史样式
|
||||
.history-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 8px;
|
||||
|
||||
.approver-name {
|
||||
font-weight: 600;
|
||||
color: #2c3e50;
|
||||
}
|
||||
}
|
||||
|
||||
.history-content {
|
||||
color: #606266;
|
||||
line-height: 1.6;
|
||||
|
||||
p {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
// 响应式设计
|
||||
@media (max-width: 768px) {
|
||||
.quick-action {
|
||||
padding: 15px;
|
||||
|
||||
.quick-icon {
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
span {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,319 @@
|
||||
<template>
|
||||
<div class="config-detail">
|
||||
<!-- 基本信息 -->
|
||||
<el-card class="detail-card mb-4">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<el-icon><InfoFilled /></el-icon>
|
||||
<span>基本信息</span>
|
||||
</div>
|
||||
</template>
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="配置名称">
|
||||
{{ config.configName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="审批类型">
|
||||
<el-tag :type="getApprovalTypeTag(config.approvalType)">
|
||||
{{ getApprovalTypeText(config.approvalType) }}
|
||||
</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="适用范围">
|
||||
{{ getScopeText(config.applicableScope) }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="状态">
|
||||
<el-tag :type="config.status === '1' ? 'success' : 'danger'">
|
||||
{{ config.status === '1' ? '启用' : '禁用' }}
|
||||
</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="排序">
|
||||
{{ config.orderNum }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="创建时间">
|
||||
{{ parseTime(config.createTime, '{y}-{m}-{d} {h}:{i}') }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
<div v-if="config.description" class="mt-4">
|
||||
<h4 class="section-title">配置描述</h4>
|
||||
<p class="description-text">{{ config.description }}</p>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<!-- 审批流程 -->
|
||||
<el-card class="detail-card" v-if="config.steps && config.steps.length > 0">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<el-icon><Share /></el-icon>
|
||||
<span>审批流程</span>
|
||||
<el-tag type="info" size="small">共 {{ config.steps.length }} 个步骤</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<el-steps :active="config.steps.length" finish-status="success" align-center>
|
||||
<el-step
|
||||
v-for="(step, index) in config.steps"
|
||||
:key="index"
|
||||
:title="step.stepName"
|
||||
:description="`${getApprovalModeText(step.approvalMode)} | ${step.timeoutHours}小时`"
|
||||
/>
|
||||
</el-steps>
|
||||
|
||||
<div class="steps-detail mt-6">
|
||||
<div
|
||||
v-for="(step, index) in config.steps"
|
||||
:key="index"
|
||||
class="step-detail-item"
|
||||
>
|
||||
<el-card shadow="hover" class="step-detail-card">
|
||||
<template #header>
|
||||
<div class="step-header">
|
||||
<span class="step-number">步骤 {{ index + 1 }}</span>
|
||||
<span class="step-name">{{ step.stepName }}</span>
|
||||
<el-tag :type="getModeTagType(step.approvalMode)" size="small">
|
||||
{{ getApprovalModeText(step.approvalMode) }}
|
||||
</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<div class="step-info">
|
||||
<label class="info-label">审批方式:</label>
|
||||
<span>{{ getApprovalModeText(step.approvalMode) }}</span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="step-info">
|
||||
<label class="info-label">超时时间:</label>
|
||||
<span>{{ step.timeoutHours }} 小时</span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="step-info">
|
||||
<label class="info-label">审批人数:</label>
|
||||
<span>{{ step.approvers ? step.approvers.length : 0 }} 人</span>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<div class="approvers-section mt-4" v-if="step.approvers && step.approvers.length > 0">
|
||||
<label class="info-label">审批人员:</label>
|
||||
<div class="approvers-list">
|
||||
<el-tag
|
||||
v-for="(approver, approverIndex) in step.approverNames"
|
||||
:key="approverIndex"
|
||||
class="approver-tag"
|
||||
>
|
||||
{{ approver }}
|
||||
</el-tag>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-else-if="config.approvalType === 'custom'" class="custom-approver-notice">
|
||||
<el-alert
|
||||
title="自选审批人"
|
||||
description="申报人在提交时自行选择审批人"
|
||||
type="info"
|
||||
show-icon
|
||||
:closable="false"
|
||||
/>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<!-- 无流程步骤时的提示 -->
|
||||
<el-card class="detail-card" v-else>
|
||||
<el-empty description="暂无配置的审批流程步骤" />
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'ApproverConfigDetail',
|
||||
props: {
|
||||
config: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/** 获取审批类型标签 */
|
||||
getApprovalTypeTag(type) {
|
||||
const typeMap = {
|
||||
'fixed': 'success',
|
||||
'role': 'warning',
|
||||
'dept': 'info',
|
||||
'custom': 'primary'
|
||||
};
|
||||
return typeMap[type] || 'info';
|
||||
},
|
||||
|
||||
/** 获取审批类型文本 */
|
||||
getApprovalTypeText(type) {
|
||||
const textMap = {
|
||||
'fixed': '固定审批人',
|
||||
'role': '角色审批',
|
||||
'dept': '部门审批',
|
||||
'custom': '自选审批人'
|
||||
};
|
||||
return textMap[type] || type;
|
||||
},
|
||||
|
||||
/** 获取适用范围文本 */
|
||||
getScopeText(scope) {
|
||||
const scopeMap = {
|
||||
'all': '全部',
|
||||
'dept': '部门',
|
||||
'project_type': '项目类型',
|
||||
'amount_range': '金额范围'
|
||||
};
|
||||
return scopeMap[scope] || scope;
|
||||
},
|
||||
|
||||
/** 获取审批方式文本 */
|
||||
getApprovalModeText(mode) {
|
||||
const modeMap = {
|
||||
'single': '单人审批',
|
||||
'multi_sign': '多人会签',
|
||||
'multi_or': '多人或签'
|
||||
};
|
||||
return modeMap[mode] || mode;
|
||||
},
|
||||
|
||||
/** 获取审批方式标签类型 */
|
||||
getModeTagType(mode) {
|
||||
const typeMap = {
|
||||
'single': 'primary',
|
||||
'multi_sign': 'success',
|
||||
'multi_or': 'warning'
|
||||
};
|
||||
return typeMap[mode] || 'info';
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.config-detail {
|
||||
.detail-card {
|
||||
border-radius: 8px;
|
||||
border: 1px solid #e4e7ed;
|
||||
|
||||
.card-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
font-weight: 600;
|
||||
color: #2c3e50;
|
||||
}
|
||||
}
|
||||
|
||||
.section-title {
|
||||
margin: 0 0 12px 0;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #2c3e50;
|
||||
}
|
||||
|
||||
.description-text {
|
||||
margin: 0;
|
||||
padding: 12px;
|
||||
background: #f8f9fa;
|
||||
border-radius: 6px;
|
||||
color: #606266;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.steps-detail {
|
||||
.step-detail-item {
|
||||
margin-bottom: 16px;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.step-detail-card {
|
||||
border: 1px solid #e4e7ed;
|
||||
|
||||
.step-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
|
||||
.step-number {
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
color: white;
|
||||
padding: 4px 12px;
|
||||
border-radius: 12px;
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.step-name {
|
||||
font-weight: 600;
|
||||
color: #2c3e50;
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.step-info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 8px;
|
||||
|
||||
.info-label {
|
||||
font-weight: 600;
|
||||
color: #909399;
|
||||
margin-right: 8px;
|
||||
min-width: 80px;
|
||||
}
|
||||
}
|
||||
|
||||
.approvers-section {
|
||||
border-top: 1px solid #f0f0f0;
|
||||
padding-top: 16px;
|
||||
|
||||
.info-label {
|
||||
font-weight: 600;
|
||||
color: #909399;
|
||||
margin-bottom: 8px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.approvers-list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
|
||||
.approver-tag {
|
||||
background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
|
||||
color: white;
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.custom-approver-notice {
|
||||
border-top: 1px solid #f0f0f0;
|
||||
padding-top: 16px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.mb-4 {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.mt-4 {
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
.mt-6 {
|
||||
margin-top: 24px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,890 @@
|
||||
<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="100px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="配置名称" prop="configName">
|
||||
<el-input v-model="queryParams.configName" placeholder="请输入配置名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="审批类型" prop="approvalType">
|
||||
<el-select v-model="queryParams.approvalType" placeholder="请选择审批类型" clearable style="width: 100%">
|
||||
<el-option label="固定审批人" value="fixed" />
|
||||
<el-option label="角色审批" value="role" />
|
||||
<el-option label="部门审批" value="dept" />
|
||||
<el-option label="自选审批人" value="custom" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable style="width: 100%">
|
||||
<el-option label="启用" value="1" />
|
||||
<el-option label="禁用" value="0" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
<!-- 快捷操作按钮 -->
|
||||
<el-row :gutter="10" class="mb-[10px]">
|
||||
<el-col :span="6">
|
||||
<el-card shadow="hover" class="quick-action-card">
|
||||
<div class="quick-action" @click="handleAdd">
|
||||
<el-icon class="quick-icon"><Plus /></el-icon>
|
||||
<span>新增配置</span>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-card shadow="hover" class="quick-action-card">
|
||||
<div class="quick-action" @click="showFlowDesigner">
|
||||
<el-icon class="quick-icon"><SetUp /></el-icon>
|
||||
<span>流程设计</span>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-card shadow="hover" class="quick-action-card">
|
||||
<div class="quick-action" @click="showTemplates">
|
||||
<el-icon class="quick-icon"><Document /></el-icon>
|
||||
<span>配置模板</span>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-card shadow="hover" class="quick-action-card">
|
||||
<div class="quick-action" @click="showTestFlow">
|
||||
<el-icon class="quick-icon"><Promotion /></el-icon>
|
||||
<span>流程测试</span>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 表格区域 -->
|
||||
<el-card shadow="never" class="button-card table-card">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['cw:approverConfig:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate" v-hasPermi="['cw:approverConfig:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete" v-hasPermi="['cw:approverConfig:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="info" plain icon="Sort" @click="toggleExpandAll">展开/折叠</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button icon="Download" @click="handleExport" v-hasPermi="['cw:approverConfig:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
border
|
||||
:data="configList"
|
||||
row-key="id"
|
||||
:default-expand-all="isExpandAll"
|
||||
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="配置名称" align="left" prop="configName" min-width="200" show-overflow-tooltip />
|
||||
<el-table-column label="审批类型" align="center" prop="approvalType" width="120">
|
||||
<template #default="scope">
|
||||
<el-tag :type="getApprovalTypeTag(scope.row.approvalType)">
|
||||
{{ getApprovalTypeText(scope.row.approvalType) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="步骤数量" align="center" prop="stepCount" width="100">
|
||||
<template #default="scope">
|
||||
<el-badge :value="scope.row.stepCount" class="step-badge" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="审批人" align="center" prop="approverNames" min-width="180" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<el-tag
|
||||
v-for="(name, index) in scope.row.approverNames"
|
||||
:key="index"
|
||||
size="small"
|
||||
class="mr-1"
|
||||
>
|
||||
{{ name }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="适用范围" align="center" prop="applicableScope" width="120">
|
||||
<template #default="scope">
|
||||
<el-tag type="info" size="small">{{ scope.row.applicableScope }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="排序" align="center" prop="orderNum" width="80" />
|
||||
<el-table-column label="状态" align="center" prop="status" width="80">
|
||||
<template #default="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.status"
|
||||
active-value="1"
|
||||
inactive-value="0"
|
||||
@change="handleStatusChange(scope.row)"
|
||||
v-hasPermi="['cw:approverConfig:edit']"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="240" class-name="small-padding fixed-width" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="查看详情" placement="top">
|
||||
<el-button link type="info" icon="View" @click="handleDetail(scope.row)"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="编辑配置" placement="top">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['cw:approverConfig:edit']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="复制配置" placement="top">
|
||||
<el-button link type="success" icon="CopyDocument" @click="handleCopy(scope.row)" v-hasPermi="['cw:approverConfig:add']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="流程图" placement="top">
|
||||
<el-button link type="warning" icon="Share" @click="handleViewFlow(scope.row)"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['cw:approverConfig:remove']"></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-card>
|
||||
|
||||
<!-- 添加或修改审批人配置对话框 -->
|
||||
<el-dialog v-model="dialog.visible" :title="dialog.title" width="900px" append-to-body>
|
||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="120px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="配置名称" prop="configName">
|
||||
<el-input v-model="form.configName" placeholder="请输入配置名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="审批类型" prop="approvalType">
|
||||
<el-select v-model="form.approvalType" placeholder="请选择审批类型" style="width: 100%" @change="handleTypeChange">
|
||||
<el-option label="固定审批人" value="fixed" />
|
||||
<el-option label="角色审批" value="role" />
|
||||
<el-option label="部门审批" value="dept" />
|
||||
<el-option label="自选审批人" value="custom" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="适用范围" prop="applicableScope">
|
||||
<el-select v-model="form.applicableScope" placeholder="请选择适用范围" style="width: 100%">
|
||||
<el-option label="全部" value="all" />
|
||||
<el-option label="部门" value="dept" />
|
||||
<el-option label="项目类型" value="project_type" />
|
||||
<el-option label="金额范围" value="amount_range" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="排序" prop="orderNum">
|
||||
<el-input-number v-model="form.orderNum" :min="0" :max="999" controls-position="right" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="配置描述" prop="description">
|
||||
<el-input v-model="form.description" type="textarea" :rows="3" placeholder="请输入配置描述" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 审批步骤配置 -->
|
||||
<el-form-item label="审批步骤">
|
||||
<el-card shadow="never" class="steps-card">
|
||||
<template #header>
|
||||
<div class="steps-header">
|
||||
<span>审批流程步骤</span>
|
||||
<el-button type="primary" size="small" icon="Plus" @click="addStep">添加步骤</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div v-if="form.steps && form.steps.length > 0" class="steps-container">
|
||||
<div
|
||||
v-for="(step, index) in form.steps"
|
||||
:key="index"
|
||||
class="step-item"
|
||||
>
|
||||
<el-card shadow="hover" class="step-card">
|
||||
<template #header>
|
||||
<div class="step-header">
|
||||
<span class="step-title">
|
||||
<el-icon><Position /></el-icon>
|
||||
步骤 {{ index + 1 }}: {{ step.stepName || '未命名步骤' }}
|
||||
</span>
|
||||
<div class="step-actions">
|
||||
<el-button type="text" 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-icon><ArrowDown /></el-icon>
|
||||
</el-button>
|
||||
<el-button type="text" size="small" @click="removeStep(index)">
|
||||
<el-icon><Delete /></el-icon>
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="步骤名称" :prop="`steps.${index}.stepName`" :rules="stepRules.stepName">
|
||||
<el-input v-model="step.stepName" placeholder="请输入步骤名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="审批方式" :prop="`steps.${index}.approvalMode`" :rules="stepRules.approvalMode">
|
||||
<el-select v-model="step.approvalMode" placeholder="请选择审批方式" style="width: 100%">
|
||||
<el-option label="单人审批" value="single" />
|
||||
<el-option label="多人会签" value="multi_sign" />
|
||||
<el-option label="多人或签" value="multi_or" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="超时时间(小时)" :prop="`steps.${index}.timeoutHours`">
|
||||
<el-input-number v-model="step.timeoutHours" :min="1" :max="720" controls-position="right" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="审批人设置" :prop="`steps.${index}.approvers`" :rules="stepRules.approvers">
|
||||
<div class="approvers-container">
|
||||
<!-- 固定审批人 -->
|
||||
<div v-if="form.approvalType === 'fixed'">
|
||||
<el-select
|
||||
v-model="step.approvers"
|
||||
multiple
|
||||
placeholder="请选择审批人"
|
||||
style="width: 100%"
|
||||
@change="updateApproverNames"
|
||||
>
|
||||
<el-option
|
||||
v-for="user in userList"
|
||||
:key="user.userId"
|
||||
:label="user.nickName"
|
||||
:value="user.userId"
|
||||
/>
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
<!-- 角色审批 -->
|
||||
<div v-else-if="form.approvalType === 'role'">
|
||||
<el-select
|
||||
v-model="step.approvers"
|
||||
multiple
|
||||
placeholder="请选择审批角色"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="role in roleList"
|
||||
:key="role.roleId"
|
||||
:label="role.roleName"
|
||||
:value="role.roleId"
|
||||
/>
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
<!-- 部门审批 -->
|
||||
<div v-else-if="form.approvalType === 'dept'">
|
||||
<el-tree-select
|
||||
v-model="step.approvers"
|
||||
:data="deptTreeData"
|
||||
:props="{ value: 'id', label: 'label', children: 'children' }"
|
||||
multiple
|
||||
placeholder="请选择审批部门"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<!-- 自选审批人 -->
|
||||
<div v-else-if="form.approvalType === 'custom'">
|
||||
<el-alert
|
||||
title="自选审批人模式"
|
||||
description="申报人在提交时可以自行选择审批人,此处无需配置具体人员"
|
||||
type="info"
|
||||
show-icon
|
||||
:closable="false"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-empty v-else description="暂无审批步骤,请添加步骤" />
|
||||
</el-card>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="cancel">取消</el-button>
|
||||
<el-button type="primary" @click="submitForm">确定</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 详情对话框 -->
|
||||
<el-dialog v-model="detailDialog.visible" :title="detailDialog.title" width="900px" append-to-body>
|
||||
<approver-config-detail :config="currentConfig" />
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="detailDialog.visible = false">关闭</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 流程图对话框 -->
|
||||
<el-dialog v-model="flowDialog.visible" title="审批流程图" width="1200px" append-to-body>
|
||||
<div ref="flowChartRef" style="height: 500px; border: 1px solid #e4e7ed;"></div>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="flowDialog.visible = false">关闭</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listApproverConfig,
|
||||
getApproverConfig,
|
||||
addApproverConfig,
|
||||
updateApproverConfig,
|
||||
delApproverConfig
|
||||
} from "@/api/cw/projectApplication";
|
||||
|
||||
export default {
|
||||
name: 'CwApproverConfig',
|
||||
dicts: ['sys_normal_disable'],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 配置列表
|
||||
configList: [],
|
||||
// 是否展开,默认全部展开
|
||||
isExpandAll: true,
|
||||
// 弹出层标题
|
||||
dialog: {
|
||||
visible: false,
|
||||
title: ''
|
||||
},
|
||||
// 详情弹窗
|
||||
detailDialog: {
|
||||
visible: false,
|
||||
title: ''
|
||||
},
|
||||
// 流程图弹窗
|
||||
flowDialog: {
|
||||
visible: false
|
||||
},
|
||||
// 当前配置数据
|
||||
currentConfig: {},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
configName: '',
|
||||
approvalType: '',
|
||||
status: ''
|
||||
},
|
||||
// 表单校验
|
||||
rules: {
|
||||
configName: [
|
||||
{ required: true, message: "配置名称不能为空", trigger: "blur" },
|
||||
{ min: 2, max: 50, message: "配置名称长度在 2 到 50 个字符", trigger: "blur" }
|
||||
],
|
||||
approvalType: [
|
||||
{ required: true, message: "审批类型不能为空", trigger: "change" }
|
||||
],
|
||||
applicableScope: [
|
||||
{ required: true, message: "适用范围不能为空", trigger: "change" }
|
||||
]
|
||||
},
|
||||
// 步骤表单校验
|
||||
stepRules: {
|
||||
stepName: [
|
||||
{ required: true, message: "步骤名称不能为空", trigger: "blur" }
|
||||
],
|
||||
approvalMode: [
|
||||
{ required: true, message: "审批方式不能为空", trigger: "change" }
|
||||
],
|
||||
approvers: [
|
||||
{ required: true, message: "请设置审批人", trigger: "change" }
|
||||
]
|
||||
},
|
||||
// 用户列表
|
||||
userList: [],
|
||||
// 角色列表
|
||||
roleList: [],
|
||||
// 部门树数据
|
||||
deptTreeData: []
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.loadBasicData();
|
||||
},
|
||||
methods: {
|
||||
/** 查询审批人配置列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listApproverConfig(this.queryParams).then(response => {
|
||||
this.configList = this.handleTree(response.data, "id", "parentId");
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
|
||||
/** 加载基础数据 */
|
||||
loadBasicData() {
|
||||
// 加载用户列表
|
||||
// listUser().then(response => {
|
||||
// this.userList = response.rows;
|
||||
// });
|
||||
|
||||
// 加载角色列表
|
||||
// listRole().then(response => {
|
||||
// this.roleList = response.rows;
|
||||
// });
|
||||
|
||||
// 加载部门树
|
||||
// listDept().then(response => {
|
||||
// this.deptTreeData = this.handleTree(response.data, "deptId");
|
||||
// });
|
||||
},
|
||||
|
||||
/** 取消按钮 */
|
||||
cancel() {
|
||||
this.dialog.visible = false;
|
||||
this.reset();
|
||||
},
|
||||
|
||||
/** 表单重置 */
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
configName: null,
|
||||
approvalType: null,
|
||||
applicableScope: 'all',
|
||||
orderNum: 0,
|
||||
description: null,
|
||||
status: "1",
|
||||
steps: []
|
||||
};
|
||||
if (this.$refs.formRef) {
|
||||
this.$refs.formRef.resetFields();
|
||||
}
|
||||
},
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.$refs.queryFormRef.resetFields();
|
||||
this.handleQuery();
|
||||
},
|
||||
|
||||
/** 多选框选中数据 */
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id);
|
||||
this.single = selection.length !== 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
|
||||
/** 展开/折叠操作 */
|
||||
toggleExpandAll() {
|
||||
this.isExpandAll = !this.isExpandAll;
|
||||
this.toggleExpandAllTree(this.configList, this.isExpandAll);
|
||||
},
|
||||
|
||||
/** 快捷操作 */
|
||||
showFlowDesigner() {
|
||||
this.$modal.msgInfo("流程设计器功能开发中...");
|
||||
},
|
||||
|
||||
showTemplates() {
|
||||
this.$modal.msgInfo("配置模板功能开发中...");
|
||||
},
|
||||
|
||||
showTestFlow() {
|
||||
this.$modal.msgInfo("流程测试功能开发中...");
|
||||
},
|
||||
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.dialog.visible = true;
|
||||
this.dialog.title = "添加审批人配置";
|
||||
},
|
||||
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row?.id || this.ids[0];
|
||||
getApproverConfig(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.dialog.visible = true;
|
||||
this.dialog.title = "修改审批人配置";
|
||||
});
|
||||
},
|
||||
|
||||
/** 复制配置 */
|
||||
handleCopy(row) {
|
||||
getApproverConfig(row.id).then(response => {
|
||||
this.form = {
|
||||
...response.data,
|
||||
id: null,
|
||||
configName: response.data.configName + '_副本'
|
||||
};
|
||||
this.dialog.visible = true;
|
||||
this.dialog.title = "复制审批人配置";
|
||||
});
|
||||
},
|
||||
|
||||
/** 查看详情 */
|
||||
handleDetail(row) {
|
||||
getApproverConfig(row.id).then(response => {
|
||||
this.currentConfig = response.data;
|
||||
this.detailDialog.visible = true;
|
||||
this.detailDialog.title = "配置详情";
|
||||
});
|
||||
},
|
||||
|
||||
/** 查看流程图 */
|
||||
handleViewFlow(row) {
|
||||
this.flowDialog.visible = true;
|
||||
this.$nextTick(() => {
|
||||
this.renderFlowChart(row);
|
||||
});
|
||||
},
|
||||
|
||||
/** 状态变更 */
|
||||
handleStatusChange(row) {
|
||||
let text = row.status === "1" ? "启用" : "停用";
|
||||
this.$modal.confirm('确认要"' + text + '""' + row.configName + '"配置吗?').then(() => {
|
||||
return updateApproverConfig(row);
|
||||
}).then(() => {
|
||||
this.$modal.msgSuccess(text + "成功");
|
||||
}).catch(() => {
|
||||
row.status = row.status === "0" ? "1" : "0";
|
||||
});
|
||||
},
|
||||
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row?.id ? [row.id] : this.ids;
|
||||
const configs = row?.configName ? [row.configName] : this.configList.filter(item => this.ids.includes(item.id)).map(item => item.configName);
|
||||
|
||||
this.$modal.confirm('是否确认删除配置名称为"' + configs.join('", "') + '"的数据项?').then(() => {
|
||||
return delApproverConfig(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs.formRef.validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateApproverConfig(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.dialog.visible = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addApproverConfig(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.dialog.visible = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/** 审批类型变更 */
|
||||
handleTypeChange(value) {
|
||||
// 清空已配置的审批人
|
||||
if (this.form.steps) {
|
||||
this.form.steps.forEach(step => {
|
||||
step.approvers = [];
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
/** 添加步骤 */
|
||||
addStep() {
|
||||
if (!this.form.steps) {
|
||||
this.form.steps = [];
|
||||
}
|
||||
this.form.steps.push({
|
||||
stepName: `审批步骤${this.form.steps.length + 1}`,
|
||||
approvalMode: 'single',
|
||||
timeoutHours: 24,
|
||||
approvers: []
|
||||
});
|
||||
},
|
||||
|
||||
/** 删除步骤 */
|
||||
removeStep(index) {
|
||||
this.form.steps.splice(index, 1);
|
||||
},
|
||||
|
||||
/** 上移步骤 */
|
||||
moveStepUp(index) {
|
||||
if (index > 0) {
|
||||
const temp = this.form.steps[index];
|
||||
this.form.steps[index] = this.form.steps[index - 1];
|
||||
this.form.steps[index - 1] = temp;
|
||||
}
|
||||
},
|
||||
|
||||
/** 下移步骤 */
|
||||
moveStepDown(index) {
|
||||
if (index < this.form.steps.length - 1) {
|
||||
const temp = this.form.steps[index];
|
||||
this.form.steps[index] = this.form.steps[index + 1];
|
||||
this.form.steps[index + 1] = temp;
|
||||
}
|
||||
},
|
||||
|
||||
/** 更新审批人名称 */
|
||||
updateApproverNames() {
|
||||
// 更新审批人名称用于显示
|
||||
},
|
||||
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('cw/approverConfig/export', {
|
||||
...this.queryParams
|
||||
}, `approver_config_${new Date().getTime()}.xlsx`);
|
||||
},
|
||||
|
||||
/** 渲染流程图 */
|
||||
renderFlowChart(row) {
|
||||
// 使用流程图库渲染流程图
|
||||
this.$modal.msgInfo("流程图功能开发中...");
|
||||
},
|
||||
|
||||
/** 获取审批类型标签 */
|
||||
getApprovalTypeTag(type) {
|
||||
const typeMap = {
|
||||
'fixed': 'success',
|
||||
'role': 'warning',
|
||||
'dept': 'info',
|
||||
'custom': 'primary'
|
||||
};
|
||||
return typeMap[type] || 'info';
|
||||
},
|
||||
|
||||
/** 获取审批类型文本 */
|
||||
getApprovalTypeText(type) {
|
||||
const textMap = {
|
||||
'fixed': '固定审批人',
|
||||
'role': '角色审批',
|
||||
'dept': '部门审批',
|
||||
'custom': '自选审批人'
|
||||
};
|
||||
return textMap[type] || type;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.page-container {
|
||||
min-height: calc(100vh - 84px);
|
||||
}
|
||||
|
||||
// 快捷操作卡片
|
||||
.quick-action-card {
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
border: 1px solid #e4e7ed;
|
||||
|
||||
&:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
|
||||
border-color: #409EFF;
|
||||
}
|
||||
|
||||
.quick-action {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 20px;
|
||||
|
||||
.quick-icon {
|
||||
font-size: 28px;
|
||||
color: #409EFF;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
span {
|
||||
font-size: 14px;
|
||||
color: #606266;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 表格卡片
|
||||
.button-card.table-card {
|
||||
border-radius: 8px;
|
||||
border: 1px solid #e4e7ed;
|
||||
}
|
||||
|
||||
// 步骤徽章
|
||||
.step-badge {
|
||||
:deep(.el-badge__content) {
|
||||
background-color: #409EFF;
|
||||
}
|
||||
}
|
||||
|
||||
// 步骤配置卡片
|
||||
.steps-card {
|
||||
border: 1px solid #e4e7ed;
|
||||
|
||||
.steps-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
font-weight: 600;
|
||||
color: #2c3e50;
|
||||
}
|
||||
}
|
||||
|
||||
.steps-container {
|
||||
.step-item {
|
||||
margin-bottom: 16px;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.step-card {
|
||||
border: 1px solid #e4e7ed;
|
||||
|
||||
.step-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.step-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-weight: 600;
|
||||
color: #2c3e50;
|
||||
|
||||
.el-icon {
|
||||
margin-right: 8px;
|
||||
color: #409EFF;
|
||||
}
|
||||
}
|
||||
|
||||
.step-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 审批人容器
|
||||
.approvers-container {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
// 标签样式
|
||||
.mr-1 {
|
||||
margin-right: 8px;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
// 响应式设计
|
||||
@media (max-width: 768px) {
|
||||
.quick-action {
|
||||
padding: 15px;
|
||||
|
||||
.quick-icon {
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
span {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,700 @@
|
||||
<template>
|
||||
<div class="p-2 page-container">
|
||||
<!-- 快捷功能按钮 -->
|
||||
<el-row :gutter="10" class="mb-[10px]">
|
||||
<el-col :span="6">
|
||||
<el-card shadow="hover" class="quick-action-card">
|
||||
<div class="quick-action" @click="handleAdd">
|
||||
<el-icon class="quick-icon"><Plus /></el-icon>
|
||||
<span>新增申报</span>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-card shadow="hover" class="quick-action-card">
|
||||
<div class="quick-action" @click="showMyApplications">
|
||||
<el-icon class="quick-icon"><User /></el-icon>
|
||||
<span>我的申报</span>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-card shadow="hover" class="quick-action-card">
|
||||
<div class="quick-action" @click="showPendingApplications">
|
||||
<el-icon class="quick-icon"><Clock /></el-icon>
|
||||
<span>待审批</span>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-card shadow="hover" class="quick-action-card">
|
||||
<div class="quick-action" @click="showStatistics">
|
||||
<el-icon class="quick-icon"><DataAnalysis /></el-icon>
|
||||
<span>统计分析</span>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 统计卡片区域 -->
|
||||
<div class="mb-[10px]">
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="3">
|
||||
<el-card shadow="hover" class="stat-card stat-card-primary">
|
||||
<div class="stat-content">
|
||||
<div class="stat-icon">
|
||||
<el-icon><Files /></el-icon>
|
||||
</div>
|
||||
<div class="stat-info">
|
||||
<div class="stat-value">{{ statistics.totalCount }}</div>
|
||||
<div class="stat-label">申报总数</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-card shadow="hover" class="stat-card stat-card-warning">
|
||||
<div class="stat-content">
|
||||
<div class="stat-icon">
|
||||
<el-icon><Clock /></el-icon>
|
||||
</div>
|
||||
<div class="stat-info">
|
||||
<div class="stat-value">{{ statistics.approvingCount }}</div>
|
||||
<div class="stat-label">审批中</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-card shadow="hover" class="stat-card stat-card-success">
|
||||
<div class="stat-content">
|
||||
<div class="stat-icon">
|
||||
<el-icon><CircleCheck /></el-icon>
|
||||
</div>
|
||||
<div class="stat-info">
|
||||
<div class="stat-value">{{ statistics.approvedCount }}</div>
|
||||
<div class="stat-label">已通过</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-card shadow="hover" class="stat-card stat-card-danger">
|
||||
<div class="stat-content">
|
||||
<div class="stat-icon">
|
||||
<el-icon><CircleClose /></el-icon>
|
||||
</div>
|
||||
<div class="stat-info">
|
||||
<div class="stat-value">{{ statistics.rejectedCount }}</div>
|
||||
<div class="stat-label">已拒绝</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-card shadow="hover" class="stat-card stat-card-info">
|
||||
<div class="stat-content">
|
||||
<div class="stat-icon">
|
||||
<el-icon><Money /></el-icon>
|
||||
</div>
|
||||
<div class="stat-info">
|
||||
<div class="stat-value">{{ formatAmount(statistics.totalAmount) }}</div>
|
||||
<div class="stat-label">总金额(万元)</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-card shadow="hover" class="stat-card stat-card-info">
|
||||
<div class="stat-content">
|
||||
<div class="stat-icon">
|
||||
<el-icon><Timer /></el-icon>
|
||||
</div>
|
||||
<div class="stat-info">
|
||||
<div class="stat-value">{{ statistics.avgProcessDays || 0 }}</div>
|
||||
<div class="stat-label">平均周期(天)</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-card shadow="hover" class="stat-card stat-card-success">
|
||||
<div class="stat-content">
|
||||
<div class="stat-icon">
|
||||
<el-icon><TrendCharts /></el-icon>
|
||||
</div>
|
||||
<div class="stat-info">
|
||||
<div class="stat-value">{{ statistics.monthlyNew || 0 }}</div>
|
||||
<div class="stat-label">本月新增</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-card shadow="hover" class="stat-card stat-card-warning">
|
||||
<div class="stat-content">
|
||||
<div class="stat-icon">
|
||||
<el-icon><Finished /></el-icon>
|
||||
</div>
|
||||
<div class="stat-info">
|
||||
<div class="stat-value">{{ statistics.monthlyApproved || 0 }}</div>
|
||||
<div class="stat-label">本月通过</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<!-- 图表区域 -->
|
||||
<el-row :gutter="16" class="mb-[10px]">
|
||||
<!-- 月度趋势图表 -->
|
||||
<el-col :xl="16" :lg="16" :md="24" :sm="24" :xs="24">
|
||||
<el-card shadow="never" class="chart-card">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span>月度申报趋势</span>
|
||||
<el-select v-model="selectedYear" @change="handleYearChange" style="width: 120px;">
|
||||
<el-option
|
||||
v-for="year in yearOptions"
|
||||
:key="year"
|
||||
:label="year + '年'"
|
||||
:value="year"
|
||||
/>
|
||||
</el-select>
|
||||
</div>
|
||||
</template>
|
||||
<div ref="trendChart" style="height: 350px;"></div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
|
||||
<!-- 状态分布图表 -->
|
||||
<el-col :xl="8" :lg="8" :md="24" :sm="24" :xs="24">
|
||||
<el-card shadow="never" class="chart-card">
|
||||
<template #header>
|
||||
<span>状态分布</span>
|
||||
</template>
|
||||
<div ref="statusChart" style="height: 350px;"></div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 部门统计表格 -->
|
||||
<el-card shadow="never" class="table-card">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span>部门统计详情</span>
|
||||
<el-button type="primary" icon="Download" @click="handleExportDeptStatistics">导出部门统计</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<el-table
|
||||
:data="statistics.deptStatistics"
|
||||
border
|
||||
style="width: 100%"
|
||||
v-loading="statisticsLoading"
|
||||
>
|
||||
<el-table-column prop="deptName" label="部门名称" align="center" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="totalCount" label="申报数量" align="center" width="100" />
|
||||
<el-table-column prop="approvingCount" label="审批中" align="center" width="100">
|
||||
<template #default="scope">
|
||||
<el-tag type="warning" size="small">{{ scope.row.approvingCount || 0 }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="approvedCount" label="已通过" align="center" width="100">
|
||||
<template #default="scope">
|
||||
<el-tag type="success" size="small">{{ scope.row.approvedCount || 0 }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="rejectedCount" label="已拒绝" align="center" width="100">
|
||||
<template #default="scope">
|
||||
<el-tag type="danger" size="small">{{ scope.row.rejectedCount || 0 }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="totalAmount" label="总金额(万元)" align="center" width="120">
|
||||
<template #default="scope">
|
||||
<span class="amount-text">{{ formatAmount(scope.row.totalAmount) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="approvedAmount" label="已批金额(万元)" align="center" width="130">
|
||||
<template #default="scope">
|
||||
<span class="amount-text success">{{ formatAmount(scope.row.approvedAmount) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="审批率" align="center" width="100">
|
||||
<template #default="scope">
|
||||
<el-progress
|
||||
:percentage="calculateApprovalRate(scope.row)"
|
||||
:status="getProgressStatus(scope.row)"
|
||||
:show-text="false"
|
||||
/>
|
||||
<span class="rate-text">{{ calculateApprovalRate(scope.row) }}%</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="120" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="查看部门详情" placement="top">
|
||||
<el-button link type="primary" icon="View" @click="viewDepartmentDetail(scope.row)"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="导出部门数据" placement="top">
|
||||
<el-button link type="info" icon="Download" @click="exportDepartmentData(scope.row)"></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, onMounted, nextTick } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import {
|
||||
Plus, User, Clock, DataAnalysis, Files, CircleCheck, CircleClose,
|
||||
Money, Timer, TrendCharts, Finished
|
||||
} from '@element-plus/icons-vue'
|
||||
import * as echarts from 'echarts'
|
||||
import { getApplicationStatistics, getStatisticsByDept, getStatisticsByMonth } from '@/api/cw/projectApplication'
|
||||
import { parseTime } from '@/utils/ruoyi'
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
// 响应式数据
|
||||
const statistics = reactive({
|
||||
totalCount: 0,
|
||||
approvingCount: 0,
|
||||
approvedCount: 0,
|
||||
rejectedCount: 0,
|
||||
totalAmount: 0,
|
||||
avgProcessDays: 0,
|
||||
monthlyNew: 0,
|
||||
monthlyApproved: 0,
|
||||
deptStatistics: [] as any[]
|
||||
})
|
||||
|
||||
const selectedYear = ref(new Date().getFullYear())
|
||||
const yearOptions = ref<number[]>([])
|
||||
const statisticsLoading = ref(false)
|
||||
|
||||
// 图表引用
|
||||
const trendChart = ref()
|
||||
const statusChart = ref()
|
||||
let trendChartInstance: echarts.ECharts | null = null
|
||||
let statusChartInstance: echarts.ECharts | null = null
|
||||
|
||||
// 生成年份选项
|
||||
const generateYearOptions = () => {
|
||||
const currentYear = new Date().getFullYear()
|
||||
for (let i = currentYear - 4; i <= currentYear + 1; i++) {
|
||||
yearOptions.value.push(i)
|
||||
}
|
||||
}
|
||||
|
||||
// 快捷操作
|
||||
const handleAdd = () => {
|
||||
router.push('/cw/application')
|
||||
}
|
||||
|
||||
const showMyApplications = () => {
|
||||
router.push({ path: '/cw/application', query: { tab: 'my' } })
|
||||
}
|
||||
|
||||
const showPendingApplications = () => {
|
||||
router.push({ path: '/cw/application', query: { tab: 'pending' } })
|
||||
}
|
||||
|
||||
const showStatistics = () => {
|
||||
router.push('/cw/application/summary')
|
||||
}
|
||||
|
||||
// 格式化金额
|
||||
const formatAmount = (amount: number | undefined): string => {
|
||||
if (!amount) return '0.00'
|
||||
return amount.toFixed(2)
|
||||
}
|
||||
|
||||
// 计算审批率
|
||||
const calculateApprovalRate = (row: any): number => {
|
||||
if (!row.totalCount || row.totalCount === 0) return 0
|
||||
return Math.round((row.approvedCount / row.totalCount) * 100)
|
||||
}
|
||||
|
||||
// 获取进度条状态
|
||||
const getProgressStatus = (row: any): string => {
|
||||
const rate = calculateApprovalRate(row)
|
||||
if (rate >= 80) return 'success'
|
||||
if (rate >= 60) return 'warning'
|
||||
return 'exception'
|
||||
}
|
||||
|
||||
// 查看部门详情
|
||||
const viewDepartmentDetail = (row: any) => {
|
||||
router.push({
|
||||
path: '/cw/application',
|
||||
query: { deptId: row.deptId, deptName: row.deptName }
|
||||
})
|
||||
}
|
||||
|
||||
// 导出部门数据
|
||||
const exportDepartmentData = (row: any) => {
|
||||
ElMessage.success(`导出部门【${row.deptName}】数据功能开发中...`)
|
||||
}
|
||||
|
||||
// 导出部门统计
|
||||
const handleExportDeptStatistics = () => {
|
||||
ElMessage.success('导出部门统计功能开发中...')
|
||||
}
|
||||
|
||||
// 获取统计数据
|
||||
const loadStatistics = async () => {
|
||||
try {
|
||||
statisticsLoading.value = true
|
||||
const [statsRes, deptRes] = await Promise.all([
|
||||
getApplicationStatistics(selectedYear.value),
|
||||
getStatisticsByDept()
|
||||
])
|
||||
|
||||
if (statsRes.code === 200) {
|
||||
Object.assign(statistics, statsRes.data)
|
||||
}
|
||||
|
||||
if (deptRes.code === 200) {
|
||||
statistics.deptStatistics = deptRes.data || []
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取统计数据失败:', error)
|
||||
ElMessage.error('获取统计数据失败')
|
||||
} finally {
|
||||
statisticsLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 年份变化处理
|
||||
const handleYearChange = () => {
|
||||
loadStatistics()
|
||||
loadTrendChart()
|
||||
}
|
||||
|
||||
// 加载趋势图表
|
||||
const loadTrendChart = async () => {
|
||||
try {
|
||||
const response = await getStatisticsByMonth(selectedYear.value)
|
||||
if (response.code === 200) {
|
||||
renderTrendChart(response.data)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取月度统计失败:', error)
|
||||
}
|
||||
}
|
||||
|
||||
// 渲染趋势图表
|
||||
const renderTrendChart = (data: any[]) => {
|
||||
if (!trendChartInstance) return
|
||||
|
||||
const months = ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']
|
||||
const applicationCounts = new Array(12).fill(0)
|
||||
const approvedCounts = new Array(12).fill(0)
|
||||
|
||||
data.forEach(item => {
|
||||
const monthIndex = item.month - 1
|
||||
if (monthIndex >= 0 && monthIndex < 12) {
|
||||
applicationCounts[monthIndex] = item.applicationCount || 0
|
||||
approvedCounts[monthIndex] = item.approvedCount || 0
|
||||
}
|
||||
})
|
||||
|
||||
const option = {
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'cross'
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
data: ['申报数量', '通过数量']
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: months
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value'
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '申报数量',
|
||||
type: 'line',
|
||||
data: applicationCounts,
|
||||
smooth: true,
|
||||
itemStyle: { color: '#409EFF' }
|
||||
},
|
||||
{
|
||||
name: '通过数量',
|
||||
type: 'line',
|
||||
data: approvedCounts,
|
||||
smooth: true,
|
||||
itemStyle: { color: '#67C23A' }
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
trendChartInstance.setOption(option)
|
||||
}
|
||||
|
||||
// 渲染状态分布图
|
||||
const renderStatusChart = () => {
|
||||
if (!statusChartInstance) return
|
||||
|
||||
const option = {
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
formatter: '{a} <br/>{b}: {c} ({d}%)'
|
||||
},
|
||||
legend: {
|
||||
orient: 'vertical',
|
||||
left: 'left'
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '申报状态',
|
||||
type: 'pie',
|
||||
radius: ['40%', '70%'],
|
||||
data: [
|
||||
{ value: statistics.approvingCount, name: '审批中', itemStyle: { color: '#E6A23C' } },
|
||||
{ value: statistics.approvedCount, name: '已通过', itemStyle: { color: '#67C23A' } },
|
||||
{ value: statistics.rejectedCount, name: '已拒绝', itemStyle: { color: '#F56C6C' } }
|
||||
],
|
||||
emphasis: {
|
||||
itemStyle: {
|
||||
shadowBlur: 10,
|
||||
shadowOffsetX: 0,
|
||||
shadowColor: 'rgba(0, 0, 0, 0.5)'
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
statusChartInstance.setOption(option)
|
||||
}
|
||||
|
||||
// 初始化图表
|
||||
const initCharts = async () => {
|
||||
await nextTick()
|
||||
|
||||
if (trendChart.value) {
|
||||
trendChartInstance = echarts.init(trendChart.value)
|
||||
loadTrendChart()
|
||||
}
|
||||
|
||||
if (statusChart.value) {
|
||||
statusChartInstance = echarts.init(statusChart.value)
|
||||
renderStatusChart()
|
||||
}
|
||||
|
||||
// 监听窗口大小变化
|
||||
window.addEventListener('resize', () => {
|
||||
trendChartInstance?.resize()
|
||||
statusChartInstance?.resize()
|
||||
})
|
||||
}
|
||||
|
||||
// 组件挂载
|
||||
onMounted(() => {
|
||||
generateYearOptions()
|
||||
loadStatistics()
|
||||
initCharts()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.page-container {
|
||||
min-height: calc(100vh - 84px);
|
||||
}
|
||||
|
||||
// 快捷操作卡片
|
||||
.quick-action-card {
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
border: 1px solid #e4e7ed;
|
||||
|
||||
&:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
|
||||
border-color: #409EFF;
|
||||
}
|
||||
|
||||
.quick-action {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 20px;
|
||||
|
||||
.quick-icon {
|
||||
font-size: 28px;
|
||||
color: #409EFF;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
span {
|
||||
font-size: 14px;
|
||||
color: #606266;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 统计卡片
|
||||
.stat-card {
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
|
||||
&.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, #fa709a 0%, #fee140 100%);
|
||||
color: white;
|
||||
}
|
||||
|
||||
&.stat-card-danger {
|
||||
background: linear-gradient(135deg, #ff6b6b 0%, #ffa726 100%);
|
||||
color: white;
|
||||
}
|
||||
|
||||
&.stat-card-info {
|
||||
background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
|
||||
color: #2c3e50;
|
||||
}
|
||||
|
||||
:deep(.el-card__body) {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.stat-content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 20px;
|
||||
|
||||
.stat-icon {
|
||||
font-size: 32px;
|
||||
margin-right: 16px;
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.stat-info {
|
||||
.stat-value {
|
||||
font-size: 24px;
|
||||
font-weight: bold;
|
||||
line-height: 1.2;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.stat-label {
|
||||
font-size: 12px;
|
||||
opacity: 0.9;
|
||||
line-height: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 图表卡片
|
||||
.chart-card {
|
||||
border-radius: 8px;
|
||||
border: 1px solid #e4e7ed;
|
||||
|
||||
.card-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
font-weight: 600;
|
||||
color: #2c3e50;
|
||||
}
|
||||
}
|
||||
|
||||
// 表格卡片
|
||||
.table-card {
|
||||
border-radius: 8px;
|
||||
border: 1px solid #e4e7ed;
|
||||
|
||||
.card-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
font-weight: 600;
|
||||
color: #2c3e50;
|
||||
}
|
||||
|
||||
.amount-text {
|
||||
font-weight: 600;
|
||||
color: #606266;
|
||||
|
||||
&.success {
|
||||
color: #67C23A;
|
||||
}
|
||||
}
|
||||
|
||||
.rate-text {
|
||||
font-size: 12px;
|
||||
margin-left: 8px;
|
||||
color: #909399;
|
||||
}
|
||||
}
|
||||
|
||||
// 动画效果
|
||||
@keyframes fadeInUp {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateY(20px);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
.quick-action-card,
|
||||
.stat-card,
|
||||
.chart-card,
|
||||
.table-card {
|
||||
animation: fadeInUp 0.6s ease forwards;
|
||||
}
|
||||
|
||||
// 响应式设计
|
||||
@media (max-width: 768px) {
|
||||
.quick-action {
|
||||
padding: 15px;
|
||||
|
||||
.quick-icon {
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
span {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
.stat-content {
|
||||
padding: 15px;
|
||||
|
||||
.stat-icon {
|
||||
font-size: 24px;
|
||||
margin-right: 12px;
|
||||
}
|
||||
|
||||
.stat-info .stat-value {
|
||||
font-size: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,945 @@
|
||||
<template>
|
||||
<div class="p-2 page-container">
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span>{{ isEdit ? '编辑毕业生信息' : '新增毕业生信息' }}</span>
|
||||
<div class="header-actions">
|
||||
<el-button @click="goBack">返回</el-button>
|
||||
<el-button type="primary" @click="submitForm" :loading="submitLoading">
|
||||
{{ isEdit ? '更新' : '保存' }}
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
label-width="120px"
|
||||
class="graduate-form"
|
||||
>
|
||||
<!-- 基本信息 -->
|
||||
<el-card class="form-section" shadow="never">
|
||||
<template #header>
|
||||
<div class="section-header">
|
||||
<el-icon><User /></el-icon>
|
||||
<span>基本信息</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="学号" prop="studentNo">
|
||||
<el-input v-model="form.studentNo" placeholder="请输入学号" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="姓名" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入姓名" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="性别" prop="gender">
|
||||
<el-select v-model="form.gender" placeholder="请选择性别" style="width: 100%">
|
||||
<el-option v-for="dict in sys_user_sex" :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="idCard">
|
||||
<el-input v-model="form.idCard" placeholder="请输入身份证号" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="民族" prop="nation">
|
||||
<el-input v-model="form.nation" placeholder="请输入民族" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="政治面貌" prop="politicalStatus">
|
||||
<el-input v-model="form.politicalStatus" placeholder="请输入政治面貌" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="出生日期" prop="birthDate">
|
||||
<el-date-picker
|
||||
v-model="form.birthDate"
|
||||
type="date"
|
||||
placeholder="请选择出生日期"
|
||||
value-format="YYYY-MM-DD"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="手机号码" prop="phoneNumber">
|
||||
<el-input v-model="form.phoneNumber" placeholder="请输入手机号码" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="邮箱地址" prop="email">
|
||||
<el-input v-model="form.email" placeholder="请输入邮箱地址" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="QQ号码" prop="qqNumber">
|
||||
<el-input v-model="form.qqNumber" placeholder="请输入QQ号码" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="微信号码" prop="wechatNumber">
|
||||
<el-input v-model="form.wechatNumber" placeholder="请输入微信号码" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="邮政编码" prop="postalCode">
|
||||
<el-input v-model="form.postalCode" placeholder="请输入邮政编码" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="省份" prop="province">
|
||||
<el-input v-model="form.province" placeholder="请输入省份" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="城市" prop="city">
|
||||
<el-input v-model="form.city" placeholder="请输入城市" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="区县" prop="district">
|
||||
<el-input v-model="form.district" placeholder="请输入区县" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="详细地址" prop="detailAddress">
|
||||
<el-input v-model="form.detailAddress" placeholder="请输入详细地址" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
|
||||
<!-- 学籍信息 -->
|
||||
<el-card class="form-section" shadow="never">
|
||||
<template #header>
|
||||
<div class="section-header">
|
||||
<el-icon><School /></el-icon>
|
||||
<span>学籍信息</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="入学年份" prop="enrollmentYear">
|
||||
<el-date-picker
|
||||
v-model="form.enrollmentYear"
|
||||
type="year"
|
||||
placeholder="请选择入学年份"
|
||||
value-format="YYYY"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="毕业年份" prop="graduationYear">
|
||||
<el-date-picker
|
||||
v-model="form.graduationYear"
|
||||
type="year"
|
||||
placeholder="请选择毕业年份"
|
||||
value-format="YYYY"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="学历层次" prop="educationLevel">
|
||||
<el-select v-model="form.educationLevel" placeholder="请选择学历层次" style="width: 100%">
|
||||
<el-option v-for="dict in zsjy_education_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="collegeId">
|
||||
<el-select v-model="form.collegeId" placeholder="请选择学院" style="width: 100%" @change="handleCollegeChange">
|
||||
<el-option v-for="item in collegeOptions" :key="item.deptId" :label="item.deptName" :value="item.deptId" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="专业" prop="majorId">
|
||||
<el-select v-model="form.majorId" placeholder="请选择专业" style="width: 100%" @change="handleMajorChange">
|
||||
<el-option v-for="dict in majorOptions" :key="dict.value" :label="dict.label" :value="parseInt(dict.value)" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="班级名称" prop="className">
|
||||
<el-input v-model="form.className" placeholder="请输入班级名称" clearable @blur="handleClassNameChange" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="培养方式" prop="trainingMode">
|
||||
<el-input v-model="form.trainingMode" placeholder="请输入培养方式" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
|
||||
<!-- 就业信息 -->
|
||||
<el-card class="form-section" shadow="never">
|
||||
<template #header>
|
||||
<div class="section-header">
|
||||
<el-icon><Briefcase /></el-icon>
|
||||
<span>就业信息</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="就业状态" prop="employmentStatus">
|
||||
<el-select v-model="form.employmentStatus" placeholder="请选择就业状态" style="width: 100%" @change="handleEmploymentStatusChange">
|
||||
<el-option v-for="dict in zsjy_graduate_employment_status" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" v-if="showEmploymentFields">
|
||||
<el-form-item label="就业单位" prop="employmentCompany">
|
||||
<el-input v-model="form.employmentCompany" placeholder="请输入就业单位名称" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" v-if="showEmploymentFields">
|
||||
<el-form-item label="单位性质" prop="companyType">
|
||||
<el-select v-model="form.companyType" placeholder="请选择单位性质" style="width: 100%">
|
||||
<el-option v-for="dict in zsjy_graduate_company_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20" v-if="showEmploymentFields">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="工作职位" prop="jobPosition">
|
||||
<el-input v-model="form.jobPosition" placeholder="请输入工作职位" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="工作省份" prop="workProvince">
|
||||
<el-input v-model="form.workProvince" placeholder="请输入工作省份" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="工作城市" prop="workCity">
|
||||
<el-input v-model="form.workCity" placeholder="请输入工作城市" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20" v-if="showEmploymentFields">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="薪资范围" prop="salaryRange">
|
||||
<el-select v-model="form.salaryRange" placeholder="请选择薪资范围" style="width: 100%">
|
||||
<el-option v-for="dict in zsjy_graduate_salary_range" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20" v-if="showFurtherStudyFields">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="升学院校" prop="furtherSchool">
|
||||
<el-input v-model="form.furtherSchool" placeholder="请输入升学院校名称" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="升学专业" prop="furtherMajor">
|
||||
<el-input v-model="form.furtherMajor" placeholder="请输入升学专业名称" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
|
||||
<!-- 其他信息 -->
|
||||
<el-card class="form-section" shadow="never">
|
||||
<template #header>
|
||||
<div class="section-header">
|
||||
<el-icon><Document /></el-icon>
|
||||
<span>其他信息</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="特长技能" prop="skills">
|
||||
<el-input
|
||||
v-model="form.skills"
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
placeholder="请输入特长技能"
|
||||
maxlength="1000"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="获奖情况" prop="awards">
|
||||
<el-input
|
||||
v-model="form.awards"
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
placeholder="请输入获奖情况"
|
||||
maxlength="1000"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="工作意向" prop="jobIntention">
|
||||
<el-input
|
||||
v-model="form.jobIntention"
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
placeholder="请输入工作意向"
|
||||
maxlength="1000"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注信息" prop="remark">
|
||||
<el-input
|
||||
v-model="form.remark"
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
placeholder="请输入备注信息"
|
||||
maxlength="500"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="GraduateInfoForm" lang="ts">
|
||||
import { ref, reactive, computed, onMounted, getCurrentInstance } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import {
|
||||
getGraduateInfo,
|
||||
addGraduateInfo,
|
||||
updateGraduateInfo,
|
||||
checkStudentNoUnique,
|
||||
checkIdCardUnique
|
||||
} from '@/api/zsjy/graduateInfo';
|
||||
import { GraduateInfoForm } from '@/api/zsjy/types';
|
||||
import { getDicts } from '@/api/system/dict/data';
|
||||
import { listDept } from '@/api/system/dept';
|
||||
import { DeptVO } from '@/api/system/dept/types';
|
||||
|
||||
const { proxy } = getCurrentInstance() as any;
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
|
||||
// 直接声明字典数据为响应式变量
|
||||
const sys_user_sex = ref([]);
|
||||
const zsjy_education_level = ref([]);
|
||||
const zsjy_graduate_employment_status = ref([]);
|
||||
const zsjy_graduate_company_type = ref([]);
|
||||
const zsjy_graduate_salary_range = ref([]);
|
||||
|
||||
// 学院和专业数据(参考招生信息管理页面)
|
||||
const collegeOptions = ref<DeptVO[]>([]);
|
||||
const majorOptionsByCollege = ref<{[key: string]: DeptVO[]}>({});
|
||||
const majorOptions = ref<Array<{ value: string, label: string, majorCode: string }>>([]);
|
||||
|
||||
// 加载字典数据的函数
|
||||
const loadDictData = async () => {
|
||||
try {
|
||||
console.log('开始加载字典数据...');
|
||||
|
||||
// 性别字典
|
||||
const sexResp = await getDicts('sys_user_sex');
|
||||
if (sexResp?.data) {
|
||||
sys_user_sex.value = sexResp.data.map(item => ({
|
||||
label: item.dictLabel,
|
||||
value: item.dictValue
|
||||
}));
|
||||
console.log('性别字典数据:', sys_user_sex.value);
|
||||
}
|
||||
|
||||
// 学历层次
|
||||
const eduResp = await getDicts('zsjy_education_level');
|
||||
if (eduResp?.data) {
|
||||
zsjy_education_level.value = eduResp.data.map(item => ({
|
||||
label: item.dictLabel,
|
||||
value: item.dictValue
|
||||
}));
|
||||
console.log('学历层次数据:', zsjy_education_level.value);
|
||||
}
|
||||
|
||||
// 就业状态
|
||||
const empResp = await getDicts('zsjy_graduate_employment_status');
|
||||
if (empResp?.data) {
|
||||
zsjy_graduate_employment_status.value = empResp.data.map(item => ({
|
||||
label: item.dictLabel,
|
||||
value: item.dictValue
|
||||
}));
|
||||
console.log('就业状态数据:', zsjy_graduate_employment_status.value);
|
||||
}
|
||||
|
||||
// 单位性质
|
||||
const compResp = await getDicts('zsjy_graduate_company_type');
|
||||
if (compResp?.data) {
|
||||
zsjy_graduate_company_type.value = compResp.data.map(item => ({
|
||||
label: item.dictLabel,
|
||||
value: item.dictValue
|
||||
}));
|
||||
console.log('单位性质数据:', zsjy_graduate_company_type.value);
|
||||
}
|
||||
|
||||
// 月薪范围
|
||||
const salaryResp = await getDicts('zsjy_graduate_salary_range');
|
||||
if (salaryResp?.data) {
|
||||
zsjy_graduate_salary_range.value = salaryResp.data.map(item => ({
|
||||
label: item.dictLabel,
|
||||
value: item.dictValue
|
||||
}));
|
||||
console.log('月薪范围数据:', zsjy_graduate_salary_range.value);
|
||||
}
|
||||
|
||||
console.log('字典数据加载完成');
|
||||
} catch (error) {
|
||||
console.error('加载字典数据失败:', error);
|
||||
}
|
||||
};
|
||||
|
||||
// 获取学院和专业数据(参考招生信息管理页面实现)
|
||||
const getCollegeAndMajorData = async () => {
|
||||
try {
|
||||
console.log('开始加载学院和专业数据...');
|
||||
|
||||
// 获取所有部门数据
|
||||
const res = await listDept();
|
||||
|
||||
if (res.code === 200 && res.data) {
|
||||
// 找出学院 - 类别编码以xy开头的部门
|
||||
const colleges = res.data.filter((dept: DeptVO) => {
|
||||
return dept.deptCategory && dept.deptCategory.startsWith('xy');
|
||||
});
|
||||
|
||||
collegeOptions.value = colleges;
|
||||
console.log('获取到的学院数据:', colleges.map(c => ({
|
||||
deptId: c.deptId,
|
||||
deptName: c.deptName,
|
||||
deptCategory: c.deptCategory
|
||||
})));
|
||||
|
||||
// 如果没有找到学院数据,尝试其他可能的过滤条件
|
||||
if (colleges.length === 0) {
|
||||
console.log('未找到xy开头的学院,尝试其他可能的部门...');
|
||||
const possibleColleges = res.data.filter((dept: DeptVO) => {
|
||||
return !dept.isLeaf;
|
||||
});
|
||||
|
||||
if (possibleColleges.length > 0) {
|
||||
collegeOptions.value = possibleColleges;
|
||||
console.log('找到可能的学院:', possibleColleges.map(c => ({
|
||||
deptId: c.deptId,
|
||||
deptName: c.deptName,
|
||||
deptCategory: c.deptCategory
|
||||
})));
|
||||
}
|
||||
}
|
||||
|
||||
// 找出专业 - 类别编码以zy开头的部门
|
||||
const allMajors = res.data.filter((dept: DeptVO) => {
|
||||
return dept.deptCategory && dept.deptCategory.startsWith('zy');
|
||||
});
|
||||
|
||||
console.log('获取到的所有专业数据:', allMajors.length);
|
||||
|
||||
// 按照上下级关系组织专业
|
||||
colleges.forEach((college: DeptVO) => {
|
||||
// 找出该学院下的所有专业
|
||||
const majors = allMajors.filter((dept: DeptVO) =>
|
||||
dept.parentId === college.deptId
|
||||
);
|
||||
|
||||
majorOptionsByCollege.value[college.deptId] = majors;
|
||||
if (majors.length > 0) {
|
||||
console.log(`学院 ${college.deptName} 的专业数量: ${majors.length}`);
|
||||
}
|
||||
});
|
||||
|
||||
return {
|
||||
success: true,
|
||||
collegeCount: collegeOptions.value.length
|
||||
};
|
||||
} else {
|
||||
console.error('部门数据返回异常:', res);
|
||||
return {
|
||||
success: false,
|
||||
error: '部门数据返回异常'
|
||||
};
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取部门数据出错:', error);
|
||||
proxy.$modal.msgError('获取学院和专业数据失败');
|
||||
return {
|
||||
success: false,
|
||||
error: error
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
// 响应式数据
|
||||
const formRef = ref();
|
||||
const submitLoading = ref(false);
|
||||
|
||||
// 判断是否为编辑模式
|
||||
const isEdit = computed(() => !!route.params.id);
|
||||
|
||||
// 表单数据
|
||||
const form = reactive<GraduateInfoForm>({
|
||||
id: undefined,
|
||||
studentNo: '',
|
||||
name: '',
|
||||
gender: '',
|
||||
idCard: '',
|
||||
nation: '',
|
||||
politicalStatus: '',
|
||||
birthDate: '',
|
||||
enrollmentYear: undefined,
|
||||
graduationYear: undefined,
|
||||
collegeId: undefined,
|
||||
collegeName: '',
|
||||
majorId: undefined,
|
||||
majorName: '',
|
||||
classId: 1, // 临时设置默认班级ID,避免验证失败
|
||||
className: '',
|
||||
educationLevel: '',
|
||||
trainingMode: '',
|
||||
phoneNumber: '',
|
||||
email: '',
|
||||
qqNumber: '',
|
||||
wechatNumber: '',
|
||||
province: '',
|
||||
city: '',
|
||||
district: '',
|
||||
detailAddress: '',
|
||||
postalCode: '',
|
||||
employmentStatus: '',
|
||||
employmentCompany: '',
|
||||
companyType: '',
|
||||
jobPosition: '',
|
||||
workProvince: '',
|
||||
workCity: '',
|
||||
salaryRange: '',
|
||||
furtherSchool: '',
|
||||
furtherMajor: '',
|
||||
skills: '',
|
||||
awards: '',
|
||||
jobIntention: '',
|
||||
remark: ''
|
||||
});
|
||||
|
||||
// 就业相关字段显示控制
|
||||
const showEmploymentFields = computed(() => {
|
||||
return ['1', '2', '3'].includes(form.employmentStatus); // 已就业、自主创业
|
||||
});
|
||||
|
||||
// 升学相关字段显示控制
|
||||
const showFurtherStudyFields = computed(() => {
|
||||
return ['4', '5'].includes(form.employmentStatus); // 升学
|
||||
});
|
||||
|
||||
/** 处理专业选择变化 */
|
||||
const handleMajorChange = (value) => {
|
||||
console.log('专业选择变化:', value);
|
||||
form.majorId = value;
|
||||
|
||||
// 查找对应的专业名称
|
||||
const selectedMajor = majorOptions.value.find(item => parseInt(item.value) === value);
|
||||
if (selectedMajor) {
|
||||
form.majorName = selectedMajor.label;
|
||||
console.log('设置专业名称:', selectedMajor.label);
|
||||
}
|
||||
};
|
||||
|
||||
/** 处理班级名称输入变化 */
|
||||
const handleClassNameChange = () => {
|
||||
// 临时处理:如果用户输入了班级名称,确保classId有值
|
||||
if (form.className && form.className.trim() !== '') {
|
||||
if (!form.classId || form.classId === 1) {
|
||||
// 生成一个临时的班级ID(基于时间戳)
|
||||
form.classId = Date.now();
|
||||
console.log('设置临时班级ID:', form.classId, '班级名称:', form.className);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/** 处理学院选择变化(参考招生信息管理页面实现) */
|
||||
const handleCollegeChange = (selectedCollegeId: string) => {
|
||||
console.log('学院选择变化:', selectedCollegeId);
|
||||
|
||||
if (selectedCollegeId) {
|
||||
// 根据选择的学院ID找到学院对象
|
||||
const college = collegeOptions.value.find(item => item.deptId == selectedCollegeId);
|
||||
if (college) {
|
||||
// 正确设置:
|
||||
// - collegeId: 使用部门ID作为学院ID
|
||||
// - collegeName: 使用部门名称作为学院名称
|
||||
form.collegeId = selectedCollegeId;
|
||||
form.collegeName = college.deptName;
|
||||
|
||||
// 更新专业选项
|
||||
const majors = majorOptionsByCollege.value[selectedCollegeId] || [];
|
||||
majorOptions.value = majors.map(major => ({
|
||||
value: major.deptId.toString(),
|
||||
label: major.deptName,
|
||||
majorCode: major.deptCategory || ''
|
||||
}));
|
||||
|
||||
// 清空专业选择
|
||||
form.majorId = undefined;
|
||||
form.majorName = '';
|
||||
|
||||
console.log(`学院变更 - ID:${selectedCollegeId}, 名称:${college.deptName}, 代码:${college.deptCategory}`);
|
||||
console.log(`加载专业数量: ${majors.length}`);
|
||||
}
|
||||
} else {
|
||||
// 清空学院和专业相关字段
|
||||
form.collegeName = '';
|
||||
form.collegeId = undefined;
|
||||
form.majorId = undefined;
|
||||
form.majorName = '';
|
||||
majorOptions.value = [];
|
||||
}
|
||||
};
|
||||
|
||||
/** 获取毕业生信息详情 */
|
||||
const getGraduateDetail = async () => {
|
||||
const graduateId = route.params.id as string;
|
||||
try {
|
||||
const response = await getGraduateInfo(graduateId);
|
||||
const data = response.data;
|
||||
|
||||
// 处理年份字段
|
||||
if (data.enrollmentYear) {
|
||||
data.enrollmentYear = data.enrollmentYear.toString();
|
||||
}
|
||||
if (data.graduationYear) {
|
||||
data.graduationYear = data.graduationYear.toString();
|
||||
}
|
||||
|
||||
Object.assign(form, data);
|
||||
|
||||
// 设置学院和专业
|
||||
if (data.collegeId) {
|
||||
form.collegeId = data.collegeId;
|
||||
form.collegeName = collegeOptions.value.find(item => item.deptId === data.collegeId)?.deptName || '';
|
||||
console.log('设置学院名称:', form.collegeName);
|
||||
|
||||
// 根据选中的学院加载专业
|
||||
if (data.collegeId) {
|
||||
const majors = majorOptionsByCollege.value[data.collegeId];
|
||||
if (majors && majors.length > 0) {
|
||||
majorOptions.value = majors.map(item => ({
|
||||
label: item.deptName,
|
||||
value: item.deptId,
|
||||
majorCode: item.deptCode // 假设部门编码就是专业编码
|
||||
}));
|
||||
console.log('加载专业数据:', majorOptions.value);
|
||||
} else {
|
||||
console.log('未找到该学院的专业数据');
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
proxy.$modal.msgError('获取毕业生信息失败');
|
||||
goBack();
|
||||
}
|
||||
};
|
||||
|
||||
/** 就业状态变化处理 */
|
||||
const handleEmploymentStatusChange = (value: string) => {
|
||||
// 清空相关字段
|
||||
if (!showEmploymentFields.value) {
|
||||
form.employmentCompany = '';
|
||||
form.companyType = '';
|
||||
form.jobPosition = '';
|
||||
form.workProvince = '';
|
||||
form.workCity = '';
|
||||
form.salaryRange = '';
|
||||
}
|
||||
|
||||
if (!showFurtherStudyFields.value) {
|
||||
form.furtherSchool = '';
|
||||
form.furtherMajor = '';
|
||||
}
|
||||
};
|
||||
|
||||
// 学号唯一性验证
|
||||
const validateStudentNo = async (rule: any, value: string, callback: any) => {
|
||||
if (!value) {
|
||||
callback();
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await checkStudentNoUnique(value, form.id);
|
||||
if (!response.data) {
|
||||
callback(new Error('学号已存在'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
} catch (error) {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
|
||||
// 身份证号唯一性验证
|
||||
const validateIdCard = async (rule: any, value: string, callback: any) => {
|
||||
if (!value) {
|
||||
callback();
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await checkIdCardUnique(value, form.id);
|
||||
if (!response.data) {
|
||||
callback(new Error('身份证号已存在'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
} catch (error) {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
|
||||
// 毕业年份验证
|
||||
const validateGraduationYear = (rule: any, value: any, callback: any) => {
|
||||
if (!value || !form.enrollmentYear) {
|
||||
callback();
|
||||
return;
|
||||
}
|
||||
|
||||
const enrollmentYear = parseInt(form.enrollmentYear.toString());
|
||||
const graduationYear = parseInt(value.toString());
|
||||
|
||||
if (graduationYear <= enrollmentYear) {
|
||||
callback(new Error('毕业年份必须大于入学年份'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
|
||||
// 表单验证规则
|
||||
const rules = reactive({
|
||||
studentNo: [
|
||||
{ required: true, message: '学号不能为空', trigger: 'blur' },
|
||||
{ min: 1, max: 50, message: '学号长度在 1 到 50 个字符', trigger: 'blur' },
|
||||
{ validator: validateStudentNo, trigger: 'blur' }
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: '姓名不能为空', trigger: 'blur' },
|
||||
{ min: 1, max: 30, message: '姓名长度在 1 到 30 个字符', trigger: 'blur' }
|
||||
],
|
||||
gender: [
|
||||
{ required: true, message: '性别不能为空', trigger: 'change' }
|
||||
],
|
||||
idCard: [
|
||||
{ required: true, message: '身份证号不能为空', trigger: 'blur' },
|
||||
{ pattern: /^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/, message: '身份证号格式不正确', trigger: 'blur' },
|
||||
{ validator: validateIdCard, trigger: 'blur' }
|
||||
],
|
||||
enrollmentYear: [
|
||||
{ required: true, message: '入学年份不能为空', trigger: 'change' }
|
||||
],
|
||||
graduationYear: [
|
||||
{ required: true, message: '毕业年份不能为空', trigger: 'change' },
|
||||
{ validator: validateGraduationYear, trigger: 'change' }
|
||||
],
|
||||
collegeId: [
|
||||
{ required: true, message: '学院名称不能为空', trigger: 'change' }
|
||||
],
|
||||
majorId: [
|
||||
{ required: true, message: '专业不能为空', trigger: 'change' }
|
||||
],
|
||||
className: [
|
||||
{ required: true, message: '班级名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
educationLevel: [
|
||||
{ required: true, message: '学历层次不能为空', trigger: 'change' }
|
||||
],
|
||||
phoneNumber: [
|
||||
{ required: true, message: '手机号码不能为空', trigger: 'blur' },
|
||||
{ pattern: /^1[3-9]\d{9}$/, message: '手机号码格式不正确', trigger: 'blur' }
|
||||
],
|
||||
email: [
|
||||
{ type: 'email', message: '邮箱格式不正确', trigger: 'blur' }
|
||||
],
|
||||
employmentStatus: [
|
||||
{ required: true, message: '就业状态不能为空', trigger: 'change' }
|
||||
]
|
||||
});
|
||||
|
||||
/** 提交表单 */
|
||||
const submitForm = async () => {
|
||||
const valid = await formRef.value.validate();
|
||||
if (!valid) return;
|
||||
submitLoading.value = true;
|
||||
|
||||
try {
|
||||
// 处理年份字段
|
||||
const submitData = { ...form };
|
||||
|
||||
// 🔍 详细的字段检查 - 帮助定位问题
|
||||
console.log('=== 提交前字段检查 ===');
|
||||
console.log('studentNo:', submitData.studentNo, typeof submitData.studentNo);
|
||||
console.log('name:', submitData.name, typeof submitData.name);
|
||||
console.log('gender:', submitData.gender, typeof submitData.gender);
|
||||
console.log('idCard:', submitData.idCard, typeof submitData.idCard);
|
||||
console.log('enrollmentYear:', submitData.enrollmentYear, typeof submitData.enrollmentYear);
|
||||
console.log('graduationYear:', submitData.graduationYear, typeof submitData.graduationYear);
|
||||
console.log('collegeId:', submitData.collegeId, typeof submitData.collegeId);
|
||||
console.log('majorId:', submitData.majorId, typeof submitData.majorId);
|
||||
console.log('classId:', submitData.classId, typeof submitData.classId);
|
||||
console.log('educationLevel:', submitData.educationLevel, typeof submitData.educationLevel);
|
||||
console.log('phoneNumber:', submitData.phoneNumber, typeof submitData.phoneNumber);
|
||||
console.log('employmentStatus:', submitData.employmentStatus, typeof submitData.employmentStatus);
|
||||
console.log('========================');
|
||||
|
||||
if (submitData.enrollmentYear) {
|
||||
submitData.enrollmentYear = parseInt(submitData.enrollmentYear.toString());
|
||||
}
|
||||
if (submitData.graduationYear) {
|
||||
submitData.graduationYear = parseInt(submitData.graduationYear.toString());
|
||||
}
|
||||
|
||||
console.log('提交数据:', submitData);
|
||||
|
||||
if (isEdit.value) {
|
||||
await updateGraduateInfo(submitData);
|
||||
proxy.$modal.msgSuccess('修改成功');
|
||||
} else {
|
||||
await addGraduateInfo(submitData);
|
||||
proxy.$modal.msgSuccess('新增成功');
|
||||
}
|
||||
|
||||
goBack();
|
||||
} catch (error) {
|
||||
console.error('提交失败:', error);
|
||||
proxy.$modal.msgError(isEdit.value ? '修改失败' : '新增失败');
|
||||
} finally {
|
||||
submitLoading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
/** 返回上一页 */
|
||||
const goBack = () => {
|
||||
router.push('/zsjy/graduate/info');
|
||||
};
|
||||
|
||||
// 页面初始化
|
||||
onMounted(() => {
|
||||
// 加载字典数据
|
||||
loadDictData();
|
||||
// 加载学院和专业数据
|
||||
getCollegeAndMajorData();
|
||||
|
||||
if (isEdit.value) {
|
||||
getGraduateDetail();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.page-container {
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
.card-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
|
||||
.header-actions {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
.graduate-form {
|
||||
.form-section {
|
||||
margin-bottom: 20px;
|
||||
border: 1px solid #e8e8e8;
|
||||
border-radius: 8px;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.section-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
|
||||
.el-icon {
|
||||
margin-right: 8px;
|
||||
font-size: 18px;
|
||||
color: #409eff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.el-form-item__label) {
|
||||
font-weight: 500;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
:deep(.el-card__header) {
|
||||
background-color: #f8f9fa;
|
||||
border-bottom: 1px solid #e8e8e8;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,985 @@
|
||||
<template>
|
||||
<div class="p-2 page-container">
|
||||
<!-- 筛选条件 -->
|
||||
<el-card shadow="hover" class="mb-[10px]">
|
||||
<el-form :model="queryParams" label-width="100px" inline>
|
||||
<el-form-item label="毕业年份">
|
||||
<el-date-picker
|
||||
v-model="queryParams.graduationYear"
|
||||
type="year"
|
||||
placeholder="请选择毕业年份"
|
||||
value-format="YYYY"
|
||||
clearable
|
||||
@change="handleQuery"
|
||||
style="width: 200px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">查询</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
<el-button @click="goBack">返回</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<!-- 统计概览 -->
|
||||
<div class="mb-[10px]">
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="4">
|
||||
<el-card shadow="hover" class="stat-card stat-card-primary">
|
||||
<div class="stat-content">
|
||||
<div class="stat-icon">
|
||||
<el-icon><User /></el-icon>
|
||||
</div>
|
||||
<div class="stat-info">
|
||||
<div class="stat-value">{{ overallStats.total || 0 }}</div>
|
||||
<div class="stat-label">总人数</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-card shadow="hover" class="stat-card stat-card-success">
|
||||
<div class="stat-content">
|
||||
<div class="stat-icon">
|
||||
<el-icon><CircleCheck /></el-icon>
|
||||
</div>
|
||||
<div class="stat-info">
|
||||
<div class="stat-value">{{ overallStats.employmentCount || 0 }}</div>
|
||||
<div class="stat-label">已就业</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-card shadow="hover" class="stat-card stat-card-info">
|
||||
<div class="stat-content">
|
||||
<div class="stat-icon">
|
||||
<el-icon><Reading /></el-icon>
|
||||
</div>
|
||||
<div class="stat-info">
|
||||
<div class="stat-value">{{ overallStats.furtherStudyCount || 0 }}</div>
|
||||
<div class="stat-label">升学深造</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-card shadow="hover" class="stat-card stat-card-warning">
|
||||
<div class="stat-content">
|
||||
<div class="stat-icon">
|
||||
<el-icon><Clock /></el-icon>
|
||||
</div>
|
||||
<div class="stat-info">
|
||||
<div class="stat-value">{{ overallStats.unemploymentCount || 0 }}</div>
|
||||
<div class="stat-label">待就业</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-card shadow="hover" class="stat-card stat-card-success">
|
||||
<div class="stat-content">
|
||||
<div class="stat-icon">
|
||||
<el-icon><TrendCharts /></el-icon>
|
||||
</div>
|
||||
<div class="stat-info">
|
||||
<div class="stat-value">{{ overallStats.employmentRate || 0 }}%</div>
|
||||
<div class="stat-label">就业率</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-card shadow="hover" class="stat-card stat-card-info">
|
||||
<div class="stat-content">
|
||||
<div class="stat-icon">
|
||||
<el-icon><StarFilled /></el-icon>
|
||||
</div>
|
||||
<div class="stat-info">
|
||||
<div class="stat-value">{{ overallStats.furtherStudyRate || 0 }}%</div>
|
||||
<div class="stat-label">升学率</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<!-- 图表区域 -->
|
||||
<el-row :gutter="16">
|
||||
<!-- 就业状态分布 -->
|
||||
<el-col :span="12">
|
||||
<el-card shadow="never" class="chart-card">
|
||||
<template #header>
|
||||
<div class="chart-header">
|
||||
<span>就业状态分布</span>
|
||||
<el-button text type="primary" @click="exportChart('employment')">
|
||||
<el-icon><Download /></el-icon>
|
||||
导出
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
<div ref="employmentChartRef" class="chart-container"></div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
|
||||
<!-- 单位性质分布 -->
|
||||
<el-col :span="12">
|
||||
<el-card shadow="never" class="chart-card">
|
||||
<template #header>
|
||||
<div class="chart-header">
|
||||
<span>单位性质分布</span>
|
||||
<el-button text type="primary" @click="exportChart('company')">
|
||||
<el-icon><Download /></el-icon>
|
||||
导出
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
<div ref="companyChartRef" class="chart-container"></div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="16" class="mt-[16px]">
|
||||
<!-- 薪资范围分布 -->
|
||||
<el-col :span="12">
|
||||
<el-card shadow="never" class="chart-card">
|
||||
<template #header>
|
||||
<div class="chart-header">
|
||||
<span>薪资范围分布</span>
|
||||
<el-button text type="primary" @click="exportChart('salary')">
|
||||
<el-icon><Download /></el-icon>
|
||||
导出
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
<div ref="salaryChartRef" class="chart-container"></div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
|
||||
<!-- 地域分布 -->
|
||||
<el-col :span="12">
|
||||
<el-card shadow="never" class="chart-card">
|
||||
<template #header>
|
||||
<div class="chart-header">
|
||||
<span>地域分布 (TOP 10)</span>
|
||||
<el-button text type="primary" @click="exportChart('region')">
|
||||
<el-icon><Download /></el-icon>
|
||||
导出
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
<div ref="regionChartRef" class="chart-container"></div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="16" class="mt-[16px]">
|
||||
<!-- 学院就业情况 -->
|
||||
<el-col :span="12">
|
||||
<el-card shadow="never" class="chart-card">
|
||||
<template #header>
|
||||
<div class="chart-header">
|
||||
<span>各学院就业情况</span>
|
||||
<el-button text type="primary" @click="exportChart('college')">
|
||||
<el-icon><Download /></el-icon>
|
||||
导出
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
<div ref="collegeChartRef" class="chart-container"></div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
|
||||
<!-- 历年就业趋势 -->
|
||||
<el-col :span="12">
|
||||
<el-card shadow="never" class="chart-card">
|
||||
<template #header>
|
||||
<div class="chart-header">
|
||||
<span>历年就业趋势</span>
|
||||
<el-button text type="primary" @click="exportChart('year')">
|
||||
<el-icon><Download /></el-icon>
|
||||
导出
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
<div ref="yearChartRef" class="chart-container"></div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 专业就业排行榜 -->
|
||||
<el-row class="mt-[16px]">
|
||||
<el-col :span="24">
|
||||
<el-card shadow="never" class="chart-card">
|
||||
<template #header>
|
||||
<div class="chart-header">
|
||||
<span>专业就业排行榜</span>
|
||||
<el-button text type="primary" @click="exportChart('major')">
|
||||
<el-icon><Download /></el-icon>
|
||||
导出
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
<div ref="majorChartRef" class="chart-container chart-container-large"></div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="GraduateStatistics" lang="ts">
|
||||
import { ref, reactive, onMounted, onUnmounted, nextTick, getCurrentInstance } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import * as echarts from 'echarts';
|
||||
import {
|
||||
getOverallStatistics,
|
||||
getStatisticsByEmploymentStatus,
|
||||
getStatisticsByCompanyType,
|
||||
getStatisticsBySalaryRange,
|
||||
getStatisticsByRegion,
|
||||
getStatisticsByCollege,
|
||||
getStatisticsByMajor,
|
||||
getStatisticsByYear
|
||||
} from '@/api/zsjy/graduateInfo';
|
||||
import { GraduateStatisticsVO } from '@/api/zsjy/types';
|
||||
|
||||
const { proxy } = getCurrentInstance() as any;
|
||||
const router = useRouter();
|
||||
|
||||
// 图表引用
|
||||
const employmentChartRef = ref();
|
||||
const companyChartRef = ref();
|
||||
const salaryChartRef = ref();
|
||||
const regionChartRef = ref();
|
||||
const collegeChartRef = ref();
|
||||
const majorChartRef = ref();
|
||||
const yearChartRef = ref();
|
||||
|
||||
// 图表实例
|
||||
let employmentChart: echarts.ECharts;
|
||||
let companyChart: echarts.ECharts;
|
||||
let salaryChart: echarts.ECharts;
|
||||
let regionChart: echarts.ECharts;
|
||||
let collegeChart: echarts.ECharts;
|
||||
let majorChart: echarts.ECharts;
|
||||
let yearChart: echarts.ECharts;
|
||||
|
||||
// 响应式数据
|
||||
const overallStats = ref<GraduateStatisticsVO>({});
|
||||
|
||||
// 查询参数
|
||||
const queryParams = reactive({
|
||||
graduationYear: undefined as number | undefined
|
||||
});
|
||||
|
||||
// 图表颜色配置
|
||||
const chartColors = [
|
||||
'#5470C6', '#91CC75', '#FAC858', '#EE6666', '#73C0DE',
|
||||
'#3BA272', '#FC8452', '#9A60B4', '#EA7CCC', '#F89898'
|
||||
];
|
||||
|
||||
/** 获取统计数据 */
|
||||
const getStatisticsData = async () => {
|
||||
try {
|
||||
// 获取总体统计
|
||||
const overallResponse = await getOverallStatistics();
|
||||
overallStats.value = overallResponse.data;
|
||||
|
||||
// 获取各维度统计数据并绘制图表
|
||||
await Promise.all([
|
||||
initEmploymentChart(),
|
||||
initCompanyChart(),
|
||||
initSalaryChart(),
|
||||
initRegionChart(),
|
||||
initCollegeChart(),
|
||||
initMajorChart(),
|
||||
initYearChart()
|
||||
]);
|
||||
} catch (error) {
|
||||
proxy.$modal.msgError('获取统计数据失败');
|
||||
}
|
||||
};
|
||||
|
||||
/** 初始化就业状态分布图表 */
|
||||
const initEmploymentChart = async () => {
|
||||
try {
|
||||
const response = await getStatisticsByEmploymentStatus(queryParams.graduationYear);
|
||||
const data = response.data;
|
||||
|
||||
if (!employmentChart) {
|
||||
employmentChart = echarts.init(employmentChartRef.value);
|
||||
}
|
||||
|
||||
const option = {
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
formatter: '{a} <br/>{b}: {c} ({d}%)'
|
||||
},
|
||||
legend: {
|
||||
bottom: 10,
|
||||
left: 'center'
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '就业状态',
|
||||
type: 'pie',
|
||||
radius: ['40%', '70%'],
|
||||
center: ['50%', '45%'],
|
||||
data: data.map((item: GraduateStatisticsVO) => ({
|
||||
value: item.value,
|
||||
name: item.name
|
||||
})),
|
||||
emphasis: {
|
||||
itemStyle: {
|
||||
shadowBlur: 10,
|
||||
shadowOffsetX: 0,
|
||||
shadowColor: 'rgba(0, 0, 0, 0.5)'
|
||||
}
|
||||
},
|
||||
itemStyle: {
|
||||
borderRadius: 8,
|
||||
borderColor: '#fff',
|
||||
borderWidth: 2
|
||||
}
|
||||
}
|
||||
],
|
||||
color: chartColors
|
||||
};
|
||||
|
||||
employmentChart.setOption(option);
|
||||
} catch (error) {
|
||||
console.error('获取就业状态统计失败:', error);
|
||||
}
|
||||
};
|
||||
|
||||
/** 初始化单位性质分布图表 */
|
||||
const initCompanyChart = async () => {
|
||||
try {
|
||||
const response = await getStatisticsByCompanyType(queryParams.graduationYear);
|
||||
const data = response.data;
|
||||
|
||||
if (!companyChart) {
|
||||
companyChart = echarts.init(companyChartRef.value);
|
||||
}
|
||||
|
||||
const option = {
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
formatter: '{a} <br/>{b}: {c} ({d}%)'
|
||||
},
|
||||
legend: {
|
||||
bottom: 10,
|
||||
left: 'center'
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '单位性质',
|
||||
type: 'pie',
|
||||
radius: ['40%', '70%'],
|
||||
center: ['50%', '45%'],
|
||||
data: data.map((item: GraduateStatisticsVO) => ({
|
||||
value: item.value,
|
||||
name: item.name
|
||||
})),
|
||||
emphasis: {
|
||||
itemStyle: {
|
||||
shadowBlur: 10,
|
||||
shadowOffsetX: 0,
|
||||
shadowColor: 'rgba(0, 0, 0, 0.5)'
|
||||
}
|
||||
},
|
||||
itemStyle: {
|
||||
borderRadius: 8,
|
||||
borderColor: '#fff',
|
||||
borderWidth: 2
|
||||
}
|
||||
}
|
||||
],
|
||||
color: chartColors
|
||||
};
|
||||
|
||||
companyChart.setOption(option);
|
||||
} catch (error) {
|
||||
console.error('获取单位性质统计失败:', error);
|
||||
}
|
||||
};
|
||||
|
||||
/** 初始化薪资范围分布图表 */
|
||||
const initSalaryChart = async () => {
|
||||
try {
|
||||
const response = await getStatisticsBySalaryRange(queryParams.graduationYear);
|
||||
const data = response.data;
|
||||
|
||||
if (!salaryChart) {
|
||||
salaryChart = echarts.init(salaryChartRef.value);
|
||||
}
|
||||
|
||||
const option = {
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'shadow'
|
||||
}
|
||||
},
|
||||
grid: {
|
||||
left: '3%',
|
||||
right: '4%',
|
||||
bottom: '3%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: data.map((item: GraduateStatisticsVO) => item.name),
|
||||
axisTick: {
|
||||
alignWithLabel: true
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value'
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '人数',
|
||||
type: 'bar',
|
||||
barWidth: '60%',
|
||||
data: data.map((item: GraduateStatisticsVO) => item.value),
|
||||
itemStyle: {
|
||||
borderRadius: [4, 4, 0, 0],
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{ offset: 0, color: '#83bff6' },
|
||||
{ offset: 0.5, color: '#188df0' },
|
||||
{ offset: 1, color: '#188df0' }
|
||||
])
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
salaryChart.setOption(option);
|
||||
} catch (error) {
|
||||
console.error('获取薪资范围统计失败:', error);
|
||||
}
|
||||
};
|
||||
|
||||
/** 初始化地域分布图表 */
|
||||
const initRegionChart = async () => {
|
||||
try {
|
||||
const response = await getStatisticsByRegion(queryParams.graduationYear);
|
||||
const data = response.data.slice(0, 10); // 只显示TOP 10
|
||||
|
||||
if (!regionChart) {
|
||||
regionChart = echarts.init(regionChartRef.value);
|
||||
}
|
||||
|
||||
const option = {
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'shadow'
|
||||
}
|
||||
},
|
||||
grid: {
|
||||
left: '3%',
|
||||
right: '4%',
|
||||
bottom: '3%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: {
|
||||
type: 'value'
|
||||
},
|
||||
yAxis: {
|
||||
type: 'category',
|
||||
data: data.map((item: GraduateStatisticsVO) => item.name),
|
||||
axisTick: {
|
||||
alignWithLabel: true
|
||||
}
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '人数',
|
||||
type: 'bar',
|
||||
barWidth: '60%',
|
||||
data: data.map((item: GraduateStatisticsVO) => item.value),
|
||||
itemStyle: {
|
||||
borderRadius: [0, 4, 4, 0],
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [
|
||||
{ offset: 0, color: '#ffecd2' },
|
||||
{ offset: 0.5, color: '#fcb69f' },
|
||||
{ offset: 1, color: '#fcb69f' }
|
||||
])
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
regionChart.setOption(option);
|
||||
} catch (error) {
|
||||
console.error('获取地域分布统计失败:', error);
|
||||
}
|
||||
};
|
||||
|
||||
/** 初始化学院就业情况图表 */
|
||||
const initCollegeChart = async () => {
|
||||
try {
|
||||
const response = await getStatisticsByCollege(queryParams.graduationYear);
|
||||
const data = response.data;
|
||||
|
||||
if (!collegeChart) {
|
||||
collegeChart = echarts.init(collegeChartRef.value);
|
||||
}
|
||||
|
||||
const option = {
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'cross',
|
||||
crossStyle: {
|
||||
color: '#999'
|
||||
}
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
data: ['总人数', '就业率']
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
type: 'category',
|
||||
data: data.map((item: GraduateStatisticsVO) => item.name),
|
||||
axisPointer: {
|
||||
type: 'shadow'
|
||||
}
|
||||
}
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: 'value',
|
||||
name: '人数',
|
||||
min: 0,
|
||||
axisLabel: {
|
||||
formatter: '{value}'
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'value',
|
||||
name: '就业率',
|
||||
min: 0,
|
||||
max: 100,
|
||||
axisLabel: {
|
||||
formatter: '{value}%'
|
||||
}
|
||||
}
|
||||
],
|
||||
series: [
|
||||
{
|
||||
name: '总人数',
|
||||
type: 'bar',
|
||||
data: data.map((item: GraduateStatisticsVO) => item.total),
|
||||
itemStyle: {
|
||||
color: '#5470C6'
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '就业率',
|
||||
type: 'line',
|
||||
yAxisIndex: 1,
|
||||
data: data.map((item: GraduateStatisticsVO) => item.employmentRate),
|
||||
itemStyle: {
|
||||
color: '#91CC75'
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
collegeChart.setOption(option);
|
||||
} catch (error) {
|
||||
console.error('获取学院统计失败:', error);
|
||||
}
|
||||
};
|
||||
|
||||
/** 初始化专业就业排行榜图表 */
|
||||
const initMajorChart = async () => {
|
||||
try {
|
||||
const response = await getStatisticsByMajor(queryParams.graduationYear);
|
||||
const data = response.data.slice(0, 15); // 只显示TOP 15
|
||||
|
||||
if (!majorChart) {
|
||||
majorChart = echarts.init(majorChartRef.value);
|
||||
}
|
||||
|
||||
const option = {
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'cross',
|
||||
crossStyle: {
|
||||
color: '#999'
|
||||
}
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
data: ['总人数', '就业人数', '就业率']
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
type: 'category',
|
||||
data: data.map((item: GraduateStatisticsVO) => item.name),
|
||||
axisPointer: {
|
||||
type: 'shadow'
|
||||
},
|
||||
axisLabel: {
|
||||
rotate: 45
|
||||
}
|
||||
}
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: 'value',
|
||||
name: '人数',
|
||||
min: 0,
|
||||
axisLabel: {
|
||||
formatter: '{value}'
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'value',
|
||||
name: '就业率',
|
||||
min: 0,
|
||||
max: 100,
|
||||
axisLabel: {
|
||||
formatter: '{value}%'
|
||||
}
|
||||
}
|
||||
],
|
||||
series: [
|
||||
{
|
||||
name: '总人数',
|
||||
type: 'bar',
|
||||
data: data.map((item: GraduateStatisticsVO) => item.total),
|
||||
itemStyle: {
|
||||
color: '#5470C6'
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '就业人数',
|
||||
type: 'bar',
|
||||
data: data.map((item: GraduateStatisticsVO) => item.employmentCount),
|
||||
itemStyle: {
|
||||
color: '#91CC75'
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '就业率',
|
||||
type: 'line',
|
||||
yAxisIndex: 1,
|
||||
data: data.map((item: GraduateStatisticsVO) => item.employmentRate),
|
||||
itemStyle: {
|
||||
color: '#FAC858'
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
majorChart.setOption(option);
|
||||
} catch (error) {
|
||||
console.error('获取专业统计失败:', error);
|
||||
}
|
||||
};
|
||||
|
||||
/** 初始化历年就业趋势图表 */
|
||||
const initYearChart = async () => {
|
||||
try {
|
||||
const response = await getStatisticsByYear();
|
||||
const data = response.data;
|
||||
|
||||
if (!yearChart) {
|
||||
yearChart = echarts.init(yearChartRef.value);
|
||||
}
|
||||
|
||||
const option = {
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'cross',
|
||||
crossStyle: {
|
||||
color: '#999'
|
||||
}
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
data: ['总人数', '就业人数', '升学人数', '就业率', '升学率']
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
type: 'category',
|
||||
data: data.map((item: GraduateStatisticsVO) => item.year),
|
||||
axisPointer: {
|
||||
type: 'shadow'
|
||||
}
|
||||
}
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: 'value',
|
||||
name: '人数',
|
||||
min: 0,
|
||||
axisLabel: {
|
||||
formatter: '{value}'
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'value',
|
||||
name: '比率',
|
||||
min: 0,
|
||||
max: 100,
|
||||
axisLabel: {
|
||||
formatter: '{value}%'
|
||||
}
|
||||
}
|
||||
],
|
||||
series: [
|
||||
{
|
||||
name: '总人数',
|
||||
type: 'bar',
|
||||
data: data.map((item: GraduateStatisticsVO) => item.total),
|
||||
itemStyle: {
|
||||
color: '#5470C6'
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '就业人数',
|
||||
type: 'bar',
|
||||
data: data.map((item: GraduateStatisticsVO) => item.employmentCount),
|
||||
itemStyle: {
|
||||
color: '#91CC75'
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '升学人数',
|
||||
type: 'bar',
|
||||
data: data.map((item: GraduateStatisticsVO) => item.furtherStudyCount),
|
||||
itemStyle: {
|
||||
color: '#FAC858'
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '就业率',
|
||||
type: 'line',
|
||||
yAxisIndex: 1,
|
||||
data: data.map((item: GraduateStatisticsVO) => item.employmentRate),
|
||||
itemStyle: {
|
||||
color: '#EE6666'
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '升学率',
|
||||
type: 'line',
|
||||
yAxisIndex: 1,
|
||||
data: data.map((item: GraduateStatisticsVO) => item.furtherStudyRate),
|
||||
itemStyle: {
|
||||
color: '#73C0DE'
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
yearChart.setOption(option);
|
||||
} catch (error) {
|
||||
console.error('获取历年趋势统计失败:', error);
|
||||
}
|
||||
};
|
||||
|
||||
/** 查询操作 */
|
||||
const handleQuery = () => {
|
||||
getStatisticsData();
|
||||
};
|
||||
|
||||
/** 重置操作 */
|
||||
const resetQuery = () => {
|
||||
queryParams.graduationYear = undefined;
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
/** 导出图表 */
|
||||
const exportChart = (type: string) => {
|
||||
let chart: echarts.ECharts;
|
||||
let fileName: string;
|
||||
|
||||
switch (type) {
|
||||
case 'employment':
|
||||
chart = employmentChart;
|
||||
fileName = '就业状态分布';
|
||||
break;
|
||||
case 'company':
|
||||
chart = companyChart;
|
||||
fileName = '单位性质分布';
|
||||
break;
|
||||
case 'salary':
|
||||
chart = salaryChart;
|
||||
fileName = '薪资范围分布';
|
||||
break;
|
||||
case 'region':
|
||||
chart = regionChart;
|
||||
fileName = '地域分布';
|
||||
break;
|
||||
case 'college':
|
||||
chart = collegeChart;
|
||||
fileName = '学院就业情况';
|
||||
break;
|
||||
case 'major':
|
||||
chart = majorChart;
|
||||
fileName = '专业就业排行榜';
|
||||
break;
|
||||
case 'year':
|
||||
chart = yearChart;
|
||||
fileName = '历年就业趋势';
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
const url = chart.getDataURL({
|
||||
type: 'png',
|
||||
pixelRatio: 2,
|
||||
backgroundColor: '#fff'
|
||||
});
|
||||
|
||||
const link = document.createElement('a');
|
||||
link.href = url;
|
||||
link.download = `${fileName}_${new Date().getTime()}.png`;
|
||||
link.click();
|
||||
};
|
||||
|
||||
/** 返回上一页 */
|
||||
const goBack = () => {
|
||||
router.push('/zsjy/graduateInfo');
|
||||
};
|
||||
|
||||
/** 窗口大小变化处理 */
|
||||
const handleResize = () => {
|
||||
if (employmentChart) employmentChart.resize();
|
||||
if (companyChart) companyChart.resize();
|
||||
if (salaryChart) salaryChart.resize();
|
||||
if (regionChart) regionChart.resize();
|
||||
if (collegeChart) collegeChart.resize();
|
||||
if (majorChart) majorChart.resize();
|
||||
if (yearChart) yearChart.resize();
|
||||
};
|
||||
|
||||
// 页面初始化
|
||||
onMounted(async () => {
|
||||
await nextTick();
|
||||
getStatisticsData();
|
||||
window.addEventListener('resize', handleResize);
|
||||
});
|
||||
|
||||
// 页面销毁
|
||||
onUnmounted(() => {
|
||||
window.removeEventListener('resize', handleResize);
|
||||
if (employmentChart) employmentChart.dispose();
|
||||
if (companyChart) companyChart.dispose();
|
||||
if (salaryChart) salaryChart.dispose();
|
||||
if (regionChart) regionChart.dispose();
|
||||
if (collegeChart) collegeChart.dispose();
|
||||
if (majorChart) majorChart.dispose();
|
||||
if (yearChart) yearChart.dispose();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.page-container {
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
/* 统计卡片样式 */
|
||||
.stat-card {
|
||||
border-radius: 8px;
|
||||
transition: all 0.3s ease;
|
||||
height: 90px;
|
||||
|
||||
&:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.stat-content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 5px 12px;
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
|
||||
.stat-icon {
|
||||
font-size: 24px;
|
||||
margin-right: 12px;
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.stat-info {
|
||||
flex: 1;
|
||||
|
||||
.stat-value {
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
line-height: 1;
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
|
||||
.stat-label {
|
||||
font-size: 13px;
|
||||
opacity: 0.7;
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
/* 图表卡片样式 */
|
||||
.chart-card {
|
||||
border-radius: 8px;
|
||||
|
||||
.chart-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.chart-container {
|
||||
height: 350px;
|
||||
width: 100%;
|
||||
|
||||
&.chart-container-large {
|
||||
height: 450px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.el-card__header) {
|
||||
background-color: #f8f9fa;
|
||||
border-bottom: 1px solid #e8e8e8;
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user