From 214f274c0b1c8d0001a17e832bcabd78baa16a71 Mon Sep 17 00:00:00 2001 From: yunuo970428 <405378304@qq.com> Date: Thu, 8 Sep 2022 09:27:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E5=8D=95=E8=BD=A6=E8=BF=94?= =?UTF-8?q?=E5=88=A9=E6=A0=B8=E5=AF=B9=E5=BE=85=E6=A0=B8=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bicyclerebatetobechecked.vue | 81 +++++++++++-------- 1 file changed, 48 insertions(+), 33 deletions(-) diff --git a/anrui-scm/anrui-scm-ui/src/views/bikerebate/bicyclerebatecheck/bicyclerebatetobechecked.vue b/anrui-scm/anrui-scm-ui/src/views/bikerebate/bicyclerebatecheck/bicyclerebatetobechecked.vue index 1713ad50d6..1967ea5ab3 100644 --- a/anrui-scm/anrui-scm-ui/src/views/bikerebate/bicyclerebatecheck/bicyclerebatetobechecked.vue +++ b/anrui-scm/anrui-scm-ui/src/views/bikerebate/bicyclerebatecheck/bicyclerebatetobechecked.vue @@ -118,7 +118,7 @@ @@ -133,12 +133,12 @@ @@ -150,8 +150,8 @@ @@ -258,7 +258,7 @@ 调整金额合计 - {{ adjustmentMoney() }} + {{ adjustmentMoneyAdd() }} @@ -489,36 +489,41 @@ export default { } this.init() }, + UpNumber(e) { + e.target.value = e.target.value.replace(/[^\d]/g, '') // 清除“数字”和“.”"-"以外的字符 + e.target.value = e.target.value.replace(/^00/, '0') // 开头不能有两个0 + if (e.target.value.indexOf('.') < 0 && e.target.value !== '' && e.target.value !== '-') { + // 以上已经过滤,此处控制的是如果没有小数点,首位不能为类似于 01、02的金额 + console.log(e.target.value) + e.target.value = parseFloat(e.target.value) + } + }, changeIsAdjustment(row) { - // if (row.isAdjustment === '是') { - // if (row.uploadMoney === '') { - // row.isAdjustment = '' - // this.$message({ showClose: true, type: 'error', message: '上传金额不能为空' }) - // return - // } - // if (row.money === '') { - // row.isAdjustment = '' - // this.$message({ showClose: true, type: 'error', message: '费用不能为空' }) - // return - // } - // if (row.stayDetermineMoney === '') { - // row.isAdjustment = '' - // this.$message({ showClose: true, type: 'error', message: '待确定金额不能为空' }) - // return - // } - // if (row.uploadMoney !== '' && row.money !== '' && row.stayDetermineMoney !== '') { - // row.adjustmentMoney = parseInt(row.uploadMoney) - parseInt(row.money) - parseInt(row.stayDetermineMoney) - parseInt(row.estimateRebate) - // } - // } else { - // row.adjustmentMoney = 0 - // row.adjustmentRemarks = '' - // } - if (row.isAdjustment === '否') { + if (row.isAdjustment === '是') { + if (row.uploadMoney === '') { + row.isAdjustment = '' + this.$message({ showClose: true, type: 'error', message: '上传金额不能为空' }) + return + } + if (row.money === '') { + row.isAdjustment = '' + this.$message({ showClose: true, type: 'error', message: '费用不能为空' }) + return + } + if (row.stayDetermineMoney === '') { + row.isAdjustment = '' + this.$message({ showClose: true, type: 'error', message: '待确定金额不能为空' }) + return + } + if (row.uploadMoney !== '' && row.money !== '' && row.stayDetermineMoney !== '') { + row.adjustmentMoney = parseInt(row.uploadMoney) - parseInt(row.money) - parseInt(row.stayDetermineMoney) - parseInt(row.estimateRebate) + } + } else if (row.isAdjustment === '否') { row.adjustmentMoney = 0 row.adjustmentRemarks = '' } }, - adjustmentMoney() { + adjustmentMoneyAdd() { this.formobj.adjustmentMoney = parseInt(this.formobj.firstRebate - 0) + parseInt(this.formobj.secondRebate - 0) - parseInt(this.formobj.surplusRebate - 0) return this.formobj.adjustmentMoney }, @@ -575,6 +580,14 @@ export default { this.$refs['divCheckAdd'].showAdd(this.listQuery.params.createOrgSid) }, toSave(row) { + if (row.uploadDate === '') { + this.$message({ showClose: true, type: 'error', message: '上传日期不能为空' }) + return + } + if (row.uploadMoney === '') { + this.$message({ showClose: true, type: 'error', message: '上传金额不能为空' }) + return + } if (row.stayDetermineMoney === '') { this.$message({ showClose: true, type: 'error', message: '待确定金额不能为空' }) return @@ -592,8 +605,10 @@ export default { } } else if (row.adjustmentMoney !== '0') { if (row.isAdjustment === '否') { - this.$message({ showClose: true, type: 'error', message: '因待确定金额等于0且调整金额大于0,是否调整选项需选择是' }) - return + if ((parseInt(row.uploadMoney) - parseInt(row.estimateRebate)) > 0) { + this.$message({ showClose: true, type: 'error', message: '因待确定金额等于0且调整金额大于0,是否调整选项需选择是' }) + return + } } } else if (row.adjustmentMoney === '0') { if (row.isAdjustment === '否') {