|
@@ -1847,22 +1847,62 @@
|
|
}
|
|
}
|
|
this.jsTime = quanbu
|
|
this.jsTime = quanbu
|
|
let worktime = this.jsTime
|
|
let worktime = this.jsTime
|
|
|
|
+
|
|
|
|
+ // 自动计算加班时长
|
|
if(this.isBatch != 0){
|
|
if(this.isBatch != 0){
|
|
worktime = this.jsTime / this.jsDay
|
|
worktime = this.jsTime / this.jsDay
|
|
}
|
|
}
|
|
if(this.user.timeType.fillOvertime && domain){
|
|
if(this.user.timeType.fillOvertime && domain){
|
|
- for(let di in spl){
|
|
|
|
|
|
+ let isover = false
|
|
|
|
+ let alltime = 0
|
|
|
|
+ let allover = 0 //此处alltime同上面的worktime
|
|
|
|
+ for(let d in spl){
|
|
|
|
+ if(spl[d].isOvertime){
|
|
|
|
+ isover = true
|
|
|
|
+ allover += spl[d].overtimeHours*1
|
|
|
|
+ }
|
|
|
|
+ alltime += spl[d].workingTime*1
|
|
|
|
+ }
|
|
|
|
+ if(domain.overtimeHours){
|
|
|
|
+ allover = allover - domain.overtimeHours
|
|
|
|
+ }
|
|
|
|
+ if(worktime*1 > this.user.timeType.allday){
|
|
|
|
+ if(isover){
|
|
|
|
+ if(alltime > (allover + this.user.timeType.allday)){
|
|
|
|
+ this.$set(domain,'isOvertime',true)
|
|
|
|
+ this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday - allover)
|
|
|
|
+ }else{
|
|
|
|
+ this.$set(domain,'isOvertime',false)
|
|
|
|
+ this.$set(domain,'overtimeHours',null)
|
|
|
|
+ if(alltime < (allover + this.user.timeType.allday)){
|
|
|
|
+ let overtime = allover + this.user.timeType.allday - alltime
|
|
|
|
+ for(let pi in spl){
|
|
|
|
+ if(spl[pi].overtimeHours){
|
|
|
|
+ if((overtime - spl[pi].overtimeHours*1) > 0){
|
|
|
|
+ overtime = overtime - spl[pi].overtimeHours*1
|
|
|
|
+ this.$set(spl[pi],'isOvertime',false)
|
|
|
|
+ this.$set(spl[pi],'overtimeHours',null)
|
|
|
|
+ }else if((overtime - spl[pi].overtimeHours*1) < 0){
|
|
|
|
+ this.$set(spl[pi],'overtimeHours',spl[pi].overtimeHours*1 - overtime)
|
|
|
|
+ break
|
|
|
|
+ }else{
|
|
|
|
+ this.$set(spl[pi],'isOvertime',false)
|
|
|
|
+ this.$set(spl[pi],'overtimeHours',null)
|
|
|
|
+ break
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ this.$set(domain,'isOvertime',true)
|
|
|
|
+ this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday)
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ for(let di in spl){
|
|
this.$set(spl[di],'isOvertime',false)
|
|
this.$set(spl[di],'isOvertime',false)
|
|
this.$set(spl[di],'overtimeHours',null)
|
|
this.$set(spl[di],'overtimeHours',null)
|
|
}
|
|
}
|
|
- if(worktime*1 > this.user.timeType.allday){
|
|
|
|
- this.$set(domain,'isOvertime',true)
|
|
|
|
- this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday)
|
|
|
|
- // domain.overtimeHours = domain.workingTime - this.user.timeType.allday
|
|
|
|
-
|
|
|
|
- }else {
|
|
|
|
- this.$set(domain,'isOvertime',false)
|
|
|
|
- this.$set(domain,'overtimeHours',null)
|
|
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|