applyFee.jsx 9.2 KB

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