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 },
|
);
|
}
|