annualReport.jsx 31 KB

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