diff --git a/src/views/mes/reportWork/index.vue b/src/views/mes/reportWork/index.vue index a1a9c2b..e6590f3 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); });