comprehensive.jsx 16 KB

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