comprehensive.jsx 16 KB

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