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
b147953f
Commit
b147953f
authored
Aug 24, 2023
by
dragondean@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
打印标签前端生成二维码
parent
8a1e9e5f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
9 deletions
+20
-9
PrintTag.vue
src/views/ecw/order/components/PrintTag.vue
+20
-9
No files found.
src/views/ecw/order/components/PrintTag.vue
View file @
b147953f
...
@@ -27,10 +27,8 @@
...
@@ -27,10 +27,8 @@
:style=
"
{display: index == 0 ? 'block':'none' }"
:style=
"
{display: index == 0 ? 'block':'none' }"
:key="item.num">
:key="item.num">
<div
style=
"float: left; width: 28mm; border-bottom: 0.2mm solid #333; border-right: 0.2mm solid #333; "
>
<div
style=
"float: left; width: 28mm; border-bottom: 0.2mm solid #333; border-right: 0.2mm solid #333; "
>
<img
:src=
"item.url"
:alt=
"item.url"
style=
"width: 26mm"
/>
<img
class=
"qrcode"
src=
""
:alt=
"item.url"
style=
"width: 26mm"
/>
<p
style=
" text-align: center; height: 5mm; font-size: 3mm; -webkit-margin-before: 0em; -webkit-margin-after: 0em; margin-top: 0mm; "
>
<p
class=
"tag"
style=
" text-align: center; height: 5mm; font-size: 3mm; -webkit-margin-before: 0em; -webkit-margin-after: 0em; margin-top: 0mm; "
>
{{
item
.
tag
}}
</p>
{{
item
.
tag
}}
</p>
<p
style=
"margin-top: -1mm; text-align: center"
>
<p
style=
"margin-top: -1mm; text-align: center"
>
<span
style=
"text-align: center; font-weight: 600; font-size: 6mm"
>
{{
item
.
num
}}
</span>
<span
style=
"text-align: center; font-weight: 600; font-size: 6mm"
>
{{
item
.
num
}}
</span>
</p>
</p>
...
@@ -73,6 +71,7 @@
...
@@ -73,6 +71,7 @@
import
{
printTag
}
from
'
@/api/ecw/order
'
import
{
printTag
}
from
'
@/api/ecw/order
'
import
{
parseTime
}
from
'
@/utils/ruoyi
'
import
{
parseTime
}
from
'
@/utils/ruoyi
'
import
lodop
from
'
@/utils/lodop
'
import
lodop
from
'
@/utils/lodop
'
import
QRCode
from
"
qrcode
"
;
export
default
{
export
default
{
filters
:
{
parseTime
}
,
filters
:
{
parseTime
}
,
...
@@ -136,12 +135,18 @@ export default {
...
@@ -136,12 +135,18 @@ export default {
if
(
!
this
.
printTags
.
length
){
if
(
!
this
.
printTags
.
length
){
return
this
.
$message
.
error
(
this
.
$t
(
'
指定区域无可打印标签
'
))
return
this
.
$message
.
error
(
this
.
$t
(
'
指定区域无可打印标签
'
))
}
}
this
.
$refs
[
"
form
"
].
validate
(
valid
=>
{
this
.
$refs
[
"
form
"
].
validate
(
(
valid
)
=>
{
if
(
!
valid
)
{
if
(
!
valid
)
{
return
;
return
;
}
}
this
.
currentNo
=
this
.
form
.
start
this
.
currentNo
=
this
.
form
.
start
this
.
step
=
'
preview
'
this
.
step
=
'
preview
'
this
.
$nextTick
(
async
()
=>
{
const
first
=
document
.
getElementsByClassName
(
'
order-print-tag-item
'
)[
0
]
const
tag
=
first
.
getElementsByClassName
(
'
tag
'
)[
0
].
innerText
const
qrcode
=
await
QRCode
.
toDataURL
(
tag
)
first
.
getElementsByClassName
(
'
qrcode
'
)[
0
].
setAttribute
(
"
src
"
,
qrcode
)
}
)
}
)
}
)
}
,
}
,
print
(){
print
(){
...
@@ -152,18 +157,24 @@ export default {
...
@@ -152,18 +157,24 @@ export default {
if
(
items
.
length
>
1000
){
if
(
items
.
length
>
1000
){
this
.
$alert
(
this
.
$t
(
'
标签超过1000需要耐心等候标签生成,请稍候
'
))
this
.
$alert
(
this
.
$t
(
'
标签超过1000需要耐心等候标签生成,请稍候
'
))
}
}
lodop
().
then
(
LODOP
=>
{
lodop
().
then
(
async
(
LODOP
)
=>
{
LODOP
.
PRINT_INIT
(
this
.
title
);
LODOP
.
PRINT_INIT
(
this
.
title
);
LODOP
.
SET_PRINT_STYLE
(
"
FontSize
"
,
18
);
LODOP
.
SET_PRINT_STYLE
(
"
FontSize
"
,
18
);
LODOP
.
SET_PRINT_STYLE
(
"
Bold
"
,
1
);
LODOP
.
SET_PRINT_STYLE
(
"
Bold
"
,
1
);
// LODOP.ADD_PRINT_TEXT(50,231,260,39,"打印页面部分内容");
// LODOP.ADD_PRINT_TEXT(50,231,260,39,"打印页面部分内容");
console
.
log
({
items
}
)
LODOP
.
SET_PRINT_PAGESIZE
(
0
,
800
,
600
,
"
TAG
"
);
LODOP
.
SET_PRINT_PAGESIZE
(
0
,
800
,
600
,
"
TAG
"
);
for
(
let
i
in
items
){
let
i
=
0
;
LODOP
.
ADD_PRINT_HTM
(
"
2mm
"
,
0
,
800
,
600
,
items
[
i
].
innerHTML
);
for
(
let
item
of
items
){
const
tag
=
item
.
getElementsByClassName
(
'
tag
'
)[
0
].
innerText
const
qrcode
=
await
QRCode
.
toDataURL
(
tag
)
item
.
getElementsByClassName
(
'
qrcode
'
)[
0
].
setAttribute
(
"
src
"
,
qrcode
)
LODOP
.
ADD_PRINT_HTM
(
"
2mm
"
,
0
,
800
,
600
,
item
.
innerHTML
);
console
.
log
(
'
item.innerHTML
'
,
item
.
innerHTML
)
if
(
i
<
items
.
length
){
if
(
i
<
items
.
length
){
LODOP
.
NewPage
()
LODOP
.
NewPage
()
}
}
i
++
}
}
LODOP
.
PREVIEW
();
LODOP
.
PREVIEW
();
...
...
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