comprehensive.jsx 19 KB

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