import type { PageParam, PageResult } from '@vben/request';
|
|
import type { SystemStorageApi } from '#/api/system/storage';
|
|
import { requestClient } from '#/api/request';
|
|
export namespace ResearchApplicationApi {
|
/** 课题申报书 */
|
export interface Application {
|
id?: number;
|
no?: string; // 申报编号,后端生成(SB 前缀)
|
guidelineId?: number; // 所属课题指南 ID
|
guidelineTitle?: string; // 所属课题指南名称
|
title: string; // 课题名称
|
category?: number; // 课题类别(后端自指南冗余,前端只读)
|
memberId?: number; // 申报会员 ID
|
applicantName: string; // 申报人姓名/单位名称
|
applicantUserId?: number; // 申报登录用户 ID
|
workUnit?: string; // 工作单位
|
jobTitle?: string; // 职称
|
contactPhone?: string; // 联系电话
|
contactEmail?: string; // 联系邮箱
|
teamMembers?: string; // 课题组成员(每行一条:姓名|单位|职称)
|
budgetAmount?: number; // 申请经费(元)
|
planContent?: string; // 申报书正文
|
status?: number; // 状态,字典 research_application_status
|
processInstanceId?: string; // BPM 流程实例 ID
|
reviewAvgScore?: number; // 专家评审加权均分(后端汇总)
|
reviewPass?: number; // 评审结论:0-未通过 1-推荐立项(后端汇总)
|
researchNo?: string; // 立项编号,审批通过后生成
|
approveTime?: string; // 立项时间
|
noticeId?: number; // 已发布的立项通知公告 ID
|
remark?: string; // 备注
|
creator?: string; // 创建人 ID
|
creatorName?: string; // 创建人姓名
|
createTime?: string; // 创建时间
|
attachmentList?: SystemStorageApi.StorageBlob[]; // 附件列表
|
hasAttachment?: boolean; // 是否有附件
|
blobIds?: number[]; // 提交时的附件 ID 列表(全量)
|
}
|
|
/** 审批流程定义 */
|
export interface ProcessDefinition {
|
id: string;
|
key: string;
|
name: string;
|
}
|
|
/** 专家评审明细 */
|
export interface TopicReview {
|
id?: number;
|
applicationId?: number; // 课题申报书 ID
|
evaluatorName: string; // 专家姓名
|
evaluatorUnit?: string; // 专家所在单位
|
evaluatorTitle?: string; // 专家职称
|
topicScore?: number; // 选题价值与意义得分(权重 0.3)
|
planScore?: number; // 研究方案可行性得分(权重 0.3)
|
teamScore?: number; // 团队与研究基础得分(权重 0.2)
|
resultScore?: number; // 预期成果与效益得分(权重 0.2)
|
compositeScore?: number; // 加权合计得分(后端计算)
|
ranking?: number; // 本申报单内评分排名(后端计算)
|
conclusion?: number; // 评审结论,字典 research_review_conclusion
|
opinion?: string; // 评审意见
|
reviewTime?: string; // 评审时间
|
creatorName?: string; // 录入人姓名
|
createTime?: string; // 创建时间
|
}
|
}
|
|
/** 查询课题申报书分页 */
|
export function getApplicationPage(params: PageParam) {
|
return requestClient.get<PageResult<ResearchApplicationApi.Application>>(
|
'/research/application/page',
|
{ params },
|
);
|
}
|
|
/** 查询课题申报书详情 */
|
export function getApplication(id: number) {
|
return requestClient.get<ResearchApplicationApi.Application>(
|
`/research/application/get?id=${id}`,
|
);
|
}
|
|
/** 新增课题申报书(草稿) */
|
export function createApplication(data: ResearchApplicationApi.Application) {
|
return requestClient.post('/research/application/create', data);
|
}
|
|
/** 修改课题申报书(仅草稿、已驳回可改) */
|
export function updateApplication(data: ResearchApplicationApi.Application) {
|
return requestClient.put('/research/application/update', data);
|
}
|
|
/** 删除课题申报书(仅草稿可删) */
|
export function deleteApplication(id: number) {
|
return requestClient.delete('/research/application/delete', {
|
params: { id },
|
});
|
}
|
|
/** 提交课题申报书审批 */
|
export function submitApplication(id: number, processDefinitionKey: string) {
|
return requestClient.post('/research/application/submit', null, {
|
params: { id, processDefinitionKey },
|
});
|
}
|
|
/** 获取课题立项审批流程列表 */
|
export function getApplicationApproveProcessList() {
|
return requestClient.get<ResearchApplicationApi.ProcessDefinition[]>(
|
'/research/application/approve-process-list',
|
);
|
}
|
|
/** 发布立项通知 */
|
export function publishApplicationNotice(id: number) {
|
return requestClient.post('/research/application/publish-notice', null, {
|
params: { id },
|
});
|
}
|
|
/** 查询某申报书的专家评审明细列表 */
|
export function getTopicReviewList(applicationId: number) {
|
return requestClient.get<ResearchApplicationApi.TopicReview[]>(
|
'/research/topic-review/list',
|
{ params: { applicationId } },
|
);
|
}
|
|
/** 录入专家评审明细 */
|
export function createTopicReview(data: ResearchApplicationApi.TopicReview) {
|
return requestClient.post('/research/topic-review/create', data);
|
}
|
|
/** 修改专家评审明细 */
|
export function updateTopicReview(data: ResearchApplicationApi.TopicReview) {
|
return requestClient.put('/research/topic-review/update', data);
|
}
|
|
/** 删除专家评审明细 */
|
export function deleteTopicReview(id: number) {
|
return requestClient.delete('/research/topic-review/delete', {
|
params: { id },
|
});
|
}
|