portal html css js resource

cmp-UnstaffList.js 3.1KB

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