PingAnYeXianSZCG_Web 前端代码

WorkList.html 5.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>工单列表</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
  7. <meta name="apple-mobile-web-app-capable" content="yes">
  8. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  9. <link href="../css/mui.min.css" rel="stylesheet" />
  10. <link rel="stylesheet" href="../css/iconfont.css" />
  11. <!-- <link rel="stylesheet" href="../css/inits.css" />-->
  12. <style>
  13. .mui-bar-popover {
  14. width: 30%;
  15. }
  16. .mui-popover.mui-bar-popover .mui-table-view {
  17. width: 100%;
  18. }
  19. .san {
  20. font-size: 14px;
  21. margin-right: 5px
  22. }
  23. .nav_a {
  24. border-right: 1px solid #ccc;
  25. }
  26. .time {
  27. text-align: right;
  28. }
  29. .mui-table-view .mui-media-object {
  30. /* line-height: 71px; */
  31. max-width: 80px;
  32. height: 80px;
  33. }
  34. input[type=search] {
  35. border: 1px solid #ccc;
  36. border-radius: 18px;
  37. background-color: rgb(255, 255, 255);
  38. }
  39. </style>
  40. </head>
  41. <body>
  42. <div class="mui-content mui-content mui-scroll-wrapper" id="pullrefresh">
  43. <div class="mui-scroll">
  44. <ul class="mui-table-view" id="OA_task_2">
  45. <li class="mui-table-view-cell mui-media">
  46. <div class="mui-slider-right mui-disabled">
  47. <a class="mui-btn mui-btn-grey">处理</a>
  48. </div>
  49. <div class="mui-slider-handle">
  50. <div class="mui-table-cell mui-col-xs-10">
  51. <h4 class="mui-ellipsis">信息化推进办公室张彦合同付款信息化</h4>
  52. <h5>申请人:李四</h5>
  53. </div>
  54. </div>
  55. </li>
  56. </ul>
  57. </div>
  58. </div>
  59. <script src="../js/mui.min.js"></script>
  60. <script src="../js/zepto.js"></script>
  61. <script src="../Script/Common/huayi.config.js"></script>
  62. <script src="../Script/Common/huayi.http.js"></script>
  63. <script type="text/javascript">
  64. var page = 1; //页数
  65. var pageSize = 10; //每页显示条目
  66. var total; //数据总条数
  67. mui.init({
  68. swipeBack: false,
  69. pullRefresh: {
  70. container: '#pullrefresh',
  71. up: {
  72. contentrefresh: "正在加载...", //可选,正在加载状态时,上拉加载控件上显示的标题内容
  73. contentnomore: '没有更多数据了', //可选,请求完毕若没有更多数据时显示的提醒内容;
  74. callback: pullupRefresh
  75. }
  76. }
  77. });
  78. Ajax();
  79. //下拉刷新
  80. function pullupRefresh() {
  81. setTimeout(function() {
  82. mui('#pullrefresh').pullRefresh().endPullupToRefresh((page++ >= Math.ceil(total / 10)));
  83. $.ajax({
  84. url: huayi.config.callcenter_url + 'WxLogin/GetList',
  85. data: {
  86. openid: helper.cookies.get("openid"), //微信openid
  87. page:page,
  88. pagesize:pageSize
  89. },
  90. async: true,
  91. dataType: 'json',
  92. type: 'get', //HTTP请求类型
  93. success: function(data) {
  94. console.log(data);
  95. $('<li class="mui-table-view-cell mui-media order" data-index="'+n.WorkOrderID+'">' +
  96. '<div class = "mui-slider-right mui-disabled" >' +
  97. '<a class = "mui-btn mui-btn-grey" > 处理 </a></div >' +
  98. '<div class = "mui-slider-handle" >' +
  99. '<div class = "mui-table-cell mui-col-xs-10" > ' +
  100. '<h4 class = "mui-ellipsis" > 信息化推进办公室张彦合同付款信息化 </h4> ' +
  101. '<h5 > 申请人: 李四 </h5>' +
  102. '</div >' +
  103. '</div> ' +
  104. '</li > ').appendTo('#OA_task_2 ');
  105. //工单跳转
  106. $('.order').on('tap', function() {
  107. var index = $(this).attr('data-index');
  108. window.location.href = "Schedule.html?id="+index;
  109. });
  110. },
  111. error: function(xhr, type, errorThrown) {
  112. //异常处理;
  113. }
  114. })
  115. }, 1000);
  116. }
  117. //获取数据
  118. function Ajax() {
  119. $.ajax({
  120. url: huayi.config.callcenter_url + 'WxLogin/GetList',
  121. data: {
  122. openid: helper.cookies.get("openid"), //微信openid ,
  123. page:page,
  124. pagesize:pageSize
  125. },
  126. async: true,
  127. dataType: 'json',
  128. type: 'get', //HTTP请求类型
  129. success: function(data) {
  130. // var con=JSON.parse(data);
  131. // total=con.total;
  132. total = data.total;
  133. console.log(data);
  134. $(data.rows).each(function(i,n){
  135. $('<li class="mui-table-view-cell order" data-index="'+n.ID+'">' +
  136. '<div class = "mui-slider-right mui-disabled" >' +
  137. '<a class = "mui-btn mui-btn-grey" > 处理 </a></div >' +
  138. '<div class = "mui-slider-handle" >' +
  139. '<div class = "mui-table-cell mui-col-xs-10" > ' +
  140. '<h4 class = "mui-ellipsis" > 信息化推进办公室张彦合同付款信息化 </h4> ' +
  141. '<h5 > 申请人: 李四 </h5>' +
  142. '</div >' +
  143. '</div> ' +
  144. '</li > ').appendTo('#OA_task_2 ');
  145. })
  146. //工单跳转
  147. $('.order').on('tap', function() {
  148. var index = $(this).attr('data-index');
  149. window.location.href = "Schedule.html?id="+index;
  150. });
  151. },
  152. error: function(xhr, type, errorThrown) {
  153. //异常处理;
  154. }
  155. })
  156. }
  157. //右滑动效果
  158. var btnArray = ['确认', '取消'];
  159. //第二个demo,向左拖拽后显示操作图标,释放后自动触发的业务逻辑
  160. $('#OA_task_2').on('slideright', '.mui-table-view-cell', function(event) {
  161. var elem = this;
  162. var li = elem.parentNode.parentNode;
  163. mui.confirm('确认删除该条记录?', 'Hello MUI', btnArray, function(e) {
  164. if(e.index == 0) {
  165. li.parentNode.removeChild(li);
  166. } else {
  167. setTimeout(function() {
  168. $.swipeoutClose(li);
  169. }, 0);
  170. }
  171. });;
  172. });
  173. </script>
  174. </body>
  175. </html>