cltj.html 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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="cltj" 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. <span class="input-group-btn">
  17. <button class="btn-sm btn-primary" type="submit" ><i class="fa fa-search"></i></button>
  18. </span>&nbsp;
  19. <span class="input-group-btn">
  20. <button class="btn-sm btn-warning" type="reset" onclick="empty_search()"><i class="fa fa-undo"></i></button>
  21. </span>
  22. </div>
  23. </form>
  24. </div>
  25. <div class="panel-group">
  26. <div class="panel panel-default">
  27. <div class="panel-heading clearfix">
  28. <div class="btn-group pull-left">
  29. 报修科室使用材料统计
  30. </div>
  31. <div class="btn-group pull-right">
  32. <a href="javascript:;" onclick="printer()" class="btn btn-sm btn btn-primary"><i class="glyphicon glyphicon-print"></i>打印</a>
  33. <a href="javascript:;" onclick="exportExcel()" class="btn btn-success btn-sm"><i class="glyphicon glyphicon-download"></i>导出</a>
  34. </div>
  35. </div>
  36. <div class="panel-body" id="printer">
  37. <table class="table table-bordered">
  38. <thead>
  39. <tr>
  40. <th>科室名称</th>
  41. <th>材料名称</th>
  42. <th>数量</th>
  43. <th>单价</th>
  44. <th>总价</th>
  45. <th>小计</th>
  46. </tr>
  47. </thead>
  48. <tbody>
  49. {if !empty($data)}
  50. {foreach $data as $k=>$v}
  51. <tr>
  52. <td rowspan="{$v['rows']}">{$v['title']}</td>
  53. <td>{$v['items'][0]['title']}</td>
  54. <td>{$v['items'][0]['total']}</td>
  55. <td>{$v['items'][0]['money']}</td>
  56. <td>{$v['items'][0]['total_money']}</td>
  57. <td rowspan="{$v['rows']}">{$v['month']}</td>
  58. </tr>
  59. {if count($v['items']) >=2}
  60. {foreach $v['items'] as $k1=>$v1}
  61. {if $k1>0}
  62. <tr>
  63. <td>{$v1['title']}</td>
  64. <td>{$v1['total']}</td>
  65. <td>{$v1['money']}</td>
  66. <td>{$v1['total_money']}</td>
  67. </tr>
  68. {/if}
  69. {/foreach}
  70. {/if}
  71. {/foreach}
  72. {/if}
  73. </tbody>
  74. </table>
  75. </div>
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. {/block}
  81. {block name="script"}
  82. <script src="/static/layDate-v5.0.9/laydate.js"></script>
  83. <script src="/static/browser.js"></script>
  84. <script src="/static/jquery.jqprint-0.3.js"></script>
  85. <script>
  86. $(function () {
  87. laydate.render({
  88. elem: '#startTime',
  89. trigger: 'click',
  90. theme: '#148d8f'
  91. });
  92. laydate.render({
  93. elem: '#endTime',
  94. trigger: 'click',
  95. theme: '#148d8f'
  96. });
  97. });
  98. function empty_search(){
  99. window.location.href = 'cltj';
  100. }
  101. function printer(){
  102. $('#printer').jqprint();
  103. }
  104. function exportExcel() {
  105. window.location.href = "cltjExport?"+$('#search_form').serialize();
  106. }
  107. </script>
  108. {/block}