businessDesc.jsx 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. import React from 'react';
  2. import { Modal, Spin } from 'antd';
  3. import DemandForm from '@/account/business/businessForm';
  4. import DemandDetaiel from '@/account/business/businessDetails';
  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. categoryList={this.props.categoryList}
  50. visible={this.state.visible}
  51. handOk={this.handOk.bind(this)}
  52. tagList={this.props.tagList}
  53. />
  54. :
  55. <DemandForm
  56. closeDesc={this.handleCancel.bind(this)}
  57. data={this.props.data}
  58. categoryList={this.props.categoryList}
  59. visible={this.state.visible}
  60. handOk={this.handOk.bind(this)}
  61. tagList={this.props.tagList}
  62. />
  63. }
  64. </div>
  65. </div>
  66. </Modal>
  67. </div>
  68. );
  69. }
  70. }
  71. export default DemandDesc;