Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiedao-app-operator-master
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lanbaoming
jiedao-app-operator-master
Commits
470036ca
Commit
470036ca
authored
Dec 27, 2022
by
dragondean@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
重新适配订单详情的查看提单
parent
a16d9863
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
8 deletions
+21
-8
box.js
src/api/ecw/box.js
+1
-1
PrintLadingBill.vue
src/views/ecw/order/components/PrintLadingBill.vue
+20
-7
No files found.
src/api/ecw/box.js
View file @
470036ca
...
...
@@ -231,7 +231,7 @@ export function downloadByOrderId(orderId) {
url
:
"
/shipment/make-bill-of-lading/downloadByOrderId
"
,
method
:
"
get
"
,
params
:
{
orderId
},
responseType
:
"
arraybuffer
"
,
/* responseType: "arraybuffer", */
});
}
...
...
src/views/ecw/order/components/PrintLadingBill.vue
View file @
470036ca
...
...
@@ -4,9 +4,10 @@
<i
class=
"el-icon-loading"
slot=
"icon"
style=
"font-size: 40px"
/>
</el-result>
<pdf-viewer
id=
"pdfViewer"
ref=
"viewer"
v-if=
"pdfData"
:url=
"pdfData"
style=
"display:block; margin: 0 auto; max-height: 80vh; overflow:auto;"
/>
<!--
<div
v-if=
"detail"
class=
"billcontent"
v-html=
"detail.billContent"
></div>
-->
<p
class=
"subs"
style=
"text-align:center"
>
<el-button
type=
"primary"
@
click=
"download"
:disabled=
"!
pdfData
"
>
{{
$t
(
'
下载
'
)
}}
</el-button>
<el-button
type=
"primary"
@
click=
"print"
:disabled=
"!
pdfData
"
>
{{
$t
(
'
打印
'
)
}}
</el-button>
<el-button
type=
"primary"
@
click=
"download"
:disabled=
"!
detail
"
>
{{
$t
(
'
下载
'
)
}}
</el-button>
<el-button
type=
"primary"
@
click=
"print"
:disabled=
"!
detail
"
>
{{
$t
(
'
打印
'
)
}}
</el-button>
</p>
</el-dialog>
</
template
>
...
...
@@ -17,7 +18,7 @@ import lodop from '@/utils/lodop'
import
PdfViewer
from
'
@/components/PdfViewer
'
import
FileSaver
from
'
file-saver
'
import
{
downloadByOrderId
}
from
'
@/api/ecw/box
'
import
html2canvas
from
'
html2canvas
'
export
default
{
components
:
{
PdfViewer
},
filters
:
{
parseTime
},
...
...
@@ -34,9 +35,19 @@ export default {
billLadingNo: 'TD20220717',
type: 1, */
pdfData
:
null
,
detail
:
null
,
loading
:
false
}
},
watch
:{
detail
(){
/* this.pdfData = this.detail.imgUrl */
fetch
(
this
.
detail
.
imgUrl
).
then
(
async
response
=>
{
console
.
log
(
response
)
this
.
pdfData
=
await
response
.
arrayBuffer
()
})
}
},
computed
:{
title
(){
let
t
=
this
.
$t
(
'
提货单
'
)
...
...
@@ -59,9 +70,9 @@ export default {
loadData
(){
this
.
loading
=
true
downloadByOrderId
(
this
.
orderId
)
.
then
(
arrayBuffer
=>
{
console
.
log
({
arrayBuffer
})
this
.
pdfData
=
arrayBuffer
.
then
(
res
=>
{
this
.
detail
=
res
.
data
/* this.pdfData = arrayBuffer */
})
.
finally
(()
=>
{
this
.
loading
=
false
...
...
@@ -71,9 +82,10 @@ export default {
this
.
show
=
false
this
.
$emit
(
'
close
'
);
},
download
(){
let
blob
=
new
Blob
([
this
.
pdfData
],
{
type
:
"
application/pdf
"
})
FileSaver
.
saveAs
(
blob
,
this
.
title
+
'
.pdf
'
);
FileSaver
.
saveAs
(
blob
,
this
.
title
+
'
.pdf
'
);
},
print
(){
lodop
().
then
(
LODOP
=>
{
...
...
@@ -82,6 +94,7 @@ export default {
LODOP
.
SET_PRINT_STYLE
(
"
Bold
"
,
1
);
LODOP
.
SET_PRINT_PAGESIZE
(
0
);
LODOP
.
SET_PRINT_PAGESIZE
(
0
,
2100
,
2970
,
"
A4
"
);
// html2canvas(document.querySelector('.billcontent'))
let
dataURLs
=
this
.
$refs
.
viewer
.
getDataURLs
()
console
.
log
(
dataURLs
)
for
(
let
page
in
dataURLs
){
...
...
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