liu
3 天以前 fe2d6627b8f1002af7a31b08f6f43bec034d04ee
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
import type { FinanceReimbursementApi } from '../index';
import type { SystemStorageApi } from '#/api/system/storage';
 
import { requestClient } from '#/api/request';
 
export namespace FinanceReimbursementAiApi {
  /** 报销发票 OCR 识别结果 */
  export interface OcrResultVO {
    /** 发票文件 Blob 编号 */
    blobId?: number;
    /** 发票号码 */
    invoiceNo?: string;
    /** 发票代码(数电票可能为空) */
    invoiceCode?: string;
    /** 发票类型 */
    invoiceType?: string;
    /** 购买方名称(发票抬头) */
    invoiceTitle?: string;
    /** 销售方名称(开票方) */
    sellerName?: string;
    /** 价税合计金额,单位:元 */
    invoiceAmount?: number;
    /** 税额合计,单位:元 */
    taxAmount?: number;
    /** 开票日期,yyyy-MM-dd */
    invoiceDate?: string;
    /** 备注 */
    remark?: string;
    /** 识别失败时的错误提示(成功时为空) */
    rawText?: string;
  }
 
  /** OCR 确认后回填给报销表单的数据 */
  export interface OcrImportPayload {
    /** 识别成功的发票明细行 */
    items: FinanceReimbursementApi.ReimbursementItem[];
    /** 本次上传的发票文件,需一并保存为报销单附件 */
    blobs: SystemStorageApi.StorageBlob[];
  }
}
 
/** 批量识别报销发票文件 */
export function ocrReimbursementInvoices(blobIds: number[]) {
  return requestClient.post<FinanceReimbursementAiApi.OcrResultVO[]>(
    '/finance/reimbursement/ai/ocr',
    { blobIds },
  );
}