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