|
@@ -6,24 +6,33 @@
|
|
|
<div class="container " id="list">
|
|
<div class="container " id="list">
|
|
|
<div class="card">
|
|
<div class="card">
|
|
|
<div class="card-header">
|
|
<div class="card-header">
|
|
|
- <label>
|
|
|
|
|
- <input type="text" name="printStr" class="form-control" ref="printStr">
|
|
|
|
|
- </label>
|
|
|
|
|
|
|
+ <div class="form-group">
|
|
|
|
|
+ <label class="form-inline" for="printStr"></label>
|
|
|
|
|
+ <input type="text" name="printStr" class="form-control" ref="printStr" id="printStr" placeholder="输入波次号,订单号,">
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="card-body">
|
|
<div class="card-body">
|
|
|
- <button @click="getPrintItems" >获取</button>
|
|
|
|
|
- <button @click="wsGetImage">GoWebSocket 预览</button>
|
|
|
|
|
- <button @click="wsPrintImage">GoWebSocket 打印</button>
|
|
|
|
|
- <button @click="uploadPrintData">WAS加工</button>
|
|
|
|
|
- <button @click="initGoWebSocket">GoWebSocket 重置</button>
|
|
|
|
|
|
|
+ <button class="btn btn-primary" @click="getPrintItems">获取</button>
|
|
|
|
|
+ <button class="btn btn-outline-info" @click="wsGetImage">GoWebSocket 预览</button>
|
|
|
|
|
+ <button class="btn btn-outline-primary" @click="uploadPrintData">WAS加工</button>
|
|
|
|
|
+ <button class="btn btn-success" @click="wsPrintImage">GoWebSocket 打印</button>
|
|
|
|
|
+ {{--<button class="btn btn-outline-warning" @click="initGoWebSocket">GoWebSocket 重置</button>--}}
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="alert-success" v-if="goWebSocketStatus === 1">
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <div class="container">
|
|
|
|
|
+ <p>打印步骤</p>
|
|
|
|
|
+ <p>1:输入单号-获取</p>
|
|
|
|
|
+ <p>2:预览</p>
|
|
|
|
|
+ <p>3:加工</p>
|
|
|
|
|
+ <p>4:打印</p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="alert alert-success" v-if="goWebSocketStatus === 1">
|
|
|
链接成功
|
|
链接成功
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="alert-primary" v-if="goWebSocketStatus === 2">
|
|
|
|
|
|
|
+ <div class="alert alert-primary" v-if="goWebSocketStatus === 2" @click="initGoWebSocket">
|
|
|
链接失败
|
|
链接失败
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="alert-primary" v-if="goWebSocketStatus === 3">
|
|
|
|
|
|
|
+ <div class="alert alert-primary" v-if="goWebSocketStatus === 3" @click="initGoWebSocket">
|
|
|
链接错误
|
|
链接错误
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -88,7 +97,7 @@
|
|
|
if (res.operation === 'print') {
|
|
if (res.operation === 'print') {
|
|
|
if (res.status === true) {
|
|
if (res.status === true) {
|
|
|
}
|
|
}
|
|
|
- } else if (res.operation === 'preview' ) {
|
|
|
|
|
|
|
+ } else if (res.operation === 'preview') {
|
|
|
if (res.status === "success") {
|
|
if (res.status === "success") {
|
|
|
this.printItems.forEach(function (item) {
|
|
this.printItems.forEach(function (item) {
|
|
|
if (item['task_id'] === res['task_id']) {
|
|
if (item['task_id'] === res['task_id']) {
|
|
@@ -161,6 +170,7 @@
|
|
|
}
|
|
}
|
|
|
this.initGoWebSocket();
|
|
this.initGoWebSocket();
|
|
|
this.printItems.forEach(function (item) {
|
|
this.printItems.forEach(function (item) {
|
|
|
|
|
+ if (item['is_process'] === true) return;
|
|
|
item['operation'] = 'preview';
|
|
item['operation'] = 'preview';
|
|
|
self.goWebSocket.send(JSON.stringify(item))
|
|
self.goWebSocket.send(JSON.stringify(item))
|
|
|
});
|
|
});
|
|
@@ -170,22 +180,10 @@
|
|
|
this.initGoWebSocket();
|
|
this.initGoWebSocket();
|
|
|
let self = this;
|
|
let self = this;
|
|
|
this.printItems.forEach(function (item) {
|
|
this.printItems.forEach(function (item) {
|
|
|
-
|
|
|
|
|
item['operation'] = 'print';
|
|
item['operation'] = 'print';
|
|
|
-
|
|
|
|
|
- item['printer_name'] = 'Microsoft XPS Document Writer';
|
|
|
|
|
-
|
|
|
|
|
self.goWebSocket.send(JSON.stringify(item));
|
|
self.goWebSocket.send(JSON.stringify(item));
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
- getPrinters(){
|
|
|
|
|
- let url ="";
|
|
|
|
|
- window.axios.get(url).then(res=>{
|
|
|
|
|
-
|
|
|
|
|
- }).catch(err=>{
|
|
|
|
|
-
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
|