index.html 7.3 KB

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