orgDesc.jsx 52 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124
  1. import React from 'react';
  2. import { Icon, Modal, message, Spin, Button, Tabs, Input, Select, Form, DatePicker, Cascader, Upload } from 'antd';
  3. import './userList.less';
  4. import ajax from 'jquery/src/ajax/xhr.js';
  5. import $ from 'jquery/src/ajax';
  6. import moment from 'moment';
  7. import { eduLevelList, auditStatusList, certifyStepList } from '../../dataDic.js'
  8. import { beforeUploadFile, getAuditState } from '../../tools.js';
  9. import { areaSelect, getProvince } from '../../NewDicProvinceList';
  10. import { getTechField, techFieldList } from '../../DicTechFieldList';
  11. const OrgShow = Form.create()(React.createClass({
  12. getInitialState() {
  13. return {
  14. loading: false,
  15. tabKey: "1",
  16. eduLvlOption: [],
  17. eduLvlObj: {},
  18. field: []
  19. };
  20. },
  21. loadData(uid) {
  22. this.state.data = [];
  23. this.setState({
  24. loading: true
  25. });
  26. $.ajax({
  27. method: "get",
  28. dataType: "json",
  29. crossDomain: false,
  30. url: globalConfig.context + "/api/admin/userCertify/orgDetail",
  31. data: {
  32. uid: uid
  33. },
  34. success: function (data) {
  35. let thisData = data.data;
  36. if (!thisData) {
  37. if (data.error && data.error.length) {
  38. message.warning(data.error[0].message);
  39. };
  40. thisData = {};
  41. };
  42. this.setState({
  43. id: thisData.id,
  44. licenceProvince: thisData.licenceProvince,
  45. licenceCity: thisData.licenceCity,
  46. licenceArea: thisData.licenceArea,
  47. locationProvince: thisData.locationProvince,
  48. locationCity: thisData.locationCity,
  49. locationArea: thisData.locationArea,
  50. contacts: thisData.contacts,
  51. contactMobile: thisData.contactMobile,
  52. fixedTel: thisData.fixedTel,
  53. qq: thisData.qq,
  54. postalAddress: thisData.postalAddress,
  55. postcode: thisData.postcode,
  56. aftUsername: thisData.aftUsername,
  57. unitName: thisData.unitName,
  58. identityType: thisData.identityType, //组织性质
  59. registeredCapital: thisData.registeredCapital, //注册资金
  60. firstContacts: thisData.firstContacts,
  61. firstMobile: thisData.firstMobile,
  62. secondContacts: thisData.secondContacts,
  63. secondMobile: thisData.secondMobile,
  64. thirdContacts: thisData.thirdContacts,
  65. thirdMobile: thisData.thirdMobile,
  66. field: thisData.field ? thisData.field.split(',') : [],
  67. legalPerson: thisData.legalPerson,
  68. legalPersonIdCard: thisData.legalPersonIdCard,
  69. licenceNumber: thisData.licenceNumber,
  70. licenceScanningUrl: thisData.licenceScanningUrl,
  71. orgCode: thisData.orgCode,
  72. orgCodeUrl: thisData.orgCodeUrl,
  73. bankAccount: thisData.bankAccount,
  74. banks: thisData.banks,
  75. bankBranch: thisData.bankBranch,
  76. bankCardNumber: thisData.bankCardNumber,
  77. validationAmount: thisData.validationAmount, //打款金额
  78. paymentDate: thisData.paymentDate,
  79. paymentDateFormattedDate: thisData.paymentDateFormattedDate,
  80. lastYearTaxReportUrl: thisData.lastYearTaxReportUrl,
  81. auditStatus: thisData.auditStatus,
  82. level: thisData.level,
  83. aid: thisData.aid, //业务员ID
  84. mid: thisData.mid //客户经理ID
  85. });
  86. this.props.form.resetFields();
  87. }.bind(this),
  88. }).always(function () {
  89. this.setState({
  90. loading: false
  91. });
  92. }.bind(this));
  93. },
  94. getAccountManagerList() {
  95. this.setState({
  96. loading: true
  97. });
  98. $.ajax({
  99. method: "get",
  100. dataType: "json",
  101. crossDomain: false,
  102. url: globalConfig.context + "/api/admin/userCertify/accountManager",
  103. success: function (data) {
  104. let theArr = [];
  105. if (!data.data) {
  106. if (data.error && data.error.length) {
  107. message.warning(data.error[0].message);
  108. };
  109. return;
  110. };
  111. for (var item in data.data) {
  112. theArr.push(
  113. <Select.Option value={item} key={item}>{data.data[item]}</Select.Option>
  114. )
  115. };
  116. this.setState({
  117. accountManagerOption: theArr,
  118. accountManagerList: data.data
  119. });
  120. }.bind(this),
  121. }).always(function () {
  122. this.setState({
  123. loading: false
  124. });
  125. }.bind(this));
  126. },
  127. getTechnicianList() {
  128. this.setState({
  129. loading: true
  130. });
  131. $.ajax({
  132. method: "get",
  133. dataType: "json",
  134. crossDomain: false,
  135. url: globalConfig.context + "/api/admin/userCertify/technician",
  136. success: function (data) {
  137. let theArr = [];
  138. if (!data.data) {
  139. if (data.error && data.error.length) {
  140. message.warning(data.error[0].message);
  141. };
  142. return;
  143. };
  144. for (var item in data.data) {
  145. theArr.push(
  146. <Select.Option value={item} key={item}>{data.data[item]}</Select.Option>
  147. )
  148. };
  149. this.setState({
  150. technicianOption: theArr,
  151. technicianList: data.data
  152. });
  153. }.bind(this),
  154. }).always(function () {
  155. this.setState({
  156. loading: false
  157. });
  158. }.bind(this));
  159. },
  160. handleSubmit(e) {
  161. e.preventDefault();
  162. this.props.form.validateFields((err, values) => {
  163. if (!err) {
  164. this.setState({
  165. loading: true
  166. });
  167. $.ajax({
  168. method: "POST",
  169. dataType: "json",
  170. crossDomain: false,
  171. url: globalConfig.context + "/api/admin/userCertify/updateOrgDetail",
  172. data: {
  173. uid: this.props.uid,
  174. id: this.state.id,
  175. auditStatus: values.auditStatus,
  176. //level: this.state.level,
  177. aid: values.aid, //指派业务员ID
  178. mid: values.mid, //指派客户经理ID
  179. }
  180. }).done(function (data) {
  181. if (!data.error.length) {
  182. message.success('保存成功!');
  183. } else {
  184. message.warning(data.error[0].message);
  185. }
  186. }.bind(this)).always(function () {
  187. this.setState({
  188. loading: false
  189. });
  190. this.props.handleOk();
  191. }.bind(this));
  192. }
  193. });
  194. },
  195. handleCancel() {
  196. this.props.closeDesc(false);
  197. },
  198. componentWillMount() {
  199. let _me = this;
  200. eduLevelList.map(function (item, i) {
  201. _me.state.eduLvlObj[item.value] = item.key
  202. });
  203. this.loadData(this.props.uid);
  204. this.getAccountManagerList();
  205. this.getTechnicianList();
  206. },
  207. componentWillReceiveProps(nextProps) {
  208. if (!this.props.visible && nextProps.visible) {
  209. this.loadData(nextProps.uid);
  210. this.state.tabKey = "1";
  211. };
  212. },
  213. render() {
  214. const { getFieldDecorator } = this.props.form;
  215. const FormItem = Form.Item
  216. const formItemLayout = {
  217. labelCol: { span: 6 },
  218. wrapperCol: { span: 12 },
  219. };
  220. return (
  221. <Form horizontal onSubmit={this.handleSubmit} className="person-form">
  222. <Tabs defaultActiveKey="1" activeKey={this.state.tabKey} onChange={(e) => { this.setState({ tabKey: e }); }}>
  223. <Tabs.TabPane tab="基本资料" key="1">
  224. <FormItem
  225. {...formItemLayout}
  226. label="公司名称" >
  227. {getFieldDecorator('unitName')(
  228. <span>{this.state.unitName}</span>
  229. )}
  230. </FormItem>
  231. <FormItem
  232. {...formItemLayout}
  233. label="认证名称" >
  234. {getFieldDecorator('aftUsername', {
  235. initialValue: this.state.aftUsername
  236. })(
  237. <span>{this.state.aftUsername}</span>
  238. )}
  239. </FormItem>
  240. <FormItem className="half-item"
  241. {...formItemLayout}
  242. label="领域" >
  243. {getFieldDecorator('field')(
  244. <span>{getTechField(this.state.field[0], this.state.field[1], this.state.field[2])}</span>
  245. )}
  246. </FormItem>
  247. <FormItem
  248. {...formItemLayout}
  249. label="身份类型" >
  250. {getFieldDecorator('identityType')(
  251. <span>{this.state.eduLvlObj[this.state.identityType]}</span>
  252. )}
  253. </FormItem>
  254. <FormItem
  255. {...formItemLayout}
  256. label="第一联系人" >
  257. {getFieldDecorator('firstContacts')(
  258. <span>{this.state.firstContacts}</span>
  259. )}
  260. </FormItem>
  261. <FormItem
  262. {...formItemLayout}
  263. label="第一联系人电话" >
  264. {getFieldDecorator('firstMobile')(
  265. <span>{this.state.firstMobile}</span>
  266. )}
  267. </FormItem>
  268. <FormItem
  269. {...formItemLayout}
  270. label="第二联系人" >
  271. {getFieldDecorator('secondContacts')(
  272. <span>{this.state.secondContacts}</span>
  273. )}
  274. </FormItem>
  275. <FormItem
  276. {...formItemLayout}
  277. label="第二联系人电话" >
  278. {getFieldDecorator('secondMobile')(
  279. <span>{this.state.secondMobile}</span>
  280. )}
  281. </FormItem>
  282. <FormItem
  283. {...formItemLayout}
  284. label="第三联系人" >
  285. {getFieldDecorator('thirdContacts')(
  286. <span>{this.state.thirdContacts}</span>
  287. )}
  288. </FormItem>
  289. <FormItem
  290. {...formItemLayout}
  291. label="第三联系人电话"
  292. >
  293. {getFieldDecorator('thirdMobile')(
  294. <span>{this.state.thirdMobile}</span>
  295. )}
  296. </FormItem>
  297. </Tabs.TabPane>
  298. <Tabs.TabPane tab="认证信息" key="2">
  299. <FormItem
  300. {...formItemLayout}
  301. label="法人" >
  302. {getFieldDecorator('legalPerson')(
  303. <span>{this.state.legalPerson}</span>
  304. )}
  305. </FormItem>
  306. <FormItem
  307. {...formItemLayout}
  308. label="法人身份证号" >
  309. {getFieldDecorator('legalPersonIdCard')(
  310. <span>{this.state.legalPersonIdCard}</span>
  311. )}
  312. </FormItem>
  313. <FormItem
  314. {...formItemLayout}
  315. label="注册资金" >
  316. {getFieldDecorator('registeredCapital')(
  317. <span>{this.state.registeredCapital}</span>
  318. )}
  319. </FormItem>
  320. <FormItem
  321. {...formItemLayout}
  322. label="营业执照编号" >
  323. {getFieldDecorator('licenceNumber')(
  324. <span>{this.state.licenceNumber}</span>
  325. )}
  326. </FormItem>
  327. <FormItem
  328. {...formItemLayout}
  329. label="营业执照所在地" >
  330. {getFieldDecorator('licenceAddress', {
  331. initialValue: this.state.licenceAddress
  332. })(
  333. <span>{getProvince(this.state.licenceProvince, this.state.licenceCity, this.state.licenceArea)}</span>
  334. )}
  335. </FormItem>
  336. <FormItem
  337. labelCol={{ span: 6 }}
  338. wrapperCol={{ span: 18 }}
  339. label="营业执照图片" >
  340. <div className="idcard-img clearfix">
  341. {this.state.licenceScanningUrl ? <div>
  342. <div className="idcard-imgbox">
  343. <img src={globalConfig.context + '/open/writeImage?path=' + this.state.licenceScanningUrl} alt="点击查看大图"
  344. onClick={(e) => { window.open(e.target.src) }} />
  345. </div>
  346. </div> : <div>
  347. <p><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传</p>
  348. </div>}
  349. </div>
  350. </FormItem>
  351. <FormItem
  352. {...formItemLayout}
  353. label="组织机构代码" >
  354. {getFieldDecorator('orgCode')(
  355. <span>{this.state.orgCode}</span>
  356. )}
  357. </FormItem>
  358. <FormItem
  359. labelCol={{ span: 6 }}
  360. wrapperCol={{ span: 18 }}
  361. label="组织机构代码证图片" >
  362. <div className="idcard-img clearfix">
  363. {this.state.orgCodeUrl ? <div>
  364. <div className="idcard-imgbox">
  365. <img src={globalConfig.context + '/open/writeImage?path=' + this.state.orgCodeUrl} alt="点击查看大图"
  366. onClick={(e) => { window.open(e.target.src) }} />
  367. </div>
  368. </div> : <div>
  369. <p><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传</p>
  370. </div>}
  371. </div>
  372. </FormItem>
  373. <FormItem
  374. labelCol={{ span: 6 }}
  375. wrapperCol={{ span: 18 }}
  376. label="上年度纳税报表" >
  377. <div className="idcard-img clearfix">
  378. {this.state.lastYearTaxReportUrl ? <div>
  379. <div className="idcard-imgbox">
  380. <img src={globalConfig.context + '/open/writeImage?path=' + this.state.lastYearTaxReportUrl} alt="点击查看大图"
  381. onClick={(e) => { window.open(e.target.src) }} />
  382. </div>
  383. </div> : <div>
  384. <p><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传</p>
  385. </div>}
  386. </div>
  387. </FormItem>
  388. <FormItem
  389. {...formItemLayout}
  390. label="开户银行" >
  391. {getFieldDecorator('banks')(
  392. <span>{this.state.banks}</span>
  393. )}
  394. </FormItem>
  395. <FormItem
  396. {...formItemLayout}
  397. label="开户银行支行" >
  398. {getFieldDecorator('bankBranch')(
  399. <span>{this.state.bankBranch}</span>
  400. )}
  401. </FormItem>
  402. <FormItem
  403. {...formItemLayout}
  404. label="银行卡号" >
  405. {getFieldDecorator('bankCardNumber')(
  406. <span>{this.state.bankCardNumber}</span>
  407. )}
  408. </FormItem>
  409. <FormItem
  410. {...formItemLayout}
  411. label="开户行所在地" >
  412. {getFieldDecorator('locationAddress', {
  413. initialValue: this.state.locationAddress
  414. })(
  415. <span>{getProvince(this.state.locationProvince, this.state.locationCity, this.state.locationArea)}</span>
  416. )}
  417. </FormItem>
  418. <FormItem
  419. {...formItemLayout}
  420. label="用户等级" >
  421. {getFieldDecorator('level')(
  422. <span>{"Lv." + (this.state.level || 0)}</span>
  423. )}
  424. </FormItem>
  425. <FormItem
  426. {...formItemLayout}
  427. label="认证状态" >
  428. {getFieldDecorator('auditStatus', {
  429. initialValue: this.state.auditStatus
  430. })(
  431. <Select placeholder="选择要修改的认证状态" style={{ width: 200 }}
  432. onChange={(e) => { this.state.auditStatus = e }}>
  433. {
  434. auditStatusList.map(function (item, i) {
  435. return <Select.Option key={i} value={item.value} >{item.key}</Select.Option>
  436. })
  437. }
  438. </Select>
  439. )}
  440. </FormItem>
  441. <FormItem
  442. {...formItemLayout}
  443. label="业务员" >
  444. {getFieldDecorator('aid', {
  445. initialValue: this.state.aid
  446. })(
  447. <Select placeholder="选择一个业务员" style={{ width: 200 }}>
  448. {this.state.technicianOption}
  449. </Select>
  450. )}
  451. </FormItem>
  452. <FormItem
  453. {...formItemLayout}
  454. label="客户经理" >
  455. {getFieldDecorator('mid', {
  456. initialValue: this.state.mid
  457. })(
  458. <Select placeholder="选择一个客户经理" style={{ width: 200 }}>
  459. {this.state.accountManagerOption}
  460. </Select>
  461. )}
  462. </FormItem>
  463. </Tabs.TabPane>
  464. </Tabs>
  465. <FormItem wrapperCol={{ span: 12, offset: 4 }}>
  466. <Button className="set-submit" type="primary" htmlType="submit">保存</Button>
  467. <Button className="set-submit" type="ghost" onClick={() => { this.props.closeDesc }} >取消</Button>
  468. </FormItem>
  469. </Form >
  470. );
  471. }
  472. }));
  473. const OrgCertify = Form.create()(React.createClass({
  474. getInitialState() {
  475. return {
  476. loading: false,
  477. tabKey: "1",
  478. saveSign: "save",
  479. eduLvlOption: [],
  480. auditStatusOption: []
  481. };
  482. },
  483. loadData(uid) {
  484. this.state.data = [];
  485. this.setState({
  486. loading: true
  487. });
  488. $.ajax({
  489. method: "post",
  490. dataType: "json",
  491. crossDomain: false,
  492. url: globalConfig.context + "/api/admin/orgDetail",
  493. data: {
  494. uid: uid
  495. },
  496. success: function (data) {
  497. let thisData = data.data;
  498. if (!thisData) {
  499. if (data.error && data.error.length) {
  500. message.warning(data.error[0].message);
  501. };
  502. thisData = {};
  503. };
  504. this.setState({
  505. id: thisData.id,
  506. licenceAddress: [thisData.licenceProvince, thisData.licenceCity, thisData.licenceArea],
  507. locationAddress: [thisData.locationProvince, thisData.locationCity, thisData.locationArea],
  508. contacts: thisData.contacts,
  509. contactMobile: thisData.contactMobile,
  510. fixedTel: thisData.fixedTel,
  511. qq: thisData.qq,
  512. postalAddress: thisData.postalAddress,
  513. postcode: thisData.postcode,
  514. aftUsername: thisData.aftUsername,
  515. unitName: thisData.unitName,
  516. identityType: thisData.identityType, //组织性质
  517. field: thisData.field ? thisData.field.split(',') : [],
  518. registeredCapital: thisData.registeredCapital, //注册资金
  519. firstContacts: thisData.firstContacts,
  520. firstMobile: thisData.firstMobile,
  521. secondContacts: thisData.secondContacts,
  522. secondMobile: thisData.secondMobile,
  523. thirdContacts: thisData.thirdContacts,
  524. thirdMobile: thisData.thirdMobile,
  525. legalPerson: thisData.legalPerson,
  526. legalPersonIdCard: thisData.legalPersonIdCard,
  527. licenceNumber: thisData.licenceNumber,
  528. licenceScanningUrl: thisData.licenceScanningUrl,
  529. orgCode: thisData.orgCode,
  530. orgCodeUrl: thisData.orgCodeUrl,
  531. bankAccount: thisData.bankAccount,
  532. banks: thisData.banks,
  533. bankBranch: thisData.bankBranch,
  534. bankCardNumber: thisData.bankCardNumber,
  535. validationAmount: thisData.validationAmount, //打款金额
  536. paymentDate: thisData.paymentDate,
  537. paymentDateFormattedDate: thisData.paymentDateFormattedDate,
  538. lastYearTaxReportUrl: thisData.lastYearTaxReportUrl,
  539. auditStatus: thisData.auditStatus,
  540. level: thisData.level,
  541. aid: thisData.aid, //业务员ID
  542. mid: thisData.mid //客户经理ID
  543. });
  544. this.props.form.resetFields();
  545. }.bind(this),
  546. }).always(function () {
  547. this.setState({
  548. loading: false
  549. });
  550. }.bind(this));
  551. },
  552. handleSubmit(e) {
  553. if (e) {
  554. e.preventDefault();
  555. };
  556. this.props.form.validateFields((err, values) => {
  557. if (!err) {
  558. this.setState({
  559. loading: true
  560. });
  561. // //金额判断
  562. // if (values.amountMoney && values.amountMoney < 0 && values.amountMoney > 100 && /^\d+(\.\d{2})?$/.test(values.amountMoney)) {
  563. // message.warning('请输入0-100以内的金额');
  564. // return;
  565. // };
  566. if ((this.state.auditStatus == "5" && values.level == "0") || (this.state.auditStatus != "5" && values.level != "0")) {
  567. message.warning('认证状态和用户等级不匹配!');
  568. return;
  569. };
  570. $.ajax({
  571. method: "POST",
  572. dataType: "json",
  573. crossDomain: false,
  574. url: globalConfig.context + "/api/admin/updateOrgDetail",
  575. data: {
  576. uid: this.props.uid,
  577. id: this.state.id,
  578. contacts: values.contacts,
  579. contactMobile: values.contactMobile,
  580. postalAddress: values.postalAddress,
  581. postcode: values.postcode,
  582. aftUsername: values.aftUsername,
  583. unitName: values.unitName,
  584. identityType: values.identityType, //组织性质
  585. registeredCapital: values.registeredCapital, //注册资金
  586. legalPerson: values.legalPerson,
  587. legalPersonIdCard: values.legalPersonIdCard,
  588. licenceNumber: values.licenceNumber,
  589. orgCode: values.orgCode,
  590. field: values.field ? values.field.join(',') : undefined,
  591. firstContacts: values.firstContacts,
  592. firstMobile: values.firstMobile,
  593. secondContacts: values.secondContacts,
  594. secondMobile: values.secondMobile,
  595. thirdContacts: values.thirdContacts,
  596. thirdMobile: values.thirdMobile,
  597. bankAccount: values.bankAccount,
  598. banks: values.banks,
  599. bankBranch: values.bankBranch,
  600. bankCardNumber: values.bankCardNumber,
  601. validationAmount: values.validationAmount, //打款金额
  602. paymentDateFormattedDate: values.paymentDateFormattedDate ? values.paymentDateFormattedDate.format("YYYY-MM-DD") : undefined,
  603. licenceScanningUrl: this.state.licenceScanningUrl,
  604. orgCodeUrl: this.state.orgCodeUrl,
  605. lastYearTaxReportUrl: this.state.lastYearTaxReportUrl,
  606. //process: this.state.process,
  607. licenceArea: values.licenceAddress[2],
  608. licenceCity: values.licenceAddress[1],
  609. licenceProvince: values.licenceAddress[0],
  610. locationArea: values.locationAddress[2],
  611. locationCity: values.locationAddress[1],
  612. locationProvince: values.locationAddress[0],
  613. //auditStatus: this.state.auditStatus,
  614. level: values.level,
  615. aid: values.aid, //指派业务员ID
  616. mid: values.mid, //指派客户经理ID
  617. saveSign: this.state.saveSign
  618. }
  619. }).done(function (data) {
  620. if (!data.error.length) {
  621. message.success('保存成功!');
  622. } else {
  623. message.warning(data.error[0].message);
  624. }
  625. }.bind(this)).always(function () {
  626. this.setState({
  627. loading: false,
  628. saveSign: "save"
  629. });
  630. this.props.handleOk();
  631. }.bind(this));
  632. }
  633. });
  634. },
  635. handleCancel() {
  636. this.props.closeDesc(false);
  637. },
  638. componentWillMount() {
  639. let _me = this;
  640. eduLevelList.map(function (item, i) {
  641. _me.state.eduLvlOption.push(
  642. <Select.Option key={item.key} value={item.value} >{item.key}</Select.Option>
  643. );
  644. });
  645. this.loadData(this.props.uid);
  646. },
  647. componentWillReceiveProps(nextProps) {
  648. if (!this.props.visible && nextProps.visible) {
  649. this.loadData(nextProps.uid);
  650. this.state.tabKey = "1";
  651. };
  652. },
  653. render() {
  654. const { getFieldDecorator } = this.props.form;
  655. const FormItem = Form.Item
  656. const formItemLayout = {
  657. labelCol: { span: 6 },
  658. wrapperCol: { span: 12 },
  659. };
  660. return (
  661. <Form horizontal onSubmit={this.handleSubmit} className="person-form">
  662. <Tabs defaultActiveKey="1" activeKey={this.state.tabKey} onChange={(e) => { this.setState({ tabKey: e }); }}>
  663. <Tabs.TabPane tab="基本资料" key="1">
  664. <FormItem
  665. {...formItemLayout}
  666. label="公司名称" >
  667. {getFieldDecorator('unitName', {
  668. initialValue: this.state.unitName
  669. })(
  670. <Input />
  671. )}
  672. </FormItem>
  673. <FormItem
  674. {...formItemLayout}
  675. label="认证名称" >
  676. {getFieldDecorator('aftUsername', {
  677. initialValue: this.state.aftUsername
  678. })(
  679. <Input />
  680. )}
  681. </FormItem>
  682. <FormItem
  683. {...formItemLayout}
  684. label="身份类型" >
  685. {getFieldDecorator('identityType', {
  686. initialValue: this.state.identityType
  687. })(
  688. <Select placeholder="身份类型" style={{ width: 200 }}
  689. onChange={(e) => { this.state.identityType = e }}>
  690. {this.state.eduLvlOption}
  691. </Select>
  692. )}
  693. </FormItem>
  694. <FormItem className="half-item"
  695. {...formItemLayout}
  696. label="领域" >
  697. {getFieldDecorator('field', {
  698. initialValue: this.state.field
  699. })(
  700. <Cascader placeholder="请选择一个领域" options={techFieldList} />
  701. )}
  702. </FormItem>
  703. <FormItem
  704. {...formItemLayout}
  705. label="第一联系人" >
  706. {getFieldDecorator('firstContacts', {
  707. initialValue: this.state.firstContacts
  708. })(
  709. <Input />
  710. )}
  711. </FormItem>
  712. <FormItem
  713. {...formItemLayout}
  714. label="第一联系人电话" >
  715. {getFieldDecorator('firstMobile', {
  716. initialValue: this.state.firstMobile
  717. })(
  718. <Input />
  719. )}
  720. </FormItem>
  721. <FormItem
  722. {...formItemLayout}
  723. label="第二联系人" >
  724. {getFieldDecorator('secondContacts', {
  725. initialValue: this.state.secondContacts
  726. })(
  727. <Input />
  728. )}
  729. </FormItem>
  730. <FormItem
  731. {...formItemLayout}
  732. label="第二联系人电话" >
  733. {getFieldDecorator('secondMobile', {
  734. initialValue: this.state.secondMobile
  735. })(
  736. <Input />
  737. )}
  738. </FormItem>
  739. <FormItem
  740. {...formItemLayout}
  741. label="第三联系人" >
  742. {getFieldDecorator('thirdContacts', {
  743. initialValue: this.state.thirdContacts
  744. })(
  745. <Input />
  746. )}
  747. </FormItem>
  748. <FormItem
  749. {...formItemLayout}
  750. label="第三联系人电话" >
  751. {getFieldDecorator('thirdMobile', {
  752. initialValue: this.state.thirdMobile
  753. })(
  754. <Input />
  755. )}
  756. </FormItem>
  757. </Tabs.TabPane>
  758. <Tabs.TabPane tab="认证信息" key="2">
  759. <FormItem
  760. {...formItemLayout}
  761. label="法人" >
  762. {getFieldDecorator('legalPerson', {
  763. initialValue: this.state.legalPerson
  764. })(
  765. <Input />
  766. )}
  767. </FormItem>
  768. <FormItem
  769. {...formItemLayout}
  770. label="法人身份证号" >
  771. {getFieldDecorator('legalPersonIdCard', {
  772. initialValue: this.state.legalPersonIdCard
  773. })(
  774. <Input />
  775. )}
  776. </FormItem>
  777. <FormItem
  778. {...formItemLayout}
  779. label="注册资金" >
  780. {getFieldDecorator('registeredCapital', {
  781. initialValue: this.state.registeredCapital
  782. })(
  783. <Input />
  784. )}
  785. </FormItem>
  786. <FormItem
  787. {...formItemLayout}
  788. label="营业执照编号" >
  789. {getFieldDecorator('licenceNumber', {
  790. initialValue: this.state.licenceNumber
  791. })(
  792. <Input />
  793. )}
  794. </FormItem>
  795. <FormItem
  796. {...formItemLayout}
  797. label="营业执照所在地" >
  798. {getFieldDecorator('licenceAddress', {
  799. initialValue: this.state.licenceAddress
  800. })(
  801. <Cascader options={areaSelect()} placeholder="请选择地址" />
  802. )}
  803. </FormItem>
  804. <FormItem
  805. labelCol={{ span: 6 }}
  806. wrapperCol={{ span: 18 }}
  807. label="营业执照图片" >
  808. <div className="idcard-img clearfix">
  809. {this.state.licenceScanningUrl ? <div>
  810. <div className="idcard-imgbox">
  811. <img src={globalConfig.context + '/open/writeImage?path=' + this.state.licenceScanningUrl} alt="点击查看大图"
  812. onClick={(e) => { window.open(e.target.src) }} />
  813. </div>
  814. </div> : <div>
  815. <p><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传</p>
  816. </div>}
  817. <Upload
  818. name="licence"
  819. action={globalConfig.context + "/api/admin/userCertify/upload"}
  820. data={{
  821. 'uid': this.props.uid,
  822. 'sign': 'licence'
  823. }}
  824. beforeUpload={beforeUploadFile}
  825. showUploadList={false}
  826. onChange={(info) => {
  827. if (info.file.status !== 'uploading') {
  828. console.log(info.file, info.fileList);
  829. }
  830. if (info.file.status === 'done') {
  831. if (!info.file.response.error.length) {
  832. message.success(`${info.file.name} 文件上传成功!`);
  833. } else {
  834. message.warning(info.file.response.error[0].message);
  835. return;
  836. };
  837. this.state.licenceScanningUrl = info.file.response.data;
  838. } else if (info.file.status === 'error') {
  839. message.error(`${info.file.name} 文件上传失败。`);
  840. }
  841. }} >
  842. <Button><Icon type="upload" /> 上传营业执照 </Button>
  843. </Upload>
  844. </div>
  845. </FormItem>
  846. <FormItem
  847. {...formItemLayout}
  848. label="组织机构代码" >
  849. {getFieldDecorator('orgCode', {
  850. initialValue: this.state.orgCode
  851. })(
  852. <Input />
  853. )}
  854. </FormItem>
  855. <FormItem
  856. labelCol={{ span: 6 }}
  857. wrapperCol={{ span: 18 }}
  858. label="组织机构代码证图片" >
  859. <div className="idcard-img clearfix">
  860. {this.state.orgCodeUrl ? <div>
  861. <div className="idcard-imgbox">
  862. <img src={globalConfig.context + '/open/writeImage?path=' + this.state.orgCodeUrl} alt="点击查看大图"
  863. onClick={(e) => { window.open(e.target.src) }} />
  864. </div>
  865. </div> : <div>
  866. <p><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传</p>
  867. </div>}
  868. <Upload
  869. name="orgCode"
  870. action={globalConfig.context + "/api/admin/userCertify/upload"}
  871. data={{ 'uid': this.props.uid, 'sign': 'orgcode' }}
  872. beforeUpload={beforeUploadFile}
  873. showUploadList={false}
  874. onChange={(info) => {
  875. if (info.file.status !== 'uploading') {
  876. console.log(info.file, info.fileList);
  877. }
  878. if (info.file.status === 'done') {
  879. if (!info.file.response.error.length) {
  880. message.success(`${info.file.name} 文件上传成功!`);
  881. } else {
  882. message.warning(info.file.response.error[0].message);
  883. return;
  884. };
  885. this.state.orgCodeUrl = info.file.response.data;
  886. } else if (info.file.status === 'error') {
  887. message.error(`${info.file.name} 文件上传失败。`);
  888. }
  889. }} >
  890. <Button><Icon type="upload" /> 上传组织机构代码证 </Button>
  891. </Upload>
  892. </div>
  893. </FormItem>
  894. <FormItem
  895. labelCol={{ span: 6 }}
  896. wrapperCol={{ span: 18 }}
  897. label="上年度纳税报表" >
  898. <div className="idcard-img clearfix">
  899. {this.state.lastYearTaxReportUrl ? <div>
  900. <div className="idcard-imgbox">
  901. <img src={globalConfig.context + '/open/writeImage?path=' + this.state.lastYearTaxReportUrl} alt="点击查看大图"
  902. onClick={(e) => { window.open(e.target.src) }} />
  903. </div>
  904. </div> : <div>
  905. <p><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传</p>
  906. </div>}
  907. <Upload
  908. name="ratepay"
  909. action={globalConfig.context + "/api/admin/userCertify/upload"}
  910. data={{ 'uid': this.props.uid, 'sign': 'ratepay' }}
  911. beforeUpload={beforeUploadFile}
  912. showUploadList={false}
  913. onChange={(info) => {
  914. if (info.file.status !== 'uploading') {
  915. console.log(info.file, info.fileList);
  916. }
  917. if (info.file.status === 'done') {
  918. if (!info.file.response.error.length) {
  919. message.success(`${info.file.name} 文件上传成功!`);
  920. } else {
  921. message.warning(info.file.response.error[0].message);
  922. return;
  923. };
  924. this.state.lastYearTaxReportUrl = info.file.response.data;
  925. } else if (info.file.status === 'error') {
  926. message.error(`${info.file.name} 文件上传失败。`);
  927. }
  928. }} >
  929. <Button><Icon type="upload" /> 上传上年度纳税表 </Button>
  930. </Upload>
  931. </div>
  932. </FormItem>
  933. <FormItem
  934. {...formItemLayout}
  935. label="开户银行" >
  936. {getFieldDecorator('banks', {
  937. initialValue: this.state.banks
  938. })(
  939. <Input />
  940. )}
  941. </FormItem>
  942. <FormItem
  943. {...formItemLayout}
  944. label="开户银行支行" >
  945. {getFieldDecorator('bankBranch', {
  946. initialValue: this.state.bankBranch
  947. })(
  948. <Input />
  949. )}
  950. </FormItem>
  951. <FormItem
  952. {...formItemLayout}
  953. label="银行卡号" >
  954. {getFieldDecorator('bankCardNumber', {
  955. initialValue: this.state.bankCardNumber
  956. })(
  957. <Input />
  958. )}
  959. </FormItem>
  960. <FormItem
  961. {...formItemLayout}
  962. label="开户行所在地" >
  963. {getFieldDecorator('locationAddress', {
  964. initialValue: this.state.locationAddress
  965. })(
  966. <Cascader options={areaSelect()} placeholder="请选择地址" />
  967. )}
  968. </FormItem>
  969. <FormItem
  970. {...formItemLayout}
  971. label="用户等级" >
  972. {getFieldDecorator('level', {
  973. initialValue: this.state.level
  974. })(
  975. <Select placeholder="选择要修改的用户等级" style={{ width: 200 }} >
  976. <Select.Option value="0" >Lv.0</Select.Option>
  977. <Select.Option value="1" >Lv.1</Select.Option>
  978. <Select.Option value="2" >Lv.2</Select.Option>
  979. <Select.Option value="3" >Lv.3</Select.Option>
  980. <Select.Option value="4" >Lv.4</Select.Option>
  981. <Select.Option value="5" >Lv.5</Select.Option>
  982. </Select>
  983. )}
  984. </FormItem>
  985. <FormItem
  986. {...formItemLayout}
  987. label="认证状态" >
  988. {getFieldDecorator('auditStatus')(
  989. <span>{getAuditState(this.state.auditStatus)}</span>
  990. )}
  991. </FormItem>
  992. <FormItem
  993. {...formItemLayout}
  994. label="业务员" >
  995. {getFieldDecorator('aid')(
  996. <span>{this.props.data.adminName}</span>
  997. )}
  998. </FormItem>
  999. <FormItem
  1000. {...formItemLayout}
  1001. label="客户经理" >
  1002. {getFieldDecorator('mid')(
  1003. <span>{this.props.data.managerName}</span>
  1004. )}
  1005. </FormItem>
  1006. </Tabs.TabPane>
  1007. </Tabs>
  1008. <FormItem wrapperCol={{ span: 12, offset: 4 }}>
  1009. <Button className="set-submit" type="primary" htmlType="submit">保存</Button>
  1010. <Button className="set-submit" type="ghost"
  1011. onClick={() => {
  1012. this.state.saveSign = "submit";
  1013. this.handleSubmit();
  1014. }}>提交审核</Button>
  1015. </FormItem>
  1016. </Form >
  1017. );
  1018. }
  1019. }));
  1020. const OrgDesc = React.createClass({
  1021. getInitialState() {
  1022. return {
  1023. visible: false,
  1024. loading: false
  1025. };
  1026. },
  1027. showModal() {
  1028. this.setState({
  1029. visible: true,
  1030. });
  1031. },
  1032. handleCancel(e) {
  1033. this.setState({
  1034. visible: false,
  1035. });
  1036. this.props.closeDesc(false);
  1037. },
  1038. handleOk(e) {
  1039. this.setState({
  1040. visible: false,
  1041. });
  1042. this.props.closeDesc(false, true);
  1043. },
  1044. componentWillReceiveProps(nextProps) {
  1045. this.state.visible = nextProps.showDesc;
  1046. },
  1047. render() {
  1048. if (this.props.data) {
  1049. return (
  1050. <div className="patent-desc">
  1051. <Spin spinning={this.state.loading} className='spin-box'>
  1052. <Modal maskClosable={false} title="用户详情" visible={this.state.visible}
  1053. onCancel={this.handleCancel}
  1054. width='600px'
  1055. footer=''
  1056. className="admin-desc-content">
  1057. {window.showAuditStatus ? <OrgShow
  1058. uid={this.props.data.id}
  1059. data={this.props.data}
  1060. closeDesc={this.handleCancel}
  1061. visible={this.state.visible}
  1062. handleOk={this.handleOk} />
  1063. : <OrgCertify
  1064. uid={this.props.data.id}
  1065. data={this.props.data}
  1066. closeDesc={this.handleCancel}
  1067. visible={this.state.visible}
  1068. handleOk={this.handleOk} />}
  1069. </Modal>
  1070. </Spin>
  1071. </div>
  1072. );
  1073. } else {
  1074. return <div></div>
  1075. }
  1076. },
  1077. });
  1078. export default OrgDesc;
  1079. // <FormItem
  1080. // {...formItemLayout}
  1081. // label="打款金额"
  1082. // >
  1083. // {getFieldDecorator('validationAmount', {
  1084. // initialValue: this.state.validationAmount
  1085. // })(
  1086. // <Input />
  1087. // )}
  1088. // </FormItem>
  1089. // <FormItem
  1090. // {...formItemLayout}
  1091. // label="打款日期"
  1092. // >
  1093. // {getFieldDecorator('paymentDateFormattedDate', {
  1094. // initialValue: this.state.paymentDate ? moment(this.state.paymentDate) : null
  1095. // })(
  1096. // <DatePicker />
  1097. // )}
  1098. // </FormItem>