Commit 931c1e92 authored by 张子雨's avatar 张子雨

feat: 添加校验

parent a09a0f43
...@@ -52,7 +52,7 @@ const { Option } = Select; ...@@ -52,7 +52,7 @@ const { Option } = Select;
const { Item: FormItem } = Form; const { Item: FormItem } = Form;
const { RangePicker } = DatePicker; const { RangePicker } = DatePicker;
const { TabPane } = Tabs; const { TabPane } = Tabs;
const carID = 301008; // 汽车类商家
class BusinessInfo extends Component { class BusinessInfo extends Component {
getFieldDecorator = this.props?.form?.getFieldDecorator; getFieldDecorator = this.props?.form?.getFieldDecorator;
...@@ -82,6 +82,7 @@ class BusinessInfo extends Component { ...@@ -82,6 +82,7 @@ class BusinessInfo extends Component {
checkboxDisabled: false, checkboxDisabled: false,
mainCategoryId: null, mainCategoryId: null,
companyNamedis: false, // 公司名称 companyNamedis: false, // 公司名称
storedis: true, // 到店校验
}; };
async componentDidMount() { async componentDidMount() {
...@@ -321,7 +322,9 @@ class BusinessInfo extends Component { ...@@ -321,7 +322,9 @@ class BusinessInfo extends Component {
} }
onChangeBusinessModel = e => { onChangeBusinessModel = e => {
const storedis = e.includes(3);
this.getCategoryList(e); this.getCategoryList(e);
this.setState({ storedis });
this.props.form.setFieldsValue({ this.props.form.setFieldsValue({
mainCategoryId: '', mainCategoryId: '',
}); });
...@@ -338,7 +341,14 @@ class BusinessInfo extends Component { ...@@ -338,7 +341,14 @@ class BusinessInfo extends Component {
const { const {
form: { getFieldDecorator }, form: { getFieldDecorator },
} = this.props; } = this.props;
const { businessInfo, type, checkboxDisabled, mainCategoryId, companyNamedis } = this.state; const {
businessInfo,
type,
checkboxDisabled,
mainCategoryId,
companyNamedis,
storedis,
} = this.state;
return ( return (
<div className={styles.infoBox}> <div className={styles.infoBox}>
<Form className="login-form" onSubmit={this.handleSubmit} {...formItemLayout}> <Form className="login-form" onSubmit={this.handleSubmit} {...formItemLayout}>
...@@ -417,6 +427,8 @@ class BusinessInfo extends Component { ...@@ -417,6 +427,8 @@ class BusinessInfo extends Component {
})(<Input />)} })(<Input />)}
</FormItem> </FormItem>
</Col> </Col>
{+mainCategoryId !== carID && (
<>
<Col span={12}> <Col span={12}>
<FormItem label="客服电话" labelCol={{ span: 5 }}> <FormItem label="客服电话" labelCol={{ span: 5 }}>
{getFieldDecorator('servicePhone', { {getFieldDecorator('servicePhone', {
...@@ -433,6 +445,8 @@ class BusinessInfo extends Component { ...@@ -433,6 +445,8 @@ class BusinessInfo extends Component {
})(<Checkbox.Group options={signDateTypeList} />)} })(<Checkbox.Group options={signDateTypeList} />)}
</FormItem> </FormItem>
</Col> </Col>
</>
)}
</Row> </Row>
</Card> </Card>
<Card title="店铺营业信息"> <Card title="店铺营业信息">
...@@ -451,7 +465,8 @@ class BusinessInfo extends Component { ...@@ -451,7 +465,8 @@ class BusinessInfo extends Component {
)} )}
</FormItem> </FormItem>
</Col> </Col>
{+mainCategoryId !== carID && (
<>
<Col span={24}> <Col span={24}>
<FormItem label="服务设施" labelCol={{ span: 4 }}> <FormItem label="服务设施" labelCol={{ span: 4 }}>
{getFieldDecorator('selfList', { {getFieldDecorator('selfList', {
...@@ -474,6 +489,8 @@ class BusinessInfo extends Component { ...@@ -474,6 +489,8 @@ class BusinessInfo extends Component {
})(renderServiceTags.call(this))} })(renderServiceTags.call(this))}
</FormItem> </FormItem>
</Col> </Col>
</>
)}
</Card> </Card>
<Card title="证照信息录入区"> <Card title="证照信息录入区">
<Row gutter={24}> <Row gutter={24}>
...@@ -500,6 +517,7 @@ class BusinessInfo extends Component { ...@@ -500,6 +517,7 @@ class BusinessInfo extends Component {
)} )}
</FormItem> </FormItem>
</Col> </Col>
{+mainCategoryId !== carID && (
<Col span={24}> <Col span={24}>
<FormItem label="企业类型" labelCol={{ span: 4 }}> <FormItem label="企业类型" labelCol={{ span: 4 }}>
{getFieldDecorator('companyType', { {getFieldDecorator('companyType', {
...@@ -514,6 +532,8 @@ class BusinessInfo extends Component { ...@@ -514,6 +532,8 @@ class BusinessInfo extends Component {
)} )}
</FormItem> </FormItem>
</Col> </Col>
)}
<Col span={24} className={styles.imgList}> <Col span={24} className={styles.imgList}>
<FormItem label="营业执照" labelCol={{ span: 4 }} wrapperCol={wrapperCol}> <FormItem label="营业执照" labelCol={{ span: 4 }} wrapperCol={wrapperCol}>
{getFieldDecorator('businessLicenseImage', { {getFieldDecorator('businessLicenseImage', {
...@@ -533,6 +553,8 @@ class BusinessInfo extends Component { ...@@ -533,6 +553,8 @@ class BusinessInfo extends Component {
)} )}
</FormItem> </FormItem>
</Col> </Col>
{+mainCategoryId !== carID && (
<>
<Col span={12}> <Col span={12}>
<Row> <Row>
<Col span={4} style={{ marginTop: '4px' }}> <Col span={4} style={{ marginTop: '4px' }}>
...@@ -558,10 +580,16 @@ class BusinessInfo extends Component { ...@@ -558,10 +580,16 @@ class BusinessInfo extends Component {
})(<Input maxLength={32} />)} })(<Input maxLength={32} />)}
</FormItem> </FormItem>
</Col> </Col>
{(!companyNamedis && businessInfo.companyType && businessInfo.companyType !== 2) || {(!companyNamedis &&
businessInfo.companyType &&
businessInfo.companyType !== 2) ||
(!companyNamedis && businessInfo?.icbProofImage?.length) ? ( (!companyNamedis && businessInfo?.icbProofImage?.length) ? (
<Col span={12}> <Col span={12}>
<FormItem label="工商局变更证明" labelCol={{ span: 8 }} wrapperCol={wrapperCol}> <FormItem
label="工商局变更证明"
labelCol={{ span: 8 }}
wrapperCol={wrapperCol}
>
{getFieldDecorator('icbProofImage', { {getFieldDecorator('icbProofImage', {
rules: [{ required: true, message: '请上传工商局变更证明!' }], rules: [{ required: true, message: '请上传工商局变更证明!' }],
initialValue: businessInfo.icbProofImage, initialValue: businessInfo.icbProofImage,
...@@ -581,7 +609,9 @@ class BusinessInfo extends Component { ...@@ -581,7 +609,9 @@ class BusinessInfo extends Component {
) : ( ) : (
'' ''
)} )}
{(!companyNamedis && businessInfo.companyType && businessInfo.companyType === 2) || {(!companyNamedis &&
businessInfo.companyType &&
businessInfo.companyType === 2) ||
(!companyNamedis && businessInfo?.householdRegisterImage?.length) ? ( (!companyNamedis && businessInfo?.householdRegisterImage?.length) ? (
<Col span={12}> <Col span={12}>
<FormItem label="户口本本人页" labelCol={{ span: 8 }} wrapperCol={wrapperCol}> <FormItem label="户口本本人页" labelCol={{ span: 8 }} wrapperCol={wrapperCol}>
...@@ -650,7 +680,9 @@ class BusinessInfo extends Component { ...@@ -650,7 +680,9 @@ class BusinessInfo extends Component {
)} )}
</FormItem> </FormItem>
</Col> </Col>
{+mainCategoryId === 301008 && ( </>
)}
{(+mainCategoryId === carID || storedis) && (
<> <>
<Col span={24}> <Col span={24}>
<FormItem label="授权品牌" labelCol={{ span: 4 }}> <FormItem label="授权品牌" labelCol={{ span: 4 }}>
...@@ -686,8 +718,14 @@ class BusinessInfo extends Component { ...@@ -686,8 +718,14 @@ class BusinessInfo extends Component {
</Card> </Card>
<Card title="法人信息录入区"> <Card title="法人信息录入区">
<Row gutter={24}> <Row gutter={24}>
{+mainCategoryId !== carID && (
<>
<Col span={12} className={styles.imgList}> <Col span={12} className={styles.imgList}>
<FormItem label="法人身份证人像面" labelCol={{ span: 8 }} wrapperCol={wrapperCol}> <FormItem
label="法人身份证人像面"
labelCol={{ span: 8 }}
wrapperCol={wrapperCol}
>
{getFieldDecorator('idCardPortraitImage', { {getFieldDecorator('idCardPortraitImage', {
rules: [{ required: true, message: '请上传身份证人像面!' }], rules: [{ required: true, message: '请上传身份证人像面!' }],
initialValue: businessInfo.idCardPortraitImage, initialValue: businessInfo.idCardPortraitImage,
...@@ -707,7 +745,11 @@ class BusinessInfo extends Component { ...@@ -707,7 +745,11 @@ class BusinessInfo extends Component {
</FormItem> </FormItem>
</Col> </Col>
<Col span={12} className={styles.imgList}> <Col span={12} className={styles.imgList}>
<FormItem label="法人身份证国徽面" labelCol={{ span: 8 }} wrapperCol={wrapperCol}> <FormItem
label="法人身份证国徽面"
labelCol={{ span: 8 }}
wrapperCol={wrapperCol}
>
{getFieldDecorator('idCardEmblemImage', { {getFieldDecorator('idCardEmblemImage', {
rules: [{ required: true, message: '请上传身份证国徽面!' }], rules: [{ required: true, message: '请上传身份证国徽面!' }],
initialValue: businessInfo.idCardEmblemImage, initialValue: businessInfo.idCardEmblemImage,
...@@ -779,6 +821,8 @@ class BusinessInfo extends Component { ...@@ -779,6 +821,8 @@ class BusinessInfo extends Component {
</Col> </Col>
</Row> </Row>
</Col> </Col>
</>
)}
<Col span={12}> <Col span={12}>
<FormItem label="手机号" labelCol={{ span: 8 }}> <FormItem label="手机号" labelCol={{ span: 8 }}>
{getFieldDecorator('legalPersonPhone', { {getFieldDecorator('legalPersonPhone', {
...@@ -790,6 +834,7 @@ class BusinessInfo extends Component { ...@@ -790,6 +834,7 @@ class BusinessInfo extends Component {
})(<Input maxLength={11} />)} })(<Input maxLength={11} />)}
</FormItem> </FormItem>
</Col> </Col>
{+mainCategoryId !== carID && (
<Col span={24}> <Col span={24}>
<FormItem label="其它证照" labelCol={{ span: 4 }} wrapperCol={wrapperCol}> <FormItem label="其它证照" labelCol={{ span: 4 }} wrapperCol={wrapperCol}>
{getFieldDecorator('otherImage', { {getFieldDecorator('otherImage', {
...@@ -804,9 +849,12 @@ class BusinessInfo extends Component { ...@@ -804,9 +849,12 @@ class BusinessInfo extends Component {
)} )}
</FormItem> </FormItem>
</Col> </Col>
)}
</Row> </Row>
</Card> </Card>
<Card title="结算信息录入区"> <Card title="结算信息录入区">
{+mainCategoryId !== carID && (
<>
<Row gutter={24}> <Row gutter={24}>
<Col span={24}> <Col span={24}>
<FormItem label="账户类型" labelCol={{ span: 4 }} wrapperCol={wrapperCol}> <FormItem label="账户类型" labelCol={{ span: 4 }} wrapperCol={wrapperCol}>
...@@ -972,9 +1020,69 @@ class BusinessInfo extends Component { ...@@ -972,9 +1020,69 @@ class BusinessInfo extends Component {
</Col> </Col>
</Row> </Row>
)} )}
</>
)}
{+mainCategoryId === carID && (
<Row gutter={24}>
<Col span={12}>
<FormItem label="开户许可证" labelCol={{ span: 8 }} wrapperCol={wrapperCol}>
{getFieldDecorator('accountOpenPermitImage', {
rules: [{ required: true, message: '请上传开户许可证!' }],
initialValue: businessInfo.accountOpenPermitImage,
})(
<Upload
{...uploadPropsFn.call(this, {
keyName: 'accountOpenPermitImage',
type: 8,
})}
fileList={businessInfo.accountOpenPermitImage}
>
<UploadOutlined /> 上传文件
</Upload>,
)}
</FormItem>
</Col>
<Col span={12}>
<FormItem label="开户名称" labelCol={{ span: 8 }}>
{getFieldDecorator('bankAccountName', {
rules: [{ required: true, message: '请输入开户名称!' }],
initialValue: businessInfo.bankAccountName,
})(<Input maxLength={32} />)}
</FormItem>
</Col>
<Col span={12}>
<FormItem label="开户行" labelCol={{ span: 8 }}>
{getFieldDecorator('accountBankName', {
rules: [{ required: true, message: '请选择开户行!' }],
initialValue: businessInfo.accountBankName,
})(
<Select
showSearch
filterOption={(input, option) =>
(option?.value ?? '').toLowerCase().includes(input.toLowerCase())
}
>
{this.state.bankList.map(item => (
<Option value={item.bankName} key={item.bankName}>
{item.bankName}
</Option>
))}
</Select>,
)}
</FormItem>
</Col>
<Col span={12}>
<FormItem label="银行帐号" labelCol={{ span: 8 }}>
{getFieldDecorator('bankAccount', {
rules: [{ required: true, message: '请输入银行帐号!' }],
initialValue: businessInfo.bankAccount,
})(<Input maxLength={20} />)}
</FormItem>
</Col>
</Row>
)}
</Card> </Card>
{/* 汽车301008 */} {(+mainCategoryId === carID || storedis) && (
{+mainCategoryId === 301008 ? (
<Card title="其他信息"> <Card title="其他信息">
<Row gutter={24}> <Row gutter={24}>
<Col span={24}> <Col span={24}>
...@@ -987,8 +1095,6 @@ class BusinessInfo extends Component { ...@@ -987,8 +1095,6 @@ class BusinessInfo extends Component {
</Col> </Col>
</Row> </Row>
</Card> </Card>
) : (
''
)} )}
<div className={styles.formBtns}> <div className={styles.formBtns}>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment