activityCostList.jsx 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672
  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, getPreview } 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 ?
  299. <span className="download-file">
  300. <a onClick={newDownloadFile.bind(null, this.props.data.id, 'activity_cost_account', '/api/admin/downloadActivityCost')}>{theData.accountDownloadFileName}</a>
  301. <a onClick={() => {
  302. getPreview(theData.id, 'activityCost', 'activity_cost_account', function (data) { window.open('https://view.officeapps.live.com/op/view.aspx?src=' + encodeURIComponent(location.origin + globalConfig.context + "/open/preview?" + data)) });
  303. }}><Icon style={{ fontSize: '16px' }} type="eye-o" /></a>
  304. </span>
  305. : <span><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传!</span>}</p>
  306. </div>
  307. <FormItem style={{ marginTop: '20px' }}>
  308. <Button className="set-submit" type="primary" htmlType="submit">保存</Button>
  309. <Button type="ghost" style={{ marginLeft: '20px' }} onClick={this.props.closeModal}>取消</Button>
  310. </FormItem>
  311. </Form >
  312. );
  313. },
  314. }));
  315. const ActivityDesc = React.createClass({
  316. getInitialState() {
  317. return {
  318. visible: false,
  319. loading: false
  320. };
  321. },
  322. componentWillReceiveProps(nextProps) {
  323. this.state.visible = nextProps.showDesc
  324. },
  325. showModal() {
  326. this.setState({
  327. visible: true,
  328. });
  329. },
  330. handleOk() {
  331. this.setState({
  332. visible: false,
  333. });
  334. this.props.closeDesc(false, true);
  335. },
  336. handleCancel(e) {
  337. this.setState({
  338. visible: false,
  339. });
  340. this.props.closeDesc(false);
  341. },
  342. spinChange(e) {
  343. this.setState({
  344. loading: e
  345. });
  346. },
  347. render() {
  348. return (
  349. <div className="patent-addNew">
  350. <Spin spinning={this.state.loading} className='spin-box'>
  351. <Modal title="企业研究开发费用结构明细" visible={this.state.visible}
  352. onOk={this.handleOk} onCancel={this.handleCancel}
  353. width='800px'
  354. footer=''
  355. >
  356. <ActivityDescFrom
  357. uid={this.props.uid}
  358. visible={this.state.visible}
  359. data={this.props.data}
  360. activityNumberList={this.props.activityNumberList}
  361. spinState={this.spinChange} closeModal={this.handleCancel} clickOk={this.handleOk} />
  362. </Modal>
  363. </Spin>
  364. </div>
  365. );
  366. },
  367. });
  368. const Activity = React.createClass({
  369. loadData(pageNo) {
  370. this.state.data = [];
  371. this.setState({
  372. loading: true
  373. });
  374. $.when($.ajax({
  375. method: "post",
  376. dataType: "json",
  377. crossDomain: false,
  378. url: globalConfig.context + "/api/admin/activityCostList",
  379. data: {
  380. pageNo: pageNo || 1,
  381. pageSize: this.state.pagination.pageSize,
  382. uid: this.props.data.uid,
  383. activityNumber: this.state.activityNumber,
  384. year: this.state.year
  385. }
  386. }), $.ajax({
  387. method: "post",
  388. dataType: "json",
  389. crossDomain: false,
  390. url: globalConfig.context + "/api/admin/activityNumber",
  391. data: {
  392. uid: this.props.data.uid
  393. }
  394. })).done((data1, data2) => {
  395. let data = data1[0];
  396. let activityNumber = data2[0];
  397. if (data.error.length || !data.data || !data.data.list) {
  398. message.warning(data.error[0].message);
  399. return;
  400. };
  401. if (activityNumber.error.length || !activityNumber.data) {
  402. message.warning(activityNumber.error[0].message);
  403. return;
  404. };
  405. for (let i = 0; i < data.data.list.length; i++) {
  406. let thisdata = data.data.list[i];
  407. this.state.data.push({
  408. key: i,
  409. id: thisdata.id,
  410. uid: thisdata.uid,
  411. aid: thisdata.aid,
  412. activityNumber: thisdata.activityNumber,
  413. year: thisdata.year,
  414. startDate: thisdata.startDate,
  415. endDate: thisdata.endDate,
  416. internalAllCost:
  417. thisdata.internalLaborCost + thisdata.internalDirectCost + thisdata.internalDepreciationCost +
  418. thisdata.internalAmortizationCost + thisdata.internalAmortizationCost + thisdata.internalDesignCost +
  419. thisdata.internalEquipmentCost + thisdata.internalOtherCost,
  420. internalLaborCost: thisdata.internalLaborCost,
  421. internalDirectCost: thisdata.internalDirectCost,
  422. internalDepreciationCost: thisdata.internalDepreciationCost,
  423. internalAmortizationCost: thisdata.internalAmortizationCost,
  424. internalDesignCost: thisdata.internalDesignCost,
  425. internalEquipmentCost: thisdata.internalEquipmentCost,
  426. internalOtherCost: thisdata.internalOtherCost,
  427. externalTotalCost: thisdata.externalTotalCost,
  428. externalAbroadCost: thisdata.externalAbroadCost,
  429. allCost:
  430. thisdata.internalLaborCost + thisdata.internalDirectCost + thisdata.internalDepreciationCost +
  431. thisdata.internalAmortizationCost + thisdata.internalAmortizationCost + thisdata.internalDesignCost +
  432. thisdata.internalEquipmentCost + thisdata.internalOtherCost + thisdata.externalTotalCost,
  433. enterpriseFiller: thisdata.enterpriseFiller,
  434. signDate: thisdata.signDate,
  435. signDateFormattedDate: thisdata.signDateFormattedDate,
  436. sortNumber: thisdata.sortNumber,
  437. startDateFormattedDate: thisdata.startDateFormattedDate,
  438. endDateFormattedDate: thisdata.endDateFormattedDate,
  439. accountDownloadFileName: thisdata.accountDownloadFileName,
  440. accountUrl: thisdata.accountUrl
  441. });
  442. };
  443. this.state.activityNumberList = activityNumber.data;
  444. this.state.pagination.current = data.data.pageNo;
  445. this.state.pagination.total = data.data.totalCount;
  446. this.setState({
  447. dataSource: this.state.data,
  448. pagination: this.state.pagination
  449. });
  450. }).always(function () {
  451. this.setState({
  452. loading: false
  453. });
  454. }.bind(this));
  455. let _me = this;
  456. getProportion(this.props.data.uid, function (data) { _me.setState({ proportion: data }); });
  457. },
  458. getInitialState() {
  459. return {
  460. selectedRowKeys: [],
  461. selectedRows: [],
  462. loading: false,
  463. pagination: {
  464. defaultCurrent: 1,
  465. defaultPageSize: 10,
  466. showQuickJumper: true,
  467. pageSize: 10,
  468. onChange: function (page) {
  469. this.loadData(page);
  470. }.bind(this),
  471. showTotal: function (total) {
  472. return '共' + total + '条数据';
  473. }
  474. },
  475. columns: [
  476. {
  477. title: '研发活动编号',
  478. dataIndex: 'activityNumber',
  479. key: 'activityNumber'
  480. }, {
  481. title: '费用年份',
  482. dataIndex: 'year',
  483. key: 'year'
  484. }, {
  485. title: '内部研究开发费用',
  486. dataIndex: 'internalAllCost',
  487. key: 'internalAllCost'
  488. }, {
  489. title: '人员人工费用',
  490. dataIndex: 'internalLaborCost',
  491. key: 'internalLaborCost'
  492. }, {
  493. title: '直接投入费用',
  494. dataIndex: 'internalDirectCost',
  495. key: 'internalDirectCost'
  496. }, {
  497. title: '折旧费用与长期待摊费用',
  498. dataIndex: 'internalDepreciationCost',
  499. key: 'internalDepreciationCost'
  500. }, {
  501. title: '设计费用',
  502. dataIndex: 'internalDesignCost',
  503. key: 'internalDesignCost'
  504. }, {
  505. title: '装备调试费用与试验费用',
  506. dataIndex: 'internalEquipmentCost',
  507. key: 'internalEquipmentCost'
  508. }, {
  509. title: '无形资产摊销费用',
  510. dataIndex: 'internalAmortizationCost',
  511. key: 'internalAmortizationCost'
  512. }, {
  513. title: '其他费用',
  514. dataIndex: 'internalOtherCost',
  515. key: 'internalOtherCost'
  516. }, {
  517. title: '委托外部研究开发费用',
  518. dataIndex: 'externalTotalCost',
  519. key: 'externalTotalCost'
  520. }, {
  521. title: '境内外部研发费用',
  522. dataIndex: 'externalAbroadCost',
  523. key: 'externalAbroadCost'
  524. }, {
  525. title: '研发费用合计',
  526. dataIndex: 'allCost',
  527. key: 'allCost'
  528. }, {
  529. title: '企业填报人',
  530. dataIndex: 'enterpriseFiller',
  531. key: 'enterpriseFiller'
  532. }, {
  533. title: '企业填报人签字日期',
  534. dataIndex: 'signDateFormattedDate',
  535. key: 'signDateFormattedDate'
  536. }, {
  537. title: '排序号',
  538. dataIndex: 'sortNumber',
  539. key: 'sortNumber'
  540. }
  541. ],
  542. dataSource: []
  543. };
  544. },
  545. componentWillMount() {
  546. this.loadData();
  547. },
  548. tableRowClick(record, index) {
  549. this.state.RowData = record;
  550. this.setState({
  551. showDesc: true
  552. });
  553. },
  554. delectRow() {
  555. let deletedIds = [];
  556. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  557. let rowItem = this.state.selectedRows[idx];
  558. if (rowItem.id) {
  559. deletedIds.push(rowItem.id)
  560. }
  561. }
  562. this.setState({
  563. selectedRowKeys: [],
  564. loading: deletedIds.length > 0
  565. });
  566. $.ajax({
  567. method: "post",
  568. dataType: "json",
  569. crossDomain: false,
  570. url: globalConfig.context + "/api/admin/deleteActivityCost",
  571. data: {
  572. ids: deletedIds
  573. }
  574. }).done(function (data) {
  575. if (!data.error.length) {
  576. message.success('保存成功!');
  577. this.setState({
  578. loading: false,
  579. });
  580. } else {
  581. message.warning(data.error[0].message);
  582. };
  583. this.loadData();
  584. }.bind(this));
  585. },
  586. closeDesc(e, s) {
  587. this.state.showDesc = e;
  588. if (s) {
  589. this.loadData();
  590. };
  591. },
  592. search() {
  593. this.loadData();
  594. },
  595. reset() {
  596. this.state.year = undefined;
  597. this.state.activityNumber = undefined;
  598. this.loadData();
  599. },
  600. render() {
  601. const rowSelection = {
  602. selectedRowKeys: this.state.selectedRowKeys,
  603. onChange: (selectedRowKeys, selectedRows) => {
  604. this.setState({
  605. selectedRows: selectedRows,
  606. selectedRowKeys: selectedRowKeys
  607. });
  608. }
  609. };
  610. const hasSelected = this.state.selectedRowKeys.length > 0;
  611. return (
  612. <div className="user-content" >
  613. <div className="content-title">
  614. <span>企业研究开发费用结构明细</span>
  615. <span className="proportion"> 是否已完成:</span>
  616. <Switch
  617. checked={this.state.proportion && this.state.proportion.activityCost == 1 ? true : false}
  618. checkedChildren={'已完成'}
  619. unCheckedChildren={'未完成'}
  620. onChange={(e) => {
  621. e ? this.state.proportion.activityCost = 1 : this.state.proportion.activityCost = 0;
  622. saveProportion(this.state.proportion.id, this.props.data.uid, 'activityCost', this.state.proportion.activityCost);
  623. this.setState({ proportion: this.state.proportion });
  624. }} />
  625. </div>
  626. <div className="user-search">
  627. <Input placeholder="研发活动编号" value={this.state.activityNumber}
  628. onChange={(e) => { this.setState({ activityNumber: e.target.value }); }} />
  629. <span>年份:</span>
  630. <YearSelect value={this.state.year} handleyear={(e) => { this.state.year = e; }} />
  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. onClick={this.tableRowClick}>添加<Icon type="plus" /></Button>
  636. <Button style={{ background: "#3fcf9e", border: "none", color: "#fff" }}
  637. disabled={!hasSelected}
  638. onClick={this.delectRow}>删除<Icon type="minus" /></Button>
  639. </p>
  640. </div>
  641. <div className="patent-table">
  642. <Spin spinning={this.state.loading}>
  643. <Table columns={this.state.columns}
  644. dataSource={this.state.dataSource}
  645. pagination={this.state.pagination}
  646. rowSelection={rowSelection}
  647. onRowClick={this.tableRowClick} />
  648. </Spin>
  649. </div>
  650. <ActivityDesc
  651. uid={this.props.data.uid}
  652. data={this.state.RowData}
  653. activityNumberList={this.state.activityNumberList}
  654. showDesc={this.state.showDesc} closeDesc={this.closeDesc} />
  655. </div >
  656. );
  657. }
  658. });
  659. export default Activity;