expert.jsx 27 KB

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