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
af056850
Commit
af056850
authored
Oct 14, 2025
by
Sweet Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
对接薪资接口,将没调通的接口注释掉
parent
f4cb66d2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
340 additions
and
150 deletions
+340
-150
src/api/financial/commission.js
+45
-0
src/views/financialCenter/financialBilling.vue
+2
-2
src/views/financialCenter/financialIncome.vue
+4
-4
src/views/financialCenter/financialSalary.vue
+289
-144
No files found.
src/api/financial/commission.js
View file @
af056850
...
@@ -118,5 +118,50 @@ export function getReconciliationCompanyList(data) {
...
@@ -118,5 +118,50 @@ export function getReconciliationCompanyList(data) {
})
})
}
}
// 删除出账
// /csf/api/fortune/delete
export
function
deletePolicyFortune
(
data
)
{
return
request
({
url
:
'/csf/api/fortune/delete/fortuneAccount'
,
method
:
'post'
,
data
:
data
})
}
// 修改出账信息
// /csf/api/fortune/update/fortuneAccount
export
function
updatePolicyFortuneAccount
(
data
)
{
return
request
({
url
:
'/csf/api/fortune/update/fortuneAccount'
,
method
:
'post'
,
data
:
data
})
}
// 新建出账
// /csf/api/fortune/add/fortuneAccount
export
function
addPolicyFortuneAccount
(
data
)
{
return
request
({
url
:
'/csf/api/fortune/add/fortuneAccount'
,
method
:
'post'
,
data
:
data
})
}
// 删除发佣
// /csf/api/fortune/delete/fortuneAccount
export
function
deletePolicyFortuneAccount
(
data
)
{
return
request
({
url
:
'/csf/api/fortune/delete'
,
method
:
'post'
,
data
:
data
})
}
src/views/financialCenter/financialBilling.vue
View file @
af056850
...
@@ -90,13 +90,13 @@
...
@@ -90,13 +90,13 @@
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
prop=
"remark"
label=
"备注"
min-width=
"150"
show-overflow-tooltip
/>
<el-table-column
prop=
"remark"
label=
"备注"
min-width=
"150"
show-overflow-tooltip
/>
<el-table-column
label=
"操作"
width=
"200"
fixed=
"right"
>
<
!-- <
el-table-column label="操作" width="200" fixed="right">
<template #default="{ row }">
<template #default="{ row }">
<el-button size="small" @click="handleEdit(row)">修改</el-button>
<el-button size="small" @click="handleEdit(row)">修改</el-button>
<el-button size="small" type="danger" @click="handleDelete(row)">删除</el-button>
<el-button size="small" type="danger" @click="handleDelete(row)">删除</el-button>
<el-button size="small" type="info" @click="handleView(row)">查看</el-button>
<el-button size="small" type="info" @click="handleView(row)">查看</el-button>
</template>
</template>
</el-table-column>
</el-table-column>
-->
</el-table>
</el-table>
<!-- 分页 -->
<!-- 分页 -->
...
...
src/views/financialCenter/financialIncome.vue
View file @
af056850
...
@@ -151,8 +151,8 @@
...
@@ -151,8 +151,8 @@
</el-form-item>
</el-form-item>
</el-col>
</el-col>
<el-col
:span=
"12"
>
<el-col
:span=
"12"
>
<el-form-item
label=
"当前期数"
prop=
"c
urrent
Period"
>
<el-form-item
label=
"当前期数"
prop=
"c
ommission
Period"
>
<el-input-number
v-model=
"editForm.c
urrent
Period"
:min=
"1"
/>
<el-input-number
v-model=
"editForm.c
ommission
Period"
:min=
"1"
/>
</el-form-item>
</el-form-item>
</el-col>
</el-col>
<el-col
:span=
"12"
>
<el-col
:span=
"12"
>
...
@@ -503,7 +503,7 @@ const handleEdit = (row) => {
...
@@ -503,7 +503,7 @@ const handleEdit = (row) => {
commissionBizId
:
row
.
commissionBizId
,
commissionBizId
:
row
.
commissionBizId
,
policyNo
:
row
.
policyNo
,
policyNo
:
row
.
policyNo
,
reconciliationCompany
:
row
.
reconciliationCompany
,
reconciliationCompany
:
row
.
reconciliationCompany
,
c
urrentPeriod
:
row
.
current
Period
||
1
,
c
ommissionPeriod
:
row
.
commission
Period
||
1
,
totalPeriod
:
row
.
totalPeriod
||
1
,
totalPeriod
:
row
.
totalPeriod
||
1
,
commissionName
:
row
.
commissionName
,
commissionName
:
row
.
commissionName
,
amount
:
row
.
amount
,
amount
:
row
.
amount
,
...
@@ -521,7 +521,7 @@ const submitEditForm = async () => {
...
@@ -521,7 +521,7 @@ const submitEditForm = async () => {
await
editFormRef
.
value
.
validate
()
await
editFormRef
.
value
.
validate
()
editLoading
.
value
=
true
editLoading
.
value
=
true
console
.
log
(
editForm
)
// 调用更新接口
// 调用更新接口
await
updatePolicyCommission
(
editForm
)
await
updatePolicyCommission
(
editForm
)
...
...
src/views/financialCenter/financialSalary.vue
View file @
af056850
...
@@ -5,12 +5,19 @@
...
@@ -5,12 +5,19 @@
<el-form
:model=
"queryParams"
label-width=
"80px"
>
<el-form
:model=
"queryParams"
label-width=
"80px"
>
<el-row
:gutter=
"20"
>
<el-row
:gutter=
"20"
>
<el-col
:xs=
"24"
:sm=
"12"
:md=
"8"
:lg=
"6"
>
<el-col
:xs=
"24"
:sm=
"12"
:md=
"8"
:lg=
"6"
>
<el-form-item
label=
"
保单号
"
>
<el-form-item
label=
"
出账状态
"
>
<el-
inpu
t
<el-
selec
t
v-model=
"queryParams.
policyNo
"
v-model=
"queryParams.
status
"
placeholder=
"请
输入保单号
"
placeholder=
"请
选择出账状态
"
clearable
clearable
/>
>
<el-option
v-for=
"item in dictLists"
:key=
"item.itemValue"
:label=
"item.itemLabel"
:value=
"item.itemValue"
/>
</el-select>
</el-form-item>
</el-form-item>
</el-col>
</el-col>
<el-col
:xs=
"24"
:sm=
"12"
:md=
"8"
:lg=
"6"
>
<el-col
:xs=
"24"
:sm=
"12"
:md=
"8"
:lg=
"6"
>
...
@@ -49,7 +56,7 @@
...
@@ -49,7 +56,7 @@
<el-row
:gutter=
"10"
>
<el-row
:gutter=
"10"
>
<el-col
:span=
"12"
>
<el-col
:span=
"12"
>
<el-button
type=
"primary"
@
click=
"handleCreate"
>
新建薪资记录
</el-button>
<el-button
type=
"primary"
@
click=
"handleCreate"
>
新建薪资记录
</el-button>
<
el-button
@
click=
"handleImport"
>
批量导入
</el-button
>
<
!--
<el-button
@
click=
"handleImport"
>
批量导入
</el-button>
--
>
</el-col>
</el-col>
<el-col
:span=
"12"
style=
"text-align: right;"
>
<el-col
:span=
"12"
style=
"text-align: right;"
>
<el-button
<el-button
...
@@ -75,7 +82,7 @@
...
@@ -75,7 +82,7 @@
<el-table-column
prop=
"team"
label=
"所属团队"
min-width=
"120"
/>
<el-table-column
prop=
"team"
label=
"所属团队"
min-width=
"120"
/>
<el-table-column
prop=
"amount"
label=
"出账金额"
width=
"120"
>
<el-table-column
prop=
"amount"
label=
"出账金额"
width=
"120"
>
<template
#
default=
"
{ row }">
<template
#
default=
"
{ row }">
{{
formatCurrency
(
row
.
amount
)
}}
{{
formatCurrency
(
row
.
amount
,
row
.
currency
)
}}
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
prop=
"currency"
label=
"出账币种"
width=
"100"
/>
<el-table-column
prop=
"currency"
label=
"出账币种"
width=
"100"
/>
...
@@ -91,7 +98,7 @@
...
@@ -91,7 +98,7 @@
<
template
#
default=
"{ row }"
>
<
template
#
default=
"{ row }"
>
<el-button
size=
"small"
@
click=
"handleEdit(row)"
>
修改
</el-button>
<el-button
size=
"small"
@
click=
"handleEdit(row)"
>
修改
</el-button>
<el-button
size=
"small"
type=
"danger"
@
click=
"handleDelete(row)"
>
删除
</el-button>
<el-button
size=
"small"
type=
"danger"
@
click=
"handleDelete(row)"
>
删除
</el-button>
<
el-button
size=
"small"
type=
"info"
@
click=
"generateSalarySlip(row)"
>
生成薪资单
</el-button
>
<
!--
<el-button
size=
"small"
type=
"info"
@
click=
"generateSalarySlip(row)"
>
生成薪资单
</el-button>
--
>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
...
@@ -108,15 +115,32 @@
...
@@ -108,15 +115,32 @@
/>
/>
</el-card>
</el-card>
<!--
新建薪资记录对话框
-->
<!--
出账完成弹窗
-->
<el-dialog
<el-dialog
title=
"新建薪资记录"
title=
"出账完成"
v-model=
"createDialogVisible"
v-model=
"billingCompleteDialogVisible"
width=
"400px"
>
<div
style=
"text-align: center;"
>
<el-icon
size=
"48"
color=
"#67C23A"
>
<SuccessFilled
/>
</el-icon>
<p
style=
"margin-top: 16px; font-size: 16px;"
>
出账操作已完成!
</p>
</div>
<
template
#
footer
>
<!--
<el-button
type=
"primary"
@
click=
"generateSalarySlips"
>
生成薪资单
</el-button>
-->
<el-button
@
click=
"billingCompleteDialogVisible = false"
>
关闭
</el-button>
</
template
>
</el-dialog>
<!-- 薪资记录对话框(新建/编辑共用) -->
<el-dialog
:title=
"dialogTitle"
v-model=
"salaryDialogVisible"
width=
"500px"
width=
"500px"
>
>
<el-form
:model=
"
createFormData
"
label-width=
"100px"
>
<el-form
:model=
"
salaryFormData"
:rules=
"salaryFormRules"
ref=
"salaryFormRef
"
label-width=
"100px"
>
<el-form-item
label=
"转介人"
required
>
<el-form-item
label=
"转介人"
prop=
"broker"
required
>
<el-select
v-model=
"
createFormData.referr
er"
placeholder=
"请选择转介人"
>
<el-select
v-model=
"
salaryFormData.brok
er"
placeholder=
"请选择转介人"
>
<el-option
<el-option
v-for=
"item in referrerOptions"
v-for=
"item in referrerOptions"
:key=
"item.value"
:key=
"item.value"
...
@@ -125,23 +149,45 @@
...
@@ -125,23 +149,45 @@
/>
/>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item
label=
"出账金额"
required
>
<el-form-item
label=
"出账金额"
prop=
"amount"
required
>
<el-input-number
<el-input-number
v-model=
"
create
FormData.amount"
v-model=
"
salary
FormData.amount"
:min=
"0"
:min=
"0"
:precision=
"2"
:precision=
"2"
placeholder=
"请输入出账金额"
placeholder=
"请输入出账金额"
/>
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"出账项目"
required
>
<el-form-item
label=
"出账币种"
prop=
"currency"
required
>
<el-input
<el-select
v-model=
"salaryFormData.currency"
placeholder=
"请选择出账币种"
>
v-model=
"createFormData.billingItem"
<el-option
placeholder=
"请输入出账项目"
v-for=
"item in currencyTypeOptions"
:key=
"item.itemValue"
:label=
"item.itemLabel"
:value=
"item.itemValue"
/>
</el-select>
</el-form-item>
<el-form-item
label=
"出账状态"
prop=
"status"
required
>
<el-select
v-model=
"salaryFormData.status"
placeholder=
"请选择出账状态"
>
<el-option
v-for=
"item in dictLists"
:key=
"item.itemValue"
:label=
"item.itemLabel"
:value=
"item.itemValue"
/>
</el-select>
</el-form-item>
<el-form-item
label=
"出账日期"
prop=
"fortuneAccountDate"
required
>
<el-date-picker
v-model=
"salaryFormData.fortuneAccountDate"
type=
"date"
value-format=
"YYYY-MM-DD"
placeholder=
"请选择出账日期"
/>
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"备注"
>
<el-form-item
label=
"备注"
>
<el-input
<el-input
v-model=
"
create
FormData.remark"
v-model=
"
salary
FormData.remark"
type=
"textarea"
type=
"textarea"
:rows=
"3"
:rows=
"3"
placeholder=
"请输入备注信息"
placeholder=
"请输入备注信息"
...
@@ -149,26 +195,8 @@
...
@@ -149,26 +195,8 @@
</el-form-item>
</el-form-item>
</el-form>
</el-form>
<
template
#
footer
>
<
template
#
footer
>
<el-button
@
click=
"createDialogVisible = false"
>
取消
</el-button>
<el-button
@
click=
"salaryDialogVisible = false"
>
取消
</el-button>
<el-button
type=
"primary"
@
click=
"submitCreateForm"
>
确认
</el-button>
<el-button
type=
"primary"
@
click=
"submitSalaryForm"
>
确认
</el-button>
</
template
>
</el-dialog>
<!-- 出账完成弹窗 -->
<el-dialog
title=
"出账完成"
v-model=
"billingCompleteDialogVisible"
width=
"400px"
>
<div
style=
"text-align: center;"
>
<el-icon
size=
"48"
color=
"#67C23A"
>
<SuccessFilled
/>
</el-icon>
<p
style=
"margin-top: 16px; font-size: 16px;"
>
出账操作已完成!
</p>
</div>
<
template
#
footer
>
<el-button
type=
"primary"
@
click=
"generateSalarySlips"
>
生成薪资单
</el-button>
<el-button
@
click=
"billingCompleteDialogVisible = false"
>
关闭
</el-button>
</
template
>
</
template
>
</el-dialog>
</el-dialog>
</div>
</div>
...
@@ -178,7 +206,7 @@
...
@@ -178,7 +206,7 @@
import
{
ref
,
reactive
,
onMounted
}
from
'vue'
import
{
ref
,
reactive
,
onMounted
}
from
'vue'
import
{
ElMessage
,
ElMessageBox
}
from
'element-plus'
import
{
ElMessage
,
ElMessageBox
}
from
'element-plus'
import
{
SuccessFilled
}
from
'@element-plus/icons-vue'
import
{
SuccessFilled
}
from
'@element-plus/icons-vue'
import
{
getReferrerFortuneList
,
updatePolicyFortuneStatus
}
from
'@/api/financial/commission'
import
{
getReferrerFortuneList
}
from
'@/api/financial/commission'
// 查询参数
// 查询参数
const
queryParams
=
reactive
({
const
queryParams
=
reactive
({
...
@@ -199,16 +227,8 @@ const loading = ref(false)
...
@@ -199,16 +227,8 @@ const loading = ref(false)
const
selectedRows
=
ref
([])
const
selectedRows
=
ref
([])
// 对话框相关
// 对话框相关
const
createDialogVisible
=
ref
(
false
)
const
billingCompleteDialogVisible
=
ref
(
false
)
const
billingCompleteDialogVisible
=
ref
(
false
)
// 新建表单数据
const
createFormData
=
reactive
({
referrer
:
''
,
amount
:
0
,
billingItem
:
''
,
remark
:
''
})
// 转介人选项
// 转介人选项
const
referrerOptions
=
[
const
referrerOptions
=
[
...
@@ -218,6 +238,45 @@ const referrerOptions = [
...
@@ -218,6 +238,45 @@ const referrerOptions = [
{
label
:
'赵六'
,
value
:
'zhaoliu'
}
{
label
:
'赵六'
,
value
:
'zhaoliu'
}
]
]
// 对话框相关
const
salaryDialogVisible
=
ref
(
false
)
const
dialogTitle
=
ref
(
'新建薪资记录'
)
const
isEditMode
=
ref
(
false
)
const
currentEditId
=
ref
(
''
)
// 薪资表单数据
const
salaryFormData
=
reactive
({
broker
:
''
,
amount
:
0
,
currency
:
'HKD'
,
status
:
''
,
fortuneAccountDate
:
''
,
remark
:
''
})
// 表单验证规则
const
salaryFormRules
=
{
broker
:
[
{
required
:
true
,
message
:
'请选择转介人'
,
trigger
:
'change'
}
],
amount
:
[
{
required
:
true
,
message
:
'请输入出账金额'
,
trigger
:
'blur'
},
{
type
:
'number'
,
min
:
0
,
message
:
'金额不能为负数'
,
trigger
:
'blur'
}
],
currency
:
[
{
required
:
true
,
message
:
'请选择出账币种'
,
trigger
:
'change'
}
],
status
:
[
{
required
:
true
,
message
:
'请选择出账状态'
,
trigger
:
'change'
}
],
fortuneAccountDate
:
[
{
required
:
true
,
message
:
'请选择出账日期'
,
trigger
:
'change'
}
]
}
// 表单引用
const
salaryFormRef
=
ref
()
// 初始化
// 初始化
onMounted
(()
=>
{
onMounted
(()
=>
{
getDictLists
()
getDictLists
()
...
@@ -230,11 +289,13 @@ onMounted(() => {
...
@@ -230,11 +289,13 @@ onMounted(() => {
const
getList
=
async
()
=>
{
const
getList
=
async
()
=>
{
loading
.
value
=
true
loading
.
value
=
true
try
{
try
{
if
(
queryParams
.
accountDate
.
length
>
0
)
{
const
params
=
{
queryParams
.
accountDateStart
=
queryParams
.
accountDate
[
0
]
...
queryParams
,
queryParams
.
accountDateEnd
=
queryParams
.
accountDate
[
1
]
accountDate
:
undefined
,
accountDateStart
:
queryParams
.
accountDate
.
length
>
0
?
queryParams
.
accountDate
[
0
]
+
' 00:00:00'
:
undefined
,
accountDateEnd
:
queryParams
.
accountDate
.
length
>
0
?
queryParams
.
accountDate
[
1
]
+
' 23:59:59'
:
undefined
,
}
}
const
response
=
await
getReferrerFortuneList
(
queryP
arams
)
const
response
=
await
getReferrerFortuneList
(
p
arams
)
tableData
.
value
=
response
.
data
.
records
tableData
.
value
=
response
.
data
.
records
total
.
value
=
response
.
data
.
total
total
.
value
=
response
.
data
.
total
loading
.
value
=
false
loading
.
value
=
false
...
@@ -278,44 +339,30 @@ const handleSelectionChange = (selection) => {
...
@@ -278,44 +339,30 @@ const handleSelectionChange = (selection) => {
selectedRows
.
value
=
selection
selectedRows
.
value
=
selection
}
}
// 新建薪资记录
import
{
deletePolicyFortune
}
from
'@/api/financial/commission'
const
handleCreate
=
()
=>
{
Object
.
assign
(
createFormData
,
{
referrer
:
''
,
amount
:
0
,
billingItem
:
''
,
remark
:
''
})
createDialogVisible
.
value
=
true
}
// 编辑薪资记录
const
handleEdit
=
(
row
)
=>
{
// 这里可以打开编辑对话框
ElMessage
.
info
(
`编辑转介人:
${
row
.
referrer
}
`
)
}
// 删除薪资记录
// 删除薪资记录
const
handleDelete
=
async
(
row
)
=>
{
const
handleDelete
=
async
(
row
)
=>
{
try
{
try
{
await
ElMessageBox
.
confirm
(
'确认删除这条薪资记录吗?'
,
'提示'
,
{
await
ElMessageBox
.
confirm
(
'确认删除这条薪资记录吗?'
,
'提示'
,
{
type
:
'warning'
type
:
'warning'
}).
then
(
async
()
=>
{
const
res
=
await
deletePolicyFortune
({
fortuneAccountBizId
:
row
.
fortuneAccountBizId
})
if
(
res
.
code
===
200
)
{
ElMessage
.
success
(
'删除成功'
)
getList
()
}
else
{
ElMessage
.
error
(
res
.
msg
)
}
})
})
// await api.deleteSalary(row.id)
}
ElMessage
.
success
(
'删除成功'
)
catch
(
error
)
{
getList
()
}
catch
(
error
)
{
if
(
error
!==
'cancel'
)
{
if
(
error
!==
'cancel'
)
{
ElMessage
.
error
(
'删除失败'
)
ElMessage
.
error
(
'删除失败'
)
}
}
}
}
}
}
// 批量导入
const
handleImport
=
()
=>
{
ElMessage
.
info
(
'批量导入功能待实现'
)
}
// 完成出账
// 完成出账
const
completeBilling
=
async
()
=>
{
const
completeBilling
=
async
()
=>
{
if
(
selectedRows
.
value
.
length
===
0
)
{
if
(
selectedRows
.
value
.
length
===
0
)
{
...
@@ -343,68 +390,83 @@ const completeBilling = async () => {
...
@@ -343,68 +390,83 @@ const completeBilling = async () => {
}
}
}
}
// 生成薪资单(单条)
const
generateSalarySlip
=
(
row
)
=>
{
// 调用生成薪资单API
// await api.generateSalarySlip(row.id)
ElMessage
.
success
(
`已为
${
row
.
referrer
}
生成薪资单`
)
}
// 生成薪资单(批量)
const
generateSalarySlips
=
()
=>
{
// 调用批量生成薪资单API
// await api.generateSalarySlips(selectedRows.value.map(item => item.id))
ElMessage
.
success
(
`已为
${
selectedRows
.
value
.
length
}
条记录生成薪资单`
)
billingCompleteDialogVisible
.
value
=
false
selectedRows
.
value
=
[]
}
// 提交新建表单
// 格式化金额
const
submitCreateForm
=
async
()
=>
{
const
formatCurrency
=
(
amount
,
currency
=
''
)
=>
{
try
{
const
currencyConfig
=
{
// 表单验证
'CNY'
:
{
if
(
!
createFormData
.
referrer
||
!
createFormData
.
amount
||
!
createFormData
.
billingItem
)
{
currency
:
'CNY'
,
ElMessage
.
warning
(
'请填写必填字段'
)
locale
:
'zh-CN'
,
return
symbol
:
'¥'
},
'HKD'
:
{
currency
:
'HKD'
,
locale
:
'zh-HK'
,
symbol
:
'HK$'
},
'USD'
:
{
currency
:
'USD'
,
locale
:
'en-US'
,
symbol
:
'$'
},
'EUR'
:
{
currency
:
'EUR'
,
locale
:
'de-DE'
,
symbol
:
'€'
},
'JPY'
:
{
currency
:
'JPY'
,
locale
:
'ja-JP'
,
symbol
:
'¥'
},
'GBP'
:
{
currency
:
'GBP'
,
locale
:
'en-GB'
,
symbol
:
'£'
},
''
:
{
currency
:
''
,
locale
:
''
,
symbol
:
''
}
}
}
// 调用保存API
// await api.createSalary(createFormData)
const
config
=
currencyConfig
[
currency
]
||
currencyConfig
[
''
]
ElMessage
.
success
(
'新建成功'
)
try
{
createDialogVisible
.
value
=
false
return
new
Intl
.
NumberFormat
(
config
.
locale
,
{
getList
()
style
:
'currency'
,
currency
:
config
.
currency
,
minimumFractionDigits
:
2
,
maximumFractionDigits
:
2
}).
format
(
amount
)
}
catch
(
error
)
{
}
catch
(
error
)
{
ElMessage
.
error
(
'新建失败'
)
// 如果Intl格式化失败,使用简单格式
return
`
${
config
.
symbol
}${
amount
.
toFixed
(
2
)}
`
}
}
}
}
// 格式化金额
const
formatCurrency
=
(
amount
)
=>
{
return
new
Intl
.
NumberFormat
(
'zh-CN'
,
{
style
:
'currency'
,
currency
:
'CNY'
}).
format
(
amount
)
}
import
{
listType
}
from
'@/api/system/dict/type'
import
{
listType
}
from
'@/api/system/dict/type'
const
dictLists
=
ref
([])
const
dictLists
=
ref
([])
const
currencyTypeOptions
=
ref
([])
// 获取出账状态字典值
// 获取出账状态字典值
const
getDictLists
=
()
=>
{
const
getDictLists
=
()
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
listType
({
typeList
:
[
'csf_fortune_status'
]}).
then
(
res
=>
{
listType
({
typeList
:
[
'csf_fortune_status'
,
'bx_currency_type'
]}).
then
(
res
=>
{
if
(
res
.
code
===
200
&&
res
.
data
)
{
if
(
res
.
code
===
200
&&
res
.
data
)
{
const
dictData
=
res
.
data
.
find
(
item
=>
item
.
dictType
===
'csf_fortune_status'
);
const
dictData
=
res
.
data
.
find
(
item
=>
item
.
dictType
===
'csf_fortune_status'
);
dictLists
.
value
=
dictData
?.
dictItemList
||
[];
dictLists
.
value
=
dictData
?.
dictItemList
||
[];
console
.
log
(
'获取到的字典数据:'
,
dictLists
.
value
);
currencyTypeOptions
.
value
=
res
.
data
.
find
(
item
=>
item
.
dictType
===
'bx_currency_type'
)?.
dictItemList
||
[];
resolve
(
dictLists
.
value
);
console
.
log
(
'获取到的币种字典数据:'
,
currencyTypeOptions
.
value
);
resolve
(
dictLists
.
value
,
currencyTypeOptions
.
value
);
}
else
{
}
else
{
dictList
s
.
value
=
[];
currencyTypeOption
s
.
value
=
[];
resolve
([]);
resolve
([]
,[]
);
}
}
}).
catch
(
error
=>
{
}).
catch
(
error
=>
{
console
.
error
(
'获取状态列表失败:'
,
error
);
console
.
error
(
'获取状态列表失败:'
,
error
);
dictLists
.
value
=
[];
dictLists
.
value
=
[];
currencyTypeOptions
.
value
=
[];
reject
(
error
);
reject
(
error
);
});
});
});
});
...
@@ -416,26 +478,6 @@ const convertStatusToDict = (status) => {
...
@@ -416,26 +478,6 @@ const convertStatusToDict = (status) => {
return
dictItem
?.
itemLabel
??
status
;
return
dictItem
?.
itemLabel
??
status
;
}
}
// 更新出账状态
const
updateStatus
=
async
(
row
)
=>
{
try
{
const
res
=
await
updatePolicyFortuneStatus
({
fortuneBizIdList
:
row
,
status
:
2
});
console
.
log
(
res
)
if
(
res
.
code
===
200
)
{
// 显示完成弹窗
billingCompleteDialogVisible
.
value
=
true
getList
()
}
else
{
ElMessage
.
error
(
res
.
msg
)
}
}
catch
(
error
)
{
}
}
// 完成出账
// 完成出账
import
{
completePolicyFortune
}
from
'@/api/financial/commission'
import
{
completePolicyFortune
}
from
'@/api/financial/commission'
const
fetchCompletePolicyFortune
=
async
(
row
)
=>
{
const
fetchCompletePolicyFortune
=
async
(
row
)
=>
{
...
@@ -456,6 +498,109 @@ const fetchCompletePolicyFortune = async (row) => {
...
@@ -456,6 +498,109 @@ const fetchCompletePolicyFortune = async (row) => {
}
}
}
}
// 新建薪资记录
const
handleCreate
=
()
=>
{
dialogTitle
.
value
=
'新建薪资记录'
isEditMode
.
value
=
false
currentEditId
.
value
=
''
// 重置表单数据
Object
.
assign
(
salaryFormData
,
{
broker
:
''
,
amount
:
0
,
currency
:
'HKD'
,
fortuneAccountDate
:
''
,
remark
:
''
})
// 重置表单验证
if
(
salaryFormRef
.
value
)
{
salaryFormRef
.
value
.
clearValidate
()
}
salaryDialogVisible
.
value
=
true
}
// 编辑薪资记录
const
handleEdit
=
(
row
)
=>
{
dialogTitle
.
value
=
'编辑薪资记录'
isEditMode
.
value
=
true
currentEditId
.
value
=
row
.
fortuneAccountBizId
||
''
// 填充表单数据
Object
.
assign
(
salaryFormData
,
{
broker
:
row
.
broker
||
row
.
broker
,
amount
:
row
.
amount
||
0
,
currency
:
row
.
currency
||
'HKD'
,
fortuneAccountDate
:
row
.
fortuneAccountDate
||
''
,
remark
:
row
.
remark
||
''
,
status
:
row
.
status
||
''
})
// 重置表单验证
if
(
salaryFormRef
.
value
)
{
salaryFormRef
.
value
.
clearValidate
()
}
salaryDialogVisible
.
value
=
true
}
import
{
addPolicyFortuneAccount
}
from
'@/api/financial/commission'
// 提交薪资表单(新建/编辑共用)
const
submitSalaryForm
=
async
()
=>
{
try
{
// 表单验证
const
valid
=
await
salaryFormRef
.
value
.
validate
()
if
(
!
valid
)
{
ElMessage
.
warning
(
'请完善表单信息'
)
return
}
// 准备提交数据
const
submitData
=
{
broker
:
salaryFormData
.
broker
,
amount
:
salaryFormData
.
amount
,
remark
:
salaryFormData
.
remark
,
currency
:
salaryFormData
.
currency
,
status
:
salaryFormData
.
status
,
fortuneAccountDate
:
salaryFormData
.
fortuneAccountDate
}
if
(
isEditMode
.
value
&&
currentEditId
.
value
)
{
// 编辑模式
submitData
.
fortuneAccountBizId
=
currentEditId
.
value
// 调用编辑API
const
res
=
await
addPolicyFortuneAccount
(
submitData
)
if
(
res
.
code
===
200
)
{
ElMessage
.
success
(
'编辑成功'
)
}
else
{
ElMessage
.
error
(
res
.
msg
)
}
}
else
{
// 新建模式
const
res
=
await
addPolicyFortuneAccount
(
submitData
)
if
(
res
.
code
===
200
)
{
ElMessage
.
success
(
'新建成功'
)
}
else
{
ElMessage
.
error
(
res
.
msg
)
}
}
salaryDialogVisible
.
value
=
false
getList
()
}
catch
(
error
)
{
if
(
error
.
errors
)
{
// 表单验证失败
ElMessage
.
warning
(
'请完善表单信息'
)
}
else
{
ElMessage
.
error
(
isEditMode
.
value
?
'编辑失败'
:
'新建失败'
)
}
}
}
</
script
>
</
script
>
<
style
scoped
>
<
style
scoped
>
...
...
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