activity.jsx 31 KB

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