develop #14
@ -6,7 +6,8 @@ type ReturnType = ProColumns<Record<string, any>, 'text'>;
|
|||||||
|
|
||||||
export const MyColumns = {
|
export const MyColumns = {
|
||||||
ID(props?: ReturnType): ReturnType {
|
ID(props?: ReturnType): ReturnType {
|
||||||
return { title: 'ID', dataIndex: 'id', hideInSearch: true, ...props };
|
// return { title: 'ID', dataIndex: 'id', hideInSearch: true, ...props };
|
||||||
|
return { title: 'ID', dataIndex: 'id', ...props };
|
||||||
},
|
},
|
||||||
DayStatus: (start: string, end: string) => {
|
DayStatus: (start: string, end: string) => {
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
|
|||||||
@ -586,14 +586,20 @@ export const Selects = {
|
|||||||
valueType: 'select',
|
valueType: 'select',
|
||||||
hideInTable: hideInTable,
|
hideInTable: hideInTable,
|
||||||
formItemProps: { ...(required ? rulesHelper.number : {}) },
|
formItemProps: { ...(required ? rulesHelper.number : {}) },
|
||||||
request: async (params) =>
|
|
||||||
(
|
request: async (params) => {
|
||||||
await Apis.Meter.HouseMeters.List({
|
let res = await Apis.Meter.HouseMeters.List({
|
||||||
keywords: params?.KeyWords,
|
keywords: params?.KeyWords,
|
||||||
...params,
|
asset_projects_id: params?.asset_projects_id,
|
||||||
asset_projects_id: params?.asset_projects_id,
|
charge_standards_id: params?.house_charge_standards_id,
|
||||||
})
|
...params,
|
||||||
).data,
|
});
|
||||||
|
res?.data?.map((l: any) => {
|
||||||
|
l.label = l.id + ':' + l.name;
|
||||||
|
l.value = l.house_meter_has_houses[0].asset_houses_id;
|
||||||
|
});
|
||||||
|
return res?.data;
|
||||||
|
},
|
||||||
...rest,
|
...rest,
|
||||||
fieldProps: {
|
fieldProps: {
|
||||||
showSearch: true,
|
showSearch: true,
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import { MyBetaModalFormProps, renderTextHelper } from '@/common';
|
import { MyBetaModalFormProps, renderTextHelper } from '@/common';
|
||||||
import { MyModal } from '@/components/MyModal';
|
import { MyModal } from '@/components/MyModal';
|
||||||
|
import { Apis } from '@/gen/Apis';
|
||||||
import {
|
import {
|
||||||
AssetHousesOrientationEnum,
|
AssetHousesOrientationEnum,
|
||||||
AssetHousesOwnershipTypeEnum,
|
AssetHousesOwnershipTypeEnum,
|
||||||
@ -7,63 +8,96 @@ import {
|
|||||||
AssetHousesUsageEnum,
|
AssetHousesUsageEnum,
|
||||||
} from '@/gen/Enums';
|
} from '@/gen/Enums';
|
||||||
import { ProCard, ProDescriptions } from '@ant-design/pro-components';
|
import { ProCard, ProDescriptions } from '@ant-design/pro-components';
|
||||||
|
import { Space } from 'antd';
|
||||||
|
import { useCallback, useState } from 'react';
|
||||||
|
|
||||||
export default function info(props: MyBetaModalFormProps) {
|
export default function info(props: MyBetaModalFormProps) {
|
||||||
|
const [show, setShow] = useState<any>({});
|
||||||
|
const [loading, setLoading] = useState(false);
|
||||||
|
|
||||||
|
const getShow = useCallback(() => {
|
||||||
|
if (loading || !props?.item?.id) return;
|
||||||
|
|
||||||
|
setLoading(true);
|
||||||
|
Apis.Asset.AssetHouses.Show({
|
||||||
|
id: props?.item?.id,
|
||||||
|
})
|
||||||
|
.then((res) => {
|
||||||
|
setShow(res?.data);
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
return false;
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
setLoading(false);
|
||||||
|
});
|
||||||
|
}, [props?.item?.id, loading]);
|
||||||
|
|
||||||
|
// 只在弹窗打开时获取数据
|
||||||
|
const handleOpen = useCallback(() => {
|
||||||
|
if (!loading) {
|
||||||
|
getShow();
|
||||||
|
}
|
||||||
|
}, [getShow, loading]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<MyModal
|
<MyModal
|
||||||
title={props.title || '查看'}
|
title={props.title || '查看'}
|
||||||
width="1000px"
|
width="800px"
|
||||||
|
onOpen={handleOpen}
|
||||||
node={
|
node={
|
||||||
<ProCard extra={props.extra}>
|
<ProCard extra={props.extra}>
|
||||||
<ProDescriptions bordered>
|
<ProDescriptions bordered>
|
||||||
<ProDescriptions.Item label="房屋全名" span={2}>
|
<ProDescriptions.Item label="房屋全名" span={2}>
|
||||||
{props?.item?.full_name}
|
<Space>
|
||||||
|
<span>【{show?.id}】</span>
|
||||||
|
{show?.full_name}
|
||||||
|
</Space>
|
||||||
</ProDescriptions.Item>
|
</ProDescriptions.Item>
|
||||||
<ProDescriptions.Item label="房号">
|
<ProDescriptions.Item label="房号">
|
||||||
{props?.item?.name}
|
{show?.name}
|
||||||
</ProDescriptions.Item>
|
</ProDescriptions.Item>
|
||||||
<ProDescriptions.Item label="楼层">
|
<ProDescriptions.Item label="楼层">
|
||||||
{props?.item?.floor}
|
{show?.floor}
|
||||||
</ProDescriptions.Item>
|
</ProDescriptions.Item>
|
||||||
<ProDescriptions.Item label="房屋用途">
|
<ProDescriptions.Item label="房屋用途">
|
||||||
<renderTextHelper.Tag
|
<renderTextHelper.Tag
|
||||||
Enums={AssetHousesUsageEnum}
|
Enums={AssetHousesUsageEnum}
|
||||||
value={props?.item?.usage}
|
value={show?.usage}
|
||||||
key="usage"
|
key="usage"
|
||||||
/>
|
/>
|
||||||
</ProDescriptions.Item>
|
</ProDescriptions.Item>
|
||||||
<ProDescriptions.Item label="产权性质">
|
<ProDescriptions.Item label="产权性质">
|
||||||
<renderTextHelper.Tag
|
<renderTextHelper.Tag
|
||||||
Enums={AssetHousesOwnershipTypeEnum}
|
Enums={AssetHousesOwnershipTypeEnum}
|
||||||
value={props?.item?.ownership_type}
|
value={show?.ownership_type}
|
||||||
key="ownership_type"
|
key="ownership_type"
|
||||||
/>
|
/>
|
||||||
</ProDescriptions.Item>
|
</ProDescriptions.Item>
|
||||||
<ProDescriptions.Item label="建筑面积">
|
<ProDescriptions.Item label="建筑面积">
|
||||||
{props?.item?.built_area}m²
|
{show?.built_area}m²
|
||||||
</ProDescriptions.Item>
|
</ProDescriptions.Item>
|
||||||
<ProDescriptions.Item label="套内面积">
|
<ProDescriptions.Item label="套内面积">
|
||||||
{props?.item?.inside_area}m²
|
{show?.inside_area}m²
|
||||||
</ProDescriptions.Item>
|
</ProDescriptions.Item>
|
||||||
<ProDescriptions.Item label="计费面积">
|
<ProDescriptions.Item label="计费面积">
|
||||||
{props?.item?.chargeable_area}m²
|
{show?.chargeable_area}m²
|
||||||
</ProDescriptions.Item>
|
</ProDescriptions.Item>
|
||||||
<ProDescriptions.Item label="房屋状态">
|
<ProDescriptions.Item label="房屋状态">
|
||||||
<renderTextHelper.Tag
|
<renderTextHelper.Tag
|
||||||
Enums={AssetHousesStatusEnum}
|
Enums={AssetHousesStatusEnum}
|
||||||
value={props?.item?.status}
|
value={show?.status}
|
||||||
key="status"
|
key="status"
|
||||||
/>
|
/>
|
||||||
</ProDescriptions.Item>
|
</ProDescriptions.Item>
|
||||||
<ProDescriptions.Item label="户型">
|
<ProDescriptions.Item label="户型">
|
||||||
{props?.item?.room || ''}房{props?.item?.hall || ''}厅
|
{show?.room || ''}房{show?.hall || ''}厅{show?.bathroom || ''}卫
|
||||||
{props?.item?.bathroom || ''}卫{props?.item?.kitchen || ''}厨
|
{show?.kitchen || ''}厨{show?.balcony || ''}阳台
|
||||||
{props?.item?.balcony || ''}阳台
|
|
||||||
</ProDescriptions.Item>
|
</ProDescriptions.Item>
|
||||||
<ProDescriptions.Item label="朝向">
|
<ProDescriptions.Item label="朝向">
|
||||||
<renderTextHelper.Tag
|
<renderTextHelper.Tag
|
||||||
Enums={AssetHousesOrientationEnum}
|
Enums={AssetHousesOrientationEnum}
|
||||||
value={props?.item?.orientation}
|
value={show?.orientation}
|
||||||
key="orientation"
|
key="orientation"
|
||||||
/>
|
/>
|
||||||
</ProDescriptions.Item>
|
</ProDescriptions.Item>
|
||||||
|
|||||||
@ -11,6 +11,7 @@ import { useNavigate } from '@umijs/max';
|
|||||||
import { Space } from 'antd';
|
import { Space } from 'antd';
|
||||||
import GridCreate from './modals/GridCreate';
|
import GridCreate from './modals/GridCreate';
|
||||||
import GridMannger from './modals/GridMannger';
|
import GridMannger from './modals/GridMannger';
|
||||||
|
import GridShow from './modals/GridShow';
|
||||||
import GridUpdate from './modals/GridUpdate';
|
import GridUpdate from './modals/GridUpdate';
|
||||||
|
|
||||||
export default function Index({ title = '楼栋范围' }) {
|
export default function Index({ title = '楼栋范围' }) {
|
||||||
@ -72,6 +73,7 @@ export default function Index({ title = '楼栋范围' }) {
|
|||||||
MyColumns.Option({
|
MyColumns.Option({
|
||||||
render: (_, item: any, index, action) => (
|
render: (_, item: any, index, action) => (
|
||||||
<Space key={index}>
|
<Space key={index}>
|
||||||
|
<GridShow item={item} reload={action?.reload} />
|
||||||
<GridUpdate item={item} reload={action?.reload} />
|
<GridUpdate item={item} reload={action?.reload} />
|
||||||
<GridMannger item={item} reload={action?.reload} />
|
<GridMannger item={item} reload={action?.reload} />
|
||||||
<MyButtons.Delete
|
<MyButtons.Delete
|
||||||
|
|||||||
97
src/pages/asset/grids/modals/GridShow.tsx
Normal file
97
src/pages/asset/grids/modals/GridShow.tsx
Normal file
@ -0,0 +1,97 @@
|
|||||||
|
import { MyBetaModalFormProps, renderTextHelper } from '@/common';
|
||||||
|
import { MyModal } from '@/components/MyModal';
|
||||||
|
import { Apis } from '@/gen/Apis';
|
||||||
|
import {
|
||||||
|
AssetHousesOrientationEnum,
|
||||||
|
AssetHousesOwnershipTypeEnum,
|
||||||
|
AssetHousesStatusEnum,
|
||||||
|
AssetHousesUsageEnum,
|
||||||
|
} from '@/gen/Enums';
|
||||||
|
import { ProCard, ProDescriptions } from '@ant-design/pro-components';
|
||||||
|
import { Space } from 'antd';
|
||||||
|
import { useState } from 'react';
|
||||||
|
|
||||||
|
export default function info(props: MyBetaModalFormProps) {
|
||||||
|
const [show, setShow] = useState<any>({});
|
||||||
|
const getShow = () => {
|
||||||
|
Apis.Grid.Grids.Show({
|
||||||
|
id: props?.item?.id,
|
||||||
|
})
|
||||||
|
.then((res) => {
|
||||||
|
setShow(res?.data);
|
||||||
|
})
|
||||||
|
.catch(() => false);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 只在弹窗打开时获取数据
|
||||||
|
const handleOpen = () => {
|
||||||
|
getShow();
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<MyModal
|
||||||
|
title={props.title || '查看'}
|
||||||
|
width="800px"
|
||||||
|
onOpen={handleOpen}
|
||||||
|
node={
|
||||||
|
<ProCard extra={props.extra}>
|
||||||
|
<ProDescriptions bordered>
|
||||||
|
<ProDescriptions.Item label="房屋全名" span={2}>
|
||||||
|
<Space>
|
||||||
|
<span>【{show?.id}】</span>
|
||||||
|
{show?.name}
|
||||||
|
</Space>
|
||||||
|
</ProDescriptions.Item>
|
||||||
|
<ProDescriptions.Item label="房号">
|
||||||
|
{show?.name}
|
||||||
|
</ProDescriptions.Item>
|
||||||
|
<ProDescriptions.Item label="楼层">
|
||||||
|
{show?.floor}
|
||||||
|
</ProDescriptions.Item>
|
||||||
|
<ProDescriptions.Item label="房屋用途">
|
||||||
|
<renderTextHelper.Tag
|
||||||
|
Enums={AssetHousesUsageEnum}
|
||||||
|
value={show?.usage}
|
||||||
|
key="usage"
|
||||||
|
/>
|
||||||
|
</ProDescriptions.Item>
|
||||||
|
<ProDescriptions.Item label="产权性质">
|
||||||
|
<renderTextHelper.Tag
|
||||||
|
Enums={AssetHousesOwnershipTypeEnum}
|
||||||
|
value={show?.ownership_type}
|
||||||
|
key="ownership_type"
|
||||||
|
/>
|
||||||
|
</ProDescriptions.Item>
|
||||||
|
<ProDescriptions.Item label="建筑面积">
|
||||||
|
{show?.built_area}m²
|
||||||
|
</ProDescriptions.Item>
|
||||||
|
<ProDescriptions.Item label="套内面积">
|
||||||
|
{show?.inside_area}m²
|
||||||
|
</ProDescriptions.Item>
|
||||||
|
<ProDescriptions.Item label="计费面积">
|
||||||
|
{show?.chargeable_area}m²
|
||||||
|
</ProDescriptions.Item>
|
||||||
|
<ProDescriptions.Item label="房屋状态">
|
||||||
|
<renderTextHelper.Tag
|
||||||
|
Enums={AssetHousesStatusEnum}
|
||||||
|
value={show?.status}
|
||||||
|
key="status"
|
||||||
|
/>
|
||||||
|
</ProDescriptions.Item>
|
||||||
|
<ProDescriptions.Item label="户型">
|
||||||
|
{show?.room || ''}房{show?.hall || ''}厅{show?.bathroom || ''}卫
|
||||||
|
{show?.kitchen || ''}厨{show?.balcony || ''}阳台
|
||||||
|
</ProDescriptions.Item>
|
||||||
|
<ProDescriptions.Item label="朝向">
|
||||||
|
<renderTextHelper.Tag
|
||||||
|
Enums={AssetHousesOrientationEnum}
|
||||||
|
value={show?.orientation}
|
||||||
|
key="orientation"
|
||||||
|
/>
|
||||||
|
</ProDescriptions.Item>
|
||||||
|
</ProDescriptions>
|
||||||
|
</ProCard>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -39,12 +39,30 @@ export default function Update(props: MyBetaModalFormProps) {
|
|||||||
}}
|
}}
|
||||||
onFinish={async (values: any) => {
|
onFinish={async (values: any) => {
|
||||||
console.log(values);
|
console.log(values);
|
||||||
// values?.grid_ranges?.map((res: { asset_projects_id: string }) => {
|
// 确保grid_ranges是正确的对象数组格式
|
||||||
// res.asset_projects_id = props?.item?.id;
|
if (
|
||||||
// });
|
values.grid_ranges &&
|
||||||
|
Array.isArray(values.grid_ranges) &&
|
||||||
|
typeof values.grid_ranges[0] === 'number'
|
||||||
|
) {
|
||||||
|
// 如果是ID数组,需要转换为对象数组
|
||||||
|
const dataSource = form.getFieldValue('_dataSource') || [];
|
||||||
|
const grid_ranges = values.grid_ranges.map((id: any) => {
|
||||||
|
const unit = dataSource.find(
|
||||||
|
(item: any) => item.asset_units_id === id.toString(),
|
||||||
|
);
|
||||||
|
return {
|
||||||
|
asset_projects_id: props?.item?.asset_projects_id,
|
||||||
|
asset_buildings_id: unit?.asset_buildings_id,
|
||||||
|
asset_units_id: id.toString(),
|
||||||
|
};
|
||||||
|
});
|
||||||
|
values.grid_ranges = grid_ranges;
|
||||||
|
}
|
||||||
|
|
||||||
return Apis.Grid.Grids.Update({
|
return Apis.Grid.Grids.Update({
|
||||||
...values,
|
...values,
|
||||||
asset_projects_id: props?.item?.id || values?.asset_projects_id,
|
asset_projects_id: props?.item?.asset_projects_id,
|
||||||
id: props?.item?.id,
|
id: props?.item?.id,
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
|||||||
@ -1,20 +1,25 @@
|
|||||||
import { MyBetaModalFormProps } from '@/common';
|
import { MyBetaModalFormProps } from '@/common';
|
||||||
|
import HousesShow from '@/pages/asset/dictionary/modals/HousesShow';
|
||||||
import { ProCard, ProDescriptions } from '@ant-design/pro-components';
|
import { ProCard, ProDescriptions } from '@ant-design/pro-components';
|
||||||
import { Space } from 'antd';
|
import { Space } from 'antd';
|
||||||
|
|
||||||
export default function info(props: MyBetaModalFormProps) {
|
export default function info(props: MyBetaModalFormProps) {
|
||||||
const { item } = props;
|
const { item } = props;
|
||||||
|
|
||||||
// 添加调试日志
|
|
||||||
console.log('BillInfo props:', props);
|
|
||||||
console.log('BillInfo 11111111:', item);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Space direction="vertical" style={{ width: '100%' }}>
|
<Space direction="vertical" style={{ width: '100%' }}>
|
||||||
<ProCard title="基本信息">
|
<ProCard title="基本信息">
|
||||||
<ProDescriptions bordered>
|
<ProDescriptions bordered>
|
||||||
<ProDescriptions.Item label="房屋名称" span={2}>
|
<ProDescriptions.Item label="房屋名称" span={2}>
|
||||||
{item?.asset_house?.full_name || '-'}
|
<Space>
|
||||||
|
{item?.asset_house?.full_name || '-'}
|
||||||
|
{item?.asset_houses_id && (
|
||||||
|
<HousesShow
|
||||||
|
item={{ id: item?.asset_houses_id }}
|
||||||
|
reload={props?.reload}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</Space>
|
||||||
</ProDescriptions.Item>
|
</ProDescriptions.Item>
|
||||||
<ProDescriptions.Item label="应付金额">
|
<ProDescriptions.Item label="应付金额">
|
||||||
{item?.total_payable_sum || '-'}
|
{item?.total_payable_sum || '-'}
|
||||||
|
|||||||
@ -11,11 +11,13 @@ import {
|
|||||||
HouseChargeTasksTypeEnum,
|
HouseChargeTasksTypeEnum,
|
||||||
} from '@/gen/Enums';
|
} from '@/gen/Enums';
|
||||||
import { ProTable } from '@ant-design/pro-components';
|
import { ProTable } from '@ant-design/pro-components';
|
||||||
|
import { useNavigate } from '@umijs/max';
|
||||||
import { Space } from 'antd';
|
import { Space } from 'antd';
|
||||||
import TaskCreate from './modals/TaskCreate';
|
import TaskCreate from './modals/TaskCreate';
|
||||||
import TaskShow from './modals/TaskShow';
|
import TaskShow from './modals/TaskShow';
|
||||||
|
|
||||||
export default function Index({ title = '账单任务' }) {
|
export default function Index({ title = '账单任务' }) {
|
||||||
|
const navigate = useNavigate();
|
||||||
// 注册当前页面为标签页
|
// 注册当前页面为标签页
|
||||||
usePageTabs({
|
usePageTabs({
|
||||||
tabKey: 'house_charge_tasks',
|
tabKey: 'house_charge_tasks',
|
||||||
@ -42,11 +44,17 @@ export default function Index({ title = '账单任务' }) {
|
|||||||
<TaskCreate key="Create" reload={action?.reload} title="账单任务" />,
|
<TaskCreate key="Create" reload={action?.reload} title="账单任务" />,
|
||||||
]}
|
]}
|
||||||
columns={[
|
columns={[
|
||||||
|
MyColumns.ID(),
|
||||||
{
|
{
|
||||||
title: '机构',
|
title: '机构',
|
||||||
dataIndex: ['company', 'name'],
|
dataIndex: ['company', 'name'],
|
||||||
search: false,
|
search: false,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: '项目',
|
||||||
|
dataIndex: ['asset_project', 'name'],
|
||||||
|
search: false,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '任务ID',
|
title: '任务ID',
|
||||||
dataIndex: 'id',
|
dataIndex: 'id',
|
||||||
@ -66,6 +74,17 @@ export default function Index({ title = '账单任务' }) {
|
|||||||
title: '收费标准',
|
title: '收费标准',
|
||||||
dataIndex: ['house_charge_standard', 'name'],
|
dataIndex: ['house_charge_standard', 'name'],
|
||||||
search: false,
|
search: false,
|
||||||
|
render: (_, record) => (
|
||||||
|
<MyButtons.View
|
||||||
|
title={record?.house_charge_standard?.name || '-'}
|
||||||
|
type="link"
|
||||||
|
onClick={() => {
|
||||||
|
navigate(
|
||||||
|
`/charge/standard/show/${record.house_charge_standards_id}`,
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '账单月份',
|
title: '账单月份',
|
||||||
|
|||||||
@ -8,9 +8,11 @@ import { MyModal } from '@/components/MyModal';
|
|||||||
import { Apis } from '@/gen/Apis';
|
import { Apis } from '@/gen/Apis';
|
||||||
import { HouseChargeTaskDetailsStatusEnum } from '@/gen/Enums';
|
import { HouseChargeTaskDetailsStatusEnum } from '@/gen/Enums';
|
||||||
import { ProTable } from '@ant-design/pro-components';
|
import { ProTable } from '@ant-design/pro-components';
|
||||||
|
import { useNavigate } from '@umijs/max';
|
||||||
import { Space } from 'antd';
|
import { Space } from 'antd';
|
||||||
|
|
||||||
export default function AssetInfo(props: MyBetaModalFormProps) {
|
export default function AssetInfo(props: MyBetaModalFormProps) {
|
||||||
|
const navigate = useNavigate();
|
||||||
return (
|
return (
|
||||||
<MyModal
|
<MyModal
|
||||||
title={props.title || '查看'}
|
title={props.title || '查看'}
|
||||||
@ -32,6 +34,15 @@ export default function AssetInfo(props: MyBetaModalFormProps) {
|
|||||||
title: '对象',
|
title: '对象',
|
||||||
dataIndex: 'full_name',
|
dataIndex: 'full_name',
|
||||||
search: false,
|
search: false,
|
||||||
|
render: (_, record) => (
|
||||||
|
<MyButtons.View
|
||||||
|
title={record.full_name}
|
||||||
|
type="link"
|
||||||
|
onClick={() => {
|
||||||
|
navigate(`/bills/summary/show/${record.asset_houses_id}`);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
),
|
||||||
},
|
},
|
||||||
MyColumns.EnumTag({
|
MyColumns.EnumTag({
|
||||||
title: '状态',
|
title: '状态',
|
||||||
|
|||||||
@ -8,7 +8,7 @@ import {
|
|||||||
import { Apis } from '@/gen/Apis';
|
import { Apis } from '@/gen/Apis';
|
||||||
import {
|
import {
|
||||||
HouseChargeTasksStatusEnum,
|
HouseChargeTasksStatusEnum,
|
||||||
HouseChargeTasksTypeEnum,
|
HouseMeterTasksGenerationMethodEnum,
|
||||||
} from '@/gen/Enums';
|
} from '@/gen/Enums';
|
||||||
import { ProTable } from '@ant-design/pro-components';
|
import { ProTable } from '@ant-design/pro-components';
|
||||||
import { Space } from 'antd';
|
import { Space } from 'antd';
|
||||||
@ -38,31 +38,32 @@ export default function Index({ title = '仪表账单' }) {
|
|||||||
<TaskCreate key="Create" reload={action?.reload} title="账单任务" />,
|
<TaskCreate key="Create" reload={action?.reload} title="账单任务" />,
|
||||||
]}
|
]}
|
||||||
columns={[
|
columns={[
|
||||||
|
MyColumns.ID(),
|
||||||
{
|
{
|
||||||
title: '机构',
|
title: '机构',
|
||||||
dataIndex: ['company', 'name'],
|
dataIndex: ['company', 'name'],
|
||||||
search: false,
|
search: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '任务ID',
|
title: '项目',
|
||||||
dataIndex: 'id',
|
dataIndex: ['asset_project', 'name'],
|
||||||
search: false,
|
search: false,
|
||||||
},
|
},
|
||||||
MyColumns.EnumTag({
|
|
||||||
title: '创建类型',
|
|
||||||
dataIndex: 'type',
|
|
||||||
valueEnum: HouseChargeTasksTypeEnum,
|
|
||||||
}),
|
|
||||||
MyColumns.EnumTag({
|
MyColumns.EnumTag({
|
||||||
title: '任务状态',
|
title: '任务状态',
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
valueEnum: HouseChargeTasksStatusEnum,
|
valueEnum: HouseChargeTasksStatusEnum,
|
||||||
}),
|
}),
|
||||||
{
|
MyColumns.EnumTag({
|
||||||
title: '收费标准',
|
title: '生成方式',
|
||||||
dataIndex: ['house_charge_standard', 'name'],
|
dataIndex: 'generation_method',
|
||||||
search: false,
|
valueEnum: HouseMeterTasksGenerationMethodEnum,
|
||||||
},
|
}),
|
||||||
|
// {
|
||||||
|
// title: '收费标准',
|
||||||
|
// dataIndex: ['house_charge_standard', 'name'],
|
||||||
|
// search: false,
|
||||||
|
// },
|
||||||
{
|
{
|
||||||
title: '账单月份',
|
title: '账单月份',
|
||||||
render: (_, record) => {
|
render: (_, record) => {
|
||||||
@ -88,19 +89,38 @@ export default function Index({ title = '仪表账单' }) {
|
|||||||
dataIndex: 'task_count',
|
dataIndex: 'task_count',
|
||||||
search: false,
|
search: false,
|
||||||
},
|
},
|
||||||
// MyColumns.UpdatedAt(),
|
MyColumns.UpdatedAt(),
|
||||||
MyColumns.CreatedAt(),
|
// MyColumns.CreatedAt(),
|
||||||
MyColumns.Option({
|
MyColumns.Option({
|
||||||
render: (_, item: any, index, action) => (
|
render: (_, item: any, index, action) => (
|
||||||
<Space key={index}>
|
<Space key={index}>
|
||||||
<TaskShow item={item} title="查看" reload={action?.reload} />
|
<TaskShow item={item} title="查看" reload={action?.reload} />
|
||||||
<MyButtons.Delete
|
|
||||||
|
<MyButtons.Default
|
||||||
|
title={
|
||||||
|
item.status ===
|
||||||
|
HouseChargeTasksStatusEnum.Completed.value ||
|
||||||
|
item.status === HouseChargeTasksStatusEnum.Failed.value
|
||||||
|
? '重新执行'
|
||||||
|
: '执行'
|
||||||
|
}
|
||||||
|
type="link"
|
||||||
|
color="primary"
|
||||||
|
isConfirm
|
||||||
|
description="是否重新执行此任务?"
|
||||||
onConfirm={() =>
|
onConfirm={() =>
|
||||||
Apis.HouseCharage.HouseChargeTasks.Delete({
|
Apis.Meter.HouseMeterTasks.ExecuteMeterTasks({
|
||||||
id: item.id,
|
id: item.id,
|
||||||
}).then(() => action?.reload())
|
}).then(() => action?.reload())
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
{/* <MyButtons.Delete
|
||||||
|
onConfirm={() =>
|
||||||
|
Apis.Meter.HouseMeterTasks.Delete({
|
||||||
|
id: item.id,
|
||||||
|
}).then(() => action?.reload())
|
||||||
|
}
|
||||||
|
/> */}
|
||||||
</Space>
|
</Space>
|
||||||
),
|
),
|
||||||
}),
|
}),
|
||||||
|
|||||||
@ -15,9 +15,9 @@ export default function AssetInfo(props: MyBetaModalFormProps) {
|
|||||||
{...MyProTableProps.props}
|
{...MyProTableProps.props}
|
||||||
request={async (params, sort) =>
|
request={async (params, sort) =>
|
||||||
MyProTableProps.request(
|
MyProTableProps.request(
|
||||||
{ ...params, house_charge_tasks_id: props?.item?.id },
|
{ ...params, house_meter_task_id: props?.item?.id },
|
||||||
sort,
|
sort,
|
||||||
Apis.Meter.HouseMeterTasks.List,
|
Apis.Meter.HouseMeterTaskDetails.List,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
columns={[
|
columns={[
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user