yee 7 years ago
parent
commit
35f51cd2fa

+ 38 - 19
js/component/account/services/activityCostList.jsx

@@ -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 >
         );

+ 4 - 0
js/component/manageCenter/achievement/techAchievementDesc.jsx

@@ -852,6 +852,10 @@ const AchievementDetailForm = Form.create()(React.createClass({
             if (nextProps.data && nextProps.data.id) {
                 this.loadData(nextProps.data.id, nextProps.detailApiUrl);
             };
+            this.state.data = {};
+            this.state.tags = [];
+            this.state.technicalPictureUrl = [];
+            this.state.maturityPictureUrl = [];
             this.state.textFileList = [];
             this.state.techPlanFileList = [];
             this.state.businessPlanFileList = [];

+ 4 - 0
js/component/manageCenter/demand/techDemandDesc.jsx

@@ -721,6 +721,10 @@ const DemandDetailForm = Form.create()(React.createClass({
             if (nextProps.data && nextProps.data.id) {
                 this.loadData(nextProps.data.id, nextProps.detailApiUrl);
             };
+            this.state.contactsOption = [];
+            this.state.data = {};
+            this.state.tags = [];
+            this.state.pictureUrl = [];
             this.state.textFileList = [];
             this.state.videoFileList = [];
             this.state.textFileUrl = undefined;