expert.jsx 27 KB

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