express.jsx 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  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. let page = pageNo || 1,
  15. pageSize = this.state.pagination.pageSize;
  16. $.ajax({
  17. method: "get",
  18. dataType: "json",
  19. crossDomain: false,
  20. url: globalConfig.context + "/api/admin/patent/getRecieveSendList?pageNo=" + page + "&pageSize=" + pageSize,
  21. success: function (data) {
  22. if (data.error.length || !data.data || !data.data.list) {
  23. message.warning(data.error[0].message);
  24. return;
  25. }
  26. for (let i = 0; i < data.data.list.length; i++) {
  27. let thisdata = data.data.list[i];
  28. this.state.data.push({
  29. key: i,
  30. number: thisdata.serialNumber,
  31. patentNumber: thisdata.patentNumber,
  32. unitName: thisdata.unitName,
  33. patentName: thisdata.patentName,
  34. patentType: thisdata.patentCatagory,
  35. acceptanceReceiveTime:thisdata.acceptanceReceiveTimeFormattedDate,
  36. acceptanceIssueTime:thisdata.acceptanceIssueTimeFormattedDate,
  37. acceptanceTrackingNumber:thisdata.acceptanceTrackingNumber,
  38. acceptance:[thisdata.acceptanceReceiveTimeFormattedDate,thisdata.acceptanceIssueTimeFormattedDate],
  39. authorizationReceiveTime:thisdata.authorizationReceiveTimeFormattedDate,
  40. authorizationIssueTime:thisdata.authorizationIssueTimeFormattedDate,
  41. authorizationTrackingNumber:thisdata.authorizationTrackingNumber,
  42. authorization:[thisdata.authorizationReceiveTimeFormattedDate,thisdata.authorizationIssueTimeFormattedDate],
  43. certificateRecieveTime:thisdata.certificateRecieveTimeFormattedDate,
  44. certificateIssueTime:thisdata.certificateIssueTimeFormattedDate,
  45. certificateTrackingNumber:thisdata.certificateTrackingNumber,
  46. certificate:[thisdata.certificateRecieveTimeFormattedDate,thisdata.certificateIssueTimeFormattedDate],
  47. rid:thisdata.rid,
  48. pid:thisdata.pid
  49. });
  50. };
  51. this.state.pagination.current = data.data.pageNo;
  52. this.state.pagination.total = data.data.totalCount;
  53. this.setState({
  54. dataSource: this.state.data,
  55. pagination: this.state.pagination
  56. });
  57. }.bind(this),
  58. }).always(function () {
  59. this.setState({
  60. loading: false
  61. });
  62. }.bind(this));
  63. },
  64. getInitialState() {
  65. return {
  66. number: '',
  67. patentNumber: '',
  68. province: '',
  69. unitName: '',
  70. patentType: '',
  71. patentName: '',
  72. data: [],
  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: 'number',
  90. key: 'number',
  91. }, {
  92. title: '申请号/专利号',
  93. dataIndex: 'patentNumber',
  94. key: 'patentNumber',
  95. }, {
  96. title: '省份',
  97. dataIndex: 'province',
  98. key: 'province',
  99. }, {
  100. title: '公司名称',
  101. dataIndex: 'companyName',
  102. key: 'companyName',
  103. }, {
  104. title: '专利类型',
  105. dataIndex: 'patentType',
  106. key: 'patentType',
  107. render: text => { return getPatentType(text) },
  108. }, {
  109. title: '专利名称',
  110. dataIndex: 'patentName',
  111. key: 'patentName',
  112. }, {
  113. title: '受理书',
  114. dataIndex: 'acceptance',
  115. key: 'acceptance',
  116. render: text => {
  117. if (text[1]) {
  118. return <div>已发出</div>
  119. } else {
  120. if ( text[0] ) {
  121. return <div>已收到</div>
  122. };
  123. };
  124. return <div>未收到</div>
  125. },
  126. }, {
  127. title: '授权书',
  128. dataIndex: 'authorization',
  129. key: 'authorization',
  130. render: text => {
  131. if (text[1]) {
  132. return <div>已发出</div>
  133. } else {
  134. if ( text[0] ) {
  135. return <div>已收到</div>
  136. };
  137. };
  138. return <div>未收到</div>
  139. },
  140. }, {
  141. title: '证书',
  142. dataIndex: 'certificate',
  143. key: 'certificate',
  144. render: text => {
  145. if (text[1]) {
  146. return <div>已发出</div>
  147. } else {
  148. if ( text[0] ) {
  149. return <div>已收到</div>
  150. };
  151. };
  152. return <div>未收到</div>
  153. },
  154. }
  155. ],
  156. dataSource: []
  157. };
  158. },
  159. componentWillMount() {
  160. this.loadData();
  161. },
  162. tableRowClick(record, index) {
  163. this.state.RowData = record;
  164. this.setState({
  165. showDesc: true
  166. });
  167. },
  168. closeDesc(e, s) {
  169. this.state.showDesc = e;
  170. if (s) {
  171. this.loadData();
  172. };
  173. },
  174. render() {
  175. return (
  176. <div className="patent-content" >
  177. <div className="content-title">
  178. <span>专利纸件收发登记</span>
  179. </div>
  180. <div className="patent-table">
  181. <Spin spinning={this.state.loading}>
  182. <Table columns={this.state.columns}
  183. dataSource={this.state.dataSource}
  184. pagination={this.state.pagination}
  185. onRowClick={this.tableRowClick} />
  186. </Spin>
  187. </div>
  188. <ExpressDesc data={this.state.RowData} showDesc={this.state.showDesc} closeDesc={this.closeDesc} />
  189. </div >
  190. );
  191. }
  192. });
  193. export default Express;