work_list1.html 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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('workList1')}?user_id={$user_id}&is_normal={$is_normal}&type={$type}&start={$start}&end={$end}",
  22. datatype: "json",
  23. colModel:[
  24. {label:'编号',name:'id',index:'id', width:30,sortable: false},
  25. {label:'执行人',name:'task_user',index:'task_user', width:40,sortable: false},
  26. {label:'计划名称',name:'title',index:'title', width:80,sortable: false},
  27. {label:'开始时间',name:'start_time',index:'start_time', width:100,sortable: false},
  28. {label:'结束时间',name:'end_time',index:'end_time', width:100,sortable: false},
  29. {label:'状态',name:'status',status:'status',width:30,editable: false,sortable: false,formatter:function (a,b,c){
  30. if(a == 0){
  31. return '<span>未执行</span>';
  32. }
  33. if(a == 1){
  34. return '<span>执行中</span>';
  35. }
  36. if(a == 2){
  37. return '<span>已完成</span>';
  38. }
  39. if(a == 3){
  40. return '<span>未完成</span>';
  41. }
  42. if(a == 5){
  43. return '<span>中断</span>';
  44. }
  45. if(a == 6){
  46. return '<span>已关闭</span>';
  47. }
  48. }},
  49. ],
  50. rowNum:10,
  51. rowList:[10,20,30,50,100],
  52. pager: '#pager',
  53. sortname: 'id',
  54. viewrecords: true,
  55. autowidth:true,
  56. mtype: 'post',
  57. height: 'auto',
  58. emptyrecords: "暂无数据",
  59. sortorder: "desc",
  60. caption:"{$meta_title}",
  61. loadComplete: function (xhr) {
  62. if(xhr.code==0){
  63. layer.msg(xhr.msg);
  64. return false;
  65. }
  66. },
  67. });
  68. });
  69. </script>
  70. {/block}