|
|
@ -407,19 +407,24 @@
|
|
|
|
autoclose: true,
|
|
|
|
autoclose: true,
|
|
|
|
pickerPosition: 'bottom-left'
|
|
|
|
pickerPosition: 'bottom-left'
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
var promote_id = "{:I('promote_id')}";
|
|
|
|
var promote_id = "{:I('promote_id')}";
|
|
|
|
function getPromotersByLevel() {
|
|
|
|
var company_id = "{:I('company_id')}";
|
|
|
|
|
|
|
|
function getPromotersByCompanyid() {
|
|
|
|
|
|
|
|
var company_id = $("#company_id option:selected").val();
|
|
|
|
|
|
|
|
if(!company_id){
|
|
|
|
|
|
|
|
company_id = -1;
|
|
|
|
|
|
|
|
}
|
|
|
|
$.ajax({
|
|
|
|
$.ajax({
|
|
|
|
url: "{:U('Ajax/getPromotersByLevel')}",
|
|
|
|
url: "{:U('Ajax/getPromotersByCompanyid')}",
|
|
|
|
type: "get",
|
|
|
|
type: "get",
|
|
|
|
data: { level: 1 },
|
|
|
|
data: { company_id:company_id},
|
|
|
|
dataType: 'json',
|
|
|
|
dataType: 'json',
|
|
|
|
success: function (response) {
|
|
|
|
success: function (response) {
|
|
|
|
str = '<option value="">请选择会长</option><option value="0"' + (promote_id && 0 == promote_id ? 'selected' : '') + '>官方渠道</option>';
|
|
|
|
str = '<option value="">请选择会长</option>';
|
|
|
|
// $.each(response.data, function(index, item){
|
|
|
|
if(company_id == 0 || company_id ==-1){
|
|
|
|
// console.log(item.id);
|
|
|
|
str +='<option value="0"' + (promote_id && 0 == promote_id ? 'selected' : '') + '>官方渠道</option>';
|
|
|
|
// str += '<option value="'+item.id+' '+(promote_id && item.id == promote_id?'selected':'')+'">'+item.nickname+'</option>';
|
|
|
|
}
|
|
|
|
// });
|
|
|
|
|
|
|
|
data = response.data;
|
|
|
|
data = response.data;
|
|
|
|
for (var i in data) {
|
|
|
|
for (var i in data) {
|
|
|
|
str += "<option value='" + data[i].id + "' " + (promote_id && data[i].id == promote_id ? 'selected' : '') + ">" + data[i].nickname + "</option>"
|
|
|
|
str += "<option value='" + data[i].id + "' " + (promote_id && data[i].id == promote_id ? 'selected' : '') + ">" + data[i].nickname + "</option>"
|
|
|
@ -430,7 +435,11 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
getPromotersByLevel();
|
|
|
|
getPromotersByCompanyid();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$("#company_id").change(function(){
|
|
|
|
|
|
|
|
getPromotersByCompanyid();
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|