scale.html 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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_statindustry}</h3>
  7. <h5></h5>
  8. </div>
  9. {include file="public/admin_items" /}
  10. </div>
  11. </div>
  12. <form method="get" name="formSearch" id="formSearch">
  13. <div class="ds-search-form">
  14. <dl>
  15. <dd id="searchgc_td"></dd>
  16. <input type="hidden" id="choose_gcid" name="choose_gcid" value="0"/>
  17. <dd>
  18. <select name="search_type" id="search_type" class="querySelect">
  19. <option value="day" {if $Request.get.search_type == 'day'}selected{/if}>{$Think.lang.search_type_day}</option>
  20. <option value="week" {if $Request.get.search_type == 'week'}selected{/if}>{$Think.lang.search_type_week}</option>
  21. <option value="month" {if $Request.get.search_type == 'month'}selected{/if}>{$Think.lang.search_type_month}</option>
  22. </select>
  23. </dd>
  24. <dd id="searchtype_day" style="display:none;"><input class="txt date" type="text" value="{$search_arr.day.search_time|date='Y-m-d'}" id="search_time" name="search_time"></dd>
  25. <dd id="searchtype_week" style="display:none;">
  26. <select name="searchweek_year" class="querySelect">
  27. {foreach name="year_arr" item="v"}
  28. <option value="{$key}"{if $search_arr.week.current_year == $key} selected{/if}>{$v}</option>
  29. {/foreach}
  30. </select>
  31. <select name="searchweek_month" class="querySelect">
  32. {foreach name="month_arr" item="v"}
  33. <option value="{$key}" {if $search_arr.week.current_month == $key} selected{/if}>{$v}</option>
  34. {/foreach}
  35. </select>
  36. <select name="searchweek_week" class="querySelect">
  37. {foreach name="week_arr" item="v"}
  38. <option value="{$v.key}" {if $search_arr.week.current_week == $v.key}selected{/if}>{$v.val}</option>
  39. {/foreach}
  40. </select>
  41. </dd>
  42. <dd id="searchtype_month" style="display:none;">
  43. <select name="searchmonth_year" class="querySelect">
  44. {foreach name="year_arr" item="v"}
  45. <option value="{$key}" {if $search_arr.month.current_year == $key}selected{/if}>{$v}</option>
  46. {/foreach}
  47. </select>
  48. <select name="searchmonth_month" class="querySelect">
  49. {foreach name="month_arr" item="v"}
  50. <option value="{$key}" {if $search_arr.month.current_month == $key}selected{/if}>{$v}</option>
  51. {/foreach}
  52. </select>
  53. </dd>
  54. </dl>
  55. <div class="btn_group">
  56. <a href="javascript:document.formSearch.submit();" class="btn tooltip" title="{$Think.lang.ds_query}">{$Think.lang.ds_query}</a>
  57. <a href="{:url('Statindustry/scale')}" class="btn btn-default" title="{$Think.lang.ds_cancel}">{$Think.lang.ds_cancel}</a>
  58. </div>
  59. </div>
  60. </form>
  61. <div class="explanation" id="explanation">
  62. <div class="title" id="checkZoom">
  63. <h4 title="{$Think.lang.ds_explanation_tip}">{$Think.lang.ds_explanation}</h4>
  64. <span id="explanationZoom" title="{$Think.lang.ds_explanation_close}" class="arrow"></span>
  65. </div>
  66. <ul>
  67. <li>{$Think.lang.statindustry_scale_help1}</li>
  68. </ul>
  69. </div>
  70. <div id="stat_tabs" class="w100pre close_float ui-tabs" style="min-height:400px">
  71. <div class="close_float tabmenu">
  72. <ul class="tab pngFix">
  73. <li><a href="#orderamount_div" ds_type="showdata" data-param='{"type":"orderamount"}'>{$Think.lang.statstore_orderamount}</a></li>
  74. <li><a href="#goodsnum_div" ds_type="showdata" data-param='{"type":"goodsnum"}'>{$Think.lang.goodsnum}</a></li>
  75. <li><a href="#ordernum_div" ds_type="showdata" data-param='{"type":"ordernum"}'>{$Think.lang.statstore_ordernum}</a></li>
  76. </ul>
  77. </div>
  78. <!-- 下单金额 -->
  79. <div id="orderamount_div" class="close_float" style="text-align:center;"></div>
  80. <!-- 下单商品数 -->
  81. <div id="goodsnum_div" class="close_float" style="text-align:center;"></div>
  82. <!-- 下单量 -->
  83. <div id="ordernum_div" class="close_float" style="text-align:center;"></div>
  84. </div>
  85. </div>
  86. <script src="{$Think.PLUGINS_SITE_ROOT}/mlselection.js"></script>
  87. <script>
  88. //展示搜索时间框
  89. function show_searchtime(){
  90. s_type = $("#search_type").val();
  91. $("[id^='searchtype_']").hide();
  92. $("#searchtype_"+s_type).show();
  93. }
  94. $(function () {
  95. //切换登录卡
  96. $('#stat_tabs').tabs();
  97. //统计数据类型
  98. var s_type = $("#search_type").val();
  99. $('#search_time').datepicker({dateFormat: 'yy-mm-dd'});
  100. show_searchtime();
  101. $("#search_type").change(function(){
  102. show_searchtime();
  103. });
  104. //更新周数组
  105. $("[name='searchweek_month']").change(function(){
  106. var year = $("[name='searchweek_year']").val();
  107. var month = $("[name='searchweek_month']").val();
  108. $("[name='searchweek_week']").html('');
  109. $.getJSON(ADMINSITEURL+'/Common/getweekofmonth',{y:year,m:month},function(data){
  110. if(data != null){
  111. for(var i = 0; i < data.length; i++) {
  112. $("[name='searchweek_week']").append('<option value="'+data[i].key+'">'+data[i].val+'</option>');
  113. }
  114. }
  115. });
  116. });
  117. //商品分类
  118. init_gcselect({$gc_choose_json|raw},{$gc_json|raw});
  119. //加载统计数据
  120. getStatdata('orderamount');
  121. $("[ds_type='showdata']").click(function(){
  122. var data_str = $(this).attr('data-param');
  123. eval('data_str = '+data_str);
  124. getStatdata(data_str.type);
  125. });
  126. });
  127. //加载统计数据
  128. function getStatdata(type){
  129. var choose_gcid = $("#choose_gcid").val();
  130. $('#'+type+'_div').load("{:url('Statindustry/scale_list')}?stattype="+type+"&t={$searchtime}&choose_gcid="+choose_gcid);
  131. }
  132. </script>