This commit is contained in:
parent
6bb7fbec43
commit
78d8b844a6
@ -1,4 +1,4 @@
|
||||
import { MyBetaModalFormProps, renderTextHelper } from '@/common';
|
||||
import { MyBetaModalFormProps, MyButtons, renderTextHelper } from '@/common';
|
||||
import { MyModal } from '@/components/MyModal';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import {
|
||||
@ -8,12 +8,14 @@ import {
|
||||
AssetHousesUsageEnum,
|
||||
} from '@/gen/Enums';
|
||||
import { ProCard, ProDescriptions } from '@ant-design/pro-components';
|
||||
import { useNavigate } from '@umijs/max';
|
||||
import { Space } from 'antd';
|
||||
import { useCallback, useState } from 'react';
|
||||
|
||||
export default function info(props: MyBetaModalFormProps) {
|
||||
const [show, setShow] = useState<any>({});
|
||||
const [loading, setLoading] = useState(false);
|
||||
const navigate = useNavigate();
|
||||
|
||||
const getShow = useCallback(() => {
|
||||
if (loading || !props?.item?.id) return;
|
||||
@ -50,8 +52,18 @@ export default function info(props: MyBetaModalFormProps) {
|
||||
<ProDescriptions bordered>
|
||||
<ProDescriptions.Item label="房屋全名" span={2}>
|
||||
<Space>
|
||||
<span>【{show?.id}】</span>
|
||||
{/* <span>【{show?.id}】</span> */}
|
||||
{show?.full_name}
|
||||
{show?.id ? (
|
||||
<MyButtons.View
|
||||
title="查看"
|
||||
onClick={() => {
|
||||
navigate(`/customer/archive/show/${show?.id}`);
|
||||
}}
|
||||
/>
|
||||
) : (
|
||||
'无'
|
||||
)}
|
||||
</Space>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="房号">
|
||||
|
||||
@ -18,6 +18,7 @@ import { ProTable } from '@ant-design/pro-components';
|
||||
import { Space } from 'antd';
|
||||
import { useState } from 'react';
|
||||
|
||||
import HousesShow from '../houses/modals/HousesShow';
|
||||
import AreaUpdate from './modals/AreaUpdate';
|
||||
import SpaceShow from './modals/SpaceShow';
|
||||
import SpaceUpdate from './modals/SpaceUpdate';
|
||||
@ -119,7 +120,20 @@ export default function Index({ title = '车位列表' }) {
|
||||
dataIndex: 'built_area',
|
||||
search: false,
|
||||
},
|
||||
|
||||
{
|
||||
title: '关联房屋',
|
||||
dataIndex: 'asset_houses_id',
|
||||
search: false,
|
||||
render: (_, item: any) =>
|
||||
item?.asset_houses_id ? (
|
||||
<HousesShow
|
||||
item={{ id: item?.asset_houses_id, type: 'link' }}
|
||||
title="查看"
|
||||
/>
|
||||
) : (
|
||||
'-'
|
||||
),
|
||||
},
|
||||
// MyColumns.CreatedAt(),
|
||||
MyColumns.UpdatedAt(),
|
||||
MyColumns.Option({
|
||||
|
||||
@ -61,12 +61,7 @@ export default function SpaceShow(props: MyBetaModalFormProps) {
|
||||
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
|
||||
@ -81,7 +76,9 @@ export default function SpaceShow(props: MyBetaModalFormProps) {
|
||||
'无'
|
||||
)}
|
||||
</ProDescriptions.Item>
|
||||
|
||||
<ProDescriptions.Item label="车牌号">
|
||||
{data?.car_number || '-'}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="备注" span={2}>
|
||||
{data?.remark || '-'}
|
||||
</ProDescriptions.Item>
|
||||
|
||||
@ -99,7 +99,45 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
params: {
|
||||
asset_projects_id: props?.item?.asset_projects_id,
|
||||
},
|
||||
title: '关联房屋',
|
||||
request: async (params) => {
|
||||
const res = await Apis.Asset.AssetHouses.SelectFullName({
|
||||
keywords: params?.keyWords,
|
||||
asset_projects_id: props?.item?.asset_projects_id,
|
||||
...params,
|
||||
});
|
||||
let list = res?.data || [];
|
||||
// 编辑模式下,确保当前选中的房屋在列表中,以正确显示 label
|
||||
const currentHouseId = props.item?.asset_houses_id;
|
||||
if (
|
||||
currentHouseId &&
|
||||
!list.some((item: any) => item.value === currentHouseId)
|
||||
) {
|
||||
try {
|
||||
const showRes = await Apis.Asset.AssetHouses.Show({
|
||||
id: currentHouseId,
|
||||
});
|
||||
if (showRes?.data) {
|
||||
list = [
|
||||
{
|
||||
label: showRes.data.full_name,
|
||||
value: showRes.data.id,
|
||||
},
|
||||
...list,
|
||||
];
|
||||
}
|
||||
} catch {
|
||||
/* ignore */
|
||||
}
|
||||
}
|
||||
return list;
|
||||
},
|
||||
}),
|
||||
{
|
||||
key: 'car_number',
|
||||
title: '车牌号',
|
||||
colProps: { span: 24 },
|
||||
},
|
||||
{
|
||||
key: 'remark',
|
||||
title: '备注',
|
||||
|
||||
@ -81,10 +81,8 @@ export default function ShowQrCode(props: MyBetaModalFormProps) {
|
||||
>
|
||||
<ProDescriptions.Item label="关联房屋/车位" span={2}>
|
||||
{props?.item?.asset_houses_id
|
||||
? ` ${props?.item?.asset_house?.full_name || ''}`
|
||||
: props?.item?.asset_car_port?.full_name
|
||||
? ` ${props?.item?.asset_car_port?.full_name}`
|
||||
: ''}
|
||||
? props?.item?.asset_house?.full_name || ''
|
||||
: props?.item?.asset_car_port?.full_name || ''}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="费用类型">
|
||||
<renderTextHelper.Tag
|
||||
@ -96,6 +94,13 @@ export default function ShowQrCode(props: MyBetaModalFormProps) {
|
||||
<ProDescriptions.Item label="应收金额">
|
||||
¥{props?.item?.total_payable_amount || 0}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="收款户名" span={2}>
|
||||
{props?.item?.receipt_account?.company_name || ''}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="收款账号">
|
||||
{props?.item?.receipt_account?.company_bank || ''}{' '}
|
||||
{props?.item?.receipt_account?.company_account || ''}
|
||||
</ProDescriptions.Item>
|
||||
</ProDescriptions>
|
||||
<Tabs
|
||||
activeKey={activeTab}
|
||||
|
||||
@ -13,7 +13,10 @@ export default function info(props: MyBetaModalFormProps) {
|
||||
<ProDescriptions bordered>
|
||||
<ProDescriptions.Item label="房屋名称" span={2}>
|
||||
<Space>
|
||||
{item?.asset_house?.full_name || '-'}
|
||||
<span>
|
||||
【{item?.asset_houses_id || '-'}】
|
||||
{item?.asset_house?.full_name || '-'}
|
||||
</span>
|
||||
<a
|
||||
onClick={() => {
|
||||
navigate(`/customer/archive/show/${item?.asset_houses_id}`);
|
||||
|
||||
@ -2,7 +2,7 @@ import { MyColumns, MyProTableProps } from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { HouseBillsBillStatusEnum, HouseBillsTypeEnum } from '@/gen/Enums';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { Space } from 'antd';
|
||||
import { Space, Tooltip } from 'antd';
|
||||
import { useEffect, useRef, useState } from 'react';
|
||||
import BillCopy from '../../house_bills/modals/BillCopy';
|
||||
import PayCreate from './modals/PayCreate';
|
||||
@ -32,7 +32,9 @@ export default function Index({ ...rest }) {
|
||||
MyProTableProps.request(
|
||||
{
|
||||
...params,
|
||||
asset_houses_id: rest.item?.asset_houses_id,
|
||||
...(rest.item?.asset_car_ports_id
|
||||
? { car_port_name: rest.item?.full_name || '' }
|
||||
: { asset_houses_id: rest.item?.asset_houses_id }),
|
||||
bill_status: [
|
||||
HouseBillsBillStatusEnum.PendingPayment.value,
|
||||
HouseBillsBillStatusEnum.PartiallyPaid.value,
|
||||
@ -95,6 +97,21 @@ export default function Index({ ...rest }) {
|
||||
valueEnum: HouseBillsTypeEnum,
|
||||
search: false,
|
||||
}),
|
||||
{
|
||||
title: '账单金额',
|
||||
dataIndex: 'amount',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '优惠金额',
|
||||
dataIndex: 'discount_amount',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '滞纳金',
|
||||
dataIndex: 'late_fee',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '应收金额',
|
||||
dataIndex: 'total_payable_amount',
|
||||
@ -117,10 +134,14 @@ export default function Index({ ...rest }) {
|
||||
title: '收款账号',
|
||||
dataIndex: 'receipt_account',
|
||||
render: (_, record) => {
|
||||
return `${record.receipt_account?.company_name}
|
||||
${record.receipt_account.company_account?.slice(0, 4)}
|
||||
****
|
||||
${record.receipt_account.company_account?.slice(-4)}`;
|
||||
const text = `${record.receipt_account.company_account}|${record.receipt_account?.company_name}|${record.receipt_account?.company_bank}`;
|
||||
return (
|
||||
<Tooltip title={text}>
|
||||
<span>
|
||||
{text.length > 16 ? `${text.slice(0, 16)}...` : text}
|
||||
</span>
|
||||
</Tooltip>
|
||||
);
|
||||
},
|
||||
search: false,
|
||||
},
|
||||
|
||||
@ -75,9 +75,9 @@ export default function ShowQrCode(props: MyBetaModalFormProps) {
|
||||
<ProDescriptions.Item label="关联房屋/车位" span={2}>
|
||||
{props?.item?.asset_houses_id
|
||||
? props?.item?.asset_house?.full_name || ''
|
||||
: props?.item?.asset_car_port?.full_name || ''}
|
||||
: props?.item?.full_name || ''}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="应收金额">
|
||||
<ProDescriptions.Item label="应收金额" span={2}>
|
||||
¥
|
||||
{props?.item?.list
|
||||
?.reduce(
|
||||
@ -87,6 +87,16 @@ export default function ShowQrCode(props: MyBetaModalFormProps) {
|
||||
)
|
||||
.toFixed(2) || 0}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="收款户名" span={2}>
|
||||
{props?.item?.list?.[0]?.receipt_account?.company_name ||
|
||||
''}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="收款账号">
|
||||
{props?.item?.list?.[0]?.receipt_account?.company_bank ||
|
||||
''}{' '}
|
||||
{props?.item?.list?.[0]?.receipt_account?.company_account ||
|
||||
''}
|
||||
</ProDescriptions.Item>
|
||||
</ProDescriptions>
|
||||
<Tabs
|
||||
activeKey={activeTab}
|
||||
|
||||
@ -14,6 +14,7 @@ export default function Show(props: MyBetaModalFormProps) {
|
||||
const { id } = useParams<{ id: string }>();
|
||||
const [data, setShow] = useState<any>({});
|
||||
const [pendingCount, setPendingCount] = useState<number>(0);
|
||||
const [totalPayableSum, setTotalPayableSum] = useState<number>(0);
|
||||
|
||||
const loadShow = () => {
|
||||
let paramsId: any = { id: id ?? 0 };
|
||||
@ -22,6 +23,16 @@ export default function Show(props: MyBetaModalFormProps) {
|
||||
});
|
||||
};
|
||||
|
||||
const loadTotalPayableSum = () => {
|
||||
Apis.Bill.HouseBills.SummaryShow({
|
||||
asset_houses_id: Number(id),
|
||||
})
|
||||
.then((res) => {
|
||||
setTotalPayableSum(res?.data?.total_payable_sum || 0);
|
||||
})
|
||||
.catch(() => setTotalPayableSum(0));
|
||||
};
|
||||
|
||||
const loadPendingCount = () => {
|
||||
Apis.Archive.HouseRegisters.List({
|
||||
asset_houses_id: Number(id),
|
||||
@ -34,6 +45,7 @@ export default function Show(props: MyBetaModalFormProps) {
|
||||
useEffect(() => {
|
||||
loadShow();
|
||||
loadPendingCount();
|
||||
loadTotalPayableSum();
|
||||
}, [props.item?.id]);
|
||||
|
||||
let items = [
|
||||
@ -43,10 +55,15 @@ export default function Show(props: MyBetaModalFormProps) {
|
||||
closable: false,
|
||||
children: (
|
||||
<OccupantsNow
|
||||
item={{ ...data, asset_houses_id: id }}
|
||||
item={{
|
||||
...data,
|
||||
asset_houses_id: id,
|
||||
total_payable_sum: totalPayableSum,
|
||||
}}
|
||||
reload={() => {
|
||||
loadShow();
|
||||
loadPendingCount();
|
||||
loadTotalPayableSum();
|
||||
}}
|
||||
/>
|
||||
),
|
||||
@ -80,9 +97,14 @@ export default function Show(props: MyBetaModalFormProps) {
|
||||
return (
|
||||
<>
|
||||
<HouseInfo item={data} reload={loadShow} />
|
||||
{id && <SummaryInfo item={{ ...data, id: id }} reload={loadShow} />}
|
||||
{id && (
|
||||
<SummaryInfo
|
||||
item={{ ...data, id: id, total_payable_sum: totalPayableSum }}
|
||||
reload={loadShow}
|
||||
/>
|
||||
)}
|
||||
<ProCard style={{ marginTop: 16 }}>
|
||||
<Tabs type="card" items={items} defaultActiveKey="1" />
|
||||
<Tabs type="card" items={items} defaultActiveKey="1" size="small" />
|
||||
</ProCard>
|
||||
</>
|
||||
);
|
||||
|
||||
56
src/pages/customer/archive/components/BillInfo.tsx
Normal file
56
src/pages/customer/archive/components/BillInfo.tsx
Normal file
@ -0,0 +1,56 @@
|
||||
import { MyBetaModalFormProps } from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import CancelledBill from '@/pages/bills/summary/table/CancelledBill';
|
||||
import PaidBill from '@/pages/bills/summary/table/PaidBill';
|
||||
|
||||
import UnpaidBill from '@/pages/bills/summary/table/UnpaidBill';
|
||||
import { ProCard } from '@ant-design/pro-components';
|
||||
import { useParams } from '@umijs/max';
|
||||
import { Tabs } from 'antd';
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
export default function Show(props: MyBetaModalFormProps) {
|
||||
const { id } = useParams<{ id: string }>();
|
||||
const [data, setShow] = useState<any>({});
|
||||
|
||||
const loadShow = () => {
|
||||
let paramsId: any = { asset_houses_id: id ?? 0 };
|
||||
Apis.HouseOrder.HousePrepayments.Show(paramsId).then((res) => {
|
||||
setShow(res?.data);
|
||||
});
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
loadShow();
|
||||
}, [id]);
|
||||
|
||||
let items = [
|
||||
{
|
||||
label: '欠费账单',
|
||||
key: '1',
|
||||
closable: false,
|
||||
children: <UnpaidBill item={{ ...data, asset_houses_id: id }} />,
|
||||
},
|
||||
{
|
||||
label: '已付账单',
|
||||
key: '2',
|
||||
closable: false,
|
||||
children: <PaidBill item={{ ...data, asset_houses_id: id }} />,
|
||||
},
|
||||
{
|
||||
label: '作废账单',
|
||||
key: '3',
|
||||
closable: false,
|
||||
children: <CancelledBill item={{ ...data, asset_houses_id: id }} />,
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* <SummaryInfo item={{ ...data, id: id }} reload={loadShow} /> */}
|
||||
<ProCard style={{ marginTop: 16 }}>
|
||||
<Tabs type="card" items={items} defaultActiveKey="1" size="small" />
|
||||
</ProCard>
|
||||
</>
|
||||
);
|
||||
}
|
||||
86
src/pages/customer/archive/components/Parking.tsx
Normal file
86
src/pages/customer/archive/components/Parking.tsx
Normal file
@ -0,0 +1,86 @@
|
||||
import { MyBetaModalFormProps, MyColumns, MyProTableProps } from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import {
|
||||
AssetCarPortsPropertyTypeEnum,
|
||||
AssetCarPortsStatusEnum,
|
||||
AssetCarPortsTypeEnum,
|
||||
} from '@/gen/Enums';
|
||||
import SpaceShow from '@/pages/asset/parking_space/modals/SpaceShow';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { Space } from 'antd';
|
||||
|
||||
export default function Index(props: MyBetaModalFormProps) {
|
||||
const { item } = props;
|
||||
if (!item) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<ProTable
|
||||
{...MyProTableProps.props}
|
||||
headerTitle="房屋关联车位"
|
||||
request={async (params, sort) =>
|
||||
MyProTableProps.request(
|
||||
{
|
||||
...params,
|
||||
asset_houses_id: item.id,
|
||||
},
|
||||
sort,
|
||||
Apis.Asset.AssetCarPorts.List,
|
||||
)
|
||||
}
|
||||
search={false}
|
||||
columns={[
|
||||
MyColumns.ID({
|
||||
search: false,
|
||||
}),
|
||||
{
|
||||
title: '车场名称',
|
||||
dataIndex: ['asset_parking_place', 'name'],
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '车位号',
|
||||
dataIndex: 'name',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '车位全称',
|
||||
dataIndex: 'full_name',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '建筑面积',
|
||||
dataIndex: 'built_area',
|
||||
search: false,
|
||||
},
|
||||
MyColumns.EnumTag({
|
||||
title: '类型',
|
||||
dataIndex: 'type',
|
||||
valueEnum: AssetCarPortsTypeEnum,
|
||||
search: false,
|
||||
}),
|
||||
MyColumns.EnumTag({
|
||||
title: '产权类型',
|
||||
dataIndex: 'property_type',
|
||||
valueEnum: AssetCarPortsPropertyTypeEnum,
|
||||
search: false,
|
||||
}),
|
||||
MyColumns.EnumTag({
|
||||
title: '状态',
|
||||
dataIndex: 'status',
|
||||
valueEnum: AssetCarPortsStatusEnum,
|
||||
search: false,
|
||||
}),
|
||||
MyColumns.CreatedAt(),
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
<SpaceShow item={item} title="车位详情" />
|
||||
</Space>
|
||||
),
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@ -1,42 +1,19 @@
|
||||
import { MyBetaModalFormProps, MyButtons } from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { ProCard, ProDescriptions } from '@ant-design/pro-components';
|
||||
import { useNavigate } from '@umijs/max';
|
||||
import { Space } from 'antd';
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
export default function Info(props: MyBetaModalFormProps) {
|
||||
const [getShow, setDataShow] = useState<any>({});
|
||||
export default function SummaryInfo(props: MyBetaModalFormProps) {
|
||||
const navigate = useNavigate();
|
||||
|
||||
useEffect(() => {
|
||||
Apis.Bill.HouseBills.SummaryShow({
|
||||
asset_houses_id: props?.item?.id,
|
||||
})
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
setDataShow(JSON.parse(JSON.stringify(res?.data)));
|
||||
return false;
|
||||
})
|
||||
.catch(() => false);
|
||||
}, [props?.item?.id]);
|
||||
const totalPayableSum = props?.item?.total_payable_sum;
|
||||
|
||||
return (
|
||||
<ProCard>
|
||||
<ProDescriptions bordered>
|
||||
{/* <ProDescriptions.Item label="账单金额">
|
||||
{getShow?.payable_amount_sum || '-'}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="滞纳金">
|
||||
{getShow?.late_fee_sum || '-'}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="优惠金额">
|
||||
{getShow?.discount_amount_sum || '-'}
|
||||
</ProDescriptions.Item> */}
|
||||
<ProDescriptions.Item label="未缴金额">
|
||||
<ProDescriptions>
|
||||
<ProDescriptions.Item label="应收金额">
|
||||
<Space>
|
||||
{getShow?.total_payable_sum ? `¥${getShow?.total_payable_sum}` : ''}
|
||||
{getShow?.total_payable_sum ? (
|
||||
{totalPayableSum ? `¥${totalPayableSum}` : ''}
|
||||
{totalPayableSum ? (
|
||||
<MyButtons.View
|
||||
title="查看账单"
|
||||
size="small"
|
||||
|
||||
@ -16,10 +16,12 @@ import {
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { useNavigate } from '@umijs/max';
|
||||
import { Tag } from 'antd';
|
||||
import { useRef } from 'react';
|
||||
import Delivery from './modals/Delivery';
|
||||
|
||||
export default function Index({ title = '房屋档案' }) {
|
||||
const navigate = useNavigate();
|
||||
const formRef = useRef<any>();
|
||||
|
||||
return (
|
||||
<MyPageContainer
|
||||
@ -34,6 +36,7 @@ export default function Index({ title = '房屋档案' }) {
|
||||
request={async (params, sort) =>
|
||||
MyProTableProps.request(params, sort, Apis.Asset.AssetHouses.List)
|
||||
}
|
||||
formRef={formRef}
|
||||
toolBarRender={(action) => [
|
||||
<MyToolBarActions
|
||||
key="toolbar"
|
||||
@ -58,15 +61,58 @@ export default function Index({ title = '房屋档案' }) {
|
||||
title: '选择项目',
|
||||
key: 'asset_projects_id',
|
||||
hidden: true,
|
||||
fieldProps: {
|
||||
onChange: () => {
|
||||
formRef.current?.setFieldsValue({
|
||||
asset_buildings_id: undefined,
|
||||
asset_units_id: undefined,
|
||||
asset_houses_id: undefined,
|
||||
});
|
||||
},
|
||||
},
|
||||
}),
|
||||
Selects?.AssetBuildings({
|
||||
title: '选择楼栋',
|
||||
key: 'asset_buildings_id',
|
||||
hidden: true,
|
||||
dependencies: ['asset_projects_id'],
|
||||
fieldProps: {
|
||||
onChange: () => {
|
||||
formRef.current?.setFieldsValue({
|
||||
asset_units_id: undefined,
|
||||
asset_houses_id: undefined,
|
||||
});
|
||||
},
|
||||
},
|
||||
}),
|
||||
Selects?.AssetUnits({
|
||||
title: '选择单元',
|
||||
key: 'asset_units_id',
|
||||
hidden: true,
|
||||
dependencies: ['asset_buildings_id'],
|
||||
fieldProps: {
|
||||
onChange: () => {
|
||||
formRef.current?.setFieldsValue({
|
||||
asset_houses_id: undefined,
|
||||
});
|
||||
},
|
||||
},
|
||||
}),
|
||||
Selects?.AssetHouses({
|
||||
title: '选择房屋',
|
||||
key: 'asset_houses_id',
|
||||
hidden: true,
|
||||
dependencies: ['asset_units_id'],
|
||||
}),
|
||||
{
|
||||
title: '项目名称',
|
||||
dataIndex: ['asset_project', 'name'],
|
||||
search: {
|
||||
transform: (value) => {
|
||||
return { project_name: value };
|
||||
},
|
||||
},
|
||||
search: false,
|
||||
// search: {
|
||||
// transform: (value) => {
|
||||
// return { project_name: value };
|
||||
// },
|
||||
// },
|
||||
},
|
||||
{
|
||||
title: '房屋名称',
|
||||
@ -108,7 +154,7 @@ export default function Index({ title = '房屋档案' }) {
|
||||
// search: false,
|
||||
// },
|
||||
{
|
||||
title: '客户信息',
|
||||
title: '产权人',
|
||||
render(_, record) {
|
||||
const owners =
|
||||
record?.house_occupants?.filter(
|
||||
@ -122,7 +168,7 @@ export default function Index({ title = '房屋档案' }) {
|
||||
<div>
|
||||
{owners.length > 0 && (
|
||||
<div>
|
||||
<Tag color="blue">产权人</Tag>
|
||||
{/* <Tag color="blue">产权人</Tag> */}
|
||||
{owners.map((owner: any) => owner?.name).join('、')}
|
||||
</div>
|
||||
)}
|
||||
|
||||
@ -69,7 +69,7 @@ export default function Delivery(props: MyBetaModalFormProps) {
|
||||
key: 'ownership_info',
|
||||
title: '产权文件',
|
||||
tooltip: '上限9张',
|
||||
uploadType: 'file',
|
||||
// uploadType: 'file',
|
||||
max: 9,
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.array },
|
||||
|
||||
@ -5,7 +5,9 @@ import { useParams } from '@umijs/max';
|
||||
import { Tabs } from 'antd';
|
||||
import { useEffect, useState } from 'react';
|
||||
import BasicInfo from '../components/BasicInfo';
|
||||
import BillInfo from '../components/BillInfo';
|
||||
import MeterInfo from '../components/MeterInfo';
|
||||
import Parking from '../components/Parking';
|
||||
import WordorderInfo from '../components/WordorderInfo';
|
||||
|
||||
export default function Show({ title }: { title?: string } = {}) {
|
||||
@ -44,6 +46,12 @@ export default function Show({ title }: { title?: string } = {}) {
|
||||
closable: false,
|
||||
children: <BasicInfo item={{ id }} reload={() => loadShow()} />,
|
||||
},
|
||||
{
|
||||
label: '账单信息',
|
||||
key: 'bills',
|
||||
closable: false,
|
||||
children: <BillInfo item={{ id }} />,
|
||||
},
|
||||
{
|
||||
label: '仪表信息',
|
||||
key: 'meters',
|
||||
@ -56,6 +64,12 @@ export default function Show({ title }: { title?: string } = {}) {
|
||||
closable: false,
|
||||
children: <WordorderInfo item={data} />,
|
||||
},
|
||||
{
|
||||
label: '车位',
|
||||
key: 'parkings',
|
||||
closable: false,
|
||||
children: <Parking item={data} />,
|
||||
},
|
||||
];
|
||||
return (
|
||||
<MyPageContainer
|
||||
|
||||
@ -52,20 +52,20 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
key: 'residential_relation',
|
||||
title: '关联身份',
|
||||
colProps: { span: 8 },
|
||||
valueEnum: HouseOccupantsResidentialRelationEnum,
|
||||
// valueEnum: () => {
|
||||
// let obj: any = JSON.parse(
|
||||
// JSON.stringify(HouseOccupantsResidentialRelationEnum),
|
||||
// );
|
||||
// delete obj.PropertyOwner;
|
||||
// return obj;
|
||||
// },
|
||||
// valueEnum: HouseOccupantsResidentialRelationEnum,
|
||||
valueEnum: () => {
|
||||
let obj: any = JSON.parse(
|
||||
JSON.stringify(HouseOccupantsResidentialRelationEnum),
|
||||
);
|
||||
delete obj.PropertyOwner;
|
||||
return obj;
|
||||
},
|
||||
required: true,
|
||||
// fieldProps: {
|
||||
// disabled:
|
||||
// props?.item?.residential_relation ===
|
||||
// HouseOccupantsResidentialRelationEnum.PropertyOwner.value,
|
||||
// },
|
||||
fieldProps: {
|
||||
disabled:
|
||||
props?.item?.residential_relation ===
|
||||
HouseOccupantsResidentialRelationEnum.PropertyOwner.value,
|
||||
},
|
||||
}),
|
||||
{
|
||||
name: ['residential_relation'],
|
||||
|
||||
@ -121,7 +121,8 @@ export default function RegistersShow(props: MyBetaModalFormProps) {
|
||||
/>
|
||||
</ProCard>
|
||||
|
||||
{props?.item?.type === 'Delivery' && (
|
||||
{(props?.item?.type === 'AddOwner' ||
|
||||
props?.item?.type === 'Transfer') && (
|
||||
<ProCard title="产证信息" style={{ paddingRight: 10 }}>
|
||||
<Image.PreviewGroup>
|
||||
{props?.item?.ownership_info?.map((res: any, index: number) => {
|
||||
|
||||
@ -11,200 +11,229 @@ import {
|
||||
HouseOccupantsHouseRelationEnum,
|
||||
} from '@/gen/Enums';
|
||||
import { BetaSchemaForm, ProCard } from '@ant-design/pro-components';
|
||||
import { Form, message } from 'antd';
|
||||
import { Form, message, Modal } from 'antd';
|
||||
import { useState } from 'react';
|
||||
|
||||
export default function Create(props: MyBetaModalFormProps) {
|
||||
export default function Transfer(props: MyBetaModalFormProps) {
|
||||
const [form] = Form.useForm();
|
||||
return (
|
||||
<BetaSchemaForm<ApiTypes.Archive.HouseRegisters.Store>
|
||||
{...MyModalFormProps.props}
|
||||
title={`${props.title}`}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="1000px"
|
||||
trigger={
|
||||
<MyButtons.Default title={props.title} size="middle" type="primary" />
|
||||
}
|
||||
key={new Date().getTime()}
|
||||
form={form}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open) {
|
||||
form.resetFields(); // 清空表单数据
|
||||
}
|
||||
}}
|
||||
onFinish={async (values) =>
|
||||
Apis.Archive.HouseRegisters.Store({
|
||||
...values,
|
||||
asset_houses_id: props?.item?.id,
|
||||
type: 'Transfer',
|
||||
customer_info: values.customer_info?.map((res: any) => {
|
||||
return {
|
||||
...res,
|
||||
house_relation: 'Owner',
|
||||
relation_with_owner: 'Self',
|
||||
residential_relation: 'PropertyOwner',
|
||||
};
|
||||
}),
|
||||
})
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
message.success(props.title + '成功');
|
||||
return true;
|
||||
})
|
||||
.catch(() => false)
|
||||
}
|
||||
columns={[
|
||||
// MyFormItems.EnumRadio({
|
||||
// key: 'house_status',
|
||||
// title: '房屋状态',
|
||||
// colProps: { span: 12 },
|
||||
// valueEnum: HouseRegistersHouseStatusEnum,
|
||||
// formItemProps: { ...rulesHelper.text },
|
||||
// }),
|
||||
// MyFormItems.EnumRadio({
|
||||
// key: 'house_status',
|
||||
// title: '使用计划',
|
||||
// colProps: { span: 8 },
|
||||
// valueEnum: HouseRegistersUsagePlanEnum,
|
||||
// formItemProps: { ...rulesHelper.text },
|
||||
// }),
|
||||
// MyFormItems.EnumSelect({
|
||||
// key: 'customer_type',
|
||||
// title: '产权归属',
|
||||
// colProps: { span: 6 },
|
||||
// valueEnum: HouseRegistersCustomerTypeEnum,
|
||||
// }),
|
||||
MyFormItems.UploadImages({
|
||||
key: 'ownership_info',
|
||||
title: '产权文件',
|
||||
tooltip: '上限3张',
|
||||
uploadType: 'file',
|
||||
max: 3,
|
||||
colProps: { span: 18 },
|
||||
formItemProps: { ...rulesHelper.array },
|
||||
}),
|
||||
{
|
||||
valueType: 'formList',
|
||||
dataIndex: 'customer_info',
|
||||
colProps: { span: 24 },
|
||||
fieldProps: {
|
||||
copyIconProps: false,
|
||||
creatorButtonProps: {
|
||||
creatorButtonText: '添加业主',
|
||||
},
|
||||
itemRender: (
|
||||
{ listDom, action }: any,
|
||||
{ index }: { index: number },
|
||||
) => {
|
||||
return (
|
||||
<ProCard
|
||||
bordered
|
||||
style={{ marginBlockEnd: 0 }}
|
||||
title={`产权人 ${index + 1}`}
|
||||
extra={action}
|
||||
bodyStyle={{ paddingBlockEnd: 0 }}
|
||||
>
|
||||
{listDom}
|
||||
</ProCard>
|
||||
);
|
||||
},
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
valueType: 'group',
|
||||
columns: [
|
||||
{
|
||||
title: '名称',
|
||||
dataIndex: 'name',
|
||||
colProps: { span: 5 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
title: '手机号',
|
||||
dataIndex: 'phone',
|
||||
colProps: { span: 5 },
|
||||
fieldProps: {
|
||||
maxLength: 11,
|
||||
},
|
||||
formItemProps: { ...rulesHelper.phone },
|
||||
},
|
||||
MyFormItems.EnumSelect({
|
||||
key: 'card_type',
|
||||
title: '证件类型',
|
||||
colProps: { span: 6 },
|
||||
valueEnum: HouseOccupantsCardTypeEnum,
|
||||
required: true,
|
||||
}),
|
||||
{
|
||||
title: '证件号码',
|
||||
dataIndex: 'id_card',
|
||||
colProps: { span: 8 },
|
||||
fieldProps: {
|
||||
maxLength: 18,
|
||||
},
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'house_relation',
|
||||
title: '住户类型',
|
||||
colProps: { span: 6 },
|
||||
valueEnum: HouseOccupantsHouseRelationEnum,
|
||||
fieldProps: {
|
||||
defaultValue: 'Owner',
|
||||
},
|
||||
hideInForm: true,
|
||||
}),
|
||||
{
|
||||
valueType: 'group',
|
||||
columns: [
|
||||
MyFormItems.UploadImages({
|
||||
key: 'card_front_image',
|
||||
title: '证件正面',
|
||||
uploadType: 'file',
|
||||
required: true,
|
||||
max: 1,
|
||||
colProps: { span: 6 },
|
||||
}),
|
||||
MyFormItems.UploadImages({
|
||||
key: 'card_back_image',
|
||||
title: '证件反面',
|
||||
uploadType: 'file',
|
||||
required: true,
|
||||
max: 1,
|
||||
colProps: { span: 6 },
|
||||
}),
|
||||
{
|
||||
title: '是否入住',
|
||||
dataIndex: 'is_live_in',
|
||||
colProps: { span: 6 },
|
||||
valueType: 'switch',
|
||||
},
|
||||
{
|
||||
name: ['is_live_in'],
|
||||
valueType: 'dependency',
|
||||
columns: ({ is_live_in }: any) => {
|
||||
return is_live_in
|
||||
? [
|
||||
{
|
||||
title: '入住日期',
|
||||
dataIndex: 'move_in_date',
|
||||
valueType: 'date',
|
||||
colProps: { span: 6 },
|
||||
fieldProps: {
|
||||
style: { width: '100%' },
|
||||
},
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
]
|
||||
: [];
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
const [open, setOpen] = useState(false);
|
||||
|
||||
const handleOpen = () => {
|
||||
const totalPayableSum = props?.item?.total_payable_sum;
|
||||
if (totalPayableSum && totalPayableSum > 0) {
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
content: `该房屋存在未收取的账单,金额合计: ¥${totalPayableSum} ,是否继续操作过户 ?`,
|
||||
okText: '继续过户',
|
||||
cancelText: '取消',
|
||||
onOk: () => {
|
||||
form.resetFields();
|
||||
setOpen(true);
|
||||
},
|
||||
]}
|
||||
/>
|
||||
onCancel: () => {
|
||||
setOpen(false);
|
||||
},
|
||||
});
|
||||
} else {
|
||||
form.resetFields();
|
||||
setOpen(true);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<MyButtons.Default
|
||||
title={props.title}
|
||||
size="middle"
|
||||
type="primary"
|
||||
disabled={!props.item?.house_occupants?.length}
|
||||
onClick={handleOpen}
|
||||
/>
|
||||
<BetaSchemaForm<ApiTypes.Archive.HouseRegisters.Store>
|
||||
{...MyModalFormProps.props}
|
||||
title={`${props.title}`}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="1000px"
|
||||
open={open}
|
||||
onOpenChange={setOpen}
|
||||
key={new Date().getTime()}
|
||||
form={form}
|
||||
onFinish={async (values) =>
|
||||
Apis.Archive.HouseRegisters.Store({
|
||||
...values,
|
||||
asset_houses_id: props?.item?.id,
|
||||
type: 'Transfer',
|
||||
customer_info: values.customer_info?.map((res: any) => {
|
||||
return {
|
||||
...res,
|
||||
house_relation: 'Owner',
|
||||
relation_with_owner: 'Self',
|
||||
residential_relation: 'PropertyOwner',
|
||||
};
|
||||
}),
|
||||
})
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
message.success(props.title + '成功');
|
||||
return true;
|
||||
})
|
||||
.catch(() => false)
|
||||
}
|
||||
columns={[
|
||||
// MyFormItems.EnumRadio({
|
||||
// key: 'house_status',
|
||||
// title: '房屋状态',
|
||||
// colProps: { span: 12 },
|
||||
// valueEnum: HouseRegistersHouseStatusEnum,
|
||||
// formItemProps: { ...rulesHelper.text },
|
||||
// }),
|
||||
// MyFormItems.EnumRadio({
|
||||
// key: 'house_status',
|
||||
// title: '使用计划',
|
||||
// colProps: { span: 8 },
|
||||
// valueEnum: HouseRegistersUsagePlanEnum,
|
||||
// formItemProps: { ...rulesHelper.text },
|
||||
// }),
|
||||
// MyFormItems.EnumSelect({
|
||||
// key: 'customer_type',
|
||||
// title: '产权归属',
|
||||
// colProps: { span: 6 },
|
||||
// valueEnum: HouseRegistersCustomerTypeEnum,
|
||||
// }),
|
||||
MyFormItems.UploadImages({
|
||||
key: 'ownership_info',
|
||||
title: '产权文件',
|
||||
tooltip: '上限9张',
|
||||
// uploadType: 'file',
|
||||
max: 9,
|
||||
colProps: { span: 18 },
|
||||
formItemProps: { ...rulesHelper.array },
|
||||
}),
|
||||
{
|
||||
valueType: 'formList',
|
||||
dataIndex: 'customer_info',
|
||||
colProps: { span: 24 },
|
||||
initialValue: [''],
|
||||
fieldProps: {
|
||||
copyIconProps: false,
|
||||
creatorButtonProps: {
|
||||
creatorButtonText: '添加业主',
|
||||
},
|
||||
itemRender: (
|
||||
{ listDom, action }: any,
|
||||
{ index }: { index: number },
|
||||
) => {
|
||||
return (
|
||||
<ProCard
|
||||
bordered
|
||||
style={{ marginBlockEnd: 0 }}
|
||||
title={`产权人 ${index + 1}`}
|
||||
extra={action}
|
||||
bodyStyle={{ paddingBlockEnd: 0 }}
|
||||
>
|
||||
{listDom}
|
||||
</ProCard>
|
||||
);
|
||||
},
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
valueType: 'group',
|
||||
columns: [
|
||||
{
|
||||
title: '名称',
|
||||
dataIndex: 'name',
|
||||
colProps: { span: 5 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
title: '手机号',
|
||||
dataIndex: 'phone',
|
||||
colProps: { span: 5 },
|
||||
fieldProps: {
|
||||
maxLength: 11,
|
||||
},
|
||||
formItemProps: { ...rulesHelper.phone },
|
||||
},
|
||||
MyFormItems.EnumSelect({
|
||||
key: 'card_type',
|
||||
title: '证件类型',
|
||||
colProps: { span: 6 },
|
||||
valueEnum: HouseOccupantsCardTypeEnum,
|
||||
required: true,
|
||||
}),
|
||||
{
|
||||
title: '证件号码',
|
||||
dataIndex: 'id_card',
|
||||
colProps: { span: 8 },
|
||||
fieldProps: {
|
||||
maxLength: 18,
|
||||
},
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'house_relation',
|
||||
title: '住户类型',
|
||||
colProps: { span: 6 },
|
||||
valueEnum: HouseOccupantsHouseRelationEnum,
|
||||
fieldProps: {
|
||||
defaultValue: 'Owner',
|
||||
},
|
||||
hideInForm: true,
|
||||
}),
|
||||
{
|
||||
valueType: 'group',
|
||||
columns: [
|
||||
MyFormItems.UploadImages({
|
||||
key: 'card_front_image',
|
||||
title: '证件正面',
|
||||
// uploadType: 'file',
|
||||
required: true,
|
||||
max: 1,
|
||||
colProps: { span: 6 },
|
||||
}),
|
||||
MyFormItems.UploadImages({
|
||||
key: 'card_back_image',
|
||||
title: '证件反面',
|
||||
// uploadType: 'file',
|
||||
required: true,
|
||||
max: 1,
|
||||
colProps: { span: 6 },
|
||||
}),
|
||||
{
|
||||
title: '是否入住',
|
||||
dataIndex: 'is_live_in',
|
||||
colProps: { span: 6 },
|
||||
valueType: 'switch',
|
||||
},
|
||||
{
|
||||
name: ['is_live_in'],
|
||||
valueType: 'dependency',
|
||||
columns: ({ is_live_in }: any) => {
|
||||
return is_live_in
|
||||
? [
|
||||
{
|
||||
title: '入住日期',
|
||||
dataIndex: 'move_in_date',
|
||||
valueType: 'date',
|
||||
colProps: { span: 6 },
|
||||
fieldProps: {
|
||||
style: { width: '100%' },
|
||||
},
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
]
|
||||
: [];
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
]}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@ -233,7 +233,8 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
/>
|
||||
</ProCard>
|
||||
)}
|
||||
{props?.item?.type === 'AddOwner' &&
|
||||
{(props?.item?.type === 'AddOwner' ||
|
||||
props?.item?.type === 'Transfer') &&
|
||||
props?.item?.ownership_info &&
|
||||
props?.item?.ownership_info?.length > 0 && (
|
||||
<ProCard title="产证信息" size="small">
|
||||
@ -243,7 +244,7 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
(res: any, index: number) => (
|
||||
<Image
|
||||
key={`${res?.name}_${index}`}
|
||||
width={100}
|
||||
width={40}
|
||||
src={res?.url || ''}
|
||||
placeholder="产证资料"
|
||||
/>
|
||||
|
||||
@ -202,7 +202,8 @@ export default function Show(props: MyBetaModalFormProps) {
|
||||
/>
|
||||
</ProCard>
|
||||
)}
|
||||
{props?.item?.type === 'AddOwner' &&
|
||||
{(props?.item?.type === 'AddOwner' ||
|
||||
props?.item?.type === 'Transfer') &&
|
||||
props?.item?.ownership_info &&
|
||||
props?.item?.ownership_info?.length > 0 && (
|
||||
<ProCard title="产证信息" size="small">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user