index.html 5.9 KB

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