Commit 17081b5a authored by agping's avatar agping

实时业绩修改

parent 2e77a22a
define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'css!style/home.css', 'css!style/report_list.css', 'ckfinder', 'ckfinderStart', 'pagination', 'bootstrapJs'], function(doT, template, template_tax, template_maid, template_maid_sub1) {
bargain = {
realtime = {
pageNo: 1,
/*第几页*/
pageSize: 10,
......@@ -7,12 +7,13 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'css!style/h
mainTabIndex: 0,
detailTabIndex: 0,
district_id: 0,//部门id
store_id: 0,//门店id
panfangData: null,
init: function() {
//初始化dot
$(document.body).append(template);
bargain.getList(1);
bargain.event();
realtime.getList(1);
realtime.event();
},
event: function() {
var _doc = $(document);
......@@ -22,9 +23,8 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'css!style/h
e.stopPropagation();
var _this = $(this);
_this.removeClass('btn-default').addClass('btn-info').siblings().removeClass('btn-info').addClass('btn-default');
bargain.mainTabIndex = _this.index();
console.log(bargain.mainTabIndex);
bargain.getList(1);
realtime.mainTabIndex = _this.index();
realtime.getList(1);
});
//点击今天按钮事件 的搜素
_doc.on('click', '#maintable_today', function(e){
......@@ -46,26 +46,28 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'css!style/h
var currentdate_=getNowFormatDate();
$("#maintable_create_time").val(currentdate_);
$("#maintable_end_time").val(currentdate_);
bargain.getList(1);
realtime.getList(1);
});
//点击 部门排行 的部门名字
_doc.on('click', '.store-ranking', function(e){
e.preventDefault();
e.stopPropagation();
bargain.getListStore(1);
realtime.district_id = $(this).attr("data-id");
realtime.getListStore(1);
});
//点击 门店排行 的门店名字
_doc.on('click', '.agent-ranking', function(e){
e.preventDefault();
e.stopPropagation();
bargain.getListAgent(1);
realtime.store_id = $(this).attr("data-id");
realtime.getListAgent(1);
});
//搜索按钮的事件
_doc.on('click', '#maintable_search', function(e) {
e.preventDefault();
e.stopPropagation();
bargain.getList(1); //一级审核搜索
realtime.getList(1); //一级审核搜索
});
//搜索的重置
......@@ -106,8 +108,8 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'css!style/h
var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo'))); //读取缓存
var params = {
'pageNo': pageNo,
'pageSize': bargain.pageSize,
'type':bargain.switchType(),
'pageSize': realtime.pageSize,
'type':realtime.switchType(),
'AuthToken':user_info_obj.AuthToken,
'agent_id':user_info_obj.id,
'start_day':$('#maintable_create_time').val(),
......@@ -125,7 +127,7 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'css!style/h
success: function(data) {
if(typeof data === 'object') {
if(data.code == 200) {
var tpl=bargain.switchTpl();
var tpl=realtime.switchTpl();
console.log(tpl);
var doTtmpl = doT.template(document.getElementById(tpl).innerHTML);
$("#maintable_list").html(doTtmpl(data.data));
......@@ -133,7 +135,7 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'css!style/h
$('#rank_start_day').html(data.data.start_time);
$('#rank_end_day').html(data.data.end_time);
/*分页代码*/
add_page(data.data.total, pageNo, bargain.pageSize, bargain.getList);
add_page(data.data.total, pageNo, realtime.pageSize, realtime.getList);
} else {
alert(data['msg']);
......@@ -158,16 +160,17 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'css!style/h
var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo'))); //读取缓存
var params = {
'pageNo': pageNo,
'pageSize': bargain.pageSize,
'type':bargain.switchType(),
'pageSize': realtime.pageSize,
'type':realtime.switchType(),
'AuthToken':user_info_obj.AuthToken,
'agent_id':user_info_obj.id,
'start_day':$('#maintable_create_time').val(),
'end_day':$('#maintable_end_time').val(),
'request_source_type':1,
'second_select':1,
'second_id':0,
'second_id':realtime.district_id
};
console.log(realtime.district_id);
$.ajax({
type: 'GET',
url: '/broker/selectPerformanceByTime',
......@@ -204,12 +207,19 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'css!style/h
console.count('bar');
var params = {
'pageNo': pageNo,
'pageSize': bargain.pageSize,
'pageSize': realtime.pageSize,
'type':realtime.switchType(),
'AuthToken':user_info_obj.AuthToken,
'agent_id':user_info_obj.id,
'start_day':$('#maintable_create_time').val(),
'end_day':$('#maintable_end_time').val(),
'request_source_type':1,
'second_select':1,
'second_id':realtime.store_id
};
$.ajax({
type: 'GET',
url: bargain.switchUrl(),
url: '/broker/selectPerformanceByTime',
data: params,
timeout: 30000,
dataType: 'json',
......@@ -217,7 +227,7 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'css!style/h
success: function(data) {
if(typeof data === 'object') {
if(data.code == 200) {
var tpl=bargain.switchTpl();
var tpl=realtime.switchTpl();
console.log(tpl);
var doTtmpl = doT.template(document.getElementById('agent_list_tpl').innerHTML);
$("#agent_details_list").html(doTtmpl(data.data));
......@@ -240,5 +250,5 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'css!style/h
});
}
};
return bargain;
return realtime;
});
\ No newline at end of file
......@@ -18,7 +18,7 @@
<tr data-id="[%= it['list'][item]['district_id'] %]">
<td class="text-center">[%= it["list"][item]['index_'] %]</td>
<td class="text-center">
<a class="store-ranking" href="#modal-store" data-toggle="modal">[%= it["list"][item]['district_name']+'-'+it["list"][item]['name'] %]</a>
<a class="store-ranking" href="#modal-store" data-toggle="modal" data-id="[%= it['list'][item]['district_id'] %]">[%= it["list"][item]['district_name']+'-'+it["list"][item]['name'] %]</a>
</td>
<td class="text-center">[%= it["list"][item]['performance_total'] %]</td>
<td class="text-center">[%= it["list"][item]['bargain_sum'] %]</td>
......@@ -55,10 +55,10 @@
<th class="text-center">团队人数</th>
</tr>
[% for(var item in it["list"]){ %]
<tr data-id="[%= it['list'][item]['id'] %]" data-orderid="[%= it['list'][item]['order_id'] %]">
<tr>
<td class="text-center">[%= it["list"][item]['index_'] %]</td>
<td class="text-center">
<a class="store-ranking" href="#modal-store" data-toggle="modal">[%= it["list"][item]['district_name']+'-'+it["list"][item]['store_name']+'-'+it["list"][item]['name'] %]</a>
<a class="store-ranking" href="#modal-store" data-toggle="modal" data-id="[%= it['list'][item]['store_id'] %]">[%= it["list"][item]['district_name']+'-'+it["list"][item]['store_name']+'-'+it["list"][item]['name'] %]</a>
</td>
<td class="text-center">[%= it["list"][item]['performance_total'] %]</td>
<td class="text-center">[%= it["list"][item]['bargain_sum'] %]</td>
......
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