orgCertify.jsx 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441
  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 } 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. legalPerson: thisData.legalPerson,
  56. legalPersonIdCard: thisData.legalPersonIdCard,
  57. licenceNumber: thisData.licenceNumber,
  58. licenceScanningUrl: thisData.licenceScanningUrl,
  59. orgCode: thisData.orgCode,
  60. orgCodeUrl: thisData.orgCodeUrl,
  61. bankAccount: thisData.bankAccount,
  62. banks: thisData.banks,
  63. bankBranch: thisData.bankBranch,
  64. bankCardNumber: thisData.bankCardNumber,
  65. validationAmount: thisData.validationAmount, //打款金额
  66. paymentDate: thisData.paymentDate,
  67. paymentDateFormattedDate: thisData.paymentDateFormattedDate,
  68. lastYearTaxReportUrl: thisData.lastYearTaxReportUrl,
  69. auditStatus: thisData.auditStatus,
  70. process: thisData.process
  71. });
  72. this.props.form.resetFields();
  73. }.bind(this),
  74. }).always(function () {
  75. this.setState({
  76. loading: false
  77. });
  78. }.bind(this));
  79. },
  80. handleSubmit(e) {
  81. e.preventDefault();
  82. this.props.form.validateFields((err, values) => {
  83. if (!err) {
  84. this.setState({
  85. loading: true
  86. });
  87. let licenceA = document.getElementById('licenceArea').value;
  88. let licenceC = document.getElementById('licenceCity').value;
  89. let licenceP = document.getElementById('licenceProvince').value;
  90. let locationA = document.getElementById('locationArea').value;
  91. let locationC = document.getElementById('locationCity').value;
  92. let locationP = document.getElementById('locationProvince').value;
  93. $.ajax({
  94. method: "POST",
  95. dataType: "json",
  96. crossDomain: false,
  97. url: globalConfig.context + "/api/admin/updateOrgDetail",
  98. data: {
  99. uid: this.props.uid,
  100. id: this.state.id,
  101. contacts: values.contacts,
  102. contactMobile: values.contactMobile,
  103. postalAddress: values.postalAddress,
  104. postcode: values.postcode,
  105. aftUsername: values.aftUsername,
  106. unitName: values.unitName,
  107. identityType: values.identityType, //组织性质
  108. registeredCapital: values.registeredCapital, //注册资金
  109. legalPerson: values.legalPerson,
  110. legalPersonIdCard: values.legalPersonIdCard,
  111. licenceNumber: values.licenceNumber,
  112. orgCode: values.orgCode,
  113. bankAccount: values.bankAccount,
  114. banks: values.banks,
  115. bankBranch: values.bankBranch,
  116. bankCardNumber: values.bankCardNumber,
  117. validationAmount: values.validationAmount, //打款金额
  118. paymentDateFormattedDate: values.paymentDateFormattedDate ? values.paymentDateFormattedDate.format("YYYY-MM-DD") : undefined,
  119. auditStatus: values.auditStatus,
  120. process: values.process,
  121. licenceArea: licenceA,
  122. licenceCity: licenceC,
  123. licenceProvince: licenceP,
  124. locationArea: locationA,
  125. locationCity: locationC,
  126. locationProvince: locationP
  127. }
  128. }).done(function (data) {
  129. if (!data.error.length) {
  130. message.success('保存成功!');
  131. } else {
  132. message.warning(data.error[0].message);
  133. }
  134. }.bind(this)).always(function () {
  135. this.setState({
  136. visible: false,
  137. });
  138. this.props.handleOk();
  139. }.bind(this));
  140. }
  141. });
  142. },
  143. handleCancel() {
  144. this.props.closeDesc(false);
  145. },
  146. componentWillMount() {
  147. let _me = this;
  148. eduLevelList.map(function (item, i) {
  149. _me.state.eduLvlOption.push(
  150. <Select.Option key={item.key} value={item.value} >{item.key}</Select.Option>
  151. );
  152. });
  153. auditStatusList.map(function (item, i) {
  154. _me.state.auditStatusOption.push(
  155. <Select.Option key={item.key} value={item.value} >{item.key}</Select.Option>
  156. );
  157. });
  158. },
  159. componentDidMount() {
  160. addressInit('licenceProvince', 'licenceCity', 'licenceArea');
  161. addressInit('locationProvince', 'locationCity', 'locationArea');
  162. this.loadData(this.props.uid);
  163. },
  164. componentWillReceiveProps(nextProps) {
  165. if (!this.props.visible && nextProps.visible) {
  166. this.loadData(nextProps.uid);
  167. };
  168. },
  169. render() {
  170. const { getFieldDecorator } = this.props.form;
  171. const FormItem = Form.Item
  172. const formItemLayout = {
  173. labelCol: { span: 6 },
  174. wrapperCol: { span: 12 },
  175. };
  176. return (
  177. <Form horizontal onSubmit={this.handleSubmit} className="person-form">
  178. <FormItem
  179. {...formItemLayout}
  180. label="公司名称"
  181. >
  182. {getFieldDecorator('unitName', {
  183. initialValue: this.state.unitName
  184. })(
  185. <Input />
  186. )}
  187. </FormItem>
  188. <FormItem
  189. {...formItemLayout}
  190. label="认证名称"
  191. >
  192. {getFieldDecorator('aftUsername', {
  193. initialValue: this.state.aftUsername
  194. })(
  195. <Input />
  196. )}
  197. </FormItem>
  198. <FormItem
  199. {...formItemLayout}
  200. label="身份类型"
  201. >
  202. {getFieldDecorator('identityType', {
  203. initialValue: this.state.identityType
  204. })(
  205. <Select placeholder="身份类型" style={{ width: 200 }}
  206. onChange={(e) => { this.state.identityType = e }}>
  207. {this.state.eduLvlOption}
  208. </Select>
  209. )}
  210. </FormItem>
  211. <FormItem
  212. {...formItemLayout}
  213. label="联系人"
  214. >
  215. {getFieldDecorator('contacts', {
  216. initialValue: this.state.contacts
  217. })(
  218. <Input />
  219. )}
  220. </FormItem>
  221. <FormItem
  222. {...formItemLayout}
  223. label="联系人电话"
  224. >
  225. {getFieldDecorator('contactMobile', {
  226. initialValue: this.state.contactMobile
  227. })(
  228. <Input />
  229. )}
  230. </FormItem>
  231. <FormItem
  232. {...formItemLayout}
  233. label="法人"
  234. >
  235. {getFieldDecorator('legalPerson', {
  236. initialValue: this.state.legalPerson
  237. })(
  238. <Input />
  239. )}
  240. </FormItem>
  241. <FormItem
  242. {...formItemLayout}
  243. label="法人身份证号"
  244. >
  245. {getFieldDecorator('legalPersonIdCard', {
  246. initialValue: this.state.legalPersonIdCard
  247. })(
  248. <Input />
  249. )}
  250. </FormItem>
  251. <FormItem
  252. {...formItemLayout}
  253. label="注册资金"
  254. >
  255. {getFieldDecorator('registeredCapital', {
  256. initialValue: this.state.registeredCapital
  257. })(
  258. <Input />
  259. )}
  260. </FormItem>
  261. <FormItem
  262. {...formItemLayout}
  263. label="营业执照编号"
  264. >
  265. {getFieldDecorator('licenceNumber', {
  266. initialValue: this.state.licenceNumber
  267. })(
  268. <Input />
  269. )}
  270. </FormItem>
  271. <FormItem
  272. labelCol={{ span: 6 }}
  273. wrapperCol={{ span: 18 }}
  274. label="营业执照所在地"
  275. >
  276. {getFieldDecorator('licenceAddress')(
  277. <div>
  278. <select id="licenceProvince" name="licenceProvince"></select>
  279. <select id="licenceCity" name="licenceCity"></select>
  280. <select id="licenceArea" name="licenceArea"></select>
  281. </div>
  282. )}
  283. </FormItem>
  284. <FormItem
  285. labelCol={{ span: 6 }}
  286. wrapperCol={{ span: 18 }}
  287. label="营业执照图片"
  288. >
  289. <div className="idcard-img clearfix">
  290. {this.state.licenceScanningUrl ? <div>
  291. <div className="idcard-imgbox">
  292. <img src={globalConfig.context + '/open/writeImage?path=' + this.state.licenceScanningUrl} alt="点击查看大图"
  293. onClick={(e) => { window.open(e.target.src) }} />
  294. </div>
  295. </div> : <div>未上传</div>}
  296. </div>
  297. </FormItem>
  298. <FormItem
  299. {...formItemLayout}
  300. label="组织机构代码"
  301. >
  302. {getFieldDecorator('orgCode', {
  303. initialValue: this.state.orgCode
  304. })(
  305. <Input />
  306. )}
  307. </FormItem>
  308. <FormItem
  309. labelCol={{ span: 6 }}
  310. wrapperCol={{ span: 18 }}
  311. label="组织机构代码证图片"
  312. >
  313. <div className="idcard-img clearfix">
  314. {this.state.orgCodeUrl ? <div>
  315. <div className="idcard-imgbox">
  316. <img src={globalConfig.context + '/open/writeImage?path=' + this.state.orgCodeUrl} alt="点击查看大图"
  317. onClick={(e) => { window.open(e.target.src) }} />
  318. </div>
  319. </div> : <div>未上传</div>}
  320. </div>
  321. </FormItem>
  322. <FormItem
  323. labelCol={{ span: 6 }}
  324. wrapperCol={{ span: 18 }}
  325. label="上年度纳税报表"
  326. >
  327. <div className="idcard-img clearfix">
  328. {this.state.lastYearTaxReportUrl ? <div>
  329. <div className="idcard-imgbox">
  330. <img src={globalConfig.context + '/open/writeImage?path=' + this.state.lastYearTaxReportUrl} alt="点击查看大图"
  331. onClick={(e) => { window.open(e.target.src) }} />
  332. </div>
  333. </div> : <div>未上传</div>}
  334. </div>
  335. </FormItem>
  336. <FormItem
  337. {...formItemLayout}
  338. label="开户银行"
  339. >
  340. {getFieldDecorator('banks', {
  341. initialValue: this.state.banks
  342. })(
  343. <Input />
  344. )}
  345. </FormItem>
  346. <FormItem
  347. {...formItemLayout}
  348. label="开户银行支行"
  349. >
  350. {getFieldDecorator('bankBranch', {
  351. initialValue: this.state.bankBranch
  352. })(
  353. <Input />
  354. )}
  355. </FormItem>
  356. <FormItem
  357. {...formItemLayout}
  358. label="银行卡号"
  359. >
  360. {getFieldDecorator('bankCardNumber', {
  361. initialValue: this.state.bankCardNumber
  362. })(
  363. <Input />
  364. )}
  365. </FormItem>
  366. <FormItem
  367. labelCol={{ span: 6 }}
  368. wrapperCol={{ span: 18 }}
  369. label="开户行所在地"
  370. >
  371. {getFieldDecorator('locationAddress')(
  372. <div>
  373. <select id="locationProvince" name="locationProvince"></select>
  374. <select id="locationCity" name="locationCity"></select>
  375. <select id="locationArea" name="locationArea"></select>
  376. </div>
  377. )}
  378. </FormItem>
  379. <FormItem
  380. {...formItemLayout}
  381. label="打款金额"
  382. >
  383. {getFieldDecorator('validationAmount', {
  384. initialValue: this.state.validationAmount
  385. })(
  386. <Input />
  387. )}
  388. </FormItem>
  389. <FormItem
  390. {...formItemLayout}
  391. label="打款日期"
  392. >
  393. {getFieldDecorator('paymentDateFormattedDate', {
  394. initialValue: this.state.paymentDate ? moment(this.state.paymentDate) : null
  395. })(
  396. <DatePicker />
  397. )}
  398. </FormItem>
  399. <FormItem
  400. {...formItemLayout}
  401. label="认证状态"
  402. >
  403. {getFieldDecorator('auditStatus', {
  404. initialValue: this.state.auditStatus
  405. })(
  406. <Select placeholder="选择认证状态" style={{ width: 200 }}
  407. onChange={(e) => { this.state.auditStatus = e }}>
  408. {this.state.auditStatusOption}
  409. </Select>
  410. )}
  411. </FormItem>
  412. <FormItem
  413. {...formItemLayout}
  414. label="认证步骤"
  415. >
  416. {getFieldDecorator('process', {
  417. initialValue: this.state.process
  418. })(
  419. <Input />
  420. )}
  421. </FormItem>
  422. <FormItem wrapperCol={{ span: 12, offset: 4 }}>
  423. <Button className="set-submit" type="primary" htmlType="submit">保存</Button>
  424. <Button className="set-submit" type="ghost" onClick={this.handleCancel} >取消</Button>
  425. </FormItem>
  426. </Form >
  427. );
  428. }
  429. }));
  430. export default OrgCertify;