month.html 4.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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 url="{:url('madd',['pid'=>$id])}" href="javascript:;" data-title="新增月计划" onclick="layer_open(this,1)" class="btn btn-sm btn-primary">新增</a>&nbsp;
  8. <a href="{:url('index')}" class="btn btn-sm btn-primary">返回年计划</a>
  9. </div>
  10. <div class="col-xs-9" style="text-align: right;display: none;">
  11. <form class="form-inline" id="form-search" action="{:url('month',['id'=>$id])}">
  12. <div class="input-group">
  13. <input type="text" class="form-control" name="title" placeholder="名称">
  14. </div>
  15. <div class="input-group">
  16. <select name="status" class="form-control">
  17. <option value="">选择状态</option>
  18. <option value="0">禁用</option>
  19. <option value="1">正常</option>
  20. </select>
  21. </div>
  22. <div class="input-group">
  23. <span class="input-group-btn">
  24. <button class="btn-sm btn-primary" type="button" id ="search-btn" ><i class="fa fa-search"></i></button>
  25. </span> &nbsp;
  26. <span class="input-group-btn">
  27. <button class="btn-sm btn-warning" type="button" id="search-clear"><i class="fa fa-undo"></i></button>
  28. </span>
  29. </div>
  30. </form>
  31. </div>
  32. </div>
  33. </div>
  34. <div class="ibox-content">
  35. <div class="jqGrid_wrapper">
  36. <table id="table" style="border-collapse: collapse"></table>
  37. <div id="pager"></div>
  38. </div>
  39. </div>
  40. </div>
  41. {/block}
  42. {block name="script"}
  43. <script>
  44. $(function () {
  45. $(window).bind("resize",function(){
  46. var width=$(".jqGrid_wrapper").width();
  47. $("#table").setGridWidth(width);
  48. });
  49. $.jgrid.defaults.styleUI="Bootstrap";
  50. $("#table").jqGrid({
  51. url:"{:url('month',['id'=>$id])}",
  52. datatype: "json",
  53. colModel:[
  54. {label:'ID',name:'id',index:'id', width:30,sortable: false},
  55. {label:'月份',name:'month',index:'month',width:40,editable: false,sortable: false},
  56. {label:'任务数',name:'count',index:'count',width:40,editable: false,sortable: false},
  57. {label:'已完成',name:'finish',index:'finish',width:40,editable: false,sortable: false},
  58. {label:'未完成',name:'notFinish',index:'notFinish',width:50,editable: false,sortable: false},
  59. {label:'备注',name:'remark',index:'remark',width:80,editable: false,sortable: false},
  60. {label:'创建时间',name:'create_time',index:'create_time',width:90,editable: false,sortable: false},
  61. {label:'操作',width:100,sortable: false,formatter: function (a, b, c) {
  62. var editurl = "{:url('madd',[],'')}/id/"+c.id;
  63. var delurl = "{:url('del',[],'')}/id/"+c.id;
  64. var month = "{:url('CleanPlanRecord/index',[],'')}/id/"+c.id;
  65. var btn = '';
  66. btn += '<a url="'+editurl+'" href="javascript:;" data-title="编辑" onclick="layer_open(this,1)"><span class="label label-primary" title="编辑">编辑</span></a>&nbsp;';
  67. btn += '<a href="'+month+'"><span class="label label-info" title="日计划">日计划</span></a>&nbsp;';
  68. btn += '<a {if !btnAuth(session("user_auth.id"),"CleanPlan/del")} style="display:none" {/if} href="'+delurl+'" class="confirm ajax-get" data-confirm="确定要删除此记录吗?(包含日计划,删除后不可恢复)" data-table="1"><span class="label label-danger" title="删除">删除</span></a>&nbsp;';
  69. return btn;
  70. }},
  71. ],
  72. rowNum:12,
  73. rowList:[12,20,30,50,100],
  74. pager: '#pager',
  75. sortname: 'id',
  76. viewrecords: true,
  77. autowidth:true,
  78. mtype: 'post',
  79. height: 'auto',
  80. emptyrecords: "暂无数据",
  81. sortorder: "asc",
  82. caption:"{$m_name}",
  83. loadComplete: function (xhr) {
  84. if(xhr.code==0){
  85. layer.msg(xhr.msg);
  86. return false;
  87. }
  88. },
  89. });
  90. });
  91. </script>
  92. {/block}