liu
2026-09-29 7a6351a1fa5fc6e67b55c475bcd253d6d3e5d68f
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
107
108
109
110
111
112
113
import type { PageParam, PageResult } from '@vben/request';
 
import type { SystemStorageApi } from '#/api/system/storage';
 
import { requestClient } from '#/api/request';
 
export namespace FinanceReimbursementApi {
  /** 报销明细行 */
  export interface ReimbursementItem {
    id?: number;
    reimbursementId?: number;
    expenseType: number; // 费用类型,字典 finance_expense_type
    invoiceNo?: string; // 发票号码
    invoiceAmount: number; // 发票金额
    invoiceDate?: string; // 发票日期 yyyy-MM-dd
    drawer?: string; // 开票方
    description?: string; // 费用说明
  }
 
  /** 报销单信息 */
  export interface Reimbursement {
    id?: number;
    no?: string; // 报销单号,后端生成
    title: string; // 报销标题
    totalAmount: number; // 报销总金额
    status?: number; // 状态,字典 finance_reimbursement_status
    applicantId?: number; // 申请人 ID
    applicantName?: string; // 申请人姓名
    applyDate: string; // 申请日期 yyyy-MM-dd
    processInstanceId?: string; // BPM 流程实例 ID
    archiveTime?: string; // 归档时间
    remark?: string; // 备注
    creator?: string; // 创建人 ID
    creatorName?: string; // 创建人姓名
    createTime?: string; // 创建时间
    updateTime?: string; // 更新时间
    items?: ReimbursementItem[]; // 报销明细
    attachmentList?: SystemStorageApi.StorageBlob[]; // 发票附件
    hasAttachment?: boolean; // 是否有发票附件
    blobIds?: number[]; // 提交时的附件 ID 列表(全量)
  }
 
  /** 审批流程定义 */
  export interface ProcessDefinition {
    id: string;
    key: string;
    name: string;
  }
}
 
/** 查询报销单分页 */
export function getReimbursementPage(params: PageParam) {
  return requestClient.get<PageResult<FinanceReimbursementApi.Reimbursement>>(
    '/finance/reimbursement/page',
    { params },
  );
}
 
/** 查询报销单详情 */
export function getReimbursement(id: number) {
  return requestClient.get<FinanceReimbursementApi.Reimbursement>(
    `/finance/reimbursement/get?id=${id}`,
  );
}
 
/** 新增报销单 */
export function createReimbursement(
  data: FinanceReimbursementApi.Reimbursement,
) {
  return requestClient.post('/finance/reimbursement/create', data);
}
 
/** 修改报销单(仅草稿、已驳回可改) */
export function updateReimbursement(
  data: FinanceReimbursementApi.Reimbursement,
) {
  return requestClient.put('/finance/reimbursement/update', data);
}
 
/** 删除报销单(仅草稿可删) */
export function deleteReimbursement(id: number) {
  return requestClient.delete('/finance/reimbursement/delete', {
    params: { id },
  });
}
 
/** 提交报销单审批 */
export function submitReimbursement(id: number, processDefinitionKey: string) {
  return requestClient.post('/finance/reimbursement/submit', null, {
    params: { id, processDefinitionKey },
  });
}
 
/** 归档报销单(仅已通过可归档) */
export function archiveReimbursement(id: number) {
  return requestClient.post('/finance/reimbursement/archive', null, {
    params: { id },
  });
}
 
/** 获取报销单审批流程列表 */
export function getReimbursementApproveProcessList() {
  return requestClient.get<FinanceReimbursementApi.ProcessDefinition[]>(
    '/finance/reimbursement/approve-process-list',
  );
}
 
/** 导出报销单 Excel */
export function exportReimbursement(params: any) {
  return requestClient.download('/finance/reimbursement/export-excel', {
    params,
  });
}