From 4f6438b7e9bc2d776f5b0cf04d2d89a5eb9b8f02 Mon Sep 17 00:00:00 2001
From: chenhao <852066789@qq.com>
Date: Fri, 27 Jun 2025 10:59:19 +0800
Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E6=8A=98=E6=89=A3?=
=?UTF-8?q?=E6=98=BE=E7=A4=BA=E7=B2=BE=E5=BA=A6=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 在多个模板文件中,将折扣显示逻辑改为保留两位小数
- 修改涉及 add.html、edit.html、info.html、order.html 和 product.html 文件
- 优化折扣显示格式,提高用户体验
---
.../main/resources/templates/manage/order/edit.html | 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 +++---
.../resources/templates/system/product/edit.html | 2 +-
5 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/ruoyi-admin/src/main/resources/templates/manage/order/edit.html b/ruoyi-admin/src/main/resources/templates/manage/order/edit.html
index 10dec599..18aa318b 100644
--- a/ruoyi-admin/src/main/resources/templates/manage/order/edit.html
+++ b/ruoyi-admin/src/main/resources/templates/manage/order/edit.html
@@ -531,7 +531,7 @@
title: '折扣',
width: 90,
formatter: function (value, row, index) {
- let showValue=value?value*100+'%':'0%';
+ let showValue=value?(value*100).toFixed(2)+'%':'0%';
var html = $.common.sprintf("" +
"" +
"", index, value,showValue);
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 383e13f7..bea4228e 100644
--- a/ruoyi-admin/src/main/resources/templates/project/info/edit.html
+++ b/ruoyi-admin/src/main/resources/templates/project/info/edit.html
@@ -359,7 +359,7 @@
ele.catalogueAllPriceFormmat = ele.catalogueAllPrice ? formatAmountNumber(ele.catalogueAllPrice) : ""
ele.allPriceFormmat = ele.allPrice ? formatAmountNumber(ele.allPrice) : ""
ele.discountFormat = ele.discount ? (ele.discount*100).toFixed(2) : ""
- ele.guidanceDiscountFormat = ele.guidanceDiscount ? ele.guidanceDiscount*100 : ""
+ ele.guidanceDiscountFormat = ele.guidanceDiscount ? (ele.guidanceDiscount*100).toFixed(2) : ""
addProduct(ele)
})
let hardwareProjectProductInfoListAll = [[${projectInfo.hardwareProjectProductInfoList}]] || []
@@ -369,7 +369,7 @@
ele.catalogueAllPriceFormmat = ele.catalogueAllPrice ? formatAmountNumber(ele.catalogueAllPrice) : ""
ele.allPriceFormmat = ele.allPrice ? formatAmountNumber(ele.allPrice) : ""
ele.discountFormat = ele.discount ? (ele.discount*100).toFixed(2) : ""
- ele.guidanceDiscountFormat = ele.guidanceDiscount ? ele.guidanceDiscount*100 : ""
+ ele.guidanceDiscountFormat = ele.guidanceDiscount ? (ele.guidanceDiscount*100).toFixed(2) : ""
addProduct2(ele)
})
let maintenanceProjectProductInfoListAll = [[${projectInfo.maintenanceProjectProductInfoList}]] || []
@@ -379,7 +379,7 @@
ele.catalogueAllPriceFormmat = ele.catalogueAllPrice ? formatAmountNumber(ele.catalogueAllPrice) : ""
ele.allPriceFormmat = ele.allPrice ? formatAmountNumber(ele.allPrice) : ""
ele.discountFormat = ele.discount ? (ele.discount*100).toFixed(2) : ""
- ele.guidanceDiscountFormat = ele.guidanceDiscount ? ele.guidanceDiscount*100 : ""
+ ele.guidanceDiscountFormat = ele.guidanceDiscount ? (ele.guidanceDiscount*100).toFixed(2) : ""
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 d780d718..e37c2830 100644
--- a/ruoyi-admin/src/main/resources/templates/project/order/add.html
+++ b/ruoyi-admin/src/main/resources/templates/project/order/add.html
@@ -768,7 +768,7 @@ ${
ele.catalogueAllPriceFormmat = ele.catalogueAllPrice ? formatAmountNumber(ele.catalogueAllPrice) : ""
ele.allPriceFormmat = ele.allPrice ? formatAmountNumber(ele.allPrice) : ""
ele.discountFormat = ele.discount ? (ele.discount*100).toFixed(2) : ""
- ele.guidanceDiscountFormat = ele.guidanceDiscount ? ele.guidanceDiscount*100 : ""
+ ele.guidanceDiscountFormat = ele.guidanceDiscount ? (ele.guidanceDiscount*100).toFixed(2) : ""
addProduct(ele)
}) : ''
data.hardwareProjectProductInfoList ? data.hardwareProjectProductInfoList.forEach((ele) => {
@@ -777,7 +777,7 @@ ${
ele.catalogueAllPriceFormmat = ele.catalogueAllPrice ? formatAmountNumber(ele.catalogueAllPrice) : ""
ele.allPriceFormmat = ele.allPrice ? formatAmountNumber(ele.allPrice) : ""
ele.discountFormat = ele.discount ? (ele.discount*100).toFixed(2) : ""
- ele.guidanceDiscountFormat = ele.guidanceDiscount ? ele.guidanceDiscount*100 : ""
+ ele.guidanceDiscountFormat = ele.guidanceDiscount ? (ele.guidanceDiscount*100).toFixed(2) : ""
addProduct2(ele)
}) : ''
data.maintenanceProjectProductInfoList ? data.maintenanceProjectProductInfoList.forEach((ele) => {
@@ -786,7 +786,7 @@ ${
ele.catalogueAllPriceFormmat = ele.catalogueAllPrice ? formatAmountNumber(ele.catalogueAllPrice) : ""
ele.allPriceFormmat = ele.allPrice ? formatAmountNumber(ele.allPrice) : ""
ele.discountFormat = ele.discount ? (ele.discount*100).toFixed(2) : ""
- ele.guidanceDiscountFormat = ele.guidanceDiscount ? ele.guidanceDiscount*100 : ""
+ ele.guidanceDiscountFormat = ele.guidanceDiscount ? (ele.guidanceDiscount*100).toFixed(2) : ""
addProduct3(ele)
}) : ''
return
@@ -802,7 +802,7 @@ ${
ele.catalogueAllPriceFormmat = ele.catalogueAllPrice ? formatAmountNumber(ele.catalogueAllPrice) : ""
ele.allPriceFormmat = ele.allPrice ? formatAmountNumber(ele.allPrice) : ""
ele.discountFormat = ele.discount ? (ele.discount*100).toFixed(2) : ""
- ele.guidanceDiscountFormat = ele.guidanceDiscount ? ele.guidanceDiscount*100 : ""
+ ele.guidanceDiscountFormat = ele.guidanceDiscount ? (ele.guidanceDiscount*100).toFixed(2) : ""
addProduct(ele)
}) : ''
res.data.hardwareProjectProductInfoList ? res.data.hardwareProjectProductInfoList.forEach((ele) => {
@@ -811,7 +811,7 @@ ${
ele.catalogueAllPriceFormmat = ele.catalogueAllPrice ? formatAmountNumber(ele.catalogueAllPrice) : ""
ele.allPriceFormmat = ele.allPrice ? formatAmountNumber(ele.allPrice) : ""
ele.discountFormat = ele.discount ? (ele.discount*100).toFixed(2) : ""
- ele.guidanceDiscountFormat = ele.guidanceDiscount ? ele.guidanceDiscount*100 : ""
+ ele.guidanceDiscountFormat = ele.guidanceDiscount ? (ele.guidanceDiscount*100).toFixed(2) : ""
addProduct2(ele)
}) : ''
res.data.maintenanceProjectProductInfoList ? res.data.maintenanceProjectProductInfoList.forEach((ele) => {
@@ -820,7 +820,7 @@ ${
ele.catalogueAllPriceFormmat = ele.catalogueAllPrice ? formatAmountNumber(ele.catalogueAllPrice) : ""
ele.allPriceFormmat = ele.allPrice ? formatAmountNumber(ele.allPrice) : ""
ele.discountFormat = ele.discount ? (ele.discount*100).toFixed(2) : ""
- ele.guidanceDiscountFormat = ele.guidanceDiscount ? ele.guidanceDiscount*100 : ""
+ ele.guidanceDiscountFormat = ele.guidanceDiscount ? (ele.guidanceDiscount*100).toFixed(2) : ""
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 089725d4..347ef861 100644
--- a/ruoyi-admin/src/main/resources/templates/project/order/edit.html
+++ b/ruoyi-admin/src/main/resources/templates/project/order/edit.html
@@ -794,7 +794,7 @@ ${
ele.catalogueAllPriceFormmat = ele.catalogueAllPrice ? formatAmountNumber(ele.catalogueAllPrice) : ""
ele.allPriceFormmat = ele.allPrice ? formatAmountNumber(ele.allPrice) : ""
ele.discountFormat = ele.discount ? (ele.discount*100).toFixed(2) : ""
- ele.guidanceDiscountFormat = ele.guidanceDiscount ? ele.guidanceDiscount*100 : ""
+ ele.guidanceDiscountFormat = ele.guidanceDiscount ? (ele.guidanceDiscount*100).toFixed(2) : ""
addProduct(ele)
}) : '';
res.data.hardwareProjectProductInfoList ? res.data.hardwareProjectProductInfoList.forEach((ele) => {
@@ -803,7 +803,7 @@ ${
ele.catalogueAllPriceFormmat = ele.catalogueAllPrice ? formatAmountNumber(ele.catalogueAllPrice) : ""
ele.allPriceFormmat = ele.allPrice ? formatAmountNumber(ele.allPrice) : ""
ele.discountFormat = ele.discount ? (ele.discount*100).toFixed(2) : ""
- ele.guidanceDiscountFormat = ele.guidanceDiscount ? ele.guidanceDiscount*100 : ""
+ ele.guidanceDiscountFormat = ele.guidanceDiscount ? (ele.guidanceDiscount*100).toFixed(2) : ""
addProduct2(ele)
}) : '';
res.data.maintenanceProjectProductInfoList ? res.data.maintenanceProjectProductInfoList.forEach((ele) => {
@@ -812,7 +812,7 @@ ${
ele.catalogueAllPriceFormmat = ele.catalogueAllPrice ? formatAmountNumber(ele.catalogueAllPrice) : ""
ele.allPriceFormmat = ele.allPrice ? formatAmountNumber(ele.allPrice) : ""
ele.discountFormat = ele.discount ? (ele.discount*100).toFixed(2) : ""
- ele.guidanceDiscountFormat = ele.guidanceDiscount ? ele.guidanceDiscount*100 : ""
+ ele.guidanceDiscountFormat = ele.guidanceDiscount ? (ele.guidanceDiscount*100).toFixed(2) : ""
addProduct3(ele)
}) : '';
window.localStorage.removeItem('getDetail')
diff --git a/ruoyi-admin/src/main/resources/templates/system/product/edit.html b/ruoyi-admin/src/main/resources/templates/system/product/edit.html
index 8b52fd66..0f3398cd 100644
--- a/ruoyi-admin/src/main/resources/templates/system/product/edit.html
+++ b/ruoyi-admin/src/main/resources/templates/system/product/edit.html
@@ -122,7 +122,7 @@
}
let guidanceDiscount=[[${productInfo.guidanceDiscount}]]
if (guidanceDiscount){
- $('#guidanceDiscountFormat').val(guidanceDiscount*100)
+ $('#guidanceDiscountFormat').val((guidanceDiscount*100).toFixed(2))
}
})