index.html 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  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-3">
  7. <a href="{:url('calendar')}" class="btn btn-sm btn-warning">日历显示</a>
  8. <!-- <a href="{:url('add',[],'')}" class="btn btn-sm btn-primary">新增</a>-->
  9. </div>
  10. <div class="col-xs-9" style="text-align: right;">
  11. <form class="form-inline" id="form-search" action="{:url('index')}">
  12. <div class="input-group">
  13. <input placeholder="月份" type="text" class="form-control" readonly id="month" name="month">
  14. </div>
  15. <div class="input-group">
  16. <input type="text" class="form-control" name="title" placeholder="名称">
  17. </div>
  18. <div class="input-group">
  19. <select name="plan_id" class="form-control">
  20. <option value="">选择计划</option>
  21. {volist name="plans" id="v"}
  22. <option value="{$v.id}">{$v.title}</option>
  23. {/volist}
  24. </select>
  25. </div>
  26. <div class="input-group">
  27. <select name="status" class="form-control">
  28. <option value="">选择状态</option>
  29. <option value="0">未执行</option>
  30. <option value="1">执行中</option>
  31. <option value="2">已完成</option>
  32. <option value="3">未完成</option>
  33. <option value="5">中断</option>
  34. <option value="6">已关闭</option>
  35. </select>
  36. </div>
  37. <div class="input-group">
  38. <select name="is_exception" class="form-control">
  39. <option value="">是否有异常</option>
  40. <option value="0">否</option>
  41. <option value="1">是</option>
  42. </select>
  43. </div>
  44. <div class="input-group">
  45. <span class="input-group-btn">
  46. <button class="btn-sm btn-primary" type="button" id ="search-btn" ><i class="fa fa-search"></i></button>
  47. </span>
  48. <span class="input-group-btn">
  49. <button class="btn-sm btn-warning " type="button" id="search-clear"><i class="fa fa-undo"></i></button>
  50. </span>
  51. </div>
  52. </form>
  53. </div>
  54. </div>
  55. </div>
  56. <!-- <div class="ibox-content">-->
  57. <!-- <div class="row">-->
  58. <!-- <div class="col-xs-6">-->
  59. <!-- <a href="{:url('calendar')}" class="btn btn-sm btn-warning">日历显示</a>-->
  60. <!-- <a href="{:url('plan')}?type=1" class="btn btn-sm btn-success">复制月计划</a>-->
  61. <!-- <a href="{:url('batch')}?type=1" class="btn btn-sm btn-danger">按月删除计划</a>-->
  62. <!-- </div>-->
  63. <!-- </div>-->
  64. <!-- </div>-->
  65. <div class="ibox-content">
  66. <div class="jqGrid_wrapper">
  67. <table id="table" style="border-collapse: collapse"></table>
  68. <div id="pager"></div>
  69. </div>
  70. </div>
  71. </div>
  72. {/block}
  73. {block name="script"}
  74. <script type="text/javascript" src="/static/layDate-v5.0.9/laydate.js"></script>
  75. <script>
  76. $(function () {
  77. $(window).bind("resize",function(){
  78. var width=$(".jqGrid_wrapper").width();
  79. $("#table").setGridWidth(width);
  80. });
  81. $.jgrid.defaults.styleUI="Bootstrap";
  82. $("#table").jqGrid({
  83. url:"{:url('index')}",
  84. datatype: "json",
  85. colModel:[
  86. {label:'编号',name:'id',index:'id', width:30,sortable: false},
  87. {label:'名称',name:'title',index:'title', width:60,sortable: false},
  88. {label:'执行人',name:'task_user',index:'task_user', width:60,sortable: false},
  89. {label:'开始时间',name:'start_time',index:'start_time', width:50,sortable: false},
  90. {label:'结束时间',name:'end_time',index:'end_time', width:50,sortable: false},
  91. {label:'状态',name:'status',index:'enable',width:30,editable: false,sortable: false,formatter:function (a,b,c){
  92. if(a==0){
  93. return '<span title="未执行">未执行</span>';
  94. }else if(a==1) {
  95. return '<span title="执行中">执行中</span>';
  96. }else if(a==2){
  97. return '<span title="已完成">已完成</span>';
  98. }else if(a==3){
  99. return '<span title="未完成">未完成</span>';
  100. }else if(a==5){
  101. return '<span title="中断">中断</span>';
  102. }else if(a==6){
  103. return '<span title="已关闭">已关闭</span>';
  104. }
  105. }},
  106. {label:'是否异常',name:'is_exception',index:'is_exception', width:30,sortable: false, formatter:function (a,b,c){
  107. if(a==0){
  108. return '<span class="label label-primary" title="否">否</span>';
  109. }else {
  110. return '<span class="label label-primary" title="是">是</span>';
  111. }
  112. }},
  113. {label:'创建日期',name:'create_time',index:'create_time', width:60,sortable: false},
  114. {label:'操作',width:70,sortable: false,formatter: function (a, b, c) {
  115. var editurl = "{:url('add',[],'')}/id/"+c.id;
  116. var trackurl = "{:url('info',[],'')}/id/"+c.id;
  117. var delurl = "{:url('del',[],'')}/id/"+c.id;
  118. var closeurl = "{:url('close',[],'')}/id/"+c.id;
  119. var btn = '';
  120. if(c.status == 0){
  121. btn+= '<a href="'+editurl+'"><span class="label label-primary" title="编辑">编辑</span></a>&nbsp;';
  122. }
  123. btn += '<a href="' + trackurl + '" ><span class="label label-warning" title="详情">详情</span></a>&nbsp;';
  124. if(c.status == 6){
  125. btn += '<a href="'+delurl+'" class="confirm ajax-get" data-confirm="确定要删除此任务吗?" data-table="1"><span class="label label-danger" title="删除">删除</span></a>';
  126. }
  127. if(c.status != 6){
  128. btn += '<a href="'+closeurl+'" class="confirm ajax-get" data-confirm="确定要关闭此任务吗?" data-table="1"><span class="label label-danger" title="关闭">关闭</span></a>';
  129. }
  130. return btn;
  131. }},
  132. ],
  133. rowNum:10,
  134. rowList:[10,20,30,50,100],
  135. pager: '#pager',
  136. sortname: 'id',
  137. viewrecords: true,
  138. autowidth:true,
  139. mtype: 'post',
  140. height: 'auto',
  141. emptyrecords: "暂无数据",
  142. sortorder: "desc",
  143. caption:"{$meta_title}",
  144. loadComplete: function (xhr) {
  145. if(xhr.code==0){
  146. layer.msg(xhr.msg);
  147. return false;
  148. }
  149. },
  150. });
  151. });
  152. </script>
  153. <script>
  154. //日期时间选择器
  155. laydate.render({
  156. elem: '#month',
  157. type: 'month',
  158. trigger: 'click' ,
  159. format:'yyyyMM',
  160. theme:'#6eb7ff'
  161. });
  162. </script>
  163. {/block}