index.html 4.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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="user_name" 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:'id',index:'id', width:40,sortable: false},
  44. {label:'反馈人',name:'real_name',index:'real_name',width:60,editable: false,sortable: false},
  45. {label:'反馈内容',name:'content',index:'content',width:80,editable: false,sortable: false},
  46. {label:'反馈时间',name:'create_time',index:'create_time',width:60,editable: false,sortable: false},
  47. {label:'状态',name:'status',status:'status',width:50,editable: false,sortable: false,formatter:function (a,b,c){
  48. if(a == 0){
  49. return '<span title="未处理">未处理</span>';
  50. }
  51. if(a == 1){
  52. return '<span title="已处理">已处理</span>';
  53. }
  54. }},
  55. {label:'操作',width:60,sortable: false,formatter: function (a, b, c) {
  56. var detailsurl = "{:url('details',[],'')}/id/"+c.id;
  57. var delurl = "{:url('del',[],'')}/id/"+c.id;
  58. var opinionturl = "{:url('opinion',[],'')}/id/"+c.id;
  59. // var btn = '<a href="'+detailsurl+'"><span class="label label-info" title="">详情</span></a>&nbsp;';
  60. var btn = '<a url="'+detailsurl+'" href="javascript:;" onclick="layer_open(this,1)" data-title="详情"><span class="label label-info" title="详情">详情</span></a>&nbsp;';
  61. if(c.status == 0){
  62. btn += '<a url="'+opinionturl+'" href="javascript:;" data-title="处理" onclick="layer_open(this,1)" data-width="600px" data-height="400px"><span class="label label-primary" title="处理">处理</span></a>&nbsp;';
  63. }
  64. btn += '<a {if !btnAuth(session("user_auth.id"),"Feedback/del")} style="display:none" {/if} href="'+delurl+'" class="confirm ajax-get" data-confirm="确定要删除此记录吗?" data-table="1"><span class="label label-danger" title="删除">删除</span></a>';
  65. return btn;
  66. }},
  67. ],
  68. rowNum:10,
  69. rowList:[10,20,30,50,100],
  70. pager: '#pager',
  71. sortname: 'id',
  72. viewrecords: true,
  73. autowidth:true,
  74. mtype: 'post',
  75. height: 'auto',
  76. emptyrecords: "暂无数据",
  77. sortorder: "desc",
  78. caption:"意见反馈",
  79. loadComplete: function (xhr) {
  80. if(xhr.code==0){
  81. layer.msg(xhr.msg);
  82. return false;
  83. }
  84. },
  85. });
  86. });
  87. </script>
  88. {/block}