annualReport.jsx 31 KB

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