Commit 565a2a42 authored by 张子雨's avatar 张子雨

feat: 数字类型校验

parent 02b9c78f
...@@ -19,7 +19,6 @@ import { ...@@ -19,7 +19,6 @@ import {
notification, notification,
Spin, Spin,
Tabs, Tabs,
InputNumber,
} from 'antd'; } from 'antd';
import styles from './style.less'; import styles from './style.less';
import { import {
...@@ -353,6 +352,7 @@ class BusinessInfo extends Component { ...@@ -353,6 +352,7 @@ class BusinessInfo extends Component {
} }
onChangeBusinessModel = e => { onChangeBusinessModel = e => {
console.log('....');
this.getCategoryList(e); this.getCategoryList(e);
this.props.form.setFieldsValue({ this.props.form.setFieldsValue({
mainCategoryId: '', mainCategoryId: '',
...@@ -980,14 +980,18 @@ class BusinessInfo extends Component { ...@@ -980,14 +980,18 @@ class BusinessInfo extends Component {
<Col span={12}> <Col span={12}>
<FormItem label="银行帐号" labelCol={{ span: 8 }}> <FormItem label="银行帐号" labelCol={{ span: 8 }}>
{getFieldDecorator('bankAccount', { {getFieldDecorator('bankAccount', {
rules: [{ required: true, message: '请输入银行帐号!' }], rules: [
{ required: true, message: '请输入银行帐号!' },
{ pattern: /^[0-9]*$/, message: '请输入数字' },
],
initialValue: businessInfo.bankAccount, initialValue: businessInfo.bankAccount,
})(<InputNumber style={{ width: '100%' }} controls={false} min={1} />)} })(<Input />)}
</FormItem> </FormItem>
</Col> </Col>
<Col span={12}> <Col span={12}>
<FormItem label="联行号" labelCol={{ span: 8 }}> <FormItem label="联行号" labelCol={{ span: 8 }}>
{getFieldDecorator('interbankNum', { {getFieldDecorator('interbankNum', {
rules: [{ pattern: /^[0-9]*$/, message: '请输入数字' }],
initialValue: businessInfo.interbankNum, initialValue: businessInfo.interbankNum,
})(<Input maxLength={50} />)} })(<Input maxLength={50} />)}
</FormItem> </FormItem>
...@@ -1063,9 +1067,12 @@ class BusinessInfo extends Component { ...@@ -1063,9 +1067,12 @@ class BusinessInfo extends Component {
<Col span={12}> <Col span={12}>
<FormItem label="银行帐号" labelCol={{ span: 8 }}> <FormItem label="银行帐号" labelCol={{ span: 8 }}>
{getFieldDecorator('bankAccount', { {getFieldDecorator('bankAccount', {
rules: [{ required: true, message: '请输入银行帐号!' }], rules: [
{ required: true, message: '请输入银行帐号!' },
{ pattern: /^[0-9]*$/, message: '请输入数字' },
],
initialValue: businessInfo.bankAccount, initialValue: businessInfo.bankAccount,
})(<InputNumber style={{ width: '100%' }} controls={false} min={1} />)} })(<Input />)}
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
...@@ -1124,9 +1131,12 @@ class BusinessInfo extends Component { ...@@ -1124,9 +1131,12 @@ class BusinessInfo extends Component {
<Col span={12}> <Col span={12}>
<FormItem label="银行帐号" labelCol={{ span: 8 }}> <FormItem label="银行帐号" labelCol={{ span: 8 }}>
{getFieldDecorator('bankAccount', { {getFieldDecorator('bankAccount', {
rules: [{ required: true, message: '请输入银行帐号!' }], rules: [
{ required: true, message: '请输入银行帐号!' },
{ pattern: /^[0-9]*$/, message: '请输入数字' },
],
initialValue: businessInfo.bankAccount, initialValue: businessInfo.bankAccount,
})(<InputNumber style={{ width: '100%' }} controls={false} min={1} />)} })(<Input />)}
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
......
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