work.html 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. {extend name="common/common2" /}
  2. {block name="main"}
  3. <div class="ibox-content">
  4. <div class="ibox">
  5. <div class="alert">
  6. <form action="{:url('WasteStatistics/work')}" method="GET" id='search_form' class="form-inline">
  7. <div class="input-group" style="width: 200px">
  8. <span class="input-group-addon">开始时间</span>
  9. <input class="form-control dialog-datetime" id="startTime" name="start" type="text" data-date-format="yyyy-mm-dd" value="{$start}" placeholder="" readonly/>
  10. </div>
  11. <div class="input-group" style="width: 200px">
  12. <span class="input-group-addon">结束时间</span>
  13. <input class="form-control dialog-datetime" id="endTime" name="end" type="text" data-date-format="yyyy-mm-dd" value="{$end}" placeholder="" readonly/>
  14. </div>
  15. <div class="input-group">
  16. <select name="type" class="form-control">
  17. <option value="">选择类型</option>
  18. {foreach $typeList as $k=>$v}
  19. <option {if $type==$v['id']} selected {/if} value="{$v['id']}">{$v['title']}</option>
  20. {/foreach}
  21. </select>
  22. </div>
  23. <div class="input-group">
  24. <span class="input-group-btn">
  25. <button class="btn-sm btn-primary" type="submit" ><i class="fa fa-search"></i></button>
  26. </span>&nbsp;
  27. <span class="input-group-btn">
  28. <button class="btn-sm btn-warning" type="reset" onclick="empty_search()"><i class="fa fa-undo"></i></button>
  29. </span>
  30. </div>
  31. </form>
  32. </div>
  33. <div class="panel-group">
  34. <div class="panel panel-default">
  35. <div class="panel-heading clearfix">
  36. <div class="btn-group pull-left">
  37. 医废工作量统计
  38. </div>
  39. <div class="btn-group pull-right">
  40. <a href="javascript:;" onclick="printer()" class="btn btn-sm btn btn-primary"><i class="glyphicon glyphicon-print"></i>打印</a>
  41. <a href="javascript:;" onclick="exportExcel()" class="btn btn-success btn-sm"><i class="glyphicon glyphicon-download"></i>导出</a>
  42. </div>
  43. </div>
  44. <div class="panel-body" id="printer">
  45. <table class="table table-bordered">
  46. <thead>
  47. <tr>
  48. <th>编号</th>
  49. <th>姓名</th>
  50. <th>单数</th>
  51. <th>重量(kg)</th>
  52. </tr>
  53. </thead>
  54. <tbody>
  55. {foreach $list as $k=>$v}
  56. <tr>
  57. <td>{$v['user_id']}</td>
  58. <td>{$v['title']}</td>
  59. <td>{$v['count']}</td>
  60. <td>{$v['weight']}</td>
  61. </tr>
  62. {/foreach}
  63. </tbody>
  64. </table>
  65. </div>
  66. </div>
  67. </div>
  68. </div>
  69. </div>
  70. {/block}
  71. {block name="script"}
  72. <script src="/static/layDate-v5.0.9/laydate.js"></script>
  73. <script src="/static/browser.js"></script>
  74. <script src="/static/jquery.jqprint-0.3.js"></script>
  75. <script>
  76. $(function () {
  77. laydate.render({
  78. elem: '#startTime',
  79. trigger: 'click',
  80. theme: '#148d8f'
  81. });
  82. laydate.render({
  83. elem: '#endTime',
  84. trigger: 'click',
  85. theme: '#148d8f'
  86. });
  87. });
  88. function empty_search(){
  89. window.location.href = "{:url('WasteStatistics/work')}";
  90. }
  91. function printer(){
  92. $('#printer').jqprint();
  93. }
  94. function exportExcel() {
  95. var start = $('#startTime').val().trim();
  96. var end = $('#endTime').val().trim();
  97. if (start && !end) {
  98. window.location.href = "{:url('WasteStatistics/workExport')}?start="+start;
  99. }else if (!start && end) {
  100. window.location.href = "{:url('WasteStatistics/workExport')}?end="+end;
  101. }else if (start && end) {
  102. window.location.href = "{:url('WasteStatistics/workExport')}?start=" + start + "&end=" + end;
  103. }else{
  104. window.location.href = "{:url('WasteStatistics/workExport')}"
  105. }
  106. }
  107. </script>
  108. {/block}