Sfoglia il codice sorgente

针对景昱的工时考勤验证

seyason 1 anno fa
parent
commit
71cf2d8293

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

@@ -1787,7 +1787,10 @@ public class ReportController {
                     }
                 }
             }else {
-                warningMsg.append("未查询到考勤信息");
+                if(warningMsg.length()>0){
+                    warningMsg.append(",");
+                }
+                warningMsg.append(df.format(date)+"未查询到考勤信息");
             }
         }
         String warningMsgStr = warningMsg.toString();

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet/src/i18n/zh.json

@@ -184,7 +184,7 @@
     "exportingTimeStatistics": "导出工时统计"
   },
   "other": {
-    "kaoqingTimeTip": "工作时长不包含未审批加班及休假",
+    "kaoqingTimeTip": "工作时长包含已提交的加班申请",
     "customerService": "咨询客服",
     "sweepWeChatYards": "微信扫码",
     "messageCenter": "消息中心",

+ 120 - 16
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -1022,7 +1022,9 @@
                 <!-- <el-button @click="zhoAddlast()" style="float:left;" class="el-icon-back">{{$t('defaultText.selectProject')}}</el-button> -->
                 <el-button @click="closeAddWeeklyReport()" :loading="submitingReport">{{$t('btn.cancel')}}</el-button>
                 <el-button @click="submitWeekReport(1)" :loading="submitingReport" >{{$t('btn.temporaryStorage')}}</el-button>
-                <el-button type="primary" @click="submitWeekReport(0)" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
+                <el-button v-if="user.companyId != 5978" type="primary" @click="submitWeekReport(0)" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
+                <!--针对景昱,先检查工时是否存在异常-->
+                <el-button v-if="user.companyId == 5978" type="primary" @click="checkDateWorkTime()" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
             </span>
         </el-dialog>
         <!-- 重庆物奇私人定制的按周填报 -->
@@ -6823,6 +6825,43 @@
                 this.selProjectList = []
                 this.selCon = []
             },
+            checkDateWorkTime() {
+                //针对苏州景昱,单独的检查逻辑
+                if (this.user.companyId == 5978) {
+                    //调接口,先检查工时是否存在异常
+                    var zhi = this.zhoData;
+                    var array = [];
+                    for(let n in zhi){
+                        if(zhi[n].he){
+                            var workData = {date: zhi[n].zhoDataTime, workingTime: zhi[n].he};
+                            array.push(workData)
+                        }
+                    }
+                    this.submitingReport = true;
+                    this.http.post('/report/checkBeiSengCardTime', {userId:this.user.id, dateWorkingTime:JSON.stringify(array)},
+                    res => {
+                        this.submitingReport = false;
+                        if (res.code == "ok") {
+                            this.submitWeekReport(0)
+                        } else {
+                            this.$confirm(res.msg, '提示', {
+                                confirmButtonText: '忽略并提交',
+                                cancelButtonText: '取消',
+                                type: 'error'
+                            }).then(() => {
+                                this.submitWeekReport(0)
+                            }).catch(() => {
+                            });
+                        }
+                    },
+                    error => {
+                        this.$message({
+                            message: error,
+                            type: "error"
+                        });
+                    });
+                }
+            },
             // 提交按周填报
             submitWeekReport(isDraft) {
                 var zhi = this.zhoData
@@ -6899,7 +6938,7 @@
                         }
                         
                     }
