orgDesc.jsx 52 KB

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