front/src/api/customer/accountFlow.ts
zzh f1d219ae48 feat: ship billing UI for additional services, conditions, and fee insights
Add product/channel billing condition editors, place-order additional services, billing simulator, forecast-to-inbound fee delta and margin warnings, insurance-aware claim tips, OMS preset dict seeds, and related AI skills/system pages.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-01 18:09:22 +08:00

43 lines
1.3 KiB
TypeScript

import { axiosInstance } from '@/api/rbac'
import { omsUrl, parseListPayload } from '@/api/oms/common'
export interface AccountFlowListParams {
page: number
pageSize: number
keyword?: string
bizType?: string
customerId?: number
startTime?: string
endTime?: string
amountMin?: number
amountMax?: number
sortField?: string
sortOrder?: string
}
export async function getAccountFlowList(params: AccountFlowListParams) {
const res = await axiosInstance.get(omsUrl('/customer/account-flow/list'), {
params: {
page: params.page,
pageSize: params.pageSize,
keyword: params.keyword || undefined,
bizType: params.bizType && params.bizType !== 'all' ? params.bizType : undefined,
customerId: params.customerId || undefined,
startTime: params.startTime || undefined,
endTime: params.endTime || undefined,
amountMin: params.amountMin,
amountMax: params.amountMax,
sortField: params.sortField || undefined,
sortOrder: params.sortOrder || undefined,
},
})
return parseListPayload(res.data)
}
/** 支付/充值成功后通知顶部余额刷新 */
export const CUSTOMER_BALANCE_CHANGED_EVENT = 'oms:customer-balance-changed'
export function notifyCustomerBalanceChanged() {
window.dispatchEvent(new CustomEvent(CUSTOMER_BALANCE_CHANGED_EVENT))
}