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
33f791b9
Commit
33f791b9
authored
May 04, 2023
by
dragondean@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改提单制作的文件名规则
parent
b6a0591c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
makeLadingBill.vue
src/views/ecw/box/ladingBill/makeLadingBill.vue
+9
-2
No files found.
src/views/ecw/box/ladingBill/makeLadingBill.vue
View file @
33f791b9
...
...
@@ -50,6 +50,7 @@ import html2canvas from 'html2canvas';
import
{
jsPDF
}
from
"
jspdf
"
;
import
{
uploadFile
}
from
'
@/api/infra/file
'
import
FileSaver
from
'
file-saver
'
import
{
getOrder
,
getOrderDetail
}
from
"
@/api/ecw/order
"
;
window
.
html2canvas
=
html2canvas
export
default
{
name
:
"
makeLadingBill
"
,
...
...
@@ -175,7 +176,13 @@ export default {
showLoaingTemplate
()
{
this
.
visible
=
true
;
},
// 先获取订单信息,pdf用 订单号+唛头命名
createPdf
(){
getOrder
(
this
.
currRow
.
orderId
).
then
(
res
=>
{
this
.
afterCreatePdf
(
res
.
data
)
})
},
afterCreatePdf
(
orderData
){
let
loading
=
this
.
$loading
()
html2canvas
(
document
.
querySelector
(
"
#html2canvas-container
"
),
{
dpi
:
144
,
useCORS
:
true
}).
then
(
canvas
=>
{
const
doc
=
new
jsPDF
(
'
p
'
,
'
pt
'
,
'
a4
'
,
true
);
...
...
@@ -194,13 +201,13 @@ export default {
/* doc.save("a4.pdf");
return Promise.reject() */
let
form
=
new
FormData
()
let
file
=
this
.
selfNo
+
'
-
'
+
this
.
currRow
.
tidanNo
+
'
.pdf
'
let
file
=
this
.
currRow
.
orderNo
+
'
-
'
+
orderData
.
marks
+
'
.pdf
'
//this.
selfNo + '-' + this.currRow.tidanNo + '.pdf'
form
.
append
(
'
file
'
,
new
File
([
doc
.
output
(
'
arraybuffer
'
)],
file
,
{
type
:
'
application/pdf
'
}))
form
.
append
(
'
path
'
,
`admin/shipment/
${
this
.
selfNo
}
/pdf/
${
file
}
`
)
// 最前面不能有/,否则返回的url会有两个/
/* let blob = new Blob([doc.output('arraybuffer')], {type: "application/pdf"})
FileSaver.saveAs(blob, file);
FileSaver.saveAs(blob, file);
return */
return
uploadFile
(
form
)
}).
then
(
res
=>
{
...
...
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