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
e750f4ab
authored
Apr 25, 2024
by
LJM
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
标签打印
parent
1e28a8b1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
348 additions
and
280 deletions
pages/tag/print.vue
pages/tag/repairPrint.vue
util/api.js
pages/tag/print.vue
View file @
e750f4ab
...
@@ -342,10 +342,26 @@
...
@@ -342,10 +342,26 @@
is_add
:
0
is_add
:
0
});
});
this
.
request
(
API
.
checkIsTallyGoods
,
'POST'
,
params
,
true
).
then
(
res
=>
{
this
.
request
(
API
.
checkRepeatPrintLabel
,
'POST'
,
params
,
true
).
then
(
res
=>
{
if
(
res
.
err_code
===
0
)
{
if
(
res
.
err_code
===
0
)
{
this
.
printLabelChange
();
this
.
request
(
API
.
checkRepeatPrintLabel
,
'POST'
,
params
,
true
).
then
(
res
=>
{
if
(
res
.
err_code
===
0
)
{
this
.
printLabelChange
();
}
else
{
uni
.
showModal
({
title
:
'提示'
,
content
:
res
.
err_msg
,
confirmText
:
'继续打印'
,
success
:
res
=>
{
if
(
res
.
confirm
)
{
this
.
printLabelChange
();
}
else
if
(
res
.
cancel
)
{
console
.
log
(
'用户点击取消'
);
}
}
});
}
});
}
else
{
}
else
{
uni
.
showModal
({
uni
.
showModal
({
title
:
'提示'
,
title
:
'提示'
,
...
@@ -353,7 +369,24 @@
...
@@ -353,7 +369,24 @@
confirmText
:
'继续打印'
,
confirmText
:
'继续打印'
,
success
:
res
=>
{
success
:
res
=>
{
if
(
res
.
confirm
)
{
if
(
res
.
confirm
)
{
this
.
printLabelChange
();
this
.
request
(
API
.
checkRepeatPrintLabel
,
'POST'
,
params
,
true
).
then
(
res
=>
{
if
(
res
.
err_code
===
0
)
{
this
.
printLabelChange
();
}
else
{
uni
.
showModal
({
title
:
'提示'
,
content
:
res
.
err_msg
,
confirmText
:
'继续打印'
,
success
:
res
=>
{
if
(
res
.
confirm
)
{
this
.
printLabelChange
();
}
else
if
(
res
.
cancel
)
{
console
.
log
(
'用户点击取消'
);
}
}
});
}
});
}
else
if
(
res
.
cancel
)
{
}
else
if
(
res
.
cancel
)
{
console
.
log
(
'用户点击取消'
);
console
.
log
(
'用户点击取消'
);
}
}
...
@@ -361,6 +394,7 @@
...
@@ -361,6 +394,7 @@
});
});
}
}
});
});
},
},
printLabelChange
()
{
printLabelChange
()
{
this
.
request
(
API
.
printLabel
,
'POST'
,
this
.
form
,
true
).
then
(
res
=>
{
this
.
request
(
API
.
printLabel
,
'POST'
,
this
.
form
,
true
).
then
(
res
=>
{
...
...
pages/tag/repairPrint.vue
View file @
e750f4ab
...
@@ -53,315 +53,344 @@
...
@@ -53,315 +53,344 @@
</template>
</template>
<
script
>
<
script
>
import
{
API
}
from
'@/util/api.js'
;
import
{
API
}
from
'@/util/api.js'
;
import
{
getPlatform
}
from
'@/util/util.js'
;
import
{
getPlatform
}
from
'@/util/util.js'
;
const
ToBase64
=
require
(
'../../util/base64gb2312.js'
);
const
ToBase64
=
require
(
'../../util/base64gb2312.js'
);
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
print_number
:
0
,
print_number
:
0
,
serviceId
:
''
,
serviceId
:
''
,
deviceId
:
''
,
deviceId
:
''
,
device_name
:
''
,
device_name
:
''
,
characteristics
:
''
,
characteristics
:
''
,
text
:
'标签数量'
,
text
:
'标签数量'
,
index_erp_order_sn_pre
:
-
1
,
index_erp_order_sn_pre
:
-
1
,
index_print_type
:
1
,
index_print_type
:
1
,
items_erp_order_sn_pre
:
[
'A单号'
,
'B单号'
,
'D单号'
],
items_erp_order_sn_pre
:
[
'A单号'
,
'B单号'
,
'D单号'
],
items_print_type
:
[
'卡板'
,
'散箱'
],
items_print_type
:
[
'卡板'
,
'散箱'
],
sendData64
:
''
,
sendData64
:
''
,
platform
:
'android'
,
platform
:
'android'
,
printLabelData
:
[],
printLabelData
:
[],
wstyptll_id
:
''
,
wstyptll_id
:
''
,
batchArr
:
[
0
,
1
,
2
,
3
,
4
,
5
,
6
],
batchArr
:
[
0
,
1
,
2
,
3
,
4
,
5
,
6
],
form
:
{
form
:
{
batch
:
0
,
//批次
batch
:
0
,
//批次
is_add
:
1
,
is_add
:
1
,
print_type
:
2
,
print_type
:
2
,
erp_order_sn_pre
:
''
,
erp_order_sn_pre
:
''
,
erp_order_sn_number
:
''
,
erp_order_sn_number
:
''
,
erp_order_sn
:
''
,
//入仓号
erp_order_sn
:
''
,
//入仓号
label_num
:
''
label_num
:
''
}
};
},
onLoad
(
option
)
{
this
.
platform
=
getPlatform
();
//停止搜索,节省系统资源
uni
.
stopBluetoothDevicesDiscovery
({
success
:
res
=>
{
console
.
log
(
'停止搜索'
,
JSON
.
stringify
(
res
.
errMsg
));
}
});
try
{
uni
.
removeStorageSync
(
'device'
);
}
catch
(
e
)
{
// error
}
},
onShow
()
{
//获取已连接蓝牙设备信息
const
deviceData
=
uni
.
getStorageSync
(
'device'
)
||
''
;
if
(
deviceData
)
{
this
.
deviceId
=
deviceData
.
deviceId
;
this
.
serviceId
=
deviceData
.
serviceId
;
this
.
characteristics
=
deviceData
.
characteristics
;
this
.
device_name
=
deviceData
.
name
;
}
else
{
this
.
deviceId
=
''
;
this
.
device_name
=
''
;
}
},
methods
:
{
bindPickerChangeBatch
(
e
)
{
this
.
form
.
batch
=
e
.
target
.
value
;
},
scanChange
()
{
uni
.
scanCode
({
success
:
res
=>
{
if
(
res
.
errMsg
==
'scanCode:ok'
)
{
this
.
form
.
erp_order_sn
=
res
.
result
;
}
},
fail
:
function
(
res
)
{
uni
.
showToast
({
title
:
'扫码失败'
,
icon
:
'error'
});
}
}
}
)
;
};
},
},
submit
()
{
onLoad
(
option
)
{
if
(
!
this
.
device_name
)
{
this
.
platform
=
getPlatform
();
uni
.
showModal
({
title
:
'提示'
,
content
:
'请连接蓝牙设备'
,
showCancel
:
false
,
confirmText
:
'关闭'
,
success
:
function
(
res
)
{
if
(
res
.
confirm
)
{
uni
.
navigateTo
({
url
:
'/pages/tag/deviceList'
});
}
else
if
(
res
.
cancel
)
{
console
.
log
(
'用户点击取消'
);
}
}
});
return
false
;
}
if
(
!
this
.
form
.
erp_order_sn
)
{
uni
.
showModal
({
title
:
'提示'
,
content
:
'请输入入仓号'
,
showCancel
:
false
});
return
false
;
}
if
(
!
this
.
form
.
label_num
)
{
uni
.
showModal
({
title
:
'提示'
,
content
:
'请输入'
+
this
.
text
,
showCancel
:
false
});
return
false
;
}
if
(
!
/
(
^
[
0-9
]
*$
)
/
.
test
(
this
.
form
.
label_num
))
{
uni
.
showModal
({
title
:
'提示'
,
content
:
this
.
text
+
'为纯数字'
,
showCancel
:
false
});
return
false
;
}
this
.
request
(
API
.
printLabel
,
'POST'
,
{
erp_order_sn
:
this
.
form
.
erp_order_sn
,
batch
:
this
.
form
.
batch
,
label_num
:
this
.
form
.
label_num
,
is_add
:
1
,
print_type
:
this
.
form
.
print_type
},
true
).
then
(
res
=>
{
//停止搜索,节省系统资源
if
(
res
.
err_code
===
0
)
{
uni
.
stopBluetoothDevicesDiscovery
({
this
.
printLabelData
=
res
.
data
;
success
:
res
=>
{
this
.
wstyptll_id
=
res
.
data
[
0
].
wstyptll_id
;
console
.
log
(
'停止搜索'
,
JSON
.
stringify
(
res
.
errMsg
));
this
.
sendDataChange
();
//发送数据
}
else
{
uni
.
showModal
({
title
:
'提示'
,
content
:
res
.
err_msg
,
showCancel
:
false
,
confirmText
:
'关闭'
});
}
}
});
});
},
/**
* 向蓝牙发送数据
*/
sendDataChange
()
{
try
{
try
{
uni
.
showLoading
({
uni
.
removeStorageSync
(
'device'
);
title
:
'打印中...'
});
console
.
log
(
'第'
+
this
.
print_number
+
'次开始打印start...'
);
let
data
=
[];
if
(
this
.
printLabelData
.
length
>
0
)
{
data
.
push
(
'! 60 200 200 300 1\r\n'
);
data
.
push
(
'SETMAG 3 4\r\n'
);
data
.
push
(
'T 7 0 10 20 '
+
this
.
printLabelData
[
this
.
print_number
].
erp_order_sn
+
'\r\n'
);
data
.
push
(
'SETMAG 0 0\r\n'
);
if
(
this
.
print_type
==
1
)
{
data
.
push
(
'T 5 0 10 120 总箱数:'
+
this
.
printLabelData
[
this
.
print_number
].
label_num
+
'箱\r\n'
);
}
else
{
data
.
push
(
'T 5 0 10 120 箱号:'
+
this
.
printLabelData
[
this
.
print_number
].
label_sort
+
'/'
+
this
.
printLabelData
[
this
.
print_number
].
label_num
+
'\r\n'
);
}
data
.
push
(
'T 8 0 10 180 时间:'
+
this
.
printLabelData
[
this
.
print_number
].
create_time_cn
+
'\r\n'
);
data
.
push
(
'T 8 0 10 220 仓库代码:'
+
this
.
printLabelData
[
this
.
print_number
].
warehouse_code
+
'\r\n'
);
data
.
push
(
'T 8 0 10 260 流水号:'
+
this
.
printLabelData
[
this
.
print_number
].
wstyptll_id_sn
+
'\r\n'
);
data
.
push
(
'SETMAG 4 1'
+
'\r\n'
);
data
.
push
(
'T 8 0 350 30 '
+
this
.
printLabelData
[
this
.
print_number
].
batch
+
'\r\n'
);
data
.
push
(
'SETMAG 0 0'
+
'\r\n'
);
data
.
push
(
'B QR 260 120 M 2 U 8\r\n'
);
data
.
push
(
'MA,'
+
this
.
printLabelData
[
this
.
print_number
][
'box_code'
]
+
'|\r\n'
);
data
.
push
(
'ENDQR\r\n'
);
data
.
push
(
'FORM\r\n'
);
data
.
push
(
'PRINT\r\n'
);
}
console
.
log
(
data
.
join
(
''
));
this
.
cutCommand
(
data
.
join
(
''
));
}
catch
(
e
)
{
}
catch
(
e
)
{
uni
.
hideLoading
();
// error
uni
.
showModal
({
title
:
'提示'
,
content
:
'数据异常,请重试'
,
showCancel
:
false
,
confirmText
:
'关闭'
});
}
}
},
},
/**
onShow
()
{
* 分批传输数据
//获取已连接蓝牙设备信息
*/
const
deviceData
=
uni
.
getStorageSync
(
'device'
)
||
''
;
cutCommand
:
function
(
data
)
{
if
(
deviceData
)
{
var
packageLength
=
10
;
//安卓不超过10个字节传输
this
.
deviceId
=
deviceData
.
deviceId
;
var
sendData64
=
[];
this
.
serviceId
=
deviceData
.
serviceId
;
if
(
this
.
platform
==
'ios'
)
{
this
.
characteristics
=
deviceData
.
characteristics
;
packageLength
=
30
;
this
.
device_name
=
deviceData
.
name
;
}
}
else
{
console
.
log
(
'package长度:'
+
packageLength
);
this
.
deviceId
=
''
;
for
(
let
i
=
0
;
i
<
Math
.
ceil
(
data
.
length
/
packageLength
);
i
++
)
{
this
.
device_name
=
''
;
sendData64
[
i
]
=
uni
.
base64ToArrayBuffer
(
ToBase64
.
encode64gb2312
(
data
.
substr
(
i
*
packageLength
,
packageLength
)));
}
}
this
.
sendData64
=
sendData64
;
console
.
log
(
sendData64
);
this
.
writeBLECharacteristicValue
(
1
);
},
},
/**
methods
:
{
* 写入二进制数据
bindPickerChangeBatch
(
e
)
{
*/
this
.
form
.
batch
=
e
.
target
.
value
;
writeBLECharacteristicValue
(
times
)
{
},
var
sendData64
=
this
.
sendData64
;
scanChange
()
{
if
(
sendData64
.
length
>=
times
)
{
uni
.
scanCode
({
uni
.
writeBLECharacteristicValue
({
deviceId
:
this
.
deviceId
,
serviceId
:
this
.
serviceId
,
characteristicId
:
this
.
characteristics
,
value
:
sendData64
[
times
-
1
],
success
:
res
=>
{
success
:
res
=>
{
this
.
writeBLECharacteristicValue
(
++
times
);
if
(
res
.
errMsg
==
'scanCode:ok'
)
{
this
.
form
.
erp_order_sn
=
res
.
result
;
}
},
},
fail
()
{
fail
:
function
(
res
)
{
uni
.
hideLoading
();
uni
.
showToast
({
uni
.
showModal
({
title
:
'扫码失败'
,
title
:
'提示'
,
icon
:
'error'
content
:
'打印失败,请重新进入打印页面'
,
showCancel
:
false
,
confirmText
:
'关闭'
,
success
:
res
=>
{
if
(
res
.
confirm
)
{
this
.
characteristics
=
''
;
//连接蓝牙信息清空
this
.
deviceId
=
''
;
//连接蓝牙信息清空
this
.
device_name
=
''
;
//连接蓝牙信息清空
this
.
print_number
=
0
;
//打印计数归零
this
.
printLabelData
=
[];
//打印数据清空
this
.
sendData64
=
''
;
//发送蓝牙数据清空
this
.
delErpOrderSnCodeManage
();
//及时作废
}
else
if
(
res
.
cancel
)
{
console
.
log
(
'用户点击取消'
);
}
}
});
});
}
}
});
});
}
else
{
},
this
.
print_number
++
;
submit
()
{
console
.
log
(
'第'
+
this
.
print_number
+
'次传输完成end'
);
if
(
!
this
.
device_name
)
{
if
(
this
.
print_number
<
this
.
printLabelData
.
length
)
{
this
.
sendDataChange
();
}
else
{
uni
.
hideLoading
();
//重置
this
.
print_number
=
0
;
//打印计数归零
this
.
printLabelData
=
[];
//打印数据清空
this
.
sendData64
=
''
;
//发送蓝牙数据清空
uni
.
showModal
({
uni
.
showModal
({
title
:
'提示'
,
title
:
'提示'
,
content
:
'
打印成功,请查看标签打印机
'
,
content
:
'
请连接蓝牙设备
'
,
showCancel
:
false
,
showCancel
:
false
,
confirmText
:
'关闭'
,
confirmText
:
'关闭'
,
success
:
function
(
res
)
{
success
:
function
(
res
)
{
if
(
res
.
confirm
)
{
if
(
res
.
confirm
)
{
console
.
log
(
'用户点击确定'
);
uni
.
navigateTo
({
url
:
'/pages/tag/deviceList'
});
}
else
if
(
res
.
cancel
)
{
}
else
if
(
res
.
cancel
)
{
console
.
log
(
'用户点击取消'
);
console
.
log
(
'用户点击取消'
);
}
}
}
}
});
});
return
false
;
}
}
}
if
(
!
this
.
form
.
erp_order_sn
)
{
},
delErpOrderSnCodeManage
()
{
this
.
request
(
API
.
delWstyptllIdErpOrderSnCodeManage
,
'POST'
,
{
wstyptll_id
:
this
.
wstyptll_id
},
true
).
then
(
res
=>
{
if
(
res
.
err_code
===
0
)
{
}
else
{
uni
.
showModal
({
uni
.
showModal
({
title
:
'提示'
,
title
:
'提示'
,
content
:
res
.
err_msg
,
content
:
'请输入入仓号'
,
showCancel
:
false
});
return
false
;
}
if
(
!
this
.
form
.
label_num
)
{
uni
.
showModal
({
title
:
'提示'
,
content
:
'请输入'
+
this
.
text
,
showCancel
:
false
});
return
false
;
}
if
(
!
/
(
^
[
0-9
]
*$
)
/
.
test
(
this
.
form
.
label_num
))
{
uni
.
showModal
({
title
:
'提示'
,
content
:
this
.
text
+
'为纯数字'
,
showCancel
:
false
});
return
false
;
}
this
.
request
(
API
.
checkIsTallyGoods
,
'POST'
,
{
erp_order_sn
:
this
.
form
.
erp_order_sn
,
batch
:
this
.
form
.
batch
},
true
).
then
(
res
=>
{
if
(
res
.
err_code
===
0
)
{
this
.
request
(
API
.
printLabel
,
'POST'
,
{
erp_order_sn
:
this
.
form
.
erp_order_sn
,
batch
:
this
.
form
.
batch
,
label_num
:
this
.
form
.
label_num
,
is_add
:
1
,
print_type
:
this
.
form
.
print_type
},
true
).
then
(
res
=>
{
if
(
res
.
err_code
===
0
)
{
this
.
printLabelData
=
res
.
data
;
this
.
wstyptll_id
=
res
.
data
[
0
].
wstyptll_id
;
this
.
sendDataChange
();
//发送数据
}
else
{
uni
.
showModal
({
title
:
'提示'
,
content
:
res
.
err_msg
,
showCancel
:
false
,
confirmText
:
'关闭'
});
}
});
}
else
{
uni
.
showModal
({
title
:
'提示'
,
content
:
res
.
err_msg
,
confirmText
:
'继续打印'
,
success
:
res
=>
{
if
(
res
.
confirm
)
{
this
.
request
(
API
.
printLabel
,
'POST'
,
{
erp_order_sn
:
this
.
form
.
erp_order_sn
,
batch
:
this
.
form
.
batch
,
label_num
:
this
.
form
.
label_num
,
is_add
:
1
,
print_type
:
this
.
form
.
print_type
},
true
).
then
(
res
=>
{
if
(
res
.
err_code
===
0
)
{
this
.
printLabelData
=
res
.
data
;
this
.
wstyptll_id
=
res
.
data
[
0
].
wstyptll_id
;
this
.
sendDataChange
();
//发送数据
}
else
{
uni
.
showModal
({
title
:
'提示'
,
content
:
res
.
err_msg
,
showCancel
:
false
,
confirmText
:
'关闭'
});
}
});
}
else
if
(
res
.
cancel
)
{
console
.
log
(
'用户点击取消'
);
}
}
});
}
});
},
/**
* 向蓝牙发送数据
*/
sendDataChange
()
{
try
{
uni
.
showLoading
({
title
:
'打印中...'
});
console
.
log
(
'第'
+
this
.
print_number
+
'次开始打印start...'
);
let
data
=
[];
if
(
this
.
printLabelData
.
length
>
0
)
{
data
.
push
(
'! 60 200 200 300 1\r\n'
);
data
.
push
(
'SETMAG 3 4\r\n'
);
data
.
push
(
'T 7 0 10 20 '
+
this
.
printLabelData
[
this
.
print_number
].
erp_order_sn
+
'\r\n'
);
data
.
push
(
'SETMAG 0 0\r\n'
);
if
(
this
.
print_type
==
1
)
{
data
.
push
(
'T 5 0 10 120 总箱数:'
+
this
.
printLabelData
[
this
.
print_number
].
label_num
+
'箱\r\n'
);
}
else
{
data
.
push
(
'T 5 0 10 120 箱号:'
+
this
.
printLabelData
[
this
.
print_number
].
label_sort
+
'/'
+
this
.
printLabelData
[
this
.
print_number
].
label_num
+
'\r\n'
);
}
data
.
push
(
'T 8 0 10 180 时间:'
+
this
.
printLabelData
[
this
.
print_number
].
create_time_cn
+
'\r\n'
);
data
.
push
(
'T 8 0 10 220 仓库代码:'
+
this
.
printLabelData
[
this
.
print_number
].
warehouse_code
+
'\r\n'
);
data
.
push
(
'T 8 0 10 260 流水号:'
+
this
.
printLabelData
[
this
.
print_number
].
wstyptll_id_sn
+
'\r\n'
);
data
.
push
(
'SETMAG 4 1'
+
'\r\n'
);
data
.
push
(
'T 8 0 350 30 '
+
this
.
printLabelData
[
this
.
print_number
].
batch
+
'\r\n'
);
data
.
push
(
'SETMAG 0 0'
+
'\r\n'
);
data
.
push
(
'B QR 260 120 M 2 U 8\r\n'
);
data
.
push
(
'MA,'
+
this
.
printLabelData
[
this
.
print_number
][
'box_code'
]
+
'|\r\n'
);
data
.
push
(
'ENDQR\r\n'
);
data
.
push
(
'FORM\r\n'
);
data
.
push
(
'PRINT\r\n'
);
}
console
.
log
(
data
.
join
(
''
));
this
.
cutCommand
(
data
.
join
(
''
));
}
catch
(
e
)
{
uni
.
hideLoading
();
uni
.
showModal
({
title
:
'提示'
,
content
:
'数据异常,请重试'
,
showCancel
:
false
,
showCancel
:
false
,
confirmText
:
'关闭'
confirmText
:
'关闭'
});
});
}
}
});
},
},
/**
change
(
index
,
type
)
{
* 分批传输数据
if
(
type
==
'erp_order_sn_pre'
)
{
*/
//订单类型
cutCommand
:
function
(
data
)
{
this
.
index_erp_order_sn_pre
=
index
;
var
packageLength
=
10
;
//安卓不超过10个字节传输
if
(
index
==
0
)
{
var
sendData64
=
[];
this
.
form
.
erp_order_sn_pre
=
'A'
;
if
(
this
.
platform
==
'ios'
)
{
}
else
if
(
index
==
1
)
{
packageLength
=
30
;
this
.
form
.
erp_order_sn_pre
=
'B'
;
}
}
else
if
(
index
==
2
)
{
console
.
log
(
'package长度:'
+
packageLength
);
this
.
form
.
erp_order_sn_pre
=
'D'
;
for
(
let
i
=
0
;
i
<
Math
.
ceil
(
data
.
length
/
packageLength
);
i
++
)
{
sendData64
[
i
]
=
uni
.
base64ToArrayBuffer
(
ToBase64
.
encode64gb2312
(
data
.
substr
(
i
*
packageLength
,
packageLength
)));
}
}
}
else
if
(
type
==
'print_type'
)
{
this
.
sendData64
=
sendData64
;
//打印类型
console
.
log
(
sendData64
);
this
.
index_print_type
=
index
;
this
.
writeBLECharacteristicValue
(
1
);
if
(
index
==
0
)
{
},
this
.
form
.
print_type
=
1
;
/**
this
.
text
=
'总箱数'
;
* 写入二进制数据
}
else
if
(
index
==
1
)
{
*/
this
.
form
.
print_type
=
2
;
writeBLECharacteristicValue
(
times
)
{
this
.
text
=
'标签数量'
;
var
sendData64
=
this
.
sendData64
;
if
(
sendData64
.
length
>=
times
)
{
uni
.
writeBLECharacteristicValue
({
deviceId
:
this
.
deviceId
,
serviceId
:
this
.
serviceId
,
characteristicId
:
this
.
characteristics
,
value
:
sendData64
[
times
-
1
],
success
:
res
=>
{
this
.
writeBLECharacteristicValue
(
++
times
);
},
fail
()
{
uni
.
hideLoading
();
uni
.
showModal
({
title
:
'提示'
,
content
:
'打印失败,请重新进入打印页面'
,
showCancel
:
false
,
confirmText
:
'关闭'
,
success
:
res
=>
{
if
(
res
.
confirm
)
{
this
.
characteristics
=
''
;
//连接蓝牙信息清空
this
.
deviceId
=
''
;
//连接蓝牙信息清空
this
.
device_name
=
''
;
//连接蓝牙信息清空
this
.
print_number
=
0
;
//打印计数归零
this
.
printLabelData
=
[];
//打印数据清空
this
.
sendData64
=
''
;
//发送蓝牙数据清空
this
.
delErpOrderSnCodeManage
();
//及时作废
}
else
if
(
res
.
cancel
)
{
console
.
log
(
'用户点击取消'
);
}
}
});
}
});
}
else
{
this
.
print_number
++
;
console
.
log
(
'第'
+
this
.
print_number
+
'次传输完成end'
);
if
(
this
.
print_number
<
this
.
printLabelData
.
length
)
{
this
.
sendDataChange
();
}
else
{
uni
.
hideLoading
();
//重置
this
.
print_number
=
0
;
//打印计数归零
this
.
printLabelData
=
[];
//打印数据清空
this
.
sendData64
=
''
;
//发送蓝牙数据清空
uni
.
showModal
({
title
:
'提示'
,
content
:
'打印成功,请查看标签打印机'
,
showCancel
:
false
,
confirmText
:
'关闭'
,
success
:
function
(
res
)
{
if
(
res
.
confirm
)
{
console
.
log
(
'用户点击确定'
);
}
else
if
(
res
.
cancel
)
{
console
.
log
(
'用户点击取消'
);
}
}
});
}
}
},
delErpOrderSnCodeManage
()
{
this
.
request
(
API
.
delWstyptllIdErpOrderSnCodeManage
,
'POST'
,
{
wstyptll_id
:
this
.
wstyptll_id
},
true
).
then
(
res
=>
{
if
(
res
.
err_code
===
0
)
{}
else
{
uni
.
showModal
({
title
:
'提示'
,
content
:
res
.
err_msg
,
showCancel
:
false
,
confirmText
:
'关闭'
});
}
});
},
change
(
index
,
type
)
{
if
(
type
==
'erp_order_sn_pre'
)
{
//订单类型
this
.
index_erp_order_sn_pre
=
index
;
if
(
index
==
0
)
{
this
.
form
.
erp_order_sn_pre
=
'A'
;
}
else
if
(
index
==
1
)
{
this
.
form
.
erp_order_sn_pre
=
'B'
;
}
else
if
(
index
==
2
)
{
this
.
form
.
erp_order_sn_pre
=
'D'
;
}
}
else
if
(
type
==
'print_type'
)
{
//打印类型
this
.
index_print_type
=
index
;
if
(
index
==
0
)
{
this
.
form
.
print_type
=
1
;
this
.
text
=
'总箱数'
;
}
else
if
(
index
==
1
)
{
this
.
form
.
print_type
=
2
;
this
.
text
=
'标签数量'
;
}
}
}
}
}
}
}
}
};
};
</
script
>
</
script
>
<
style
scoped
lang=
"scss"
>
<
style
scoped
lang=
"scss"
>
@import
'../../assets/css/tag/print.scss'
;
@import
'../../assets/css/tag/print.scss'
;
</
style
>
</
style
>
\ No newline at end of file
util/api.js
View file @
e750f4ab
const
API_BASE
=
'https://api.ichunt.com'
;
//
const API_BASE = 'https://api.ichunt.com';
const
API_BASE_OSS
=
'https://image.ichunt.net'
;
//oss系统
//
const API_BASE_OSS = 'https://image.ichunt.net'; //oss系统
const
API_BASE_WMS
=
'https://wms.ichunt.net'
;
//WMS系统
//
const API_BASE_WMS = 'https://wms.ichunt.net'; //WMS系统
//
const API_BASE = 'http://api.liexin.com';
const
API_BASE
=
'http://api.liexin.com'
;
//
const API_BASE_OSS = 'http://image.liexindev.net';
const
API_BASE_OSS
=
'http://image.liexindev.net'
;
//
const API_BASE_WMS = 'http://wms.liexindev.net'; //WMS系统
const
API_BASE_WMS
=
'http://wms.liexindev.net'
;
//WMS系统
const
API
=
{
const
API
=
{
/**
/**
...
@@ -132,6 +132,10 @@ const API = {
...
@@ -132,6 +132,10 @@ const API = {
*/
*/
checkRepeatPrintLabel
:
API_BASE
+
'/supplywechatwms/checkRepeatPrintLabel'
,
checkRepeatPrintLabel
:
API_BASE
+
'/supplywechatwms/checkRepeatPrintLabel'
,
/**
/**
* 入仓号是否理货
*/
checkIsTallyGoods
:
API_BASE
+
'/supplywechatwms/checkIsTallyGoods'
,
/**
* 扫描入库
* 扫描入库
*/
*/
szScanIn
:
API_BASE
+
'/supplywechatwms/szScanIn'
,
szScanIn
:
API_BASE
+
'/supplywechatwms/szScanIn'
,
...
...
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