index.html 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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" id="date" readonly class="form-control" name="begin" placeholder="开始时间">
  10. </div>
  11. <div class="input-group">
  12. <input type="text" id="date1" readonly class="form-control" name="end" placeholder="结束时间">
  13. </div>
  14. <div class="input-group">
  15. <span class="input-group-btn">
  16. <button class="btn-sm btn-primary" type="button" id ="search-btn" ><i class="fa fa-search"></i></button>
  17. </span>
  18. <span class="input-group-btn">
  19. <button class="btn-sm btn-primary " type="button" id="search-clear"><i class="fa fa-undo"></i></button>
  20. </span>
  21. </div>
  22. </form>
  23. </div>
  24. </div>
  25. </div>
  26. <div class="ibox-content">
  27. <div class="jqGrid_wrapper">
  28. <table id="table" style="border-collapse: collapse"></table>
  29. <div id="pager"></div>
  30. </div>
  31. </div>
  32. </div>
  33. <script src="/static/layDate-v5.0.9/laydate.js"></script>
  34. {/block}
  35. {block name="script"}
  36. <script>
  37. laydate.render({
  38. elem: '#date',
  39. //设置开始日期、日期日期的 input 选择器
  40. //数组格式为 5.3.0 开始新增,之前版本直接配置 true 或任意分割字符即可
  41. trigger: 'click' ,
  42. theme: '#337ab7'
  43. });
  44. laydate.render({
  45. elem: '#date1',
  46. //设置开始日期、日期日期的 input 选择器
  47. //数组格式为 5.3.0 开始新增,之前版本直接配置 true 或任意分割字符即可
  48. trigger: 'click' ,
  49. theme: '#337ab7'
  50. });
  51. $(function () {
  52. $(window).bind("resize",function(){
  53. var width=$(".jqGrid_wrapper").width();
  54. $("#table").setGridWidth(width);
  55. });
  56. $.jgrid.defaults.styleUI="Bootstrap";
  57. $("#table").jqGrid({
  58. url:"{:url('index')}",
  59. datatype: "json",
  60. colModel:[
  61. {label:'ID',name:'id',index:'id', width:30,sortable: false},
  62. {label:'操作人',name:'uName',index:'uName',width:60,editable: false,sortable: false},
  63. {label:'时间',name:'create_time',index:'create_time',width:80,editable: false,sortable: false},
  64. {label:'操作',width:100,sortable: false,formatter: function (a, b, c) {
  65. var detail = "{:url('detail',[],'')}/id/"+c.id;
  66. // var btn= '<a href="'+detail+'"><span class="label label-info" title="详情">详情</span></a>';
  67. var btn = '<a url="'+detail+'" href="javascript:;" data-title="详情" onclick="layer_open(this,1)"><span class="label label-primary" title="详情">详情</span></a>&nbsp;';
  68. // if(c.balance>0){
  69. // btn += '<a href="'+js_money+'" class="confirm ajax-get" data-confirm="确定要结算该护工工资吗?" data-table="1"><span class="label label-info" title="工资结算">工资结算</span></a>';
  70. // }
  71. return btn;
  72. }},
  73. ],
  74. rowNum:10,
  75. rowList:[10,20,30,50,100],
  76. pager: '#pager',
  77. sortname: 'id',
  78. viewrecords: true,
  79. autowidth:true,
  80. mtype: 'post',
  81. height: 'auto',
  82. emptyrecords: "暂无数据",
  83. sortorder: "desc",
  84. caption:"结算记录",
  85. loadComplete: function (xhr) {
  86. if(xhr.code==0){
  87. layer.msg(xhr.msg);
  88. return false;
  89. }
  90. },
  91. });
  92. $('#js').click(function () {
  93. var url = "{:url('export')}?"+$('#form-search').serialize();
  94. window.location.href = url;
  95. })
  96. });
  97. </script>
  98. {/block}