portal html css js resource

cmp-UnstaffList.js 3.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. $(document).ready(function() {
  2. $(".onlogin .headnavbtn li").eq(0).addClass("navcurrent");
  3. var id = $.cookie('orgId');
  4. if(id == "" || id == null || id == "null"){
  5. location.href = "cmp-settled-log.html";
  6. }
  7. resMgr(id);
  8. /*获取企业未认证的用户*/
  9. function UnauthorizedUser() {
  10. $.ajax({
  11. url: "/ajax/professor/qaOrgAuth",
  12. type: "GET",
  13. timeout: 10000,
  14. dataType: "json",
  15. data: {
  16. "orgId": id,
  17. "orgAuth": 0
  18. },
  19. success: function(data, textState) {
  20. if(data.success) {
  21. console.log(data);
  22. var $data = data.data;
  23. UnauthorizedUserHtml($data, "#UnauthorizedUserList", 1);
  24. }
  25. },
  26. error: function(XMLHttpRequest, textStats, errorThrown) {
  27. $.MsgBox.Alert('提示', '服务器请求失败')
  28. }
  29. })
  30. }
  31. UnauthorizedUser();
  32. /*企业未认证用户html*/
  33. function UnauthorizedUserHtml() {
  34. var arr = new Array();
  35. for(var i = 0; i < arguments[0].length; i++) {
  36. var img, tiof, deor, otex;
  37. if(arguments[0][i].hasHeadImage) {
  38. img = "/images/head/" + arguments[0][i].id + "_l.jpg";
  39. } else {
  40. img = "../images/default-photo.jpg"
  41. }
  42. if(arguments[0][i].title) {
  43. if(arguments[0][i].office) {
  44. tiof = arguments[0][i].title + " ," + arguments[0][i].office;
  45. } else {
  46. tiof = arguments[0][i].title;
  47. }
  48. } else {
  49. if(arguments[0][i].office) {
  50. tiof = arguments[0][i].office;
  51. } else {
  52. tiof = "";
  53. }
  54. }
  55. if(arguments[0][i].department) {
  56. if(arguments[0][i].orgName) {
  57. deor = arguments[0][i].department + " ," + arguments[0][i].orgName;
  58. } else {
  59. deor = arguments[0][i].department;
  60. }
  61. } else {
  62. if(arguments[0][i].orgName) {
  63. deor = arguments[0][i].orgName;
  64. } else {
  65. deor = "";
  66. }
  67. }
  68. if(arguments[2] == 1) {
  69. otex = "待认证";
  70. } else {
  71. otex = "移除";
  72. }
  73. var oString = "<li>"
  74. oString += "<div class='leftlogo floatL userRadius'>"
  75. oString += "<img class='headPhoto' src='" + img + "' width='100%'>"
  76. oString += "</div>"
  77. oString += "<div class='rightinfo staffinfo floatL'>"
  78. oString += "<p class='h3Font'>" + arguments[0][i].name + "</p>"
  79. oString += "<p class='h5Font ellipsisSty'>" + tiof + "</p>"
  80. oString += "<p class='h5Font ellipsisSty'>" + deor + "</p>"
  81. oString += "</div>"
  82. oString += "<button type='button' class='frmtype fontLink btnPosition cmpColor headRadius' data-id='" + arguments[0][i].id + "'>" + otex + "</button>"
  83. oString += "</li>"
  84. $(arguments[1]).append(oString);
  85. }
  86. }
  87. /*认证企业员工*/
  88. $("#UnauthorizedUserList").on("click", "button", function() {
  89. var oDataId = $(this).attr("data-id");
  90. var oDa = $(this);
  91. $.ajax({
  92. url: "/ajax/professor/passOrgAuth",
  93. type: "POST",
  94. timeout: 10000,
  95. dataType: "json",
  96. data: {
  97. "id": oDataId,
  98. },
  99. success: function(data, textState) {
  100. if(data.success) {
  101. oDa.text("已认证")
  102. }
  103. },
  104. error: function(XMLHttpRequest, textStats, errorThrown) {
  105. $.MsgBox.Alert('提示', '服务器请求失败')
  106. }
  107. })
  108. })
  109. })