import React from 'react'; import { Spin, Form, Button, InputNumber, message } from 'antd'; import ajax from 'jquery/src/ajax/xhr.js' import $ from 'jquery/src/ajax'; const FormItem = Form.Item; const formItemLayout = { labelCol: { span: 6 }, wrapperCol: { span: 10 }, }; const EvaluateStep6 = Form.create({})(React.createClass({ getInitialState() { return { loading: false, initialData: {} }; }, componentWillMount() { this.state.initialData = this.props.data || {}; }, next() { if (this.state.loading) { return; } this.props.form.validateFields((err, values) => { if (!err) { this.setState({ loading: true }) $.ajax({ url: globalConfig.context + '/api/user/evaluate/step6', method: 'post', data: { id: this.props.id, taxRate: values.taxRate } }).done(function (res) { if (res.error && res.error.length) { message.error(res.error[0].message) } else { if (this.props.next) { this.props.next(values); } } }.bind(this)).fail(function () { this.setState({ loading: false }) }.bind(this)); } }); }, prev() { if (this.props.prev) { this.props.prev(); } }, stringify(val) { return val && String(val) }, render() { let { loading, initialData } = this.state; const { getFieldDecorator } = this.props.form; return (
提示:一般企业所得税率为25%,如果应用该项技术的公司有所得税优惠政策,按照优惠政策填列。如为高新技术企业请填15%
{getFieldDecorator('taxRate', { initialValue: this.stringify(initialData.taxRate), rules: [{ required: true, message: '请输入预估企业所得税率!' }, { validator: (rule, value, callback) => { if (!Number(value)) { callback('请输入预估企业所得税率!'); } else { callback(); } }, }] })( )}
) }, })); export default EvaluateStep6;