work_list.html 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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('workList')}?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:'task_title',index:'task_title', width:80,sortable: false},
  27. {label:'地点',name:'address_title',index:'address_title', width:80,sortable: false},
  28. {label:'内容',name:'content',index:'content', width:60,sortable: false},
  29. {label:'状态',name:'is_normal',status:'is_normal',width:30,editable: false,sortable: false,formatter:function (a,b,c){
  30. if(a == 0){
  31. return '<span title="正常">正常</span>';
  32. }
  33. if(a == 1){
  34. return '<span title="异常">异常</span>';
  35. }
  36. }},
  37. {label:'提交日期',name:'create_time',index:'create_time', width:60,sortable: false},
  38. ],
  39. rowNum:10,
  40. rowList:[10,20,30,50,100],
  41. pager: '#pager',
  42. sortname: 'id',
  43. viewrecords: true,
  44. autowidth:true,
  45. mtype: 'post',
  46. height: 'auto',
  47. emptyrecords: "暂无数据",
  48. sortorder: "desc",
  49. caption:"{$meta_title}",
  50. loadComplete: function (xhr) {
  51. if(xhr.code==0){
  52. layer.msg(xhr.msg);
  53. return false;
  54. }
  55. },
  56. });
  57. });
  58. </script>
  59. {/block}