Commit 0db4acd0 authored by 我在何方's avatar 我在何方

收款单修复

parent 9f8dd866
...@@ -514,14 +514,15 @@ export default { ...@@ -514,14 +514,15 @@ export default {
}, },
WriteOffProportion(){ WriteOffProportion(){
let total = 0 let total = 0
let amountTotal = 0 let amountTotal = this.form.receiptAccountList.find(item=>item.type=='total').writeOffAmount
this.detailed.forEach(item => { this.detailed.forEach(item => {
if(item.status){ // if(item.status){
amountTotal = NP.plus(amountTotal, item.writeOffAmount) // amountTotal = NP.plus(amountTotal, item.writeOffAmount)
} // }
total = NP.plus(total, item.writeOffAmount) total = NP.plus(total, item.writeOffAmount)
}) })
let portion = NP.divide(amountTotal,total) let portion = NP.divide(total,amountTotal)
return (portion*100).toFixed(2) return (portion*100).toFixed(2)
} }
}, },
...@@ -623,7 +624,7 @@ export default { ...@@ -623,7 +624,7 @@ export default {
}) })
this.form.receiptAccountList[this.form.receiptAccountList.length -1].collectionAmount = amountList this.form.receiptAccountList[this.form.receiptAccountList.length -1].collectionAmount = amountList
this.$set(this.form, 'receiptAccountList', [...this.form.receiptAccountList]) this.$set(this.form, 'receiptAccountList', [...this.form.receiptAccountList])
this.$nextTick(() => { this.$nextTick(() => {
this.form.receiptAccountList.forEach((item, index) => { this.form.receiptAccountList.forEach((item, index) => {
...@@ -896,7 +897,7 @@ export default { ...@@ -896,7 +897,7 @@ export default {
} }
}) })
console.log('collom',collom) console.log('collom',collom)
if(recepted.length>collom.length){ // if(recepted.length>collom.length){
recepted.forEach((amount,currency)=>{ recepted.forEach((amount,currency)=>{
if(amount){ if(amount){
if(collom[currency]){ if(collom[currency]){
...@@ -907,17 +908,20 @@ export default { ...@@ -907,17 +908,20 @@ export default {
} }
}) })
}else{ // }else{
collom.forEach((amount,currency)=>{ collom.forEach((amount,currency)=>{
if(amount){ if(amount){
if(recepted[currency]){ if(!this.surplusData[currency]){
if((amount-recepted[currency])!=0) this.surplusData[currency] = +parseFloat((amount-recepted[currency]).toPrecision(12)) if(recepted[currency]){
}else{ if((amount-recepted[currency])!=0) this.surplusData[currency] = +parseFloat((amount-recepted[currency]).toPrecision(12))
}else{
this.surplusData[currency] = amount this.surplusData[currency] = amount
} }
}
} }
}) })
} // }
console.log(this.surplusData) console.log(this.surplusData)
this.addForm = {} this.addForm = {}
this.openAddDialog = true this.openAddDialog = true
......
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