comprehensive.jsx 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364
  1. import React from 'react';
  2. import { Icon, Button, Input, Select, Spin, Table, Switch, DatePicker, message } from 'antd';
  3. import { patentTypeList, patentStateList, 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 './comprehensive.less';
  8. import PatentAdd from './comPatentAdd.jsx';
  9. import PatentDesc from './comPatentDesc.jsx';
  10. const Patent = React.createClass({
  11. loadData(pageNo) {
  12. this.state.data = [];
  13. this.setState({
  14. loading: true
  15. });
  16. $.ajax({
  17. method: "post",
  18. dataType: "json",
  19. crossDomain: false,
  20. url: globalConfig.context + "/techservice/patent/managePatentList",
  21. data: {
  22. pageNo: pageNo || 1,
  23. pageSize: this.state.pagination.pageSize,
  24. serialNumber: this.state.number,
  25. patentNumber: this.state.patentNumber,
  26. patentName: this.state.patentName,
  27. //office: 事务所,
  28. locationProvince: this.state.province,
  29. unitName: this.state.unitName,
  30. patentCatagory: this.state.patentType,
  31. patentState: this.state.patentState,
  32. createTime: this.state.createTime,
  33. patentApplicationDate: this.state.startTime,
  34. authorizedDate: this.state.endTime,
  35. author: this.state.author
  36. },
  37. success: function (data) {
  38. if (data.error.length || !data.data || !data.data.list) {
  39. message.warning(data.error[0].message);
  40. return;
  41. }
  42. for (let i = 0; i < data.data.list.length; i++) {
  43. let thisdata = data.data.list[i];
  44. this.state.data.push({
  45. key: i,
  46. number: thisdata.serialNumber,
  47. patentNumber: thisdata.patentNumber,
  48. unitName: thisdata.unitName,
  49. patentName: thisdata.patentName,
  50. patentType: thisdata.patentCatagory,
  51. patentState: thisdata.patentState,
  52. patentField: thisdata.patentField,
  53. patentDes: thisdata.patentDes,
  54. patentProryStatementUrl: thisdata.patentProryStatementUrl, //专利代理委托书
  55. patentWritingUrl: thisdata.patentWritingUrl, //专利稿件
  56. authorizationNoticeUrl: thisdata.authorizationNoticeUrl, //授权通知书
  57. patentCertificateUrl: thisdata.patentCertificateUrl, //专利证书
  58. lastYearTaxReportUrl: thisdata.lastYearTaxReportUrl, //上年度纳税表
  59. startTime: thisdata.patentApplicationDate,
  60. endTime: thisdata.authorizedDate,
  61. orgCode: thisdata.orgCode,
  62. companyAddress: thisdata.locationProvince + '/' + thisdata.locationCity + '/' + thisdata.locationArea,
  63. companyContacts: thisdata.contacts, //联系人
  64. firstInventorName: thisdata.firstInventorName,
  65. firstInventorNationality: thisdata.firstInventorNationality, //国籍
  66. firstInventorIdNumber: thisdata.firstInventorIdNumber, //id
  67. firstInventorIsPublish: thisdata.firstInventorIsPublish, //是否公布
  68. secondInventorName: thisdata.secondInventorName,
  69. secondInventorNationality: thisdata.secondInventorNationality,
  70. secondInventorIsPublish: thisdata.secondInventorIsPublish,
  71. thirdInventorName: thisdata.thirdInventorName,
  72. thirdInventorNationality: thisdata.thirdInventorNationality,
  73. thirdInventorIsPublish: thisdata.thirdInventorIsPublish,
  74. createTime: thisdata.createTime, //派单日
  75. author: thisdata.author, //撰写人
  76. office: thisdata.office, //事务所
  77. principal: thisdata.principal //负责人
  78. });
  79. };
  80. this.state.pagination.current = data.data.pageNo;
  81. this.state.pagination.total = data.data.totalCount;
  82. this.setState({
  83. dataSource: this.state.data,
  84. pagination: this.state.pagination
  85. });
  86. }.bind(this),
  87. }).always(function () {
  88. this.setState({
  89. loading: false
  90. });
  91. }.bind(this));
  92. },
  93. getAuthorList() {
  94. this.setState({
  95. loading: true
  96. });
  97. $.ajax({
  98. method: "get",
  99. dataType: "json",
  100. crossDomain: false,
  101. url: globalConfig.context + "/techservice/patent/getUnitNames",
  102. success: function (data) {
  103. if (data.error.length || !data.data) {
  104. return;
  105. };
  106. let _me = this;
  107. for (var item in data.data) {
  108. _me.state.authorOption.push(
  109. <Select.Option value={item} key={item}>{data.data[item]}</Select.Option>
  110. )
  111. };
  112. }.bind(this),
  113. }).always(function () {
  114. this.setState({
  115. loading: false
  116. });
  117. }.bind(this));
  118. },
  119. getCompanyList() {
  120. this.setState({
  121. loading: true
  122. });
  123. $.ajax({
  124. method: "get",
  125. dataType: "json",
  126. crossDomain: false,
  127. url: globalConfig.context + "/techservice/patent/getUnitNames",
  128. success: function (data) {
  129. if (data.error.length || !data.data) {
  130. return;
  131. };
  132. let _me = this;
  133. for (var item in data.data) {
  134. _me.state.companyOption.push(
  135. <Select.Option value={item} key={item}>{data.data[item]}</Select.Option>
  136. )
  137. };
  138. }.bind(this),
  139. }).always(function () {
  140. this.setState({
  141. loading: false
  142. });
  143. }.bind(this));
  144. },
  145. getInitialState() {
  146. return {
  147. number: '',
  148. patentNumber: '',
  149. //office: 事务所,
  150. province: '',
  151. unitName: '',
  152. patentType: '',
  153. patentName: '',
  154. patentState: '',
  155. createTime: [],
  156. endTime: [],
  157. startTime: [],
  158. author: '',
  159. warningText: 'warning text! warning text! warning text!',
  160. AlertDis: 'block',
  161. patentTypeOption: [],
  162. patentStateOption: [],
  163. companyOption: [],
  164. authorOption: [],
  165. provinceOption: [],
  166. searchMore: true,
  167. data: [],
  168. download: globalConfig.context + '/api/warningreports/download',
  169. loading: false,
  170. pagination: {
  171. defaultCurrent: 1,
  172. defaultPageSize: 10,
  173. showQuickJumper: true,
  174. pageSize: 10,
  175. onChange: function (page) {
  176. this.loadData(page);
  177. }.bind(this),
  178. showTotal: function (total) {
  179. return '共' + total + '条数据';
  180. }
  181. },
  182. columns: [
  183. {
  184. title: '编号',
  185. dataIndex: 'number',
  186. key: 'number',
  187. }, {
  188. title: '申请号/专利号',
  189. dataIndex: 'patentNumber',
  190. key: 'patentNumber',
  191. }, {
  192. title: '事务所',
  193. dataIndex: 'office',
  194. key: 'office',
  195. }, {
  196. title: '省份',
  197. dataIndex: 'province',
  198. key: 'province',
  199. }, {
  200. title: '公司名称',
  201. dataIndex: 'companyName',
  202. key: 'companyName',
  203. }, {
  204. title: '专利名称',
  205. dataIndex: 'patentName',
  206. key: 'patentName',
  207. }, {
  208. title: '专利状态',
  209. dataIndex: 'patentState',
  210. key: 'patentState',
  211. render: text => { return getPatentState(text) },
  212. }, {
  213. title: '派单日',
  214. dataIndex: 'createtime',
  215. key: 'createtime',
  216. render: text => { return getTime(text) },
  217. }, {
  218. title: '申请日',
  219. dataIndex: 'startTime',
  220. key: 'startTime',
  221. render: text => { return getTime(text) },
  222. }, {
  223. title: '授权日',
  224. dataIndex: 'endTime',
  225. key: 'endTime',
  226. render: text => { return getTime(text) },
  227. }, {
  228. title: '资料撰写人',
  229. dataIndex: 'author',
  230. key: 'author',
  231. }
  232. ],
  233. dataSource: []
  234. };
  235. },
  236. componentWillMount() {
  237. let _me = this;
  238. patentTypeList.map(function (item) {
  239. _me.state.patentTypeOption.push(
  240. <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
  241. )
  242. });
  243. patentStateList.map(function (item) {
  244. _me.state.patentStateOption.push(
  245. <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
  246. )
  247. });
  248. provinceArr.map(function (item) {
  249. _me.state.provinceOption.push(
  250. <Select.Option value={item} key={item}>{item}</Select.Option>
  251. )
  252. });
  253. this.loadData();
  254. this.getAuthorList();
  255. this.getCompanyList();
  256. },
  257. tableRowClick(record, index) {
  258. this.state.RowData = record;
  259. this.setState({
  260. showDesc: true
  261. });
  262. },
  263. closeDesc(e) {
  264. this.state.showDesc = e;
  265. },
  266. search() {
  267. this.loadData();
  268. },
  269. reset() {
  270. this.state.number = '';
  271. this.state.patentNumber = '';
  272. this.state.province = '';
  273. this.state.unitName = '';
  274. this.state.patentType = '';
  275. this.state.patentName = '';
  276. this.state.patentState = '';
  277. this.state.createTime = [];
  278. this.state.endTime = [];
  279. this.state.startTime = [];
  280. this.state.author = '';
  281. this.loadData();
  282. },
  283. searchSwitch() {
  284. this.setState({
  285. searchMore: !this.state.searchMore
  286. });
  287. },
  288. searchcreateTime(date, dateString) {
  289. this.state.createTime = dateString;
  290. },
  291. searchstartTime(date, dateString) {
  292. this.state.startTime = dateString;
  293. },
  294. searchSelect(e) {
  295. let _me = this;
  296. this.setState({
  297. searchValue: e.target.value
  298. });
  299. switch (_me.state.searchKey) {
  300. case "patentNumber":
  301. _me.state.patentNumber = e.target.value;
  302. _me.state.number = '';
  303. _me.state.patentName = '';
  304. break;
  305. case "serialNumber":
  306. _me.state.number = e.target.value;
  307. _me.state.patentNumber = '';
  308. _me.state.patentName = '';
  309. break;
  310. case "patentName":
  311. _me.state.patentNumber = '';
  312. _me.state.number = '';
  313. _me.state.patentName = e.target.value;
  314. break;
  315. }
  316. },
  317. render() {
  318. const { MonthPicker, RangePicker } = DatePicker;
  319. return (
  320. <div className="patent-content" >
  321. <div className="content-title">
  322. <span>专利综合管理</span>
  323. <PatentAdd />
  324. </div>
  325. <div className="patent-query">
  326. <Select placeholder="请选择" value={this.state.searchKey} style={{ width: 200 }} onChange={(e) => { this.setState({ searchKey: e, searchValue: '' }); } }>
  327. <Select.Option value="patentNumber">专利号</Select.Option>
  328. <Select.Option value="serialNumber">编号</Select.Option>
  329. <Select.Option value="patentName">专利名称</Select.Option>
  330. </Select>
  331. <Input value={this.state.searchValue} onChange={this.searchSelect} />
  332. <Select placeholder="专利状态" value={this.state.searchState} style={{ width: 200 }} onChange={(e) => { this.setState({ searchState: e }); } }>{this.state.patentStateOption}</Select>
  333. <Button type="primary" onClick={this.search}>搜索</Button>
  334. <Button onClick={this.reset}>重置</Button>
  335. <Button type="ghost">导出</Button>
  336. <span>更多搜索<Switch defaultChecked={false} onChange={this.searchSwitch} /></span>
  337. <div className="search-more" style={this.state.searchMore ? { display: 'none' } : {}}>
  338. <p>
  339. <span>派单日:</span><RangePicker onChange={this.searchcreateTime} />
  340. <span>申请日:</span><RangePicker onChange={this.searchstartTime} />
  341. </p>
  342. <div>
  343. <Select placeholder="选择省份" style={{ width: 200 }} onChange={(e) => { this.state.province = e } }>{this.state.provinceOption}</Select>
  344. <Select placeholder="选择撰写人" style={{ width: 200 }} onChange={(e) => { this.state.author = e } }>{this.state.authorOption}</Select>
  345. <Select placeholder="选择公司" style={{ width: 200 }} onChange={(e) => { this.state.companyName = e } }>{this.state.companyOption}</Select>
  346. </div>
  347. </div>
  348. </div>
  349. <div className="patent-table">
  350. <Spin spinning={this.state.loading}>
  351. <Table columns={this.state.columns}
  352. dataSource={this.state.dataSource}
  353. pagination={this.state.pagination}
  354. onRowClick={this.tableRowClick} />
  355. </Spin>
  356. </div>
  357. <PatentDesc data={this.state.RowData} showDesc={this.state.showDesc} closeDesc={this.closeDesc} />
  358. </div >
  359. );
  360. }
  361. });
  362. export default Patent;