curingFN.js 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. /**
  2. * 分页列表--刷新用户列表
  3. * @param parameter
  4. * @param currentPage
  5. * @returns
  6. */
  7. function refreshCuringPagination(parameter,currentPage){
  8. $.ajax({
  9. cache :false,
  10. type: 'get',
  11. url: '/cloud/curing/ajax/getCuringPage/'+currentPage+parameter,
  12. dataType: 'json',
  13. success: function(data) {
  14. if (data.status == 1) {
  15. fnStructureCuringUser(data.curingList);
  16. fnPage(data.pageData);
  17. } else {
  18. alert(data.msg);
  19. }
  20. }
  21. })
  22. }
  23. /**
  24. * 筛选-统一请求--刷新用户列表
  25. * @returns
  26. */
  27. function refreshCuringPage(compilation,latestCompilation,sortField,sort,wd){
  28. $.ajax({
  29. cache :false,
  30. type: 'get',
  31. url: '/cloud/curing/ajax/refreshCuringPage?sortField='+sortField+'&sort='+sort+'&compilation='+compilation+'&latestCompilation='+latestCompilation+
  32. '&wd='+wd,
  33. dataType: 'json',
  34. success: function(data) {
  35. if (data.status == 1) {
  36. fnStructureCuringUser(data.curingList);
  37. fnPage(data.pageData);
  38. } else {
  39. alert(data.msg);
  40. }
  41. }
  42. })
  43. }
  44. /**
  45. * 通行证账号检索用户--刷新列表和分页
  46. * @returns
  47. */
  48. function fnMobile2Info(){
  49. mobile2InfoTimeout = null;
  50. if((/^1[34578]\d{9}$/.test(mobile))) {
  51. refreshCuringPage('','','','',mobile);
  52. }
  53. }
  54. /**
  55. * 刷新用户详情页
  56. * @param ssoid
  57. * @param client_id
  58. * @returns
  59. */
  60. function refreshCuringPageDetail(ssoid,client_id){
  61. $.ajax({
  62. cache :false,
  63. type: 'GET',
  64. url: '/cloud/curing/ajax/getCuringBySsoid',
  65. data: {ssoid: encodeURI(ssoid),client_id:encodeURI(client_id)},
  66. dataType: 'json',
  67. success: function(data){
  68. if(data.status==1||data.status==2){
  69. //设置 养护用户信息
  70. var objHtml=buildCuringInfo(data.detail.userInfo);
  71. $('div[curingInfo] curing').html(objHtml);
  72. $('div[curingInfo] curingClient').html('');
  73. //设置CLD客户信息
  74. if(data.detail.curingInfo.updateTotal!=0){
  75. //$("#id").val(id);
  76. var clientHtml=relevanceClient(data.detail.clientInfo);
  77. $('div[curingInfo] curingClient').html(clientHtml);
  78. }
  79. //设置养护详情页里产品升级信息
  80. var upMajorBoxHtml=buildCuringCompilation(data);
  81. $('tbody[upMajorBox]').html(upMajorBoxHtml);
  82. //更新在线时长
  83. var onlineTimesHtml=buildCuringOnlineTimes(data.detail.userInfo.online_list);
  84. $('tbody[onlineTimes]').html(onlineTimesHtml);
  85. //设置参数
  86. $('#curingSsoid').val(data.detail.userInfo.ssoIdKey);
  87. $('#curingMobile').val(data.detail.userInfo.mobile);
  88. $('#client_id').val(data.detail.clientInfo.cidKey);
  89. //设置养护日志
  90. var operateLogHtml=buildCuringOperateLog(data.detail.operateLog);
  91. $('div[operateLog] curingOperate').html(operateLogHtml);
  92. setTimeout(autoHeight, 400);
  93. //autoHeight();
  94. $('#detail').modal('show');
  95. }else if(data.status==3){
  96. alert(data.msg);
  97. }
  98. },
  99. error: function(xhr, type){
  100. console.log('Ajax error!')
  101. }
  102. })
  103. }
  104. /**
  105. * DOM加载完毕后初始化
  106. * @returns
  107. */
  108. function init(){
  109. refreshColumn(columnLength);
  110. }