Commit d8a6b3e6 authored by agping's avatar agping

业绩排行修改

parent 23aab49b
...@@ -4,6 +4,11 @@ ...@@ -4,6 +4,11 @@
.left{ .left{
float: left; float: left;
} }
.modal-body-width{
width: 800px;
height: 900px;
overflow-y: scroll;
}
</style> </style>
<div id="page-content-wrapper"> <div id="page-content-wrapper">
...@@ -21,7 +26,7 @@ ...@@ -21,7 +26,7 @@
<table class="table table-striped table-bordered table-hover table-condensed"> <table class="table table-striped table-bordered table-hover table-condensed">
<thead> <thead>
<tr> <tr>
<td colspan="9" class="maintable-top-sub-tr"> <td colspan="10" class="maintable-top-sub-tr">
<a class="btn btn-info liudan_pic_btn">部门业绩排行榜</a> <a class="btn btn-info liudan_pic_btn">部门业绩排行榜</a>
<a class="btn btn-default liudan_pic_btn">门店业绩排行榜</a> <a class="btn btn-default liudan_pic_btn">门店业绩排行榜</a>
<a class="btn btn-default liudan_pic_btn">个人业绩排行榜</a> <a class="btn btn-default liudan_pic_btn">个人业绩排行榜</a>
...@@ -29,7 +34,7 @@ ...@@ -29,7 +34,7 @@
</tr> </tr>
<!--三级审核的搜索功能--> <!--三级审核的搜索功能-->
<tr> <tr>
<td colspan="9"> <td colspan="10">
<form id="maintable_form_search"> <form id="maintable_form_search">
<span class="btn btn-primary btn3 left" id="maintable_month">本月</span> <span class="btn btn-primary btn3 left" id="maintable_month">本月</span>
<span class="btn btn-primary btn3 left" id="maintable_today">今天</span> <span class="btn btn-primary btn3 left" id="maintable_today">今天</span>
...@@ -43,16 +48,6 @@ ...@@ -43,16 +48,6 @@
</form> </form>
</td> </td>
</tr> </tr>
<tr class="maintable-tr-bar">
<th class="text-center">提交时间</th>
<th class="text-center">是否开业</th>
<th class="text-center">商铺地址</th>
<th class="text-center">商铺号</th>
<th class="text-center">成交客户</th>
<th class="text-center">客户电话</th>
<th class="text-center">成交类型</th>
<th class="text-center">应收佣金(元)</th>
</tr>
</thead> </thead>
<tbody class="text-center" id="maintable_list"> <tbody class="text-center" id="maintable_list">
...@@ -69,4 +64,48 @@ ...@@ -69,4 +64,48 @@
</div> </div>
</div> </div>
</div>
<!-- 弹出框 门店业绩排行 详情 -->
<div class="modal fade" id="modal-store" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content modal-body-width">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
×
</button>
<h4 class="modal-title">
时间:2018.02.08-2018.02.28
</h4>
</div>
<div class="modal-body">
<table class="table table-striped table-bordered table-hover table-condensed">
<tbody class="text-center" id="store_details_list">
</tbody>
</table>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal -->
</div>
<!-- 弹出框 经纪人业绩排行 详情 -->
<div class="modal fade" id="modal-agent" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content modal-body-width">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
×
</button>
<h4 class="modal-title">
时间:2018.02.08-2018.02.28
</h4>
</div>
<div class="modal-body">
<table class="table table-striped table-bordered table-hover table-condensed">
<tbody class="text-center" id="agent_details_list">
</tbody>
</table>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal -->
</div> </div>
\ No newline at end of file
...@@ -24,12 +24,24 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'css!style/h ...@@ -24,12 +24,24 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'css!style/h
e.preventDefault(); e.preventDefault();
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(); bargain.mainTabIndex = _this.index();
console.log(bargain.mainTabIndex); console.log(bargain.mainTabIndex);
bargain.getList(1); bargain.getList(1);
}); });
//点击 部门排行 的部门名字
_doc.on('click', '.store-ranking', function(e){
e.preventDefault();
e.stopPropagation();
bargain.getListStore(1);
});
//点击 门店排行 的门店名字
_doc.on('click', '.agent-ranking', function(e){
e.preventDefault();
e.stopPropagation();
bargain.getListAgent(1);
});
//搜索按钮的事件 //搜索按钮的事件
_doc.on('click', '#maintable_search', function(e) { _doc.on('click', '#maintable_search', function(e) {
...@@ -49,11 +61,11 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'css!style/h ...@@ -49,11 +61,11 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'css!style/h
switchTpl: function(){ switchTpl: function(){
switch (Number(this.mainTabIndex)){ switch (Number(this.mainTabIndex)){
case 0: case 0:
return 'realtimePerformance_list_tpl_one'; return 3;
case 1: case 1:
return 'realtimePerformance_list_tpl_two'; return 2;
case 2: case 2:
return 'realtimePerformance_list_tpl_three'; return 1;
default: default:
return ''; return '';
} }
...@@ -76,16 +88,12 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'css!style/h ...@@ -76,16 +88,12 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'css!style/h
var params = { var params = {
'pageNo': pageNo, 'pageNo': pageNo,
'pageSize': bargain.pageSize, 'pageSize': bargain.pageSize,
'shop_type': $('#maintable_shop_type').val(), 'type':bargain.switchUrl(),
'create_time': $.trim($('#maintable_create_time').val()),
'end_time': $.trim($('#maintable_end_time').val()),
'internal_address': $.trim($('#maintable_internal_address').val()),
'user_phone': $.trim($('#maintable_user_phone').val()),
'house_number': $.trim($('#maintable_shop_num').val())
}; };
$.ajax({ $.ajax({
type: 'GET', type: 'GET',
url: bargain.switchUrl(), // url: bargain.switchUrl(),
url: /broker/selectPerformanceByTime,
data: params, data: params,
timeout: 30000, timeout: 30000,
dataType: 'json', dataType: 'json',
...@@ -97,7 +105,6 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'css!style/h ...@@ -97,7 +105,6 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'css!style/h
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));
// var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo')));
/*分页代码*/ /*分页代码*/
add_page(data.data.total, pageNo, bargain.pageSize, bargain.getList); add_page(data.data.total, pageNo, bargain.pageSize, bargain.getList);
...@@ -117,6 +124,88 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'css!style/h ...@@ -117,6 +124,88 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'css!style/h
}; };
} }
}); });
},
//获取门店排行详情
getListStore: function(pageNo){
console.count('bar');
var params = {
'pageNo': pageNo,
'pageSize': bargain.pageSize,
};
$.ajax({
type: 'GET',
url: bargain.switchUrl(),
data: params,
timeout: 30000,
dataType: 'json',
beforeSend: function() {},
success: function(data) {
if(typeof data === 'object') {
if(data.code == 200) {
var tpl=bargain.switchTpl();
console.log(tpl);
var doTtmpl = doT.template(document.getElementById('store_list_tpl').innerHTML);
$("#store_details_list").html(doTtmpl(data.data));
} else {
alert(data['msg']);
};
} else {
alert('数据错误');
};
},
error: function() {
alert('error');
},
complete: function(xhr, textStatus) {
if(textStatus === 'timeout') {
alert('请求超时');
};
}
});
},
//获取经纪人详情
getListAgent: function(pageNo){
console.count('bar');
var params = {
'pageNo': pageNo,
'pageSize': bargain.pageSize,
};
$.ajax({
type: 'GET',
url: bargain.switchUrl(),
data: params,
timeout: 30000,
dataType: 'json',
beforeSend: function() {},
success: function(data) {
if(typeof data === 'object') {
if(data.code == 200) {
var tpl=bargain.switchTpl();
console.log(tpl);
var doTtmpl = doT.template(document.getElementById('agent_list_tpl').innerHTML);
$("#agent_details_list").html(doTtmpl(data.data));
} else {
alert(data['msg']);
};
} else {
alert('数据错误');
};
},
error: function() {
alert('error');
},
complete: function(xhr, textStatus) {
if(textStatus === 'timeout') {
alert('请求超时');
};
}
});
} }
}; };
return bargain; return bargain;
......
<!--部门业绩排行-->
<script id="realtimePerformance_list_tpl_one" type="text/template"> <script id="realtimePerformance_list_tpl_one" type="text/template">
[% if(it["list"] && it["list"].length && it["list"].length>0) { %] [% if(it["list"] && it["list"].length && it["list"].length>0) { %]
<tr> <tr class="maintable-tr-bar">
<td>1</td> <th class="text-center">部门</th>
<tr> <th class="text-center">业绩(元)</th>
<th class="text-center">成交报告(出租)</th>
<th class="text-center">成交报告(其他)</th>
<th class="text-center">收款数</th>
<th class="text-center">进场数</th>
<th class="text-center">报备数</th>
<th class="text-center">新增商铺</th>
<th class="text-center">新增客户</th>
<th class="text-center">团队人数</th>
</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 data-id="[%= it['list'][item]['id'] %]" data-orderid="[%= it['list'][item]['order_id'] %]">
<td class="text-center" width="10%">[%= it["list"][item]['create_time'] %]</td> <td class="text-center">
<td class="text-center" width="8%">[%= it["list"][item]['is_open']?'是':'否' %]</td> <a class="store-ranking" href="#modal-store" data-toggle="modal">[%= it["list"][item]['create_time'] %]</a>
<td class="text-left">[%= it["list"][item]['internal_address'] %]</td> </td>
<td class="text-center">[%= it["list"][item]['is_open']?'是':'否' %]</td>
<td class="text-center">[%= it["list"][item]['internal_address'] %]</td>
<td class="text-center">[%= it["list"][item]['house_number'] %]</td> <td class="text-center">[%= it["list"][item]['house_number'] %]</td>
<td class="text-center">[%= it["list"][item]['user_name'] %]</td> <td class="text-center">[%= it["list"][item]['user_name'] %]</td>
<td class="text-center">[%= hideTel(it["list"][item]['user_phone']) %]</td> <td class="text-center">[%= hideTel(it["list"][item]['user_phone']) %]</td>
<td class="text-center">[%= it["list"][item]['trade_type'] %]</td> <td class="text-center">[%= it["list"][item]['trade_type'] %]</td>
<td class="text-center">[%= it["list"][item]['commission'] %]</td> <td class="text-center">[%= it["list"][item]['commission'] %]</td>
<td class="text-center">[%= it["list"][item]['trade_type'] %]</td>
<td class="text-center">[%= it["list"][item]['commission'] %]</td>
</tr> </tr>
[% } %] [% } %]
[% }else{ %] [% }else{ %]
<tr> <tr>
<td colspan="8" style="text-align:center;"> 暂无数据</td> <td colspan="10" style="text-align:center;"> 暂无数据</td>
</tr> </tr>
[% } %] [% } %]
</script> </script>
<!--门店业绩排行-->
<script id="realtimePerformance_list_tpl_two" type="text/template"> <script id="realtimePerformance_list_tpl_two" type="text/template">
[% if(it["list"] && it["list"].length && it["list"].length>0) { %] [% if(it["list"] && it["list"].length && it["list"].length>0) { %]
<tr> <tr class="maintable-tr-bar">
<td>2</td> <td class="text-center">门店</td>
<tr> <th class="text-center">业绩(元)</th>
<th class="text-center">成交报告(出租)</th>
<th class="text-center">成交报告(其他)</th>
<th class="text-center">收款数</th>
<th class="text-center">进场数</th>
<th class="text-center">报备数</th>
<th class="text-center">新增商铺</th>
<th class="text-center">新增客户</th>
<th class="text-center">团队人数</th>
</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 data-id="[%= it['list'][item]['id'] %]" data-orderid="[%= it['list'][item]['order_id'] %]">
<td class="text-center" width="10%">[%= it["list"][item]['create_time'] %]</td> <td class="text-center">
<td class="text-center" width="8%">[%= it["list"][item]['is_open']?'是':'否' %]</td> <a class="agent-ranking" href="#modal-agent" data-toggle="modal">[%= it["list"][item]['create_time'] %]</a>
<td class="text-left">[%= it["list"][item]['internal_address'] %]</td> </td>
<td class="text-center">[%= it["list"][item]['is_open']?'是':'否' %]</td>
<td class="text-center">[%= it["list"][item]['internal_address'] %]</td>
<td class="text-center">[%= it["list"][item]['house_number'] %]</td> <td class="text-center">[%= it["list"][item]['house_number'] %]</td>
<td class="text-center">[%= it["list"][item]['user_name'] %]</td> <td class="text-center">[%= it["list"][item]['user_name'] %]</td>
<td class="text-center">[%= hideTel(it["list"][item]['user_phone']) %]</td> <td class="text-center">[%= hideTel(it["list"][item]['user_phone']) %]</td>
<td class="text-center">[%= it["list"][item]['trade_type'] %]</td> <td class="text-center">[%= it["list"][item]['trade_type'] %]</td>
<td class="text-center">[%= it["list"][item]['commission'] %]</td> <td class="text-center">[%= it["list"][item]['commission'] %]</td>
<td class="text-center">[%= it["list"][item]['trade_type'] %]</td>
<td class="text-center">[%= it["list"][item]['commission'] %]</td>
</tr> </tr>
[% } %] [% } %]
[% }else{ %] [% }else{ %]
<tr> <tr>
<td colspan="8" style="text-align:center;"> 暂无数据</td> <td colspan="10" style="text-align:center;"> 暂无数据</td>
</tr> </tr>
[% } %] [% } %]
</script> </script>
<!--个人业绩排行-->
<script id="realtimePerformance_list_tpl_three" type="text/template"> <script id="realtimePerformance_list_tpl_three" type="text/template">
[% if(it["list"] && it["list"].length && it["list"].length>0) { %] [% if(it["list"] && it["list"].length && it["list"].length>0) { %]
<tr class="maintable-tr-bar">
<th class="text-center">经纪人</th>
<th class="text-center">业绩(元)</th>
<th class="text-center">成交报告(出租)</th>
<th class="text-center">成交报告(其他)</th>
<th class="text-center">收款数</th>
<th class="text-center">进场数</th>
<th class="text-center">报备数</th>
<th class="text-center">新增商铺</th>
<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'] %]">
<td class="text-center">[%= it["list"][item]['create_time'] %]</td>
<td class="text-center">[%= it["list"][item]['is_open']?'是':'否' %]</td>
<td class="text-center">[%= it["list"][item]['internal_address'] %]</td>
<td class="text-center">[%= it["list"][item]['house_number'] %]</td>
<td class="text-center">[%= it["list"][item]['user_name'] %]</td>
<td class="text-center">[%= hideTel(it["list"][item]['user_phone']) %]</td>
<td class="text-center">[%= it["list"][item]['trade_type'] %]</td>
<td class="text-center">[%= it["list"][item]['commission'] %]</td>
<td class="text-center">[%= it["list"][item]['commission'] %]</td>
</tr>
[% } %]
[% }else{ %]
<tr> <tr>
<td>3</td> <td colspan="10" style="text-align:center;"> 暂无数据</td>
<tr> </tr>
[% } %]
</script>
<!--门店业绩 详情-->
<script id="store_list_tpl" type="text/template">
[% if(it["list"] && it["list"].length && it["list"].length>0) { %]
<tr>
<th class="text-center">门店</th>
<th class="text-center">业绩(元)</th>
<th class="text-center">收款数</th>
<th class="text-center">进场数</th>
<th class="text-center">报备数</th>
<th class="text-center">新增商铺</th>
<th class="text-center">新增客户</th>
<th class="text-center">团队人数</th>
</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 data-id="[%= it['list'][item]['id'] %]" data-orderid="[%= it['list'][item]['order_id'] %]">
<td class="text-center" width="10%">[%= it["list"][item]['create_time'] %]</td> <td class="text-center">[%= it["list"][item]['create_time'] %]</td>
<td class="text-center" width="8%">[%= it["list"][item]['is_open']?'是':'否' %]</td> <td class="text-center">[%= it["list"][item]['is_open']?'是':'否' %]</td>
<td class="text-left">[%= it["list"][item]['internal_address'] %]</td> <td class="text-center">[%= it["list"][item]['internal_address'] %]</td>
<td class="text-center">[%= it["list"][item]['house_number'] %]</td> <td class="text-center">[%= it["list"][item]['house_number'] %]</td>
<td class="text-center">[%= it["list"][item]['user_name'] %]</td> <td class="text-center">[%= it["list"][item]['user_name'] %]</td>
<td class="text-center">[%= hideTel(it["list"][item]['user_phone']) %]</td> <td class="text-center">[%= hideTel(it["list"][item]['user_phone']) %]</td>
...@@ -63,8 +136,42 @@ ...@@ -63,8 +136,42 @@
[% } %] [% } %]
[% }else{ %] [% }else{ %]
<tr> <tr>
<td colspan="8" style="text-align:center;"> 暂无数据</td> <td colspan="10" style="text-align:center;"> 暂无数据</td>
</tr> </tr>
[% } %] [% } %]
</script> </script>
<!--个人业绩 详情-->
<script id="agent_list_tpl" type="text/template">
[% if(it["list"] && it["list"].length && it["list"].length>0) { %]
<tr>
<th class="text-center">经纪人</th>
<th class="text-center">业绩(元)</th>
<th class="text-center">收款数</th>
<th class="text-center">进场数</th>
<th class="text-center">报备数</th>
<th class="text-center">新增商铺</th>
<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'] %]">
<td class="text-center">[%= it["list"][item]['create_time'] %]</td>
<td class="text-center">[%= it["list"][item]['is_open']?'是':'否' %]</td>
<td class="text-center">[%= it["list"][item]['internal_address'] %]</td>
<td class="text-center">[%= it["list"][item]['house_number'] %]</td>
<td class="text-center">[%= it["list"][item]['user_name'] %]</td>
<td class="text-center">[%= hideTel(it["list"][item]['user_phone']) %]</td>
<td class="text-center">[%= it["list"][item]['trade_type'] %]</td>
<td class="text-center">[%= it["list"][item]['commission'] %]</td>
<td class="text-center">[%= it["list"][item]['commission'] %]</td>
</tr>
[% } %]
[% }else{ %]
<tr>
<td colspan="10" style="text-align:center;"> 暂无数据</td>
</tr>
[% } %]
</script>
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