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
30fd22f8
Commit
30fd22f8
authored
Jun 24, 2026
by
yuzhenWang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'wyz' into 'test'
修改薪资单计算代码 See merge request
!175
parents
b3301dd3
005a8c87
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
72 additions
and
49 deletions
+72
-49
src/views/payslip/wordReferenceSalary.vue
+72
-49
No files found.
src/views/payslip/wordReferenceSalary.vue
View file @
30fd22f8
...
...
@@ -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,20 +705,21 @@ 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
)
{
try
{
let
params
=
{
grossAmount
:
currentRow
.
grossAmount
,
mpfAmount
:
currentRow
.
mpfAmount
,
otherAmount
:
currentRow
.
otherAmount
}
const
res
=
await
calculatePaidAmount
(
params
)
updatedRow
.
paidAmount
=
res
.
data
needUpdate
=
true
}
catch
(
error
)
{
console
.
log
(
'实发金额计算失败'
,
error
)
ElMessage
.
error
(
'实发金额计算失败'
)
// if (currentRow.grossAmount && currentRow.mpfAmount && currentRow.otherAmount) {
// }
try
{
let
params
=
{
grossAmount
:
currentRow
.
grossAmount
,
mpfAmount
:
currentRow
.
mpfAmount
,
otherAmount
:
currentRow
.
otherAmount
}
const
res
=
await
calculatePaidAmount
(
params
)
updatedRow
.
paidAmount
=
res
.
data
needUpdate
=
true
}
catch
(
error
)
{
console
.
log
(
'实发金额计算失败'
,
error
)
ElMessage
.
error
(
'实发金额计算失败'
)
}
}
// 如果用户手动修改了 hkdAmount,不做反向联动(符合需求)
...
...
@@ -823,21 +827,22 @@ const handleSingleSalaryCellChange = async ({ row, col, newValue, oldValue, rowI
}
//计算折合港币总金额,改变币种汇率也会改变,所以等表格更新完在更新折合港币总金额
if
(
prop
===
'amount'
||
prop
===
'exchangeRate'
)
{
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
)
{
acc
.
push
({
...
item
})
}
return
acc
},
[])
const
res
=
await
calculateTotalAmountApi
({
calculateTotalAmountDTOList
:
params
})
personSaleryFormModel
.
value
.
apiSalaryRemittanceFzDTO
.
totalAmount
=
res
.
data
}
catch
(
error
)
{
console
.
log
(
'折合港币总金额计算失败'
,
error
)
ElMessage
.
error
(
'折合港币总金额计算失败'
)
}
// if (currentRow.amount && currentRow.exchangeRate && currentRow.currency) {
// }
try
{
let
calculateTotalAmountDTOList
=
JSON
.
parse
(
JSON
.
stringify
(
salaryRemittanceDTOList
.
value
))
let
params
=
calculateTotalAmountDTOList
.
reduce
((
acc
,
item
)
=>
{
if
(
item
.
exchangeRate
&&
item
.
currency
)
{
acc
.
push
({
...
item
})
}
return
acc
},
[])
const
res
=
await
calculateTotalAmountApi
({
calculateTotalAmountDTOList
:
params
})
personSaleryFormModel
.
value
.
apiSalaryRemittanceFzDTO
.
totalAmount
=
res
.
data
}
catch
(
error
)
{
console
.
log
(
'折合港币总金额计算失败'
,
error
)
ElMessage
.
error
(
'折合港币总金额计算失败'
)
}
}
}
...
...
@@ -931,23 +936,24 @@ 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
)
{
try
{
let
params
=
{
grossAmount
:
personSaleryFormModel
.
value
.
grossAmount
,
mpfAmount
:
personSaleryFormModel
.
value
.
mpfAmount
,
otherAmount
:
personSaleryFormModel
.
value
.
otherAmount
}
const
res
=
await
calculatePaidAmount
(
params
)
personSaleryFormModel
.
value
.
paidAmount
=
res
.
data
}
catch
(
error
)
{
console
.
log
(
'实发金额计算失败'
,
error
)
ElMessage
.
error
(
'实发金额计算失败'
)
// if (
// personSaleryFormModel.value.grossAmount &&
// personSaleryFormModel.value.mpfAmount &&
// personSaleryFormModel.value.otherAmount
// ) {
// }
try
{
let
params
=
{
grossAmount
:
personSaleryFormModel
.
value
.
grossAmount
,
mpfAmount
:
personSaleryFormModel
.
value
.
mpfAmount
,
otherAmount
:
personSaleryFormModel
.
value
.
otherAmount
}
const
res
=
await
calculatePaidAmount
(
params
)
personSaleryFormModel
.
value
.
paidAmount
=
res
.
data
}
catch
(
error
)
{
console
.
log
(
'实发金额计算失败'
,
error
)
ElMessage
.
error
(
'实发金额计算失败'
)
}
}
}
...
...
@@ -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