|
@@ -12,9 +12,17 @@ const ActivityDescFrom = Form.create()(React.createClass({
|
|
|
return {
|
|
|
loading: false,
|
|
|
activityNumberOption: [],
|
|
|
- activityNumberObj: []
|
|
|
+ activityNumberObj: [],
|
|
|
+ yearOption: []
|
|
|
};
|
|
|
},
|
|
|
+ getYearOption() {
|
|
|
+ let Option = Select.Option, d = new Date(), thisYear = d.getFullYear(), theArr = [];
|
|
|
+ for (let i = thisYear; i >= 2000; i--) {
|
|
|
+ theArr.push(<Option value={i.toString()} key={i.toString()}>{i}</Option>)
|
|
|
+ };
|
|
|
+ this.state.yearOption = theArr;
|
|
|
+ },
|
|
|
allCostCount() {
|
|
|
this.state.internalAllCost = this.props.form.getFieldValue('internalLaborCost') + this.props.form.getFieldValue('internalDirectCost') +
|
|
|
this.props.form.getFieldValue('internalDepreciationCost') + this.props.form.getFieldValue('internalAmortizationCost') +
|
|
@@ -31,10 +39,23 @@ const ActivityDescFrom = Form.create()(React.createClass({
|
|
|
loading: false
|
|
|
});
|
|
|
},
|
|
|
+ componentWillMount() {
|
|
|
+ this.getYearOption();
|
|
|
+ let _me = this;
|
|
|
+ if (this.props.activityNumberList) {
|
|
|
+ this.props.activityNumberList.map(function (item) {
|
|
|
+ _me.state.activityNumberOption.push(
|
|
|
+ <Select.Option value={item.aid} key={item.uid}>{item.activityNumber}</Select.Option>
|
|
|
+ );
|
|
|
+ _me.state.activityNumberObj[item.aid] = item.activityNumber;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
componentWillReceiveProps(nextProps) {
|
|
|
this.allCostCount();
|
|
|
let _me = this;
|
|
|
if (!this.props.visible && nextProps.visible && nextProps.activityNumberList) {
|
|
|
+ _me.state.activityNumberOption = [];
|
|
|
nextProps.activityNumberList.map(function (item) {
|
|
|
_me.state.activityNumberOption.push(
|
|
|
<Select.Option value={item.aid} key={item.uid}>{item.activityNumber}</Select.Option>
|
|
@@ -120,7 +141,7 @@ const ActivityDescFrom = Form.create()(React.createClass({
|
|
|
<Select
|
|
|
placeholder="请选择年份"
|
|
|
style={{ width: 200 }} >
|
|
|
- {this.props.yearOption}
|
|
|
+ {this.state.yearOption}
|
|
|
</Select>
|
|
|
)}
|
|
|
<p className="activityCost-title">内部研究开发费用(万元)</p>
|
|
@@ -143,7 +164,7 @@ const ActivityDescFrom = Form.create()(React.createClass({
|
|
|
rules: [{ type: "number", required: true, message: '此项为必填项!' }],
|
|
|
initialValue: theData.internalLaborCost
|
|
|
})(
|
|
|
- <InputNumber min={0} max={999999} step={0.01}/>
|
|
|
+ <InputNumber min={0} max={999999} step={0.01} />
|
|
|
)}
|
|
|
</FormItem>
|
|
|
<FormItem className="half-item"
|
|
@@ -154,7 +175,7 @@ const ActivityDescFrom = Form.create()(React.createClass({
|
|
|
rules: [{ type: "number", required: true, message: '此项为必填项!' }],
|
|
|
initialValue: theData.internalDirectCost
|
|
|
})(
|
|
|
- <InputNumber min={0} max={999999} step={0.01}/>
|
|
|
+ <InputNumber min={0} max={999999} step={0.01} />
|
|
|
)}
|
|
|
</FormItem>
|
|
|
<FormItem className="half-item"
|
|
@@ -165,7 +186,7 @@ const ActivityDescFrom = Form.create()(React.createClass({
|
|
|
rules: [{ type: "number", required: true, message: '此项为必填项!' }],
|
|
|
initialValue: theData.internalDepreciationCost
|
|
|
})(
|
|
|
- <InputNumber min={0} max={999999} step={0.01}/>
|
|
|
+ <InputNumber min={0} max={999999} step={0.01} />
|
|
|
)}
|
|
|
</FormItem>
|
|
|
<FormItem className="half-item"
|
|
@@ -176,7 +197,7 @@ const ActivityDescFrom = Form.create()(React.createClass({
|
|
|
rules: [{ type: "number", required: true, message: '此项为必填项!' }],
|
|
|
initialValue: theData.internalAmortizationCost
|
|
|
})(
|
|
|
- <InputNumber min={0} max={999999} step={0.01}/>
|
|
|
+ <InputNumber min={0} max={999999} step={0.01} />
|
|
|
)}
|
|
|
</FormItem>
|
|
|
<FormItem className="half-item"
|
|
@@ -187,7 +208,7 @@ const ActivityDescFrom = Form.create()(React.createClass({
|
|
|
rules: [{ type: "number", required: true, message: '此项为必填项!' }],
|
|
|
initialValue: theData.internalDesignCost
|
|
|
})(
|
|
|
- <InputNumber min={0} max={999999} step={0.01}/>
|
|
|
+ <InputNumber min={0} max={999999} step={0.01} />
|
|
|
)}
|
|
|
</FormItem>
|
|
|
<FormItem className="half-item"
|
|
@@ -198,7 +219,7 @@ const ActivityDescFrom = Form.create()(React.createClass({
|
|
|
rules: [{ type: "number", required: true, message: '此项为必填项!' }],
|
|
|
initialValue: theData.internalEquipmentCost
|
|
|
})(
|
|
|
- <InputNumber min={0} max={999999} step={0.01}/>
|
|
|
+ <InputNumber min={0} max={999999} step={0.01} />
|
|
|
)}
|
|
|
</FormItem>
|
|
|
<FormItem className="half-item"
|
|
@@ -209,7 +230,7 @@ const ActivityDescFrom = Form.create()(React.createClass({
|
|
|
rules: [{ type: "number", required: true, message: '此项为必填项!' }],
|
|
|
initialValue: theData.internalOtherCost
|
|
|
})(
|
|
|
- <InputNumber min={0} max={999999} step={0.01}/>
|
|
|
+ <InputNumber min={0} max={999999} step={0.01} />
|
|
|
)}
|
|
|
</FormItem>
|
|
|
</div>
|
|
@@ -223,7 +244,7 @@ const ActivityDescFrom = Form.create()(React.createClass({
|
|
|
rules: [{ type: "number", required: true, message: '此项为必填项!' }],
|
|
|
initialValue: theData.externalTotalCost
|
|
|
})(
|
|
|
- <InputNumber min={0} max={999999} step={0.01}/>
|
|
|
+ <InputNumber min={0} max={999999} step={0.01} />
|
|
|
)}
|
|
|
</FormItem>
|
|
|
<FormItem className="half-item"
|
|
@@ -342,7 +363,6 @@ const ActivityDesc = React.createClass({
|
|
|
footer=''
|
|
|
>
|
|
|
<ActivityDescFrom data={this.props.data}
|
|
|
- yearOption={this.state.yearOption}
|
|
|
visible={this.state.visible}
|
|
|
activityNumberList={this.props.activityNumberList}
|
|
|
spinState={this.spinChange}
|
|
@@ -452,6 +472,13 @@ const Activity = React.createClass({
|
|
|
});
|
|
|
}.bind(this));
|
|
|
},
|
|
|
+ getYearOption() {
|
|
|
+ let Option = Select.Option, d = new Date(), thisYear = d.getFullYear(), theArr = [];
|
|
|
+ for (let i = thisYear; i >= 2000; i--) {
|
|
|
+ theArr.push(<Option value={i.toString()} key={i.toString()}>{i}</Option>)
|
|
|
+ };
|
|
|
+ this.state.yearOption = theArr;
|
|
|
+ },
|
|
|
getInitialState() {
|
|
|
return {
|
|
|
selectedRowKeys: [],
|
|
@@ -531,13 +558,6 @@ const Activity = React.createClass({
|
|
|
dataSource: []
|
|
|
};
|
|
|
},
|
|
|
- getYearOption() {
|
|
|
- let Option = Select.Option, d = new Date(), thisYear = d.getFullYear(), theArr = [];
|
|
|
- for (let i = thisYear; i >= 1950; i--) {
|
|
|
- theArr.push(<Option value={i.toString()} key={i.toString()}>{i}</Option>)
|
|
|
- };
|
|
|
- this.state.yearOption = theArr;
|
|
|
- },
|
|
|
componentWillMount() {
|
|
|
this.loadData();
|
|
|
this.getYearOption();
|
|
@@ -641,7 +661,6 @@ const Activity = React.createClass({
|
|
|
</div>
|
|
|
<ActivityDesc data={this.state.RowData}
|
|
|
activityNumberList={this.state.activityNumberList}
|
|
|
- yearOption={this.state.yearOption}
|
|
|
showDesc={this.state.showDesc} closeDesc={this.closeDesc} />
|
|
|
</div >
|
|
|
);
|