patent.jsx 9.1 KB

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