correctionDesc.jsx 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. import React from 'react';
  2. import { Icon, Modal, message, Spin, Button } from 'antd';
  3. import './comprehensive.less';
  4. import ajax from 'jquery/src/ajax/xhr.js';
  5. import $ from 'jquery/src/ajax';
  6. const CorrectionDesc = React.createClass({
  7. getInitialState() {
  8. return {
  9. visible: false,
  10. loading: false,
  11. };
  12. },
  13. showModal() {
  14. this.setState({
  15. visible: true,
  16. });
  17. },
  18. handleOk() {
  19. this.setState({
  20. loading: true
  21. });
  22. $.ajax({
  23. method: "post",
  24. dataType: "json",
  25. crossDomain: false,
  26. url: globalConfig.context + "/api/admin/patent/replyConfirm",
  27. data: {
  28. pid: this.props.data.pid,
  29. uid: this.props.data.uid,
  30. patentState: this.props.data.patentState
  31. },
  32. success: function (data) {
  33. if (data.error && data.error.length) {
  34. message.warning(data.error[0].message);
  35. } else {
  36. message.success('保存成功!');
  37. this.props.closeDesc(false, true);
  38. };
  39. }.bind(this),
  40. }).always(function () {
  41. this.setState({
  42. loading: false,
  43. visible: false,
  44. });
  45. }.bind(this));
  46. },
  47. handleCancel(e) {
  48. this.setState({
  49. visible: false,
  50. });
  51. this.props.closeDesc(false);
  52. },
  53. componentWillReceiveProps(nextProps) {
  54. this.state.visible = nextProps.showDesc
  55. },
  56. render() {
  57. if (this.props.data) {
  58. return (
  59. <div className="payment-desc">
  60. <Spin spinning={this.state.loading} className='spin-box'>
  61. <Modal maskClosable={false} title="通知答复确认" visible={this.state.visible}
  62. onOk={this.handleOk} onCancel={this.handleCancel}
  63. width='500px'
  64. footer={[
  65. <Button key="submit" type="primary" size="large" onClick={this.handleOk}>确认</Button>,
  66. <Button key="back" type="ghost" size="large" onClick={this.handleCancel}>取消</Button>,
  67. ]}
  68. className="patent-desc-content">
  69. <div style={{ fontSize: '16px' }}>
  70. <p><span>公司:</span>{this.props.data.unitName}</p>
  71. <p><span>专利:</span>{this.props.data.patentName}</p>
  72. <p>{(() => {
  73. if (this.props.data.patentState == 6) { return <span>审查意见</span> }
  74. else if (this.props.data.patentState == 8) { return <span>补正通知</span> }
  75. })()}
  76. <span>确认已经答复?</span></p>
  77. </div>
  78. </Modal>
  79. </Spin>
  80. </div>
  81. );
  82. } else {
  83. return <div></div>
  84. }
  85. },
  86. });
  87. export default CorrectionDesc;