index.html 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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('add',['plan_id'=>$pinfo['id']])}" href="javascript:;" data-title="新增日计划" onclick="layer_open(this,1)" class="btn btn-sm btn-primary">新增</a>
  8. <a href="{:url('CleanPlan/month',['id'=>$pinfo['pid']])}" 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',['id'=>$pinfo['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="formId" class="form-control">
  17. <option value="">选择任务项</option>
  18. {volist name="type" id="v"}
  19. <option value="{$v.id}">{$v.title}</option>
  20. {/volist}
  21. </select>
  22. </div>
  23. <div class="input-group">
  24. <select name="addrId" class="form-control">
  25. <option value="">选择地点</option>
  26. {volist name="address" id="v"}
  27. <option value="{$v.id}">{$v.title}</option>
  28. {/volist}
  29. </select>
  30. </div>
  31. <div class="input-group">
  32. <select name="enable" class="form-control">
  33. <option value="">选择状态</option>
  34. <option value="0">未完成</option>
  35. <option value="1">已完成</option>
  36. </select>
  37. </div>
  38. <div class="input-group">
  39. <span class="input-group-btn">
  40. <button class="btn-sm btn-primary" type="button" id ="search-btn" ><i class="fa fa-search"></i></button>
  41. </span> &nbsp;
  42. <span class="input-group-btn">
  43. <button class="btn-sm btn-warning" type="button" id="search-clear"><i class="fa fa-undo"></i></button>
  44. </span>
  45. </div>
  46. </form>
  47. </div>
  48. </div>
  49. </div>
  50. <div class="ibox-content">
  51. <div class="jqGrid_wrapper">
  52. <table id="table" style="border-collapse: collapse"></table>
  53. <div id="pager"></div>
  54. </div>
  55. </div>
  56. </div>
  57. {/block}
  58. {block name="script"}
  59. <script>
  60. $(function () {
  61. $(window).bind("resize",function(){
  62. var width=$(".jqGrid_wrapper").width();
  63. $("#table").setGridWidth(width);
  64. });
  65. $.jgrid.defaults.styleUI="Bootstrap";
  66. $("#table").jqGrid({
  67. url:"{:url('index',['id'=>$pinfo['id']])}",
  68. datatype: "json",
  69. colModel:[
  70. {label:'ID',name:'id',index:'id', width:30,sortable: false},
  71. {label:'任务项',name:'form_title',index:'form_title',width:80,editable: false,sortable: false},
  72. {label:'地点',name:'addr_title',index:'addr_title',width:80,editable: false,sortable: false},
  73. {label:'开始时间',name:'start',index:'start',width:80,editable: false,sortable: false},
  74. {label:'结束时间',name:'end',index:'end',width:80,editable: false,sortable: false},
  75. {label:'备注',name:'remark',index:'remark',width:80,editable: false,sortable: false},
  76. {label:'状态',name:'enable',index:'enable',width:80,editable: false,sortable: false,formatter: function (a, b, c) {
  77. if(c.enable == 0){
  78. return '未完成';
  79. }else{
  80. return '已完成';
  81. }
  82. }},
  83. {label:'创建时间',name:'create_time',index:'create_time',width:90,editable: false,sortable: false},
  84. {label:'操作',width:100,sortable: false,formatter: function (a, b, c) {
  85. var editurl = "{:url('edit',[],'')}/id/"+c.id;
  86. var delurl = "{:url('del',[],'')}/id/"+c.id;
  87. var detailurl = "{:url('detail',[],'')}/id/"+c.id;
  88. var btn = '';
  89. if(c.enable == 0){
  90. btn += '<a url="'+editurl+'" href="javascript:;" data-title="编辑" onclick="layer_open(this,1)"><span class="label label-primary" title="编辑">编辑</span></a>&nbsp;';
  91. }
  92. btn += '<a url="'+detailurl+'" href="javascript:;" data-title="详情" onclick="layer_open(this,0)"><span class="label label-info" title="详情">详情</span></a>&nbsp;';
  93. 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;';
  94. return btn;
  95. }},
  96. ],
  97. rowNum:10,
  98. rowList:[10,20,30,50,100],
  99. pager: '#pager',
  100. sortname: 'id',
  101. viewrecords: true,
  102. autowidth:true,
  103. mtype: 'post',
  104. height: 'auto',
  105. emptyrecords: "暂无数据",
  106. sortorder: "desc",
  107. caption:"{$m_name}",
  108. loadComplete: function (xhr) {
  109. if(xhr.code==0){
  110. layer.msg(xhr.msg);
  111. return false;
  112. }
  113. },
  114. });
  115. });
  116. </script>
  117. {/block}