Browse Source

Merge branch 'master' of http://47.100.37.243:10191/wutt/manHourHousekeeper

cs 2 năm trước cách đây
mục cha
commit
58498aa3a1

+ 2 - 2
fhKeeper/formulahousekeeper/timesheet/src/views/team/index.vue

@@ -483,7 +483,7 @@
           <div class="deteee">确定删除该员工吗?</div>
           <div class="deteeeAce" v-if="deleteUserFlgData.isExistsReport">
 
-            <div style="margin-right: 10px">该员工存在工时数据转移 至</div>
+            <div style="margin-right: 10px">将该员工的工时数据、参与的项目与任务转移 至</div>
             <el-select v-if="user.userNameNeedTranslate != 1" v-model="moveReportUserId" style="width:140px;" :placeholder="$t('defaultText.pleaseChoose')" clearable size="small" filterable popper-class="managePopperClass">
                 <el-option v-for="item in users" :key="item.id" :label="item.name + '\u3000' + item.jobNumber" :value="item.id">
                     <span style="float: left">{{ item.name }}</span>
@@ -1861,7 +1861,7 @@ export default {
     },
     // 转移日报
     transferDaily() {
-      this.http.post("/report/moveUserData", {
+      this.http.post("/user/moveUserData", {
           targetId: this.moveReportUserId,
           sourceId: this.deleteUserFlgData.id
         },

+ 84 - 37
fhKeeper/formulahousekeeper/timesheet_h5/src/views/edit/index.vue

@@ -243,7 +243,7 @@
                         <template >
                             <div>
                         <span>用时占比</span>
-                        <van-slider :disabled="!item.canEdit" :min="5" :step="5" style="width:120px;display:inline-block;margin-left:50px;" v-model="item.progress" :value="100" @change="item.workingTime = (reportTimeType.allday*item.progress/100).toFixed(1)" >
+                        <van-slider :disabled="!item.canEdit" :min="5" :step="5" style="width:120px;display:inline-block;margin-left:50px;" v-model="item.progress" :value="100" @change="item.workingTime = (reportTimeType.allday*item.progress/100).toFixed(1), setTotalReportHours()" >
                         <template #button>
                             <div class="custom-button">{{ item.progress }}%</div>
                         </template>
@@ -485,48 +485,50 @@ import timetoolVue from '../timetool/timetool.vue';
                     list: [],
                     searchList: []
                 },
-                vacationTime: {}
+                vacationTime: {},
+                totalReportHours: 0
             };
         },
 
         created() {
 
         },
+        watch: {},
         computed: {
-            totalReportHours(){
-                let domains = this.form.domains
-                let hours = 0
-                for(let i in domains){
-                    if(domains[i].projectId){
-                        // hours += parseFloat(domains[i].workingTime)
-                        if(this.reportTimeType.multiWorktime == 1){
-                            for(let m in domains[i].worktimeList){
-                                if(domains[i].worktimeList[m].startTime && domains[i].worktimeList[m].endTime){
-                                    hours += this.getHour(domains[i].worktimeList[m].startTime, domains[i].worktimeList[m].endTime)
-                                }
-                            }
-                        }else{
-                            if(this.user.timeType.type == 2){
-                                if(domains[i].startTime && domains[i].endTime){
-                                    let selectionTime = this.getHour(domains[i].startTime, domains[i].endTime)
-                                    let subtractedData = 0
-                                    let arr = JSON.parse(JSON.stringify(this.vacationTime))
-                                    arr.unshift({s: domains[i].startTime, e: domains[i].endTime})
-                                    for(var j in arr) {
-                                        subtractedData += +this.timeOverlap(j, arr)
-                                    }
-                                    console.log(selectionTime, subtractedData)
-                                    hours += +selectionTime - +subtractedData
-                                    console.log(hours)
-                                }
-                            } else {
-                                hours += domains[i].workingTime ? parseFloat(domains[i].workingTime) : 0
-                            }
-                        }
-                    }
-                }
-                return hours.toFixed(2)
-            },
+            // totalReportHours(){
+            //     let domains = this.form.domains
+            //     let hours = 0
+            //     for(let i in domains){
+            //         if(domains[i].projectId){
+            //             // hours += parseFloat(domains[i].workingTime)
+            //             if(this.reportTimeType.multiWorktime == 1){
+            //                 for(let m in domains[i].worktimeList){
+            //                     if(domains[i].worktimeList[m].startTime && domains[i].worktimeList[m].endTime){
+            //                         hours += this.getHour(domains[i].worktimeList[m].startTime, domains[i].worktimeList[m].endTime)
+            //                     }
+            //                 }
+            //             }else{
+            //                 if(this.user.timeType.type == 2){
+            //                     if(domains[i].startTime && domains[i].endTime){
+            //                         let selectionTime = this.getHour(domains[i].startTime, domains[i].endTime)
+            //                         let subtractedData = 0
+            //                         let arr = JSON.parse(JSON.stringify(this.vacationTime))
+            //                         arr.unshift({s: domains[i].startTime, e: domains[i].endTime})
+            //                         for(var j in arr) {
+            //                             subtractedData += +this.timeOverlap(j, arr)
+            //                         }
+            //                         console.log(selectionTime, subtractedData)
+            //                         hours += +selectionTime - +subtractedData
+            //                         console.log(hours)
+            //                     }
+            //                 } else {
+            //                     hours += domains[i].workingTime ? parseFloat(domains[i].workingTime) : 0
+            //                 }
+            //             }
+            //         }
+            //     }
+            //     return hours.toFixed(2)
+            // },
         },
 
         methods: {
@@ -979,7 +981,45 @@ import timetoolVue from '../timetool/timetool.vue';
                     item.endTime = this.endTime;
                     this.showEndTime = false;
                 }
+                this.setTotalReportHours()
             },
