expert.jsx 27 KB

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