work.html 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. {extend name="common/common2" /}
  2. {block name="main"}
  3. <div class="ibox-content">
  4. <div class="ibox">
  5. <div class="alert">
  6. <form action="{:url('PatrolStatistics/work')}" method="GET" id='search_form' class="form-inline">
  7. <input type="hidden" name="type" value="{$type}">
  8. <div class="input-group" style="width: 200px">
  9. <span class="input-group-addon">开始时间</span>
  10. <input class="form-control dialog-datetime" id="startTime" name="start" type="text" data-date-format="yyyy-mm-dd" value="{$start}" placeholder="" readonly/>
  11. </div>
  12. <div class="input-group" style="width: 200px">
  13. <span class="input-group-addon">结束时间</span>
  14. <input class="form-control dialog-datetime" id="endTime" name="end" type="text" data-date-format="yyyy-mm-dd" value="{$end}" placeholder="" readonly/>
  15. </div>
  16. <div class="input-group">
  17. <span class="input-group-btn">
  18. <button class="btn-sm btn-primary" type="submit" ><i class="fa fa-search"></i></button>
  19. </span>&nbsp;
  20. <span class="input-group-btn">
  21. <button class="btn-sm btn-warning" type="reset" onclick="empty_search()"><i class="fa fa-undo"></i></button>
  22. </span>
  23. </div>
  24. </form>
  25. </div>
  26. <div class="panel-group">
  27. <div class="panel panel-default">
  28. <div class="panel-heading clearfix">
  29. <div class="btn-group pull-left">
  30. {if $type==1}巡更{/if}{if $type==2}巡视{/if}{if $type==3}巡查{/if}{if $type==4}巡检{/if} 人员工作量统计
  31. </div>
  32. <div class="btn-group pull-right">
  33. <a href="javascript:;" onclick="printer()" class="btn btn-sm btn btn-primary"><i class="glyphicon glyphicon-print"></i>打印</a>
  34. <a href="javascript:;" onclick="exportExcel()" class="btn btn-success btn-sm"><i class="glyphicon glyphicon-download"></i>导出</a>
  35. </div>
  36. </div>
  37. <div class="panel-body" id="printer">
  38. <table class="table table-bordered">
  39. <thead>
  40. <tr>
  41. <th>ID</th>
  42. <th>姓名</th>
  43. <th>工作记录(总数)</th>
  44. <th>工作记录(正常)</th>
  45. <th>工作记录(异常)</th>
  46. <th>完成率</th>
  47. <th>需要完成</th>
  48. <th>已完成</th>
  49. </tr>
  50. </thead>
  51. <tbody>
  52. {foreach $list as $k=>$v}
  53. <tr>
  54. <td>{$v['id']}</td>
  55. <td>{$v['title']}</td>
  56. <td> {if $v['count'] >0}
  57. <a href="javascript:;" onclick="layer_open(this,0)" url="{:url('workList')}?type={$type}&user_id={$v['user_id']}&start={$start}&end={$end}">{$v['count']}</a>
  58. {else}
  59. {$v['count']}
  60. {/if}</td>
  61. <td> {if $v['count1'] >0}
  62. <a href="javascript:;" onclick="layer_open(this,0)" url="{:url('workList')}?type={$type}&is_normal=0&user_id={$v['user_id']}&start={$start}&end={$end}">{$v['count1']}</a>
  63. {else}
  64. {$v['count1']}
  65. {/if}</td>
  66. <td> {if $v['count2'] >0}
  67. <a href="javascript:;" onclick="layer_open(this,0)" url="{:url('workList')}?type={$type}&is_normal=1&user_id={$v['user_id']}&start={$start}&end={$end}">{$v['count2']}</a>
  68. {else}
  69. {$v['count2']}
  70. {/if}</td>
  71. <td>{$v['wcl']}</td>
  72. <td> {if $v['count4'] >0}
  73. <a href="javascript:;" onclick="layer_open(this,0)" url="{:url('workList1')}?is_normal=1type={$type}&user_id={$v['user_id']}&start={$start}&end={$end}">{$v['count4']}</a>
  74. {else}
  75. {$v['count4']}
  76. {/if}</td>
  77. <td> {if $v['count3'] >0}
  78. <a href="javascript:;" onclick="layer_open(this,0)" url="{:url('workList1')}?is_normal=2type={$type}&user_id={$v['user_id']}&start={$start}&end={$end}">{$v['count3']}</a>
  79. {else}
  80. {$v['count3']}
  81. {/if}</td>
  82. </tr>
  83. {/foreach}
  84. </tbody>
  85. </table>
  86. </div>
  87. </div>
  88. </div>
  89. </div>
  90. </div>
  91. {/block}
  92. {block name="script"}
  93. <script src="/static/layDate-v5.0.9/laydate.js"></script>
  94. <script src="/static/browser.js"></script>
  95. <script src="/static/jquery.jqprint-0.3.js"></script>
  96. <script>
  97. $(function () {
  98. laydate.render({
  99. elem: '#startTime',
  100. trigger: 'click',
  101. theme: '#284a94'
  102. });
  103. laydate.render({
  104. elem: '#endTime',
  105. trigger: 'click',
  106. theme: '#284a94'
  107. });
  108. });
  109. function empty_search(){
  110. window.location.href = "{:url('PatrolStatistics/work')}?type={$type}";
  111. }
  112. function printer(){
  113. $('#printer').jqprint();
  114. }
  115. function exportExcel() {
  116. var start = $('#startTime').val().trim();
  117. var end = $('#endTime').val().trim();
  118. if (start && !end) {
  119. window.location.href = "{:url('PatrolStatistics/workExport')}?type={$type}&start="+start;
  120. }else if (!start && end) {
  121. window.location.href = "{:url('PatrolStatistics/workExport')}?type={$type}&end="+end;
  122. }else if (start && end) {
  123. window.location.href = "{:url('PatrolStatistics/workExport')}?type={$type}&start=" + start + "&end=" + end;
  124. }else{
  125. window.location.href = "{:url('PatrolStatistics/workExport')}?type={$type}"
  126. }
  127. }
  128. </script>
  129. {/block}