diff --git a/admin/views/receiver/clues/lists.php b/admin/views/receiver/clues/lists.php index f2d712e2..054a5619 100644 --- a/admin/views/receiver/clues/lists.php +++ b/admin/views/receiver/clues/lists.php @@ -329,11 +329,22 @@ var that = this; if(nv == ''){ that.countyAry = []; - that.county_id = ''; + that.county_id = '0'; } else { $.get('common/area',{id:nv,key:'county',type:1},function(response){ if (response.code == 1) { that.countyAry = response.data; + if(that.county_id>0){ + var county_id = '0'; + for(var i in that.countyAry){ + var county = that.countyAry[i]; + if(county.id == that.county_id){ + county_id = county.id; + break; + } + } + that.county_id = county_id; + } } }); } @@ -345,7 +356,18 @@ that.cfroms = []; } else { $.get('/receiver/clues/get_cfroms',{'id':nv},function(result){ - that.cfroms2 = result.data.data + that.cfroms2 = result.data.data; + if(that.cfrom_id2>0){ + var cfrom_id2 = '0'; + for(var i in that.cfroms){ + var county = that.cfroms[i]; + if(county.id == that.cfrom_id2){ + cfrom_id2 = county.id; + break; + } + } + that.cfrom_id2 = cfrom_id2; + } }); } } diff --git a/admin/views/receiver/customer/lists.php b/admin/views/receiver/customer/lists.php index d54d0a9e..3744ad9b 100644 --- a/admin/views/receiver/customer/lists.php +++ b/admin/views/receiver/customer/lists.php @@ -224,18 +224,42 @@ watch: { 'params.city_id':function(nv, ov){ var that = this; - that.county_id = ''; if(nv == ''){ that.countyAry = []; + that.bizList = []; + that.params.county_id = ''; + that.params.biz_id = ''; } else { $.get('common/area',{id:nv,key:'county',type:1},function(response){ if (response.code == 1) { that.countyAry = response.data; + if(that.params.county_id>0){ + var county_id = ''; + for(var i in that.countyAry){ + var county = that.countyAry[i]; + if(county.id == that.params.county_id){ + county_id = county.id; + break; + } + } + that.params.county_id = county_id; + } } }); $.post('receiver/clues/get_adviser',{city_id:that.params.city_id,county_id:that.params.county_id},function(response){ if (response.code == 1) { that.bizList = response.data.bizList; + if(that.params.biz_id>0){ + var biz_id = ''; + for(var i in that.bizList){ + var biz = that.bizList[i]; + if(biz.id == that.params.biz_id){ + biz_id = biz.id; + break; + } + } + that.params.biz_id = biz_id; + } } }); } @@ -245,6 +269,17 @@ $.post('receiver/clues/get_adviser',{city_id:that.params.city_id,county_id:that.params.county_id},function(response){ if (response.code == 1) { that.bizList = response.data.bizList; + if(that.params.biz_id>0){ + var biz_id = ''; + for(var i in that.bizList){ + var biz = that.bizList[i]; + if(biz.id == that.params.biz_id){ + biz_id = biz.id; + break; + } + } + that.params.biz_id = biz_id; + } } }); },