orgDesc.jsx 52 KB

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