import { MyBetaModalFormProps, MyButtons, MyColumns, MyFormItems, MyModalFormProps, MyProTableProps, renderTextHelper, rulesHelper, } from '@/common'; import { Apis } from '@/gen/Apis'; import { HouseOccupantsCardTypeEnum, HouseOccupantsResidentialRelationEnum, HouseRegistersStatusEnum, HouseRegistersTypeEnum, } from '@/gen/Enums'; import { BetaSchemaForm, ProCard, ProDescriptions, ProTable, } from '@ant-design/pro-components'; import { Form, Image, message, Space } from 'antd'; export default function Update(props: MyBetaModalFormProps) { const [form] = Form.useForm(); return ( {...MyModalFormProps.props} title={props.title} trigger={} wrapperCol={{ span: 24 }} width="800px" modalProps={{ bodyStyle: { maxHeight: '70vh', overflowY: 'auto' }, }} key={new Date().getTime()} form={form} onFinish={async (values: any) => Apis.Archive.HouseRegisters.Audit({ id: props.item?.id ?? 0, ...values, }) .then(() => { props.reload?.(); message.success(props.title + '成功'); return true; }) .catch(() => false) } columns={[ { // title: '登记信息', dataIndex: 'info_display', valueType: 'text', renderFormItem: () => ( {props?.item?.asset_house?.full_name || '-'} {/* */} {props?.item?.created_at || '-'} {props?.item?.customer_info && props?.item?.customer_info?.length > 0 && ( record?.id_card || index} size="small" columns={[ MyColumns.EnumTag({ title: '居住关系', dataIndex: 'residential_relation', valueEnum: HouseOccupantsResidentialRelationEnum, }), // MyColumns.EnumTag({ // title: // props?.item?.status === 'Rented' // ? '与主租人关系' // : '与产权人关系', // // title: '关系说明', // dataIndex: 'relation_with_owner', // valueEnum: HouseOccupantsRelationWithOwnerEnum, // search: false, // }), { title: '姓名', dataIndex: 'name', }, { title: '手机号', dataIndex: 'phone', }, MyColumns.EnumTag({ title: '证件类型', dataIndex: 'card_type', valueEnum: HouseOccupantsCardTypeEnum, }), { title: '证件号码', dataIndex: 'id_card', }, { title: '证件资料', render: (_, item) => { return ( {item?.card_front_image?.[0] && ( )} {item?.card_back_image?.[0] && ( )} ); }, }, ]} /> )} {props?.item?.type === 'AddOwner' && props?.item?.ownership_info && props?.item?.ownership_info?.length > 0 && ( {props?.item?.ownership_info?.map( (res: any, index: number) => ( ), )} )} ), colProps: { span: 24 }, }, { valueType: 'group', // title: '审核操作', columns: [ MyFormItems.EnumRadio({ key: 'status', title: '审核操作', colProps: { span: 24 }, valueEnum: () => { let obj: any = JSON.parse( JSON.stringify(HouseRegistersStatusEnum), ); delete obj.Pending; return obj; }, required: true, }), { valueType: 'dependency', name: ['status'], columns: ({ status }) => { return status === 'Rejected' ? [ { title: '驳回原因', dataIndex: 'reason', valueType: 'textarea', formItemProps: { ...rulesHelper.text }, colProps: { span: 24 }, }, ] : []; }, }, ], }, ]} /> ); }