Commit 8e04c67a authored by xishifeng's avatar xishifeng Committed by hujun

优化所属部门所属门店

parent 1497e201
...@@ -96,8 +96,16 @@ ...@@ -96,8 +96,16 @@
<input type="text" class="form-control btn6" name="password" id="password" value="44444" placeholder="填写密码"> <input type="text" class="form-control btn6" name="password" id="password" value="44444" placeholder="填写密码">
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">绑定门店ID:</label> <label class="col-sm-3 control-label">所属部门:</label>
<input type="number" class="form-control btn6" name="store_id" value="" placeholder="填写门店ID"> <select name="district_id" class="form-control btn6">
<option value="">选择所属部门</option>
</select>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">所属门店:</label>
<select name="store_id" class="form-control btn6">
</select>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">性别:</label> <label class="col-sm-3 control-label">性别:</label>
......
...@@ -156,7 +156,7 @@ ...@@ -156,7 +156,7 @@
<input class="form-control btn2 margin-top-ld" data-rule-phoneus="false" data-rule-required="false" name="phone" placeholder="客户姓名或手机号" type="text" value=""> <input class="form-control btn2 margin-top-ld" data-rule-phoneus="false" data-rule-required="false" name="phone" placeholder="客户姓名或手机号" type="text" value="">
<input class="form-control btn2 margin-top-ld input" data-rule-phoneus="false" data-rule-required="false" name="invite_phone" placeholder="邀请人(C端用户)手机号" type="text" value=""> <input class="form-control btn2 margin-top-ld input" data-rule-phoneus="false" data-rule-required="false" name="invite_phone" placeholder="邀请人(C端用户)手机号" type="text" value="">
<input class="form-control btn2 margin-top-ld input" data-rule-phoneus="false" data-rule-required="false" name="invite_agent_phone" placeholder="邀请人(经纪人)手机号" type="text" value="">
<!--业态选择--> <!--业态选择-->
<select class="form-control btn2 margin-top-ld" name="industry_type"> <select class="form-control btn2 margin-top-ld" name="industry_type">
...@@ -199,30 +199,39 @@ ...@@ -199,30 +199,39 @@
<option value="2"></option> <option value="2"></option>
<option value="1"></option> <option value="1"></option>
</select> </select>
<select class="form-control btn2 margin-top-ld input" name="" id="district_id" placeholder="" title=" <select class="form-control btn2 margin-top-ld" name="public_status">
<option value="2">客户状态</option>
<option value="0">求租</option>
<option value="1">已租</option>
<option value="-1">无效</option>
</select>
<select class="form-control btn2 margin-top-ld input" name="" id="district_id" title="
客方所属部门、客方所属门店 与邀请人所属部门、邀请人所属门店 不作为并列筛选项"> 客方所属部门、客方所属门店 与邀请人所属部门、邀请人所属门店 不作为并列筛选项">
<option value="">客方所属部门</option>
</select> </select>
<select class="form-control btn2 margin-top-ld input" name="" id="guest_stores" title="
客方所属部门、客方所属门店 与邀请人所属部门、邀请人所属门店 不作为并列筛选项" value="">
<input class="form-control btn2 margin-top-ld input" data-rule-phoneus="false" data-rule-required="false" id="guest_stores" placeholder="客方所属门店" type="text" value="" title=" </select>
客方所属部门、客方所属门店 与邀请人所属部门、邀请人所属门店 不作为并列筛选项">
<!--邀请人--> <!--邀请人-->
<select class="form-control btn2 margin-top-ld input" name="" id="district_id2" placeholder="" title=" <select class="form-control btn2 margin-top-ld input" name="" id="district_id2" title="
客方所属部门、客方所属门店 与邀请人所属部门、邀请人所属门店 不作为并列筛选项"> 客方所属部门、客方所属门店 与邀请人所属部门、邀请人所属门店 不作为并列筛选项">
<option value="">邀请人所属部门</option>
</select> </select>
<input class="form-control btn2 margin-top-ld input" data-rule-phoneus="false" data-rule-required="false" id="guest_stores2" placeholder="邀请人所属门店" type="text" value="" title=" <select class="form-control btn2 margin-top-ld input" name="" id="guest_stores2" title="
客方所属部门、客方所属门店 与邀请人所属部门、邀请人所属门店 不作为并列筛选项"> 客方所属部门、客方所属门店 与邀请人所属部门、邀请人所属门店 不作为并列筛选项">
</select>
<input class="form-control btn2 margin-top-ld input" data-rule-phoneus="false" data-rule-required="false" name="invite_agent_phone" placeholder="邀请人(经纪人)手机号" type="text" value="">
<!--<div class="clear"></div>--> <!--<div class="clear"></div>-->
<!--<span class='left bottom'>(注:客方所属部门,客方所属门店与邀请人所属部门,邀请人所属门店不作为并列筛选项)</span>--> <!--<span class='left bottom'>(注:客方所属部门,客方所属门店与邀请人所属部门,邀请人所属门店不作为并列筛选项)</span>-->
<select class="form-control btn2 margin-top-ld" name="public_status">
<option value="2">客户状态</option>
<option value="0">求租</option>
<option value="1">已租</option>
<option value="-1">无效</option>
</select>
<div class="clear"></div> <div class="clear"></div>
......
...@@ -194,8 +194,7 @@ ...@@ -194,8 +194,7 @@
<select name="qx-store" class="form-control btn2" id="qx-store"> <select name="qx-store" class="form-control btn2" id="qx-store">
<option value="" selected="selected">选择部门</option> <option value="" selected="selected">选择部门</option>
</select> </select>
<select name="mend_name" class="form-control btn2" id="mend_name"></select>
<input class="form-control btn2" data-rule-phoneus="false" data-rule-required="false" id="mend_name" placeholder="门店名称" type="text" value="">
<input class="form-control btn2" data-rule-phoneus="false" data-rule-required="false" id="name" placeholder="店长姓名" type="text" value=""> <input class="form-control btn2" data-rule-phoneus="false" data-rule-required="false" id="name" placeholder="店长姓名" type="text" value="">
<input class="form-control btn2" data-rule-phoneus="false" data-rule-required="false" id="phone" placeholder="店长手机号" type="text" value=""> <input class="form-control btn2" data-rule-phoneus="false" data-rule-required="false" id="phone" placeholder="店长手机号" type="text" value="">
<span class="btn btn-default btn3" id="search">搜索</span> <span class="btn btn-default btn3" id="search">搜索</span>
......
...@@ -10,7 +10,25 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'css!style/home.css', 'pagin ...@@ -10,7 +10,25 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'css!style/home.css', 'pagin
agent.event(); agent.event();
}, },
event: function () { event: function () {
var _doc = $(document);
agent.getDistrict(function(){
_doc.on('input', '[name=district_id]', function(){
var _this = $(this);
var _id = _this.val();
var _objTemp = _this.parent().next().find('select');
_objTemp.html('');//先清空
if(_id && _id != '0'){
agent.getDistrictStoreList(_id, function(_data){
var _str = '';
$.each(_data, function(i,item) {
_str += '<option value="'+item.id+'">'+item.store_name+'</option>';
});
_objTemp.html(_str);
});
}else{
};
});
})
$('#search').click(function (pageNo) { $('#search').click(function (pageNo) {
agent.getList(1); agent.getList(1);
}); });
...@@ -23,6 +41,7 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'css!style/home.css', 'pagin ...@@ -23,6 +41,7 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'css!style/home.css', 'pagin
$("#title").html("新增经纪人"); $("#title").html("新增经纪人");
$("#password").parent().addClass('hide'); //新增不显示密码 $("#password").parent().addClass('hide'); //新增不显示密码
$(".form-horizontal")[0].reset(); //重置表单 $(".form-horizontal")[0].reset(); //重置表单
agent.emptyInput();//清空表单
}); });
$(document).delegate(".edit", "click", function () {//点击编辑 $(document).delegate(".edit", "click", function () {//点击编辑
...@@ -31,6 +50,7 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'css!style/home.css', 'pagin ...@@ -31,6 +50,7 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'css!style/home.css', 'pagin
agent.agent_id = $(this).attr("data-id"); agent.agent_id = $(this).attr("data-id");
$("#password").parent().removeClass('hide'); //编辑显示密码 $("#password").parent().removeClass('hide'); //编辑显示密码
$("#password").attr('type','text'); $("#password").attr('type','text');
agent.emptyInput();//清空表单
agent.Edit(); agent.Edit();
}); });
...@@ -112,23 +132,35 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'css!style/home.css', 'pagin ...@@ -112,23 +132,35 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'css!style/home.css', 'pagin
success: function (data) { success: function (data) {
if (data.code == 200) { if (data.code == 200) {
$("input[name = id]").val(data.data.id); if(data.data){
$("input[name = phone]").val(data.data.phone); $("input[name = id]").val(data.data.id);
$("input[name = name]").val(data.data.name); $("input[name = phone]").val(data.data.phone);
$("input[name = store_id]").val(data.data.store_id); $("input[name = name]").val(data.data.name);
$("#admin_off").val(data.data.admin_off); $("[name = district_id]").val(data.data.district_id);
$("#remarks").val(data.data.remarks); if(data.data.district_id){
$("#password").val(data.data.password); agent.getDistrictStoreList(data.data.district_id, function(_data){
$("input[name='password']").attr('form-group'); var _str = '';
// store.getDistrict(data.data.district_name); $.each(_data, function(i,item) {
_str += '<option value="'+item.id+'">'+item.store_name+'</option>';
});
$("[name = store_id]").html(_str).val(data.data.store_id);
});
}else{
}
$("#remarks").val(data.data.remarks);
$("#password").val(data.data.password);
$("input[name='password']").attr('form-group');
if (data.data.sex == '0') {
$("#sex0").attr('checked', true);
} else if (data.data.sex == '1') {
$("#sex1").attr('checked', true);
} else {
$("#sex2").attr('checked', true);
}
}
if (data.data.sex == '0') {
$("#sex0").attr('checked', true);
} else if (data.data.sex == '1') {
$("#sex1").attr('checked', true);
} else {
$("#sex2").attr('checked', true);
}
} else { } else {
alert('获取经纪人数据失败'); alert('获取经纪人数据失败');
} }
...@@ -142,7 +174,8 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'css!style/home.css', 'pagin ...@@ -142,7 +174,8 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'css!style/home.css', 'pagin
params.id = agent.agent_id; params.id = agent.agent_id;
params.name = $("input[name = name]").val(); params.name = $("input[name = name]").val();
params.password = $("#password").val(); params.password = $("#password").val();
params.store_id = $("input[name = store_id]").val(); params.district_id = $("[name = district_id]").val();
params.store_id = $("[name = store_id]").val();
params.phone = $("input[name = phone]").val(); params.phone = $("input[name = phone]").val();
params.admin_off = $("#admin_off").val(); params.admin_off = $("#admin_off").val();
params.sex = $("input[name =sex]:checked").val(); params.sex = $("input[name =sex]:checked").val();
...@@ -155,9 +188,16 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'css!style/home.css', 'pagin ...@@ -155,9 +188,16 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'css!style/home.css', 'pagin
alert('手机号必填!'); alert('手机号必填!');
return false; return false;
} }
if (params.district_id == '') {
alert('所属部门必填');
$("#modal-edit").show();
return false;
}
if (params.store_id == '') { if (params.store_id == '') {
alert('绑定门店ID必填'); alert('所属门店必填');
$("#modal-edit").show(); $("#modal-edit").show();
return false; return false;
} }
...@@ -184,6 +224,17 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'css!style/home.css', 'pagin ...@@ -184,6 +224,17 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'css!style/home.css', 'pagin
}); });
}, },
emptyInput: function(){
console.count('emptyInput');
$("input[name = name]").val('');
$("input[name = phone]").val('');
$("#password").val('');
$("[name = district_id]").val('');
$("[name = store_id]").html('');
$("input[name =sex]").val('0');
$("#admin_off").val('0');
$("#remarks").val('');
},
getList: function (pageNo) { getList: function (pageNo) {
agent.pageNo = pageNo; agent.pageNo = pageNo;
var params = {}; var params = {};
...@@ -229,6 +280,42 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'css!style/home.css', 'pagin ...@@ -229,6 +280,42 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'css!style/home.css', 'pagin
} }
}); });
},
getDistrict : function (fn) {
$.ajax ({
url: '/index/getDistrict',
type: 'GET',
async: true,
data: {"pageSize":1000},
dataType: 'json',
success: function (data) {
if (data.code == 200 && data.data != null) {
var str = '';
$.each(data.data, function(i,item) {
str += '<option value="'+item.id+'">'+item.district_name+'</option>';
});
$('[name=district_id]').append(str);
fn && fn();
}
}
});
},
getDistrictStoreList: function(id, fn){
$.ajax ({
url: '/index/getDistrictStoreList',
type: 'GET',
async: true,
data: {
'id':id,
"pageSize":1000
},
dataType: 'json',
success: function (data) {
if (data.code == 200 && data.data != null) {
fn && fn(data.data);
}
}
});
} }
}; };
return agent; return agent;
......
...@@ -21,10 +21,10 @@ define(['doT', 'text!temp/store_template_tpl.html', 'css!style/home.css', 'ckfin ...@@ -21,10 +21,10 @@ define(['doT', 'text!temp/store_template_tpl.html', 'css!style/home.css', 'ckfin
$("body").append(template); $("body").append(template);
store.getList(); store.getList();
store.event(); store.event();
store.getRegionsDisc();
store.getDistrict();
}, },
event: function() { event: function() {
var _doc = $(document);
$("#search").click(function() { $("#search").click(function() {
store.getList(1); store.getList(1);
}); });
...@@ -32,6 +32,26 @@ define(['doT', 'text!temp/store_template_tpl.html', 'css!style/home.css', 'ckfin ...@@ -32,6 +32,26 @@ define(['doT', 'text!temp/store_template_tpl.html', 'css!style/home.css', 'ckfin
$("#reset").click(function() { //重置 $("#reset").click(function() { //重置
document.getElementById("form_search").reset(); document.getElementById("form_search").reset();
}); });
store.getDistrict({
'type': 1
}, function(){
_doc.on('input', '#qx-store', function(){
var _this = $(this);
var _id = _this.val();
_this.next().html('');//先清空
if(_id && _id != '0'){
store.getDistrictStoreList(_id, function(_data){
var _str = '';
$.each(_data, function(i,item) {
_str += '<option value="'+item.store_name+'">'+item.store_name+'</option>';
});
_this.next().html(_str);
});
}else{
};
});
});
$(document).delegate(".del_modal", "click", function() { $(document).delegate(".del_modal", "click", function() {
store.id = $(this).attr("data-id"); store.id = $(this).attr("data-id");
...@@ -67,7 +87,6 @@ define(['doT', 'text!temp/store_template_tpl.html', 'css!style/home.css', 'ckfin ...@@ -67,7 +87,6 @@ define(['doT', 'text!temp/store_template_tpl.html', 'css!style/home.css', 'ckfin
$ (document).delegate (".add", "click", function () {//list2消失 $ (document).delegate (".add", "click", function () {//list2消失
document.getElementById('form_id').reset(); document.getElementById('form_id').reset();
store.getDistrict();
}); });
/************************************************百度地址定位相关*************************************************************/ /************************************************百度地址定位相关*************************************************************/
...@@ -185,29 +204,6 @@ define(['doT', 'text!temp/store_template_tpl.html', 'css!style/home.css', 'ckfin ...@@ -185,29 +204,6 @@ define(['doT', 'text!temp/store_template_tpl.html', 'css!style/home.css', 'ckfin
/************************************************百度地址定位相关****结束*************************************************************/ /************************************************百度地址定位相关****结束*************************************************************/
}, },
getRegionsDisc: function(name) {
var params = {};
params.parent_code = 310100;
$.ajax({
url: '/index/regions',
type: 'GET',
async: true,
data: params,
dataType: 'json',
success: function(data) {
if(data.code == 200) {
var _html = '';
$.each(data.data, function(i, n) {
_html += '<option value="' + n.fullName + '">' + n.fullName + '</option>';
});
$("#area").append(_html);
} else {
alert('请求省市区错误');
}
}
});
},
Edit:function(){//获取编辑的数据 Edit:function(){//获取编辑的数据
$.ajax({ $.ajax({
'type': 'GET', 'type': 'GET',
...@@ -229,7 +225,10 @@ define(['doT', 'text!temp/store_template_tpl.html', 'css!style/home.css', 'ckfin ...@@ -229,7 +225,10 @@ define(['doT', 'text!temp/store_template_tpl.html', 'css!style/home.css', 'ckfin
$("#latitude").val(data.data.latitude)//经纬度 $("#latitude").val(data.data.latitude)//经纬度
store.agents_id=data.data.agents_id;//经纪人id store.agents_id=data.data.agents_id;//经纪人id
store.district_id=data.data.district_id;//部门id store.district_id=data.data.district_id;//部门id
store.getDistrict(data.data.district_name); store.getDistrict({
'type': 2,
'name': data.data.district_name
});
} }
else { else {
alert('获取失败!'); alert('获取失败!');
...@@ -350,7 +349,7 @@ define(['doT', 'text!temp/store_template_tpl.html', 'css!style/home.css', 'ckfin ...@@ -350,7 +349,7 @@ define(['doT', 'text!temp/store_template_tpl.html', 'css!style/home.css', 'ckfin
} }
}); });
}, },
getDistrict: function(name) { getDistrict: function(obj, fn) {
$.ajax({ $.ajax({
url: '/index/getDistrictListByName', url: '/index/getDistrictListByName',
type: 'GET', type: 'GET',
...@@ -359,24 +358,42 @@ define(['doT', 'text!temp/store_template_tpl.html', 'css!style/home.css', 'ckfin ...@@ -359,24 +358,42 @@ define(['doT', 'text!temp/store_template_tpl.html', 'css!style/home.css', 'ckfin
dataType: 'json', dataType: 'json',
success: function(data) { success: function(data) {
if(data.code == 200) { if(data.code == 200) {
var _html = ' <option value="" selected="selected">请选择</option>'; var _html = '';
$.each(data.data, function(i, n) { $.each(data.data, function(i, n) {
if (n.district_name == name && (typeof name != undefined)) { if (obj.type == '2' && n.district_name == obj.name) {
_html += '<option selected="selected" value="' + n.id + '">' + n.district_name + '</option>'; _html += '<option selected="selected" value="' + n.id + '">' + n.district_name + '</option>';
} else { } else {
_html += '<option value="' + n.id + '">' + n.district_name + '</option>'; _html += '<option value="' + n.id + '">' + n.district_name + '</option>';
} }
}); });
$("#ss-store").html(_html); if(obj.type == '2'){
$("#qx-store").append(_html); $("#ss-store").html(_html);
}else if(obj.type == '1'){
// $("#qx-store").html(_html); $("#qx-store").append(_html);
}else{}
fn && fn();
} else { } else {
alert('获取部门信息失败'); alert('获取部门信息失败');
} }
} }
}); });
},
getDistrictStoreList: function(id, fn){
$.ajax ({
url: '/index/getDistrictStoreList',
type: 'GET',
async: true,
data: {
'id':id,
"pageSize":1000
},
dataType: 'json',
success: function (data) {
if (data.code == 200 && data.data != null) {
fn && fn(data.data);
}
}
});
} }
}; };
return store; return store;
......
...@@ -11,8 +11,6 @@ define (['doT', 'text!temp/user_template_tpl.html','ckfinder','ckfinderStart', ' ...@@ -11,8 +11,6 @@ define (['doT', 'text!temp/user_template_tpl.html','ckfinder','ckfinderStart', '
$ ("body").append (template); $ ("body").append (template);
user.getList (); user.getList ();
user.event (); user.event ();
user.getDistrict();
user.getDistricttwo();
//时间控件初始化 //时间控件初始化
/* $('#datetimepicker').datetimepicker({ /* $('#datetimepicker').datetimepicker({
format: 'yyyy-MM-dd', format: 'yyyy-MM-dd',
...@@ -24,6 +22,23 @@ define (['doT', 'text!temp/user_template_tpl.html','ckfinder','ckfinderStart', ' ...@@ -24,6 +22,23 @@ define (['doT', 'text!temp/user_template_tpl.html','ckfinder','ckfinderStart', '
}, },
event: function () { event: function () {
var _doc = $(document); var _doc = $(document);
user.getDistrict(function(){
_doc.on('input', '#district_id, #district_id2', function(){
var _this = $(this);
var _id = _this.val();
_this.next().html('');//先清空
if(_id && _id != '0'){
user.getDistrictStoreList(_id, function(_data){
var _str = '';
$.each(_data, function(i,item) {
_str += '<option value="'+item.store_name+'">'+item.store_name+'</option>';
});
_this.next().html(_str);
});
}else{
};
});
});
$ (".Bannertu").click (function () { $ (".Bannertu").click (function () {
BrowseServer ('cover_image'); BrowseServer ('cover_image');
}); });
...@@ -174,6 +189,7 @@ define (['doT', 'text!temp/user_template_tpl.html','ckfinder','ckfinderStart', ' ...@@ -174,6 +189,7 @@ define (['doT', 'text!temp/user_template_tpl.html','ckfinder','ckfinderStart', '
}); });
// =================== // ===================
}, },
addphone:function(obj){ addphone:function(obj){
var user_ht=$(obj).html(); var user_ht=$(obj).html();
...@@ -377,15 +393,14 @@ define (['doT', 'text!temp/user_template_tpl.html','ckfinder','ckfinderStart', ' ...@@ -377,15 +393,14 @@ define (['doT', 'text!temp/user_template_tpl.html','ckfinder','ckfinderStart', '
getList: function (pageNo) { getList: function (pageNo) {
user.pageNo = pageNo; user.pageNo = pageNo;
var params = {}; var params = {};
console.log($("#start_date").val()); // if($("#district_id").val()!=0||$("#guest_stores").val()!=''){
if($("#district_id").val()!=0||$("#guest_stores").val()!=''){ // $("#district_id2").val('0');
$("#district_id2").val('0'); // $("#guest_stores2").val('');
$("#guest_stores2").val(''); // };
}; // if($("#district_id2").val()!=0||$("#guest_stores2").val()!=''){
if($("#district_id2").val()!=0||$("#guest_stores2").val()!=''){ // $("#district_id1").val('0');
$("#district_id1").val('0'); // $("#guest_stores1").val('');
$("#guest_stores1").val(''); // };
};
// 输入 name // 输入 name
// params.name = $("input[name='user']").val(); // params.name = $("input[name='user']").val();
params.phone = $("input[name='phone']").val(); params.phone = $("input[name='phone']").val();
...@@ -430,11 +445,6 @@ define (['doT', 'text!temp/user_template_tpl.html','ckfinder','ckfinderStart', ' ...@@ -430,11 +445,6 @@ define (['doT', 'text!temp/user_template_tpl.html','ckfinder','ckfinderStart', '
/*分页代码*/ /*分页代码*/
add_page(data.data.total,pageNo,user.pageSize,user.getList); add_page(data.data.total,pageNo,user.pageSize,user.getList);
$("#total_page").html(data.data.total); $("#total_page").html(data.data.total);
console.log(data.data.total);
console.log(user.pageSize);
console.log(pageNo);
} }
}); });
}, },
...@@ -520,40 +530,39 @@ define (['doT', 'text!temp/user_template_tpl.html','ckfinder','ckfinderStart', ' ...@@ -520,40 +530,39 @@ define (['doT', 'text!temp/user_template_tpl.html','ckfinder','ckfinderStart', '
} }
}); });
}, },
getDistrict : function () { getDistrict : function (fn) {
$.ajax ({ $.ajax ({
url: '/index/getDistrict', url: '/index/getDistrict',
type: 'GET', type: 'GET',
async: true, async: true,
data: {"pageSize":50}, data: {"pageSize":1000},
dataType: 'json', dataType: 'json',
success: function (data) { success: function (data) {
if (data.code == 200 && data.data != null) { if (data.code == 200 && data.data != null) {
var str = '<option value="0">客方所属部门</option>'; var str = '';
$.each(data.data, function(i,item) { $.each(data.data, function(i,item) {
str += '<option value="'+item.id+'">'+item.district_name+'</option>'; str += '<option value="'+item.id+'">'+item.district_name+'</option>';
}); });
$("#district_id").html(str); $("#district_id").append(str);
$("#district_id2").append(str);
fn && fn();
} }
} }
}); });
}, },
getDistricttwo : function () { getDistrictStoreList: function(id, fn){
$.ajax ({ $.ajax ({
url: '/index/getDistrict', url: '/index/getDistrictStoreList',
type: 'GET', type: 'GET',
async: true, async: true,
data: {"pageSize":50}, data: {
'id':id,
"pageSize":1000
},
dataType: 'json', dataType: 'json',
success: function (data) { success: function (data) {
if (data.code == 200 && data.data != null) { if (data.code == 200 && data.data != null) {
var str = '<option value="0">邀请人所属部门</option>'; fn && fn(data.data);
$.each(data.data, function(i,item) {
str += '<option value="'+item.id+'">'+item.district_name+'</option>';
});
$("#district_id2").html(str);
} }
} }
}); });
......
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