Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
factory_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
qinjianhui
factory_front
Commits
81fe3f6a
Commit
81fe3f6a
authored
May 09, 2026
by
qinjianhui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 添加打印日志
parent
8bfd9fb8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
2 deletions
+41
-2
src/views/order/factoryOrderNew/index.vue
+41
-2
No files found.
src/views/order/factoryOrderNew/index.vue
View file @
81fe3f6a
...
...
@@ -1993,15 +1993,34 @@ const printOrder = async (
}
if
(
data
.
filePath
)
{
const
strURL
=
filePath
+
data
.
filePath
console
.
log
(
'strURL'
,
strURL
,
data
)
const
isHttpsPdf
=
/
(
https
)
:
\/\/([^/]
+
)
/i
.
test
(
strURL
)
console
.
log
(
'[printOrder] label source'
,
{
id
:
data
.
id
,
hasFilePath
:
!!
data
.
filePath
,
hasFileData
:
!!
data
.
fileData
,
isHttpsPdf
,
strURL
,
}
)
const
pdfPayload
=
isHttpsPdf
?
downloadPDF
(
strURL
)
:
strURL
console
.
log
(
'[printOrder] pdf payload meta'
,
{
mode
:
isHttpsPdf
?
'base64'
:
'url'
,
length
:
pdfPayload
?.
length
||
0
,
preview
:
pdfPayload
?.
slice
(
0
,
30
),
}
)
lodop
.
ADD_PRINT_PDF
(
0
,
0
,
'100%'
,
'100%'
,
/
(
https
)
:
\/\/([^/]
+
)
/i
.
test
(
strURL
)
?
downloadPDF
(
strURL
)
:
strURL
,
pdfPayload
,
)
}
else
{
console
.
log
(
'[printOrder] raw payload meta'
,
{
id
:
data
.
id
,
hasFilePath
:
!!
data
.
filePath
,
fileDataLength
:
data
.
fileData
?.
length
||
0
,
fileDataPreview
:
data
.
fileData
?.
slice
(
0
,
30
),
}
)
lodop
.
SEND_PRINT_RAWDATA
(
data
.
fileData
||
''
)
}
console
.
log
(
'lodop.CVERSION'
,
lodop
.
CVERSION
)
...
...
@@ -2100,7 +2119,22 @@ const downloadPDF = (url: string) => {
xhr
.
overrideMimeType
(
'text/plain; charset=x-user-defined'
)
}
xhr
.
send
(
null
)
console
.
log
(
'[downloadPDF] response meta'
,
{
url
,
status
:
xhr
.
status
,
readyState
:
xhr
.
readyState
,
contentType
:
xhr
.
getResponseHeader
?.(
'content-type'
),
responseType
:
xhr
.
responseType
,
}
)
const
data
=
xhr
.
response
||
xhr
.
responseBody
const
dataByteLength
=
arrybuffer
?
(
data
as
ArrayBuffer
|
null
)?.
byteLength
||
0
:
(
data
as
string
|
null
)?.
length
||
0
console
.
log
(
'[downloadPDF] data length'
,
{
url
,
arrybuffer
,
dataByteLength
,
}
)
if
(
typeof
Uint8Array
!==
'undefined'
)
{
if
(
arrybuffer
)
{
dataArray
=
new
Uint8Array
(
data
)
...
...
@@ -2131,6 +2165,11 @@ const downloadPDF = (url: string) => {
digits
.
substring
(
d3
,
d3
+
1
)
+
digits
.
substring
(
d4
,
d4
+
1
)
}
console
.
log
(
'[downloadPDF] base64 meta'
,
{
url
,
base64Length
:
strData
.
length
,
base64Preview
:
strData
.
slice
(
0
,
30
),
}
)
return
strData
}
const
handleDownloadMaterial
=
async
()
=>
{
...
...
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