From f44374410462b5d13b558865ad461ab923477ee9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=97=AB=E6=99=93=E8=8C=B9?= <1935832701@qq.com> Date: Wed, 13 Mar 2024 17:12:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/manage/project/index.vue | 37 ++++++++ src/views/manage/projectresult/index.vue | 109 ++++++++++++++++------- 2 files changed, 116 insertions(+), 30 deletions(-) diff --git a/src/views/manage/project/index.vue b/src/views/manage/project/index.vue index 13efdb8..92b99bf 100644 --- a/src/views/manage/project/index.vue +++ b/src/views/manage/project/index.vue @@ -356,12 +356,14 @@ @@ -585,6 +587,41 @@ export default { this.info(); }, methods: { + checkPricemax() { + let checkPlan = "" + this.form.maxValue; + checkPlan = checkPlan + .replace(/[^\d.]/g, "") // 清除“数字”和“.”以外的字符 + .replace(/\.{2,}/g, ".") // 只保留第一个. 清除多余的 + .replace(/^\./g, "") // 保证第一个为数字而不是. + .replace(".", "$#$") + .replace(/\./g, "") + .replace("$#$", "."); + if (checkPlan.indexOf(".") < 0 && checkPlan !== "") { + // 以上已经过滤,此处控制的是如果没有小数点,首位不能为类似于 01、02的金额 + checkPlan = parseFloat(checkPlan) + ""; + } else if (checkPlan.indexOf(".") >= 0) { + checkPlan = checkPlan.replace(/^()*(\d+)\.(\d\d).*$/, "$1$2.$3"); // 只能输入两个小数 + } + this.form.maxValue = checkPlan; + }, + /**只能输入数字且有小数点最多保留两位*/ + checkPrice() { + let checkPlan = "" + this.form.minValue; + checkPlan = checkPlan + .replace(/[^\d.]/g, "") // 清除“数字”和“.”以外的字符 + .replace(/\.{2,}/g, ".") // 只保留第一个. 清除多余的 + .replace(/^\./g, "") // 保证第一个为数字而不是. + .replace(".", "$#$") + .replace(/\./g, "") + .replace("$#$", "."); + if (checkPlan.indexOf(".") < 0 && checkPlan !== "") { + // 以上已经过滤,此处控制的是如果没有小数点,首位不能为类似于 01、02的金额 + checkPlan = parseFloat(checkPlan) + ""; + } else if (checkPlan.indexOf(".") >= 0) { + checkPlan = checkPlan.replace(/^()*(\d+)\.(\d\d).*$/, "$1$2.$3"); // 只能输入两个小数 + } + this.form.minValue = checkPlan; + }, info() { var dictType = "project_judge_mode"; getAgencytype(dictType).then((res) => { diff --git a/src/views/manage/projectresult/index.vue b/src/views/manage/projectresult/index.vue index ca6f9a6..0ddeb71 100644 --- a/src/views/manage/projectresult/index.vue +++ b/src/views/manage/projectresult/index.vue @@ -373,10 +373,10 @@ - + - + @@ -430,15 +430,21 @@