correctionDesc.jsx 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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 + "/techservice/patent/replyConfirm",
  27. data: {
  28. pid: this.props.data.pid,
  29. patentState: this.props.data.patentState
  30. },
  31. success: function (data) {
  32. if (data.error.length) {
  33. message.warning(data.error[0].message);
  34. return;
  35. } else {
  36. message.success('保存成功!');
  37. };
  38. }.bind(this),
  39. }).always(function () {
  40. this.setState({
  41. loading: false,
  42. visible: false,
  43. });
  44. }.bind(this));
  45. this.props.closeDesc(false);
  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 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.companyName}</p>
  71. <p><span>专利:</span>{this.props.data.patentName}</p>
  72. <p><span>专利号:</span><a href="">{this.props.data.patentNumber}</a></p>
  73. <p>{(() => {
  74. if (this.props.data.patentState == 4) { return <span>审查意见</span> }
  75. else if (this.props.data.patentState == 6) { return <span>补正通知</span> }
  76. })()}
  77. <span>确认已经答复?</span></p>
  78. </div>
  79. </Modal>
  80. </Spin>
  81. </div>
  82. );
  83. } else {
  84. return <div></div>
  85. }
  86. },
  87. });
  88. export default CorrectionDesc;