Commit 1aaf36a9 by yuzhenWang

修正拆分出账

parent dbb8c004
......@@ -179,7 +179,7 @@
</el-table-column>
<el-table-column label="原币种金额" prop="fromAmount" width="150">
<template #default="scope">
<!-- @input="val => (scope.row.fromAmount = amountInput.filterInput(val, 4))"
<!--等生产没问题再删除 @input="val => (scope.row.fromAmount = amountInput.filterInput(val, 4))"
@blur="billInputBlur('fromAmount', scope.row)" -->
<el-input
v-model="scope.row.fromAmount"
......@@ -212,7 +212,7 @@
</el-select>
</template>
</el-table-column>
<!-- @blur="billInputBlur('exchangeRate', scope.row)"
<!--等生产没问题再删除 @blur="billInputBlur('exchangeRate', scope.row)"
@input="val => (scope.row.exchangeRate = amountInput.filterInput(val, 4))" -->
<el-table-column label="汇率(%)" prop="exchangeRate" width="150">
<template #default="scope">
......@@ -404,11 +404,13 @@ const dropdownItems = [
]
//=============拆分出账开始================
const clearInput = (key, row) => {
if (key == 'fromAmount' || key == 'toCurrency') {
if (key == 'toCurrency') {
row.exchangeRate = '0.00'
row.toAmount = '0.00'
} else if (key == 'exchangeRate') {
row.toAmount = '0.00'
} else if (key == 'fromAmount') {
row.toAmount = '0.00'
}
}
const getDebouncedChangeRate = row => {
......@@ -470,11 +472,11 @@ const billInputBlur = (type, row) => {
// 改变汇率
const changeRate = async (row, type) => {
try {
if (row.toCurrency && row.fromAmount) {
if (row.toCurrency) {
const params = {
fortuneAccountBizId: currentRow.value.fortuneAccountBizId, //出账记录业务id(关联出账记录表)
fromCurrency: currentRow.value.currency, //原币种
fromAmount: row.fromAmount, //原币种金额
fromAmount: row.fromAmount || '0.00', //原币种金额
toCurrency: row.toCurrency //目标币种
}
const response = await billSplitRate(params)
......@@ -485,8 +487,11 @@ const changeRate = async (row, type) => {
? (response.data.exchangeRate * 100).toFixed(4)
: ''
}
if (response.data.convertedAmount > 0) {
row.toAmount = Number(response.data.convertedAmount).toFixed(4)
} else {
row.toAmount = '0.00'
}
}
} else {
}
......
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