<Col xxl={6} xl={12} lg={12}>
<Row>
<Item
{...ItemOneFourth}
label='配载量'
>
{
getFieldDecorator("stowage" + index + j_index, {
initialValue: '',
rules: [
{
validator: this.validateStowage,
}
]
})(
<Input suffix={
<span>{this.state.goodsUnit}</span>}/>
)
}
</Item>
</Row>
</Col>
// 自定义表单验证
validateStowage =(rule, value, callback)=>{
if(value == ''|| value == null || /^[0-9]*$/.test(value) == false){
callback('请填写正确内容');
}else{
callback();
}
};
//提交
this.props.form.validateFieldsAndScroll(
(err) => {
if (!err) {
Axios.post('url', data).then((res) => {}).catch((err) => {});
}
},
);


968

被折叠的 条评论
为什么被折叠?



