93 lines
2.4 KiB
TypeScript
Raw Normal View History

import {
MyColumns,
MyPageContainer,
MyProTableProps,
usePageTabs,
} from '@/common';
import { Apis } from '@/gen/Apis';
import { ProTable } from '@ant-design/pro-components';
2025-09-25 20:20:46 +08:00
import { Space } from 'antd';
import SummaryShow from './modals/SummaryShow';
2025-09-25 20:20:46 +08:00
export default function Index({ title = '房屋账单' }) {
// 注册当前页面为标签页
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,
)
}
// toolBarRender={(action) => [
// <MyImportModal
// key="ImportHouse"
// title="批量导入"
// type="danger"
// size="middle"
// templateApi={Apis.Bill.HouseBills.DownloadTemplate}
// importApi={Apis.Bill.HouseBills.Import}
// reload={action?.reload}
// />,
// <BillCreate key="Create" reload={action?.reload} title={title} />,
// ]}
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}>
<SummaryShow item={item} title="查看" reload={action?.reload} />
</Space>
),
}),
]}
/>
</MyPageContainer>
);
}