payment.jsx 7.3 KB

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