-                    if(overcorp != ''){
+                    if(this.user.companyId != 5978 && overcorp != ''){
                         overcorp = overcorp.substring(0,overcorp.length - 1)
                         this.$message({
                             message: this.$t('weekDay.date')+'[' + overcorp + ']'+this.$t('message.cannotexceedtotal'),
@@ -7479,18 +7518,83 @@
                 this.isDraft = isDraft;
                 this.$refs.workForm.validate(valid => {
                     if (valid) {
-                if(this.totalReportHours < this.user.timeType.allday){
-                    this.$confirm('当日工时不足' + this.user.timeType.allday.toFixed(1) + '小时,是否确定提交?', '提示', {
-                        confirmButtonText: '确定',
-                        cancelButtonText: '取消',
-                        type: 'warning'
-                    }).then(() => {
-                        this.submitReportSon()
-                    }).catch(() => {
-                    });
-                }else{
-                    this.submitReportSon()
-                }
+                        if (!isDraft) {
+                            //针对苏州景昱,单独的检查逻辑
+                            if (this.user.companyId == 5978) {
+                                //调接口,先检查工时是否存在异常
+                                var totalTime = 0;
+                                for (var t=0;t<this.workForm.domains.length; t++) {
+                                    totalTime += parseFloat(this.workForm.domains[t].workingTime);
+                                }
+                                var array = [];
+                                if (this.isBatch) {
+                                    var startDate = new Date(this.workForm.createDate[0]);
+                                    var endDate = new Date(this.workForm.createDate[1]);
+                                    if (startDate > endDate) {
+                                        this.$message({
+                                            message: '开始日期不能大于结束日期',
+                                            type: "error"
+                                        });
+                                        return
+                                    } else {
+                                        while(true){
+                                            var workData = {date: util.formatDate.format(startDate, "yyyy-MM-dd"), workingTime: totalTime};
+                                            array.push(workData);
+                                            startDate.setDate(startDate.getDate() + 1);
+                                            if (startDate > endDate) {
+                                                break;
+                                            }
+                                        }
+                                    }
+                                } else {
+                                    var workData = {date: this.workForm.createDate, workingTime: totalTime};
+                                    array.push(workData)
+                                }
+                                this.submitingReport = true;
+                                var passUserId = this.user.id;
+                                if (this.isSubstitude) {
+                                    passUserId = this.targetUids;
+                                }
+                                this.http.post('/report/checkBeiSengCardTime', {userId:passUserId, dateWorkingTime:JSON.stringify(array)},
+                                res => {
+                                    this.submitingReport = false;
+                                    if (res.code == "ok") {
+                                        this.submitReportSon()
+                                    } else {
+                                        this.$confirm(res.msg, '提示', {
+                                            confirmButtonText: '忽略并提交',
+                                            cancelButtonText: '取消',
+                                            type: 'error'
+                                        }).then(() => {
+                                            this.submitReportSon()
+                                        }).catch(() => {
+                                        });
+                                    }
+                                },
+                                error => {
+                                    this.$message({
+                                        message: error,
+                                        type: "error"
+                                    });
+                                });
+                            } else {
+                                if(this.totalReportHours < this.user.timeType.allday){
+                                    this.$confirm('当日工时不足' + this.user.timeType.allday.toFixed(1) + '小时,是否确定提交?', '提示', {
+                                        confirmButtonText: '确定',
+                                        cancelButtonText: '取消',
+                                        type: 'warning'
+                                    }).then(() => {
+                                        this.submitReportSon()
+                                    }).catch(() => {
+                                    });
+                                }else{
+                                    this.submitReportSon()
+                                }
+                            }
+                        } else {
+                            //暂存,不需要检查工时是否超过考勤
+                            this.submitReportSon()
+                        }
                     }
                 });
             },
@@ -7690,8 +7794,8 @@
                                 }
                             }
                         }
