Commit 2151f2e3 authored by youjie's avatar youjie

修改汇率组件, 制单页汇率 计算金额保留两位小数,四舍五入

parent 27427b12
......@@ -2409,7 +2409,7 @@ import SpecialList from '../SalesModule/SpecialList.vue';
if (!isNaN(rate)) {
let num = (numberC * price) * rate;
num = Math.round(num * 100) / 100;
this.msg.detailList[i - 1].bTotalPrice = num;
this.msg.detailList[i - 1].bTotalPrice = num.toFixed(2);
this.msg.detailList[i - 1].bTotalPriceTo = this.$commonUtils.addCommas(num)
}
}
......@@ -2434,7 +2434,7 @@ import SpecialList from '../SalesModule/SpecialList.vue';
if (!isNaN(rate)) {
let num = (numberC * price) * rate;
num = Math.round(num * 100) / 100;
this.detailList.bTotalPrice = num;
this.detailList.bTotalPrice = num.toFixed(2);
this.detailList.bTotalPriceTo = this.$commonUtils.addCommas(num)
}
}
......@@ -2697,7 +2697,7 @@ import SpecialList from '../SalesModule/SpecialList.vue';
if (!isNaN(rate)) {
let num = (numberC * price) * rate;
num = Math.round(num * 100) / 100;
item.bTotalPrice = num;
item.bTotalPrice = num.toFixed(2);
item.bTotalPriceTo = this.$commonUtils.addCommas(num)
}
}
......@@ -2821,7 +2821,7 @@ import SpecialList from '../SalesModule/SpecialList.vue';
x.rate = x.Rate;
let num = (x.Number * x.UnitPrice) * x.Rate;
num = Math.round(num * 100) / 100;
x.bTotalPrice = num;
x.bTotalPrice = num.toFixed(2);
x.Money = Math.round(x.Money * 100) / 100;
x.yTotalPriceTo = this.$commonUtils.addCommas(Math.round(x.yTotalPrice * 100) / 100);
......
......@@ -2114,7 +2114,7 @@
if (!isNaN(rate)) {
let num = (numberC * price) * rate;
num = Math.round(num * 100) / 100;
this.msg.detailList[i - 1].bTotalPrice = num;
this.msg.detailList[i - 1].bTotalPrice = num.toFixed(2);
this.msg.detailList[i - 1].bTotalPriceTo = this.$commonUtils.addCommas(num);
};
}
......@@ -2161,7 +2161,7 @@
if (!isNaN(rate)) {
let num = (numberC * price) * rate;
num = Math.round(num * 100) / 100;
this.detailList.bTotalPrice = num;
this.detailList.bTotalPrice = num.toFixed(2);
this.detailList.bTotalPriceTo = this.$commonUtils.addCommas(num);
};
}
......@@ -2279,7 +2279,7 @@
x.yTotalPrice = x.Number * x.UnitPrice;
let num = (x.Number * x.UnitPrice) * x.Rate;
num = Math.round(num * 100) / 100;
x.bTotalPrice = num;
x.bTotalPrice = num.toFixed(2);
x.Money = Math.round(x.Money * 100) / 100;
x.yTotalPriceTo = this.$commonUtils.addCommas(Math.round(x.yTotalPrice * 100) / 100);
x.bTotalPriceTo = this.$commonUtils.addCommas(num);
......
......@@ -182,9 +182,9 @@ export default {
// x.Money = Math.round(x.Money * 100) / 100
let FractionalPart = String(x.Money).split('.')
if(FractionalPart.length>1&&FractionalPart[1].length>3&&FractionalPart[1].slice(3,4)>5){
x.Money = this.RoundItUp(parseFloat(x.Money).toFixed(4))
x.Money = (x.Money).toFixed(2)//this.RoundItUp(parseFloat(x.Money).toFixed(4))
}else{
x.Money = this.RoundItUp(parseFloat(x.Money).toFixed(3))
x.Money = (x.Money).toFixed(2)//this.RoundItUp(parseFloat(x.Money).toFixed(3))
}
x.OriginalMoney = Math.round(x.OriginalMoney * 100) / 100
this.currentMoney += parseFloat(x.OriginalMoney);
......@@ -202,9 +202,9 @@ export default {
x.Money = x.Rate*x.OriginalMoney
let FractionalPart = String(x.Money).split('.')
if(FractionalPart.length>1&&FractionalPart[1].length>3&&FractionalPart[1].slice(3,4)>5){
x.Money = this.RoundItUp(parseFloat(x.Money).toFixed(4))
x.Money = (x.Money).toFixed(2)//this.RoundItUp(parseFloat(x.Money).toFixed(4))
}else{
x.Money = this.RoundItUp(parseFloat(x.Money).toFixed(3))
x.Money = (x.Money).toFixed(2)//this.RoundItUp(parseFloat(x.Money).toFixed(3))
}
x.OriginalMoney = Math.round(x.OriginalMoney * 100) / 100
......@@ -220,36 +220,38 @@ export default {
this.loading = true;
this.apipost('Financial_post_GetDetail',{ID:id}, res => {
if(res.data.resultCode == 1) {
let data = res.data.data;
let arrList = function(arr){
arr.forEach(x=>{
x.show = false
})
}
arrList(data.DetailList)
data.DetailList.forEach(x=>{
x.UnitPrice = this.$commonUtils.addCommas(Math.round(x.UnitPrice * 100) / 100)
x.Money = Math.round(x.Money * 100) / 100
x.OriginalMoney = Math.round(x.OriginalMoney * 100) / 100
this.currentMoney += parseFloat(x.OriginalMoney);
this.benMoney += parseFloat(x.Money);
})
this.currentMoney = Math.round(this.currentMoney * 100) / 100;
this.benMoney = Math.round(this.benMoney * 100) / 100;
this.$emit('headCallBack', this.currentMoney);
data.ChineseMoney = this.$commonUtils.changeMoneyToChinese(data.Money)
data.ChinesePayMoney = this.$commonUtils.changeMoneyToChinese(data.PayMoney)
data.PayMoney = this.$commonUtils.addCommas(Math.round(data.PayMoney * 100) / 100)
data.Money = this.$commonUtils.addCommas(Math.round(data.Money * 100) / 100)
data.AuditSteps.reverse()
this.GetDetail = data;
this.loading=false
this.Financial_post_GetCostTypeList(data.TemplateId, data.type);
if (id > 0) {
let TCID = data.TCIDList.length > 0 ? data.TCIDList[0] : 0
this.financeinfo_post_GetList(TCID);
}
this.calculation()
let data = res.data.data;
let arrList = function(arr){
arr.forEach(x=>{
x.show = false
})
}
arrList(data.DetailList)
data.DetailList.forEach(x=>{
x.UnitPrice = this.$commonUtils.addCommas(Math.round(x.UnitPrice * 100) / 100)
x.Money = Math.round(x.Money * 100) / 100
x.OriginalMoney = Math.round(x.OriginalMoney * 100) / 100
this.currentMoney += parseFloat(x.OriginalMoney);
this.benMoney += parseFloat(x.Money);
})
this.currentMoney = Math.round(this.currentMoney * 100) / 100;
this.benMoney = Math.round(this.benMoney * 100) / 100;
this.$emit('headCallBack', this.currentMoney);
data.ChineseMoney = this.$commonUtils.changeMoneyToChinese(data.Money)
data.ChinesePayMoney = this.$commonUtils.changeMoneyToChinese(data.PayMoney)
data.PayMoney = this.$commonUtils.addCommas(Math.round(data.PayMoney * 100) / 100)
data.Money = this.$commonUtils.addCommas(Math.round(data.Money * 100) / 100)
data.AuditSteps.reverse()
this.GetDetail = data;
this.loading=false
this.Financial_post_GetCostTypeList(data.TemplateId, data.type);
if (id > 0) {
let TCID = data.TCIDList.length > 0 ? data.TCIDList[0] : 0
this.financeinfo_post_GetList(TCID);
}
setTimeout(()=>{
this.calculation()
},300)
}
}, err => {})
},
......
......@@ -148,9 +148,9 @@ export default {
let FractionalPart = String(x.Money).split('.')
if(FractionalPart.length>1&&FractionalPart[1].length>3&&FractionalPart[1].slice(3,4)>5){
x.Money = this.RoundItUp(parseFloat(x.Money).toFixed(4))
x.Money = (x.Money).toFixed(2)//this.RoundItUp(parseFloat(x.Money).toFixed(4))
}else{
x.Money = this.RoundItUp(parseFloat(x.Money).toFixed(3))
x.Money = (x.Money).toFixed(2)//this.RoundItUp(parseFloat(x.Money).toFixed(3))
}
x.OriginalMoney = Math.round(x.OriginalMoney * 100) / 100
......@@ -170,9 +170,9 @@ export default {
let FractionalPart = String(x.Money).split('.')
if(FractionalPart.length>1&&FractionalPart[1].length>3&&FractionalPart[1].slice(3,4)>5){
x.Money = this.RoundItUp(parseFloat(x.Money).toFixed(4))
x.Money = (x.Money).toFixed(2)//this.RoundItUp(parseFloat(x.Money).toFixed(4))
}else{
x.Money = this.RoundItUp(parseFloat(x.Money).toFixed(3))
x.Money = (x.Money).toFixed(2)//this.RoundItUp(parseFloat(x.Money).toFixed(3))
}
x.OriginalMoney = Math.round(x.OriginalMoney * 100) / 100
......@@ -210,7 +210,9 @@ export default {
this.benMoney2 = 0
this.loading=false
this.$set(this.$data,"GetDetail",data);
this.calculation()
setTimeout(()=>{
this.calculation()
},300)
}
}, err => {})
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment