portal html css js resource

cmp-UnstaffList.js 2.9KB

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