activityCostList.jsx 29 KB

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