activityCostList.jsx 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671
  1. import React from 'react';
  2. import { Icon, Form, Upload, Button, Input, Spin, Table, message, Select, Modal, DatePicker, InputNumber } from 'antd';
  3. import './activityCostList.less';
  4. import { beforeUploadFile, newDownloadFile } from '../../tools.js';
  5. import YearSelect from '../../yearSelect.jsx';
  6. import moment from 'moment';
  7. import ajax from 'jquery/src/ajax/xhr.js';
  8. import $ from 'jquery/src/ajax';
  9. const ActivityDescFrom = Form.create()(React.createClass({
  10. getInitialState() {
  11. return {
  12. loading: false,
  13. activityNumberOption: [],
  14. activityNumberObj: [],
  15. yearOption: []
  16. };
  17. },
  18. getYearOption() {
  19. let Option = Select.Option, d = new Date(), thisYear = d.getFullYear(), theArr = [];
  20. for (let i = thisYear; i >= 2000; i--) {
  21. theArr.push(<Option value={i.toString()} key={i.toString()}>{i}</Option>)
  22. };
  23. this.state.yearOption = theArr;
  24. },
  25. allCostCount() {
  26. this.state.internalAllCost = this.props.form.getFieldValue('internalLaborCost') + this.props.form.getFieldValue('internalDirectCost') +
  27. this.props.form.getFieldValue('internalDepreciationCost') + this.props.form.getFieldValue('internalAmortizationCost') +
  28. this.props.form.getFieldValue('internalDesignCost') + this.props.form.getFieldValue('internalEquipmentCost') +
  29. this.props.form.getFieldValue('internalOtherCost');
  30. this.state.allCost = this.props.form.getFieldValue('internalLaborCost') + this.props.form.getFieldValue('internalDirectCost') +
  31. this.props.form.getFieldValue('internalDepreciationCost') + this.props.form.getFieldValue('internalAmortizationCost') +
  32. this.props.form.getFieldValue('internalDesignCost') + this.props.form.getFieldValue('internalEquipmentCost') +
  33. this.props.form.getFieldValue('internalOtherCost') + this.props.form.getFieldValue('externalTotalCost');
  34. },
  35. componentDidMount() {
  36. this.allCostCount();
  37. this.setState({
  38. loading: false
  39. });
  40. },
  41. componentWillMount() {
  42. this.getYearOption();
  43. let _me = this;
  44. if (this.props.activityNumberList) {
  45. this.props.activityNumberList.map(function (item) {
  46. _me.state.activityNumberOption.push(
  47. <Select.Option value={item.aid} key={item.uid}>{item.activityNumber}</Select.Option>
  48. );
  49. _me.state.activityNumberObj[item.aid] = item.activityNumber;
  50. });
  51. }
  52. },
  53. componentWillReceiveProps(nextProps) {
  54. this.allCostCount();
  55. let _me = this;
  56. if (!this.props.visible && nextProps.visible && nextProps.activityNumberList) {
  57. _me.state.activityNumberOption = [];
  58. nextProps.activityNumberList.map(function (item) {
  59. _me.state.activityNumberOption.push(
  60. <Select.Option value={item.aid} key={item.uid}>{item.activityNumber}</Select.Option>
  61. );
  62. _me.state.activityNumberObj[item.aid] = item.activityNumber;
  63. });
  64. this.state.fileList = [];
  65. this.state.accountUrl = undefined;
  66. };
  67. },
  68. handleSubmit(e) {
  69. e.preventDefault();
  70. this.props.form.validateFields((err, values) => {
  71. if (!err) {
  72. this.props.spinState(true);
  73. $.ajax({
  74. method: "POST",
  75. dataType: "json",
  76. crossDomain: false,
  77. url: globalConfig.context + "/api/user/cognizance/activityCost",
  78. data: {
  79. id: this.props.data.id,
  80. aid: values.activityNumber,
  81. activityNumber: this.state.activityNumberObj[values.activityNumber],
  82. year: values.year,
  83. internalLaborCost: values.internalLaborCost,
  84. internalDirectCost: values.internalDirectCost,
  85. internalDepreciationCost: values.internalDepreciationCost,
  86. internalAmortizationCost: values.internalAmortizationCost,
  87. internalDesignCost: values.internalDesignCost,
  88. internalEquipmentCost: values.internalEquipmentCost,
  89. internalOtherCost: values.internalOtherCost,
  90. externalTotalCost: values.externalTotalCost,
  91. externalAbroadCost: values.externalAbroadCost,
  92. //enterpriseFiller: values.enterpriseFiller,
  93. //signDateFormattedDate: values.signDate.format('YYYY-MM-DD'),
  94. sortNumber: values.sortNumber,
  95. accountUrl: this.state.accountUrl
  96. }
  97. }).done(function (data) {
  98. if (!data.error.length) {
  99. message.success('保存成功!');
  100. } else {
  101. message.warning(data.error[0].message);
  102. }
  103. }.bind(this)).always(function () {
  104. this.props.spinState(false);
  105. this.props.clickOk();
  106. this.props.form.resetFields();
  107. }.bind(this));
  108. }
  109. });
  110. },
  111. render() {
  112. const FormItem = Form.Item;
  113. const { getFieldDecorator } = this.props.form;
  114. const theData = this.props.data;
  115. const formItemLayout = {
  116. labelCol: { span: 14 },
  117. wrapperCol: { span: 8 },
  118. };
  119. const _me = this;
  120. return (
  121. <Form onSubmit={this.handleSubmit} className="activityCost-form">
  122. <p className="activityCost-title">项目编号</p>
  123. {getFieldDecorator('activityNumber', {
  124. rules: [{ required: true, message: '此项为必填项!' }],
  125. initialValue: theData.activityNumber
  126. })(
  127. <Select
  128. notFoundContent="无项目可选"
  129. placeholder="请选择项目编号"
  130. style={{ width: 200 }} >
  131. {this.state.activityNumberOption}
  132. </Select>
  133. )}
  134. <p className="activityCost-title">费用年份</p>
  135. {getFieldDecorator('year', {
  136. rules: [{ required: true, message: '此项为必填项!' }],
  137. initialValue: theData.year
  138. })(
  139. <Select
  140. placeholder="请选择年份"
  141. style={{ width: 200 }} >
  142. {this.state.yearOption}
  143. </Select>
  144. )}
  145. <p className="activityCost-title">内部研究开发费用(万元)</p>
  146. <div className="clearfix activityCost-box">
  147. <FormItem className="half-item"
  148. {...formItemLayout}
  149. label="共计(万元)"
  150. >
  151. {getFieldDecorator('internalAllCost')(
  152. <span className="number-box">
  153. {this.state.internalAllCost || 0}
  154. </span>
  155. )}
  156. </FormItem>
  157. <FormItem className="half-item"
  158. {...formItemLayout}
  159. label="人员人工费用(万元)"
  160. >
  161. {getFieldDecorator('internalLaborCost', {
  162. rules: [{ type: "number", required: true, message: '此项为必填项!' }],
  163. initialValue: theData.internalLaborCost
  164. })(
  165. <InputNumber min={0} max={999999} step={0.01} />
  166. )}
  167. </FormItem>
  168. <FormItem className="half-item"
  169. {...formItemLayout}
  170. label="直接投入费用(万元)"
  171. >
  172. {getFieldDecorator('internalDirectCost', {
  173. rules: [{ type: "number", required: true, message: '此项为必填项!' }],
  174. initialValue: theData.internalDirectCost
  175. })(
  176. <InputNumber min={0} max={999999} step={0.01} />
  177. )}
  178. </FormItem>
  179. <FormItem className="half-item"
  180. {...formItemLayout}
  181. label="折旧费用与长期待摊费用(万元)"
  182. >
  183. {getFieldDecorator('internalDepreciationCost', {
  184. rules: [{ type: "number", required: true, message: '此项为必填项!' }],
  185. initialValue: theData.internalDepreciationCost
  186. })(
  187. <InputNumber min={0} max={999999} step={0.01} />
  188. )}
  189. </FormItem>
  190. <FormItem className="half-item"
  191. {...formItemLayout}
  192. label="无形资产摊销费用(万元)"
  193. >
  194. {getFieldDecorator('internalAmortizationCost', {
  195. rules: [{ type: "number", required: true, message: '此项为必填项!' }],
  196. initialValue: theData.internalAmortizationCost
  197. })(
  198. <InputNumber min={0} max={999999} step={0.01} />
  199. )}
  200. </FormItem>
  201. <FormItem className="half-item"
  202. {...formItemLayout}
  203. label="设计费用(万元)"
  204. >
  205. {getFieldDecorator('internalDesignCost', {
  206. rules: [{ type: "number", required: true, message: '此项为必填项!' }],
  207. initialValue: theData.internalDesignCost
  208. })(
  209. <InputNumber min={0} max={999999} step={0.01} />
  210. )}
  211. </FormItem>
  212. <FormItem className="half-item"
  213. {...formItemLayout}
  214. label="装备调试费用与实验费用(万元)"
  215. >
  216. {getFieldDecorator('internalEquipmentCost', {
  217. rules: [{ type: "number", required: true, message: '此项为必填项!' }],
  218. initialValue: theData.internalEquipmentCost
  219. })(
  220. <InputNumber min={0} max={999999} step={0.01} />
  221. )}
  222. </FormItem>
  223. <FormItem className="half-item"
  224. {...formItemLayout}
  225. label="其他费用(万元)"
  226. >
  227. {getFieldDecorator('internalOtherCost', {
  228. rules: [{ type: "number", required: true, message: '此项为必填项!' }],
  229. initialValue: theData.internalOtherCost
  230. })(
  231. <InputNumber min={0} max={999999} step={0.01} />
  232. )}
  233. </FormItem>
  234. </div>
  235. <p className="activityCost-title">委托外部研究开发费用(万元)</p>
  236. <div className="clearfix activityCost-box">
  237. <FormItem className="half-item"
  238. {...formItemLayout}
  239. label="共计(万元)"
  240. >
  241. {getFieldDecorator('externalTotalCost', {
  242. rules: [{ type: "number", required: true, message: '此项为必填项!' }],
  243. initialValue: theData.externalTotalCost
  244. })(
  245. <InputNumber min={0} max={999999} step={0.01} />
  246. )}
  247. </FormItem>
  248. <FormItem className="half-item"
  249. {...formItemLayout}
  250. label="境内的外部研发费用"
  251. >
  252. {getFieldDecorator('externalAbroadCost', {
  253. rules: [{ type: "number", required: true, message: '此项为必填项!' }],
  254. initialValue: theData.externalAbroadCost
  255. })(
  256. <InputNumber min={0} max={999999} step={0.01} />
  257. )}
  258. </FormItem>
  259. </div>
  260. <p className="activityCost-title">研发开发费用(内、外部)小计(万元)</p>
  261. <div className="clearfix activityCost-box">
  262. <FormItem className="half-item"
  263. {...formItemLayout}
  264. label="共计(万元)"
  265. >
  266. {getFieldDecorator('allCost')(
  267. <span className="number-box">
  268. {this.state.allCost || 0}
  269. </span>
  270. )}
  271. </FormItem>
  272. <FormItem className="half-item"
  273. {...formItemLayout}
  274. label="排序号"
  275. >
  276. {getFieldDecorator('sortNumber', {
  277. rules: [{ required: true, message: '此项为必填项!' }],
  278. initialValue: theData.sortNumber
  279. })(
  280. <Input />
  281. )}
  282. </FormItem>
  283. </div>
  284. <div style={{ width: '50%', marginTop: '20px' }}>
  285. <Upload
  286. name="ratepay"
  287. action={globalConfig.context + "/api/user/cognizance/uploadActivityCost"}
  288. data={{ 'sign': 'activity_cost_account' }}
  289. beforeUpload={beforeUploadFile}
  290. fileList={this.state.fileList}
  291. onChange={(info) => {
  292. if (info.file.status !== 'uploading') {
  293. console.log(info.file, info.fileList);
  294. }
  295. if (info.file.status === 'done') {
  296. if (!info.file.response.error.length) {
  297. message.success(`${info.file.name} 文件上传成功!`);
  298. } else {
  299. message.warning(info.file.response.error[0].message);
  300. return;
  301. };
  302. this.state.accountUrl = info.file.response.data;
  303. } else if (info.file.status === 'error') {
  304. message.error(`${info.file.name} 文件上传失败。`);
  305. };
  306. this.setState({ fileList: info.fileList.slice(-1) });
  307. }}
  308. >
  309. <Button><Icon type="upload" /> 上传研发费用台账 </Button>
  310. </Upload>
  311. <p style={{ marginTop: '20px' }}>{theData.accountUrl ? <a onClick={newDownloadFile.bind(null, theData.id, 'activity_cost_account', '/api/user/cognizance/downloadActivityCost')}>{theData.accountDownloadFileName}</a> : <span><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传!</span>}</p>
  312. </div>
  313. <FormItem style={{ marginTop: '20px' }}>
  314. <Button className="set-submit" type="primary" htmlType="submit">保存</Button>
  315. <Button type="ghost" style={{ marginLeft: '20px' }} onClick={this.props.closeModal}>取消</Button>
  316. </FormItem>
  317. </Form >
  318. );
  319. },
  320. }));
  321. const ActivityDesc = React.createClass({
  322. getInitialState() {
  323. return {
  324. visible: false,
  325. loading: false
  326. };
  327. },
  328. componentWillReceiveProps(nextProps) {
  329. this.state.visible = nextProps.showDesc
  330. },
  331. showModal() {
  332. this.setState({
  333. visible: true,
  334. });
  335. },
  336. handleOk() {
  337. this.setState({
  338. visible: false,
  339. });
  340. this.props.closeDesc(false, true);
  341. },
  342. handleCancel(e) {
  343. this.setState({
  344. visible: false,
  345. });
  346. this.props.closeDesc(false);
  347. },
  348. spinChange(e) {
  349. this.setState({
  350. loading: e
  351. });
  352. },
  353. render() {
  354. return (
  355. <div className="patent-addNew">
  356. <Spin spinning={this.state.loading} className='spin-box'>
  357. <Modal maskClosable={false} title="企业研究开发费用结构明细" visible={this.state.visible}
  358. onOk={this.handleOk} onCancel={this.handleCancel}
  359. width='800px'
  360. footer=''
  361. >
  362. <ActivityDescFrom data={this.props.data}
  363. visible={this.state.visible}
  364. activityNumberList={this.props.activityNumberList}
  365. spinState={this.spinChange}
  366. closeModal={this.handleCancel}
  367. clickOk={this.handleOk} />
  368. </Modal>
  369. </Spin>
  370. </div>
  371. );
  372. },
  373. });
  374. const Activity = React.createClass({
  375. loadData(pageNo) {
  376. this.state.data = [];
  377. this.setState({
  378. loading: true
  379. });
  380. $.when($.ajax({
  381. method: "post",
  382. dataType: "json",
  383. crossDomain: false,
  384. url: globalConfig.context + "/api/user/cognizance/activityCostList",
  385. data: {
  386. pageNo: pageNo || 1,
  387. pageSize: this.state.pagination.pageSize,
  388. activityNumber: this.state.activityNumber,
  389. year: this.state.year
  390. }
  391. }), $.ajax({
  392. method: "get",
  393. dataType: "json",
  394. crossDomain: false,
  395. url: globalConfig.context + "/api/user/cognizance/activityNumber",
  396. })).done((data1, data2) => {
  397. let data = data1[0];
  398. let activityNumber = data2[0];
  399. if (!data.data || !data.data.list) {
  400. if (data.error && data.error.length) {
  401. message.warning(data.error[0].message);
  402. this.state.ButtonDisabled = true;
  403. };
  404. return;
  405. };
  406. if (!activityNumber.data) {
  407. if (activityNumber.error && activityNumber.error.length) {
  408. message.warning(activityNumber.error[0].message);
  409. this.state.ButtonDisabled = true;
  410. };
  411. return;
  412. };
  413. for (let i = 0; i < data.data.list.length; i++) {
  414. let thisdata = data.data.list[i];
  415. this.state.data.push({
  416. key: i,
  417. id: thisdata.id,
  418. uid: thisdata.uid,
  419. aid: thisdata.aid,
  420. activityNumber: thisdata.activityNumber,
  421. year: thisdata.year ? String(thisdata.year) : undefined,
  422. startDate: thisdata.startDate,
  423. endDate: thisdata.endDate,
  424. internalAllCost:
  425. thisdata.internalLaborCost + thisdata.internalDirectCost + thisdata.internalDepreciationCost +
  426. thisdata.internalAmortizationCost + thisdata.internalAmortizationCost + thisdata.internalDesignCost +
  427. thisdata.internalEquipmentCost + thisdata.internalOtherCost,
  428. internalLaborCost: thisdata.internalLaborCost,
  429. internalDirectCost: thisdata.internalDirectCost,
  430. internalDepreciationCost: thisdata.internalDepreciationCost,
  431. internalAmortizationCost: thisdata.internalAmortizationCost,
  432. internalDesignCost: thisdata.internalDesignCost,
  433. internalEquipmentCost: thisdata.internalEquipmentCost,
  434. internalOtherCost: thisdata.internalOtherCost,
  435. externalTotalCost: thisdata.externalTotalCost,
  436. externalAbroadCost: thisdata.externalAbroadCost,
  437. allCost:
  438. thisdata.internalLaborCost + thisdata.internalDirectCost + thisdata.internalDepreciationCost +
  439. thisdata.internalAmortizationCost + thisdata.internalAmortizationCost + thisdata.internalDesignCost +
  440. thisdata.internalEquipmentCost + thisdata.internalOtherCost + thisdata.externalTotalCost,
  441. //enterpriseFiller: thisdata.enterpriseFiller,
  442. //signDate: thisdata.signDate,
  443. //signDateFormattedDate: thisdata.signDateFormattedDate,
  444. sortNumber: thisdata.sortNumber,
  445. startDateFormattedDate: thisdata.startDateFormattedDate,
  446. endDateFormattedDate: thisdata.endDateFormattedDate,
  447. accountDownloadFileName: thisdata.accountDownloadFileName,
  448. accountUrl: thisdata.accountUrl
  449. });
  450. };
  451. this.state.activityNumberList = activityNumber.data;
  452. this.state.pagination.current = data.data.pageNo;
  453. this.state.pagination.total = data.data.totalCount;
  454. this.setState({
  455. dataSource: this.state.data,
  456. pagination: this.state.pagination
  457. });
  458. }).always(function () {
  459. this.setState({
  460. loading: false
  461. });
  462. }.bind(this));
  463. },
  464. getYearOption() {
  465. let Option = Select.Option, d = new Date(), thisYear = d.getFullYear(), theArr = [];
  466. for (let i = thisYear; i >= 2000; i--) {
  467. theArr.push(<Option value={i.toString()} key={i.toString()}>{i}</Option>)
  468. };
  469. this.state.yearOption = theArr;
  470. },
  471. getInitialState() {
  472. return {
  473. selectedRowKeys: [],
  474. selectedRows: [],
  475. loading: false,
  476. pagination: {
  477. defaultCurrent: 1,
  478. defaultPageSize: 10,
  479. showQuickJumper: true,
  480. pageSize: 10,
  481. onChange: function (page) {
  482. this.loadData(page);
  483. }.bind(this),
  484. showTotal: function (total) {
  485. return '共' + total + '条数据';
  486. }
  487. },
  488. columns: [
  489. {
  490. title: '研发活动编号',
  491. dataIndex: 'activityNumber',
  492. key: 'activityNumber'
  493. }, {
  494. title: '费用年份',
  495. dataIndex: 'year',
  496. key: 'year'
  497. }, {
  498. title: '内部研究开发费用',
  499. dataIndex: 'internalAllCost',
  500. key: 'internalAllCost'
  501. }, {
  502. title: '人员人工费用',
  503. dataIndex: 'internalLaborCost',
  504. key: 'internalLaborCost'
  505. }, {
  506. title: '直接投入费用',
  507. dataIndex: 'internalDirectCost',
  508. key: 'internalDirectCost'
  509. }, {
  510. title: '折旧费用与长期待摊费用',
  511. dataIndex: 'internalDepreciationCost',
  512. key: 'internalDepreciationCost'
  513. }, {
  514. title: '设计费用',
  515. dataIndex: 'internalDesignCost',
  516. key: 'internalDesignCost'
  517. }, {
  518. title: '装备调试费用与试验费用',
  519. dataIndex: 'internalEquipmentCost',
  520. key: 'internalEquipmentCost'
  521. }, {
  522. title: '无形资产摊销费用',
  523. dataIndex: 'internalAmortizationCost',
  524. key: 'internalAmortizationCost'
  525. }, {
  526. title: '其他费用',
  527. dataIndex: 'internalOtherCost',
  528. key: 'internalOtherCost'
  529. }, {
  530. title: '委托外部研究开发费用',
  531. dataIndex: 'externalTotalCost',
  532. key: 'externalTotalCost'
  533. }, {
  534. title: '境内外部研发费用',
  535. dataIndex: 'externalAbroadCost',
  536. key: 'externalAbroadCost'
  537. }, {
  538. title: '研发费用合计',
  539. dataIndex: 'allCost',
  540. key: 'allCost'
  541. }, {
  542. title: '排序号',
  543. dataIndex: 'sortNumber',
  544. key: 'sortNumber'
  545. }
  546. ],
  547. dataSource: []
  548. };
  549. },
  550. componentWillMount() {
  551. this.loadData();
  552. this.getYearOption();
  553. },
  554. tableRowClick(record, index) {
  555. this.state.RowData = record;
  556. this.setState({
  557. showDesc: true
  558. });
  559. },
  560. delectRow() {
  561. let deletedIds = [];
  562. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  563. let rowItem = this.state.selectedRows[idx];
  564. if (rowItem.id) {
  565. deletedIds.push(rowItem.id)
  566. }
  567. }
  568. this.setState({
  569. selectedRowKeys: [],
  570. loading: deletedIds.length > 0
  571. });
  572. $.ajax({
  573. method: "POST",
  574. dataType: "json",
  575. crossDomain: false,
  576. url: globalConfig.context + "/api/user/cognizance/deleteActivityCost",
  577. data: {
  578. ids: deletedIds
  579. }
  580. }).done(function (data) {
  581. if (!data.error.length) {
  582. message.success('删除成功!');
  583. this.setState({
  584. loading: false,
  585. });
  586. } else {
  587. message.warning(data.error[0].message);
  588. };
  589. this.loadData();
  590. }.bind(this));
  591. },
  592. closeDesc(e, s) {
  593. this.state.showDesc = e;
  594. if (s) {
  595. this.loadData();
  596. };
  597. },
  598. search() {
  599. this.loadData();
  600. },
  601. reset() {
  602. this.state.year = undefined;
  603. this.state.activityNumber = undefined;
  604. this.loadData();
  605. },
  606. render() {
  607. const rowSelection = {
  608. selectedRowKeys: this.state.selectedRowKeys,
  609. onChange: (selectedRowKeys, selectedRows) => {
  610. this.setState({
  611. selectedRows: selectedRows,
  612. selectedRowKeys: selectedRowKeys
  613. });
  614. }
  615. };
  616. const hasSelected = this.state.selectedRowKeys.length > 0;
  617. return (
  618. <div className="user-content" >
  619. <div className="content-title">
  620. <span>企业研究开发费用结构明细</span>
  621. </div>
  622. <div className="user-search">
  623. <Input placeholder="研发活动编号" value={this.state.activityNumber}
  624. onChange={(e) => { this.setState({ activityNumber: e.target.value }); }} />
  625. <span>年份:</span>
  626. <Select value={this.state.year}
  627. style={{ width: 100 }}
  628. onChange={(e) => { this.setState({ year: e }); }} >
  629. {this.state.yearOption}
  630. </Select>
  631. <Button type="primary" onClick={this.search}>搜索</Button>
  632. <Button onClick={this.reset}>重置</Button>
  633. <p>
  634. <Button style={{ background: "#ea0862", border: "none", color: "#fff" }}
  635. disabled={this.state.ButtonDisabled}
  636. onClick={this.tableRowClick}>添加<Icon type="plus" /></Button>
  637. <Button style={{ background: "#3fcf9e", border: "none", color: "#fff" }}
  638. disabled={!hasSelected}
  639. onClick={this.delectRow}>删除<Icon type="minus" /></Button>
  640. </p>
  641. </div>
  642. <div className="patent-table">
  643. <Spin spinning={this.state.loading}>
  644. <Table columns={this.state.columns}
  645. dataSource={this.state.dataSource}
  646. pagination={this.state.pagination}
  647. rowSelection={rowSelection}
  648. onRowClick={this.tableRowClick} />
  649. </Spin>
  650. </div>
  651. <ActivityDesc data={this.state.RowData}
  652. activityNumberList={this.state.activityNumberList}
  653. showDesc={this.state.showDesc} closeDesc={this.closeDesc} />
  654. </div >
  655. );
  656. }
  657. });
  658. export default Activity;