index.html 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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="sn" placeholder="商品单号">
  10. </div>
  11. <div class="input-group">
  12. <input class="form-control" id="start" readonly placeholder="开始时间" name="start" >
  13. </div>
  14. <div class="input-group">
  15. <input class="form-control" id="end" readonly placeholder="结束时间" name="end" >
  16. </div>
  17. <div class="input-group">
  18. <span class="input-group-btn">
  19. <button class="btn-sm btn-primary" type="button" id ="search-btn" ><i class="fa fa-search"></i></button>
  20. </span>
  21. <span class="input-group-btn">
  22. <button class="btn-sm btn-primary " type="button" id="search-clear"><i class="fa fa-undo"></i></button>
  23. </span>
  24. </div>
  25. </form>
  26. </div>
  27. </div>
  28. </div>
  29. <div class="ibox-content">
  30. <div class="jqGrid_wrapper">
  31. <table id="table" style="border-collapse: collapse"></table>
  32. <div id="pager"></div>
  33. </div>
  34. </div>
  35. </div>
  36. {/block}
  37. {block name="script"}
  38. <script src="/static/layDate-v5.0.9/laydate.js"></script>
  39. <script>
  40. $(function () {
  41. laydate.render({
  42. elem: '#start',
  43. trigger: 'click' ,
  44. theme: '#f99c34'
  45. });
  46. laydate.render({
  47. elem: '#end',
  48. trigger: 'click' ,
  49. theme: '#f99c34'
  50. });
  51. $(window).bind("resize",function(){
  52. var width=$(".jqGrid_wrapper").width();
  53. $("#table").setGridWidth(width);
  54. });
  55. $.jgrid.defaults.styleUI="Bootstrap";
  56. $("#table").jqGrid({
  57. url:"{:url('index')}",
  58. datatype: "json",
  59. colModel:[
  60. {label:'商品单号',name:'sn',index:'sn', width:70,sortable: false},
  61. {label:'商品名称',name:'title',index:'title', width:70,sortable: false},
  62. {label:'操作人',name:'userName',index:'userName', width:70,sortable: false},
  63. {label:'调拨人姓名',name:'allotUserName',index:'allotUserName', width:70,sortable: false},
  64. {label:'调拨人部门',name:'allotDepName',index:'allotDepName', width:70,sortable: false},
  65. {label:'操作时间',name:'create_time',index:'create_time', width:70,sortable: false},
  66. ],
  67. rowNum:10,
  68. rowList:[10,20,30,50,100],
  69. pager: '#pager',
  70. sortname: 'sort',
  71. viewrecords: true,
  72. autowidth:true,
  73. mtype: 'post',
  74. height: 'auto',
  75. emptyrecords: "暂无数据",
  76. sortorder: "asc",
  77. caption:"调拨记录列表",
  78. loadComplete: function (xhr) {
  79. if(xhr.code==0){
  80. layer.msg(xhr.msg);
  81. return false;
  82. }
  83. },
  84. });
  85. });
  86. </script>
  87. {/block}