import React from 'react'; import { Input, Button, Form, Select, Upload, Icon, Spin, message, Radio, InputNumber } from 'antd'; import './pfs.less'; import ajax from 'jquery/src/ajax/xhr.js' import $ from 'jquery/src/ajax'; import YearSelect from '../../yearSelect.jsx'; const FormItem = Form.Item; const RadioButton = Radio.Button; const RadioGroup = Radio.Group; const jingli_yuanxiao = 'XXX年获得博士学位,师从XXX名师;\nXXX年入职厦门大学,XXX年获评教授职称;\nXXX年成为厦门大学材料学院副院长;\n曾担任XXX届人大代表;\n曾担任XXX名企的科研顾问;\n从事科研研究8年,累计发表论文xxx篇,获得专利xx项。'; const jingli_shehui = 'XXX年毕业于XXX名校,获得XXX学位;\nXXX年就职于XXX企业,担任XXX岗位;\nXXX年创办XXX企业或机构;\n曾担任XXX届人大代表。'; const chengjiu_yuanxiao = '案例1:XXX年,主持(参与)XXX重大科研项目,该项目在XXX领域取了xxx成果,获得了xxx奖项。(纵向科研课题)\n案例2:XXX年,因为在xxx方面的科研成就,获得了xxx奖项。(科研奖项)\n案例3:XXX年,获得了XXX专利,该专利具有xxx价值。(专利,重点展现最核心最有价值的专利即可)\n案例4:XXX年,在XXX核心刊物上发表XXX论文,在XXX方面的研究上取得突破性成就。(科研成果,体现最有核心价值的即可)\n案例5:XXX年,与XXX企业合作进行XXX项目的研究,该项目投产后,实现了xxx的经济效益。(横向科研课题)\n案例6:XXX年,因xxx项目,获得厦门双百人才计划项目支持,该项目于XXX年正式投产,取得XXX经济效益。(技术创业)\n案例7:XXX年,担任xxx企业的技术总监,主持研发了XXX项目,该项目获得了xxx成就(经济效益、社会效益等)。(企业成就)'; const chengjiu_shehui = '案例1:XXX年,担任xxx企业的XXX岗位,在该岗位上实现了XXX业绩。(职业经理人成就)\n案例2:XXX年,因xxx项目,获得厦门双百人才计划项目支持,该项目于XXX年正式投产,取得xxx经济效益或社会效益。(重大人才项目成就)\n案例3:XXX年,创办了XXX企业,该企业取得了xxx成就(经济效益、社会效益等)。(创业成就)\n案例4:XXX年,因为在xxx方面成就,被评为xxx风云人物。(社会荣誉成就)\n案例5:XXX年,曾主持xxx国家课题项目,该项目取得xxx成果。(重大课题成就)\n案例6:从业xxx年以来,为xxx企业提供过各类管理咨询和政策指导服务,其中,为xxx家企业服务,帮助其实现xxx效果。(服务类成就)' function getBase64(img, callback) { const reader = new FileReader(); reader.addEventListener('load', () => callback(reader.result)); reader.readAsDataURL(img); }; function beforeUpload(file) { const isJPG = file.type === 'image/jpeg'; if (!isJPG) { message.error('You can only upload JPG file!'); } const isLt2M = file.size / 1024 / 1024 < 2; if (!isLt2M) { message.error('Image must smaller than 2MB!'); } return isJPG && isLt2M; }; 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 PfsFrom = Form.create()(React.createClass({ getData() { this.props.spinState(true); $.ajax({ method: "get", dataType: "json", url: globalConfig.context + "/api/user/job", success: function (data) { if (data.data) { this.setState({ lingyu: data.data.engagedField, gongling: data.data.workingAge, zhichengname: data.data.professionalTitle, zhichengyear: data.data.professionalTitleGettime, zhichengPicUrl: data.data.professionalCertificateUrl, zigename: data.data.qualification, zigeyear: data.data.qualificationGettime, zigePicUrl: data.data.qualificationCertificateUrl, danwei: data.data.workUnit, touxian: data.data.position, jingli: data.data.experiences, chengjiu: data.data.achievement }); }; }.bind(this), }).always(function () { this.props.spinState(false); }.bind(this)); }, getInitialState() { return { loading: false, }; }, componentWillMount() { this.getData(); }, handleSubmit(e) { e.preventDefault(); this.props.form.validateFields((err, values) => { if (!err) { this.props.spinState(true); $.ajax({ method: "POST", dataType: "json", crossDomain: false, url: globalConfig.context + "/api/user/userCareer", data: { "engagedField": values.lingyu, "workingAge": values.gongling, "professionalTitle": values.zhichengname, "professionalTitleGettime": this.state.zhichengyear, "professionalCertificateUrl": this.state.zhichengPicUrl, "qualification": values.zigename, "qualificationGettime": this.state.zigeyear, "qualificationCertificateUrl": this.state.zigePicUrl, "workUnit": values.danwei, "position": values.touxia, "experiences": values.jingli, "achievement": values.chengjiu } }).done(function (data) { if (!data.error.length) { message.success('保存成功!'); } else { message.warning(data.error[0].message); } }.bind(this)).always(function () { this.props.spinState(false); }.bind(this)); } }); }, zhichengPic(e) { this.state.zhichengPicUrl = e; }, zhichengyear(e) { this.state.zhichengyear = e; }, zigePic(e) { this.state.zigePicUrl = e; }, zigeyear(e) { this.state.zigeyear = e; }, jingliChange(e) { if (e.target.value == "a") { this.props.form.setFieldsValue({ 'jingli': "" }) } else if (e.target.value == "b") { this.props.form.setFieldsValue({ 'jingli': jingli_yuanxiao }) } else if (e.target.value == "c") { this.props.form.setFieldsValue({ 'jingli': jingli_shehui }) } }, chengjiuChange(e) { if (e.target.value == "a") { this.props.form.setFieldsValue({ 'chengjiu': "" }) } else if (e.target.value == "b") { this.props.form.setFieldsValue({ 'chengjiu': chengjiu_yuanxiao }) } else if (e.target.value == "c") { this.props.form.setFieldsValue({ 'chengjiu': chengjiu_shehui }) } }, downloadPic(type) { $.ajax({ method: "post", dataType: "json", url: globalConfig.context + "/open/downLoadPicture", data:{ path:type , isPrivate: true }, success: function (data) { }.bind(this), }); }, render() { const { getFieldDecorator } = this.props.form; const formItemLayout = { labelCol: { span: 3 }, wrapperCol: { span: 12 }, }; const _me = this; return (
{getFieldDecorator('lingyu', { initialValue: this.state.lingyu || null })( )} {getFieldDecorator('gongling', { initialValue: this.state.gongling })( )} {getFieldDecorator('zhichengname', { initialValue: this.state.zhichengname || null })( )} {getFieldDecorator('zhichengyear')( )} {getFieldDecorator('zhichengPic')( )}

要求2M 以下的jpg、jpeg格式的图片。该资料不会公开展示,仅作为审核材料使用。

{this.state.zhichengPicUrl !== "" ? : ""}

{getFieldDecorator('zigename', { initialValue: this.state.zigename })( )} {getFieldDecorator('zigeyear')( )} {getFieldDecorator('zigePic')( )}

要求2M 以下的jpg、jpeg格式的图片。该资料不会公开展示,仅作为审核材料使用。

{this.state.zigePicUrl !== "" ? : ""}

{getFieldDecorator('danwei', { initialValue: this.state.danwei || null })( )} {getFieldDecorator('touxian', { initialValue: this.state.touxian || null })( )}
从业经历 自定义 院校专家模板 企业或社会专家模板

您可使用模板直接编辑调整!

还可输入{ (() => { if (_me.props.form.getFieldValue('jingli') && _me.props.form.getFieldValue('jingli').length) { return 1000 - _me.props.form.getFieldValue('jingli').length; } else { return 1000; } })() }字/1000

描述您主要的从业履历,包括职业,最有亮点的社会兼职。可自定义或选择模板后直接编辑

} label="" > {getFieldDecorator('jingli', { initialValue: this.state.jingli || null })( )}
从业经历 自定义 院校专家模板 企业或社会专家模板

您可使用模板直接编辑调整!

还可输入{ (() => { if (_me.props.form.getFieldValue('chengjiu') && _me.props.form.getFieldValue('chengjiu').length) { return 1000 - _me.props.form.getFieldValue('chengjiu').length; } else { return 1000; } })() }字/1000

描述您主要的从业履历,包括职业,最有亮点的社会兼职。可自定义或选择模板后直接编辑

} label="" > {getFieldDecorator('chengjiu', { initialValue: this.state.chengjiu || null })( )}
); }, })); const Pfs = React.createClass({ getInitialState() { return { loading: false }; }, spinChange(e) { this.setState({ loading: e }); }, render() { return (

职业信息

) } }); export default Pfs;