diff --git a/sgzb-ui/src/views/claimAndRefund/receive/receiveApplyAdd.vue b/sgzb-ui/src/views/claimAndRefund/receive/receiveApplyAdd.vue index eff21e12..c4932d84 100644 --- a/sgzb-ui/src/views/claimAndRefund/receive/receiveApplyAdd.vue +++ b/sgzb-ui/src/views/claimAndRefund/receive/receiveApplyAdd.vue @@ -538,16 +538,20 @@ export default { this.$message.error('请添加数据') return } - this.queryParams.leaseApplyDetails.forEach(item => { - /* if(item.num==0){ + try { + this.queryParams.leaseApplyDetails.forEach(item => { + if(item.num==0){ this.$message.error('机具类型库存量为零无法领料'); - return - } */ - if (item.preNum == '') { - this.$message.error('请填写预领数量') - return - } - }) + throw new Error(); + } + if (item.preNum == '') { + this.$message.error('请填写预领数量') + throw new Error(); + } + }) + } catch (e) { + throw e + } this.queryParams.createBy = this.user.userName this.queryParams.companyId = this.user.companyId let res diff --git a/sgzb-ui/src/views/claimAndRefund/receiveByCq/receiveApplyAddByCq.vue b/sgzb-ui/src/views/claimAndRefund/receiveByCq/receiveApplyAddByCq.vue index 08c61d66..ce49889e 100644 --- a/sgzb-ui/src/views/claimAndRefund/receiveByCq/receiveApplyAddByCq.vue +++ b/sgzb-ui/src/views/claimAndRefund/receiveByCq/receiveApplyAddByCq.vue @@ -587,18 +587,20 @@ export default { return } let canSave = true - this.queryParams.leaseApplyDetails.forEach(item => { - if (item.num == 0) { - this.$message.error('机具类型库存量为零无法领料') - canSave = false - return - } - if (item.preNum == '') { - canSave = false - this.$message.error('请填写预领数量') - return - } - }) + try { + this.queryParams.leaseApplyDetails.forEach(item => { + if(item.num==0){ + this.$message.error('机具类型库存量为零无法领料'); + throw new Error(); + } + if (item.preNum == '') { + this.$message.error('请填写预领数量') + throw new Error(); + } + }) + } catch (e) { + throw e + } if (!canSave) { return false }