This commit is contained in:
commit
b66917f999
@ -445,7 +445,41 @@ export const Selects = {
|
||||
},
|
||||
};
|
||||
},
|
||||
//房屋全称
|
||||
AssetFullName(props?: PropsType): ReturnType {
|
||||
const {
|
||||
title = '选择房屋',
|
||||
key = 'asset_houses_id',
|
||||
required = false,
|
||||
hideInTable = true,
|
||||
...rest
|
||||
} = props ?? {};
|
||||
|
||||
return {
|
||||
title: title,
|
||||
key: key,
|
||||
valueType: 'select',
|
||||
hideInTable: hideInTable,
|
||||
formItemProps: { ...(required ? rulesHelper.number : {}) },
|
||||
request: async (params) =>
|
||||
(
|
||||
await Apis.Asset.AssetHouses.SelectFullName({
|
||||
keywords: params?.keyWords,
|
||||
...params,
|
||||
})
|
||||
).data,
|
||||
...rest,
|
||||
fieldProps: {
|
||||
showSearch: true,
|
||||
placeholder: '请选择(支持关键字搜索)',
|
||||
fieldNames: {
|
||||
label: 'label',
|
||||
value: 'value',
|
||||
},
|
||||
...rest?.fieldProps,
|
||||
},
|
||||
};
|
||||
},
|
||||
//获取广告位
|
||||
GetBannerSpace(props?: PropsType): ReturnType {
|
||||
const {
|
||||
|
||||
1
src/gen/ApiTypes.d.ts
vendored
1
src/gen/ApiTypes.d.ts
vendored
@ -578,7 +578,6 @@ declare namespace ApiTypes {
|
||||
"year"?: number; // 账单年份
|
||||
"month"?: number; // 账单月份
|
||||
"type"?: string; // 账单类型,[enum:HouseBillsTypeEnum]
|
||||
"has_refunding"?: boolean; // 是否有退款中:false-无,true-有
|
||||
};
|
||||
type SummaryBillList = {
|
||||
"project_name"?: string; // 模糊搜索:项目名称
|
||||
|
||||
1924
src/gen/Enums.ts
1924
src/gen/Enums.ts
File diff suppressed because it is too large
Load Diff
@ -21,7 +21,7 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
labelCol={{ span: 4 }}
|
||||
wrapperCol={{ span: 24 }}
|
||||
labelAlign="right"
|
||||
trigger={<MyButtons.Edit title={`调整`} size="small" type="primary" />}
|
||||
trigger={<MyButtons.Edit title={'范围'} size="small" type="primary" />}
|
||||
form={form}
|
||||
key={new Date().getTime()}
|
||||
onOpenChange={(open: any) => {
|
||||
|
||||
@ -5,6 +5,7 @@ import {
|
||||
MyProTableProps,
|
||||
useCurrentPermissions,
|
||||
} from '@/common';
|
||||
import { MyExport } from '@/components/MyExport';
|
||||
import { Selects } from '@/components/Select';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import {
|
||||
@ -14,9 +15,13 @@ import {
|
||||
} from '@/gen/Enums';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { Space } from 'antd';
|
||||
import { useState } from 'react';
|
||||
|
||||
import SpaceShow from './modals/SpaceShow';
|
||||
import SpaceUpdate from './modals/SpaceUpdate';
|
||||
|
||||
export default function Index({ title = '车位列表' }) {
|
||||
const [getParams, setParams] = useState({ page: 1 });
|
||||
const getCurrentPermissions = useCurrentPermissions();
|
||||
let tableRender = (item: any, action: any) => {
|
||||
return getCurrentPermissions({
|
||||
@ -44,11 +49,22 @@ export default function Index({ title = '车位列表' }) {
|
||||
headerTitle="车位列表"
|
||||
tooltip="车位列表的信息管理,请在【项目列表】的【配置】中进行操作"
|
||||
request={async (params, sort) =>
|
||||
MyProTableProps.request(params, sort, Apis.Asset.AssetCarPorts.List)
|
||||
MyProTableProps.request(
|
||||
params,
|
||||
sort,
|
||||
Apis.Asset.AssetCarPorts.List,
|
||||
setParams,
|
||||
)
|
||||
}
|
||||
// toolBarRender={(action) => [
|
||||
// <Create key="Create" reload={action?.reload} title="车场" />,
|
||||
// ]}
|
||||
toolBarRender={(action) => [
|
||||
<MyExport
|
||||
key="export"
|
||||
item={{ current: getParams?.page || 1, ...getParams }}
|
||||
reload={action?.reload}
|
||||
download={Apis.Asset.AssetCarPorts}
|
||||
/>,
|
||||
// <Create key="Create" reload={action?.reload} title="车场" />,
|
||||
]}
|
||||
columns={[
|
||||
MyColumns.ID({ search: false }),
|
||||
Selects?.AssetProjects({
|
||||
@ -59,11 +75,12 @@ export default function Index({ title = '车位列表' }) {
|
||||
{
|
||||
title: '项目名称',
|
||||
dataIndex: ['asset_project', 'name'],
|
||||
search: {
|
||||
transform: (value) => {
|
||||
return { project_name: value };
|
||||
},
|
||||
},
|
||||
// search: {
|
||||
// transform: (value) => {
|
||||
// return { project_name: value };
|
||||
// },
|
||||
// },
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '车场名称',
|
||||
@ -106,7 +123,10 @@ export default function Index({ title = '车位列表' }) {
|
||||
MyColumns.CreatedAt(),
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>{tableRender(item, action)}</Space>
|
||||
<Space key={index}>
|
||||
<SpaceShow item={item} reload={action?.reload} title={title} />
|
||||
{tableRender(item, action)}
|
||||
</Space>
|
||||
),
|
||||
}),
|
||||
]}
|
||||
|
||||
@ -5,6 +5,7 @@ import {
|
||||
MyModalFormProps,
|
||||
rulesHelper,
|
||||
} from '@/common';
|
||||
import { Selects } from '@/components/Select';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import {
|
||||
AssetCarPortsPropertyTypeEnum,
|
||||
@ -14,7 +15,7 @@ import {
|
||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||
import { Form, message } from 'antd';
|
||||
|
||||
export default function Create(props: MyBetaModalFormProps) {
|
||||
export default function SpaceCreate(props: MyBetaModalFormProps) {
|
||||
const [form] = Form.useForm();
|
||||
return (
|
||||
<BetaSchemaForm<ApiTypes.Asset.AssetCarPorts.Store>
|
||||
@ -60,6 +61,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
title: '建筑面积',
|
||||
valueType: 'digit',
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.number },
|
||||
fieldProps: {
|
||||
addonAfter: 'm²',
|
||||
},
|
||||
@ -83,7 +85,24 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
valueEnum: AssetCarPortsStatusEnum,
|
||||
required: true,
|
||||
}),
|
||||
|
||||
{
|
||||
key: 'owner_name',
|
||||
title: '业主姓名',
|
||||
colProps: { span: 24 },
|
||||
},
|
||||
{
|
||||
key: 'owner_phone',
|
||||
title: '业主手机号',
|
||||
colProps: { span: 24 },
|
||||
},
|
||||
Selects?.AssetFullName({
|
||||
key: 'asset_houses_id',
|
||||
params: {
|
||||
asset_projects_id: props?.item?.asset_projects_id,
|
||||
},
|
||||
title: '关联房屋',
|
||||
colProps: { span: 24 },
|
||||
}),
|
||||
{
|
||||
key: 'remark',
|
||||
title: '备注',
|
||||
|
||||
95
src/pages/asset/parking_space/modals/SpaceShow.tsx
Normal file
95
src/pages/asset/parking_space/modals/SpaceShow.tsx
Normal file
@ -0,0 +1,95 @@
|
||||
import { MyBetaModalFormProps, MyButtons, renderTextHelper } from '@/common';
|
||||
import { MyModal } from '@/components/MyModal';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import {
|
||||
AssetCarPortsPropertyTypeEnum,
|
||||
AssetCarPortsStatusEnum,
|
||||
AssetCarPortsTypeEnum,
|
||||
} from '@/gen/Enums';
|
||||
import { ProCard, ProDescriptions } from '@ant-design/pro-components';
|
||||
import { useNavigate } from '@umijs/max';
|
||||
import { Space, Spin } from 'antd';
|
||||
import { useState } from 'react';
|
||||
|
||||
export default function SpaceShow(props: MyBetaModalFormProps) {
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [data, setData] = useState<any>({});
|
||||
const navigate = useNavigate();
|
||||
|
||||
return (
|
||||
<MyModal
|
||||
title={'查看'}
|
||||
width="800px"
|
||||
onOpen={() => {
|
||||
if (props?.item?.id) {
|
||||
setLoading(true);
|
||||
Apis.Asset.AssetCarPorts.Show({ id: props.item.id })
|
||||
.then((res) => {
|
||||
setData(res?.data || {});
|
||||
})
|
||||
.finally(() => {
|
||||
setLoading(false);
|
||||
});
|
||||
}
|
||||
}}
|
||||
node={
|
||||
<Space direction="vertical" style={{ width: '100%' }}>
|
||||
<ProCard>
|
||||
<Spin spinning={loading}>
|
||||
<ProDescriptions column={2} bordered>
|
||||
<ProDescriptions.Item label="车位号">
|
||||
{data?.name}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="建筑面积">
|
||||
{data?.built_area} m²
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="类型">
|
||||
<renderTextHelper.Tag
|
||||
Enums={AssetCarPortsTypeEnum}
|
||||
value={data?.type}
|
||||
/>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="产权类型">
|
||||
<renderTextHelper.Tag
|
||||
Enums={AssetCarPortsPropertyTypeEnum}
|
||||
value={data?.property_type}
|
||||
/>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="状态">
|
||||
<renderTextHelper.Tag
|
||||
Enums={AssetCarPortsStatusEnum}
|
||||
value={data?.status}
|
||||
/>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="业主姓名">
|
||||
{data?.owner_name || '-'}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="业主手机号">
|
||||
{data?.owner_phone || '-'}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="关联房屋">
|
||||
{data?.asset_houses_id ? (
|
||||
<MyButtons.View
|
||||
title="查看"
|
||||
onClick={() => {
|
||||
navigate(
|
||||
`/customer/archive/show/${data?.asset_houses_id}`,
|
||||
);
|
||||
}}
|
||||
/>
|
||||
) : (
|
||||
'无'
|
||||
)}
|
||||
</ProDescriptions.Item>
|
||||
|
||||
<ProDescriptions.Item label="备注" span={2}>
|
||||
{data?.remark || '-'}
|
||||
</ProDescriptions.Item>
|
||||
</ProDescriptions>
|
||||
</Spin>
|
||||
</ProCard>
|
||||
</Space>
|
||||
}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@ -5,6 +5,7 @@ import {
|
||||
MyModalFormProps,
|
||||
rulesHelper,
|
||||
} from '@/common';
|
||||
import { Selects } from '@/components/Select';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import {
|
||||
AssetCarPortsPropertyTypeEnum,
|
||||
@ -59,6 +60,7 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
title: '建筑面积',
|
||||
valueType: 'digit',
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.number },
|
||||
fieldProps: {
|
||||
addonAfter: 'm²',
|
||||
},
|
||||
@ -82,6 +84,22 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
valueEnum: AssetCarPortsStatusEnum,
|
||||
required: true,
|
||||
}),
|
||||
{
|
||||
key: 'owner_name',
|
||||
title: '业主姓名',
|
||||
colProps: { span: 24 },
|
||||
},
|
||||
{
|
||||
key: 'owner_phone',
|
||||
title: '业主手机号',
|
||||
colProps: { span: 24 },
|
||||
},
|
||||
Selects?.AssetFullName({
|
||||
key: 'asset_houses_id',
|
||||
params: {
|
||||
asset_projects_id: props?.item?.asset_projects_id,
|
||||
},
|
||||
}),
|
||||
{
|
||||
key: 'remark',
|
||||
title: '备注',
|
||||
|
||||
@ -4,7 +4,7 @@ import { Apis } from '@/gen/Apis';
|
||||
import { HomeFilled } from '@ant-design/icons';
|
||||
import { ProCard } from '@ant-design/pro-components';
|
||||
import { useNavigate } from '@umijs/max';
|
||||
import { Empty, Space, Tag } from 'antd';
|
||||
import { Empty, Space, Tabs, Tag } from 'antd';
|
||||
import { useEffect, useState } from 'react';
|
||||
import SearchInfo from './components/SearchInfo';
|
||||
|
||||
@ -12,14 +12,40 @@ export default function Index({ title = '房屋账单' }) {
|
||||
const navigate = useNavigate();
|
||||
// const [selectedBuilding, setSelectedBuilding] =
|
||||
// useState<SelectedBuilding | null>(null);
|
||||
const [items, setItems] = useState<any>([
|
||||
{
|
||||
key: '1',
|
||||
label: '全部房屋',
|
||||
},
|
||||
]);
|
||||
const [params, setParams] = useState<any>({ page: 1 });
|
||||
const [getSummaryBillListData, setGetSummaryBillListData] = useState<any>({});
|
||||
|
||||
const setPageStatistics = (res: any) => {
|
||||
setItems([
|
||||
{
|
||||
key: '1',
|
||||
label: '全部房屋',
|
||||
},
|
||||
{
|
||||
key: '2',
|
||||
label: `清欠房屋数(${res?.['清欠房屋数']})`,
|
||||
},
|
||||
{
|
||||
key: '3',
|
||||
label: `欠费房屋数(${res?.['欠费房屋数']})`,
|
||||
},
|
||||
]);
|
||||
};
|
||||
|
||||
const getSummaryBillList = (data: any) => {
|
||||
Apis.Bill.HouseBills.SummaryBillList({ ...params, ...data }).then((res) => {
|
||||
setParams({ ...params, ...data });
|
||||
setGetSummaryBillListData(res);
|
||||
});
|
||||
Apis.Bill.HouseBills.SummaryBillList({ ...params, ...data }).then(
|
||||
(res: any) => {
|
||||
setParams({ ...params, ...data });
|
||||
setPageStatistics(res?.statistics || {});
|
||||
setGetSummaryBillListData(res);
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
@ -55,6 +81,17 @@ export default function Index({ title = '房屋账单' }) {
|
||||
}}
|
||||
/>
|
||||
<ProCard>
|
||||
<Tabs
|
||||
defaultActiveKey="1"
|
||||
items={items}
|
||||
onChange={(e) => {
|
||||
console.log(e);
|
||||
getSummaryBillList({
|
||||
page: 1,
|
||||
has_overdue: e === '3' ? true : e === '2' ? false : undefined,
|
||||
});
|
||||
}}
|
||||
/>
|
||||
<div style={{ display: 'flex', flexWrap: 'wrap', gap: 15 }}>
|
||||
{getSummaryBillListData?.data?.length ? null : (
|
||||
<div
|
||||
|
||||
164
src/pages/charge/standard/components/CarPortFee.tsx
Normal file
164
src/pages/charge/standard/components/CarPortFee.tsx
Normal file
@ -0,0 +1,164 @@
|
||||
import { MyButtons, MyColumns, MyProTableProps } from '@/common';
|
||||
import { Selects } from '@/components/Select';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import {
|
||||
HouseBillsTypeEnum,
|
||||
HouseChargeStandardsCalculationMethodEnum,
|
||||
HouseChargeStandardsCalculationModeEnum,
|
||||
HouseChargeStandardsCalculationPeriodEnum,
|
||||
HouseChargeStandardsPriceAlgorithmEnum,
|
||||
} from '@/gen/Enums';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { useNavigate } from '@umijs/max';
|
||||
import { Space } from 'antd';
|
||||
import ChargeStandardHasCar from '../modals/ChargeStandardHasCar';
|
||||
import ChargeStandardUpdate from '../modals/ChargeStandardUpdate';
|
||||
import ChargingStandard from '../modals/ChargingStandard';
|
||||
import CreateCarPortFee from '../pages/CreateCarPortFee';
|
||||
|
||||
export default function Index({ title = '车位管理费标准' }) {
|
||||
const navigate = useNavigate();
|
||||
|
||||
return (
|
||||
<ProTable
|
||||
{...MyProTableProps.props}
|
||||
headerTitle={title}
|
||||
request={async (params, sort) =>
|
||||
MyProTableProps.request(
|
||||
{
|
||||
...params,
|
||||
charge_type: HouseBillsTypeEnum.CarPortFee.value,
|
||||
},
|
||||
sort,
|
||||
Apis.HouseCharge.HouseChargeStandards.List,
|
||||
)
|
||||
}
|
||||
toolBarRender={(action) => [
|
||||
<CreateCarPortFee key="Create" reload={action?.reload} title={title} />,
|
||||
]}
|
||||
columns={[
|
||||
MyColumns.ID({ search: false }),
|
||||
Selects?.AssetProjects({
|
||||
title: '选择项目',
|
||||
key: 'asset_projects_id',
|
||||
hidden: true,
|
||||
}),
|
||||
{
|
||||
title: '关联项目',
|
||||
dataIndex: ['asset_project', 'name'],
|
||||
// search: {
|
||||
// transform: (value) => {
|
||||
// return { project_name: value };
|
||||
// },
|
||||
// },
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '收费名称',
|
||||
dataIndex: 'name',
|
||||
search: false,
|
||||
render: (_, item: any) => {
|
||||
return <ChargingStandard item={item} />;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '绑定车位',
|
||||
dataIndex: 'house_charge_has_houses_count',
|
||||
search: false,
|
||||
},
|
||||
MyColumns.EnumTag({
|
||||
title: '收费项',
|
||||
dataIndex: 'charge_type',
|
||||
valueEnum: HouseBillsTypeEnum,
|
||||
search: false,
|
||||
}),
|
||||
MyColumns.EnumTag({
|
||||
title: '计量单位',
|
||||
dataIndex: 'calculation_method',
|
||||
valueEnum: HouseChargeStandardsCalculationMethodEnum,
|
||||
search: false,
|
||||
}),
|
||||
MyColumns.EnumTag({
|
||||
title: '计费模式',
|
||||
dataIndex: 'calculation_mode',
|
||||
valueEnum: HouseChargeStandardsCalculationModeEnum,
|
||||
search: false,
|
||||
}),
|
||||
MyColumns.EnumTag({
|
||||
title: '计费算法',
|
||||
dataIndex: 'price_algorithm',
|
||||
valueEnum: HouseChargeStandardsPriceAlgorithmEnum,
|
||||
search: false,
|
||||
}),
|
||||
{
|
||||
title: '价格',
|
||||
dataIndex: 'price',
|
||||
search: false,
|
||||
render(_, record) {
|
||||
if (record?.price_algorithm === 'Fixed') {
|
||||
return record?.price;
|
||||
} else {
|
||||
return (
|
||||
<div>
|
||||
{record?.tiered_rates?.map((rate: any, index: number) => (
|
||||
<div key={index}>
|
||||
{rate?.min_quantity} - {rate?.max_quantity} :{rate?.price}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
},
|
||||
},
|
||||
MyColumns.EnumTag({
|
||||
title: '账单计费周期',
|
||||
dataIndex: 'calculation_period',
|
||||
valueEnum: HouseChargeStandardsCalculationPeriodEnum,
|
||||
search: false,
|
||||
}),
|
||||
{
|
||||
title: '账单自动生成日期',
|
||||
dataIndex: 'auto_date',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '是否公摊',
|
||||
dataIndex: 'is_apportionment',
|
||||
search: false,
|
||||
render(_, record) {
|
||||
return `${record?.is_apportionment ? '是' : '否'} `;
|
||||
},
|
||||
},
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
<MyButtons.View
|
||||
title="查看"
|
||||
onClick={() => {
|
||||
navigate(`/charge/standard/show/${item.id}?type=Car`);
|
||||
}}
|
||||
/>
|
||||
<ChargeStandardUpdate
|
||||
item={item}
|
||||
reload={action?.reload}
|
||||
title="编辑"
|
||||
/>
|
||||
<ChargeStandardHasCar
|
||||
item={item}
|
||||
reload={action?.reload}
|
||||
title="绑定车位"
|
||||
/>
|
||||
<MyButtons.Delete
|
||||
onConfirm={() =>
|
||||
Apis.HouseCharge.HouseChargeStandards.Delete({
|
||||
id: item.id,
|
||||
}).then(() => action?.reload())
|
||||
}
|
||||
/>
|
||||
</Space>
|
||||
),
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@ -1,49 +1,108 @@
|
||||
import { MyBetaModalFormProps, renderTextHelper } from '@/common';
|
||||
import {
|
||||
HouseBillsTypeEnum,
|
||||
HouseChargeStandardsApportionmentMethodEnum,
|
||||
HouseChargeStandardsCalculationMethodEnum,
|
||||
HouseChargeStandardsCalculationModeEnum,
|
||||
HouseChargeStandardsCalculationPeriodEnum,
|
||||
HouseChargeStandardsPriceAlgorithmEnum,
|
||||
} from '@/gen/Enums';
|
||||
import { ProCard, ProDescriptions } from '@ant-design/pro-components';
|
||||
import { Space } from 'antd';
|
||||
|
||||
export default function info(props: MyBetaModalFormProps) {
|
||||
export default function ChargeInfo(props: MyBetaModalFormProps) {
|
||||
const { item } = props;
|
||||
|
||||
return (
|
||||
<Space direction="vertical" style={{ width: '100%' }}>
|
||||
<ProCard title="基本信息">
|
||||
<ProDescriptions bordered>
|
||||
<ProDescriptions.Item label="项目名称" span={2}>
|
||||
{item?.asset_project?.name}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions bordered column={3}>
|
||||
<ProDescriptions.Item label="收费标准名称">
|
||||
{item?.name}
|
||||
</ProDescriptions.Item>
|
||||
|
||||
<ProDescriptions.Item label="收费项目">
|
||||
<ProDescriptions.Item label="关联项目">
|
||||
{item?.asset_project?.name || '-'}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="收费项">
|
||||
<renderTextHelper.Tag
|
||||
Enums={HouseBillsTypeEnum}
|
||||
value={item?.charge_type}
|
||||
key="type"
|
||||
/>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="收款帐号">
|
||||
{item?.company_receipt_account?.company_bank}:
|
||||
{item?.company_receipt_account?.company_account}
|
||||
</ProDescriptions.Item>
|
||||
{item?.apportionment_method ? (
|
||||
<ProDescriptions.Item label="分摊方式">
|
||||
<renderTextHelper.Tag
|
||||
Enums={HouseChargeStandardsApportionmentMethodEnum}
|
||||
value={item?.apportionment_method}
|
||||
/>
|
||||
</ProDescriptions.Item>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
<ProDescriptions.Item label="是否公摊">
|
||||
{item?.is_apportionment ? '是' : '否'}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="计量单位">
|
||||
<renderTextHelper.Tag
|
||||
Enums={HouseChargeStandardsCalculationMethodEnum}
|
||||
value={item?.calculation_method}
|
||||
/>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="计费模式">
|
||||
<renderTextHelper.Tag
|
||||
Enums={HouseChargeStandardsCalculationModeEnum}
|
||||
value={item?.calculation_mode}
|
||||
key="type"
|
||||
/>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="账单计费周期">
|
||||
<ProDescriptions.Item label="计费算法">
|
||||
<renderTextHelper.Tag
|
||||
Enums={HouseChargeStandardsPriceAlgorithmEnum}
|
||||
value={item?.price_algorithm}
|
||||
/>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="固定单价">
|
||||
¥{item?.price}元
|
||||
</ProDescriptions.Item>
|
||||
{item?.calculation_method !== 'PerUnit' ? (
|
||||
<ProDescriptions.Item label="阶梯标准" span={2}>
|
||||
<Space direction="vertical">
|
||||
{item?.tiered_rates?.map((rate: any, index: number) => (
|
||||
<div key={`item_${index}`}>
|
||||
阶梯范围:{rate?.min_quantity}-{rate?.max_quantity}{' '}
|
||||
阶梯单价:¥{rate?.price}元
|
||||
</div>
|
||||
))}
|
||||
</Space>
|
||||
</ProDescriptions.Item>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
<ProDescriptions.Item label="计费周期">
|
||||
<renderTextHelper.Tag
|
||||
Enums={HouseChargeStandardsCalculationPeriodEnum}
|
||||
value={item?.calculation_period}
|
||||
key="type"
|
||||
/>
|
||||
</ProDescriptions.Item>
|
||||
|
||||
<ProDescriptions.Item label="备注">
|
||||
<ProDescriptions.Item label="账单自动生成日期">
|
||||
{item?.auto_date}
|
||||
</ProDescriptions.Item>
|
||||
{item?.has_late_fee ? (
|
||||
<ProDescriptions.Item label="滞纳金计算" span={2}>
|
||||
<Space direction="vertical">
|
||||
<div>有滞纳金:{item?.has_late_fee ? '是' : '否'}</div>
|
||||
<div>起算天数:生成账单后{item?.late_fee_start_days}天</div>
|
||||
<div>收取费率:每日{item?.late_fee_rate}%</div>
|
||||
<div>封顶天数:最多{item?.late_fee_cap_days}天</div>
|
||||
</Space>
|
||||
</ProDescriptions.Item>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
<ProDescriptions.Item label="备注" span={2}>
|
||||
{item?.remark}
|
||||
</ProDescriptions.Item>
|
||||
</ProDescriptions>
|
||||
|
||||
111
src/pages/charge/standard/components/HasCar.tsx
Normal file
111
src/pages/charge/standard/components/HasCar.tsx
Normal file
@ -0,0 +1,111 @@
|
||||
import { MyButtons, MyColumns, MyProTableProps } from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
|
||||
import {
|
||||
AssetCarPortsPropertyTypeEnum,
|
||||
AssetCarPortsStatusEnum,
|
||||
AssetCarPortsTypeEnum,
|
||||
} from '@/gen/Enums';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { Space } from 'antd';
|
||||
import { useEffect, useRef } from 'react';
|
||||
import ChargeStandardHasCar from '../modals/ChargeStandardHasCar';
|
||||
|
||||
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,
|
||||
house_charge_standards_id: rest.item?.house_charge_has_houses_id,
|
||||
},
|
||||
sort,
|
||||
Apis.HouseCharge.HouseChargeHasCarPorts.List,
|
||||
)
|
||||
}
|
||||
toolBarRender={(action) => [
|
||||
<ChargeStandardHasCar
|
||||
item={{
|
||||
...rest.item,
|
||||
size: 'middle',
|
||||
}}
|
||||
reload={action?.reload}
|
||||
title={'绑车位'}
|
||||
/>,
|
||||
]}
|
||||
search={false}
|
||||
columns={[
|
||||
// MyColumns.ID({
|
||||
// search: false,
|
||||
// }),
|
||||
{
|
||||
title: '车场名称',
|
||||
dataIndex: ['asset_parking_place', 'name'],
|
||||
search: {
|
||||
transform: (value) => {
|
||||
return { parking_place_name: value };
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '车位号',
|
||||
dataIndex: ['asset_car_port', 'name'],
|
||||
search: false,
|
||||
},
|
||||
// {
|
||||
// title: '车位全称',
|
||||
// dataIndex: ['asset_car_port', 'full_name'],
|
||||
// },
|
||||
{
|
||||
title: '建筑面积',
|
||||
dataIndex: ['asset_car_port', 'built_area'],
|
||||
search: false,
|
||||
},
|
||||
MyColumns.EnumTag({
|
||||
title: '类型',
|
||||
dataIndex: ['asset_car_port', 'type'],
|
||||
valueEnum: AssetCarPortsTypeEnum,
|
||||
}),
|
||||
MyColumns.EnumTag({
|
||||
title: '产权类型',
|
||||
dataIndex: ['asset_car_port', 'property_type'],
|
||||
valueEnum: AssetCarPortsPropertyTypeEnum,
|
||||
}),
|
||||
MyColumns.EnumTag({
|
||||
title: '状态',
|
||||
dataIndex: ['asset_car_port', 'status'],
|
||||
valueEnum: AssetCarPortsStatusEnum,
|
||||
}),
|
||||
{
|
||||
title: '绑定时间',
|
||||
dataIndex: 'updated_at',
|
||||
search: false,
|
||||
},
|
||||
MyColumns.Option({
|
||||
width: 80,
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
<MyButtons.Delete
|
||||
onConfirm={() =>
|
||||
Apis.HouseCharge.HouseChargeHasCarPorts.Delete({
|
||||
id: item.id,
|
||||
}).then(() => action?.reload())
|
||||
}
|
||||
/>
|
||||
</Space>
|
||||
),
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@ -40,7 +40,7 @@ export default function Index(props: MyBetaModalFormProps) {
|
||||
<MyButtons.View
|
||||
title="查看"
|
||||
onClick={() => {
|
||||
navigate(`/instrument/readings/show/${item.id}`);
|
||||
navigate(`/meter/readings/show/${item.id}`);
|
||||
}}
|
||||
/>
|
||||
),
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import { MyPageContainer } from '@/common';
|
||||
import { Tabs } from 'antd';
|
||||
import CarPortFee from './components/CarPortFee';
|
||||
import ElectricityFee from './components/ElectricityFee';
|
||||
import MaintenanceFund from './components/MaintenanceFund';
|
||||
import PropertyFee from './components/PropertyFee';
|
||||
@ -39,6 +40,11 @@ export default function Index({ title = '收费标准配置' }) {
|
||||
label: '维修基金',
|
||||
children: <MaintenanceFund />,
|
||||
},
|
||||
{
|
||||
key: 'CarPortFee',
|
||||
label: '车位管理费',
|
||||
children: <CarPortFee />,
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
|
||||
174
src/pages/charge/standard/modals/ChargeStandardHasCar.tsx
Normal file
174
src/pages/charge/standard/modals/ChargeStandardHasCar.tsx
Normal file
@ -0,0 +1,174 @@
|
||||
import {
|
||||
MyBetaModalFormProps,
|
||||
MyButtons,
|
||||
MyColumns,
|
||||
MyProTableProps,
|
||||
} from '@/common';
|
||||
import { MyModal } from '@/components/MyModal';
|
||||
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import {
|
||||
AssetCarPortsPropertyTypeEnum,
|
||||
AssetCarPortsStatusEnum,
|
||||
AssetCarPortsTypeEnum,
|
||||
} from '@/gen/Enums';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { message, Space } from 'antd';
|
||||
import { useRef, useState } from 'react';
|
||||
|
||||
export default function ChargeStandardHasHouse(props: MyBetaModalFormProps) {
|
||||
// 使用 useState 保存选中的房屋 ID 和行数据,确保跨页选中状态保持
|
||||
const [selectedHousesIds, setSelectedHousesIds] = useState<number[]>([]);
|
||||
const [selectedRows, setSelectedRows] = useState<any[]>([]);
|
||||
|
||||
// 添加 tableRef 用于操作表格
|
||||
const tableRef = useRef<any>();
|
||||
|
||||
const onShowContactPhone = () => {
|
||||
if (selectedRows.length === 0) {
|
||||
message.warning('请至少选择一个车位');
|
||||
return;
|
||||
}
|
||||
|
||||
// 确保 houses_ids 是字符串数组
|
||||
const carPortsIds = selectedRows.map((row) => String(row.id));
|
||||
|
||||
Apis.HouseCharge.HouseChargeHasCarPorts.Store({
|
||||
house_charge_standards_id: props?.item?.id ?? 0,
|
||||
car_ports_ids: carPortsIds,
|
||||
})
|
||||
.then(() => {
|
||||
// 成功后重置选中状态
|
||||
setSelectedHousesIds([]);
|
||||
setSelectedRows([]);
|
||||
props.reload?.();
|
||||
message.success('绑车位成功!');
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('绑车位失败:', error);
|
||||
message.error('绑车位失败: ' + (error.message || '未知错误'));
|
||||
return false;
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
<MyModal
|
||||
title={props.title || '查看'}
|
||||
type="primary"
|
||||
width="920px"
|
||||
size={props?.item?.size || 'small'}
|
||||
node={
|
||||
<ProTable
|
||||
actionRef={tableRef}
|
||||
{...MyProTableProps.props}
|
||||
request={async (params, sort) =>
|
||||
MyProTableProps.request(
|
||||
{
|
||||
...params,
|
||||
asset_projects_id: props?.item?.asset_projects_id,
|
||||
},
|
||||
sort,
|
||||
Apis.Asset.AssetCarPorts.List,
|
||||
undefined,
|
||||
(res) => {
|
||||
// 确保响应数据正确处理
|
||||
console.log('加载房屋数据:', res);
|
||||
return res;
|
||||
},
|
||||
)
|
||||
}
|
||||
style={{
|
||||
padding: '20px',
|
||||
height: '680px',
|
||||
overflowY: 'auto',
|
||||
overflowX: 'hidden',
|
||||
}}
|
||||
pagination={{
|
||||
showQuickJumper: true,
|
||||
// pageSizeOptions: [10, 20, 50, 100, 200, 500, 1000, 2000],
|
||||
}}
|
||||
rowSelection={{
|
||||
type: 'checkbox',
|
||||
preserveSelectedRowKeys: true, // 启用跨页选择
|
||||
selectedRowKeys: selectedHousesIds,
|
||||
onChange: (selectedRowKeys, selectedRows) => {
|
||||
// 确保 selectedRowKeys 是数字类型
|
||||
const numericKeys = selectedRowKeys.map((key) =>
|
||||
typeof key === 'string' ? parseInt(key, 10) : key,
|
||||
) as number[];
|
||||
|
||||
// 更新选中状态
|
||||
setSelectedHousesIds(numericKeys);
|
||||
|
||||
// 合并当前页面选中的行和之前选中的行
|
||||
const newSelectedRows = [...selectedRows];
|
||||
|
||||
// 设置选中行数据
|
||||
setSelectedRows(newSelectedRows);
|
||||
},
|
||||
}}
|
||||
tableAlertOptionRender={({ selectedRowKeys, onCleanSelected }) => {
|
||||
return (
|
||||
<Space>
|
||||
<span>已选 {selectedRowKeys.length} 项</span>
|
||||
<a onClick={onCleanSelected}>清空</a>
|
||||
<MyButtons.Create
|
||||
title="批量添加"
|
||||
type="primary"
|
||||
key="create2"
|
||||
onClick={() => onShowContactPhone()}
|
||||
/>
|
||||
</Space>
|
||||
);
|
||||
}}
|
||||
options={false}
|
||||
columns={[
|
||||
{
|
||||
title: '项目名称',
|
||||
dataIndex: ['asset_project', 'name'],
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '车场名称',
|
||||
dataIndex: ['asset_parking_place', 'name'],
|
||||
search: {
|
||||
transform: (value) => {
|
||||
return { parking_place_name: value };
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '车位号',
|
||||
dataIndex: 'name',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '车位全称',
|
||||
dataIndex: 'full_name',
|
||||
},
|
||||
{
|
||||
title: '建筑面积',
|
||||
dataIndex: 'built_area',
|
||||
search: false,
|
||||
},
|
||||
MyColumns.EnumTag({
|
||||
title: '类型',
|
||||
dataIndex: 'type',
|
||||
valueEnum: AssetCarPortsTypeEnum,
|
||||
}),
|
||||
MyColumns.EnumTag({
|
||||
title: '产权类型',
|
||||
dataIndex: 'property_type',
|
||||
valueEnum: AssetCarPortsPropertyTypeEnum,
|
||||
}),
|
||||
MyColumns.EnumTag({
|
||||
title: '状态',
|
||||
dataIndex: 'status',
|
||||
valueEnum: AssetCarPortsStatusEnum,
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@ -14,7 +14,6 @@ import {
|
||||
HouseChargeStandardsCalculationModeEnum,
|
||||
HouseChargeStandardsCalculationPeriodEnum,
|
||||
HouseChargeStandardsPriceAlgorithmEnum,
|
||||
HouseChargeStandardsTypeEnum,
|
||||
} from '@/gen/Enums';
|
||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||
import { Form, message } from 'antd';
|
||||
@ -51,11 +50,7 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
...values,
|
||||
charge_type: props?.item?.charge_type,
|
||||
asset_projects_id: props?.item?.asset_projects_id,
|
||||
type:
|
||||
values.charge_type === HouseBillsTypeEnum.PropertyFee.value ||
|
||||
values.charge_type === HouseBillsTypeEnum.MaintenanceFund.value
|
||||
? HouseChargeStandardsTypeEnum.House.value
|
||||
: HouseChargeStandardsTypeEnum.Meter.value,
|
||||
type: props?.item?.type,
|
||||
is_apportionment:
|
||||
values.charge_type === HouseBillsTypeEnum.SharedWaterFee.value ||
|
||||
values.charge_type === HouseBillsTypeEnum.SharedElectricityFee.value
|
||||
|
||||
522
src/pages/charge/standard/pages/CreateCarPortFee.tsx
Normal file
522
src/pages/charge/standard/pages/CreateCarPortFee.tsx
Normal file
@ -0,0 +1,522 @@
|
||||
import {
|
||||
MyBetaModalFormProps,
|
||||
MyButtons,
|
||||
MyFormItems,
|
||||
MyModalFormProps,
|
||||
rulesHelper,
|
||||
} from '@/common';
|
||||
import { Selects } from '@/components/Select';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import {
|
||||
HouseBillsTypeEnum,
|
||||
HouseChargeStandardsCalculationMethodEnum,
|
||||
HouseChargeStandardsCalculationModeEnum,
|
||||
HouseChargeStandardsCalculationPeriodEnum,
|
||||
HouseChargeStandardsPriceAlgorithmEnum,
|
||||
} from '@/gen/Enums';
|
||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||
import { Form, message } from 'antd';
|
||||
import { useRef } from 'react';
|
||||
|
||||
export default function CreatePropertyFee(props: MyBetaModalFormProps) {
|
||||
const [form] = Form.useForm();
|
||||
const actionRef = useRef<any>();
|
||||
|
||||
return (
|
||||
<BetaSchemaForm<ApiTypes.HouseCharge.HouseChargeStandards.Store>
|
||||
{...MyModalFormProps.props}
|
||||
form={form}
|
||||
title={`新增车位管理费标准`}
|
||||
// wrapperCol={{ span: 24 }}
|
||||
// 基础表单
|
||||
layout="horizontal"
|
||||
labelCol={{ span: 5 }}
|
||||
wrapperCol={{ span: 19 }}
|
||||
labelAlign="left"
|
||||
width="680px"
|
||||
trigger={<MyButtons.Create title={`车位管理费标准`} />}
|
||||
key={new Date().getTime()}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open) {
|
||||
form.resetFields(); // 清空表单数据
|
||||
}
|
||||
}}
|
||||
onFinish={async (values: any) =>
|
||||
Apis.HouseCharge.HouseChargeStandards.Store({
|
||||
...values,
|
||||
charge_type: HouseBillsTypeEnum.CarPortFee.value,
|
||||
type: 'House',
|
||||
is_apportionment:
|
||||
values.charge_type === HouseBillsTypeEnum.SharedWaterFee.value ||
|
||||
values.charge_type === HouseBillsTypeEnum.SharedElectricityFee.value
|
||||
? 1
|
||||
: 0,
|
||||
// 按套
|
||||
calculation_mode:
|
||||
values?.calculation_method ===
|
||||
HouseChargeStandardsCalculationMethodEnum.PerUnit.value
|
||||
? HouseChargeStandardsCalculationModeEnum.FixedAmount.value
|
||||
: values?.calculation_mode,
|
||||
// 按固定金额
|
||||
price_algorithm:
|
||||
values?.calculation_mode ===
|
||||
HouseChargeStandardsCalculationModeEnum.FixedAmount.value ||
|
||||
values?.calculation_method ===
|
||||
HouseChargeStandardsCalculationMethodEnum.PerUnit.value
|
||||
? HouseChargeStandardsPriceAlgorithmEnum.Fixed.value
|
||||
: values?.price_algorithm,
|
||||
tiered_rates: values.tiered_rates?.map((res: any) => {
|
||||
return {
|
||||
...res,
|
||||
};
|
||||
}),
|
||||
// 避免计费模式切换导致的价格异常
|
||||
price:
|
||||
values?.price_algorithm ===
|
||||
HouseChargeStandardsPriceAlgorithmEnum.Fixed.value ||
|
||||
values?.calculation_mode ===
|
||||
HouseChargeStandardsCalculationModeEnum.FixedAmount.value
|
||||
? values.price
|
||||
: 0,
|
||||
late_fee_rate: values.has_late_fee || '',
|
||||
late_fee_start_days: values.has_late_fee || '',
|
||||
late_fee_cap_days: values.has_late_fee || '',
|
||||
})
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
message.success('车位管理费标准创建成功');
|
||||
return true;
|
||||
})
|
||||
.catch(() => false)
|
||||
}
|
||||
columns={[
|
||||
Selects?.AssetProjects({
|
||||
key: 'asset_projects_id',
|
||||
title: '选择项目',
|
||||
colProps: { span: 24 },
|
||||
required: true,
|
||||
fieldProps: {
|
||||
onChange: () => {
|
||||
// 切换计量单位时清空计费模式
|
||||
form.setFieldValue('company_receipt_accounts_id', undefined);
|
||||
},
|
||||
},
|
||||
}),
|
||||
{
|
||||
key: 'name',
|
||||
title: '收费标准名称',
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
valueType: 'dependency',
|
||||
name: ['asset_projects_id'],
|
||||
columns: ({ asset_projects_id }) => {
|
||||
return [
|
||||
Selects?.ProjectAccounts({
|
||||
title: '项目收款账户',
|
||||
key: 'company_receipt_accounts_id',
|
||||
params: {
|
||||
asset_projects_id: asset_projects_id,
|
||||
},
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
}),
|
||||
];
|
||||
},
|
||||
},
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'calculation_method',
|
||||
title: '计量单位',
|
||||
colProps: { span: 24 },
|
||||
valueEnum: () => {
|
||||
let obj: any = JSON.parse(
|
||||
JSON.stringify(HouseChargeStandardsCalculationMethodEnum),
|
||||
);
|
||||
delete obj.ElectricityUsage;
|
||||
delete obj.WaterUsage;
|
||||
return obj;
|
||||
},
|
||||
required: true,
|
||||
fieldProps: {
|
||||
buttonStyle: 'solid',
|
||||
onChange: () => {
|
||||
// 切换计量单位时清空计费模式
|
||||
form.setFieldValue('calculation_mode', undefined);
|
||||
form.setFieldValue('price', undefined);
|
||||
form.setFieldValue('price_algorithm', undefined);
|
||||
},
|
||||
},
|
||||
}),
|
||||
|
||||
{
|
||||
name: ['calculation_method'],
|
||||
valueType: 'dependency',
|
||||
columns: ({ calculation_method }: any) => {
|
||||
return calculation_method ===
|
||||
HouseChargeStandardsCalculationMethodEnum.PerUnit.value
|
||||
? [
|
||||
{
|
||||
key: 'price',
|
||||
title: '固定单价',
|
||||
colProps: { span: 24 },
|
||||
fieldProps: {
|
||||
addonAfter: '元',
|
||||
},
|
||||
formItemProps: { ...rulesHelper.number },
|
||||
},
|
||||
]
|
||||
: !calculation_method &&
|
||||
calculation_method !==
|
||||
HouseChargeStandardsCalculationMethodEnum.PerUnit.value
|
||||
? []
|
||||
: [
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'calculation_mode',
|
||||
title: '计费模式',
|
||||
colProps: { span: 24 },
|
||||
// valueEnum: HouseChargeStandardsCalculationModeEnum,
|
||||
valueEnum: () => {
|
||||
let obj: any = JSON.parse(
|
||||
JSON.stringify(HouseChargeStandardsCalculationModeEnum),
|
||||
);
|
||||
delete obj.FixedAmount;
|
||||
return obj;
|
||||
},
|
||||
required: true,
|
||||
}),
|
||||
];
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: ['calculation_mode'],
|
||||
valueType: 'dependency',
|
||||
columns: ({ calculation_mode }: any) => {
|
||||
return calculation_mode ===
|
||||
HouseChargeStandardsCalculationModeEnum.FixedAmount.value
|
||||
? [
|
||||
{
|
||||
key: 'price',
|
||||
title: '固定单价',
|
||||
colProps: { span: 24 },
|
||||
fieldProps: {
|
||||
addonAfter: '元',
|
||||
},
|
||||
formItemProps: { ...rulesHelper.number },
|
||||
},
|
||||
]
|
||||
: calculation_mode ===
|
||||
HouseChargeStandardsCalculationModeEnum.QuantityPrice.value
|
||||
? [
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'price_algorithm',
|
||||
title: '计费算法',
|
||||
colProps: { span: 24 },
|
||||
valueEnum: HouseChargeStandardsPriceAlgorithmEnum,
|
||||
required: true,
|
||||
fieldProps: {
|
||||
buttonStyle: 'solid',
|
||||
onChange: () => {
|
||||
// 切换计费算法时清空阶梯配置
|
||||
form.setFieldValue('price', undefined);
|
||||
form.setFieldValue('tiered_rates', undefined);
|
||||
},
|
||||
},
|
||||
}),
|
||||
{
|
||||
name: ['price_algorithm'],
|
||||
valueType: 'dependency',
|
||||
columns: ({ price_algorithm }: any) => {
|
||||
return price_algorithm ===
|
||||
HouseChargeStandardsPriceAlgorithmEnum.Fixed.value
|
||||
? [
|
||||
{
|
||||
key: 'price',
|
||||
title: '固定单价',
|
||||
valueType: 'digit',
|
||||
colProps: { span: 24 },
|
||||
fieldProps: {
|
||||
addonAfter: '元',
|
||||
max: 99,
|
||||
},
|
||||
formItemProps: { ...rulesHelper.number },
|
||||
},
|
||||
]
|
||||
: price_algorithm ===
|
||||
HouseChargeStandardsPriceAlgorithmEnum.Tiered.value
|
||||
? [
|
||||
{
|
||||
valueType: 'formList',
|
||||
dataIndex: 'tiered_rates',
|
||||
title: '阶梯标准',
|
||||
formItemProps: { ...rulesHelper.array },
|
||||
initialValue: [
|
||||
{
|
||||
min_quantity: 0,
|
||||
max_quantity: null,
|
||||
price: null,
|
||||
},
|
||||
],
|
||||
fieldProps: {
|
||||
actionRef: actionRef,
|
||||
copyIconProps: false,
|
||||
// deleteIconProps: false,
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
valueType: 'group',
|
||||
colProps: { span: 24 },
|
||||
columns: [
|
||||
{
|
||||
key: 'min_quantity',
|
||||
colProps: { span: 9 },
|
||||
// title: '起始值',
|
||||
valueType: 'digit',
|
||||
fieldProps: {
|
||||
min: 0,
|
||||
addonBefore: '阶梯范围',
|
||||
placeholder: '起始值',
|
||||
},
|
||||
width: '100%',
|
||||
formItemProps: {
|
||||
...rulesHelper.number,
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'max_quantity',
|
||||
colProps: { span: 5 },
|
||||
// title: '结束值',
|
||||
valueType: 'digit',
|
||||
width: '100%',
|
||||
formItemProps: {
|
||||
...rulesHelper.number,
|
||||
},
|
||||
fieldProps: {
|
||||
min: 0,
|
||||
max: 999,
|
||||
placeholder: '结束值',
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'price',
|
||||
colProps: { span: 10 },
|
||||
// title: '阶梯单价',
|
||||
valueType: 'digit',
|
||||
fieldProps: {
|
||||
addonBefore: '阶梯单价',
|
||||
addonAfter: '元',
|
||||
min: 0,
|
||||
max: 999,
|
||||
},
|
||||
formItemProps: {
|
||||
...rulesHelper.number,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
]
|
||||
: price_algorithm ===
|
||||
HouseChargeStandardsPriceAlgorithmEnum.Peak.value
|
||||
? [
|
||||
{
|
||||
valueType: 'formList',
|
||||
dataIndex: 'tiered_rates',
|
||||
title: '阶梯标准',
|
||||
formItemProps: { ...rulesHelper.array },
|
||||
initialValue: [
|
||||
{
|
||||
min_quantity: 0,
|
||||
max_quantity: null,
|
||||
price: null,
|
||||
},
|
||||
],
|
||||
fieldProps: {
|
||||
actionRef: actionRef,
|
||||
copyIconProps: false,
|
||||
// deleteIconProps: false,
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
valueType: 'group',
|
||||
colProps: { span: 24 },
|
||||
columns: [
|
||||
{
|
||||
key: 'min_quantity',
|
||||
colProps: { span: 9 },
|
||||
// title: '起始值',
|
||||
valueType: 'digit',
|
||||
fieldProps: {
|
||||
min: 0,
|
||||
addonBefore: '阶梯范围',
|
||||
placeholder: '起始值',
|
||||
},
|
||||
width: '100%',
|
||||
formItemProps: {
|
||||
...rulesHelper.number,
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'max_quantity',
|
||||
colProps: { span: 5 },
|
||||
// title: '结束值',
|
||||
valueType: 'digit',
|
||||
width: '100%',
|
||||
formItemProps: {
|
||||
...rulesHelper.number,
|
||||
},
|
||||
fieldProps: {
|
||||
min: 0,
|
||||
max: 999,
|
||||
placeholder: '结束值',
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'price',
|
||||
colProps: { span: 10 },
|
||||
// title: '阶梯单价',
|
||||
valueType: 'digit',
|
||||
fieldProps: {
|
||||
addonBefore: '阶梯单价',
|
||||
addonAfter: '元',
|
||||
min: 0,
|
||||
max: 999,
|
||||
},
|
||||
formItemProps: {
|
||||
...rulesHelper.number,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
]
|
||||
: [];
|
||||
},
|
||||
},
|
||||
]
|
||||
: [];
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ['price', 'price_algorithm'],
|
||||
valueType: 'dependency',
|
||||
columns: ({ price, price_algorithm }: any) => {
|
||||
return price ||
|
||||
price_algorithm ===
|
||||
HouseChargeStandardsPriceAlgorithmEnum.Tiered.value ||
|
||||
price_algorithm ===
|
||||
HouseChargeStandardsPriceAlgorithmEnum.Peak.value
|
||||
? [
|
||||
{
|
||||
valueType: 'group',
|
||||
columns: [
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'calculation_period',
|
||||
title: '计费周期',
|
||||
colProps: { span: 24 },
|
||||
valueEnum: HouseChargeStandardsCalculationPeriodEnum,
|
||||
required: true,
|
||||
}),
|
||||
{
|
||||
key: 'auto_date',
|
||||
title: '生成日期',
|
||||
colProps: { span: 24 },
|
||||
tooltip: '系统将按该设置日期自动生成第一期的账单',
|
||||
valueType: 'date',
|
||||
width: '100%',
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
key: 'has_late_fee',
|
||||
title: '启用滞纳金',
|
||||
colProps: { span: 24 },
|
||||
valueType: 'switch',
|
||||
width: '100%',
|
||||
fieldProps: {
|
||||
onChange: () => {
|
||||
// 切换计费算法时清空阶梯配置
|
||||
form.setFieldValue(
|
||||
'late_fee_start_days',
|
||||
undefined,
|
||||
);
|
||||
form.setFieldValue('late_fee_rate', undefined);
|
||||
form.setFieldValue('late_fee_cap_days', undefined);
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ['has_late_fee'],
|
||||
valueType: 'dependency',
|
||||
columns: ({ has_late_fee }: any) => {
|
||||
return has_late_fee
|
||||
? [
|
||||
{
|
||||
key: 'late_fee_start_days',
|
||||
title: '滞纳起算',
|
||||
colProps: { span: 24 },
|
||||
formItemProps: {
|
||||
...rulesHelper.number,
|
||||
},
|
||||
fieldProps: {
|
||||
mix: 1,
|
||||
addonBefore: '生成账单后',
|
||||
addonAfter: '天',
|
||||
placeholder:
|
||||
'请输入按账单生成后多少天后开始收取',
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'late_fee_rate',
|
||||
title: '滞纳金费率',
|
||||
valueType: 'digit',
|
||||
colProps: { span: 24 },
|
||||
formItemProps: {
|
||||
...rulesHelper.number,
|
||||
},
|
||||
fieldProps: {
|
||||
addonBefore: '每日',
|
||||
addonAfter: '%',
|
||||
max: 100,
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'late_fee_cap_days',
|
||||
title: '滞纳金封顶',
|
||||
colProps: { span: 24 },
|
||||
formItemProps: {
|
||||
...rulesHelper.number,
|
||||
},
|
||||
fieldProps: {
|
||||
mix: 1,
|
||||
placeholder: '请输入封顶天数',
|
||||
addonAfter: '天',
|
||||
},
|
||||
},
|
||||
]
|
||||
: [];
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'remark',
|
||||
title: '备注',
|
||||
colProps: { span: 24 },
|
||||
valueType: 'textarea',
|
||||
fieldProps: {
|
||||
// rows: 2,
|
||||
maxLength: 100,
|
||||
showCount: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
]
|
||||
: [];
|
||||
},
|
||||
},
|
||||
]}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@ -13,7 +13,6 @@ import {
|
||||
HouseChargeStandardsCalculationModeEnum,
|
||||
HouseChargeStandardsCalculationPeriodEnum,
|
||||
HouseChargeStandardsPriceAlgorithmEnum,
|
||||
HouseChargeStandardsTypeEnum,
|
||||
} from '@/gen/Enums';
|
||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||
import { Form, message } from 'antd';
|
||||
@ -46,11 +45,7 @@ export default function CreateWaterFee(props: MyBetaModalFormProps) {
|
||||
Apis.HouseCharge.HouseChargeStandards.Store({
|
||||
...values,
|
||||
charge_type: HouseBillsTypeEnum.ElectricityFee.value,
|
||||
type:
|
||||
values.charge_type === HouseBillsTypeEnum.PropertyFee.value ||
|
||||
values.charge_type === HouseBillsTypeEnum.MaintenanceFund.value
|
||||
? HouseChargeStandardsTypeEnum.House.value
|
||||
: HouseChargeStandardsTypeEnum.Meter.value,
|
||||
type: 'Meter',
|
||||
is_apportionment:
|
||||
values.charge_type === HouseBillsTypeEnum.SharedWaterFee.value ||
|
||||
values.charge_type === HouseBillsTypeEnum.SharedElectricityFee.value
|
||||
|
||||
@ -13,7 +13,6 @@ import {
|
||||
HouseChargeStandardsCalculationModeEnum,
|
||||
HouseChargeStandardsCalculationPeriodEnum,
|
||||
HouseChargeStandardsPriceAlgorithmEnum,
|
||||
HouseChargeStandardsTypeEnum,
|
||||
} from '@/gen/Enums';
|
||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||
import { Form, message } from 'antd';
|
||||
@ -46,11 +45,7 @@ export default function CreateMaintenanceFund(props: MyBetaModalFormProps) {
|
||||
Apis.HouseCharge.HouseChargeStandards.Store({
|
||||
...values,
|
||||
charge_type: HouseBillsTypeEnum.MaintenanceFund.value,
|
||||
type:
|
||||
values.charge_type === HouseBillsTypeEnum.PropertyFee.value ||
|
||||
values.charge_type === HouseBillsTypeEnum.MaintenanceFund.value
|
||||
? HouseChargeStandardsTypeEnum.House.value
|
||||
: HouseChargeStandardsTypeEnum.Meter.value,
|
||||
type: 'House',
|
||||
is_apportionment:
|
||||
values.charge_type === HouseBillsTypeEnum.SharedWaterFee.value ||
|
||||
values.charge_type === HouseBillsTypeEnum.SharedElectricityFee.value
|
||||
|
||||
@ -13,7 +13,6 @@ import {
|
||||
HouseChargeStandardsCalculationModeEnum,
|
||||
HouseChargeStandardsCalculationPeriodEnum,
|
||||
HouseChargeStandardsPriceAlgorithmEnum,
|
||||
HouseChargeStandardsTypeEnum,
|
||||
} from '@/gen/Enums';
|
||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||
import { Form, message } from 'antd';
|
||||
@ -46,11 +45,7 @@ export default function CreatePropertyFee(props: MyBetaModalFormProps) {
|
||||
Apis.HouseCharge.HouseChargeStandards.Store({
|
||||
...values,
|
||||
charge_type: HouseBillsTypeEnum.PropertyFee.value,
|
||||
type:
|
||||
values.charge_type === HouseBillsTypeEnum.PropertyFee.value ||
|
||||
values.charge_type === HouseBillsTypeEnum.MaintenanceFund.value
|
||||
? HouseChargeStandardsTypeEnum.House.value
|
||||
: HouseChargeStandardsTypeEnum.Meter.value,
|
||||
type: 'House',
|
||||
is_apportionment:
|
||||
values.charge_type === HouseBillsTypeEnum.SharedWaterFee.value ||
|
||||
values.charge_type === HouseBillsTypeEnum.SharedElectricityFee.value
|
||||
|
||||
@ -14,7 +14,6 @@ import {
|
||||
HouseChargeStandardsCalculationModeEnum,
|
||||
HouseChargeStandardsCalculationPeriodEnum,
|
||||
HouseChargeStandardsPriceAlgorithmEnum,
|
||||
HouseChargeStandardsTypeEnum,
|
||||
} from '@/gen/Enums';
|
||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||
import { Form, message } from 'antd';
|
||||
@ -47,11 +46,7 @@ export default function CreateWaterFee(props: MyBetaModalFormProps) {
|
||||
Apis.HouseCharge.HouseChargeStandards.Store({
|
||||
...values,
|
||||
charge_type: HouseBillsTypeEnum.SharedElectricityFee.value,
|
||||
type:
|
||||
values.charge_type === HouseBillsTypeEnum.PropertyFee.value ||
|
||||
values.charge_type === HouseBillsTypeEnum.MaintenanceFund.value
|
||||
? HouseChargeStandardsTypeEnum.House.value
|
||||
: HouseChargeStandardsTypeEnum.Meter.value,
|
||||
type: 'Meter',
|
||||
is_apportionment:
|
||||
values.charge_type === HouseBillsTypeEnum.SharedWaterFee.value ||
|
||||
values.charge_type === HouseBillsTypeEnum.SharedElectricityFee.value
|
||||
|
||||
@ -14,7 +14,6 @@ import {
|
||||
HouseChargeStandardsCalculationModeEnum,
|
||||
HouseChargeStandardsCalculationPeriodEnum,
|
||||
HouseChargeStandardsPriceAlgorithmEnum,
|
||||
HouseChargeStandardsTypeEnum,
|
||||
} from '@/gen/Enums';
|
||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||
import { Form, message } from 'antd';
|
||||
@ -47,11 +46,7 @@ export default function CreateSharedWaterFee(props: MyBetaModalFormProps) {
|
||||
Apis.HouseCharge.HouseChargeStandards.Store({
|
||||
...values,
|
||||
charge_type: HouseBillsTypeEnum.SharedWaterFee.value,
|
||||
type:
|
||||
values.charge_type === HouseBillsTypeEnum.PropertyFee.value ||
|
||||
values.charge_type === HouseBillsTypeEnum.MaintenanceFund.value
|
||||
? HouseChargeStandardsTypeEnum.House.value
|
||||
: HouseChargeStandardsTypeEnum.Meter.value,
|
||||
type: 'Meter',
|
||||
is_apportionment:
|
||||
values.charge_type === HouseBillsTypeEnum.SharedWaterFee.value ||
|
||||
values.charge_type === HouseBillsTypeEnum.SharedElectricityFee.value
|
||||
|
||||
@ -13,7 +13,6 @@ import {
|
||||
HouseChargeStandardsCalculationModeEnum,
|
||||
HouseChargeStandardsCalculationPeriodEnum,
|
||||
HouseChargeStandardsPriceAlgorithmEnum,
|
||||
HouseChargeStandardsTypeEnum,
|
||||
} from '@/gen/Enums';
|
||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||
import { Form, message } from 'antd';
|
||||
@ -46,11 +45,7 @@ export default function CreateWaterFee(props: MyBetaModalFormProps) {
|
||||
Apis.HouseCharge.HouseChargeStandards.Store({
|
||||
...values,
|
||||
charge_type: HouseBillsTypeEnum.WaterFee.value,
|
||||
type:
|
||||
values.charge_type === HouseBillsTypeEnum.PropertyFee.value ||
|
||||
values.charge_type === HouseBillsTypeEnum.MaintenanceFund.value
|
||||
? HouseChargeStandardsTypeEnum.House.value
|
||||
: HouseChargeStandardsTypeEnum.Meter.value,
|
||||
type: 'Meter',
|
||||
is_apportionment:
|
||||
values.charge_type === HouseBillsTypeEnum.SharedWaterFee.value ||
|
||||
values.charge_type === HouseBillsTypeEnum.SharedElectricityFee.value
|
||||
|
||||
@ -6,6 +6,7 @@ import { useParams, useSearchParams } from '@umijs/max';
|
||||
import { Tabs } from 'antd';
|
||||
import { useEffect, useState } from 'react';
|
||||
import ChargeInfo from '../components/ChargeInfo';
|
||||
import HasCar from '../components/HasCar';
|
||||
import HasHouse from '../components/HasHouse';
|
||||
import Instrument from '../components/Instrument';
|
||||
|
||||
@ -56,6 +57,22 @@ export default function Show({ title = '详情' }: { title?: string } = {}) {
|
||||
},
|
||||
]);
|
||||
}
|
||||
|
||||
if (pageType === 'Car') {
|
||||
setItem([
|
||||
{
|
||||
label: '关联车位',
|
||||
key: '3',
|
||||
closable: false,
|
||||
children: (
|
||||
<HasCar
|
||||
item={{ ...res?.data, house_charge_has_houses_id: id }}
|
||||
reload={() => loadShow()}
|
||||
/>
|
||||
),
|
||||
},
|
||||
]);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@ -20,7 +20,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
labelCol={{ span: 8 }}
|
||||
wrapperCol={{ span: 16 }}
|
||||
labelAlign="left"
|
||||
trigger={<MyButtons.Create title={`创建${props.title}`} />}
|
||||
trigger={<MyButtons.Create title={`${props.title}`} />}
|
||||
key={new Date().getTime()}
|
||||
form={form}
|
||||
onOpenChange={(open: any) => {
|
||||
@ -61,7 +61,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
key: 'house_charge_standards_id',
|
||||
params: {
|
||||
asset_projects_id: asset_projects_id,
|
||||
charge_type: ['PropertyFee', 'MaintenanceFund'],
|
||||
charge_type: ['PropertyFee', 'MaintenanceFund', 'CarPortFee'],
|
||||
},
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
|
||||
@ -21,7 +21,6 @@ import { useState } from 'react';
|
||||
import ChargingStandard from './modals/ChargingStandard';
|
||||
import Create from './modals/Create';
|
||||
import MeterHasHouse from './modals/MeterHasHouse';
|
||||
import MeterHasOne from './modals/MeterHasOne';
|
||||
import Update from './modals/Update';
|
||||
|
||||
export default function CommonMeter({ title = '公摊表' }) {
|
||||
@ -69,7 +68,7 @@ export default function CommonMeter({ title = '公摊表' }) {
|
||||
<MyButtons.View
|
||||
title="查看"
|
||||
onClick={() => {
|
||||
navigate(`/instrument/readings/show/${item.id}`);
|
||||
navigate(`/meter/readings/show/${item.id}`);
|
||||
}}
|
||||
/>
|
||||
),
|
||||
@ -80,23 +79,11 @@ export default function CommonMeter({ title = '公摊表' }) {
|
||||
has: {
|
||||
key: '1',
|
||||
label: (
|
||||
<>
|
||||
{item.meter_type === HouseMetersMeterTypeEnum.HouseMeter.value &&
|
||||
!item.house_meter_has_houses_count && (
|
||||
<MeterHasOne
|
||||
item={{ ...item, size: 'small' }}
|
||||
reload={action?.reload}
|
||||
title="绑房"
|
||||
/>
|
||||
)}
|
||||
{item.meter_type === HouseMetersMeterTypeEnum.CommonMeter.value && (
|
||||
<MeterHasHouse
|
||||
item={{ ...item, size: 'small' }}
|
||||
reload={action?.reload}
|
||||
title="绑房"
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
<MeterHasHouse
|
||||
item={{ ...item, size: 'small' }}
|
||||
reload={action?.reload}
|
||||
title="绑房"
|
||||
/>
|
||||
),
|
||||
},
|
||||
delete: {
|
||||
@ -178,7 +165,7 @@ export default function CommonMeter({ title = '公摊表' }) {
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '关联房屋数',
|
||||
title: '绑定房屋',
|
||||
dataIndex: 'house_meter_has_houses_count',
|
||||
search: false,
|
||||
},
|
||||
@ -218,14 +205,14 @@ export default function CommonMeter({ title = '公摊表' }) {
|
||||
// dataIndex: 'remark',
|
||||
// search: false,
|
||||
// },
|
||||
MyColumns.SoftDelete({
|
||||
onRestore: Apis.Meter.HouseMeters.Restore,
|
||||
onSoftDelete: Apis.Meter.HouseMeters.SoftDelete,
|
||||
search: false,
|
||||
setPermissions: getCurrentPermissions({
|
||||
enableDisable: true,
|
||||
}),
|
||||
}),
|
||||
// MyColumns.SoftDelete({
|
||||
// onRestore: Apis.Meter.HouseMeters.Restore,
|
||||
// onSoftDelete: Apis.Meter.HouseMeters.SoftDelete,
|
||||
// search: false,
|
||||
// setPermissions: getCurrentPermissions({
|
||||
// enableDisable: true,
|
||||
// }),
|
||||
// }),
|
||||
// MyColumns.CreatedAt(),
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
|
||||
@ -20,7 +20,7 @@ export default function Index(props: MyBetaModalFormProps) {
|
||||
type="link"
|
||||
width="1000px"
|
||||
onOpen={() => {
|
||||
Apis.HouseCharage.HouseChargeStandards.Show({
|
||||
Apis.HouseCharge.HouseChargeStandards.Show({
|
||||
id: props.item?.charge_standards_id ?? 0,
|
||||
}).then((res) => {
|
||||
setData(res?.data || {});
|
||||
|
||||
@ -20,7 +20,6 @@ import dayjs from 'dayjs';
|
||||
import { useState } from 'react';
|
||||
import ChargingStandard from './modals/ChargingStandard';
|
||||
import Create from './modals/Create';
|
||||
import MeterHasHouse from './modals/MeterHasHouse';
|
||||
import MeterHasOne from './modals/MeterHasOne';
|
||||
import Update from './modals/Update';
|
||||
|
||||
@ -69,7 +68,7 @@ export default function HouseMeter({ title = '房屋表' }) {
|
||||
<MyButtons.View
|
||||
title="查看"
|
||||
onClick={() => {
|
||||
navigate(`/instrument/readings/show/${item.id}`);
|
||||
navigate(`/meter/readings/show/${item.id}`);
|
||||
}}
|
||||
/>
|
||||
),
|
||||
@ -80,23 +79,11 @@ export default function HouseMeter({ title = '房屋表' }) {
|
||||
has: {
|
||||
key: '1',
|
||||
label: (
|
||||
<>
|
||||
{item.meter_type === HouseMetersMeterTypeEnum.HouseMeter.value &&
|
||||
!item.house_meter_has_houses_count && (
|
||||
<MeterHasOne
|
||||
item={{ ...item, size: 'small' }}
|
||||
reload={action?.reload}
|
||||
title="绑房"
|
||||
/>
|
||||
)}
|
||||
{item.meter_type === HouseMetersMeterTypeEnum.CommonMeter.value && (
|
||||
<MeterHasHouse
|
||||
item={{ ...item, size: 'small' }}
|
||||
reload={action?.reload}
|
||||
title="绑房"
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
<MeterHasOne
|
||||
item={{ ...item, size: 'small' }}
|
||||
reload={action?.reload}
|
||||
title="绑房"
|
||||
/>
|
||||
),
|
||||
},
|
||||
delete: {
|
||||
@ -178,7 +165,7 @@ export default function HouseMeter({ title = '房屋表' }) {
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '关联房屋数',
|
||||
title: '绑定房屋',
|
||||
dataIndex: 'house_meter_has_houses_count',
|
||||
search: false,
|
||||
},
|
||||
|
||||
@ -20,7 +20,7 @@ export default function Index(props: MyBetaModalFormProps) {
|
||||
type="link"
|
||||
width="1000px"
|
||||
onOpen={() => {
|
||||
Apis.HouseCharage.HouseChargeStandards.Show({
|
||||
Apis.HouseCharge.HouseChargeStandards.Show({
|
||||
id: props.item?.charge_standards_id ?? 0,
|
||||
}).then((res) => {
|
||||
setData(res?.data || {});
|
||||
|
||||
@ -9,8 +9,6 @@ import { HouseMetersMeterTypeEnum } from '@/gen/Enums';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { useNavigate } from '@umijs/max';
|
||||
import { Space } from 'antd';
|
||||
import MeterHasHouse from '../../instrument_list/modals/MeterHasHouse';
|
||||
import MeterHasOne from '../../instrument_list/modals/MeterHasOne';
|
||||
|
||||
export default function Index(props: MyBetaModalFormProps) {
|
||||
const navigate = useNavigate();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user