2025-07-16 10:18:01 +08:00
|
|
|
import {
|
|
|
|
|
MyButtons,
|
|
|
|
|
MyColumns,
|
2025-09-18 19:40:30 +08:00
|
|
|
MyPageContainer,
|
2025-07-16 10:18:01 +08:00
|
|
|
MyProTableProps,
|
2025-09-18 19:40:30 +08:00
|
|
|
usePageTabs,
|
2025-07-16 10:18:01 +08:00
|
|
|
} from '@/common';
|
|
|
|
|
import { Apis } from '@/gen/Apis';
|
|
|
|
|
import { ProTable } from '@ant-design/pro-components';
|
2025-09-18 19:40:30 +08:00
|
|
|
import { useNavigate } from '@umijs/max';
|
2025-07-16 10:18:01 +08:00
|
|
|
import { Space } from 'antd';
|
2025-09-18 19:40:30 +08:00
|
|
|
import AccountsGet from './modals/AccountsGet';
|
|
|
|
|
|
|
|
|
|
export default function Index({ title = '项目账户' }) {
|
|
|
|
|
const navigate = useNavigate();
|
|
|
|
|
|
|
|
|
|
// 注册当前页面为标签页
|
|
|
|
|
usePageTabs({
|
|
|
|
|
tabKey: 'company-project-receipt-accounts',
|
|
|
|
|
tabLabel: title,
|
|
|
|
|
});
|
2025-07-16 10:18:01 +08:00
|
|
|
|
|
|
|
|
return (
|
2025-09-18 19:40:30 +08:00
|
|
|
<MyPageContainer
|
|
|
|
|
title={title}
|
|
|
|
|
enableTabs={true}
|
|
|
|
|
tabKey="company-apps"
|
|
|
|
|
tabLabel={title}
|
|
|
|
|
>
|
2025-07-16 10:18:01 +08:00
|
|
|
<ProTable
|
|
|
|
|
{...MyProTableProps.props}
|
|
|
|
|
request={async (params, sort) =>
|
|
|
|
|
MyProTableProps.request(
|
2025-09-18 19:40:30 +08:00
|
|
|
params,
|
2025-07-16 10:18:01 +08:00
|
|
|
sort,
|
|
|
|
|
Apis.Company.CompanyProjectReceiptAccounts.List,
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
toolBarRender={(action) => [
|
2025-09-18 19:40:30 +08:00
|
|
|
<AccountsGet key="Select" reload={action?.reload} title={title} />,
|
2025-07-16 10:18:01 +08:00
|
|
|
]}
|
|
|
|
|
columns={[
|
2025-10-04 23:45:30 +08:00
|
|
|
MyColumns.ID(),
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
title: '机构名称',
|
|
|
|
|
dataIndex: ['company', 'name'],
|
|
|
|
|
},
|
2025-07-17 13:58:54 +08:00
|
|
|
{
|
2025-10-04 23:45:30 +08:00
|
|
|
title: '项目名称',
|
|
|
|
|
dataIndex: ['project', 'name'],
|
2025-07-17 13:58:54 +08:00
|
|
|
},
|
2025-07-16 10:18:01 +08:00
|
|
|
{
|
2025-09-22 00:04:31 +08:00
|
|
|
title: '收款名称',
|
2025-07-16 10:18:01 +08:00
|
|
|
dataIndex: ['receipt_account', 'company_name'],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '开户行',
|
|
|
|
|
dataIndex: ['receipt_account', 'company_bank'],
|
|
|
|
|
search: false,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '收款账号',
|
|
|
|
|
dataIndex: ['receipt_account', 'company_account'],
|
|
|
|
|
search: false,
|
|
|
|
|
},
|
|
|
|
|
// {
|
|
|
|
|
// title: '是否默认',
|
|
|
|
|
// dataIndex: 'is_default',
|
|
|
|
|
// search: false,
|
|
|
|
|
// render(_, record) {
|
|
|
|
|
// return `${record?.is_default ? '是' : '否'} `;
|
|
|
|
|
// },
|
|
|
|
|
// },
|
2025-09-18 19:40:30 +08:00
|
|
|
MyColumns.UpdatedAt(),
|
2025-07-16 10:18:01 +08:00
|
|
|
MyColumns.Option({
|
|
|
|
|
render: (_, item: any, index, action) => (
|
|
|
|
|
<Space key={index}>
|
|
|
|
|
<MyButtons.Delete
|
|
|
|
|
onConfirm={() =>
|
|
|
|
|
Apis.Company.CompanyProjectReceiptAccounts.Delete({
|
|
|
|
|
id: item.id,
|
|
|
|
|
}).then(() => action?.reload())
|
|
|
|
|
}
|
|
|
|
|
/>
|
|
|
|
|
</Space>
|
|
|
|
|
),
|
|
|
|
|
}),
|
|
|
|
|
]}
|
|
|
|
|
/>
|
2025-09-18 19:40:30 +08:00
|
|
|
</MyPageContainer>
|
2025-07-16 10:18:01 +08:00
|
|
|
);
|
|
|
|
|
}
|