correction.jsx 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. import React from 'react';
  2. import { Spin, Table, Switch, message } from 'antd';
  3. import { getTime, getPatentState, getPatentType } from '../../../tools.js';
  4. import { getProvince } from '../../../NewDicProvinceList';
  5. import ajax from 'jquery/src/ajax/xhr.js';
  6. import $ from 'jquery/src/ajax';
  7. import './comprehensive.less';
  8. import CorrectionDesc from './correctionDesc.jsx';
  9. const Correction = React.createClass({
  10. loadData(pageNo) {
  11. this.state.data = [];
  12. this.setState({
  13. loading: true
  14. });
  15. $.ajax({
  16. method: "post",
  17. dataType: "json",
  18. crossDomain: false,
  19. url: globalConfig.context + "/api/admin/patent/noticeOfCorrectionList",
  20. data: {
  21. pageNo: pageNo || 1,
  22. pageSize: this.state.pagination.pageSize
  23. },
  24. success: function (data) {
  25. if (data.error.length || !data.data || !data.data.list) {
  26. message.warning(data.error[0].message);
  27. return;
  28. }
  29. for (let i = 0; i < data.data.list.length; i++) {
  30. let thisdata = data.data.list[i];
  31. this.state.data.push({
  32. key: i,
  33. pid: thisdata.pid,
  34. uid: thisdata.uid,
  35. number: thisdata.serialNumber,
  36. patentNumber: thisdata.patentNumber,
  37. office: thisdata.office,
  38. locationProvince: thisdata.locationProvince,
  39. unitName: thisdata.unitName,
  40. patentType: thisdata.patentCatagory,
  41. patentName: thisdata.patentName,
  42. patentState: thisdata.patentState,
  43. province: thisdata.locationProvince,
  44. endData: [thisdata.patentCatagory, thisdata.authorizedDate],
  45. author: thisdata.author,
  46. authorizedDate: thisdata.authorizedDate
  47. });
  48. };
  49. this.state.pagination.current = data.data.pageNo;
  50. this.state.pagination.total = data.data.totalCount;
  51. this.setState({
  52. dataSource: this.state.data,
  53. pagination: this.state.pagination
  54. });
  55. }.bind(this),
  56. }).always(function () {
  57. this.setState({
  58. loading: false
  59. });
  60. }.bind(this));
  61. },
  62. getInitialState() {
  63. return {
  64. serialNumber: '',
  65. patentNumber: '',
  66. office: '',
  67. locationProvince: '',
  68. unitName: '',
  69. patentCatagory: '',
  70. patentName: '',
  71. patentState: '',
  72. author: '',
  73. authorizedDate: '',
  74. loading: false,
  75. pagination: {
  76. defaultCurrent: 1,
  77. defaultPageSize: 10,
  78. showQuickJumper: true,
  79. pageSize: 10,
  80. onChange: function (page) {
  81. this.loadData(page);
  82. }.bind(this),
  83. showTotal: function (total) {
  84. return '共' + total + '条数据';
  85. }
  86. },
  87. columns: [
  88. {
  89. title: '答复截止日',
  90. dataIndex: 'endData',
  91. key: 'endData',
  92. render: text => {
  93. if (text[0] == '0') {
  94. return getTime(text[1], 2)
  95. } else if (text[0] == '1' || text[0] == '2') {
  96. return getTime(text[1], 4)
  97. }
  98. },
  99. }, {
  100. title: '编号',
  101. dataIndex: 'number',
  102. key: 'number',
  103. }, {
  104. title: '申请号/专利号',
  105. dataIndex: 'patentNumber',
  106. key: 'patentNumber',
  107. }, {
  108. title: '事务所',
  109. dataIndex: 'office',
  110. key: 'office',
  111. }, {
  112. title: '省份',
  113. dataIndex: 'province',
  114. key: 'province',
  115. render: text => { return getProvince(text) }
  116. }, {
  117. title: '公司名称',
  118. dataIndex: 'unitName',
  119. key: 'unitName',
  120. }, {
  121. title: '专利类型',
  122. dataIndex: 'patentType',
  123. key: 'patentType',
  124. render: text => { return getPatentType(text) },
  125. }, {
  126. title: '专利名称',
  127. dataIndex: 'patentName',
  128. key: 'patentName',
  129. }, {
  130. title: '专利状态',
  131. dataIndex: 'patentState',
  132. key: 'patentState',
  133. render: text => { return getPatentState(text) },
  134. }, {
  135. title: '资料撰写人',
  136. dataIndex: 'author',
  137. key: 'author',
  138. }
  139. ],
  140. dataSource: []
  141. };
  142. },
  143. componentWillMount() {
  144. this.loadData();
  145. },
  146. tableRowClick(record, index) {
  147. this.state.RowData = record;
  148. this.setState({
  149. showDesc: true
  150. });
  151. },
  152. closeDesc(e, s) {
  153. this.state.showDesc = e;
  154. if (s) {
  155. this.loadData();
  156. };
  157. },
  158. render() {
  159. return (
  160. <div className="patent-content" >
  161. <div className="content-title">
  162. <span>补正审查通知管理</span>
  163. </div>
  164. <div className="patent-table">
  165. <Spin spinning={this.state.loading}>
  166. <Table columns={this.state.columns}
  167. dataSource={this.state.dataSource}
  168. pagination={this.state.pagination}
  169. onRowClick={this.tableRowClick} />
  170. </Spin>
  171. </div>
  172. <CorrectionDesc data={this.state.RowData} showDesc={this.state.showDesc} closeDesc={this.closeDesc} />
  173. </div >
  174. );
  175. }
  176. });
  177. export default Correction;