coupon.blade.php 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. @extends('layouts.base')
  2. <script src="{{static_url('js/echarts.js')}}" type="text/javascript"></script>
  3. @section('title', trans('优惠券数据统计'))
  4. @section('content')
  5. <link href="{{static_url('yunshop/css/order.css')}}" media="all" rel="stylesheet" type="text/css"/>
  6. <style>
  7. .coupon-count{ margin-bottom:20px !important;line-height: 40px;height: 40px;}
  8. .status-content{ margin: 20px 0;}
  9. .panel-heading{ border: 0 !important; font-size: 1.2em !important;}
  10. .panel-body-change{ font-size: 1.5em !important;}
  11. /*.daterangepicker .right .calendar-date, .daterangepicker ul, .daterangepicker label, .daterangepicker_end_input{display:none;}*/
  12. /*[name=daterangepicker_start]{width:164px !important;}*/
  13. </style>
  14. <div class="w1200 m0a">
  15. <div class="rightlist">
  16. @include('layouts.tabs')
  17. <!-- 新增加右侧顶部三级菜单 -->
  18. <div class="panel panel-info">
  19. <div class="panel-body">
  20. <div class="card">
  21. <div class="card-content">
  22. <form action="" method="post" class="form-horizontal" role="form" id="form1">
  23. <div class='form-group col-xs-12 col-sm-6'>
  24. <div class="input-group">
  25. <span class="input-group-addon">
  26. <input type="checkbox" name="search[is_time]" value="1"
  27. @if($search['is_time'] == '1')checked="checked"@endif>
  28. </span>
  29. {!!app\common\helpers\DateRange::tplFormFieldDateRange('search[time]', [
  30. 'starttime'=>$search['time']['start'] ?: date('Y-m-d H:i:s'),
  31. 'endtime'=>$search['time']['end'] ?: date('Y-m-d H:i:s'),
  32. 'start'=>0,
  33. 'end'=>0
  34. ])!!}
  35. </div>
  36. </div>
  37. <div class="form-group col-xs-12 col-sm-4">
  38. <button class="btn btn-success" id="search"><i class="fa fa-search"></i> 搜索</button>
  39. <button type="submit" name="export" value="1" id="export" class="btn btn-default">导出 Excel</button>
  40. </div>
  41. </form>
  42. </div>
  43. </div>
  44. </div>
  45. </div>
  46. <div class="panel panel-default">
  47. <table class='table coupon-count'>
  48. <tr class='trhead'>
  49. <td colspan='8' style="text-align: left;">
  50. 优惠券统计:已赠送优惠券总数,已消耗优惠券总数,已过期优惠券总数
  51. </td>
  52. </tr>
  53. </table>
  54. </div>
  55. <div class="panel panel-default">
  56. <table class='table coupon-count'>
  57. <tr class='trhead'style="text-align: center;">
  58. <td>
  59. <h4>已赠送优惠券</h4>
  60. <p style="font-size: 1.2em">{{ $couponGivenCount }}</p>
  61. </td>
  62. <td>
  63. <h4>已消耗优惠券</h4>
  64. <p style="font-size: 1.2em">{{ $couponUsedCount }}</p>
  65. </td>
  66. <td>
  67. <h4>已过期优惠券</h4>
  68. <p style="font-size: 1.2em">{{ $couponExpiredCount }}</p>
  69. </td>
  70. </tr>
  71. </table>
  72. </div>
  73. <div class="panel panel-default">
  74. <table class='table' style='float:left;margin-bottom:0;table-layout: fixed;line-height: 40px;height: 40px'>
  75. <tr class='trhead'>
  76. <td colspan='8' style="text-align: left;">
  77. 优惠券趋势图
  78. </td>
  79. </tr>
  80. </table>
  81. </div>
  82. <div class='panel panel-default form-horizontal form'>
  83. <div class='panel-body'style="border: 1px solid #e6e6e6">
  84. <div id="couponChart" style="width: 100%;height:400px;float: left;"></div>
  85. </div>
  86. </div>
  87. <div class="panel panel-default" style="border: 1px solid #e6e6e6; margin-top: 10px;">
  88. <div class="panel-heading">详细数据</div>
  89. <div class='panel-body'>
  90. <table class="table table-hover table-responsive table-striped">
  91. <thead>
  92. <tr>
  93. <th >时间</th>
  94. <th >已赠送优惠券</th>
  95. <th >已消耗优惠券</th>
  96. <th >已过期优惠券</th>
  97. </tr>
  98. </thead>
  99. <tbody>
  100. @foreach($allCouponLogData as $key => $item)
  101. <tr>
  102. <td>
  103. {{ $item['date'] }}
  104. </td>
  105. <td>
  106. {{ $item['givenCoupon'] }}
  107. </td>
  108. <td>
  109. {{ $item['usedCoupon'] }}
  110. </td>
  111. <td>
  112. {{ $item['expiredCoupon'] }}
  113. </td>
  114. </tr>
  115. @endforeach
  116. </table>
  117. {!! $page !!}
  118. </div>
  119. </div>
  120. </div>
  121. </div>
  122. <script type="text/javascript">
  123. //优惠券统计
  124. var couponChart = echarts.init(document.getElementById('couponChart'));
  125. {{--gender_data = {!! $gender !!};--}}
  126. option = {
  127. tooltip: {
  128. trigger: 'axis'
  129. },
  130. legend: {
  131. data:['已赠送优惠券','已消耗优惠券','已过期优惠券']
  132. },
  133. grid: {
  134. left: '3%',
  135. right: '4%',
  136. bottom: '3%',
  137. containLabel: true
  138. },
  139. toolbox: {
  140. feature: {
  141. saveAsImage: {}
  142. }
  143. },
  144. xAxis: {
  145. type: 'category',
  146. boundaryGap: false,
  147. data: {!! $couponTime !!}
  148. },
  149. yAxis: {
  150. type: 'value'
  151. },
  152. series: [
  153. {
  154. name:'已赠送优惠券',
  155. type:'line',
  156. stack: '总量2',
  157. data:{!! $couponGivenData !!}
  158. },
  159. {
  160. name:'已消耗优惠券',
  161. type:'line',
  162. stack: '总量1',
  163. data:{!! $couponUsedData !!}
  164. },
  165. {
  166. name:'已过期优惠券',
  167. type:'line',
  168. stack: '总量3',
  169. data:{!! $couponExpiredData !!}
  170. },
  171. ]
  172. };
  173. couponChart.setOption(option, true);
  174. </script>
  175. <script>
  176. $(function () {
  177. $('#export').click(function () {
  178. $('#form1').attr('action', '{!! yzWebUrl('charts.finance.coupon.export') !!}');
  179. $('#form1').submit();
  180. setTimeout(() =>{
  181. $('#form1').attr('action', " ");
  182. },0)
  183. });
  184. });
  185. </script>
  186. @endsection