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

feat: 数字类型校验

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