浏览代码

修改默认值

mxx 3 年之前
父节点
当前提交
35bb874082
共有 1 个文件被更改,包括 22 次插入7 次删除
  1. 22 7
      src/views/houseSelfCollect/weightCheck.vue

+ 22 - 7
src/views/houseSelfCollect/weightCheck.vue

@@ -278,12 +278,15 @@
       makeData() {
         this.mList = [];
         this.pList = [];
+        let that = this
         console.log(this.common.commonWeighingList, "commonWeighingList")
         let _list = this.common.commonWeighingList
         for (let i = 0; i < _list.length; i++) {
           if (_list[i].status == '已质检' || _list[i].status == '已称毛重') {
             this.mList.push(_list[i])
-          } else if (_list[i].status == '已称皮重' || _list[i].status == '已称毛重') {
+          }
+          // if(_list[i].paymentManagement.status == '待结算'){}
+          if ((_list[i].status == '已称皮重' || _list[i].status == '已称毛重')) {
             this.pList.push(_list[i])
           }
         }
@@ -291,30 +294,42 @@
           this.index = 0
           this.carList = this.mList
           if (this.mList.length != 0) {
-            this.setCurrent(this.mList[0])
+      let _list = this.mList.filter(function(val){
+        console.log(that.$route.query.id)
+                if(val.id==that.$route.query.id){
+                  return val
+                }
+            })
+
+            this.setCurrent(_list[0])
 
             this.carWeightInfo = {
-              carNumber: this.mList[0].carNumber,
+              carNumber: _list[0].carNumber,
               type: this.information,
               weight: this.weighingList.grossWeight
             }
             this.deptBudgetTotal =  this.mList.length
           }
-          this.weighingList = this.mList[0]
+          this.weighingList = _list[0]
         } else {
           this.index = 1
           this.carList = this.pList
           if (this.pList.length != 0) {
-            this.setCurrent(this.pList[0])
+            let _item = this.pList.filter(function(val1){
+                if(val1.id==that.$route.query.id){
+                  return val1
+                }
+            })
+            this.setCurrent(_item[0])
 
             this.carWeightInfo = {
-              carNumber: this.pList[0].carNumber,
+              carNumber: _item[0].carNumber,
               type: this.information,
               weight: this.weighingList.tare
             }
              this.deptBudgetTotal =  this.pList.length
           }
-          this.weighingList = this.pList[0]
+          this.weighingList = _item[0]
         }
       },
       tabClick(val) {