Browse Source

按周考勤0不填报

ggooalice 2 years ago
parent
commit
26a8f759e8

+ 17 - 0
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -4440,6 +4440,23 @@
             },
             // 按周填报里内容的填写
             tianxies(item, i, names, row) {
+                if(this.user.timeType.notAllowedNoAttendance == 1){
+                    if(this.zhoData[i].corpTime){
+                        if(this.zhoData[i].corpTime.workHours == 0){
+                            this.$message({
+                                message: '无考勤记录不可填报',
+                                type: 'error'
+                            })
+                            return
+                        }
+                    }else{
+                        this.$message({
+                            message: '无考勤记录不可填报',
+                            type: 'error'
+                        })
+                        return
+                    }
+                }
                 var idd = ''
                 var obj = {}
                 for(var l in this.projectList) {

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

@@ -524,6 +524,42 @@
             },
             // 切换星期
             switchWeek(item,index){
+                if(this.user.timeType.notAllowedNoAttendance == 1){
+                    let havework = false
+                    let cleardomain = [{
+                                id: null,
+                                projectId: "",
+                                projectName: "",
+                                workingTime: this.user.timeType.allday,
+                                content: "",
+                                progress: 100,
+                                state: 2,
+                                multiWorktime:0,
+                                worktimeList:[{}],
+                                degreeId: '',
+
+                                auditorFirst: {name:'',id:''},
+                                auditorSec: {name:'',id:''},
+                                auditorThird: {name:'',id:''},
+                                ccUserid: {name:'',id:''}
+                            }]
+                    for(let i in this.currentForm.domains){
+                        if(this.currentForm.domains[i].projectId){
+                            havework = true
+                        }
+                    }
+                    if(havework){
+                        if(this.kaoqinText){
+                            if(this.currentForm.cardtime == 0){
+                                this.$toast.fail('无考勤记录' + this.weekArr[this.inbtn] +'不可填报')
+                                this.currentForm.domains = cleardomain
+                            }
+                        }else{
+                            this.$toast.fail('无考勤记录' + this.weekArr[this.inbtn] +'不可填报')
+                            this.currentForm.domains = cleardomain
+                        }
+                    }
+                }
                 this.form[this.inbtn] = this.currentForm
                 this.inbtn = index
                 this.currentForm = this.form[this.inbtn]
@@ -535,6 +571,7 @@
                 this.getKaoqin()
                 this.getWorkTime()
             },
+            
             // 获取日考勤记录
             getKaoqin(){
                 this.$axios.post('/report/getCardTime',{
@@ -1495,6 +1532,46 @@
 
             // 提交日报
             submitReport() {
+                if(this.user.timeType.notAllowedNoAttendance == 1){
+                    let havework = false
+                    let cleardomain = [{
+                                id: null,
+                                projectId: "",
+                                projectName: "",
+                                workingTime: this.user.timeType.allday,
+                                content: "",
+                                progress: 100,
+                                state: 2,
+                                multiWorktime:0,
+                                worktimeList:[{}],
+                                degreeId: '',
+
+                                auditorFirst: {name:'',id:''},
+                                auditorSec: {name:'',id:''},
+                                auditorThird: {name:'',id:''},
+                                ccUserid: {name:'',id:''}
+                            }]
+                    for(let i in this.currentForm.domains){
+                        if(this.currentForm.domains[i].projectId){
+                            havework = true
+                        }
+                    }
+                    if(havework){
+                        if(this.kaoqinText){
+                            if(this.currentForm.cardtime == 0){
+                                this.$toast.fail('无考勤记录' + this.weekArr[this.inbtn] +'不可填报')
+                                this.currentForm.domains = cleardomain
+                                return
+                            }
+                        }else{
+                            this.$toast.fail('无考勤记录' + this.weekArr[this.inbtn] +'不可填报')
+                            this.currentForm.domains = cleardomain
+                            return
+                        }
+                    }
+                }
+
+
                 this.form[this.inbtn] = this.currentForm
                 if((this.user.timeType.showDdCardtime == 1 || this.user.timeType.showCorpwxCardtime == 1) && this.reportTimeType.type == 1){
                     let tips = ''
@@ -1881,6 +1958,7 @@
         },
         
         mounted() {
+            this.user.timeType.notAllowedNoAttendance = 1
             this.timeRange = []
             for(let i=0.5; i<=20; i+=0.5){
                 this.timeRange.push(i)