companyDetail.jsx 44 KB

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