index.html 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  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" style="text-align: right">
  7. <form class="form-inline" id="form-search" action="{:url('index',['mode'=>$mode])}">
  8. <div class="input-group">
  9. <input class="form-control" id="start" readonly placeholder="开始时间" name="start" >
  10. </div>
  11. <div class="input-group">
  12. <input class="form-control" id="end" readonly placeholder="结束时间" name="end" >
  13. </div>
  14. <div class="input-group">
  15. <input type="text" class="form-control" style="width: 200px" 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. <span class="input-group-btn">
  27. <button class="btn-sm btn-primary" type="button" id ="search-btn" ><i class="fa fa-search"></i></button>
  28. </span> &nbsp;
  29. <span class="input-group-btn">
  30. <button class="btn-sm btn-warning " type="button" id="search-clear"><i class="fa fa-undo"></i></button>
  31. </span> &nbsp;
  32. <span class="input-group-btn">
  33. <button class="btn-sm btn-success" title="导出" data-url="{:url('export',['mode'=>$mode])}" type="button" onclick="exports(this)"><i class="fa fa-cloud-download"></i></button>
  34. </span>
  35. </div>
  36. </form>
  37. </div>
  38. </div>
  39. </div>
  40. <div class="ibox-content">
  41. <div class="jqGrid_wrapper">
  42. <table id="table" style="border-collapse: collapse"></table>
  43. <div id="pager"></div>
  44. </div>
  45. </div>
  46. </div>
  47. {/block}
  48. {block name="script"}
  49. <script src="/static/layDate-v5.0.9/laydate.js"></script>
  50. <script>
  51. $(function () {
  52. laydate.render({
  53. elem: '#start',
  54. trigger: 'click' ,
  55. theme: '#148d8f'
  56. });
  57. laydate.render({
  58. elem: '#end',
  59. trigger: 'click' ,
  60. theme: '#148d8f'
  61. });
  62. $(window).bind("resize",function(){
  63. var width=$(".jqGrid_wrapper").width();
  64. $("#table").setGridWidth(width);
  65. });
  66. $.jgrid.defaults.styleUI="Bootstrap";
  67. $("#table").jqGrid({
  68. url:"{:url('index',['mode'=>$mode])}",
  69. datatype: "json",
  70. colModel:[
  71. {label:'编号',name:'id',index:'id', width:30,sortable: false},
  72. {label:'执行人',name:'task_user',index:'task_user', width:40,sortable: false},
  73. {label:'计划名称',name:'task_title',index:'task_title', width:80,sortable: false},
  74. {label:'地点',name:'title',index:'title', width:80,sortable: false},
  75. {label:'内容',name:'content',index:'content', width:60,sortable: false},
  76. // {label:'状态',name:'is_normal',status:'is_normal',width:30,editable: false,sortable: false,formatter:function (a,b,c){
  77. // if(a == 0){
  78. // return '<span title="正常">正常</span>';
  79. // }
  80. // if(a == 1){
  81. // return '<span title="异常">异常</span>';
  82. // }
  83. // }},
  84. {label:'检查项异常',name:'exception',status:'exception',width:30,editable: false,sortable: false,formatter:function (a,b,c){
  85. if(a == 0){
  86. return '<span title="是">是</span>';
  87. }
  88. if(a == 1){
  89. return '<span title="否">否</span>';
  90. }
  91. }},
  92. {label:'提交日期',name:'create_time',index:'create_time', width:60,sortable: false},
  93. {label:'操作',width:80,sortable: false,formatter: function (a, b, c) {
  94. var detailsurl = "{:url('details',[],'')}/id/"+c.id+'?mode='+c.patrol_mode;
  95. //var btn = '<a href="'+detailsurl+'"><span class="label label-info" title="详情">详情</span></a>&nbsp;';
  96. var btn= '<a url="'+detailsurl+'" href="javascript:;" data-title="详情" onclick="layer_open(this,1)"><span class="label label-info" title="详情">详情</span></a>&nbsp;';
  97. if(c.zg_type >0 &&c.order_id >0){
  98. var zgdetail = "{:url('orders/zg_detail',[],'')}/id/"+c.order_id;
  99. btn+= '<a url="'+zgdetail+'" href="javascript:;" data-title="整改详情" onclick="layer_open(this,1)"><span class="label label-primary" title="整改详情">整改详情</span></a>';
  100. }
  101. return btn;
  102. }},
  103. ],
  104. rowNum:10,
  105. rowList:[10,20,30,50,100],
  106. pager: '#pager',
  107. sortname: 'id',
  108. viewrecords: true,
  109. autowidth:true,
  110. mtype: 'post',
  111. height: 'auto',
  112. emptyrecords: "暂无数据",
  113. sortorder: "desc",
  114. caption:"{$meta_title}",
  115. loadComplete: function (xhr) {
  116. if(xhr.code==0){
  117. layer.msg(xhr.msg);
  118. return false;
  119. }
  120. },
  121. });
  122. });
  123. function exports(_self) {
  124. var param = $("#form-search").serialize();
  125. window.location.href = $(_self).attr('data-url')+'?'+param;
  126. }
  127. </script>
  128. {/block}