index.html 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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. <select name="enable" class="form-control">
  13. <option value="">选择状态</option>
  14. <option value="0">待审核</option>
  15. <option value="1">已同意</option>
  16. <option value="2">已拒绝</option>
  17. <option value="3">已作废</option>
  18. </select>
  19. </div>
  20. <div class="input-group">
  21. <span class="input-group-btn">
  22. <button class="btn-sm btn-primary" type="button" id ="search-btn" ><i class="fa fa-search"></i></button>
  23. </span> &nbsp;
  24. <span class="input-group-btn">
  25. <button class="btn-sm btn-warning" type="button" id="search-clear"><i class="fa fa-undo"></i></button>
  26. </span>
  27. </div>
  28. </form>
  29. </div>
  30. </div>
  31. </div>
  32. <div class="ibox-content">
  33. <div class="jqGrid_wrapper">
  34. <table id="table" style="border-collapse: collapse"></table>
  35. <div id="pager"></div>
  36. </div>
  37. </div>
  38. </div>
  39. {/block}
  40. {block name="script"}
  41. <script>
  42. $(function () {
  43. $(window).bind("resize",function(){
  44. var width=$(".jqGrid_wrapper").width();
  45. $("#table").setGridWidth(width);
  46. });
  47. $.jgrid.defaults.styleUI="Bootstrap";
  48. $("#table").jqGrid({
  49. url:"{:url('index')}",
  50. datatype: "json",
  51. colModel:[
  52. {label:'ID',name:'id',index:'id', width:30,sortable: false},
  53. {label:'姓名',name:'name',index:'name',width:100,editable: false,sortable: false},
  54. {label:'电话',name:'phone',index:'phone',width:100,editable: false,sortable: false},
  55. {label:'图片',name:'imgs',index:'imgs',width:120,editable: false,sortable: false,formatter:function (a,b,c){
  56. var img = a.split(',');
  57. var html = '';
  58. for (var i=0;i<img.length;i++){
  59. html+='<img src="'+img[i]+'" style="width: 50px" onclick="open_img(this)">'
  60. }
  61. return html;
  62. }},
  63. {label:'状态',name:'status',index:'status',width:40,editable: false,sortable: false,formatter:function (a,b,c){
  64. if(a == 0){
  65. return '待审核';
  66. } else if(a==1) {
  67. return '已同意';
  68. }else if(a==2) {
  69. return '已拒绝';
  70. } else if(a==3) {
  71. return '已作废';
  72. }
  73. }},
  74. {label:'备注',name:'remark',index:'remark',width:100,sortable: true},
  75. {label:'创建时间',name:'create_time',index:'create_time',width:120,sortable: true},
  76. {label:'操作',width:80,sortable: false,formatter: function (a, b, c) {
  77. var editurl = "{:url('option',[],'')}/id/"+c.id;
  78. var delurl = "{:url('cancel',[],'')}/id/"+c.id;
  79. var btn = "";
  80. if(c.status==0){
  81. btn+= '<a url="'+editurl+'" href="javascript:;" data-title="审核" onclick="layer_open(this,1)"><span class="label label-primary" title="审核">审核</span></a>&nbsp;';
  82. }
  83. if(c.status!=3){
  84. btn += '<a href="'+delurl+'" class="confirm ajax-get" data-confirm="确定要作废此记录吗?" data-table="1"><span class="label label-danger" title="作废">作废</span></a>';
  85. }
  86. return btn;
  87. }},
  88. ],
  89. rowNum:10,
  90. rowList:[10,20,30,50,100],
  91. pager: '#pager',
  92. sortname: 'id',
  93. viewrecords: true,
  94. autowidth:true,
  95. mtype: 'post',
  96. height: 'auto',
  97. emptyrecords: "暂无数据",
  98. sortorder: "desc",
  99. caption:"申请列表",
  100. loadComplete: function (xhr) {
  101. if(xhr.code==0){
  102. layer.msg(xhr.msg);
  103. return false;
  104. }
  105. },
  106. });
  107. });
  108. </script>
  109. {/block}