index.html 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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="javascript:;" url="{:url('add')}?pid={$id}" data-title="新增" onclick="layer_open(this,1)" class="btn btn-sm btn-primary">新增</a>
  8. <a href="javascript:history.go(-1);" 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/{$id}">
  12. <div class="input-group">
  13. <input type="text" class="form-control" name="title" placeholder="名称">
  14. </div>
  15. <div class="input-group">
  16. <span class="input-group-btn">
  17. <button class="btn-sm btn-primary" type="button" id ="search-btn" ><i class="fa fa-search"></i></button>
  18. </span> &nbsp;
  19. <span class="input-group-btn">
  20. <button class="btn-sm btn-warning" type="button" id="search-clear"><i class="fa fa-undo"></i></button>
  21. </span>
  22. </div>
  23. </form>
  24. </div>
  25. </div>
  26. </div>
  27. <div class="ibox-content">
  28. <div class="jqGrid_wrapper">
  29. <table id="table" style="border-collapse: collapse"></table>
  30. <div id="pager"></div>
  31. </div>
  32. </div>
  33. </div>
  34. {/block}
  35. {block name="script"}
  36. <script>
  37. $(function () {
  38. $(window).bind("resize",function(){
  39. var width=$(".jqGrid_wrapper").width();
  40. $("#table").setGridWidth(width);
  41. });
  42. $.jgrid.defaults.styleUI="Bootstrap";
  43. $("#table").jqGrid({
  44. url:"{:url('index',[],'')}/id/{$id}",
  45. datatype: "json",
  46. colModel:[
  47. {label:'ID',name:'id',index:'id', width:30,sortable: false},
  48. {label:'位置名称',name:'address_title',index:'address_title',width:80,editable: false,sortable: false},
  49. {label:'检查次数',name:'count',index:'count',width:40,sortable: true},
  50. {label:'排序',name:'sort',index:'sort',width:40,sortable: true},
  51. {label:'备注',name:'remark',index:'remark',width:40,sortable: true},
  52. {label:'操作',width:80,sortable: false,formatter: function (a, b, c) {
  53. var editurl = "{:url('add',[],'')}/id/"+c.id;
  54. var delurl = "{:url('del',[],'')}/id/"+c.id;
  55. var btn = '<a url="'+editurl+'" href="javascript:;" data-title="编辑部门" onclick="layer_open(this,1)"><span class="label label-primary" title="编辑">编辑</span></a>&nbsp;';
  56. btn += '<a href="'+delurl+'" class="confirm ajax-get" data-confirm="确定要删除此记录吗?" data-table="1"><span class="label label-danger" title="删除">删除</span></a>';
  57. return btn;
  58. }},
  59. ],
  60. rowNum:10,
  61. rowList:[10,20,30,50,100],
  62. pager: '#pager',
  63. sortname: 'sort',
  64. viewrecords: true,
  65. autowidth:true,
  66. mtype: 'post',
  67. height: 'auto',
  68. emptyrecords: "暂无数据",
  69. sortorder: "asc",
  70. caption:"[{$info.name}]循环签到路线",
  71. loadComplete: function (xhr) {
  72. if(xhr.code==0){
  73. layer.msg(xhr.msg);
  74. return false;
  75. }
  76. },
  77. });
  78. });
  79. </script>
  80. {/block}