orgCertify.jsx 17 KB

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