orgCertify.jsx 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529
  1. import React from 'react';
  2. import { Icon, message, Input, Select, Button, Form, DatePicker } 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 { addressInit } from '../../tools.js';
  9. const OrgCertify = Form.create()(React.createClass({
  10. getInitialState() {
  11. return {
  12. visible: false,
  13. loading: false,
  14. eduLvlOption: [],
  15. auditStatusOption: []
  16. };
  17. },
  18. loadData(uid) {
  19. this.state.data = [];
  20. this.setState({
  21. loading: true
  22. });
  23. $.ajax({
  24. method: "post",
  25. dataType: "json",
  26. crossDomain: false,
  27. url: globalConfig.context + "/api/admin/orgDetail",
  28. data: {
  29. uid: uid
  30. },
  31. success: function (data) {
  32. let thisData = data.data;
  33. if (!thisData) {
  34. if (data.error && data.error.length) {
  35. message.warning(data.error[0].message);
  36. };
  37. thisData = {};
  38. };
  39. addressInit('licenceProvince', 'licenceCity', 'licenceArea',
  40. thisData.licenceProvince, thisData.licenceCity, thisData.licenceArea);
  41. addressInit('locationProvince', 'locationCity', 'locationArea',
  42. thisData.locationProvince, thisData.locationCity, thisData.locationArea);
  43. this.setState({
  44. id: thisData.id,
  45. contacts: thisData.contacts,
  46. contactMobile: thisData.contactMobile,
  47. fixedTel: thisData.fixedTel,
  48. qq: thisData.qq,
  49. postalAddress: thisData.postalAddress,
  50. postcode: thisData.postcode,
  51. aftUsername: thisData.aftUsername,
  52. unitName: thisData.unitName,
  53. identityType: thisData.identityType, //组织性质
  54. registeredCapital: thisData.registeredCapital, //注册资金
  55. firstContacts: thisData.firstContacts,
  56. firstMobile: thisData.firstMobile,
  57. secondContacts: thisData.secondContacts,
  58. secondMobile: thisData.secondMobile,
  59. thirdContacts: thisData.thirdContacts,
  60. thirdMobile: thisData.thirdMobile,
  61. legalPerson: thisData.legalPerson,
  62. legalPersonIdCard: thisData.legalPersonIdCard,
  63. licenceNumber: thisData.licenceNumber,
  64. licenceScanningUrl: thisData.licenceScanningUrl,
  65. orgCode: thisData.orgCode,
  66. orgCodeUrl: thisData.orgCodeUrl,
  67. bankAccount: thisData.bankAccount,
  68. banks: thisData.banks,
  69. bankBranch: thisData.bankBranch,
  70. bankCardNumber: thisData.bankCardNumber,
  71. validationAmount: thisData.validationAmount, //打款金额
  72. paymentDate: thisData.paymentDate,
  73. paymentDateFormattedDate: thisData.paymentDateFormattedDate,
  74. lastYearTaxReportUrl: thisData.lastYearTaxReportUrl,
  75. auditStatus: thisData.auditStatus,
  76. //process: thisData.process ? String(thisData.process) : undefined
  77. });
  78. this.props.form.resetFields();
  79. }.bind(this),
  80. }).always(function () {
  81. this.setState({
  82. loading: false
  83. });
  84. }.bind(this));
  85. },
  86. handleSubmit(e) {
  87. e.preventDefault();
  88. this.props.form.validateFields((err, values) => {
  89. if (!err) {
  90. this.setState({
  91. loading: true
  92. });
  93. //
  94. let licenceA = document.getElementById('licenceArea').value;
  95. let licenceC = document.getElementById('licenceCity').value;
  96. let licenceP = document.getElementById('licenceProvince').value;
  97. let locationA = document.getElementById('locationArea').value;
  98. let locationC = document.getElementById('locationCity').value;
  99. let locationP = document.getElementById('locationProvince').value;
  100. //金额判断
  101. if (values.amountMoney && values.amountMoney < 0 && values.amountMoney > 100 && /^\d+(\.\d{2})?$/.test(values.amountMoney)) {
  102. message.warning('请输入0-100以内的金额');
  103. return;
  104. };
  105. $.ajax({
  106. method: "POST",
  107. dataType: "json",
  108. crossDomain: false,
  109. url: globalConfig.context + "/api/admin/updateOrgDetail",
  110. data: {
  111. uid: this.props.uid,
  112. id: this.state.id,
  113. contacts: values.contacts,
  114. contactMobile: values.contactMobile,
  115. postalAddress: values.postalAddress,
  116. postcode: values.postcode,
  117. aftUsername: values.aftUsername,
  118. unitName: values.unitName,
  119. identityType: values.identityType, //组织性质
  120. registeredCapital: values.registeredCapital, //注册资金
  121. legalPerson: values.legalPerson,
  122. legalPersonIdCard: values.legalPersonIdCard,
  123. licenceNumber: values.licenceNumber,
  124. orgCode: values.orgCode,
  125. firstContacts: values.firstContacts,
  126. firstMobile: values.firstMobile,
  127. secondContacts: values.secondContacts,
  128. secondMobile: values.secondMobile,
  129. thirdContacts: values.thirdContacts,
  130. thirdMobile: values.thirdMobile,
  131. bankAccount: values.bankAccount,
  132. banks: values.banks,
  133. bankBranch: values.bankBranch,
  134. bankCardNumber: values.bankCardNumber,
  135. validationAmount: values.validationAmount, //打款金额
  136. paymentDateFormattedDate: values.paymentDateFormattedDate ? values.paymentDateFormattedDate.format("YYYY-MM-DD") : undefined,
  137. auditStatus: values.auditStatus,
  138. //process: this.state.process,
  139. licenceArea: licenceA,
  140. licenceCity: licenceC,
  141. licenceProvince: licenceP,
  142. locationArea: locationA,
  143. locationCity: locationC,
  144. locationProvince: locationP
  145. }
  146. }).done(function (data) {
  147. if (!data.error.length) {
  148. message.success('保存成功!');
  149. this.props.handleOk();
  150. } else {
  151. message.warning(data.error[0].message);
  152. };
  153. }.bind(this)).always(function () {
  154. this.setState({
  155. visible: false,
  156. });
  157. }.bind(this));
  158. }
  159. });
  160. },
  161. handleCancel() {
  162. this.props.closeDesc(false);
  163. },
  164. componentWillMount() {
  165. let _me = this;
  166. eduLevelList.map(function (item, i) {
  167. _me.state.eduLvlOption.push(
  168. <Select.Option key={item.key} value={item.value} >{item.key}</Select.Option>
  169. );
  170. });
  171. auditStatusList.map(function (item, i) {
  172. _me.state.auditStatusOption.push(
  173. <Select.Option key={item.key} value={item.value} >{item.key}</Select.Option>
  174. );
  175. });
  176. },
  177. componentDidMount() {
  178. addressInit('licenceProvince', 'licenceCity', 'licenceArea');
  179. addressInit('locationProvince', 'locationCity', 'locationArea');
  180. this.loadData(this.props.uid);
  181. },
  182. componentWillReceiveProps(nextProps) {
  183. if (!this.props.visible && nextProps.visible) {
  184. this.loadData(nextProps.uid);
  185. };
  186. },
  187. render() {
  188. const { getFieldDecorator } = this.props.form;
  189. const FormItem = Form.Item
  190. const formItemLayout = {
  191. labelCol: { span: 6 },
  192. wrapperCol: { span: 12 },
  193. };
  194. return (
  195. <Form horizontal onSubmit={this.handleSubmit} className="person-form">
  196. <FormItem
  197. {...formItemLayout}
  198. label="公司名称"
  199. >
  200. {getFieldDecorator('unitName', {
  201. initialValue: this.state.unitName
  202. })(
  203. <Input />
  204. )}
  205. </FormItem>
  206. <FormItem
  207. {...formItemLayout}
  208. label="认证名称"
  209. >
  210. {getFieldDecorator('aftUsername', {
  211. initialValue: this.state.aftUsername
  212. })(
  213. <Input />
  214. )}
  215. </FormItem>
  216. <FormItem
  217. {...formItemLayout}
  218. label="身份类型"
  219. >
  220. {getFieldDecorator('identityType', {
  221. initialValue: this.state.identityType
  222. })(
  223. <Select placeholder="身份类型" style={{ width: 200 }}
  224. onChange={(e) => { this.state.identityType = e }}>
  225. {this.state.eduLvlOption}
  226. </Select>
  227. )}
  228. </FormItem>
  229. <FormItem
  230. {...formItemLayout}
  231. label="联系人"
  232. >
  233. {getFieldDecorator('contacts', {
  234. initialValue: this.state.contacts
  235. })(
  236. <Input />
  237. )}
  238. </FormItem>
  239. <FormItem
  240. {...formItemLayout}
  241. label="联系人电话"
  242. >
  243. {getFieldDecorator('contactMobile', {
  244. initialValue: this.state.contactMobile
  245. })(
  246. <Input />
  247. )}
  248. </FormItem>
  249. <FormItem
  250. {...formItemLayout}
  251. label="第一联系人"
  252. >
  253. {getFieldDecorator('firstContacts', {
  254. initialValue: this.state.firstContacts
  255. })(
  256. <Input />
  257. )}
  258. </FormItem>
  259. <FormItem
  260. {...formItemLayout}
  261. label="第一联系人电话"
  262. >
  263. {getFieldDecorator('firstMobile', {
  264. initialValue: this.state.firstMobile
  265. })(
  266. <Input />
  267. )}
  268. </FormItem>
  269. <FormItem
  270. {...formItemLayout}
  271. label="第二联系人"
  272. >
  273. {getFieldDecorator('secondContacts', {
  274. initialValue: this.state.secondContacts
  275. })(
  276. <Input />
  277. )}
  278. </FormItem>
  279. <FormItem
  280. {...formItemLayout}
  281. label="第二联系人电话"
  282. >
  283. {getFieldDecorator('secondMobile', {
  284. initialValue: this.state.secondMobile
  285. })(
  286. <Input />
  287. )}
  288. </FormItem>
  289. <FormItem
  290. {...formItemLayout}
  291. label="第三联系人"
  292. >
  293. {getFieldDecorator('thirdContacts', {
  294. initialValue: this.state.thirdContacts
  295. })(
  296. <Input />
  297. )}
  298. </FormItem>
  299. <FormItem
  300. {...formItemLayout}
  301. label="第三联系人电话"
  302. >
  303. {getFieldDecorator('thirdMobile', {
  304. initialValue: this.state.thirdMobile
  305. })(
  306. <Input />
  307. )}
  308. </FormItem>
  309. <FormItem
  310. {...formItemLayout}
  311. label="法人"
  312. >
  313. {getFieldDecorator('legalPerson', {
  314. initialValue: this.state.legalPerson
  315. })(
  316. <Input />
  317. )}
  318. </FormItem>
  319. <FormItem
  320. {...formItemLayout}
  321. label="法人身份证号"
  322. >
  323. {getFieldDecorator('legalPersonIdCard', {
  324. initialValue: this.state.legalPersonIdCard
  325. })(
  326. <Input />
  327. )}
  328. </FormItem>
  329. <FormItem
  330. {...formItemLayout}
  331. label="注册资金"
  332. >
  333. {getFieldDecorator('registeredCapital', {
  334. initialValue: this.state.registeredCapital
  335. })(
  336. <Input />
  337. )}
  338. </FormItem>
  339. <FormItem
  340. {...formItemLayout}
  341. label="营业执照编号"
  342. >
  343. {getFieldDecorator('licenceNumber', {
  344. initialValue: this.state.licenceNumber
  345. })(
  346. <Input />
  347. )}
  348. </FormItem>
  349. <FormItem
  350. labelCol={{ span: 6 }}
  351. wrapperCol={{ span: 18 }}
  352. label="营业执照所在地"
  353. >
  354. {getFieldDecorator('licenceAddress')(
  355. <div>
  356. <select id="licenceProvince" name="licenceProvince"></select>
  357. <select id="licenceCity" name="licenceCity"></select>
  358. <select id="licenceArea" name="licenceArea"></select>
  359. </div>
  360. )}
  361. </FormItem>
  362. <FormItem
  363. labelCol={{ span: 6 }}
  364. wrapperCol={{ span: 18 }}
  365. label="营业执照图片"
  366. >
  367. <div className="idcard-img clearfix">
  368. {this.state.licenceScanningUrl ? <div>
  369. <div className="idcard-imgbox">
  370. <img src={globalConfig.context + '/open/writeImage?path=' + this.state.licenceScanningUrl} alt="点击查看大图"
  371. onClick={(e) => { window.open(e.target.src) }} />
  372. </div>
  373. </div> : <div><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传</div>}
  374. </div>
  375. </FormItem>
  376. <FormItem
  377. {...formItemLayout}
  378. label="组织机构代码"
  379. >
  380. {getFieldDecorator('orgCode', {
  381. initialValue: this.state.orgCode
  382. })(
  383. <Input />
  384. )}
  385. </FormItem>
  386. <FormItem
  387. labelCol={{ span: 6 }}
  388. wrapperCol={{ span: 18 }}
  389. label="组织机构代码证图片"
  390. >
  391. <div className="idcard-img clearfix">
  392. {this.state.orgCodeUrl ? <div>
  393. <div className="idcard-imgbox">
  394. <img src={globalConfig.context + '/open/writeImage?path=' + this.state.orgCodeUrl} alt="点击查看大图"
  395. onClick={(e) => { window.open(e.target.src) }} />
  396. </div>
  397. </div> : <div><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传</div>}
  398. </div>
  399. </FormItem>
  400. <FormItem
  401. labelCol={{ span: 6 }}
  402. wrapperCol={{ span: 18 }}
  403. label="上年度纳税报表"
  404. >
  405. <div className="idcard-img clearfix">
  406. {this.state.lastYearTaxReportUrl ? <div>
  407. <div className="idcard-imgbox">
  408. <img src={globalConfig.context + '/open/writeImage?path=' + this.state.lastYearTaxReportUrl} alt="点击查看大图"
  409. onClick={(e) => { window.open(e.target.src) }} />
  410. </div>
  411. </div> : <div><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传</div>}
  412. </div>
  413. </FormItem>
  414. <FormItem
  415. {...formItemLayout}
  416. label="开户银行"
  417. >
  418. {getFieldDecorator('banks', {
  419. initialValue: this.state.banks
  420. })(
  421. <Input />
  422. )}
  423. </FormItem>
  424. <FormItem
  425. {...formItemLayout}
  426. label="开户银行支行"
  427. >
  428. {getFieldDecorator('bankBranch', {
  429. initialValue: this.state.bankBranch
  430. })(
  431. <Input />
  432. )}
  433. </FormItem>
  434. <FormItem
  435. {...formItemLayout}
  436. label="银行卡号"
  437. >
  438. {getFieldDecorator('bankCardNumber', {
  439. initialValue: this.state.bankCardNumber
  440. })(
  441. <Input />
  442. )}
  443. </FormItem>
  444. <FormItem
  445. labelCol={{ span: 6 }}
  446. wrapperCol={{ span: 18 }}
  447. label="开户行所在地"
  448. >
  449. {getFieldDecorator('locationAddress')(
  450. <div>
  451. <select id="locationProvince" name="locationProvince"></select>
  452. <select id="locationCity" name="locationCity"></select>
  453. <select id="locationArea" name="locationArea"></select>
  454. </div>
  455. )}
  456. </FormItem>
  457. <FormItem
  458. {...formItemLayout}
  459. label="打款金额"
  460. >
  461. {getFieldDecorator('validationAmount', {
  462. initialValue: this.state.validationAmount
  463. })(
  464. <Input />
  465. )}
  466. </FormItem>
  467. <FormItem
  468. {...formItemLayout}
  469. label="打款日期"
  470. >
  471. {getFieldDecorator('paymentDateFormattedDate', {
  472. initialValue: this.state.paymentDate ? moment(this.state.paymentDate) : null
  473. })(
  474. <DatePicker />
  475. )}
  476. </FormItem>
  477. <FormItem
  478. {...formItemLayout}
  479. label="认证状态"
  480. >
  481. {getFieldDecorator('auditStatus', {
  482. initialValue: this.state.auditStatus
  483. })(
  484. <Select placeholder="选择认证状态" style={{ width: 200 }}
  485. onChange={(e) => { this.state.auditStatus = e }}>
  486. {this.state.auditStatusOption}
  487. </Select>
  488. )}
  489. </FormItem>
  490. <FormItem wrapperCol={{ span: 12, offset: 4 }}>
  491. <Button className="set-submit" type="primary" htmlType="submit">保存</Button>
  492. <Button className="set-submit" type="ghost" onClick={this.handleCancel} >取消</Button>
  493. </FormItem>
  494. </Form >
  495. );
  496. }
  497. }));
  498. export default OrgCertify;
  499. // <FormItem
  500. // {...formItemLayout}
  501. // label="认证步骤"
  502. // >
  503. // {getFieldDecorator('process', {
  504. // initialValue: this.state.process
  505. // })(
  506. // <Select placeholder="选择要修改的认证步骤" style={{ width: 200 }}
  507. // onChange={(e) => { this.state.process = e }}>
  508. // {
  509. // certifyStepList.map(function (item, i) {
  510. // return <Select.Option key={i} value={item.value} >{item.key}</Select.Option>
  511. // })
  512. // }
  513. // </Select>
  514. // )}
  515. // </FormItem>