ccjgmwz %!s(int64=3) %!d(string=hai) anos
pai
achega
fc33358f20
Modificáronse 1 ficheiros con 10 adicións e 4 borrados
  1. 10 4
      src/components/balanceAlert.vue

+ 10 - 4
src/components/balanceAlert.vue

@@ -58,21 +58,22 @@ export default {
           if (!this.$store.state.app.reader) {
           if (!this.$store.state.app.reader) {
             // The Web Serial API is supported.
             // The Web Serial API is supported.
             console.log('the Web Serial API is supported.')
             console.log('the Web Serial API is supported.')
-            console.log(this.param)
             const port = await navigator.serial.requestPort()
             const port = await navigator.serial.requestPort()
+          debugger
             if(this.deptBudgetList.warehouseName == '白城内陆港'){
             if(this.deptBudgetList.warehouseName == '白城内陆港'){
               this.param = 1200
               this.param = 1200
             }
             }
             else{
             else{
               this.param = 9600
               this.param = 9600
             }
             }
+            console.log(this.param)
             await port.open({
             await port.open({
               baudRate: this.param,
               baudRate: this.param,
             }) // set baud rate
             }) // set baud rate
             this.reader = port.readable.getReader()
             this.reader = port.readable.getReader()
-            console.log('beforeReader', port)
-            console.log('beforeReader', this.reader)
+            console.log('port  ', port)
             this.$store.dispatch('app/setReader', this.reader)
             this.$store.dispatch('app/setReader', this.reader)
+            console.log('reader  ', this.reader)
           } else {
           } else {
             console.log('afterport', this.$store.state.app.reader)
             console.log('afterport', this.$store.state.app.reader)
             this.reader = this.$store.state.app.reader
             this.reader = this.$store.state.app.reader
@@ -111,7 +112,12 @@ export default {
           //     this.deptBudgetList.tare = parseInt(result)
           //     this.deptBudgetList.tare = parseInt(result)
           //   }
           //   }
           // }
           // }
-          console.log('value:', value)
+          if(value.length > 3){
+            console.log('value:', value)
+          }
+          else if(this.deptBudgetList.warehouseName == '白城内陆港'){
+            break
+          }
           if (
           if (
             this.deptBudgetList.warehouseName &&
             this.deptBudgetList.warehouseName &&
             (this.deptBudgetList.warehouseName == '山东诸城迈饶库' ||
             (this.deptBudgetList.warehouseName == '山东诸城迈饶库' ||