Commit 6c6463c1 by yuzhenWang

Merge branch 'feature-20260408-拆分出账' into 'test'

修正拆分出账

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