expert.jsx 27 KB

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