Browse Source

增加lanjiazai

Lijy 3 năm trước cách đây
mục cha
commit
2eb886d151

+ 53 - 3
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -1312,7 +1312,11 @@
                     total: 0,
                 },
                 toViewloadings: false,
-                tabPositionss: 'top'
+                tabPositionss: 'top',
+                monthTotal: 0,
+                monthTotalPage: 0,
+                monthTotalLages: 20,
+                monthworkDateS1: []
             };
         },
         filters: {
@@ -1858,7 +1862,7 @@
     },
 
     showMonthWorkTime() {
-
+      this.monthTotalPage = 0,
       this.http.post(
         "/report/getUserDailyWorkTime",
         // "/report/getNoReportUserList",
@@ -1871,7 +1875,27 @@
           if (res.code == "ok") {
             this.pickDateArray = res.data.days;
             this.monthworkDate = res.data.list;
-            this.monthworkDateS = this.monthworkDate
+            // this.monthworkDateS = this.monthworkDate
+            this.monthworkDateS1 = res.data.list
+            this.monthTotal = res.data.list.length
+            // console.log('列表的总数据', this.monthworkDateS)
+            var infoList = []
+
+            if (this.monthworkDateS1.length > 20) {
+                this.monthworkDateS1.forEach((val ,i) => {
+                if (i < 20) {
+                    infoList.push(val)
+                }
+                })
+            }
+            this.monthworkDateS = infoList
+            // 判断
+            if (this.monthworkDateS1.length > 0) {
+                setTimeout(() => {
+                    this.tableListener()
+                }, 1000);
+            }
+
             this.$nextTick(function(){
                 this.$refs.hasworkTbl.doLayout();
             });
@@ -1885,7 +1909,33 @@
         }
       );
     },
+    tableListener(){
+      let that = this;
+      // this.$refs.maTable.bodyWarpper 
+      let dom = that.$refs.hasworkTbl.bodyWrapper;
+      console.log(dom)
+      	  // 添加scroll监听事件
+          dom.addEventListener("scroll", function () {
+          // scrollHeight-scrollTop-clientHeight=0 用来判断滚动条到底部
+            const scrollDistance = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
+            if (scrollDistance <= 1) {
+              if (that.monthworkDateS.length < that.monthworkDateS1.length) {
+                that.monthTotalPage++; //当前页数自增
+                console.log(that.monthworkDateS1.length, that.monthworkDateS.length, that.monthTotalPage, that.monthTotalLages, that.monthTotalPage * that.monthTotalLages)
+                var arrList = JSON.parse(JSON.stringify(that.monthworkDateS1))
+                var infoList = arrList.splice(
+                  that.monthTotalPage * that.monthTotalLages,
+                  that.monthTotalLages
+                );
+                console.log(infoList, '将要合并的数据')
+                // 数据添加
+                that.monthworkDateS = that.monthworkDateS.concat(infoList);
+              }
+            }
+          })
+    },
     showMonthNotWorkTime() {
+      this.monthTotalPage = 0,
       console.log("exportMembNotWorkHours",this.WorktimeDatepickValue);
       this.http.post(
         // "/report/getUserDailyWorkTime",

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet_h5/src/views/edit/index.vue

@@ -1,6 +1,6 @@
 <template>
     <div>
-        <van-nav-bar title="填写日报1" left-text="返回" @click-left="back" fixed left-arrow/>
+        <van-nav-bar title="填写日报" left-text="返回" @click-left="back" fixed left-arrow/>
 
         <van-form class="login_form" @submit="submitReport">
             <van-field readonly clickable name="datetimePicker" :value="form.createDate" label="时间选择" placeholder="点击选择时间"