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
005a8c87
Commit
005a8c87
authored
Jun 24, 2026
by
yuzhenWang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改薪资单计算代码
parent
28b4ef95
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
16 deletions
+39
-16
src/views/payslip/wordReferenceSalary.vue
+39
-16
No files found.
src/views/payslip/wordReferenceSalary.vue
View file @
005a8c87
...
...
@@ -180,7 +180,7 @@ const allSelectedRows = ref(new Map())
const
selectedRows
=
ref
([])
const
multipAddSalaryDialog
=
ref
(
false
)
const
addRecordRef
=
ref
(
null
)
const
apiSalaryBatchAddDTOList
=
ref
([
{}
])
//批量新增薪资单
const
apiSalaryBatchAddDTOList
=
ref
([])
//批量新增薪资单
const
salaryRemittanceDTOList
=
ref
([{}])
//银行数据
const
editTableRef
=
ref
(
null
)
const
bankTableRef
=
ref
(
null
)
...
...
@@ -631,7 +631,10 @@ const clearAllSelection = () => {
//==============表格复选框结束===========
const
addSalaryRecord
=
()
=>
{
apiSalaryBatchAddDTOList
.
value
.
push
({
multipleId
:
Date
.
now
()
+
Math
.
random
()
// 或使用 uuid
multipleId
:
Date
.
now
()
+
Math
.
random
(),
// 或使用 uuid
otherAmount
:
0
,
mpfAmount
:
0
,
grossAmount
:
0
})
}
const
addSalaryRemittanceRecord
=
()
=>
{
...
...
@@ -702,7 +705,9 @@ const handleSplitCellChange = async ({ row, col, newValue, oldValue, rowIndex, p
const
updatedRow
=
{
...
currentRow
}
//计算实发金额
if
(
prop
===
'grossAmount'
||
prop
===
'mpfAmount'
||
prop
===
'otherAmount'
)
{
if
(
currentRow
.
grossAmount
&&
currentRow
.
mpfAmount
&&
currentRow
.
otherAmount
)
{
// if (currentRow.grossAmount && currentRow.mpfAmount && currentRow.otherAmount) {
// }
try
{
let
params
=
{
grossAmount
:
currentRow
.
grossAmount
,
...
...
@@ -717,7 +722,6 @@ const handleSplitCellChange = async ({ row, col, newValue, oldValue, rowIndex, p
ElMessage
.
error
(
'实发金额计算失败'
)
}
}
}
// 如果用户手动修改了 hkdAmount,不做反向联动(符合需求)
if
(
needUpdate
)
{
// 更新表格数据(整体替换,触发视图更新)
...
...
@@ -823,11 +827,13 @@ const handleSingleSalaryCellChange = async ({ row, col, newValue, oldValue, rowI
}
//计算折合港币总金额,改变币种汇率也会改变,所以等表格更新完在更新折合港币总金额
if
(
prop
===
'amount'
||
prop
===
'exchangeRate'
)
{
if
(
currentRow
.
amount
&&
currentRow
.
exchangeRate
&&
currentRow
.
currency
)
{
// if (currentRow.amount && currentRow.exchangeRate && currentRow.currency) {
// }
try
{
let
calculateTotalAmountDTOList
=
JSON
.
parse
(
JSON
.
stringify
(
salaryRemittanceDTOList
.
value
))
let
params
=
calculateTotalAmountDTOList
.
reduce
((
acc
,
item
)
=>
{
if
(
item
.
amount
&&
item
.
exchangeRate
&&
item
.
currency
)
{
if
(
item
.
exchangeRate
&&
item
.
currency
)
{
acc
.
push
({
...
item
})
}
return
acc
...
...
@@ -839,7 +845,6 @@ const handleSingleSalaryCellChange = async ({ row, col, newValue, oldValue, rowI
ElMessage
.
error
(
'折合港币总金额计算失败'
)
}
}
}
}
// 单个薪资单的新增,修改
const
handleConfirmSingleSalary
=
async
()
=>
{
...
...
@@ -931,11 +936,13 @@ const handleFormInputChange = async (prop, value, item) => {
await
nextTick
()
//计算实发金额
if
(
prop
===
'grossAmount'
||
prop
===
'mpfAmount'
||
prop
===
'otherAmount'
)
{
if
(
personSaleryFormModel
.
value
.
grossAmount
&&
personSaleryFormModel
.
value
.
mpfAmount
&&
personSaleryFormModel
.
value
.
otherAmount
)
{
// if (
// personSaleryFormModel.value.grossAmount &&
// personSaleryFormModel.value.mpfAmount &&
// personSaleryFormModel.value.otherAmount
// ) {
// }
try
{
let
params
=
{
grossAmount
:
personSaleryFormModel
.
value
.
grossAmount
,
...
...
@@ -949,7 +956,6 @@ const handleFormInputChange = async (prop, value, item) => {
ElMessage
.
error
(
'实发金额计算失败'
)
}
}
}
}
const
handleFormSelectChange
=
async
(
prop
,
value
,
item
)
=>
{
console
.
log
(
'表单选中项改变'
,
prop
,
value
,
item
)
...
...
@@ -999,8 +1005,18 @@ const setSignleSalaryFormStatus = () => {
const
handleSingleAdd
=
()
=>
{
commonDialogTit
.
value
=
'增加薪资单'
commonDialogType
.
value
=
'add'
personSaleryFormModel
.
value
=
{
apiSalaryRemittanceFzDTO
:
{}
}
salaryRemittanceDTOList
.
value
=
[{}]
personSaleryFormModel
.
value
=
{
apiSalaryRemittanceFzDTO
:
{},
otherAmount
:
0
,
mpfAmount
:
0
,
grossAmount
:
0
}
salaryRemittanceDTOList
.
value
=
[
{
amount
:
0
,
signleId
:
Date
.
now
()
+
Math
.
random
()
}
]
setSignleSalaryFormStatus
()
detailDialogVisible
.
value
=
true
}
...
...
@@ -1094,7 +1110,14 @@ const handleAdd = () => {
if
(
addRecordRef
.
value
)
{
addRecordRef
.
value
.
resetForm
()
}
apiSalaryBatchAddDTOList
.
value
=
[{}]
apiSalaryBatchAddDTOList
.
value
=
[
{
multipleId
:
Date
.
now
()
+
Math
.
random
(),
// 或使用 uuid
otherAmount
:
0
,
mpfAmount
:
0
,
grossAmount
:
0
}
]
}
const
handleExport
=
async
()
=>
{
...
...
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