Commit 22b30a9b authored by agping's avatar agping

业绩排行 修改

parent 03f7d12a
...@@ -21,6 +21,7 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'text!temp/r ...@@ -21,6 +21,7 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'text!temp/r
switchType:3, switchType:3,
district_store_agent_id:'', district_store_agent_id:'',
agent_id_choose:'', agent_id_choose:'',
order_ranking:'desc',
init: function() { init: function() {
//初始化dot //初始化dot
$(document.body).append(template + template_tax); $(document.body).append(template + template_tax);
...@@ -30,6 +31,9 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'text!temp/r ...@@ -30,6 +31,9 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'text!temp/r
event: function() { event: function() {
var _doc = $(document); var _doc = $(document);
$('.left-phone,#district_id,#guest_stores').hide();//初始化 隐藏 部门 门店的搜索 $('.left-phone,#district_id,#guest_stores').hide();//初始化 隐藏 部门 门店的搜索
$('#district_id').val('');//置空 部门 id
$('#guest_stores').val('');//置空 门店id
realtime.agent_id_choose='';//将业绩排行的 经纪人id置空
//二级联动 //二级联动
realtime.getDistrict(function(){//有了列表 点击 调用门店列表 realtime.getDistrict(function(){//有了列表 点击 调用门店列表
_doc.on('input', '#district_id', function(){ _doc.on('input', '#district_id', function(){
...@@ -38,7 +42,7 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'text!temp/r ...@@ -38,7 +42,7 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'text!temp/r
_this.next().html('');//先清空 _this.next().html('');//先清空
if(_id && _id != '0'){ if(_id && _id != '0'){
realtime.getDistrictStoreList(_id, function(_data){ realtime.getDistrictStoreList(_id, function(_data){
var _str = '<option value="0">选择门店</option>'; var _str = '<option value="">选择门店</option>';
$.each(_data, function(i,item) { $.each(_data, function(i,item) {
_str += '<option value="'+item.id+'">'+item.store_name+'</option>'; _str += '<option value="'+item.id+'">'+item.store_name+'</option>';
}); });
...@@ -69,13 +73,23 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'text!temp/r ...@@ -69,13 +73,23 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'text!temp/r
realtime.mainTabIndex = _this.index(); realtime.mainTabIndex = _this.index();
if(realtime.mainTabIndex == 0){ if(realtime.mainTabIndex == 0){
$('.left-phone,#district_id,#guest_stores').hide(); $('.left-phone,#district_id,#guest_stores').hide();
$('#district_id').val('');//置空 部门 id
$('#guest_stores').val('');//置空 门店id
realtime.agent_id_choose='';//将业绩排行的 经纪人id置空
} }
if(realtime.mainTabIndex == 1){ if(realtime.mainTabIndex == 1){
$('#district_id,#guest_stores').show(); $('#district_id,#guest_stores').show();
$('.left-phone').hide(); $('.left-phone').hide();
$('#district_id').val('');//置空 部门 id
$('#guest_stores').val('');//置空 门店id
realtime.agent_id_choose='';//将业绩排行的 经纪人id置空
}; };
if(realtime.mainTabIndex == 2){ if(realtime.mainTabIndex == 2){
$('.left-phone,#district_id,#guest_stores').show(); $('.left-phone,#district_id,#guest_stores').show();
$('#district_id').val('');//置空 部门 id
$('#guest_stores').val('');//置空 门店id
realtime.agent_id_choose='';//将业绩排行的 经纪人id置空
} }
realtime.getList(1); realtime.getList(1);
}); });
...@@ -169,6 +183,7 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'text!temp/r ...@@ -169,6 +183,7 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'text!temp/r
e.stopPropagation(); e.stopPropagation();
realtime.orderList=1; realtime.orderList=1;
realtime.getList(1); realtime.getList(1);
realtime.order_ranking='desc';
}); });
//倒序 //倒序
_doc.on('click', '.reverse-order-yeji', function(e) { _doc.on('click', '.reverse-order-yeji', function(e) {
...@@ -176,6 +191,8 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'text!temp/r ...@@ -176,6 +191,8 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'text!temp/r
e.stopPropagation(); e.stopPropagation();
realtime.orderList=0; realtime.orderList=0;
realtime.getList(1); realtime.getList(1);
realtime.order_ranking='asc';
}); });
//搜索的重置 //搜索的重置
...@@ -331,6 +348,11 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'text!temp/r ...@@ -331,6 +348,11 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'text!temp/r
'pageSize': realtime.pageSize, 'pageSize': realtime.pageSize,
'start_day':$('#maintable_create_time').val(), 'start_day':$('#maintable_create_time').val(),
'end_day':$('#maintable_end_time').val(), 'end_day':$('#maintable_end_time').val(),
'district_id':$('#district_id').val(),
'store_id':$('#guest_stores').val(),
'agent_id':realtime.agent_id_choose,
'order':realtime.order_ranking
}; };
$.ajax({ $.ajax({
type: 'GET', type: 'GET',
...@@ -345,12 +367,7 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'text!temp/r ...@@ -345,12 +367,7 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'text!temp/r
var tpl=realtime.switchTpl(); var tpl=realtime.switchTpl();
console.log(tpl); console.log(tpl);
var doTtmpl = doT.template(document.getElementById(tpl).innerHTML); var doTtmpl = doT.template(document.getElementById(tpl).innerHTML);
if(realtime.orderList==0){ $("#maintable_list").html(doTtmpl(data.data.list));
$("#maintable_list").html(doTtmpl(data.data.list.slice(0,20)));
}
if(realtime.orderList==1){
$("#maintable_list").html(doTtmpl(data.data.list.reverse().slice(0,20)));
}
//获取统计时间 //获取统计时间
$('#rank_start_day').html(data.data.start_time); $('#rank_start_day').html(data.data.start_time);
$('#rank_end_day').html(data.data.end_time); $('#rank_end_day').html(data.data.end_time);
......
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