Jelajahi Sumber

2022.6.24 周填报超前限制

ggooalice 2 tahun lalu
induk
melakukan
b60e8d8463

+ 31 - 5
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -607,7 +607,7 @@
                         </template>
                     </el-table-column>
                     <!-- <el-table-column align="center" v-for="(item, index) in projectList" :key="item.id" :label="item.projectName" width="200"> -->
-                    <el-table-column align="center" v-for="item in selProjectList" :key="item.id" :label="item.projectName" width="200">
+                    <el-table-column align="center" v-for="item in selProjectList" :key="item.id" :label="item.projectName" min-width="200">
                         <template slot-scope="scope">
                             <div v-if="reportTimeType.multiWorktime == 0" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
                                 <el-button v-if="scope.row[item.projectName].workingTime != null && scope.row[item.projectName].workingTime != '' && reportTimeType.type == 3 && scope.row[item.projectName].workingTime > 0" type="text" slot="reference">{{scope.row[item.projectName].workingTime}} h</el-button>
@@ -3904,10 +3904,18 @@
                 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()
                 var stat = this.dealdate(monday)
-                var end = this.dealdate(sunday)
+                var end
+                if(this.user.timeType.fillAhead == 1){
+                    const endDay = week == 0 || week == 6 ? 0 : 5 - week
+                    const endDate = new Date(currentDate.getTime() + endDay * millisecond)
+                    end = this.dealdate(endDate)
+                }else{
+                    end = this.dealdate(currentDate)
+                }
+                
                 this.zhoRqi = [stat, end]
+                console.log('date',currentDate,this.zhoRqi);
                 this.zhoRqis()
                 this.jiazai()
             },
@@ -3984,7 +3992,16 @@
                 // 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())
+                let nowdate2
+                if(this.user.timeType.fillAhead == 1){
+                    let week = nowdate.getDay()
+                    const endDay = week > 5 ? 0 : 5 - week
+                    const endDate = new Date(nowdate.getTime() + endDay * millisecond)
+                    nowdate2 = this.dealdate(endDate)
+                }else{
+                    nowdate2 = new Date(nowdate.getFullYear(),nowdate.getMonth(),nowdate.getDate())
+                }
+
                 if(edate >= nowdate2){
                     return
                 }
@@ -4145,7 +4162,16 @@
             },
             zhoRqis() {
                 let nowdate = new Date()
-                let nowdate2 = new Date(nowdate.getFullYear(),nowdate.getMonth(),nowdate.getDate())
+                let nowdate2
+                if(this.user.timeType.fillAhead == 1){
+                    const millisecond = 1000 * 60 * 60 * 24
+                    let week = nowdate.getDay()
+                    const endDay = week == 0 || week == 6 ? 0 : 5 - week
+                    const endDate = new Date(nowdate.getTime() + endDay * millisecond)
+                    nowdate2 = this.dealdate(endDate)
+                }else{
+                    nowdate2 = new Date(nowdate.getFullYear(),nowdate.getMonth(),nowdate.getDate())
+                }
                 let edate = new Date(this.zhoRqi[1])
                 if(edate >= nowdate2){
                     let emon = nowdate2.getMonth() + 1