expert.jsx 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729
  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+''
  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('个人认证成功。')
  283. }
  284. this.loadInformation();
  285. } else {
  286. message.warning(data.error[0].message);
  287. }
  288. }.bind(this)
  289. );
  290. },
  291. subFun(e) {
  292. e.preventDefault();
  293. this.props.form.validateFields((err, values) => {
  294. if(!err){
  295. if(this.state.authenticationState==undefined||this.state.authentication=='0'){
  296. if(!this.state.authentication&&(this.state.auditStatus=='0'||this.state.auditStatus=='3'||!this.state.auditStatus)){
  297. this.setState({
  298. visible: true,
  299. values :values
  300. });
  301. }else{
  302. this.newSubmit(values)
  303. }
  304. }else{
  305. if(this.state.authenticationState=='0'||this.state.authenticationState=='1'){
  306. if(!(this.state.headPortraitUrl.length)){
  307. message.warning(this.state.authenticationState?'请上传顾问照片!':'请上传专家照片');
  308. return;
  309. }
  310. if(!(this.state.oppositeIdUrl.length)||!(this.state.positiveIdUrl.length)){
  311. message.warning('请上传您的身份证正反照片!');
  312. return;
  313. }
  314. this.setState({
  315. visible: true,
  316. values :values
  317. });
  318. }else{
  319. this.newSubmit(values)
  320. }
  321. }
  322. }
  323. })
  324. },
  325. handleOk() {
  326. this.newSubmit(this.state.values);
  327. this.setState({
  328. visible: false
  329. });
  330. },
  331. handleCancel() {
  332. this.setState({
  333. visible: false
  334. });
  335. },
  336. getHeadPortraitUrl(e) {
  337. this.setState({ headPortraitUrl: e });
  338. },
  339. getPositiveIdUrl(e) {
  340. this.setState({ positiveIdUrl: e });
  341. },
  342. getOppositeIdUrl(e) {
  343. this.setState({ oppositeIdUrl: e });
  344. },
  345. componentWillMount() {
  346. this.loadInformation();
  347. },
  348. componentWillReceiveProps(nextProps) {},
  349. render() {
  350. const { getFieldDecorator } = this.props.form;
  351. const { MonthPicker } = DatePicker;
  352. const formItemLayout = {
  353. labelCol: {
  354. span: 6
  355. },
  356. wrapperCol: {
  357. span: 14
  358. }
  359. };
  360. const theData = this.state.data || [];
  361. return (
  362. <div className="unit-wrap">
  363. <Form layout="horizontal" onSubmit={this.subFun} id="demand-form" style={{ width: '80%' }}>
  364. <Spin spinning={this.state.loading}>
  365. <Row style={{ marginBottom: 20 }}>
  366. <Col offset={2} span={4}>
  367. <h4 style={{ fontSize: 20 }}>个人资料</h4>
  368. </Col>
  369. </Row>
  370. <div className="clearfix">
  371. <FormItem className="half-item" {...formItemLayout} label="姓名">
  372. {getFieldDecorator('identifyName', {
  373. rules: [ { required: true, message: '此项为必填项!' } ],
  374. initialValue: theData.identifyName
  375. })(<Input placeholder="输入姓名" maxLength={128}/>)}
  376. </FormItem>
  377. <FormItem className="half-item" {...formItemLayout} label="行业">
  378. {getFieldDecorator('industry', {
  379. rules: [ { required: true, message: '此项为必填项!' } ],
  380. initialValue: theData.industry?theData.industry.toString():undefined
  381. })(
  382. <Select placeholder="选择行业">
  383. {industry.map(function(item) {
  384. return <Select.Option key={item.value}>{item.key}</Select.Option>;
  385. })}
  386. </Select>
  387. )}
  388. </FormItem>
  389. <FormItem className="half-item" {...formItemLayout} label="社会属性">
  390. {getFieldDecorator('societyTag', {
  391. rules: [ { required: true, message: '此项为必填项!' } ],
  392. initialValue: theData.societyTag
  393. })(
  394. <Select placeholder="客户社会属性">
  395. {socialAttribute.map(function(item) {
  396. return <Select.Option key={item.value}>{item.key}</Select.Option>;
  397. })}
  398. </Select>
  399. )}
  400. </FormItem>
  401. <FormItem className="half-item" {...formItemLayout} label="性别">
  402. {getFieldDecorator('sex', {
  403. initialValue: theData.sex
  404. })(
  405. <Radio.Group>
  406. <Radio value={'男'}>男</Radio>
  407. <Radio value={'女'}>女</Radio>
  408. </Radio.Group>
  409. )}
  410. </FormItem>
  411. <FormItem className="half-item" {...formItemLayout} label="出生日期">
  412. <MonthPicker
  413. value={this.state.yearMonth?moment(this.state.yearMonth, monthFormat):undefined}
  414. format={monthFormat}
  415. onChange={(time,times) => {
  416. this.setState({ yearMonth: time,yearList:times });
  417. }}
  418. />
  419. </FormItem>
  420. <FormItem className="half-item" {...formItemLayout} label="身份证号码">
  421. {getFieldDecorator('idNumber', {
  422. initialValue: theData.idNumber
  423. })(<Input placeholder="身份证号码" maxLength={20}/>)}
  424. </FormItem>
  425. </div>
  426. <div className="clearfix">
  427. <FormItem className="half-item" {...formItemLayout} label="省-市-区">
  428. {getFieldDecorator('ProvinceCity', {
  429. rules: [ { required: true, message: '此项为必填项!' } ],
  430. initialValue: this.state.ProvinceCity
  431. })(<Cascader options={areaSelect()} placeholder="选择城市" />)}
  432. </FormItem>
  433. <FormItem className="half-item" {...formItemLayout} label="通信地址">
  434. {getFieldDecorator('postalAddress', {
  435. initialValue: theData.postalAddress
  436. })(<Input placeholder="输入通信地址" maxLength={255}/>)}
  437. </FormItem>
  438. <FormItem className="half-item" {...formItemLayout} label="手机号码">
  439. {getFieldDecorator('mobile', {
  440. rules: [ { required: true, message: '此项为必填项!' } ],
  441. initialValue: theData.mobile
  442. })(<Input placeholder="输入手机号码" maxLength={16}/>)}
  443. </FormItem>
  444. <FormItem className="half-item" {...formItemLayout} label="固定电话">
  445. {getFieldDecorator('fixedTel', {
  446. initialValue: theData.fixedTel
  447. })(<Input placeholder="输入固定电话" maxLength={13}/>)}
  448. </FormItem>
  449. <FormItem className="half-item" {...formItemLayout} label="QQ">
  450. {getFieldDecorator('qq', {
  451. initialValue: theData.qq
  452. })(<Input placeholder="输入qq" maxLength={16}/>)}
  453. </FormItem>
  454. <FormItem className="half-item" {...formItemLayout} label="电子邮箱">
  455. {getFieldDecorator('email', {
  456. initialValue: theData.email
  457. })(<Input placeholder="输入电子邮箱" maxLength={128}/>)}
  458. </FormItem>
  459. </div>
  460. <div className="clearfix">
  461. <FormItem
  462. labelCol={{ span: 3 }}
  463. wrapperCol={{ span: 18 }}
  464. label="个人简介"
  465. >
  466. {getFieldDecorator('introduction', {
  467. initialValue: theData.introduction
  468. })(<Input type="textarea" rows={4} maxLength={512} placeholder="输入个人简介"/>)}
  469. </FormItem>
  470. </div>
  471. {(this.state.expert=='0'||this.state.auditStatus=='3'||this.state.expert==null)&&this.state.type!=null?
  472. <div>
  473. <div className="clearfix btnGrounp">
  474. <Radio.Group
  475. value={this.state.authenticationState}
  476. onChange={(e)=>{this.setState({
  477. authenticationState:e.target.value
  478. })}}>
  479. <Radio.Button value="0">专家认证</Radio.Button>
  480. <Radio.Button value="1">顾问认证</Radio.Button>
  481. </Radio.Group>
  482. <Button type="dashed" style={{marginLeft:20}} onClick={(e)=>{this.setState({authenticationState:undefined})}}>暂不认证</Button>
  483. <span style={{marginLeft:10,color:'#f00'}}>{this.state.auditStatus=='3'?"(认证失败:"+this.state.authMessage+')':''}</span>
  484. </div>
  485. {this.state.authenticationState=='0'?<div className="patentBody">
  486. <FormItem className="half-item" {...formItemLayout} label="毕业院校">
  487. {getFieldDecorator('graduateSchool', {
  488. initialValue: theData.graduateSchool,
  489. rules: [ { required: true, message: '此项为必填项!' } ],
  490. })(<Input placeholder="输入毕业院校全称" maxLength={32}/>)}
  491. </FormItem>
  492. <FormItem className="half-item" {...formItemLayout} label="专业类别">
  493. {getFieldDecorator('majorCategory', {
  494. initialValue: theData.majorCategory,
  495. rules: [ { required: true, message: '此项为必填项!' } ],
  496. })(<Input placeholder="输入专业" maxLength={16}/>)}
  497. </FormItem>
  498. <FormItem className="half-item" {...formItemLayout} label="职业资格">
  499. {getFieldDecorator('qualification', {
  500. initialValue: theData.qualification,
  501. rules: [ { required: true, message: '此项为必填项!' } ],
  502. })(<Input placeholder="输入职业资格" maxLength={32} />)}
  503. </FormItem>
  504. <FormItem className="half-item" {...formItemLayout} label="就职单位">
  505. {getFieldDecorator('workUnit', {
  506. initialValue: theData.workUnit,
  507. rules: [ { required: true, message: '此项为必填项!' } ],
  508. })(<Input placeholder="输入就职单位全称" maxLength={64}/>)}
  509. </FormItem>
  510. <FormItem className="half-item" {...formItemLayout} label="职称">
  511. {getFieldDecorator('professionalTitle', {
  512. initialValue: theData.professionalTitle,
  513. rules: [ { required: true, message: '此项为必填项!' } ],
  514. })(<Input placeholder="输入职称" maxLength={32}/>)}
  515. </FormItem>
  516. </div>:this.state.authenticationState=='1'?
  517. <div>
  518. <FormItem className="half-item" {...formItemLayout} label="顾问类型">
  519. {getFieldDecorator('adviserType', {
  520. rules: [ { required: true, message: '此项为必填项!' } ],
  521. initialValue: theData.consultantType=='0'?theData.consultantType.toString():undefined
  522. })(
  523. <Select placeholder="选择类型">
  524. {adviserType.map(function(item) {
  525. return <Select.Option key={item.value}>{item.key}</Select.Option>;
  526. })}
  527. </Select>
  528. )}
  529. </FormItem>
  530. </div>:''}
  531. {this.state.authenticationState=='1'||this.state.authenticationState=='0'?<div className="clearfix pictures">
  532. <div className="clearfix">
  533. <FormItem
  534. className="picWidth"
  535. labelCol={{ span: 9 }}
  536. wrapperCol={{ span: 10 }}
  537. label={<div style={{marginRight:10}}><strong style={{color:"#f00"}}>*</strong><span>{this.state.authenticationState=='0'?'专家照片 : ':'顾问照片 : ' } </span></div> }
  538. >
  539. <PicturesWall
  540. fileList={this.getHeadPortraitUrl}
  541. pictureUrl={this.state.headPortraitUrl}
  542. />
  543. <p>建议:图片要清晰1。</p>
  544. </FormItem>
  545. </div>
  546. <FormItem
  547. className="picWidth"
  548. labelCol={{ span: 9 }}
  549. wrapperCol={{ span: 10 }}
  550. label={<div style={{marginRight:10}}><strong style={{color:"#f00"}}>*</strong><span>身份证正面 : </span></div> }
  551. >
  552. <PicturesWall fileList={this.getPositiveIdUrl} pictureUrl={this.state.positiveIdUrl} />
  553. <p>建议:图片要清晰。</p>
  554. </FormItem>
  555. <FormItem
  556. className="picWidth"
  557. labelCol={{ span: 9 }}
  558. wrapperCol={{ span: 10 }}
  559. label={<div style={{marginRight:10}}><strong style={{color:"#f00"}}>*</strong><span>身份证反面 : </span></div> }
  560. >
  561. <PicturesWall fileList={this.getOppositeIdUrl} pictureUrl={this.state.oppositeIdUrl} />
  562. <p>建议:图片要清晰。</p>
  563. </FormItem>
  564. </div>:''}
  565. </div>:(this.state.auditStatus=='2'||this.state.auditStatus=='1')&&this.state.expert=='1'?
  566. <div>
  567. <div className="authState">专家认证<span>({getAuthState(this.state.auditStatus)})</span></div>
  568. <FormItem className="half-item" {...formItemLayout} label="毕业院校">
  569. <span>{theData.graduateSchool}</span>
  570. </FormItem>
  571. <FormItem className="half-item" {...formItemLayout} label="专业类别">
  572. <span>{theData.majorCategory}</span>
  573. </FormItem>
  574. <FormItem className="half-item" {...formItemLayout} label="职业资格">
  575. <span>{theData.qualification}</span>
  576. </FormItem>
  577. <FormItem className="half-item" {...formItemLayout} label="就职单位">
  578. <span>{theData.workUnit}</span>
  579. </FormItem>
  580. <FormItem className="half-item" {...formItemLayout} label="职称">
  581. <span>{theData.professionalTitle}</span>
  582. </FormItem>
  583. <div className="clearfix">
  584. <FormItem labelCol={{ span: 3 }} wrapperCol={{ span: 13 }} label="专家照片">
  585. <Upload className="demandDetailShow-upload"
  586. listType="picture-card"
  587. fileList={this.state.headPortraitUrl}
  588. onPreview={(file) => {
  589. this.setState({
  590. previewImage: file.url || file.thumbUrl,
  591. previewVisible: true,
  592. });
  593. }} >
  594. </Upload>
  595. <Modal maskClosable={false} footer={null}
  596. visible={this.state.previewVisible}
  597. onCancel={() => { this.setState({ previewVisible: false }) }}>
  598. <img alt="" style={{ width: '100%' }} src={this.state.previewImage || ''} />
  599. </Modal>
  600. </FormItem>
  601. </div>
  602. <FormItem className="picWidth" labelCol={{ span: 9 }} wrapperCol={{ span: 10 }} label="身份证正面">
  603. <div className="clearfix">
  604. <Upload className="demandDetailShow-upload"
  605. listType="picture-card"
  606. fileList={this.state.positiveIdUrl}
  607. onPreview={(file) => {
  608. this.setState({
  609. previewImage: file.url || file.thumbUrl,
  610. previewVisible: true,
  611. });
  612. }} >
  613. </Upload>
  614. <Modal maskClosable={false} footer={null}
  615. visible={this.state.previewVisible}
  616. onCancel={() => { this.setState({ previewVisible: false }) }}>
  617. <img alt="" style={{ width: '100%' }} src={this.state.previewImage || ''} />
  618. </Modal>
  619. </div>
  620. </FormItem>
  621. <FormItem className="picWidth" labelCol={{ span:9 }} wrapperCol={{ span: 10 }} label="身份证反面">
  622. <div className="clearfix">
  623. <Upload className="demandDetailShow-upload"
  624. listType="picture-card"
  625. fileList={this.state.oppositeIdUrl}
  626. onPreview={(file) => {
  627. this.setState({
  628. previewImage: file.url || file.thumbUrl,
  629. previewVisible: true,
  630. });
  631. }} >
  632. </Upload>
  633. <Modal maskClosable={false} footer={null}
  634. visible={this.state.previewVisible}
  635. onCancel={() => { this.setState({ previewVisible: false }) }}>
  636. <img alt="" style={{ width: '100%' }} src={this.state.previewImage || ''} />
  637. </Modal>
  638. </div>
  639. </FormItem>
  640. </div>:(this.state.auditStatus=='2'||this.state.auditStatus=='1')&&this.state.expert=='2'?
  641. <div className="clearfix">
  642. <div className="authState">顾问认证<span>({getAuthState(this.state.auditStatus)})</span></div>
  643. <FormItem className="half-item" {...formItemLayout} label="顾问类型">
  644. <span>{getAdviserType(theData.consultantType)}</span>
  645. </FormItem>
  646. <div className="clearfix">
  647. <FormItem labelCol={{ span: 3 }} wrapperCol={{ span: 13 }} label="顾问照片">
  648. <Upload className="demandDetailShow-upload"
  649. listType="picture-card"
  650. fileList={this.state.headPortraitUrl}
  651. onPreview={(file) => {
  652. this.setState({
  653. previewImage: file.url || file.thumbUrl,
  654. previewVisible: true,
  655. });
  656. }} >
  657. </Upload>
  658. <Modal maskClosable={false} footer={null}
  659. visible={this.state.previewVisible}
  660. onCancel={() => { this.setState({ previewVisible: false }) }}>
  661. <img alt="" style={{ width: '100%' }} src={this.state.previewImage || ''} />
  662. </Modal>
  663. </FormItem>
  664. </div>
  665. <div>
  666. <FormItem className="picWidth" labelCol={{ span: 9 }} wrapperCol={{ span: 10 }} label="身份证正面">
  667. <div className="clearfix">
  668. <Upload className="demandDetailShow-upload"
  669. listType="picture-card"
  670. fileList={this.state.positiveIdUrl}
  671. onPreview={(file) => {
  672. this.setState({
  673. previewImage: file.url || file.thumbUrl,
  674. previewVisible: true,
  675. });
  676. }} >
  677. </Upload>
  678. <Modal maskClosable={false} footer={null}
  679. visible={this.state.previewVisible}
  680. onCancel={() => { this.setState({ previewVisible: false }) }}>
  681. <img alt="" style={{ width: '100%' }} src={this.state.previewImage || ''} />
  682. </Modal>
  683. </div>
  684. </FormItem>
  685. <FormItem className="picWidth" labelCol={{ span:9 }} wrapperCol={{ span: 10 }} label="身份证反面">
  686. <div className="clearfix">
  687. <Upload className="demandDetailShow-upload"
  688. listType="picture-card"
  689. fileList={this.state.oppositeIdUrl}
  690. onPreview={(file) => {
  691. this.setState({
  692. previewImage: file.url || file.thumbUrl,
  693. previewVisible: true,
  694. });
  695. }} >
  696. </Upload>
  697. <Modal maskClosable={false} footer={null}
  698. visible={this.state.previewVisible}
  699. onCancel={() => { this.setState({ previewVisible: false }) }}>
  700. <img alt="" style={{ width: '100%' }} src={this.state.previewImage || ''} />
  701. </Modal>
  702. </div>
  703. </FormItem>
  704. </div>
  705. </div>:''}
  706. <div className="clearfix">
  707. <Row style={{ marginBottom: 20 }} >
  708. <Col offset={3} span={4}>
  709. <Button size="large" className="set-submit" type="primary" htmlType="submit">
  710. 保存
  711. </Button>
  712. </Col>
  713. </Row>
  714. </div>
  715. </Spin>
  716. </Form>
  717. <Modal visible={this.state.visible} onOk={this.handleOk} onCancel={this.handleCancel}>
  718. {this.state.authenticationState=='0'&&<p>是否申请专家认证?注意:认证成功后,您的信息将在本平台展示。</p>}
  719. {this.state.authenticationState=='1'&&<p>是否申请顾问认证?注意:认证成功后,您的信息将在本平台展示。</p>}
  720. {!this.state.authentication?<p>是否申请个人认证?</p>:''}
  721. </Modal>
  722. </div>
  723. );
  724. }
  725. });
  726. export default Form.create()(Expert);