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
5a2f5eb0
Commit
5a2f5eb0
authored
Jun 24, 2026
by
yuzhenWang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'wyz' into 'test'
对接电子薪资单的导出 See merge request
!171
parents
a1e72a7e
b58581cf
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
6 deletions
+32
-6
src/api/salary/index.js
+9
-0
src/views/payslip/electronicSalary.vue
+23
-6
No files found.
src/api/salary/index.js
View file @
5a2f5eb0
...
@@ -118,6 +118,15 @@ export function checkSalaryApi(data) {
...
@@ -118,6 +118,15 @@ export function checkSalaryApi(data) {
data
:
data
data
:
data
})
})
}
}
// 电子薪资单导出
export
function
electronicExport
(
data
)
{
return
request
({
url
:
'/csf/api/salary/salary/export'
,
method
:
'post'
,
data
:
data
,
})
}
// 下载选中的发佣数据
// 下载选中的发佣数据
export
function
downloadPolicyFortune
(
data
)
{
export
function
downloadPolicyFortune
(
data
)
{
...
...
src/views/payslip/electronicSalary.vue
View file @
5a2f5eb0
...
@@ -149,7 +149,8 @@ import {
...
@@ -149,7 +149,8 @@ import {
delSalaryApi
,
delSalaryApi
,
electronicSalaryListApi
,
electronicSalaryListApi
,
pushSalaryApi
,
pushSalaryApi
,
checkSalaryApi
checkSalaryApi
,
electronicExport
}
from
'@/api/salary'
}
from
'@/api/salary'
import
SearchForm
from
'@/components/SearchForm/SearchForm.vue'
import
SearchForm
from
'@/components/SearchForm/SearchForm.vue'
import
{
loadDicts
,
getDictLabel
}
from
'@/utils/useDict'
import
{
loadDicts
,
getDictLabel
}
from
'@/utils/useDict'
...
@@ -707,14 +708,30 @@ const handlePush = async () => {
...
@@ -707,14 +708,30 @@ const handlePush = async () => {
}
}
const
handleExport
=
async
()
=>
{
const
handleExport
=
async
()
=>
{
ElMessage
.
info
(
'导出待开发'
)
//
ElMessage.info('导出待开发')
return
//
return
// 获取搜索参数
// 获取搜索参数
const
params
=
searchFormRef
.
value
?.
getFormData
()
||
{}
const
params
=
searchFormRef
.
value
?.
getFormData
()
||
{}
const
response
=
await
exportReceivedFortune
(
params
)
const
response
=
await
electronicExport
(
params
)
console
.
log
(
'response'
,
response
)
// 创建隐藏的下载链接
const
link
=
document
.
createElement
(
'a'
)
link
.
href
=
response
.
data
.
url
link
.
target
=
'_blank'
// 新窗口打开
// 设置下载文件名(重要)
// 从URL中提取文件名,或者使用返回的文件名
const
fileName
=
'电子薪资单'
link
.
download
=
fileName
// 触发下载
document
.
body
.
appendChild
(
link
)
link
.
click
()
document
.
body
.
removeChild
(
link
)
// 文件名设置为应收款导出_yyyy-MM-dd hh:mm:ss.xlsx,不需要-,用字符串
// 文件名设置为应收款导出_yyyy-MM-dd hh:mm:ss.xlsx,不需要-,用字符串
const
fileName
=
`应收款
导出_
${
new
Date
().
toLocaleString
().
replace
(
/
\/
/g
,
''
).
replace
(
/:/g
,
''
).
replace
(
/
\s
/g
,
''
)}
.xlsx`
// const fileName = `电子薪资单
导出_${new Date().toLocaleString().replace(/\//g, '').replace(/:/g, '').replace(/\s/g, '')}.xlsx`
await
safeDownload
(
response
,
fileName
,
'application/vnd.ms-excel;charset=utf-8'
)
//
await safeDownload(response, fileName, 'application/vnd.ms-excel;charset=utf-8')
}
}
const
handleReset
=
()
=>
{
const
handleReset
=
()
=>
{
...
...
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