Commit cb1bc107 by yuzhenWang

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

添加禁用

See merge request !105
parents a1f3ef61 a06d41d7
// 格式化金额为货币格式 // 格式化金额为货币格式
export function formatCurrency(value, currency = '',fixedDigits = 2) { export function formatCurrency(value, currency = '', fixedDigits = 2) {
if (value === undefined || value === null) return currency + '0.00' if (value === undefined || value === null) return currency + '0.00'
return currency + value.toFixed(fixedDigits).replace(/\d(?=(\d{3})+\.)/g, '$&,') return currency + value.toFixed(fixedDigits).replace(/\d(?=(\d{3})+\.)/g, '$&,')
} }
...@@ -198,9 +198,19 @@ export function formatThousandsSimple(value) { ...@@ -198,9 +198,19 @@ export function formatThousandsSimple(value) {
return result return result
} }
export function inputThousands(value) {
if (value === undefined || value === null || value === '') {
return ''
}
const parts = String(value).split('.')
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',')
return parts.join('.')
}
export default { export default {
formatCurrency, formatCurrency,
numberFormat, numberFormat,
formatThousands, formatThousands,
formatThousandsSimple formatThousandsSimple,
inputThousands
} }
...@@ -106,14 +106,14 @@ ...@@ -106,14 +106,14 @@
<el-row :gutter="16"> <el-row :gutter="16">
<el-col :xs="24" :sm="12" :md="6" class="text-center mb-4"> <el-col :xs="24" :sm="12" :md="6" class="text-center mb-4">
<el-statistic <el-statistic
title="原币种金额" title="原币种金额"
:value="currentRow.hkdAmount" :value="currentRow.hkdAmount"
:formatter="value => formatCurrency(value, '', 4)" :formatter="value => formatCurrency(value, '', 4)"
/> />
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="6" class="text-center mb-4"> <el-col :xs="24" :sm="12" :md="6" class="text-center mb-4">
<el-statistic <el-statistic
title="剩余原币种金额" title="剩余原币种金额"
:value="billStatistic.beSplitAmount" :value="billStatistic.beSplitAmount"
:formatter="value => formatCurrency(value, '', 4)" :formatter="value => formatCurrency(value, '', 4)"
/> />
...@@ -144,7 +144,12 @@ ...@@ -144,7 +144,12 @@
></el-table-column> ></el-table-column>
<el-table-column label="发放编号" prop="salarySplitNo" width="150" fixed="left"> <el-table-column label="发放编号" prop="salarySplitNo" width="150" fixed="left">
<template #default="scope"> <template #default="scope">
<el-input v-model="scope.row.salarySplitNo" placeholder="请输入" clearable /> <el-input
v-model="scope.row.salarySplitNo"
placeholder="请输入"
clearable
:disabled="true"
/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="转介人" prop="brokerName" width="150"> <el-table-column label="转介人" prop="brokerName" width="150">
...@@ -181,7 +186,7 @@ ...@@ -181,7 +186,7 @@
@clear="clearInput('fromAmount', scope.row)" @clear="clearInput('fromAmount', scope.row)"
@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)"
:formatter="value => `${value}`.replace(/\d(?=(\d{3})+\.)/g, '$&,')" :formatter="value => inputThousands(value)"
:parser="value => value.replace(/\$\s?|(,*)/g, '')" :parser="value => value.replace(/\$\s?|(,*)/g, '')"
/> />
</template> </template>
...@@ -224,7 +229,7 @@ ...@@ -224,7 +229,7 @@
placeholder="请输入" placeholder="请输入"
clearable clearable
@input="val => (scope.row.toAmount = amountInput.filterInput(val, 4))" @input="val => (scope.row.toAmount = amountInput.filterInput(val, 4))"
:formatter="value => `${value}`.replace(/\d(?=(\d{3})+\.)/g, '$&,')" :formatter="value => inputThousands(value)"
:parser="value => value.replace(/\$\s?|(,*)/g, '')" :parser="value => value.replace(/\$\s?|(,*)/g, '')"
/> />
</template> </template>
...@@ -302,7 +307,7 @@ import { ...@@ -302,7 +307,7 @@ import {
billBatchSave, billBatchSave,
billCalculateToAmount billCalculateToAmount
} from '@/api/financial/commission' } from '@/api/financial/commission'
import { formatCurrency, formatThousands } from '@/utils/number' import { formatCurrency, inputThousands } from '@/utils/number'
import { generateId } from '@/utils/common' import { generateId } from '@/utils/common'
import { ElMessageBox, ElMessage } from 'element-plus' import { ElMessageBox, ElMessage } from 'element-plus'
import SearchForm from '@/components/SearchForm/SearchForm.vue' import SearchForm from '@/components/SearchForm/SearchForm.vue'
...@@ -452,6 +457,10 @@ const changeToAmount = async row => { ...@@ -452,6 +457,10 @@ const changeToAmount = async row => {
} }
const handleBillConfirm = async () => { const handleBillConfirm = async () => {
submitBillLoading.value = true submitBillLoading.value = true
billTableList.value = billTableList.value.map(item => {
item.brokerBizId = currentRow.value.brokerBizId
return item
})
try { try {
const params = { const params = {
fortuneAccountBizId: currentRow.value.fortuneAccountBizId, fortuneAccountBizId: currentRow.value.fortuneAccountBizId,
......
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