patentDesc.jsx 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. import React from 'react';
  2. import { Icon, Modal, message, Spin, Timeline, Button, Popconfirm } from 'antd';
  3. import { getPatentType, getPatentState, getTime, getIndustryType, newDownloadFile } from '../../tools.js';
  4. import './patent.less';
  5. import ajax from 'jquery/src/ajax/xhr.js';
  6. import $ from 'jquery/src/ajax';
  7. const PatentDesc = React.createClass({
  8. getInitialState() {
  9. return {
  10. visible: false,
  11. loading: false,
  12. stepList: []
  13. };
  14. },
  15. showModal() {
  16. this.setState({
  17. visible: true,
  18. });
  19. },
  20. handleOk() {
  21. this.setState({
  22. visible: false,
  23. });
  24. this.props.closeDesc(false, true);
  25. },
  26. getPatentInfo(thepid) {
  27. $.ajax({
  28. method: "get",
  29. dataType: "json",
  30. crossDomain: false,
  31. url: globalConfig.context + "/api/user/patent/clientPatentInfo",
  32. data: {
  33. pid: thepid
  34. },
  35. success: function (data) {
  36. let thisData = data.data;
  37. if (!thisData) {
  38. if (data.error && data.error.length) {
  39. message.warning(data.error[0].message);
  40. }
  41. thisData = {};
  42. };
  43. this.setState({
  44. patentInfoData: thisData,
  45. stepList: this.state.stepList
  46. });
  47. }.bind(this),
  48. });
  49. },
  50. getStepList(thepid) {
  51. $.ajax({
  52. method: "get",
  53. dataType: "json",
  54. crossDomain: false,
  55. url: globalConfig.context + '/api/user/patent/patentProcess',
  56. data: {
  57. pid: thepid || this.props.pid
  58. },
  59. success: function (data) {
  60. let theArr = [];
  61. if (!data.data) {
  62. if (data.error && data.error.length) {
  63. message.warning(data.error[0].message);
  64. };
  65. } else {
  66. for (var item in data.data) {
  67. theArr.push(
  68. <Timeline.Item key={item}>
  69. <span>{getPatentState(data.data[item].state)}</span>
  70. {data.data[item].recordTimeFormattedDate}
  71. </Timeline.Item>
  72. )
  73. };
  74. };
  75. this.setState({
  76. stepList: theArr
  77. });
  78. }.bind(this),
  79. });
  80. },
  81. componentWillReceiveProps(nextProps) {
  82. if (!this.state.visible && nextProps.showDesc) {
  83. if (nextProps.data && nextProps.data.pid) {
  84. this.getStepList(nextProps.data.pid);
  85. this.getPatentInfo(nextProps.data.pid);
  86. };
  87. };
  88. this.state.visible = nextProps.showDesc;
  89. },
  90. handleCancel(e) {
  91. this.setState({
  92. visible: false,
  93. });
  94. this.props.closeDesc(false);
  95. },
  96. confirmButton() {
  97. this.setState({
  98. loading: true
  99. });
  100. $.ajax({
  101. method: "post",
  102. dataType: "json",
  103. crossDomain: false,
  104. url: globalConfig.context + "/api/user/patent/clientConfirm",
  105. data: {
  106. pid: this.props.data.pid
  107. }
  108. }).done(function (data) {
  109. if (data.error && data.error.length) {
  110. message.warning(data.error[0].message);
  111. } else {
  112. message.success('已确认完成!');
  113. this.state.patentInfoData.confirmState = 1;
  114. };
  115. }.bind(this)).always(function () {
  116. this.setState({
  117. loading: false
  118. });
  119. }.bind(this));
  120. },
  121. render() {
  122. let theData = this.state.patentInfoData;
  123. if (theData) {
  124. return (
  125. <div className="patent-desc">
  126. <Spin spinning={this.state.loading} className='spin-box'>
  127. <Modal maskClosable={false} title="专利详情" visible={this.state.visible}
  128. onOk={this.handleOk} onCancel={this.handleCancel}
  129. width='800px'
  130. footer=''
  131. className="patent-desc-content">
  132. <div>
  133. <p className="widthHalf"><span>编号:</span>{theData.serialNumber}</p>
  134. <p className="widthHalf"><span>申请号/专利号:</span>{theData.patentNumber}</p>
  135. </div>
  136. <div>
  137. <p className="widthHalf"><span>专利名称:</span>{theData.patentName}</p>
  138. <p className="widthHalf"><span>专利类型:</span>{getPatentType(theData.patentCatagory)}</p>
  139. </div>
  140. <div>
  141. <p className="widthHalf"><span>专利状态:</span>{getPatentState(theData.patentState)}</p>
  142. <p className="widthHalf"><span>所属行业:</span>{getIndustryType(theData.patentField)}</p>
  143. </div>
  144. <div>
  145. <span>简介:</span>{theData.patentDes}
  146. </div>
  147. <div className="patent-download">
  148. <span>专利相关材料:</span>
  149. {theData.patentWritingUrl ?
  150. <p className="download-file">
  151. <a onClick={newDownloadFile.bind(this, theData.id, 'patent_writing', '/api/user/patent/download')}>专利稿件下载</a>
  152. {theData.confirmState == 0 ?
  153. <Popconfirm
  154. title={"您将确认专利名称为 [ " + theData.patentName + " ] 的稿件,确认操作?"}
  155. onConfirm={this.confirmButton}
  156. okText="确认"
  157. cancelText="取消"
  158. placement="topLeft">
  159. <Button>确认稿件</Button>
  160. </Popconfirm> : <span></span>}
  161. </p> :
  162. <p><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />专利稿件未上传</p>
  163. }
  164. {theData.authorizationNoticeUrl ?
  165. <p className="download-file">
  166. <a onClick={newDownloadFile.bind(this, theData.id, 'authorization_notice', '/api/user/patent/download')}>授权通知书下载</a>
  167. </p> :
  168. <p><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />授权通知书未上传</p>
  169. }
  170. {theData.patentCertificateUrl ?
  171. <p className="download-file">
  172. <a onClick={newDownloadFile.bind(this, theData.id, 'patent_certificate', '/api/user/patent/download')}>专利证书下载</a>
  173. </p> :
  174. <p><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />专利证书未上传</p>
  175. }
  176. {theData.patentProryStatementUrl ?
  177. <p className="download-file">
  178. <a onClick={newDownloadFile.bind(this, theData.id, 'patent_prory_statement', '/api/user/patent/download')}>专利代理委托书下载</a>
  179. </p> :
  180. <p><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />专利代理委托书未上传</p>
  181. }
  182. </div>
  183. <div>
  184. <span>专利申请日:</span>{theData.patentApplicationFormattedDate}
  185. </div>
  186. <div>
  187. <span>专利授权日:</span>{theData.authorizedFormattedDate}
  188. </div>
  189. <div>
  190. <span>每年年费缴费截止日:</span>{getTime(theData.patentApplicationDate, 12)}
  191. </div>
  192. <div>
  193. <p>第一发明人:</p>
  194. <p><span>姓名:</span>{theData.firstInventorName}</p>
  195. <p><span>身份证:</span>{theData.firstInventorIdNumber}</p>
  196. </div>
  197. <div style={theData.secondInventorName === '' ? { display: 'none' } : {}}>
  198. <p>第二发明人:</p>
  199. <p><span>姓名:</span>{theData.secondInventorName}</p>
  200. </div>
  201. <div style={theData.thirdInventorName === '' ? { display: 'none' } : {}}>
  202. <p>第三发明人:</p>
  203. <p><span>姓名:</span>{theData.thirdInventorName}</p>
  204. </div>
  205. <Timeline className="time-line">
  206. {this.state.stepList}
  207. </Timeline>
  208. </Modal>
  209. </Spin>
  210. </div>
  211. );
  212. } else {
  213. return <div></div>
  214. }
  215. },
  216. });
  217. export default PatentDesc;