comprehensive.jsx 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429
  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. patentTypeOption: [],
  167. patentStateOption: [],
  168. companyOption: [],
  169. authorOption: [],
  170. provinceOption: [],
  171. searchMore: true,
  172. data: [],
  173. loading: false,
  174. pagination: {
  175. defaultCurrent: 1,
  176. defaultPageSize: 10,
  177. showQuickJumper: true,
  178. pageSize: 10,
  179. onChange: function (page) {
  180. this.loadData(page);
  181. }.bind(this),
  182. showTotal: function (total) {
  183. return '共' + total + '条数据';
  184. }
  185. },
  186. columns: [
  187. {
  188. title: '编号',
  189. dataIndex: 'number',
  190. key: 'number',
  191. }, {
  192. title: '申请号/专利号',
  193. dataIndex: 'patentNumber',
  194. key: 'patentNumber',
  195. }, {
  196. title: '事务所',
  197. dataIndex: 'office',
  198. key: 'office',
  199. }, {
  200. title: '省份',
  201. dataIndex: 'province',
  202. key: 'province',
  203. }, {
  204. title: '公司名称',
  205. dataIndex: 'unitName',
  206. key: 'unitName',
  207. }, {
  208. title: '专利名称',
  209. dataIndex: 'patentName',
  210. key: 'patentName',
  211. }, {
  212. title: '专利状态',
  213. dataIndex: 'patentState',
  214. key: 'patentState',
  215. render: text => { return getPatentState(text) },
  216. }, {
  217. title: '派单日',
  218. dataIndex: 'createTime',
  219. key: 'createTime',
  220. render: text => { return getTime(text) },
  221. }, {
  222. title: '申请日',
  223. dataIndex: 'startTime',
  224. key: 'startTime',
  225. render: text => { return getTime(text) },
  226. }, {
  227. title: '授权日',
  228. dataIndex: 'endTime',
  229. key: 'endTime',
  230. render: text => { return getTime(text) },
  231. }, {
  232. title: '资料撰写人',
  233. dataIndex: 'author',
  234. key: 'author',
  235. }
  236. ],
  237. dataSource: []
  238. };
  239. },
  240. componentWillMount() {
  241. let _me = this;
  242. patentTypeList.map(function (item) {
  243. _me.state.patentTypeOption.push(
  244. <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
  245. )
  246. });
  247. patentStateList.map(function (item) {
  248. _me.state.patentStateOption.push(
  249. <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
  250. )
  251. });
  252. provinceArr.map(function (item) {
  253. _me.state.provinceOption.push(
  254. <Select.Option value={item} key={item}>{item}</Select.Option>
  255. )
  256. });
  257. this.loadData();
  258. this.getAuthorList();
  259. this.getCompanyList();
  260. },
  261. tableRowClick(record, index) {
  262. this.state.RowData = record;
  263. this.setState({
  264. showDesc: true
  265. });
  266. },
  267. closeDesc(e, s) {
  268. this.state.showDesc = e;
  269. if (s) {
  270. this.loadData();
  271. };
  272. },
  273. search() {
  274. this.loadData();
  275. },
  276. reset() {
  277. this.state.number = undefined;
  278. this.state.patentNumber = undefined;
  279. this.state.province = undefined;
  280. this.state.unitName = undefined;
  281. this.state.patentType = undefined;
  282. this.state.patentName = undefined;
  283. this.state.patentState = undefined;
  284. this.state.createTime = [];
  285. this.state.endTime = [];
  286. this.state.startTime = [];
  287. this.state.author = undefined;
  288. this.state.searchKey = undefined;
  289. this.state.searchValue = undefined;
  290. this.loadData();
  291. },
  292. exportComposite() {
  293. window.open(globalConfig.context + "/api/admin/patent/exportComposite" +
  294. "?" + "serialNumber" + "=" + this.state.number +
  295. "&" + "patentNumber" + "=" + this.state.patentNumber +
  296. "&" + "patentName" + "=" + this.state.patentName +
  297. "&" + "locationProvince" + "=" + this.state.locationProvince +
  298. "&" + "unitName" + "=" + this.state.unitName +
  299. "&" + "patentCatagory" + "=" + this.state.patentCatagory +
  300. "&" + "patentState" + "=" + this.state.patentState +
  301. "&" + "createTime" + "=" + this.state.createTime +
  302. "&" + "patentApplicationDate" + "=" + this.state.startTime +
  303. "&" + "author" + "=" + this.state.author);
  304. },
  305. searchSwitch() {
  306. this.setState({
  307. searchMore: !this.state.searchMore
  308. });
  309. },
  310. searchcreateTime(date, dateString) {
  311. this.state.createTime = dateString;
  312. },
  313. searchstartTime(date, dateString) {
  314. this.state.startTime = dateString;
  315. },
  316. searchSelect(e) {
  317. let _me = this;
  318. this.setState({
  319. searchValue: e.target.value
  320. });
  321. switch (_me.state.searchKey) {
  322. case "patentNumber":
  323. _me.state.patentNumber = e.target.value;
  324. _me.state.number = '';
  325. _me.state.patentName = '';
  326. break;
  327. case "serialNumber":
  328. _me.state.number = e.target.value;
  329. _me.state.patentNumber = '';
  330. _me.state.patentName = '';
  331. break;
  332. case "patentName":
  333. _me.state.patentNumber = '';
  334. _me.state.number = '';
  335. _me.state.patentName = e.target.value;
  336. break;
  337. }
  338. },
  339. render() {
  340. const { MonthPicker, RangePicker } = DatePicker;
  341. return (
  342. <div className="patent-content" >
  343. <div className="content-title">
  344. <span>专利综合管理</span>
  345. <div className="patent-addNew">
  346. <Upload style={{ float: 'right' }}
  347. name="ratepay"
  348. showUploadList={false}
  349. action={globalConfig.context + "/api/admin/patent/uploadTemplate"}
  350. data={{ 'sign': 'patent_prory_statement' }}
  351. beforeUpload={beforeUploadFile}
  352. onChange={(info) => {
  353. if (info.file.status === 'done') {
  354. if (!info.file.response.error.length) {
  355. if (!info.file.response.error.length) {
  356. message.success(`${info.file.name} 文件上传成功!`);
  357. } else {
  358. message.warning(info.file.response.error[0].message);
  359. return;
  360. };
  361. } else {
  362. message.warning(info.file.response.error[0].message);
  363. };
  364. } else if (info.file.status === 'error') {
  365. message.error(`${info.file.name} 文件上传失败。`);
  366. }
  367. }}
  368. >
  369. <Button>上传专利代理委托书模板 <Icon type="upload" /></Button>
  370. </Upload>
  371. </div>
  372. <PatentAdd closeDesc={this.closeDesc} />
  373. </div>
  374. <div className="patent-query">
  375. <Select placeholder="请选择" value={this.state.searchKey} style={{ width: 200 }} onChange={(e) => { this.setState({ searchKey: e, searchValue: '' }); }}>
  376. <Select.Option value="patentNumber">专利号</Select.Option>
  377. <Select.Option value="serialNumber">编号</Select.Option>
  378. <Select.Option value="patentName">专利名称</Select.Option>
  379. </Select>
  380. <Input value={this.state.searchValue} onChange={this.searchSelect} />
  381. <Select placeholder="专利状态" value={this.state.patentState} style={{ width: 200 }} onChange={(e) => { this.setState({ patentState: e }); }}>{this.state.patentStateOption}</Select>
  382. <Button type="primary" onClick={this.search}>搜索</Button>
  383. <Button onClick={this.reset}>重置</Button>
  384. <Button type="ghost" onClick={this.exportComposite}>导出</Button>
  385. <span>更多搜索<Switch defaultChecked={false} onChange={this.searchSwitch} /></span>
  386. <div className="search-more" style={this.state.searchMore ? { display: 'none' } : {}}>
  387. <p>
  388. <span>派单日:</span><RangePicker onChange={this.searchcreateTime} />
  389. <span>申请日:</span><RangePicker onChange={this.searchstartTime} />
  390. </p>
  391. <div>
  392. <Select placeholder="选择省份"
  393. showSearch
  394. filterOption={companySearch}
  395. style={{ width: 200 }}
  396. onChange={(e) => { this.state.province = e }}>
  397. {this.state.provinceOption}
  398. </Select>
  399. <Select placeholder="选择撰写人" style={{ width: 200 }} onChange={(e) => { this.state.author = e }}>{this.state.authorOption}</Select>
  400. <Select placeholder="选择公司"
  401. style={{ width: 200 }}
  402. showSearch
  403. filterOption={companySearch}
  404. onChange={(e) => { this.state.companyName = e }}>
  405. {this.state.companyOption}
  406. </Select>
  407. </div>
  408. </div>
  409. </div>
  410. <div className="patent-table">
  411. <Spin spinning={this.state.loading}>
  412. <Table columns={this.state.columns}
  413. dataSource={this.state.dataSource}
  414. pagination={this.state.pagination}
  415. onRowClick={this.tableRowClick} />
  416. </Spin>
  417. </div>
  418. <PatentDesc data={this.state.RowData} showDesc={this.state.showDesc} closeDesc={this.closeDesc} />
  419. </div >
  420. );
  421. }
  422. });
  423. export default Patent;