|
@@ -0,0 +1,245 @@
|
|
|
+<template>
|
|
|
+ <div class="carCkbox">
|
|
|
+ <div class="brandsBox">
|
|
|
+ <div class="mainLeft" >
|
|
|
+ <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 in brandList" >
|
|
|
+ <div class="titleStr">{{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>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- 车型-->
|
|
|
+ <div class="mainLeft modelBox" >
|
|
|
+ <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,index) in modelList" ><!-- -->
|
|
|
+ <div class="fct_name">{{item.fct_name}}</div>
|
|
|
+ <div class="lineName" v-for="(v,i) in item.models" @click="goNext(v)" :class="{mainLeftLineActive:modelname==v.model_name}">{{v.model_name}}</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+import { fetchPost, fetchGet, fetchPut, fetchDelete, baseURL } from '@/utils/request'
|
|
|
+export default {
|
|
|
+
|
|
|
+ props: ['show', 'carInfoData'],
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ leftIndex:2,
|
|
|
+ brands:[],
|
|
|
+ childrenHeight:'',
|
|
|
+ brandList:'',
|
|
|
+ brandName:'',
|
|
|
+ childrenss:'',
|
|
|
+ epc_id:'',
|
|
|
+ modelList:'',
|
|
|
+ token:'',
|
|
|
+ param:'',
|
|
|
+ modelname:'',
|
|
|
+ access_time:'',
|
|
|
+ mtime:'',
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+
|
|
|
+
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ brandCk(item){ //点击品牌
|
|
|
+ this.brandName=item.brand;
|
|
|
+ this.epc_id=item.epc_id;
|
|
|
+ this.getModel()
|
|
|
+ },
|
|
|
+ goNext(item) { //点击车型
|
|
|
+ this.token = item.token;
|
|
|
+ this.param = item.param;
|
|
|
+
|
|
|
+
|
|
|
+ if (item.next_restrain == 1) {
|
|
|
+ this.modelname=item.model_name
|
|
|
+ this.getYueSuData(item)
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ this.gogroup(item);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getYueSuData(){
|
|
|
+ fetchGet('/advancedEpc/getRestrainPc', {
|
|
|
+ epc_id: this.epc_id,
|
|
|
+ token: this.token,
|
|
|
+ param: this.param,
|
|
|
+ access_time: this.mtime,
|
|
|
+ }).then(res => {
|
|
|
+ if(res.data.number==200||res.data.number==5212){
|
|
|
+ //this.modelList = res.data.result.list;
|
|
|
+ //this.mtime = res.data.result.access_time;
|
|
|
+ }else{
|
|
|
+ this.$message({
|
|
|
+ message: res.data.message,
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }).catch(err => {})
|
|
|
+ },
|
|
|
+ gogroup(){
|
|
|
+
|
|
|
+ },
|
|
|
+ getBrands(){ //品牌
|
|
|
+ fetchGet('/advancedEpc/getBrandsPc', {
|
|
|
+
|
|
|
+ }).then(res => {
|
|
|
+ var list = res.data.result.list;
|
|
|
+ var sectionTitle = [];
|
|
|
+ var brandList = [];
|
|
|
+ list.forEach(item => {
|
|
|
+ if (item) {
|
|
|
+ sectionTitle.push(item.first_letter);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ sectionTitle.sort();
|
|
|
+ sectionTitle = Array.from(new Set(sectionTitle))
|
|
|
+ sectionTitle.forEach(title => {
|
|
|
+ var arr = [];
|
|
|
+ list.forEach(item => {
|
|
|
+ if (item.first_letter == title) {
|
|
|
+ arr.push(item);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ var dic = {
|
|
|
+ titleStr: title,
|
|
|
+ list: arr
|
|
|
+ };
|
|
|
+ brandList.push(dic);
|
|
|
+ })
|
|
|
+
|
|
|
+ this.brandList = brandList;
|
|
|
+ console.log('list==', brandList);
|
|
|
+ }).catch(err => {})
|
|
|
+ },
|
|
|
+ getModel(){
|
|
|
+ fetchGet('/advancedEpc/getModelPc', {
|
|
|
+ epc_id: this.epc_id,
|
|
|
+ }).then(res => {
|
|
|
+ if(res.data.number==200||res.data.number==5212){
|
|
|
+ this.modelList = res.data.result.list;
|
|
|
+ this.mtime = res.data.result.access_time;
|
|
|
+ }else{
|
|
|
+ this.$message({
|
|
|
+ message: res.data.message,
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }).catch(err => {})
|
|
|
+ },
|
|
|
+ brandkeyup(){
|
|
|
+
|
|
|
+ },
|
|
|
+ close() {
|
|
|
+
|
|
|
+ this.$emit('update:show', false)
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+</script>
|
|
|
+<style >
|
|
|
+ .brandsBox{
|
|
|
+ display: flex;
|
|
|
+ }
|
|
|
+ .mainLeft{
|
|
|
+ width: 300px;
|
|
|
+ }
|
|
|
+ .mainLeft{
|
|
|
+ border-radius: 4px;
|
|
|
+ border: 1px solid #EEEEEE;
|
|
|
+ }
|
|
|
+.brandicon{
|
|
|
+ width: 30px;height: 30px;
|
|
|
+}
|
|
|
+.brandsLine{
|
|
|
+ display: flex;
|
|
|
+ line-height: 30px;
|
|
|
+
|
|
|
+ cursor: pointer;
|
|
|
+ padding:12px 0 0 12px;
|
|
|
+ border-bottom: 1px solid #EEEEEE;
|
|
|
+}
|
|
|
+.titleStr{
|
|
|
+ padding:12px 0;font-size: 16px;
|
|
|
+ padding-left: 12px;
|
|
|
+}
|
|
|
+.brandName{
|
|
|
+ padding-left: 10px;
|
|
|
+}
|
|
|
+ .mainLeftTop{
|
|
|
+ display: flex;
|
|
|
+ border-bottom: 1px solid #EEEEEE;
|
|
|
+ }
|
|
|
+ .mainLeftLineBox{
|
|
|
+ max-height: calc(100vh - 220px );
|
|
|
+ overflow: auto;
|
|
|
+ }
|
|
|
+ .mainLeftLine{
|
|
|
+ color: #333333; font-size: 14px;
|
|
|
+ }
|
|
|
+.childrensearchBox{
|
|
|
+ position: relative;
|
|
|
+ }
|
|
|
+ .childrensearchImg{
|
|
|
+ width: 16px;right: 10px;
|
|
|
+ height: 16px;
|
|
|
+ position: absolute;top: 16px;
|
|
|
+ }
|
|
|
+ .childrensearchInput{
|
|
|
+ width: 180px;
|
|
|
+ height: 34px;
|
|
|
+ background: #FFFFFF;
|
|
|
+ border-radius: 4px;
|
|
|
+ border: 1px solid #EEEEEE;
|
|
|
+ outline: none;
|
|
|
+ margin-top: 5px;
|
|
|
+ margin-left: 20px;
|
|
|
+ }
|
|
|
+ .lineName{
|
|
|
+ cursor: pointer;
|
|
|
+ padding:12px;
|
|
|
+ border-bottom: 1px solid #EEEEEE;
|
|
|
+ }
|
|
|
+ .fct_name{
|
|
|
+ background: #F7F9F8;
|
|
|
+ line-height: 30px;padding-left: 12px;
|
|
|
+ }
|
|
|
+ .mainLeftLineActive{
|
|
|
+ background: #FDF9E6;
|
|
|
+
|
|
|
+ }
|
|
|
+</style>
|