Nessuna descrizione

WorkList.html 6.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  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 href="../css/Common.css?v=0619" rel="stylesheet" />
  11. <link rel="stylesheet" href="../css/iconfont.css" />
  12. </head>
  13. <body>
  14. <div class="hy_loading" id="hy_loading">
  15. <img class="loading_img" src="../images/loading-0.gif" alt="加载中" />
  16. </div>
  17. <div class="mui-content mui-content mui-scroll-wrapper workList" id="pullrefresh">
  18. <div class="mui-scroll">
  19. <ul class="mui-table-view" id="OA_task_2">
  20. <li class="mui-table-view-cell">
  21. <div class="mui-input-row mui-search">
  22. <input type="search" class="mui-input-clear go_search" placeholder="请输入关键字" style="margin-bottom: 0;">
  23. </div>
  24. <div class="mui-btn mui-btn-primary turnGo">更多</div>
  25. </li>
  26. </ul>
  27. </div>
  28. </div>
  29. <script src="../js/zepto.js"></script>
  30. <script src="../js/mui.min.js"></script>
  31. <script src="../Script/Common/huayi.config.js"></script>
  32. <script src="../Script/Common/huayi.http.js"></script>
  33. <script type="text/javascript">
  34. var page = 1; //页数
  35. var pageSize = 10; //每页显示条目
  36. var total; //数据总条数
  37. var keyw;
  38. var state = helper.request.queryString("state"); //手机号
  39. var name = helper.request.queryString("name"); //手机号
  40. var tel = helper.request.queryString("tel"); //受理编号
  41. var starttime = helper.request.queryString("starttime"); //受理编号
  42. var endtime = helper.request.queryString("endtime"); //受理编号
  43. var workid = helper.request.queryString("workid"); //受理编号
  44. var source = helper.request.queryString("source"); //受理编号
  45. var infotype = helper.request.queryString("infotype"); //受理编号
  46. mui.init({
  47. swipeBack: false,
  48. pullRefresh: {
  49. container: '#pullrefresh',
  50. up: {
  51. contentrefresh: "正在加载...", //可选,正在加载状态时,上拉加载控件上显示的标题内容
  52. contentnomore: '没有更多数据了', //可选,请求完毕若没有更多数据时显示的提醒内容;
  53. callback: pullupRefresh
  54. }
  55. }
  56. });
  57. //查找
  58. $('.go_search').on('input focus', function() {
  59. keyw = $(this).val();
  60. page = 1;
  61. Ajax();
  62. })
  63. Ajax();
  64. //下拉刷新
  65. function pullupRefresh() {
  66. setTimeout(function() {
  67. mui('#pullrefresh').pullRefresh().endPullupToRefresh((page++ >= Math.ceil(total / 10)));
  68. $.ajax({
  69. url: huayi.config.callcenter_url + 'WxLogin/GetList',
  70. data: {
  71. openid: helper.cookies.get("openid"), //微信openid
  72. key: keyw,
  73. page: page,
  74. state: state,
  75. name: name, ///联系人
  76. tel: tel, //联系电话
  77. starttime: starttime, //
  78. endtime: endtime, //
  79. workid: workid, //工单编号
  80. source: source, //工单来源
  81. infotype: infotype, //信息分类
  82. pagesize: pageSize
  83. },
  84. async: true,
  85. dataType: 'json',
  86. type: 'get', //HTTP请求类型
  87. success: function(data) {
  88. total = data.total;
  89. $(data.rows).each(function(i, n) {
  90. var States = n.State;//0待处理 1已处理
  91. var html = ''
  92. var Html = '';
  93. if(States < 1) {
  94. Html = '<div class="mui-slider-right mui-disabled" >' +
  95. '<a class="mui-btn mui-btn-grey"> 处理 </a></div >' +
  96. '<div class="mui-slider-handle">'
  97. html = '<h5 class="wait" style="text-align:right;"><span>待处理</span></h5>'
  98. } else {
  99. html = '<h5 class="success" style="text-align:right;"><span>已处理</span></h5>'
  100. }
  101. $('<li class="mui-table-view-cell order" data-index="' + n.ID + '">' +
  102. '' + Html + '' +
  103. '<div class="mui-table-cell mui-col-xs-10" >' +
  104. '<h4 class="mui-ellipsis">' + n.Detail + '</h4>' +
  105. '<h5><span>联系人:' + n.Customer + '</span>' +
  106. '</h5>' +
  107. '</div>' +
  108. '</div> ' +
  109. '' + html + '' +
  110. '</li> ').appendTo('#OA_task_2 ');
  111. })
  112. //工单跳转
  113. $('.order').on('tap', function() {
  114. var index = $(this).attr('data-index');
  115. window.location.href = "Schedule.html?id=" + index;
  116. });
  117. },
  118. error: function(xhr, type, errorThrown) {
  119. //异常处理;
  120. }
  121. })
  122. }, 1000);
  123. }
  124. //获取数据
  125. function Ajax() {
  126. $(".order").remove();
  127. $.ajax({
  128. url: huayi.config.callcenter_url + 'WxLogin/GetList',
  129. data: {
  130. openid: helper.cookies.get("openid"), //微信openid ,
  131. key: keyw,
  132. page: page,
  133. state: state,
  134. name: name, ///联系人
  135. tel: tel, //联系电话
  136. starttime: starttime, //
  137. endtime: endtime, //
  138. workid: workid, //工单编号
  139. source: source, //工单来源
  140. infotype: infotype, //信息分类
  141. pagesize: pageSize
  142. },
  143. async: true,
  144. dataType: 'json',
  145. type: 'get', //HTTP请求类型
  146. success: function(data) {
  147. if(document.getElementById('hy_loading')){
  148. document.getElementById('hy_loading').style.opacity = 0;
  149. document.getElementById('hy_loading').remove();
  150. }
  151. if(data.state.toLowerCase() == "success") {
  152. total = data.total;
  153. if(data.rows && data.rows.length > 0) {
  154. $(data.rows).each(function(i, n) {
  155. var States = n.State;
  156. var html = ''
  157. if(States < 1) {
  158. html = '<h5 class="wait" style="text-align:right;"><span>待处理</span></h5>'
  159. } else {
  160. html = '<h5 class="success" style="text-align:right;"><span>已处理</span></h5>'
  161. }
  162. $('<li class="mui-table-view-cell order" data-index="' + n.ID + '">' +
  163. '<div class = "mui-table-cell mui-col-xs-10" >' +
  164. '<h4 class = "mui-ellipsis">' + n.Detail + '</h4>' +
  165. '<h5><span>联系人:' + n.Customer + '</span>' +
  166. '</h5>' +
  167. '</div>' +
  168. '</div> ' +
  169. '' + html + '' +
  170. '</li>').appendTo('#OA_task_2 ');
  171. });
  172. //工单跳转
  173. $('.order').on('tap', function() {
  174. var index = $(this).attr('data-index');
  175. window.location.href = "Schedule.html?id=" + index;
  176. });
  177. }
  178. }
  179. },
  180. error: function(xhr, type, errorThrown) {
  181. //异常处理;
  182. }
  183. })
  184. }
  185. $('.turnGo').on('tap', function() {
  186. window.location.href = "WorkSearch.html";
  187. })
  188. </script>
  189. </body>
  190. </html>