express.jsx 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. import React from 'react';
  2. import { Icon, Spin, Table, message } from 'antd';
  3. import { 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 ExpressDesc from './expressDesc.jsx';
  8. const Express = React.createClass({
  9. loadData(pageNo) {
  10. this.state.data = [];
  11. this.setState({
  12. loading: true
  13. });
  14. $.ajax({
  15. method: "get",
  16. dataType: "json",
  17. crossDomain: false,
  18. url: globalConfig.context + "/api/admin/patent/getRecieveSendList",
  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. number: thisdata.serialNumber,
  33. patentNumber: thisdata.patentNumber,
  34. unitName: thisdata.unitName,
  35. patentName: thisdata.patentName,
  36. patentType: thisdata.patentCatagory,
  37. locationProvince: thisdata.locationProvince,
  38. acceptanceReceiveTime: thisdata.acceptanceReceiveTimeFormattedDate,
  39. acceptanceIssueTime: thisdata.acceptanceIssueTimeFormattedDate,
  40. acceptanceTrackingNumber: thisdata.acceptanceTrackingNumber,
  41. acceptance: [thisdata.acceptanceReceiveTimeFormattedDate, thisdata.acceptanceIssueTimeFormattedDate],
  42. authorizationReceiveTime: thisdata.authorizationReceiveTimeFormattedDate,
  43. authorizationIssueTime: thisdata.authorizationIssueTimeFormattedDate,
  44. authorizationTrackingNumber: thisdata.authorizationTrackingNumber,
  45. authorization: [thisdata.authorizationReceiveTimeFormattedDate, thisdata.authorizationIssueTimeFormattedDate],
  46. certificateRecieveTime: thisdata.certificateRecieveTimeFormattedDate,
  47. certificateIssueTime: thisdata.certificateIssueTimeFormattedDate,
  48. certificateTrackingNumber: thisdata.certificateTrackingNumber,
  49. certificate: [thisdata.certificateRecieveTimeFormattedDate, thisdata.certificateIssueTimeFormattedDate],
  50. rid: thisdata.rid,
  51. pid: thisdata.pid
  52. });
  53. };
  54. this.state.pagination.current = data.data.pageNo;
  55. this.state.pagination.total = data.data.totalCount;
  56. this.setState({
  57. dataSource: this.state.data,
  58. pagination: this.state.pagination
  59. });
  60. }.bind(this),
  61. }).always(function () {
  62. this.setState({
  63. loading: false
  64. });
  65. }.bind(this));
  66. },
  67. getInitialState() {
  68. return {
  69. number: '',
  70. patentNumber: '',
  71. province: '',
  72. unitName: '',
  73. patentType: '',
  74. patentName: '',
  75. data: [],
  76. loading: false,
  77. pagination: {
  78. defaultCurrent: 1,
  79. defaultPageSize: 10,
  80. showQuickJumper: true,
  81. pageSize: 10,
  82. onChange: function (page) {
  83. this.loadData(page);
  84. }.bind(this),
  85. showTotal: function (total) {
  86. return '共' + total + '条数据';
  87. }
  88. },
  89. columns: [
  90. {
  91. title: '编号',
  92. dataIndex: 'number',
  93. key: 'number',
  94. }, {
  95. title: '申请号/专利号',
  96. dataIndex: 'patentNumber',
  97. key: 'patentNumber',
  98. }, {
  99. title: '省份',
  100. dataIndex: 'locationProvince',
  101. key: 'locationProvince',
  102. }, {
  103. title: '公司名称',
  104. dataIndex: 'unitName',
  105. key: 'unitName',
  106. }, {
  107. title: '专利类型',
  108. dataIndex: 'patentType',
  109. key: 'patentType',
  110. render: text => { return getPatentType(text) },
  111. }, {
  112. title: '专利名称',
  113. dataIndex: 'patentName',
  114. key: 'patentName',
  115. }, {
  116. title: '受理书',
  117. dataIndex: 'acceptance',
  118. key: 'acceptance',
  119. render: text => {
  120. if (text[1]) {
  121. return <div>已发出</div>
  122. } else {
  123. if (text[0]) {
  124. return <div>已收到</div>
  125. };
  126. };
  127. return <div>未收到</div>
  128. },
  129. }, {
  130. title: '授权书',
  131. dataIndex: 'authorization',
  132. key: 'authorization',
  133. render: text => {
  134. if (text[1]) {
  135. return <div>已发出</div>
  136. } else {
  137. if (text[0]) {
  138. return <div>已收到</div>
  139. };
  140. };
  141. return <div>未收到</div>
  142. },
  143. }, {
  144. title: '证书',
  145. dataIndex: 'certificate',
  146. key: 'certificate',
  147. render: text => {
  148. if (text[1]) {
  149. return <div>已发出</div>
  150. } else {
  151. if (text[0]) {
  152. return <div>已收到</div>
  153. };
  154. };
  155. return <div>未收到</div>
  156. },
  157. }
  158. ],
  159. dataSource: []
  160. };
  161. },
  162. componentWillMount() {
  163. this.loadData();
  164. },
  165. tableRowClick(record, index) {
  166. this.state.RowData = record;
  167. this.setState({
  168. showDesc: true
  169. });
  170. },
  171. closeDesc(e, s) {
  172. this.state.showDesc = e;
  173. if (s) {
  174. this.loadData();
  175. };
  176. },
  177. render() {
  178. return (
  179. <div className="patent-content" >
  180. <div className="content-title">
  181. <span>专利纸件收发登记</span>
  182. </div>
  183. <div className="patent-table">
  184. <Spin spinning={this.state.loading}>
  185. <Table columns={this.state.columns}
  186. dataSource={this.state.dataSource}
  187. pagination={this.state.pagination}
  188. onRowClick={this.tableRowClick} />
  189. </Spin>
  190. </div>
  191. <ExpressDesc data={this.state.RowData} showDesc={this.state.showDesc} closeDesc={this.closeDesc} />
  192. </div >
  193. );
  194. }
  195. });
  196. export default Express;