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