achao 3 лет назад
Родитель
Сommit
7e636697a3

+ 21 - 15
src/components/balanceAlert.vue

@@ -5,7 +5,7 @@
     <div class="title" v-else>皮重</div>
     <div class="number" v-if="information.indexOf('毛重') > -1">{{grossWeightVal}} kg</div>
     <div class="number" v-else>{{tareVal}} KG</div>
-    
+
     <div class="btn" @click="sendVal">确定</div>
   </div>
 </template>
@@ -14,28 +14,34 @@
 
 export default {
   name: 'balanceAlert',
-  props: ['deptBudgetList', 'information'],
+  props: ['deptBudgetList1', 'information'],
   data () {
     return {
      param: 9600,
      grossWeightVal:'',
-     tareVal:''
+     tareVal:'',
+     deptBudgetList:this.deptBudgetList1
     }
   },
   activated(){
-   
+
   },
-  mounted(){
+  mounted(){debugger
  console.log('11111111111111111111111111111111111')
-    console.log(this.deptBudgetList)
+    console.log(this.deptBudgetList1)
     this.openPort()
   },
   computed: {
-    
+
   },
   created () {
-    
+
   },
+   watch: {
+      deptBudgetList1: function (deptBudgetList1) {debugger
+        this.deptBudgetList = deptBudgetList1
+      }
+    },
   methods: {
     sendVal(){
       console.log(this.grossWeightVal)
@@ -45,7 +51,7 @@ export default {
       }else{
         this.$emit('balanceListen',this.tareVal)
       }
-      
+
     },
    async closePort() {
       console.log('closePort')
@@ -72,7 +78,7 @@ export default {
           }
         // 监听来自串行设备的数据
         while (true) {
-          
+
           const { value, done } = await this.reader.read()
           // console.log("value",value);
           if (done) {
@@ -114,7 +120,7 @@ export default {
               this.deptBudgetList.warehouseName == '哈尔滨依兰库'||
               this.deptBudgetList.warehouseName == '龙江金信库')
           ) {
-            
+
             for (var i = 0; i < value.length; i++) {
               var tmp = String.fromCharCode(value[i])
               if (tmp == '+') {
@@ -161,7 +167,7 @@ export default {
             if(value.length > 10){
                for (var i = 0; i < value.length; i++) {
                   var tmp = String.fromCharCode(value[i])
-                  
+
                   // if (value[0] != 49 && value[0] != 2) {
                   //   // if (
                   //   //   value[value.length - 1] == 48 &&
@@ -187,7 +193,7 @@ export default {
                   if (
                     flag &&
                     result.length < 7 &&
-                    tmp != String.fromCharCode(32) 
+                    tmp != String.fromCharCode(32)
                     // &&
                     // !(
                     //   value[value.length - 1] == 48 && value[value.length - 2] == 48
@@ -199,7 +205,7 @@ export default {
                     else{
                       result += tmp
                     }
-                    
+
                   }
                   // if (flag1 && tmp != String.fromCharCode(32)) {
                   //   // if (
@@ -216,7 +222,7 @@ export default {
                   // }
                 }
             }
-            
+
             if (this.information.indexOf('毛重') > -1) {
               if (parseInt(result) || parseInt(result) == 0) {
                 this.grossWeightVal = parseInt(

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

@@ -12,7 +12,7 @@
     </el-row>
     <div class="substance">
       <div class="left">
-        <BalanceAlert v-if='isShowBalance' ref="weightChild" :deptBudgetList='deptBudgetList'
+        <BalanceAlert v-if='isShowBalance' ref="weightChild" :deptBudgetList1='deptBudgetList'
             :information='information' v-on:balanceListen="setVal"></BalanceAlert>
         <div class="top">
           <div class="car-type">{{carWeightInfo.type}}</div>

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

@@ -22,7 +22,7 @@
           <span v-show="this.$route.query.warehouseType == 2">(临)</span>
         </h2>
         <div class="balance-row">
-          <BalanceAlert v-if='isShowBalance' class="left" ref="weightChild" :deptBudgetList='deptBudgetList'
+          <BalanceAlert v-if='isShowBalance' class="left" ref="weightChild" :deptBudgetList1='deptBudgetList'
             :information='information' v-on:balanceListen="setVal"></BalanceAlert>
           <div class="top">
             <div class="car-type">皮重</div>

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

@@ -22,7 +22,7 @@
           <span v-show="this.$route.query.warehouseType == 2"> (临) </span>
         </h2>
         <div class="balance-row">
-          <BalanceAlert v-if='isShowBalance' class="left" ref="weightChild" :deptBudgetList='deptBudgetList'
+          <BalanceAlert v-if='isShowBalance' class="left" ref="weightChild" :deptBudgetList1='deptBudgetList'
             :information='information' v-on:balanceListen="setVal"></BalanceAlert>
           <div class="top">
             <div class="car-type">毛重</div>

+ 1 - 1
src/views/warehouse/warehouseManagementTare.vue

@@ -21,7 +21,7 @@
           <span v-show="this.deptBudgetList.warehouseType == 2">(临)</span>
         </h2>
         <div class="balance-row">
-          <BalanceAlert v-if='isShowBalance' class="left" ref="weightChild" :deptBudgetList='deptBudgetList'
+          <BalanceAlert v-if='isShowBalance' class="left" ref="weightChild" :deptBudgetList1='deptBudgetList'
             :information='information' v-on:balanceListen="setVal"></BalanceAlert>
           <div class="top">
             <div class="car-type">皮重</div>