进销存汇总数优化,保留两位小数,四舍五入
This commit is contained in:
@@ -213,16 +213,8 @@
|
|||||||
param.monthTime = this.queryParam.monthTime;
|
param.monthTime = this.queryParam.monthTime;
|
||||||
getAction(this.url.totalCountMoney, param).then((res)=>{
|
getAction(this.url.totalCountMoney, param).then((res)=>{
|
||||||
if(res && res.code === 200) {
|
if(res && res.code === 200) {
|
||||||
let stock = res.data.totalStock.toString();
|
this.totalStockStr = res.data.totalStock.toFixed(2)
|
||||||
let count = res.data.totalCount.toString();
|
this.totalCountMoneyStr = res.data.totalCount.toFixed(2)
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -238,9 +238,9 @@
|
|||||||
this.dataSource = res.data.rows;
|
this.dataSource = res.data.rows;
|
||||||
this.ipagination.total = res.data.total;
|
this.ipagination.total = res.data.total;
|
||||||
this.tableAddTotalRow(this.columns, this.dataSource)
|
this.tableAddTotalRow(this.columns, this.dataSource)
|
||||||
this.currentStock = res.data.currentStock.toFixed(2);
|
this.currentStock = res.data.currentStock.toFixed(2)
|
||||||
this.currentStockPrice = res.data.currentStockPrice.toFixed(2);
|
this.currentStockPrice = res.data.currentStockPrice.toFixed(2)
|
||||||
this.currentWeight = res.data.currentWeight.toFixed(2);
|
this.currentWeight = res.data.currentWeight.toFixed(2)
|
||||||
}
|
}
|
||||||
if(res.code===510){
|
if(res.code===510){
|
||||||
this.$message.warning(res.data)
|
this.$message.warning(res.data)
|
||||||
|
|||||||
Reference in New Issue
Block a user