applyFee.jsx 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. import React from 'react';
  2. import { Icon, Button, Select, Spin, Table, message, DatePicker } 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 ApplyFeeDesc from './applyFeeDesc.jsx';
  9. const applyFee = 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/getApplicationFeeList",
  20. data: {
  21. pageNo: pageNo || 1,
  22. pageSize: this.state.pagination.pageSize,
  23. locationProvince: this.state.province,
  24. patentApplicationDate: this.state.searchData
  25. },
  26. success: function (data) {
  27. if (data.error.length || !data.data || !data.data.list) {
  28. message.warning(data.error[0].message);
  29. return;
  30. }
  31. for (let i = 0; i < data.data.list.length; i++) {
  32. let thisdata = data.data.list[i];
  33. this.state.data.push({
  34. key: i,
  35. cid: thisdata.cid,
  36. number: thisdata.serialNumber,
  37. province: thisdata.locationProvince,
  38. patentNumber: thisdata.patentNumber,
  39. unitName: thisdata.unitName,
  40. patentName: thisdata.patentName,
  41. patentApplicationDate: thisdata.patentApplicationDate,
  42. endTime: thisdata.patentApplicationDate,
  43. paymentState: thisdata.paymentState,
  44. applicationFee: thisdata.applicationFee,
  45. trialFee: thisdata.trialFee,
  46. printingFee: thisdata.printingFee,
  47. funds: thisdata.funds,
  48. reimbursement: thisdata.reimbursement,
  49. });
  50. };
  51. this.state.pagination.current = data.data.pageNo;
  52. this.state.pagination.total = data.data.totalCount;
  53. this.setState({
  54. dataSource: this.state.data,
  55. pagination: this.state.pagination
  56. });
  57. }.bind(this),
  58. }).always(function () {
  59. this.setState({
  60. loading: false
  61. });
  62. }.bind(this));
  63. },
  64. getInitialState() {
  65. return {
  66. number: '',
  67. patentNumber: '',
  68. //office: 事务所,
  69. province: '',
  70. unitName: '',
  71. patentType: '',
  72. patentName: '',
  73. provinceOption: [],
  74. data: [],
  75. loading: false,
  76. pagination: {
  77. defaultCurrent: 1,
  78. defaultPageSize: 10,
  79. showQuickJumper: true,
  80. pageSize: 10,
  81. onChange: function (page) {
  82. this.loadData(page);
  83. }.bind(this),
  84. showTotal: function (total) {
  85. return '共' + total + '条数据';
  86. }
  87. },
  88. columns: [
  89. {
  90. title: '编号',
  91. dataIndex: 'number',
  92. key: 'number',
  93. }, {
  94. title: '申请号/专利号',
  95. dataIndex: 'patentNumber',
  96. key: 'patentNumber',
  97. }, {
  98. title: '省份',
  99. dataIndex: 'province',
  100. key: 'province',
  101. }, {
  102. title: '公司名称',
  103. dataIndex: 'companyName',
  104. key: 'companyName',
  105. }, {
  106. title: '专利名称',
  107. dataIndex: 'patentName',
  108. key: 'patentName',
  109. }, {
  110. title: '缴费状态',
  111. dataIndex: 'paymentState',
  112. key: 'paymentState',
  113. render: text => {
  114. if (text == '0') {
  115. return '待缴费'
  116. } else if (text == '1') {
  117. return '已缴费'
  118. };
  119. }
  120. }, {
  121. title: '申请费',
  122. dataIndex: 'applicationFee',
  123. key: 'applicationFee',
  124. }, {
  125. title: '实审费',
  126. dataIndex: 'trialFee',
  127. key: 'trialFee',
  128. }, {
  129. title: '文印费',
  130. dataIndex: 'printingFee',
  131. key: 'printingFee',
  132. }, {
  133. title: '是否请款',
  134. dataIndex: 'funds',
  135. key: 'funds',
  136. render: text => {
  137. if (text == '0') {
  138. return '未请款'
  139. } else if (text == '1') {
  140. return '已请款'
  141. };
  142. }
  143. }, {
  144. title: '是否报销',
  145. dataIndex: 'reimbursement',
  146. key: 'reimbursement',
  147. render: text => {
  148. if (text == '0') {
  149. return '未报销'
  150. } else if (text == '1') {
  151. return '已报销'
  152. };
  153. }
  154. }, {
  155. title: '申请日',
  156. dataIndex: 'patentApplicationDate',
  157. key: 'patentApplicationDate',
  158. render: text => { return getTime(text) }
  159. }, {
  160. title: '缴费截止时间',
  161. dataIndex: 'endTime',
  162. key: 'endTime',
  163. render: text => { return getTime(text, 2) }
  164. }
  165. ],
  166. dataSource: []
  167. };
  168. },
  169. componentWillMount() {
  170. let _me = this;
  171. provinceArr.map(function (item) {
  172. _me.state.provinceOption.push(
  173. <Select.Option value={item} key={item}>{item}</Select.Option>
  174. )
  175. });
  176. this.loadData();
  177. },
  178. tableRowClick(record, index) {
  179. this.state.RowData = record;
  180. if (record.annualFeeState !== '1') {
  181. this.setState({
  182. showDesc: true
  183. });
  184. };
  185. },
  186. closeDesc(e) {
  187. this.state.showDesc = e;
  188. this.loadData();
  189. },
  190. searchAuthorizedDate(data, dataString) {
  191. this.state.searchData = dataString;
  192. },
  193. search() {
  194. this.loadData();
  195. },
  196. reset() {
  197. this.state.province = '';
  198. this.state.searchData = '';
  199. this.loadData();
  200. },
  201. exportApply() {
  202. window.open(globalConfig.context + "/techservice/patent/exportApplicationFee?locationProvince="
  203. + this.state.province + "&patentApplicationDate=" + this.state.searchData);
  204. },
  205. render() {
  206. const { MonthPicker, RangePicker } = DatePicker;
  207. return (
  208. <div className="patent-content" >
  209. <div className="content-title">
  210. <span>专利申请费用管理</span>
  211. </div>
  212. <div className="patent-query">
  213. <Select placeholder="选择省份" style={{ width: 200 }} onChange={(e) => { this.state.province = e }}>{this.state.provinceOption}</Select>
  214. <span>申请日:<RangePicker onChange={this.searchAuthorizedDate} /></span>
  215. <span>
  216. <Button type="primary" onClick={this.search}>搜索</Button>
  217. <Button onClick={this.reset}>重置</Button>
  218. <Button type="ghost" onClick={this.exportApply}>导出</Button>
  219. </span>
  220. </div>
  221. <div className="patent-table">
  222. <Spin spinning={this.state.loading}>
  223. <Table columns={this.state.columns}
  224. dataSource={this.state.dataSource}
  225. pagination={this.state.pagination}
  226. onRowClick={this.tableRowClick} />
  227. </Spin>
  228. </div>
  229. <ApplyFeeDesc data={this.state.RowData} showDesc={this.state.showDesc} closeDesc={this.closeDesc} />
  230. </div >
  231. );
  232. }
  233. });
  234. export default applyFee;