Forráskód Böngészése

获取代填人考情时长

QuYueTing 8 hónapja
szülő
commit
378d18ebd2

+ 3 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ReportController.java

@@ -1611,8 +1611,10 @@ public class ReportController {
                                 report.setAuditDeptid(parentDept.getDepartmentId());
                                 report.setAuditDeptManagerid(parentDept.getManagerId());
                             } else {
-                                //没有上级部门,直接算部门审核通过
+                                //没有上级部门,直接算当前部门审核通过
                                 report.setDepartmentAuditState(1);
+                                report.setAuditDeptManagerid(department.getManagerId());
+                                report.setAuditDeptid(department.getDepartmentId());
                             }
                         } else {
                             report.setAuditDeptid(department.getDepartmentId());

+ 3 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/UserCorpwxTimeController.java

@@ -96,7 +96,9 @@ public class UserCorpwxTimeController {
     @RequestMapping("/getUserCardTime")
     public HttpRespMsg getUserCardTime(String userId, String date) {
         HttpRespMsg msg = new HttpRespMsg();
-
+        User user = userMapper.selectById(userId);
+        UserCorpwxTime userCorpwxTime = userCorpwxTimeMapper.selectOne(new QueryWrapper<UserCorpwxTime>().eq("corpwx_userid", user.getCorpwxUserid()).eq("create_date", date));
+        msg.data = userCorpwxTime;
         return msg;
     }
     @RequestMapping("/getMyDeptMembsData")

+ 62 - 33
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -139,7 +139,7 @@
                                     <el-link v-if="user.timeType.enableNewWeeklyfill == 1" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">{{ $t('textLink.fillInAWeek') }}</el-link>
                                     <!-- <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">按周填报123</el-link> -->
                                     <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;weekIndex++,fillWeekDialogVisiCustomTwo=true" v-if="user.timeType.enableNewWeeklyfill==2">按周填报</el-link>
-                                    <el-link type="primary" v-if="user.companyId != 5978 && permissions.reportsFillOut && user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReport(-1,2)">{{$t('textLink.helpToFillIn')}}</el-link>
+                                    <el-link type="primary" v-if="user.companyId != 5978 && permissions.reportsFillOut && user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReport(-1,0)">{{$t('textLink.helpToFillIn')}}</el-link>
                                     <!-- 苏州景昱,按周填报的模式进行代填日报 -->
                                     <el-link type="primary" v-if="user.companyId == 5978 && permissions.reportsFillOut && user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReportss();">{{$t('textLink.helpToFillIn')}}</el-link>
                                     
@@ -383,8 +383,8 @@
                 <el-form ref="workForm" :model="workForm" :rules="workRules" label-width="120px">
                     <el-form-item :label="$t('screening.selectPeople')" v-if="isSubstitude">
                         <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames"
-                        :placeholder="$t('defaultText.pleaseSelectAsubstitute')" ></el-input>
-                        <div class="daitianrbao"  @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1">
+                        :placeholder="$t('defaultText.pleaseSelectAsubstitute')" style="width:200px;"></el-input>
+                        <div class="daitianrbao"  @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1" style="width:200px;">
                             <span class="spnn" v-if="workForm.userNames">
                                 <span v-for="(item, index) in workForm.userNames" :key="index">
                                     <span><TranslationOpenDataText type='userName' :openid='item'></TranslationOpenDataText></span>
@@ -418,7 +418,7 @@
                         <span v-if="workForm.time.askLeaveTime">|&nbsp;{{ $t('other.AskForLeave') }}{{ workForm.time.askLeaveTime }}{{$t('time.hour')}}</span>
                         <span v-if="workForm.time.otTime" style="color:#FFA500;">|&nbsp;加班{{ workForm.time.otTime }}{{$t('time.hour')}}</span>
                         </span>
-                        <!--批量填报和批量代填不显示考勤记录-->
+                        <!--批量填报不显示考勤记录-->
                         <span v-if="!isBatch && (user.timeType.syncDingding==1 || user.timeType.syncCorpwxTime==1)&&!workForm.time" >{{$t('other.noAttendanceRecord')}}</span>
                         <!--针对明夷,批量填报(不含代填)情况下显示考勤时长-->
                         <span v-if="!isSubstitude && isBatch && user.company.companyName === mingyiName">,{{ $t('workAttendance') }}:{{this.workTimeForMinYi}}{{$t('time.hour')}}</span>
@@ -3836,7 +3836,7 @@
                 }
             },
             seleChn(e,domain) {
-                
+                console.log('===========修改时间==========');
                 if(e == 1) {
                     for(var i in this.workForm.domains) {
                         if(this.workForm.domains[i].timeType == 0) {
@@ -3848,12 +3848,15 @@
                 }
                 var quanbu = 0 
                 var spl = this.workForm.domains
+                console.log(spl)
                 var zhi = ''
                 for(var i in spl) {
                     var sp = +spl[i].workingTime + 0
+                    console.log('this.jsDay==='+this.jsDay);
                     zhi = this.jsDay * sp
                     quanbu = +quanbu + zhi
                 }
+                console.log('quanbu========'+quanbu);
                 this.jsTime = quanbu
                 this.totalReportHours = quanbu
                 let worktime = this.jsTime
@@ -3914,7 +3917,6 @@
                             this.$set(spl[di],'overtimeHours',null)
                         }
                     }
-                    
                 }
             },
             iptChang() {
@@ -3923,30 +3925,9 @@
                 for(var i in sl) {
                     if(sl[i].startTime && sl[i].endTime) {
                         timeArr.push({startTime: sl[i].startTime, endTime: sl[i].endTime})
-                    }
-                    
+                    } 
                 }
