Commit 04b43c48 authored by agping's avatar agping

经纪人搜索二级联动

parent 472738ae
This diff is collapsed.
......@@ -12,11 +12,10 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'css!style/home.css', 'pagin
event: function () {
var _doc = $(document);
agent.getDistrict(function(){
_doc.on('input', '[name=district_id]', function(){
_doc.on('input', '#district_id', function(){
var _this = $(this);
var _id = _this.val();
var _objTemp = _this.parent().next().find('select');
_objTemp.html('');//先清空
_this.next().html('');//先清空
if(_id && _id != '0'){
agent.getDistrictStoreList(_id, function(_data){
// var _str = '';
......@@ -24,12 +23,12 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'css!style/home.css', 'pagin
$.each(_data, function(i,item) {
_str += '<option value="'+item.id+'">'+item.store_name+'</option>';
});
_objTemp.html(_str);
_this.next().html(_str);//先清空
});
}else{
};
});
})
});
$('#search').click(function (pageNo) {
agent.getList(1);
});
......@@ -245,6 +244,7 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'css!style/home.css', 'pagin
params.search = $("input[name='search']").val();
params.groupname = $("input[name='groupname']").val();
params.store_name = $("input[name='store_name']").val();
//后端加入两个字段搜索
$.ajax({
url: '/index/AgentList',
type: 'GET',
......@@ -298,7 +298,7 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'css!style/home.css', 'pagin
$.each(data.data, function(i,item) {
str += '<option value="'+item.id+'">'+item.district_name+'</option>';
});
$('[name=district_id]').append(str);
$('#district_id').append(str);
fn && fn();
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment