diff --git a/apps/web-antd/src/api/agent/agent.ts b/apps/web-antd/src/api/agent/agent.ts index b0d955e..368baad 100644 --- a/apps/web-antd/src/api/agent/agent.ts +++ b/apps/web-antd/src/api/agent/agent.ts @@ -78,6 +78,7 @@ export namespace AgentApi { page: number; pageSize: number; agent_id?: number; + order_id?: number; product_name?: string; status?: number; } @@ -333,6 +334,13 @@ export interface GetAgentLinkProductStatisticsParams {} price_ratio?: null | number; // 提价区间收取比例 price_increase_amount?: null | number; // 在原本成本上加价的金额 } + + // 代理钱包信息 + export interface AgentWalletInfo { + balance: number; // 可用余额 + frozen_balance: number; // 冻结余额 + total_earnings: number; // 总收益 + } } /** @@ -571,6 +579,15 @@ async function getAgentLinkProductStatistics() { ); } +/** + * 获取代理钱包信息 + */ +async function getAgentWallet(agentId: number) { + return requestClient.get( + `/agent/wallet/${agentId}`, + ); +} + export { batchUnfreezeAgentCommission, getAgentCommissionDeductionList, @@ -584,6 +601,7 @@ export { getAgentProductionConfigList, getAgentRewardList, getAgentStatistics, + getAgentWallet, getAgentWithdrawalList, getMembershipRechargeOrderList, getWithdrawalStatistics, diff --git a/apps/web-antd/src/views/agent/agent-commission/data.ts b/apps/web-antd/src/views/agent/agent-commission/data.ts index 2949fc9..6414e4f 100644 --- a/apps/web-antd/src/views/agent/agent-commission/data.ts +++ b/apps/web-antd/src/views/agent/agent-commission/data.ts @@ -37,7 +37,7 @@ export function useCommissionColumns( const statusMap: Record = { 0: '已结算', 1: '冻结中', - 2: '已取消', + 2: '已退款', }; return statusMap[cellValue] || '未知'; }, @@ -83,21 +83,7 @@ export function useCommissionColumns( row?.status !== 1 ? '!text-gray-400 !cursor-not-allowed' : '', tooltip: (row: AgentApi.AgentCommissionListItem) => { if (row?.status === 0) return '已结算的佣金无需解冻'; - if (row?.status === 2) return '已取消的佣金无法操作'; - return ''; - }, - }, - { - code: 'cancel', - text: '取消', - type: 'primary', - disabled: (row: AgentApi.AgentCommissionListItem) => - row?.status !== 1, - class: (row: AgentApi.AgentCommissionListItem) => - row?.status !== 1 ? '!text-gray-400 !cursor-not-allowed' : '', - tooltip: (row: AgentApi.AgentCommissionListItem) => { - if (row?.status === 0) return '只能取消冻结中的佣金'; - if (row?.status === 2) return '已取消的佣金无法再次取消'; + if (row?.status === 2) return '已退款的佣金无法操作'; return ''; }, }, @@ -114,10 +100,22 @@ export function useCommissionColumns( // 佣金记录搜索表单配置 export function useCommissionFormSchema(): VbenFormSchema[] { return [ + { + component: 'InputNumber', + fieldName: 'order_id', + label: '订单ID', + componentProps: { + placeholder: '请输入订单ID', + style: { width: '100%' }, + }, + }, { component: 'Input', fieldName: 'product_name', label: '产品名称', + componentProps: { + placeholder: '请输入产品名称(支持模糊搜索)', + }, }, { component: 'Select', @@ -125,10 +123,11 @@ export function useCommissionFormSchema(): VbenFormSchema[] { label: '状态', componentProps: { allowClear: true, + placeholder: '请选择状态', options: [ { label: '已结算', value: 0 }, { label: '冻结中', value: 1 }, - { label: '已取消', value: 2 }, + { label: '已退款', value: 2 }, ], }, }, diff --git a/apps/web-antd/src/views/agent/agent-commission/list.vue b/apps/web-antd/src/views/agent/agent-commission/list.vue index 7b28d86..a695cd4 100644 --- a/apps/web-antd/src/views/agent/agent-commission/list.vue +++ b/apps/web-antd/src/views/agent/agent-commission/list.vue @@ -1,15 +1,18 @@