companyDetail.jsx 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963
  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('contactsFixedTel', {
  568. rules: [{ required: true, message: '此项为必填项!' }],
  569. initialValue: theData.contactsFixedTel
  570. })(
  571. <Input />
  572. )}
  573. </FormItem>
  574. <FormItem className="half-item"
  575. {...formItemLayout}
  576. label="传真"
  577. >
  578. {getFieldDecorator('contactsFax', {
  579. rules: [{ required: true, message: '此项为必填项!' }],
  580. initialValue: theData.contactsFax
  581. })(
  582. <Input />
  583. )}
  584. </FormItem>
  585. </div>
  586. <div className="clearfix">
  587. <p className="content-title">企业法人信息</p>
  588. <FormItem className="half-item"
  589. {...formItemLayout}
  590. label="电话"
  591. >
  592. {getFieldDecorator('legalPersonTel', {
  593. rules: [{ required: true, message: '此项为必填项!' }],
  594. initialValue: theData.legalPersonTel
  595. })(
  596. <Input />
  597. )}
  598. </FormItem>
  599. <FormItem className="half-item"
  600. {...formItemLayout}
  601. label="传真"
  602. >
  603. {getFieldDecorator('legalPersonFax', {
  604. rules: [{ required: true, message: '此项为必填项!' }],
  605. initialValue: theData.legalPersonFax
  606. })(
  607. <Input />
  608. )}
  609. </FormItem>
  610. <FormItem className="half-item"
  611. {...formItemLayout}
  612. label="E-mail"
  613. >
  614. {getFieldDecorator('legalPersonEmail', {
  615. rules: [{ required: true, message: '此项为必填项!' }],
  616. initialValue: theData.legalPersonEmail
  617. })(
  618. <Input />
  619. )}
  620. </FormItem>
  621. </div>
  622. <div className="content-title">
  623. <span>企业重要信息</span>
  624. </div>
  625. <div className="clearfix">
  626. <FormItem className="half-item"
  627. {...formItemLayout}
  628. label="注册资金"
  629. >
  630. {getFieldDecorator('registeredCapital', {
  631. rules: [{ type: 'number', required: true, message: '此项为必填项!' }],
  632. initialValue: theData.registeredCapital
  633. })(
  634. <InputNumber />
  635. )}
  636. <span>万元</span>
  637. </FormItem>
  638. <FormItem className="half-item"
  639. {...formItemLayout}
  640. label="注册时间"
  641. >
  642. {getFieldDecorator('registrationTime', {
  643. rules: [{ type: 'object', required: true, message: '此项为必填项!' }],
  644. initialValue: theData.registrationTime ? moment(theData.registrationTime) : null
  645. })(
  646. <DatePicker />
  647. )}
  648. </FormItem>
  649. <FormItem className="half-item"
  650. {...formItemLayout}
  651. label="法人代表姓名"
  652. >
  653. {getFieldDecorator('legalPerson', {
  654. rules: [{ required: true, message: '此项为必填项!' }],
  655. initialValue: theData.legalPerson
  656. })(
  657. <Input />
  658. )}
  659. </FormItem>
  660. <FormItem className="half-item"
  661. {...formItemLayout}
  662. label="身份证号"
  663. >
  664. {getFieldDecorator('legalPersonIdCard', {
  665. rules: [{ required: true, message: '此项为必填项!' }],
  666. initialValue: theData.legalPersonIdCard
  667. })(
  668. <Input />
  669. )}
  670. </FormItem>
  671. <FormItem className="half-item"
  672. {...formItemLayout}
  673. label="组织机构代码/统一社会信用代码"
  674. >
  675. {getFieldDecorator('orgCode', {
  676. rules: [{ required: true, message: '此项为必填项!' }],
  677. initialValue: theData.orgCode
  678. })(
  679. <Input />
  680. )}
  681. </FormItem>
  682. <FormItem className="half-item"
  683. {...formItemLayout}
  684. label="税务登记号/统一社会信用代码"
  685. >
  686. {getFieldDecorator('ratepayCode', {
  687. rules: [{ required: true, message: '此项为必填项!' }],
  688. initialValue: theData.ratepayCode
  689. })(
  690. <Input />
  691. )}
  692. </FormItem>
  693. <FormItem className="half-item"
  694. {...formItemLayout}
  695. label="所属行业"
  696. >
  697. {getFieldDecorator('industry', {
  698. rules: [{ required: true, message: '此项为必填项!' }],
  699. initialValue: theData.industry
  700. })(
  701. <Select>{this.state.industryOption}</Select>
  702. )}
  703. </FormItem>
  704. <FormItem className="half-item"
  705. {...formItemLayout}
  706. label="企业规模(注册资金)"
  707. >
  708. {getFieldDecorator('enterpriseScale', {
  709. rules: [{ required: true, message: '此项为必填项!' }],
  710. initialValue: theData.enterpriseScale
  711. })(
  712. <Select>{this.state.scaleOption}</Select>
  713. )}
  714. </FormItem>
  715. <FormItem className="half-item"
  716. {...formItemLayout}
  717. label="注册类型"
  718. >
  719. {getFieldDecorator('registerType', {
  720. rules: [{ type: 'array', required: true, message: '此项为必填项!' }],
  721. initialValue: theData.registerType
  722. })(
  723. <Cascader options={companyType} />
  724. )}
  725. </FormItem>
  726. <FormItem className="half-item"
  727. {...formItemLayout}
  728. label="外资来源地"
  729. >
  730. {getFieldDecorator('foreignInvestment', {
  731. //rules: [{ required: true, message: '此项为必填项!' }],
  732. initialValue: theData.foreignInvestment
  733. })(
  734. <Input />
  735. )}
  736. </FormItem>
  737. </div>
  738. <div className="clearfix">
  739. <FormItem className="half-item"
  740. {...formItemLayout}
  741. label="领域"
  742. >
  743. {getFieldDecorator('field', {
  744. rules: [{ type: 'array', required: true, message: '此项为必填项!' }],
  745. initialValue: [Number(theData.field[0]), theData.field[1] ? Number(theData.field[1]) : null, theData.field[2] ? Number(theData.field[2]) : null]
  746. })(
  747. <Cascader options={techFieldList} />
  748. )}
  749. </FormItem>
  750. </div>
  751. <div className="clearfix">
  752. <FormItem className="half-item"
  753. {...formItemLayout}
  754. label="企业所得税主管税务机关"
  755. >
  756. {getFieldDecorator('taxAuthority', {
  757. rules: [{ required: true, message: '此项为必填项!' }],
  758. initialValue: theData.taxAuthority
  759. })(
  760. <Radio.Group>
  761. <Radio value="0">国税</Radio>
  762. <Radio value="1">地税</Radio>
  763. </Radio.Group>
  764. )}
  765. </FormItem>
  766. <FormItem className="half-item"
  767. {...formItemLayout}
  768. label="企业所得税征收方式"
  769. >
  770. {getFieldDecorator('ratepayMethod', {
  771. rules: [{ required: true, message: '此项为必填项!' }],
  772. initialValue: theData.ratepayMethod
  773. })(
  774. <Radio.Group>
  775. <Radio value="0">查账征收</Radio>
  776. <Radio value="1">核定征收</Radio>
  777. </Radio.Group>
  778. )}
  779. </FormItem>
  780. </div>
  781. <div className="clearfix">
  782. <FormItem className="half-item"
  783. {...formItemLayout}
  784. label="是否上市"
  785. > {getFieldDecorator('listed', {
  786. rules: [{ required: true, message: '此项为必填项!' }],
  787. initialValue: theData.listed
  788. })(
  789. <Radio.Group>
  790. <Radio value="0">否</Radio>
  791. <Radio value="1">是</Radio>
  792. </Radio.Group>
  793. )}
  794. </FormItem>
  795. </div>
  796. <div className="clearfix" style={{ display: this.props.form.getFieldValue('listed') == 1 ? 'block' : 'none' }}>
  797. <FormItem className="half-item"
  798. {...formItemLayout}
  799. label="上市时间"
  800. >
  801. {getFieldDecorator('listedDate', {
  802. initialValue: theData.listedDate ? moment(theData.listedDate) : null
  803. })(
  804. <DatePicker />
  805. )}
  806. </FormItem>
  807. <FormItem className="half-item"
  808. {...formItemLayout}
  809. label="上市类型"
  810. > {getFieldDecorator('listedType', {
  811. initialValue: theData.listedType
  812. })(
  813. <Select placeholder="请选择上市类型">
  814. <Select.Option value='0'>股票型上市公司</Select.Option>
  815. <Select.Option value='1'>债券型上市公司</Select.Option>
  816. </Select>
  817. )}
  818. </FormItem>
  819. <FormItem className="half-item"
  820. {...formItemLayout}
  821. label="股票代码"
  822. > {getFieldDecorator('stockCode', {
  823. initialValue: theData.stockCode
  824. })(
  825. <Input />
  826. )}
  827. </FormItem>
  828. </div>
  829. <div className="clearfix">
  830. <FormItem className="half-item"
  831. {...formItemLayout}
  832. label="是否属于国家级高新区内企业"
  833. > {getFieldDecorator('highTechZone', {
  834. rules: [{ required: true, message: '此项为必填项!' }],
  835. initialValue: theData.highTechZone
  836. })(
  837. <Radio.Group>
  838. <Radio value="0">否</Radio>
  839. <Radio value="1">是</Radio>
  840. </Radio.Group>
  841. )}
  842. </FormItem>
  843. </div>
  844. <div className="clearfix" style={{ display: this.props.form.getFieldValue('highTechZone') == 1 ? 'block' : 'none' }}>
  845. <FormItem className="half-item"
  846. {...formItemLayout}
  847. label="国家级高新区名称"
  848. > {getFieldDecorator('highTechName', {
  849. initialValue: theData.highTechName
  850. })(
  851. <Input />
  852. )}
  853. </FormItem>
  854. </div>
  855. <div className="content-title">
  856. <span>股权结构</span>
  857. </div>
  858. <div className="clearfix">
  859. <div className="half-item">
  860. <div className="table-title">
  861. <span>自然人股权</span>
  862. <Button style={{ background: "#ea0862", border: "none", color: "#fff" }}
  863. onClick={this.humanAdd}>添加<Icon type="plus" /></Button>
  864. <Button style={{ background: "#3fcf9e", border: "none", color: "#fff" }}
  865. disabled={!humanHasSelected}
  866. onClick={this.humanRemove}>删除<Icon type="minus" /></Button>
  867. <Button type="primary" onClick={this.humanSave}>保存修改</Button>
  868. </div>
  869. <Table className="company-table" style={{ padding: '10px 20px' }}
  870. columns={this.state.humanColumns}
  871. dataSource={this.state.humanTableData}
  872. pagination={false}
  873. rowSelection={humanRowSelection} />
  874. </div>
  875. <div className="half-item">
  876. <div className="table-title">
  877. <span>法人股权</span>
  878. <Button style={{ background: "#ea0862", border: "none", color: "#fff" }}
  879. onClick={this.legalAdd}>添加<Icon type="plus" /></Button>
  880. <Button style={{ background: "#3fcf9e", border: "none", color: "#fff" }}
  881. disabled={!legalHasSelected}
  882. onClick={this.legalRemove}>删除<Icon type="minus" /></Button>
  883. <Button type="primary" onClick={this.legalSave}>保存修改</Button>
  884. </div>
  885. <Table className="company-table" style={{ padding: '10px 20px' }}
  886. columns={this.state.legalColumns}
  887. dataSource={this.state.legalTableData}
  888. pagination={false}
  889. rowSelection={legalRowSelection} />
  890. </div>
  891. </div>
  892. <FormItem style={{ width: '50%' }}
  893. {...formItemLayout}
  894. label="是否引入风险投资"
  895. >
  896. {getFieldDecorator('riskInvestment', {
  897. rules: [{ required: true, message: '此项为必填项!' }],
  898. initialValue: theData.riskInvestment
  899. })(
  900. <Radio.Group>
  901. <Radio value="0">否</Radio>
  902. <Radio value="1">是</Radio>
  903. </Radio.Group>
  904. )}
  905. </FormItem>
  906. <FormItem style={{ width: '50%' }}
  907. {...formItemLayout}
  908. label="经营范围(限400字)"
  909. >
  910. {getFieldDecorator('businessScope', {
  911. rules: [{ required: true, message: '此项为必填项!' }],
  912. initialValue: theData.businessScope
  913. })(
  914. <Input type='textarea' rows={6} />
  915. )}
  916. </FormItem>
  917. <div className="content-title">
  918. <span>员工情况</span>
  919. </div>
  920. <div className="clearfix">
  921. <FormItem className="half-item" style={{ width: '25%' }}
  922. {...formItemLayout}
  923. label="企业职工"
  924. >
  925. {getFieldDecorator('firmTotal', {
  926. initialValue: theData.firmTotal || 0
  927. })(
  928. <InputNumber />
  929. )}
  930. </FormItem>
  931. <FormItem className="half-item"
  932. {...formItemLayout}
  933. label="科技人员"
  934. >
  935. {getFieldDecorator('techTotal', {
  936. initialValue: theData.techTotal || 0
  937. })(
  938. <InputNumber />
  939. )}
  940. <span>其中科技人员占比
  941. {(() => {
  942. if (!this.props.form.getFieldValue('techTotal') || !this.props.form.getFieldValue('firmTotal')) {
  943. return 0
  944. }
  945. return (this.props.form.getFieldValue('techTotal') / this.props.form.getFieldValue('firmTotal') * 100).toFixed(2)
  946. })()}
  947. %</span>
  948. </FormItem>
  949. </div>
  950. <FormItem style={{ marginTop: '20px' }}>
  951. <Button className="set-submit" type="primary" htmlType="submit">保存</Button>
  952. <Button type="ghost" style={{ marginLeft: '20px' }} onClick={this.props.closeModal}>取消</Button>
  953. </FormItem>
  954. </Form >
  955. );
  956. } else {
  957. return (<div></div>)
  958. };
  959. }
  960. }));
  961. export default CompanyDetail;