费用管理内容优化-初步

This commit is contained in:
Cheng Zhou
2026-01-13 16:49:55 +08:00
parent 0c7c03069a
commit 1db36f40b0
43 changed files with 5229 additions and 26 deletions
+50
View File
@@ -0,0 +1,50 @@
import { apiDelete, apiGet, apiPatch, apiPost } from "./axios";
import type { FeeApiResponse } from "../types/api";
export interface ContractFeePayload {
project_id: string;
center_id: string;
contract_amount: number;
contract_cases: number;
actual_cases?: number | null;
settlement_amount?: number | null;
final_payment_amount?: number | null;
}
export interface ContractFeeUpdatePayload {
contract_amount?: number;
contract_cases?: number;
actual_cases?: number | null;
settlement_amount?: number | null;
final_payment_amount?: number | null;
}
export interface ContractPaymentPayload {
amount: number;
paid_date?: string | null;
verified_date?: string | null;
is_paid?: boolean;
is_verified?: boolean;
remark?: string | null;
}
export const listContractFees = (params: { projectId: string; centerId?: string; q?: string }) =>
apiGet<FeeApiResponse<any[]>>("/api/v1/fees/contracts", { params });
export const getContractFee = (contractId: string) => apiGet<FeeApiResponse<any>>(`/api/v1/fees/contracts/${contractId}`);
export const createContractFee = (payload: ContractFeePayload) =>
apiPost<FeeApiResponse<any>>("/api/v1/fees/contracts", payload);
export const updateContractFee = (contractId: string, payload: ContractFeeUpdatePayload) =>
apiPatch<FeeApiResponse<any>>(`/api/v1/fees/contracts/${contractId}`, payload);
export const deleteContractFee = (contractId: string) => apiDelete(`/api/v1/fees/contracts/${contractId}`);
export const createContractPayment = (contractId: string, payload: ContractPaymentPayload) =>
apiPost<FeeApiResponse<any>>(`/api/v1/fees/contracts/${contractId}/payments`, payload);
export const updateContractPayment = (paymentId: string, payload: ContractPaymentPayload) =>
apiPatch<FeeApiResponse<any>>(`/api/v1/fees/payments/${paymentId}`, payload);
export const deleteContractPayment = (paymentId: string) => apiDelete(`/api/v1/fees/payments/${paymentId}`);