ggooalice 2 år sedan
förälder
incheckning
a5c9859d14
1 ändrade filer med 15 tillägg och 7 borttagningar
  1. 15 7
      fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

+ 15 - 7
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -3453,7 +3453,7 @@
             },
 
             // 获取日期列表
-            getAllDate() {
+            getAllDate(e) {
                 var dayArry = [];
                 var day = this.getCountDays();
                 let curMonthDay = null;
@@ -3488,16 +3488,24 @@
                     let nowmonth = new Date().getMonth() + 1
                     let nowd = new Date().getFullYear() + '-' + (nowmonth < 10 ? '0' + nowmonth : nowmonth)
                     if(nowd == this.date){
-                        let nowday = new Date().getDate()
+                        
+                        if(e && sessionStorage.msg){
+                        }else{
+                            sessionStorage.msg = this.date + '-' + (nowday < 10 ? '0' + nowday : nowday)
+                        }
+                        let nowday = new Date(sessionStorage.msg).getDate()
                         this.choseDay = nowday - 1
-                        sessionStorage.msg = this.date + '-' + (nowday < 10 ? '0' + nowday : nowday)
+                        
                         let monthdate = new Date(sessionStorage.msg)
                         this.curDate = (monthdate.getMonth() + 1) + '月' + monthdate.getDate() + '日'
                         console.log('choseday',sessionStorage.msg,this.choseDay,monthdate.getDate());
                     }else{
-                        this.choseDay = 0;
-                        sessionStorage.msg = this.date + '-01'
-                        let monthdate = new Date(this.date + '-01')
+                        if(e && sessionStorage.msg){
+                        }else{
+                            sessionStorage.msg = this.date + '-01'
+                        }
+                        this.choseDay = day - 1
+                        let monthdate = new Date(sessionStorage.msg)
                         this.curDate = (monthdate.getMonth() + 1) + '月' + monthdate.getDate() + '日'
                     }
                 }else{
@@ -5314,7 +5322,7 @@
             var t = util.formatDate.format(now, 'yyyy-MM-dd');
             var startStr = util.formatDate.format(new Date(), 'yyyy-MM') + "-01";
             this.exportParam.dateRange = [startStr,t];
-            this.getAllDate();
+            this.getAllDate(1);
             this.getReportList();
             this.getProjectList();
             this.getFillProjectList();