companyDetail.jsx 44 KB

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