stat_sale.html 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  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_stattrade}</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. <input type="hidden" name="stat_type" id="stat_type" value="ordernum" />
  18. <input type="hidden" name="exporttype" id="exporttype" value="" />
  19. </dd>
  20. <dd>
  21. <select name="search_type" id="search_type" class="querySelect">
  22. <option value="day" {if isset($search_arr.search_type) && $search_arr.search_type == 'day'}selected{/if}>{$Think.lang.search_type_day}</option>
  23. <option value="week" {if isset($search_arr.search_type) && $search_arr.search_type == 'week'}selected{/if}>{$Think.lang.search_type_week}</option>
  24. <option value="month" {if isset($search_arr.search_type) && $search_arr.search_type == 'month'}selected{/if}>{$Think.lang.search_type_month}</option>
  25. </select>
  26. </dd>
  27. <dd id="searchtype_day" style="display:none;">
  28. <input class="txt date" type="text" value="{:date('Y-m-d',$search_arr.day.search_time)}" id="search_time" name="search_time">
  29. </dd>
  30. <dd id="searchtype_week" style="display:none;">
  31. <select name="searchweek_year" class="querySelect">
  32. {foreach name="year_arr" item="v"}
  33. <option value="{$key}" {$search_arr.week.current_year == $key ?'selected':''}>{$v}</option>
  34. {/foreach}
  35. </select>
  36. <select name="searchweek_month" class="querySelect">
  37. {foreach name="month_arr" item="v"}
  38. <option value="{$key}" {$search_arr.week.current_month == $key ?'selected':''}>{$v}</option>
  39. {/foreach}
  40. </select>
  41. <select name="searchweek_week" class="querySelect">
  42. {foreach name="week_arr" item="v"}
  43. <option value="{$v.key}" {$search_arr.week.current_week == $v.key ?'selected':''}>{$v.val}</option>
  44. {/foreach}
  45. </select>
  46. </dd>
  47. <dd id="searchtype_month" style="display:none;">
  48. <select name="searchmonth_year" class="querySelect">
  49. {foreach name="year_arr" item="v"}
  50. <option value="{$key}" {$search_arr.month.current_year == $key ?'selected':''}>{$v}</option>
  51. {/foreach}
  52. </select>
  53. <select name="searchmonth_month" class="querySelect">
  54. {foreach name="month_arr" item="v"}
  55. <option value="{$key}" {$search_arr.month.current_month == $key ?'selected':''}>{$v}</option>
  56. {/foreach}
  57. </select>
  58. </dd>
  59. <dd>
  60. <select name="order_type" id="order_type" class="querySelect">
  61. <option value="" {$Request.param.order_type == '' ?'selected':''}>{$Think.lang.ds_please_choose}</option>
  62. <option value="{$Think.ORDER_STATE_NEW}" {$Request.param.order_type !='' && $Request.param.order_type == ORDER_STATE_NEW ? 'selected':''}>{$Think.lang.order_state_new|raw}</option>
  63. <option value="{$Think.ORDER_STATE_PAY}" {$Request.param.order_type !='' && $Request.param.order_type == ORDER_STATE_PAY ? 'selected':''}>{$Think.lang.order_state_pay|raw}</option>
  64. <option value="{$Think.ORDER_STATE_SEND}" {$Request.param.order_type !='' && $Request.param.order_type == ORDER_STATE_SEND ? 'selected':''}>{$Think.lang.order_state_send|raw}</option>
  65. <option value="{$Think.ORDER_STATE_SUCCESS}" {$Request.param.order_type !='' && $Request.param.order_type == ORDER_STATE_SUCCESS ? 'selected':''}>{$Think.lang.order_state_success|raw}</option>
  66. <option value="{$Think.ORDER_STATE_CANCEL}" {$Request.param.order_type !='' && $Request.param.order_type == ORDER_STATE_CANCEL ? 'selected':''}>{$Think.lang.order_state_cancel|raw}</option>
  67. </select>
  68. </dd>
  69. <dd>{$Think.lang.ds_store_name}
  70. <input class="txt-long" type="text" name="store_name" id="store_name" value="{$Request.param.store_name}" />
  71. </dd>
  72. </dl>
  73. <div class="btn_group">
  74. <a href="javascript:void(0);" id="dssubmit" class="btn tooltip">{$Think.lang.ds_query}</a>
  75. <a href="{:url('Stattrade/sale')}" class="btn btn-default" title="{$Think.lang.ds_cancel}">{$Think.lang.ds_cancel}</a>
  76. </div>
  77. </div>
  78. </form>
  79. <div class="explanation" id="explanation">
  80. <div class="title" id="checkZoom">
  81. <h4 title="{$Think.lang.ds_explanation_tip}">{$Think.lang.ds_explanation}</h4>
  82. <span id="explanationZoom" title="{$Think.lang.ds_explanation_close}" class="arrow"></span>
  83. </div>
  84. <ul>
  85. <li>{$Think.lang.stat_validorder_explain}</li>
  86. <li>{$Think.lang.statstore_stat_sale_help1}</li>
  87. <li>{$Think.lang.statstore_stat_sale_help2}</li>
  88. </ul>
  89. </div>
  90. <div class="stat-info">
  91. <span>{$Think.lang.statstore_orderamount}:
  92. <strong>{$statcount_arr.orderamount|default="0.00"}</strong>{$Think.lang.ds_yuan}</span>
  93. <span>{$Think.lang.statstore_ordernum}:<strong>{:intval($statcount_arr.ordernum)}</strong></span>
  94. </div>
  95. <div id="stat_tabs" class="w100pre close_float ui-tabs" style="min-height:500px">
  96. <div class="close_float tabmenu">
  97. <ul class="tab pngFix">
  98. <li><a href="#orderamount_div" ds_type="showdata" data-param='{"type":"orderamount"}'>{$Think.lang.statstore_orderamount}</a></li>
  99. <li><a href="#ordernum_div" ds_type="showdata" data-param='{"type":"ordernum"}'>{$Think.lang.statstore_ordernum}</a></li>
  100. </ul>
  101. </div>
  102. <!-- 下单金额 -->
  103. <div id="orderamount_div" class="close_float" style="text-align:center;"></div>
  104. <!-- 下单量 -->
  105. <div id="ordernum_div" class="close_float" style="text-align:center;"></div>
  106. </div>
  107. <div style="text-align:right;"><a class="btn btn-mini" href="javascript:void(0);" id="export_btn">{$Think.lang.ds_export}Excel</a></div>
  108. <table class="ds-default-table nobdb">
  109. <thead>
  110. <tr class="thead">
  111. {foreach name="statlist.headertitle" item="v"}
  112. <th class="align-center">{$v}</th>
  113. {/foreach}
  114. </tr>
  115. </thead>
  116. <tbody id="datatable">
  117. {notempty name="statlist.data"}
  118. {foreach name="statlist.data" item="v"}
  119. <tr class="hover">
  120. <td class="align-center">{$v.order_sn}</td>
  121. <td class="align-center">{$v.buyer_name}</td>
  122. <td class="align-center">{$v.store_name}</td>
  123. <td class="align-center">{:date('Y-m-d H:i:s',$v.order_add_time)}</td>
  124. <td class="align-center">{:number_format($v.order_amount,2)}</td>
  125. <td class="align-center">{$v.order_statetext}</td>
  126. </tr>
  127. {/foreach}
  128. {else /}
  129. <tr class="no_data">
  130. <td colspan="15">{$Think.lang.ds_no_record}</td>
  131. </tr>
  132. {/notempty}
  133. </tbody>
  134. </table>
  135. {$show_page|raw}
  136. </div>
  137. <script src="{$Think.PLUGINS_SITE_ROOT}/highcharts/highcharts.js"></script>
  138. <script src="{$Think.PLUGINS_SITE_ROOT}/statistics.js"></script>
  139. <script src="{$Think.PLUGINS_SITE_ROOT}/jquery.ajaxContent.pack.js" type="text/javascript"></script>
  140. <script>
  141. //展示搜索时间框
  142. function show_searchtime(){
  143. s_type = $("#search_type").val();
  144. $("[id^='searchtype_']").hide();
  145. $("#searchtype_"+s_type).show();
  146. }
  147. $(function () {
  148. //切换登录卡
  149. $('#stat_tabs').tabs();
  150. //统计数据类型
  151. var s_type = $("#search_type").val();
  152. $('#search_time').datepicker({dateFormat: 'yy-mm-dd'});
  153. show_searchtime();
  154. $("#search_type").change(function(){
  155. show_searchtime();
  156. });
  157. //更新周数组
  158. $("[name='searchweek_month']").change(function(){
  159. var year = $("[name='searchweek_year']").val();
  160. var month = $("[name='searchweek_month']").val();
  161. $("[name='searchweek_week']").html('');
  162. $.getJSON(ADMINSITEURL+'/Common/getweekofmonth',{y:year,m:month},function(data){
  163. if(data != null){
  164. for(var i = 0; i < data.length; i++) {
  165. $("[name='searchweek_week']").append('<option value="'+data[i].key+'">'+data[i].val+'</option>');
  166. }
  167. }
  168. });
  169. });
  170. $('#dssubmit').click(function(){
  171. $("#exporttype").val('');
  172. $('#formSearch').submit();
  173. });
  174. //导出图表
  175. $("#export_btn").click(function(){
  176. $("#exporttype").val('excel');
  177. $('#formSearch').submit();
  178. });
  179. //加载统计数据
  180. getStatdata('orderamount');
  181. $("[ds_type='showdata']").click(function(){
  182. var data_str = $(this).attr('data-param');
  183. eval('data_str = '+data_str);
  184. getStatdata(data_str.type);
  185. });
  186. });
  187. //加载统计地图
  188. function getStatdata(type){
  189. var search_type = $("#search_type").val();
  190. var order_type = $("#order_type").val();
  191. var store_name = $("#store_name").val();
  192. $('#'+type+'_div').load(ADMINSITEURL+'/Stattrade/sale_trend.html?search_type='+search_type+'&type='+type+'&order_type='+order_type+'&store_name='+store_name+'&t={$searchtime}');
  193. }
  194. </script>