Commit e76a4be8 authored by agping's avatar agping

拨打电话 优化

parent aa54a7de
...@@ -289,6 +289,18 @@ ...@@ -289,6 +289,18 @@
font-size: 20px; font-size: 20px;
font-weight: 700; font-weight: 700;
} }
/*加载图标*/
#main_loading_pic {
position: fixed;
top: 50%;
left: 50%;
width: 100px;
height: 100px;
margin-left: 50px;
margin-top: -100px;
overflow: hidden;
display: none;
}
</style> </style>
<div id="page-content-wrapper"> <div id="page-content-wrapper">
<div class="container"> <div class="container">
...@@ -692,4 +704,7 @@ ...@@ -692,4 +704,7 @@
</div> </div>
<div id="close_btn"><img src="/app/images/ic_cha.png" /></div> <div id="close_btn"><img src="/app/images/ic_cha.png" /></div>
</div> </div>
<!--加载图标-->
<div id="main_loading_pic">
<img src="/resource/image/jz2.gif">
</div>
...@@ -47,7 +47,6 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -47,7 +47,6 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
init: function() { init: function() {
//初始化dot //初始化dot
$("body").append(template); $("body").append(template);
//初始化时间 //初始化时间
var myDate = new Date(); var myDate = new Date();
var y = myDate.getFullYear(); var y = myDate.getFullYear();
...@@ -55,7 +54,7 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -55,7 +54,7 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
var d = myDate.getDate(); var d = myDate.getDate();
var day_end = y + '-' + (m < 10 ? ('0' + m) : m) + '-' + (d < 10 ? ('0' + d) : d); var day_end = y + '-' + (m < 10 ? ('0' + m) : m) + '-' + (d < 10 ? ('0' + d) : d);
$('#start_date').val(day_end); $('#start_date').val(day_end);
$('#end_date').val(day_end);//商铺跟进 添加 默认时间 一个月 $('#end_date').val(day_end);//客户跟进 添加 默认时间一天
//初始化城市 区域筛选 //初始化城市 区域筛选
user.initializationCityFunction(); user.initializationCityFunction();
user.event(); user.event();
...@@ -1474,14 +1473,13 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css' ...@@ -1474,14 +1473,13 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
$.trim(_customerPhoneObj.val()) != '' && (params.phone = $.trim(_customerPhoneObj.val())); $.trim(_customerPhoneObj.val()) != '' && (params.phone = $.trim(_customerPhoneObj.val()));
$.trim(_followContentObj.val()) != '' && (params.content = $.trim(_followContentObj.val())); $.trim(_followContentObj.val()) != '' && (params.content = $.trim(_followContentObj.val()));
if(!$('#start_date').val() || !$('#end_date').val()){ if(!$('#start_date').val() || !$('#end_date').val()){
alert('请您选择搜索时间!'); alert('请您选择跟进时间!');
return; return;
}; };
var start_ = params.start_date+" 00:00:00"; var start_ = params.start_date+" 00:00:00";
date_start =new Date(Date.parse(start_.replace(/-/g, "/"))); date_start =new Date(Date.parse(start_.replace(/-/g, "/")));
var start_time =date_start.getTime(); var start_time =date_start.getTime();
var end_ = params.end_date+" 00:00:00"; var end_ = params.end_date+" 00:00:00";
date_end =new Date(Date.parse(end_.replace(/-/g, "/"))); date_end =new Date(Date.parse(end_.replace(/-/g, "/")));
var end_time =date_end.getTime(); var end_time =date_end.getTime();
var cha_time=end_time-start_time; var cha_time=end_time-start_time;
......
...@@ -40,6 +40,14 @@ define(['doT', 'text!temp/callPhone_template_tpl.html', 'css!style/home.css', 'c ...@@ -40,6 +40,14 @@ define(['doT', 'text!temp/callPhone_template_tpl.html', 'css!style/home.css', 'c
init: function() { init: function() {
//初始化dot //初始化dot
$("body").append(template); $("body").append(template);
//初始化时间
var myDate = new Date();
var y = myDate.getFullYear();
var m = myDate.getMonth() + 1;
var d = myDate.getDate();
var day_end = y + '-' + (m < 10 ? ('0' + m) : m) + '-' + (d < 10 ? ('0' + d) : d);
$('#start_date').val(day_end);
$('#end_date').val(day_end);//客户跟进 添加 默认时间一天
user.getList(); user.getList();
user.event(); user.event();
//时间控件初始化 //时间控件初始化
...@@ -1305,30 +1313,48 @@ define(['doT', 'text!temp/callPhone_template_tpl.html', 'css!style/home.css', 'c ...@@ -1305,30 +1313,48 @@ define(['doT', 'text!temp/callPhone_template_tpl.html', 'css!style/home.css', 'c
params.call_style = $("#call_style").val(); params.call_style = $("#call_style").val();
params.ali_yun_phone = $("#ali_yun_phone").val(); params.ali_yun_phone = $("#ali_yun_phone").val();
params.users_id = $("#user_id").val();//客户id精确搜索 params.users_id = $("#user_id").val();//客户id精确搜索
//通话记录 时间搜索 必须选择时间
$.ajax ({ if(!$('#start_date').val() || !$('#end_date').val()){
alert('请您选择拨打时间!');
return;
};
//通话记录 时间控制30天之内
var start_ = params.start_date+" 00:00:00";
date_start =new Date(Date.parse(start_.replace(/-/g, "/")));
var start_time =date_start.getTime();
var end_ = params.end_date+" 00:00:00";
date_end =new Date(Date.parse(end_.replace(/-/g, "/")));
var end_time =date_end.getTime();
var cha_time=end_time-start_time;
if(cha_time > 2678400000){
alert("跟进时间搜索控制在30天以内");
return;
}
if(!user.isAjaxSaving){
user.isAjaxSaving = true;
$.ajax ({
url: '/index/callLog',//获取列表 url: '/index/callLog',//获取列表
type: 'GET', type: 'GET',
async: true, async: true,
data: params, data: params,
dataType: 'json', dataType: 'json',
beforeSend: function() {
$('#main_loading_pic').show();
},
success: function (data) { success: function (data) {
var temp = document.getElementById ('callPhone_list_tpl').innerHTML; var temp = document.getElementById ('callPhone_list_tpl').innerHTML;
var doTtmpl = doT.template (temp); var doTtmpl = doT.template (temp);
$ ("#callPhone_list").html (doTtmpl (data.data.list)); $ ("#callPhone_list").html (doTtmpl (data.data.list));
/*分页代码*/ /*分页代码*/
add_page(data.data.total,pageNo,user.pageSize,user.getList); add_page(data.data.total,pageNo,user.pageSize,user.getList);
/*$ ("#pagediv").pagination ({ },
length: data.data.total, complete: function(){
current: pageNo, user.isAjaxSaving = false;//请求结束,再改为初始状态
every: callphone.pageSize, $('#main_loading_pic').hide();
onClick: function (el) { }
callphone.getList (el.num.current);
}
});*/
}
}); });
}
}, },
//获取站点 标签 (编辑) //获取站点 标签 (编辑)
getSiteTagsEdit: function() { getSiteTagsEdit: function() {
......
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