feat:登记
This commit is contained in:
parent
4494bc0119
commit
e5a723fb84
@ -1,14 +1,42 @@
|
|||||||
import {
|
import {
|
||||||
|
AliwangwangFilled,
|
||||||
|
AndroidFilled,
|
||||||
|
AppleFilled,
|
||||||
|
AppstoreFilled,
|
||||||
AuditOutlined,
|
AuditOutlined,
|
||||||
|
BankFilled,
|
||||||
BankOutlined,
|
BankOutlined,
|
||||||
BarChartOutlined,
|
BarChartOutlined,
|
||||||
BarcodeOutlined,
|
BarcodeOutlined,
|
||||||
|
BellFilled,
|
||||||
|
ChromeFilled,
|
||||||
ClusterOutlined,
|
ClusterOutlined,
|
||||||
ControlOutlined,
|
ControlOutlined,
|
||||||
CreditCardOutlined,
|
CreditCardOutlined,
|
||||||
|
CustomerServiceFilled,
|
||||||
|
FolderOpenFilled,
|
||||||
|
HeartFilled,
|
||||||
|
HomeFilled,
|
||||||
|
HourglassFilled,
|
||||||
|
IeSquareFilled,
|
||||||
|
NotificationFilled,
|
||||||
|
OpenAIFilled,
|
||||||
|
ReadFilled,
|
||||||
|
RocketFilled,
|
||||||
|
SafetyCertificateFilled,
|
||||||
|
ScheduleFilled,
|
||||||
|
SettingFilled,
|
||||||
SettingOutlined,
|
SettingOutlined,
|
||||||
|
ShopFilled,
|
||||||
ShopOutlined,
|
ShopOutlined,
|
||||||
|
StarFilled,
|
||||||
|
TruckFilled,
|
||||||
|
TwitchFilled,
|
||||||
|
UnlockFilled,
|
||||||
UserOutlined,
|
UserOutlined,
|
||||||
|
WalletFilled,
|
||||||
|
WindowsFilled,
|
||||||
|
YoutubeFilled,
|
||||||
} from '@ant-design/icons';
|
} from '@ant-design/icons';
|
||||||
|
|
||||||
export type MyIconsType =
|
export type MyIconsType =
|
||||||
@ -34,4 +62,32 @@ export const MyIcons = {
|
|||||||
BankOutlined: <BankOutlined />,
|
BankOutlined: <BankOutlined />,
|
||||||
UserOutlined: <UserOutlined />,
|
UserOutlined: <UserOutlined />,
|
||||||
CreditCardOutlined: <CreditCardOutlined />,
|
CreditCardOutlined: <CreditCardOutlined />,
|
||||||
|
AndroidFilled: <AndroidFilled />,
|
||||||
|
AppleFilled: <AppleFilled />,
|
||||||
|
WindowsFilled: <WindowsFilled />,
|
||||||
|
ChromeFilled: <ChromeFilled />,
|
||||||
|
AliwangwangFilled: <AliwangwangFilled />,
|
||||||
|
OpenAIFilled: <OpenAIFilled />,
|
||||||
|
TwitchFilled: <TwitchFilled />,
|
||||||
|
YoutubeFilled: <YoutubeFilled />,
|
||||||
|
HeartFilled: <HeartFilled />,
|
||||||
|
IeSquareFilled: <IeSquareFilled />,
|
||||||
|
TruckFilled: <TruckFilled />,
|
||||||
|
UnlockFilled: <UnlockFilled />,
|
||||||
|
AppstoreFilled: <AppstoreFilled />,
|
||||||
|
BellFilled: <BellFilled />,
|
||||||
|
CustomerServiceFilled: <CustomerServiceFilled />,
|
||||||
|
WalletFilled: <WalletFilled />,
|
||||||
|
StarFilled: <StarFilled />,
|
||||||
|
SafetyCertificateFilled: <SafetyCertificateFilled />,
|
||||||
|
FolderOpenFilled: <FolderOpenFilled />,
|
||||||
|
ScheduleFilled: <ScheduleFilled />,
|
||||||
|
HourglassFilled: <HourglassFilled />,
|
||||||
|
BankFilled: <BankFilled />,
|
||||||
|
ShopFilled: <ShopFilled />,
|
||||||
|
HomeFilled: <HomeFilled />,
|
||||||
|
SettingFilled: <SettingFilled />,
|
||||||
|
ReadFilled: <ReadFilled />,
|
||||||
|
RocketFilled: <RocketFilled />,
|
||||||
|
NotificationFilled: <NotificationFilled />,
|
||||||
};
|
};
|
||||||
|
|||||||
@ -73,15 +73,15 @@ export function MyUploadImages({
|
|||||||
uploadType === 'image' ? (
|
uploadType === 'image' ? (
|
||||||
<div>
|
<div>
|
||||||
<PlusOutlined />
|
<PlusOutlined />
|
||||||
<div style={{ marginTop: 8 }}>Upload</div>
|
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<Button icon={<UploadOutlined />}>Click to Upload</Button>
|
<Button icon={<UploadOutlined />}>点击上传</Button>
|
||||||
);
|
);
|
||||||
|
|
||||||
const customRequest = ({ file, onError, onProgress, onSuccess }: any) => {
|
const customRequest = ({ file, onError, onProgress, onSuccess }: any) => {
|
||||||
Apis.Auth.PreUpload({
|
Apis.Common.Auth.PreUpload({
|
||||||
filename: file.name,
|
filename: file.name,
|
||||||
|
alc: 'public-read',
|
||||||
}).then(async (res) => {
|
}).then(async (res) => {
|
||||||
axios
|
axios
|
||||||
.put(res.data.url, file, {
|
.put(res.data.url, file, {
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { MyResponseType, renderTextHelper } from '@/common';
|
import { MyResponseType, renderTextHelper } from '@/common';
|
||||||
import { Apis } from '@/gen/Apis';
|
import { Apis } from '@/gen/Apis';
|
||||||
import { ProColumns } from '@ant-design/pro-components';
|
import { ProColumns } from '@ant-design/pro-components';
|
||||||
import { Popconfirm, Tag } from 'antd';
|
import { Image, Popconfirm, Tag } from 'antd';
|
||||||
|
|
||||||
type ReturnType = ProColumns<Record<string, any>, 'text'>;
|
type ReturnType = ProColumns<Record<string, any>, 'text'>;
|
||||||
|
|
||||||
@ -193,4 +193,13 @@ export const MyColumns = {
|
|||||||
...rest,
|
...rest,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
Image({ ...rest }) {
|
||||||
|
return {
|
||||||
|
search: false,
|
||||||
|
renderText(text: { url: string }[]) {
|
||||||
|
return <Image src={text[0]?.url} width={50} height={50} />;
|
||||||
|
},
|
||||||
|
...rest,
|
||||||
|
};
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@ -250,6 +250,40 @@ export const Selects = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
//项目
|
||||||
|
AssetProjects(props?: PropsType): ReturnType {
|
||||||
|
const {
|
||||||
|
title = '选择项目',
|
||||||
|
key = 'asset_projects_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.AssetProjects.Select({
|
||||||
|
keywords: params?.KeyWords,
|
||||||
|
...params,
|
||||||
|
})
|
||||||
|
).data,
|
||||||
|
...rest,
|
||||||
|
fieldProps: {
|
||||||
|
showSearch: true,
|
||||||
|
fieldNames: {
|
||||||
|
label: 'label',
|
||||||
|
value: 'value',
|
||||||
|
},
|
||||||
|
...rest?.fieldProps,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
//房屋
|
//房屋
|
||||||
AssetHouses(props?: PropsType): ReturnType {
|
AssetHouses(props?: PropsType): ReturnType {
|
||||||
const {
|
const {
|
||||||
|
|||||||
@ -127,7 +127,12 @@ export const HouseOccupantsHouseRelationEnum= {
|
|||||||
|
|
||||||
// HouseOccupantsRelationWithOwnerEnum
|
// HouseOccupantsRelationWithOwnerEnum
|
||||||
export const HouseOccupantsRelationWithOwnerEnum= {
|
export const HouseOccupantsRelationWithOwnerEnum= {
|
||||||
'Value': {"text":"Label","color":"#ff0000","value":"Value"},
|
'Self': {"text":"本人","color":"#52c41a","value":"Self"},
|
||||||
|
'Spouse': {"text":"夫妻","color":"#2db7f5","value":"Spouse"},
|
||||||
|
'FatherSon': {"text":"父子","color":"#faad14","value":"FatherSon"},
|
||||||
|
'MotherSon': {"text":"母子","color":"#fa8c16","value":"MotherSon"},
|
||||||
|
'Children': {"text":"子女","color":"#87d068","value":"Children"},
|
||||||
|
'ContactPerson': {"text":"指定联系人","color":"#f5222d","value":"ContactPerson"},
|
||||||
};
|
};
|
||||||
|
|
||||||
// HouseOccupantsStatusEnum
|
// HouseOccupantsStatusEnum
|
||||||
|
|||||||
37
src/pages/archive/house_registers/$id.tsx
Normal file
37
src/pages/archive/house_registers/$id.tsx
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
import { MyPageContainer } from '@/common';
|
||||||
|
import { Apis } from '@/gen/Apis';
|
||||||
|
import { ProCard } from '@ant-design/pro-components';
|
||||||
|
import { useParams } from '@umijs/max';
|
||||||
|
import { Tabs } from 'antd';
|
||||||
|
import { useEffect, useState } from 'react';
|
||||||
|
import HouseOccupants from './components/HouseOccupants';
|
||||||
|
export default function Show({ title = '机构详情' }) {
|
||||||
|
const { id } = useParams<{ id: string }>();
|
||||||
|
const [data, setShow] = useState<any>({});
|
||||||
|
|
||||||
|
const loadShow = () => {
|
||||||
|
let paramsId: any = { id: id ?? 0 };
|
||||||
|
Apis.Archive.HouseRegisters.Show(paramsId).then((res) => {
|
||||||
|
setShow(res?.data);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
useEffect(() => {
|
||||||
|
loadShow();
|
||||||
|
}, [id]);
|
||||||
|
|
||||||
|
let items = [
|
||||||
|
{
|
||||||
|
label: '入住人',
|
||||||
|
key: '1',
|
||||||
|
closable: false,
|
||||||
|
children: <HouseOccupants item={data} />,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
return (
|
||||||
|
<MyPageContainer title={title}>
|
||||||
|
<ProCard>
|
||||||
|
<Tabs type="card" items={data?.id ? items : []} />
|
||||||
|
</ProCard>
|
||||||
|
</MyPageContainer>
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -0,0 +1,70 @@
|
|||||||
|
import { MyBetaModalFormProps, MyColumns, MyProTableProps } from '@/common';
|
||||||
|
import { Apis } from '@/gen/Apis';
|
||||||
|
import {
|
||||||
|
HouseOccupantsCardTypeEnum,
|
||||||
|
HouseOccupantsHouseRelationEnum,
|
||||||
|
HouseOccupantsRelationWithOwnerEnum,
|
||||||
|
HouseOccupantsStatusEnum,
|
||||||
|
} from '@/gen/Enums';
|
||||||
|
import { ProTable } from '@ant-design/pro-components';
|
||||||
|
|
||||||
|
export default function Index(props: MyBetaModalFormProps) {
|
||||||
|
return (
|
||||||
|
<ProTable
|
||||||
|
{...MyProTableProps.props}
|
||||||
|
// search={false}
|
||||||
|
options={false}
|
||||||
|
request={async (params, sort) =>
|
||||||
|
MyProTableProps.request(
|
||||||
|
{ ...params, asset_houses_id: props.item?.asset_house?.id },
|
||||||
|
sort,
|
||||||
|
Apis.Archive.HouseOccupants.List,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
columns={[
|
||||||
|
MyColumns.ID(),
|
||||||
|
{
|
||||||
|
title: '姓名',
|
||||||
|
dataIndex: 'name',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '手机号',
|
||||||
|
dataIndex: 'phone',
|
||||||
|
},
|
||||||
|
MyColumns.EnumTag({
|
||||||
|
title: '状态',
|
||||||
|
dataIndex: 'status',
|
||||||
|
valueEnum: HouseOccupantsStatusEnum,
|
||||||
|
search: false,
|
||||||
|
}),
|
||||||
|
MyColumns.EnumTag({
|
||||||
|
title: '与产权人关系',
|
||||||
|
dataIndex: 'relation_with_owner',
|
||||||
|
valueEnum: HouseOccupantsRelationWithOwnerEnum,
|
||||||
|
search: false,
|
||||||
|
}),
|
||||||
|
MyColumns.EnumTag({
|
||||||
|
title: '房客关系',
|
||||||
|
dataIndex: 'house_relation',
|
||||||
|
valueEnum: HouseOccupantsHouseRelationEnum,
|
||||||
|
search: false,
|
||||||
|
}),
|
||||||
|
MyColumns.EnumTag({
|
||||||
|
title: '证件类型',
|
||||||
|
dataIndex: 'card_type',
|
||||||
|
valueEnum: HouseOccupantsCardTypeEnum,
|
||||||
|
search: false,
|
||||||
|
}),
|
||||||
|
MyColumns?.Image({
|
||||||
|
title: '身份证正面',
|
||||||
|
dataIndex: 'card_front_image',
|
||||||
|
}),
|
||||||
|
MyColumns?.Image({
|
||||||
|
title: '身份证正面',
|
||||||
|
dataIndex: 'card_back_image',
|
||||||
|
}),
|
||||||
|
MyColumns.CreatedAt(),
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -13,11 +13,12 @@ import {
|
|||||||
HouseRegistersUsagePlanEnum,
|
HouseRegistersUsagePlanEnum,
|
||||||
} from '@/gen/Enums';
|
} from '@/gen/Enums';
|
||||||
import { ProTable } from '@ant-design/pro-components';
|
import { ProTable } from '@ant-design/pro-components';
|
||||||
|
import { useNavigate } from '@umijs/max';
|
||||||
import { Space } from 'antd';
|
import { Space } from 'antd';
|
||||||
import Create from './modals/Create';
|
import OccupantsCreate from './modals/OccupantsCreate';
|
||||||
import Update from './modals/Update';
|
|
||||||
|
|
||||||
export default function Index({ title = '房屋登记' }) {
|
export default function Index({ title = '房屋登记' }) {
|
||||||
|
const navigate = useNavigate();
|
||||||
return (
|
return (
|
||||||
<MyPageContainer title={title}>
|
<MyPageContainer title={title}>
|
||||||
<ProTable
|
<ProTable
|
||||||
@ -31,7 +32,11 @@ export default function Index({ title = '房屋登记' }) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
toolBarRender={(action) => [
|
toolBarRender={(action) => [
|
||||||
<Create key="Create" reload={action?.reload} title={title} />,
|
<OccupantsCreate
|
||||||
|
key="Create"
|
||||||
|
reload={action?.reload}
|
||||||
|
title={title}
|
||||||
|
/>,
|
||||||
]}
|
]}
|
||||||
columns={[
|
columns={[
|
||||||
MyColumns.ID(),
|
MyColumns.ID(),
|
||||||
@ -71,7 +76,12 @@ export default function Index({ title = '房屋登记' }) {
|
|||||||
MyColumns.Option({
|
MyColumns.Option({
|
||||||
render: (_, item: any, index, action) => (
|
render: (_, item: any, index, action) => (
|
||||||
<Space key={index}>
|
<Space key={index}>
|
||||||
<Update item={item} reload={action?.reload} title={title} />
|
<MyButtons.View
|
||||||
|
title="详情"
|
||||||
|
onClick={() => {
|
||||||
|
navigate(`/archive/house_registers/${item.id}`);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
<MyButtons.Delete
|
<MyButtons.Delete
|
||||||
onConfirm={() =>
|
onConfirm={() =>
|
||||||
Apis.Archive.HouseRegisters.Delete({ id: item.id }).then(
|
Apis.Archive.HouseRegisters.Delete({ id: item.id }).then(
|
||||||
|
|||||||
@ -1,78 +0,0 @@
|
|||||||
import {
|
|
||||||
MyBetaModalFormProps,
|
|
||||||
MyButtons,
|
|
||||||
MyFormItems,
|
|
||||||
MyModalFormProps,
|
|
||||||
rulesHelper,
|
|
||||||
} from '@/common';
|
|
||||||
import { Selects } from '@/components/Select';
|
|
||||||
import { Apis } from '@/gen/Apis';
|
|
||||||
import {
|
|
||||||
HouseRegistersCustomerTypeEnum,
|
|
||||||
HouseRegistersHouseStatusEnum,
|
|
||||||
HouseRegistersStatusEnum,
|
|
||||||
HouseRegistersTypeEnum,
|
|
||||||
HouseRegistersUsagePlanEnum,
|
|
||||||
} from '@/gen/Enums';
|
|
||||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
|
||||||
import { message } from 'antd';
|
|
||||||
|
|
||||||
export default function Create(props: MyBetaModalFormProps) {
|
|
||||||
return (
|
|
||||||
<BetaSchemaForm<ApiTypes.Archive.HouseRegisters.Store>
|
|
||||||
{...MyModalFormProps.props}
|
|
||||||
title={`添加${props.title}`}
|
|
||||||
wrapperCol={{ span: 24 }}
|
|
||||||
width="800px"
|
|
||||||
trigger={<MyButtons.Create title={`添加${props.title}`} />}
|
|
||||||
onFinish={async (values) =>
|
|
||||||
Apis.Archive.HouseRegisters.Store(values)
|
|
||||||
.then(() => {
|
|
||||||
props.reload?.();
|
|
||||||
message.success(props.title + '成功');
|
|
||||||
return true;
|
|
||||||
})
|
|
||||||
.catch(() => false)
|
|
||||||
}
|
|
||||||
columns={[
|
|
||||||
Selects?.AssetHouses({
|
|
||||||
title: '选择房屋',
|
|
||||||
key: 'asset_houses_id',
|
|
||||||
formItemProps: { ...rulesHelper.text },
|
|
||||||
colProps: { span: 12 },
|
|
||||||
}),
|
|
||||||
MyFormItems.EnumRadio({
|
|
||||||
key: 'type',
|
|
||||||
title: '类型',
|
|
||||||
colProps: { span: 12 },
|
|
||||||
valueEnum: HouseRegistersTypeEnum,
|
|
||||||
required: true,
|
|
||||||
}),
|
|
||||||
MyFormItems.EnumRadio({
|
|
||||||
key: 'customer_type',
|
|
||||||
title: '客户类型',
|
|
||||||
colProps: { span: 12 },
|
|
||||||
valueEnum: HouseRegistersCustomerTypeEnum,
|
|
||||||
}),
|
|
||||||
MyFormItems.EnumRadio({
|
|
||||||
key: 'usage_plan',
|
|
||||||
title: '使用计划',
|
|
||||||
colProps: { span: 12 },
|
|
||||||
valueEnum: HouseRegistersUsagePlanEnum,
|
|
||||||
}),
|
|
||||||
MyFormItems.EnumRadio({
|
|
||||||
key: 'status',
|
|
||||||
title: '状态',
|
|
||||||
colProps: { span: 12 },
|
|
||||||
valueEnum: HouseRegistersStatusEnum,
|
|
||||||
}),
|
|
||||||
MyFormItems.EnumRadio({
|
|
||||||
key: 'house_status',
|
|
||||||
title: '房屋状态',
|
|
||||||
colProps: { span: 12 },
|
|
||||||
valueEnum: HouseRegistersHouseStatusEnum,
|
|
||||||
}),
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
230
src/pages/archive/house_registers/modals/OccupantsCreate.tsx
Normal file
230
src/pages/archive/house_registers/modals/OccupantsCreate.tsx
Normal file
@ -0,0 +1,230 @@
|
|||||||
|
import {
|
||||||
|
MyBetaModalFormProps,
|
||||||
|
MyButtons,
|
||||||
|
MyFormItems,
|
||||||
|
MyModalFormProps,
|
||||||
|
rulesHelper,
|
||||||
|
} from '@/common';
|
||||||
|
import { Selects } from '@/components/Select';
|
||||||
|
import { Apis } from '@/gen/Apis';
|
||||||
|
import {
|
||||||
|
HouseOccupantsCardTypeEnum,
|
||||||
|
HouseOccupantsHouseRelationEnum,
|
||||||
|
HouseOccupantsRelationWithOwnerEnum,
|
||||||
|
HouseRegistersCustomerTypeEnum,
|
||||||
|
HouseRegistersHouseStatusEnum,
|
||||||
|
HouseRegistersTypeEnum,
|
||||||
|
HouseRegistersUsagePlanEnum,
|
||||||
|
} from '@/gen/Enums';
|
||||||
|
import { BetaSchemaForm, ProCard } from '@ant-design/pro-components';
|
||||||
|
import { Form, message } from 'antd';
|
||||||
|
|
||||||
|
export default function Create(props: MyBetaModalFormProps) {
|
||||||
|
const [form] = Form.useForm();
|
||||||
|
return (
|
||||||
|
<BetaSchemaForm<ApiTypes.Archive.HouseRegisters.Store>
|
||||||
|
{...MyModalFormProps.props}
|
||||||
|
title={`添加${props.title}`}
|
||||||
|
wrapperCol={{ span: 24 }}
|
||||||
|
width="900px"
|
||||||
|
form={form}
|
||||||
|
trigger={<MyButtons.Create title={`添加${props.title}`} />}
|
||||||
|
onOpenChange={(open: any) => {
|
||||||
|
if (open) {
|
||||||
|
form.resetFields(); // 清空表单数据
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
onFinish={async (values) =>
|
||||||
|
Apis.Archive.HouseRegisters.Store(values)
|
||||||
|
.then(() => {
|
||||||
|
props.reload?.();
|
||||||
|
message.success(props.title + '成功');
|
||||||
|
return true;
|
||||||
|
})
|
||||||
|
.catch(() => false)
|
||||||
|
}
|
||||||
|
columns={[
|
||||||
|
Selects?.AssetProjects({
|
||||||
|
title: '选择项目',
|
||||||
|
key: 'asset_projects_id',
|
||||||
|
colProps: { span: 8 },
|
||||||
|
formItemProps: { ...rulesHelper.text },
|
||||||
|
}),
|
||||||
|
|
||||||
|
{
|
||||||
|
valueType: 'dependency',
|
||||||
|
name: ['asset_projects_id'],
|
||||||
|
columns: ({ asset_projects_id }) => [
|
||||||
|
Selects?.AssetHouses({
|
||||||
|
title: '选择房屋',
|
||||||
|
key: 'asset_houses_id',
|
||||||
|
params: { asset_projects_id: asset_projects_id },
|
||||||
|
formItemProps: { ...rulesHelper.text },
|
||||||
|
colProps: { span: 8 },
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
MyFormItems.EnumRadio({
|
||||||
|
key: 'type',
|
||||||
|
title: '类型',
|
||||||
|
colProps: { span: 8 },
|
||||||
|
valueEnum: HouseRegistersTypeEnum,
|
||||||
|
required: true,
|
||||||
|
}),
|
||||||
|
{
|
||||||
|
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: 8 }}
|
||||||
|
title={`客户${index + 1}`}
|
||||||
|
extra={action}
|
||||||
|
bodyStyle={{ paddingBlockEnd: 0 }}
|
||||||
|
>
|
||||||
|
{listDom}
|
||||||
|
</ProCard>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
valueType: 'group',
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
title: '姓名',
|
||||||
|
dataIndex: 'name',
|
||||||
|
colProps: { span: 8 },
|
||||||
|
formItemProps: { ...rulesHelper.text },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '手机号',
|
||||||
|
dataIndex: 'phone',
|
||||||
|
colProps: { span: 8 },
|
||||||
|
fieldProps: {
|
||||||
|
maxLength: 11,
|
||||||
|
},
|
||||||
|
formItemProps: { ...rulesHelper.text },
|
||||||
|
},
|
||||||
|
MyFormItems.EnumSelect({
|
||||||
|
key: 'house_relation',
|
||||||
|
title: '房客关系',
|
||||||
|
colProps: { span: 8 },
|
||||||
|
valueEnum: HouseOccupantsHouseRelationEnum,
|
||||||
|
required: true,
|
||||||
|
}),
|
||||||
|
|
||||||
|
{
|
||||||
|
title: '客户地址',
|
||||||
|
dataIndex: 'address',
|
||||||
|
colProps: { span: 8 },
|
||||||
|
formItemProps: { ...rulesHelper.text },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '解除时间',
|
||||||
|
dataIndex: 'unbound_time',
|
||||||
|
colProps: { span: 8 },
|
||||||
|
valueType: 'date',
|
||||||
|
fieldProps: {
|
||||||
|
style: { width: '100%' },
|
||||||
|
},
|
||||||
|
formItemProps: { ...rulesHelper.text },
|
||||||
|
},
|
||||||
|
MyFormItems.EnumSelect({
|
||||||
|
key: 'relation_with_owner',
|
||||||
|
title: '与产权人关系',
|
||||||
|
colProps: { span: 8 },
|
||||||
|
valueEnum: HouseOccupantsRelationWithOwnerEnum,
|
||||||
|
required: true,
|
||||||
|
}),
|
||||||
|
MyFormItems.EnumSelect({
|
||||||
|
key: 'card_type',
|
||||||
|
title: '证件类型',
|
||||||
|
colProps: { span: 8 },
|
||||||
|
valueEnum: HouseOccupantsCardTypeEnum,
|
||||||
|
required: true,
|
||||||
|
}),
|
||||||
|
{
|
||||||
|
title: '证件号码',
|
||||||
|
dataIndex: 'id_card',
|
||||||
|
colProps: { span: 8 },
|
||||||
|
fieldProps: {
|
||||||
|
maxLength: 18,
|
||||||
|
},
|
||||||
|
formItemProps: { ...rulesHelper.text },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '是否在居住中',
|
||||||
|
dataIndex: 'is_live_in',
|
||||||
|
colProps: { span: 8 },
|
||||||
|
valueType: 'switch',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
valueType: 'group',
|
||||||
|
columns: [
|
||||||
|
MyFormItems.UploadImages({
|
||||||
|
key: 'card_front_image',
|
||||||
|
title: '身份证正面',
|
||||||
|
max: 1,
|
||||||
|
colProps: { span: 8 },
|
||||||
|
formItemProps: { ...rulesHelper.text },
|
||||||
|
}),
|
||||||
|
MyFormItems.UploadImages({
|
||||||
|
key: 'card_back_image',
|
||||||
|
title: '身份证反面',
|
||||||
|
max: 1,
|
||||||
|
colProps: { span: 8 },
|
||||||
|
formItemProps: { ...rulesHelper.text },
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
MyFormItems.UploadImages({
|
||||||
|
key: 'ownership_info',
|
||||||
|
title: '产权信息',
|
||||||
|
max: 100,
|
||||||
|
colProps: { span: 24 },
|
||||||
|
formItemProps: { ...rulesHelper.array },
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
|
||||||
|
MyFormItems.EnumRadio({
|
||||||
|
key: 'customer_type',
|
||||||
|
title: '客户类型',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
valueEnum: HouseRegistersCustomerTypeEnum,
|
||||||
|
}),
|
||||||
|
MyFormItems.EnumRadio({
|
||||||
|
key: 'usage_plan',
|
||||||
|
title: '使用计划',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
valueEnum: HouseRegistersUsagePlanEnum,
|
||||||
|
}),
|
||||||
|
// MyFormItems.EnumRadio({
|
||||||
|
// key: 'status',
|
||||||
|
// title: '状态',
|
||||||
|
// colProps: { span: 24 },
|
||||||
|
// valueEnum: HouseRegistersStatusEnum,
|
||||||
|
// }),
|
||||||
|
MyFormItems.EnumRadio({
|
||||||
|
key: 'house_status',
|
||||||
|
title: '房屋状态',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
valueEnum: HouseRegistersHouseStatusEnum,
|
||||||
|
}),
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
236
src/pages/archive/house_registers/modals/OccupantsUpdate.tsx
Normal file
236
src/pages/archive/house_registers/modals/OccupantsUpdate.tsx
Normal file
@ -0,0 +1,236 @@
|
|||||||
|
import {
|
||||||
|
MyBetaModalFormProps,
|
||||||
|
MyButtons,
|
||||||
|
MyFormItems,
|
||||||
|
MyModalFormProps,
|
||||||
|
rulesHelper,
|
||||||
|
} from '@/common';
|
||||||
|
|
||||||
|
import { Selects } from '@/components/Select';
|
||||||
|
import { Apis } from '@/gen/Apis';
|
||||||
|
import {
|
||||||
|
HouseOccupantsCardTypeEnum,
|
||||||
|
HouseOccupantsHouseRelationEnum,
|
||||||
|
HouseOccupantsRelationWithOwnerEnum,
|
||||||
|
HouseRegistersCustomerTypeEnum,
|
||||||
|
HouseRegistersHouseStatusEnum,
|
||||||
|
HouseRegistersTypeEnum,
|
||||||
|
HouseRegistersUsagePlanEnum,
|
||||||
|
} from '@/gen/Enums';
|
||||||
|
import { BetaSchemaForm, ProCard } from '@ant-design/pro-components';
|
||||||
|
import { Form, message } from 'antd';
|
||||||
|
export default function Update(props: MyBetaModalFormProps) {
|
||||||
|
const [form] = Form.useForm();
|
||||||
|
return (
|
||||||
|
<BetaSchemaForm<ApiTypes.Archive.HouseRegisters.Update>
|
||||||
|
{...MyModalFormProps.props}
|
||||||
|
title={`编辑${props.title}`}
|
||||||
|
trigger={<MyButtons.Edit />}
|
||||||
|
wrapperCol={{ span: 24 }}
|
||||||
|
width="900px"
|
||||||
|
form={form}
|
||||||
|
onOpenChange={(open: any) => {
|
||||||
|
if (open && props.item) {
|
||||||
|
form.setFieldsValue({
|
||||||
|
...props.item,
|
||||||
|
asset_houses_id: props.item?.asset_house?.id,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
onFinish={async (values) =>
|
||||||
|
Apis.Archive.HouseRegisters.Update({
|
||||||
|
...values,
|
||||||
|
id: props.item?.id ?? 0,
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
props.reload?.();
|
||||||
|
message.success(props.title + '成功');
|
||||||
|
return true;
|
||||||
|
})
|
||||||
|
.catch(() => false)
|
||||||
|
}
|
||||||
|
columns={[
|
||||||
|
Selects?.AssetProjects({
|
||||||
|
title: '选择项目',
|
||||||
|
key: 'asset_projects_id',
|
||||||
|
colProps: { span: 8 },
|
||||||
|
formItemProps: { ...rulesHelper.text },
|
||||||
|
}),
|
||||||
|
|
||||||
|
{
|
||||||
|
valueType: 'dependency',
|
||||||
|
name: ['asset_projects_id'],
|
||||||
|
columns: ({ asset_projects_id }) => [
|
||||||
|
Selects?.AssetHouses({
|
||||||
|
title: '选择房屋',
|
||||||
|
key: 'asset_houses_id',
|
||||||
|
params: { asset_projects_id: asset_projects_id },
|
||||||
|
formItemProps: { ...rulesHelper.text },
|
||||||
|
colProps: { span: 8 },
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
MyFormItems.EnumRadio({
|
||||||
|
key: 'type',
|
||||||
|
title: '类型',
|
||||||
|
colProps: { span: 8 },
|
||||||
|
valueEnum: HouseRegistersTypeEnum,
|
||||||
|
required: true,
|
||||||
|
}),
|
||||||
|
{
|
||||||
|
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: 8 }}
|
||||||
|
title={`客户${index + 1}`}
|
||||||
|
extra={action}
|
||||||
|
bodyStyle={{ paddingBlockEnd: 0 }}
|
||||||
|
>
|
||||||
|
{listDom}
|
||||||
|
</ProCard>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
valueType: 'group',
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
title: '姓名',
|
||||||
|
dataIndex: 'name',
|
||||||
|
colProps: { span: 8 },
|
||||||
|
formItemProps: { ...rulesHelper.text },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '手机号',
|
||||||
|
dataIndex: 'phone',
|
||||||
|
colProps: { span: 8 },
|
||||||
|
fieldProps: {
|
||||||
|
maxLength: 11,
|
||||||
|
},
|
||||||
|
formItemProps: { ...rulesHelper.text },
|
||||||
|
},
|
||||||
|
MyFormItems.EnumSelect({
|
||||||
|
key: 'house_relation',
|
||||||
|
title: '房客关系',
|
||||||
|
colProps: { span: 8 },
|
||||||
|
valueEnum: HouseOccupantsHouseRelationEnum,
|
||||||
|
required: true,
|
||||||
|
}),
|
||||||
|
|
||||||
|
{
|
||||||
|
title: '客户地址',
|
||||||
|
dataIndex: 'address',
|
||||||
|
colProps: { span: 8 },
|
||||||
|
formItemProps: { ...rulesHelper.text },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '解除时间',
|
||||||
|
dataIndex: 'unbound_time',
|
||||||
|
colProps: { span: 8 },
|
||||||
|
valueType: 'date',
|
||||||
|
fieldProps: {
|
||||||
|
style: { width: '100%' },
|
||||||
|
},
|
||||||
|
formItemProps: { ...rulesHelper.text },
|
||||||
|
},
|
||||||
|
MyFormItems.EnumSelect({
|
||||||
|
key: 'relation_with_owner',
|
||||||
|
title: '与产权人关系',
|
||||||
|
colProps: { span: 8 },
|
||||||
|
valueEnum: HouseOccupantsRelationWithOwnerEnum,
|
||||||
|
required: true,
|
||||||
|
}),
|
||||||
|
MyFormItems.EnumSelect({
|
||||||
|
key: 'card_type',
|
||||||
|
title: '证件类型',
|
||||||
|
colProps: { span: 8 },
|
||||||
|
valueEnum: HouseOccupantsCardTypeEnum,
|
||||||
|
required: true,
|
||||||
|
}),
|
||||||
|
{
|
||||||
|
title: '证件号码',
|
||||||
|
dataIndex: 'id_card',
|
||||||
|
colProps: { span: 8 },
|
||||||
|
fieldProps: {
|
||||||
|
maxLength: 18,
|
||||||
|
},
|
||||||
|
formItemProps: { ...rulesHelper.text },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '是否在居住中',
|
||||||
|
dataIndex: 'is_live_in',
|
||||||
|
colProps: { span: 8 },
|
||||||
|
valueType: 'switch',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
valueType: 'group',
|
||||||
|
columns: [
|
||||||
|
MyFormItems.UploadImages({
|
||||||
|
key: 'card_front_image',
|
||||||
|
title: '身份证正面',
|
||||||
|
max: 1,
|
||||||
|
colProps: { span: 8 },
|
||||||
|
formItemProps: { ...rulesHelper.text },
|
||||||
|
}),
|
||||||
|
MyFormItems.UploadImages({
|
||||||
|
key: 'card_back_image',
|
||||||
|
title: '身份证反面',
|
||||||
|
max: 1,
|
||||||
|
colProps: { span: 8 },
|
||||||
|
formItemProps: { ...rulesHelper.text },
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
MyFormItems.UploadImages({
|
||||||
|
key: 'ownership_info',
|
||||||
|
title: '产权信息',
|
||||||
|
max: 100,
|
||||||
|
colProps: { span: 24 },
|
||||||
|
formItemProps: { ...rulesHelper.array },
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
|
||||||
|
MyFormItems.EnumRadio({
|
||||||
|
key: 'customer_type',
|
||||||
|
title: '客户类型',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
valueEnum: HouseRegistersCustomerTypeEnum,
|
||||||
|
}),
|
||||||
|
MyFormItems.EnumRadio({
|
||||||
|
key: 'usage_plan',
|
||||||
|
title: '使用计划',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
valueEnum: HouseRegistersUsagePlanEnum,
|
||||||
|
}),
|
||||||
|
// MyFormItems.EnumRadio({
|
||||||
|
// key: 'status',
|
||||||
|
// title: '状态',
|
||||||
|
// colProps: { span: 24 },
|
||||||
|
// valueEnum: HouseRegistersStatusEnum,
|
||||||
|
// }),
|
||||||
|
MyFormItems.EnumRadio({
|
||||||
|
key: 'house_status',
|
||||||
|
title: '房屋状态',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
valueEnum: HouseRegistersHouseStatusEnum,
|
||||||
|
}),
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -1,91 +0,0 @@
|
|||||||
import {
|
|
||||||
MyBetaModalFormProps,
|
|
||||||
MyButtons,
|
|
||||||
MyFormItems,
|
|
||||||
MyModalFormProps,
|
|
||||||
rulesHelper,
|
|
||||||
} from '@/common';
|
|
||||||
|
|
||||||
import { Selects } from '@/components/Select';
|
|
||||||
import { Apis } from '@/gen/Apis';
|
|
||||||
import {
|
|
||||||
HouseRegistersCustomerTypeEnum,
|
|
||||||
HouseRegistersHouseStatusEnum,
|
|
||||||
HouseRegistersStatusEnum,
|
|
||||||
HouseRegistersTypeEnum,
|
|
||||||
HouseRegistersUsagePlanEnum,
|
|
||||||
} from '@/gen/Enums';
|
|
||||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
|
||||||
import { Form, message } from 'antd';
|
|
||||||
export default function Update(props: MyBetaModalFormProps) {
|
|
||||||
const [form] = Form.useForm();
|
|
||||||
return (
|
|
||||||
<BetaSchemaForm<ApiTypes.Archive.HouseRegisters.Update>
|
|
||||||
{...MyModalFormProps.props}
|
|
||||||
title={`编辑员工`}
|
|
||||||
trigger={<MyButtons.Edit />}
|
|
||||||
wrapperCol={{ span: 24 }}
|
|
||||||
width="800px"
|
|
||||||
form={form}
|
|
||||||
onOpenChange={(open: any) => {
|
|
||||||
if (open && props.item) {
|
|
||||||
form.setFieldsValue({
|
|
||||||
...props.item,
|
|
||||||
roles_id: props.item?.roles?.map((item: any) => item.value),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
onFinish={async (values) =>
|
|
||||||
Apis.Archive.HouseRegisters.Update({
|
|
||||||
...values,
|
|
||||||
id: props.item?.id ?? 0,
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
props.reload?.();
|
|
||||||
message.success(props.title + '成功');
|
|
||||||
return true;
|
|
||||||
})
|
|
||||||
.catch(() => false)
|
|
||||||
}
|
|
||||||
columns={[
|
|
||||||
Selects?.AssetHouses({
|
|
||||||
title: '选择房屋',
|
|
||||||
key: 'asset_houses_id',
|
|
||||||
formItemProps: { ...rulesHelper.text },
|
|
||||||
colProps: { span: 8 },
|
|
||||||
}),
|
|
||||||
MyFormItems.EnumRadio({
|
|
||||||
key: 'type',
|
|
||||||
title: '类型',
|
|
||||||
colProps: { span: 12 },
|
|
||||||
valueEnum: HouseRegistersTypeEnum,
|
|
||||||
required: true,
|
|
||||||
}),
|
|
||||||
MyFormItems.EnumRadio({
|
|
||||||
key: 'customer_type',
|
|
||||||
title: '客户类型',
|
|
||||||
colProps: { span: 12 },
|
|
||||||
valueEnum: HouseRegistersCustomerTypeEnum,
|
|
||||||
}),
|
|
||||||
MyFormItems.EnumRadio({
|
|
||||||
key: 'usage_plan',
|
|
||||||
title: '使用计划',
|
|
||||||
colProps: { span: 12 },
|
|
||||||
valueEnum: HouseRegistersUsagePlanEnum,
|
|
||||||
}),
|
|
||||||
MyFormItems.EnumRadio({
|
|
||||||
key: 'status',
|
|
||||||
title: '状态',
|
|
||||||
colProps: { span: 12 },
|
|
||||||
valueEnum: HouseRegistersStatusEnum,
|
|
||||||
}),
|
|
||||||
MyFormItems.EnumRadio({
|
|
||||||
key: 'house_status',
|
|
||||||
title: '房屋状态',
|
|
||||||
colProps: { span: 12 },
|
|
||||||
valueEnum: HouseRegistersHouseStatusEnum,
|
|
||||||
}),
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@ -18,6 +18,7 @@ import AssetBuildingsUpdate from '../modals/BuildingsUpdate';
|
|||||||
import AssetHousesCreate from '../modals/HousesCreate';
|
import AssetHousesCreate from '../modals/HousesCreate';
|
||||||
import AssetHousesShow from '../modals/HousesShow';
|
import AssetHousesShow from '../modals/HousesShow';
|
||||||
import AssetHousesUpdate from '../modals/HousesUpdate';
|
import AssetHousesUpdate from '../modals/HousesUpdate';
|
||||||
|
import RegistersCreate from '../modals/RegistersCreate';
|
||||||
import AssetUnitsCreate from '../modals/UnitsCreate';
|
import AssetUnitsCreate from '../modals/UnitsCreate';
|
||||||
import AssetUnitsUpdate from '../modals/UnitsUpdate';
|
import AssetUnitsUpdate from '../modals/UnitsUpdate';
|
||||||
|
|
||||||
@ -222,7 +223,16 @@ export default function AssetBuildings(props: MyBetaModalFormProps) {
|
|||||||
render: (_, item: any, index, action) => (
|
render: (_, item: any, index, action) => (
|
||||||
<Space key={index}>
|
<Space key={index}>
|
||||||
<AssetHousesShow item={item} reload={action?.reload} />
|
<AssetHousesShow item={item} reload={action?.reload} />
|
||||||
<AssetHousesUpdate item={item} reload={action?.reload} />
|
<AssetHousesUpdate
|
||||||
|
item={item}
|
||||||
|
reload={action?.reload}
|
||||||
|
title="编辑"
|
||||||
|
/>
|
||||||
|
<RegistersCreate
|
||||||
|
item={item}
|
||||||
|
reload={action?.reload}
|
||||||
|
title="登记"
|
||||||
|
/>
|
||||||
<MyButtons.Delete
|
<MyButtons.Delete
|
||||||
onConfirm={() =>
|
onConfirm={() =>
|
||||||
Apis.Asset.AssetBuildings.Delete({ id: item.id }).then(
|
Apis.Asset.AssetBuildings.Delete({ id: item.id }).then(
|
||||||
|
|||||||
@ -26,7 +26,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
onFinish={async (values: any) => {
|
onFinish={async (values: any) => {
|
||||||
values?.grid_ranges?.map((res: { asset_projects_id: string }) => {
|
values?.grid_ranges?.forEach((res: { asset_projects_id: string }) => {
|
||||||
res.asset_projects_id = props?.item?.id;
|
res.asset_projects_id = props?.item?.id;
|
||||||
});
|
});
|
||||||
return Apis.Grid.Grids.Store({
|
return Apis.Grid.Grids.Store({
|
||||||
|
|||||||
@ -22,10 +22,12 @@ export default function Update(props: MyBetaModalFormProps) {
|
|||||||
return (
|
return (
|
||||||
<BetaSchemaForm<ApiTypes.Asset.AssetHouses.Update>
|
<BetaSchemaForm<ApiTypes.Asset.AssetHouses.Update>
|
||||||
{...MyModalFormProps.props}
|
{...MyModalFormProps.props}
|
||||||
title={`编辑房屋`}
|
title={props.title}
|
||||||
wrapperCol={{ span: 24 }}
|
wrapperCol={{ span: 24 }}
|
||||||
width="800px"
|
width="900px"
|
||||||
trigger={<MyButtons.Default title={`编辑`} size="small" type="link" />}
|
trigger={
|
||||||
|
<MyButtons.Default title={props.title} size="small" type="link" />
|
||||||
|
}
|
||||||
form={form}
|
form={form}
|
||||||
onOpenChange={(open: any) => {
|
onOpenChange={(open: any) => {
|
||||||
if (open) {
|
if (open) {
|
||||||
|
|||||||
214
src/pages/asset/asset_projects/modals/RegistersCreate.tsx
Normal file
214
src/pages/asset/asset_projects/modals/RegistersCreate.tsx
Normal file
@ -0,0 +1,214 @@
|
|||||||
|
import {
|
||||||
|
MyBetaModalFormProps,
|
||||||
|
MyButtons,
|
||||||
|
MyFormItems,
|
||||||
|
MyModalFormProps,
|
||||||
|
rulesHelper,
|
||||||
|
} from '@/common';
|
||||||
|
import { Apis } from '@/gen/Apis';
|
||||||
|
import {
|
||||||
|
HouseOccupantsCardTypeEnum,
|
||||||
|
HouseOccupantsHouseRelationEnum,
|
||||||
|
HouseOccupantsRelationWithOwnerEnum,
|
||||||
|
HouseRegistersCustomerTypeEnum,
|
||||||
|
HouseRegistersHouseStatusEnum,
|
||||||
|
HouseRegistersTypeEnum,
|
||||||
|
HouseRegistersUsagePlanEnum,
|
||||||
|
} from '@/gen/Enums';
|
||||||
|
import { BetaSchemaForm, ProCard } from '@ant-design/pro-components';
|
||||||
|
import { Form, message } from 'antd';
|
||||||
|
|
||||||
|
export default function Create(props: MyBetaModalFormProps) {
|
||||||
|
const [form] = Form.useForm();
|
||||||
|
return (
|
||||||
|
<BetaSchemaForm<ApiTypes.Archive.HouseRegisters.Store>
|
||||||
|
{...MyModalFormProps.props}
|
||||||
|
title={`添加${props.title}`}
|
||||||
|
wrapperCol={{ span: 24 }}
|
||||||
|
width="900px"
|
||||||
|
form={form}
|
||||||
|
trigger={
|
||||||
|
<MyButtons.Default title={props.title} size="small" type="link" />
|
||||||
|
}
|
||||||
|
onOpenChange={(open: any) => {
|
||||||
|
if (open) {
|
||||||
|
form.resetFields(); // 清空表单数据
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
onFinish={async (values) =>
|
||||||
|
Apis.Archive.HouseRegisters.Store({
|
||||||
|
...values,
|
||||||
|
asset_houses_id: props?.item?.id,
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
props.reload?.();
|
||||||
|
message.success(props.title + '成功');
|
||||||
|
return true;
|
||||||
|
})
|
||||||
|
.catch(() => false)
|
||||||
|
}
|
||||||
|
columns={[
|
||||||
|
MyFormItems.EnumRadio({
|
||||||
|
key: 'type',
|
||||||
|
title: '类型',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
valueEnum: HouseRegistersTypeEnum,
|
||||||
|
required: true,
|
||||||
|
}),
|
||||||
|
{
|
||||||
|
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: 8 }}
|
||||||
|
title={`客户${index + 1}`}
|
||||||
|
extra={action}
|
||||||
|
bodyStyle={{ paddingBlockEnd: 0 }}
|
||||||
|
>
|
||||||
|
{listDom}
|
||||||
|
</ProCard>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
valueType: 'group',
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
title: '姓名',
|
||||||
|
dataIndex: 'name',
|
||||||
|
colProps: { span: 8 },
|
||||||
|
formItemProps: { ...rulesHelper.text },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '手机号',
|
||||||
|
dataIndex: 'phone',
|
||||||
|
colProps: { span: 8 },
|
||||||
|
fieldProps: {
|
||||||
|
maxLength: 11,
|
||||||
|
},
|
||||||
|
formItemProps: { ...rulesHelper.text },
|
||||||
|
},
|
||||||
|
MyFormItems.EnumSelect({
|
||||||
|
key: 'house_relation',
|
||||||
|
title: '房客关系',
|
||||||
|
colProps: { span: 8 },
|
||||||
|
valueEnum: HouseOccupantsHouseRelationEnum,
|
||||||
|
required: true,
|
||||||
|
}),
|
||||||
|
|
||||||
|
{
|
||||||
|
title: '客户地址',
|
||||||
|
dataIndex: 'address',
|
||||||
|
colProps: { span: 8 },
|
||||||
|
formItemProps: { ...rulesHelper.text },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '解除时间',
|
||||||
|
dataIndex: 'unbound_time',
|
||||||
|
colProps: { span: 8 },
|
||||||
|
valueType: 'date',
|
||||||
|
fieldProps: {
|
||||||
|
style: { width: '100%' },
|
||||||
|
},
|
||||||
|
formItemProps: { ...rulesHelper.text },
|
||||||
|
},
|
||||||
|
MyFormItems.EnumSelect({
|
||||||
|
key: 'relation_with_owner',
|
||||||
|
title: '与产权人关系',
|
||||||
|
colProps: { span: 8 },
|
||||||
|
valueEnum: HouseOccupantsRelationWithOwnerEnum,
|
||||||
|
required: true,
|
||||||
|
}),
|
||||||
|
MyFormItems.EnumSelect({
|
||||||
|
key: 'card_type',
|
||||||
|
title: '证件类型',
|
||||||
|
colProps: { span: 8 },
|
||||||
|
valueEnum: HouseOccupantsCardTypeEnum,
|
||||||
|
required: true,
|
||||||
|
}),
|
||||||
|
{
|
||||||
|
title: '证件号码',
|
||||||
|
dataIndex: 'id_card',
|
||||||
|
colProps: { span: 8 },
|
||||||
|
fieldProps: {
|
||||||
|
maxLength: 18,
|
||||||
|
},
|
||||||
|
formItemProps: { ...rulesHelper.text },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '是否在居住中',
|
||||||
|
dataIndex: 'is_live_in',
|
||||||
|
colProps: { span: 8 },
|
||||||
|
valueType: 'switch',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
valueType: 'group',
|
||||||
|
columns: [
|
||||||
|
MyFormItems.UploadImages({
|
||||||
|
key: 'card_front_image',
|
||||||
|
title: '身份证正面',
|
||||||
|
max: 1,
|
||||||
|
colProps: { span: 8 },
|
||||||
|
formItemProps: { ...rulesHelper.text },
|
||||||
|
}),
|
||||||
|
MyFormItems.UploadImages({
|
||||||
|
key: 'card_back_image',
|
||||||
|
title: '身份证反面',
|
||||||
|
max: 1,
|
||||||
|
colProps: { span: 8 },
|
||||||
|
formItemProps: { ...rulesHelper.text },
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
MyFormItems.UploadImages({
|
||||||
|
key: 'ownership_info',
|
||||||
|
title: '产权信息',
|
||||||
|
max: 100,
|
||||||
|
colProps: { span: 24 },
|
||||||
|
formItemProps: { ...rulesHelper.array },
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
|
||||||
|
MyFormItems.EnumRadio({
|
||||||
|
key: 'customer_type',
|
||||||
|
title: '客户类型',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
valueEnum: HouseRegistersCustomerTypeEnum,
|
||||||
|
}),
|
||||||
|
MyFormItems.EnumRadio({
|
||||||
|
key: 'usage_plan',
|
||||||
|
title: '使用计划',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
valueEnum: HouseRegistersUsagePlanEnum,
|
||||||
|
}),
|
||||||
|
// MyFormItems.EnumRadio({
|
||||||
|
// key: 'status',
|
||||||
|
// title: '状态',
|
||||||
|
// colProps: { span: 24 },
|
||||||
|
// valueEnum: HouseRegistersStatusEnum,
|
||||||
|
// }),
|
||||||
|
MyFormItems.EnumRadio({
|
||||||
|
key: 'house_status',
|
||||||
|
title: '房屋状态',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
valueEnum: HouseRegistersHouseStatusEnum,
|
||||||
|
}),
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
4
src/pages/examine/AuditEnum.ts
Normal file
4
src/pages/examine/AuditEnum.ts
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
export const AuditEnum = {
|
||||||
|
Approved: { text: '通过', color: '#007bff', value: 'Approved' },
|
||||||
|
Rejected: { text: '拒绝', color: '#28a745', value: 'Rejected' },
|
||||||
|
};
|
||||||
72
src/pages/examine/house_registers_audit/index.tsx
Normal file
72
src/pages/examine/house_registers_audit/index.tsx
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
import { MyColumns, MyPageContainer, MyProTableProps } from '@/common';
|
||||||
|
import { Apis } from '@/gen/Apis';
|
||||||
|
import {
|
||||||
|
HouseRegistersCustomerTypeEnum,
|
||||||
|
HouseRegistersHouseStatusEnum,
|
||||||
|
HouseRegistersStatusEnum,
|
||||||
|
HouseRegistersTypeEnum,
|
||||||
|
HouseRegistersUsagePlanEnum,
|
||||||
|
} from '@/gen/Enums';
|
||||||
|
import { ProTable } from '@ant-design/pro-components';
|
||||||
|
import { Space } from 'antd';
|
||||||
|
import Audit from './modals/Audit';
|
||||||
|
|
||||||
|
export default function Index({ title = '房屋登记审核' }) {
|
||||||
|
return (
|
||||||
|
<MyPageContainer title={title}>
|
||||||
|
<ProTable
|
||||||
|
{...MyProTableProps.props}
|
||||||
|
request={async (params, sort) =>
|
||||||
|
MyProTableProps.request(
|
||||||
|
{ status: 'Pending', ...params },
|
||||||
|
sort,
|
||||||
|
Apis.Archive.HouseRegisters.List,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
columns={[
|
||||||
|
MyColumns.ID(),
|
||||||
|
{
|
||||||
|
title: '房屋',
|
||||||
|
dataIndex: ['asset_house', 'full_name'],
|
||||||
|
},
|
||||||
|
MyColumns.EnumTag({
|
||||||
|
title: '类型',
|
||||||
|
dataIndex: 'type',
|
||||||
|
valueEnum: HouseRegistersTypeEnum,
|
||||||
|
}),
|
||||||
|
MyColumns.EnumTag({
|
||||||
|
title: '状态',
|
||||||
|
dataIndex: 'status',
|
||||||
|
valueEnum: HouseRegistersStatusEnum,
|
||||||
|
}),
|
||||||
|
MyColumns.EnumTag({
|
||||||
|
title: '房屋状态',
|
||||||
|
dataIndex: 'house_status',
|
||||||
|
valueEnum: HouseRegistersHouseStatusEnum,
|
||||||
|
search: false,
|
||||||
|
}),
|
||||||
|
MyColumns.EnumTag({
|
||||||
|
title: '使用计划',
|
||||||
|
dataIndex: 'usage_plan',
|
||||||
|
valueEnum: HouseRegistersUsagePlanEnum,
|
||||||
|
search: false,
|
||||||
|
}),
|
||||||
|
MyColumns.EnumTag({
|
||||||
|
title: '客户类型',
|
||||||
|
dataIndex: 'customer_type',
|
||||||
|
valueEnum: HouseRegistersCustomerTypeEnum,
|
||||||
|
search: false,
|
||||||
|
}),
|
||||||
|
MyColumns.CreatedAt(),
|
||||||
|
MyColumns.Option({
|
||||||
|
render: (_, item: any, index, action) => (
|
||||||
|
<Space key={index}>
|
||||||
|
<Audit item={item} reload={action?.reload} title={title} />
|
||||||
|
</Space>
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</MyPageContainer>
|
||||||
|
);
|
||||||
|
}
|
||||||
62
src/pages/examine/house_registers_audit/modals/Audit.tsx
Normal file
62
src/pages/examine/house_registers_audit/modals/Audit.tsx
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
import {
|
||||||
|
MyBetaModalFormProps,
|
||||||
|
MyButtons,
|
||||||
|
MyFormItems,
|
||||||
|
MyModalFormProps,
|
||||||
|
rulesHelper,
|
||||||
|
} from '@/common';
|
||||||
|
|
||||||
|
import { Apis } from '@/gen/Apis';
|
||||||
|
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||||
|
import { Form, message } from 'antd';
|
||||||
|
import { AuditEnum } from '../../AuditEnum';
|
||||||
|
export default function Update(props: MyBetaModalFormProps) {
|
||||||
|
const [form] = Form.useForm();
|
||||||
|
return (
|
||||||
|
<BetaSchemaForm<ApiTypes.Archive.HouseRegisters.Update>
|
||||||
|
{...MyModalFormProps.props}
|
||||||
|
title={props.title}
|
||||||
|
trigger={<MyButtons.Default title="审核" type="primary" />}
|
||||||
|
wrapperCol={{ span: 24 }}
|
||||||
|
width="600px"
|
||||||
|
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={[
|
||||||
|
MyFormItems.EnumRadio({
|
||||||
|
key: 'status',
|
||||||
|
title: '审核',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
valueEnum: AuditEnum,
|
||||||
|
required: true,
|
||||||
|
}),
|
||||||
|
{
|
||||||
|
valueType: 'dependency',
|
||||||
|
name: ['status'],
|
||||||
|
columns: ({ status }) => {
|
||||||
|
return status === 'Rejected'
|
||||||
|
? [
|
||||||
|
{
|
||||||
|
title: '驳回原因',
|
||||||
|
dataIndex: 'reason',
|
||||||
|
valueType: 'textarea',
|
||||||
|
formItemProps: { ...rulesHelper.text },
|
||||||
|
},
|
||||||
|
]
|
||||||
|
: [];
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user