Commit ea0d6a9e authored by xishifeng's avatar xishifeng

1

parent 003302a7
......@@ -47,9 +47,6 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
agent_id_phone:'',
pageNoUser:1,//客户详情 客户动态初始化分页
moreUser:0,//标识点击加载更多 还有没有数据
isExitsNew:0,
isTaday:1,
init: function() {
//初始化dot
$("body").append(template);
......@@ -268,11 +265,6 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
}
user.delete_user(params);
});
$(document).delegate(".genj_ure", "click", function() {
user.user_id = $(this).attr("data-id");
// checkLogin();
user.getGenjinLabel();
});
$(document).delegate(".add_alert", "click", function() {
document.getElementById("add_user_form").reset();
......@@ -316,38 +308,9 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
});
//客户列表操作
$(document).delegate(".cao-zuo-record", "click", function() { //点击操作跟进详情
user.isExitsNew=0;
user.user_id = $(this).attr("data-id");
user.user_phone = $(this).attr("data-phone");
user.baohu = $(this).attr("data-baohu");
user.agent_id_infor = $(this).attr("data-agentId");
user.remark_id = $(this).attr("data-remark");
//隐藏拨打电话 相关
user.agent_id_call=$(this).attr("data-agentId");
user.agent_id_call_vip=$(this).attr("data-vip");
$('.call-user-five').html('');
$('.detail-modal-body-sec-2').show();
$('#take_look_name').html($(this).attr("data-name"));
$('#take_look_phone').html($(this).attr("data-phone"));
$('#take_look_id').html($(this).attr("data-id"));
$('#look_shop_date').val('');
$('#note_look').val('');
$('.look-shop').val('');
$('.look-shop').removeAttr('data-id');
//点击客户详情 初始化客户动态 带看动态
$('.modal-title-genjing-con>span:nth-of-type(1)').addClass('text-info').siblings().removeClass('text-info');
//初始化客户动态 带看动态两个表格切换
$('.follow-up-modal-list-area:nth-of-type(1)').show().siblings().hide();
$('.detail-modal-header-tab>a:nth-of-type(1)').removeClass('btn-default').addClass('btn-info').siblings().removeClass('btn-info').addClass('btn-default');
user.detailTabIndex = 0;
$('.detail-modal-body-sec:nth-of-type(1)').show().siblings().hide();
$('.followup-modal-comment-area>textarea').val('');//清空跟进框内容
// checkLogin();
user.getSiteTagsEdit();
user.getUserLogNew();//客户详情获取最近一条带看动态
$('.user-log-more').show();//显示加载更多
$(document).delegate(".caozuo", "click", function() { //点击操作跟进详情
var _$this = $(this);
$('#modal-record iframe').attr('src', '/index/userModalList?data=' + _$this.attr('data-item') + '&id=' + _$this.attr('data-id'));
});
//查看弹出框里的tab点击事件,客户动态 带看动态
_doc.on('click', '.modal-title-genjing-con>span', function(e){
......@@ -364,7 +327,6 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
$('.user-log-more').show();
user.pageNoUser=1;
$('#caozuo_table2').html('');
user.isExitsNew=0;
user.getGenjincon()//获取客户动态
}
});
......@@ -464,7 +426,6 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
user.Caozuo();
user.pageNoUser=1;
$('#caozuo_table2').html('');
user.isExitsNew=0;
user.getGenjincon();
}
});
......@@ -684,7 +645,6 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
_btnSave.css('display','block');
user.pageNoUser=1;
$('#caozuo_table2').html('');
user.isExitsNew=0;
user.getGenjincon();
};
}else {
......@@ -732,7 +692,6 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
_genjinModal.hide();
user.pageNoUser=1;
$('#caozuo_table2').html('');
user.isExitsNew=0;
user.getGenjincon();
}else {
layerTipsX(data['msg']);
......@@ -1342,7 +1301,6 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
alert('修改成功');
user.pageNoUser=1;
$('#caozuo_table2').html('');
user.isExitsNew=0;
user.getGenjincon();
$('#genj_text').val('');
// $("#modal-record").modal('hide');
......@@ -1602,29 +1560,12 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
}
params.user_id = $.trim($("#customer_name_id").val());//区域
// params.disc = $.trim($("#user_area_choose").val());//区域
if(user.isTaday){
var myDate = new Date();
var y = myDate.getFullYear();
var m = myDate.getMonth() + 1;
var d = myDate.getDate();
var day_end = y + '-' + (m < 10 ? ('0' + m) : m) + '-' + (d < 10 ? ('0' + d) : d);
params.start_date = day_end;
params.end_date = day_end;
}else{
params.start_date = _startDateObj.val();
params.end_date = _endDateObj.val();
var time_=getTimeStamp(getBeforeDate(1));
if(getTimeStamp(params.end_date) > time_){
alert('选择的时间不能大于等于今天!!!');
return;
}
};
params.customer = $.trim(_customerNameObj.val());
params.phone = $.trim(_customerPhoneObj.val());
params.content = $.trim(_followContentObj.val());
if(!params.start_date || !params.end_date){
_startDateObj.val() != '' && (params.start_date = _startDateObj.val());
_endDateObj.val() != '' && (params.end_date = _endDateObj.val());
$.trim(_customerNameObj.val()) != '' && (params.customer = $.trim(_customerNameObj.val()));
$.trim(_customerPhoneObj.val()) != '' && (params.phone = $.trim(_customerPhoneObj.val()));
$.trim(_followContentObj.val()) != '' && (params.content = $.trim(_followContentObj.val()));
if(!$('#start_date').val() || !$('#end_date').val()){
alert('请您选择跟进时间!');
return;
};
......
......@@ -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");
// user.getGenjinLabel();
var _$this = $(this);
$('#modal-record iframe').attr('src', '/index/userModalList?data=' + _$this.attr('data-item') + '&id=' + _$this.attr('data-id') + '&type=1').show();
user.user_id = $(this).attr("data-id");
// $("#genj_text").val('');
// $("input[name = 'user_status']:checked").removeAttr("checked");
user.getGenjinLabel();
});
$(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(".cao-zuo-record", "click", function() { //点击操作跟进详情
$(document).delegate(".caozuo", "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");
// user.getGenjinLabel();
var _$this = $(this);
$('#modal-record iframe').attr('src', '/index/userModalList?data=' + _$this.attr('data-item') + '&id=' + _$this.attr('data-id') + '&type=1').show();
user.user_id = $(this).attr("data-id");
// $("#genj_text").val('');
// $("input[name = 'user_status']:checked").removeAttr("checked");
user.getGenjinLabel();
});
$(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(".cao-zuo-record", "click", function() { //点击操作跟进详情
$(document).delegate(".caozuo", "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,10 +53,8 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
agent_id_call_vip:"",
pageNoUser:1,//客户详情 客户动态初始化分页
moreUser:0,//标识点击加载更多 还有没有数据
isExitsNew:0,
agent_id_phone:'',
init: function() {
user.isExitsNew=0;
//初始化dot
$("body").append(template);
//初始化城市 区域筛选
......@@ -179,42 +177,12 @@ 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', '.relationalRecord', function(e) {
e.preventDefault();
e.stopPropagation();
var id_=$(this).attr("data-id");
user.relationalRecord(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();
e.stopPropagation();
user.moreUser=1;
user.getGenjincon(user.pageNoUser++)
});
//点击 无效
......@@ -506,9 +474,7 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
});
//客户列表操作
$(document).delegate(".cao-zuo-record", "click", function() { //点击操作跟进详情
//重置客户动态 全局变量
user.isExitsNew=0;
$(document).delegate(".caozuo", "click", function() { //点击操作跟进详情
user.user_id = $(this).attr("data-id");
user.user_phone = $(this).attr("data-phone");
user.agent_id_infor = $(this).attr("data-agentId");
......@@ -639,7 +605,6 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
user.Caozuo();
user.pageNoUser=1;
$('#caozuo_table2').html('');
user.isExitsNew=0;
user.getGenjincon();
}
});
......@@ -658,7 +623,6 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
$('.user-log-more').show();
user.pageNoUser=1;
$('#caozuo_table2').html('');
user.isExitsNew=0;
user.getGenjincon()//获取客户动态
}
});
......@@ -868,7 +832,6 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
_btnSave.css('display','block');
user.pageNoUser=1;
$('#caozuo_table2').html('');
user.isExitsNew=0;
user.getGenjincon();
};
}else {
......@@ -917,7 +880,6 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
_genjinModal.hide();
user.pageNoUser=1;
$('#caozuo_table2').html('');
user.isExitsNew=0;
user.getGenjincon();
}else {
layerTipsX(data['msg']);
......@@ -1602,7 +1564,6 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
alert('修改成功');
user.pageNoUser=1;
$('#caozuo_table2').html('');
user.isExitsNew=0;
user.getGenjincon();
$('#genj_text').val('');
} else {
......@@ -1697,14 +1658,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.is_collect == 2){
if(data.data.user_info.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.is_can_look == 0)){
if(check_auth('auth_vip') || (user.agent_id_call*1 == user.agent_id_call_current*1) || (data.data.user_info.is_can_look == 0)){
$('.user_call').show();
}else{
$('.user_call').hide();
......@@ -2267,7 +2228,6 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
user.getUserLogNew();
user.pageNoUser=1;
$('#caozuo_table2').html('');
user.isExitsNew=0;
user.getGenjincon();
if(data.data.user_id==data.data.max_user_id){
user.user_id=data.data.max_user_id-1;
......@@ -2307,14 +2267,10 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
});
},
getGenjincon: function() {//获取客户动态(客户详情)
if(user.isExitsNew == 1){
user.getGenjincontwo();
}else{
var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo'))); //读取缓存
// checkLogin();
$.ajax({
url:'/index/followUpLogNew',
url:'/index/followUpLog',
type: 'GET',
async: true,
data: {
......@@ -2328,12 +2284,12 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
dataType: 'json',
success: function(data) {
if(data.code == 200 && data.data != null) {
// if(data.data.length == 30){
// $('.is-show-more-followlog').show();
// }else{
// $('.is-show-more-followlog').hide();
//
// };
if(data.data.length == 30){
$('.is-show-more-followlog').show();
}else{
$('.is-show-more-followlog').hide();
};
//客户动态 即跟进
var caozuo_table = "";
......@@ -2361,77 +2317,14 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
// $('.follow-up-modal-list-area').scrollTop(0);
}else{
user.isExitsNew = 1;
//数据为空 num 置1
user.pageNoUser=1;
user.getGenjincontwo();
}
}
});
}
},
getGenjincontwo: function() {//获取客户动态(客户详情)
var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo'))); //读取缓存
$.ajax({
url:'/index/followUpLog',
type: 'GET',
async: true,
data: {
"AuthToken": user_info_obj.AuthToken,
"user_id": user.user_id,
"page_no": user.pageNoUser,
"page_size": 30,
},
dataType: 'json',
success: function(data) {
if(data.code == 200 && data.data != null) {
// if(data.data.length == 30){
// $('.is-show-more-followlog').show();
// }else{
// $('.is-show-more-followlog').hide();
//
// };
//客户动态 即跟进
var caozuo_table = "";
$.each(data['data'], function(i, item) {
if(item.user_status*1){
var user_status = '【已租】'
}else{
var user_status = '【求租】'
};
if(item.type*1){
var follow_status = '跟进:'
}else{
var follow_status = '电话跟进:'
};
caozuo_table += '<tr><td class="text-left follow-up-home" width="70%">' + follow_status + dealPunctuation(item.content) + user_status +'</td><td>' + item.name + '</td><td>' + item.create_time +'</td></tr>';
});
if(caozuo_table){
$("#caozuo_table2").append(caozuo_table);
}else{
if(user.pageNoUser==1){
$("#caozuo_table2").html('暂无跟进信息');
}
//滚动条 回到顶部
// $('.follow-up-modal-list-area').scrollTop(0);
}else{
alert('暂无跟进信息!!!');
// if(user.pageNoUser==1){
// $("#caozuo_table2").html('暂无跟进信息');
// $('.is-show-more-followlog').hide();
// };
// if(user.moreUser){
// alert('暂无跟进信息!!!');
// user.moreUser=0;
// };
$('.is-show-more-followlog').hide();
}
if(user.moreUser){
alert('暂无跟进信息!!!');
user.moreUser=0;
};
}
}
......@@ -2571,41 +2464,7 @@ 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