山水共长天一色 3 éve
szülő
commit
9330982327

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

@@ -126,7 +126,7 @@
                     
                     <!-- 选择数字时间长度模式 -->
                     <van-popup v-model="showPickerHours" position="bottom">
-                        <van-picker show-toolbar :columns="timeRange" 
+                        <van-picker show-toolbar :columns="timeRange"
                         :default-index="15"
                         @confirm="choseTimePick" @cancel="showPickerHours = false" />
                     </van-popup>
@@ -713,10 +713,21 @@
                     this.form.domains[this.clickTimeIndex].label = value.label;
                     this.showPickerTime = false;
                 } else if (this.reportTimeType.type == 1) {
-                    console.log('this.reportTimeType.type=='+value);
+                    console.log('this.reportTimeType.type=='+value,this.form.domains);
                     this.form.domains[this.clickTimeIndex].workingTime = value;
                     this.form.domains[this.clickTimeIndex].label = value.toFixed(1)+'小时';
                     this.showPickerHours = false;
+
+                    let allhour = 0
+                    for(let i in this.form.domains){
+                        this.form.domains[i].isOvertime = false
+                        delete this.form.domains[i].overtimeHours
+                        allhour += this.form.domains[i].workingTime
+                    }
+                    if(allhour > this.user.timeType.allday){
+                        this.form.domains[this.clickTimeIndex].isOvertime = true
+                        this.form.domains[this.clickTimeIndex].overtimeHours = allhour - this.user.timeType.allday
+                    }
                 }
       
             },
@@ -1541,6 +1552,9 @@
             if (this.isCorpWX) {
                 this.initWxConfig();
             }
+            if(this.user.timeType.lockWorktime){
+                this.timeRange = this.timeRange.filter(item => {return item <= this.user.timeType.allday})
+            }
 
             // if(localStorage.getItem("formVal")) {
             //     var obj = localStorage.getItem("formVal")

+ 11 - 0
fhKeeper/formulahousekeeper/timesheet_h5/src/views/edit/weekEdit.vue

@@ -803,6 +803,17 @@
                     this.currentForm.domains[this.clickTimeIndex].workingTime = value;
                     this.currentForm.domains[this.clickTimeIndex].label = value.toFixed(1)+'小时';
                     this.showPickerHours = false;
+
+                    let allhour = 0
+                    for(let i in this.currentForm.domains){
+                        this.currentForm.domains[i].isOvertime = false
+                        delete this.currentForm.domains[i].overtimeHours
+                        allhour += this.currentForm.domains[i].workingTime
+                    }
+                    if(allhour > this.user.timeType.allday){
+                        this.currentForm.domains[this.clickTimeIndex].isOvertime = true
+                        this.currentForm.domains[this.clickTimeIndex].overtimeHours = allhour - this.user.timeType.allday
+                    }
                 }
       
             },