jiand пре 5 месеци
родитељ
комит
4ec623fed2

+ 14 - 2
src/views/financingManage/limitExpenditure/components/RevenueExpenditurePlan.vue

@@ -6,6 +6,7 @@
       :columns="columns"
       :data="tableData"
       :count="0"
+      row-key="index"
     />
     <el-form ref="ruleForm" :model="ruleForm" :rules="rules" label-width="150px" label-position="top" class="rule-form-orange">
       <el-form-item label="预期IRR" prop="planIrrStr" style="width: 100%">
@@ -151,7 +152,8 @@ export default {
         if (newV && Object.keys(newV).length) {
           const list = JSON.parse(JSON.stringify(newV.incomeExpenditurePlanList))
           replaceNull(list)
-          this.tableData = list
+          this.tableData = JSON.parse(JSON.stringify(list)) 
+          this.handlerTable()
           this.ruleForm.planIrrStr = newV.planIrrStr
         }
       },
@@ -175,12 +177,22 @@ export default {
           receivingSubject: '',
           currency: ''
         })
+        this.handlerTable()
       } else if (type === 'delete') {
         this.tableData.splice(index, 1)
       }
     },
+    handlerTable() {
+      this.tableData = this.tableData.map((item, index) => {
+        item.index = index
+        return item
+      })
+    },
     getParams() {
-      return this.tableData
+      return this.tableData.map(item => {
+        delete item.index
+        return item
+      })
     }
   }
 }

+ 0 - 1
src/views/financingManage/limitExpenditure/components/TripartiteAgreement.vue

@@ -197,7 +197,6 @@ export default {
       handler(newV) {
         if (newV === undefined) return
         const { reviewBasicContractList } = JSON.parse(JSON.stringify(newV))
-        console.log(reviewBasicContractList, 888)
         this.tableData = reviewBasicContractList
       },
       immediate: true,

+ 6 - 3
src/views/financingManage/limitExpenditure/mainContent.vue

@@ -190,7 +190,7 @@ export default {
         }
         this.expenditurePlanData = {
           incomeExpenditurePlanList: this.ruleForm.incomeExpenditurePlanList || [],
-          planIrrStr: this.ruleForm.planIrrStr
+          planIrrStr: this.ruleForm.planIrrStr  
         }
         this.formKey += 1
       })
@@ -279,10 +279,13 @@ export default {
           this.$router.go(-1)
         })
       } else {
-        await this.automaticGeneration()
+        const data = await this.getParams(type)
+        if(data.incomeExpenditurePlanList && data.incomeExpenditurePlanList.length) {
+          await this.automaticGeneration()
+        }
         this.$refs.ruleForm.validate(async(valid) => {
           if (valid) {
-            const data = await this.getParams(type)
+            
             data.visible = type !== 'temp'
             setTimeout(() => {
               reviewQuotaDisburseSubmit(data).then(() => {