Sfoglia il codice sorgente

添加检斤新功能

mxx 3 anni fa
parent
commit
41ff4f8bf7

BIN
public/img/quesheng@2x.png


+ 3 - 1
src/common.js

@@ -1,6 +1,8 @@
 
    const houseName= [{ payname: "" },{ payname: "" },{ payname: "" },{ payname: "" }]
+   let commonWeighingList = []
 
 export default {
-    houseName
+    houseName,
+    commonWeighingList
 }

+ 1 - 0
src/main.js

@@ -21,6 +21,7 @@ import $ from 'jquery'
 // import Warehouse from './common.js'
 import Warehouse from './common.js'
 Vue.prototype.WAREHOUSE = Warehouse.houseName
+Vue.prototype.common = Warehouse
 // 初始化vue-amap
 AMap.initAMapApiLoader({
   // 高德key

+ 2 - 1
src/views/houseSelfCollect/weighingManagement.vue

@@ -286,8 +286,9 @@ export default {
             }else{
               response.records[i].allow = 1
             }  
-          }
+          }debugger
           this.weighingList = response.records
+          this.common.commonWeighingList  = response.records
           this.deptBudgetTotal = response.total
         })
         .catch((response) => {

+ 185 - 5
src/views/houseSelfCollect/weightCheck.vue

@@ -15,10 +15,36 @@
           />返回</el-button
         >
       </el-col>
-    </el-row>
+    </el-row> 
     <div class="substance">
+      
+    <div class="left">
+      <div class="top">
+        <div class="weight">{{carWeightInfo.weight}} <span>kg</span></div>
+        <div class="car-no">{{carWeightInfo.carNumber}}</div>
+         <div class="car-type">{{carWeightInfo.type}}</div>
+      </div>
+      <div class="bottom">
+        <div class="video1">
+        <img src="../../../public/img/quesheng@2x.png" alt=""  class="img1" v-if="!video1Src">
+          <div v-if="!video1Src">监控视频未连接</div>
+        <video v-if="video1Src" controls="controls" :src="video1Src" autoplay="autoplay" class="video-content" mediatype="video"></video>
+        </div>
+        <div class="vide2">
+           <img src="../../../public/img/quesheng@2x.png" alt="" class="img2"  v-if="!video2Src">
+           <div v-if="!video2Src">监控视频未连接</div>
+        <video src=""  v-if="video2Src" class="video-content"></video>
+        </div>
+      </div>
+    </div>
+    <div class="right">
       <ws-form>
-        <div style="width: 50%; margin: 0 auto">
+        <div style="margin: 0 auto">
+          
+        <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>
+        </div>
           <div class="title">基本信息</div>
           <ws-info-table>
             <ws-form-item label="编号" span="1" prop="number">
@@ -159,8 +185,29 @@
             >
           </div>
         </div>
+        <div class="bottom">
+          <el-table
+    ref="singleTable"
+    :data="carList"
+    highlight-current-row
+    @current-change="handleCurrentChange"
+    style="width: 100%">
+    </el-table-column>
+    <el-table-column
+      property="number"
+      label="编号"
+      >
+    </el-table-column>
+    <el-table-column
+      property="carNumber"
+      label="车牌号">
+    </el-table-column>
+  </el-table>
+        </div>
       </ws-form>
     </div>
+
+    </div>
     <el-dialog
       width="70%"
       class="table-content"
@@ -194,12 +241,24 @@ export default {
   },
   data() {
     return {
+      pList:[],
+      mList:[],
+      index:0,
+      video1Src:'https://www.w3school.com.cn/i/movie.ogg',
+      video2Src:'',
+      carList: [],
+      carWeightInfo:{
+      carNumber:'',
+      type:'',
+      weight:''
+      },
+      currentRow: null,
       inspect: {},
       types: 1,
       information: '',
       weighingList: {
-        grossWeight: '',
-        tare: '',
+        grossWeight: 0,
+        tare: 0,
         buckleMiscellaneous: 0,
       },
       tpyeNo: '',
@@ -224,6 +283,9 @@ export default {
     this.weighingList.id = this.$route.query.id
     this.relationId = this.$route.query.relationId
     this.warehouseId = this.$route.query.warehouseId
+    if(!this.$route.query.grossWeight){
+      this.$route.query.grossWeight = 0
+    }
     this.weighingList.grossWeight = this.$route.query.grossWeight
     this.purchasePriceList = this.$route.query.purchasePriceList
     console.log(this.purchasePriceList,"上限")
@@ -239,11 +301,89 @@ export default {
     } else if (this.tpyeNo == 2) {
       this.information = '皮重'
     }
+    
+    this.makeData();
   },
   deactivated(){
     // this.closePort()
+
   },
   methods: {
+    makeData(){
+      debugger
+      this.mList = [];
+      this.pList =[];
+    console.log(this.common.commonWeighingList,"commonWeighingList")
+    let _list = this.common.commonWeighingList
+    for(let i =0;i<_list.length;i++){
+      if(_list[i].status=='已质检'){
+          this.mList.push(_list[i])
+      }else if(_list[i].status=='已称皮重'||_list[i].status=='已称毛重'){
+          this.pList.push(_list[i])
+      }
+    }
+    if(this.information=="毛重"){
+      this.index=0
+    this.carList = this.mList
+    if(this.mList.length!=0){
+      this.setCurrent(this.mList[0])
+
+      this.carWeightInfo = {
+        carNumber:this.mList[0].carNumber,
+        type:this.information,
+        weight:this.weighingList.grossWeight
+      }
+    }
+      this.weighingList = this.mList[0]
+    }else{
+       this.index=1
+  this.carList = this.pList
+    if(this.pList.length!=0){
+      this.setCurrent(this.pList[0])
+
+      this.carWeightInfo = {
+        carNumber:this.pList[0].carNumber,
+        type:this.information,
+        weight:this.weighingList.tare
+      }
+    }
+       this.weighingList = this.pList[0]
+    }
+    },
+    tabClick(val){
+      this.index = val
+      if(val ==0){
+        this.carList = this.mList
+        this.information="毛重"
+         this.setCurrent(this.mList[0])
+         this.carWeightInfo = {
+        carNumber:this.mList[0].carNumber,
+        type:this.information,
+        weight:this.weighingList.grossWeight
+      }
+      }else{
+         this.carList = this.pList
+         this.information = "皮重";
+         this.setCurrent(this.pList[0])
+         this.carWeightInfo = {
+        carNumber:this.pList[0].carNumber,
+        type:this.information,
+        weight:this.weighingList.tare
+      }
+      }
+    },
+    setCurrent(row) {
+        this.$refs.singleTable.setCurrentRow(row);
+      },
+      handleCurrentChange(val) {debugger
+        this.currentRow = val;
+        this.carWeightInfo = {
+        carNumber:val.carNumber,
+        type:this.information,
+        weight:val.grossWeight
+      }
+      this.weighingList = val;
+      },
     async closePort(){
       console.log('closePort');
       this.reader.cancel()
@@ -560,11 +700,51 @@ export default {
 }
 
 .substance {
-  background: #ffffff;
+  .active{
+    background: #5878e8;
+    color: white;
+  }
+  // background: #ffffff;
   width: 100%;
   border-radius: 4px;
   margin: 0 auto;
   padding-top: 20px;
+  display: flex;
+  .left{
+    width: 30%;
+    padding: 20px;
+    .top{
+      background: black;
+      color: #147505;
+      font-size:32px;
+      text-align: right;
+      padding: 20px;
+    }
+    .bottom{
+      text-align: center;
+        .img1,.img2{
+          width: 200px;
+          padding: 20px;
+        }
+        .video-content{
+          width: 100%;
+        }
+    }
+  }
+  .right{
+    width: 60%;
+    padding:20px;
+    background: white;
+    margin-right: 20px;
+    .tab{
+      display: flex;
+      .tab-item{
+         padding: 5px 10px;
+         margin-right: 20px;
+         border-radius: 10px;
+      }
+    }
+  }
 }
 /deep/.el-table .el-table__header .cell,
 .el-table .el-table__body .cell {