Commit f4903b32 authored by agping's avatar agping Committed by hujun

客户列表 客户详情 上一页 下一页

parent ebe8929b
...@@ -518,10 +518,8 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind ...@@ -518,10 +518,8 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
user.delete_user(params); user.delete_user(params);
}); });
$(document).delegate(".genj_ure", "click", function() { $(document).delegate(".genj_ure", "click", function() {
// user.user_id = $(this).attr("data-id");
// user.getGenjinLabel();
var _$this = $(this); var _$this = $(this);
$('#modal-record iframe').attr('src', '/index/userModalList?data=' + $.trim(_$this.next().html()) + '&id=' + _$this.attr('data-id')).show(); $('#modal-record iframe').attr('src', '/index/userModalList?data=' + $.trim(_$this.next().html()) + '&id=' + _$this.attr('data-id') + '&idIndexUser=' + _$this.attr('data-index')).show();
}); });
$(document).delegate(".add_alert", "click", function() { //重置搜索 $(document).delegate(".add_alert", "click", function() { //重置搜索
...@@ -1954,7 +1952,6 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind ...@@ -1954,7 +1952,6 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
user.pageNo = pageNo; user.pageNo = pageNo;
var params = {}; var params = {};
params.AuthToken=user_info_obj.AuthToken; params.AuthToken=user_info_obj.AuthToken;
//区分全部 商铺 办公楼 //区分全部 商铺 办公楼
params.entrust_type=user.entrust_type_list; params.entrust_type=user.entrust_type_list;
params.agent_id_for_bind=user_info_obj.id; params.agent_id_for_bind=user_info_obj.id;
...@@ -2014,7 +2011,6 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind ...@@ -2014,7 +2011,6 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
alert('开始时间不能大于结束时间'); alert('开始时间不能大于结束时间');
return; return;
} }
// checkLogin();
$.ajax({ $.ajax({
url: '/index/users_list', url: '/index/users_list',
type: 'GET', type: 'GET',
...@@ -2026,6 +2022,12 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind ...@@ -2026,6 +2022,12 @@ 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) {
//客户列表 每个详情按钮绑定下标
$('[href="#modal-record"]').each(function(i, v){
$(v).attr('data-index', i);
});
//客户列表 缓存列表信息
localStorage.setItem('pc_userL_current_list', JSON.stringify(data.data.list));
var temp = document.getElementById('user_list_tpl').innerHTML; var temp = document.getElementById('user_list_tpl').innerHTML;
var doTtmpl = doT.template(temp); var doTtmpl = doT.template(temp);
$("#users_list").html(doTtmpl(data.data.list)); $("#users_list").html(doTtmpl(data.data.list));
......
...@@ -21,9 +21,9 @@ define(['doT', 'text!temp/user_model_template_tpl.html','css!style/home.css', 'c ...@@ -21,9 +21,9 @@ define(['doT', 'text!temp/user_model_template_tpl.html','css!style/home.css', 'c
_temp_follow_id = '',//临时的跟进id _temp_follow_id = '',//临时的跟进id
is_outpace_call_num = 1;//拨打电话0:未超过限制 1:超过限制 is_outpace_call_num = 1;//拨打电话0:未超过限制 1:超过限制
var cus_obj = JSON.parse(getUrlParam('data')); var cus_obj = JSON.parse(getUrlParam('data'));//获取链接上面数据
var idIndex = getUrlParam('idindex');//客户跟进列表
var idIndex = getUrlParam('idindex'); var idIndexUser = getUrlParam('idindex');//客户列表
var _tempUrl = parent.location.pathname; var _tempUrl = parent.location.pathname;
if((_tempUrl === '/index/users_list') || (_tempUrl === '/index/RemarkFollowList')){ if((_tempUrl === '/index/users_list') || (_tempUrl === '/index/RemarkFollowList')){
...@@ -367,7 +367,7 @@ define(['doT', 'text!temp/user_model_template_tpl.html','css!style/home.css', 'c ...@@ -367,7 +367,7 @@ define(['doT', 'text!temp/user_model_template_tpl.html','css!style/home.css', 'c
//初始化客户动态 带看动态两个表格切换 //初始化客户动态 带看动态两个表格切换
$('.follow-up-modal-list-area:nth-of-type(1)').show().siblings().hide(); $('.follow-up-modal-list-area:nth-of-type(1)').show().siblings().hide();
if(_tempUrl === '/index/users_list'){ if(_tempUrl === '/index/users_list'){
user.getInfor(); user.getInforNewUser();
}else if(_tempUrl === '/index/RemarkFollowList'){ }else if(_tempUrl === '/index/RemarkFollowList'){
user.getInforNew(); user.getInforNew();
}else{} }else{}
...@@ -380,7 +380,7 @@ define(['doT', 'text!temp/user_model_template_tpl.html','css!style/home.css', 'c ...@@ -380,7 +380,7 @@ define(['doT', 'text!temp/user_model_template_tpl.html','css!style/home.css', 'c
//初始化客户动态 带看动态两个表格切换 //初始化客户动态 带看动态两个表格切换
$('.follow-up-modal-list-area:nth-of-type(1)').show().siblings().hide(); $('.follow-up-modal-list-area:nth-of-type(1)').show().siblings().hide();
if(_tempUrl === '/index/users_list'){ if(_tempUrl === '/index/users_list'){
user.getInfor(); user.getInforNewUser();
}else if(_tempUrl === '/index/RemarkFollowList'){ }else if(_tempUrl === '/index/RemarkFollowList'){
user.getInforNew(); user.getInforNew();
}else{} }else{}
...@@ -1607,6 +1607,7 @@ define(['doT', 'text!temp/user_model_template_tpl.html','css!style/home.css', 'c ...@@ -1607,6 +1607,7 @@ define(['doT', 'text!temp/user_model_template_tpl.html','css!style/home.css', 'c
} }
}); });
}, },
//客户跟进 客户详情页 上一页下一页
getInforNew: function() { getInforNew: function() {
if(user_type == 'next'){ if(user_type == 'next'){
++idIndex; ++idIndex;
...@@ -1630,6 +1631,29 @@ define(['doT', 'text!temp/user_model_template_tpl.html','css!style/home.css', 'c ...@@ -1630,6 +1631,29 @@ define(['doT', 'text!temp/user_model_template_tpl.html','css!style/home.css', 'c
_tempUserId = _tempListObj[idIndex].id; _tempUserId = _tempListObj[idIndex].id;
}; };
var aa = location.origin + location.pathname + '?data=' + JSON.stringify(_tempListObj[idIndex]) + '&idindex='+ idIndex +'&id=' +_tempUserId; var aa = location.origin + location.pathname + '?data=' + JSON.stringify(_tempListObj[idIndex]) + '&idindex='+ idIndex +'&id=' +_tempUserId;
console.log(aa)
location.replace(aa);
}
},
//客户列表 客户详情页 上一页下一页
getInforNewUser: function() {
if(user_type == 'next'){
++idIndexUser;
}else{
--idIndexUser;
};
if(idIndexUser>14){
alert('请翻页');
idIndexUser = 14;
return false;
}else if(idIndexUser<0){
alert('请翻页');
idIndexUser = 0;
return false;
}else{
var _tempListObj = JSON.parse(localStorage.getItem('pc_userL_current_list'));
var _tempUserId = _tempListObj[idIndexUser].id;
var aa = location.origin + location.pathname + '?data=' + JSON.stringify(_tempListObj[idIndexUser]) + '&idindex='+ idIndexUser +'&id=' +_tempUserId;
location.replace(aa); location.replace(aa);
} }
}, },
......
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