HighTechApply.jsx 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. import React from 'react';
  2. import { Icon, Button, Input, Select, Spin, Table, DatePicker, message, Cascader } from 'antd';
  3. import { techFieldList, provinceArr } from '../../../dataDic.js';
  4. import { getTime, getPatentState } from '../../../tools.js';
  5. import ajax from 'jquery/src/ajax/xhr.js';
  6. import $ from 'jquery/src/ajax';
  7. import './highTechFoster.less';
  8. const HighTechApply = React.createClass({
  9. loadData(pageNo) {
  10. this.state.data = [];
  11. this.setState({
  12. loading: true
  13. });
  14. $.ajax({
  15. method: "post",
  16. dataType: "json",
  17. crossDomain: false,
  18. url: globalConfig.context + "/techservice/patent/managePatentList",
  19. data: {
  20. pageNo: pageNo || 1,
  21. pageSize: this.state.pagination.pageSize,
  22. locationProvince: this.state.province,
  23. unitName: this.state.unitName,
  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. });
  35. };
  36. this.state.pagination.current = data.data.pageNo;
  37. this.state.pagination.total = data.data.totalCount;
  38. this.setState({
  39. dataSource: this.state.data,
  40. pagination: this.state.pagination
  41. });
  42. }.bind(this),
  43. }).always(function () {
  44. this.setState({
  45. loading: false
  46. });
  47. }.bind(this));
  48. },
  49. getAuthorList() {
  50. this.setState({
  51. loading: true
  52. });
  53. $.ajax({
  54. method: "get",
  55. dataType: "json",
  56. crossDomain: false,
  57. url: globalConfig.context + "/techservice/patent/getAdmin",
  58. success: function (data) {
  59. if (data.error.length || !data.data) {
  60. return;
  61. };
  62. let _me = this;
  63. for (var item in data.data) {
  64. _me.state.authorOption.push(
  65. <Select.Option value={item} key={item}>{data.data[item]}</Select.Option>
  66. )
  67. };
  68. }.bind(this),
  69. }).always(function () {
  70. this.setState({
  71. loading: false
  72. });
  73. }.bind(this));
  74. },
  75. getCompanyList() {
  76. this.setState({
  77. loading: true
  78. });
  79. $.ajax({
  80. method: "get",
  81. dataType: "json",
  82. crossDomain: false,
  83. url: globalConfig.context + "/techservice/patent/getUnitNames",
  84. success: function (data) {
  85. if (data.error.length || !data.data) {
  86. return;
  87. };
  88. let _me = this;
  89. for (var item in data.data) {
  90. _me.state.companyOption.push(
  91. <Select.Option value={item} key={item}>{data.data[item]}</Select.Option>
  92. )
  93. };
  94. }.bind(this),
  95. }).always(function () {
  96. this.setState({
  97. loading: false
  98. });
  99. }.bind(this));
  100. },
  101. getInitialState() {
  102. return {
  103. provinceOption:[],
  104. companyOption:[],
  105. authorOption:[],
  106. province: '',
  107. unitName: '',
  108. data: [],
  109. loading: false,
  110. pagination: {
  111. defaultCurrent: 1,
  112. defaultPageSize: 10,
  113. showQuickJumper: true,
  114. pageSize: 10,
  115. onChange: function (page) {
  116. this.loadData(page);
  117. }.bind(this),
  118. showTotal: function (total) {
  119. return '共' + total + '条数据';
  120. }
  121. },
  122. columns: [
  123. {
  124. title: '编号',
  125. dataIndex: 'number',
  126. key: 'number',
  127. }, {
  128. title: '申请号/专利号',
  129. dataIndex: 'patentNumber',
  130. key: 'patentNumber',
  131. }, {
  132. title: '事务所',
  133. dataIndex: 'office',
  134. key: 'office',
  135. }, {
  136. title: '省份',
  137. dataIndex: 'province',
  138. key: 'province',
  139. }, {
  140. title: '公司名称',
  141. dataIndex: 'unitName',
  142. key: 'unitName',
  143. }, {
  144. title: '专利名称',
  145. dataIndex: 'patentName',
  146. key: 'patentName',
  147. }, {
  148. title: '专利状态',
  149. dataIndex: 'patentState',
  150. key: 'patentState',
  151. render: text => { return getPatentState(text) },
  152. }, {
  153. title: '派单日',
  154. dataIndex: 'createTime',
  155. key: 'createTime',
  156. render: text => { return getTime(text) },
  157. }, {
  158. title: '申请日',
  159. dataIndex: 'startTime',
  160. key: 'startTime',
  161. render: text => { return getTime(text) },
  162. }, {
  163. title: '授权日',
  164. dataIndex: 'endTime',
  165. key: 'endTime',
  166. render: text => { return getTime(text) },
  167. }, {
  168. title: '资料撰写人',
  169. dataIndex: 'author',
  170. key: 'author',
  171. }
  172. ],
  173. dataSource: []
  174. };
  175. },
  176. componentWillMount() {
  177. let _me = this;
  178. provinceArr.map(function (item) {
  179. _me.state.provinceOption.push(
  180. <Select.Option value={item} key={item}>{item}</Select.Option>
  181. )
  182. });
  183. this.loadData();
  184. this.getAuthorList();
  185. this.getCompanyList();
  186. },
  187. tableRowClick(record, index) {
  188. this.state.RowData = record;
  189. this.setState({
  190. showDesc: true
  191. });
  192. },
  193. closeDesc(e) {
  194. this.state.showDesc = e;
  195. this.loadData();
  196. },
  197. search() {
  198. this.loadData();
  199. },
  200. reset() {
  201. this.state.province = undefined;
  202. this.state.unitName = undefined;
  203. this.loadData();
  204. },
  205. render() {
  206. const { MonthPicker, RangePicker } = DatePicker;
  207. return (
  208. <div className="foster-content" >
  209. <div className="content-title">
  210. <span>高企认定申请</span>
  211. </div>
  212. <div className="foster-query">
  213. <Select placeholder="选择省份" style={{ width: 200 }} onChange={(e) => { this.state.province = e }}>{this.state.provinceOption}</Select>
  214. <Select placeholder="选择公司" style={{ width: 200 }} onChange={(e) => { this.state.unitName = e }}>{this.state.companyOption}</Select>
  215. <Button type="primary" onClick={this.search}>搜索</Button>
  216. <Button onClick={this.reset}>重置</Button>
  217. </div>
  218. <div className="foster-table">
  219. <Spin spinning={this.state.loading}>
  220. <Table columns={this.state.columns}
  221. dataSource={this.state.dataSource}
  222. pagination={this.state.pagination}
  223. onRowClick={this.tableRowClick} />
  224. </Spin>
  225. </div>
  226. </div >
  227. );
  228. }
  229. });
  230. export default HighTechApply;