Commit 9bfc0514 authored by youjie's avatar youjie

修改汇率bug修复

parent b9836316
...@@ -171,7 +171,6 @@ export default { ...@@ -171,7 +171,6 @@ export default {
}, },
calculation(i){ calculation(i){
if(!i){
let Money = 0 let Money = 0
let benMoney = 0 let benMoney = 0
this.currentMoney = 0 this.currentMoney = 0
...@@ -188,22 +187,22 @@ export default { ...@@ -188,22 +187,22 @@ export default {
benMoney += Money benMoney += Money
this.benMoney = benMoney/100; this.benMoney = benMoney/100;
}) })
}else{ // 有收款账户需对比总金额
let Money = 0 if(this.GetDetail.CashierDetail&&this.GetDetail.CashierDetail.length>0){
let benMoney = 0 let Money1 = 0
this.benMoney2 = 0 let benMoney1 = 0
this.GetDetail.CashierDetail.forEach(x=>{ this.benMoney2 = 0
x.UnitPrice = this.$commonUtils.addCommas(Math.round(x.UnitPrice * 100) / 100) this.GetDetail.CashierDetail.forEach(x=>{
x.Money = x.Rate*x.OriginalMoney x.UnitPrice = this.$commonUtils.addCommas(Math.round(x.UnitPrice * 100) / 100)
// x.Money = Math.round(x.Money) x.Money = x.Rate*x.OriginalMoney
x.Money = x.Money.toFixed(2) // x.Money = Math.round(x.Money)
x.OriginalMoney = Math.round(x.OriginalMoney * 100) / 100 x.Money = x.Money.toFixed(2)
Money = parseFloat(x.Money)*100 x.OriginalMoney = Math.round(x.OriginalMoney * 100) / 100
benMoney += Money Money1 = parseFloat(x.Money)*100
this.benMoney2 = benMoney/100; benMoney1 += Money1
}) this.benMoney2 = benMoney1/100;
} })
}
}, },
Financial_post_GetDetail(id){ //获取单据详情 Financial_post_GetDetail(id){ //获取单据详情
...@@ -240,6 +239,7 @@ export default { ...@@ -240,6 +239,7 @@ 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);
} }
this.calculation()
} }
}, err => {}) }, err => {})
}, },
...@@ -330,15 +330,15 @@ export default { ...@@ -330,15 +330,15 @@ export default {
watch: { // 监听参数变化 watch: { // 监听参数变化
GetDetail: { GetDetail: {
handler: function(val, oldVal) { handler: function(val, oldVal) {
let isAmount = true // let isAmount = true
if(this.GetDetail.CashierDetail&&this.GetDetail.CashierDetail.length){ // if(this.GetDetail.CashierDetail&&this.GetDetail.CashierDetail.length){
if(this.benMoney2===this.benMoney){ // if(this.benMoney2===this.benMoney){
isAmount = false // isAmount = false
}else{ // }else{
isAmount = true // isAmount = true
} // }
} // }
this.$emit('getList',val,isAmount) this.$emit('getList',val,false)
}, },
deep: true, deep: true,
immediate: true immediate: true
......
...@@ -138,7 +138,6 @@ export default { ...@@ -138,7 +138,6 @@ export default {
}, },
calculation(i){ calculation(i){
if(!i){
let Money = 0 let Money = 0
let benMoney = 0 let benMoney = 0
this.currentMoney = 0 this.currentMoney = 0
...@@ -155,21 +154,21 @@ export default { ...@@ -155,21 +154,21 @@ export default {
benMoney += Money benMoney += Money
this.benMoney = benMoney/100; this.benMoney = benMoney/100;
}) })
}else{ // 有收款账户需对比总金额
let Money = 0 if(this.GetDetail.CashierDetail&&this.GetDetail.CashierDetail.length>0){
let benMoney = 0 let Money1 = 0
this.benMoney2 = 0 let benMoney1 = 0
this.GetDetail.CashierDetail.forEach(x=>{ this.benMoney2 = 0
x.UnitPrice = this.$commonUtils.addCommas(Math.round(x.UnitPrice * 100) / 100) this.GetDetail.CashierDetail.forEach(x=>{
x.Money = x.Rate*x.OriginalMoney x.UnitPrice = this.$commonUtils.addCommas(Math.round(x.UnitPrice * 100) / 100)
x.Money = x.Money.toFixed(2) x.Money = x.Rate*x.OriginalMoney
x.OriginalMoney = Math.round(x.OriginalMoney * 100) / 100 x.Money = x.Money.toFixed(2)
Money = parseFloat(x.Money)*100 x.OriginalMoney = Math.round(x.OriginalMoney * 100) / 100
benMoney += Money Money1 = parseFloat(x.Money)*100
this.benMoney2 = benMoney/100; benMoney1 += Money1
}) this.benMoney2 = benMoney1/100;
} })
}
}, },
Financial_post_GetDetail(id){ //获取单据详情 Financial_post_GetDetail(id){ //获取单据详情
if(!id) return; if(!id) return;
...@@ -199,6 +198,7 @@ export default { ...@@ -199,6 +198,7 @@ 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);
this.calculation()
} }
}, 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