Commit ad29d194 authored by agping's avatar agping

客户详情优化

parent a1834f26
{layout name="global/frame_tpl" /} {layout name="global/frame_tpl" /}
<input type="hidden" class="page-load" id="RemarkFollowIndex" /> <input type="hidden" class="page-load" id="RemarkFollowIndex" />
<style> <style>
.follow-up-modal-list-area{
height: 258px;
overflow-y: scroll;
}
.modal-body1 { .modal-body1 {
height: 716px; height: 716px;
overflow-y: auto; overflow-y: auto;
...@@ -246,7 +250,12 @@ ...@@ -246,7 +250,12 @@
.modal-title-genjing { .modal-title-genjing {
height: 36px; height: 36px;
line-height: 36px; line-height: 36px;
border-top: 3px solid #ccc; font-weight: 600;
font-size: 16px;
}
.modal-title-genjing span{
cursor: pointer;
margin-right: 20px;
} }
.center-btn { .center-btn {
...@@ -586,15 +595,34 @@ ...@@ -586,15 +595,34 @@
</thead> </thead>
</table> </table>
<h4 class="modal-title-genjing clear text-info"> <div>
客户跟进 <div class="text-info" style="margin: 2px;font-size: 16px;">最近一条带看动态</div>
</h4> <table class="table table-striped table-bordered table-hover table-condensed">
<tbody class="text-center user-log-detail">
</tbody>
</table>
</div>
<div class="clear modal-title-genjing">
<span class="modal-title-genjing-con">
<span class="text-info">客户动态</span>
<span>带看动态</span>
</span>
<span class="user-log-more text-info" style="float: right;">加载更多</span>
</div>
<div id="gen_jing_user"> <div id="gen_jing_user">
<div class="followup-modal-list-area"> <div>
<div class="follow-up-modal-list-area" style="height: 212px">
<table class="table table-striped table-bordered table-hover table-condensed"> <table class="table table-striped table-bordered table-hover table-condensed">
<tbody class="text-center" id="caozuo_table2"> <tbody class="text-center" id="caozuo_table2">
</tbody> </tbody>
</table> </table>
</div>
<div class="follow-up-modal-list-area" style="height: 212px">
<table class="table table-striped table-bordered table-hover table-condensed">
<tbody class="text-center" id="caozuo_table_log">
</tbody>
</table>
</div>
</div> </div>
<div class="clear margin-top-ld"> <div class="clear margin-top-ld">
</div> </div>
......
...@@ -45,6 +45,8 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -45,6 +45,8 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
agent_id_call:"",//拨打电话 相关 agent_id_call:"",//拨打电话 相关
agent_id_call_vip:"", agent_id_call_vip:"",
agent_id_phone:'', agent_id_phone:'',
pageNoUser:1,//客户详情 客户动态初始化分页
init: function() { init: function() {
//初始化dot //初始化dot
$("body").append(template); $("body").append(template);
...@@ -292,7 +294,7 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -292,7 +294,7 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
// 客户编辑 修改记录 // 客户编辑 修改记录
$(document).delegate(".cao-zuo-record", "click", function() { $(document).delegate(".cao-zuo-record", "click", function() {
user.user_id = $(this).attr("data-id"); user.user_id = $(this).attr("data-id");
user.Caozuorecord(); // user.Caozuorecord();
}); });
$(document).delegate(".caozuo-yue", "click", function() { $(document).delegate(".caozuo-yue", "click", function() {
//约带看初始化 //约带看初始化
...@@ -323,16 +325,45 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -323,16 +325,45 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
$('#note_look').val(''); $('#note_look').val('');
$('.look-shop').val(''); $('.look-shop').val('');
$('.look-shop').removeAttr('data-id'); $('.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'); $('.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; user.detailTabIndex = 0;
$('.detail-modal-body-sec:nth-of-type(1)').show().siblings().hide(); $('.detail-modal-body-sec:nth-of-type(1)').show().siblings().hide();
$('.followup-modal-comment-area>textarea').val('');//清空跟进框内容 $('.followup-modal-comment-area>textarea').val('');//清空跟进框内容
// checkLogin(); // checkLogin();
user.getSiteTagsEdit(); user.getSiteTagsEdit();
user.getUserLogNew();//客户详情获取最近一条带看动态
$('.user-log-more').show();//显示加载更多
}); });
// 点击缓存 //查看弹出框里的tab点击事件,客户动态 带看动态
_doc.on('click', '.modal-title-genjing-con>span', function(e){
e.preventDefault();
e.stopPropagation();
var _this = $(this);
_this.addClass('text-info').siblings().removeClass('text-info');
user.detailTabIndexFollow = _this.index();
$('.follow-up-modal-list-area:nth-of-type('+(user.detailTabIndexFollow+1)+')').show().siblings().hide();
if(user.detailTabIndexFollow){
$('.user-log-more').hide();
user.getUserLog(2)//获取带看记录
}else{
$('.user-log-more').show();
user.pageNoUser=1;
$('#caozuo_table2').html('');
user.getGenjincon()//获取客户动态
}
});
//客户动态 加载更多
_doc.on('click', '.user-log-more', function(e) {
e.preventDefault();
e.stopPropagation();
user.getGenjincon(user.pageNoUser++)
});
//点击缓存
$(document).delegate(".caozuo-add-color", "click", function() { //点击操作跟进详情 $(document).delegate(".caozuo-add-color", "click", function() { //点击操作跟进详情
user.remark_id = $(this).attr("data-remark"); user.remark_id = $(this).attr("data-remark");
$(this).removeClass('btn-success'); $(this).removeClass('btn-success');
...@@ -419,6 +450,8 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -419,6 +450,8 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
if(user.detailTabIndex == 1){ if(user.detailTabIndex == 1){
}else if(user.detailTabIndex == 0){ }else if(user.detailTabIndex == 0){
user.Caozuo(); user.Caozuo();
user.pageNoUser=1;
$('#caozuo_table2').html('');
user.getGenjincon(); user.getGenjincon();
} }
}); });
...@@ -636,6 +669,8 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -636,6 +669,8 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
_genjinModal.hide(); _genjinModal.hide();
_btnSaveTemp.hide(); _btnSaveTemp.hide();
_btnSave.css('display','block'); _btnSave.css('display','block');
user.pageNoUser=1;
$('#caozuo_table2').html('');
user.getGenjincon(); user.getGenjincon();
}; };
}else { }else {
...@@ -681,6 +716,8 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -681,6 +716,8 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
console.log('释放成功'); console.log('释放成功');
alert('提交成功'); alert('提交成功');
_genjinModal.hide(); _genjinModal.hide();
user.pageNoUser=1;
$('#caozuo_table2').html('');
user.getGenjincon(); user.getGenjincon();
}else { }else {
layerTipsX(data['msg']); layerTipsX(data['msg']);
...@@ -1287,6 +1324,8 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -1287,6 +1324,8 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
success: function(data) { success: function(data) {
if(data.code == 200) { if(data.code == 200) {
alert('修改成功'); alert('修改成功');
user.pageNoUser=1;
$('#caozuo_table2').html('');
user.getGenjincon(); user.getGenjincon();
$('#genj_text').val(''); $('#genj_text').val('');
// $("#modal-record").modal('hide'); // $("#modal-record").modal('hide');
...@@ -1354,8 +1393,9 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -1354,8 +1393,9 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
$.ajax({ $.ajax({
'type': 'GET', 'type': 'GET',
'url': '/index/useraction_search', 'url': '/index/userDetail',
data: { data: {
"AuthToken": user_info_obj.AuthToken,
"user_id": user.user_id, "user_id": user.user_id,
'agent_id':user_info_obj.id 'agent_id':user_info_obj.id
}, },
...@@ -1374,8 +1414,8 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -1374,8 +1414,8 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
$(".user_vip2").val(data.data.user_info.vip); //是否vip $(".user_vip2").val(data.data.user_info.vip); //是否vip
$(".cus_phone").html(hideTel(data.data.user_info.user_phone)); //电话 $(".cus_phone").html(hideTel(data.data.user_info.user_phone)); //电话
$(".cus_date").html(data.data.user_info.create_time); //创建时间 $(".cus_date").html(data.data.user_info.create_time); //创建时间
$(".cus_fang_edit").val(data.data.user_info.agentinfo); //客方详情 $(".cus_fang_edit").val(data.data.user_info.agent_info); //客方详情
$(".cus_fang").val(data.data.user_info.agentinfo); //客方编辑 $(".cus_fang").val(data.data.user_info.agent_info); //客方编辑
$("select[name=industry_type_two]").val(data.data.user_info.industry_type); $("select[name=industry_type_two]").val(data.data.user_info.industry_type);
$("input[name=price_demand]").val(data.data.user_info.price_demand * 1); $("input[name=price_demand]").val(data.data.user_info.price_demand * 1);
$("input[name=area_demand]").val(data.data.user_info.area_demand * 1); $("input[name=area_demand]").val(data.data.user_info.area_demand * 1);
...@@ -1449,6 +1489,7 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -1449,6 +1489,7 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
}else{ }else{
$(".user-details-introduce").html('否'); //转介绍详情 $(".user-details-introduce").html('否'); //转介绍详情
} }
//客方修改记录
var caozuo_table = ""; var caozuo_table = "";
$.each(data['data']['user_history'], function(i, item) { $.each(data['data']['user_history'], function(i, item) {
caozuo_table += '<tr><td>' + item.remark + '</td><td>' + item.name + '</td><td>' + item.create_time + '</td></tr>'; caozuo_table += '<tr><td>' + item.remark + '</td><td>' + item.name + '</td><td>' + item.create_time + '</td></tr>';
...@@ -1458,6 +1499,19 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -1458,6 +1499,19 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
}else{ }else{
$("#caozuo_table_edit").html('暂无数据(*^_^*)'); $("#caozuo_table_edit").html('暂无数据(*^_^*)');
}; };
//邀请人修改记录
var caozuo_table_introduce = "";
$.each(data['data']['user_invite_history'], function(i, item) {
caozuo_table_introduce += '<tr><td>' + item.remark + '</td><td>' + item.name + '</td><td>' + item.create_time + '</td></tr>';
});
if(caozuo_table_introduce){
$("#caozuo_table_edit_introduce").html(caozuo_table_introduce);
}else{
$("#caozuo_table_edit_introduce").html('暂无数据(*^_^*)');
}
//拨打电话
user.customerInfo = data.data.user_info;
is_outpace_call_num = data.data.is_outpace_call_num;
} }
} else { } else {
...@@ -1789,6 +1843,8 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -1789,6 +1843,8 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
if(data.code == 200&&data.data) { if(data.code == 200&&data.data) {
user.user_id=data.data.user_id; user.user_id=data.data.user_id;
user.Caozuo(); user.Caozuo();
user.pageNoUser=1;
$('#caozuo_table2').html('');
user.getGenjincon(); user.getGenjincon();
}else{ }else{
alert(data.msg) alert(data.msg)
...@@ -1882,6 +1938,8 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -1882,6 +1938,8 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
$('.call-user-five').html(''); $('.call-user-five').html('');
$('.detail-modal-body-sec-2').show(); $('.detail-modal-body-sec-2').show();
user.Caozuo(); user.Caozuo();
user.pageNoUser=1;
$('#caozuo_table2').html('');
user.getGenjincon(); user.getGenjincon();
}else{ }else{
$('.call-user-five').html(data.msg); $('.call-user-five').html(data.msg);
...@@ -1914,7 +1972,9 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -1914,7 +1972,9 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
success: function(data) { success: function(data) {
if(data.code == 200) { if(data.code == 200) {
// $("input[type='radio'][name='user_status'][value=" + data.data + "]").prop("checked", "checked"); // $("input[type='radio'][name='user_status'][value=" + data.data + "]").prop("checked", "checked");
user.getGenjincon(); $('#caozuo_table2').html('');
user.pageNoUser=1;
user.getGenjincon();
} }
} }
}); });
...@@ -1922,42 +1982,109 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -1922,42 +1982,109 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
getGenjincon: function() {//获取客户动态 getGenjincon: function() {//获取客户动态
var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo'))); //读取缓存 var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo'))); //读取缓存
$.ajax({ $.ajax({
url:'/broker/useraction_search', url:'/index/followUpLog',
type: 'POST', type: 'POST',
async: true, async: true,
data: { data: {
"AuthToken": user_info_obj.AuthToken, "AuthToken": user_info_obj.AuthToken,
"user_id": user.user_id, "user_id": user.user_id,
"agent_id": user_info_obj.id "page_no": user.pageNoUser,
"page_size": 8,
}, },
dataType: 'json', dataType: 'json',
success: function(data) { success: function(data) {
if(data.code == 200 && data.data != null) { if(data.code == 200 && data.data != null) {
user.customerInfo = data.data.user_info; //客户动态 即跟进
is_outpace_call_num = data.data.is_outpace_call_num; 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 + 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{
alert('暂无数据!!!');
}
},
});
},
//调用带看记录
getUserLog: function(type) {
$.ajax({
url: '/index/userLog',
type: 'GET',
async: true,
data: {
"user_id": user.user_id,
"type": type
},
dataType: 'json',
success: function(data) {
var caozuo_table='';
if(data.code == 200 && data.data != null) {
//带看动态
var caozuo_table = ""; var caozuo_table = "";
$.each(data['data']['user_date'], function(i, item) { $.each(data['data'], function(i, item) {
if(item.step_name=='report'){ if(item.step_name=='report'){
caozuo_table += '<tr><td class="text-left follow-up-home" width="70%">' + dealPunctuation(item.step)+'到场时间:'+ item.predict_see_time +'备注:'+item.intro+ '</td><td>' + item.name + '</td><td>' + item.create_time + '</td></tr>'; caozuo_table += '<tr><td class="text-left follow-up-home" width="70%">' + item.step+'到场时间:'+ item.predict_see_time +'备注:'+item.intro+ '</td><td>' + item.name + '</td><td>' + item.create_time + '</td></tr>';
}else{ }else{
caozuo_table += '<tr><td class="text-left follow-up-home" width="70%">' + dealPunctuation(item.step)+ '</td><td>' + item.name + '</td><td>' + item.create_time + '</td></tr>'; caozuo_table += '<tr><td class="text-left follow-up-home" width="70%">' + item.step+ '</td><td>' + item.name + '</td><td>' + item.create_time + '</td></tr>';
} }
}); });
if(caozuo_table){ $("#caozuo_table_log").html(caozuo_table);
$("#caozuo_table2").html(caozuo_table);
}else{
$("#caozuo_table2").html('暂无跟进信息');
}
//滚动条 回到顶部 //滚动条 回到顶部
$('.followup-modal-list-area').scrollTop(0); $('.follow-up-modal-list-area').scrollTop(0);
}else{
$("#caozuo_table_log").html('暂无带看信息');
}
}
});
},
getUserLogNew: function(type) {
$.ajax({
url: '/index/userLog',
type: 'GET',
async: true,
data: {
"user_id": user.user_id,
"type": 1
},
dataType: 'json',
success: function(data) {
var caozuo_table='';
if(data.code == 200 && data.data != null) {
//带看动态
var caozuo_table = "";
if(data.data.step_name=='report'){
caozuo_table += '<tr><td class="text-left follow-up-home" width="70%">' + data.data.step+'到场时间:'+ data.data.predict_see_time +'备注:'+data.data.intro+ '</td><td>' + data.data.name + '</td><td>' + data.data.create_time + '</td></tr>';
}else{
caozuo_table += '<tr><td class="text-left follow-up-home" width="70%">' + data.data.step+ '</td><td>' + data.data.name + '</td><td>' + data.data.create_time + '</td></tr>';
}
$(".user-log-detail").html(caozuo_table);
}else{
$(".user-log-detail").html('暂无带看信息');
} }
} }
}); });
}, },
//调用部门 和 门店的接口 //调用部门 和 门店的接口
getDistrict: function(fn) { getDistrict: function(fn) {
$.ajax({ $.ajax({
......
...@@ -2294,8 +2294,7 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind ...@@ -2294,8 +2294,7 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
$("#caozuo_table2").html('暂无跟进信息'); $("#caozuo_table2").html('暂无跟进信息');
} }
//滚动条 回到顶部 //滚动条 回到顶部
$('.follow-up-modal-list-area').scrollTop(0); // $('.follow-up-modal-list-area').scrollTop(0);
/*分页代码*/
}else{ }else{
alert('暂无数据!!!'); alert('暂无数据!!!');
......
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