comprehensive.jsx 16 KB

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