Browse Source

修改检斤样式

mxx 3 years ago
parent
commit
a05feb3d6b
2 changed files with 90 additions and 68 deletions
  1. 4 0
      src/App.vue
  2. 86 68
      src/views/houseSelfCollect/weightCheck.vue

+ 4 - 0
src/App.vue

@@ -97,4 +97,8 @@ input::-webkit-inner-spin-button {
 input[type='number'] {
       -moz-appearance: textfield !important;
     }
+    .el-input.is-disabled .el-input__inner{
+      background: #f9FAFC!important;
+      color: #8890B1!important;
+    }
 </style>

+ 86 - 68
src/views/houseSelfCollect/weightCheck.vue

@@ -41,9 +41,8 @@
         </div>
       </div>
       <div class="right">
-        <ws-form>
-          <div style="margin: 0 auto">
-
+        <ws-form class='right-content'>
+          <div class="left">
             <div class="tab">
               <div class="tab-item" :class="index==0?'active':''" @click="tabClick(0)"> 待称毛重({{mList.length}})</div>
               <div class="tab-item" :class="index==1?'active':''" @click="tabClick(1)">待称皮重({{pList.length}})</div>
@@ -67,21 +66,17 @@
                 <ws-input v-model="weighingList.carNumber" placeholder="请输入车牌号" maxlength="100" size="small" disabled />
               </ws-form-item>
               <ws-form-item label="箱号-1" span="1" prop="boxNo">
-            <ws-input disabled v-model="inspect.boxNo" placeholder="请输入箱号" maxlength="20"
-              size="small" />
-          </ws-form-item>
-          <ws-form-item label="箱号-2" span="1" prop="boxNoOther">
-            <ws-input disabled v-model="inspect.boxNoOther" placeholder="请输入箱号" maxlength="20"
-              size="small" />
-          </ws-form-item>
-          <ws-form-item label="封号-1" span="1" prop="titleNo">
-            <ws-input disabled v-model="inspect.titleNo" placeholder="请输入封号" maxlength="20"
-              size="small" />
-          </ws-form-item>
-          <ws-form-item label="封号-2" span="1" prop="titleNoOther">
-            <ws-input disabled v-model="inspect.titleNoOther" placeholder="请输入封号" maxlength="20"
-              size="small" />
-          </ws-form-item>
+                <ws-input disabled v-model="inspect.boxNo" placeholder="请输入箱号" maxlength="20" size="small" />
+              </ws-form-item>
+              <ws-form-item label="箱号-2" span="1" prop="boxNoOther">
+                <ws-input disabled v-model="inspect.boxNoOther" placeholder="请输入箱号" maxlength="20" size="small" />
+              </ws-form-item>
+              <ws-form-item label="封号-1" span="1" prop="titleNo">
+                <ws-input disabled v-model="inspect.titleNo" placeholder="请输入封号" maxlength="20" size="small" />
+              </ws-form-item>
+              <ws-form-item label="封号-2" span="1" prop="titleNoOther">
+                <ws-input disabled v-model="inspect.titleNoOther" placeholder="请输入封号" maxlength="20" size="small" />
+              </ws-form-item>
               <ws-form-item label="货名" span="1" prop="goodsName">
                 <ws-input v-model="weighingList.goodsName" placeholder="请输入货名" maxlength="100" size="small" disabled />
               </ws-form-item>
@@ -91,13 +86,13 @@
                   size="small" :disabled="disabled" />
                 <ws-input type="number" @mousewheel.native.prevent v-else v-model="weighingList.grossWeight"
                   @input="calculation" placeholder="未获取到毛重" maxlength="100" size="small" disabled />
+                <el-button type="primary" :class="index ==0 ? '' : 'butCss'" @click="openPort">重新获取</el-button>
               </ws-form-item>
-              <el-button type="primary" :class="index ==0 ? '' : 'butCss'" @click="openPort">重新获取</el-button>
               <ws-form-item label="皮重(公斤)" span="1" prop="tare" v-if="information == '皮重'">
                 <ws-input type="number" @mousewheel.native.prevent v-model="weighingList.tare" @input="calculation"
                   placeholder="未获取到皮重" maxlength="100" size="small" :disabled="disabled" />
+                <el-button type="primary" v-if="index != 0" @click="openPort">重新获取</el-button>
               </ws-form-item>
-              <el-button type="primary" v-if="index != 0" @click="openPort">重新获取</el-button>
               <div class="formItem">
                 <ws-form-item label="扣重(公斤)" span="1" prop="buckleWeightRatio"
                   v-if="information == '皮重' && paramType == '2'">
@@ -117,9 +112,9 @@
               <el-button @click="print" v-if="this.information == '皮重'" type="primary">保存并打印</el-button>
             </div>
           </div>
-          <div class="bottom">
-            <el-table ref="singleTable" :data="carList" height="550" highlight-current-row
-              @current-change="handleCurrentChange" style="width: 100%;overflow:auto">
+          <div class="right">
+            <el-table ref="singleTable" :data="carList" highlight-current-row @current-change="handleCurrentChange"
+              style="width: 100%;overflow:auto;height: calc(100% - 32px);">
               <el-table-column property="number" label="编号">
               </el-table-column>
               <el-table-column property="carNumber" label="车牌号">
@@ -127,8 +122,8 @@
             </el-table>
             <div style="text-align: center">
               <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
-                :current-page="currentPage" :page-size="pageSize"
-                layout="total, sizes, prev, pager, next, jumper" :total="deptBudgetTotal">
+                :current-page="currentPage" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper"
+                :total="deptBudgetTotal">
               </el-pagination>
             </div>
             <!-- <div class="table-title">
@@ -187,10 +182,10 @@
       weighingList: { //深度监听,可监听到对象、数组的变化
         handler(val, oldVal) {
           if (val.tare) {
-            if(this.weighingList.buckleMiscellaneous){
-               this.weighingList.netWeight = this.weighingList.grossWeight - val.tare - this.weighingList.buckleMiscellaneous
-            }
-            else{
+            if (this.weighingList.buckleMiscellaneous) {
+              this.weighingList.netWeight = this.weighingList.grossWeight - val.tare - this.weighingList
+                .buckleMiscellaneous
+            } else {
               this.weighingList.netWeight = this.weighingList.grossWeight - val.tare
             }
           }
@@ -221,7 +216,7 @@
           grossWeight: 0,
           tare: 0,
           buckleMiscellaneous: 0,
-          netWeight:0
+          netWeight: 0
         },
         tpyeNo: 1,
         disabled: true,
@@ -238,7 +233,7 @@
         paramType: '1',
         warehouseName: '',
         result1: '00',
-        allowEdit:0,
+        allowEdit: 0,
       }
     },
     activated() {
@@ -342,8 +337,8 @@
             if (_list[i].paymentManagement.status != '待结算' || _list[i].paymentManagement
               .approveStatus) {
               continue
-            } 
-          } 
+            }
+          }
           if (_list[i].status == '已质检' || _list[i].status == '已称毛重') {
             this.mList.push(_list[i])
           }
