129 lines
3.4 KiB
TypeScript
Raw Normal View History

import {
2025-10-09 20:21:05 +08:00
MyButtons,
MyColumns,
MyPageContainer,
MyProTableProps,
usePageTabs,
} from '@/common';
import { Apis } from '@/gen/Apis';
import {
HouseOrdersOrderStatusEnum,
HouseOrdersPaymentMethodEnum,
} from '@/gen/Enums';
import { ProTable } from '@ant-design/pro-components';
2025-10-09 20:21:05 +08:00
import { Space } from 'antd';
import Payments from './modals/Payments';
2025-10-09 20:21:05 +08:00
export default function Index({ title = '支付订单' }) {
// 注册当前页面为标签页
usePageTabs({
tabKey: 'house_order',
tabLabel: title,
});
return (
<MyPageContainer
title={title}
enableTabs={true}
tabKey="house_order"
tabLabel={title}
>
<ProTable
{...MyProTableProps.props}
request={async (params, sort) =>
MyProTableProps.request(
params,
sort,
Apis.HouseOrder.HouseOrders.List,
)
}
// toolBarRender={(action) => [
// <MyImportModal
// key="ImportHouse"
// title="批量导入"
// type="danger"
// size="middle"
// templateApi={Apis.Bill.HouseBills.DownloadTemplate}
// importApi={Apis.Bill.HouseBills.Import}
// reload={action?.reload}
// />,
// ]}
columns={[
2025-10-09 20:21:05 +08:00
MyColumns.ID(),
2025-09-25 20:20:46 +08:00
{
title: '订单号',
dataIndex: 'order_code',
search: false,
},
MyColumns.EnumTag({
title: '支付方式',
dataIndex: 'payment_method',
valueEnum: HouseOrdersPaymentMethodEnum,
}),
MyColumns.EnumTag({
title: '支付状态',
dataIndex: 'order_status',
valueEnum: HouseOrdersOrderStatusEnum,
}),
{
2025-09-25 20:20:46 +08:00
title: '应收金额',
2025-10-09 20:21:05 +08:00
dataIndex: 'amount',
search: false,
},
{
2025-10-09 20:21:05 +08:00
title: '实收金额',
dataIndex: 'actual_paid_amount',
search: false,
},
{
2025-10-09 20:21:05 +08:00
title: '退款金额',
2025-09-25 20:20:46 +08:00
dataIndex: 'refund_amount',
search: false,
},
2025-10-09 20:21:05 +08:00
{
2025-09-25 20:20:46 +08:00
title: '收款账号',
dataIndex: ['house_order_items', 'receipt_account'],
render: (text, item) =>
`${
item?.receipt_account?.company_bank
} ${item?.receipt_account?.company_account?.slice(-4)}`,
},
{
2025-09-25 20:20:46 +08:00
title: '支付时间',
dataIndex: 'paid_time',
search: false,
},
{
title: '关联机构',
dataIndex: ['company', 'name'],
search: false,
},
2025-09-25 20:20:46 +08:00
{
title: '关联项目',
dataIndex: ['asset_project', 'name'],
search: false,
},
// MyColumns.CreatedAt(),
2025-10-09 20:21:05 +08:00
MyColumns.Option({
render: (_, item: any, index, action) => (
<Space key={index}>
<Payments item={item} title="查看" reload={action?.reload} />
<MyButtons.Delete
onConfirm={() =>
2025-10-09 23:24:10 +08:00
Apis.HouseOrder.HouseOrders.Delete({ id: item.id }).then(
() => action?.reload(),
2025-10-09 20:21:05 +08:00
)
}
/>
</Space>
),
}),
]}
/>
</MyPageContainer>
);
}