113 lines
3.1 KiB
TypeScript
Raw Normal View History

2025-07-04 17:26:52 +08:00
import {
MyButtons,
MyColumns,
MyPageContainer,
MyProTableProps,
} from '@/common';
import { Apis } from '@/gen/Apis';
import { HouseBillsTypeEnum } from '@/gen/Enums';
import { ProTable } from '@ant-design/pro-components';
import { Space } from 'antd';
import Create from './modals/Create';
import Update from './modals/Update';
export default function Index({ title = '账单' }) {
return (
<MyPageContainer title={title}>
<ProTable
{...MyProTableProps.props}
request={async (params, sort) =>
MyProTableProps.request(params, sort, Apis.Bill.HouseBills.List)
}
toolBarRender={(action) => [
<Create key="Create" reload={action?.reload} title={title} />,
]}
columns={[
MyColumns.ID(),
2025-07-10 18:01:45 +08:00
MyColumns.EnumTag({
title: '类型',
dataIndex: 'type',
valueEnum: HouseBillsTypeEnum,
}),
{
title: '房屋',
dataIndex: ['asset_house', 'full_name'],
search: {
transform: (value) => {
return { full_name: value };
},
},
},
{
title: '账单月份',
dataIndex: 'month',
width: 100,
},
2025-07-04 17:26:52 +08:00
{
2025-07-16 10:18:01 +08:00
title: '账单金额',
2025-07-04 17:26:52 +08:00
dataIndex: 'amount',
2025-07-10 18:01:45 +08:00
search: false,
width: 100,
2025-07-04 17:26:52 +08:00
},
{
title: '优惠金额',
dataIndex: 'discount_amount',
search: false,
2025-07-10 18:01:45 +08:00
width: 100,
2025-07-04 17:26:52 +08:00
},
{
title: '滞纳金',
dataIndex: 'late_fee',
search: false,
2025-07-10 18:01:45 +08:00
width: 100,
2025-07-04 17:26:52 +08:00
},
2025-07-10 18:01:45 +08:00
2025-07-16 10:18:01 +08:00
// {
// title: '计费开始日期',
// dataIndex: 'start_date',
// search: false,
// width: 120,
// },
// {
// title: '计费结束日期',
// dataIndex: 'end_date',
// search: false,
// width: 120,
// },
2025-07-10 18:01:45 +08:00
// {
// title: '滞纳金起算日期',
// dataIndex: 'late_start_date',
// search: false,
// },
// {
// title: '已收滞纳金天数',
// dataIndex: 'collected_late_fee_days',
// search: false,
// // },
// {
// title: '备注',
// dataIndex: 'remark',
// search: false,
// },
// MyColumns.CreatedAt(),
MyColumns.UpdatedAt(),
2025-07-04 17:26:52 +08:00
MyColumns.Option({
render: (_, item: any, index, action) => (
<Space key={index}>
<Update item={item} reload={action?.reload} title={title} />
<MyButtons.Delete
onConfirm={() =>
Apis.Common.Admins.Delete({ id: item.id }).then(() =>
action?.reload(),
)
}
/>
</Space>
),
}),
]}
/>
</MyPageContainer>
);
}