Преглед на файлове

Merge branch 'master' of http://git.zthymaoyi.com:3000/gdc/yiliangyiyun-pc

gjy преди 3 години
родител
ревизия
9d4170901c

+ 17 - 17
src/views/houseSelfCollect/weightCheck.vue

@@ -494,7 +494,7 @@
       async openPort() {
         console.log('openPort', navigator)
         if ('serial' in navigator) {
-          if (!this.$store.state.app.reader) {
+          // if (!this.$store.state.app.reader) {
             // The Web Serial API is supported.
             console.log('the Web Serial API is supported.')
             console.log(this.param)
@@ -506,10 +506,10 @@
             console.log('beforeReader', port)
             console.log('beforeReader', this.reader)
             this.$store.dispatch('app/setReader', this.reader)
-          } else {
-            console.log('afterport', this.$store.state.app.reader)
-            this.reader = this.$store.state.app.reader
-          }
+          // } else {
+          //   console.log('afterport', this.$store.state.app.reader)
+          //   this.reader = this.$store.state.app.reader
+          // }
           // 监听来自串行设备的数据
           while (true) {
             const {
@@ -625,9 +625,9 @@
       },
       cancel() {
 
-        // if (this.reader) {
-        //   this.reader.cancel()
-        // }
+        if (this.reader) {
+          this.reader.cancel()
+        }
         this.$router.push({
           path: 'weighingManagement'
         })
@@ -678,9 +678,9 @@
         // })
       },
       print() {
-        // if (this.reader) {
-        //   this.reader.cancel()
-        // }
+        if (this.reader) {
+          this.reader.cancel()
+        }
         if (!this.weighingList.grossWeight) {
           this.$message({
             message: '毛重不能为空',
@@ -808,9 +808,9 @@
                           grossWeight(this.weighingList)
                           .toPromise()
                           .then((response) => {
-                            // if (this.reader) {
-                            //   this.reader.cancel()
-                            // }
+                            if (this.reader) {
+                              this.reader.cancel()
+                            }
                             this.$notify.success({
                               title: '成功',
                               message: '保存成功',
@@ -837,9 +837,9 @@
               tare(this.weighingList)
                 .toPromise()
                 .then((response) => {
-                  // if (this.reader) {
-                  //   this.reader.cancel()
-                  // }
+                  if (this.reader) {
+                    this.reader.cancel()
+                  }
                   this.$notify.success({
                     title: '成功',
                     message: '保存成功',

+ 5 - 5
src/views/outboundManagement/weighing.vue

@@ -181,7 +181,7 @@
 			async openPort(){
 			 console.log('openPort', navigator)
         if ('serial' in navigator) {
-          if (!this.$store.state.app.reader) {
+        //   if (!this.$store.state.app.reader) {
             // The Web Serial API is supported.
             console.log('the Web Serial API is supported.')
             console.log(this.param)
@@ -193,10 +193,10 @@
             console.log('beforeReader', port)
             console.log('beforeReader', this.reader)
             this.$store.dispatch('app/setReader', this.reader)
-          } else {
-            console.log('afterport', this.$store.state.app.reader)
-            this.reader = this.$store.state.app.reader
-          }
+        //   } else {
+        //     console.log('afterport', this.$store.state.app.reader)
+        //     this.reader = this.$store.state.app.reader
+        //   }
 				// 监听来自串行设备的数据
 				while (true) {
 				const { value, done } = await this.reader.read();

+ 17 - 17
src/views/warehouse/warehouseManagementGross.vue

@@ -927,7 +927,7 @@ export default {
     async openPort() {
       console.log('openPort', navigator)
         if ('serial' in navigator) {
-          if (!this.$store.state.app.reader) {
+          // if (!this.$store.state.app.reader) {
             // The Web Serial API is supported.
             console.log('the Web Serial API is supported.')
             console.log(this.param)
@@ -939,10 +939,10 @@ export default {
             console.log('beforeReader', port)
             console.log('beforeReader', this.reader)
             this.$store.dispatch('app/setReader', this.reader)
-          } else {
-            console.log('afterport', this.$store.state.app.reader)
-            this.reader = this.$store.state.app.reader
-          }
+          // } else {
+          //   console.log('afterport', this.$store.state.app.reader)
+          //   this.reader = this.$store.state.app.reader
+          // }
         // 监听来自串行设备的数据
         while (true) {
           const { value, done } = await this.reader.read()
@@ -1188,9 +1188,9 @@ export default {
     //提交按钮
     submit() {
       
-      // if(this.reader){
-      //   this.reader.cancel()
-      // }
+      if(this.reader){
+        this.reader.cancel()
+      }
       if (!this.deptBudgetList.goodsName) {
         this.$message({
           message: '货名不能为空',
@@ -1770,9 +1770,9 @@ export default {
                   // this.deptBudgetList.netWeight = Math.round(this.dataList.netWeight*1000)
                   // this.deptBudgetList.pureWeight = Math.round(this.dataList.pureWeight*1000)
                   // this.deptBudgetList.deductionWeight = Math.round(this.dataList.deductionWeight*1000)
-                  // if (this.reader) {
-                  //   this.reader.cancel()
-                  // }
+                  if (this.reader) {
+                    this.reader.cancel()
+                  }
                   this.$message.success('添加成功')
                   this.$router.push({
                     path: 'warehouseManagementList',
@@ -1807,9 +1807,9 @@ export default {
     },
     temporaryStorage() {
       
-        // if(this.reader){
-        //   this.reader.cancel()
-        // }
+        if(this.reader){
+          this.reader.cancel()
+        }
       if (!this.deptBudgetList.goodsName) {
         this.$message({
           message: '货名不能为空',
@@ -2304,9 +2304,9 @@ export default {
               addstorageputList(this.deptBudgetList)
                 .toPromise()
                 .then((response) => {
-                  // if (this.reader) {
-                  //   this.reader.cancel()
-                  // }
+                  if (this.reader) {
+                    this.reader.cancel()
+                  }
                   this.$message.success('保存成功')
                   this.$router.push({
                     path: 'warehouseManagementList',

+ 11 - 11
src/views/warehouse/warehouseManagementNoWeightIn.vue

@@ -898,7 +898,7 @@ export default {
     async openPort() {
        console.log('openPort', navigator)
         if ('serial' in navigator) {
-          if (!this.$store.state.app.reader) {
+          // if (!this.$store.state.app.reader) {
             // The Web Serial API is supported.
             console.log('the Web Serial API is supported.')
             console.log(this.param)
@@ -910,10 +910,10 @@ export default {
             console.log('beforeReader', port)
             console.log('beforeReader', this.reader)
             this.$store.dispatch('app/setReader', this.reader)
-          } else {
-            console.log('afterport', this.$store.state.app.reader)
-            this.reader = this.$store.state.app.reader
-          }
+          // } else {
+          //   console.log('afterport', this.$store.state.app.reader)
+          //   this.reader = this.$store.state.app.reader
+          // }
         // 监听来自串行设备的数据
         while (true) {
           const { value, done } = await this.reader.read()
@@ -1251,9 +1251,9 @@ export default {
     //提交按钮
     submit() {
       
-      // if(this.reader){
-      //   this.reader.cancel()
-      // }
+      if(this.reader){
+        this.reader.cancel()
+      }
       if (!this.dataList.goodsName) {
         this.$message({
           message: '货名不能为空',
@@ -1778,9 +1778,9 @@ export default {
                   this.dataList.deductionWeight = Math.round(
                     this.dataList.deductionWeight * 1000
                   )
-                  // if (this.reader) {
-                  //   this.reader.cancel()
-                  // }
+                  if (this.reader) {
+                    this.reader.cancel()
+                  }
                   this.$message.success('提交成功')
                   this.$confirm(`是否打印磅单`, {
                     cancelButtonText: '取消',

+ 11 - 11
src/views/warehouse/warehouseManagementNoWeightOut.vue

@@ -668,7 +668,7 @@ export default {
     async openPort() {
       console.log('openPort', navigator)
     if ('serial' in navigator) {
-      if (!this.$store.state.app.reader) {
+      // if (!this.$store.state.app.reader) {
         // The Web Serial API is supported.
         console.log('the Web Serial API is supported.')
         console.log(this.param)
@@ -680,10 +680,10 @@ export default {
         console.log('beforeReader', port)
         console.log('beforeReader', this.reader)
         this.$store.dispatch('app/setReader', this.reader)
-      } else {
-        console.log('afterport', this.$store.state.app.reader)
-        this.reader = this.$store.state.app.reader
-      }
+      // } else {
+      //   console.log('afterport', this.$store.state.app.reader)
+      //   this.reader = this.$store.state.app.reader
+      // }
         // 监听来自串行设备的数据
         while (true) {
           const { value, done } = await this.reader.read()
@@ -973,9 +973,9 @@ export default {
     //提交按钮
     submit() {
       
-      // if(this.reader){
-      //   this.reader.cancel()
-      // }
+      if(this.reader){
+        this.reader.cancel()
+      }
       if (!this.dataList.goodsName) {
         this.$message({
           message: '货名不能为空',
@@ -1399,9 +1399,9 @@ export default {
               addstorageputList(this.dataList)
                 .toPromise()
                 .then((response) => {
-                  // if (this.reader) {
-                  //   this.reader.cancel()
-                  // }
+                  if (this.reader) {
+                    this.reader.cancel()
+                  }
                   this.$message.success('提交成功')
                   this.$confirm(`是否打印磅单`, {
                     cancelButtonText: '取消',

+ 16 - 14
src/views/warehouse/warehouseManagementTare.vue

@@ -785,7 +785,7 @@ export default {
     async openPort() {
       console.log('openPort', navigator)
     if ('serial' in navigator) {
-      if (!this.$store.state.app.reader) {
+      // if (!this.$store.state.app.reader) {
         // The Web Serial API is supported.
         console.log('the Web Serial API is supported.')
         console.log(this.param)
@@ -797,10 +797,10 @@ export default {
         console.log('beforeReader', port)
         console.log('beforeReader', this.reader)
         this.$store.dispatch('app/setReader', this.reader)
-      } else {
-        console.log('afterport', this.$store.state.app.reader)
-        this.reader = this.$store.state.app.reader
-      }
+      // } else {
+      //   console.log('afterport', this.$store.state.app.reader)
+      //   this.reader = this.$store.state.app.reader
+      // }
         // 监听来自串行设备的数据
         while (true) {
           const { value, done } = await this.reader.read()
@@ -1398,16 +1398,18 @@ export default {
               this.deptBudgetList.statusFlag = 1
               this.deptBudgetList.grossWeight /= 1000
               this.deptBudgetList.tare /= 1000
-              this.deptBudgetList.netWeight = Number(
-                this.deptBudgetList.netWeight
-              ).toFixed(2)
+              if(this.deptBudgetList.netWeight){
+                this.deptBudgetList.netWeight = Number(
+                  this.deptBudgetList.netWeight
+                ).toFixed(2)
+              }
               this.deptBudgetList.pureWeight /= 1000
               addstorageputList(this.deptBudgetList)
                 .toPromise()
                 .then((response) => {
-                  // if (this.reader) {
-                  //   this.reader.cancel()
-                  // }
+                  if (this.reader) {
+                    this.reader.cancel()
+                  }
                   this.$message.success('保存成功')
                   this.$router.push({
                     path: 'warehouseManagementList',
@@ -1881,9 +1883,9 @@ export default {
             addstorageputList(this.deptBudgetList)
               .toPromise()
               .then((response) => {
-                // if (this.reader) {
-                //   this.reader.cancel()
-                // }
+                if (this.reader) {
+                  this.reader.cancel()
+                }
                 this.$message.success('添加成功')
                 this.$router.push({
                   path: 'warehouseManagementList',