patent.jsx 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. import React from 'react';
  2. import { Icon, Button, Input, Select, Spin, Table, message } from 'antd';
  3. import { patentTypeList, patentStateList } from '../../dataDic.js';
  4. import { getPatentType, getPatentState, getTime, setUserContactsList } 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: "get",
  18. dataType: "json",
  19. crossDomain: false,
  20. url: globalConfig.context + "/api/user/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.data) {
  31. if (data.error && data.error.length) {
  32. message.warning(data.error[0].message);
  33. this.state.ButtonDisabled = true;
  34. }
  35. return;
  36. };
  37. for (let i = 0; i < data.data.list.length; i++) {
  38. let thisdata = data.data.list[i];
  39. this.state.data.push({
  40. key: i,
  41. pid: thisdata.id,
  42. number: thisdata.serialNumber,
  43. patentNum: thisdata.patentNumber,
  44. patentName: thisdata.patentName,
  45. patentCatagory: thisdata.patentCatagory ? getPatentType(thisdata.patentCatagory) : '',
  46. patentState: thisdata.patentState,
  47. patentField: thisdata.patentField,
  48. patentDes: thisdata.patentDes,
  49. patentProryStatementUrl: thisdata.patentProryStatementUrl, //专利代理委托书
  50. patentWritingUrl: thisdata.patentWritingUrl, //专利稿件
  51. authorizationNoticeUrl: thisdata.authorizationNoticeUrl, //授权通知书
  52. patentCertificateUrl: thisdata.patentCertificateUrl, //专利证书
  53. confirmState: thisdata.confirmState, //稿件确认状态
  54. authorizedTime: getTime(thisdata.authorizedDate),
  55. startTime: getTime(thisdata.patentApplicationDate),
  56. endTime: getTime(thisdata.patentApplicationDate, 12),
  57. firstInventorName: thisdata.firstInventorName,
  58. firstInventorNationality: thisdata.firstInventorNationality, //国籍
  59. firstInventorIdNumber: thisdata.firstInventorIdNumber, //id
  60. firstInventorIsPublish: thisdata.firstInventorIsPublish, //是否公布
  61. secondInventorName: thisdata.secondInventorName,
  62. secondInventorNationality: thisdata.secondInventorNationality,
  63. secondInventorIsPublish: thisdata.secondInventorIsPublish,
  64. thirdInventorName: thisdata.thirdInventorName,
  65. thirdInventorNationality: thisdata.thirdInventorNationality,
  66. thirdInventorIsPublish: thisdata.thirdInventorIsPublish,
  67. createTime: thisdata.createTime, //派单日
  68. author: thisdata.author, //撰写人
  69. office: thisdata.office, //事务所
  70. principal: thisdata.principal //负责人
  71. });
  72. };
  73. this.state.pagination.current = data.data.pageNo;
  74. this.state.pagination.total = data.data.totalCount;
  75. this.setState({
  76. dataSource: this.state.data,
  77. pagination: this.state.pagination
  78. });
  79. }.bind(this),
  80. }).always(function () {
  81. this.setState({
  82. loading: false
  83. });
  84. }.bind(this));
  85. },
  86. getInitialState() {
  87. return {
  88. patentTypeOption: [],
  89. patentStateOption: [],
  90. data: [],
  91. //dataSource: [],
  92. loading: false,
  93. pagination: {
  94. defaultCurrent: 1,
  95. defaultPageSize: 10,
  96. showQuickJumper: true,
  97. pageSize: 10,
  98. onChange: function (page) {
  99. this.loadData(page);
  100. }.bind(this),
  101. showTotal: function (total) {
  102. return '共' + total + '条数据';
  103. }
  104. },
  105. columns: [
  106. {
  107. title: '编号',
  108. dataIndex: 'number',
  109. key: 'number',
  110. }, {
  111. title: '申请号/专利号',
  112. dataIndex: 'patentNum',
  113. key: 'patentNum',
  114. }, {
  115. title: '专利类型',
  116. dataIndex: 'patentCatagory',
  117. key: 'patentCatagory',
  118. }, {
  119. title: '专利名称',
  120. dataIndex: 'patentName',
  121. key: 'patentName',
  122. }, {
  123. title: '专利状态',
  124. dataIndex: 'patentState',
  125. key: 'patentState',
  126. render: (text) => {
  127. if (text == '13') {
  128. return '已完成'
  129. } else {
  130. return getPatentState(text)
  131. }
  132. }
  133. }, {
  134. title: '申请日',
  135. dataIndex: 'startTime',
  136. key: 'startTime',
  137. }, {
  138. title: '授权缴费截止日',
  139. dataIndex: 'endTime',
  140. key: 'endTime',
  141. }
  142. ],
  143. dataSource: []
  144. };
  145. },
  146. componentWillMount() {
  147. let _me = this;
  148. patentTypeList.map(function (item) {
  149. _me.state.patentTypeOption.push(
  150. <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
  151. )
  152. });
  153. patentStateList.map(function (item) {
  154. if (item.value == '13') {
  155. _me.state.patentStateOption.push(
  156. <Select.Option value={item.value} key={item.key}>已完成</Select.Option>
  157. )
  158. } else {
  159. _me.state.patentStateOption.push(
  160. <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
  161. )
  162. }
  163. });
  164. this.loadData();
  165. this.state.contactsOption = setUserContactsList();
  166. },
  167. tableRowClick(record, index) {
  168. this.state.RowData = record;
  169. this.setState({
  170. showDesc: true
  171. });
  172. },
  173. closeDesc(e, s) {
  174. this.state.showDesc = e;
  175. if (s) {
  176. this.loadData();
  177. };
  178. },
  179. search() {
  180. this.loadData();
  181. },
  182. reset() {
  183. this.state.searchNum = undefined;
  184. this.state.searchName = undefined;
  185. this.state.searchType = undefined;
  186. this.state.searchState = undefined;
  187. this.loadData();
  188. },
  189. render() {
  190. return (
  191. <div className="patent-content" >
  192. <div className="content-title">
  193. <span>专利申请管理</span>
  194. </div>
  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. style={{
  209. cursor: 'pointer',
  210. }}
  211. onRowClick={this.tableRowClick} />
  212. </Spin>
  213. </div>
  214. <PatentDesc data={this.state.RowData} showDesc={this.state.showDesc} closeDesc={this.closeDesc} />
  215. </div >
  216. );
  217. }
  218. });
  219. export default Patent;
  220. // {userData.type == '0' ? <span></span> : <PatentAdd ButtonDisabled={this.state.ButtonDisabled} closeDesc={this.closeDesc} />}