进销存汇总数优化,保留两位小数,四舍五入

This commit is contained in:
季圣华
2023-05-14 21:16:39 +08:00
parent cb2a82b17b
commit b744796523
2 changed files with 5 additions and 13 deletions

View File

@@ -213,16 +213,8 @@
param.monthTime = this.queryParam.monthTime;
getAction(this.url.totalCountMoney, param).then((res)=>{
if(res && res.code === 200) {
let stock = res.data.totalStock.toString();
let count = res.data.totalCount.toString();
if (stock.lastIndexOf('.') > -1) {
stock = stock.substring(0, stock.lastIndexOf('.') + 3);
}
if (count.lastIndexOf('.') > -1) {
count = count.substring(0, count.lastIndexOf('.') + 3);
}
this.totalStockStr = stock;
this.totalCountMoneyStr = count;
this.totalStockStr = res.data.totalStock.toFixed(2)
this.totalCountMoneyStr = res.data.totalCount.toFixed(2)
}
})
},

View File

@@ -238,9 +238,9 @@
this.dataSource = res.data.rows;
this.ipagination.total = res.data.total;
this.tableAddTotalRow(this.columns, this.dataSource)
this.currentStock = res.data.currentStock.toFixed(2);
this.currentStockPrice = res.data.currentStockPrice.toFixed(2);
this.currentWeight = res.data.currentWeight.toFixed(2);
this.currentStock = res.data.currentStock.toFixed(2)
this.currentStockPrice = res.data.currentStockPrice.toFixed(2)
this.currentWeight = res.data.currentWeight.toFixed(2)
}
if(res.code===510){
this.$message.warning(res.data)