payment.jsx 7.3 KB

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