Ei kuvausta

salerBonus.blade.php 7.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. @extends('admin/master')
  2. @section('content')
  3. <body>
  4. <div class="page-container">
  5. <div>
  6. <div>
  7. @if($self_role != '销售')
  8. <input class="input-text" style="width:6%;text-align:center" type="text" value="所属团队"/>
  9. <select style="width:10%;text-align:center" id='team_id' name="team_id">
  10. <option value="0" @if($team_id=='') selected @endif>-- 选择团队 --</option>
  11. @foreach($teamlist as $v)
  12. <option value="{{$v['id']}}" @if($team_id==$v['id']) selected @endif>{{$v['name']}}</option>
  13. @endforeach
  14. </select>
  15. <input class="input-text" style="width:6%;text-align:center" type="text" value="所属销售"/>
  16. <select style="width:8%;text-align:center" id='admin_id' name="admin_id">
  17. <option value="0" @if($admin_id=='') selected @endif>-- 选择销售 --</option>
  18. @foreach($adminlist as $v)
  19. <option value="{{$v['id']}}" @if($admin_id==$v['id']) selected @endif>{{$v['realname']}}</option>
  20. @endforeach
  21. </select>
  22. @endif
  23. <input class="input-text" style="width:6%;text-align:center" type="text" value="开始时间"/>
  24. <input id="stime" type="text" onfocus="WdatePicker({ dateFmt:'yyyy-MM' })" class="input-text Wdate" style="width:12%;text-align:center;margin-left: -5px" name="stime" value="{{$stime?$stime:''}}">
  25. <input class="input-text" style="width:6%;text-align:center" type="text" value="结束时间"/>
  26. <input id="etime"type="text" onfocus="WdatePicker({ dateFmt:'yyyy-MM' })" class="input-text Wdate" style="width:12%;text-align:center;margin-left: -5px" name="etime" value="{{$etime?$etime:''}}">
  27. <a class="btn btn-primary radius" style="margin-left: 5px" onclick="user_search()" href="javascript:;">搜索</a>
  28. <a class="btn btn-primary radius" onclick="statistics_export()" href="javascript:;"><i class="Hui-iconfont"></i> 导出数据</a>
  29. </div>
  30. </div>
  31. <div class="mt-20">
  32. <table class="table table-border table-bordered table-bg table-hover table-sort">
  33. <thead>
  34. <tr class="text-c">
  35. <th width="5%">月份</th>
  36. <th width="5%">销售名</th>
  37. <th width="5%">总单量</th>
  38. <th width="5%">总成交额</th>
  39. <th width="5%">总加粉数</th>
  40. <th width="5%">总提成</th>
  41. <th width="5%">一阶提成</th>
  42. <th width="5%">二阶提成</th>
  43. <th width="5%">三阶提成</th>
  44. </tr>
  45. </thead>
  46. <tbody>
  47. @if($result)
  48. @foreach($result as $a)
  49. <tr class="text-c" style=" text-align:center;">
  50. <td>{{$a['month']}}</td>
  51. <td>{{$a['admin_name']}}</td>
  52. <td>{{$a['order_count']}}</td>
  53. <td>{{$a['order_amount']}}</td>
  54. <td>{{$a['fan_count']}}</td>
  55. <td>{{$a['bonus'][0]}}</td>
  56. <td>{{$a['bonus'][1]}}</td>
  57. <td>{{$a['bonus'][2]}}</td>
  58. <td>{{$a['bonus'][3]}}</td>
  59. </tr>
  60. @endforeach
  61. @endif
  62. </tbody>
  63. </table>
  64. </div>
  65. <div id="page" class="page_div"></div>
  66. </div>
  67. <!--_footer 作为公共模版分离出去-->
  68. <script type="text/javascript" src="/admin/lib/jquery/1.9.1/jquery.min.js"></script>
  69. <script type="text/javascript" src="/admin/lib/layer/2.4/layer.js"></script>
  70. <script type="text/javascript" src="/admin/static/h-ui/js/H-ui.min.js"></script>
  71. <script type="text/javascript" src="/admin/static/h-ui.admin/js/H-ui.admin.js"></script>
  72. <script type="text/javascript" src="/admin/lib/page/paging.js"></script>
  73. <script type="text/javascript" src="/admin/lib/My97DatePicker/4.8/WdatePicker.js"></script>
  74. <!--/_footer 作为公共模版分离出去-->
  75. <!--/_footer 作为公共模版分离出去-->
  76. <script type="text/javascript">
  77. function user_search(){
  78. var stime = $('#stime').val();
  79. var etime = $('#etime').val();
  80. var team_id = $('#team_id').val();
  81. var admin_id = $('#admin_id').val();
  82. location.href = 'salerBonus?stime='+stime+'&etime='+etime+'&team_id='+team_id+'&admin_id='+admin_id;
  83. }
  84. //导出
  85. function statistics_export(){
  86. var stime = $('#stime').val();
  87. var etime = $('#etime').val();
  88. var team_id = $('#team_id').val();
  89. var admin_id = $('#admin_id').val();
  90. location.href = '/admin/statistics/salerBonus_export?stime='+stime+'&etime='+etime+'&team_id='+team_id+'&admin_id='+admin_id;
  91. }
  92. /*分页*/
  93. $("#page").paging({
  94. pageNo:{{$page}},
  95. totalPage: {{$pages}},
  96. totalSize: {{$count}},
  97. callback: function(num) {
  98. var stime = $('#stime').val();
  99. var etime = $('#etime').val();
  100. var team_id = $('#team_id').val();
  101. var admin_id = $('#admin_id').val();
  102. location.href='salerBonus?page='+num+'&stime='+stime+'&etime='+etime+'&team_id='+team_id+'&admin_id='+admin_id;
  103. }
  104. })
  105. $(function(){
  106. getsale();
  107. })
  108. $('#team_id').change(function(){
  109. getsale();
  110. })
  111. function getsale(){
  112. team = $('#team_id').val();
  113. if(team=='0'){
  114. return false;
  115. }else{
  116. $.ajax({
  117. 'url':'/admin/order/teamAdmins/'+team,
  118. 'type': 'get',
  119. 'dataType':'json',
  120. 'success' : function(data){
  121. admin_id = '{{$admin_id}}';
  122. str = '<option value=\'0\'>-- 选择销售 --<\/option>';
  123. $.each(data, function(i, va){
  124. sele = '';
  125. if(va.id == admin_id){
  126. sele = 'selected';
  127. }
  128. str += '<option value="'+va.id+'" '+sele+'>' + va.realname +'<\/option>';
  129. })
  130. $('#admin_id').html(str);
  131. }
  132. });
  133. }
  134. }
  135. </script>
  136. </body>
  137. @endsection