From 08a00767b182a00321faf9f1a6341cd573b37198 Mon Sep 17 00:00:00 2001 From: chenhao <852066789@qq.com> Date: Fri, 27 Jun 2025 10:55:55 +0800 Subject: [PATCH] =?UTF-8?q?refactor(project):=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E6=8A=98=E6=89=A3=E7=8E=87=E6=98=BE=E7=A4=BA=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在项目订单添加、编辑和信息编辑页面中,将折扣率乘以 100 后保留两位小数- 使用 toFixed(2) 方法确保折扣率显示为两位小数,提高用户体验 --- .../main/resources/templates/project/info/edit.html | 6 +++--- .../main/resources/templates/project/order/add.html | 12 ++++++------ .../main/resources/templates/project/order/edit.html | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ruoyi-admin/src/main/resources/templates/project/info/edit.html b/ruoyi-admin/src/main/resources/templates/project/info/edit.html index 14b725a4..383e13f7 100644 --- a/ruoyi-admin/src/main/resources/templates/project/info/edit.html +++ b/ruoyi-admin/src/main/resources/templates/project/info/edit.html @@ -358,7 +358,7 @@ ele.priceFormmat = ele.price ? formatAmountNumber(ele.price) : "" ele.catalogueAllPriceFormmat = ele.catalogueAllPrice ? formatAmountNumber(ele.catalogueAllPrice) : "" ele.allPriceFormmat = ele.allPrice ? formatAmountNumber(ele.allPrice) : "" - ele.discountFormat = ele.discount ? ele.discount*100 : "" + ele.discountFormat = ele.discount ? (ele.discount*100).toFixed(2) : "" ele.guidanceDiscountFormat = ele.guidanceDiscount ? ele.guidanceDiscount*100 : "" addProduct(ele) }) @@ -368,7 +368,7 @@ ele.priceFormmat = ele.price ? formatAmountNumber(ele.price) : "" ele.catalogueAllPriceFormmat = ele.catalogueAllPrice ? formatAmountNumber(ele.catalogueAllPrice) : "" ele.allPriceFormmat = ele.allPrice ? formatAmountNumber(ele.allPrice) : "" - ele.discountFormat = ele.discount ? ele.discount*100 : "" + ele.discountFormat = ele.discount ? (ele.discount*100).toFixed(2) : "" ele.guidanceDiscountFormat = ele.guidanceDiscount ? ele.guidanceDiscount*100 : "" addProduct2(ele) }) @@ -378,7 +378,7 @@ ele.priceFormmat = ele.price ? formatAmountNumber(ele.price) : "" ele.catalogueAllPriceFormmat = ele.catalogueAllPrice ? formatAmountNumber(ele.catalogueAllPrice) : "" ele.allPriceFormmat = ele.allPrice ? formatAmountNumber(ele.allPrice) : "" - ele.discountFormat = ele.discount ? ele.discount*100 : "" + ele.discountFormat = ele.discount ? (ele.discount*100).toFixed(2) : "" ele.guidanceDiscountFormat = ele.guidanceDiscount ? ele.guidanceDiscount*100 : "" addProduct3(ele) }) diff --git a/ruoyi-admin/src/main/resources/templates/project/order/add.html b/ruoyi-admin/src/main/resources/templates/project/order/add.html index e3ad6e13..d780d718 100644 --- a/ruoyi-admin/src/main/resources/templates/project/order/add.html +++ b/ruoyi-admin/src/main/resources/templates/project/order/add.html @@ -767,7 +767,7 @@ ${ ele.priceFormmat = ele.price ? formatAmountNumber(ele.price) : "" ele.catalogueAllPriceFormmat = ele.catalogueAllPrice ? formatAmountNumber(ele.catalogueAllPrice) : "" ele.allPriceFormmat = ele.allPrice ? formatAmountNumber(ele.allPrice) : "" - ele.discountFormat = ele.discount ? ele.discount*100 : "" + ele.discountFormat = ele.discount ? (ele.discount*100).toFixed(2) : "" ele.guidanceDiscountFormat = ele.guidanceDiscount ? ele.guidanceDiscount*100 : "" addProduct(ele) }) : '' @@ -776,7 +776,7 @@ ${ ele.priceFormmat = ele.price ? formatAmountNumber(ele.price) : "" ele.catalogueAllPriceFormmat = ele.catalogueAllPrice ? formatAmountNumber(ele.catalogueAllPrice) : "" ele.allPriceFormmat = ele.allPrice ? formatAmountNumber(ele.allPrice) : "" - ele.discountFormat = ele.discount ? ele.discount*100 : "" + ele.discountFormat = ele.discount ? (ele.discount*100).toFixed(2) : "" ele.guidanceDiscountFormat = ele.guidanceDiscount ? ele.guidanceDiscount*100 : "" addProduct2(ele) }) : '' @@ -785,7 +785,7 @@ ${ ele.priceFormmat = ele.price ? formatAmountNumber(ele.price) : "" ele.catalogueAllPriceFormmat = ele.catalogueAllPrice ? formatAmountNumber(ele.catalogueAllPrice) : "" ele.allPriceFormmat = ele.allPrice ? formatAmountNumber(ele.allPrice) : "" - ele.discountFormat = ele.discount ? ele.discount*100 : "" + ele.discountFormat = ele.discount ? (ele.discount*100).toFixed(2) : "" ele.guidanceDiscountFormat = ele.guidanceDiscount ? ele.guidanceDiscount*100 : "" addProduct3(ele) }) : '' @@ -801,7 +801,7 @@ ${ ele.priceFormmat = ele.price ? formatAmountNumber(ele.price) : "" ele.catalogueAllPriceFormmat = ele.catalogueAllPrice ? formatAmountNumber(ele.catalogueAllPrice) : "" ele.allPriceFormmat = ele.allPrice ? formatAmountNumber(ele.allPrice) : "" - ele.discountFormat = ele.discount ? ele.discount*100 : "" + ele.discountFormat = ele.discount ? (ele.discount*100).toFixed(2) : "" ele.guidanceDiscountFormat = ele.guidanceDiscount ? ele.guidanceDiscount*100 : "" addProduct(ele) }) : '' @@ -810,7 +810,7 @@ ${ ele.priceFormmat = ele.price ? formatAmountNumber(ele.price) : "" ele.catalogueAllPriceFormmat = ele.catalogueAllPrice ? formatAmountNumber(ele.catalogueAllPrice) : "" ele.allPriceFormmat = ele.allPrice ? formatAmountNumber(ele.allPrice) : "" - ele.discountFormat = ele.discount ? ele.discount*100 : "" + ele.discountFormat = ele.discount ? (ele.discount*100).toFixed(2) : "" ele.guidanceDiscountFormat = ele.guidanceDiscount ? ele.guidanceDiscount*100 : "" addProduct2(ele) }) : '' @@ -819,7 +819,7 @@ ${ ele.priceFormmat = ele.price ? formatAmountNumber(ele.price) : "" ele.catalogueAllPriceFormmat = ele.catalogueAllPrice ? formatAmountNumber(ele.catalogueAllPrice) : "" ele.allPriceFormmat = ele.allPrice ? formatAmountNumber(ele.allPrice) : "" - ele.discountFormat = ele.discount ? ele.discount*100 : "" + ele.discountFormat = ele.discount ? (ele.discount*100).toFixed(2) : "" ele.guidanceDiscountFormat = ele.guidanceDiscount ? ele.guidanceDiscount*100 : "" addProduct3(ele) }) : '' diff --git a/ruoyi-admin/src/main/resources/templates/project/order/edit.html b/ruoyi-admin/src/main/resources/templates/project/order/edit.html index 6936cdee..089725d4 100644 --- a/ruoyi-admin/src/main/resources/templates/project/order/edit.html +++ b/ruoyi-admin/src/main/resources/templates/project/order/edit.html @@ -793,7 +793,7 @@ ${ ele.priceFormmat = ele.price ? formatAmountNumber(ele.price) : "" ele.catalogueAllPriceFormmat = ele.catalogueAllPrice ? formatAmountNumber(ele.catalogueAllPrice) : "" ele.allPriceFormmat = ele.allPrice ? formatAmountNumber(ele.allPrice) : "" - ele.discountFormat = ele.discount ? ele.discount*100 : "" + ele.discountFormat = ele.discount ? (ele.discount*100).toFixed(2) : "" ele.guidanceDiscountFormat = ele.guidanceDiscount ? ele.guidanceDiscount*100 : "" addProduct(ele) }) : ''; @@ -802,7 +802,7 @@ ${ ele.priceFormmat = ele.price ? formatAmountNumber(ele.price) : "" ele.catalogueAllPriceFormmat = ele.catalogueAllPrice ? formatAmountNumber(ele.catalogueAllPrice) : "" ele.allPriceFormmat = ele.allPrice ? formatAmountNumber(ele.allPrice) : "" - ele.discountFormat = ele.discount ? ele.discount*100 : "" + ele.discountFormat = ele.discount ? (ele.discount*100).toFixed(2) : "" ele.guidanceDiscountFormat = ele.guidanceDiscount ? ele.guidanceDiscount*100 : "" addProduct2(ele) }) : ''; @@ -811,7 +811,7 @@ ${ ele.priceFormmat = ele.price ? formatAmountNumber(ele.price) : "" ele.catalogueAllPriceFormmat = ele.catalogueAllPrice ? formatAmountNumber(ele.catalogueAllPrice) : "" ele.allPriceFormmat = ele.allPrice ? formatAmountNumber(ele.allPrice) : "" - ele.discountFormat = ele.discount ? ele.discount*100 : "" + ele.discountFormat = ele.discount ? (ele.discount*100).toFixed(2) : "" ele.guidanceDiscountFormat = ele.guidanceDiscount ? ele.guidanceDiscount*100 : "" addProduct3(ele) }) : '';