yuantianjiao 6 年之前
父節點
當前提交
b0477ac7ef
共有 2 個文件被更改,包括 20 次插入13 次删除
  1. 1
    1
      dist/index.html
  2. 19
    12
      src/pages/system/newOrder/newOrderList/index.vue

+ 1
- 1
dist/index.html 查看文件

@@ -1 +1 @@
1
-<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><link rel=stylesheet href=//at.alicdn.com/t/font_775069_dwqa9wy3lkh.css><link rel="shortcut icon" href=favorite.ico><title>城的空间后台管理系统</title><link href=./static/css/app.ae72038e174a11169c7c51f94e09113e.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.7e921535e20f729cf046.js></script><script type=text/javascript src=./static/js/app.eacb012101628be54e8d.js></script></body></html>
1
+<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><link rel=stylesheet href=//at.alicdn.com/t/font_775069_dwqa9wy3lkh.css><link rel="shortcut icon" href=favorite.ico><title>城的空间后台管理系统</title><link href=./static/css/app.bf70b42de6cff066f179f6fcb263c589.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.7e921535e20f729cf046.js></script><script type=text/javascript src=./static/js/app.71e24e76faf4dd36b9f1.js></script></body></html>

+ 19
- 12
src/pages/system/newOrder/newOrderList/index.vue 查看文件

@@ -179,12 +179,12 @@ export default {
179 179
         var timer = setInterval(() => {
180 180
           if (param.length && bool) {
181 181
             bool = false
182
+            this.printPdf(`item_${param[0]}`)
182 183
             this.putPrintGoodsOrder({
183 184
               id: param[0]
184 185
             }).then(() => {
185 186
               param.splice(0, 1)
186 187
               bool = true
187
-              this.printPdf(`item_${param[0]}`)
188 188
             })
189 189
           } else {
190 190
             clearInterval(timer)
@@ -298,7 +298,7 @@ export default {
298 298
       this.updateList({ list: this.list.concat(newList) }).then(() => {
299 299
         newList.forEach((it) => {
300 300
           console.log(it)
301
-          if (it.IsIntimidate === 0) {
301
+          if (!it.IsIntimidate) {
302 302
             console.log('print')
303 303
             this.putPrintGoodsOrder({
304 304
               id: it.OrdersId
@@ -316,19 +316,26 @@ export default {
316 316
         this.websockets[wsRealPath] = new WebSocket(url)
317 317
         this.websockets[wsRealPath].onopen = console.log
318 318
         this.websockets[wsRealPath].onmessage = this.websocketonmessage
319
-        this.websockets[wsRealPath].onclose = this.reloadWebSocket
320
-        this.websockets[wsRealPath].onerror = this.reloadWebSocket
319
+        this.websockets[wsRealPath].onclose = ((ws) => {
320
+          return e => this.reloadWebSocket(e, ws)
321
+        })(this.websockets[wsRealPath])
321 322
         this.websockets[wsRealPath].interval = setInterval(() => this.websockets[wsRealPath].send(10), 120000)
322 323
       }
323 324
     },
324
-    reloadWebSocket (e) {
325
-      console.log(e.currentTarget.url)
326
-      Object.keys(this.websockets).forEach((key) => {
327
-        clearInterval(this.websockets[key].interval)
328
-      })
329
-      if (this.needReload) { // 此变量判断是否需要重连
330
-        this.websockets = {}
331
-        this.initWebSocket()
325
+    reloadWebSocket (e, ws) {
326
+      if (e.target.readyState >= 2) {
327
+        console.log(e.currentTarget.url)
328
+        Object.keys(this.websockets).forEach((key) => {
329
+          // this.websockets[key].close()
330
+          clearInterval(this.websockets[key].interval)
331
+        })
332
+        ws = null
333
+        setTimeout(() => {
334
+          if (this.needReload) { // 此变量判断是否需要重连
335
+            this.websockets = {}
336
+            this.initWebSocket()
337
+          }
338
+        }, 5000)
332 339
       }
333 340
     },
334 341
     open () {