orgDesc.jsx 51 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108
  1. import React from 'react';
  2. import { Icon, Modal, message, Spin, Button, Tabs, Input, InputNumber, 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.lvl,
  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 || 0} 万元</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. <a onClick={newDownloadFile.bind(null, this.state.lastYearTaxReportId, "last_year_ratepay", "/api/admin/patent/downloadRatepay")}>上年度纳税报表</a>
  364. </div> : <div>
  365. <p><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传</p>
  366. </div>}
  367. </div>
  368. </FormItem>
  369. <FormItem
  370. {...formItemLayout}
  371. label="开户银行" >
  372. {getFieldDecorator('banks')(
  373. <span>{this.state.banks}</span>
  374. )}
  375. </FormItem>
  376. <FormItem
  377. {...formItemLayout}
  378. label="开户银行支行" >
  379. {getFieldDecorator('bankBranch')(
  380. <span>{this.state.bankBranch}</span>
  381. )}
  382. </FormItem>
  383. <FormItem
  384. {...formItemLayout}
  385. label="银行卡号" >
  386. {getFieldDecorator('bankCardNumber')(
  387. <span>{this.state.bankCardNumber}</span>
  388. )}
  389. </FormItem>
  390. <FormItem
  391. {...formItemLayout}
  392. label="开户行所在地" >
  393. {getFieldDecorator('locationAddress', {
  394. initialValue: this.state.locationAddress
  395. })(
  396. <span>{getProvince(this.state.locationProvince, this.state.locationCity, this.state.locationArea)}</span>
  397. )}
  398. </FormItem>
  399. <FormItem
  400. {...formItemLayout}
  401. label="用户等级" >
  402. {getFieldDecorator('level')(
  403. <span>{"Lv." + (this.state.level || 0)}</span>
  404. )}
  405. </FormItem>
  406. <FormItem
  407. {...formItemLayout}
  408. label="认证状态" >
  409. {getFieldDecorator('auditStatus', {
  410. initialValue: this.state.auditStatus
  411. })(
  412. <Select placeholder="选择要修改的认证状态" style={{ width: 200 }}
  413. onChange={(e) => { this.state.auditStatus = e }}>
  414. {
  415. auditStatusList.map(function (item, i) {
  416. return <Select.Option key={i} value={item.value} >{item.key}</Select.Option>
  417. })
  418. }
  419. </Select>
  420. )}
  421. </FormItem>
  422. <FormItem
  423. {...formItemLayout}
  424. label="业务员" >
  425. {getFieldDecorator('aid', {
  426. initialValue: this.state.aid
  427. })(
  428. <Select placeholder="选择一个业务员" style={{ width: 200 }}>
  429. {this.state.technicianOption}
  430. </Select>
  431. )}
  432. </FormItem>
  433. <FormItem
  434. {...formItemLayout}
  435. label="客户经理" >
  436. {getFieldDecorator('mid', {
  437. initialValue: this.state.mid
  438. })(
  439. <Select placeholder="选择一个客户经理" style={{ width: 200 }}>
  440. {this.state.accountManagerOption}
  441. </Select>
  442. )}
  443. </FormItem>
  444. </Tabs.TabPane>
  445. </Tabs>
  446. <FormItem wrapperCol={{ span: 12, offset: 4 }}>
  447. <Button className="set-submit" type="primary" htmlType="submit">保存</Button>
  448. <Button className="set-submit" type="ghost" onClick={this.handleCancel} >取消</Button>
  449. </FormItem>
  450. </Form >
  451. );
  452. }
  453. }));
  454. const OrgCertify = Form.create()(React.createClass({
  455. getInitialState() {
  456. return {
  457. loading: false,
  458. tabKey: "1",
  459. saveSign: "save",
  460. eduLvlOption: [],
  461. auditStatusOption: []
  462. };
  463. },
  464. loadData(uid) {
  465. this.state.data = [];
  466. this.setState({
  467. loading: true
  468. });
  469. $.ajax({
  470. method: "post",
  471. dataType: "json",
  472. crossDomain: false,
  473. url: globalConfig.context + "/api/admin/orgDetail",
  474. data: {
  475. uid: uid
  476. },
  477. success: function (data) {
  478. let thisData = data.data;
  479. if (!thisData) {
  480. if (data.error && data.error.length) {
  481. message.warning(data.error[0].message);
  482. };
  483. thisData = {};
  484. };
  485. this.setState({
  486. id: thisData.id,
  487. licenceAddress: [thisData.licenceProvince, thisData.licenceCity, thisData.licenceArea],
  488. locationAddress: [thisData.locationProvince, thisData.locationCity, thisData.locationArea],
  489. contacts: thisData.contacts,
  490. contactMobile: thisData.contactMobile,
  491. fixedTel: thisData.fixedTel,
  492. qq: thisData.qq,
  493. postalAddress: thisData.postalAddress,
  494. postcode: thisData.postcode,
  495. aftUsername: thisData.aftUsername,
  496. unitName: thisData.unitName,
  497. identityType: thisData.identityType, //组织性质
  498. field: thisData.field ? thisData.field.split(',') : [],
  499. registeredCapital: thisData.registeredCapital, //注册资金
  500. firstContacts: thisData.firstContacts,
  501. firstMobile: thisData.firstMobile,
  502. secondContacts: thisData.secondContacts,
  503. secondMobile: thisData.secondMobile,
  504. thirdContacts: thisData.thirdContacts,
  505. thirdMobile: thisData.thirdMobile,
  506. legalPerson: thisData.legalPerson,
  507. legalPersonIdCard: thisData.legalPersonIdCard,
  508. licenceNumber: thisData.licenceNumber,
  509. licenceScanningUrl: thisData.licenceScanningUrl,
  510. orgCode: thisData.orgCode,
  511. orgCodeUrl: thisData.orgCodeUrl,
  512. bankAccount: thisData.bankAccount,
  513. banks: thisData.banks,
  514. bankBranch: thisData.bankBranch,
  515. bankCardNumber: thisData.bankCardNumber,
  516. validationAmount: thisData.validationAmount, //打款金额
  517. paymentDate: thisData.paymentDate,
  518. paymentDateFormattedDate: thisData.paymentDateFormattedDate,
  519. lastYearTaxReportUrl: thisData.lastYearTaxReportUrl,
  520. auditStatus: thisData.auditStatus,
  521. level: thisData.level,
  522. aid: thisData.aid, //业务员ID
  523. mid: thisData.mid //客户经理ID
  524. });
  525. this.props.form.resetFields();
  526. }.bind(this),
  527. }).always(function () {
  528. this.setState({
  529. loading: false
  530. });
  531. }.bind(this));
  532. },
  533. handleSubmit(e) {
  534. if (e) {
  535. e.preventDefault();
  536. };
  537. this.props.form.validateFields((err, values) => {
  538. if (!err) {
  539. this.props.spinState(true);
  540. // //金额判断
  541. // if (values.amountMoney && values.amountMoney < 0 && values.amountMoney > 100 && /^\d+(\.\d{2})?$/.test(values.amountMoney)) {
  542. // message.warning('请输入0-100以内的金额');
  543. // return;
  544. // };
  545. if ((this.state.auditStatus == "5" && values.level == "0") || (this.state.auditStatus != "5" && values.level != "0")) {
  546. message.warning('认证状态和用户等级不匹配!');
  547. return;
  548. };
  549. $.ajax({
  550. method: "POST",
  551. dataType: "json",
  552. crossDomain: false,
  553. url: globalConfig.context + "/api/admin/updateOrgDetail",
  554. data: {
  555. uid: this.props.uid,
  556. id: this.state.id,
  557. contacts: values.contacts,
  558. contactMobile: values.contactMobile,
  559. postalAddress: values.postalAddress,
  560. postcode: values.postcode,
  561. aftUsername: values.aftUsername,
  562. unitName: values.unitName,
  563. identityType: values.identityType, //组织性质
  564. registeredCapital: values.registeredCapital, //注册资金
  565. legalPerson: values.legalPerson,
  566. legalPersonIdCard: values.legalPersonIdCard,
  567. licenceNumber: values.licenceNumber,
  568. orgCode: values.orgCode,
  569. field: values.field ? values.field.join(',') : undefined,
  570. firstContacts: values.firstContacts,
  571. firstMobile: values.firstMobile,
  572. secondContacts: values.secondContacts,
  573. secondMobile: values.secondMobile,
  574. thirdContacts: values.thirdContacts,
  575. thirdMobile: values.thirdMobile,
  576. bankAccount: values.bankAccount,
  577. banks: values.banks,
  578. bankBranch: values.bankBranch,
  579. bankCardNumber: values.bankCardNumber,
  580. validationAmount: values.validationAmount, //打款金额
  581. paymentDateFormattedDate: values.paymentDateFormattedDate ? values.paymentDateFormattedDate.format("YYYY-MM-DD") : undefined,
  582. licenceScanningUrl: this.state.licenceScanningUrl,
  583. orgCodeUrl: this.state.orgCodeUrl,
  584. lastYearTaxReportUrl: this.state.lastYearTaxReportUrl,
  585. //process: this.state.process,
  586. licenceArea: values.licenceAddress[2],
  587. licenceCity: values.licenceAddress[1],
  588. licenceProvince: values.licenceAddress[0],
  589. locationArea: values.locationAddress[2],
  590. locationCity: values.locationAddress[1],
  591. locationProvince: values.locationAddress[0],
  592. //auditStatus: this.state.auditStatus,
  593. level: values.level,
  594. aid: values.aid, //指派业务员ID
  595. mid: values.mid, //指派客户经理ID
  596. saveSign: this.state.saveSign
  597. }
  598. }).done(function (data) {
  599. if (!data.error.length) {
  600. message.success('保存成功!');
  601. } else {
  602. message.warning(data.error[0].message);
  603. }
  604. }.bind(this)).always(function () {
  605. this.setState({
  606. saveSign: "save"
  607. });
  608. this.props.spinState(false);
  609. this.props.handleOk();
  610. }.bind(this));
  611. }
  612. });
  613. },
  614. handleCancel() {
  615. this.props.closeDesc(false);
  616. },
  617. componentWillMount() {
  618. let _me = this;
  619. eduLevelList.map(function (item, i) {
  620. _me.state.eduLvlOption.push(
  621. <Select.Option key={item.key} value={item.value} >{item.key}</Select.Option>
  622. );
  623. });
  624. this.loadData(this.props.uid);
  625. },
  626. componentWillReceiveProps(nextProps) {
  627. if (!this.props.visible && nextProps.visible) {
  628. this.loadData(nextProps.uid);
  629. this.state.tabKey = "1";
  630. };
  631. },
  632. render() {
  633. const { getFieldDecorator } = this.props.form;
  634. const FormItem = Form.Item
  635. const formItemLayout = {
  636. labelCol: { span: 6 },
  637. wrapperCol: { span: 12 },
  638. };
  639. return (
  640. <Form horizontal onSubmit={this.handleSubmit} className="person-form">
  641. <Tabs defaultActiveKey="1" activeKey={this.state.tabKey} onChange={(e) => { this.setState({ tabKey: e }); }}>
  642. <Tabs.TabPane tab="基本资料" key="1">
  643. <FormItem
  644. {...formItemLayout}
  645. label="公司名称" >
  646. {getFieldDecorator('unitName', {
  647. initialValue: this.state.unitName
  648. })(
  649. <Input />
  650. )}
  651. </FormItem>
  652. <FormItem
  653. {...formItemLayout}
  654. label="认证名称" >
  655. {getFieldDecorator('aftUsername', {
  656. initialValue: this.state.aftUsername
  657. })(
  658. <Input />
  659. )}
  660. </FormItem>
  661. <FormItem
  662. {...formItemLayout}
  663. label="身份类型" >
  664. {getFieldDecorator('identityType', {
  665. initialValue: this.state.identityType
  666. })(
  667. <Select placeholder="身份类型" style={{ width: 200 }}
  668. onChange={(e) => { this.state.identityType = e }}>
  669. {this.state.eduLvlOption}
  670. </Select>
  671. )}
  672. </FormItem>
  673. <FormItem className="half-item"
  674. {...formItemLayout}
  675. label="领域" >
  676. {getFieldDecorator('field', {
  677. initialValue: this.state.field
  678. })(
  679. <Cascader placeholder="请选择一个领域" options={techFieldList} />
  680. )}
  681. </FormItem>
  682. <FormItem
  683. {...formItemLayout}
  684. label="第一联系人" >
  685. {getFieldDecorator('firstContacts', {
  686. initialValue: this.state.firstContacts
  687. })(
  688. <Input />
  689. )}
  690. </FormItem>
  691. <FormItem
  692. {...formItemLayout}
  693. label="第一联系人电话" >
  694. {getFieldDecorator('firstMobile', {
  695. initialValue: this.state.firstMobile
  696. })(
  697. <Input />
  698. )}
  699. </FormItem>
  700. <FormItem
  701. {...formItemLayout}
  702. label="第二联系人" >
  703. {getFieldDecorator('secondContacts', {
  704. initialValue: this.state.secondContacts
  705. })(
  706. <Input />
  707. )}
  708. </FormItem>
  709. <FormItem
  710. {...formItemLayout}
  711. label="第二联系人电话" >
  712. {getFieldDecorator('secondMobile', {
  713. initialValue: this.state.secondMobile
  714. })(
  715. <Input />
  716. )}
  717. </FormItem>
  718. <FormItem
  719. {...formItemLayout}
  720. label="第三联系人" >
  721. {getFieldDecorator('thirdContacts', {
  722. initialValue: this.state.thirdContacts
  723. })(
  724. <Input />
  725. )}
  726. </FormItem>
  727. <FormItem
  728. {...formItemLayout}
  729. label="第三联系人电话" >
  730. {getFieldDecorator('thirdMobile', {
  731. initialValue: this.state.thirdMobile
  732. })(
  733. <Input />
  734. )}
  735. </FormItem>
  736. </Tabs.TabPane>
  737. <Tabs.TabPane tab="认证信息" key="2">
  738. <FormItem
  739. {...formItemLayout}
  740. label="法人" >
  741. {getFieldDecorator('legalPerson', {
  742. initialValue: this.state.legalPerson
  743. })(
  744. <Input />
  745. )}
  746. </FormItem>
  747. <FormItem
  748. {...formItemLayout}
  749. label="法人身份证号" >
  750. {getFieldDecorator('legalPersonIdCard', {
  751. initialValue: this.state.legalPersonIdCard
  752. })(
  753. <Input />
  754. )}
  755. </FormItem>
  756. <FormItem
  757. {...formItemLayout}
  758. label="注册资金" >
  759. {getFieldDecorator('registeredCapital', {
  760. initialValue: this.state.registeredCapital
  761. })(
  762. <InputNumber min={0} max={999999} step={1} />
  763. )}
  764. <span> 万元</span>
  765. </FormItem>
  766. <FormItem
  767. {...formItemLayout}
  768. label="营业执照编号" >
  769. {getFieldDecorator('licenceNumber', {
  770. initialValue: this.state.licenceNumber
  771. })(
  772. <Input />
  773. )}
  774. </FormItem>
  775. <FormItem
  776. {...formItemLayout}
  777. label="营业执照所在地" >
  778. {getFieldDecorator('licenceAddress', {
  779. initialValue: this.state.licenceAddress
  780. })(
  781. <Cascader options={areaSelect()} placeholder="请选择地址" />
  782. )}
  783. </FormItem>
  784. <FormItem
  785. labelCol={{ span: 6 }}
  786. wrapperCol={{ span: 18 }}
  787. label="营业执照图片" >
  788. <div className="idcard-img clearfix">
  789. {this.state.licenceScanningUrl ? <div>
  790. <div className="idcard-imgbox">
  791. <img src={globalConfig.context + '/open/writeImage?path=' + this.state.licenceScanningUrl} alt="点击查看大图"
  792. onClick={(e) => { window.open(e.target.src) }} />
  793. </div>
  794. </div> : <div>
  795. <p><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传</p>
  796. </div>}
  797. <Upload
  798. name="licence"
  799. action={globalConfig.context + "/api/admin/userCertify/upload"}
  800. data={{
  801. 'uid': this.props.uid,
  802. 'sign': 'licence'
  803. }}
  804. beforeUpload={beforeUploadFile}
  805. showUploadList={false}
  806. onChange={(info) => {
  807. if (info.file.status !== 'uploading') {
  808. console.log(info.file, info.fileList);
  809. }
  810. if (info.file.status === 'done') {
  811. if (!info.file.response.error.length) {
  812. message.success(`${info.file.name} 文件上传成功!`);
  813. } else {
  814. message.warning(info.file.response.error[0].message);
  815. return;
  816. };
  817. this.state.licenceScanningUrl = info.file.response.data;
  818. } else if (info.file.status === 'error') {
  819. message.error(`${info.file.name} 文件上传失败。`);
  820. }
  821. }} >
  822. <Button><Icon type="upload" /> 上传营业执照 </Button>
  823. </Upload>
  824. </div>
  825. </FormItem>
  826. <FormItem
  827. {...formItemLayout}
  828. label="组织机构代码" >
  829. {getFieldDecorator('orgCode', {
  830. initialValue: this.state.orgCode
  831. })(
  832. <Input />
  833. )}
  834. </FormItem>
  835. <FormItem
  836. labelCol={{ span: 6 }}
  837. wrapperCol={{ span: 18 }}
  838. label="组织机构代码证图片" >
  839. <div className="idcard-img clearfix">
  840. {this.state.orgCodeUrl ? <div>
  841. <div className="idcard-imgbox">
  842. <img src={globalConfig.context + '/open/writeImage?path=' + this.state.orgCodeUrl} alt="点击查看大图"
  843. onClick={(e) => { window.open(e.target.src) }} />
  844. </div>
  845. </div> : <div>
  846. <p><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传</p>
  847. </div>}
  848. <Upload
  849. name="orgCode"
  850. action={globalConfig.context + "/api/admin/userCertify/upload"}
  851. data={{ 'uid': this.props.uid, 'sign': 'orgcode' }}
  852. beforeUpload={beforeUploadFile}
  853. showUploadList={false}
  854. onChange={(info) => {
  855. if (info.file.status !== 'uploading') {
  856. console.log(info.file, info.fileList);
  857. }
  858. if (info.file.status === 'done') {
  859. if (!info.file.response.error.length) {
  860. message.success(`${info.file.name} 文件上传成功!`);
  861. } else {
  862. message.warning(info.file.response.error[0].message);
  863. return;
  864. };
  865. this.state.orgCodeUrl = info.file.response.data;
  866. } else if (info.file.status === 'error') {
  867. message.error(`${info.file.name} 文件上传失败。`);
  868. }
  869. }} >
  870. <Button><Icon type="upload" /> 上传组织机构代码证 </Button>
  871. </Upload>
  872. </div>
  873. </FormItem>
  874. <FormItem
  875. labelCol={{ span: 6 }}
  876. wrapperCol={{ span: 18 }}
  877. label="上年度纳税报表" >
  878. <div className="idcard-img clearfix">
  879. {this.state.lastYearTaxReportUrl ? <div>
  880. <a onClick={newDownloadFile.bind(null, this.state.lastYearTaxReportId, "last_year_ratepay", "/api/admin/patent/downloadRatepay")}>上年度纳税报表</a>
  881. </div> : <div>
  882. <p><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传</p>
  883. </div>}
  884. <Upload
  885. name="ratepay"
  886. action={globalConfig.context + "/api/admin/userCertify/upload"}
  887. data={{ 'uid': this.props.uid, 'sign': 'ratepay' }}
  888. beforeUpload={beforeUploadFile}
  889. showUploadList={false}
  890. onChange={(info) => {
  891. if (info.file.status !== 'uploading') {
  892. console.log(info.file, info.fileList);
  893. }
  894. if (info.file.status === 'done') {
  895. if (!info.file.response.error.length) {
  896. message.success(`${info.file.name} 文件上传成功!`);
  897. } else {
  898. message.warning(info.file.response.error[0].message);
  899. return;
  900. };
  901. this.state.lastYearTaxReportUrl = info.file.response.data;
  902. } else if (info.file.status === 'error') {
  903. message.error(`${info.file.name} 文件上传失败。`);
  904. }
  905. }} >
  906. <Button><Icon type="upload" /> 上传上年度纳税表 </Button>
  907. </Upload>
  908. </div>
  909. </FormItem>
  910. <FormItem
  911. {...formItemLayout}
  912. label="开户银行" >
  913. {getFieldDecorator('banks', {
  914. initialValue: this.state.banks
  915. })(
  916. <Input />
  917. )}
  918. </FormItem>
  919. <FormItem
  920. {...formItemLayout}
  921. label="开户银行支行" >
  922. {getFieldDecorator('bankBranch', {
  923. initialValue: this.state.bankBranch
  924. })(
  925. <Input />
  926. )}
  927. </FormItem>
  928. <FormItem
  929. {...formItemLayout}
  930. label="银行卡号" >
  931. {getFieldDecorator('bankCardNumber', {
  932. initialValue: this.state.bankCardNumber
  933. })(
  934. <Input />
  935. )}
  936. </FormItem>
  937. <FormItem
  938. {...formItemLayout}
  939. label="开户行所在地" >
  940. {getFieldDecorator('locationAddress', {
  941. initialValue: this.state.locationAddress
  942. })(
  943. <Cascader options={areaSelect()} placeholder="请选择地址" />
  944. )}
  945. </FormItem>
  946. <FormItem
  947. {...formItemLayout}
  948. label="用户等级" >
  949. {getFieldDecorator('level', {
  950. initialValue: this.state.level
  951. })(
  952. <Select placeholder="选择要修改的用户等级" style={{ width: 200 }} >
  953. <Select.Option value="0" >Lv.0</Select.Option>
  954. <Select.Option value="1" >Lv.1</Select.Option>
  955. <Select.Option value="2" >Lv.2</Select.Option>
  956. <Select.Option value="3" >Lv.3</Select.Option>
  957. <Select.Option value="4" >Lv.4</Select.Option>
  958. <Select.Option value="5" >Lv.5</Select.Option>
  959. </Select>
  960. )}
  961. </FormItem>
  962. <FormItem
  963. {...formItemLayout}
  964. label="认证状态" >
  965. {getFieldDecorator('auditStatus')(
  966. <span>{getAuditState(this.state.auditStatus)}</span>
  967. )}
  968. </FormItem>
  969. <FormItem
  970. {...formItemLayout}
  971. label="业务员" >
  972. {getFieldDecorator('aid')(
  973. <span>{this.props.data.adminName}</span>
  974. )}
  975. </FormItem>
  976. <FormItem
  977. {...formItemLayout}
  978. label="客户经理" >
  979. {getFieldDecorator('mid')(
  980. <span>{this.props.data.managerName}</span>
  981. )}
  982. </FormItem>
  983. </Tabs.TabPane>
  984. </Tabs>
  985. <FormItem wrapperCol={{ span: 12, offset: 4 }}>
  986. <Button className="set-submit" type="primary" htmlType="submit">保存</Button>
  987. <Button className="set-submit" type="ghost"
  988. onClick={() => {
  989. this.state.saveSign = "submit";
  990. this.handleSubmit();
  991. }}>提交审核</Button>
  992. </FormItem>
  993. </Form >
  994. );
  995. }
  996. }));
  997. const OrgDesc = React.createClass({
  998. getInitialState() {
  999. return {
  1000. visible: false,
  1001. loading: false
  1002. };
  1003. },
  1004. showModal() {
  1005. this.setState({
  1006. visible: true,
  1007. });
  1008. },
  1009. handleCancel(e) {
  1010. this.setState({
  1011. visible: false,
  1012. });
  1013. this.props.closeDesc(false);
  1014. },
  1015. handleOk(e) {
  1016. this.setState({
  1017. visible: false,
  1018. });
  1019. this.props.closeDesc(false, true);
  1020. },
  1021. componentWillReceiveProps(nextProps) {
  1022. this.state.visible = nextProps.showDesc;
  1023. },
  1024. spinChange(e) {
  1025. this.setState({
  1026. loading: e
  1027. });
  1028. },
  1029. render() {
  1030. if (this.props.data) {
  1031. return (
  1032. <div className="patent-desc">
  1033. <Modal maskClosable={false} title="用户详情" visible={this.state.visible}
  1034. onCancel={this.handleCancel}
  1035. width='600px'
  1036. footer=''
  1037. className="admin-desc-content">
  1038. <Spin spinning={this.state.loading} className='spin-box'>
  1039. {window.showAuditStatus ? <OrgShow
  1040. uid={this.props.data.id}
  1041. data={this.props.data}
  1042. closeDesc={this.handleCancel}
  1043. spinState={this.spinChange}
  1044. visible={this.state.visible}
  1045. handleOk={this.handleOk} />
  1046. : <OrgCertify
  1047. uid={this.props.data.id}
  1048. data={this.props.data}
  1049. closeDesc={this.handleCancel}
  1050. spinState={this.spinChange}
  1051. visible={this.state.visible}
  1052. handleOk={this.handleOk} />}
  1053. </Spin>
  1054. </Modal>
  1055. </div>
  1056. );
  1057. } else {
  1058. return <div></div>
  1059. }
  1060. },
  1061. });
  1062. export default OrgDesc;
  1063. // <FormItem
  1064. // {...formItemLayout}
  1065. // label="打款金额"
  1066. // >
  1067. // {getFieldDecorator('validationAmount', {
  1068. // initialValue: this.state.validationAmount
  1069. // })(
  1070. // <Input />
  1071. // )}
  1072. // </FormItem>
  1073. // <FormItem
  1074. // {...formItemLayout}
  1075. // label="打款日期"
  1076. // >
  1077. // {getFieldDecorator('paymentDateFormattedDate', {
  1078. // initialValue: this.state.paymentDate ? moment(this.state.paymentDate) : null
  1079. // })(
  1080. // <DatePicker />
  1081. // )}
  1082. // </FormItem>