twt 2 年 前
コミット
96d8b869d3
共有2 個のファイルを変更した152 個の追加14 個の削除を含む
  1. 79 5
      src/page/carCk.vue
  2. 73 9
      src/page/index.vue

+ 79 - 5
src/page/carCk.vue

@@ -38,12 +38,28 @@
            </div>
          </div>
        </div>
-    
-    
+       <!-- 车辆配置 -->
+        <div class="mainLeft " v-for="(i,index) in pzList">
+         <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">
+           </div> -->
+         </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>
+         </div>
+       </div>
+
      </div>
     </div>
   </div>
- 
+
 </template>
 <script>
 import { fetchPost, fetchGet, fetchPut, fetchDelete, baseURL } from '@/utils/request'
@@ -65,6 +81,9 @@ export default {
        modelname:'',
        access_time:'',
        mtime:'',
+       pzList:[],
+       barnd:'',
+       description:'',
     }
   },
   watch: {
@@ -78,13 +97,62 @@ export default {
     brandCk(item){  //点击品牌
       this.brandName=item.brand;
       this.epc_id=item.epc_id;
+      this.pzList=[]
       this.getModel()
+    },
+    goNextX(item,time,index){  //点击车辆配置
+       console.log(time + '时间---index'+index)
+
+      if(item.next_restrain==1){
+        fetchGet('/advancedEpc/getRestrainPc', {
+          epc_id: this.epc_id,
+          token: item.token,
+          param: item.param,
+          access_time: time,
+         }).then(res => {
+           if(res.data.number==200||res.data.number==5212){
+               //this.modelList = res.data.result.list;
+               //this.mtime = res.data.result.access_time;
+               if(index + 2 > this.pzList.length){
+                 var obj={
+                   time:res.data.result.access_time,
+                   list:res.data.result.list
+                 }
+                 this.pzList.push(obj)
+               }else{
+                 var obj={
+                   time:res.data.result.access_time,
+                   list:res.data.result.list
+                 }
+                // this.pzList[index]=obj
+                 this.$set(this.pzList, index+1, obj)
+               }
+              console.log(this.pzList)
+           }else{
+             this.$message({
+                    message: res.data.message,
+                    type: 'warning'
+              });
+           }
+         }).catch(err => {})
+      }else{
+        var data={
+          time:time,
+          param:item.param,
+          token:item.token,
+          epc_id:this.epc_id,
+          brand_name:this.brandName,
+          description:this.modelname,
+        }
+        this.$emit('done',data)
+      }
+
+
     },
     goNext(item) {  //点击车型
     	this.token = item.token;
     	this.param = item.param;
-
-
+      this.pzList=[]
     	if (item.next_restrain == 1) {
     		this.modelname=item.model_name
     		this.getYueSuData(item)
@@ -103,6 +171,12 @@ export default {
           if(res.data.number==200||res.data.number==5212){
               //this.modelList = res.data.result.list;
               //this.mtime = res.data.result.access_time;
+              var obj={
+                time:res.data.result.access_time,
+                list:res.data.result.list
+              }
+              this.pzList.push(obj);
+              //console.log(this.pzList)
           }else{
             this.$message({
                    message: res.data.message,

+ 73 - 9
src/page/index.vue

@@ -11,7 +11,7 @@
            <!-- <img src="http://img.db.66km.cn/carbrandlogo/B - 比亚迪.png" alt="" class="barndLogo"> -->
             <div class="barndTxt">{{brand_name}}</div>
            </div>
-         <!--  <div class="topkk"  @click="ckBrand">选择品牌</div> --><!--  -->
+           <div class="topkk"  @click="ckBrand">选择品牌</div><!--  -->
            <div class="topkk" @click="oemClick">OEM查询</div>
        </div>
      </div>
@@ -243,7 +243,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"></carCk>
+     <carCk :show.sync="carCkShow" ref="childrencarCk" @done="carckhl"></carCk>
   </div>
 </template>
 
@@ -336,7 +336,7 @@ export default {
   },
   created() {
     this.keyup()
-   //this.ckBrand()
+  //this.ckBrand()
   },
   filters:{
     re(val){
@@ -353,8 +353,68 @@ export default {
   },
   methods:{
     ckBrand(){
-     // this.carCkShow=true;
-    //  this.$refs.childrencarCk.getBrands()
+      this.carCkShow=true;
+      this.firstShow=false;
+      this.$refs.childrencarCk.getBrands()
+    },
+    carckhl(data){
+      console.log(data)
+      this.carCkShow=false;
+      this.firstShow=true;
+      this.vin=[];
+      this.epc_id=data.epc_id
+      this.param=data.param;
+      this.token=data.token;
+      this.access_time=data.time;
+      this.brand_name=data.brand_name;
+      this.description=data.description;
+     // this.carConfigName=item.combine_cp;
+       this.getModelGroup()
+    },
+    getModelGroup() {
+
+    	fetchGet('advancedEpc/getModelGroupPc', {
+    		token: this.token,
+    		param: this.param,
+    		epc_id: this.epc_id,
+    		access_time: this.access_time
+    	}, 'GET').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.epc_id = res.data.result.epc_id;
+    			if(res.data.result.restrains.length>0){
+    			  this.restrains=res.data.result.restrains;
+    			  this.groupShow=false;
+    			  this.carConfig=true;
+    			  this.childrenShow=false;
+    			}else{
+    			  this.zzTime=res.data.result.access_time;
+    			  this.zlist=res.data.result.list;
+    			  this.zzName=this.zlist[0].caption;
+    			  this.param=this.zlist[0].param;
+    			  this.token=this.zlist[0].token;
+    			  this.navfName=res.data.result.caption;
+    			  this.groupShow=true;
+    			  this.carConfig=false;
+    			  this.childrenShow=false;
+    			  this.carConfigName=''
+    			  this.getSubgroupPc();
+    			  if(res.data.result.vehicle.description){
+    			    this.description=res.data.result.vehicle.description;
+    			    this.carInfoData=res.data.result.vehicle
+    			  }
+    			}
+
+    		} else {
+           this.$message({
+                  message: res.data.message,
+                  type: 'warning'
+            });
+
+    		}
+
+    	});
     },
     carConfigtck(){
       console.log(this.restrains)
@@ -379,7 +439,7 @@ export default {
       this.ckIndex1=-1;
       this.ckIndex2=-1;
       this.zzIndex=0;
-
+      this.epc_id=''
       this.description='';
     },
     seeBigImg(url){
@@ -454,6 +514,7 @@ export default {
        this.zzIndex=0;
        this.firstShow=true;
        this.description='';
+        this.epc_id=''
        console.log(this.vin.length)
        if(this.vin==''||this.vin.length!=17){
          this.$message({
@@ -513,7 +574,8 @@ export default {
         vin:this.vin,
         access_time:this.access_time,
         param:this.param,
-        token:this.token
+        token:this.token,
+
        }).then(res => {
          console.log(res.data.number);
          if(res.data.number==200||res.data.number==5212){
@@ -579,7 +641,8 @@ export default {
         vin:this.vin,
         access_time:this.zzTime,
         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){
@@ -802,7 +865,8 @@ export default {
         vin:this.vin,
         access_time:this.access_time,
         param:this.childrenparam,
-        token:this.childrentoken
+        token:this.childrentoken,
+         epc_id: this.epc_id,
        }).then(res => {
 
          if(res.data.number==200||res.data.number==5212){