Files
ycc-proxy-admin/apps/web-antd/src/views/agent/agent-commission-deduction/data.ts
liangzai 0668eea99b
Some checks failed
CI / Test (ubuntu-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / Lint (ubuntu-latest) (push) Has been cancelled
CI / Lint (windows-latest) (push) Has been cancelled
CI / Check (ubuntu-latest) (push) Has been cancelled
CI / Check (windows-latest) (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Deploy Website on push / Deploy Push Playground Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Docs Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Antd Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Element Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Naive Ftp (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
CI / CI OK (push) Has been cancelled
Deploy Website on push / Rerun on failure (push) Has been cancelled
Lock Threads / action (push) Has been cancelled
Issue Close Require / close-issues (push) Has been cancelled
Close stale issues / stale (push) Has been cancelled
f
2025-11-27 19:08:41 +08:00

102 lines
2.2 KiB
TypeScript

import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
export function useCommissionDeductionColumns(): VxeTableGridOptions['columns'] {
return [
{
title: 'ID',
field: 'id',
width: 80,
},
{
title: '代理ID',
field: 'agent_id',
width: 100,
},
{
title: '被扣代理ID',
field: 'deducted_agent_id',
width: 100,
},
{
title: '抽佣金额',
field: 'amount',
width: 120,
formatter: ({ cellValue }) => `¥${cellValue.toFixed(2)}`,
},
{
title: '产品名称',
field: 'product_name',
width: 150,
},
{
title: '抽佣类型',
field: 'type',
width: 120,
formatter: ({ cellValue }: { cellValue: 'cost' | 'pricing' }) => {
const typeMap = {
cost: '成本抽佣',
pricing: '定价抽佣',
};
return typeMap[cellValue] || cellValue;
},
},
{
title: '状态',
field: 'status',
width: 100,
cellRender: {
name: 'CellTag',
options: [
{ value: 0, color: 'warning', label: '待结算' },
{ value: 1, color: 'success', label: '已结算' },
{ value: 2, color: 'error', label: '已取消' },
],
},
},
{
title: '创建时间',
field: 'create_time',
width: 180,
},
];
}
export function useCommissionDeductionFormSchema(): VbenFormSchema[] {
return [
{
fieldName: 'product_name',
label: '产品名称',
component: 'Input',
componentProps: {
allowClear: true,
},
},
{
fieldName: 'type',
label: '抽佣类型',
component: 'Select',
componentProps: {
options: [
{ label: '成本抽佣', value: 'cost' },
{ label: '定价抽佣', value: 'pricing' },
],
allowClear: true,
},
},
{
fieldName: 'status',
label: '状态',
component: 'Select',
componentProps: {
options: [
{ label: '待结算', value: 0 },
{ label: '已结算', value: 1 },
{ label: '已取消', value: 2 },
],
allowClear: true,
},
},
];
}