activity.jsx 31 KB

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