89 lines
2.4 KiB
TypeScript
Raw Normal View History

2025-09-02 16:22:57 +08:00
import { MyButtons, MyColumns, MyProTableProps } from '@/common';
import { Apis } from '@/gen/Apis';
2025-09-19 18:55:51 +08:00
2025-10-10 09:54:23 +08:00
import { HouseBillsTypeEnum } from '@/gen/Enums';
import { ProTable } from '@ant-design/pro-components';
import { Space } from 'antd';
import { useEffect, useRef } from 'react';
2025-09-19 18:55:51 +08:00
import ChargeStandardHasHouse from '../modals/ChargeStandardHasHouse';
export default function Index({ ...rest }) {
const actionLooks = useRef<any>();
useEffect(() => {
actionLooks?.current.reloadAndRest();
}, [rest.loadmore]);
return (
<>
<ProTable<Record<any, any>>
{...MyProTableProps.props}
actionRef={actionLooks}
request={async (params, sort) =>
MyProTableProps.request(
{
...params,
2025-09-08 17:22:58 +08:00
house_charge_standards_id: rest.item?.house_charge_has_houses_id,
},
sort,
2025-09-02 16:22:57 +08:00
Apis.HouseCharage.HouseChargeHasHouses.List,
)
}
toolBarRender={(action) => [
2025-10-10 09:54:23 +08:00
(rest?.item.charge_type === HouseBillsTypeEnum.PropertyFee.value ||
rest?.item.charge_type ===
HouseBillsTypeEnum.MaintenanceFund.value) && (
<ChargeStandardHasHouse
item={rest.item}
reload={action?.reload}
title={'绑房'}
/>
),
]}
search={false}
columns={[
MyColumns.ID(),
{
2025-09-02 16:22:57 +08:00
title: '房屋名称',
dataIndex: 'full_name',
},
{
2025-09-02 16:22:57 +08:00
title: '项目名称',
dataIndex: 'project_name',
},
{
2025-09-02 16:22:57 +08:00
title: '楼栋名称',
dataIndex: 'building_name',
},
{
title: '单元名称',
dataIndex: 'unit_name',
},
{
title: '房号',
dataIndex: 'name',
},
{
title: '绑定时间',
dataIndex: 'updated_at',
search: false,
},
MyColumns.Option({
render: (_, item: any, index, action) => (
<Space key={index}>
2025-09-08 17:22:58 +08:00
<MyButtons.Delete
2025-09-02 16:22:57 +08:00
onConfirm={() =>
Apis.HouseCharage.HouseChargeHasHouses.Delete({
id: item.id,
}).then(() => action?.reload())
}
/>
</Space>
),
}),
]}
/>
</>
);
}