waste_year.html 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. {extend name="common/common2" /}
  2. {block name="main"}
  3. <div class="ibox-content">
  4. <div class="ibox">
  5. <div class="panel-group">
  6. <div class="panel panel-default">
  7. <div class="panel-heading clearfix">
  8. <div class="btn-group pull-left">
  9. 近2年医废数据统计
  10. </div>
  11. <div class="btn-group pull-right">
  12. <a href="javascript:;" onclick="printer()" class="btn btn-sm btn btn-primary"><i class="glyphicon glyphicon-print"></i>打印</a>
  13. </div>
  14. </div>
  15. <div class="panel-body" id="printer">
  16. <div id="echarts1" style="width: 100%;height: 350px">
  17. </div>
  18. <div id="echarts2" style="width: 100%;height: 350px">
  19. </div>
  20. <table class="table table-bordered">
  21. <thead>
  22. <tr>
  23. <th>月份</th>
  24. <th>{$data['qyear']}重量(kg)</th>
  25. <th>{$data['qyear']}环比</th>
  26. <th>{$data['year']}重量(kg)</th>
  27. <th>{$data['year']}环比</th>
  28. <th>同比</th>
  29. </tr>
  30. </thead>
  31. <tbody>
  32. {foreach $data['months'] as $k=>$v}
  33. <tr>
  34. <td>{$v}</td>
  35. <td>{$data['lists'][$k]['weight']}</td>
  36. <td>{$data['lists'][$k]['hb']}%</td>
  37. <td>{$data['lists'][$k+12]['weight']}</td>
  38. <td>{$data['lists'][$k+12]['hb']}%</td>
  39. <td>{$data['tb'][$k]}%</td>
  40. </tr>
  41. {/foreach}
  42. </tbody>
  43. </table>
  44. </div>
  45. </div>
  46. </div>
  47. </div>
  48. </div>
  49. {/block}
  50. {block name="script"}
  51. <script src="/static/browser.js"></script>
  52. <script src="/static/jquery.jqprint-0.3.js"></script>
  53. <script src="/static/data/js/echarts.js"></script>
  54. <script>
  55. function printer(){
  56. $('#printer').jqprint();
  57. }
  58. function exportExcel() {
  59. window.location.href = "/Statistics/wasteExport?"+$('#search_form').serialize();
  60. }
  61. var colors = ['#5793f3', '#d14a61', '#675bba'];
  62. var option = {
  63. tooltip: {
  64. trigger: 'axis',
  65. axisPointer: {
  66. type: 'cross',
  67. crossStyle: {
  68. color: '#999'
  69. }
  70. }
  71. },
  72. legend: {
  73. data: ["{$data['qyear']}", "{$data['year']}", '同比']
  74. },
  75. xAxis: [
  76. {
  77. type: 'category',
  78. data: {:json_encode($data['months'])},
  79. axisPointer: {
  80. type: 'shadow'
  81. }
  82. }
  83. ],
  84. yAxis: [
  85. {
  86. type: 'value',
  87. name: '重量',
  88. splitLine:{
  89. show:false
  90. },
  91. axisLabel: {
  92. formatter: '{value} kg'
  93. }
  94. },
  95. {
  96. type: 'value',
  97. name: '同比',
  98. splitLine:{
  99. show:false
  100. },
  101. axisLabel: {
  102. formatter: '{value}'
  103. }
  104. }
  105. ],
  106. series: [
  107. {
  108. name: "{$data['qyear']}",
  109. type: 'bar',
  110. data: {:json_encode($data['warr2'])}
  111. },
  112. {
  113. name: "{$data['year']}",
  114. type: 'bar',
  115. data: {:json_encode($data['warr1'])}
  116. },
  117. {
  118. name: '同比',
  119. type: 'line',
  120. yAxisIndex: 1,
  121. data: {:json_encode($data['tb'])}
  122. }
  123. ]
  124. };
  125. var myChart = echarts.init(document.getElementById('echarts1'));
  126. myChart.setOption(option);
  127. var option2 = {
  128. tooltip: {
  129. trigger: 'axis',
  130. axisPointer: {
  131. type: 'cross',
  132. crossStyle: {
  133. color: '#999'
  134. }
  135. }
  136. },
  137. legend: {
  138. data: ['重量', '环比']
  139. },
  140. xAxis: [
  141. {
  142. type: 'category',
  143. data: {:json_encode($data['tmonths'])},
  144. axisPointer: {
  145. type: 'shadow'
  146. }
  147. }
  148. ],
  149. yAxis: [
  150. {
  151. type: 'value',
  152. name: '重量',
  153. splitLine:{
  154. show:false
  155. },
  156. axisLabel: {
  157. formatter: '{value} kg'
  158. }
  159. },
  160. {
  161. type: 'value',
  162. name: '环比',
  163. splitLine:{
  164. show:false
  165. },
  166. axisLabel: {
  167. formatter: '{value}'
  168. }
  169. }
  170. ],
  171. series: [
  172. {
  173. name: '重量',
  174. type: 'bar',
  175. barWidth: 20,
  176. data: {:json_encode($data['warr'])}
  177. },
  178. {
  179. name: '环比',
  180. type: 'line',
  181. yAxisIndex: 1,
  182. data: {:json_encode($data['hb'])}
  183. }
  184. ]
  185. };
  186. var myChart2 = echarts.init(document.getElementById('echarts2'));
  187. myChart2.setOption(option2);
  188. </script>
  189. {/block}