import React from 'react'; import { Input, Button, Form, Upload, Icon, Spin, message, Row, Col, DatePicker, Select, Radio, Cascader } from 'antd'; import './certify.less'; import { getBase64, beforeUpload, beforeUploadFile } from '../tools.js'; import { areaSelect } from '../NewDicProvinceList'; import { techFieldList } from '../DicTechFieldList'; import ajax from 'jquery/src/ajax/xhr.js'; import $ from 'jquery/src/ajax'; import moment from 'moment'; import card1 from '../../../image/idcard1.jpg'; import card2 from '../../../image/idcard2.jpg'; class Avatar extends React.Component { constructor(props) { super(props); this.state = { imageUrl: '' } } handleChange(info) { if (info.file.status === 'done') { // Get this url from response in real world. getBase64(info.file.originFileObj, imageUrl => this.setState({ imageUrl })); this.props.urlData(info.file.response.data); } } render() { const imageUrl = this.state.imageUrl; return ( { imageUrl ? : } ); } }; const Content = Form.create()(React.createClass({ getData() { this.setState({ loading: true }); $.ajax({ method: "get", dataType: "json", url: globalConfig.context + "/api/user/orgProcess", success: function (data) { if (data.data) { this.setState({ firstContacts: data.data.firstContacts, firstMobile: data.data.firstMobile, aftUsername: data.data.aftUsername, unitName: data.data.unitName, registeredCapital: data.data.registeredCapital, licenceNumber: data.data.licenceNumber, address: [data.data.licenceProvince, data.data.licenceCity, data.data.licenceArea], orgCode: data.data.orgCode, legalPerson: data.data.legalPerson, legalPersonIdCard: data.data.legalPersonIdCard, licenceScanningUrl: data.data.licenceScanningUrl, orgCodeUrl: data.data.orgCodeUrl, lastYearTaxReportUrl: data.data.lastYearTaxReportUrl, listed: data.data.listed, listedDate: data.data.listedDateFormattedDate, listedType: data.data.listedType, stockCode: data.data.stockCode, auditStatus: data.data.auditStatus, field: data.data.field ? data.data.field.split(",") : [] }); }; }.bind(this), }).done(function (data) { if (data.error.length) { message.warning(data.error[0].message); } }.bind(this)).always(function () { this.setState({ loading: false }); this.reloadVCode(); }.bind(this)); }, getInitialState() { return { loading: false, field: [], fileList: [], vsCodeSrc: '' }; }, handleSubmit(e) { this.reloadVCode(); e.preventDefault(); this.props.form.validateFields((err, values) => { if (!this.state.licenceScanningUrl) { message.warning("请上传营业执照副本!"); return; }; if (!this.state.orgCodeUrl) { message.warning("请上传组织机构代码证!"); return; }; if (!this.state.lastYearTaxReportUrl) { message.warning("请上传上年度纳税报表!"); return; }; if (!err) { if (values.listed == 1) { if (!values.listedDate || !values.listedType || !values.stockCode) { message.warning("请输入上市资料!"); return; }; }; this.setState({ loading: true }); $.ajax({ method: "POST", dataType: "json", crossDomain: false, url: globalConfig.context + "/api/user/orgNextPro", data: { firstContacts: values.firstContacts, firstMobile: values.firstMobile, aftUsername: values.aftUsername, unitName: values.unitName, registeredCapital: values.registeredCapital, licenceNumber: values.licenceNumber, licenceProvince: values.address[0], licenceCity: values.address[1], licenceArea: values.address[2], field: values.field ? values.field.join(',') : '', licenceScanningUrl: this.state.licenceScanningUrl, orgCode: values.orgCode, orgCodeUrl: this.state.orgCodeUrl, lastYearTaxReportUrl: this.state.lastYearTaxReportUrl, legalPerson: values.legalPerson, legalPersonIdCard: values.legalPersonIdCard, verificationCode: values.captcha, listed: values.listed, listedDateFormattedDate: values.listedDate ? values.listedDate.format("YYYY-MM-DD") : null, listedType: values.listedType, stockCode: values.stockCode, auditStatus: this.state.auditStatus, process: 1 } }).done(function (data) { if (!data.error.length) { message.success('保存成功!'); this.props.changeStep(2); } else { message.warning(data.error[0].message); this.setState({ loading: false }); } }.bind(this)); }; }); }, checkIdcardnum(rule, value, callback) { if (!/(^\d{15}$)|(^\d{17}(\d|X)$)/.test(value)) { callback('请输入正确的身份证号!'); } else { callback(); } }, checkPhone(rule, value, callback) { const form = this.props.form; const _me = this; if (!(/^1[34578]\d{9}$/.test(value))) { callback('请输入正确的手机号码!'); _me.setState({ getCodeButton: true }); } else { callback(); _me.setState({ getCodeButton: false }); } }, checkNumber(rule, value, callback) { if (!/(^[a-zA-Z0-9]{0,18}$)/.test(value)) { callback('请输入正确的营业执照注册号!'); } else { callback(); } }, getLicenceScanningUrl(e) { this.state.licenceScanningUrl = e; }, getOrgCodeUrl(e) { this.state.orgCodeUrl = e; }, getLastYearTaxReportUrl(e) { this.state.lastYearTaxReportUrl = e; }, componentWillMount() { this.getData(); }, reloadVCode() { this.setState({ vsCodeSrc: globalConfig.context + '/open/getVCode?t=' + Math.random() }); }, render() { const FormItem = Form.Item; const { getFieldDecorator } = this.props.form; const formItemLayout = { labelCol: { span: 6 }, wrapperCol: { span: 12 }, }; const _me = this; return (
建议字母、数字和符号两种以上组合,6-20个字符} > {getFieldDecorator('aftUsername', { initialValue: this.state.aftUsername || null, rules: [{ required: true, message: '请输入用户名!' }] })( )} {getFieldDecorator('unitName', { initialValue: this.state.unitName || null, rules: [{ required: true, message: '请输入企业名称!' }] })( )} {getFieldDecorator('registeredCapital', { initialValue: this.state.registeredCapital || null })( )} 万元 {getFieldDecorator('field', { rules: [{ type: 'array', required: true, message: '此项为必填项!' }], initialValue: this.state.field })( )} {getFieldDecorator('listed', { initialValue: this.state.listed || "0" })( )} {getFieldDecorator('listedDate', { initialValue: this.state.listedDate ? moment(this.state.listedDate) : null })( )} {getFieldDecorator('listedType', { initialValue: this.state.listedType })( )} {getFieldDecorator('stockCode', { initialValue: this.state.stockCode })( )} {getFieldDecorator('firstContacts', { initialValue: this.state.firstContacts || null, rules: [{ required: true, message: '请输入联系人姓名!' }] })( )} 请填写联系人手机号码,我们会将重要进度以短信形式通知您} > {getFieldDecorator('firstMobile', { initialValue: this.state.firstMobile || null, rules: [{ validator: this.checkPhone }] })( )} {getFieldDecorator('legalPerson', { initialValue: this.state.legalPerson || null, rules: [{ required: true, message: '请输入联系人姓名!' }] })( )} {getFieldDecorator('legalPersonIdCard', { rules: [{ validator: this.checkIdcardnum, }], initialValue: this.state.legalPersonIdCard || null })( )} {getFieldDecorator('licenceNumber', { initialValue: this.state.licenceNumber || null, rules: [{ validator: this.checkNumber, }], })( )} {getFieldDecorator('address', { initialValue: this.state.address || null, rules: [{ type: 'array', required: true, message: '请选择地址!' }] })( )} {getFieldDecorator('licenceScanningUrl')( )}

1.企业营业执照副本复印件加盖企业公章后,扫描或拍照上传,图片大小不超过2M以内,仅支持jpg格式。

2.若已办理三证合一,请输入统一社会信用代码并上传营业执照副本复印件(加盖企业公章)。

如机构已五证合一,社会统一注册号的第九位至倒数第二位,即为您单位的组织机构代码证号码。} > {getFieldDecorator('orgCode', { initialValue: this.state.orgCode || null, rules: [{ required: true, message: '请输入组织机构代码证号码!' }] })( )} {getFieldDecorator('orgCodeUrl')( )}

1.组织机构代码证副本复印件加盖企业公章后,扫描或拍照上传,图片大小不超过2M以内,仅支持jpg格式。

2.若已办理三证合一,请输入统一社会信用代码并上传营业执照副本复印件(加盖企业公章)。

{ if (info.file.status !== 'uploading') { console.log(info.file, info.fileList); } if (info.file.status === 'done') { if (!info.file.response.error.length) { message.success(`${info.file.name} 文件上传成功!`); } else { message.warning(info.file.response.error[0].message); return; }; this.state.lastYearTaxReportUrl = info.file.response.data; } else if (info.file.status === 'error') { message.error(`${info.file.name} 文件上传失败。`); }; this.setState({ fileList: info.fileList.slice(-1) }); }} >
看不清?点击图片更换验证码} > {getFieldDecorator('captcha', { rules: [{ required: true, message: '请输入图片中的验证码' }], })( )}
); }, })); export default Content;