- AP 概览页 Tab 工作台化(待付款/异常付款/风险标记/对账异常) - AP 导出端点支持 CSV/XLSX 与筛选 - 风险标记 resolve/dismiss 支持说明审计留痕 - 支付批次深链、高风险复核提示、对账确认权限收口 - OpenClaw 浏览器级回归全部通过
79 行
2.1 KiB
TypeScript
79 行
2.1 KiB
TypeScript
import { apiRequestBlob, apiRequestData } from "./http";
|
|
import type { RiskFlag } from "./feeControl";
|
|
|
|
export type ApOperationsExportFormat = "csv" | "xlsx";
|
|
export type ApOperationsRiskBucket = "all" | "exception" | "budget_overspend";
|
|
export type ApOperationsPendingEntityType = "reimbursement" | "travel_order";
|
|
|
|
export type ApPendingPaymentBatchSummary = {
|
|
id: string;
|
|
batchNo: string;
|
|
entityType: string;
|
|
name: string;
|
|
status: string;
|
|
totalAmount: string;
|
|
highRisk: boolean;
|
|
createdAt: string | null;
|
|
};
|
|
|
|
export type ApFailedPaymentBatchItemSummary = {
|
|
id: string;
|
|
paymentBatchId: string;
|
|
entityId: string;
|
|
entityCode: string;
|
|
entityTitle: string;
|
|
amount: string;
|
|
currencyCode: string;
|
|
failureCode: string | null;
|
|
failureMessage: string | null;
|
|
createdAt: string | null;
|
|
};
|
|
|
|
export type ApPartialMatchItemSummary = {
|
|
id: string;
|
|
travelReconciliationBatchId: string;
|
|
travelOrderId: string | null;
|
|
travelRequestId: string | null;
|
|
matchStatus: string;
|
|
resolutionStatus: string;
|
|
anomalyCode: string | null;
|
|
orderAmount: string | null;
|
|
transactionAmount: string | null;
|
|
currency: string;
|
|
createdAt: string | null;
|
|
};
|
|
|
|
export type ApOperationsSummary = {
|
|
summary: {
|
|
pendingPaymentCount: number;
|
|
partialMatchCount: number;
|
|
exceptionCount: number;
|
|
budgetOverspendCount: number;
|
|
};
|
|
pendingPaymentBatches: ApPendingPaymentBatchSummary[];
|
|
failedPaymentBatchItems: ApFailedPaymentBatchItemSummary[];
|
|
exceptionRiskFlags: RiskFlag[];
|
|
budgetOverspendRisks: RiskFlag[];
|
|
partialMatchItems: ApPartialMatchItemSummary[];
|
|
};
|
|
|
|
export async function fetchApOperations() {
|
|
return apiRequestData<ApOperationsSummary>("/api/ap-operations");
|
|
}
|
|
|
|
export async function exportApOperations(params: {
|
|
format: ApOperationsExportFormat;
|
|
pendingEntityType?: ApOperationsPendingEntityType;
|
|
pendingCreatedAtFrom?: string;
|
|
pendingCreatedAtTo?: string;
|
|
riskBucket?: ApOperationsRiskBucket;
|
|
}) {
|
|
return apiRequestBlob("/api/exports/ap-operations", {
|
|
method: "POST",
|
|
headers: {
|
|
"content-type": "application/json",
|
|
},
|
|
body: JSON.stringify(params),
|
|
});
|
|
}
|