comprehensive.jsx 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365
  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. number: thisdata.serialNumber,
  48. patentNumber: thisdata.patentNumber,
  49. unitName: thisdata.unitName,
  50. patentName: thisdata.patentName,
  51. patentType: thisdata.patentCatagory,
  52. patentState: thisdata.patentState,
  53. patentField: thisdata.patentField,
  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. startTime: thisdata.patentApplicationDate,
  61. endTime: thisdata.authorizedDate,
  62. orgCode: thisdata.orgCode,
  63. companyAddress: thisdata.locationProvince + '/' + thisdata.locationCity + '/' + thisdata.locationArea,
  64. companyContacts: thisdata.contacts, //联系人
  65. firstInventorName: thisdata.firstInventorName,
  66. firstInventorNationality: thisdata.firstInventorNationality, //国籍
  67. firstInventorIdNumber: thisdata.firstInventorIdNumber, //id
  68. firstInventorIsPublish: thisdata.firstInventorIsPublish, //是否公布
  69. secondInventorName: thisdata.secondInventorName,
  70. secondInventorNationality: thisdata.secondInventorNationality,
  71. secondInventorIsPublish: thisdata.secondInventorIsPublish,
  72. thirdInventorName: thisdata.thirdInventorName,
  73. thirdInventorNationality: thisdata.thirdInventorNationality,
  74. thirdInventorIsPublish: thisdata.thirdInventorIsPublish,
  75. createTime: thisdata.createTime, //派单日
  76. author: thisdata.author, //撰写人
  77. office: thisdata.office, //事务所
  78. principal: thisdata.principal //负责人
  79. });
  80. };
  81. this.state.pagination.current = data.data.pageNo;
  82. this.state.pagination.total = data.data.totalCount;
  83. this.setState({
  84. dataSource: this.state.data,
  85. pagination: this.state.pagination
  86. });
  87. }.bind(this),
  88. }).always(function () {
  89. this.setState({
  90. loading: false
  91. });
  92. }.bind(this));
  93. },
  94. getAuthorList() {
  95. this.setState({
  96. loading: true
  97. });
  98. $.ajax({
  99. method: "get",
  100. dataType: "json",
  101. crossDomain: false,
  102. url: globalConfig.context + "/techservice/patent/getUnitNames",
  103. success: function (data) {
  104. if (data.error.length || !data.data) {
  105. return;
  106. };
  107. let _me = this;
  108. for (var item in data.data) {
  109. _me.state.authorOption.push(
  110. <Select.Option value={item} key={item}>{data.data[item]}</Select.Option>
  111. )
  112. };
  113. }.bind(this),
  114. }).always(function () {
  115. this.setState({
  116. loading: false
  117. });
  118. }.bind(this));
  119. },
  120. getCompanyList() {
  121. this.setState({
  122. loading: true
  123. });
  124. $.ajax({
  125. method: "get",
  126. dataType: "json",
  127. crossDomain: false,
  128. url: globalConfig.context + "/techservice/patent/getUnitNames",
  129. success: function (data) {
  130. if (data.error.length || !data.data) {
  131. return;
  132. };
  133. let _me = this;
  134. for (var item in data.data) {
  135. _me.state.companyOption.push(
  136. <Select.Option value={item} key={item}>{data.data[item]}</Select.Option>
  137. )
  138. };
  139. }.bind(this),
  140. }).always(function () {
  141. this.setState({
  142. loading: false
  143. });
  144. }.bind(this));
  145. },
  146. getInitialState() {
  147. return {
  148. number: '',
  149. patentNumber: '',
  150. //office: 事务所,
  151. province: '',
  152. unitName: '',
  153. patentType: '',
  154. patentName: '',
  155. patentState: '',
  156. createTime: [],
  157. endTime: [],
  158. startTime: [],
  159. author: '',
  160. warningText: 'warning text! warning text! warning text!',
  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. searchSwitch() {
  285. this.setState({
  286. searchMore: !this.state.searchMore
  287. });
  288. },
  289. searchcreateTime(date, dateString) {
  290. this.state.createTime = dateString;
  291. },
  292. searchstartTime(date, dateString) {
  293. this.state.startTime = dateString;
  294. },
  295. searchSelect(e) {
  296. let _me = this;
  297. this.setState({
  298. searchValue: e.target.value
  299. });
  300. switch (_me.state.searchKey) {
  301. case "patentNumber":
  302. _me.state.patentNumber = e.target.value;
  303. _me.state.number = '';
  304. _me.state.patentName = '';
  305. break;
  306. case "serialNumber":
  307. _me.state.number = e.target.value;
  308. _me.state.patentNumber = '';
  309. _me.state.patentName = '';
  310. break;
  311. case "patentName":
  312. _me.state.patentNumber = '';
  313. _me.state.number = '';
  314. _me.state.patentName = e.target.value;
  315. break;
  316. }
  317. },
  318. render() {
  319. const { MonthPicker, RangePicker } = DatePicker;
  320. return (
  321. <div className="patent-content" >
  322. <div className="content-title">
  323. <span>专利综合管理</span>
  324. <PatentAdd />
  325. </div>
  326. <div className="patent-query">
  327. <Select placeholder="请选择" value={this.state.searchKey} style={{ width: 200 }} onChange={(e) => { this.setState({ searchKey: e, searchValue: '' }); } }>
  328. <Select.Option value="patentNumber">专利号</Select.Option>
  329. <Select.Option value="serialNumber">编号</Select.Option>
  330. <Select.Option value="patentName">专利名称</Select.Option>
  331. </Select>
  332. <Input value={this.state.searchValue} onChange={this.searchSelect} />
  333. <Select placeholder="专利状态" value={this.state.searchState} style={{ width: 200 }} onChange={(e) => { this.setState({ searchState: e }); } }>{this.state.patentStateOption}</Select>
  334. <Button type="primary" onClick={this.search}>搜索</Button>
  335. <Button onClick={this.reset}>重置</Button>
  336. <Button type="ghost">导出</Button>
  337. <span>更多搜索<Switch defaultChecked={false} onChange={this.searchSwitch} /></span>
  338. <div className="search-more" style={this.state.searchMore ? { display: 'none' } : {}}>
  339. <p>
  340. <span>派单日:</span><RangePicker onChange={this.searchcreateTime} />
  341. <span>申请日:</span><RangePicker onChange={this.searchstartTime} />
  342. </p>
  343. <div>
  344. <Select placeholder="选择省份" style={{ width: 200 }} onChange={(e) => { this.state.province = e } }>{this.state.provinceOption}</Select>
  345. <Select placeholder="选择撰写人" style={{ width: 200 }} onChange={(e) => { this.state.author = e } }>{this.state.authorOption}</Select>
  346. <Select placeholder="选择公司" style={{ width: 200 }} onChange={(e) => { this.state.companyName = e } }>{this.state.companyOption}</Select>
  347. </div>
  348. </div>
  349. </div>
  350. <div className="patent-table">
  351. <Spin spinning={this.state.loading}>
  352. <Table columns={this.state.columns}
  353. dataSource={this.state.dataSource}
  354. pagination={this.state.pagination}
  355. onRowClick={this.tableRowClick} />
  356. </Spin>
  357. </div>
  358. <PatentDesc data={this.state.RowData} showDesc={this.state.showDesc} closeDesc={this.closeDesc} />
  359. </div >
  360. );
  361. }
  362. });
  363. export default Patent;