diff --git a/pages/work/wms/inventoryConfirm.vue b/pages/work/wms/inventoryConfirm.vue index 8b93c4a..a34251a 100644 --- a/pages/work/wms/inventoryConfirm.vue +++ b/pages/work/wms/inventoryConfirm.vue @@ -330,6 +330,20 @@ // } //表单提交 formSubmit: function(ref) { + // 1. 新增核心校验:判断actQty是否为null + // 先判断数组是否存在且有数据,避免数组为空时报错 + if (this.billInfo.checkPltInfos.length > 0) { + const firstItem = this.billInfo.checkPltInfos[0]; + // 校验actQty是否为null/空/未定义 + if (firstItem.actQty === null || firstItem.actQty === undefined || firstItem.actQty === '') { + this.$modal.msgError("请先填写确认数量,不允许为空!"); + return; // 阻止后续提交逻辑 + } + } else { + // 可选:如果数组为空也阻止提交(根据你的业务需求调整) + this.$modal.msgError("暂无盘点数据,无法提交!"); + return; + } //拿到 formaData var details = this.getSelectDetail() if (details && details.length > 0) {