index.html 9.3 KB

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