payment.jsx 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. import React from 'react';
  2. import { Icon, Button, Select, Spin, Table, message } from 'antd';
  3. import { provinceArr } from '../../../dataDic.js';
  4. import { getTime, getPatentType, getPatentState } from '../../../tools.js';
  5. import ajax from 'jquery/src/ajax/xhr.js';
  6. import $ from 'jquery/src/ajax';
  7. import './comprehensive.less';
  8. import PaymentDesc from './paymentDesc.jsx';
  9. const Payment = React.createClass({
  10. loadData(pageNo) {
  11. this.state.data = [];
  12. this.setState({
  13. loading: true
  14. });
  15. $.ajax({
  16. method: "post",
  17. dataType: "json",
  18. crossDomain: false,
  19. url: globalConfig.context + "/techservice/patent/managePendingPaymentList",
  20. data: {
  21. pageNo: pageNo || 1,
  22. pageSize: this.state.pagination.pageSize,
  23. locationProvince: this.state.province,
  24. },
  25. success: function (data) {
  26. if (data.error.length || !data.data || !data.data.list) {
  27. message.warning(data.error[0].message);
  28. return;
  29. }
  30. for (let i = 0; i < data.data.list.length; i++) {
  31. let thisdata = data.data.list[i];
  32. this.state.data.push({
  33. key: i,
  34. cid: thisdata.cid,
  35. number: thisdata.serialNumber,
  36. province: thisdata.locationProvince,
  37. patentNumber: thisdata.patentNumber,
  38. unitName: thisdata.unitName,
  39. patentName: thisdata.patentName,
  40. patentType: thisdata.patentCatagory,
  41. patentState: thisdata.patentState,
  42. endTime: thisdata.authorizedDate,
  43. annualFeeState: thisdata.annualFeeState
  44. });
  45. };
  46. this.state.pagination.current = data.data.pageNo;
  47. this.state.pagination.total = data.data.totalCount;
  48. this.setState({
  49. dataSource: this.state.data,
  50. pagination: this.state.pagination
  51. });
  52. }.bind(this),
  53. }).always(function () {
  54. this.setState({
  55. loading: false
  56. });
  57. }.bind(this));
  58. },
  59. getInitialState() {
  60. return {
  61. number: '',
  62. patentNumber: '',
  63. //office: 事务所,
  64. province: '',
  65. unitName: '',
  66. patentType: '',
  67. patentName: '',
  68. patentState: '',
  69. provinceOption: [],
  70. data: [],
  71. download: globalConfig.context + '/api/warningreports/download',
  72. loading: false,
  73. pagination: {
  74. defaultCurrent: 1,
  75. defaultPageSize: 10,
  76. showQuickJumper: true,
  77. pageSize: 10,
  78. onChange: function (page) {
  79. this.loadData(page);
  80. }.bind(this),
  81. showTotal: function (total) {
  82. return '共' + total + '条数据';
  83. }
  84. },
  85. columns: [
  86. {
  87. title: '编号',
  88. dataIndex: 'number',
  89. key: 'number',
  90. }, {
  91. title: '申请号/专利号',
  92. dataIndex: 'patentNumber',
  93. key: 'patentNumber',
  94. }, {
  95. title: '省份',
  96. dataIndex: 'province',
  97. key: 'province',
  98. }, {
  99. title: '公司名称',
  100. dataIndex: 'companyName',
  101. key: 'companyName',
  102. }, {
  103. title: '专利类型',
  104. dataIndex: 'patentType',
  105. key: 'patentType',
  106. render: text => { return getPatentType(text) },
  107. }, {
  108. title: '专利名称',
  109. dataIndex: 'patentName',
  110. key: 'patentName',
  111. }, {
  112. title: '专利状态',
  113. dataIndex: 'patentState',
  114. key: 'patentState',
  115. render: text => { return getPatentState(text) },
  116. }, {
  117. title: '缴费状态',
  118. dataIndex: 'annualFeeState',
  119. key: 'annualFeeState',
  120. render: text => {
  121. if (text == '0') {
  122. return '未缴费'
  123. }
  124. },
  125. }, {
  126. title: '缴费截止时间',
  127. dataIndex: 'endTime',
  128. key: 'endTime',
  129. render: text => { return getTime(text, 2) },
  130. }
  131. ],
  132. dataSource: []
  133. };
  134. },
  135. componentWillMount() {
  136. let _me = this;
  137. provinceArr.map(function (item) {
  138. _me.state.provinceOption.push(
  139. <Select.Option value={item} key={item}>{item}</Select.Option>
  140. )
  141. });
  142. this.loadData();
  143. },
  144. tableRowClick(record, index) {
  145. this.state.RowData = record;
  146. if (record.annualFeeState !== '1') {
  147. this.setState({
  148. showDesc: true
  149. });
  150. };
  151. },
  152. closeDesc(e) {
  153. this.state.showDesc = e;
  154. this.loadData();
  155. },
  156. search() {
  157. this.loadData();
  158. },
  159. reset() {
  160. this.state.province = '';
  161. this.loadData();
  162. },
  163. exportPending() {
  164. window.open(globalConfig.context + "/techservice/patent/exportPending?locationProvince=" + this.state.province)
  165. },
  166. render() {
  167. return (
  168. <div className="patent-content" >
  169. <div className="content-title">
  170. <span>代缴年登印费专利管理</span>
  171. </div>
  172. <div className="patent-query">
  173. <Select placeholder="选择省份" style={{ width: 200 }} onChange={(e) => { this.state.province = e } }>{this.state.provinceOption}</Select>
  174. <Button type="primary" onClick={this.search}>搜索</Button>
  175. <Button onClick={this.reset}>重置</Button>
  176. <Button type="ghost" onClick={this.exportPending}>导出</Button>
  177. </div>
  178. <div className="patent-table">
  179. <Spin spinning={this.state.loading}>
  180. <Table columns={this.state.columns}
  181. dataSource={this.state.dataSource}
  182. pagination={this.state.pagination}
  183. onRowClick={this.tableRowClick} />
  184. </Spin>
  185. </div>
  186. <PaymentDesc data={this.state.RowData} showDesc={this.state.showDesc} closeDesc={this.closeDesc} />
  187. </div >
  188. );
  189. }
  190. });
  191. export default Payment;