fix(wms): 修复库存数量比较的精度问题

- 在库存数量比较时使用 parseFloat 进行类型转换
- 优化了库存报警的判断逻辑,提高了精度准确性
master
zangch@mesnac.com 3 months ago
parent bd84847ab1
commit 7e4720c9a3

@ -86,11 +86,11 @@
<!-- <el-table-column label="库位编码" align="center" prop="locationCode" v-if="columns[4].visible"/> -->
<el-table-column label="物料编码" align="center" prop="materialCode" />
<el-table-column label="物料名称" align="center" prop="materialName" />
<el-table-column label="库存数量" align="center" prop="inventoryQty" >
<el-table-column label="库存数量" align="center" prop="inventoryQty">
<template #default="scope">
<el-tooltip
v-if="scope.row.inventoryQty > scope.row.maxStockAmount || scope.row.inventoryQty < scope.row.minStockAmount"
:content="scope.row.inventoryQty > scope.row.maxStockAmount ? '库存高于上限' : '库存低于下限'"
v-if="parseFloat(scope.row.inventoryQty) > parseFloat(scope.row.maxStockAmount) || parseFloat(scope.row.inventoryQty) < parseFloat(scope.row.minStockAmount)"
:content="parseFloat(scope.row.inventoryQty) > parseFloat(scope.row.maxStockAmount) ? '库存高于上限' : '库存低于下限'"
placement="top"
>
<span :class="{ 'text-red-500': true }">{{ scope.row.inventoryQty }}</span>
@ -392,13 +392,12 @@ const getMaterialCategorySelect = async () => {
};
const getRowClass = (row: any) => {
if (row.row.inventoryQty > row.row.maxStockAmount || row.row.inventoryQty < row.row.minStockAmount) {
if (parseFloat(row.row.inventoryQty) > parseFloat(row.row.maxStockAmount) || parseFloat(row.row.inventoryQty) < parseFloat(row.row.minStockAmount)) {
return 'alarm-row';
}
return '';
};
onMounted(() => {
getMaterialCategorySelect();
getBaseWarehouseListsss();

Loading…
Cancel
Save