Commit ad29d194 authored by agping's avatar agping

客户详情优化

parent a1834f26
{layout name="global/frame_tpl" /}
<input type="hidden" class="page-load" id="RemarkFollowIndex" />
<style>
.follow-up-modal-list-area{
height: 258px;
overflow-y: scroll;
}
.modal-body1 {
height: 716px;
overflow-y: auto;
......@@ -246,7 +250,12 @@
.modal-title-genjing {
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 {
......@@ -586,16 +595,35 @@
</thead>
</table>
<h4 class="modal-title-genjing clear text-info">
客户跟进
</h4>
<div>
<div class="text-info" style="margin: 2px;font-size: 16px;">最近一条带看动态</div>
<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 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">
<tbody class="text-center" id="caozuo_table2">
</tbody>
</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 class="clear margin-top-ld">
</div>
<label class="col-sm-3 control-label">跟进<span class="text-danger">(必填)</span></label>
......
......@@ -45,6 +45,8 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
agent_id_call:"",//拨打电话 相关
agent_id_call_vip:"",
agent_id_phone:'',
pageNoUser:1,//客户详情 客户动态初始化分页
init: function() {
//初始化dot
$("body").append(template);
......@@ -292,7 +294,7 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
// 客户编辑 修改记录
$(document).delegate(".cao-zuo-record", "click", function() {
user.user_id = $(this).attr("data-id");
user.Caozuorecord();
// user.Caozuorecord();
});
$(document).delegate(".caozuo-yue", "click", function() {
//约带看初始化
......@@ -323,16 +325,45 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
$('#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();//显示加载更多
});
// 点击缓存
//查看弹出框里的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() { //点击操作跟进详情
user.remark_id = $(this).attr("data-remark");
$(this).removeClass('btn-success');
......@@ -419,6 +450,8 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
if(user.detailTabIndex == 1){
}else if(user.detailTabIndex == 0){
user.Caozuo();
user.pageNoUser=1;
$('#caozuo_table2').html('');
user.getGenjincon();
}
});
......@@ -636,6 +669,8 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
_genjinModal.hide();
_btnSaveTemp.hide();
_btnSave.css('display','block');
user.pageNoUser=1;
$('#caozuo_table2').html('');
user.getGenjincon();
};
}else {
......@@ -681,6 +716,8 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
console.log('释放成功');
alert('提交成功');
_genjinModal.hide();
user.pageNoUser=1;
$('#caozuo_table2').html('');
user.getGenjincon();
}else {
layerTipsX(data['msg']);
......@@ -1287,6 +1324,8 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
success: function(data) {
if(data.code == 200) {
alert('修改成功');
user.pageNoUser=1;
$('#caozuo_table2').html('');
user.getGenjincon();
$('#genj_text').val('');
// $("#modal-record").modal('hide');
......@@ -1354,8 +1393,9 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
$.ajax({
'type': 'GET',
'url': '/index/useraction_search',
'url': '/index/userDetail',
data: {
"AuthToken": user_info_obj.AuthToken,
"user_id": user.user_id,
'agent_id':user_info_obj.id
},
......@@ -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
$(".cus_phone").html(hideTel(data.data.user_info.user_phone)); //电话
$(".cus_date").html(data.data.user_info.create_time); //创建时间
$(".cus_fang_edit").val(data.data.user_info.agentinfo); //客方详情
$(".cus_fang").val(data.data.user_info.agentinfo); //客方编辑
$(".cus_fang_edit").val(data.data.user_info.agent_info); //客方详情
$(".cus_fang").val(data.data.user_info.agent_info); //客方编辑
$("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=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'
}else{
$(".user-details-introduce").html('否'); //转介绍详情
}
//客方修改记录
var caozuo_table = "";
$.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>';
......@@ -1458,6 +1499,19 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
}else{
$("#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 {
......@@ -1789,6 +1843,8 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
if(data.code == 200&&data.data) {
user.user_id=data.data.user_id;
user.Caozuo();
user.pageNoUser=1;
$('#caozuo_table2').html('');
user.getGenjincon();
}else{
alert(data.msg)
......@@ -1882,6 +1938,8 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
$('.call-user-five').html('');
$('.detail-modal-body-sec-2').show();
user.Caozuo();
user.pageNoUser=1;
$('#caozuo_table2').html('');
user.getGenjincon();
}else{
$('.call-user-five').html(data.msg);
......@@ -1914,6 +1972,8 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
success: function(data) {
if(data.code == 200) {
// $("input[type='radio'][name='user_status'][value=" + data.data + "]").prop("checked", "checked");
$('#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'
getGenjincon: function() {//获取客户动态
var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo'))); //读取缓存
$.ajax({
url:'/broker/useraction_search',
url:'/index/followUpLog',
type: 'POST',
async: true,
data: {
"AuthToken": user_info_obj.AuthToken,
"user_id": user.user_id,
"agent_id": user_info_obj.id
"page_no": user.pageNoUser,
"page_size": 8,
},
dataType: 'json',
success: function(data) {
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']['user_date'], function(i, item) {
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>';
$.each(data['data'], function(i, item) {
if(item.user_status*1){
var user_status = '【已租】'
}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>';
}
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").html(caozuo_table);
$("#caozuo_table2").append(caozuo_table);
}else{
$("#caozuo_table2").html('暂无跟进信息');
}
//滚动条 回到顶部
$('.followup-modal-list-area').scrollTop(0);
// $('.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 = "";
$.each(data['data'], function(i, item) {
if(item.step_name=='report'){
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{
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>';
}
});
$("#caozuo_table_log").html(caozuo_table);
//滚动条 回到顶部
$('.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) {
$.ajax({
......
......@@ -2294,8 +2294,7 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
$("#caozuo_table2").html('暂无跟进信息');
}
//滚动条 回到顶部
$('.follow-up-modal-list-area').scrollTop(0);
/*分页代码*/
// $('.follow-up-modal-list-area').scrollTop(0);
}else{
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