88 lines
2.1 KiB
TypeScript
Raw Normal View History

import {
MyButtons,
MyColumns,
MyPageContainer,
MyProTableProps,
usePageTabs,
} from '@/common';
import { Apis } from '@/gen/Apis';
import { ProTable } from '@ant-design/pro-components';
import { useNavigate } from '@umijs/max';
2025-09-25 20:20:46 +08:00
import { Space } from 'antd';
2025-09-25 20:20:46 +08:00
export default function Index({ title = '房屋账单' }) {
const navigate = useNavigate();
// 注册当前页面为标签页
usePageTabs({
2025-09-25 20:20:46 +08:00
tabKey: 'summary',
tabLabel: title,
});
return (
<MyPageContainer
title={title}
enableTabs={true}
2025-09-25 20:20:46 +08:00
tabKey="summary"
tabLabel={title}
>
<ProTable
{...MyProTableProps.props}
request={async (params, sort) =>
MyProTableProps.request(
params,
sort,
2025-09-25 20:20:46 +08:00
Apis.Bill.HouseBills.SummaryBillList,
)
}
columns={[
2025-09-25 20:20:46 +08:00
{
title: '房屋ID',
dataIndex: 'asset_houses_id',
},
{
title: '房屋',
dataIndex: ['asset_house', 'full_name'],
search: {
transform: (value) => {
return { full_name: value };
},
},
},
{
2025-09-25 20:20:46 +08:00
title: '账单金额合计',
dataIndex: 'payable_amount_sum',
search: false,
},
{
title: '滞纳金合计',
dataIndex: 'late_fee_sum',
search: false,
},
{
2025-09-25 20:20:46 +08:00
title: '优惠金额合计',
dataIndex: 'discount_amount_sum',
search: false,
},
{
2025-09-25 20:20:46 +08:00
title: '应付合计',
dataIndex: 'total_payable_sum',
search: false,
},
2025-09-25 20:20:46 +08:00
MyColumns.Option({
render: (_, item: any, index, action) => (
<Space key={index}>
<MyButtons.View
title="查看"
onClick={() => {
navigate(`/bills/summary/show/${item.asset_houses_id}`);
}}
/>
2025-09-25 20:20:46 +08:00
</Space>
),
}),
]}
/>
</MyPageContainer>
);
}