Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yd-csf-front
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
yuzhenWang
yd-csf-front
Commits
8383d648
Commit
8383d648
authored
May 19, 2026
by
yuzhenWang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'wyz' into 'test'
优化9 See merge request
!154
parents
b47d0fb2
b7691251
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
77 additions
and
21 deletions
+77
-21
src/utils/number.js
+18
-0
src/views/financialCenter/financialBilling.vue
+24
-8
src/views/financialCenter/financialIncome.vue
+3
-1
src/views/financialCenter/financialSalary.vue
+1
-1
src/views/financialCenter/payables.vue
+21
-8
src/views/financialCenter/payroll.vue
+8
-1
src/views/sign/underwritingMain/policyDetail.vue
+2
-2
No files found.
src/utils/number.js
View file @
8383d648
...
...
@@ -235,6 +235,24 @@ export function calculateAmount(a, b, digits = 2, type) {
return
null
}
}
/**
* 格式化数字,保留最多 maxDigits 位小数,自动去除尾随零
* @param {number|null|undefined} value - 原始数值
* @param {number} maxDigits - 最多保留的小数位数,默认 5
* @param {string} defaultValue - 无效值时的占位符,默认 '-'
* @returns {string} 格式化后的字符串
*/
export
function
formatNumberToMaxDigits
(
value
,
maxDigits
=
5
,
defaultValue
=
'-'
)
{
if
(
value
===
undefined
||
value
===
null
||
isNaN
(
Number
(
value
)))
{
return
defaultValue
;
}
const
num
=
Number
(
value
);
// 先固定保留 maxDigits 位小数(四舍五入)
const
fixed
=
num
.
toFixed
(
maxDigits
);
// 移除末尾的0,如果小数部分全是0则连小数点一起移除
const
trimmed
=
fixed
.
replace
(
/
\.?
0+$/
,
''
);
return
trimmed
;
}
export
default
{
formatCurrency
,
numberFormat
,
...
...
src/views/financialCenter/financialBilling.vue
View file @
8383d648
...
...
@@ -118,7 +118,13 @@
<el-table-column
prop=
"broker"
label=
"转介人"
width=
"130"
sortable
/>
<el-table-column
prop=
"brokerGradeName"
label=
"转介人职级"
width=
"100"
/>
<el-table-column
prop=
"team"
label=
"所属团队"
width=
"120"
sortable
/>
<el-table-column
prop=
"exchangeRate"
label=
"结算汇率(估)"
width=
"140"
sortable
/>
<el-table-column
prop=
"exchangeRate"
label=
"结算汇率(估)"
width=
"140"
:formatter=
"row => formatNumberToMaxDigits(row.exchangeRate, 5, '-')"
>
</el-table-column>
<el-table-column
prop=
"hkdAmount"
label=
"应出账金额(HKD)"
...
...
@@ -324,7 +330,7 @@ import editTable from '@/components/Table/editTable.vue'
import
CommonDialog
from
'@/components/commonDialog'
import
SearchForm
from
'@/components/SearchForm/SearchForm.vue'
import
{
ElMessage
}
from
'element-plus'
import
{
formatCurrency
,
calculateAmount
}
from
'@/utils/number'
import
{
formatCurrency
,
calculateAmount
,
formatNumberToMaxDigits
}
from
'@/utils/number'
import
{
Select
,
EditPen
}
from
'@element-plus/icons-vue'
// 接口
...
...
@@ -506,8 +512,9 @@ const splitTableColumns = ref([
{
editType
:
'input'
,
prop
:
'originalToHkdRate'
,
label
:
'原币种->港币'
,
label
:
'原币种->港币
(汇率)
'
,
inputType
:
'decimal'
,
decimalDigits
:
5
,
required
:
true
,
width
:
150
},
...
...
@@ -516,6 +523,7 @@ const splitTableColumns = ref([
prop
:
'hkdAmount'
,
label
:
'港币金额'
,
inputType
:
'decimal'
,
required
:
true
,
width
:
150
},
...
...
@@ -523,8 +531,9 @@ const splitTableColumns = ref([
{
editType
:
'input'
,
prop
:
'hkdToPayoutRate'
,
label
:
'港币->发放币种'
,
label
:
'港币->发放币种
(汇率)
'
,
inputType
:
'decimal'
,
decimalDigits
:
5
,
required
:
true
,
width
:
150
},
...
...
@@ -543,6 +552,7 @@ const splitTableColumns = ref([
prop
:
'exchangeRate'
,
label
:
'保单币种->港币(入账检核汇率)'
,
inputType
:
'decimal'
,
decimalDigits
:
5
,
required
:
true
,
width
:
150
// defaultValue: 1
...
...
@@ -635,8 +645,9 @@ const rateExchangeConfig = [
{
type
:
'input'
,
prop
:
'originalToHkdRate'
,
label
:
'原币种->港币'
,
label
:
'原币种->港币
(汇率)
'
,
inputType
:
'decimal'
,
decimalDigits
:
5
,
rules
:
[{
required
:
true
,
message
:
'只能输入正整数和小数'
,
trigger
:
'blur'
}]
// defaultValue: 1
},
...
...
@@ -651,8 +662,9 @@ const rateExchangeConfig = [
{
type
:
'input'
,
prop
:
'hkdToPayoutRate'
,
label
:
'港币->发放币种'
,
label
:
'港币->发放币种
(汇率)
'
,
inputType
:
'decimal'
,
decimalDigits
:
5
,
rules
:
[{
required
:
true
,
message
:
'只能输入正整数和小数'
,
trigger
:
'blur'
}]
// defaultValue: 1
},
...
...
@@ -670,6 +682,7 @@ const rateExchangeConfig = [
prop
:
'exchangeRate'
,
label
:
'保单币种->港币(入账检核汇率)'
,
inputType
:
'decimal'
,
decimalDigits
:
5
,
rules
:
[{
required
:
true
,
message
:
'只能输入正整数和小数'
,
trigger
:
'blur'
}]
// defaultValue: 1
},
...
...
@@ -1223,7 +1236,8 @@ const addCheckRecordConfig = [
{
type
:
'input'
,
prop
:
'originalToHkdRate'
,
label
:
'原币种->港币'
,
label
:
'原币种->港币(汇率)'
,
decimalDigits
:
5
,
inputType
:
'decimal'
,
rules
:
[{
required
:
true
,
message
:
'只能输入正整数和小数'
,
trigger
:
'blur'
}]
// defaultValue: 1
...
...
@@ -1239,8 +1253,9 @@ const addCheckRecordConfig = [
{
type
:
'input'
,
prop
:
'hkdToPayoutRate'
,
label
:
'港币->发放币种'
,
label
:
'港币->发放币种
(汇率)
'
,
inputType
:
'decimal'
,
decimalDigits
:
5
,
rules
:
[{
required
:
true
,
message
:
'只能输入正整数和小数'
,
trigger
:
'blur'
}]
// defaultValue: 1
},
...
...
@@ -1258,6 +1273,7 @@ const addCheckRecordConfig = [
prop
:
'exchangeRate'
,
label
:
'保单币种->港币(入账检核汇率)'
,
inputType
:
'decimal'
,
decimalDigits
:
5
,
rules
:
[{
required
:
true
,
message
:
'只能输入正整数和小数'
,
trigger
:
'blur'
}]
// defaultValue: 1
},
...
...
src/views/financialCenter/financialIncome.vue
View file @
8383d648
...
...
@@ -858,7 +858,7 @@ const addCheckRecordConfig = ref([
prop
:
'exchangeRate'
,
label
:
'结算汇率(实)'
,
inputType
:
'decimal'
,
decimalDigits
:
4
,
decimalDigits
:
5
,
visible
:
formData
=>
formData
.
commissionBizType
==
'R'
,
rules
:
[
{
required
:
true
,
message
:
'请输入金额'
,
trigger
:
'blur'
},
...
...
@@ -1206,6 +1206,8 @@ const closthDialog = () => {
checkFormRef
.
value
.
resetForm
()
checkFormData
.
value
=
{}
checkRecordTableData
.
value
=
[]
const
params
=
searchFormRef
.
value
.
getFormData
()
loadTableData
(
params
)
}
// 重新比对
...
...
src/views/financialCenter/financialSalary.vue
View file @
8383d648
...
...
@@ -492,7 +492,7 @@ const handleFromAmountBlur = row => {
// 汇率输入处理
const
handleExchangeRateInput
=
(
val
,
row
)
=>
{
row
.
exchangeRate
=
amountInput
.
filterInput
(
val
,
4
)
row
.
exchangeRate
=
amountInput
.
filterInput
(
val
,
5
)
getDebouncedChangeToAmount
(
row
)(
row
)
}
...
...
src/views/financialCenter/payables.vue
View file @
8383d648
...
...
@@ -258,7 +258,7 @@
import
CommonPage
from
'@/components/commonPage'
import
{
ref
,
reactive
,
nextTick
}
from
'vue'
import
{
ElMessage
,
ElMessageBox
}
from
'element-plus'
import
{
formatCurrency
,
calculateAmount
}
from
'@/utils/number'
import
{
formatCurrency
,
calculateAmount
,
formatNumberToMaxDigits
}
from
'@/utils/number'
import
{
expectedFortuneList
,
payRecordList
,
...
...
@@ -513,12 +513,19 @@ const payableReportListTableColumns = ref([
width
:
'120'
,
formatter
:
row
=>
formatCurrency
(
row
.
hkdAmount
||
0
)
},
// {
// prop: 'exchangeRate',
// label: '保单币种->HKD(汇率)',
// sortable: true,
// width: '140',
// formatter: row => formatCurrency(row.exchangeRate || 0, '', 5)
// },
{
prop
:
'exchangeRate'
,
label
:
'保单币种->HKD
汇率
'
,
label
:
'保单币种->HKD
(汇率)
'
,
sortable
:
true
,
width
:
'140'
,
formatter
:
row
=>
format
Currency
(
row
.
exchangeRate
||
0
)
formatter
:
row
=>
format
NumberToMaxDigits
(
row
.
exchangeRate
,
5
,
'-'
)
},
{
...
...
@@ -907,8 +914,9 @@ const updatePayRecordFormConfig = [
{
type
:
'input'
,
prop
:
'originalToHkdRate'
,
label
:
'原币种->港币'
,
label
:
'原币种->港币
(汇率)
'
,
inputType
:
'decimal'
,
decimalDigits
:
5
,
rules
:
[{
required
:
true
,
message
:
'只能输入正整数和小数'
,
trigger
:
'blur'
}]
// defaultValue: 1
},
...
...
@@ -923,8 +931,9 @@ const updatePayRecordFormConfig = [
{
type
:
'input'
,
prop
:
'hkdToPayoutRate'
,
label
:
'港币->发放币种'
,
label
:
'港币->发放币种
(汇率)
'
,
inputType
:
'decimal'
,
decimalDigits
:
5
,
rules
:
[{
required
:
true
,
message
:
'只能输入正整数和小数'
,
trigger
:
'blur'
}]
// defaultValue: 1
},
...
...
@@ -942,6 +951,7 @@ const updatePayRecordFormConfig = [
prop
:
'exchangeRate'
,
label
:
'保单币种->港币(入账检核汇率)'
,
inputType
:
'decimal'
,
decimalDigits
:
5
,
rules
:
[{
required
:
true
,
message
:
'只能输入正整数和小数'
,
trigger
:
'blur'
}]
// defaultValue: 1
},
...
...
@@ -1215,7 +1225,7 @@ const addPayRecordFormConfig = [
label
:
'所属团队'
,
api
:
'/csf/api/team/page'
,
keywordField
:
'teamName'
,
requestParams
:
{
pageNo
:
1
,
pageSize
:
20
0
},
requestParams
:
{
pageNo
:
1
,
pageSize
:
20
},
placeholder
:
'输入所属团队名称搜索'
,
debounceWait
:
500
,
// 自定义防抖时间
valueKey
:
'teamBizId'
,
...
...
@@ -1272,8 +1282,9 @@ const addPayRecordFormConfig = [
{
type
:
'input'
,
prop
:
'originalToHkdRate'
,
label
:
'原币种->港币'
,
label
:
'原币种->港币
(汇率)
'
,
inputType
:
'decimal'
,
decimalDigits
:
5
,
rules
:
[{
required
:
true
,
message
:
'只能输入正整数和小数'
,
trigger
:
'blur'
}]
// defaultValue: 1
},
...
...
@@ -1288,8 +1299,9 @@ const addPayRecordFormConfig = [
{
type
:
'input'
,
prop
:
'hkdToPayoutRate'
,
label
:
'港币->发放币种'
,
label
:
'港币->发放币种
(汇率)
'
,
inputType
:
'decimal'
,
decimalDigits
:
5
,
rules
:
[{
required
:
true
,
message
:
'只能输入正整数和小数'
,
trigger
:
'blur'
}]
// defaultValue: 1
},
...
...
@@ -1307,6 +1319,7 @@ const addPayRecordFormConfig = [
prop
:
'defaultExchangeRate'
,
label
:
'保单币种->港币(入账检核汇率)'
,
inputType
:
'decimal'
,
decimalDigits
:
5
,
rules
:
[{
required
:
true
,
message
:
'只能输入正整数和小数'
,
trigger
:
'blur'
}]
// defaultValue: 1
},
...
...
src/views/financialCenter/payroll.vue
View file @
8383d648
...
...
@@ -47,6 +47,7 @@ import CommonPage from '@/components/commonPage'
import
{
salarySummary
,
exportPayRoll
}
from
'@/api/financial/commission'
import
{
ElMessageBox
,
ElMessage
}
from
'element-plus'
import
SearchForm
from
'@/components/SearchForm/SearchForm.vue'
import
{
formatNumberToMaxDigits
}
from
'@/utils/number'
const
searchFormRef
=
ref
(
null
)
const
searchParams
=
ref
({})
const
searchConfig
=
ref
([
...
...
@@ -93,7 +94,13 @@ const tableColumns = ref([
{
prop
:
'team'
,
label
:
'所属团队'
,
sortable
:
true
,
width
:
'150'
},
{
prop
:
'fromAmount'
,
label
:
'原币种金额'
,
sortable
:
true
,
width
:
'150'
},
{
prop
:
'currency'
,
label
:
'原币种'
,
sortable
:
true
,
width
:
'150'
},
{
prop
:
'exchangeRate'
,
label
:
'汇率(原币种->目标币种)'
,
sortable
:
true
,
width
:
'150'
},
{
prop
:
'exchangeRate'
,
label
:
'汇率(原币种->目标币种)'
,
sortable
:
true
,
width
:
'150'
,
formatter
:
row
=>
formatNumberToMaxDigits
(
row
.
exchangeRate
,
5
,
'-'
)
},
{
prop
:
'toAmount'
,
label
:
'目标金额'
,
sortable
:
true
,
width
:
'150'
},
{
prop
:
'toCurrency'
,
label
:
'目标币种'
,
sortable
:
true
,
width
:
'150'
},
{
prop
:
'fortuneAccountMonth'
,
label
:
'出账月(实)'
,
sortable
:
true
,
width
:
'150'
},
...
...
src/views/sign/underwritingMain/policyDetail.vue
View file @
8383d648
...
...
@@ -315,9 +315,9 @@ const introducerConfig = [
broker
:
'realName'
,
// 选中后自动填 broker = raw.realName
brokerName
:
'realName'
,
internalCode
:
'internalNumber'
,
team
:
'
dept
Name'
,
team
:
'
team
Name'
,
phone
:
'phone'
,
teamBizId
:
'
dept
BizId'
teamBizId
:
'
team
BizId'
},
transform
:
res
=>
{
return
(
res
?.
data
.
records
||
[]).
map
(
item
=>
({
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment