liu
2026-09-29 982c97ab82f3beb1b4febcf014562eda34b9fc05
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
import type { PageParam, PageResult } from '@vben/request';
 
import { requestClient } from '#/api/request';
 
export namespace ArchiveBorrowApi {
  /** 借阅单 */
  export interface Borrow {
    id?: number; // 借阅单编号
    no?: string; // 借阅单号(后端生成:JY+yyyyMMdd+6位流水,只读)
    documentId: number; // 档案 ID
    documentNo?: string; // 档案编号(快照)
    documentTitle?: string; // 档案标题(快照)
    borrowerUserId?: number; // 借阅人用户 ID
    borrowerName: string; // 借阅人姓名
    borrowerDept?: string; // 借阅人部门
    borrowerPhone?: string; // 借阅人联系电话
    borrowDate: string; // 借阅日期
    borrowPurpose?: string; // 借阅目的
    returnDeadline: string; // 归还期限
    status?: number; // 状态,字典 archive_borrow_status
    processInstanceId?: string; // BPM 流程实例 ID
    approveTime?: string; // 审批通过(实际借出)时间
    returnTime?: string; // 实际归还时间
    returnConfirmUserId?: number; // 归还确认人用户 ID
    returnConfirmUserName?: string; // 归还确认人姓名
    returnRemark?: string; // 归还备注
    rejectReason?: string; // 驳回原因
    rejectTime?: string; // 驳回时间
    remark?: string; // 备注
    overdue?: boolean; // 是否逾期(后端实时计算)
    overdueDays?: number; // 逾期天数(后端实时计算)
    createTime?: string; // 创建时间
  }
 
  /** 审批流程定义 */
  export interface ProcessDefinition {
    id: string;
    key: string;
    name: string;
  }
 
  /** 归还登记请求 */
  export interface ReturnReq {
    id: number; // 借阅单编号
    returnRemark?: string; // 归还备注
  }
}
 
/** 查询借阅单分页 */
export function getBorrowPage(params: PageParam) {
  return requestClient.get<PageResult<ArchiveBorrowApi.Borrow>>(
    '/archive/borrow/page',
    { params },
  );
}
 
/** 查询逾期未还借阅单分页 */
export function getOverdueBorrowPage(params: PageParam) {
  return requestClient.get<PageResult<ArchiveBorrowApi.Borrow>>(
    '/archive/borrow/overdue-page',
    { params },
  );
}
 
/** 查询借阅单详情 */
export function getBorrow(id: number) {
  return requestClient.get<ArchiveBorrowApi.Borrow>(
    `/archive/borrow/get?id=${id}`,
  );
}
 
/** 新增借阅单 */
export function createBorrow(data: ArchiveBorrowApi.Borrow) {
  return requestClient.post('/archive/borrow/create', data);
}
 
/** 修改借阅单 */
export function updateBorrow(data: ArchiveBorrowApi.Borrow) {
  return requestClient.put('/archive/borrow/update', data);
}
 
/** 删除借阅单 */
export function deleteBorrow(id: number) {
  return requestClient.delete('/archive/borrow/delete', {
    params: { id },
  });
}
 
/** 提交借阅单审批 */
export function submitBorrow(id: number, processDefinitionKey?: string) {
  return requestClient.post('/archive/borrow/submit', null, {
    params: { id, processDefinitionKey },
  });
}
 
/** 获取档案借阅审批流程列表 */
export function getBorrowApproveProcessList() {
  return requestClient.get<ArchiveBorrowApi.ProcessDefinition[]>(
    '/archive/borrow/approve-process-list',
  );
}
 
/** 归还登记 */
export function returnBorrow(data: ArchiveBorrowApi.ReturnReq) {
  return requestClient.post('/archive/borrow/return', data);
}