2025-06-29 18:42:50 +08:00
|
|
|
import {
|
|
|
|
|
MyBetaModalFormProps,
|
|
|
|
|
MyButtons,
|
|
|
|
|
MyModalFormProps,
|
|
|
|
|
rulesHelper,
|
|
|
|
|
} from '@/common';
|
|
|
|
|
import { Address } from '@/components/Address';
|
|
|
|
|
import { Apis } from '@/gen/Apis';
|
|
|
|
|
import { BetaSchemaForm } from '@ant-design/pro-components';
|
|
|
|
|
import { message } from 'antd';
|
|
|
|
|
|
|
|
|
|
export default function Create(props: MyBetaModalFormProps) {
|
|
|
|
|
return (
|
|
|
|
|
<BetaSchemaForm<ApiTypes.Company.Companies.Store>
|
|
|
|
|
{...MyModalFormProps.props}
|
2025-06-30 15:56:13 +08:00
|
|
|
title={`添加机构`}
|
2025-06-29 18:42:50 +08:00
|
|
|
wrapperCol={{ span: 24 }}
|
|
|
|
|
width="800px"
|
2025-06-30 15:56:13 +08:00
|
|
|
trigger={<MyButtons.Create title={`添加机构`} />}
|
2025-06-29 18:42:50 +08:00
|
|
|
onFinish={async (values) =>
|
2025-06-30 15:56:13 +08:00
|
|
|
Apis.Company.Companies.Store({
|
|
|
|
|
...values,
|
|
|
|
|
merchant_type: 'PropertyManagement',
|
|
|
|
|
})
|
2025-06-29 18:42:50 +08:00
|
|
|
.then(() => {
|
|
|
|
|
props.reload?.();
|
|
|
|
|
message.success(props.title + '成功');
|
|
|
|
|
return true;
|
|
|
|
|
})
|
|
|
|
|
.catch(() => false)
|
|
|
|
|
}
|
|
|
|
|
columns={[
|
|
|
|
|
{
|
|
|
|
|
key: 'name',
|
2025-06-30 13:41:38 +08:00
|
|
|
title: '机构名称',
|
2025-06-29 18:42:50 +08:00
|
|
|
colProps: { span: 8 },
|
|
|
|
|
formItemProps: { ...rulesHelper.text },
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: 'short_name',
|
2025-06-30 13:41:38 +08:00
|
|
|
title: '机构简称',
|
2025-06-29 18:42:50 +08:00
|
|
|
colProps: { span: 8 },
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: 'business_license_number',
|
|
|
|
|
title: '营业执照号',
|
|
|
|
|
colProps: { span: 8 },
|
|
|
|
|
formItemProps: { ...rulesHelper.text },
|
2025-06-30 15:56:13 +08:00
|
|
|
fieldProps: {
|
|
|
|
|
maxLength: 18,
|
|
|
|
|
},
|
2025-06-29 18:42:50 +08:00
|
|
|
},
|
2025-06-30 15:56:13 +08:00
|
|
|
// MyFormItems.EnumRadio({
|
|
|
|
|
// key: 'merchant_type',
|
|
|
|
|
// title: '商户类型',
|
|
|
|
|
// colProps: { span: 8 },
|
|
|
|
|
// valueEnum: CompaniesMerchantTypeEnum,
|
|
|
|
|
// required: true,
|
|
|
|
|
// }),
|
2025-06-29 18:42:50 +08:00
|
|
|
{
|
|
|
|
|
key: 'contact_name',
|
|
|
|
|
title: '联系人姓名',
|
|
|
|
|
colProps: { span: 8 },
|
|
|
|
|
formItemProps: { ...rulesHelper.text },
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: 'contact_phone',
|
|
|
|
|
title: '联系人手机',
|
|
|
|
|
colProps: { span: 8 },
|
|
|
|
|
valueType: 'number',
|
|
|
|
|
fieldProps: {
|
|
|
|
|
maxLength: 11,
|
|
|
|
|
},
|
|
|
|
|
formItemProps: { ...rulesHelper.number },
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: 'contact_email',
|
|
|
|
|
title: '联系人邮箱',
|
|
|
|
|
colProps: { span: 8 },
|
|
|
|
|
},
|
2025-06-30 15:56:13 +08:00
|
|
|
// {
|
|
|
|
|
// key: 'contact_address',
|
|
|
|
|
// title: '联系人地址',
|
|
|
|
|
// colProps: { span: 24 },
|
|
|
|
|
// },
|
|
|
|
|
|
2025-06-29 18:42:50 +08:00
|
|
|
Address.Cascader({
|
|
|
|
|
key: 'casacader',
|
2025-06-30 15:56:13 +08:00
|
|
|
title: '联系地址',
|
|
|
|
|
colProps: { span: 16 },
|
2025-06-29 18:42:50 +08:00
|
|
|
keys: ['province', 'city', 'area', 'street'],
|
|
|
|
|
required: true,
|
|
|
|
|
}),
|
|
|
|
|
{
|
|
|
|
|
key: 'address',
|
2025-06-30 13:41:38 +08:00
|
|
|
title: '详细地址',
|
2025-06-30 15:56:13 +08:00
|
|
|
colProps: { span: 8 },
|
2025-06-29 18:42:50 +08:00
|
|
|
},
|
2025-06-30 15:56:13 +08:00
|
|
|
// MyFormItems.UploadImages({
|
|
|
|
|
// key: 'business_license_image',
|
|
|
|
|
// title: '营业执照',
|
|
|
|
|
// max: 1,
|
|
|
|
|
// colProps: { span: 6 },
|
|
|
|
|
// }),
|
2025-06-29 18:42:50 +08:00
|
|
|
]}
|
|
|
|
|
/>
|
|
|
|
|
);
|
|
|
|
|
}
|