index.html 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. {extend name="common/common2" /}
  2. {block name="main"}
  3. <div class="ibox">
  4. <div class="ibox-content">
  5. <div class="row">
  6. <div class="col-xs-12" style="text-align: right;">
  7. <form class="form-inline" id="form-search" action="{:url('index')}">
  8. <div class="input-group">
  9. <input type="text" class="form-control" name="barcode" placeholder="标本码">
  10. </div>
  11. <div class="input-group">
  12. <span class="input-group-btn">
  13. <button class="btn-sm btn-primary" type="button" id ="search-btn" ><i class="fa fa-search"></i></button>
  14. </span> &nbsp;
  15. <span class="input-group-btn">
  16. <button class="btn-sm btn-warning" type="button" id="search-clear"><i class="fa fa-undo"></i></button>
  17. </span>
  18. </div>
  19. </form>
  20. </div>
  21. </div>
  22. </div>
  23. <div class="ibox-content">
  24. <div class="jqGrid_wrapper">
  25. <table id="table" style="border-collapse: collapse"></table>
  26. <div id="pager"></div>
  27. </div>
  28. </div>
  29. </div>
  30. {/block}
  31. {block name="script"}
  32. <script src="/static/layDate-v5.0.9/laydate.js"></script>
  33. <script>
  34. $(function () {
  35. laydate.render({
  36. elem: '#start',
  37. trigger: 'click' ,
  38. theme: '#284a94'
  39. });
  40. laydate.render({
  41. elem: '#end',
  42. trigger: 'click' ,
  43. theme: '#284a94'
  44. });
  45. $(window).bind("resize",function(){
  46. var width=$(".jqGrid_wrapper").width();
  47. $("#table").setGridWidth(width);
  48. });
  49. $.jgrid.defaults.styleUI="Bootstrap";
  50. $("#table").jqGrid({
  51. url:"{:url('index')}",
  52. datatype: "json",
  53. colModel:[
  54. {label:'标本码',name:'barcode',index:'barcode', width:50,sortable: false},
  55. {label:'扫码人',name:'real_name',index:'real_name',width:80,editable: false,sortable: false},
  56. {label:'扫码地点',name:'address_title',index:'address_title',width:40,sortable: true},
  57. {label:'扫码时间',name:'create_time',index:'create_time',width:40,sortable: true},
  58. ],
  59. rowNum:10,
  60. rowList:[10,20,30,50,100],
  61. pager: '#pager',
  62. sortname: 'id',
  63. viewrecords: true,
  64. autowidth:true,
  65. mtype: 'post',
  66. height: 'auto',
  67. emptyrecords: "暂无数据",
  68. sortorder: "desc",
  69. caption:"标本记录列表",
  70. loadComplete: function (xhr) {
  71. if(xhr.code==0){
  72. layer.msg(xhr.msg);
  73. return false;
  74. }
  75. },
  76. });
  77. });
  78. </script>
  79. {/block}