AngularJS中
ng-keyup
<div class="form-group" ng-if="vm.manLim">
<label>网点编码</label>
<input class="form-control" ng-model="vm.params.siteId" style="width:120px;"ng-keyup="vm.change(vm.params.siteId)">
</div>
<div class="form-group" ng-if="vm.manLim">
<label>网点名称</label>
<input type = "text" readonly="readonly" οnfοcus=this.blur() class="form-control" ng-model="vm.params.siteName" >
</div>
<div class="form-group" ng-if="vm.manLim">
<label>商家</label>
<select ng-model="vm.params.businessesId" class="form-control">
<option value="">-请选择-</option>
<option ng-repeat="x in vm.changes" value="{{x.id}}">{{x.businessesName}}</option>
</select>
</div>
//级联查
vm.change = function(siteId){
var promise2 = CustomerStockRookieService.getBusinessesses(siteId);
promise2.then(function(businesses) {
vm.changes = businesses;
if(businesses.length==0){
vm.params.siteName = "";
}else{
vm.params.siteName = businesses[0].siteName;
}
},function(){
vm.changes = "";
vm.params.siteName = "";
});
}