patrol_list.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport"
  6. content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  7. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  8. <link rel="stylesheet" href="/static/bootstrap-3.3.7/css/bootstrap.css">
  9. <link rel="stylesheet" href="/static/dropload-gh-pages/dropload.css">
  10. <script type="text/javascript" src="/static/jquery-2.2.4.min.js"></script>
  11. <script type="text/javascript" src="/static/dropload-gh-pages/dropload.min.js"></script>
  12. <script type="text/javascript" src="/static/layer/layer.js"></script>
  13. <link rel="stylesheet" href="/static/h5/css/common.css">
  14. <title>列表</title>
  15. <style>
  16. body{
  17. background-color: #F1F1F1;
  18. }
  19. .container{
  20. max-width: 750px;
  21. height: auto;
  22. margin: 0 auto;
  23. padding: 0px 6px;
  24. }
  25. .patrol-lists{
  26. width: 100%;
  27. height: auto;
  28. margin-bottom: 30px;
  29. }
  30. .patrol-all{
  31. width: 100%;
  32. height: 170px;
  33. background-color: #FFFFFF;
  34. border-radius: 10px;
  35. margin: 5px 0px;
  36. padding: 0px 13px;
  37. }
  38. .patrol-title{
  39. width: 100%;
  40. height: 40px;
  41. line-height: 40px;
  42. }
  43. .patrol-title-left{
  44. width: 70%;
  45. height: 40px;
  46. display: inline-block;
  47. float: left;
  48. font-size: 15px;
  49. font-weight: 600;
  50. letter-spacing: 1px;
  51. color: var(--themeColor);
  52. overflow: hidden;
  53. }
  54. .patrol-title-right{
  55. float: right;
  56. font-size: 14px;
  57. /*font-weight: 600;*/
  58. }
  59. .patrol-content{
  60. width: 100%;
  61. height: 60px;
  62. }
  63. .patrol-start-time{
  64. width: 100%;
  65. height: 30px;
  66. line-height: 30px;
  67. border-bottom:1px solid #F1F1F1;
  68. overflow: hidden;
  69. }
  70. .left{
  71. font-size: 14px;
  72. float: left;
  73. }
  74. .right{
  75. font-size: 13px;
  76. color: #A9A9A9;
  77. float: right;
  78. }
  79. .patrol-end-time{
  80. width: 100%;
  81. height: 30px;
  82. line-height: 30px;
  83. border-bottom: 1px solid #F1F1F1;
  84. overflow: hidden;
  85. }
  86. .footer-back{
  87. position: fixed;
  88. z-index: 1000;
  89. width: 100%;
  90. height: 45px;
  91. line-height: 45px;
  92. background-color: #ffffff;
  93. bottom: 0;
  94. left: 0;
  95. box-shadow: 0px 0px 10px 0px rgba(26, 25, 26, 0.05);
  96. display: table-cell;
  97. vertical-align: middle;
  98. text-align: center;
  99. }
  100. .footer-back a img{
  101. width: 43px;
  102. height: 43px;
  103. }
  104. .nulldata{
  105. width: 100%;
  106. height: 200px;
  107. text-align: center;
  108. position: fixed;
  109. top: 22%;
  110. }
  111. .nulldata img{
  112. width: 200px;
  113. height: 160px;
  114. text-align: center;
  115. }
  116. .nulldata-text{
  117. margin-top: 15px;
  118. font-size: 14px;
  119. letter-spacing: 2px;
  120. text-align: center;
  121. }
  122. .patrol-dep{
  123. width: 100%;
  124. height: 30px;
  125. line-height: 30px;
  126. border-bottom: 1px solid #F1F1F1;
  127. }
  128. .patrol-user{
  129. width: 100%;
  130. height: 30px;
  131. line-height: 30px;
  132. overflow: hidden;
  133. }
  134. </style>
  135. </head>
  136. <body>
  137. {if $list}
  138. <div class="container">
  139. <div class="patrol-lists">
  140. {foreach $list as $k=>$v}
  141. <div class="patrol-all" onclick="patrolDetails(this)" data-id="{$v['id']}" data-orgId="{$v['org_id']}">
  142. <div class="patrol-title">
  143. <div class="patrol-title-left">{$v['title']}</div>
  144. {if $v['status'] == 0}
  145. <text class="patrol-title-right" style="color:orange;">未执行</text>
  146. {elseif($v['status'] == 1)}
  147. <text class="patrol-title-right" style="color:orange;">执行中</text>
  148. {elseif($v['status'] == 2)}
  149. <text class="patrol-title-right" style="color:green;">已完成</text>
  150. {elseif($v['status'] == 3)}
  151. <text class="patrol-title-right" style="color:gray;">未完成</text>
  152. {elseif($v['status'] == 5)}
  153. <text class="patrol-title-right" style="color:red;">中断</text>
  154. {elseif($v['status'] == 6)}
  155. <text class="patrol-title-right" style="color:red;">已关闭</text>
  156. {/if}
  157. </div>
  158. <div class="patrol-content">
  159. <div class="patrol-start-time">
  160. <text class="left">任务开始时间:</text>
  161. <text class="right">{$v['start_time']}</text>
  162. </div>
  163. <div class="patrol-end-time">
  164. <text class="left">任务结束时间:</text>
  165. <text class="right">{$v['end_time']}</text>
  166. </div>
  167. <div class="patrol-dep">
  168. <text class="left">执行人员部门:</text>
  169. <text class="right">{$v['dep']}</text>
  170. </div>
  171. <div class="patrol-user">
  172. <text class="left">执行人员名称:</text>
  173. <text class="right">{$v['real_name']}</text>
  174. </div>
  175. </div>
  176. </div>
  177. {/foreach}
  178. </div>
  179. </div>
  180. {else /}
  181. <div class="nulldata">
  182. <img src="/img/nulldata.png" alt="">
  183. <div class="nulldata-text">空空如也 ~</div>
  184. </div>
  185. {/if}
  186. <div class="footer-back">
  187. <a href="javascript:;" onclick="javascript:history.back(-1);"><img src="/img/back.png"></a>
  188. </div>
  189. </body>
  190. </html>
  191. <script>
  192. function patrolDetails(obj) {
  193. var obj = $(obj);
  194. var id = $(obj).attr('data-id');
  195. var orgId = $(obj).attr('data-orgId');
  196. var url = "{:url('Statistics/patrolDetails')}?id="+id+'&orgId='+orgId;
  197. window.location.href=url;
  198. }
  199. </script>
  200. <script>
  201. var type = '{$type}';
  202. var orgId = '{$orgId}';
  203. var day= '{$day}';
  204. var mode= '{$mode}';
  205. var count= '<?=count($list)?>';
  206. $(function(){
  207. // 页数
  208. var page = 1;
  209. // 每页展示20个
  210. var size = 20;
  211. // dropload
  212. $('.container').dropload({
  213. scrollArea : window,
  214. domDown : {
  215. domClass : 'dropload-down',
  216. domRefresh : '<div class="dropload-refresh">↑上拉加载更多</div>',
  217. domLoad : '<div class="dropload-load"><span class="loading"></span>加载中...</div>',
  218. domNoData : '<div class="dropload-noData"></div>'
  219. },
  220. loadDownFn : function(me){
  221. page++;
  222. // 拼接HTML
  223. var result = '';
  224. var url= "{:url('Statistics/patrolList')}";
  225. $.ajax({
  226. type: 'GET',
  227. url: url+'?page='+page+'&size='+size+'&type='+type+'&orgId='+orgId+'&day='+day+'&mode='+mode+'&dropload=1',
  228. dataType: 'json',
  229. success: function(res){
  230. var data = res.data;
  231. var arrLen = data.length;
  232. if(arrLen > 0){
  233. for(var i = 0; i < data.length; i++){
  234. if(arrLen > 0){
  235. result +='<div class="patrol-all" onclick="patrolDetails(this)" data-id="'+data[i].id+'" data-orgId="'+data[i].orgId+'">';
  236. result +='<div class="patrol-title">';
  237. result +='<div class="patrol-title-left">'+data[i].title+'</div>';
  238. if(data[i].status ==0){
  239. result +='<text class="patrol-title-right" style="color:orange;">未执行</text>';
  240. }
  241. if(data[i].status ==1){
  242. result +='<text class="patrol-title-right" style="color:orange;">执行中</text>';
  243. }
  244. if(data[i].status ==2){
  245. result +='<text class="patrol-title-right" style="color:green;">已完成</text>';
  246. }
  247. if(data[i].status ==3){
  248. result +='<text class="patrol-title-right" style="color:gray;">未完成</text>';
  249. }
  250. if(data[i].status ==5){
  251. result +='<text class="patrol-title-right" style="color:red;">中断</text>';
  252. }
  253. if(data[i].status ==6){
  254. result +='<text class="patrol-title-right" style="color:red;">已关闭</text>';
  255. }
  256. result +='</div>';
  257. result +='<div class="patrol-content">';
  258. result +='<div class="patrol-start-time">';
  259. result +='<text class="left">任务开始时间:</text>';
  260. result +='<text class="right">'+data[i].startTime+'</text>';
  261. result +='</div>';
  262. result +='<div class="patrol-end-time">';
  263. result +='<text class="left">任务结束时间:</text>';
  264. result +='<text class="right">'+data[i].endTime+'</text>';
  265. result +='</div>';
  266. result +='<div class="patrol-dep">';
  267. result +='<text class="left">执行人员部门:</text>';
  268. result +='<text class="right">'+data[i].dep+'</text>';
  269. result +='</div>';
  270. result +='<div class="patrol-user">';
  271. result +='<text class="left">执行人员名称:</text>';
  272. result +='<text class="right">'+data[i].realName+'</text>';
  273. result +='</div>';
  274. result +='</div>';
  275. result +='</div>';
  276. result +='</div>';
  277. }
  278. }
  279. // 如果没有数据
  280. }else{
  281. // 锁定
  282. me.lock();
  283. // 无数据
  284. me.noData();
  285. }
  286. //延迟1秒加载
  287. setTimeout(function(){
  288. // 插入数据到页面,放到最后面
  289. $('.patrol-lists').append(result);
  290. // 每次数据插入,必须重置
  291. me.resetload();
  292. },1000);
  293. },
  294. error: function(xhr, type){
  295. // 即使加载出错,也得重置
  296. me.resetload();
  297. }
  298. });
  299. },
  300. threshold : 50
  301. });
  302. });
  303. </script>