express.jsx 7.6 KB

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