liche update for admin finance get select car bug
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
</div>
|
||||
<div class="am-form-group am-para-inline w150">
|
||||
<select name="s_id" v-model="info.v_id">
|
||||
<option value="0">选择车型</option>
|
||||
<option :value="v.id" v-for="v in v_arr">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
@@ -126,8 +127,8 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
if(vm.info.v_id){
|
||||
$.get('auto/finance/get_cars',{brand_id:vm.info.brand_id,s_id:vm.info.s_id,v_id:vm.info.v_id},function(response){
|
||||
if(vm.info.v_id>0){
|
||||
$.get('auto/finance/get_cars',{brand_id:vm.info.brand_id,s_id:vm.info.s_id,v_id:vm.info.v_id,tp:1},function(response){
|
||||
if (response.code == 1) {
|
||||
vm.cars_arr = response.data.lists
|
||||
}
|
||||
@@ -158,12 +159,19 @@
|
||||
that.s_arr = [];
|
||||
that.v_arr = [];
|
||||
that.info.s_id = 0;
|
||||
that.info.car_id = 0;
|
||||
that.info.v_id = 0;
|
||||
} else {
|
||||
$.get('common/auto',{pid:that.info.brand_id,type:2,tp:1},function(response){
|
||||
if (response.code == 1) {
|
||||
that.s_arr = response.data
|
||||
that.s_arr = response.data;
|
||||
var s_id = 0;
|
||||
for(var i in that.s_arr){
|
||||
var v = that.s_arr[i];
|
||||
if(that.info.s_id == v.id){
|
||||
s_id = v.id;
|
||||
break;
|
||||
}
|
||||
}
|
||||
that.info.s_id = s_id;
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -173,12 +181,20 @@
|
||||
if(nv == 0){
|
||||
that.v_arr = [];
|
||||
that.cars_arr = [];
|
||||
that.info.car_id = 0;
|
||||
that.info.v_id = 0;
|
||||
} else {
|
||||
$.get('common/auto',{pid:that.info.s_id,type:3},function(response){
|
||||
$.get('common/auto',{pid:that.info.s_id,type:3,tp:1},function(response){
|
||||
if (response.code == 1) {
|
||||
that.v_arr = response.data;
|
||||
that.v_arr = response.data[3];
|
||||
var v_id = 0;
|
||||
for(var i in that.v_arr){
|
||||
var v = that.v_arr[i];
|
||||
if(that.info.v_id == v.id){
|
||||
v_id = v.id;
|
||||
break;
|
||||
}
|
||||
}
|
||||
that.info.v_id = v_id;
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -191,7 +207,16 @@
|
||||
} else {
|
||||
$.get('auto/finance/get_cars',{brand_id:that.info.brand_id,s_id:that.info.s_id,v_id:that.info.v_id},function(response){
|
||||
if (response.code == 1) {
|
||||
that.cars_arr = response.data.lists
|
||||
that.cars_arr = response.data.lists;
|
||||
var car_id = 0;
|
||||
for(var i in that.cars_arr){
|
||||
var v = that.cars_arr[i];
|
||||
if(that.info.car_id == v.id){
|
||||
car_id = v.id;
|
||||
break;
|
||||
}
|
||||
}
|
||||
that.info.car_id = car_id;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user