companyDetail.jsx 44 KB

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