stat_goodssale.html 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  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_statgoods}</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. <dd>
  17. <select name="search_type" id="search_type" class="querySelect">
  18. <option value="day" {if isset($search_arr.search_type) && $search_arr.search_type == 'day'}selected{/if}>{$Think.lang.search_type_day}</option>
  19. <option value="week" {if isset($search_arr.search_type) && $search_arr.search_type == 'week'}selected{/if}>{$Think.lang.search_type_week}</option>
  20. <option value="month" {if isset($search_arr.search_type) && $search_arr.search_type == 'month'}selected{/if}>{$Think.lang.search_type_month}</option>
  21. </select>
  22. </dd>
  23. <dd id="searchtype_day" style="display:none;">
  24. <input class="txt date" type="text" value="{:date('Y-m-d',$search_arr.day.search_time)}" id="search_time" name="search_time">
  25. </dd>
  26. <dd id="searchtype_week" style="display:none;">
  27. <select name="searchweek_year" class="querySelect">
  28. {foreach name="year_arr" item="v"}
  29. <option value="{$key}" {$search_arr.week.current_year == $key ?'selected':''}>{$v}</option>
  30. {/foreach}
  31. </select>
  32. <select name="searchweek_month" class="querySelect">
  33. {foreach name="month_arr" item="v"}
  34. <option value="{$key}" {$search_arr.week.current_month == $key ?'selected':''}>{$v}</option>
  35. {/foreach}
  36. </select>
  37. <select name="searchweek_week" class="querySelect">
  38. {foreach name="week_arr" item="v"}
  39. <option value="{$v.key}" {$search_arr.week.current_week == $key ?'selected':''}>{$v.val}</option>
  40. {/foreach}
  41. </select>
  42. </dd>
  43. <dd id="searchtype_month" style="display:none;">
  44. <select name="searchmonth_year" class="querySelect">
  45. {foreach name="year_arr" item="v"}
  46. <option value="{$key}" {$search_arr.month.current_year == $key ?'selected':''}>{$v}</option>
  47. {/foreach}
  48. </select>
  49. <select name="searchmonth_month" class="querySelect">
  50. {foreach name="month_arr" item="v"}
  51. <option value="{$key}" {$search_arr.month.current_month == $key ? 'selected':''}>{$v}</option>
  52. {/foreach}
  53. </select>
  54. </dd>
  55. <dd>{$Think.lang.ds_goods}<input class="txt-long" type="text" name="goods_name" value="{$Request.param.goods_name}" /></dd>
  56. <dd>{$Think.lang.ds_store_name}<input class="txt-long" type="text" name="store_name" value="{$Request.param.store_name}" /></dd>
  57. <dt>{$Think.lang.ds_class}</dt>
  58. <dd id="searchgc_td"></dd>
  59. <input type="hidden" id="choose_gcid" name="choose_gcid" value="0"/>
  60. <input type="hidden" id="exporttype" name="exporttype" value="">
  61. </dl>
  62. <div class="btn_group">
  63. <a href="javascript:void(0);" id="dssubmit" class="btn tooltip">{$Think.lang.ds_query}</a>
  64. <a href="{:url('Statgoods/goods_sale')}" class="btn btn-default" title="{$Think.lang.ds_cancel}">{$Think.lang.ds_cancel}</a>
  65. </div>
  66. </div>
  67. </form>
  68. <div class="explanation" id="explanation">
  69. <div class="title" id="checkZoom">
  70. <h4 title="{$Think.lang.ds_explanation_tip}">{$Think.lang.ds_explanation}</h4>
  71. <span id="explanationZoom" title="{$Think.lang.ds_explanation_close}" class="arrow"></span>
  72. </div>
  73. <ul>
  74. <li>{$Think.lang.stat_validorder_explain}</li>
  75. <li>{$Think.lang.statgoods_stat_goodssale_help1}</li>
  76. <li>{$Think.lang.statgoods_stat_goodssale_help2}</li>
  77. </ul>
  78. </div>
  79. <div id="container" class="w100pre close_float">
  80. <div style="text-align:right;">
  81. <a class="btn btn-mini" href="javascript:void(0);" id="export_btn">{$Think.lang.ds_export}Excel</a>
  82. </div>
  83. </div>
  84. <table class="ds-default-table">
  85. <thead>
  86. <tr class="thead sortbar-array" >
  87. <th class="align-center">{$Think.lang.ds_goods}</th>
  88. <th class="align-center">{$Think.lang.goods_commonid}</th>
  89. <th class="align-center">{$Think.lang.ds_store_name}</th>
  90. <th class="align-center">
  91. <a ds_type="orderitem" data-param='{"orderby":"goodsnum"}' class="{!$orderby || $orderby=='goodsnum desc' ?'selected desc':''}{$orderby =='goodsnum asc'?'selected asc':'' }">{$Think.lang.goodsnum}<i></i></a>
  92. </th>
  93. <th class="align-center">
  94. <a ds_type="orderitem" data-param='{"orderby":"ordernum"}' class="{$orderby == 'selected desc' ?'selected desc':''} {$orderby == 'ordernum asc' ?'selected asc':''}">{$Think.lang.statstore_ordernum}<i></i></a>
  95. </th>
  96. <th class="align-center">
  97. <a ds_type="orderitem" data-param='{"orderby":"goodsamount"}' class="{$orderby == 'goodsamount desc' ?'selected desc':''}{$orderby == 'goodsamount asc' ?'selected asc':''}">{$Think.lang.statstore_orderamount}<i></i></a>
  98. </th>
  99. </tr>
  100. </thead>
  101. <tbody id="datatable">
  102. {notempty name="goods_list"}
  103. {foreach name="goods_list" item="v"}
  104. <tr class="hover">
  105. <td class="align-left">
  106. <a href="{:url('home/Goods/index',['goods_id'=>$v.goods_id])}" target="_blank">{$v.goods_name}</a>
  107. </td>
  108. <td class="align-center">{$v.goods_commonid}</td>
  109. <td class="align-center">{$v.store_name}</td>
  110. <td class="align-center">{$v.goodsnum}</td>
  111. <td class="align-center">{$v.ordernum}</td>
  112. <td class="align-center">{$v.goodsamount}</td>
  113. </tr>
  114. {/foreach}
  115. {else /}
  116. <tr class="no_data">
  117. <td colspan="15">{$Think.lang.ds_no_record}</td>
  118. </tr>
  119. {/notempty}
  120. </tbody>
  121. </table>
  122. {$show_page|raw}
  123. </div>
  124. <script src="{$Think.PLUGINS_SITE_ROOT}/highcharts/highcharts.js"></script>
  125. <script src="{$Think.PLUGINS_SITE_ROOT}/statistics.js"></script>
  126. <script src="{$Think.PLUGINS_SITE_ROOT}/mlselection.js"></script>
  127. <script>
  128. //展示搜索时间框
  129. function show_searchtime(){
  130. s_type = $("#search_type").val();
  131. $("[id^='searchtype_']").hide();
  132. $("#searchtype_"+s_type).show();
  133. }
  134. $(function () {
  135. //统计数据类型
  136. var s_type = $("#search_type").val();
  137. $('#search_time').datepicker({dateFormat: 'yy-mm-dd'});
  138. show_searchtime();
  139. $("#search_type").change(function(){
  140. show_searchtime();
  141. });
  142. //更新周数组
  143. $("[name='searchweek_month']").change(function(){
  144. var year = $("[name='searchweek_year']").val();
  145. var month = $("[name='searchweek_month']").val();
  146. $("[name='searchweek_week']").html('');
  147. $.getJSON(ADMINSITEURL+'/Common/getweekofmonth.html',{y:year,m:month},function(data){
  148. if(data != null){
  149. for(var i = 0; i < data.length; i++) {
  150. $("[name='searchweek_week']").append('<option value="'+data[i].key+'">'+data[i].val+'</option>');
  151. }
  152. }
  153. });
  154. });
  155. $('#dssubmit').click(function(){
  156. $("#exporttype").val('');
  157. $("#orderby").val('');
  158. $('#formSearch').submit();
  159. });
  160. //导出图表
  161. $("#export_btn").click(function(){
  162. $("#exporttype").val('excel');
  163. $('#formSearch').submit();
  164. });
  165. //排序
  166. $("[ds_type='orderitem']").click(function(){
  167. $("#exporttype").val('');
  168. var data_str = $(this).attr('data-param');
  169. eval( "data_str = "+data_str);
  170. if($(this).hasClass('desc')){
  171. $("#orderby").val(data_str.orderby + ' asc');
  172. } else {
  173. $("#orderby").val(data_str.orderby + ' desc');
  174. }
  175. $('#formSearch').submit();
  176. });
  177. //商品分类
  178. init_gcselect({$gc_choose_json|raw},{$gc_json|raw});
  179. /* AJAX选择品牌 */
  180. $("#ajax_brand").brandinit();
  181. });
  182. </script>