tj_list.html 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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('tjList',[],'')}?userId={$userId}&status={$status}&patrol_mode={$patrol_mode}&start={$start}&end={$end}">
  8. <div class="input-group">
  9. {:widget_view('common/laydate',['name'=>'month','title' => '选择月份','type' => 'month'])}
  10. </div>
  11. <div class="input-group">
  12. <input type="text" class="form-control" name="title" placeholder="名称">
  13. </div>
  14. <div class="input-group">
  15. <select name="plan_id" class="form-control">
  16. <option value="">选择计划</option>
  17. {volist name="plans" id="v"}
  18. <option value="{$v.id}">{$v.title}</option>
  19. {/volist}
  20. </select>
  21. </div>
  22. <div class="input-group">
  23. <select name="is_exception" class="form-control">
  24. <option value="">是否有异常</option>
  25. <option value="0">否</option>
  26. <option value="1">是</option>
  27. </select>
  28. </div>
  29. <div class="input-group">
  30. <span class="input-group-btn">
  31. <button class="btn-sm btn-primary" type="button" id ="search-btn" ><i class="fa fa-search"></i></button>
  32. </span>&nbsp;
  33. <span class="input-group-btn">
  34. <button class="btn-sm btn-warning " type="button" id="search-clear"><i class="fa fa-undo"></i></button>
  35. </span>
  36. </div>
  37. </form>
  38. </div>
  39. </div>
  40. </div>
  41. <div class="ibox-content">
  42. <div class="jqGrid_wrapper">
  43. <table id="table" style="border-collapse: collapse"></table>
  44. <div id="pager"></div>
  45. </div>
  46. </div>
  47. </div>
  48. {/block}
  49. {block name="script"}
  50. <script>
  51. $(function () {
  52. $(window).bind("resize",function(){
  53. var width=$(".jqGrid_wrapper").width();
  54. $("#table").setGridWidth(width);
  55. });
  56. $.jgrid.defaults.styleUI="Bootstrap";
  57. $("#table").jqGrid({
  58. url:"{:url('tjList',[],'')}?userId={$userId}&status={$status}&patrol_mode={$patrol_mode}&start={$start}&end={$end}",
  59. datatype: "json",
  60. colModel:[
  61. {label:'编号',name:'id',index:'id', width:20,sortable: false},
  62. {label:'名称',name:'title',index:'title', width:60,sortable: false},
  63. {label:'执行人',name:'task_user',index:'task_user', width:40,sortable: false},
  64. {label:'开始时间',name:'start_time',index:'start_time', width:50,sortable: false},
  65. {label:'结束时间',name:'end_time',index:'end_time', width:50,sortable: false},
  66. {label:'状态',name:'status',index:'enable',width:30,editable: false,sortable: false,formatter:function (a,b,c){
  67. if(a==0){
  68. return '<span title="未执行">未执行</span>';
  69. }else if(a==1) {
  70. return '<span title="执行中">执行中</span>';
  71. }else if(a==2){
  72. return '<span title="已完成">已完成</span>';
  73. }else if(a==3){
  74. return '<span title="未完成">未完成</span>';
  75. }else if(a==5){
  76. return '<span title="中断">中断</span>';
  77. }else if(a==6){
  78. return '<span title="已关闭">已关闭</span>';
  79. }
  80. }},
  81. {label:'是否异常',name:'is_exception',index:'is_exception', width:30,sortable: false, formatter:function (a,b,c){
  82. if(a==0){
  83. return '<span class="label label-primary" title="否">否</span>';
  84. }else {
  85. return '<span class="label label-primary" title="是">是</span>';
  86. }
  87. }},
  88. {label:'创建日期',name:'create_time',index:'create_time', width:60,sortable: false},
  89. ],
  90. rowNum:10,
  91. rowList:[10,20,30,50,100],
  92. pager: '#pager',
  93. sortname: 'id',
  94. viewrecords: true,
  95. autowidth:true,
  96. mtype: 'post',
  97. height: 'auto',
  98. emptyrecords: "暂无数据",
  99. sortorder: "desc",
  100. caption:"{$meta_title}",
  101. loadComplete: function (xhr) {
  102. if(xhr.code==0){
  103. layer.msg(xhr.msg);
  104. return false;
  105. }
  106. },
  107. });
  108. });
  109. </script>
  110. {/block}