repair_items.html 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. {extend name="common/common2" /}
  2. {block name="main"}
  3. <style>
  4. .combined{
  5. width: 100%;
  6. height: auto;
  7. font-size: 22px;
  8. padding: 10px;
  9. background: #fff;
  10. }
  11. </style>
  12. <div class="ibox">
  13. <div class="ibox-content">
  14. <div class="row">
  15. <div class="col-xs-3">
  16. <div class="btn-group pull-left">
  17. <a href="javascript:;" onclick="printer()" class="btn btn-sm btn btn-primary"><i class="glyphicon glyphicon-print"></i> 打印</a>&nbsp;&nbsp;
  18. <a href="{:url('repairItemsExport',['start'=>$start,'end'=>$end])}" class="btn btn-sm btn-danger"><i class="fa fa-cloud-download"> 导出</i></a>
  19. </div>
  20. </div>
  21. <div class="col-xs-9" style="text-align: right;">
  22. <form class="form-inline" id="form-search" action="{:url('repairItems')}">
  23. <div class="input-group">
  24. <input class="form-control" value="{$start}" id="start" readonly placeholder="开始时间" name="start" >
  25. </div>
  26. <div class="input-group">
  27. <input class="form-control" value="{$end}" id="end" readonly placeholder="结束时间" name="end" >
  28. </div>
  29. <div class="input-group">
  30. <span class="input-group-btn">
  31. <button class="btn-sm btn-primary" type="button" id ="search-btn" ><i class="fa fa-search"></i></button>
  32. </span> &nbsp;
  33. <span class="input-group-btn">
  34. <button class="btn-sm btn-warning" type="button" id="search-clear"><i class="fa fa-undo"></i></button>
  35. </span>
  36. </div>
  37. </form>
  38. </div>
  39. </div>
  40. </div>
  41. <div class="ibox-content">
  42. <div class="jqGrid_wrapper" id="printer">
  43. <table id="table" style="border-collapse: collapse"></table>
  44. <div id="pager"></div>
  45. </div>
  46. <!-- <div class="combined">合计:</div>-->
  47. </div>
  48. </div>
  49. {/block}
  50. {block name="script"}
  51. <script src="/static/layDate-v5.0.9/laydate.js"></script>
  52. <script src="/static/browser.js"></script>
  53. <script src="/static/jquery.jqprint-0.3.js"></script>
  54. <script>
  55. $(function () {
  56. laydate.render({
  57. elem: '#start',
  58. trigger: 'click' ,
  59. theme: '#284a94'
  60. });
  61. laydate.render({
  62. elem: '#end',
  63. trigger: 'click' ,
  64. theme: '#284a94'
  65. });
  66. });
  67. function printer(){
  68. $('#printer').jqprint();
  69. }
  70. $(function () {
  71. $(window).bind("resize",function(){
  72. var width=$(".jqGrid_wrapper").width();
  73. $("#table").setGridWidth(width);
  74. });
  75. $.jgrid.defaults.styleUI="Bootstrap";
  76. $("#table").jqGrid({
  77. url:"{:url('repairItems')}",
  78. datatype: "json",
  79. colModel:[
  80. {label:'报修事项',name:'title',index:'title', width:80,sortable: false},
  81. {label:'订单数',name:'nums',index:'nums', width:80,sortable: false},
  82. ],
  83. sortname: 'id',
  84. viewrecords: true,
  85. autowidth:true,
  86. mtype: 'post',
  87. height: 'auto',
  88. emptyrecords: "暂无数据",
  89. sortorder: "asc",
  90. caption:"报修事项统计报表",
  91. loadComplete: function (xhr) {
  92. if(xhr.code==0){
  93. layer.msg(xhr.msg);
  94. return false;
  95. }
  96. },
  97. });
  98. });
  99. </script>
  100. {/block}