Commit 00fda0c2 by chenwq

fix(financeManage): 优化系统账单对话框金额验证逻辑

合并金额范围的验证条件,简化错误提示信息
1 parent 86b9f1bc
...@@ -497,11 +497,9 @@ export default { ...@@ -497,11 +497,9 @@ export default {
const totalPaymentObj = this.tmplFieldsList.find(item => item.fieldCode == 'totalPaymentAmount') const totalPaymentObj = this.tmplFieldsList.find(item => item.fieldCode == 'totalPaymentAmount')
var errorTxt = '' var errorTxt = ''
const max = this.tableList[rowIndex][totalPaymentObj.extInfo.source].totalPaymentAmount || '0' const max = this.tableList[rowIndex][totalPaymentObj.extInfo.source].totalPaymentAmount || '0'
const min = (this.tableList[rowIndex][totalPaymentObj.extInfo.source].totalPaymentAmount * -1).toFixed(2) || '0' const min = parseFloat((this.tableList[rowIndex][totalPaymentObj.extInfo.source].totalPaymentAmount * -1).toFixed(2)) || '0'
if (value > max) { if (value > max || value < min) {
errorTxt = `请输入小于${max}的数字` errorTxt = `请输入大于${min}且小于${max}的数字`
} else if (value < min) {
errorTxt = `请输入大于${min}的数字`
} else if (value !== null && value !== undefined && value !== '') { } else if (value !== null && value !== undefined && value !== '') {
const decimalPart = String(value).split('.')[1] const decimalPart = String(value).split('.')[1]
if (decimalPart && decimalPart.length > 2) { if (decimalPart && decimalPart.length > 2) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!