portal html css js resource

cmp-UnstaffList.js 3.1KB

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