Browse Source

bug修改

twt 2 years ago
parent
commit
58efbe473d
4 changed files with 91 additions and 15 deletions
  1. 88 12
      src/page/carCk.vue
  2. 1 1
      src/page/carInfo.vue
  3. 1 1
      src/page/oem.vue
  4. 1 1
      src/page/part.vue

+ 88 - 12
src/page/carCk.vue

@@ -22,13 +22,13 @@
          </div>
        </div>
        <!-- 车型-->
-       <div class="mainLeft modelBox" >
+       <div class="mainLeft modelBox" v-if="cxShow">
          <div class="mainLeftTop">
            <div class="sx"></div>
            <div class="leftTitle">选择车型</div>
            <div class="childrensearchBox">
-             <input type="text" v-model="childrenss" class="childrensearchInput" placeholder="搜索"  @keyup.enter="brandkeyup">
-             <img src="../assets/icon_search@2x.png" alt="" class="childrensearchImg"  @click="brandkeyup">
+             <input type="text" v-model="cxss" class="childrensearchInput" placeholder="搜索"  @keyup.enter="brandkeyupcx">
+             <img src="../assets/icon_search@2x.png" alt="" class="childrensearchImg"  @click="brandkeyupcx">
            </div>
          </div>
          <div class="mainLeftLineBox">
@@ -50,8 +50,7 @@
          </div>
          <div class="mainLeftLineBox">
            <div class="mainLeftLine"   v-for="(item,index2) in i.list" ><!--  -->
-
-                <div class="lineName" @click="goNextX(item,i.time,index)" >{{item.combine_cp}}</div>
+                <div class="lineName" @click="goNextX(item,i.time,index)" :class="{mainLeftLineActive:combineCplist[index]==item.combine_cp}">{{item.combine_cp}}</div>
            </div>
          </div>
        </div>
@@ -72,10 +71,12 @@ export default {
        brands:[],
        childrenHeight:'',
        brandList:'',
+       ybrandList:'',
        brandName:'',
        childrenss:'',
        epc_id:'',
        modelList:'',
+       ymodelList:'',
        token:'',
        param:'',
        modelname:'',
@@ -84,6 +85,10 @@ export default {
        pzList:[],
        barnd:'',
        description:'',
+       cxss:'',
+       cxShow:false,
+       cxTime:'',
+       combineCplist:[],
     }
   },
   watch: {
@@ -97,12 +102,15 @@ export default {
     brandCk(item){  //点击品牌
       this.brandName=item.brand;
       this.epc_id=item.epc_id;
-      this.pzList=[]
+      this.pzList=[];
+      this.cxShow=true;
       this.getModel()
     },
     goNextX(item,time,index){  //点击车辆配置
        console.log(time + '时间---index'+index)
-
+       this.combineCplist[index]=item.combine_cp;
+       this.combineCplist=this.combineCplist.splice(0,index+1)
+       console.log( this.combineCplist)
       if(item.next_restrain==1){
         fetchGet('/advancedEpc/getRestrainPc', {
           epc_id: this.epc_id,
@@ -124,7 +132,7 @@ export default {
                    time:res.data.result.access_time,
                    list:res.data.result.list
                  }
-                // this.pzList[index]=obj
+                 this.pzList=this.pzList.splice(0,index+1)
                  this.$set(this.pzList, index+1, obj)
                }
               console.log(this.pzList)
@@ -185,10 +193,22 @@ export default {
           }
         }).catch(err => {})
     },
-    gogroup(){
-
+    gogroup(item){
+     var data={
+       time: this.mtime,
+       param:item.param,
+       token:item.token,
+       epc_id:this.epc_id,
+       brand_name:this.brandName,
+       description:this.modelname,
+     }
+     this.$emit('done',data)
     },
     getBrands(){ //品牌
+        this.cxShow=false;
+         this.pzList=[];
+         this.modelname='';
+         this.brandName='';
       fetchGet('/advancedEpc/getBrandsPc', {
 
        }).then(res => {
@@ -217,6 +237,7 @@ export default {
           })
 
           this.brandList = brandList;
+          this.ybrandList=brandList
           console.log('list==', brandList);
        }).catch(err => {})
     },
@@ -226,6 +247,7 @@ export default {
        }).then(res => {
          if(res.data.number==200||res.data.number==5212){
              this.modelList = res.data.result.list;
+             this.ymodelList=res.data.result.list;
              this.mtime = res.data.result.access_time;
          }else{
            this.$message({
@@ -236,7 +258,45 @@ export default {
        }).catch(err => {})
     },
     brandkeyup(){
+       console.log(this.childrenss)
+       var list=[];
+
+       this.ybrandList.forEach(item => {
+             var obj={
+               titleStr:item.titleStr,
+               list:[]
+             }
+             item.list.forEach(v=>{
+
+               if (v.brand.includes(this.childrenss)) {
+                    obj.list.push(v)
+               }
+
+             })
+             list.push(obj)
+        	})
+      console.log(list)
+       this.brandList=list
+    },
+    brandkeyupcx(){
+       var list=[];
+        this.ymodelList.forEach(item => {
+             var obj={
+               fct_name:item.fct_name,
+               models:[]
+             }
+             item.models.forEach(v=>{
+
+               if (v.model_name.includes(this.cxss)) {
+                    obj.models.push(v)
+               }
+
+             })
+             list.push(obj)
+        	})
 
+      console.log(list)
+       this.modelList=list
     },
      close() {
 
@@ -248,12 +308,28 @@ export default {
 
 }
 </script>
-<style >
+<style scoped>
   .brandsBox{
     display: flex;
+    overflow-x: auto;
+        flex-wrap: nowrap;
+  }
+  .sx{
+    width: 3px;
+    height: 12px;
+    background: #FF4F00;
+    margin-top: 18px;margin-left: 14px;
+  }
+  .leftTitle{
+    line-height: 48px;
+    font-weight: 500;
+    color: #333333;
+    font-size: 14px;
+    padding-left: 8px;
+    white-space:nowrap;
   }
   .mainLeft{
-    width: 300px;
+    width: 300px;    flex-shrink: 0;
   }
   .mainLeft{
     border-radius: 4px;

+ 1 - 1
src/page/carInfo.vue

@@ -53,7 +53,7 @@ export default {
 
 }
 </script>
-<style >
+<style scoped>
 .el-dialog__body{
    padding: 0 20px !important;
  }

+ 1 - 1
src/page/oem.vue

@@ -399,7 +399,7 @@ export default {
 
 }
 </script>
-<style >
+<style scoped>
   .oemTop{
     display: flex;
     width: 100%;

+ 1 - 1
src/page/part.vue

@@ -155,7 +155,7 @@ export default {
 
 }
 </script>
-<style >
+<style scoped>
 .el-dialog__body{
    padding: 0 20px !important;
  }