From 257281a68316e65a506eb765f5754d0efbbe4c32 Mon Sep 17 00:00:00 2001 From: yxq Date: Wed, 28 Jun 2023 14:54:47 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=8F=E8=B4=B9=E5=BC=80=E5=A7=8B=E7=94=B3?= =?UTF-8?q?=E6=8A=A5=20=E6=95=B0=E9=87=8F=E4=B8=A4=E4=BD=8D=E5=B0=8F?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Views/FundsApplyDetail/Form.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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; } }