This commit is contained in:
parent
abfad6a385
commit
092888fe19
111
src/pages/meter/bills/index.tsx
Normal file
111
src/pages/meter/bills/index.tsx
Normal file
@ -0,0 +1,111 @@
|
||||
import {
|
||||
MyButtons,
|
||||
MyColumns,
|
||||
MyPageContainer,
|
||||
MyProTableProps,
|
||||
usePageTabs,
|
||||
} from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { HouseChargeTaskDetailsStatusEnum } from '@/gen/Enums';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { useNavigate } from '@umijs/max';
|
||||
import { Space } from 'antd';
|
||||
|
||||
export default function Index({ title = '仪表账单' }) {
|
||||
const navigate = useNavigate();
|
||||
|
||||
// 注册当前页面为标签页
|
||||
usePageTabs({
|
||||
tabKey: 'house_meter_bills',
|
||||
tabLabel: title,
|
||||
});
|
||||
|
||||
return (
|
||||
<MyPageContainer
|
||||
title={title}
|
||||
enableTabs={true}
|
||||
tabKey="house_meter_bills"
|
||||
tabLabel={title}
|
||||
>
|
||||
<ProTable
|
||||
{...MyProTableProps.props}
|
||||
request={async (params, sort) =>
|
||||
MyProTableProps.request(
|
||||
params,
|
||||
sort,
|
||||
Apis.Meter.HouseMeterTaskDetails.List,
|
||||
)
|
||||
}
|
||||
// toolBarRender={(action) => [
|
||||
// <TaskCreate key="Create" reload={action?.reload} title="账单任务" />,
|
||||
// ]}
|
||||
columns={[
|
||||
MyColumns.ID(),
|
||||
{
|
||||
title: '仪表名称',
|
||||
dataIndex: ['meter_data', 'name'],
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '关联房屋',
|
||||
dataIndex: 'full_name',
|
||||
search: false,
|
||||
render: (_, record) => (
|
||||
<MyButtons.View
|
||||
title={record.full_name}
|
||||
type="link"
|
||||
onClick={() => {
|
||||
navigate(`/bills/summary/show/${record.asset_houses_id}`);
|
||||
}}
|
||||
/>
|
||||
),
|
||||
},
|
||||
MyColumns.EnumTag({
|
||||
title: '状态',
|
||||
dataIndex: 'status',
|
||||
valueEnum: HouseChargeTaskDetailsStatusEnum,
|
||||
}),
|
||||
|
||||
{
|
||||
title: '收费标准',
|
||||
dataIndex: ['charge_standard', 'name'],
|
||||
render: (_, record) => {
|
||||
return `【${record.charge_standard.id}】${record.charge_standard.name}`;
|
||||
},
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '账单月份',
|
||||
render: (_, record) => {
|
||||
return `${record.year}-${String(record.month).padStart(2, '0')}`;
|
||||
},
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '完成时间',
|
||||
dataIndex: 'processed_time',
|
||||
search: false,
|
||||
},
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
<MyButtons.Default
|
||||
title="重新执行"
|
||||
type="link"
|
||||
color="primary"
|
||||
isConfirm
|
||||
description="确认执行此任务吗?"
|
||||
onConfirm={() =>
|
||||
Apis.HouseCharage.HouseChargeTaskDetails.CreateHouseBill({
|
||||
id: item.id,
|
||||
}).then(() => action?.reload())
|
||||
}
|
||||
/>
|
||||
</Space>
|
||||
),
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
</MyPageContainer>
|
||||
);
|
||||
}
|
||||
@ -15,7 +15,7 @@ import { Space } from 'antd';
|
||||
import TaskCreate from './modals/TaskCreate';
|
||||
import TaskShow from './modals/TaskShow';
|
||||
|
||||
export default function Index({ title = '仪表账单' }) {
|
||||
export default function Index({ title = '仪表任务' }) {
|
||||
// 注册当前页面为标签页
|
||||
usePageTabs({
|
||||
tabKey: 'house_meter_tasks',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user