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