payment.jsx 7.2 KB

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