From b4beb49f91cfc6f214996e22b1f17e73eef79591 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=82=E7=B3=96?= Date: Sat, 31 Jan 2026 14:39:53 +0800 Subject: [PATCH] =?UTF-8?q?feat(utils):=20=E6=B7=BB=E5=8A=A0=E6=95=B0?= =?UTF-8?q?=E5=AD=97=E6=A0=BC=E5=BC=8F=E5=8C=96=E5=B7=A5=E5=85=B7=E5=87=BD?= =?UTF-8?q?=E6=95=B0=E5=B9=B6=E5=BA=94=E7=94=A8=E8=87=B3=E5=A4=9A=E4=B8=AA?= =?UTF-8?q?=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加 formatDecimal 函数用于格式化小数显示,去除末尾无效0和孤立小数点 在库存管理、采购、出入库等模块中应用该格式化函数,统一数字显示格式 调整仪表盘统计数据的精度显示为整数 优化采购截止日期的显示逻辑,增加状态判断和剩余天数计算 --- gear-ui3/src/components/RawSelector/index.vue | 9 ++- gear-ui3/src/components/Renderer/Raw.vue | 3 +- gear-ui3/src/utils/gear.js | 18 +++++ gear-ui3/src/views/mat/components/bom.vue | 8 +- gear-ui3/src/views/mat/components/in.vue | 20 ++++- gear-ui3/src/views/mat/dashboard/index.vue | 21 ++++-- gear-ui3/src/views/mat/in/index.vue | 19 ++++- gear-ui3/src/views/mat/out/index.vue | 7 +- gear-ui3/src/views/mat/product/index.vue | 13 +++- gear-ui3/src/views/mat/purchase/index.vue | 74 ++++++++++++++++--- gear-ui3/src/views/mat/raw/index.vue | 13 +++- 11 files changed, 175 insertions(+), 30 deletions(-) diff --git a/gear-ui3/src/components/RawSelector/index.vue b/gear-ui3/src/components/RawSelector/index.vue index 379f063..614ee6a 100644 --- a/gear-ui3/src/components/RawSelector/index.vue +++ b/gear-ui3/src/components/RawSelector/index.vue @@ -18,8 +18,12 @@ - - + + + + @@ -39,6 +43,7 @@ import { ref, computed, watch, onMounted } from 'vue'; import { listMaterial, getMaterial } from '@/api/mat/material'; import { ElMessage } from 'element-plus'; +import { formatDecimal } from '@/utils/gear' // 双向绑定物料ID const materialId = defineModel({ diff --git a/gear-ui3/src/components/Renderer/Raw.vue b/gear-ui3/src/components/Renderer/Raw.vue index fb7484d..5492374 100644 --- a/gear-ui3/src/components/Renderer/Raw.vue +++ b/gear-ui3/src/components/Renderer/Raw.vue @@ -8,7 +8,7 @@ {{ formattedData.spec }} {{ formattedData.model }} {{ formattedData.factory }} - {{ formattedData.currentStock }} + {{ formatDecimal(formattedData.currentStock) }} {{ formattedData.unit }} {{ formattedData.remark }} @@ -17,6 +17,7 @@