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