暫無描述

WorkCL.html 7.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  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 name = helper.request.queryString("name"); //姓名
  47. var tel = helper.request.queryString("tel"); //受理编号
  48. mui.init({
  49. swipeBack: false,
  50. pullRefresh: {
  51. container: '#pullrefresh',
  52. up: {
  53. contentrefresh: "正在加载...", //可选,正在加载状态时,上拉加载控件上显示的标题内容
  54. contentnomore: '没有更多数据了', //可选,请求完毕若没有更多数据时显示的提醒内容;
  55. callback: pullupRefresh
  56. }
  57. }
  58. });
  59. //查找
  60. $('.go_search').on('input focus', function() {
  61. keyw = $(this).val();
  62. page = 1;
  63. Ajax();
  64. })
  65. Ajax();
  66. //下拉刷新
  67. function pullupRefresh() {
  68. setTimeout(function() {
  69. mui('#pullrefresh').pullRefresh().endPullupToRefresh((page++ >= Math.ceil(total / 10)));
  70. $.ajax({
  71. url: huayi.config.callcenter_url + 'WxLogin/GetList',
  72. data: {
  73. openid: helper.cookies.get("openid"), //微信openid
  74. key: keyw,
  75. page: page,
  76. pagesize: pageSize,
  77. name: name, ///联系人
  78. tel: tel, //联系电话
  79. // state: state,
  80. // starttime: starttime, //
  81. // endtime: endtime, //
  82. // workid: workid, //工单编号
  83. // source: source, //工单来源
  84. // infotype: infotype, //信息分类
  85. },
  86. async: true,
  87. dataType: 'json',
  88. type: 'get', //HTTP请求类型
  89. success: function(data) {
  90. total = data.total;
  91. $(data.rows).each(function(i, n) {
  92. var States = n.State;
  93. var html = ''
  94. var Html = '';
  95. if(States < 2) {//0,1 待完成 2已完成
  96. Html = '<div class = "mui-slider-right mui-disabled" >' +
  97. '<a class = "mui-btn mui-btn-grey" > 处理 </a></div >' +
  98. '<div class = "mui-slider-handle" >'
  99. html = '<h5 class="wait" style="text-align:right;"><span>待完成</span></h5>'
  100. } else {
  101. html = '<h5 class="success" style="text-align:right;"><span>已完成</span></h5>'
  102. }
  103. $('<li class="mui-table-view-cell order" data-index="' + n.ID + '">' +
  104. '' + Html + '' +
  105. '<div class = "mui-table-cell mui-col-xs-10" > ' +
  106. '<h4 class = "mui-ellipsis" > ' + n.Detail + ' </h4> ' +
  107. '<h5 > <span>联系人:' + n.Customer + '</span>' +
  108. '</h5>' +
  109. '</div >' +
  110. '</div> ' +
  111. '' + html + '' +
  112. '</li > ').appendTo('#OA_task_2 ');
  113. })
  114. //去工单详情
  115. $('.order').on('tap', function() {
  116. var index = $(this).attr('data-index');
  117. window.location.href = "Schedule.html?id=" + index + '&isDeal=' + 1;
  118. });
  119. },
  120. error: function(xhr, type, errorThrown) {
  121. //异常处理;
  122. }
  123. })
  124. }, 1000);
  125. }
  126. //获取数据
  127. function Ajax() {
  128. $(".order").remove();
  129. $.ajax({
  130. url: huayi.config.callcenter_url + 'WxLogin/GetList',
  131. data: {
  132. openid: helper.cookies.get("openid"), //微信openid ,
  133. key: keyw,
  134. page: page,
  135. pagesize: pageSize,
  136. name: name, ///联系人
  137. tel: tel, //联系电话
  138. // state: state,
  139. // starttime: starttime, //
  140. // endtime: endtime, //
  141. // workid: workid, //工单编号
  142. // source: source, //工单来源
  143. // infotype: infotype, //信息分类
  144. },
  145. async: true,
  146. dataType: 'json',
  147. type: 'get', //HTTP请求类型
  148. success: function(data) {
  149. if(document.getElementById('hy_loading')){
  150. document.getElementById('hy_loading').style.opacity = 0;
  151. document.getElementById('hy_loading').remove();
  152. }
  153. total = data.total;
  154. $(data.rows).each(function(i, n) {
  155. var States = n.State;
  156. var html = ''
  157. var Html = '';
  158. if(States < 2) { //0,1 待完成 2已完成
  159. Html = '<div class = "mui-slider-right mui-disabled" >' +
  160. '<a class = "mui-btn mui-btn-grey"> 处理 </a></div >' +
  161. '<div class = "mui-slider-handle">'
  162. html = '<h5 class="wait" style="text-align:right;"><span>待完成</span></h5>'
  163. } else {
  164. html = '<h5 class="success" style="text-align:right;"><span>已完成</span></h5>'
  165. }
  166. $('<li class="mui-table-view-cell order" data-index="' + n.ID + '">' +
  167. '' + Html + '' +
  168. '<div class = "mui-table-cell mui-col-xs-10" >' +
  169. '<h4 class = "mui-ellipsis" >' + n.Detail + ' </h4> ' +
  170. '<h5 > <span>联系人:' + n.Customer + '</span>' +
  171. '</h5>' +
  172. '</div>' +
  173. '</div> ' +
  174. '' + html + '' +
  175. '</li >').appendTo('#OA_task_2');
  176. })
  177. //工单跳转 工单详情
  178. $('.order').on('tap', function() {
  179. var index = $(this).attr('data-index');
  180. window.location.href = "Schedule.html?id=" + index + '&isDeal=' + 1;
  181. });
  182. },
  183. error: function(xhr, type, errorThrown) {
  184. //异常处理;
  185. }
  186. })
  187. }
  188. (function($) {
  189. var btnArray = ['确认', '取消'];
  190. //第二个demo,向左拖拽后显示操作图标,释放后自动触发的业务逻辑
  191. $('#OA_task_2').on('slideleft', '.mui-table-view-cell', function(event) {
  192. var elem = this;
  193. var Workindex = elem.getAttribute("data-index");
  194. mui.confirm('确认要处理此工单吗?', ' ', btnArray, function(e) {
  195. if(e.index == 0) {
  196. window.location.href = "Workdeal.html?id=" + Workindex;
  197. } else {
  198. setTimeout(function() {
  199. $.swipeoutClose(elem);
  200. }, 0);
  201. }
  202. });
  203. });
  204. })(mui);
  205. //更多
  206. $('.turnGo').on('tap', function() {
  207. window.location.href = "WorkSearch.html?Tye=" + Type_;
  208. });
  209. </script>
  210. </body>
  211. </html>