express.jsx 7.8 KB

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