orgCertify.jsx 17 KB

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