correction.jsx 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. import React from 'react';
  2. import { Icon, Button, Input, Select, Spin, Table, Switch, DatePicker, message } from 'antd';
  3. import { getTime, getPatentState,getPatentType } from '../../../tools.js';
  4. import ajax from 'jquery/src/ajax/xhr.js';
  5. import $ from 'jquery/src/ajax';
  6. import './comprehensive.less';
  7. import CorrectionDesc from './correctionDesc.jsx';
  8. const Correction = React.createClass({
  9. loadData(pageNo) {
  10. this.state.data = [];
  11. this.setState({
  12. loading: true
  13. });
  14. $.ajax({
  15. method: "post",
  16. dataType: "json",
  17. crossDomain: false,
  18. url: globalConfig.context + "/api/admin/patent/noticeOfCorrectionList",
  19. data: {
  20. pageNo: pageNo || 1,
  21. pageSize: this.state.pagination.pageSize
  22. },
  23. success: function (data) {
  24. if (data.error.length || !data.data || !data.data.list) {
  25. message.warning(data.error[0].message);
  26. return;
  27. }
  28. for (let i = 0; i < data.data.list.length; i++) {
  29. let thisdata = data.data.list[i];
  30. this.state.data.push({
  31. key: i,
  32. pid:thisdata.pid,
  33. uid:thisdata.uid,
  34. number: thisdata.serialNumber,
  35. patentNumber: thisdata.patentNumber,
  36. office: thisdata.office,
  37. locationProvince: thisdata.locationProvince,
  38. unitName: thisdata.unitName,
  39. patentType: thisdata.patentCatagory,
  40. patentName: thisdata.patentName,
  41. patentState: thisdata.patentState,
  42. province:thisdata.locationProvince,
  43. endData:[thisdata.patentCatagory,thisdata.authorizedDate],
  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: 'province',
  113. key: 'province',
  114. }, {
  115. title: '公司名称',
  116. dataIndex: 'companyName',
  117. key: 'companyName',
  118. }, {
  119. title: '专利类型',
  120. dataIndex: 'patentType',
  121. key: 'patentType',
  122. render: text => { return getPatentType(text) },
  123. }, {
  124. title: '专利名称',
  125. dataIndex: 'patentName',
  126. key: 'patentName',
  127. }, {
  128. title: '专利状态',
  129. dataIndex: 'patentState',
  130. key: 'patentState',
  131. render: text => { return getPatentState(text) },
  132. }, {
  133. title: '资料撰写人',
  134. dataIndex: 'author',
  135. key: 'author',
  136. }
  137. ],
  138. dataSource: []
  139. };
  140. },
  141. componentWillMount() {
  142. this.loadData();
  143. },
  144. tableRowClick(record, index) {
  145. this.state.RowData = record;
  146. this.setState({
  147. showDesc: true
  148. });
  149. },
  150. closeDesc(e, s) {
  151. this.state.showDesc = e;
  152. if (s) {
  153. this.loadData();
  154. };
  155. },
  156. render() {
  157. const { MonthPicker, RangePicker } = DatePicker;
  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. onRowClick={this.tableRowClick} />
  169. </Spin>
  170. </div>
  171. <CorrectionDesc data={this.state.RowData} showDesc={this.state.showDesc} closeDesc={this.closeDesc} />
  172. </div >
  173. );
  174. }
  175. });
  176. export default Correction;