|
@ -129,7 +129,7 @@ export default {
|
|
|
showPrintComplete: false,
|
|
|
nextOrderDetail: '',
|
|
|
oldCardNo: '',
|
|
|
reconnect: false
|
|
|
reconnect: false,
|
|
|
}
|
|
|
},
|
|
|
watch:{
|
|
@ -335,6 +335,9 @@ export default {
|
|
|
},
|
|
|
getMessage: function(msg) {
|
|
|
console.log(msg.data)
|
|
|
//有收到消息后 重置重连定时器时间
|
|
|
this.reconnectTimeout()
|
|
|
|
|
|
var msgobj = JSON.parse(msg.data)
|
|
|
if (msgobj.type == 'ShipInfo') {
|
|
|
if(!this.inOut){
|
|
@ -477,7 +480,7 @@ export default {
|
|
|
type: "ReadCard",
|
|
|
mess: ""
|
|
|
}
|
|
|
this.socket.send(JSON.stringify(obj));
|
|
|
this.send(obj);
|
|
|
},
|
|
|
|
|
|
sendShipment: function() {
|
|
@ -501,15 +504,14 @@ export default {
|
|
|
layerNo: row.layerNo,
|
|
|
wayerNo: row.wayerNo
|
|
|
}
|
|
|
this.socket.send(JSON.stringify(obj));
|
|
|
this.send(obj);
|
|
|
},
|
|
|
send: function() {
|
|
|
var obj = {
|
|
|
type: "读取设备功能列表",
|
|
|
mess: "",
|
|
|
layerNo: this.layerNo,
|
|
|
wayerNo: this.wayerNo,
|
|
|
send: function(obj) {
|
|
|
if(obj.type != 'heart'){
|
|
|
//发送消息时 重置重连定时器时间
|
|
|
this.reconnectTimeout()
|
|
|
}
|
|
|
|
|
|
this.socket.send(JSON.stringify(obj));
|
|
|
},
|
|
|
send2: function() {
|
|
@ -517,7 +519,7 @@ export default {
|
|
|
type: "读取设备功能列表",
|
|
|
mess: ""
|
|
|
}
|
|
|
this.socket.send(JSON.stringify(obj));
|
|
|
this.send(obj);
|
|
|
},
|
|
|
close: function() {
|
|
|
console.log("socket已经关闭")
|
|
@ -531,6 +533,20 @@ export default {
|
|
|
}, 2000)
|
|
|
}
|
|
|
},
|
|
|
reconnectTimeout(){
|
|
|
if(this.reconnectInterval){
|
|
|
clearInterval(this.reconnectInterval)
|
|
|
}
|
|
|
this.reconnectInterval = setInterval(()=>{
|
|
|
if(this.socket){
|
|
|
this.forceClose = true
|
|
|
this.socket.close()
|
|
|
}
|
|
|
setTimeout(()=>{
|
|
|
this.init()
|
|
|
}, 200)
|
|
|
}, 5 * 60 * 1000 + 5000)
|
|
|
},
|
|
|
heartbit(){
|
|
|
if(this.heartbitInterval){
|
|
|
clearInterval(this.heartbitInterval)
|
|
@ -540,26 +556,17 @@ export default {
|
|
|
type: "heart",
|
|
|
mess: "",
|
|
|
}
|
|
|
this.socket.send(JSON.stringify(obj));
|
|
|
this.send(obj);
|
|
|
}, 30 * 1000)
|
|
|
|
|
|
if(this.reconnectInterval){
|
|
|
clearInterval(this.reconnectInterval)
|
|
|
}
|
|
|
this.reconnectInterval = setInterval(()=>{
|
|
|
if(this.socket){
|
|
|
this.forceClose = true
|
|
|
this.socket.close()
|
|
|
}
|
|
|
this.init()
|
|
|
}, 5 * 60 * 1000 + 5000)
|
|
|
this.reconnectTimeout()
|
|
|
},
|
|
|
sendDeviceInfo: function() {
|
|
|
var obj = {
|
|
|
type: "ReadDevice",
|
|
|
mess: ""
|
|
|
}
|
|
|
this.socket.send(JSON.stringify(obj));
|
|
|
this.send(obj);
|
|
|
},
|
|
|
SetPrintPage: function() {
|
|
|
// string type; //text 文本 |line 间隔行|barcode 条码|qrcode 二维码|reset 重置打印机 |nline 走纸【进行【
|
|
@ -656,7 +663,7 @@ export default {
|
|
|
type: "PrintPage",
|
|
|
mess: JSON.stringify(printcon),
|
|
|
}
|
|
|
this.socket.send(JSON.stringify(obj));
|
|
|
this.send(obj);
|
|
|
},
|
|
|
updateOrderOutStatus(shipmentLogId, status, msg){
|
|
|
return new Promise((resolve, reject)=>{
|