activityCostList.jsx 29 KB

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