Commit af9a2382 authored by agping's avatar agping

客户跟进

parent 3771f9f4
......@@ -47,7 +47,10 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
agent_id_phone:'',
pageNoUser:1,//客户详情 客户动态初始化分页
moreUser:0,//标识点击加载更多 还有没有数据
isExitsNew:0,
init: function() {
user.isExitsNew=0;
//初始化dot
$("body").append(template);
//初始化时间
......@@ -314,6 +317,7 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
});
//客户列表操作
$(document).delegate(".caozuo", "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");
......@@ -360,6 +364,7 @@ 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()//获取客户动态
}
});
......@@ -459,6 +464,7 @@ 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();
}
});
......@@ -678,6 +684,7 @@ 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 {
......@@ -725,6 +732,7 @@ 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']);
......@@ -1334,6 +1342,7 @@ 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');
......@@ -1853,6 +1862,7 @@ 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();
}else{
alert(data.msg)
......@@ -1949,6 +1959,7 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
user.getUserLogNew();//点击上一条 下一条初始化页面
user.pageNoUser=1;
$('#caozuo_table2').html('');
user.isExitsNew=0;
user.getGenjincon();
}else{
$('.call-user-five').html(data.msg);
......@@ -1988,11 +1999,15 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
}
});
},
getGenjincon: function() {//获取客户动态
getGenjincon: function() {//获取客户动态(客户详情)
if(user.isExitsNew == 1){
user.getGenjincontwo();
}else{
var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo'))); //读取缓存
$.ajax({
url:'/index/followUpLog',
type: 'POST',
url:'/index/followUpLogNew',
type: 'GET',
async: true,
data: {
"AuthToken": user_info_obj.AuthToken,
......@@ -2005,51 +2020,112 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
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);
// 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{
$("#caozuo_table2").html('暂无跟进信息');
}
//滚动条 回到顶部
// $('.follow-up-modal-list-area').scrollTop(0);
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('暂无跟进信息');
$('.is-show-more-followlog').hide();
$("#caozuo_table2").html('暂无跟进信息');
}
//滚动条 回到顶部
// $('.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(user.moreUser){
alert('暂无跟进信息!!!');
user.moreUser=0;
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{
$("#caozuo_table2").html('暂无跟进信息');
}
},
});
//滚动条 回到顶部
// $('.follow-up-modal-list-area').scrollTop(0);
}else{
// if(user.pageNoUser==1){
// $("#caozuo_table2").html('暂无跟进信息');
// $('.is-show-more-followlog').hide();
// };
// if(user.moreUser){
// alert('暂无跟进信息!!!');
// user.moreUser=0;
// };
}
}
});
},
//调用带看记录
getUserLog: function(type) {
......
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