Nenhuma Descrição

WorkCL.html 7.5KB

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