feat(utils): 添加数字格式化工具函数并应用至多个组件

添加 formatDecimal 函数用于格式化小数显示,去除末尾无效0和孤立小数点
在库存管理、采购、出入库等模块中应用该格式化函数,统一数字显示格式
调整仪表盘统计数据的精度显示为整数
优化采购截止日期的显示逻辑,增加状态判断和剩余天数计算
This commit is contained in:
砂糖
2026-01-31 14:39:53 +08:00
parent 42f6f83c3a
commit b4beb49f91
11 changed files with 175 additions and 30 deletions

View File

@@ -25,7 +25,11 @@
<raw :data="scope.row" :materialId="scope.row.materialId" />
</template>
</el-table-column>
<el-table-column label="所需数量" align="center" prop="materialNum" />
<el-table-column label="所需数量" align="center" prop="materialNum">
<template #default="scope">
{{ formatDecimal(scope.row.materialNum) }}
</template>
</el-table-column>
<!-- <el-table-column label="配料排序 用于前端展示顺序" align="center" prop="sort" /> -->
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
@@ -73,6 +77,8 @@
import { listProductMaterialRelation, getProductMaterialRelation, delProductMaterialRelation, addProductMaterialRelation, updateProductMaterialRelation } from "@/api/mat/productMaterialRelation";
import RawSelector from '@/components/RawSelector/index.vue'
import Raw from '@/components/Renderer/Raw.vue'
import { formatDecimal } from '@/utils/gear'
const { proxy } = getCurrentInstance();
const productMaterialRelationList = ref([]);