Commit 4f5a7776 authored by 邓春圆's avatar 邓春圆

Merge remote-tracking branch 'origin/release2.2' into release2.2

parents f484bcb3 d720bc07
...@@ -393,7 +393,7 @@ ...@@ -393,7 +393,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.type !== 'total'">{{ scope.row.collectionAmount }}</span> <span v-if="scope.row.type !== 'total'">{{ scope.row.collectionAmount }}</span>
<div v-else> <div v-else>
<div v-for="itemAmount in scope.row.collectionAmount">{{$i18n.locale=='zh_CN'?(itemAmount?itemAmount.currencyNameZh:''):(itemAmount?itemAmount.currencyNameEn:'')}}: {{ itemAmount?itemAmount.amount:''}}</div> <div v-for="itemAmount in scope.row.collectionAmount">{{$i18n.locale=='zh_CN'?(itemAmount?itemAmount.currencyNameZh:''):(itemAmount?itemAmount.currencyNameEn:'')}}: {{ itemAmount&&itemAmount.amount?itemAmount.amount:0}}</div>
<!-- <div v-if="scope.row.collectionAmount[1]">{{ $t('人民币') }}: {{ scope.row.collectionAmount[1].toFixed(6) }}</div> <!-- <div v-if="scope.row.collectionAmount[1]">{{ $t('人民币') }}: {{ scope.row.collectionAmount[1].toFixed(6) }}</div>
<div v-if="scope.row.collectionAmount[2]">{{ $t('奈拉') }}: {{ scope.row.collectionAmount[2].toFixed(6) }}</div> <div v-if="scope.row.collectionAmount[2]">{{ $t('奈拉') }}: {{ scope.row.collectionAmount[2].toFixed(6) }}</div>
<div v-if="scope.row.collectionAmount[3]">{{ $t('西非法郎') }}: {{ scope.row.collectionAmount[3].toFixed(6) }}</div> --> <div v-if="scope.row.collectionAmount[3]">{{ $t('西非法郎') }}: {{ scope.row.collectionAmount[3].toFixed(6) }}</div> -->
...@@ -1048,7 +1048,7 @@ export default { ...@@ -1048,7 +1048,7 @@ export default {
getRate(sourceCurrencyId,targetCurrencyId){ getRate(sourceCurrencyId,targetCurrencyId){
var rate = this.rateList.find(v=>(v.sourceCurrencyId === sourceCurrencyId&&v.targetCurrencyId===targetCurrencyId)) var rate = this.rateList.find(v=>(v.sourceCurrencyId === sourceCurrencyId&&v.targetCurrencyId===targetCurrencyId))
if(rate) return rate.currencyRate if(rate) return rate.currencyRate
return 1 return 0
}, },
writeOffRateChange(row, index) { writeOffRateChange(row, index) {
row.writeOffAmount = Math.round(NP.times(row.writeOffRate || 0, NP.minus(row.receivableAmount, row.discountTotal))) row.writeOffAmount = Math.round(NP.times(row.writeOffRate || 0, NP.minus(row.receivableAmount, row.discountTotal)))
...@@ -1057,7 +1057,11 @@ export default { ...@@ -1057,7 +1057,11 @@ export default {
this.form.receiptAccountList[this.form.receiptAccountList.length -1].writeOffAmount = writeOffAmountTotal this.form.receiptAccountList[this.form.receiptAccountList.length -1].writeOffAmount = writeOffAmountTotal
}, },
rateChange(row, index) { rateChange(row, index) {
row.receivableAmount && (row.collectionAmount = Math.round(NP.times(row.collectionRate || 0, NP.minus(row.receivableAmount, row.discountTotal||0)))) if(row.collectionRate){
row.receivableAmount && (row.collectionAmount = Math.round(NP.times(row.collectionRate || 0, NP.minus(row.receivableAmount, row.discountTotal||0))))
}else{
row.collectionAmount = 0
}
this.form.receiptAccountList[index] = {...row} this.form.receiptAccountList[index] = {...row}
setTimeout(() => { setTimeout(() => {
......
...@@ -157,7 +157,7 @@ ...@@ -157,7 +157,7 @@
</el-table-column> </el-table-column>
<el-table-column :label="$t('期望收款账户')" align="center"> <el-table-column :label="$t('期望收款账户')" align="center">
<template slot-scope="scope" v-if="scope.row.type !== 'total'"> <template slot-scope="scope" v-if="scope.row.type !== 'total'">
{{ `${bankData.find(v => v.id == scope.row.platformAccountId).baAccountName}(${bankData.find(v => v.id == scope.row.platformAccountId).baAccountNum})` }} {{ `${bankData.find(v => v.id == scope.row.platformAccountId)?bankData.find(v => v.id == scope.row.platformAccountId).baAccountName:''}(${bankData.find(v => v.id == scope.row.platformAccountId)?bankData.find(v => v.id == scope.row.platformAccountId).baAccountNum:''})` }}
</template> </template>
</el-table-column> </el-table-column>
...@@ -189,7 +189,7 @@ ...@@ -189,7 +189,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.type !== 'total'">{{ scope.row.collectionAmount }}</span> <span v-if="scope.row.type !== 'total'">{{ scope.row.collectionAmount }}</span>
<div v-else> <div v-else>
<div v-for="itemAmount in scope.row.collectionAmount">{{$i18n.locale=='zh_CN'?itemAmount.currencyNameZh:itemAmount.currencyNameEn}}: {{ itemAmount.amount}}</div> <div v-for="itemAmount in scope.row.collectionAmount">{{$i18n.locale=='zh_CN'?itemAmount.currencyNameZh:itemAmount.currencyNameEn}}: {{ itemAmount&&itemAmount.amount?itemAmount.amount:0}}</div>
<!-- <div v-if="scope.row.collectionAmount[0]">{{ $t('美元') }}: {{ scope.row.collectionAmount[0] }}</div> <!-- <div v-if="scope.row.collectionAmount[0]">{{ $t('美元') }}: {{ scope.row.collectionAmount[0] }}</div>
<div v-if="scope.row.collectionAmount[1]">{{ $t('人民币') }}: {{ scope.row.collectionAmount[1] }}</div> <div v-if="scope.row.collectionAmount[1]">{{ $t('人民币') }}: {{ scope.row.collectionAmount[1] }}</div>
<div v-if="scope.row.collectionAmount[2]">{{ $t('奈拉') }}: {{ scope.row.collectionAmount[2] }}</div> --> <div v-if="scope.row.collectionAmount[2]">{{ $t('奈拉') }}: {{ scope.row.collectionAmount[2] }}</div> -->
...@@ -744,7 +744,7 @@ export default { ...@@ -744,7 +744,7 @@ export default {
collectionAmount: [] collectionAmount: []
}] }]
} }
this.$set(this.form, 'receiptAccountList', [...res.data]) this.$set(this.form, 'receiptAccountList', res.data)
// 收款总计 // 收款总计
// const dollarList = res.data.filter(v => v.collectionCurrencyId == 1) // const dollarList = res.data.filter(v => v.collectionCurrencyId == 1)
// const dollar = dollarList.reduce((total, currentValue) => NP.plus(total, currentValue.collectionAmount || 0), 0) // const dollar = dollarList.reduce((total, currentValue) => NP.plus(total, currentValue.collectionAmount || 0), 0)
...@@ -796,9 +796,12 @@ export default { ...@@ -796,9 +796,12 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
this.form.receiptAccountList.forEach((item, index) => { // this.form.receiptAccountList.forEach((item, index) => {
this.rateChange(item, index) // this.rateChange(item, index)
}); // });
if(this.form.receiptAccountList.length>0){
this.editReceiptAccountList()
}
}) })
}) })
} }
...@@ -807,10 +810,26 @@ export default { ...@@ -807,10 +810,26 @@ export default {
}, },
methods: { methods: {
rateChange(row, index) { rateChange(row, index) {
console.log(row) if(row.collectionRate){
row.receivableAmount && (row.collectionAmount = NP.times(row.collectionRate || 0, NP.minus(row.receivableAmount, row.discountTotal||0)).toFixed(2)) row.receivableAmount && (row.collectionAmount = Math.round(NP.times(row.collectionRate || 0, NP.minus(row.receivableAmount, row.discountTotal||0))))
}else{
row.collectionAmount = 0
}
// row.receivableAmount && (row.collectionAmount = NP.times(row.collectionRate || 0, NP.minus(row.receivableAmount, row.discountTotal||0)).toFixed(2))
this.form.receiptAccountList[index] = {...row} this.form.receiptAccountList[index] = {...row}
}, },
editReceiptAccountList(){
var amountList =[]
this.currencyList.forEach((item,index)=>{
var dollarList = this.form.receiptAccountList.filter(v => v.collectionCurrencyId == item.id)
if(dollarList.length>0){
var dollar = Math.round(dollarList.reduce((total, currentValue) => NP.plus(total, currentValue.collectionAmount), 0))
amountList.push({currencyId:item.id,currencyNameEn:item.titleEn,currencyNameZh:item.titleZh,amount:dollar})
}
})
this.form.receiptAccountList[this.form.receiptAccountList.length -1].collectionAmount = amountList
this.$set(this.form, 'receiptAccountList', [...this.form.receiptAccountList])
},
setWriteOffAmount() { setWriteOffAmount() {
var pointArr = [] var pointArr = []
var regs=/^[0-9]+\d*(\.\d*)?$|^0?\.\d*[0-9]\d*$/; var regs=/^[0-9]+\d*(\.\d*)?$|^0?\.\d*[0-9]\d*$/;
...@@ -944,9 +963,9 @@ export default { ...@@ -944,9 +963,9 @@ export default {
}, },
accountChange(val){ accountChange(val){
var data = this.bankData.find(item=>item.id==val) var data = this.bankData.find(item=>item.id==val)
this.$set(this.addForm,'accountName',data.baAccountName) this.$set(this.addForm,'accountName',data.baAccountName||'')
this.$set(this.addForm,'accountNo',data.baAccountNum) this.$set(this.addForm,'accountNo',data.baAccountNum||'')
this.$set(this.addForm,'accountBankName',data.baBankName) this.$set(this.addForm,'accountBankName',data.baBankName||'')
}, },
RMBtoUS() { RMBtoUS() {
return NP.divide(100, this.currencyList.find(v => v.titleEn === 'USD').huilv) return NP.divide(100, this.currencyList.find(v => v.titleEn === 'USD').huilv)
......
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