|
@@ -9,6 +9,55 @@ import ajax from 'jquery/src/ajax/xhr.js';
|
|
|
import $ from 'jquery/src/ajax';
|
|
|
|
|
|
|
|
|
+if (!Array.prototype.includes) {
|
|
|
+ Object.defineProperty(Array.prototype, 'includes', {
|
|
|
+ value: function (searchElement, fromIndex) {
|
|
|
+
|
|
|
+ // 1. Let O be ? ToObject(this value).
|
|
|
+ if (this == null) {
|
|
|
+ throw new TypeError('"this" is null or not defined');
|
|
|
+ }
|
|
|
+
|
|
|
+ var o = Object(this);
|
|
|
+
|
|
|
+ // 2. Let len be ? ToLength(? Get(O, "length")).
|
|
|
+ var len = o.length >>> 0;
|
|
|
+
|
|
|
+ // 3. If len is 0, return false.
|
|
|
+ if (len === 0) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 4. Let n be ? ToInteger(fromIndex).
|
|
|
+ // (If fromIndex is undefined, this step produces the value 0.)
|
|
|
+ var n = fromIndex | 0;
|
|
|
+
|
|
|
+ // 5. If n ≥ 0, then
|
|
|
+ // a. Let k be n.
|
|
|
+ // 6. Else n < 0,
|
|
|
+ // a. Let k be len + n.
|
|
|
+ // b. If k < 0, let k be 0.
|
|
|
+ var k = Math.max(n >= 0 ? n : len - Math.abs(n), 0);
|
|
|
+
|
|
|
+ // 7. Repeat, while k < len
|
|
|
+ while (k < len) {
|
|
|
+ // a. Let elementK be the result of ? Get(O, ! ToString(k)).
|
|
|
+ // b. If SameValueZero(searchElement, elementK) is true, return true.
|
|
|
+ // c. Increase k by 1.
|
|
|
+ // NOTE: === provides the correct "SameValueZero" comparison needed here.
|
|
|
+ if (o[k] === searchElement) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ k++;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 8. Return false
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
const ActivityForm = Form.create()(React.createClass({
|
|
|
getInitialState() {
|
|
|
return {
|
|
@@ -97,7 +146,7 @@ const ActivityForm = Form.create()(React.createClass({
|
|
|
if (!this.props.visible && nextProps.visible) {
|
|
|
this.state.mockData = nextProps.data.mockData;
|
|
|
this.props.form.resetFields();
|
|
|
- this.state.proofUrl = null;
|
|
|
+ this.state.proofUrl = undefined;
|
|
|
this.state.fileList = [];
|
|
|
if (nextProps.data.id) {
|
|
|
this.loadData(nextProps.data.id);
|
|
@@ -229,7 +278,7 @@ const ActivityForm = Form.create()(React.createClass({
|
|
|
selectedKeys={this.state.selectedKeys}
|
|
|
onChange={this.intellectualChange}
|
|
|
onSelectChange={this.intellectualSelectChange}
|
|
|
- render={item => `${item.name}-${item.key}`}
|
|
|
+ render={item => `${item.name}-${item.number}`}
|
|
|
/>
|
|
|
</div>
|
|
|
<FormItem className="half-div"
|
|
@@ -392,7 +441,6 @@ const ActivityDesc = React.createClass({
|
|
|
},
|
|
|
});
|
|
|
|
|
|
-
|
|
|
const Activity = React.createClass({
|
|
|
loadData(pageNo) {
|
|
|
this.state.data = [];
|
|
@@ -422,74 +470,77 @@ const Activity = React.createClass({
|
|
|
})).done((data1, data2) => {
|
|
|
let data = data1[0];
|
|
|
let intellectualList = data2[0];
|
|
|
+ let theArr = [], theObj = {};
|
|
|
if (data.error.length || !data.data || !data.data.list) {
|
|
|
message.warning(data.error[0].message);
|
|
|
- return;
|
|
|
+ } else {
|
|
|
+ for (let i = 0; i < data.data.list.length; i++) {
|
|
|
+ let thisdata = data.data.list[i];
|
|
|
+ this.state.data.push({
|
|
|
+ key: i,
|
|
|
+ id: thisdata.id,
|
|
|
+ uid: thisdata.uid,
|
|
|
+ activityNumber: thisdata.activityNumber,
|
|
|
+ activityName: thisdata.activityName,
|
|
|
+ startDate: thisdata.startDate,
|
|
|
+ endDate: thisdata.endDate,
|
|
|
+
|
|
|
+ mockData: this.state.mockData,
|
|
|
+
|
|
|
+ techField: [thisdata.technicalField1, thisdata.technicalField2, thisdata.technicalField3],
|
|
|
+ technicalField: getTechField(thisdata.technicalField1, thisdata.technicalField2, thisdata.technicalField3),
|
|
|
+ technicalField1: thisdata.technicalField1,
|
|
|
+ technicalField2: thisdata.technicalField2,
|
|
|
+ technicalField3: thisdata.technicalField3,
|
|
|
+ technicalSource: thisdata.technicalSource ? String(thisdata.technicalSource) : undefined,
|
|
|
+ intellectualPropertyNumber: thisdata.intellectualPropertyNumber ? thisdata.intellectualPropertyNumber.split(",") : [],
|
|
|
+ intellectualPropertyNumberText: thisdata.intellectualPropertyNumber,
|
|
|
+ budget: thisdata.budget,
|
|
|
+ firstYearExpenditure: thisdata.firstYearExpenditure,
|
|
|
+ secondYearExpenditure: thisdata.secondYearExpenditure,
|
|
|
+ thirdYearExpenditure: thisdata.thirdYearExpenditure,
|
|
|
+ implement: thisdata.implement,
|
|
|
+ technologyInnovation: thisdata.technologyInnovation,
|
|
|
+ achievement: thisdata.achievement,
|
|
|
+ internalLaborCost: thisdata.internalLaborCost,
|
|
|
+ internalDirectCost: thisdata.internalDirectCost,
|
|
|
+ internalDepreciationCost: thisdata.internalDepreciationCost,
|
|
|
+ internalAmortizationCost: thisdata.internalAmortizationCost,
|
|
|
+ internalDesignCost: thisdata.internalDesignCost,
|
|
|
+ internalEquipmentCost: thisdata.internalEquipmentCost,
|
|
|
+ internalOtherCost: thisdata.internalOtherCost,
|
|
|
+ externalTotalCost: thisdata.externalTotalCost,
|
|
|
+ externalAbroadCost: thisdata.externalAbroadCost,
|
|
|
+ enterpriseFiller: thisdata.enterpriseFiller,
|
|
|
+ signDate: thisdata.signDate,
|
|
|
+ sortNumber: thisdata.sortNumber,
|
|
|
+ startDateFormattedDate: thisdata.startDateFormattedDate,
|
|
|
+ endDateFormattedDate: thisdata.endDateFormattedDate,
|
|
|
+ projectMode: thisdata.projectMode,
|
|
|
+ proofUrl: thisdata.proofUrl,
|
|
|
+ proofDownloadFileName: thisdata.proofDownloadFileName
|
|
|
+ });
|
|
|
+ };
|
|
|
+ this.state.pagination.current = data.data.pageNo;
|
|
|
+ this.state.pagination.total = data.data.totalCount;
|
|
|
};
|
|
|
if (intellectualList.error.length || !intellectualList.data || !intellectualList.data.list) {
|
|
|
message.warning(intellectualList.error[0].message);
|
|
|
- return;
|
|
|
- };
|
|
|
- let theArr = [];
|
|
|
- for (let i = 0; i < intellectualList.data.list.length; i++) {
|
|
|
- theArr.push({
|
|
|
- key: intellectualList.data.list[i].intellectualPropertyNumber,
|
|
|
- name: intellectualList.data.list[i].intellectualPropertyName
|
|
|
- });
|
|
|
- };
|
|
|
- this.state.mockData = theArr;
|
|
|
- for (let i = 0; i < data.data.list.length; i++) {
|
|
|
- let thisdata = data.data.list[i];
|
|
|
- this.state.data.push({
|
|
|
- key: i,
|
|
|
- id: thisdata.id,
|
|
|
- uid: thisdata.uid,
|
|
|
- activityNumber: thisdata.activityNumber,
|
|
|
- activityName: thisdata.activityName,
|
|
|
- startDate: thisdata.startDate,
|
|
|
- endDate: thisdata.endDate,
|
|
|
-
|
|
|
- mockData: this.state.mockData,
|
|
|
-
|
|
|
- techField: [thisdata.technicalField1, thisdata.technicalField2, thisdata.technicalField3],
|
|
|
- technicalField: getTechField(thisdata.technicalField1, thisdata.technicalField2, thisdata.technicalField3),
|
|
|
- technicalField1: thisdata.technicalField1,
|
|
|
- technicalField2: thisdata.technicalField2,
|
|
|
- technicalField3: thisdata.technicalField3,
|
|
|
- technicalSource: String(thisdata.technicalSource),
|
|
|
- intellectualPropertyNumber: thisdata.intellectualPropertyNumber ? thisdata.intellectualPropertyNumber.split(",") : [],
|
|
|
- intellectualPropertyNumberText: thisdata.intellectualPropertyNumber,
|
|
|
- budget: thisdata.budget,
|
|
|
- firstYearExpenditure: thisdata.firstYearExpenditure,
|
|
|
- secondYearExpenditure: thisdata.secondYearExpenditure,
|
|
|
- thirdYearExpenditure: thisdata.thirdYearExpenditure,
|
|
|
- implement: thisdata.implement,
|
|
|
- technologyInnovation: thisdata.technologyInnovation,
|
|
|
- achievement: thisdata.achievement,
|
|
|
- internalLaborCost: thisdata.internalLaborCost,
|
|
|
- internalDirectCost: thisdata.internalDirectCost,
|
|
|
- internalDepreciationCost: thisdata.internalDepreciationCost,
|
|
|
- internalAmortizationCost: thisdata.internalAmortizationCost,
|
|
|
- internalDesignCost: thisdata.internalDesignCost,
|
|
|
- internalEquipmentCost: thisdata.internalEquipmentCost,
|
|
|
- internalOtherCost: thisdata.internalOtherCost,
|
|
|
- externalTotalCost: thisdata.externalTotalCost,
|
|
|
- externalAbroadCost: thisdata.externalAbroadCost,
|
|
|
- enterpriseFiller: thisdata.enterpriseFiller,
|
|
|
- signDate: thisdata.signDate,
|
|
|
- sortNumber: thisdata.sortNumber,
|
|
|
- startDateFormattedDate: thisdata.startDateFormattedDate,
|
|
|
- endDateFormattedDate: thisdata.endDateFormattedDate,
|
|
|
- projectMode: thisdata.projectMode,
|
|
|
- proofUrl: thisdata.proofUrl,
|
|
|
- proofDownloadFileName: thisdata.proofDownloadFileName
|
|
|
- });
|
|
|
+ } else {
|
|
|
+ for (let i = 0; i < intellectualList.data.list.length; i++) {
|
|
|
+ theArr.push({
|
|
|
+ key: intellectualList.data.list[i].id,
|
|
|
+ number: intellectualList.data.list[i].intellectualPropertyNumber,
|
|
|
+ name: intellectualList.data.list[i].intellectualPropertyName
|
|
|
+ });
|
|
|
+ theObj[intellectualList.data.list[i].id] = intellectualList.data.list[i].intellectualPropertyNumber;
|
|
|
+ };
|
|
|
};
|
|
|
- this.state.pagination.current = data.data.pageNo;
|
|
|
- this.state.pagination.total = data.data.totalCount;
|
|
|
this.setState({
|
|
|
dataSource: this.state.data,
|
|
|
- pagination: this.state.pagination
|
|
|
+ pagination: this.state.pagination,
|
|
|
+ mockData: theArr,
|
|
|
+ mockDataObj: theObj
|
|
|
});
|
|
|
}).always(function () {
|
|
|
this.setState({
|
|
@@ -500,6 +551,7 @@ const Activity = React.createClass({
|
|
|
getInitialState() {
|
|
|
return {
|
|
|
mockData: [],
|
|
|
+ mockDataObj: {},
|
|
|
selectedRowKeys: [],
|
|
|
selectedRows: [],
|
|
|
loading: false,
|
|
@@ -536,7 +588,16 @@ const Activity = React.createClass({
|
|
|
}, {
|
|
|
title: '知识产权编号',
|
|
|
dataIndex: 'intellectualPropertyNumberText',
|
|
|
- key: 'intellectualPropertyNumberText'
|
|
|
+ key: 'intellectualPropertyNumberText',
|
|
|
+ render: (text) => {
|
|
|
+ let arr = [], _me = this;
|
|
|
+ if (text && text.split(',').length) {
|
|
|
+ text.split(',').map((item) => {
|
|
|
+ arr.push(_me.state.mockDataObj[item]);
|
|
|
+ });
|
|
|
+ };
|
|
|
+ return arr.join(',');
|
|
|
+ }
|
|
|
}, {
|
|
|
title: '开始时间',
|
|
|
dataIndex: 'startDateFormattedDate',
|