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' ...@@ -47,7 +47,10 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
agent_id_phone:'', agent_id_phone:'',
pageNoUser:1,//客户详情 客户动态初始化分页 pageNoUser:1,//客户详情 客户动态初始化分页
moreUser:0,//标识点击加载更多 还有没有数据 moreUser:0,//标识点击加载更多 还有没有数据
isExitsNew:0,
init: function() { init: function() {
user.isExitsNew=0;
//初始化dot //初始化dot
$("body").append(template); $("body").append(template);
//初始化时间 //初始化时间
...@@ -314,6 +317,7 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -314,6 +317,7 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
}); });
//客户列表操作 //客户列表操作
$(document).delegate(".caozuo", "click", function() { //点击操作跟进详情 $(document).delegate(".caozuo", "click", function() { //点击操作跟进详情
user.isExitsNew=0;
user.user_id = $(this).attr("data-id"); user.user_id = $(this).attr("data-id");
user.user_phone = $(this).attr("data-phone"); user.user_phone = $(this).attr("data-phone");
user.baohu = $(this).attr("data-baohu"); user.baohu = $(this).attr("data-baohu");
...@@ -360,6 +364,7 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -360,6 +364,7 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
$('.user-log-more').show(); $('.user-log-more').show();
user.pageNoUser=1; user.pageNoUser=1;
$('#caozuo_table2').html(''); $('#caozuo_table2').html('');
user.isExitsNew=0;
user.getGenjincon()//获取客户动态 user.getGenjincon()//获取客户动态
} }
}); });
...@@ -459,6 +464,7 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -459,6 +464,7 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
user.Caozuo(); user.Caozuo();
user.pageNoUser=1; user.pageNoUser=1;
$('#caozuo_table2').html(''); $('#caozuo_table2').html('');
user.isExitsNew=0;
user.getGenjincon(); user.getGenjincon();
} }
}); });
...@@ -678,6 +684,7 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -678,6 +684,7 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
_btnSave.css('display','block'); _btnSave.css('display','block');
user.pageNoUser=1; user.pageNoUser=1;
$('#caozuo_table2').html(''); $('#caozuo_table2').html('');
user.isExitsNew=0;
user.getGenjincon(); user.getGenjincon();
}; };
}else { }else {
...@@ -725,6 +732,7 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -725,6 +732,7 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
_genjinModal.hide(); _genjinModal.hide();
user.pageNoUser=1; user.pageNoUser=1;
$('#caozuo_table2').html(''); $('#caozuo_table2').html('');
user.isExitsNew=0;
user.getGenjincon(); user.getGenjincon();
}else { }else {
layerTipsX(data['msg']); layerTipsX(data['msg']);
...@@ -1334,6 +1342,7 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -1334,6 +1342,7 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
alert('修改成功'); alert('修改成功');
user.pageNoUser=1; user.pageNoUser=1;
$('#caozuo_table2').html(''); $('#caozuo_table2').html('');
user.isExitsNew=0;
user.getGenjincon(); user.getGenjincon();
$('#genj_text').val(''); $('#genj_text').val('');
// $("#modal-record").modal('hide'); // $("#modal-record").modal('hide');
...@@ -1853,6 +1862,7 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -1853,6 +1862,7 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
user.Caozuo(); user.Caozuo();
user.pageNoUser=1; user.pageNoUser=1;
$('#caozuo_table2').html(''); $('#caozuo_table2').html('');
user.isExitsNew=0;
user.getGenjincon(); user.getGenjincon();
}else{ }else{
alert(data.msg) alert(data.msg)
...@@ -1949,6 +1959,7 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -1949,6 +1959,7 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
user.getUserLogNew();//点击上一条 下一条初始化页面 user.getUserLogNew();//点击上一条 下一条初始化页面
user.pageNoUser=1; user.pageNoUser=1;
$('#caozuo_table2').html(''); $('#caozuo_table2').html('');
user.isExitsNew=0;
user.getGenjincon(); user.getGenjincon();
}else{ }else{
$('.call-user-five').html(data.msg); $('.call-user-five').html(data.msg);
...@@ -1988,11 +1999,15 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -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'))); //读取缓存 var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo'))); //读取缓存
$.ajax({ $.ajax({
url:'/index/followUpLog', url:'/index/followUpLogNew',
type: 'POST', type: 'GET',
async: true, async: true,
data: { data: {
"AuthToken": user_info_obj.AuthToken, "AuthToken": user_info_obj.AuthToken,
...@@ -2005,12 +2020,12 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -2005,12 +2020,12 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
dataType: 'json', dataType: 'json',
success: function(data) { success: function(data) {
if(data.code == 200 && data.data != null) { if(data.code == 200 && data.data != null) {
if(data.data.length == 30){ // if(data.data.length == 30){
$('.is-show-more-followlog').show(); // $('.is-show-more-followlog').show();
}else{ // }else{
$('.is-show-more-followlog').hide(); // $('.is-show-more-followlog').hide();
//
}; // };
//客户动态 即跟进 //客户动态 即跟进
var caozuo_table = ""; var caozuo_table = "";
...@@ -2032,23 +2047,84 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -2032,23 +2047,84 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
$("#caozuo_table2").append(caozuo_table); $("#caozuo_table2").append(caozuo_table);
}else{ }else{
$("#caozuo_table2").html('暂无跟进信息'); $("#caozuo_table2").html('暂无跟进信息');
} }
//滚动条 回到顶部 //滚动条 回到顶部
// $('.follow-up-modal-list-area').scrollTop(0); // $('.follow-up-modal-list-area').scrollTop(0);
}else{ }else{
if(user.pageNoUser==1){ user.isExitsNew = 1;
$("#caozuo_table2").html('暂无跟进信息'); //数据为空 num 置1
$('.is-show-more-followlog').hide(); 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){ if(item.type*1){
alert('暂无跟进信息!!!'); var follow_status = '跟进:'
user.moreUser=0; }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;
// };
}
}
}); });
}, },
//调用带看记录 //调用带看记录
......
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