activity.jsx 31 KB

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