activity.jsx 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682
  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: [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 ?
  333. <span className="download-file">
  334. <a onClick={newDownloadFile.bind(null, theData.id, 'proof', '/api/admin/downloadProof')}>{theData.proofDownloadFileName}</a>
  335. <a onClick={() => {
  336. getPreview(theData.id, 'activity', 'proof', function (data) { window.open('https://view.officeapps.live.com/op/view.aspx?src=' + encodeURIComponent(location.origin + globalConfig.context + "/open/preview?" + data)) });
  337. }}><Icon style={{ fontSize: '16px' }} type="eye-o" /></a>
  338. </span>
  339. : <span><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传!</span>}</p>
  340. </div>
  341. <FormItem style={{ marginTop: '20px' }}>
  342. <Button className="set-submit" type="primary" htmlType="submit">保存</Button>
  343. <Button type="ghost" style={{ marginLeft: '20px' }} onClick={this.props.closeModal}>取消</Button>
  344. </FormItem>
  345. </Form >
  346. </Spin >
  347. )
  348. } else {
  349. return (<div></div>)
  350. };
  351. }
  352. }));
  353. const ActivityDesc = React.createClass({
  354. getInitialState() {
  355. return {
  356. visible: false,
  357. loading: false
  358. };
  359. },
  360. handleCancel(e) {
  361. this.setState({
  362. visible: false,
  363. });
  364. if (e) {
  365. this.props.closeDesc(true);
  366. };
  367. },
  368. componentWillReceiveProps(nextProps) {
  369. this.state.visible = nextProps.showDesc;
  370. },
  371. render() {
  372. return (
  373. <div className="admin-desc">
  374. <Modal title="企业研究开发活动情况详情"
  375. visible={this.state.visible}
  376. onCancel={this.handleCancel}
  377. width='800px'
  378. footer=''
  379. className="admin-desc-content">
  380. <ActivityForm
  381. visible={this.state.visible}
  382. data={this.props.data}
  383. uid={this.props.uid}
  384. mockData={this.props.mockData}
  385. spinState={this.spinChange}
  386. closeModal={this.handleCancel} />
  387. </Modal>
  388. </div>
  389. );
  390. },
  391. });
  392. const Activity = React.createClass({
  393. loadData(pageNo) {
  394. this.state.data = [];
  395. this.setState({
  396. loading: true
  397. });
  398. $.when($.ajax({
  399. method: "post",
  400. dataType: "json",
  401. crossDomain: false,
  402. url: globalConfig.context + "/api/admin/activityList",
  403. data: {
  404. pageNo: pageNo || 1,
  405. pageSize: this.state.pagination.pageSize,
  406. uid: this.props.data.uid,
  407. activityNumber: this.state.activityNumber,
  408. activityName: this.state.activityName,
  409. startDateFormattedDate: this.state.startDateFormattedDate,
  410. endDateFormattedDate: this.state.endDateFormattedDate
  411. }
  412. }), $.ajax({
  413. method: "post",
  414. dataType: "json",
  415. crossDomain: false,
  416. url: globalConfig.context + "/api/admin/intellectualList",
  417. data: {
  418. uid: this.props.data.uid,
  419. pageNo: pageNo || 1,
  420. pageSize: 99,
  421. }
  422. })).done((data1, data2) => {
  423. let data = data1[0];
  424. let intellectualList = data2[0];
  425. if (data.error.length || !data.data || !data.data.list) {
  426. message.warning(data.error[0].message);
  427. return;
  428. };
  429. if (intellectualList.error.length || !intellectualList.data || !intellectualList.data.list) {
  430. message.warning(intellectualList.error[0].message);
  431. return;
  432. };
  433. let theArr = [];
  434. for (let i = 0; i < intellectualList.data.list.length; i++) {
  435. theArr.push({
  436. key: intellectualList.data.list[i].intellectualPropertyNumber,
  437. name: intellectualList.data.list[i].intellectualPropertyName
  438. });
  439. };
  440. this.state.mockData = theArr;
  441. for (let i = 0; i < data.data.list.length; i++) {
  442. let thisdata = data.data.list[i];
  443. this.state.data.push({
  444. key: i,
  445. id: thisdata.id,
  446. uid: thisdata.uid,
  447. activityNumber: thisdata.activityNumber,
  448. activityName: thisdata.activityName,
  449. startDate: thisdata.startDate,
  450. endDate: thisdata.endDate,
  451. mockData: this.state.mockData,
  452. techField: [Number(thisdata.technicalField1), Number(thisdata.technicalField2), Number(thisdata.technicalField3)],
  453. technicalField: getTechField(thisdata.technicalField1, thisdata.technicalField2, thisdata.technicalField3),
  454. technicalField1: thisdata.technicalField1,
  455. technicalField2: thisdata.technicalField2,
  456. technicalField3: thisdata.technicalField3,
  457. technicalSource: thisdata.technicalSource ? String(thisdata.technicalSource) : undefined,
  458. intellectualPropertyNumber: thisdata.intellectualPropertyNumber ? thisdata.intellectualPropertyNumber.split(",") : [],
  459. intellectualPropertyNumberText: thisdata.intellectualPropertyNumber,
  460. budget: thisdata.budget,
  461. firstYearExpenditure: thisdata.firstYearExpenditure,
  462. secondYearExpenditure: thisdata.secondYearExpenditure,
  463. thirdYearExpenditure: thisdata.thirdYearExpenditure,
  464. implement: thisdata.implement,
  465. technologyInnovation: thisdata.technologyInnovation,
  466. achievement: thisdata.achievement,
  467. internalLaborCost: thisdata.internalLaborCost,
  468. internalDirectCost: thisdata.internalDirectCost,
  469. internalDepreciationCost: thisdata.internalDepreciationCost,
  470. internalAmortizationCost: thisdata.internalAmortizationCost,
  471. internalDesignCost: thisdata.internalDesignCost,
  472. internalEquipmentCost: thisdata.internalEquipmentCost,
  473. internalOtherCost: thisdata.internalOtherCost,
  474. externalTotalCost: thisdata.externalTotalCost,
  475. externalAbroadCost: thisdata.externalAbroadCost,
  476. enterpriseFiller: thisdata.enterpriseFiller,
  477. signDate: thisdata.signDate,
  478. sortNumber: thisdata.sortNumber,
  479. startDateFormattedDate: thisdata.startDateFormattedDate,
  480. endDateFormattedDate: thisdata.endDateFormattedDate,
  481. projectMode: thisdata.projectMode,
  482. proofUrl: thisdata.proofUrl,
  483. proofDownloadFileName: thisdata.proofDownloadFileName
  484. });
  485. };
  486. this.state.pagination.current = data.data.pageNo;
  487. this.state.pagination.total = data.data.totalCount;
  488. this.setState({
  489. dataSource: this.state.data,
  490. pagination: this.state.pagination
  491. });
  492. }).always(function () {
  493. this.setState({
  494. loading: false
  495. });
  496. }.bind(this));
  497. let _me = this;
  498. getProportion(this.props.data.uid, function (data) { _me.setState({ proportion: data }); });
  499. },
  500. getInitialState() {
  501. return {
  502. mockData: [],
  503. selectedRowKeys: [],
  504. selectedRows: [],
  505. loading: false,
  506. pagination: {
  507. defaultCurrent: 1,
  508. defaultPageSize: 10,
  509. showQuickJumper: true,
  510. pageSize: 10,
  511. onChange: function (page) {
  512. this.loadData(page);
  513. }.bind(this),
  514. showTotal: function (total) {
  515. return '共' + total + '条数据';
  516. }
  517. },
  518. columns: [
  519. {
  520. title: '研发活动编号',
  521. dataIndex: 'activityNumber',
  522. key: 'activityNumber'
  523. }, {
  524. title: '研发活动名称',
  525. dataIndex: 'activityName',
  526. key: 'activityName'
  527. }, {
  528. title: '技术领域',
  529. dataIndex: 'technicalField',
  530. key: 'technicalField'
  531. }, {
  532. title: '技术来源',
  533. dataIndex: 'technicalSource',
  534. key: 'technicalSource',
  535. render: (text) => { return getTechnicalSource(text) }
  536. }, {
  537. title: '知识产权编号',
  538. dataIndex: 'intellectualPropertyNumberText',
  539. key: 'intellectualPropertyNumberText'
  540. }, {
  541. title: '开始时间',
  542. dataIndex: 'startDateFormattedDate',
  543. key: 'startDateFormattedDate'
  544. }, {
  545. title: '结束时间',
  546. dataIndex: 'endDateFormattedDate',
  547. key: 'endDateFormattedDate'
  548. }
  549. ],
  550. dataSource: []
  551. };
  552. },
  553. componentWillMount() {
  554. this.loadData();
  555. },
  556. tableRowClick(record, index) {
  557. this.state.RowData = record;
  558. this.setState({
  559. showDesc: true
  560. });
  561. },
  562. delectRow() {
  563. let deletedIds = [];
  564. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  565. let rowItem = this.state.selectedRows[idx];
  566. if (rowItem.id) {
  567. deletedIds.push(rowItem.id)
  568. }
  569. }
  570. this.setState({
  571. selectedRowKeys: [],
  572. loading: deletedIds.length > 0
  573. });
  574. $.ajax({
  575. method: "post",
  576. dataType: "json",
  577. crossDomain: false,
  578. url: globalConfig.context + "/api/admin/deleteActivity",
  579. data: {
  580. ids: deletedIds
  581. }
  582. }).done(function (data) {
  583. if (!data.error.length) {
  584. message.success('保存成功!');
  585. this.setState({
  586. loading: false,
  587. });
  588. } else {
  589. message.warning(data.error[0].message);
  590. };
  591. this.loadData();
  592. }.bind(this));
  593. },
  594. closeDesc(e) {
  595. this.state.showDesc = false;
  596. if (e) {
  597. this.loadData();
  598. };
  599. },
  600. search() {
  601. this.loadData();
  602. },
  603. reset() {
  604. this.state.activityName = undefined;
  605. this.state.activityNumber = undefined;
  606. this.state.startDateFormattedDate = undefined;
  607. this.state.endDateFormattedDate = undefined;
  608. this.loadData();
  609. },
  610. render() {
  611. const rowSelection = {
  612. selectedRowKeys: this.state.selectedRowKeys,
  613. onChange: (selectedRowKeys, selectedRows) => {
  614. this.setState({
  615. selectedRows: selectedRows,
  616. selectedRowKeys: selectedRowKeys
  617. });
  618. }
  619. };
  620. const hasSelected = this.state.selectedRowKeys.length > 0;
  621. return (
  622. <div className="user-content" >
  623. <div className="content-title">
  624. <span>企业研究开发活动情况表</span>
  625. <span className="proportion"> 是否已完成:</span>
  626. <Switch
  627. checked={this.state.proportion && this.state.proportion.activity == 1 ? true : false}
  628. checkedChildren={'已完成'}
  629. unCheckedChildren={'未完成'}
  630. onChange={(e) => {
  631. e ? this.state.proportion.activity = 1 : this.state.proportion.activity = 0;
  632. saveProportion(this.state.proportion.id, this.props.data.uid, 'activity', this.state.proportion.activity);
  633. this.setState({ proportion: this.state.proportion });
  634. }} />
  635. </div>
  636. <div className="user-search">
  637. <Input placeholder="研发活动名称" value={this.state.activityName}
  638. onChange={(e) => { this.setState({ activityName: e.target.value }); }} />
  639. <Input placeholder="研发活动编号" value={this.state.activityNumber}
  640. onChange={(e) => { this.setState({ activityNumber: e.target.value }); }} />
  641. <span>开始日期:</span>
  642. <DatePicker
  643. value={this.state.startDateFormattedDate ? moment(this.state.startDateFormattedDate) : null}
  644. onChange={(data, dataString) => { this.setState({ startDateFormattedDate: dataString }); }} />
  645. <span>结束日期:</span>
  646. <DatePicker
  647. value={this.state.endDateFormattedDate ? moment(this.state.endDateFormattedDate) : null}
  648. onChange={(data, dataString) => { this.setState({ endDateFormattedDate: dataString }); }} />
  649. <Button type="primary" onClick={this.search}>搜索</Button>
  650. <Button onClick={this.reset}>重置</Button>
  651. <p>
  652. <Button style={{ background: "#ea0862", border: "none", color: "#fff" }}
  653. onClick={this.tableRowClick}>添加<Icon type="plus" /></Button>
  654. <Button style={{ background: "#3fcf9e", border: "none", color: "#fff" }}
  655. disabled={!hasSelected}
  656. onClick={this.delectRow}>删除<Icon type="minus" /></Button>
  657. </p>
  658. </div>
  659. <div className="patent-table" >
  660. <Spin spinning={this.state.loading}>
  661. <Table columns={this.state.columns}
  662. dataSource={this.state.dataSource}
  663. pagination={this.state.pagination}
  664. rowSelection={rowSelection}
  665. onRowClick={this.tableRowClick} />
  666. </Spin>
  667. </div>
  668. <ActivityDesc data={this.state.RowData}
  669. uid={this.props.data.uid}
  670. mockData={this.state.mockData}
  671. showDesc={this.state.showDesc} closeDesc={this.closeDesc} />
  672. </div >
  673. );
  674. }
  675. });
  676. export default Activity;