companyDetail.jsx 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983
  1. import React from 'react';
  2. import { Icon, Form, Button, Input, Spin, message, InputNumber, DatePicker, Select, Checkbox, Cascader, Table, Radio } from 'antd';
  3. import './techProduct.less';
  4. import { provinceSelect } from '../../../../tools';
  5. import { industryList, scaleList, companyType } from '../../../../dataDic';
  6. import { techFieldList } from '../../../../DicTechFieldList';
  7. import moment from 'moment';
  8. import ajax from 'jquery/src/ajax/xhr.js';
  9. import $ from 'jquery/src/ajax';
  10. const CompanyDetail = Form.create()(React.createClass({
  11. loadInfoData(uid) {
  12. this.setState({
  13. loading: true
  14. });
  15. $.ajax({
  16. method: "get",
  17. dataType: "json",
  18. crossDomain: false,
  19. url: globalConfig.context + "/api/admin/basic/info",
  20. data: {
  21. uid: uid || this.props.data.uid
  22. }
  23. }).done(function (data) {
  24. let thisdata = data.data;
  25. if (!data.data) {
  26. if (data.error && data.error.length) {
  27. message.warning(data.error[0].message);
  28. };
  29. return;
  30. };
  31. this.setState({
  32. data: thisdata,
  33. id: thisdata.id,
  34. uid: thisdata.uid,
  35. hid: thisdata.hid,
  36. unitName: thisdata.unitName,
  37. postalAddress: thisdata.postalAddress,
  38. postcode: thisdata.postcode,
  39. contacts: thisdata.contacts,
  40. contactMobile: thisdata.contactMobile,
  41. contactsFixedTel: thisdata.contactsFixedTel,
  42. contactsFax: thisdata.contactsFax,
  43. legalPersonTel: thisdata.legalPersonTel,
  44. legalPersonFax: thisdata.legalPersonFax,
  45. legalPersonEmail: thisdata.legalPersonEmail,
  46. registeredCapital: thisdata.registeredCapital,
  47. registrationTime: thisdata.registrationTime,
  48. legalPerson: thisdata.legalPerson,
  49. legalPersonIdCard: thisdata.legalPersonIdCard,
  50. orgCode: thisdata.orgCode,
  51. ratepayCode: thisdata.ratepayCode,
  52. industry: thisdata.industry,
  53. enterpriseScale: thisdata.enterpriseScale,
  54. foreignInvestment: thisdata.foreignInvestment,
  55. taxAuthority: thisdata.taxAuthority,
  56. ratepayMethod: thisdata.ratepayMethod,
  57. listed: thisdata.listed,
  58. listedDate: thisdata.listedDate,
  59. listedType: thisdata.listedType,
  60. stockCode: thisdata.stockCode,
  61. highTechZone: thisdata.highTechZone,
  62. highTechName: thisdata.highTechName,
  63. riskInvestment: thisdata.riskInvestment,
  64. businessScope: thisdata.businessScope,
  65. firmTotal: thisdata.firmTotal,
  66. techTotal: thisdata.techTotal,
  67. listedDateFormattedDate: thisdata.listedDateFormattedDate,
  68. registrationTimeFormattedDate: thisdata.registrationTimeFormattedDate,
  69. address: [thisdata.province, thisdata.city, thisdata.area],
  70. field: thisdata.field ? thisdata.field.split(',') : [],
  71. registerType: thisdata.registerType ? thisdata.registerType.split(',') : []
  72. });
  73. }.bind(this)).always(function () {
  74. this.setState({
  75. loading: false
  76. });
  77. }.bind(this));
  78. },
  79. loadHumanData(uid) {
  80. this.setState({
  81. loading: true
  82. });
  83. $.ajax({
  84. method: "get",
  85. dataType: "json",
  86. crossDomain: false,
  87. url: globalConfig.context + "/api/admin/basic/listNature",
  88. data: {
  89. uid: uid || this.props.data.uid
  90. }
  91. }).done(function (data) {
  92. let theTableData = [];
  93. if (!data.data) {
  94. if (data.error && data.error.length) {
  95. message.warning(data.error[0].message);
  96. };
  97. return;
  98. };
  99. data.data.map(function (item) {
  100. theTableData.push({
  101. id: item.id,
  102. uid: item.uid,
  103. type: item.type,
  104. name: item.name,
  105. idNumber: item.idNumber,
  106. investment: item.investment
  107. });
  108. });
  109. this.setState({
  110. humanTableData: theTableData
  111. });
  112. }.bind(this)).always(function () {
  113. this.setState({
  114. loading: false
  115. });
  116. }.bind(this));
  117. },
  118. loadLegalData(uid) {
  119. this.setState({
  120. loading: true
  121. });
  122. $.ajax({
  123. method: "get",
  124. dataType: "json",
  125. crossDomain: false,
  126. url: globalConfig.context + "/api/admin/basic/listLegalPerson",
  127. data: {
  128. uid: uid || this.props.data.uid
  129. }
  130. }).done(function (data) {
  131. let theTableData = [];
  132. if (!data.data) {
  133. if (data.error && data.error.length) {
  134. message.warning(data.error[0].message);
  135. };
  136. return;
  137. };
  138. data.data.map(function (item) {
  139. theTableData.push({
  140. id: item.id,
  141. uid: item.uid,
  142. type: item.type,
  143. name: item.name,
  144. idNumber: item.idNumber,
  145. investment: item.investment
  146. });
  147. });
  148. this.setState({
  149. humanLegalData: theTableData
  150. });
  151. }.bind(this)).always(function () {
  152. this.setState({
  153. loading: false
  154. });
  155. }.bind(this));
  156. },
  157. getInitialState() {
  158. return {
  159. loading: false,
  160. industryOption: [],
  161. scaleOption: [],
  162. humanTableData: [],
  163. legalTableData: [],
  164. humanColumns: [
  165. {
  166. title: '公民类型',
  167. dataIndex: 'type',
  168. key: 'type',
  169. width: '130px',
  170. render: (text, record, index) => {
  171. return <Select value={record.type} onChange={(e) => { record.type = e; this.setState({ humanTableData: this.state.humanTableData }); }}>
  172. <Select.Option value="0">中国公民</Select.Option>
  173. <Select.Option value="1">外籍公民</Select.Option>
  174. </Select>
  175. }
  176. }, {
  177. title: '姓名',
  178. dataIndex: 'name',
  179. key: 'name',
  180. render: (text, record, index) => {
  181. return <Input value={record.name} onChange={(e) => { record.name = e.target.value; this.setState({ humanTableData: this.state.humanTableData }); }} />
  182. }
  183. }, {
  184. title: '身份证(护照)号',
  185. dataIndex: 'idNumber',
  186. key: 'idNumber',
  187. render: (text, record, index) => {
  188. return <Input value={record.idNumber} onChange={(e) => { record.idNumber = e.target.value; this.setState({ humanTableData: this.state.humanTableData }); }} />
  189. }
  190. }, {
  191. title: '投资额(万元)',
  192. dataIndex: 'investment',
  193. key: 'investment',
  194. render: (text, record, index) => {
  195. return <InputNumber value={record.investment} onChange={(e) => { record.investment = e; this.setState({ humanTableData: this.state.humanTableData }); }} />
  196. }
  197. }
  198. ],
  199. legalColumns: [
  200. {
  201. title: '法人类型',
  202. dataIndex: 'type',
  203. key: 'type',
  204. width: '130px',
  205. render: (text, record, index) => {
  206. return <Select value={record.type} onChange={(e) => { record.type = e; this.setState({ legalTableData: this.state.legalTableData }); }}>
  207. <Select.Option value="0">中国企业法人</Select.Option>
  208. <Select.Option value="1">外观企业法人</Select.Option>
  209. </Select>
  210. }
  211. }, {
  212. title: '名称',
  213. dataIndex: 'name',
  214. key: 'name',
  215. render: (text, record, index) => {
  216. return <Input value={record.name} onChange={(e) => { record.name = e.target.value; this.setState({ legalTableData: this.state.legalTableData }); }} />
  217. }
  218. }, {
  219. title: '组织机构代码或统一社会信用代码',
  220. dataIndex: 'orgCode',
  221. key: 'orgCode',
  222. render: (text, record, index) => {
  223. return <Input value={record.orgCode} onChange={(e) => { record.orgCode = e.target.value; this.setState({ legalTableData: this.state.legalTableData }); }} />
  224. }
  225. }, {
  226. title: '投资额(万元)',
  227. dataIndex: 'investment',
  228. key: 'investment',
  229. render: (text, record, index) => {
  230. return <InputNumber value={record.investment} onChange={(e) => { record.investment = e; this.setState({ legalTableData: this.state.legalTableData }); }} />
  231. }
  232. }
  233. ],
  234. humanSelectedRowKeys: [],
  235. humanSelectedRows: [],
  236. legalSelectedRowKeys: [],
  237. legalSelectedRows: []
  238. };
  239. },
  240. handleSubmit(e) {
  241. this.setState({
  242. loading: true
  243. });
  244. e.preventDefault();
  245. this.props.form.validateFields((err, values) => {
  246. if (!err) {
  247. $.ajax({
  248. method: "POST",
  249. dataType: "json",
  250. crossDomain: false,
  251. url: globalConfig.context + "/api/admin/basic/disposeInfo",
  252. data: {
  253. id: this.state.data.id,
  254. uid: this.props.data.uid || this.state.data.uid,
  255. hid: this.state.data.hid,
  256. unitName: values.unitName,
  257. province: values.address[0],
  258. city: values.address[1],
  259. area: values.address[2],
  260. postalAddress: values.postalAddress,
  261. postcode: values.postcode,
  262. contacts: values.contacts,
  263. contactMobile: values.contactMobile,
  264. contactsFixedTel: values.contactsFixedTel,
  265. contactsFax: values.contactsFax,
  266. legalPersonTel: values.legalPersonTel,
  267. legalPersonFax: values.legalPersonFax,
  268. legalPersonEmail: values.legalPersonEmail,
  269. registeredCapital: values.registeredCapital,
  270. legalPerson: values.legalPerson,
  271. legalPersonIdCard: values.legalPersonIdCard,
  272. orgCode: values.orgCode,
  273. ratepayCode: values.ratepayCode,
  274. industry: values.industry,
  275. enterpriseScale: values.enterpriseScale,
  276. registerType: values.registerType ? values.registerType.join(',') : '',
  277. foreignInvestment: values.foreignInvestment,
  278. field: values.field ? values.field.join(',') : '',
  279. taxAuthority: values.taxAuthority,
  280. ratepayMethod: values.ratepayMethod,
  281. listed: values.listed,
  282. listedType: values.listedType ? Number(values.listedType) : null,
  283. stockCode: values.stockCode,
  284. highTechZone: values.highTechZone,
  285. highTechName: values.highTechName,
  286. riskInvestment: values.riskInvestment,
  287. businessScope: values.businessScope,
  288. firmTotal: values.firmTotal,
  289. techTotal: values.techTotal,
  290. listedDateFormattedDate: values.listedDate ? values.listedDate.format("YYYY-MM-DD") : '',
  291. registrationTimeFormattedDate: values.registrationTime ? values.registrationTime.format("YYYY-MM-DD") : ''
  292. }
  293. }).done(function (data) {
  294. if (!data.error.length) {
  295. message.success('保存成功!');
  296. this.setState({
  297. loading: false
  298. });
  299. } else {
  300. message.warning(data.error[0].message);
  301. }
  302. }.bind(this));
  303. }
  304. });
  305. },
  306. componentWillMount() {
  307. let _me = this;
  308. industryList.map(function (item) {
  309. _me.state.industryOption.push(
  310. <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
  311. )
  312. });
  313. scaleList.map(function (item) {
  314. _me.state.scaleOption.push(
  315. <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
  316. )
  317. });
  318. this.loadHumanData();
  319. this.loadLegalData();
  320. this.loadInfoData();
  321. },
  322. componentWillReceiveProps() {
  323. },
  324. humanRemove() {
  325. let deletedIds = [];
  326. for (let idx = 0; idx < this.state.humanSelectedRows.length; idx++) {
  327. let rowItem = this.state.humanSelectedRows[idx];
  328. if (rowItem.id) {
  329. deletedIds.push(rowItem.id)
  330. }
  331. };
  332. this.setState({
  333. loading: deletedIds.length > 0
  334. });
  335. if (deletedIds.length) {
  336. $.ajax({
  337. url: globalConfig.context + '/api/admin/basic/deleteNature',
  338. method: 'post',
  339. data: {
  340. data: JSON.stringify(deletedIds)
  341. }
  342. }).done((res) => {
  343. if (!res.error.length) {
  344. Message.success("删除成功");
  345. this.state.humanSelectedRowKeys.sort((a, b) => { return b - a });
  346. for (let idx = 0; idx < this.state.humanSelectedRowKeys.length; idx++) {
  347. let dataIndex = this.state.humanSelectedRowKeys[idx];
  348. this.state.humanTableData.splice(dataIndex, 1);
  349. };
  350. this.setState({
  351. humanTableData: this.state.humanTableData,
  352. humanSelectedRowKeys: []
  353. });
  354. } else {
  355. Message.error(res.error[0].message);
  356. }
  357. }).always(() => {
  358. this.setState({
  359. loading: false
  360. });
  361. })
  362. }
  363. },
  364. humanAdd() {
  365. this.state.humanTableData.push({
  366. id: null,
  367. type: null,
  368. uid: this.state.uid,
  369. name: '',
  370. idNumber: '',
  371. investment: 0
  372. });
  373. this.setState({
  374. humanTableData: this.state.humanTableData
  375. })
  376. },
  377. humanSave() {
  378. this.setState({
  379. loading: true
  380. });
  381. $.ajax({
  382. url: globalConfig.context + '/api/admin/basic/nature',
  383. method: 'post',
  384. data: {
  385. data: JSON.stringify(this.state.humanTableData)
  386. }
  387. }).done((res) => {
  388. if (!res.error.length) {
  389. message.success("保存成功");
  390. this.loadData();
  391. } else {
  392. message.error(res.error[0].message);
  393. }
  394. }).always(() => {
  395. this.setState({
  396. loading: false
  397. });
  398. })
  399. },
  400. legalRemove() {
  401. let deletedIds = [];
  402. for (let idx = 0; idx < this.state.legalSelectedRows.length; idx++) {
  403. let rowItem = this.state.legalSelectedRows[idx];
  404. if (rowItem.id) {
  405. deletedIds.push(rowItem.id)
  406. }
  407. };
  408. this.setState({
  409. loading: deletedIds.length > 0
  410. });
  411. if (deletedIds.length) {
  412. $.ajax({
  413. url: globalConfig.context + '/api/admin/basic/deleteLegalPerson',
  414. method: 'post',
  415. data: {
  416. data: JSON.stringify(deletedIds)
  417. }
  418. }).done((res) => {
  419. if (!res.error.length) {
  420. Message.success("删除成功");
  421. this.state.legalSelectedRowKeys.sort((a, b) => { return b - a });
  422. for (let idx = 0; idx < this.state.legalSelectedRowKeys.length; idx++) {
  423. let dataIndex = this.state.legalSelectedRowKeys[idx];
  424. this.state.legalTableData.splice(dataIndex, 1);
  425. };
  426. this.setState({
  427. legalTableData: this.state.legalTableData,
  428. legalSelectedRowKeys: []
  429. });
  430. } else {
  431. Message.error(res.error[0].message);
  432. }
  433. }).always(() => {
  434. this.setState({
  435. loading: false
  436. });
  437. })
  438. }
  439. },
  440. legalAdd() {
  441. this.state.legalTableData.push({
  442. id: null,
  443. type: null,
  444. uid: this.state.uid,
  445. name: '',
  446. idNumber: '',
  447. investment: 0
  448. });
  449. this.setState({
  450. legalTableData: this.state.legalTableData
  451. })
  452. },
  453. legalSave() {
  454. this.setState({
  455. loading: true
  456. });
  457. $.ajax({
  458. url: globalConfig.context + '/api/admin/basic/legalPerson',
  459. method: 'post',
  460. data: {
  461. data: JSON.stringify(this.state.legalTableData)
  462. }
  463. }).done((res) => {
  464. if (!res.error.length) {
  465. message.success("保存成功");
  466. this.loadData();
  467. } else {
  468. message.error(res.error[0].message);
  469. }
  470. }).always(() => {
  471. this.setState({
  472. loading: false
  473. });
  474. })
  475. },
  476. render() {
  477. const FormItem = Form.Item;
  478. const { getFieldDecorator } = this.props.form;
  479. const theData = this.state;
  480. const formItemLayout = {
  481. labelCol: { span: 8 },
  482. wrapperCol: { span: 16 },
  483. };
  484. const humanRowSelection = {
  485. type: 'checkbox',
  486. selectedRowKeys: this.state.humanSelectedRowKeys,
  487. onChange: (selectedRowKeys, selectedRows) => {
  488. this.setState({
  489. humanSelectedRows: humanSelectedRows,
  490. humanSelectedRowKeys: humanSelectedRowKeys
  491. });
  492. }
  493. };
  494. const humanHasSelected = this.state.humanSelectedRowKeys.length > 0;
  495. const legalRowSelection = {
  496. type: 'checkbox',
  497. selectedRowKeys: this.state.legalSelectedRowKeys,
  498. onChange: (selectedRowKeys, selectedRows) => {
  499. this.setState({
  500. legalSelectedRows: legalSelectedRows,
  501. legalSelectedRowKeys: legalSelectedRowKeys
  502. });
  503. }
  504. };
  505. const legalHasSelected = this.state.legalSelectedRowKeys.length > 0;
  506. if (this.state.data) {
  507. return (
  508. <Form onSubmit={this.handleSubmit} className="company-detail-form">
  509. <div className="content-title">
  510. <span>企业基本信息</span>
  511. </div>
  512. <div className="clearfix">
  513. <FormItem className="half-item"
  514. {...formItemLayout}
  515. label="企业名称"
  516. >
  517. {getFieldDecorator('unitName', {
  518. rules: [{ required: true, message: '此项为必填项!' }],
  519. initialValue: theData.unitName
  520. })(
  521. <Input />
  522. )}
  523. </FormItem>
  524. <FormItem className="half-item"
  525. {...formItemLayout}
  526. label="行政区域"
  527. >
  528. {getFieldDecorator('address', {
  529. rules: [{ type: 'array', required: true, message: '此项为必填项!' }],
  530. initialValue: theData.address
  531. })(
  532. <Cascader options={provinceSelect()} />
  533. )}
  534. </FormItem>
  535. <FormItem className="half-item"
  536. {...formItemLayout}
  537. label="通信地址"
  538. >
  539. {getFieldDecorator('postalAddress', {
  540. rules: [{ required: true, message: '此项为必填项!' }],
  541. initialValue: theData.postalAddress
  542. })(
  543. <Input />
  544. )}
  545. </FormItem>
  546. <FormItem className="half-item"
  547. {...formItemLayout}
  548. label="邮编"
  549. >
  550. {getFieldDecorator('postcode', {
  551. rules: [{ required: true, message: '此项为必填项!' }],
  552. initialValue: theData.postcode
  553. })(
  554. <Input />
  555. )}
  556. </FormItem>
  557. </div>
  558. <div className="clearfix">
  559. <p className="content-title">联系人信息</p>
  560. <FormItem className="half-item"
  561. {...formItemLayout}
  562. label="姓名"
  563. >
  564. {getFieldDecorator('contacts', {
  565. rules: [{ required: true, message: '此项为必填项!' }],
  566. initialValue: theData.contacts
  567. })(
  568. <Input />
  569. )}
  570. </FormItem>
  571. <FormItem className="half-item"
  572. {...formItemLayout}
  573. label="手机"
  574. >
  575. {getFieldDecorator('contactMobile', {
  576. rules: [{ required: true, message: '此项为必填项!' }],
  577. initialValue: theData.contactMobile
  578. })(
  579. <Input />
  580. )}
  581. </FormItem>
  582. <FormItem className="half-item"
  583. {...formItemLayout}
  584. label="电话"
  585. >
  586. {getFieldDecorator('contactsFixedTel', {
  587. rules: [{ required: true, message: '此项为必填项!' }],
  588. initialValue: theData.contactsFixedTel
  589. })(
  590. <Input />
  591. )}
  592. </FormItem>
  593. <FormItem className="half-item"
  594. {...formItemLayout}
  595. label="传真"
  596. >
  597. {getFieldDecorator('contactsFax', {
  598. rules: [{ required: true, message: '此项为必填项!' }],
  599. initialValue: theData.contactsFax
  600. })(
  601. <Input />
  602. )}
  603. </FormItem>
  604. </div>
  605. <div className="clearfix">
  606. <p className="content-title">企业法人信息</p>
  607. <FormItem className="half-item"
  608. {...formItemLayout}
  609. label="电话"
  610. >
  611. {getFieldDecorator('legalPersonTel', {
  612. rules: [{ required: true, message: '此项为必填项!' }],
  613. initialValue: theData.legalPersonTel
  614. })(
  615. <Input />
  616. )}
  617. </FormItem>
  618. <FormItem className="half-item"
  619. {...formItemLayout}
  620. label="传真"
  621. >
  622. {getFieldDecorator('legalPersonFax', {
  623. rules: [{ required: true, message: '此项为必填项!' }],
  624. initialValue: theData.legalPersonFax
  625. })(
  626. <Input />
  627. )}
  628. </FormItem>
  629. <FormItem className="half-item"
  630. {...formItemLayout}
  631. label="E-mail"
  632. >
  633. {getFieldDecorator('legalPersonEmail', {
  634. rules: [{ required: true, message: '此项为必填项!' }],
  635. initialValue: theData.legalPersonEmail
  636. })(
  637. <Input />
  638. )}
  639. </FormItem>
  640. </div>
  641. <div className="content-title">
  642. <span>企业重要信息</span>
  643. </div>
  644. <div className="clearfix">
  645. <FormItem className="half-item"
  646. {...formItemLayout}
  647. label="注册资金"
  648. >
  649. {getFieldDecorator('registeredCapital', {
  650. rules: [{ type: 'number', required: true, message: '此项为必填项!' }],
  651. initialValue: theData.registeredCapital
  652. })(
  653. <InputNumber />
  654. )}
  655. <span>万元</span>
  656. </FormItem>
  657. <FormItem className="half-item"
  658. {...formItemLayout}
  659. label="注册时间"
  660. >
  661. {getFieldDecorator('registrationTime', {
  662. rules: [{ type: 'object', required: true, message: '此项为必填项!' }],
  663. initialValue: theData.registrationTime ? moment(theData.registrationTime) : null
  664. })(
  665. <DatePicker />
  666. )}
  667. </FormItem>
  668. <FormItem className="half-item"
  669. {...formItemLayout}
  670. label="法人代表姓名"
  671. >
  672. {getFieldDecorator('legalPerson', {
  673. rules: [{ required: true, message: '此项为必填项!' }],
  674. initialValue: theData.legalPerson
  675. })(
  676. <Input />
  677. )}
  678. </FormItem>
  679. <FormItem className="half-item"
  680. {...formItemLayout}
  681. label="身份证号"
  682. >
  683. {getFieldDecorator('legalPersonIdCard', {
  684. rules: [{ required: true, message: '此项为必填项!' }],
  685. initialValue: theData.legalPersonIdCard
  686. })(
  687. <Input />
  688. )}
  689. </FormItem>
  690. <FormItem className="half-item"
  691. {...formItemLayout}
  692. label="组织机构代码/统一社会信用代码"
  693. >
  694. {getFieldDecorator('orgCode', {
  695. rules: [{ required: true, message: '此项为必填项!' }],
  696. initialValue: theData.orgCode
  697. })(
  698. <Input />
  699. )}
  700. </FormItem>
  701. <FormItem className="half-item"
  702. {...formItemLayout}
  703. label="税务登记号/统一社会信用代码"
  704. >
  705. {getFieldDecorator('ratepayCode', {
  706. rules: [{ required: true, message: '此项为必填项!' }],
  707. initialValue: theData.ratepayCode
  708. })(
  709. <Input />
  710. )}
  711. </FormItem>
  712. <FormItem className="half-item"
  713. {...formItemLayout}
  714. label="所属行业"
  715. >
  716. {getFieldDecorator('industry', {
  717. rules: [{ required: true, message: '此项为必填项!' }],
  718. initialValue: theData.industry
  719. })(
  720. <Select>{this.state.industryOption}</Select>
  721. )}
  722. </FormItem>
  723. <FormItem className="half-item"
  724. {...formItemLayout}
  725. label="企业规模(注册资金)"
  726. >
  727. {getFieldDecorator('enterpriseScale', {
  728. rules: [{ required: true, message: '此项为必填项!' }],
  729. initialValue: theData.enterpriseScale
  730. })(
  731. <Select>{this.state.scaleOption}</Select>
  732. )}
  733. </FormItem>
  734. <FormItem className="half-item"
  735. {...formItemLayout}
  736. label="注册类型"
  737. >
  738. {getFieldDecorator('registerType', {
  739. rules: [{ type: 'array', required: true, message: '此项为必填项!' }],
  740. initialValue: theData.registerType
  741. })(
  742. <Cascader options={companyType} />
  743. )}
  744. </FormItem>
  745. <FormItem className="half-item"
  746. {...formItemLayout}
  747. label="外资来源地"
  748. >
  749. {getFieldDecorator('foreignInvestment', {
  750. //rules: [{ required: true, message: '此项为必填项!' }],
  751. initialValue: theData.foreignInvestment
  752. })(
  753. <Input />
  754. )}
  755. </FormItem>
  756. </div>
  757. <div className="clearfix">
  758. <FormItem className="half-item"
  759. {...formItemLayout}
  760. label="领域"
  761. >
  762. {getFieldDecorator('field', {
  763. rules: [{ type: 'array', required: true, message: '此项为必填项!' }],
  764. initialValue: [Number(theData.field[0]), theData.field[1] ? Number(theData.field[1]) : null, theData.field[2] ? Number(theData.field[2]) : null]
  765. })(
  766. <Cascader options={techFieldList} />
  767. )}
  768. </FormItem>
  769. </div>
  770. <div className="clearfix">
  771. <FormItem className="half-item"
  772. {...formItemLayout}
  773. label="企业所得税主管税务机关"
  774. >
  775. {getFieldDecorator('taxAuthority', {
  776. rules: [{ required: true, message: '此项为必填项!' }],
  777. initialValue: theData.taxAuthority
  778. })(
  779. <Radio.Group>
  780. <Radio value="0">国税</Radio>
  781. <Radio value="1">地税</Radio>
  782. </Radio.Group>
  783. )}
  784. </FormItem>
  785. <FormItem className="half-item"
  786. {...formItemLayout}
  787. label="企业所得税征收方式"
  788. >
  789. {getFieldDecorator('ratepayMethod', {
  790. rules: [{ required: true, message: '此项为必填项!' }],
  791. initialValue: theData.ratepayMethod
  792. })(
  793. <Radio.Group>
  794. <Radio value="0">查账征收</Radio>
  795. <Radio value="1">核定征收</Radio>
  796. </Radio.Group>
  797. )}
  798. </FormItem>
  799. </div>
  800. <div className="clearfix">
  801. <FormItem className="half-item"
  802. {...formItemLayout}
  803. label="是否上市"
  804. > {getFieldDecorator('listed', {
  805. rules: [{ required: true, message: '此项为必填项!' }],
  806. initialValue: theData.listed
  807. })(
  808. <Radio.Group>
  809. <Radio value="0">否</Radio>
  810. <Radio value="1">是</Radio>
  811. </Radio.Group>
  812. )}
  813. </FormItem>
  814. </div>
  815. <div className="clearfix" style={{ display: this.props.form.getFieldValue('listed') == 1 ? 'block' : 'none' }}>
  816. <FormItem className="half-item"
  817. {...formItemLayout}
  818. label="上市时间"
  819. >
  820. {getFieldDecorator('listedDate', {
  821. initialValue: theData.listedDate ? moment(theData.listedDate) : null
  822. })(
  823. <DatePicker />
  824. )}
  825. </FormItem>
  826. <FormItem className="half-item"
  827. {...formItemLayout}
  828. label="上市类型"
  829. > {getFieldDecorator('listedType', {
  830. initialValue: theData.listedType
  831. })(
  832. <Select placeholder="请选择上市类型">
  833. <Select.Option value='0'>股票型上市公司</Select.Option>
  834. <Select.Option value='1'>债券型上市公司</Select.Option>
  835. </Select>
  836. )}
  837. </FormItem>
  838. <FormItem className="half-item"
  839. {...formItemLayout}
  840. label="股票代码"
  841. > {getFieldDecorator('stockCode', {
  842. initialValue: theData.stockCode
  843. })(
  844. <Input />
  845. )}
  846. </FormItem>
  847. </div>
  848. <div className="clearfix">
  849. <FormItem className="half-item"
  850. {...formItemLayout}
  851. label="是否属于国家级高新区内企业"
  852. > {getFieldDecorator('highTechZone', {
  853. rules: [{ required: true, message: '此项为必填项!' }],
  854. initialValue: theData.highTechZone
  855. })(
  856. <Radio.Group>
  857. <Radio value="0">否</Radio>
  858. <Radio value="1">是</Radio>
  859. </Radio.Group>
  860. )}
  861. </FormItem>
  862. </div>
  863. <div className="clearfix" style={{ display: this.props.form.getFieldValue('highTechZone') == 1 ? 'block' : 'none' }}>
  864. <FormItem className="half-item"
  865. {...formItemLayout}
  866. label="国家级高新区名称"
  867. > {getFieldDecorator('highTechName', {
  868. initialValue: theData.highTechName
  869. })(
  870. <Input />
  871. )}
  872. </FormItem>
  873. </div>
  874. <div className="content-title">
  875. <span>股权结构</span>
  876. </div>
  877. <div className="clearfix">
  878. <div className="half-item">
  879. <div className="table-title">
  880. <span>自然人股权</span>
  881. <Button style={{ background: "#ea0862", border: "none", color: "#fff" }}
  882. onClick={this.humanAdd}>添加<Icon type="plus" /></Button>
  883. <Button style={{ background: "#3fcf9e", border: "none", color: "#fff" }}
  884. disabled={!humanHasSelected}
  885. onClick={this.humanRemove}>删除<Icon type="minus" /></Button>
  886. <Button type="primary" onClick={this.humanSave}>保存修改</Button>
  887. </div>
  888. <Table className="company-table" style={{ padding: '10px 20px' }}
  889. columns={this.state.humanColumns}
  890. dataSource={this.state.humanTableData}
  891. pagination={false}
  892. rowSelection={humanRowSelection} />
  893. </div>
  894. <div className="half-item">
  895. <div className="table-title">
  896. <span>法人股权</span>
  897. <Button style={{ background: "#ea0862", border: "none", color: "#fff" }}
  898. onClick={this.legalAdd}>添加<Icon type="plus" /></Button>
  899. <Button style={{ background: "#3fcf9e", border: "none", color: "#fff" }}
  900. disabled={!legalHasSelected}
  901. onClick={this.legalRemove}>删除<Icon type="minus" /></Button>
  902. <Button type="primary" onClick={this.legalSave}>保存修改</Button>
  903. </div>
  904. <Table className="company-table" style={{ padding: '10px 20px' }}
  905. columns={this.state.legalColumns}
  906. dataSource={this.state.legalTableData}
  907. pagination={false}
  908. rowSelection={legalRowSelection} />
  909. </div>
  910. </div>
  911. <FormItem style={{ width: '50%' }}
  912. {...formItemLayout}
  913. label="是否引入风险投资"
  914. >
  915. {getFieldDecorator('riskInvestment', {
  916. rules: [{ required: true, message: '此项为必填项!' }],
  917. initialValue: theData.riskInvestment
  918. })(
  919. <Radio.Group>
  920. <Radio value="0">否</Radio>
  921. <Radio value="1">是</Radio>
  922. </Radio.Group>
  923. )}
  924. </FormItem>
  925. <FormItem style={{ width: '50%' }}
  926. {...formItemLayout}
  927. label="经营范围(限400字)"
  928. >
  929. {getFieldDecorator('businessScope', {
  930. rules: [{ required: true, message: '此项为必填项!' }],
  931. initialValue: theData.businessScope
  932. })(
  933. <Input type='textarea' rows={6} />
  934. )}
  935. </FormItem>
  936. <div className="content-title">
  937. <span>员工情况</span>
  938. </div>
  939. <div className="clearfix">
  940. <FormItem className="half-item" style={{ width: '25%' }}
  941. {...formItemLayout}
  942. label="企业职工"
  943. >
  944. {getFieldDecorator('firmTotal', {
  945. initialValue: theData.firmTotal || 0
  946. })(
  947. <InputNumber />
  948. )}
  949. </FormItem>
  950. <FormItem className="half-item"
  951. {...formItemLayout}
  952. label="科技人员"
  953. >
  954. {getFieldDecorator('techTotal', {
  955. initialValue: theData.techTotal || 0
  956. })(
  957. <InputNumber />
  958. )}
  959. <span>其中科技人员占比
  960. {(() => {
  961. if (!this.props.form.getFieldValue('techTotal') || !this.props.form.getFieldValue('firmTotal')) {
  962. return 0
  963. }
  964. return (this.props.form.getFieldValue('techTotal') / this.props.form.getFieldValue('firmTotal') * 100).toFixed(2)
  965. })()}
  966. %</span>
  967. </FormItem>
  968. </div>
  969. <FormItem style={{ marginTop: '20px' }}>
  970. <Button className="set-submit" type="primary" htmlType="submit">保存</Button>
  971. <Button type="ghost" style={{ marginLeft: '20px' }} onClick={this.props.closeModal}>取消</Button>
  972. </FormItem>
  973. </Form >
  974. );
  975. } else {
  976. return (<div></div>)
  977. };
  978. }
  979. }));
  980. export default CompanyDetail;