From 83cb38d33d45eed38017bc0c455422980aa05150 Mon Sep 17 00:00:00 2001 From: cwchen <1048842385@qq.com> Date: Fri, 14 Mar 2025 11:25:03 +0800 Subject: [PATCH] =?UTF-8?q?=E8=80=83=E5=8B=A4=E6=98=8E=E7=BB=86=E6=89=B9?= =?UTF-8?q?=E9=87=8F=E4=BF=AE=E6=94=B9=20=E6=8F=90=E7=A4=BA=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/report/attReport/index.vue | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) 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' });