新增渠道查看公司联动

master
chenzhi 5 years ago
parent f594e3bb14
commit 4d0606d6fc

@ -382,18 +382,19 @@
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>';
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>"
@ -404,7 +405,11 @@
}
})
}
getPromotersByLevel();
getPromotersByCompanyid();
$("#company_id").change(function(){
getPromotersByCompanyid();
})
})

Loading…
Cancel
Save