ccjgmwz 3 éve
szülő
commit
caf8c20a5d
1 módosított fájl, 9 hozzáadás és 3 törlés
  1. 9 3
      src/views/houseSelfCollect/weightCheck.vue

+ 9 - 3
src/views/houseSelfCollect/weightCheck.vue

@@ -429,7 +429,9 @@
       },
       async closePort() {
         console.log('closePort');
-        this.reader.cancel()
+        if(this.reader){
+          this.reader.cancel()
+        }
       },
       async openPort() {
         console.log('openPort', navigator);
@@ -725,7 +727,9 @@
                           grossWeight(this.weighingList)
                           .toPromise()
                           .then((response) => {
-                            this.reader.cancel()
+                            if(this.reader){
+                              this.reader.cancel()
+                            }
                             this.$notify.success({
                               title: '成功',
                               message: '保存成功',
@@ -752,7 +756,9 @@
               tare(this.weighingList)
                 .toPromise()
                 .then((response) => {
-                  this.reader.cancel()
+                  if(this.reader){
+                    this.reader.cancel()
+                  }
                   this.$notify.success({
                     title: '成功',
                     message: '保存成功',