index.html 5.5 KB

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