-
                 this.getTimeHours(timeArr)
-
-                // for(let j in arrNum) {
-                //     this.timeJsonStr += arrNum[j]
-                //     if(flg) {
-                //         this.$set(this.workForm.domains[j],'isOvertime', true)
-                //         this.$set(this.workForm.domains[j],'overtimeHours', this.timeJsonStr / this.jsDay)
-                //     }
-                //     if(this.timeJsonStr > (this.user.timeType.allday * this.jsDay) && !flg) {
-                //         flg = true
-                //         this.$set(this.workForm.domains[j],'isOvertime', true)
-                //         this.$set(this.workForm.domains[j],'overtimeHours', (this.timeJsonStr - (this.user.timeType.allday * this.jsDay)) / this.jsDay)
-                //         // this.$set(this.workForm.domains[j],'overtimeHours', zhizhang / this.jsDay)
-                //     }
-
-                //     if(this.timeJsonStr < (this.user.timeType.allday * this.jsDay) && !flg) {
-                //         this.$set(this.workForm.domains[j],'isOvertime', false)
-                //         this.$set(this.workForm.domains[j],'overtimeHours', '')
-                //     }
-                // }
             },
             iptChangs() {
                 var sl = this.workForm.domains
@@ -4639,8 +4620,31 @@
                 if (this.workForm.userId.length > 0) {
                     this.getSubUsersFillProjectList(this.workForm.userId[0]);
                 }
+                //打通企业微信考勤的情况,获取考勤
+                if (this.user.timeType.showCorpwxCardtime) {
+                    this.getTargetUserCardTime();
+                }
+            },
+            getTargetUserCardTime() {
+                if (this.workForm.createDate && this.workForm.userId && this.workForm.userId.length > 0) {
+                    this.http.post('/user-corpwx-time/getUserCardTime',{ 
+                        userId: this.workForm.userId[0], date: this.workForm.createDate,
+                    },
+                    res => {
+                        if (res.code == "ok") {
+                            this.$set(this.workForm,'time', res.data);
+                            console.log(res.data);
+                        } 
+                    },
+                    error => {
+                        this.$message({
+                            message: error,
+                            type: "error"
+                        });
+                        }
+                    );
+                }
             },
-
             notifySel(sel){
                 // console.log(sel);
                 this.notifySelList = sel
@@ -6518,6 +6522,7 @@
                 } else {
                     this.falsss = true
                 }
+                console.log('this.isSubstitude=='+this.isSubstitude);
                 if (this.isSubstitude) {
                     this.getSubstitudeUserDeptList();
                 } else {
@@ -6544,7 +6549,6 @@
                     }
                     this.getReport(i);
                 } else {
-                    // console.log('执行到了这里')
                     this.jsTime = 0
                     this.jsDay = 0
                     this.workForm = {
@@ -6567,15 +6571,20 @@
                                     // console.log('执行二次')
                                 this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
                             }
-                            // console.log(this.workForm)
+                            if (this.isSubstitude && this.user.timeType.showCorpwxCardtime) {
+                                this.workForm.showRefresh = true;
+                            }
                     if (this.timeBasecostList&&this.timeBasecostList.length>0) {
                         this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
                     }        
                     this.canEdit = true;
                 }
-                
+                if (this.isSubstitude) {
+                    //代填情况,默认计算合计工时
+                    this.jsDay = 1
+                    this.seleChn();
+                }
                 this.dialogVisible = true;
-                
             },
 
             //按周填报的弹窗口中编辑单项目相关数据
@@ -7962,6 +7971,11 @@
                             }
                         }
                         this.getReport()
+                    } else {
+                        //获取代填人员的考勤
+                        if (this.user.timeType.showCorpwxCardtime == 1) {
+                            this.getTargetUserCardTime();
+                        }
                     }
                 }else {
                     if(this.user.timeType.fillAhead == 0){
@@ -8077,6 +8091,21 @@
                                         type: "error"
                                     });
                                 });
+                            } else if (this.user.companyId == 7) {
+                                //试点,针对赛元微电子校验考勤工时
+                                if (this.workForm.time.workHours) {
+                                    if (this.totalReportHours > this.workForm.time.workHours) {
+                                        this.$message({
+                                            message: '填报工时不得超过考勤时长',
+                                            type: "error"
+                                        });
+                                    } else if (this.totalReportHours < this.workForm.time.workHours) {
+                                        this.$message({
+                                            message: '还剩余'+(this.workForm.time.workHours-this.totalReportHours).toFixed(1)+'h考勤时长尚未分配',
+                                            type: "error"
+                                        });
+                                    }
+                                }
                             } else {
                                 if(this.totalReportHours < this.user.timeType.allday){
                                     this.$confirm(this.$t('dangRiGongShiBuZu') + this.user.timeType.allday.toFixed(1) + this.$t('xiaoShiShiFouQueDingTiJiao'), this.$t('other.prompts'), {