-                        //针对凡己,不校验考勤时长
-                        if (this.user.companyId != 3918 && this.reportTimeType.type == 1 && this.workForm.time) {
+                        //针对凡己和景昱此处不校验考勤时长
+                        if (this.user.companyId != 3918 && this.user.companyId != 5978  && this.reportTimeType.type == 1 && this.workForm.time) {
                             if (this.workForm.time.workHours && totalTime > parseFloat(this.workForm.time.workHours)) {
                                 this.$message({
                                         message: this.$t('message.Fillinthesumofworkinghours')+(totalTime)+"h"+this.$t('message.Cannotexceedthetotalworkinghoursofattendance')+"("+this.workForm.time.workHours.toFixed(1)+"h)",

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

@@ -2086,16 +2086,43 @@ export default {
                         //暂存操作
                         this.submitReportSon()
                     } else {
-                        //提交时,做工时时长不足的提醒
-                        if (this.totalReportHours < this.user.timeType.allday) {
-                            this.$dialog.confirm({
-                                title: '提示',
-                                message: '当日工时不足' + this.user.timeType.allday.toFixed(1) + '小时,是否确定提交?'
-                            }).then(() => {
-                                this.submitReportSon()
-                            }).catch(() => { })
+                        if (this.user.companyId == 5978) {
+                            //调接口,先检查工时是否存在异常
+                            var totalTime = 0;
+                            for (var t=0;t<this.form.domains.length; t++) {
+                                totalTime += parseFloat(this.form.domains[t].workingTime);
+                            }
+                            var array = [];
+                            var workData = {date: this.form.createDate, workingTime: totalTime};
+                            array.push(workData)
+                            this.flgLg = false
+                            var passUserId = this.user.id;
+                            this.$axios.post("/report/checkBeiSengCardTime", { userId:passUserId, dateWorkingTime:JSON.stringify(array)})
+                            .then(res => {
+                                this.flgLg = true
+                                if (res.code == "ok") {
+                                    this.submitReportSon()
+                                } else {
+                                    this.$dialog.confirm({
+                                        title: '提示',
+                                        message: res.msg + ',是否忽略并提交?'
+                                    }).then(() => {
+                                        this.submitReportSon()
+                                    }).catch(() => { })
+                                }
+                            }).catch(err => { this.$toast.clear(); });
                         } else {
-                            this.submitReportSon()
+                            //提交时,做工时时长不足的提醒
+                            if (this.totalReportHours < this.user.timeType.allday) {
+                                this.$dialog.confirm({
+                                    title: '提示',
+                                    message: '当日工时不足' + this.user.timeType.allday.toFixed(1) + '小时,是否确定提交?'
+                                }).then(() => {
+                                    this.submitReportSon()
+                                }).catch(() => { })
+                            } else {
+                                this.submitReportSon()
+                            }
                         }
                     }
                 }).catch((err) => {
@@ -2231,7 +2258,7 @@ export default {
                 }
             }
             //针对凡己,不校验考勤时长
-            if (this.user.companyId != 3918 && this.reportTimeType.type == 1 && this.report.time) {
+            if (this.user.companyId != 3918 && this.user.companyId != 5978 && this.reportTimeType.type == 1 && this.report.time) {
                 var totalTime = 0;
                 for (var t = 0; t < this.form.domains.length; t++) {
                     totalTime += parseFloat(this.form.domains[t].workingTime);

+ 40 - 3
fhKeeper/formulahousekeeper/timesheet_h5/src/views/edit/weekEdit.vue

@@ -422,9 +422,14 @@
                     <van-button square block type="info" @click="submitReport(0)" native-type="submit" style="width:50%;float:right;">
                         <div>提交</div>
                     </van-button>
+                    
                 </div>
                 <div style="padding-bottom:10px;" v-if="!temporaryStorage">
-                    <van-button square block type="info" @click="submitReport(0)" native-type="submit" style="width:100%;float:right;">
+                    <van-button v-if="this.user.companyId != 5978" square block type="info" @click="submitReport(0)" native-type="submit" style="width:100%;float:right;">
+                        <div>提交</div>
+                    </van-button>
+                    <!--景昱没有暂存功能,直接加在这里-->
+                    <van-button v-if="this.user.companyId == 5978" square block type="info" @click="checkDateWorkTime()" native-type="submit" style="width:100%;float:right;">
                         <div>提交</div>
                     </van-button>
                 </div>
@@ -1915,7 +1920,39 @@
                             }]
                 // console.log(this.currentForm);
             },
-
+            checkDateWorkTime() {
+                var array = [];
+                for(let m in this.form){
+                    let allhours = 0
+                    for(let n in this.form[m].domains){
+                        if(this.form[m].domains[n].projectId){
+                            allhours += this.form[m].domains[n].workingTime
+                        }
+                    }
+                    if (allhours) {
+                        var workData = {date: this.form[m].createDate, workingTime: allhours};
+                        array.push(workData);
+                    }
+                }
+                if (array.length > 0) {
+                    this.$axios.post("/report/checkBeiSengCardTime", { userId:this.user.id, dateWorkingTime:JSON.stringify(array)})
+                        .then(res => {
+                            this.flgLg = true
+                            if (res.code == "ok") {
+                                this.submitReport(0)
+                            } else {
+                                this.$dialog.confirm({
+                                    title: '提示',
+                                    message: res.msg + ',是否忽略并提交?'
+                                }).then(() => {
+                                    this.submitReport(0)
+                                }).catch(() => { })
+                            }
+                        }).catch(err => { this.$toast.clear(); });
+                } else {
+                    submitReport(0);
+                }
+            },
             // 提交日报
             submitReport(isDraft) {
                 if(this.inbtn != 999) {
@@ -1993,7 +2030,7 @@
                     }
                 }
                 //针对凡己,不校验考勤时长
-                if(this.user.companyId != 3918 && (this.user.timeType.showDdCardtime == 1 || this.user.timeType.showCorpwxCardtime == 1) && this.reportTimeType.type == 1){
+                if(this.user.companyId != 3918 && this.user.companyId != 5978  && (this.user.timeType.showDdCardtime == 1 || this.user.timeType.showCorpwxCardtime == 1) && this.reportTimeType.type == 1){
                     let tips = ''
                     for(let m in this.form){
                         let allhours = 0