index.html 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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-3">
  7. </div>
  8. <div class="col-xs-12" style="text-align: right;">
  9. <form class="form-inline" id="form-search" action="{:url('index')}">
  10. <div class="input-group">
  11. <input type="text" id="date" readonly class="form-control" name="begin" placeholder="开始日期">
  12. </div>
  13. <div class="input-group">
  14. <input type="text" id="date1" readonly class="form-control" name="end" placeholder="结束日期">
  15. </div>
  16. <div class="input-group">
  17. <input type="text" class="form-control" style="width: 180px;" name="order_sn" placeholder="单号">
  18. </div>
  19. <div class="input-group">
  20. <input type="text" class="form-control" style="width: 150px;" name="name" placeholder="用户名">
  21. </div>
  22. <div class="input-group">
  23. <span class="input-group-btn">
  24. <button class="btn-sm btn-primary" type="button" id ="search-btn" ><i class="fa fa-search"></i></button>
  25. </span>
  26. <span class="input-group-btn">
  27. <button class="btn-sm btn-primary " type="button" id="search-clear"><i class="fa fa-undo"></i></button>
  28. </span>
  29. </div>
  30. </form>
  31. </div>
  32. </div>
  33. </div>
  34. <div class="ibox-content">
  35. <div class="jqGrid_wrapper">
  36. <table id="table" style="border-collapse: collapse"></table>
  37. <div id="pager"></div>
  38. </div>
  39. </div>
  40. </div>
  41. <script src="/static/layDate-v5.0.9/laydate.js"></script>
  42. {/block}
  43. {block name="script"}
  44. <script>
  45. laydate.render({
  46. elem: '#date',
  47. //设置开始日期、日期日期的 input 选择器
  48. //数组格式为 5.3.0 开始新增,之前版本直接配置 true 或任意分割字符即可
  49. trigger: 'click' ,
  50. theme: '#1ab394'
  51. });
  52. laydate.render({
  53. elem: '#date1',
  54. //设置开始日期、日期日期的 input 选择器
  55. //数组格式为 5.3.0 开始新增,之前版本直接配置 true 或任意分割字符即可
  56. trigger: 'click' ,
  57. theme: '#1ab394'
  58. });
  59. $(function () {
  60. $(window).bind("resize",function(){
  61. var width=$(".jqGrid_wrapper").width();
  62. $("#table").setGridWidth(width);
  63. });
  64. $.jgrid.defaults.styleUI="Bootstrap";
  65. $("#table").jqGrid({
  66. url:"{:url('index')}",
  67. datatype: "json",
  68. colModel:[
  69. {label:'#',name:'id',index:'id', width:30,sortable: false},
  70. {label:'单号',name:'sn',index:'sn', width:80,sortable: false},
  71. {label:'用户名',name:'user_name',index:'user_name', width:60,sortable: false},
  72. {label:'空桶',name:'barrel_name',index:'barrel_name', width:60,sortable: false},
  73. {label:'数量',name:'num',index:'num', width:60,sortable: false},
  74. {label:'单价',name:'price',index:'price', width:40,sortable: false},
  75. {label:'金额',name:'amount',index:'amount', width:40,sortable: false},
  76. {label:'创建时间',name:'create_time',index:'create_time', width:70,sortable: false},
  77. {label:'操作',width:40,sortable: false,formatter: function (a, b, c) {
  78. var detailsurl = "{:url('details',[],'')}/id/"+c.id;
  79. var option = "{:url('option',[],'')}/id/"+c.id;
  80. var btn= '<a url="'+detailsurl+'" href="javascript:;" data-title="详情" onclick="layer_open(this,1)"><span class="label label-primary" title="详情">详情</span></a>&nbsp;';
  81. return btn;
  82. }},
  83. ],
  84. rowNum:10,
  85. rowList:[10,20,30,50,100],
  86. pager: '#pager',
  87. sortname: 'id',
  88. viewrecords: true,
  89. autowidth:true,
  90. mtype: 'post',
  91. height: 'auto',
  92. emptyrecords: "暂无数据",
  93. sortorder: "desc",
  94. caption:"{$meta_title}",
  95. loadComplete: function (xhr) {
  96. if(xhr.code==0){
  97. layer.msg(xhr.msg);
  98. return false;
  99. }
  100. },
  101. });
  102. });
  103. </script>
  104. {/block}