From ef6932006f11be084158fbf4f204b122c7bcd47f Mon Sep 17 00:00:00 2001 From: mengjiao <3338049200@qq,com> Date: Wed, 7 Aug 2024 14:33:10 +0800 Subject: [PATCH] =?UTF-8?q?SAP=E6=94=B6=E8=B4=A7=E6=89=B9=E6=AC=A1?= =?UTF-8?q?=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/mes/reportWork/index.vue | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/views/mes/reportWork/index.vue b/src/views/mes/reportWork/index.vue index a1a9c2b2..e6590f32 100644 --- a/src/views/mes/reportWork/index.vue +++ b/src/views/mes/reportWork/index.vue @@ -1314,6 +1314,22 @@ export default { this.$modal.msgError(`请选择数据`); return false; } + + // 使用 for...of 循环遍历 reportRows + for (const row of this.reportRows) { + console.log("当前行: ", row.batchSK); // 输出当前行 + const batchSK = row.batchSK; + // 使用正则表达式检查是否全部为大写字母 + const isUpperCase = /^[A-Z0-9]+$/.test(batchSK); + if (isUpperCase) { + console.log("当前行的 batchSK (符合要求): ", batchSK); // 输出符合要求的 batchSK + } else { + console.log("当前行的 batchSK 不符合要求 (应为大写): ", batchSK); // 输出不符合要求的 batchSK + this.$modal.msgError("批次不符合要求 (英文应为大写): " + batchSK); // 显示错误信息 + return; // 结束方法的执行 + } + } + // 使用 forEach 循环遍历 reportRows this.reportRows.forEach((row) => { this.$set(row, "whCode", this.selectedWarehouse); });