No Description

list.html 7.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  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 href="../css/mui.picker.css" rel="stylesheet" />
  11. <link href="../css/mui.poppicker.css" rel="stylesheet" />
  12. <link href="../css/iconfont.css" rel="stylesheet" />
  13. <link href="css/index.css" rel="stylesheet" />
  14. </head>
  15. <body>
  16. <div class="mui-nav">
  17. <a class="mui-icon mui-icon-arrowleft return"></a>
  18. 工单列表
  19. <span class="type_down mui-icon mui-icon-settings" style="font-size: 22px;"></span>
  20. </div>
  21. <div class="mui-content mui-content mui-scroll-wrapper workList" id="pullrefresh" style="margin-top: 35px;">
  22. <div class="mui-scroll">
  23. <ul class="mui-table-view" id="OA_task_2">
  24. </ul>
  25. </div>
  26. <div class="noinfor" style="text-align: center; font-size: 16px;">
  27. </div>
  28. <script src="../js/zepto.js"></script>
  29. <script src="../js/mui.min.js"></script>
  30. <script src="../Script/Common/huayi.config.js"></script>
  31. <script src="../Script/Common/huayi.http.js"></script>
  32. <script type="text/javascript">
  33. var openid = helper.cookies.get("openid");
  34. var UserType = helper.cookies.get("usertype");
  35. var itype = helper.request.queryString("itype");
  36. var page = 1; //页数
  37. var pageSize = 10; //每页显示条目
  38. var total; //数据总条数
  39. if(itype == "") {
  40. itype = -1;
  41. } else {
  42. itype = helper.request.queryString("itype");
  43. }
  44. mui.init({
  45. swipeBack: false,
  46. pullRefresh: {
  47. container: '#pullrefresh',
  48. up: {
  49. contentrefresh: "正在加载...", //可选,正在加载状态时,上拉加载控件上显示的标题内容
  50. contentnomore: '没有更多数据了', //可选,请求完毕若没有更多数据时显示的提醒内容;
  51. callback: pullupRefresh
  52. }
  53. }
  54. });
  55. $('.type_down').on('tap', function() {
  56. var index = $(this).attr('data-index');
  57. window.location.href = "Seach.html";
  58. });
  59. $('.return').on('tap', function() {
  60. window.location.href = "../client-side/Setting-1.html";
  61. // if (UserType==4) {
  62. // window.location.href = "report-index.html";
  63. // } else{
  64. // window.location.href = "report.html";
  65. // }
  66. });
  67. Ajax();
  68. //下拉刷新
  69. function pullupRefresh() {
  70. setTimeout(function() {
  71. mui('#pullrefresh').pullRefresh().endPullupToRefresh((page++ >= Math.ceil(total / 10)));
  72. $.ajax({
  73. url: huayi.config.callcenter_url + 'WxLogin/GetList',
  74. data: {
  75. ltype: itype,
  76. openid: helper.cookies.get("openid"), //微信openid
  77. page: page,
  78. pagesize: pageSize
  79. },
  80. async: true,
  81. dataType: 'json',
  82. type: 'get', //HTTP请求类型
  83. success: function(data) {
  84. total = data.total;
  85. if(data.rows && data.rows.length > 0) {
  86. data.rows.WorkOrderID
  87. $(data.rows).each(function(i, n) {
  88. if(n.CreateUser == "") {
  89. receiver = '</span><span class="font-color1">未选择创建人</span>'
  90. } else {
  91. receiver = '</span><span class="font-color3">创建人' + n.CreateUser + '</span>'
  92. //receiver= '受理人:'+n.CreateUser
  93. }
  94. var statedet;
  95. if (n.State==0) {
  96. statedet='待派单';
  97. } else if (n.State==1) {
  98. statedet='待处理';
  99. } else{
  100. statedet='已完成';
  101. }
  102. var builName
  103. if (n.buildingname==null) {
  104. builName=""
  105. } else{
  106. builName=n.buildingname
  107. }
  108. var proName
  109. if (n.proname==null) {
  110. proName=""
  111. } else{
  112. proName=n.proname
  113. }
  114. console.log(n.Customer);
  115. // |<button class="mui-btn-primary">重要' + '</button> 重要程度
  116. $('<a class="mui-card mui-card-detail order" data-index="' + n.WorkOrderID + '"><div class="mui-card-header"><div class="fl"><span>' + n.TypeClassName +
  117. '</span>|<span>' + n.OwnerRelations +
  118. '</span><span>' + statedet +
  119. '</span></div><div class="fr"><span>' + n.CreateTime +
  120. '</span></div></div>' +
  121. '<div class="mui-card-content"><div class="mui-card-content-inner"><p class="font-color2 details_line">' + n.Detail +
  122. '</p><p class="font-color3 margin">' + n.areaname + proName + builName +
  123. '</p><div class="mui-card-content-inner-span"><span id="">' + n.Customer +
  124. '</span><span id="">' + n.CustomerTel + receiver +
  125. '</div></div></div></a>').appendTo('#OA_task_2');
  126. });
  127. //工单跳转
  128. $('.order').on('tap', function() {
  129. var index = $(this).attr('data-index');
  130. window.location.href = "details.html?id=" + index + '&itype=' + itype;
  131. });
  132. }
  133. },
  134. error: function(xhr, type, errorThrown) {
  135. //异常处理;
  136. }
  137. })
  138. }, 1000);
  139. }
  140. //获取数据
  141. function Ajax() {
  142. $(".order").remove();
  143. $.ajax({
  144. url: huayi.config.callcenter_url + 'WxLogin/GetList',
  145. data: {
  146. ltype: itype,
  147. openid: helper.cookies.get("openid"), //微信openid
  148. page: page,
  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. if(data.rows && data.rows.length > 0) {
  160. data.rows.WorkOrderID
  161. $(data.rows).each(function(i, n) {
  162. if(n.CreateUser == "") {
  163. receiver = '</span><span class="font-color1">未选择创建人</span>'
  164. } else {
  165. receiver = '</span><span class="font-color3">创建人' + n.CreateUser + '</span>'
  166. //receiver= '受理人:'+n.CreateUser
  167. }
  168. var statedet;
  169. if (n.State==0) {
  170. statedet='待派单';
  171. } else if (n.State==1) {
  172. statedet='待处理';
  173. } else{
  174. statedet='已完成';
  175. }
  176. console.log(n.Customer);
  177. var builName
  178. if (n.buildingname==null) {
  179. builName=""
  180. } else{
  181. builName=n.buildingname
  182. }
  183. var proName
  184. if (n.proname==null) {
  185. proName=""
  186. } else{
  187. proName=n.proname
  188. }
  189. // |<button class="mui-btn-primary">重要' + '</button> 重要程度
  190. $('<a class="mui-card mui-card-detail order" data-index="' + n.WorkOrderID + '"><div class="mui-card-header"><div class="fl"><span>' + n.TypeClassName +
  191. '</span>|<span>' + n.OwnerRelations +
  192. '</span><span>' + statedet +
  193. '</span></div><div class="fr"><span>' + n.CreateTime +
  194. '</span></div></div>' +
  195. '<div class="mui-card-content"><div class="mui-card-content-inner"><p class="font-color2 details_line">' + n.Detail +
  196. '</p><p class="font-color3 margin">' + n.areaname + proName + builName +
  197. '</p><div class="mui-card-content-inner-span"><span id="">' + n.Customer +
  198. '</span><span id="">' + n.CustomerTel + receiver +
  199. '</div></div></div></a>').appendTo('#OA_task_2');
  200. });
  201. //工单跳转
  202. $('.order').on('tap', function() {
  203. var index = $(this).attr('data-index');
  204. window.location.href = "details.html?id=" + index + '&itype=' + itype;
  205. });
  206. }else{
  207. $(".noinfor").text("暂无信息");
  208. }
  209. },
  210. error: function(xhr, type, errorThrown) {
  211. //异常处理;
  212. }
  213. })
  214. }
  215. </script>
  216. </body>
  217. </html>