注册组件修改字段
This commit is contained in:
@ -45,13 +45,21 @@ const DomesticForm: React.FC<DomesticFormProps> = ({
|
||||
surveyQuestions,
|
||||
}) => {
|
||||
const [contactsTypeOptions, setContactsTypeOptions] = useState<DictItem[]>([]);
|
||||
// 企业类别
|
||||
const [companyTypeOptions, setCompanyTypeOptions] = useState<DictItem[]>([]);
|
||||
useEffect(() => {
|
||||
// 从字典中 联系人身份类别contacts_type 获取数据
|
||||
getDictList('contacts_type').then(res => {
|
||||
getDictList('contacts_type').then((res) => {
|
||||
if (res.code === 200) {
|
||||
setContactsTypeOptions(res.data);
|
||||
}
|
||||
});
|
||||
// 企业类别
|
||||
getDictList('enterprise_type').then((res) => {
|
||||
if (res.code === 200) {
|
||||
setCompanyTypeOptions(res.data);
|
||||
}
|
||||
});
|
||||
}, []);
|
||||
return (
|
||||
<>
|
||||
@ -131,12 +139,13 @@ const DomesticForm: React.FC<DomesticFormProps> = ({
|
||||
label="企业类别"
|
||||
rules={[{ required: true, message: '请选择企业类别' }]}
|
||||
>
|
||||
<Select placeholder="请选择企业类别">
|
||||
<Option value="limited">有限责任公司</Option>
|
||||
<Option value="joint">股份有限公司</Option>
|
||||
<Option value="individual">个体工商户</Option>
|
||||
<Option value="other">其他</Option>
|
||||
</Select>
|
||||
<Select
|
||||
placeholder="请选择企业类别"
|
||||
options={companyTypeOptions.map((item) => ({
|
||||
label: item.dicName,
|
||||
value: item.code,
|
||||
}))}
|
||||
/>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
{/* <Col span={8}>
|
||||
@ -207,8 +216,22 @@ const DomesticForm: React.FC<DomesticFormProps> = ({
|
||||
{ required: true, message: '请输入联系人手机号' },
|
||||
{ pattern: /^1[3-9]\d{9}$/, message: '请输入有效的手机号' },
|
||||
]}
|
||||
extra="该手机号用于后续联系和找回密码"
|
||||
>
|
||||
<Input prefix={<MobileOutlined />} placeholder="请输入11位手机号码" />
|
||||
<Input
|
||||
prefix={<MobileOutlined />}
|
||||
placeholder="请输入11位手机号码"
|
||||
addonAfter={
|
||||
<Button
|
||||
type="link"
|
||||
size="small"
|
||||
disabled={countdown > 0}
|
||||
onClick={handleGetCaptcha}
|
||||
>
|
||||
{countdown > 0 ? `${countdown}s` : '获取验证码'}
|
||||
</Button>
|
||||
}
|
||||
/>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
@ -217,21 +240,7 @@ const DomesticForm: React.FC<DomesticFormProps> = ({
|
||||
label="验证码"
|
||||
rules={[{ required: true, message: '请输入验证码' }]}
|
||||
>
|
||||
<Row gutter={8}>
|
||||
<Col span={14}>
|
||||
<Input placeholder="请输入短信验证码" />
|
||||
</Col>
|
||||
<Col span={10}>
|
||||
<Button
|
||||
type="primary"
|
||||
style={{ marginTop: 0 }}
|
||||
disabled={countdown > 0}
|
||||
onClick={handleGetCaptcha}
|
||||
>
|
||||
{countdown > 0 ? `${countdown}s` : '获取验证码'}
|
||||
</Button>
|
||||
</Col>
|
||||
</Row>
|
||||
<Input placeholder="请输入短信验证码" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
{/* <Col span={8}>
|
||||
@ -244,16 +253,26 @@ const DomesticForm: React.FC<DomesticFormProps> = ({
|
||||
</Form.Item>
|
||||
</Col> */}
|
||||
<Col span={8}>
|
||||
<Form.Item label="联系人证件号码" required >
|
||||
<Space.Compact size='large'>
|
||||
<Form.Item name="contactIdType" noStyle rules={[{ required: true, message: '请选择联系人证件类型' }]}>
|
||||
<Form.Item label="联系人证件号码" required>
|
||||
<Space.Compact size="large">
|
||||
<Form.Item
|
||||
name="contactIdType"
|
||||
noStyle
|
||||
rules={[{ required: true, message: '请选择联系人证件类型' }]}
|
||||
>
|
||||
<Select placeholder="请选择类型">
|
||||
{contactsTypeOptions.map(item => (
|
||||
<Option key={item.code} value={item.code}>{item.dicName}</Option>
|
||||
{contactsTypeOptions.map((item) => (
|
||||
<Option key={item.code} value={item.code}>
|
||||
{item.dicName}
|
||||
</Option>
|
||||
))}
|
||||
</Select>
|
||||
</Form.Item>
|
||||
<Form.Item name="contactIdNumber" noStyle rules={[{ required: true, message: '请填写联系人正确的身份证号' }]}>
|
||||
<Form.Item
|
||||
name="contactIdNumber"
|
||||
noStyle
|
||||
rules={[{ required: true, message: '请填写联系人正确的身份证号' }]}
|
||||
>
|
||||
<Input placeholder="请填写联系人正确的身份证号" />
|
||||
</Form.Item>
|
||||
</Space.Compact>
|
||||
|
Reference in New Issue
Block a user