todo_xy_time.html 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. {extend name="common/common2" /}
  2. {block name="main"}
  3. <style>
  4. .echarts{
  5. width: 100%;
  6. height: 300px;
  7. }
  8. </style>
  9. <div class="ibox">
  10. <div class="ibox-content">
  11. <div class="row">
  12. <div class="col-xs-3">
  13. <div class="btn-group pull-left">
  14. <a href="javascript:;" onclick="printer()" class="btn btn-sm btn btn-primary"><i class="glyphicon glyphicon-print"></i> 打印</a>
  15. <a href="{:url('xyTimeExport')}" class="btn btn-sm btn-danger"><i class="fa fa-cloud-download"> 导出</i></a>
  16. </div>
  17. </div>
  18. </div>
  19. <div class="echarts" id="echarts"></div>
  20. <div class="panel-group" id="printer" style="margin-top: 10px">
  21. <div class="panel panel-default">
  22. <div class="panel-body">
  23. <table class="table table-bordered">
  24. <thead>
  25. <tr>
  26. <!-- <th>需求日期</th>-->
  27. <th>类型</th>
  28. <th>部门</th>
  29. <th>员工</th>
  30. <th>需求描述</th>
  31. <th>状态</th>
  32. <th>响应时间</th>
  33. <!-- <th>完成时间</th>-->
  34. </tr>
  35. </thead>
  36. {foreach $list as $k=>$v}
  37. <tbody>
  38. <tr>
  39. <td>{$v.type_title}</td>
  40. <td>{$v.dep}</td>
  41. <td>{$v.user_name}</td>
  42. <td>{$v.content}</td>
  43. {if($v['todo_mode'] == 2)}
  44. <td>进行中</td>
  45. {elseif($v['todo_mode'] == 3)}
  46. <td>已完成</td>
  47. {/if}
  48. <td>{$v.xy_time}</td>
  49. <!-- <td>{$v.done_time}</td>-->
  50. </tr>
  51. </tbody>
  52. {/foreach}
  53. <tr>
  54. <td colspan="2" style="text-align: right"><strong>合计</strong></td>
  55. <td colspan="4" style="text-align: right">{$count}</td>
  56. </tr>
  57. </table>
  58. </div>
  59. </div>
  60. </div>
  61. </div>
  62. </div>
  63. {/block}
  64. {block name="script"}
  65. <script src="/static/echarts-5.2.2.js"></script>
  66. <script src="/static/browser.js"></script>
  67. <script src="/static/jquery.jqprint-0.3.js"></script>
  68. <script>
  69. $(function (){
  70. var url = '{:url("RepairStatistics/xyTimeEcharts")}';
  71. $.post(url,{},function (res) {
  72. if(res.code == 1) {
  73. var lists = res.data;
  74. var option;
  75. option = {
  76. xAxis: {
  77. type: 'category',
  78. data: lists.title
  79. },
  80. yAxis: {
  81. type: 'value'
  82. },
  83. series: [
  84. {
  85. data: lists.list,
  86. type: 'bar',
  87. barWidth :35,
  88. }
  89. ]
  90. };
  91. var myChart = echarts.init(document.getElementById('echarts'));
  92. myChart.setOption(option);
  93. }
  94. })
  95. })
  96. function printer(){
  97. $('#printer').jqprint();
  98. }
  99. </script>
  100. {/block}