expert.jsx 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735
  1. /*
  2. @author:李霆
  3. @update:2018/05/29
  4. @descript:复制粘贴,拿起来就是干!!
  5. */
  6. import React from 'react';
  7. import {
  8. Radio,
  9. Icon,
  10. Button,
  11. Cascader,
  12. Input,
  13. Select,
  14. Spin,
  15. message,
  16. DatePicker,
  17. Modal,
  18. Upload,
  19. Form,
  20. Row,
  21. Col
  22. } from 'antd';
  23. import $ from 'jquery/src/ajax';
  24. import moment from 'moment';
  25. import './unit.less';
  26. import { areaSelect } from '@/NewDicProvinceList';
  27. import { socialAttribute, industry,adviserType } from '@/dataDic.js';
  28. import { splitUrl,getAuthState,getAdviserType } from '@/tools.js';
  29. const FormItem = Form.Item;
  30. const monthFormat = 'YYYY/MM';
  31. //图片组件
  32. const PicturesWall = React.createClass({
  33. getInitialState() {
  34. return {
  35. previewVisible: false,
  36. previewImage: '',
  37. fileList: []
  38. };
  39. },
  40. handleCancel() {
  41. this.setState({
  42. previewVisible: false
  43. });
  44. },
  45. handlePreview(file) {
  46. this.setState({
  47. previewImage: file.url || file.thumbUrl,
  48. previewVisible: true
  49. });
  50. },
  51. handleChange(info) {
  52. let fileList = info.fileList;
  53. this.setState({
  54. fileList
  55. });
  56. this.props.fileList(fileList);
  57. },
  58. componentWillReceiveProps(nextProps) {
  59. this.state.fileList = nextProps.pictureUrl;
  60. },
  61. render() {
  62. const { previewVisible, previewImage, fileList } = this.state;
  63. const uploadButton = (
  64. <div>
  65. <Icon type="plus" />
  66. <div className="ant-upload-text">点击上传</div>
  67. </div>
  68. );
  69. return (
  70. <div style={{ display: 'inline-block' }}>
  71. <Upload
  72. action={globalConfig.context + '/api/user/uploadPicture'}
  73. data={{ sign: 'user_picture' }}
  74. listType="picture-card"
  75. fileList={fileList}
  76. onPreview={this.handlePreview}
  77. onChange={this.handleChange}
  78. >
  79. {fileList.length >= 1 ? null : uploadButton}
  80. </Upload>
  81. <Modal maskClosable={false} visible={previewVisible} footer={null} onCancel={this.handleCancel}>
  82. <img alt="example" style={{ width: '100%' }} src={previewImage} />
  83. </Modal>
  84. </div>
  85. );
  86. }
  87. });
  88. const Expert = React.createClass({
  89. getInitialState() {
  90. return {
  91. loading: false,
  92. orgCodeUrl: [],
  93. companyLogoUrl: [],
  94. headPortraitUrl: [],
  95. adviserUrl:[],
  96. positiveIdUrl: [],
  97. oppositeIdUrl: [],
  98. authenticationState:undefined
  99. };
  100. },
  101. loadInformation(record) {
  102. this.setState({
  103. loading: true
  104. });
  105. $.ajax({
  106. method: 'get',
  107. dataType: 'json',
  108. crossDomain: false,
  109. url: globalConfig.context + '/api/user/getUserDetail',
  110. success: function(data) {
  111. let thisData = data.data;
  112. if (!thisData) {
  113. if (data.error && data.error.length) {
  114. message.warning(data.error[0].message);
  115. }
  116. thisData = {};
  117. }
  118. let ProvinceCityArr = [];
  119. let ProvinceS = thisData.province; //getprovince
  120. let citys = thisData.city;
  121. let Areas = thisData.area;
  122. ProvinceCityArr.push(ProvinceS, citys, Areas);
  123. let month = thisData.dateOfBirthYear
  124. ? thisData.dateOfBirthYear + '/' + thisData.dateOfBirthMonth
  125. : undefined;
  126. let authenticationState='';
  127. if(thisData.auditStatus=='3'){
  128. authenticationState=(thisData.expert-1).toString()
  129. }
  130. console.log(authenticationState)
  131. this.setState({
  132. InformationId: thisData.id,
  133. InformationUid: thisData.uid,
  134. authentication:thisData.authentication,
  135. authenticationState:authenticationState,
  136. dateOfBirthYear:thisData.dateOfBirthYear,
  137. dateOfBirthMonth:thisData.dateOfBirthMonth,
  138. type:thisData.type, //0-个人认证 1-企业认证
  139. expert:thisData.expert, //认证类型 0-未认证专家顾问 1-专家认证 2-顾问认证
  140. authMessage:thisData.auditInfo,
  141. auditStatus:thisData.auditStatus||'0', //认证状态 0-未认证 1-认证审核中 2-已认证 3-认证失败
  142. headPortraitUrl: thisData.headPortraitUrl //专家照片
  143. ? splitUrl(thisData.headPortraitUrl, ',', globalConfig.avatarHost + '/upload')
  144. : [],
  145. adviserUrl: thisData.adviserUrl //顾问照片
  146. ? splitUrl(thisData.adviserUrl, ',', globalConfig.avatarHost + '/upload')
  147. : [],
  148. positiveIdUrl: thisData.positiveIdUrl
  149. ? splitUrl(thisData.positiveIdUrl, ',', globalConfig.avatarHost + '/upload')
  150. : [],
  151. oppositeIdUrl: thisData.oppositeIdUrl
  152. ? splitUrl(thisData.oppositeIdUrl, ',', globalConfig.avatarHost + '/upload')
  153. : [],
  154. data: thisData,
  155. ProvinceCity: ProvinceCityArr[0] != null ? ProvinceCityArr : undefined,
  156. yearMonth: month,
  157. workUnit:thisData.workUnit||'',
  158. graduateSchool: thisData.graduateSchool||'',
  159. professionalTitle: thisData.professionalTitle||'',
  160. qualification: thisData.qualification||'',
  161. majorCategory: thisData.majorCategory||'',
  162. adviserType: thisData.consultantType||'',
  163. headPortraitUrlCopy: thisData.headPortraitUrl,
  164. adviserUrlCopy: thisData.adviserUrl,
  165. positiveIdUrlCopy: thisData.positiveIdUrl,
  166. oppositeIdUrlCopy:thisData.oppositeIdUrl
  167. });
  168. }.bind(this)
  169. }).always(
  170. function() {
  171. this.setState({
  172. loading: false
  173. });
  174. }.bind(this)
  175. );
  176. },
  177. //图片
  178. getOrgCodeUrl(e) {
  179. this.setState({
  180. orgCodeUrl: e
  181. });
  182. },
  183. getCompanyLogoUrl(e) {
  184. this.setState({
  185. companyLogoUrl: e
  186. });
  187. },
  188. //基本信息提交
  189. newSubmit(values={}){
  190. this.state.data = [];
  191. let theorgCodeUrl = [];
  192. if (this.state.headPortraitUrl.length) {
  193. let picArr = [];
  194. this.state.headPortraitUrl.map(function(item) {
  195. if (item.response && item.response.data && item.response.data.length) {
  196. picArr.push(item.response.data);
  197. }
  198. });
  199. theorgCodeUrl = picArr.join(',');
  200. }
  201. let thecompanyLogoUrl = [];
  202. if (this.state.positiveIdUrl.length) {
  203. let picArr = [];
  204. this.state.positiveIdUrl.map(function(item) {
  205. if (item.response && item.response.data && item.response.data.length) {
  206. picArr.push(item.response.data);
  207. }
  208. });
  209. thecompanyLogoUrl = picArr.join(',');
  210. }
  211. let thecompanyLogoUrls = [];
  212. if (this.state.oppositeIdUrl.length) {
  213. let picArr = [];
  214. this.state.oppositeIdUrl.map(function(item) {
  215. if (item.response && item.response.data && item.response.data.length) {
  216. picArr.push(item.response.data);
  217. }
  218. });
  219. thecompanyLogoUrls = picArr.join(',');
  220. }
  221. let years = [];
  222. years = this.state.yearList!=undefined?(this.state.yearList).split('/'):[this.state.dateOfBirthYear,this.state.dateOfBirthMonth];
  223. this.setState({
  224. loading: true
  225. });
  226. let dataList={};
  227. dataList={
  228. id: this.state.InformationId,
  229. uid: this.state.InformationUid,
  230. type:this.state.type,
  231. societyTag: values.societyTag,
  232. identifyName: values.identifyName,
  233. industry: values.industry,
  234. dateOfBirthYear: years[0]||'', //出生年
  235. dateOfBirthMonth: years[1]||'', //出生月
  236. province: (values.ProvinceCity)[0], //省-
  237. city:(values.ProvinceCity)[1], //市
  238. area:(values.ProvinceCity)[2], //区
  239. sex: values.sex,
  240. expert:'0',
  241. authentication:this.state.authentication,
  242. mobile: values.mobile,
  243. fixedTel: values.fixedTel,
  244. qq: values.qq,
  245. idNumber: values.idNumber,
  246. email: values.email,
  247. postalAddress: values.postalAddress,
  248. introduction: values.introduction,
  249. auditStatus:this.state.auditStatus||'0',
  250. }
  251. if(this.state.authenticationState=='0'){
  252. dataList.expert='1',
  253. dataList.workUnit=values.workUnit;
  254. dataList.professionalTitle=values.professionalTitle;
  255. dataList.qualification=values.qualification;
  256. dataList.majorCategory=values.majorCategory;
  257. dataList.graduateSchool=values.graduateSchool;
  258. dataList.headPortraitUrl=theorgCodeUrl.length != 0 ? theorgCodeUrl : '';
  259. dataList.positiveIdUrl=thecompanyLogoUrl.length != 0 ? thecompanyLogoUrl : '';
  260. dataList.oppositeIdUrl=thecompanyLogoUrls.length != 0 ? thecompanyLogoUrls : '';
  261. }else if(this.state.authenticationState=='1'){
  262. dataList.expert='2';
  263. dataList.consultantType=values.adviserType;//顾问类型
  264. dataList.headPortraitUrl=theorgCodeUrl.length != 0 ? theorgCodeUrl : ''; //顾问照片
  265. dataList.positiveIdUrl=thecompanyLogoUrl.length != 0 ? thecompanyLogoUrl : '';
  266. dataList.oppositeIdUrl=thecompanyLogoUrls.length != 0 ? thecompanyLogoUrls : '';
  267. }
  268. $.ajax({
  269. method: 'post',
  270. dataType: 'json',
  271. url: globalConfig.context + '/api/user/updateUserDetail',
  272. data:dataList,
  273. }).done(
  274. function(data) {
  275. this.setState({
  276. loading: false
  277. });
  278. if (!data.error.length) {
  279. //认证状态判定说明
  280. if(this.state.authentication){
  281. message.success((this.state.auditStatus=='0'||this.state.auditStatus=='3')&&(this.state.headPortraitUrl).length?'认证审核提交成功,请耐心等待。':'保存成功')
  282. }else{
  283. message.success('个人认证成功,2秒后跳转个人中心首页。')
  284. setTimeout(()=>{
  285. window.location.href= globalConfig.context+'/user/account/index.html'
  286. },2000)
  287. }
  288. this.loadInformation();
  289. } else {
  290. message.warning(data.error[0].message);
  291. }
  292. }.bind(this)
  293. );
  294. },
  295. subFun(e) {
  296. e.preventDefault();
  297. this.props.form.validateFields((err, values) => {
  298. if(!err){
  299. if(this.state.authenticationState==undefined||this.state.authentication=='0'){
  300. if(!this.state.authentication&&(this.state.auditStatus=='0'||this.state.auditStatus=='3'||!this.state.auditStatus)){
  301. this.setState({
  302. visible: true,
  303. values :values
  304. });
  305. }else{
  306. this.newSubmit(values)
  307. }
  308. }else{
  309. if(this.state.authenticationState=='0'||this.state.authenticationState=='1'){
  310. if(!(this.state.headPortraitUrl.length)){
  311. message.warning(this.state.authenticationState?'请上传顾问照片!':'请上传专家照片');
  312. return;
  313. }
  314. if(!(this.state.oppositeIdUrl.length)||!(this.state.positiveIdUrl.length)){
  315. message.warning('请上传您的身份证正反照片!');
  316. return;
  317. }
  318. this.setState({
  319. visible: true,
  320. values :values
  321. });
  322. }else{
  323. this.newSubmit(values)
  324. }
  325. }
  326. }
  327. })
  328. },
  329. handleOk() {
  330. this.newSubmit(this.state.values);
  331. this.setState({
  332. visible: false
  333. });
  334. },
  335. handleCancel() {
  336. this.setState({
  337. visible: false
  338. });
  339. },
  340. getHeadPortraitUrl(e) {
  341. this.setState({ headPortraitUrl: e });
  342. },
  343. getPositiveIdUrl(e) {
  344. this.setState({ positiveIdUrl: e });
  345. },
  346. getOppositeIdUrl(e) {
  347. this.setState({ oppositeIdUrl: e });
  348. },
  349. componentWillMount() {
  350. this.loadInformation();
  351. },
  352. componentWillReceiveProps(nextProps) {},
  353. render() {
  354. const { getFieldDecorator } = this.props.form;
  355. const { MonthPicker } = DatePicker;
  356. const formItemLayout = {
  357. labelCol: {
  358. span: 6
  359. },
  360. wrapperCol: {
  361. span: 14
  362. }
  363. };
  364. console.log(this.state.authenticationState)
  365. const theData = this.state.data || [];
  366. return (
  367. <div className="unit-wrap">
  368. <Form layout="horizontal" onSubmit={this.subFun} id="demand-form" style={{ width: '80%' }}>
  369. <Spin spinning={this.state.loading}>
  370. <Row style={{ marginBottom: 20 }}>
  371. <Col offset={2} span={4}>
  372. <h4 style={{ fontSize: 20 }}>个人资料</h4>
  373. </Col>
  374. </Row>
  375. <div className="clearfix">
  376. <FormItem className="half-item" {...formItemLayout} label="姓名">
  377. {getFieldDecorator('identifyName', {
  378. rules: [ { required: true, message: '此项为必填项!' } ],
  379. initialValue: theData.identifyName
  380. })(<Input placeholder="输入姓名" maxLength={128}/>)}
  381. </FormItem>
  382. <FormItem className="half-item" {...formItemLayout} label="行业">
  383. {getFieldDecorator('industry', {
  384. rules: [ { required: true, message: '此项为必填项!' } ],
  385. initialValue: theData.industry?theData.industry.toString():undefined
  386. })(
  387. <Select placeholder="选择行业">
  388. {industry.map(function(item) {
  389. return <Select.Option key={item.value}>{item.key}</Select.Option>;
  390. })}
  391. </Select>
  392. )}
  393. </FormItem>
  394. <FormItem className="half-item" {...formItemLayout} label="社会属性">
  395. {getFieldDecorator('societyTag', {
  396. rules: [ { required: true, message: '此项为必填项!' } ],
  397. initialValue: theData.societyTag
  398. })(
  399. <Select placeholder="客户社会属性">
  400. {socialAttribute.map(function(item) {
  401. return <Select.Option key={item.value}>{item.key}</Select.Option>;
  402. })}
  403. </Select>
  404. )}
  405. </FormItem>
  406. <FormItem className="half-item" {...formItemLayout} label="性别">
  407. {getFieldDecorator('sex', {
  408. initialValue: theData.sex
  409. })(
  410. <Radio.Group>
  411. <Radio value={'男'}>男</Radio>
  412. <Radio value={'女'}>女</Radio>
  413. </Radio.Group>
  414. )}
  415. </FormItem>
  416. <FormItem className="half-item" {...formItemLayout} label="出生日期">
  417. <MonthPicker
  418. value={this.state.yearMonth?moment(this.state.yearMonth, monthFormat):undefined}
  419. format={monthFormat}
  420. onChange={(time,times) => {
  421. this.setState({ yearMonth: time,yearList:times });
  422. }}
  423. />
  424. </FormItem>
  425. <FormItem className="half-item" {...formItemLayout} label="身份证号码">
  426. {getFieldDecorator('idNumber', {
  427. initialValue: theData.idNumber
  428. })(<Input placeholder="身份证号码" maxLength={20}/>)}
  429. </FormItem>
  430. </div>
  431. <div className="clearfix">
  432. <FormItem className="half-item" {...formItemLayout} label="省-市-区">
  433. {getFieldDecorator('ProvinceCity', {
  434. rules: [ { required: true, message: '此项为必填项!' } ],
  435. initialValue: this.state.ProvinceCity
  436. })(<Cascader options={areaSelect()} placeholder="选择城市" />)}
  437. </FormItem>
  438. <FormItem className="half-item" {...formItemLayout} label="通信地址">
  439. {getFieldDecorator('postalAddress', {
  440. initialValue: theData.postalAddress
  441. })(<Input placeholder="输入通信地址" maxLength={255}/>)}
  442. </FormItem>
  443. <FormItem className="half-item" {...formItemLayout} label="手机号码">
  444. {getFieldDecorator('mobile', {
  445. rules: [ { required: true, message: '此项为必填项!' } ],
  446. initialValue: theData.mobile
  447. })(<Input placeholder="输入手机号码" maxLength={16}/>)}
  448. </FormItem>
  449. <FormItem className="half-item" {...formItemLayout} label="固定电话">
  450. {getFieldDecorator('fixedTel', {
  451. initialValue: theData.fixedTel
  452. })(<Input placeholder="输入固定电话" maxLength={13}/>)}
  453. </FormItem>
  454. <FormItem className="half-item" {...formItemLayout} label="QQ">
  455. {getFieldDecorator('qq', {
  456. initialValue: theData.qq
  457. })(<Input placeholder="输入qq" maxLength={16}/>)}
  458. </FormItem>
  459. <FormItem className="half-item" {...formItemLayout} label="电子邮箱">
  460. {getFieldDecorator('email', {
  461. initialValue: theData.email
  462. })(<Input placeholder="输入电子邮箱" maxLength={128}/>)}
  463. </FormItem>
  464. </div>
  465. <div className="clearfix">
  466. <FormItem
  467. labelCol={{ span: 3 }}
  468. wrapperCol={{ span: 18 }}
  469. label="个人简介"
  470. >
  471. {getFieldDecorator('introduction', {
  472. initialValue: theData.introduction
  473. })(<Input type="textarea" rows={4} maxLength={512} placeholder="输入个人简介"/>)}
  474. </FormItem>
  475. </div>
  476. {(this.state.expert=='0'||this.state.auditStatus=='3'||this.state.expert==null)&&this.state.type!=null?
  477. <div>
  478. <div className="clearfix btnGrounp">
  479. <Radio.Group
  480. value={this.state.authenticationState}
  481. onChange={(e)=>{this.setState({
  482. authenticationState:e.target.value
  483. })}}>
  484. <Radio.Button value="0">专家认证</Radio.Button>
  485. <Radio.Button value="1">顾问认证</Radio.Button>
  486. </Radio.Group>
  487. <Button type="dashed" style={{marginLeft:20}} onClick={(e)=>{this.setState({authenticationState:undefined})}}>暂不认证</Button>
  488. <span style={{marginLeft:10,color:'#f00'}}>{this.state.auditStatus=='3'?"(认证失败:"+this.state.authMessage+')':''}</span>
  489. </div>
  490. {this.state.authenticationState=='0'?<div className="patentBody">
  491. <FormItem className="half-item" {...formItemLayout} label="毕业院校">
  492. {getFieldDecorator('graduateSchool', {
  493. initialValue: theData.graduateSchool,
  494. rules: [ { required: true, message: '此项为必填项!' } ],
  495. })(<Input placeholder="输入毕业院校全称" maxLength={32}/>)}
  496. </FormItem>
  497. <FormItem className="half-item" {...formItemLayout} label="专业类别">
  498. {getFieldDecorator('majorCategory', {
  499. initialValue: theData.majorCategory,
  500. rules: [ { required: true, message: '此项为必填项!' } ],
  501. })(<Input placeholder="输入专业" maxLength={16}/>)}
  502. </FormItem>
  503. <FormItem className="half-item" {...formItemLayout} label="职业资格">
  504. {getFieldDecorator('qualification', {
  505. initialValue: theData.qualification,
  506. rules: [ { required: true, message: '此项为必填项!' } ],
  507. })(<Input placeholder="输入职业资格" maxLength={32} />)}
  508. </FormItem>
  509. <FormItem className="half-item" {...formItemLayout} label="就职单位">
  510. {getFieldDecorator('workUnit', {
  511. initialValue: theData.workUnit,
  512. rules: [ { required: true, message: '此项为必填项!' } ],
  513. })(<Input placeholder="输入就职单位全称" maxLength={64}/>)}
  514. </FormItem>
  515. <FormItem className="half-item" {...formItemLayout} label="职称">
  516. {getFieldDecorator('professionalTitle', {
  517. initialValue: theData.professionalTitle,
  518. rules: [ { required: true, message: '此项为必填项!' } ],
  519. })(<Input placeholder="输入职称" maxLength={32}/>)}
  520. </FormItem>
  521. </div>:this.state.authenticationState=='1'?
  522. <div>
  523. <FormItem className="half-item" {...formItemLayout} label="顾问类型">
  524. {getFieldDecorator('adviserType', {
  525. rules: [ { required: true, message: '此项为必填项!' } ],
  526. initialValue: theData.consultantType=='0'?theData.consultantType.toString():undefined
  527. })(
  528. <Select placeholder="选择类型">
  529. {adviserType.map(function(item) {
  530. return <Select.Option key={item.value}>{item.key}</Select.Option>;
  531. })}
  532. </Select>
  533. )}
  534. </FormItem>
  535. </div>:''}
  536. {this.state.authenticationState=='1'||this.state.authenticationState=='0'?<div className="clearfix pictures">
  537. <div className="clearfix">
  538. <FormItem
  539. className="picWidth"
  540. labelCol={{ span: 9 }}
  541. wrapperCol={{ span: 10 }}
  542. label={<span><strong style={{color:"#f00"}}>*</strong><span>{this.state.authenticationState=='0'?'专家照片':'顾问照片'}</span></span> }
  543. >
  544. <PicturesWall
  545. fileList={this.getHeadPortraitUrl}
  546. pictureUrl={this.state.headPortraitUrl}
  547. />
  548. <p>建议:图片要清晰1。</p>
  549. </FormItem>
  550. </div>
  551. <FormItem
  552. className="picWidth"
  553. labelCol={{ span: 9 }}
  554. wrapperCol={{ span: 10 }}
  555. label={<span ><strong style={{color:"#f00"}}>*</strong><span>身份证正面</span></span> }
  556. >
  557. <PicturesWall fileList={this.getPositiveIdUrl} pictureUrl={this.state.positiveIdUrl} />
  558. <p>建议:图片要清晰。</p>
  559. </FormItem>
  560. <FormItem
  561. className="picWidth"
  562. labelCol={{ span: 9 }}
  563. wrapperCol={{ span: 10 }}
  564. label={<span><strong style={{color:"#f00"}}>*</strong><span>身份证反面</span></span> }
  565. >
  566. <PicturesWall fileList={this.getOppositeIdUrl} pictureUrl={this.state.oppositeIdUrl} />
  567. <p>建议:图片要清晰。</p>
  568. </FormItem>
  569. </div>:''}
  570. </div>:(this.state.auditStatus=='2'||this.state.auditStatus=='1')&&this.state.expert=='1'?
  571. <div>
  572. <div className="authState">专家认证<span>({getAuthState(this.state.auditStatus)})</span></div>
  573. <FormItem className="half-item" {...formItemLayout} label="毕业院校">
  574. <span>{theData.graduateSchool}</span>
  575. </FormItem>
  576. <FormItem className="half-item" {...formItemLayout} label="专业类别">
  577. <span>{theData.majorCategory}</span>
  578. </FormItem>
  579. <FormItem className="half-item" {...formItemLayout} label="职业资格">
  580. <span>{theData.qualification}</span>
  581. </FormItem>
  582. <FormItem className="half-item" {...formItemLayout} label="就职单位">
  583. <span>{theData.workUnit}</span>
  584. </FormItem>
  585. <FormItem className="half-item" {...formItemLayout} label="职称">
  586. <span>{theData.professionalTitle}</span>
  587. </FormItem>
  588. <div className="clearfix">
  589. <FormItem labelCol={{ span: 3 }} wrapperCol={{ span: 13 }} label="专家照片">
  590. <Upload className="demandDetailShow-upload"
  591. listType="picture-card"
  592. fileList={this.state.headPortraitUrl}
  593. onPreview={(file) => {
  594. this.setState({
  595. previewImage: file.url || file.thumbUrl,
  596. previewVisible: true,
  597. });
  598. }} >
  599. </Upload>
  600. <Modal maskClosable={false} footer={null}
  601. visible={this.state.previewVisible}
  602. onCancel={() => { this.setState({ previewVisible: false }) }}>
  603. <img alt="" style={{ width: '100%' }} src={this.state.previewImage || ''} />
  604. </Modal>
  605. </FormItem>
  606. </div>
  607. <FormItem className="picWidth" labelCol={{ span: 9 }} wrapperCol={{ span: 10 }} label="身份证正面">
  608. <div className="clearfix">
  609. <Upload className="demandDetailShow-upload"
  610. listType="picture-card"
  611. fileList={this.state.positiveIdUrl}
  612. onPreview={(file) => {
  613. this.setState({
  614. previewImage: file.url || file.thumbUrl,
  615. previewVisible: true,
  616. });
  617. }} >
  618. </Upload>
  619. <Modal maskClosable={false} footer={null}
  620. visible={this.state.previewVisible}
  621. onCancel={() => { this.setState({ previewVisible: false }) }}>
  622. <img alt="" style={{ width: '100%' }} src={this.state.previewImage || ''} />
  623. </Modal>
  624. </div>
  625. </FormItem>
  626. <FormItem className="picWidth" labelCol={{ span:9 }} wrapperCol={{ span: 10 }} label="身份证反面">
  627. <div className="clearfix">
  628. <Upload className="demandDetailShow-upload"
  629. listType="picture-card"
  630. fileList={this.state.oppositeIdUrl}
  631. onPreview={(file) => {
  632. this.setState({
  633. previewImage: file.url || file.thumbUrl,
  634. previewVisible: true,
  635. });
  636. }} >
  637. </Upload>
  638. <Modal maskClosable={false} footer={null}
  639. visible={this.state.previewVisible}
  640. onCancel={() => { this.setState({ previewVisible: false }) }}>
  641. <img alt="" style={{ width: '100%' }} src={this.state.previewImage || ''} />
  642. </Modal>
  643. </div>
  644. </FormItem>
  645. </div>:(this.state.auditStatus=='2'||this.state.auditStatus=='1')&&this.state.expert=='2'?
  646. <div className="clearfix">
  647. <div className="authState">顾问认证<span>({getAuthState(this.state.auditStatus)})</span></div>
  648. <FormItem className="half-item" {...formItemLayout} label="顾问类型">
  649. <span>{getAdviserType(theData.consultantType)}</span>
  650. </FormItem>
  651. <div className="clearfix">
  652. <FormItem labelCol={{ span: 3 }} wrapperCol={{ span: 13 }} label="顾问照片">
  653. <Upload className="demandDetailShow-upload"
  654. listType="picture-card"
  655. fileList={this.state.headPortraitUrl}
  656. onPreview={(file) => {
  657. this.setState({
  658. previewImage: file.url || file.thumbUrl,
  659. previewVisible: true,
  660. });
  661. }} >
  662. </Upload>
  663. <Modal maskClosable={false} footer={null}
  664. visible={this.state.previewVisible}
  665. onCancel={() => { this.setState({ previewVisible: false }) }}>
  666. <img alt="" style={{ width: '100%' }} src={this.state.previewImage || ''} />
  667. </Modal>
  668. </FormItem>
  669. </div>
  670. <div>
  671. <FormItem className="picWidth" labelCol={{ span: 9 }} wrapperCol={{ span: 10 }} label="身份证正面">
  672. <div className="clearfix">
  673. <Upload className="demandDetailShow-upload"
  674. listType="picture-card"
  675. fileList={this.state.positiveIdUrl}
  676. onPreview={(file) => {
  677. this.setState({
  678. previewImage: file.url || file.thumbUrl,
  679. previewVisible: true,
  680. });
  681. }} >
  682. </Upload>
  683. <Modal maskClosable={false} footer={null}
  684. visible={this.state.previewVisible}
  685. onCancel={() => { this.setState({ previewVisible: false }) }}>
  686. <img alt="" style={{ width: '100%' }} src={this.state.previewImage || ''} />
  687. </Modal>
  688. </div>
  689. </FormItem>
  690. <FormItem className="picWidth" labelCol={{ span:9 }} wrapperCol={{ span: 10 }} label="身份证反面">
  691. <div className="clearfix">
  692. <Upload className="demandDetailShow-upload"
  693. listType="picture-card"
  694. fileList={this.state.oppositeIdUrl}
  695. onPreview={(file) => {
  696. this.setState({
  697. previewImage: file.url || file.thumbUrl,
  698. previewVisible: true,
  699. });
  700. }} >
  701. </Upload>
  702. <Modal maskClosable={false} footer={null}
  703. visible={this.state.previewVisible}
  704. onCancel={() => { this.setState({ previewVisible: false }) }}>
  705. <img alt="" style={{ width: '100%' }} src={this.state.previewImage || ''} />
  706. </Modal>
  707. </div>
  708. </FormItem>
  709. </div>
  710. </div>:''}
  711. <div className="clearfix">
  712. <Row style={{ marginBottom: 20 }} >
  713. <Col offset={3} span={4}>
  714. <Button size="large" className="set-submit" type="primary" htmlType="submit">
  715. 保存
  716. </Button>
  717. </Col>
  718. </Row>
  719. </div>
  720. </Spin>
  721. </Form>
  722. <Modal visible={this.state.visible} onOk={this.handleOk} onCancel={this.handleCancel}>
  723. {this.state.authenticationState=='0'&&<p>是否申请专家认证?注意:认证成功后,您的信息将在本平台展示。</p>}
  724. {this.state.authenticationState=='1'&&<p>是否申请顾问认证?注意:认证成功后,您的信息将在本平台展示。</p>}
  725. {!this.state.authentication?<p>是否申请个人认证?</p>:''}
  726. </Modal>
  727. </div>
  728. );
  729. }
  730. });
  731. export default Form.create()(Expert);