|
|
@@ -66,6 +66,8 @@
|
|
|
|
|
|
|
|
|
@section('lastScript')
|
|
|
+ <script type="text/javascript" src='http://localhost:8000/CLodopfuncs.js?name=CLODOPA'></script>
|
|
|
+
|
|
|
<script>
|
|
|
let WebSocketStatus = {
|
|
|
Close: 0,
|
|
|
@@ -142,7 +144,7 @@
|
|
|
let _this =this;
|
|
|
window.axios.post(url, data).then(res => {
|
|
|
this.printItems =this.printItems.concat(res.data.data);
|
|
|
- res.data.data.forEach((item)=>{
|
|
|
+ res.data.data.forEach((item,i,array)=>{
|
|
|
_this.previewLogisticFace(item);
|
|
|
})
|
|
|
this.$forceUpdate();
|
|
|
@@ -152,8 +154,7 @@
|
|
|
},
|
|
|
// TODO ClientWs 返回信息
|
|
|
receiveClientWebSocketMessage(meg) {
|
|
|
- let data = meg.data;
|
|
|
- data = JSON.parse(data);
|
|
|
+ let data = JSON.parse(meg.data);
|
|
|
if (data['Status'] !== true){return ;}
|
|
|
let _this = this;
|
|
|
switch (data["ProcessType"]) {
|
|
|
@@ -189,12 +190,12 @@
|
|
|
let _this = this;
|
|
|
window.axios.post(url, data).then(res => {
|
|
|
if (res.data.success){
|
|
|
- console.log(res.data.data);
|
|
|
- this.printItems.forEach((item)=>{
|
|
|
+ this.printItems.forEach((item)=>{
|
|
|
res.data.data.forEach(node=>{
|
|
|
if(node['task_id'] === item["task_id"]){
|
|
|
item['base64'] = node['base64'];
|
|
|
- _this.prin tImage(item);
|
|
|
+ _this.printImage(item);
|
|
|
+ //_this.LodopPrint(item);
|
|
|
}
|
|
|
})
|
|
|
|
|
|
@@ -239,8 +240,7 @@
|
|
|
if (data.type === "CAINIAO") {
|
|
|
let json = this.getCnPreviewTaskJson(data)
|
|
|
if (this.cnWebSocket && this.cnWebSocket.readyState === 1) {
|
|
|
- console.log(json);
|
|
|
- this.cnWebSocket.send(json)
|
|
|
+ this.cnWebSocket.send(json)
|
|
|
}
|
|
|
} else if (data.type === "PDD") {
|
|
|
let json = this.getPddPreviewTaskJson(data)
|
|
|
@@ -250,7 +250,11 @@
|
|
|
}
|
|
|
},
|
|
|
handlerCnWebsocket(message) {
|
|
|
- let data = JSON.parse(message.data)
|
|
|
+ let data = JSON.parse(message.data);
|
|
|
+ if (data.status === 'failed'){
|
|
|
+ window.tempTip.show(data.msg);
|
|
|
+ return ;
|
|
|
+ }
|
|
|
if (data.cmd === 'print') {
|
|
|
let url = data['previewImage'][0];
|
|
|
this.printItems.forEach((item)=>{
|
|
|
@@ -337,7 +341,15 @@
|
|
|
printImage(item){
|
|
|
let data = JSON.parse(JSON.stringify(item));
|
|
|
data.processType = "printImage";
|
|
|
+ data.p
|
|
|
this.ClientWebSocket.send(JSON.stringify(data));
|
|
|
+ },
|
|
|
+ LodopPrint(item){
|
|
|
+ let LODOP = getCLodop();
|
|
|
+ LODOP.PRINT_INIT("打印插件功能演示_Lodop功能_BASE64编码串打印图片");
|
|
|
+ LODOP.ADD_PRINT_IMAGE(100,100,"100%","100%",'data:image/jpeg;base64,'+item.base64);
|
|
|
+ LODOP.ADD_PRINT_RECT("0%","0%","100%","100%",0,1)
|
|
|
+ LODOP.PREVIEW();
|
|
|
}
|
|
|
}
|
|
|
});
|