+
+            setTotalReportHours(){
+                let domains = this.form.domains
+                let hours = 0
+                for(let i in domains){
+                    // if(domains[i].projectId){
+                        // hours += parseFloat(domains[i].workingTime)
+                        if(this.reportTimeType.multiWorktime == 1){
+                            for(let m in domains[i].worktimeList){
+                                if(domains[i].worktimeList[m].startTime && domains[i].worktimeList[m].endTime){
+                                    hours += this.getHour(domains[i].worktimeList[m].startTime, domains[i].worktimeList[m].endTime)
+                                }
+                            }
+                        }else{
+                            if(this.user.timeType.type == 2){
+                                if(domains[i].startTime && domains[i].endTime){
+                                    let selectionTime = this.getHour(domains[i].startTime, domains[i].endTime)
+                                    let subtractedData = 0
+                                    let arr = JSON.parse(JSON.stringify(this.vacationTime))
+                                    arr.unshift({s: domains[i].startTime, e: domains[i].endTime})
+                                    for(var j in arr) {
+                                        subtractedData += +this.timeOverlap(j, arr)
+                                    }
+                                    console.log(selectionTime, subtractedData)
+                                    hours += +selectionTime - +subtractedData
+                                    console.log(hours)
+                                }
+                            } else {
+                                hours += domains[i].workingTime ? parseFloat(domains[i].workingTime) : 0
+                            }
+                        }
+                    // }
+                }
+                // return hours.toFixed(2)
+                this.totalReportHours = hours.toFixed(2)
+            },
+
             filter(type, options) {
                 if (type === 'minute') {
                     return options.filter(option => option % 30 === 0);
@@ -1019,7 +1059,8 @@ import timetoolVue from '../timetool/timetool.vue';
                         this.form.domains[this.clickTimeIndex].overtimeHours = allhour - this.user.timeType.allday
                     }
                 }
-      
+
+                this.setTotalReportHours()
             },
             clickTimePicker(i,item) {
                 if (!item.canEdit) {
@@ -1258,7 +1299,11 @@ import timetoolVue from '../timetool/timetool.vue';
                                 }
                             }
                             this.form.domains = array;
+                            // console.log('执行One')
+                            this.setTotalReportHours()
                         } else {
+                            // console.log('执行TWO')
+                            this.totalReportHours = 0
                             this.canCancel = false;
                             this.canEdit = true;
                             var shuzhi = this.user.timeType.allday + ''
@@ -1294,6 +1339,8 @@ import timetoolVue from '../timetool/timetool.vue';
                                 this.form.domains[0].basecostName = this.report.timeBasecostList[0].name;
                             }
                             this.canEdit = true;
+
+                            this.setTotalReportHours()
                         }
                     } else {
                         this.$toast.clear();