Commit 6ebcd31a authored by agping's avatar agping

优化

parent 28b8b8e8
......@@ -48,15 +48,15 @@ class Transfer extends Basic
$where = array();
if (!empty($params['start_date']) && empty($params['end_date'])) {
$where['a.create_time'] = ['> time', $params['start_date']];
$where['a.create_time'] = ['> time', $params['start_date'] . '00:00:00'];
}
if (!empty($params['end_date']) && empty($params['start_date'])) {
$where['a.create_time'] = ['< time', $params['end_date']];
$where['a.create_time'] = ['< time', $params['end_date']. '23:59:59'];
}
if (!empty($params['start_date']) && !empty($params['end_date'])) {
$where['a.create_time'] = ['between time', [$params['start_date'],$params['end_date']]];
$where['a.create_time'] = ['between time', [$params['start_date'] . '00:00:00',$params['end_date'] . '23:59:59']];
}
if (!empty($params['name'])) {
......
......@@ -5,14 +5,18 @@
float: left;
}
.modal-body-width{
width: 900px;
height: 800px;
overflow-y: scroll;
}
/*二级弹窗*/
.modal-body-width-two{
width: 800px;
height: 900px;
height: 700px;
overflow-y: scroll;
}
#rank_start_day,#rank_end_day,#performance_ranking{
font-size: 16px;
/*font-weight: 600;*/
}
</style>
......@@ -80,7 +84,7 @@
×
</button>
<h4 class="modal-title">
时间门店:2018.02.08-2018.02.28
<a href="#"><span id="performance_ranking">时间:</span>&nbsp;&nbsp;&nbsp;&nbsp;<span id="rank_start_day_store"></span>&nbsp;&nbsp;<span id="rank_end_day_store"></span></a>
</h4>
</div>
<div class="modal-body">
......@@ -93,6 +97,7 @@
</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">
......@@ -102,7 +107,7 @@
×
</button>
<h4 class="modal-title">
时间经纪人:2018.02.08-2018.02.28
<a href="#"><span id="performance_ranking_agent">时间:</span>&nbsp;&nbsp;&nbsp;&nbsp;<span id="rank_start_day_agent"></span>&nbsp;&nbsp;<span id="rank_end_day_agent"></span></a>
</h4>
</div>
<div class="modal-body">
......@@ -115,21 +120,22 @@
</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 fade" id="modal-agent-two" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content modal-body-width">
<div class="modal-content modal-body-width-two">
<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
<a href="#"><span id="performance_ranking_agent_two">时间:</span>&nbsp;&nbsp;&nbsp;&nbsp;<span id="rank_start_day_agent_two"></span>&nbsp;&nbsp;<span id="rank_end_day_agent_two"></span></a>
</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 class="text-center" id="agent_details_list_two">
</tbody>
</table>
......
......@@ -8,6 +8,7 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'css!style/h
detailTabIndex: 0,
district_id: 0,//部门id
store_id: 0,//门店id
store_id_Two: 0,//二级门店id
panfangData: null,
init: function() {
//初始化dot
......@@ -63,6 +64,14 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'css!style/h
realtime.store_id = $(this).attr("data-id");
realtime.getListAgent(1);
});
//点击 门店二级排行 的门店名字
_doc.on('click', '.store-ranking-two', function(e){
e.preventDefault();
e.stopPropagation();
realtime.store_id_Two = $(this).attr("data-id");
realtime.getListAgentTwo(1);
});
//搜索按钮的事件
_doc.on('click', '#maintable_search', function(e) {
e.preventDefault();
......@@ -174,6 +183,9 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'css!style/h
if(data.code == 200) {
var doTtmpl = doT.template(document.getElementById('store_list_tpl').innerHTML);
$("#store_details_list").html(doTtmpl(data.data));
//获取统计时间
$('#rank_start_day_store').html(data.data.start_time);
$('#rank_end_day_store').html(data.data.end_time);
} else {
alert(data['msg']);
......@@ -218,6 +230,55 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'css!style/h
console.log(tpl);
var doTtmpl = doT.template(document.getElementById('agent_list_tpl').innerHTML);
$("#agent_details_list").html(doTtmpl(data.data));
//获取统计时间
$('#rank_start_day_agent').html(data.data.start_time);
$('#rank_end_day_agent').html(data.data.end_time);
} else {
alert(data['msg']);
};
} else {
alert('数据错误');
};
},
error: function() {
alert('error');
},
complete: function(xhr, textStatus) {
if(textStatus === 'timeout') {
alert('请求超时');
};
}
});
},
//获取经纪人(点击弹窗里的 门店 获取的)详情
getListAgentTwo: function(pageNo){
console.count('bar');
var params = {
'pageNo': pageNo,
'pageSize': realtime.pageSize,
'father_id': realtime.store_id_Two,
'start_day':$('#maintable_create_time').val(),
'end_day':$('#maintable_end_time').val(),
};
$.ajax({
type: 'GET',
url: '/index/selectIndividualPerformance',
data: params,
timeout: 30000,
dataType: 'json',
beforeSend: function() {},
success: function(data) {
if(typeof data === 'object') {
if(data.code == 200) {
var tpl=realtime.switchTpl();
console.log(tpl);
var doTtmpl = doT.template(document.getElementById('agent_list_two_tpl').innerHTML);
$("#agent_details_list_two").html(doTtmpl(data.data));
//获取统计时间
$('#rank_start_day_agent_two').html(data.data.start_time);
$('#rank_end_day_agent_two').html(data.data.end_time);
} else {
alert(data['msg']);
......
......@@ -58,7 +58,7 @@
<tr>
<td class="text-center">[%= it["list"][item]['index_'] %]</td>
<td class="text-center">
<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>
<a class="agent-ranking" href="#modal-agent" 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>
......@@ -134,7 +134,7 @@
<tr data-id="[%= it['list'][item]['id'] %]" data-orderid="[%= it['list'][item]['order_id'] %]">
<td class="text-center">[%= it["list"][item]['index_'] %]</td>
<td class="text-center">
<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>
<a class="store-ranking-two" href="#modal-agent-two" 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>
......@@ -193,3 +193,40 @@
</script>
<!--个人业绩二级详情 点击门店名字 -->
<script id="agent_list_two_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>
<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]['index_'] %]</td>
<td class="text-center">[%= 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>
<!--<td class="text-center">[%= it["list"][item]['bargain_sum'] %]</td>-->
<td class="text-center">[%= it["list"][item]['paylog'] %]</td>
<td class="text-center">[%= it["list"][item]['march_in_num'] %]</td>
<td class="text-center">[%= it["list"][item]['look_at_num'] %]</td>
<td class="text-center">[%= it["list"][item]['add_house_num'] %]</td>
<td class="text-center">[%= it["list"][item]['add_user_num'] %]</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