|
@@ -1,9 +1,10 @@
|
|
|
import React from 'react';
|
|
|
-import { Icon, Button, Input, Select, Spin, Table, DatePicker, message, Cascader } from 'antd';
|
|
|
+import { Icon, Button, Input, Select, Spin, Table, message, Cascader } from 'antd';
|
|
|
import { provinceArr } from '../../../dataDic.js';
|
|
|
-import { getTime, getPatentState, companySearch } from '../../../tools.js';
|
|
|
+import { getTime, getCognizanceState, companySearch } from '../../../tools.js';
|
|
|
import ajax from 'jquery/src/ajax/xhr.js';
|
|
|
import $ from 'jquery/src/ajax';
|
|
|
+import moment from 'moment';
|
|
|
import './highTechFoster.less';
|
|
|
import FosterDesc from './fosterDesc/content.jsx';
|
|
|
|
|
@@ -17,12 +18,12 @@ const Patent = React.createClass({
|
|
|
method: "post",
|
|
|
dataType: "json",
|
|
|
crossDomain: false,
|
|
|
- url: globalConfig.context + "/api/admin/listCognizance",
|
|
|
+ url: globalConfig.context + "/api/admin/cultivate",
|
|
|
data: {
|
|
|
pageNo: pageNo || 1,
|
|
|
pageSize: this.state.pagination.pageSize,
|
|
|
locationProvince: this.state.province,
|
|
|
- unitName: this.state.unitName,
|
|
|
+ uid: this.state.unitName,
|
|
|
},
|
|
|
success: function (data) {
|
|
|
if (data.error.length || !data.data || !data.data.list) {
|
|
@@ -33,25 +34,24 @@ const Patent = React.createClass({
|
|
|
let thisdata = data.data.list[i];
|
|
|
this.state.data.push({
|
|
|
key: i,
|
|
|
- uid: thisdata.uid,
|
|
|
- cid: thisdata.cid,
|
|
|
- serialNumber: thisdata.serialNumber,
|
|
|
- locationProvince: thisdata.locationProvince,
|
|
|
- unitName: thisdata.unitName,
|
|
|
- contacts: [thisdata.contacts, {
|
|
|
+ certificateNumber: thisdata.certificateNumber,
|
|
|
+ contacts: [thisdata.cogContacts, {
|
|
|
'1': thisdata.firstContacts,
|
|
|
'2': thisdata.secondContacts,
|
|
|
'3': thisdata.thirdContacts
|
|
|
}],
|
|
|
- createTime: thisdata.createTime,
|
|
|
- comment: thisdata.comment,
|
|
|
- state: thisdata.state,
|
|
|
- certificateNumber: thisdata.certificateNumber,
|
|
|
- issuingDate: thisdata.issuingDate,
|
|
|
+ cogContacts: thisdata.cogContacts,
|
|
|
consultant: thisdata.consultant,
|
|
|
- createTimeFormattedDate: thisdata.createTimeFormattedDate,
|
|
|
+ firstContacts: thisdata.firstContacts,
|
|
|
+ issuingDate: thisdata.issuingDate,
|
|
|
issuingDateFormattedDate: thisdata.issuingDateFormattedDate,
|
|
|
- endtime: getTime(thisdata.issuingDateFormattedDate, 36)
|
|
|
+ endtime: thisdata.issuingDateFormattedDate ? getTime(thisdata.issuingDateFormattedDate, 36) : null,
|
|
|
+ province: thisdata.province,
|
|
|
+ secondContacts: thisdata.secondContacts,
|
|
|
+ thirdContacts: thisdata.thirdContacts,
|
|
|
+ uid: thisdata.uid,
|
|
|
+ unitName: thisdata.unitName,
|
|
|
+ state: thisdata.issuingDateFormattedDate ? getTime(thisdata.issuingDateFormattedDate, 36) : null,
|
|
|
});
|
|
|
};
|
|
|
this.state.pagination.current = data.data.pageNo;
|
|
@@ -67,32 +67,6 @@ const Patent = React.createClass({
|
|
|
});
|
|
|
}.bind(this));
|
|
|
},
|
|
|
- getAuthorList() {
|
|
|
- this.setState({
|
|
|
- loading: true
|
|
|
- });
|
|
|
- $.ajax({
|
|
|
- method: "get",
|
|
|
- dataType: "json",
|
|
|
- crossDomain: false,
|
|
|
- url: globalConfig.context + "/api/user/patent/getAdmin",
|
|
|
- success: function (data) {
|
|
|
- if (data.error.length || !data.data) {
|
|
|
- return;
|
|
|
- };
|
|
|
- let _me = this;
|
|
|
- for (var item in data.data) {
|
|
|
- _me.state.authorOption.push(
|
|
|
- <Select.Option value={item} key={item}>{data.data[item]}</Select.Option>
|
|
|
- )
|
|
|
- };
|
|
|
- }.bind(this),
|
|
|
- }).always(function () {
|
|
|
- this.setState({
|
|
|
- loading: false
|
|
|
- });
|
|
|
- }.bind(this));
|
|
|
- },
|
|
|
getCompanyList() {
|
|
|
this.setState({
|
|
|
loading: true
|
|
@@ -101,9 +75,12 @@ const Patent = React.createClass({
|
|
|
method: "get",
|
|
|
dataType: "json",
|
|
|
crossDomain: false,
|
|
|
- url: globalConfig.context + "/api/user/patent/getUnitNames",
|
|
|
+ url: globalConfig.context + "/api/admin/getUnitNames",
|
|
|
success: function (data) {
|
|
|
- if (data.error.length || !data.data) {
|
|
|
+ if (!data.data) {
|
|
|
+ if (data.error && data.error.length) {
|
|
|
+ message.warning(data.error[0].message);
|
|
|
+ };
|
|
|
return;
|
|
|
};
|
|
|
let _me = this;
|
|
@@ -123,7 +100,6 @@ const Patent = React.createClass({
|
|
|
return {
|
|
|
provinceOption: [],
|
|
|
companyOption: [],
|
|
|
- authorOption: [],
|
|
|
fosterDescDisplay: 'none',
|
|
|
fosterDisplay: 'block',
|
|
|
data: [],
|
|
@@ -143,8 +119,8 @@ const Patent = React.createClass({
|
|
|
columns: [
|
|
|
{
|
|
|
title: '省份',
|
|
|
- dataIndex: 'locationProvince',
|
|
|
- key: 'locationProvince',
|
|
|
+ dataIndex: 'province',
|
|
|
+ key: 'province',
|
|
|
}, {
|
|
|
title: '公司名称',
|
|
|
dataIndex: 'unitName',
|
|
@@ -164,7 +140,18 @@ const Patent = React.createClass({
|
|
|
title: '状态',
|
|
|
dataIndex: 'state',
|
|
|
key: 'state',
|
|
|
- render: text => { return getPatentState(text) }
|
|
|
+ render: text => {
|
|
|
+ if (text) {
|
|
|
+ let n = moment(new Date()).format("YYYY-MM-DD");
|
|
|
+ if (text > n) {
|
|
|
+ return '已下证';
|
|
|
+ } else {
|
|
|
+ return '已到期';
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ return '培育中';
|
|
|
+ }
|
|
|
+ }
|
|
|
}, {
|
|
|
title: '证书编号',
|
|
|
dataIndex: 'certificateNumber',
|
|
@@ -194,7 +181,6 @@ const Patent = React.createClass({
|
|
|
)
|
|
|
});
|
|
|
this.loadData();
|
|
|
- this.getAuthorList();
|
|
|
this.getCompanyList();
|
|
|
},
|
|
|
tableRowClick(record, index) {
|