consumables.html 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. {extend name="common/common2" /}
  2. {block name="main"}
  3. <style>
  4. </style>
  5. <div class="ibox">
  6. <div class="ibox-content">
  7. <div class="row">
  8. <div class="col-xs-3">
  9. <div class="btn-group pull-left">
  10. <a href="javascript:;" onclick="printer()" class="btn btn-sm btn btn-primary"><i class="glyphicon glyphicon-print"></i> 打印</a>
  11. <a href="{:url('consumablesExport',['month'=>$month,'goodsIds'=>$goodsIds])}" class="btn btn-sm btn-danger"><i class="fa fa-cloud-download"> 导出</i></a>
  12. </div>
  13. </div>
  14. <div class="col-xs-9" style="text-align: right;">
  15. <form class="form-inline" action="{:url('consumables')}">
  16. <div class="input-group">
  17. {:widget_view('common/multiselect',['name'=>'goodsIds','lists' => $mateGoods, 'val' =>isset($goodsIds2)?$goodsIds2:[]])}
  18. </div>
  19. <div class="input-group">
  20. <input placeholder="月份" type="text" class="form-control" readonly id="month" name="month" value="{$month}">
  21. </div>
  22. <div class="input-group">
  23. <span class="input-group-btn">
  24. <button class="btn-sm btn-primary" type="submit" id ="search-btn" ><i class="fa fa-search"></i></button>
  25. </span> &nbsp;
  26. <!-- <span class="input-group-btn">-->
  27. <!-- <button class="btn-sm btn-warning" type="submit" id="search-clear"><i class="fa fa-undo"></i></button>-->
  28. <!-- </span>-->
  29. </div>
  30. </form>
  31. </div>
  32. </div>
  33. <div class="panel-group" id="printer" style="margin-top: 10px;overflow-y: auto">
  34. <div class="panel panel-default" style="border: 0px !important;">
  35. <div class="panel-body">
  36. <table class="table table-bordered">
  37. <thead>
  38. <tr>
  39. <th>日期</th>
  40. {if isset($mate)}
  41. {foreach $mate as $k=>$v}
  42. <th>{$v.title}</th>
  43. {/foreach}
  44. {/if}
  45. </tr>
  46. </thead>
  47. {foreach $lists as $k=>$v}
  48. <tbody>
  49. <tr>
  50. <td>{$v['title']}</td>
  51. {foreach $mate as $kk=>$vv}
  52. <td>{$v['type'.$vv['id']]}</td>
  53. {/foreach}
  54. </tr>
  55. </tbody>
  56. {/foreach}
  57. <tr>
  58. <td><strong>小计</strong></td>
  59. {foreach $subtotal as $k=>$v}
  60. <td>{$v}</td>
  61. {/foreach}
  62. </tr>
  63. </table>
  64. </div>
  65. <div class="type-bottom" style="width: 100%;height: 50px;line-height: 50px;padding-left: 20px;">
  66. <span style="margin-right: 20px"><strong>合计:</strong></span>
  67. <span>{$total}</span>
  68. </div>
  69. </div>
  70. </div>
  71. </div>
  72. </div>
  73. {/block}
  74. {block name="script"}
  75. <script src="/static/layDate-v5.0.9/laydate.js"></script>
  76. <script src="/static/browser.js"></script>
  77. <script src="/static/jquery.jqprint-0.3.js"></script>
  78. <script>
  79. laydate.render({
  80. elem: '#month',
  81. type: 'month',
  82. trigger: 'click' ,
  83. format:'yyyy-MM',
  84. theme:'#1d519c'
  85. });
  86. function printer(){
  87. $('#printer').jqprint();
  88. }
  89. </script>
  90. {/block}