scorpio 2 years ago
parent
commit
d6b110d414
1 changed files with 5 additions and 4 deletions
  1. 5 4
      src/views/home/component/params/params3.vue

+ 5 - 4
src/views/home/component/params/params3.vue

@@ -276,16 +276,17 @@ export default {
     update (show = Boolean) {
       this.$nextTick(() => {
         this.form.projectId = this.form.id
-        if (this.form.month_plan_complete_amount.length > 0) {
+        if (this.form.month_plan_complete_amount[this.current.index] !== undefined && this.form.month_plan_complete_amount.length > 0) {
           this.form.month_plan_complete_amount[this.current.index].sum = this.getSum(this.form.month_plan_complete_amount[this.current.index].monthlyData)
         }
-        if (this.form.month_complete_amount.length > 0) {
+        if (this.form.month_complete_amount[this.current.index] !== undefined && this.form.month_complete_amount.length > 0) {
           this.form.month_complete_amount[this.current.index].sum = this.getSum(this.form.month_complete_amount[this.current.index].monthlyData)
         }
-        if (this.form.month_plan_investment.length > 0) {
+        console.log(this.form.month_plan_investment)
+        if (this.form.month_plan_investment[this.current.index] !== undefined && this.form.month_plan_investment.length > 0) {
           this.form.month_plan_investment[this.current.index].sum = this.getSum(this.form.month_plan_investment[this.current.index].monthlyData)
         }
-        if (this.form.month_investment_amount.length > 0) {
+        if (this.form.month_investment_amount[this.current.index] !== undefined && this.form.month_investment_amount.length > 0) {
           this.form.month_investment_amount[this.current.index].sum = this.getSum(this.form.month_investment_amount[this.current.index].monthlyData)
         }
         // 生成年月字段