companyDetail.jsx 44 KB

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