index.html 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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="title" 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>-->
  15. <span class="input-group-btn">
  16. <button class="btn-sm btn-primary " 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>
  33. $(function () {
  34. $(window).bind("resize",function(){
  35. var width=$(".jqGrid_wrapper").width();
  36. $("#table").setGridWidth(width);
  37. });
  38. $.jgrid.defaults.styleUI="Bootstrap";
  39. $("#table").jqGrid({
  40. url:"{:url('index')}",
  41. datatype: "json",
  42. colModel:[
  43. {label:'类型',name:'type',index:'type',width:50,editable: false,sortable: false,formatter:function (a,b,c){
  44. if(a == 1){
  45. return '专项保洁';
  46. } else{
  47. return '工单';
  48. }
  49. }},
  50. {label:'日期',name:'create_time',index:'create_time', width:60,sortable: false},
  51. {label:'使用人',name:'userName',index:'userName', width:80,sortable: false},
  52. {label:'操作',width:30,sortable: false,formatter: function (a, b, c) {
  53. var info_url = "{:url('info',[],'')}/id/"+c.id;
  54. var btn= '<a url="'+info_url+'" href="javascript:;" data-title="详情" onclick="layer_open(this,1)"><span class="label label-success" title="详情">详情</span></a>';
  55. return btn;
  56. }},
  57. ],
  58. rowNum:10,
  59. rowList:[10,20,30,50,100],
  60. pager: '#pager',
  61. sortname: 'id',
  62. viewrecords: true,
  63. autowidth:true,
  64. mtype: 'post',
  65. height: 'auto',
  66. emptyrecords: "暂无数据",
  67. sortorder: "desc",
  68. caption:"{$meta_title}",
  69. loadComplete: function (xhr) {
  70. if(xhr.code==0){
  71. layer.msg(xhr.msg);
  72. return false;
  73. }
  74. },
  75. });
  76. });
  77. </script>
  78. {/block}