patrol_list.html 12 KB

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