correction.jsx 6.3 KB

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