correction.jsx 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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. endData: [thisdata.patentCatagory, thisdata.recordTime],
  44. author: thisdata.author,
  45. authorizedDate: thisdata.authorizedDate
  46. });
  47. };
  48. this.state.pagination.current = data.data.pageNo;
  49. this.state.pagination.total = data.data.totalCount;
  50. this.setState({
  51. dataSource: this.state.data,
  52. pagination: this.state.pagination
  53. });
  54. }.bind(this),
  55. }).always(function () {
  56. this.setState({
  57. loading: false
  58. });
  59. }.bind(this));
  60. },
  61. getInitialState() {
  62. return {
  63. serialNumber: '',
  64. patentNumber: '',
  65. office: '',
  66. locationProvince: '',
  67. unitName: '',
  68. patentCatagory: '',
  69. patentName: '',
  70. patentState: '',
  71. author: '',
  72. authorizedDate: '',
  73. loading: false,
  74. pagination: {
  75. defaultCurrent: 1,
  76. defaultPageSize: 10,
  77. showQuickJumper: true,
  78. pageSize: 10,
  79. onChange: function (page) {
  80. this.loadData(page);
  81. }.bind(this),
  82. showTotal: function (total) {
  83. return '共' + total + '条数据';
  84. }
  85. },
  86. columns: [
  87. {
  88. title: '答复截止日',
  89. dataIndex: 'endData',
  90. key: 'endData',
  91. render: text => {
  92. if (text[0] == '0') {
  93. return getTime(text[1], 2)
  94. } else if (text[0] == '1' || text[0] == '2') {
  95. return getTime(text[1], 4)
  96. }
  97. },
  98. }, {
  99. title: '编号',
  100. dataIndex: 'number',
  101. key: 'number',
  102. }, {
  103. title: '申请号/专利号',
  104. dataIndex: 'patentNumber',
  105. key: 'patentNumber',
  106. }, {
  107. title: '事务所',
  108. dataIndex: 'office',
  109. key: 'office',
  110. }, {
  111. title: '省份',
  112. dataIndex: 'locationProvince',
  113. key: 'locationProvince',
  114. render: text => { return getProvince(text) }
  115. }, {
  116. title: '公司名称',
  117. dataIndex: 'unitName',
  118. key: 'unitName',
  119. }, {
  120. title: '专利类型',
  121. dataIndex: 'patentType',
  122. key: 'patentType',
  123. render: text => { return getPatentType(text) },
  124. }, {
  125. title: '专利名称',
  126. dataIndex: 'patentName',
  127. key: 'patentName',
  128. }, {
  129. title: '专利状态',
  130. dataIndex: 'patentState',
  131. key: 'patentState',
  132. render: text => { return getPatentState(text) },
  133. }, {
  134. title: '资料撰写人',
  135. dataIndex: 'author',
  136. key: 'author',
  137. }
  138. ],
  139. dataSource: []
  140. };
  141. },
  142. componentWillMount() {
  143. this.loadData();
  144. },
  145. tableRowClick(record, index) {
  146. this.state.RowData = record;
  147. this.setState({
  148. showDesc: true
  149. });
  150. },
  151. closeDesc(e, s) {
  152. this.state.showDesc = e;
  153. if (s) {
  154. this.loadData();
  155. };
  156. },
  157. render() {
  158. return (
  159. <div className="patent-content" >
  160. <div className="content-title">
  161. <span>补正审查通知管理</span>
  162. </div>
  163. <div className="patent-table">
  164. <Spin spinning={this.state.loading}>
  165. <Table columns={this.state.columns}
  166. dataSource={this.state.dataSource}
  167. pagination={this.state.pagination}
  168. style={{
  169. cursor: 'pointer',
  170. }}
  171. onRowClick={this.tableRowClick} />
  172. </Spin>
  173. </div>
  174. <CorrectionDesc data={this.state.RowData} showDesc={this.state.showDesc} closeDesc={this.closeDesc} />
  175. </div >
  176. );
  177. }
  178. });
  179. export default Correction;