diff --git a/src/pages/asset/houses/modals/HousesShow.tsx b/src/pages/asset/houses/modals/HousesShow.tsx index 5ded783..c733ff7 100644 --- a/src/pages/asset/houses/modals/HousesShow.tsx +++ b/src/pages/asset/houses/modals/HousesShow.tsx @@ -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({}); 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) { - 【{show?.id}】 + {/* 【{show?.id}】 */} {show?.full_name} + {show?.id ? ( + { + navigate(`/customer/archive/show/${show?.id}`); + }} + /> + ) : ( + '无' + )} diff --git a/src/pages/asset/parking_space/index.tsx b/src/pages/asset/parking_space/index.tsx index 27ab566..cd8153c 100644 --- a/src/pages/asset/parking_space/index.tsx +++ b/src/pages/asset/parking_space/index.tsx @@ -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 ? ( + + ) : ( + '-' + ), + }, // MyColumns.CreatedAt(), MyColumns.UpdatedAt(), MyColumns.Option({ diff --git a/src/pages/asset/parking_space/modals/SpaceShow.tsx b/src/pages/asset/parking_space/modals/SpaceShow.tsx index b005d25..5f685d7 100644 --- a/src/pages/asset/parking_space/modals/SpaceShow.tsx +++ b/src/pages/asset/parking_space/modals/SpaceShow.tsx @@ -61,12 +61,7 @@ export default function SpaceShow(props: MyBetaModalFormProps) { value={data?.status} /> - - {data?.owner_name || '-'} - - - {data?.owner_phone || '-'} - + {data?.asset_houses_id ? ( - + + {data?.car_number || '-'} + {data?.remark || '-'} diff --git a/src/pages/asset/parking_space/modals/SpaceUpdate.tsx b/src/pages/asset/parking_space/modals/SpaceUpdate.tsx index 88a30aa..54de47c 100644 --- a/src/pages/asset/parking_space/modals/SpaceUpdate.tsx +++ b/src/pages/asset/parking_space/modals/SpaceUpdate.tsx @@ -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: '备注', diff --git a/src/pages/bills/house_bills/modals/QrCode.tsx b/src/pages/bills/house_bills/modals/QrCode.tsx index 52a0b22..1abcd40 100644 --- a/src/pages/bills/house_bills/modals/QrCode.tsx +++ b/src/pages/bills/house_bills/modals/QrCode.tsx @@ -81,10 +81,8 @@ export default function ShowQrCode(props: MyBetaModalFormProps) { > {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 || ''} ¥{props?.item?.total_payable_amount || 0} + + {props?.item?.receipt_account?.company_name || ''} + + + {props?.item?.receipt_account?.company_bank || ''}{' '} + {props?.item?.receipt_account?.company_account || ''} + - {item?.asset_house?.full_name || '-'} + + 【{item?.asset_houses_id || '-'}】 + {item?.asset_house?.full_name || '-'} + { navigate(`/customer/archive/show/${item?.asset_houses_id}`); diff --git a/src/pages/bills/summary/table/UnpaidBill.tsx b/src/pages/bills/summary/table/UnpaidBill.tsx index 53549ee..d6b2f34 100644 --- a/src/pages/bills/summary/table/UnpaidBill.tsx +++ b/src/pages/bills/summary/table/UnpaidBill.tsx @@ -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 ( + + + {text.length > 16 ? `${text.slice(0, 16)}...` : text} + + + ); }, search: false, }, diff --git a/src/pages/bills/summary/table/modals/ShowQrCode.tsx b/src/pages/bills/summary/table/modals/ShowQrCode.tsx index c491d59..3bf78fe 100644 --- a/src/pages/bills/summary/table/modals/ShowQrCode.tsx +++ b/src/pages/bills/summary/table/modals/ShowQrCode.tsx @@ -75,9 +75,9 @@ export default function ShowQrCode(props: MyBetaModalFormProps) { {props?.item?.asset_houses_id ? props?.item?.asset_house?.full_name || '' - : props?.item?.asset_car_port?.full_name || ''} + : props?.item?.full_name || ''} - + ¥ {props?.item?.list ?.reduce( @@ -87,6 +87,16 @@ export default function ShowQrCode(props: MyBetaModalFormProps) { ) .toFixed(2) || 0} + + {props?.item?.list?.[0]?.receipt_account?.company_name || + ''} + + + {props?.item?.list?.[0]?.receipt_account?.company_bank || + ''}{' '} + {props?.item?.list?.[0]?.receipt_account?.company_account || + ''} + (); const [data, setShow] = useState({}); const [pendingCount, setPendingCount] = useState(0); + const [totalPayableSum, setTotalPayableSum] = useState(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: ( { loadShow(); loadPendingCount(); + loadTotalPayableSum(); }} /> ), @@ -80,9 +97,14 @@ export default function Show(props: MyBetaModalFormProps) { return ( <> - {id && } + {id && ( + + )} - + ); diff --git a/src/pages/customer/archive/components/BillInfo.tsx b/src/pages/customer/archive/components/BillInfo.tsx new file mode 100644 index 0000000..d0bbbab --- /dev/null +++ b/src/pages/customer/archive/components/BillInfo.tsx @@ -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({}); + + 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: , + }, + { + label: '已付账单', + key: '2', + closable: false, + children: , + }, + { + label: '作废账单', + key: '3', + closable: false, + children: , + }, + ]; + + return ( + <> + {/* */} + + + + + ); +} diff --git a/src/pages/customer/archive/components/Parking.tsx b/src/pages/customer/archive/components/Parking.tsx new file mode 100644 index 0000000..3dc00f1 --- /dev/null +++ b/src/pages/customer/archive/components/Parking.tsx @@ -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 ( + + 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) => ( + + + + ), + }), + ]} + /> + ); +} diff --git a/src/pages/customer/archive/components/SummaryInfo.tsx b/src/pages/customer/archive/components/SummaryInfo.tsx index d1e6e8d..5f98fbb 100644 --- a/src/pages/customer/archive/components/SummaryInfo.tsx +++ b/src/pages/customer/archive/components/SummaryInfo.tsx @@ -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({}); +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 ( - - {/* - {getShow?.payable_amount_sum || '-'} - - - {getShow?.late_fee_sum || '-'} - - - {getShow?.discount_amount_sum || '-'} - */} - + + - {getShow?.total_payable_sum ? `¥${getShow?.total_payable_sum}` : ''} - {getShow?.total_payable_sum ? ( + {totalPayableSum ? `¥${totalPayableSum}` : ''} + {totalPayableSum ? ( (); return ( MyProTableProps.request(params, sort, Apis.Asset.AssetHouses.List) } + formRef={formRef} toolBarRender={(action) => [ { + 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 = '房屋档案' }) {
{owners.length > 0 && (
- 产权人 + {/* 产权人 */} {owners.map((owner: any) => owner?.name).join('、')}
)} diff --git a/src/pages/customer/archive/modals/Delivery.tsx b/src/pages/customer/archive/modals/Delivery.tsx index 6293082..44b3820 100644 --- a/src/pages/customer/archive/modals/Delivery.tsx +++ b/src/pages/customer/archive/modals/Delivery.tsx @@ -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 }, diff --git a/src/pages/customer/archive/show/$id.tsx b/src/pages/customer/archive/show/$id.tsx index 1c5391d..5767252 100644 --- a/src/pages/customer/archive/show/$id.tsx +++ b/src/pages/customer/archive/show/$id.tsx @@ -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: loadShow()} />, }, + { + label: '账单信息', + key: 'bills', + closable: false, + children: , + }, { label: '仪表信息', key: 'meters', @@ -56,6 +64,12 @@ export default function Show({ title }: { title?: string } = {}) { closable: false, children: , }, + { + label: '车位', + key: 'parkings', + closable: false, + children: , + }, ]; return ( { - // 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'], diff --git a/src/pages/customer/archive/table/modals/RegistersShow.tsx b/src/pages/customer/archive/table/modals/RegistersShow.tsx index 1d8fc8b..ce64acf 100644 --- a/src/pages/customer/archive/table/modals/RegistersShow.tsx +++ b/src/pages/customer/archive/table/modals/RegistersShow.tsx @@ -121,7 +121,8 @@ export default function RegistersShow(props: MyBetaModalFormProps) { /> - {props?.item?.type === 'Delivery' && ( + {(props?.item?.type === 'AddOwner' || + props?.item?.type === 'Transfer') && ( {props?.item?.ownership_info?.map((res: any, index: number) => { diff --git a/src/pages/customer/archive/table/modals/Transfer.tsx b/src/pages/customer/archive/table/modals/Transfer.tsx index 117d2c1..47671ea 100644 --- a/src/pages/customer/archive/table/modals/Transfer.tsx +++ b/src/pages/customer/archive/table/modals/Transfer.tsx @@ -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 ( - - {...MyModalFormProps.props} - title={`${props.title}`} - wrapperCol={{ span: 24 }} - width="1000px" - trigger={ - - } - 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 ( - - {listDom} - - ); - }, - }, - 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 ( + <> + + + {...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 ( + + {listDom} + + ); + }, + }, + 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 }, + }, + ] + : []; + }, + }, + ], + }, + ], + }, + ], + }, + ]} + /> + ); } diff --git a/src/pages/customer/house_registers_audit/modals/Audit.tsx b/src/pages/customer/house_registers_audit/modals/Audit.tsx index 5941f29..64075f2 100644 --- a/src/pages/customer/house_registers_audit/modals/Audit.tsx +++ b/src/pages/customer/house_registers_audit/modals/Audit.tsx @@ -233,7 +233,8 @@ export default function Update(props: MyBetaModalFormProps) { /> )} - {props?.item?.type === 'AddOwner' && + {(props?.item?.type === 'AddOwner' || + props?.item?.type === 'Transfer') && props?.item?.ownership_info && props?.item?.ownership_info?.length > 0 && ( @@ -243,7 +244,7 @@ export default function Update(props: MyBetaModalFormProps) { (res: any, index: number) => ( diff --git a/src/pages/customer/house_registers_audit/modals/Show.tsx b/src/pages/customer/house_registers_audit/modals/Show.tsx index c91fbf0..3d0d663 100644 --- a/src/pages/customer/house_registers_audit/modals/Show.tsx +++ b/src/pages/customer/house_registers_audit/modals/Show.tsx @@ -202,7 +202,8 @@ export default function Show(props: MyBetaModalFormProps) { /> )} - {props?.item?.type === 'AddOwner' && + {(props?.item?.type === 'AddOwner' || + props?.item?.type === 'Transfer') && props?.item?.ownership_info && props?.item?.ownership_info?.length > 0 && (