浏览代码

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

gjy 3 年之前
父节点
当前提交
5fcc58ab84
共有 2 个文件被更改,包括 80 次插入39 次删除
  1. 56 34
      src/components/balanceAlert.vue
  2. 24 5
      src/layout/index/top/index.vue

+ 56 - 34
src/components/balanceAlert.vue

@@ -155,43 +155,65 @@ export default {
               }
             }
           } else {
-            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 &&
-                  value[value.length - 2] == 48
-                ) {
-                  flag1 = true
-                } else {
-                  break
-                }
-              }
-              if (tmp == String.fromCharCode(32)) {
-                flag = true
-              }
-              if (
-                flag &&
-                result.length < 7 &&
-                tmp != String.fromCharCode(32) &&
-                !(
-                  value[value.length - 1] == 48 && value[value.length - 2] == 48
-                )
-              ) {
-                result += tmp
-              }
-              if (flag1 && tmp != String.fromCharCode(32)) {
-                if (
-                  value[value.length - 1] == 48 &&
-                  value[value.length - 2] == 48
-                ) {
-                  if (i == 0) {
-                    this.result1 = tmp + '0'
+            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 &&
+                  //   //   value[value.length - 2] == 48
+                  //   // ) {
+                  //   //   flag1 = true
+                  //   // } else {
+                  //   //   break
+                  //   // }
+                  //   // flag1 = true
+                  //   if (i == 0) {
+                  //     this.result1 = tmp + '0'
+                  //   }
+                  // }
+                  // else{
+                  //   if (tmp == String.fromCharCode(32)) {
+                  //     flag = true
+                  //   }
+                  // }
+                  if (tmp == String.fromCharCode(32)) {
+                      flag = true
+                    }
+                  if (
+                    flag &&
+                    result.length < 7 &&
+                    tmp != String.fromCharCode(32) 
+                    // &&
+                    // !(
+                    //   value[value.length - 1] == 48 && value[value.length - 2] == 48
+                    // )
+                  ) {
+                    if(i > 0&& value[i] == 48&& value[i-1] == 32){
+                      break
+                    }
+                    else{
+                      result += tmp
+                    }
+                    
                   }
+                  // if (flag1 && tmp != String.fromCharCode(32)) {
+                  //   // if (
+                  //   //   value[value.length - 1] == 48 &&
+                  //   //   value[value.length - 2] == 48
+                  //   // ) {
+                  //   //   if (i == 0) {
+                  //   //     this.result1 = tmp + '0'
+                  //   //   }
+                  //   // }
+                  //   if (i == 0) {
+                  //     this.result1 = tmp + '0'
+                  //   }
+                  // }
                 }
-              }
             }
+            
             if (this.information.indexOf('毛重') > -1) {
               if (parseInt(result) || parseInt(result) == 0) {
                 this.grossWeightVal = parseInt(

+ 24 - 5
src/layout/index/top/index.vue

@@ -21,10 +21,10 @@
       <!-- 使用租户 -->
       
       <div class="hidden-content">
-        <el-input ref="hiddenFocus" type="password" class="input-Style" v-model="barCode" size="small" @focus="focus" @blur="blur"
+        <el-input ref="hiddenFocus" style ="ime-mode:disabled"  type="text" class="input-Style" v-model="barCode" size="small" @focus="focus" @blur="blur"
           @keyup.enter.native="payCode" placeholder="扫码枪内容"></el-input>
-        <div v-show="isOpenCodeGun">扫码枪已连接</div>
-        <div v-show="!isOpenCodeGun" @click="setCodeGun">点我扫码</div>
+        <div v-show="isOpenCodeGun" class="code-scan-text">扫码枪已连接</div>
+        <div v-show="!isOpenCodeGun" @click="setCodeGun" class="code-scan-text">点我扫码</div>
         <!--  -->
         <el-dialog title="扫描二维码" :visible.sync="smAlert" width="200px374a8a02ecfe40dc9abdcd902dd564f5
         ">
@@ -50,8 +50,8 @@
           </div>
         </el-dialog>
       </div>
-      <div >
-        <span style="padding: 0 4px;font-size:15px;position:relative;top:-2px;">{{compName}}</span>
+      <div class="compName-row">
+        <span class="compName">{{compName}}</span>
       </div>
       <div v-if="getDay" class="right-menu-item hover-effect dayClass">
         {{ $t('common.trialDays') }}
@@ -734,6 +734,8 @@
   .hidden-content {
     display: flex;
     font-size: 16px;
+    margin-right: 20px;
+    align-items: center;
   }
 
   .input-Style {
@@ -759,4 +761,21 @@
     padding: 20px!important;
     font-size: 40px;
   }
+  .compName{
+    font-size: 16px;
+  }
+  .compName-row{
+    // background: red;
+    display: flex;
+    height: 100%;
+  }
+  .code-scan-text{
+    height: 30px;
+    line-height: 30px;
+    background: #EFF7FD;
+    border-radius: 20px;
+    color:#5473E8 ;
+    border: 1px solid #5473E8;
+    padding: 0 15px;
+  }
 </style>