correction.jsx 15 KB

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