소스 검색

2022.5.31

山水共长天一色 3 년 전
부모
커밋
ee73501967
1개의 변경된 파일18개의 추가작업 그리고 1개의 파일을 삭제
  1. 18 1
      fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

+ 18 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -3795,7 +3795,7 @@
                 const millisecond = 1000 * 60 * 60 * 24
                 const minusDay = week != 0 ? week - 1 : 4
                 const monday = new Date(currentDate.getTime() - minusDay * millisecond)
-                const sunday = new Date(monday.getTime() + 4 * millisecond)
+                const sunday = new Date()
                 var stat = this.dealdate(monday)
                 var end = this.dealdate(sunday)
                 this.zhoRqi = [stat, end]
@@ -3873,7 +3873,15 @@
             // 新增日期
             newDates() {
                 // console.log(this.zhoRqi, '看卡')
+                let edate = new Date(this.zhoRqi[1])
+                let nowdate = new Date()
+                let nowdate2 = new Date(nowdate.getFullYear(),nowdate.getMonth(),nowdate.getDate())
+                if(edate >= nowdate2){
+                    return
+                }
                 this.zhoRqi[1] = this.dateChange(1, this.zhoRqi[1])
+                
+                console.log(this.zhoRqi[1]);
                 // console.log(this.zhoRqi[1])
                 var obj = {}
                 obj.zhoDataTime = this.zhoRqi[1]
@@ -4027,6 +4035,15 @@
                 }
             },
             zhoRqis() {
+                let nowdate = new Date()
+                let nowdate2 = new Date(nowdate.getFullYear(),nowdate.getMonth(),nowdate.getDate())
+                let edate = new Date(this.zhoRqi[1])
+                if(edate >= nowdate2){
+                    let emon = nowdate2.getMonth() + 1
+                    let eday = nowdate2.getDate()
+                    let edate2 = nowdate2.getFullYear() + '-' + (emon < 10 ? '0' + emon : emon) + '-' + (eday < 10 ? '0' + eday : eday)
+                    this.zhoRqi[1] = edate2
+                }
                 this.zhoData = []
                 if(this.zhoRqi) { 
                     var stime = this.zhoRqi[0]