orgDesc.jsx 51 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107
  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. <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. <Input />
  763. )}
  764. </FormItem>
  765. <FormItem
  766. {...formItemLayout}
  767. label="营业执照编号" >
  768. {getFieldDecorator('licenceNumber', {
  769. initialValue: this.state.licenceNumber
  770. })(
  771. <Input />
  772. )}
  773. </FormItem>
  774. <FormItem
  775. {...formItemLayout}
  776. label="营业执照所在地" >
  777. {getFieldDecorator('licenceAddress', {
  778. initialValue: this.state.licenceAddress
  779. })(
  780. <Cascader options={areaSelect()} placeholder="请选择地址" />
  781. )}
  782. </FormItem>
  783. <FormItem
  784. labelCol={{ span: 6 }}
  785. wrapperCol={{ span: 18 }}
  786. label="营业执照图片" >
  787. <div className="idcard-img clearfix">
  788. {this.state.licenceScanningUrl ? <div>
  789. <div className="idcard-imgbox">
  790. <img src={globalConfig.context + '/open/writeImage?path=' + this.state.licenceScanningUrl} alt="点击查看大图"
  791. onClick={(e) => { window.open(e.target.src) }} />
  792. </div>
  793. </div> : <div>
  794. <p><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传</p>
  795. </div>}
  796. <Upload
  797. name="licence"
  798. action={globalConfig.context + "/api/admin/userCertify/upload"}
  799. data={{
  800. 'uid': this.props.uid,
  801. 'sign': 'licence'
  802. }}
  803. beforeUpload={beforeUploadFile}
  804. showUploadList={false}
  805. onChange={(info) => {
  806. if (info.file.status !== 'uploading') {
  807. console.log(info.file, info.fileList);
  808. }
  809. if (info.file.status === 'done') {
  810. if (!info.file.response.error.length) {
  811. message.success(`${info.file.name} 文件上传成功!`);
  812. } else {
  813. message.warning(info.file.response.error[0].message);
  814. return;
  815. };
  816. this.state.licenceScanningUrl = info.file.response.data;
  817. } else if (info.file.status === 'error') {
  818. message.error(`${info.file.name} 文件上传失败。`);
  819. }
  820. }} >
  821. <Button><Icon type="upload" /> 上传营业执照 </Button>
  822. </Upload>
  823. </div>
  824. </FormItem>
  825. <FormItem
  826. {...formItemLayout}
  827. label="组织机构代码" >
  828. {getFieldDecorator('orgCode', {
  829. initialValue: this.state.orgCode
  830. })(
  831. <Input />
  832. )}
  833. </FormItem>
  834. <FormItem
  835. labelCol={{ span: 6 }}
  836. wrapperCol={{ span: 18 }}
  837. label="组织机构代码证图片" >
  838. <div className="idcard-img clearfix">
  839. {this.state.orgCodeUrl ? <div>
  840. <div className="idcard-imgbox">
  841. <img src={globalConfig.context + '/open/writeImage?path=' + this.state.orgCodeUrl} alt="点击查看大图"
  842. onClick={(e) => { window.open(e.target.src) }} />
  843. </div>
  844. </div> : <div>
  845. <p><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传</p>
  846. </div>}
  847. <Upload
  848. name="orgCode"
  849. action={globalConfig.context + "/api/admin/userCertify/upload"}
  850. data={{ 'uid': this.props.uid, 'sign': 'orgcode' }}
  851. beforeUpload={beforeUploadFile}
  852. showUploadList={false}
  853. onChange={(info) => {
  854. if (info.file.status !== 'uploading') {
  855. console.log(info.file, info.fileList);
  856. }
  857. if (info.file.status === 'done') {
  858. if (!info.file.response.error.length) {
  859. message.success(`${info.file.name} 文件上传成功!`);
  860. } else {
  861. message.warning(info.file.response.error[0].message);
  862. return;
  863. };
  864. this.state.orgCodeUrl = info.file.response.data;
  865. } else if (info.file.status === 'error') {
  866. message.error(`${info.file.name} 文件上传失败。`);
  867. }
  868. }} >
  869. <Button><Icon type="upload" /> 上传组织机构代码证 </Button>
  870. </Upload>
  871. </div>
  872. </FormItem>
  873. <FormItem
  874. labelCol={{ span: 6 }}
  875. wrapperCol={{ span: 18 }}
  876. label="上年度纳税报表" >
  877. <div className="idcard-img clearfix">
  878. {this.state.lastYearTaxReportUrl ? <div>
  879. <a onClick={newDownloadFile.bind(null, this.state.lastYearTaxReportId, "last_year_ratepay", "/api/admin/patent/downloadRatepay")}>上年度纳税报表</a>
  880. </div> : <div>
  881. <p><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传</p>
  882. </div>}
  883. <Upload
  884. name="ratepay"
  885. action={globalConfig.context + "/api/admin/userCertify/upload"}
  886. data={{ 'uid': this.props.uid, 'sign': 'ratepay' }}
  887. beforeUpload={beforeUploadFile}
  888. showUploadList={false}
  889. onChange={(info) => {
  890. if (info.file.status !== 'uploading') {
  891. console.log(info.file, info.fileList);
  892. }
  893. if (info.file.status === 'done') {
  894. if (!info.file.response.error.length) {
  895. message.success(`${info.file.name} 文件上传成功!`);
  896. } else {
  897. message.warning(info.file.response.error[0].message);
  898. return;
  899. };
  900. this.state.lastYearTaxReportUrl = info.file.response.data;
  901. } else if (info.file.status === 'error') {
  902. message.error(`${info.file.name} 文件上传失败。`);
  903. }
  904. }} >
  905. <Button><Icon type="upload" /> 上传上年度纳税表 </Button>
  906. </Upload>
  907. </div>
  908. </FormItem>
  909. <FormItem
  910. {...formItemLayout}
  911. label="开户银行" >
  912. {getFieldDecorator('banks', {
  913. initialValue: this.state.banks
  914. })(
  915. <Input />
  916. )}
  917. </FormItem>
  918. <FormItem
  919. {...formItemLayout}
  920. label="开户银行支行" >
  921. {getFieldDecorator('bankBranch', {
  922. initialValue: this.state.bankBranch
  923. })(
  924. <Input />
  925. )}
  926. </FormItem>
  927. <FormItem
  928. {...formItemLayout}
  929. label="银行卡号" >
  930. {getFieldDecorator('bankCardNumber', {
  931. initialValue: this.state.bankCardNumber
  932. })(
  933. <Input />
  934. )}
  935. </FormItem>
  936. <FormItem
  937. {...formItemLayout}
  938. label="开户行所在地" >
  939. {getFieldDecorator('locationAddress', {
  940. initialValue: this.state.locationAddress
  941. })(
  942. <Cascader options={areaSelect()} placeholder="请选择地址" />
  943. )}
  944. </FormItem>
  945. <FormItem
  946. {...formItemLayout}
  947. label="用户等级" >
  948. {getFieldDecorator('level', {
  949. initialValue: this.state.level
  950. })(
  951. <Select placeholder="选择要修改的用户等级" style={{ width: 200 }} >
  952. <Select.Option value="0" >Lv.0</Select.Option>
  953. <Select.Option value="1" >Lv.1</Select.Option>
  954. <Select.Option value="2" >Lv.2</Select.Option>
  955. <Select.Option value="3" >Lv.3</Select.Option>
  956. <Select.Option value="4" >Lv.4</Select.Option>
  957. <Select.Option value="5" >Lv.5</Select.Option>
  958. </Select>
  959. )}
  960. </FormItem>
  961. <FormItem
  962. {...formItemLayout}
  963. label="认证状态" >
  964. {getFieldDecorator('auditStatus')(
  965. <span>{getAuditState(this.state.auditStatus)}</span>
  966. )}
  967. </FormItem>
  968. <FormItem
  969. {...formItemLayout}
  970. label="业务员" >
  971. {getFieldDecorator('aid')(
  972. <span>{this.props.data.adminName}</span>
  973. )}
  974. </FormItem>
  975. <FormItem
  976. {...formItemLayout}
  977. label="客户经理" >
  978. {getFieldDecorator('mid')(
  979. <span>{this.props.data.managerName}</span>
  980. )}
  981. </FormItem>
  982. </Tabs.TabPane>
  983. </Tabs>
  984. <FormItem wrapperCol={{ span: 12, offset: 4 }}>
  985. <Button className="set-submit" type="primary" htmlType="submit">保存</Button>
  986. <Button className="set-submit" type="ghost"
  987. onClick={() => {
  988. this.state.saveSign = "submit";
  989. this.handleSubmit();
  990. }}>提交审核</Button>
  991. </FormItem>
  992. </Form >
  993. );
  994. }
  995. }));
  996. const OrgDesc = React.createClass({
  997. getInitialState() {
  998. return {
  999. visible: false,
  1000. loading: false
  1001. };
  1002. },
  1003. showModal() {
  1004. this.setState({
  1005. visible: true,
  1006. });
  1007. },
  1008. handleCancel(e) {
  1009. this.setState({
  1010. visible: false,
  1011. });
  1012. this.props.closeDesc(false);
  1013. },
  1014. handleOk(e) {
  1015. this.setState({
  1016. visible: false,
  1017. });
  1018. this.props.closeDesc(false, true);
  1019. },
  1020. componentWillReceiveProps(nextProps) {
  1021. this.state.visible = nextProps.showDesc;
  1022. },
  1023. spinChange(e) {
  1024. this.setState({
  1025. loading: e
  1026. });
  1027. },
  1028. render() {
  1029. if (this.props.data) {
  1030. return (
  1031. <div className="patent-desc">
  1032. <Modal maskClosable={false} title="用户详情" visible={this.state.visible}
  1033. onCancel={this.handleCancel}
  1034. width='600px'
  1035. footer=''
  1036. className="admin-desc-content">
  1037. <Spin spinning={this.state.loading} className='spin-box'>
  1038. {window.showAuditStatus ? <OrgShow
  1039. uid={this.props.data.id}
  1040. data={this.props.data}
  1041. closeDesc={this.handleCancel}
  1042. spinState={this.spinChange}
  1043. visible={this.state.visible}
  1044. handleOk={this.handleOk} />
  1045. : <OrgCertify
  1046. uid={this.props.data.id}
  1047. data={this.props.data}
  1048. closeDesc={this.handleCancel}
  1049. spinState={this.spinChange}
  1050. visible={this.state.visible}
  1051. handleOk={this.handleOk} />}
  1052. </Spin>
  1053. </Modal>
  1054. </div>
  1055. );
  1056. } else {
  1057. return <div></div>
  1058. }
  1059. },
  1060. });
  1061. export default OrgDesc;
  1062. // <FormItem
  1063. // {...formItemLayout}
  1064. // label="打款金额"
  1065. // >
  1066. // {getFieldDecorator('validationAmount', {
  1067. // initialValue: this.state.validationAmount
  1068. // })(
  1069. // <Input />
  1070. // )}
  1071. // </FormItem>
  1072. // <FormItem
  1073. // {...formItemLayout}
  1074. // label="打款日期"
  1075. // >
  1076. // {getFieldDecorator('paymentDateFormattedDate', {
  1077. // initialValue: this.state.paymentDate ? moment(this.state.paymentDate) : null
  1078. // })(
  1079. // <DatePicker />
  1080. // )}
  1081. // </FormItem>