|
|
|
@ -72,7 +72,7 @@ function websocketLifePeriod() { |
|
|
|
|
|
|
|
websocket.onerror = errorCallback; |
|
|
|
|
|
|
|
console.log(websocket); |
|
|
|
//console.log(websocket);
|
|
|
|
|
|
|
|
return websocket; |
|
|
|
} |
|
|
|
@ -173,11 +173,13 @@ function init() { |
|
|
|
var arrParse = JSON.parse(JSON.stringify(data)); |
|
|
|
if (arrParse.resultAck.result !== 0) { |
|
|
|
// 如果初始化失败
|
|
|
|
this.$message.error("初始化打印服务失败,请重试"); |
|
|
|
setTimeout(function () { |
|
|
|
var index = parent.layer.getFrameIndex(window.name); |
|
|
|
parent.layer.close(index); |
|
|
|
}, 500); |
|
|
|
this.$alert('初始化打印服务失败,请重试', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
callback: action => { |
|
|
|
var index = parent.layer.getFrameIndex(window.name); |
|
|
|
parent.layer.close(index); |
|
|
|
} |
|
|
|
}); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
@ -185,11 +187,13 @@ function init() { |
|
|
|
let arrParse = JSON.parse(JSON.stringify(data)); |
|
|
|
|
|
|
|
if (!arrParse.resultAck.result) { |
|
|
|
this.$message.error("打印机获取失败,请重试"); |
|
|
|
setTimeout(function () { |
|
|
|
var index = parent.layer.getFrameIndex(window.name); |
|
|
|
parent.layer.close(index); |
|
|
|
}, 500); |
|
|
|
this.$alert('打印机获取失败,请重试', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
callback: action => { |
|
|
|
var index = parent.layer.getFrameIndex(window.name); |
|
|
|
parent.layer.close(index); |
|
|
|
} |
|
|
|
}); |
|
|
|
return; |
|
|
|
} else if (isJSON(arrParse.resultAck.info)) { |
|
|
|
allPrinters = JSON.parse(arrParse.resultAck.info); |
|
|
|
|