twt 2 年 前
コミット
9dbdaa855d
共有2 個のファイルを変更した148 個の追加31 個の削除を含む
  1. 3 2
      src/page/carCk.vue
  2. 145 29
      src/page/index.vue

+ 3 - 2
src/page/carCk.vue

@@ -13,7 +13,7 @@
          </div>
          <div class="mainLeftLineBox">
            <div class="mainLeftLine"   v-for="item in brandList" >
-             <div class="titleStr">{{item.titleStr}}</div>
+             <div class="titleStr" v-if="item.list.length>0">{{item.titleStr}}</div>
               <div class="brandsLine " v-for="(v,i) in item.list" @click="brandCk(v)" :class="{mainLeftLineActive:brandName==v.brand}">
                 <img :src="v.icon" alt="" class="brandicon">
                 <div class="brandName">{{v.brand}}</div>
@@ -104,7 +104,8 @@ export default {
       this.epc_id=item.epc_id;
       this.pzList=[];
       this.cxShow=true;
-      this.getModel()
+      this.getModel();
+      this.$emit('brandCk',this.brandName)
     },
     goNextX(item,time,index){  //点击车辆配置
 

+ 145 - 29
src/page/index.vue

@@ -26,7 +26,7 @@
        <span class="goback" @click="goback" v-if="!firstShow&&prevNextShow">返回</span>
      </div>
      <div class="main">
-       <div class="firstBox" v-if="firstShow">
+       <div class="firstBox" v-if="firstShow" ref="firstBox">
          <!-- 总组-->
          <div class="mainLeft" v-if="groupShow">
            <div class="mainLeftTop">
@@ -62,6 +62,17 @@
            </div>
 
          </div>
+         <!-- 动态 -->
+         <div class="mainLeft" v-for="(i,index) in pzList">
+           <div class="mainLeftTop">
+             <div class="sx"></div>
+             <div class="leftTitle">{{i.caption}}</div>
+           </div>
+           <div class="mainLeftLineBox">
+             <div class="mainLeftLine"
+              v-for="(item,index2) in i.list" @click="morez(item,index,i.time)" v-html="item.caption">{{item.caption}}</div>
+           </div>
+         </div>
          <!-- 车辆配置-->
          <div class="mainLeft" v-if="carConfig">
            <div class="mainLeftTop">
@@ -243,7 +254,7 @@
      <oem  ref="childoem" :show.sync="oemFlag" @done="getOemDetail" :param='param' :token='token' :vin='vin' :id.sync="epc_id"></oem>
      <part ref="childrenPart" :show.sync="partFlag" :epc_id='epc_id' :partnum="partnum" :threeData='threeData'></part>
      <carInfo  ref="childrencar" :show.sync="carFlag" :carInfoData="carInfoData"></carInfo>
-     <carCk :show.sync="carCkShow" ref="childrencarCk" @done="carckhl"></carCk>
+     <carCk :show.sync="carCkShow" ref="childrencarCk" @done="carckhl" @brandCk="brandCkFn"></carCk>
   </div>
 </template>
 
@@ -325,6 +336,8 @@ export default {
        viewerimg:'',
        viewerimgArr:[],
        prevNextShow:false,
+       pzList:[],
+       moreTime:'',
     }
   },
   computed:{
@@ -352,6 +365,9 @@ export default {
     }
   },
   methods:{
+    brandCkFn(e){
+      this.brand_name=e
+    },
     ckBrand(){
       this.carCkShow=true;
       this.firstShow=false;
@@ -361,7 +377,18 @@ export default {
       console.log(data)
       this.carCkShow=false;
       this.firstShow=true;
+      this.lastShow=false;
+      this.restrainShow1=false
+      this.restrainShow2=false
+      this.restrainShow3=false
+      this.childrenCk1=false;
+      this.childrenShow=false;
+      this.childrenShow2=false;
+      this.restrainShow4=false;
+      this.groupShow=false;
+      this.lastShow=false;
       this.vin=[];
+      this.pzList=[];
       this.epc_id=data.epc_id
       this.param=data.param;
       this.token=data.token;
@@ -726,7 +753,8 @@ export default {
         vin:this.vin,
         access_time:this.access_time,
         param:this.param,
-        token:this.token
+        token:this.token,
+         epc_id: this.epc_id,
        }).then(res => {
          console.log(res.data.number);
          if(res.data.number==200||res.data.number==5212){
@@ -757,7 +785,8 @@ export default {
         vin:this.vin,
         access_time:this.ckTimeOne,
         param:this.param,
-        token:this.token
+        token:this.token,
+         epc_id: this.epc_id,
        }).then(res => {
          console.log(res.data.number);
          if(res.data.number==200||res.data.number==5212){
@@ -784,18 +813,31 @@ export default {
         vin:this.vin,
         access_time:this.restrainTime,
         param:this.param,
-        token:this.token
+        token:this.token,
+         epc_id: this.epc_id,
        }).then(res => {
          console.log(res.data.number);
          if(res.data.number==200||res.data.number==5212){
                this.access_time=res.data.result.access_time;
                //this.childrenTime:'',
                console.log("约束3")
-               this.restrainShow3=true;
-               this.childrenList=res.data.result.list;
-               this.zkName3=res.data.result.caption;
-               //console.log(this.zkName1)
-               this.oldList=this.childrenList
+               if(res.data.result.list[0].next_restrain==1){
+                 var obj={
+                   time:res.data.result.access_time,
+                   list:res.data.result.list,
+                   caption:res.data.result.caption
+                 }
+                 this.pzList.push(obj);
+               }else{
+                 this.restrainShow3=true;
+                 this.childrenList=res.data.result.list;
+                 this.zkName3=res.data.result.caption;
+                 //console.log(this.zkName1)
+                 this.oldList=this.childrenList;
+               }
+
+
+
 
          }else{
            this.$message({
@@ -808,6 +850,80 @@ export default {
 
          })
     },
+    morez(item,index,time){
+      if(item.next_restrain==1){
+        fetchGet('/advancedEpc/getSubgroupPc', {
+          vin:this.vin,
+          access_time:time,
+          param:item.param,
+          token:item.token,
+          epc_id: this.epc_id,
+         }).then(res => {
+           console.log(res.data.number);
+           if(res.data.number==200||res.data.number==5212){
+                if(index + 2 > this.pzList.length){
+                  var obj={
+                    time:res.data.result.access_time,
+                    list:res.data.result.list,
+                     caption:res.data.result.caption
+                  }
+                  this.pzList.push(obj)
+                }else{
+                  var obj={
+                    time:res.data.result.access_time,
+                    list:res.data.result.list,
+                     caption:res.data.result.caption
+                  }
+                  this.pzList=this.pzList.splice(0,index+1)
+                  this.$set(this.pzList, index+1, obj)
+                }
+               setTimeout(() => {
+                 console.log(this.$refs.firstBox.scrollWidth)
+                  this.$refs.firstBox.scrollLeft = this.$refs.firstBox.scrollWidth
+               }, 500);
+           }else{
+             this.$message({
+                    message: res.data.message,
+                    type: 'warning'
+              });
+           }
+           }).catch(err => {
+
+
+           })
+      }else{
+        fetchGet('/advancedEpc/getSubgroupPc', {
+          vin:this.vin,
+          access_time:time,
+          param:item.param,
+          token:item.token,
+           epc_id: this.epc_id,
+         }).then(res => {
+           console.log(res.data.number);
+           if(res.data.number==200||res.data.number==5212){
+                 this.access_time=res.data.result.access_time;
+                   this.restrainShow3=true;
+                   this.childrenList=res.data.result.list;
+                   this.zkName3=res.data.result.caption;
+                   //console.log(this.zkName1)
+                   this.oldList=this.childrenList;
+                 setTimeout(() => {
+                   console.log(this.$refs.firstBox.scrollWidth)
+                    this.$refs.firstBox.scrollLeft = this.$refs.firstBox.scrollWidth
+                 }, 500);
+           }else{
+             this.$message({
+                    message: res.data.message,
+                    type: 'warning'
+              });
+           }
+           }).catch(err => {
+
+
+           })
+      }
+
+    },
     goback(){
       this.childrenShow=false;
       this.firstShow=true;
@@ -816,28 +932,25 @@ export default {
     childrenClick(item,index){
       //this.param=item.param;
      // this.token=item.token;
-      this.childrenIndex=index
-      this.childrenparam=item.param;
-      this.childrentoken=item.token;
-      this.lastName=item.caption;
-      this.getPartsPc();
-
-       this.firstShow=false;
-     //  this.groupShow=false;
-     //  this.carConfig=false;
-     //  this.restrainShow3=false;
-     //  this.restrainShow2=false;
-     //  this.restrainShow1=false;
-
-     //   this.restrainShow4=false;
-     //  this.lastShow=false;
-       setTimeout(() => {
-        this.childrenHeight = this.$refs.childrenMainLeft.offsetHeight // 高度
+     if(item.next_restrain!=1){
+       this.childrenIndex=index
+       this.childrenparam=item.param;
+       this.childrentoken=item.token;
+       this.lastName=item.caption;
+       this.getPartsPc();
+        this.firstShow=false;
+        setTimeout(() => {
+         this.childrenHeight = this.$refs.childrenMainLeft.offsetHeight // 高度
+
+        // console.log(this.childrenHeight)
+        }, 500)
+     }else{
+       this.moregroup(item,index)
+     }
 
-       // console.log(this.childrenHeight)
-       }, 500)
 
     },
+
     prev(){
         if(this.childrenIndex>0){
           this.childrenIndex--
@@ -980,6 +1093,9 @@ export default {
 <style scoped>
   .firstBox{
     display: flex;
+    overflow-x: auto;
+        flex-wrap: nowrap;
+        width: 100vw;
   }
  .vinsearch{
    width: 426px;