diff --git a/src/views/report/attReport/index.vue b/src/views/report/attReport/index.vue index 74e56f3..cd19b8e 100644 --- a/src/views/report/attReport/index.vue +++ b/src/views/report/attReport/index.vue @@ -740,16 +740,18 @@ export default { let paramList = [] let hasError = false let hasChanges = false; - - this.dialogList.forEach((newItem, index) => { + let isErrorMsg = ''; + this.dialogList.some((newItem, index) => { const oldItem = this.dialogListOld[index] // 检查toWorkAttCurrentTime或toWorkAttStatus是否改变 if ((newItem.toWorkAttCurrentTime !== oldItem.toWorkAttCurrentTime || newItem.toWorkAttStatus !== oldItem.toWorkAttStatus) && (!newItem.toErrorRemake || newItem.toErrorRemake === '' || !this.hasAttachments(newItem.filesVoList, '1') )) { hasError = true - this.$message({ message: '上班时间或状态改变时,原因说明、附件不能为空!', type: 'warning' }) + // this.$message({ message: '上班时间或状态改变时,原因说明、附件不能为空!', type: 'warning' }) + isErrorMsg = '上班时间或状态改变时,原因说明、附件不能为空!'; + return true; } - + if(newItem.toErrorRemake!=""&&this.hasAttachments(newItem.filesVoList, '1')){ hasChanges = true } @@ -758,7 +760,9 @@ export default { if ((newItem.offWorkAttCurrentTime !== oldItem.offWorkAttCurrentTime || newItem.offWorkAttStatus !== oldItem.offWorkAttStatus) && (!newItem.offErrorRemake || newItem.offErrorRemake === '' || !this.hasAttachments(newItem.filesVoList, '2') )) { hasError = true - this.$message({ message: '下班时间或状态改变时,原因说明、附件不能为空!', type: 'warning' }) + // this.$message({ message: '下班时间或状态改变时,原因说明、附件不能为空!', type: 'warning' }) + isErrorMsg = '下班时间或状态改变时,原因说明、附件不能为空!'; + return true; } if(newItem.offErrorRemake!=""&&this.hasAttachments(newItem.filesVoList, '2')){ @@ -783,6 +787,9 @@ export default { paramList.push(obj) } }) + if(isErrorMsg){ + return this.$message({ message: isErrorMsg, type: 'warning' }) + } console.log("aa=",paramList) if(!hasChanges){ this.$message({ message: '没有数据变化,无需更新!', type: 'info' });