feat(agent): 立账凭证检核
(cherry picked from commit f9e2fb5efc1ec7bf4f6e52e08dd3591b4e77edd9)
This commit is contained in:
1 parent
9bcbf9d211
commit
f615e56bb9
70 files changed
+4968
-108
No files matched your search
@@ -0,0 +1,91 @@
|
||||
/**
|
||||
* features/workspace/api/voucherCheck.api.ts
|
||||
* 用途:工作台立账凭证检核记录查询 API 客户端。
|
||||
* 依赖:@/shared/api/client、getAuthHeaders。
|
||||
* 逻辑:AccountingVoucherCheckView 调用;对应 /api/workspace/accounting-voucher-check/*。
|
||||
*/
|
||||
import { requestJson } from '@/shared/api/client';
|
||||
import { getAuthHeaders } from '@/shared/utils/auth';
|
||||
|
||||
export interface VoucherCheckStateItem {
|
||||
id: number;
|
||||
scope_code: string;
|
||||
period_month: string | null;
|
||||
invoice_no: string;
|
||||
invoice_date?: string | null;
|
||||
status: string;
|
||||
folder_path?: string | null;
|
||||
folder_exists?: boolean;
|
||||
matched_files?: Record<string, string>;
|
||||
missing_materials?: Array<{ code?: string; name?: string }>;
|
||||
last_checked_at?: string | null;
|
||||
last_missing_notified_on?: string | null;
|
||||
}
|
||||
|
||||
export interface VoucherCheckStatesResponse {
|
||||
scope_code: string;
|
||||
period: string;
|
||||
page: number;
|
||||
page_size: number;
|
||||
total: number;
|
||||
items: VoucherCheckStateItem[];
|
||||
}
|
||||
|
||||
export interface VoucherCheckRunItemsResponse {
|
||||
run_id: number;
|
||||
run_no: string;
|
||||
page: number;
|
||||
page_size: number;
|
||||
total: number;
|
||||
items: Array<{
|
||||
id: number;
|
||||
invoice_no: string;
|
||||
invoice_date?: string | null;
|
||||
result: string;
|
||||
folder_path?: string | null;
|
||||
folder_exists?: boolean;
|
||||
matched_files?: Record<string, string>;
|
||||
missing_materials?: Array<{ code?: string; name?: string }>;
|
||||
error_code?: string | null;
|
||||
error_message?: string | null;
|
||||
checked_at?: string | null;
|
||||
}>;
|
||||
}
|
||||
|
||||
/**
|
||||
* 按月份/状态/发票号筛选最新检核状态。
|
||||
*/
|
||||
export function listVoucherCheckStates(params: {
|
||||
period?: string;
|
||||
status?: string;
|
||||
invoice_no?: string;
|
||||
page?: number;
|
||||
page_size?: number;
|
||||
}) {
|
||||
const q = new URLSearchParams();
|
||||
if (params.period) q.set('period', params.period);
|
||||
if (params.status) q.set('status', params.status);
|
||||
if (params.invoice_no) q.set('invoice_no', params.invoice_no);
|
||||
if (params.page) q.set('page', String(params.page));
|
||||
if (params.page_size) q.set('page_size', String(params.page_size));
|
||||
const qs = q.toString();
|
||||
return requestJson<VoucherCheckStatesResponse>(
|
||||
`/api/workspace/accounting-voucher-check/states${qs ? `?${qs}` : ''}`,
|
||||
{ headers: getAuthHeaders() },
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询指定批次明细。
|
||||
*/
|
||||
export function listVoucherCheckRunItems(runId: number, params?: { result?: string; page?: number; page_size?: number }) {
|
||||
const q = new URLSearchParams();
|
||||
if (params?.result) q.set('result', params.result);
|
||||
if (params?.page) q.set('page', String(params.page));
|
||||
if (params?.page_size) q.set('page_size', String(params.page_size));
|
||||
const qs = q.toString();
|
||||
return requestJson<VoucherCheckRunItemsResponse>(
|
||||
`/api/workspace/accounting-voucher-check/runs/${runId}/items${qs ? `?${qs}` : ''}`,
|
||||
{ headers: getAuthHeaders() },
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user