orgCertify.jsx 15 KB

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