0
0

tj.html 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. {extend name="common/common2" /}
  2. {block name="main"}
  3. <div class="ibox">
  4. <div class="ibox-title">
  5. <h5>{$meta_title}任务统计</h5>
  6. <div class="ibox-tools">
  7. </div>
  8. </div>
  9. <div class="ibox-content">
  10. <div class="row">
  11. <div class="col-xs-12" style="text-align: left;">
  12. <form class="form-inline" id="form-search" action="{:url('tj',['mode'=>$mode])}">
  13. <div class="input-group" style="width: 200px">
  14. {:widget_view('common/laydate',['name'=>'start','title' => '开始时间', 'val' => $start])}
  15. </div>
  16. <div class="input-group" style="width: 200px">
  17. {:widget_view('common/laydate',['name'=>'end','title' => '结束时间', 'val' => $end])}
  18. </div>
  19. <div class="input-group">
  20. <div class="input-group">
  21. <input type="text" class="form-control" name="title" value="" placeholder="执行人名称">
  22. </div>
  23. </div>
  24. <div class="input-group">
  25. <span class="input-group-btn">
  26. <button class="btn-sm btn-primary" type="button" id ="search-btn" ><i class="fa fa-search"></i></button>
  27. </span>&nbsp;
  28. <span class="input-group-btn">
  29. <button class="btn-sm btn-warning " type="button" id="search-clear"><i class="fa fa-undo"></i></button>
  30. </span>
  31. <!-- <span class="input-group-btn">-->
  32. <!-- <button class="btn-sm btn-info" type="button" onclick="printer()"><i class="glyphicon glyphicon-print"></i>打印</button>-->
  33. <!-- </span> &nbsp;-->
  34. <span class="input-group-btn">
  35. <button class="btn-sm btn-danger" type="button" onclick="exportExcel()"><i class="glyphicon glyphicon-download"></i>导出</button>
  36. </span>
  37. </div>
  38. </form>
  39. </div>
  40. </div>
  41. </div>
  42. <div class="ibox-content">
  43. <div class="jqGrid_wrapper">
  44. <table id="table" style="border-collapse: collapse"></table>
  45. <div id="pager"></div>
  46. </div>
  47. </div>
  48. {/block}
  49. {block name="script"}
  50. <script src="/static/browser.js"></script>
  51. <script src="/static/jquery.jqprint-0.3.js"></script>
  52. <script>
  53. $(function () {
  54. $(window).bind("resize",function(){
  55. var width=$(".jqGrid_wrapper").width();
  56. $("#table").setGridWidth(width);
  57. });
  58. $.jgrid.defaults.styleUI="Bootstrap";
  59. $("#table").jqGrid({
  60. url:"{:url('tj',['mode'=>$mode])}",
  61. datatype: "json",
  62. colModel:[
  63. {label:'编号',name:'user_id',index:'user_id', width:20,sortable: false},
  64. {label:'姓名',name:'title',index:'title', width:60,sortable: false},
  65. {label:'未执行',name:'c1',index:'c1',width:30,editable: false,sortable: false,formatter:function (a,b,c){
  66. var s1 = "{:url('tjList',[],'')}/userId/"+c.user_id+'/status/0/'+'patrol_mode/{$mode}'+'/start/'+c.st+'/end/'+c.et;
  67. if(a > 0){
  68. return '<a href="javascript:;" data-title="未执行列表" onclick="layer_open(this,1)" url="'+s1+'">'+a+'</a>';
  69. }else{
  70. return '<span title="未执行列表">'+a+'</span>';
  71. }
  72. }},
  73. {label:'执行中',name:'c2',index:'c2',width:30,editable: false,sortable: false,formatter:function (a,b,c){
  74. var s1 = "{:url('tjList',[],'')}/userId/"+c.user_id+'/status/1/'+'patrol_mode/{$mode}'+'/start/'+c.st+'/end/'+c.et;
  75. if(a > 0){
  76. return '<a href="javascript:;" data-title="执行中列表" onclick="layer_open(this,1)" url="'+s1+'">'+a+'</a>';
  77. }else{
  78. return '<span title="执行中列表">'+a+'</span>';
  79. }
  80. }},
  81. {label:'已完成',name:'c3',index:'c3',width:30,editable: false,sortable: false,formatter:function (a,b,c){
  82. var s1 = "{:url('tjList',[],'')}/userId/"+c.user_id+'/status/2/'+'patrol_mode/{$mode}'+'/start/'+c.st+'/end/'+c.et;
  83. if(a > 0){
  84. return '<a href="javascript:;" data-title="已完成列表" onclick="layer_open(this,1)" url="'+s1+'">'+a+'</a>';
  85. }else{
  86. return '<span title="已完成列表">'+a+'</span>';
  87. }
  88. }},
  89. {label:'未完成',name:'c4',index:'c4',width:30,editable: false,sortable: false,formatter:function (a,b,c){
  90. var s1 = "{:url('tjList',[],'')}/userId/"+c.user_id+'/status/3'+'/patrol_mode/{$mode}'+'/start/'+c.st+'/end/'+c.et;
  91. if(a > 0){
  92. return '<a href="javascript:;" data-title="未完成列表" onclick="layer_open(this,1)" url="'+s1+'">'+a+'</a>';
  93. }else{
  94. return '<span title="未完成列表">'+a+'</span>';
  95. }
  96. }},
  97. {label:'中断',name:'c5',index:'c5',width:30,editable: false,sortable: false,formatter:function (a,b,c){
  98. var s1 = "{:url('tjList',[],'')}/userId/"+c.user_id+'/status/5/'+'patrol_mode/{$mode}'+'/start/'+c.st+'/end/'+c.et;
  99. if(a > 0){
  100. return '<a href="javascript:;" data-title="中断列表" onclick="layer_open(this,1)" url="'+s1+'">'+a+'</a>';
  101. }else{
  102. return '<span title="中断列表">'+a+'</span>';
  103. }
  104. }},
  105. {label:'已关闭',name:'c6',index:'c6',width:30,editable: false,sortable: false,formatter:function (a,b,c){
  106. var s1 = "{:url('tjList',[],'')}/userId/"+c.user_id+'/status/6/'+'patrol_mode/{$mode}'+'/start/'+c.st+'/end/'+c.et;
  107. if(a > 0){
  108. return '<a href="javascript:;" data-title="已关闭列表" onclick="layer_open(this,1)" url="'+s1+'"</a>';
  109. }else{
  110. return '<span title="已关闭列表">'+a+'</span>';
  111. }
  112. }},
  113. ],
  114. rowNum:10,
  115. rowList:[10,20,30,50,100],
  116. pager: '#pager',
  117. sortname: 'id',
  118. viewrecords: true,
  119. autowidth:true,
  120. mtype: 'post',
  121. height: 'auto',
  122. emptyrecords: "暂无数据",
  123. sortorder: "desc",
  124. caption:"{$meta_title}",
  125. loadComplete: function (xhr) {
  126. if(xhr.code==0){
  127. layer.msg(xhr.msg);
  128. return false;
  129. }
  130. },
  131. });
  132. });
  133. function empty_search(){
  134. window.location.href = "{:url('tj',[],'')}/mode/{$mode}";
  135. }
  136. function printer(){
  137. $('#printer').jqprint();
  138. }
  139. function exportExcel() {
  140. window.location.href = "{:url('tjExport',[],'')}/mode/{$mode}?"+$('#form-search').serialize();
  141. }
  142. </script>
  143. {/block}