Lijy il y a 2 jours
Parent
commit
d583330846

+ 13 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/contract/components/customContract.vue

@@ -332,7 +332,7 @@
 
           <el-form-item label="付款计划">
             <el-table :data="contractPaymentList" size="small" :height="'300px'"
-              show-header="false" style="margin-top:10px;">
+              show-header="false" style="margin-top:10px;" ref="contractPaymentTableRef">
               <el-table-column prop="isPayed" width="120">
                 <template slot-scope="scope">
                   <el-checkbox v-model="scope.row.isPayed">已付款</el-checkbox>
@@ -958,6 +958,18 @@ export default {
       }
 
       this.contractPaymentList.push(val)
+
+      this.$nextTick(() => {
+        this.scrollToBottom('contractPaymentTableRef');
+      });
+    },
+    scrollToBottom(refName) {
+      const tableRef = this.$refs[refName];
+      if (tableRef) {
+        // el-table 内部的滚动容器
+        const bodyWrapper = tableRef.bodyWrapper;
+        bodyWrapper.scrollTop = bodyWrapper.scrollHeight;
+      }
     },
 
     getProjectList() {