Commit 2151f2e3 authored by youjie's avatar youjie

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

parent 27427b12
...@@ -2409,7 +2409,7 @@ import SpecialList from '../SalesModule/SpecialList.vue'; ...@@ -2409,7 +2409,7 @@ import SpecialList from '../SalesModule/SpecialList.vue';
if (!isNaN(rate)) { if (!isNaN(rate)) {
let num = (numberC * price) * rate; let num = (numberC * price) * rate;
num = Math.round(num * 100) / 100; 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) this.msg.detailList[i - 1].bTotalPriceTo = this.$commonUtils.addCommas(num)
} }
} }
...@@ -2434,7 +2434,7 @@ import SpecialList from '../SalesModule/SpecialList.vue'; ...@@ -2434,7 +2434,7 @@ import SpecialList from '../SalesModule/SpecialList.vue';
if (!isNaN(rate)) { if (!isNaN(rate)) {
let num = (numberC * price) * rate; let num = (numberC * price) * rate;
num = Math.round(num * 100) / 100; num = Math.round(num * 100) / 100;
this.detailList.bTotalPrice = num; this.detailList.bTotalPrice = num.toFixed(2);
this.detailList.bTotalPriceTo = this.$commonUtils.addCommas(num) this.detailList.bTotalPriceTo = this.$commonUtils.addCommas(num)
} }
} }
...@@ -2697,7 +2697,7 @@ import SpecialList from '../SalesModule/SpecialList.vue'; ...@@ -2697,7 +2697,7 @@ import SpecialList from '../SalesModule/SpecialList.vue';
if (!isNaN(rate)) { if (!isNaN(rate)) {
let num = (numberC * price) * rate; let num = (numberC * price) * rate;
num = Math.round(num * 100) / 100; num = Math.round(num * 100) / 100;
item.bTotalPrice = num; item.bTotalPrice = num.toFixed(2);
item.bTotalPriceTo = this.$commonUtils.addCommas(num) item.bTotalPriceTo = this.$commonUtils.addCommas(num)
} }
} }
...@@ -2821,7 +2821,7 @@ import SpecialList from '../SalesModule/SpecialList.vue'; ...@@ -2821,7 +2821,7 @@ import SpecialList from '../SalesModule/SpecialList.vue';
x.rate = x.Rate; x.rate = x.Rate;
let num = (x.Number * x.UnitPrice) * x.Rate; let num = (x.Number * x.UnitPrice) * x.Rate;
num = Math.round(num * 100) / 100; num = Math.round(num * 100) / 100;
x.bTotalPrice = num; x.bTotalPrice = num.toFixed(2);
x.Money = Math.round(x.Money * 100) / 100; x.Money = Math.round(x.Money * 100) / 100;
x.yTotalPriceTo = this.$commonUtils.addCommas(Math.round(x.yTotalPrice * 100) / 100); x.yTotalPriceTo = this.$commonUtils.addCommas(Math.round(x.yTotalPrice * 100) / 100);
......
...@@ -2114,7 +2114,7 @@ ...@@ -2114,7 +2114,7 @@
if (!isNaN(rate)) { if (!isNaN(rate)) {
let num = (numberC * price) * rate; let num = (numberC * price) * rate;
num = Math.round(num * 100) / 100; 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); this.msg.detailList[i - 1].bTotalPriceTo = this.$commonUtils.addCommas(num);
}; };
} }
...@@ -2161,7 +2161,7 @@ ...@@ -2161,7 +2161,7 @@
if (!isNaN(rate)) { if (!isNaN(rate)) {
let num = (numberC * price) * rate; let num = (numberC * price) * rate;
num = Math.round(num * 100) / 100; num = Math.round(num * 100) / 100;
this.detailList.bTotalPrice = num; this.detailList.bTotalPrice = num.toFixed(2);
this.detailList.bTotalPriceTo = this.$commonUtils.addCommas(num); this.detailList.bTotalPriceTo = this.$commonUtils.addCommas(num);
}; };
} }
...@@ -2279,7 +2279,7 @@ ...@@ -2279,7 +2279,7 @@
x.yTotalPrice = x.Number * x.UnitPrice; x.yTotalPrice = x.Number * x.UnitPrice;
let num = (x.Number * x.UnitPrice) * x.Rate; let num = (x.Number * x.UnitPrice) * x.Rate;
num = Math.round(num * 100) / 100; num = Math.round(num * 100) / 100;
x.bTotalPrice = num; x.bTotalPrice = num.toFixed(2);
x.Money = Math.round(x.Money * 100) / 100; x.Money = Math.round(x.Money * 100) / 100;
x.yTotalPriceTo = this.$commonUtils.addCommas(Math.round(x.yTotalPrice * 100) / 100); x.yTotalPriceTo = this.$commonUtils.addCommas(Math.round(x.yTotalPrice * 100) / 100);
x.bTotalPriceTo = this.$commonUtils.addCommas(num); x.bTotalPriceTo = this.$commonUtils.addCommas(num);
......
...@@ -182,9 +182,9 @@ export default { ...@@ -182,9 +182,9 @@ export default {
// x.Money = Math.round(x.Money * 100) / 100 // x.Money = Math.round(x.Money * 100) / 100
let FractionalPart = String(x.Money).split('.') let FractionalPart = String(x.Money).split('.')
if(FractionalPart.length>1&&FractionalPart[1].length>3&&FractionalPart[1].slice(3,4)>5){ 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{ }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 x.OriginalMoney = Math.round(x.OriginalMoney * 100) / 100
this.currentMoney += parseFloat(x.OriginalMoney); this.currentMoney += parseFloat(x.OriginalMoney);
...@@ -202,9 +202,9 @@ export default { ...@@ -202,9 +202,9 @@ export default {
x.Money = x.Rate*x.OriginalMoney x.Money = x.Rate*x.OriginalMoney
let FractionalPart = String(x.Money).split('.') let FractionalPart = String(x.Money).split('.')
if(FractionalPart.length>1&&FractionalPart[1].length>3&&FractionalPart[1].slice(3,4)>5){ 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{ }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 x.OriginalMoney = Math.round(x.OriginalMoney * 100) / 100
...@@ -249,7 +249,9 @@ export default { ...@@ -249,7 +249,9 @@ export default {
let TCID = data.TCIDList.length > 0 ? data.TCIDList[0] : 0 let TCID = data.TCIDList.length > 0 ? data.TCIDList[0] : 0
this.financeinfo_post_GetList(TCID); this.financeinfo_post_GetList(TCID);
} }
setTimeout(()=>{
this.calculation() this.calculation()
},300)
} }
}, err => {}) }, err => {})
}, },
......
...@@ -148,9 +148,9 @@ export default { ...@@ -148,9 +148,9 @@ export default {
let FractionalPart = String(x.Money).split('.') let FractionalPart = String(x.Money).split('.')
if(FractionalPart.length>1&&FractionalPart[1].length>3&&FractionalPart[1].slice(3,4)>5){ 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{ }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 x.OriginalMoney = Math.round(x.OriginalMoney * 100) / 100
...@@ -170,9 +170,9 @@ export default { ...@@ -170,9 +170,9 @@ export default {
let FractionalPart = String(x.Money).split('.') let FractionalPart = String(x.Money).split('.')
if(FractionalPart.length>1&&FractionalPart[1].length>3&&FractionalPart[1].slice(3,4)>5){ 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{ }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 x.OriginalMoney = Math.round(x.OriginalMoney * 100) / 100
...@@ -210,7 +210,9 @@ export default { ...@@ -210,7 +210,9 @@ export default {
this.benMoney2 = 0 this.benMoney2 = 0
this.loading=false this.loading=false
this.$set(this.$data,"GetDetail",data); this.$set(this.$data,"GetDetail",data);
setTimeout(()=>{
this.calculation() this.calculation()
},300)
} }
}, err => {}) }, 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