patent.jsx 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. import React from 'react';
  2. import { Icon, Alert, Button, Input, Select, Spin, Table } from 'antd';
  3. import { patentTypeList, patentStateList } from '../../dataDic.js';
  4. import { getPatentType, getPatentState, getTime } from '../../tools.js';
  5. import ajax from 'jquery/src/ajax/xhr.js'
  6. import $ from 'jquery/src/ajax';
  7. import './patent.less';
  8. import PatentAdd from './patentAdd.jsx';
  9. import PatentDesc from './patentDesc.jsx';
  10. import ClientInputPatent from './clientInputPatent.jsx';
  11. const Patent = React.createClass({
  12. loadData(pageNo) {
  13. this.state.data = [];
  14. this.setState({
  15. loading: true
  16. });
  17. $.ajax({
  18. method: "post",
  19. dataType: "json",
  20. crossDomain: false,
  21. url: globalConfig.context + "/techservice/patent/clientApplyList",
  22. data: {
  23. pageNo: pageNo || 1,
  24. pageSize: this.state.pagination.pageSize,
  25. patentNumber: this.state.searchNum,
  26. patentName: this.state.searchName,
  27. patentCatagory: this.state.searchType,
  28. patentState: this.state.searchState
  29. },
  30. success: function (data) {
  31. if (data.error.length || !data.data || !data.data.list) {
  32. return;
  33. }
  34. for (let i = 0; i < data.data.list.length; i++) {
  35. let thisdata = data.data.list[i];
  36. this.state.data.push({
  37. key: i,
  38. pid:thisdata.id,
  39. number: thisdata.serialNumber,
  40. patentNum: thisdata.patentNumber,
  41. patentName: thisdata.patentName,
  42. patentType: getPatentType(thisdata.patentCatagory),
  43. patentState: getPatentState(thisdata.patentState),
  44. patentField: thisdata.patentField,
  45. patentDes: thisdata.patentDes,
  46. patentProryStatementUrl: thisdata.patentProryStatementUrl, //专利代理委托书
  47. patentWritingUrl: thisdata.patentWritingUrl, //专利稿件
  48. authorizationNoticeUrl: thisdata.authorizationNoticeUrl, //授权通知书
  49. patentCertificateUrl: thisdata.patentCertificateUrl, //专利证书
  50. confirmState:thisdata.confirmState, //稿件确认状态
  51. authorizedTime:getTime(thisdata.authorizedDate),
  52. startTime: getTime(thisdata.patentApplicationDate),
  53. endTime: getTime(thisdata.patentApplicationDate,2),
  54. firstInventorName: thisdata.firstInventorName,
  55. firstInventorNationality: thisdata.firstInventorNationality, //国籍
  56. firstInventorIdNumber: thisdata.firstInventorIdNumber, //id
  57. firstInventorIsPublish: thisdata.firstInventorIsPublish, //是否公布
  58. secondInventorName: thisdata.secondInventorName,
  59. secondInventorNationality: thisdata.secondInventorNationality,
  60. secondInventorIsPublish: thisdata.secondInventorIsPublish,
  61. thirdInventorName: thisdata.thirdInventorName,
  62. thirdInventorNationality: thisdata.thirdInventorNationality,
  63. thirdInventorIsPublish: thisdata.thirdInventorIsPublish,
  64. createTime: thisdata.createTime, //派单日
  65. author: thisdata.author, //撰写人
  66. office: thisdata.office, //事务所
  67. principal: thisdata.principal //负责人
  68. });
  69. };
  70. this.state.pagination.current = data.data.pageNo;
  71. this.state.pagination.total = data.data.totalCount;
  72. this.setState({
  73. dataSource: this.state.data,
  74. pagination: this.state.pagination
  75. });
  76. console.log(this.state.data);
  77. }.bind(this),
  78. }).always(function () {
  79. this.setState({
  80. loading: false
  81. });
  82. }.bind(this));
  83. },
  84. getInitialState() {
  85. return {
  86. warningText: 'warning text! warning text! warning text!',
  87. AlertDis: 'block',
  88. patentTypeOption: [],
  89. patentStateOption: [],
  90. data: [],
  91. //dataSource: [],
  92. download: globalConfig.context + '/api/warningreports/download',
  93. loading: false,
  94. pagination: {
  95. defaultCurrent: 1,
  96. defaultPageSize: 10,
  97. showQuickJumper: true,
  98. pageSize: 10,
  99. onChange: function (page) {
  100. this.loadData(page);
  101. }.bind(this),
  102. showTotal: function (total) {
  103. return '共' + total + '条数据';
  104. }
  105. },
  106. columns: [
  107. {
  108. title: '编号',
  109. dataIndex: 'number',
  110. key: 'number',
  111. }, {
  112. title: '申请号/专利号',
  113. dataIndex: 'patentNum',
  114. key: 'patentNum',
  115. }, {
  116. title: '专利类型',
  117. dataIndex: 'patentType',
  118. key: 'patentType',
  119. }, {
  120. title: '专利名称',
  121. dataIndex: 'patentName',
  122. key: 'patentName',
  123. }, {
  124. title: '专利状态',
  125. dataIndex: 'patentState',
  126. key: 'patentState',
  127. }, {
  128. title: '申请日',
  129. dataIndex: 'startTime',
  130. key: 'startTime',
  131. }, {
  132. title: '授权缴费截止日',
  133. dataIndex: 'endTime',
  134. key: 'endTime',
  135. }
  136. ],
  137. dataSource: []
  138. };
  139. },
  140. componentWillMount() {
  141. let _me = this;
  142. patentTypeList.map(function (item) {
  143. _me.state.patentTypeOption.push(
  144. <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
  145. )
  146. });
  147. patentStateList.map(function (item) {
  148. _me.state.patentStateOption.push(
  149. <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
  150. )
  151. });
  152. this.loadData();
  153. },
  154. alertClose(e) {
  155. console.log(e);
  156. },
  157. tableRowClick(record, index) {
  158. this.state.RowData = record;
  159. this.setState({
  160. showDesc: true
  161. });
  162. },
  163. closeDesc(e) {
  164. this.state.showDesc = e;
  165. this.loadData();
  166. },
  167. search() {
  168. this.state.searchNum;
  169. this.state.searchName;
  170. this.state.searchType;
  171. this.state.searchState;
  172. this.loadData();
  173. },
  174. reset() {
  175. this.state.searchNum = "";
  176. this.state.searchName = "";
  177. this.state.searchType = "";
  178. this.state.searchState = "";
  179. this.loadData();
  180. },
  181. render() {
  182. return (
  183. <div className="patent-content" >
  184. <div className="content-title">
  185. <span>专利申请管理</span>
  186. {userData.type == '0' ? <span></span> : <PatentAdd closeDesc={this.closeDesc}/>}
  187. {userData.type == '0' ? <span></span> : <ClientInputPatent closeDesc={this.closeDesc}/>}
  188. </div>
  189. <Alert style={{ display: this.state.AlertDis }} className="patent-alert" message={this.state.warningText}
  190. type="info"
  191. showIcon={true}
  192. closable
  193. onClose={this.alertClose}
  194. />
  195. <div className="patent-query">
  196. <Input placeholder="专利号" value={this.state.searchNum} onChange={(e) => { this.setState({ searchNum: e.target.value }); }} />
  197. <Input placeholder="专利名称" value={this.state.searchName} onChange={(e) => { this.setState({ searchName: e.target.value }); }} />
  198. <Select placeholder="专利类型" value={this.state.searchType} style={{ width: 200 }} onChange={(e) => { this.setState({ searchType: e }); }}>{this.state.patentTypeOption}</Select>
  199. <Select placeholder="专利状态" value={this.state.searchState} style={{ width: 200 }} onChange={(e) => { this.setState({ searchState: e }); }}>{this.state.patentStateOption}</Select>
  200. <Button type="primary" onClick={this.search}>搜索</Button>
  201. <Button type="ghost" onClick={this.reset}>重置</Button>
  202. </div>
  203. <div className="patent-table">
  204. <Spin spinning={this.state.loading}>
  205. <Table columns={this.state.columns}
  206. dataSource={this.state.dataSource}
  207. pagination={this.state.pagination}
  208. onRowClick={this.tableRowClick} />
  209. </Spin>
  210. </div>
  211. <PatentDesc data={this.state.RowData} showDesc={this.state.showDesc} closeDesc={this.closeDesc} />
  212. </div >
  213. );
  214. }
  215. });
  216. export default Patent;