diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/FundsApplyDetail/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/FundsApplyDetail/Form.js index 7bdd3131e..8024652f0 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/FundsApplyDetail/Form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/FundsApplyDetail/Form.js @@ -22,22 +22,22 @@ var bootstrap = function ($, learun) { var num = $('#Number').val(); var Price = $('#Price').val(); if (!!Price) { - let regNeg = /^(0|[1-9]\d*|(0|[1-9]\d*)\.\d*[1-9])$/; - if (regNeg.test(Price)) { + let regNeg = /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/; + if (regNeg.test(Price) && Price != '.') { $('#Price').val(parseFloat(Price).toFixed(2)); } else { $('#Price').val(''); - learun.alert.warning("单价必须为整数或小数(不能为负数)!"); + learun.alert.warning("单价必须为整数或最多两位小数(不能为负数)!"); return false; } } if (!!num) { - let regNeg = /^(0|[1-9]\d*|(0|[1-9]\d*)\.\d*[1-9])$/; - if (regNeg.test(num)) { + let regNeg = /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/; + if (regNeg.test(num) && num != '.') { $('#Number').val(parseFloat(num).toFixed(2)); } else { $('#Number').val(''); - learun.alert.warning("数量必须为整数或小数(不能为负数)!"); + learun.alert.warning("数量必须为整数或最多两位小数(不能为负数)!"); return false; } }