portal html css js resource

cmp-UnstaffList.js 3.0KB

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