1、增加订单开发票功能和发票抬头添加功能
2、一个订单只能在一个开票里,不允许多开
This commit is contained in:
@@ -568,6 +568,40 @@ export async function refundPaymentOrder(orderNo: string): Promise<void> {
|
||||
await api.post(`/admin/payment-orders/${orderNo}/refund`);
|
||||
}
|
||||
|
||||
// ── Invoice Management ───────────────────────────────────
|
||||
|
||||
export async function getAdminInvoices(params?: {
|
||||
page?: number;
|
||||
pageSize?: number;
|
||||
status?: string;
|
||||
phone?: string;
|
||||
startDate?: string;
|
||||
endDate?: string;
|
||||
}): Promise<{ items: any[]; total: number }> {
|
||||
const qs = new URLSearchParams();
|
||||
if (params?.page) qs.set('page', String(params.page));
|
||||
if (params?.pageSize) qs.set('page_size', String(params.pageSize));
|
||||
if (params?.status) qs.set('status', params.status);
|
||||
if (params?.phone) qs.set('phone', params.phone);
|
||||
if (params?.startDate) qs.set('start_date', params.startDate);
|
||||
if (params?.endDate) qs.set('end_date', params.endDate);
|
||||
return api.get(`/admin/invoices?${qs.toString()}`);
|
||||
}
|
||||
|
||||
export async function getAdminInvoiceDetail(id: string): Promise<any> {
|
||||
return api.get(`/admin/invoices/${id}`);
|
||||
}
|
||||
|
||||
export async function updateInvoiceStatus(id: string, data: {
|
||||
status: 'success' | 'failed';
|
||||
failureReason?: string;
|
||||
}): Promise<void> {
|
||||
await api.put(`/admin/invoices/${id}/status`, {
|
||||
status: data.status,
|
||||
failure_reason: data.failureReason,
|
||||
});
|
||||
}
|
||||
|
||||
export async function getAdminNotifications(page = 1, pageSize = 20): Promise<{ total: number; items: any[] }> {
|
||||
const params = new URLSearchParams();
|
||||
params.set('page', String(page));
|
||||
|
||||
Reference in New Issue
Block a user