applyFee.jsx 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. import React from 'react';
  2. import { Icon, Button, Select, Spin, Table, message, DatePicker, 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 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 ? this.state.province[0] : undefined,
  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. data: [],
  69. loading: false,
  70. pagination: {
  71. defaultCurrent: 1,
  72. defaultPageSize: 10,
  73. showQuickJumper: true,
  74. pageSize: 10,
  75. onChange: function (page) {
  76. this.loadData(page);
  77. }.bind(this),
  78. showTotal: function (total) {
  79. return '共' + total + '条数据';
  80. }
  81. },
  82. columns: [
  83. {
  84. title: '编号',
  85. dataIndex: 'number',
  86. key: 'number',
  87. }, {
  88. title: '申请号/专利号',
  89. dataIndex: 'patentNumber',
  90. key: 'patentNumber',
  91. }, {
  92. title: '省份',
  93. dataIndex: 'province',
  94. key: 'province',
  95. render: text => { return getProvince(text) }
  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. this.loadData();
  166. },
  167. tableRowClick(record, index) {
  168. this.state.RowData = record;
  169. if (record.annualFeeState !== '1') {
  170. this.setState({
  171. showDesc: true
  172. });
  173. };
  174. },
  175. closeDesc(e, s) {
  176. this.state.showDesc = e;
  177. if (s) {
  178. this.loadData();
  179. };
  180. },
  181. search() {
  182. this.loadData();
  183. },
  184. reset() {
  185. this.state.province = undefined;
  186. this.state.searchData = [];
  187. this.loadData();
  188. },
  189. exportApply() {
  190. window.open(globalConfig.context + "/api/admin/patent/exportApplicationFee?locationProvince="
  191. + (this.state.province ? this.state.province[0] : null) + "&patentApplicationDate=" + this.state.searchData);
  192. },
  193. render() {
  194. const { MonthPicker, RangePicker } = DatePicker;
  195. return (
  196. <div className="patent-content" >
  197. <div className="content-title">
  198. <span>专利申请费用管理</span>
  199. </div>
  200. <div className="patent-query">
  201. <Cascader placeholder="选择省份"
  202. style={{ width: 100, marginTop: "-4px", marginLeft: 0 }}
  203. value={this.state.province}
  204. options={provinceSelect()}
  205. showSearch
  206. filterOption={companySearch}
  207. onChange={(e) => { this.setState({ province: e }) }} />
  208. <span>申请日:
  209. <RangePicker style={{ width: '240px' }}
  210. allowClear={false}
  211. value={[this.state.searchData[0] ? moment(this.state.searchData[0]) : null, this.state.searchData[1] ? moment(this.state.searchData[1]) : null]}
  212. onChange={(date, dateString) => { this.setState({ searchData: dateString }) }} />
  213. </span>
  214. <span>
  215. <Button type="primary" onClick={this.search}>搜索</Button>
  216. <Button onClick={this.reset}>重置</Button>
  217. <Button type="ghost" onClick={this.exportApply}>导出</Button>
  218. </span>
  219. </div>
  220. <div className="patent-table">
  221. <Spin spinning={this.state.loading}>
  222. <Table size="middle" columns={this.state.columns}
  223. dataSource={this.state.dataSource}
  224. style={{
  225. cursor: 'pointer',
  226. }}
  227. pagination={this.state.pagination}
  228. onRowClick={this.tableRowClick} />
  229. </Spin>
  230. </div>
  231. <ApplyFeeDesc data={this.state.RowData} showDesc={this.state.showDesc} closeDesc={this.closeDesc} />
  232. </div >
  233. );
  234. }
  235. });
  236. export default applyFee;