copyright.jsx 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. import React from 'react';
  2. import { Icon, Button, Input, Select, Spin, Table, DatePicker, message, Cascader } from 'antd';
  3. import { techFieldList, 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 PatentAdd from './comPatentAdd.jsx';
  8. import PatentChange from './comPatentChange.jsx';
  9. //import PatentDesc from '../patent/comPatentDesc.jsx';
  10. import './copyright.less';
  11. const copyright = 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. locationProvince: this.state.province,
  26. unitName: this.state.unitName,
  27. },
  28. success: function (data) {
  29. if (data.error.length || !data.data || !data.data.list) {
  30. message.warning(data.error[0].message);
  31. return;
  32. }
  33. this.state.pagination.defaultCurrent = data.data.pageNo;
  34. this.state.pagination.total = data.data.totalCount;
  35. this.setState({
  36. dataSource: data.data.list,
  37. pagination: this.state.pagination
  38. });
  39. }.bind(this),
  40. }).always(function () {
  41. this.setState({
  42. loading: false
  43. });
  44. }.bind(this));
  45. },
  46. getAuthorList() {
  47. this.setState({
  48. loading: true
  49. });
  50. $.ajax({
  51. method: "get",
  52. dataType: "json",
  53. crossDomain: false,
  54. url: globalConfig.context + "/techservice/patent/getAdmin",
  55. success: function (data) {
  56. if (data.error.length || !data.data) {
  57. return;
  58. };
  59. let _me = this;
  60. for (var item in data.data) {
  61. _me.state.authorOption.push(
  62. <Select.Option value={item} key={item}>{data.data[item]}</Select.Option>
  63. )
  64. };
  65. }.bind(this),
  66. }).always(function () {
  67. this.setState({
  68. loading: false
  69. });
  70. }.bind(this));
  71. },
  72. getCompanyList() {
  73. this.setState({
  74. loading: true
  75. });
  76. $.ajax({
  77. method: "get",
  78. dataType: "json",
  79. crossDomain: false,
  80. url: globalConfig.context + "/techservice/patent/getUnitNames",
  81. success: function (data) {
  82. if (data.error.length || !data.data) {
  83. return;
  84. };
  85. let _me = this;
  86. for (var item in data.data) {
  87. _me.state.companyOption.push(
  88. <Select.Option value={item} key={item}>{data.data[item]}</Select.Option>
  89. )
  90. };
  91. }.bind(this),
  92. }).always(function () {
  93. this.setState({
  94. loading: false
  95. });
  96. }.bind(this));
  97. },
  98. getInitialState() {
  99. return {
  100. visible:false,
  101. provinceOption:[],
  102. companyOption:[],
  103. authorOption:[],
  104. province: '',
  105. unitName: '',
  106. data: [],
  107. loading: false,
  108. pagination: {
  109. defaultCurrent: 1,
  110. defaultPageSize: 10,
  111. showQuickJumper: true,
  112. pageSize: 10,
  113. onChange: function (page) {
  114. this.loadData(page);
  115. }.bind(this),
  116. showTotal: function (total) {
  117. return '共' + total + '条数据';
  118. }
  119. },
  120. columns: [
  121. {
  122. title: '编号',
  123. dataIndex: 'number',
  124. key: 'number',
  125. }, {
  126. title: '省份',
  127. dataIndex: 'province',
  128. key: 'province',
  129. }, {
  130. title: '公司名称',
  131. dataIndex: 'unitName',
  132. key: 'unitName',
  133. }, {
  134. title: '联系方式',
  135. dataIndex: 'contacts',
  136. key: 'contacts',
  137. }, {
  138. title: '派单信息',
  139. dataIndex: 'createInfo',
  140. key: 'createInfo',
  141. }, {
  142. title: '软著名称',
  143. dataIndex: 'copyrightName',
  144. key: 'copyrightName',
  145. }, {
  146. title: '加急',
  147. dataIndex: 'urgent',
  148. key: 'urgent',
  149. }, {
  150. title: '咨询师',
  151. dataIndex: 'consultant',
  152. key: 'consultant',
  153. }, {
  154. title: '派单日',
  155. dataIndex: 'createTime',
  156. key: 'createTime',
  157. }, {
  158. title: '受理日',
  159. dataIndex: 'acceptanceTime',
  160. key: 'acceptanceTime',
  161. }, {
  162. title: '(预计)下证时间',
  163. dataIndex: 'endTime',
  164. key: 'endTime',
  165. }, {
  166. title: '备注',
  167. dataIndex: 'explain',
  168. key: 'explain',
  169. }
  170. ],
  171. dataSource: []
  172. };
  173. },
  174. componentWillMount() {
  175. let _me = this;
  176. provinceArr.map(function (item) {
  177. _me.state.provinceOption.push(
  178. <Select.Option value={item} key={item}>{item}</Select.Option>
  179. )
  180. });
  181. //console.log(this.state.pagination.total);
  182. this.loadData();
  183. this.getAuthorList();
  184. this.getCompanyList();
  185. },
  186. tableRowClick(record, index) {
  187. this.state.RowData = record;
  188. this.setState({
  189. showDesc: true
  190. });
  191. },
  192. closeDesc(e) {
  193. this.state.showDesc = e;
  194. this.loadData();
  195. },
  196. search() {
  197. this.loadData();
  198. },
  199. reset() {
  200. this.state.province = undefined;
  201. this.state.unitName = undefined;
  202. this.loadData();
  203. },
  204. showChangePatent() {
  205. require.ensure([], () => {
  206. const changePatent = require('./changePatent').default;
  207. this.setState({
  208. visible: true
  209. });
  210. });
  211. },
  212. render() {
  213. return (
  214. <div className="foster-box">
  215. <div className="foster-content">
  216. <div className="content-title">
  217. <span>软著申请管理</span>
  218. <PatentAdd closeDesc={this.closeDesc}/>
  219. <PatentChange closeDesc={this.closeDesc}/>
  220. </div>
  221. <div className="foster-query">
  222. <Select placeholder="选择省份" style={{ width: 200 }} onChange={(e) => { this.state.province = e }}>{this.state.provinceOption}</Select>
  223. <Select placeholder="选择公司" style={{ width: 200 }} onChange={(e) => { this.state.unitName = e }}>{this.state.companyOption}</Select>
  224. <Button type="primary" onClick={this.search}>搜索</Button>
  225. <Button onClick={this.reset}>重置</Button>
  226. </div>
  227. <div className="foster-table">
  228. <Spin spinning={this.state.loading}>
  229. <Table columns={this.state.columns}
  230. dataSource={this.state.dataSource}
  231. pagination={this.state.pagination}
  232. onRowClick={this.tableRowClick} />
  233. </Spin>
  234. </div>
  235. <PatentChange data={this.state.RowData} showDesc={this.state.showDesc} closeDesc={this.closeDesc} />
  236. </div >
  237. </div>
  238. );
  239. }
  240. });
  241. export default copyright;