index.html 9.4 KB

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