Commit c19a7381 authored by zw's avatar zw

Merge branch 'test' into 0102-v3.0.4

# Conflicts: # application/index/view/remark/remark_follow_index.html # public/resource/js/RemarkFollowIndex.js # public/resource/js/user.js
parents 9e8d0adf d6492671
...@@ -250,12 +250,7 @@ ...@@ -250,12 +250,7 @@
.modal-title-genjing { .modal-title-genjing {
height: 36px; height: 36px;
line-height: 36px; line-height: 36px;
font-weight: 600; border-top: 3px solid #ccc;
font-size: 16px;
}
.modal-title-genjing span{
cursor: pointer;
margin-right: 20px;
} }
.center-btn { .center-btn {
...@@ -595,45 +590,21 @@ ...@@ -595,45 +590,21 @@
</thead> </thead>
</table> </table>
<div> <h4 class="modal-title-genjing clear text-info">
<div class="text-info" style="margin: 2px;font-size: 16px;">最近一条带看动态</div> 客户跟进
<table class="table table-striped table-bordered table-hover table-condensed"> </h4>
<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> <div class="followup-modal-list-area">
<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">
<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="2" id="genj_text"></textarea> <textarea class="form-control" rows="3" 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,19 +203,13 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -203,19 +203,13 @@ 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();
}); });
//客户列表 收藏夹 //客户列表 收藏夹
...@@ -300,7 +294,7 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -300,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() {
//约带看初始化 //约带看初始化
...@@ -331,46 +325,16 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -331,46 +325,16 @@ 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');
...@@ -457,8 +421,6 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -457,8 +421,6 @@ 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();
} }
}); });
...@@ -676,8 +638,6 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -676,8 +638,6 @@ 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 {
...@@ -723,8 +683,6 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -723,8 +683,6 @@ 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']);
...@@ -1281,8 +1239,7 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -1281,8 +1239,7 @@ 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({
...@@ -1332,8 +1289,6 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -1332,8 +1289,6 @@ 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');
...@@ -1390,7 +1345,7 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -1390,7 +1345,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){
...@@ -1401,9 +1356,8 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -1401,9 +1356,8 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
$.ajax({ $.ajax({
'type': 'GET', 'type': 'GET',
'url': '/index/userDetail', 'url': '/index/useraction_search',
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
}, },
...@@ -1422,8 +1376,8 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -1422,8 +1376,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.agent_info); //客方详情 $(".cus_fang_edit").val(data.data.user_info.agentinfo); //客方详情
$(".cus_fang").val(data.data.user_info.agent_info); //客方编辑 $(".cus_fang").val(data.data.user_info.agentinfo); //客方编辑
$("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);
...@@ -1497,7 +1451,6 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -1497,7 +1451,6 @@ 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>';
...@@ -1507,19 +1460,6 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -1507,19 +1460,6 @@ 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 {
...@@ -1851,8 +1791,6 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -1851,8 +1791,6 @@ 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)
...@@ -1946,9 +1884,6 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -1946,9 +1884,6 @@ 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);
...@@ -1981,8 +1916,6 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -1981,8 +1916,6 @@ 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();
} }
} }
...@@ -1991,21 +1924,24 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -1991,21 +1924,24 @@ 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:'/index/followUpLog', url:'/broker/useraction_search',
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,
"page_no": user.pageNoUser, "agent_id": user_info_obj.id
"page_size": 30,
}, },
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){
$('.is-show-more-followlog').show(); $('.is-show-more-followlog').show();
}else{
$('.is-show-more-followlog').hide();
};
//客户动态 即跟进 //客户动态 即跟进
var caozuo_table = ""; var caozuo_table = "";
...@@ -2020,7 +1956,7 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -2020,7 +1956,7 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
}else{ }else{
var follow_status = '电话跟进:' 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>'; 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){ if(caozuo_table){
...@@ -2064,11 +2000,11 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -2064,11 +2000,11 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
var caozuo_table = ""; var caozuo_table = "";
$.each(data['data'], 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%">' + 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'){ }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>'; 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%">' + 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>';
} }
}); });
$("#caozuo_table_log").html(caozuo_table); $("#caozuo_table_log").html(caozuo_table);
...@@ -2107,6 +2043,7 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -2107,6 +2043,7 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
} }
}); });
}, },
//调用部门 和 门店的接口 //调用部门 和 门店的接口
getDistrict: function(fn) { getDistrict: function(fn) {
$.ajax({ $.ajax({
......
...@@ -657,8 +657,8 @@ define(['doT', 'text!temp/financial_manager_daily_list_template_tpl.html', 'css! ...@@ -657,8 +657,8 @@ define(['doT', 'text!temp/financial_manager_daily_list_template_tpl.html', 'css!
doc.find("#intoPrice").val(data.money); doc.find("#intoPrice").val(data.money);
doc.find("#shouxu").val(data.transaction_fee); doc.find("#shouxu").val(data.transaction_fee);
doc.find("#realPrice").val(data.real_money); doc.find("#realPrice").val(data.real_money);
doc.find("#getPrice").text(((data.price-0)*0.8 )+ "元"); doc.find("#getPrice").text(((data.price-0)*0.7 )+ "元");
doc.find("#morePrice").text(Math.floor((data.money - ((data.price-0)*0.8))*100)/100 + "元"); doc.find("#morePrice").text(Math.floor((data.money - ((data.price-0)*0.7))*100)/100 + "元");
$("#person").text(data.current_agent_name); $("#person").text(data.current_agent_name);
$("#belongT").text(data.store_name); $("#belongT").text(data.store_name);
doc.find("#payType").val(data.pay_type); doc.find("#payType").val(data.pay_type);
......
...@@ -324,7 +324,7 @@ function urlDeal(urlStr, httpStr) { ...@@ -324,7 +324,7 @@ function urlDeal(urlStr, httpStr) {
} }
function dealPunctuation(str) {//处理跟进内容 多个标点符号 截取 function dealPunctuation(str) {//处理跟进内容 多个标点符号 截取
return str.replace(/!!!!!/g, '').replace(/!!!!!/g, '').replace(/\?\?\?\?\?/g, '').replace(/?????/g, '').replace(/。。。。。/g, ''); return (str+'!!!!!').replace(/!!!!!/g, '').replace(/!!!!!/g, '').replace(/\?\?\?\?\?/g, '').replace(/?????/g, '').replace(/。。。。。/g, '');
} }
/** /**
......
...@@ -177,14 +177,6 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind ...@@ -177,14 +177,6 @@ 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();
...@@ -333,19 +325,11 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind ...@@ -333,19 +325,11 @@ 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();
}); });
//二级联动 //二级联动
...@@ -461,11 +445,10 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind ...@@ -461,11 +445,10 @@ 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('');
...@@ -495,17 +478,10 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind ...@@ -495,17 +478,10 @@ 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();//显示加载更多
}); });
...@@ -603,30 +579,9 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind ...@@ -603,30 +579,9 @@ 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='';
...@@ -830,8 +785,6 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind ...@@ -830,8 +785,6 @@ 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 {
...@@ -878,8 +831,6 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind ...@@ -878,8 +831,6 @@ 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']);
...@@ -1562,8 +1513,6 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind ...@@ -1562,8 +1513,6 @@ 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 {
...@@ -1615,7 +1564,7 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind ...@@ -1615,7 +1564,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){
...@@ -1626,9 +1575,8 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind ...@@ -1626,9 +1575,8 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
// checkLogin(); // checkLogin();
$.ajax({ $.ajax({
'type': 'GET', 'type': 'GET',
'url': '/index/userDetail', 'url': '/index/useraction_search',
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
}, },
...@@ -1648,8 +1596,8 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind ...@@ -1648,8 +1596,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.agent_info); //客方详情 $(".cus_fang_edit").val(data.data.user_info.agentinfo); //客方详情
$(".cus_fang").val(data.data.user_info.agent_info); //客方编辑 $(".cus_fang").val(data.data.user_info.agentinfo); //客方编辑
$("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);
...@@ -1723,7 +1671,6 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind ...@@ -1723,7 +1671,6 @@ 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>';
...@@ -1733,33 +1680,20 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind ...@@ -1733,33 +1680,20 @@ 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(data.msg); alert('获取失败!');
} }
} }
}); });
}, },
//客户编辑 修改记录(废弃) //客户编辑 修改记录
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:'/index/userDetail', url:'/broker/useraction_search',
type: 'POST', type: 'POST',
async: true, async: true,
data: { data: {
...@@ -1926,7 +1860,6 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind ...@@ -1926,7 +1860,6 @@ 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({
...@@ -2223,11 +2156,7 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind ...@@ -2223,11 +2156,7 @@ 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;
...@@ -2258,95 +2187,41 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind ...@@ -2258,95 +2187,41 @@ 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");
$('#caozuo_table2').html(''); user.getGenjincon();
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:'/index/followUpLog', url:'/broker/useraction_search',
type: 'GET', 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,
"page_no": user.pageNoUser, "agent_id": user_info_obj.id
"page_size": 30,
}, },
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){
$('.is-show-more-followlog').show(); $('.is-show-more-followlog').show();
//客户动态 即跟进
var caozuo_table = "";
$.each(data['data'], function(i, item) {
if(item.user_status*1){
var user_status = '【已租】'
}else{ }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{
if(user.pageNoUser==1){
$("#caozuo_table2").html('暂无跟进信息');
$('.is-show-more-followlog').hide(); $('.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 = ""; var caozuo_table = "";
$.each(data['data'], function(i, item) { $.each(data['data']['user_date'], 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%">' + 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%">' + 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>';
} }
}); });
$("#caozuo_table_log").html(caozuo_table); $("#caozuo_table_log").html(caozuo_table);
......
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