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