correctionDesc.jsx 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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.length) {
  34. message.warning(data.error[0].message);
  35. return;
  36. } else {
  37. message.success('保存成功!');
  38. };
  39. }.bind(this),
  40. }).always(function () {
  41. this.setState({
  42. loading: false,
  43. visible: false,
  44. });
  45. }.bind(this));
  46. this.props.closeDesc(false,true);
  47. },
  48. handleCancel(e) {
  49. this.setState({
  50. visible: false,
  51. });
  52. this.props.closeDesc(false);
  53. },
  54. componentWillReceiveProps(nextProps) {
  55. this.state.visible = nextProps.showDesc
  56. },
  57. render() {
  58. if (this.props.data) {
  59. return (
  60. <div className="payment-desc">
  61. <Spin spinning={this.state.loading} className='spin-box'>
  62. <Modal title="通知答复确认" visible={this.state.visible}
  63. onOk={this.handleOk} onCancel={this.handleCancel}
  64. width='500px'
  65. footer={[
  66. <Button key="submit" type="primary" size="large" onClick={this.handleOk}>确认</Button>,
  67. <Button key="back" type="ghost" size="large" onClick={this.handleCancel}>取消</Button>,
  68. ]}
  69. className="patent-desc-content">
  70. <div style={{ fontSize: '16px' }}>
  71. <p><span>公司:</span>{this.props.data.companyName}</p>
  72. <p><span>专利:</span>{this.props.data.patentName}</p>
  73. <p><span>专利号:</span><a href="">{this.props.data.patentNumber}</a></p>
  74. <p>{(() => {
  75. if (this.props.data.patentState == 4) { return <span>审查意见</span> }
  76. else if (this.props.data.patentState == 6) { return <span>补正通知</span> }
  77. })()}
  78. <span>确认已经答复?</span></p>
  79. </div>
  80. </Modal>
  81. </Spin>
  82. </div>
  83. );
  84. } else {
  85. return <div></div>
  86. }
  87. },
  88. });
  89. export default CorrectionDesc;