@@ -446,7 +441,7 @@
       },
       async closePort() {
         console.log('closePort');
-        if(this.reader){
+        if (this.reader) {
           this.reader.cancel()
         }
       },
@@ -480,7 +475,8 @@
             // console.log("receData",receData);
             var flag = false;
             var flag1 = false;
-            if (this.warehouseName && (this.warehouseName == '山东诸城迈饶库'||this.warehouseName == '克东千红库'||this.warehouseName == '鲅鱼圈祥腾库'||this.warehouseName == '哈尔滨依兰库')) {
+            if (this.warehouseName && (this.warehouseName == '山东诸城迈饶库' || this.warehouseName == '克东千红库' || this
+                .warehouseName == '鲅鱼圈祥腾库' || this.warehouseName == '哈尔滨依兰库')) {
               for (var i = 0; i < value.length; i++) {
                 var tmp = String.fromCharCode(value[i])
                 if (tmp == '+') {
@@ -499,15 +495,14 @@
                   this.weighingList.tare = parseInt(result)
                 }
               }
-            }
-            else if (this.warehouseName && (this.warehouseName == '顺诚粮库'||this.warehouseName == '鲅鱼圈金信库')) {
+            } else if (this.warehouseName && (this.warehouseName == '顺诚粮库' || this.warehouseName == '鲅鱼圈金信库')) {
               for (var i = value.length - 1; i >= 0; i--) {
                 var tmp = String.fromCharCode(value[i])
                 console.log(tmp)
                 if (String.fromCharCode(value[0]) == '.') {
                   flag = true
                 }
-                if (flag && result.length < 9 && tmp != '='&& tmp != '.') {
+                if (flag && result.length < 9 && tmp != '=' && tmp != '.') {
                   result += tmp
                 }
               }
@@ -521,49 +516,48 @@
                   this.weighingList.tare = parseInt(result)
                 }
               }
-            }
-            else {
+            } else {
               // console.log(value)
-              for(var i=0;i<value.length;i++){
+              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)){
+
+                if ((value[0] != 49 && value[0] != 2)) {
+                  if ((value[value.length - 1] == 48 && value[value.length - 2] == 48)) {
                     flag1 = true
-                  }
-                  else{
+                  } else {
                     break
                   }
                 }
-                if (tmp == String.fromCharCode(32) ) {
+                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 (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 ){
+                  if ((value[value.length - 1] == 48 && value[value.length - 2] == 48)) {
+                    if (i == 0) {
                       this.result1 = tmp + '0'
                     }
                   }
                 }
               }
               if (this.tpyeNo != 2) {
-                console.log(parseInt(result)+''+parseInt(this.result1))
+                console.log(parseInt(result) + '' + parseInt(this.result1))
                 if (parseInt(result) || parseInt(result) == 0) {
-                  this.weighingList.grossWeight =  parseInt(result+this.result1)
+                  this.weighingList.grossWeight = parseInt(result + this.result1)
                 }
-                if (parseInt(result) == 0&&parseInt(this.result1) == 0) {
-                  this.weighingList.grossWeight =  0
+                if (parseInt(result) == 0 && parseInt(this.result1) == 0) {
+                  this.weighingList.grossWeight = 0
                 }
-               
+
               } else {
                 if (parseInt(result) || parseInt(result) == 0) {
-                  this.weighingList.tare =  parseInt(result+this.result1)
+                  this.weighingList.tare = parseInt(result + this.result1)
                 }
-                if (parseInt(result) == 0&&parseInt(this.result1) == 0) {
-                  this.weighingList.tare =  0
+                if (parseInt(result) == 0 && parseInt(this.result1) == 0) {
+                  this.weighingList.tare = 0
                 }
               }
             }
@@ -577,8 +571,8 @@
         }
       },
       cancel() {
-        
-        if(this.reader){
+
+        if (this.reader) {
           this.reader.cancel()
         }
         this.$router.push({
@@ -631,7 +625,7 @@
         // })
       },
       print() {
-        if(this.reader){
+        if (this.reader) {
           this.reader.cancel()
         }
         if (!this.weighingList.grossWeight) {
@@ -723,7 +717,7 @@
               //毛检保存前进行校验
               getamount({
                   compId: localStorage.getItem('ws-pf_compId'),
-                  customerNumberCard:this.weighingList.customerNumberCard,
+                  customerNumberCard: this.weighingList.customerNumberCard,
                   goodsName: this.weighingList.goodsName,
                 })
                 .toPromise()
@@ -761,7 +755,7 @@
                           grossWeight(this.weighingList)
                           .toPromise()
                           .then((response) => {
-                            if(this.reader){
+                            if (this.reader) {
                               this.reader.cancel()
                             }
                             this.$notify.success({
@@ -790,7 +784,7 @@
               tare(this.weighingList)
                 .toPromise()
                 .then((response) => {
-                  if(this.reader){
+                  if (this.reader) {
                     this.reader.cancel()
                   }
                   this.$notify.success({
@@ -837,7 +831,7 @@
   }
 
   .ws-info-table .el-form-item {
-    width: 50%;
+    width: 100%;
     border: none;
   }
 
@@ -885,9 +879,9 @@
 
     // background: #ffffff;
     width: 100%;
+    height: calc(100vh - 125px);
     border-radius: 4px;
     margin: 0 auto;
-    padding-top: 20px;
     display: flex;
 
     .left {
@@ -985,8 +979,9 @@
     font-size: 16px;
     // background: #f6f7fc;
   }
-  /deep/.el-table td{
-   background: #e7e8ef; 
+
+  /deep/.el-table td {
+    background: #e7e8ef;
   }
 
   /deep/.el-table--enable-row-transition .el-table__body td {
@@ -1042,4 +1037,27 @@
   .weight {
     font-size: 68px;
   }
+
+  .right-content {
+    display: flex;
+    height: 100%;
+
+    .left {
+      position: relative;
+
+      .but {
+        position: absolute;
+        left: 0;
+        right: 0;
+        bottom: 20px;
+        margin: auto;
+      }
+    }
+
+    .left,
+    .right {
+      width: 50%;
+      height: 100%;
+    }
+  }
 </style>