payment.jsx 7.2 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. $.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, s) {
  153. this.state.showDesc = e;
  154. if (s) {
  155. this.loadData();
  156. };
  157. },
  158. search() {
  159. this.loadData();
  160. },
  161. reset() {
  162. this.state.province = '';
  163. this.loadData();
  164. },
  165. exportPending() {
  166. window.open(globalConfig.context + "/techservice/patent/exportPending?locationProvince=" + this.state.province)
  167. },
  168. render() {
  169. return (
  170. <div className="patent-content" >
  171. <div className="content-title">
  172. <span>代缴年登印费专利管理</span>
  173. </div>
  174. <div className="patent-query">
  175. <Select placeholder="选择省份"
  176. style={{ width: 200 }}
  177. showSearch
  178. filterOption={companySearch}
  179. onChange={(e) => { this.state.province = e }}>
  180. {this.state.provinceOption}
  181. </Select>
  182. <Button type="primary" onClick={this.search}>搜索</Button>
  183. <Button onClick={this.reset}>重置</Button>
  184. <Button type="ghost" onClick={this.exportPending}>导出</Button>
  185. </div>
  186. <div className="patent-table">
  187. <Spin spinning={this.state.loading}>
  188. <Table columns={this.state.columns}
  189. dataSource={this.state.dataSource}
  190. pagination={this.state.pagination}
  191. onRowClick={this.tableRowClick} />
  192. </Spin>
  193. </div>
  194. <PaymentDesc data={this.state.RowData} showDesc={this.state.showDesc} closeDesc={this.closeDesc} />
  195. </div >
  196. );
  197. }
  198. });
  199. export default Payment;