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