record.html 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. {extend name="common/common2" /}
  2. {block name="main"}
  3. <div class="ibox">
  4. <div class="ibox-content">
  5. <div class="jqGrid_wrapper">
  6. <table id="table" style="border-collapse: collapse"></table>
  7. <div id="pager"></div>
  8. </div>
  9. </div>
  10. </div>
  11. {/block}
  12. {block name="script"}
  13. <script>
  14. $(function () {
  15. $(window).bind("resize",function(){
  16. var width=$(".jqGrid_wrapper").width();
  17. $("#table").setGridWidth(width);
  18. });
  19. $.jgrid.defaults.styleUI="Bootstrap";
  20. $("#table").jqGrid({
  21. url:"{:url('record',['id'=>$id,'s'=>$s,'e'=>$e])}",
  22. datatype: "json",
  23. colModel:[
  24. {label:'编号',name:'id',index:'id', width:40,sortable: false},
  25. {label:'任务地点名称',name:'title',index:'title', width:80,sortable: false},
  26. {label:'任务详情',name:'daily_details',index:'daily_details', width:120,sortable: false},
  27. {label:'工作人员',name:'user_name',index:'user_name', width:100,sortable: false},
  28. {label:'时间',name:'create_time',index:'create_time', width:80,sortable: false},
  29. {label:'操作',width:60,sortable: false,formatter: function (a, b, c) {
  30. var details = "{:url('DailyRecord/details',[],'')}/id/"+c.id;
  31. var btn = '<a href="'+details+'"><span class="label label-primary" title="详情">详情</span></a>';
  32. return btn;
  33. }},
  34. ],
  35. rowNum:10,
  36. rowList:[10,20,30,50,100],
  37. pager: '#pager',
  38. sortname: 'id',
  39. viewrecords: true,
  40. autowidth:true,
  41. mtype: 'post',
  42. height: 'auto',
  43. emptyrecords: "暂无数据",
  44. sortorder: "desc",
  45. caption:"{$meta_title}",
  46. loadComplete: function (xhr) {
  47. if(xhr.code==0){
  48. layer.msg(xhr.msg);
  49. return false;
  50. }
  51. },
  52. });
  53. });
  54. </script>
  55. {/block}