Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
ydLife
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
0
Merge Requests
0
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
Sweet Zhang
ydLife
Commits
07ab2a1f
Commit
07ab2a1f
authored
Jun 17, 2020
by
Chao Sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pdf移动端下载
parent
9320374b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
0 deletions
+4
-0
src/app/my/my.service.ts
+3
-0
src/app/my/salary/salary.component.ts
+1
-0
No files found.
src/app/my/my.service.ts
View file @
07ab2a1f
...
@@ -318,10 +318,13 @@ export class MyService {
...
@@ -318,10 +318,13 @@ export class MyService {
//薪资pdf
//薪资pdf
payScalePdf
(
param
)
{
payScalePdf
(
param
)
{
this
.
http
.
post
(
`
${
this
.
ydapi
}
/practitioner/payScalePdf`
,
param
,
{
responseType
:
'blob'
,
observe
:
'response'
}).
subscribe
(
data
=>
{
this
.
http
.
post
(
`
${
this
.
ydapi
}
/practitioner/payScalePdf`
,
param
,
{
responseType
:
'blob'
,
observe
:
'response'
}).
subscribe
(
data
=>
{
console
.
log
(
data
)
const
link
=
document
.
createElement
(
'a'
);
const
link
=
document
.
createElement
(
'a'
);
const
blob
=
new
Blob
([
data
.
body
],
{
type
:
'application/pdf;charset=UTF-8'
});
const
blob
=
new
Blob
([
data
.
body
],
{
type
:
'application/pdf;charset=UTF-8'
});
console
.
log
(
blob
)
link
.
setAttribute
(
'href'
,
window
.
URL
.
createObjectURL
(
blob
));
link
.
setAttribute
(
'href'
,
window
.
URL
.
createObjectURL
(
blob
));
link
.
setAttribute
(
'download'
,
data
.
headers
.
get
(
'Content-Disposition'
).
split
(
'filename='
)[
1
]);
link
.
setAttribute
(
'download'
,
data
.
headers
.
get
(
'Content-Disposition'
).
split
(
'filename='
)[
1
]);
alert
(
data
.
headers
.
get
(
'Content-Disposition'
).
split
(
'filename='
)[
1
])
link
.
style
.
visibility
=
'hidden'
;
link
.
style
.
visibility
=
'hidden'
;
document
.
body
.
appendChild
(
link
);
document
.
body
.
appendChild
(
link
);
link
.
click
();
link
.
click
();
...
...
src/app/my/salary/salary.component.ts
View file @
07ab2a1f
...
@@ -28,6 +28,7 @@ export class SalaryComponent implements OnInit {
...
@@ -28,6 +28,7 @@ export class SalaryComponent implements OnInit {
//下载pdf
//下载pdf
getPdf
(
monShId
)
{
getPdf
(
monShId
)
{
this
.
myService
.
payScalePdf
({
monShId
:
monShId
})
this
.
myService
.
payScalePdf
({
monShId
:
monShId
})
}
}
}
}
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