From 6918a8bf240b2a9e46c5e79821a8400869fc4d7b Mon Sep 17 00:00:00 2001 From: yunuo970428 <405378304@qq.com> Date: Thu, 27 Mar 2025 10:17:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=94=B6=E8=B4=A7=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../receivingGoods/receivingGoodsAdd.vue | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/yxt-as-ui/src/views/storage/receivingGoods/receivingGoodsAdd.vue b/yxt-as-ui/src/views/storage/receivingGoods/receivingGoodsAdd.vue index 70f42a9457..86edc07208 100644 --- a/yxt-as-ui/src/views/storage/receivingGoods/receivingGoodsAdd.vue +++ b/yxt-as-ui/src/views/storage/receivingGoods/receivingGoodsAdd.vue @@ -223,6 +223,18 @@ export default { saveOrUpdate() { this.$refs['form_obj'].validate((valid) => { if (valid) { + if (this.formobj.list.length === 0) { + this.$message({ showClose: true, type: 'error', message: '商品列表不能为空' }) + return + } + for (var i = 0; i < this.formobj.list.length; i++) { + if (this.formobj.list[i].actualInCount === '' ) { + this.$message({ showClose: true, type: 'error', message: '实收数量不能为空' }) + return + } else if (parseFloat(this.formobj.list[i].actualInCount) < 1) { + this.$message({ showClose: true, type: 'error', message: '实收数量不能为零' }) + } + } this.submitdisabled = true req.save(this.formobj).then((res) => { if (res.success) { @@ -245,14 +257,11 @@ export default { return } for (var i = 0; i < this.formobj.list.length; i++) { - var item = this.formobj.list[i] - if (item.actualInCount == 0) { - this.$message({ - showClose: true, - type: 'error', - message: '实收数量不能为空' - }) + if (this.formobj.list[i].actualInCount === '' ) { + this.$message({ showClose: true, type: 'error', message: '实收数量不能为空' }) return + } else if (parseFloat(this.formobj.list[i].actualInCount) < 1) { + this.$message({ showClose: true, type: 'error', message: '实收数量不能为零' }) } } this.submitdisabled = true