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