Commit 5ac4abc1 authored by xishifeng's avatar xishifeng

3

parent edd8c69a
......@@ -246,10 +246,10 @@ define(['doT', 'text!temp/callPhone_template_tpl.html', 'css!style/home.css', 'c
user.delete_user(params);
});
$(document).delegate(".genj_ure", "click", function() {
user.user_id = $(this).attr("data-id");
// $("#genj_text").val('');
// $("input[name = 'user_status']:checked").removeAttr("checked");
user.getGenjinLabel();
// user.user_id = $(this).attr("data-id");
// user.getGenjinLabel();
var _$this = $(this);
$('#modal-record iframe').attr('src', '/index/userModalList?data=' + _$this.attr('data-item') + '&id=' + _$this.attr('data-id')).show();
});
$(document).delegate(".add_alert", "click", function() { //重置搜索
......@@ -286,7 +286,7 @@ define(['doT', 'text!temp/callPhone_template_tpl.html', 'css!style/home.css', 'c
});
//客户列表操作
$(document).delegate(".caozuo", "click", function() { //点击操作跟进详情
$(document).delegate(".cao-zuo-record", "click", function() { //点击操作跟进详情
user.user_id = $(this).attr("data-id");
console.log(user.user_id);
if(user.user_id== 'null'){
......
......@@ -240,10 +240,10 @@ define(['doT', 'text!temp/my_collection_user_template_tpl.html', 'css!style/home
user.delete_user(params);
});
$(document).delegate(".genj_ure", "click", function() {
user.user_id = $(this).attr("data-id");
// $("#genj_text").val('');
// $("input[name = 'user_status']:checked").removeAttr("checked");
user.getGenjinLabel();
// user.user_id = $(this).attr("data-id");
// user.getGenjinLabel();
var _$this = $(this);
$('#modal-record iframe').attr('src', '/index/userModalList?data=' + _$this.attr('data-item') + '&id=' + _$this.attr('data-id')).show();
});
$(document).delegate(".add_alert", "click", function() { //重置搜索
......@@ -285,7 +285,7 @@ define(['doT', 'text!temp/my_collection_user_template_tpl.html', 'css!style/home
});
//客户列表操作
$(document).delegate(".caozuo", "click", function() { //点击操作跟进详情
$(document).delegate(".cao-zuo-record", "click", function() { //点击操作跟进详情
user.user_id = $(this).attr("data-id");
user.user_phone = $(this).attr("data-phone");
user.agent_id_infor = $(this).attr("data-agentId");
......
......@@ -53,7 +53,7 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
agent_id_call_vip:"",
pageNoUser:1,//客户详情 客户动态初始化分页
moreUser:0,//标识点击加载更多 还有没有数据
agent_id_phone:'',
init: function() {
//初始化dot
$("body").append(template);
......@@ -177,6 +177,28 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
e.stopPropagation();
$(this).parent().remove();
});
//客户详情 关联客户
_doc.on('click', '.save-relational', function(e) {
e.preventDefault();
e.stopPropagation();
user.addRelational()
});
//客户详情 解除关联客户
_doc.on('click', '.del-relational', function(e) {
e.preventDefault();
e.stopPropagation();
var id_=$(this).attr("data-id");
user.delRelational(id_);
});
//点击客户详情 添加关联客户
_doc.on('click', '#user_add_relational', function(e) {
e.preventDefault();
e.stopPropagation();
$('#partical_name').val('');
user.agent_id_phone='';
});
//客户动态 加载更多
_doc.on('click', '.user-log-more', function(e) {
e.preventDefault();
......@@ -427,8 +449,10 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
user.delete_user(params);
});
$(document).delegate(".genj_ure", "click", function() {
user.user_id = $(this).attr("data-id");
user.getGenjinLabel();
// user.user_id = $(this).attr("data-id");
// user.getGenjinLabel();
var _$this = $(this);
$('#modal-record iframe').attr('src', '/index/userModalList?data=' + _$this.attr('data-item') + '&id=' + _$this.attr('data-id')).show();
});
$(document).delegate(".add_alert", "click", function() { //重置搜索
......@@ -474,7 +498,7 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
});
//客户列表操作
$(document).delegate(".caozuo", "click", function() { //点击操作跟进详情
$(document).delegate(".cao-zuo-record", "click", function() { //点击操作跟进详情
user.user_id = $(this).attr("data-id");
user.user_phone = $(this).attr("data-phone");
user.agent_id_infor = $(this).attr("data-agentId");
......@@ -635,6 +659,19 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
user.search_phone2();
}
});
//跟进姓名 下拉式搜索
$(document).on("input", "#partical_name", function() { //手机号新增搜索客方
if($("#partical_name").val() == '') {
user.agent_id_phone='';
$(".user-ul-liu").html('');
} else {
user.search_phone_liu();
}
});
//点击li 列表消失
$(document).delegate(".addphoneliu", "click", function() { //list消失新增客户 点击li事件 获取id ul消失
user.addphoneliu(this);
});
$(document).delegate(".addphone", "click", function() { //list消失新增客户 点击li事件 获取id ul消失
user.addphone(this);
});
......@@ -1658,14 +1695,14 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
$("#take_look_phone").html(data.data.user_info.user_phone); //约带看手机号
$("#take_look_id").html(data.data.user_info.user_id); //约带看id
//收藏客户 取消收藏
if(data.data.user_info.is_collect == 2){
if(data.data.is_collect == 2){
$('#user_is_collect').html('收藏');
}else{
$('#user_is_collect').html('取消收藏');
};
//vip客户 查看权限
if(user.agent_id_call_vip*1 == 1){
if(check_auth('auth_vip') || (user.agent_id_call*1 == user.agent_id_call_current*1) || (data.data.user_info.is_can_look == 0)){
if(check_auth('auth_vip') || (user.agent_id_call*1 == user.agent_id_call_current*1) || (data.data.is_can_look == 0)){
$('.user_call').show();
}else{
$('.user_call').hide();
......@@ -1746,6 +1783,13 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
//拨打电话
user.customerInfo = data.data.user_info;
is_outpace_call_num = data.data.is_outpace_call_num;
//关联客户显示 解除关联
var user_bind_list = "";
$.each(data['data']['user_bind_list'], function(i, item) {
user_bind_list += '<div>' + item.user_name + ',ID:' + item.user_id + ',' + item.user_phone + '<span class="text-info del-relational" data-id="'+ item.user_id +'">解除关联</span></div>';
});
$(".user-detail-relational").html(user_bind_list);
}
} else {
......@@ -1992,6 +2036,49 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
}
}
});
},
//新增关联客户
addRelational: function() {
$.ajax({
url: '/index/addUserBind',
type: 'GET',
async: true,
data: {
'bind_id': user.agent_id_phone,
"user_id": user.user_id
},
dataType: 'json',
success: function(data) {
if(data.code == 200 && data.data != null) {
alert(data.msg);
user.Caozuo();//更新关联客户
}else{
alert(data.msg);
}
}
});
},
//解除关联客户
delRelational: function(id) {
$.ajax({
url: '/index/removeUserBind',
type: 'GET',
async: true,
data: {
"user_id": id
},
dataType: 'json',
success: function(data) {
if(data.code == 200 && data.data != null) {
alert(data.msg);
user.Caozuo();//更新关联客户
}else{
alert(data.msg);
}
}
});
},
add_user: function() {
var params = {};
......@@ -2464,6 +2551,40 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
}
});
},
//跟进人 姓名搜索
search_phone_liu: function() { //手机号新增客户
$.ajax({
url: '/broker/searchUser',
type: 'GET',
async: true,
data: {
"AuthToken": user_info_obj.AuthToken,
'id' : $("#partical_name").val()
},
dataType: 'json',
success: function(data) {
if(data.code == 200) {
var user_ul = "";
$.each(data.data.user_date, function(i, item) {
user_ul += '<li class="addphoneliu" data-id="' + item.user_id + '">' + item.user_name + '-' + item.user_id + '-' + item.user_phone + '</li>';
});
$(".user-ul-liu").html(user_ul);
} else {
alert(data.msg);
}
}
});
},
//将li里的值 赋给input(分佣方姓名)
addphoneliu: function(obj) {//新增客户 input赋值
var user_ht = $(obj).html()+'';
var user_ht_str=user_ht.substring(0,user_ht.length-3);
$("#partical_name").val(user_ht_str);
$(".user-ul-liu").html('');
user.agent_id_phone = $(obj).attr("data-id");
},
};
return user;
......
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