Commit 12007e86 authored by youjie's avatar youjie

四舍五入

parent 4c6f7268
......@@ -178,14 +178,16 @@ export default {
this.GetDetail.DetailList.forEach(x=>{
x.UnitPrice = this.$commonUtils.addCommas(Math.round(x.UnitPrice * 100) / 100)
x.Money = x.Rate*x.OriginalMoney
x.Money = x.Money.toFixed(2)
// x.Money = x.Money.toFixed(2)
// x.Money = Math.round(x.Money * 100) / 100
x.OriginalMoney = Math.round(x.OriginalMoney * 100) / 100
this.currentMoney += parseFloat(x.OriginalMoney);
Money = parseFloat(x.Money)*100
benMoney += Money
this.benMoney = benMoney/100;
x.Money = this.RoundItUp(x.Money)
x.OriginalMoney = Math.round(x.OriginalMoney * 100) / 100
this.currentMoney += parseFloat(x.OriginalMoney);
Money = parseFloat(x.Money)*100
benMoney += Money
this.benMoney = benMoney/100;
})
// 有收款账户需对比总金额
if(this.GetDetail.CashierDetail&&this.GetDetail.CashierDetail.length>0){
......@@ -195,8 +197,9 @@ export default {
this.GetDetail.CashierDetail.forEach(x=>{
x.UnitPrice = this.$commonUtils.addCommas(Math.round(x.UnitPrice * 100) / 100)
x.Money = x.Rate*x.OriginalMoney
// x.Money = Math.round(x.Money)
x.Money = x.Money.toFixed(2)
x.Money = this.RoundItUp(x.Money)
x.OriginalMoney = Math.round(x.OriginalMoney * 100) / 100
Money1 = parseFloat(x.Money)*100
benMoney1 += Money1
......@@ -326,6 +329,9 @@ export default {
let userInfo = this.getLocalStorage();
this.EmployeeId = userInfo.EmployeeId;
this.Financial_post_GetDetail(this.ID);
},
watch: { // 监听参数变化
GetDetail: {
......
......@@ -145,14 +145,14 @@ export default {
this.GetDetail.DetailList.forEach(x=>{
x.UnitPrice = this.$commonUtils.addCommas(Math.round(x.UnitPrice * 100) / 100)
x.Money = x.Rate*x.OriginalMoney
x.Money = x.Money.toFixed(2)
// x.Money = Math.round(x.Money * 100) / 100
x.OriginalMoney = Math.round(x.OriginalMoney * 100) / 100
this.currentMoney += parseFloat(x.OriginalMoney);
Money = parseFloat(x.Money)*100
benMoney += Money
this.benMoney = benMoney/100;
x.Money = this.RoundItUp(x.Money)
x.OriginalMoney = Math.round(x.OriginalMoney * 100) / 100
this.currentMoney += parseFloat(x.OriginalMoney);
Money = parseFloat(x.Money)*100
benMoney += Money
this.benMoney = benMoney/100;
})
// 有收款账户需对比总金额
if(this.GetDetail.CashierDetail&&this.GetDetail.CashierDetail.length>0){
......@@ -162,7 +162,9 @@ export default {
this.GetDetail.CashierDetail.forEach(x=>{
x.UnitPrice = this.$commonUtils.addCommas(Math.round(x.UnitPrice * 100) / 100)
x.Money = x.Rate*x.OriginalMoney
x.Money = x.Money.toFixed(2)
x.Money = this.RoundItUp(x.Money)
x.OriginalMoney = Math.round(x.OriginalMoney * 100) / 100
Money1 = parseFloat(x.Money)*100
benMoney1 += Money1
......
......@@ -120,7 +120,7 @@ export default {
let crmUrl = ""; //crm API
let locationName = window.location.hostname;
domainUrl = "http://192.168.10.25:8083"; // 刘东电脑
domainUrl = "http://192.168.10.25:8083";
domainUrl = "http://192.168.10.226:8015";
// domainUrl = "http://reborn.oytour.com";
let crmLocalFileStreamDownLoadUrl = "";
......@@ -130,7 +130,8 @@ export default {
//商城API
mallUrl = "http://192.168.20.13:8088";
lxymallUrl = "http://192.168.20.13:8088";
crmUrl = "http://192.168.10.36:8098"
// crmUrl = "http://192.168.10.36:8098"
crmUrl = "http://crm.oytour.com"
if (locationName.indexOf('testerp.oytour') !== -1) {
domainUrl = "http://testapi.oytour.com";
mallUrl = "https://mallapi.oytour.com";
......@@ -276,12 +277,12 @@ export default {
this.$router.push({
path: '/signature'
})
}
}
if (this.$route.path.toLowerCase() == "/signname") {
this.$router.push({
path: '/signname'
})
}
}
else if (this.$route.path == "/clientConfirm") {
let TCID = this.$route.query.TCID;
let orderID = this.$route.query.orderID;
......@@ -1713,5 +1714,14 @@ export default {
}
}
}
// 多位小数点四舍五入
Vue.prototype.RoundItUp = function (Money) {
let FractionalPart = String(Money).split('.')
if(FractionalPart&&FractionalPart[1]&&FractionalPart[1].length>2){
return Money = (parseFloat(Money.toFixed(3))+0.001).toFixed(2)
}else{
return Money = Math.round(Money * 100) / 100
}
}
}
}
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