patrol_list.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  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. width: 100px;
  72. height: 30px;
  73. font-size: 14px;
  74. float: left;
  75. display: inline-block;
  76. float: left;
  77. overflow: hidden;
  78. }
  79. .right{
  80. width: calc(100% - 100px);
  81. height: 30px;
  82. font-size: 13px;
  83. color: #A9A9A9;
  84. display: inline-block;
  85. float: right;
  86. overflow: hidden;
  87. text-align: right;
  88. white-space: nowrap;
  89. }
  90. .patrol-end-time{
  91. width: 100%;
  92. height: 30px;
  93. line-height: 30px;
  94. border-bottom: 1px solid #F1F1F1;
  95. overflow: hidden;
  96. }
  97. .footer-back{
  98. position: fixed;
  99. z-index: 1000;
  100. width: 100%;
  101. height: 45px;
  102. line-height: 45px;
  103. background-color: #ffffff;
  104. bottom: 0;
  105. left: 0;
  106. box-shadow: 0px 0px 10px 0px rgba(26, 25, 26, 0.05);
  107. display: table-cell;
  108. vertical-align: middle;
  109. text-align: center;
  110. }
  111. .footer-back a img{
  112. width: 43px;
  113. height: 43px;
  114. }
  115. .nulldata{
  116. width: 100%;
  117. height: 200px;
  118. text-align: center;
  119. position: fixed;
  120. top: 22%;
  121. }
  122. .nulldata img{
  123. width: 200px;
  124. height: 160px;
  125. text-align: center;
  126. }
  127. .nulldata-text{
  128. margin-top: 15px;
  129. font-size: 14px;
  130. letter-spacing: 2px;
  131. text-align: center;
  132. }
  133. .patrol-dep{
  134. width: 100%;
  135. height: 30px;
  136. line-height: 30px;
  137. border-bottom: 1px solid #F1F1F1;
  138. }
  139. .patrol-user{
  140. width: 100%;
  141. height: 30px;
  142. line-height: 30px;
  143. overflow: hidden;
  144. }
  145. </style>
  146. </head>
  147. <body>
  148. {if $list}
  149. <div class="container">
  150. <div class="patrol-lists">
  151. {foreach $list as $k=>$v}
  152. <div class="patrol-all" onclick="patrolDetails(this)" data-id="{$v['id']}" data-orgId="{$v['org_id']}">
  153. <div class="patrol-title">
  154. <div class="patrol-title-left">{$v['title']}</div>
  155. {if $v['status'] == 0}
  156. <text class="patrol-title-right" style="color:orange;">未执行</text>
  157. {elseif($v['status'] == 1)}
  158. <text class="patrol-title-right" style="color:orange;">执行中</text>
  159. {elseif($v['status'] == 2)}
  160. <text class="patrol-title-right" style="color:green;">已完成</text>
  161. {elseif($v['status'] == 3)}
  162. <text class="patrol-title-right" style="color:gray;">未完成</text>
  163. {elseif($v['status'] == 5)}
  164. <text class="patrol-title-right" style="color:red;">中断</text>
  165. {elseif($v['status'] == 6)}
  166. <text class="patrol-title-right" style="color:red;">已关闭</text>
  167. {/if}
  168. </div>
  169. <div class="patrol-content">
  170. <div class="patrol-start-time">
  171. <text class="left">任务开始时间:</text>
  172. <text class="right">{$v['start_time']}</text>
  173. </div>
  174. <div class="patrol-end-time">
  175. <text class="left">任务结束时间:</text>
  176. <text class="right">{$v['end_time']}</text>
  177. </div>
  178. <div class="patrol-dep">
  179. <text class="left">执行人员部门:</text>
  180. <text class="right">{$v['dep']}</text>
  181. </div>
  182. <div class="patrol-user">
  183. <text class="left">执行人员名称:</text>
  184. <text class="right">{$v['real_name']}</text>
  185. </div>
  186. </div>
  187. </div>
  188. {/foreach}
  189. </div>
  190. </div>
  191. {else /}
  192. <div class="nulldata">
  193. <img src="/img/nulldata.png" alt="">
  194. <div class="nulldata-text">空空如也 ~</div>
  195. </div>
  196. {/if}
  197. <div class="footer-back">
  198. <a href="javascript:;" onclick="javascript:history.back(-1);"><img src="/img/back.png"></a>
  199. </div>
  200. </body>
  201. </html>
  202. <script>
  203. function patrolDetails(obj) {
  204. var obj = $(obj);
  205. var id = $(obj).attr('data-id');
  206. var orgId = $(obj).attr('data-orgId');
  207. var url = "{:url('Statistics/patrolDetails')}?id="+id+'&orgId='+orgId;
  208. window.location.href=url;
  209. }
  210. </script>
  211. <script>
  212. var type = '{$type}';
  213. var orgId = '{$orgId}';
  214. var day= '{$day}';
  215. var mode= '{$mode}';
  216. var count= '<?=count($list)?>';
  217. $(function(){
  218. // 页数
  219. var page = 1;
  220. // 每页展示20个
  221. var size = 20;
  222. // dropload
  223. $('.container').dropload({
  224. scrollArea : window,
  225. domDown : {
  226. domClass : 'dropload-down',
  227. domRefresh : '<div class="dropload-refresh">↑上拉加载更多</div>',
  228. domLoad : '<div class="dropload-load"><span class="loading"></span>加载中...</div>',
  229. domNoData : '<div class="dropload-noData"></div>'
  230. },
  231. loadDownFn : function(me){
  232. page++;
  233. // 拼接HTML
  234. var result = '';
  235. var url= "{:url('Statistics/patrolList')}";
  236. $.ajax({
  237. type: 'GET',
  238. url: url+'?page='+page+'&size='+size+'&type='+type+'&orgId='+orgId+'&day='+day+'&mode='+mode+'&dropload=1',
  239. dataType: 'json',
  240. success: function(res){
  241. var data = res.data;
  242. var arrLen = data.length;
  243. if(arrLen > 0){
  244. for(var i = 0; i < data.length; i++){
  245. if(arrLen > 0){
  246. result +='<div class="patrol-all" onclick="patrolDetails(this)" data-id="'+data[i].id+'" data-orgId="'+data[i].orgId+'">';
  247. result +='<div class="patrol-title">';
  248. result +='<div class="patrol-title-left">'+data[i].title+'</div>';
  249. if(data[i].status ==0){
  250. result +='<text class="patrol-title-right" style="color:orange;">未执行</text>';
  251. }
  252. if(data[i].status ==1){
  253. result +='<text class="patrol-title-right" style="color:orange;">执行中</text>';
  254. }
  255. if(data[i].status ==2){
  256. result +='<text class="patrol-title-right" style="color:green;">已完成</text>';
  257. }
  258. if(data[i].status ==3){
  259. result +='<text class="patrol-title-right" style="color:gray;">未完成</text>';
  260. }
  261. if(data[i].status ==5){
  262. result +='<text class="patrol-title-right" style="color:red;">中断</text>';
  263. }
  264. if(data[i].status ==6){
  265. result +='<text class="patrol-title-right" style="color:red;">已关闭</text>';
  266. }
  267. result +='</div>';
  268. result +='<div class="patrol-content">';
  269. result +='<div class="patrol-start-time">';
  270. result +='<text class="left">任务开始时间:</text>';
  271. result +='<text class="right">'+data[i].startTime+'</text>';
  272. result +='</div>';
  273. result +='<div class="patrol-end-time">';
  274. result +='<text class="left">任务结束时间:</text>';
  275. result +='<text class="right">'+data[i].endTime+'</text>';
  276. result +='</div>';
  277. result +='<div class="patrol-dep">';
  278. result +='<text class="left">执行人员部门:</text>';
  279. result +='<text class="right">'+data[i].dep+'</text>';
  280. result +='</div>';
  281. result +='<div class="patrol-user">';
  282. result +='<text class="left">执行人员名称:</text>';
  283. result +='<text class="right">'+data[i].realName+'</text>';
  284. result +='</div>';
  285. result +='</div>';
  286. result +='</div>';
  287. result +='</div>';
  288. }
  289. }
  290. // 如果没有数据
  291. }else{
  292. // 锁定
  293. me.lock();
  294. // 无数据
  295. me.noData();
  296. }
  297. //延迟1秒加载
  298. setTimeout(function(){
  299. // 插入数据到页面,放到最后面
  300. $('.patrol-lists').append(result);
  301. // 每次数据插入,必须重置
  302. me.resetload();
  303. },1000);
  304. },
  305. error: function(xhr, type){
  306. // 即使加载出错,也得重置
  307. me.resetload();
  308. }
  309. });
  310. },
  311. threshold : 50
  312. });
  313. });
  314. </script>