annualReport.jsx 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788
  1. import React from 'react';
  2. import { Icon, Form, Button, Input, Spin, Table, message, Select, Modal, InputNumber } from 'antd';
  3. import './annualReport.less';
  4. import { annualReportStateList } from '../../dataDic.js';
  5. import { beforeUploadFile, getAnnualReportState } from '../../tools.js';
  6. import { getProvince } from '../../NewDicProvinceList'
  7. import moment from 'moment';
  8. import ajax from 'jquery/src/ajax/xhr.js';
  9. import $ from 'jquery/src/ajax';
  10. const AnnualReportDescFrom = Form.create()(React.createClass({
  11. getInitialState() {
  12. return {
  13. loading: false,
  14. data: {},
  15. contactsOption: [],
  16. contactsObj: {},
  17. yearOption: []
  18. };
  19. },
  20. loadData(theYear) {
  21. this.setState({
  22. loading: true
  23. })
  24. $.ajax({
  25. method: "post",
  26. dataType: "json",
  27. crossDomain: false,
  28. url: globalConfig.context + "/api/user/cognizance/annualReportDetail",
  29. data: {
  30. year: theYear || this.props.data.year
  31. }
  32. }).done((data) => {
  33. let thisdata = data.data;
  34. if (!thisdata) {
  35. if (data.error && data.error.length) {
  36. message.warning(data.error[0].message);
  37. };
  38. thisdata = {};
  39. } else {
  40. thisdata.location = getProvince(thisdata.locationProvince, thisdata.locationCity, thisdata.locationArea);
  41. };
  42. this.setState({
  43. data: thisdata
  44. });
  45. }).always(function () {
  46. this.setState({
  47. loading: false
  48. })
  49. }.bind(this));
  50. },
  51. getContactsOption() {
  52. let theOption = [], theObj = {};
  53. $.ajax({
  54. method: "get",
  55. dataType: "json",
  56. crossDomain: false,
  57. url: globalConfig.context + '/api/user/getContacts',
  58. success: function (data) {
  59. if (!data.data) {
  60. if (data.error && data.error.length) {
  61. message.warning(data.error[0].message);
  62. };
  63. } else {
  64. for (let item in data.data) {
  65. let theData = data.data[item];
  66. theOption.push(
  67. <Select.Option value={item} key={theData}>{theData}</Select.Option>
  68. );
  69. };
  70. theObj = data.data || {};
  71. };
  72. this.setState({
  73. contactsOption: theOption,
  74. contactsObj: theObj
  75. });
  76. }.bind(this)
  77. });
  78. },
  79. componentWillMount() {
  80. let d = new Date();
  81. let _me = this;
  82. d = d.getFullYear();
  83. for (let i = d; i > d - 20; i--) {
  84. _me.state.yearOption.push(
  85. <Select.Option key={i.toString()} >{i}</Select.Option>
  86. )
  87. };
  88. this.getContactsOption();
  89. if (this.props.data) {
  90. this.loadData();
  91. };
  92. },
  93. componentWillReceiveProps(nextProps) {
  94. if (!this.props.visible && nextProps.visible) {
  95. if (nextProps.data) {
  96. this.loadData(nextProps.data.year)
  97. };
  98. };
  99. },
  100. handleSubmit(e) {
  101. e.preventDefault();
  102. this.props.form.validateFields((err, values) => {
  103. if (!err) {
  104. this.props.spinState(true);
  105. $.ajax({
  106. method: "POST",
  107. dataType: "json",
  108. crossDomain: false,
  109. url: globalConfig.context + "/api/user/cognizance/disposeAnnualReport",
  110. data: {
  111. id: this.props.data.id,
  112. year: this.props.data.year,
  113. totalTax: values.totalTax,
  114. incomeTaxRelief: values.incomeTaxRelief,
  115. totalExportVolume: values.totalExportVolume,
  116. basicResearchCost: values.basicResearchCost,
  117. state: 0,
  118. }
  119. }).done(function (data) {
  120. if (!data.error.length) {
  121. message.success('保存成功!');
  122. this.props.clickOk();
  123. this.props.spinState(false);
  124. this.props.form.resetFields();
  125. } else {
  126. message.warning(data.error[0].message);
  127. this.props.spinState(false);
  128. }
  129. }.bind(this));
  130. }
  131. });
  132. },
  133. render() {
  134. const FormItem = Form.Item;
  135. const { getFieldDecorator } = this.props.form;
  136. const theData = this.state.data;
  137. const formItemLayout = {
  138. labelCol: { span: 0 },
  139. wrapperCol: { span: 20 },
  140. };
  141. const _me = this;
  142. return (
  143. <Form onSubmit={this.handleSubmit} id="annualReport-form">
  144. <Spin spinning={this.state.loading} className='spin-box'>
  145. <div className="activityCost-title">
  146. <span>年份: </span>
  147. <span>{this.props.data.year}</span>
  148. </div>
  149. <div className="clearfix" style={{ padding: '0 10px' }}>
  150. <div className="half-item" style={{ marginRight: "50%" }}>
  151. <p className="item-title">企业名称: </p>
  152. <p>{theData.unitName}</p>
  153. </div>
  154. <div className="half-item">
  155. <p className="item-title">组织机构代码或统一社会信用代码: </p>
  156. <p>{theData.orgCode}</p>
  157. </div>
  158. <div className="half-item">
  159. <p className="item-title">所属地区: </p>
  160. <p>{theData.location}</p>
  161. </div>
  162. <div className="half-item">
  163. <p className="item-title">高新技术企业认定证书编号: </p>
  164. <p>{theData.certificateNumber}</p>
  165. </div>
  166. <div className="half-item">
  167. <p className="item-title">高新技术企业认定时间: </p>
  168. <p>{theData.issuingDate}</p>
  169. </div>
  170. <div className="half-item">
  171. <p className="item-title">企业是否上市: </p>
  172. <p>{theData.listed == 1 ? "是" : "否"}</p>
  173. </div>
  174. <div className="half-item">
  175. <p className="item-title">上市时间: </p>
  176. <p>{theData.listedDate}</p>
  177. </div>
  178. <div className="half-item">
  179. <p className="item-title">上市类型: </p>
  180. <p>
  181. {(() => {
  182. switch (theData.listedType) {
  183. case '0':
  184. return "股票型上市公司";
  185. case '1':
  186. return "债券型上市公司";
  187. default:
  188. return "";
  189. }
  190. })()}
  191. </p>
  192. </div>
  193. <div className="half-item">
  194. <p className="item-title">股票代码: </p>
  195. <p>{theData.stockCode}</p>
  196. </div>
  197. <div className="half-item">
  198. <p className="item-title">企业联系人: </p>
  199. <p>{this.state.contactsObj[theData.contacts]}</p>
  200. </div>
  201. </div>
  202. <div className="activityCost-title"><span>本年度获得的知识产权数: </span></div>
  203. <div className="clearfix annualReport-box">
  204. <div className="four-item">
  205. <p className="item-title">发明专利数: </p>
  206. <p>{theData.inventionPatent}</p>
  207. </div>
  208. <div className="four-item">
  209. <p className="item-title">国防专利数: </p>
  210. <p>{theData.defensePatent}</p>
  211. </div>
  212. <div className="four-item">
  213. <p className="item-title">国家级农作物品种数: </p>
  214. <p>{theData.nationalCrop}</p>
  215. </div>
  216. <div className="four-item">
  217. <p className="item-title">植物新品种数: </p>
  218. <p>{theData.newPlantCariety}</p>
  219. </div>
  220. <div className="four-item">
  221. <p className="item-title">国家新药数: </p>
  222. <p>{theData.nationalDrug}</p>
  223. </div>
  224. <div className="four-item">
  225. <p className="item-title">国家一级中药保护品种数: </p>
  226. <p>{theData.chineseMedicine}</p>
  227. </div>
  228. <div className="four-item">
  229. <p className="item-title">实用新型专利数: </p>
  230. <p>{theData.utilityPatent}</p>
  231. </div>
  232. <div className="four-item">
  233. <p className="item-title">集成电路布图设计专有权数: </p>
  234. <p>{theData.circuitDesign}</p>
  235. </div>
  236. <div className="four-item">
  237. <p className="item-title">外观设计专利数: </p>
  238. <p>{theData.exteriorPatent}</p>
  239. </div>
  240. <div className="four-item">
  241. <p className="item-title">软件著作权数: </p>
  242. <p>{theData.softwareWorks}</p>
  243. </div>
  244. </div>
  245. <div className="activityCost-title"><span>本年度人员情况(人): </span></div>
  246. <div className="clearfix annualReport-box">
  247. <div className="four-item">
  248. <p className="item-title">职工总人数: </p>
  249. <p>{theData.firmTotal}</p>
  250. </div>
  251. <div className="four-item">
  252. <p className="item-title">科技人员数: </p>
  253. <p>{theData.techTotal}</p>
  254. </div>
  255. <div className="four-item">
  256. <p className="item-title">新增就业人数: </p>
  257. <p>{theData.newEmployment}</p>
  258. </div>
  259. <div className="four-item">
  260. <p className="item-title">高校应届毕业生人数: </p>
  261. <p>{theData.graduateNumber}</p>
  262. </div>
  263. </div>
  264. <div className="activityCost-title"><span>企业本年度财务状况(万元): </span></div>
  265. <div className="clearfix annualReport-box">
  266. <div className="four-item">
  267. <p className="item-title">企业总收入: </p>
  268. <p>{theData.totalRevenue}</p>
  269. </div>
  270. <div className="four-item">
  271. <p className="item-title">销售收入: </p>
  272. <p>{theData.salesRevenue}</p>
  273. </div>
  274. <div className="four-item">
  275. <p className="item-title">所有者权益(净资产)合计: </p>
  276. <p>{theData.netAsset}</p>
  277. </div>
  278. <div className="four-item">
  279. <p className="item-title">高新技术产品(服务)收入:
  280. </p>
  281. <p>
  282. <span>{theData.lastYearRevenue} </span>
  283. {(() => {
  284. let s = (theData.lastYearRevenue / theData.totalRevenue * 100).toFixed(2);
  285. if (!isNaN(s)) {
  286. if (s < 50) {
  287. return <span style={{ color: '#ea0862' }}> 占比总收入的{s}%,小于60%</span>
  288. } else {
  289. return <span> 占比总收入的{s}%</span>
  290. };
  291. } else {
  292. return <span> 占比总收入的0%</span>
  293. }
  294. })()}
  295. </p>
  296. </div>
  297. <div className="four-item">
  298. <p className="item-title">利润总额: </p>
  299. <p>{theData.grossProfit}</p>
  300. </div>
  301. <div className="four-item">
  302. <p className="item-title">研发费用总额:
  303. </p>
  304. <p>
  305. <span>{theData.researchCost} </span>
  306. {(() => {
  307. let s = (theData.researchCost / theData.salesRevenue * 100).toFixed(2);
  308. if (!isNaN(s)) {
  309. if (theData.salesRevenue < 5000) {
  310. if (s < 5) {
  311. return <span style={{ color: '#ea0862' }}> 占比总收入的{s}%,小于60%</span>
  312. } else {
  313. return <span> 占比总收入的{s}%</span>
  314. };
  315. } else if (5000 < theData.salesRevenue < 20000) {
  316. if (s < 4) {
  317. return <span style={{ color: '#ea0862' }}> 占比总收入的{s}%,小于60%</span>
  318. } else {
  319. return <span> 占比总收入的{s}%</span>
  320. };
  321. } else if (theData.salesRevenue >= 20000) {
  322. if (s < 3) {
  323. return <span style={{ color: '#ea0862' }}> 占比总收入的{s}%,小于60%</span>
  324. } else {
  325. return <span> 占比总收入的{s}%</span>
  326. };
  327. }
  328. } else {
  329. return <span> 占比总收入的0%</span>
  330. }
  331. })()}
  332. </p>
  333. </div>
  334. <div className="four-item" style={{ marginRight: '25%' }}>
  335. <p className="item-title">其中:在中国境内研发费用: </p>
  336. <p>{theData.researchCost}</p>
  337. </div>
  338. <div className="four-item">
  339. <p className="item-title">纳税总额: </p>
  340. <FormItem
  341. {...formItemLayout}
  342. >
  343. {getFieldDecorator('totalTax', {
  344. rules: [{ type: 'number', required: true, message: '此项为必填项!' }],
  345. initialValue: this.props.data.totalTax
  346. })(
  347. <InputNumber min={0} max={999999} step={0.01} />
  348. )}
  349. <span>万元</span>
  350. </FormItem>
  351. </div>
  352. <div className="four-item">
  353. <p className="item-title">高企所得税减免额: </p>
  354. <FormItem
  355. {...formItemLayout}
  356. >
  357. {getFieldDecorator('incomeTaxRelief', {
  358. rules: [{ type: 'number', required: true, message: '此项为必填项!' }],
  359. initialValue: this.props.data.incomeTaxRelief
  360. })(
  361. <InputNumber min={0} max={999999} step={0.01} />
  362. )}
  363. <span>万元</span>
  364. </FormItem>
  365. </div>
  366. <div className="four-item">
  367. <p className="item-title">出口创汇总额(人民币): </p>
  368. <FormItem
  369. {...formItemLayout}
  370. >
  371. {getFieldDecorator('totalExportVolume', {
  372. rules: [{ type: 'number', required: true, message: '此项为必填项!' }],
  373. initialValue: this.props.data.totalExportVolume
  374. })(
  375. <InputNumber min={0} max={999999} step={0.01} />
  376. )}
  377. <span>万元</span>
  378. </FormItem>
  379. </div>
  380. <div className="four-item">
  381. <p className="item-title">基础研究投入费用: </p>
  382. <FormItem
  383. {...formItemLayout}
  384. >
  385. {getFieldDecorator('basicResearchCost', {
  386. rules: [{ type: 'number', required: true, message: '此项为必填项!' }],
  387. initialValue: this.props.data.basicResearchCost
  388. })(
  389. <InputNumber min={0} max={999999} step={0.01} />
  390. )}
  391. <span>万元</span>
  392. </FormItem>
  393. </div>
  394. </div>
  395. <FormItem style={{ marginTop: '20px' }}>
  396. <Button className="set-submit" type="primary" htmlType="submit">保存</Button>
  397. <Button type="ghost" style={{ marginLeft: '20px' }} onClick={this.props.closeModal}>取消</Button>
  398. </FormItem>
  399. </Spin>
  400. </Form >
  401. );
  402. },
  403. }));
  404. const AnnualReportDesc = React.createClass({
  405. getInitialState() {
  406. return {
  407. visible: false,
  408. loading: false
  409. };
  410. },
  411. componentWillReceiveProps(nextProps) {
  412. this.state.visible = nextProps.showDesc;
  413. },
  414. showModal() {
  415. this.setState({
  416. visible: true,
  417. });
  418. },
  419. handleOk() {
  420. this.setState({
  421. visible: false,
  422. });
  423. this.props.closeDesc(false, true);
  424. },
  425. handleCancel(e) {
  426. this.setState({
  427. visible: false,
  428. });
  429. this.props.closeDesc(false);
  430. },
  431. render() {
  432. return (
  433. <div className="patent-addNew">
  434. <Modal maskClosable={false} title="企业年报详情" visible={this.state.visible}
  435. onOk={this.handleOk} onCancel={this.handleCancel}
  436. width='1000px'
  437. footer='' >
  438. <AnnualReportDescFrom
  439. data={this.props.data}
  440. visible={this.state.visible}
  441. detailData={this.state.detailData}
  442. closeModal={this.handleCancel}
  443. clickOk={this.handleOk} />
  444. </Modal>
  445. </div>
  446. );
  447. },
  448. });
  449. const AnnualReportAdd = React.createClass({
  450. getInitialState() {
  451. return {
  452. visible: false,
  453. loading: false,
  454. yearOption: []
  455. };
  456. },
  457. componentWillReceiveProps(nextProps) {
  458. this.state.visible = nextProps.showAdd
  459. },
  460. componentWillMount() {
  461. let d = new Date();
  462. let _me = this;
  463. d = d.getFullYear();
  464. for (let i = d; i > d - 20; i--) {
  465. _me.state.yearOption.push(
  466. <Select.Option key={i.toString()} >{i}</Select.Option>
  467. )
  468. };
  469. },
  470. showModal() {
  471. this.setState({
  472. visible: true,
  473. });
  474. },
  475. handleOk() {
  476. this.setState({
  477. loading: true
  478. });
  479. if (!this.state.year) {
  480. message.warning('请选择年份!');
  481. this.setState({
  482. loading: false
  483. });
  484. return;
  485. };
  486. $.ajax({
  487. method: "POST",
  488. dataType: "json",
  489. crossDomain: false,
  490. url: globalConfig.context + "/api/user/cognizance/disposeAnnualReport",
  491. data: {
  492. year: this.state.year,
  493. totalTax: this.state.totalTax,
  494. incomeTaxRelief: this.state.incomeTaxRelief,
  495. totalExportVolume: this.state.totalExportVolume,
  496. basicResearchCost: this.state.basicResearchCost,
  497. state: 0
  498. }
  499. }).done(function (data) {
  500. this.setState({
  501. loading: false
  502. });
  503. if (!data.error.length) {
  504. message.success('保存成功!');
  505. this.setState({
  506. visible: false
  507. });
  508. this.props.closeAdd(false, true);
  509. } else {
  510. message.warning(data.error[0].message);
  511. }
  512. }.bind(this));
  513. },
  514. handleCancel(e) {
  515. this.setState({
  516. visible: false,
  517. });
  518. this.props.closeAdd(false);
  519. },
  520. spinChange(e) {
  521. this.setState({
  522. loading: e
  523. });
  524. },
  525. render() {
  526. return (
  527. <div className="cognizance-add">
  528. <Modal maskClosable={false} title="年报申请" visible={this.state.visible}
  529. onOk={this.handleOk} onCancel={this.handleCancel}
  530. width='800px'
  531. footer={[
  532. <Button key="submit" type="primary" loading={this.state.loading} onClick={this.handleOk}>
  533. 提交
  534. </Button>,
  535. <Button key="back" onClick={this.handleCancel}>
  536. 返回
  537. </Button>,
  538. ]}
  539. >
  540. <Spin spinning={this.state.loading} className='spin-box'>
  541. <div className="clearfix">
  542. <div className="half-item">
  543. <span>选择申请年份: </span>
  544. <Select placeholder="请选择年份" style={{ width: 200 }}
  545. onSelect={(e, n) => { this.state.year = e }}>
  546. {this.state.yearOption}
  547. </Select>
  548. </div>
  549. </div>
  550. <div className="clearfix">
  551. <div className="half-item">
  552. <span>纳税总额: </span>
  553. <InputNumber min={0} max={999999} step={0.01} onChange={(e) => { this.state.totalTax = e; }} />
  554. <span> (万元)</span>
  555. </div>
  556. <div className="half-item">
  557. <span>高企所得税减免额: </span>
  558. <InputNumber min={0} max={999999} step={0.01} onChange={(e) => { this.state.incomeTaxRelief = e; }} />
  559. <span> (万元)</span>
  560. </div>
  561. <div className="half-item">
  562. <span>出口创汇总额(人民币): </span>
  563. <InputNumber min={0} max={999999} step={0.01} onChange={(e) => { this.state.totalExportVolume = e; }} />
  564. <span> (万元)</span>
  565. </div>
  566. <div className="half-item">
  567. <span>基础研究投入费用: </span>
  568. <InputNumber min={0} max={999999} step={0.01} onChange={(e) => { this.state.basicResearchCost = e; }} />
  569. <span> (万元)</span>
  570. </div>
  571. </div>
  572. </Spin>
  573. </Modal>
  574. </div>
  575. );
  576. }
  577. });
  578. const AnnualReport = React.createClass({
  579. loadData(pageNo) {
  580. this.state.data = [];
  581. this.setState({
  582. loading: true
  583. });
  584. $.ajax({
  585. method: "post",
  586. dataType: "json",
  587. crossDomain: false,
  588. url: globalConfig.context + "/api/user/cognizance/annualReport",
  589. data: {
  590. pageNo: pageNo || 1,
  591. pageSize: this.state.pagination.pageSize,
  592. }
  593. }).done((data) => {
  594. if (!data.data || !data.data.list) {
  595. if (data.error.length) {
  596. message.warning(data.error[0].message);
  597. this.state.ButtonDisabled = true;
  598. };
  599. return;
  600. };
  601. for (let i = 0; i < data.data.list.length; i++) {
  602. let thisdata = data.data.list[i];
  603. this.state.data.push({
  604. key: i,
  605. id: thisdata.id,
  606. uid: thisdata.uid,
  607. createTime: thisdata.createTime,
  608. lastUpdateTime: thisdata.lastUpdateTime,
  609. totalTax: thisdata.totalTax,
  610. incomeTaxRelief: thisdata.incomeTaxRelief,
  611. totalExportVolume: thisdata.totalExportVolume,
  612. year: thisdata.year,
  613. state: thisdata.state,
  614. createTimeFormattedDate: thisdata.createTimeFormattedDate,
  615. lastUpdateTimeFormattedDate: thisdata.lastUpdateTimeFormattedDate,
  616. basicResearchCost: thisdata.basicResearchCost
  617. });
  618. };
  619. this.state.pagination.current = data.data.pageNo;
  620. this.state.pagination.total = data.data.totalCount;
  621. this.setState({
  622. dataSource: this.state.data,
  623. pagination: this.state.pagination
  624. });
  625. }).always(function () {
  626. this.setState({
  627. loading: false
  628. });
  629. }.bind(this));
  630. },
  631. getInitialState() {
  632. return {
  633. selectedRowKeys: [],
  634. selectedRows: [],
  635. RowData: {},
  636. loading: false,
  637. pagination: {
  638. defaultCurrent: 1,
  639. defaultPageSize: 10,
  640. showQuickJumper: true,
  641. pageSize: 10,
  642. onChange: function (page) {
  643. this.loadData(page);
  644. }.bind(this),
  645. showTotal: function (total) {
  646. return '共' + total + '条数据';
  647. }
  648. },
  649. columns: [
  650. {
  651. title: '年份',
  652. dataIndex: 'year',
  653. key: 'year'
  654. }, {
  655. title: '创建时间',
  656. dataIndex: 'createTimeFormattedDate',
  657. key: 'createTimeFormattedDate'
  658. }, {
  659. title: '最近更新时间',
  660. dataIndex: 'lastUpdateTimeFormattedDate',
  661. key: 'lastUpdateTimeFormattedDate'
  662. }, {
  663. title: '年报状态',
  664. dataIndex: 'state',
  665. key: 'state',
  666. render: (text) => {
  667. return getAnnualReportState(text)
  668. }
  669. }
  670. ],
  671. dataSource: []
  672. };
  673. },
  674. componentWillMount() {
  675. this.loadData();
  676. },
  677. tableRowClick(record, index) {
  678. this.state.RowData = record;
  679. this.setState({
  680. showDesc: true
  681. });
  682. },
  683. // delectRow() {
  684. // let deletedIds = [];
  685. // for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  686. // let rowItem = this.state.selectedRows[idx];
  687. // if (rowItem.id) {
  688. // deletedIds.push(rowItem.id)
  689. // }
  690. // }
  691. // this.setState({
  692. // selectedRowKeys: [],
  693. // loading: deletedIds.length > 0
  694. // });
  695. // $.ajax({
  696. // method: "POST",
  697. // dataType: "json",
  698. // crossDomain: false,
  699. // url: globalConfig.context + "/api/user/cognizance/deleteAnnualReport",
  700. // data: {
  701. // ids: deletedIds
  702. // }
  703. // }).done(function (data) {
  704. // if (!data.error.length) {
  705. // message.success('保存成功!');
  706. // this.setState({
  707. // loading: false,
  708. // });
  709. // } else {
  710. // message.warning(data.error[0].message);
  711. // };
  712. // this.loadData();
  713. // }.bind(this));
  714. // },
  715. closeDesc(e, s) {
  716. this.state.showDesc = e;
  717. if (s) {
  718. this.loadData();
  719. };
  720. },
  721. addClick() {
  722. this.setState({
  723. showAdd: true
  724. });
  725. },
  726. closeAdd(e, s) {
  727. this.state.showAdd = e;
  728. if (s) {
  729. this.loadData();
  730. };
  731. },
  732. // search() {
  733. // this.loadData();
  734. // },
  735. // reset() {
  736. // this.loadData();
  737. // },
  738. render() {
  739. const rowSelection = {
  740. selectedRowKeys: this.state.selectedRowKeys,
  741. onChange: (selectedRowKeys, selectedRows) => {
  742. this.setState({
  743. selectedRows: selectedRows,
  744. selectedRowKeys: selectedRowKeys
  745. });
  746. }
  747. };
  748. const hasSelected = this.state.selectedRowKeys.length > 0;
  749. return (
  750. <div className="user-content" >
  751. <div className="content-title">
  752. <span>企业年报</span>
  753. </div>
  754. <div className="user-search">
  755. <p>
  756. <Button style={{ background: "#ea0862", border: "none", color: "#fff" }}
  757. disabled={this.state.ButtonDisabled}
  758. onClick={this.addClick}>添加<Icon type="plus" /></Button>
  759. <Button style={{ background: "#3fcf9e", border: "none", color: "#fff", display: 'none' }}
  760. disabled={!hasSelected}
  761. onClick={this.delectRow}>删除<Icon type="minus" /></Button>
  762. </p>
  763. </div>
  764. <div className="patent-table">
  765. <Spin spinning={this.state.loading}>
  766. <Table columns={this.state.columns}
  767. dataSource={this.state.dataSource}
  768. pagination={this.state.pagination}
  769. //rowSelection={rowSelection}
  770. onRowClick={this.tableRowClick} />
  771. </Spin>
  772. </div>
  773. <AnnualReportDesc
  774. data={this.state.RowData}
  775. showDesc={this.state.showDesc} closeDesc={this.closeDesc} />
  776. <AnnualReportAdd
  777. showAdd={this.state.showAdd}
  778. closeAdd={this.closeAdd} />
  779. </div >
  780. );
  781. }
  782. });
  783. export default AnnualReport;