Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mes-pad
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ximai
mes-pad
Commits
fa3838ff
Commit
fa3838ff
authored
Mar 18, 2024
by
张海景
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update:修改pdf打印方法
parent
7cc15289
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
19 deletions
+13
-19
test.vue
pages/test/test.vue
+11
-8
$u.mixin.js
store/$u.mixin.js
+2
-11
No files found.
pages/test/test.vue
View file @
fa3838ff
<
template
>
<
template
>
<view>
<view>
<u-button
@
click=
"exportPDF"
>
预览pdf
</u-button>
<u-button
@
click=
"exportPDF"
>
预览pdf
</u-button>
<u-button
@
click=
"
printPdfSocke
t"
>
打印pdf
</u-button>
<u-button
@
click=
"
handlePrin
t"
>
打印pdf
</u-button>
</view>
</view>
</
template
>
</
template
>
...
@@ -17,13 +17,16 @@ export default {
...
@@ -17,13 +17,16 @@ export default {
},
},
methods
:
{
methods
:
{
handlePrint
()
{
handlePrint
()
{
console
.
log
(
this
.
socket
,
'this.$socket'
);
this
.
printPdfSocket
({
this
.
socket
.
emit
(
'news'
,
{
reportName
:
'mysql:qrcode-100*100'
,
client
:
null
,
values
:
{
printer
:
'HP LaserJet 1022n'
,
detail
:
[
type
:
'url_pdf'
,
{
pdf_path
:
'http://192.168.3.91:8082/static/123.pdf'
qrcode
:
'qqq'
,
});
},
],
},
})
},
},
previewPdf
()
{
previewPdf
()
{
// 预览pdf文件
// 预览pdf文件
...
...
store/$u.mixin.js
View file @
fa3838ff
...
@@ -52,22 +52,13 @@ module.exports = {
...
@@ -52,22 +52,13 @@ module.exports = {
console
.
log
(
printerList
,
'printerList'
);
console
.
log
(
printerList
,
'printerList'
);
});
});
},
},
printPdfSocket
()
{
printPdfSocket
(
params
)
{
console
.
log
(
this
.
pdfSocket
,
'pdfSocket'
)
console
.
log
(
this
.
pdfSocket
,
'pdfSocket'
)
if
(
!
this
.
pdfSocket
)
{
if
(
!
this
.
pdfSocket
)
{
this
.
createSocket
()
this
.
createSocket
()
}
}
this
.
$u
.
api
this
.
$u
.
api
.
getPrintDown
({
.
getPrintDown
(
params
)
reportName
:
'mysql:qrcode-100*100'
,
values
:
{
detail
:
[
{
qrcode
:
'qqq'
,
},
],
},
})
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
if
(
res
.
code
===
200
)
{
if
(
res
.
code
===
200
)
{
this
.
pdfSocket
.
emit
(
'news'
,
{
this
.
pdfSocket
.
emit
(
'news'
,
{
...
...
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