From 9f3bc47b98cbc51df7cfcea94d4aa0c35f40cbc5 Mon Sep 17 00:00:00 2001
From: yuan <123@>
Date: 星期二, 13 十月 2026 14:09:06 +0800
Subject: [PATCH] feat: 添加数字格式化工具,支持去掉小数末尾多余的 0 和四舍五入功能
---
src/views/salesManagement/salesQuotation/index.vue | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/views/salesManagement/salesQuotation/index.vue b/src/views/salesManagement/salesQuotation/index.vue
index 6c9443b..a2c7482 100644
--- a/src/views/salesManagement/salesQuotation/index.vue
+++ b/src/views/salesManagement/salesQuotation/index.vue
@@ -65,7 +65,7 @@
</el-table-column>
<el-table-column prop="totalAmount" label="鎶ヤ环閲戦" width="120">
<template #default="scope">
- 楼{{ scope.row.totalAmount.toFixed(6) }}
+ 楼{{ trimZeros(scope.row.totalAmount, 6) }}
</template>
</el-table-column>
<el-table-column label="鎿嶄綔" width="200" fixed="right" align="center">
@@ -267,7 +267,7 @@
<!-- <el-tag :type="getStatusType(currentQuotation.status)">{{ currentQuotation.status }}</el-tag>-->
<!-- </el-descriptions-item>-->
<el-descriptions-item label="鎶ヤ环鎬婚" :span="2">
- <span style="font-size: 18px; color: #e6a23c; font-weight: bold;">楼{{ currentQuotation.totalAmount?.toFixed(6) }}</span>
+ <span style="font-size: 18px; color: #e6a23c; font-weight: bold;">楼{{ trimZeros(currentQuotation.totalAmount, 6) }}</span>
</el-descriptions-item>
</el-descriptions>
@@ -279,7 +279,7 @@
<el-table-column prop="unit" label="鍗曚綅" />
<el-table-column prop="unitPrice" label="鍗曚环">
<template #default="scope">
- 楼{{ scope.row.unitPrice.toFixed(6) }}
+ 楼{{ trimZeros(scope.row.unitPrice, 6) }}
</template>
</el-table-column>
</el-table>
@@ -303,6 +303,7 @@
import {modelList, productTreeList} from "@/api/basicData/product.js";
import {listCustomer} from "@/api/basicData/customer.js";
import { userListNoPage } from "@/api/system/user.js";
+import { trimZeros } from "@/utils/formatNumber.js";
// 鍝嶅簲寮忔暟鎹�
const loading = ref(false)
--
Gitblit v1.9.3