Commit e7618f2d authored by agping's avatar agping

客户详情同步线上

parent 951b0098
...@@ -401,7 +401,7 @@ ...@@ -401,7 +401,7 @@
<table class="table table-striped table-bordered table-hover table-condensed"> <table class="table table-striped table-bordered table-hover table-condensed">
<thead> <thead>
<tr> <tr>
<td colspan="12"> <td colspan="11">
<form action="" method="get" id="form_search"> <form action="" method="get" id="form_search">
<select class="form-control btn2-city ld-Marheight user_city_choose_site_list"></select> <select class="form-control btn2-city ld-Marheight user_city_choose_site_list"></select>
<!--<select class="form-control btn2 ld-Marheight" id="user_area_choose"> <!--<select class="form-control btn2 ld-Marheight" id="user_area_choose">
...@@ -549,7 +549,6 @@ ...@@ -549,7 +549,6 @@
<th class="text-center">价格</th> <th class="text-center">价格</th>
<th class="text-center">面积</th> <th class="text-center">面积</th>
<th class="text-center">产生类型</th> <th class="text-center">产生类型</th>
<th class="text-center">客方</th>
<th class="text-center">操作</th> <th class="text-center">操作</th>
</tr> </tr>
</thead> </thead>
......
...@@ -250,7 +250,12 @@ ...@@ -250,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 {
...@@ -590,21 +595,45 @@ ...@@ -590,21 +595,45 @@
</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>
<tr class="text-center is-show-more-followlog">
<td colspan="3">
<span class="user-log-more text-info" style="cursor: pointer;">加载更多</span>
</td>
</tr>
</table> </table>
</div> </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 class="clear margin-top-ld">
</div> </div>
<label class="col-sm-3 control-label">跟进<span class="text-danger">(必填)</span></label> <label class="col-sm-3 control-label">跟进<span class="text-danger">(必填)</span></label>
<div class="col-sm-9"> <div class="col-sm-9">
<textarea class="form-control" rows="3" id="genj_text"></textarea> <textarea class="form-control" rows="2" id="genj_text"></textarea>
</div> </div>
<label class="col-sm-3 control-label">状态标签<span class="text-danger">(必填)</span></label> <label class="col-sm-3 control-label">状态标签<span class="text-danger">(必填)</span></label>
......
...@@ -203,13 +203,19 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -203,13 +203,19 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
//上一页 获取客户详情 //上一页 获取客户详情
_doc.on('click', '#user_up', function() { _doc.on('click', '#user_up', function() {
user_type='last'; user_type='last';
// checkLogin(); //点击客户详情 初始化客户动态 带看动态
$('.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();
user.getInfor(); user.getInfor();
}); });
//下一页 获取客户详情 //下一页 获取客户详情
_doc.on('click', '#user_down', function() { _doc.on('click', '#user_down', function() {
user_type='next'; user_type='next';
checkLogin(); //点击客户详情 初始化客户动态 带看动态
$('.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();
user.getInfor(); user.getInfor();
}); });
//客户列表 收藏夹 //客户列表 收藏夹
...@@ -294,7 +300,7 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -294,7 +300,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() {
//约带看初始化 //约带看初始化
...@@ -325,16 +331,46 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -325,16 +331,46 @@ 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.moreUser=1;
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');
...@@ -421,6 +457,8 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -421,6 +457,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();
} }
}); });
...@@ -638,6 +676,8 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -638,6 +676,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 {
...@@ -683,6 +723,8 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -683,6 +723,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']);
...@@ -1239,7 +1281,8 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -1239,7 +1281,8 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
params.source_intro=$("#user_source_edit").val(); params.source_intro=$("#user_source_edit").val();
params.referrer_id = user.user_id_edit_introduce ? user.user_id_edit_introduce : 0; params.referrer_id = user.user_id_edit_introduce ? user.user_id_edit_introduce : 0;
params.referrer_source = 10; params.referrer_source = 10;
params.source = $("#user_label_edit").val(); // params.source = $("#user_label_edit").val();
params.user_label = $("#user_label_edit").val();
$.ajax({ $.ajax({
...@@ -1289,6 +1332,8 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -1289,6 +1332,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');
...@@ -1345,7 +1390,7 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -1345,7 +1390,7 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
} }
}); });
}, },
// 新增客户页面 // 客户详情页面 编辑和客户详情共用
Caozuo: function() { //获取跟进详情的数据 Caozuo: function() { //获取跟进详情的数据
//隐藏拨打电话 如果客户在保护期 并且客户不是我的 //隐藏拨打电话 如果客户在保护期 并且客户不是我的
if((user_info_obj.id*1 == user.agent_id_infor*1) || user.baohu*1){ if((user_info_obj.id*1 == user.agent_id_infor*1) || user.baohu*1){
...@@ -1356,8 +1401,9 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -1356,8 +1401,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
}, },
...@@ -1376,8 +1422,8 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -1376,8 +1422,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);
...@@ -1385,14 +1431,14 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -1385,14 +1431,14 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
$("#take_look_phone").html(data.data.user_info.user_phone); //约带看手机号 $("#take_look_phone").html(data.data.user_info.user_phone); //约带看手机号
$("#take_look_id").html(data.data.user_info.user_id); //约带看id $("#take_look_id").html(data.data.user_info.user_id); //约带看id
//收藏客户 取消收藏 //收藏客户 取消收藏
if(data.data.user_info.is_collect == 2){ if(data.data.is_collect == 2){
$('#user_is_collect').html('收藏'); $('#user_is_collect').html('收藏');
}else{ }else{
$('#user_is_collect').html('取消收藏'); $('#user_is_collect').html('取消收藏');
}; };
//vip客户 查看权限 //vip客户 查看权限
if(user.agent_id_call_vip*1 == 1){ 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.user_info.is_can_look == 0)){ if(check_auth('auth_vip') || (user.agent_id_call*1 == user.agent_id_call_current*1) || (data.data.is_can_look == 0)){
$('.user_call').show(); $('.user_call').show();
}else{ }else{
$('.user_call').hide(); $('.user_call').hide();
...@@ -1451,6 +1497,7 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -1451,6 +1497,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>';
...@@ -1460,6 +1507,19 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -1460,6 +1507,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 {
...@@ -1791,6 +1851,8 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -1791,6 +1851,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)
...@@ -1884,6 +1946,9 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -1884,6 +1946,9 @@ 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.getUserLogNew();//点击上一条 下一条初始化页面
user.pageNoUser=1;
$('#caozuo_table2').html('');
user.getGenjincon(); user.getGenjincon();
}else{ }else{
$('.call-user-five').html(data.msg); $('.call-user-five').html(data.msg);
...@@ -1916,6 +1981,8 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -1916,6 +1981,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) {
// $("input[type='radio'][name='user_status'][value=" + data.data + "]").prop("checked", "checked"); // $("input[type='radio'][name='user_status'][value=" + data.data + "]").prop("checked", "checked");
$('#caozuo_table2').html('');
user.pageNoUser=1;
user.getGenjincon(); user.getGenjincon();
} }
} }
...@@ -1924,13 +1991,15 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -1924,13 +1991,15 @@ 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": 30,
}, },
dataType: 'json', dataType: 'json',
...@@ -2043,7 +2112,6 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -2043,7 +2112,6 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
} }
}); });
}, },
//调用部门 和 门店的接口 //调用部门 和 门店的接口
getDistrict: function(fn) { getDistrict: function(fn) {
$.ajax({ $.ajax({
......
...@@ -177,6 +177,14 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind ...@@ -177,6 +177,14 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
e.stopPropagation(); e.stopPropagation();
$(this).parent().remove(); $(this).parent().remove();
}); });
//客户动态 加载更多
_doc.on('click', '.user-log-more', function(e) {
e.preventDefault();
e.stopPropagation();
user.moreUser=1;
user.getGenjincon(user.pageNoUser++)
});
//点击 无效 //点击 无效
_doc.on('click', '.is_invalid', function(e) { _doc.on('click', '.is_invalid', function(e) {
e.preventDefault(); e.preventDefault();
...@@ -325,11 +333,19 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind ...@@ -325,11 +333,19 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
//上一页 获取客户详情 //上一页 获取客户详情
_doc.on('click', '#user_up', function() { _doc.on('click', '#user_up', function() {
user_type='last'; user_type='last';
//点击客户详情 初始化客户动态 带看动态
$('.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();
user.getInfor(); user.getInfor();
}); });
//下一页 获取客户详情 //下一页 获取客户详情
_doc.on('click', '#user_down', function() { _doc.on('click', '#user_down', function() {
user_type='next'; user_type='next';
//点击客户详情 初始化客户动态 带看动态
$('.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();
user.getInfor(); user.getInfor();
}); });
//二级联动 //二级联动
...@@ -445,10 +461,11 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind ...@@ -445,10 +461,11 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
// 客户编辑 修改记录 // 客户编辑 修改记录
$(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() {
//约带看初始化 //约带看初始化
console.log(667);
$('#look_shop_date').val(''); $('#look_shop_date').val('');
$('#note_look').val(''); $('#note_look').val('');
$('.look-shop').val(''); $('.look-shop').val('');
...@@ -478,10 +495,17 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind ...@@ -478,10 +495,17 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
$('.look-shop').removeAttr('data-id'); $('.look-shop').removeAttr('data-id');
$('.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');
//点击客户详情 初始化客户动态 带看动态
$('.modal-title-genjing-con>span:nth-of-type(1)').addClass('text-info').siblings().removeClass('text-info');
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();
//初始化客户动态 带看动态两个表格切换
$('.follow-up-modal-list-area:nth-of-type(1)').show().siblings().hide();
$('.followup-modal-comment-area>textarea').val('');//清空跟进框内容 $('.followup-modal-comment-area>textarea').val('');//清空跟进框内容
user.getSiteTagsEdit(); user.getSiteTagsEdit();
user.getUserLogNew();//客户详情获取最近一条带看动态
$('.user-log-more').show();//显示加载更多
}); });
...@@ -579,9 +603,30 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind ...@@ -579,9 +603,30 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
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();
} }
}); });
//查看弹出框里的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()//获取客户动态
}
});
$(document).on("input", ".cus_fang", function() { //手机号搜索客方2 编辑 $(document).on("input", ".cus_fang", function() { //手机号搜索客方2 编辑
if($(".cus_fang").val() == '') { if($(".cus_fang").val() == '') {
user.agent_id2=''; user.agent_id2='';
...@@ -785,6 +830,8 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind ...@@ -785,6 +830,8 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
_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 {
...@@ -831,6 +878,8 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind ...@@ -831,6 +878,8 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
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']);
...@@ -1513,6 +1562,8 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind ...@@ -1513,6 +1562,8 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
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('');
} else { } else {
...@@ -1564,7 +1615,7 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind ...@@ -1564,7 +1615,7 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
} }
}); });
}, },
// 新增客户页面 // 客户详情页面 编辑和客户详情共用
Caozuo: function() { //获取跟进详情的数据 Caozuo: function() { //获取跟进详情的数据
//隐藏拨打电话 如果客户在保护期 并且客户不是我的 //隐藏拨打电话 如果客户在保护期 并且客户不是我的
if((user_info_obj.id*1 == user.agentbaohu*1) || user.baohu*1){ if((user_info_obj.id*1 == user.agentbaohu*1) || user.baohu*1){
...@@ -1575,8 +1626,9 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind ...@@ -1575,8 +1626,9 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
// checkLogin(); // checkLogin();
$.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
}, },
...@@ -1596,8 +1648,8 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind ...@@ -1596,8 +1648,8 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
$(".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); //创建时间
$(".referrer_user").html(data.data.user_info.referrer_user); //上传时间 $(".referrer_user").html(data.data.user_info.referrer_user); //上传时间
$(".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);
...@@ -1606,14 +1658,14 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind ...@@ -1606,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_phone").html(data.data.user_info.user_phone); //约带看手机号
$("#take_look_id").html(data.data.user_info.user_id); //约带看id $("#take_look_id").html(data.data.user_info.user_id); //约带看id
//收藏客户 取消收藏 //收藏客户 取消收藏
if(data.data.user_info.is_collect == 2){ if(data.data.is_collect == 2){
$('#user_is_collect').html('收藏'); $('#user_is_collect').html('收藏');
}else{ }else{
$('#user_is_collect').html('取消收藏'); $('#user_is_collect').html('取消收藏');
}; };
//vip客户 查看权限 //vip客户 查看权限
if(user.agent_id_call_vip*1 == 1){ 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.user_info.is_can_look == 0)){ if(check_auth('auth_vip') || (user.agent_id_call*1 == user.agent_id_call_current*1) || (data.data.is_can_look == 0)){
$('.user_call').show(); $('.user_call').show();
}else{ }else{
$('.user_call').hide(); $('.user_call').hide();
...@@ -1671,6 +1723,7 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind ...@@ -1671,6 +1723,7 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
}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>';
...@@ -1680,20 +1733,33 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind ...@@ -1680,20 +1733,33 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
}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 {
alert('获取失败!'); alert(data.msg);
} }
} }
}); });
}, },
//客户编辑 修改记录 //客户编辑 修改记录(废弃)
Caozuorecord: function() {//获取客户动态 Caozuorecord: function() {//获取客户动态
var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo'))); //读取缓存 var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo'))); //读取缓存
// checkLogin(); // checkLogin();
$.ajax({ $.ajax({
url:'/broker/useraction_search', url:'/index/userDetail',
type: 'POST', type: 'POST',
async: true, async: true,
data: { data: {
...@@ -1860,6 +1926,7 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind ...@@ -1860,6 +1926,7 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
}, },
//获取站点 标签 (编辑) //获取站点 标签 (编辑)
getSiteTagsEdit: function() { getSiteTagsEdit: function() {
console.log(669);
$('.shangpu_tags_area_edit ').html(''); $('.shangpu_tags_area_edit ').html('');
$('.shangpu_tags_area_detail').html(''); $('.shangpu_tags_area_detail').html('');
$.ajax({ $.ajax({
...@@ -2156,7 +2223,11 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind ...@@ -2156,7 +2223,11 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
$('.call-user-five').html(data.msg); $('.call-user-five').html(data.msg);
$('.detail-modal-body-sec-2').hide(); $('.detail-modal-body-sec-2').hide();
} }
console.log(670)
user.Caozuo(); user.Caozuo();
user.getUserLogNew();
user.pageNoUser=1;
$('#caozuo_table2').html('');
user.getGenjincon(); user.getGenjincon();
if(data.data.user_id==data.data.max_user_id){ if(data.data.user_id==data.data.max_user_id){
user.user_id=data.data.max_user_id-1; user.user_id=data.data.max_user_id-1;
...@@ -2187,22 +2258,27 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind ...@@ -2187,22 +2258,27 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
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();//以前获取客户动态
} }
} }
}); });
}, },
getGenjincon: function() {//获取客户动态 getGenjincon: function() {//获取客户动态(客户详情)
var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo'))); //读取缓存 var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo'))); //读取缓存
// checkLogin(); // checkLogin();
$.ajax({ $.ajax({
url:'/broker/useraction_search', url:'/index/followUpLog',
type: 'POST', type: 'GET',
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": 30,
}, },
dataType: 'json', dataType: 'json',
...@@ -2217,9 +2293,64 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind ...@@ -2217,9 +2293,64 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
//客户动态 即跟进 //客户动态 即跟进
var caozuo_table = ""; var caozuo_table = "";
$.each(data['data']['user_date'], function(i, item) { $.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{
$("#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) {
$.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'){ 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%">' + dealPunctuation(item.step)+'到场时间:'+ item.predict_see_time +'备注:'+item.intro+ '</td><td>' + item.name + '</td><td>' + item.create_time + '</td></tr>';
}else if(item.step_name=='follow_up_log'){
caozuo_table += '<tr><td class="text-left follow-up-home" width="70%">报备' + item.step+';属于哪类客户:'+ item.user_type + '</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%">' + dealPunctuation(item.step)+ '</td><td>' + item.name + '</td><td>' + item.create_time + '</td></tr>';
} }
......
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