achievementDesc.jsx 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. import React from 'react';
  2. import { Modal, Spin } from 'antd';
  3. import DemandForm from '@/account/achievement/achievementForm';
  4. import DemandDetaiel from '@/account/achievement/achievementDetails';
  5. class DemandDesc extends React.Component {
  6. constructor(props) {
  7. super(props);
  8. this.state = {
  9. loading: false,
  10. pictureUrl: [],
  11. showState:false
  12. };
  13. }
  14. handleCancel() {
  15. this.setState({
  16. visible: false,
  17. });
  18. this.props.closeDesc(false, false);
  19. }
  20. handOk() {
  21. this.setState({
  22. visible: false,
  23. });
  24. this.props.closeDesc(false, true);
  25. }
  26. componentWillReceiveProps(nextProps) {
  27. this.state.visible = nextProps.showDesc;
  28. }
  29. render() {
  30. let data = this.props.data || {auditStatus:0};
  31. return (
  32. <div className="patent-desc">
  33. <Modal
  34. maskClosable={false}
  35. visible={this.state.visible}
  36. onOk={this.handOk.bind(this)}
  37. onCancel={this.handleCancel.bind(this)}
  38. width="1000px"
  39. title={!data.id ? '新建成果' : '成果详情'}
  40. footer=""
  41. className="admin-desc-content"
  42. >
  43. <div>
  44. <div>
  45. {data.auditStatus=='1'||data.auditStatus=='2'?
  46. <DemandDetaiel
  47. closeDesc={this.handleCancel.bind(this)}
  48. data={this.props.data}
  49. demandTypeOption={this.props.demandTypeOption}
  50. visible={this.state.visible}
  51. handOk={this.handOk.bind(this)}
  52. />
  53. :
  54. <DemandForm
  55. closeDesc={this.handleCancel.bind(this)}
  56. data={this.props.data}
  57. demandTypeOption={this.props.demandTypeOption}
  58. visible={this.state.visible}
  59. handOk={this.handOk.bind(this)}
  60. />
  61. }
  62. </div>
  63. </div>
  64. </Modal>
  65. </div>
  66. );
  67. }
  68. }
  69. export default DemandDesc;