stat_newstore.html 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. {include file="public/header" /}
  2. <div class="page">
  3. <div class="fixed-bar">
  4. <div class="item-title">
  5. <div class="subject">
  6. <h3>{$Think.lang.ds_statstore}</h3>
  7. <h5></h5>
  8. </div>
  9. {include file="public/admin_items" /}
  10. </div>
  11. </div>
  12. <div class="fixed-empty"></div>
  13. <form method="get" name="formSearch" id="formSearch">
  14. <div class="ds-search-form">
  15. <dl>
  16. <dt></dt>
  17. <dd>
  18. <select name="search_sclass" id="search_sclass" class="querySelect">
  19. <option value="" selected >{$Think.lang.ds_storeclass}</option>
  20. {foreach name="store_class" item="v"}
  21. <option value="{$v.storeclass_id}" {$Request.param.search_sclass == $v.storeclass_id ?'selected':''}>{$v.storeclass_name}</option>
  22. {/foreach}
  23. </select>
  24. </dd>
  25. <dd>
  26. <select name="search_type" id="search_type" class="querySelect">
  27. <option value="day" {$Request.param.search_type == 'day'?'selected':''}>{$Think.lang.search_type_day}</option>
  28. <option value="week" {$Request.param.search_type == 'week'?'selected':''}>{$Think.lang.search_type_week}</option>
  29. <option value="month" {$Request.param.search_type == 'month'?'selected':''}>{$Think.lang.search_type_month}</option>
  30. </select>
  31. </dd>
  32. <dd id="searchtype_day" style="display:none;">
  33. <input class="txt date" type="text" value="{$search_time}" id="search_time" name="search_time">
  34. </dd>
  35. <dd id="searchtype_week" style="display:none;">
  36. <select name="search_time_year" class="querySelect">
  37. {foreach name="year_arr" item="v"}
  38. <option value="{$key}" {$current_year == $key ?'selected':''}>{$v}</option>
  39. {/foreach}
  40. </select>
  41. <select name="search_time_month" class="querySelect">
  42. {foreach name="month_arr" item="v"}
  43. <option value="{$key}" {$current_month == $key ?'selected':''}>{$v}</option>
  44. {/foreach}
  45. </select>
  46. <select name="search_time_week" class="querySelect">
  47. {foreach name="week_arr" item="v"}
  48. <option value="{$v.key}" {$current_week == $v.key ?'selected':''}>{$v.val}</option>
  49. {/foreach}
  50. </select>
  51. </dd>
  52. <dd id="searchtype_month" style="display:none;">
  53. <select name="search_time_year" class="querySelect">
  54. {foreach name="year_arr" item="v"}
  55. <option value="{$key}" {$current_year == $key ?'selected':''}>{$v}</option>
  56. {/foreach}
  57. </select>
  58. <select name="search_time_month" class="querySelect">
  59. {foreach name="month_arr" item="v"}
  60. <option value="{$key}" {$current_month == $key ?'selected':''}>{$v}</option>
  61. {/foreach}
  62. </select>
  63. </dd>
  64. </dl>
  65. <div class="btn_group">
  66. <a href="javascript:void(0);" id="dssubmit" class="btn tooltip" title="">{$Think.lang.ds_query}</a>
  67. <a href="{:url('Statstore/newstore')}" class="btn btn-default" title="{$Think.lang.ds_cancel}">{$Think.lang.ds_cancel}</a>
  68. </div>
  69. </div>
  70. </form>
  71. <div class="explanation" id="explanation">
  72. <div class="title" id="checkZoom">
  73. <h4 title="{$Think.lang.ds_explanation_tip}">{$Think.lang.ds_explanation}</h4>
  74. <span id="explanationZoom" title="{$Think.lang.ds_explanation_close}" class="arrow"></span>
  75. </div>
  76. <ul>
  77. <li>{$Think.lang.statstore_stat_newstore_help1}</li>
  78. <li>{$Think.lang.statstore_stat_newstore_help2}</li>
  79. <li>{$Think.lang.statstore_stat_newstore_help3}</li>
  80. </ul>
  81. </div>
  82. <div id="container" class="w100pre close_float" style="height:400px"></div>
  83. <div style="text-align:right;">
  84. <input type="hidden" id="export_type" data-url="{:url(request()->controller().'/'.request()->action())}/exporttype/excel" name="export_type" data-param='{"url":"{$actionurl}&exporttype=excel"}' value="excel"/>
  85. <a class="btn btn-mini" href="javascript:void(0);" id="export_btn">{$Think.lang.ds_export}Excel</a>
  86. </div>
  87. <table class="ds-default-table">
  88. <thead>
  89. <tr class="thead">
  90. {foreach name="statlist.headertitle" item="v"}
  91. <th class="align-center">{$v}</th>
  92. {/foreach}
  93. <th class="align-center">{$Think.lang.ds_handle}</th>
  94. </tr>
  95. </thead>
  96. <tbody id="datatable">
  97. {notempty name="statlist.data"}
  98. {foreach name="statlist.data" item="v"}
  99. <tr class="hover">
  100. <td class="align-center">{$v.timetext}</td>
  101. <td class="align-center">{$v.updata}</td>
  102. <td class="align-center">{$v.currentdata}</td>
  103. <td class="align-center">{$v.tbrate}</td>
  104. <td class="align-center">
  105. <a href="{:url('Statstore/showstore',['type'=>'newbyday','t'=>$v.seartime,'scid'=>$Request.param.search_sclass])}" class="dsui-btn-view"><i class="iconfont"></i>{$Think.lang.ds_view}</a>
  106. </td>
  107. </tr>
  108. {/foreach}
  109. {else /}
  110. <tr class="no_data">
  111. <td colspan="5">{$Think.lang.no_record}</td>
  112. </tr>
  113. {/notempty}
  114. </tbody>
  115. </table>
  116. </div>
  117. <script src="{$Think.PLUGINS_SITE_ROOT}/highcharts/highcharts.js"></script>
  118. <script src="{$Think.PLUGINS_SITE_ROOT}/statistics.js"></script>
  119. <script>
  120. //展示搜索时间框
  121. function show_searchtime(){
  122. s_type = $("#search_type").val();
  123. $("[id^='searchtype_']").hide();
  124. $("#searchtype_"+s_type).show();
  125. }
  126. $(function () {
  127. //统计数据类型
  128. var s_type = $("#search_type").val();
  129. $('#search_time').datepicker({dateFormat: 'yy-mm-dd'});
  130. show_searchtime();
  131. $("#search_type").change(function(){
  132. show_searchtime();
  133. });
  134. //更新周数组
  135. $("[name='search_time_month']").change(function(){
  136. var year = $("[name='search_time_year']").val();
  137. var month = $("[name='search_time_month']").val();
  138. $("[name='search_time_week']").html('');
  139. $.getJSON(ADMINSITEURL+'/Common/getweekofmonth',{y:year,m:month},function(data){
  140. if(data != null){
  141. for(var i = 0; i < data.length; i++) {
  142. $("[name='search_time_week']").append('<option value="'+data[i].key+'">'+data[i].val+'</option>');
  143. }
  144. }
  145. });
  146. });
  147. $('select[name="search_time_year"]').change(function(){
  148. var s_year = $(this).val();
  149. $('select[name="search_time_year"]').each(function(){
  150. $(this).val(s_year);
  151. });
  152. });
  153. $('select[name="search_time_month"]').change(function(){
  154. var s_month = $(this).val();
  155. $('select[name="search_time_month"]').each(function(){
  156. $(this).val(s_month);
  157. });
  158. });
  159. $('#container').highcharts({$stat_json|raw});
  160. $('#dssubmit').click(function(){
  161. $('#formSearch').submit();
  162. });
  163. //导出图表
  164. $("#export_btn").click(function(){
  165. var item = $("#export_type");
  166. var type = $(item).val();
  167. if(type == 'excel'){
  168. export_xls(item.attr('data-url').replace('.html',''));
  169. }
  170. });
  171. });
  172. </script>