Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
梁建民
/
wmsMin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
c368acd5
authored
Jan 24, 2022
by
liangjianmin
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
css
parent
2501d28b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
17 deletions
pages/tag/print.vue
pages/tag/repairPrint.vue
pages/tag/print.vue
View file @
c368acd5
...
@@ -298,7 +298,7 @@
...
@@ -298,7 +298,7 @@
if
(
that
.
print_number
<
that
.
printLabelData
.
length
)
{
if
(
that
.
print_number
<
that
.
printLabelData
.
length
)
{
setTimeout
(
function
()
{
setTimeout
(
function
()
{
that
.
sendDataChange
();
that
.
sendDataChange
();
},
10
0
);
},
0
);
}
else
{
}
else
{
uni
.
hideLoading
();
uni
.
hideLoading
();
uni
.
closeBLEConnection
({
uni
.
closeBLEConnection
({
...
...
pages/tag/repairPrint.vue
View file @
c368acd5
...
@@ -190,7 +190,7 @@
...
@@ -190,7 +190,7 @@
that
.
getBLEDeviceCharacteristics
();
that
.
getBLEDeviceCharacteristics
();
}
}
});
});
},
0
);
},
100
0
);
}
}
});
});
},
},
...
@@ -239,22 +239,27 @@
...
@@ -239,22 +239,27 @@
sendDataChange
()
{
sendDataChange
()
{
console
.
log
(
'第'
+
this
.
print_number
+
'次打印'
);
console
.
log
(
'第'
+
this
.
print_number
+
'次打印'
);
//发送数据 二进制
//发送数据 二进制
let
data
=
""
;
let
data
=
[]
;
if
(
this
.
printLabelData
.
length
>
0
)
{
if
(
this
.
printLabelData
.
length
>
0
)
{
data
=
"! 10 200 200 250 1\r\n"
+
data
.
push
(
"! 10 200 200 200 1\r\n"
);
"T 8 0 10 10 入仓号:"
+
this
.
printLabelData
[
this
.
print_number
].
erp_order_sn
+
"\r\n"
+
data
.
push
(
"T 8 0 10 20 入仓号:"
+
this
.
printLabelData
[
this
.
print_number
].
erp_order_sn
+
"\r\n"
);
"T 8 0 10 50 箱号:"
+
this
.
printLabelData
[
this
.
print_number
].
label_sort
+
'/'
+
this
.
printLabelData
[
0
].
label_num
+
"\r\n"
+
if
(
this
.
print_type
==
1
)
{
"T 8 0 10 90 时间:"
+
this
.
printLabelData
[
this
.
print_number
].
create_time_cn
+
"\r\n"
+
data
.
push
(
"T 8 0 10 70 总箱数:"
+
this
.
printLabelData
[
this
.
print_number
].
label_num
+
"箱\r\n"
);
"T 8 0 10 130 仓库代码:"
+
this
.
print_number
+
"\r\n"
+
}
else
{
"B QR 290 0 M 2 U 8\r\n"
+
data
.
push
(
"T 8 0 10 70 箱号:"
+
this
.
printLabelData
[
this
.
print_number
].
label_sort
+
'/'
+
this
.
printLabelData
[
this
.
print_number
].
label_num
+
"\r\n"
);
"MA,"
+
this
.
printLabelData
[
this
.
print_number
].
erp_order_sn
+
"\r\n"
+
}
"ENDQR\r\n"
+
data
.
push
(
"T 8 0 10 120 时间:"
+
this
.
printLabelData
[
this
.
print_number
].
create_time_cn
+
"\r\n"
);
"PRINT\r\n"
;
data
.
push
(
"T 8 0 10 170 仓库代码:"
+
this
.
printLabelData
[
this
.
print_number
].
warehouse_code
+
"\r\n"
);
}
data
.
push
(
"B QR 290 20 M 2 U 8\r\n"
);
console
.
log
(
data
)
data
.
push
(
"MA,"
+
this
.
printLabelData
[
this
.
print_number
].
erp_order_sn
+
"\r\n"
);
let
arrayBuffer
=
uni
.
base64ToArrayBuffer
(
ToBase64
.
encode64gb2312
(
data
));
data
.
push
(
"ENDQR\r\n"
);
data
.
push
(
"FORM\r\n"
);
data
.
push
(
"PRINT\r\n"
);
}
let
arrayBuffer
=
uni
.
base64ToArrayBuffer
(
ToBase64
.
encode64gb2312
(
data
.
join
(
''
)));
this
.
sendData64
=
arrayBuffer
;
this
.
sendData64
=
arrayBuffer
;
this
.
writeBLECharacteristicValue
();
this
.
writeBLECharacteristicValue
();
console
.
log
(
data
.
join
(
''
))
},
},
writeBLECharacteristicValue
()
{
writeBLECharacteristicValue
()
{
//写入二进制数据
//写入二进制数据
...
@@ -266,10 +271,19 @@
...
@@ -266,10 +271,19 @@
value
:
that
.
sendData64
,
value
:
that
.
sendData64
,
success
(
res
)
{
success
(
res
)
{
console
.
log
(
'writeBLECharacteristicValue success'
,
res
.
errMsg
)
console
.
log
(
'writeBLECharacteristicValue success'
,
res
.
errMsg
)
that
.
print_number
++
;
if
(
that
.
print_number
<
that
.
printLabelData
.
length
)
{
setTimeout
(
function
()
{
that
.
sendDataChange
();
},
0
);
}
else
{
uni
.
hideLoading
();
uni
.
hideLoading
();
uni
.
closeBLEConnection
({
uni
.
closeBLEConnection
({
deviceId
:
that
.
deviceId
,
deviceId
:
that
.
deviceId
,
success
(
res
)
{
success
(
res
)
{
console
.
log
(
res
)
}
})
uni
.
showModal
({
uni
.
showModal
({
title
:
'提示'
,
title
:
'提示'
,
content
:
'提交成功,打印中,请查看标签打印机'
,
content
:
'提交成功,打印中,请查看标签打印机'
,
...
@@ -278,14 +292,12 @@
...
@@ -278,14 +292,12 @@
success
:
function
(
res
)
{
success
:
function
(
res
)
{
if
(
res
.
confirm
)
{
if
(
res
.
confirm
)
{
console
.
log
(
'用户点击确定'
);
console
.
log
(
'用户点击确定'
);
}
else
if
(
res
.
cancel
)
{
}
else
if
(
res
.
cancel
)
{
console
.
log
(
'用户点击取消'
);
console
.
log
(
'用户点击取消'
);
}
}
}
}
});
});
}
}
})
},
},
fail
()
{
fail
()
{
uni
.
hideLoading
();
uni
.
hideLoading
();
...
...
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