Lijy пре 1 година
родитељ
комит
7c4bf79f38
1 измењених фајлова са 39 додато и 2 уклоњено
  1. 39 2
      fhKeeper/formulahousekeeper/timesheet_h5/src/views/edit/weekEdit.vue

+ 39 - 2
fhKeeper/formulahousekeeper/timesheet_h5/src/views/edit/weekEdit.vue

@@ -1706,7 +1706,7 @@
                 if(this.inbtn != 999) {
                     this.form[this.inbtn] = this.currentForm
                 }
-                const { allday, workContentState, enableNewWeeklyfill } = this.user.timeType // 系统设置的每日工作时间
+                const { allday, workContentState, enableNewWeeklyfill, reportAuditType } = this.user.timeType // 系统设置的每日工作时间
                 // 针对物奇做的判断
                 if(this.user.timeType.enableNewWeeklyfill == 1){
                     const { next, error, group } = this.judgeStrange(this.form)
@@ -1729,7 +1729,16 @@
                         return
                     }
                 }
-                
+
+                // 判断 report_audit_type  = 1 和 2 的情况下任务分组填没填
+                if(reportAuditType == 1 || reportAuditType == 2) {
+                    const { error, next } = this.judgeWorkGroud(this.form)
+                    if(!next) {
+                        this.$toast(`【${error.join('、')}】请填写任务分组`)
+                        return
+                    }
+                }
+
                 //检查子项目
                 if (this.user.timeType.subProMustFill == 1) {
                     for(let i in this.form){
@@ -2257,6 +2266,34 @@
                     }
                 }
             },
+            // 判断任务分组是否填写
+            judgeWorkGroud(from) {
+                const newFrom = JSON.parse(JSON.stringify(from))
+                const arrList = []
+                for(var i in newFrom) {
+                    const { domains, createDate } = newFrom[i]
+                    for(var j in domains) {
+                        if(domains[j].projectId && !domains[j].groupId) {
+                            arrList.push({
+                                dateTime: createDate,
+                                projectName: domains[j].projectName,
+                                weeks: this.getNewWeek(createDate)
+                            })
+                        }
+                    }
+                }
+                if(arrList.length > 0) {
+                    return {
+                        next: false,
+                        error: arrList.map(item => `【${item.dateTime} ${item.weeks} 中的 (${item.projectName})项目】`),
+                    }
+                } else {
+                    return {
+                        next: true,
+                        error: [],
+                    }
+                }
+            },
             // 判断是否小于系统设置的每日工作时间
             judgmentData(data) {
                 const { allday } = this.user.timeType // 系统设置的每日工作时间