123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- $(document).ready(function() {
- var id = $.cookie('orgId');
-
- function UnauthorizedUser() {
- $.ajax({
- url: "/ajax/professor/qaOrgAuth",
- type: "GET",
- timeout: 10000,
- dataType: "json",
- data: {
- "orgId": id,
- "orgAuth": 0
- },
- success: function(data, textState) {
- if(data.success) {
- console.log(data);
- var $data = data.data;
- UnauthorizedUserHtml($data, "#UnauthorizedUserList", 1);
- }
- },
- error: function(XMLHttpRequest, textStats, errorThrown) {
- $.MsgBox.Alert('提示', '服务器请求失败')
- }
- })
- }
- UnauthorizedUser();
-
- function UnauthorizedUserHtml() {
- var arr = new Array();
- for(var i = 0; i < arguments[0].length; i++) {
- var img, tiof, deor, otex;
- if(arguments[0][i].hasHeadImage) {
- img = "/images/head/" + arguments[0][i].id + "_l.jpg";
- } else {
- img = "../images/default-photo.jpg"
- }
- if(arguments[0][i].title) {
- if(arguments[0][i].office) {
- tiof = arguments[0][i].title + " ," + arguments[0][i].office;
- } else {
- tiof = arguments[0][i].title;
- }
- } else {
- if(arguments[0][i].office) {
- tiof = arguments[0][i].office;
- } else {
- tiof = "";
- }
- }
- if(arguments[0][i].department) {
- if(arguments[0][i].orgName) {
- deor = arguments[0][i].department + " ," + arguments[0][i].orgName;
- } else {
- deor = arguments[0][i].department;
- }
- } else {
- if(arguments[0][i].orgName) {
- deor = arguments[0][i].orgName;
- } else {
- deor = "";
- }
- }
- if(arguments[2] == 1) {
- otex = "待认证";
- } else {
- otex = "移除";
- }
- var oString = "<li>"
- oString += "<div class='leftlogo floatL headRadius'>"
- oString += "<img class='headPhoto' src='" + img + "' width='100%'>"
- oString += "</div>"
- oString += "<div class='rightinfo staffinfo floatL'>"
- oString += "<p class='h3Font'>" + arguments[0][i].name + "</p>"
- oString += "<p class='h5Font ellipsisSty'>" + tiof + "</p>"
- oString += "<p class='h5Font ellipsisSty'>" + deor + "</p>"
- oString += "</div>"
- oString += "<button type='button' class='frmtype fontLink btnPosition cmpColor headRadius' data-id='" + arguments[0][i].id + "'>" + otex + "</button>"
- oString += "</li>"
- $(arguments[1]).append(oString);
- }
- }
-
- $("#UnauthorizedUserList").on("click", "button", function() {
- var oDataId = $(this).attr("data-id");
- var oDa = $(this);
- $.ajax({
- url: "/ajax/professor/passOrgAuth",
- type: "POST",
- timeout: 10000,
- dataType: "json",
- data: {
- "id": oDataId,
- },
- success: function(data, textState) {
- if(data.success) {
- oDa.text("已认证")
- }
- },
- error: function(XMLHttpRequest, textStats, errorThrown) {
- $.MsgBox.Alert('提示', '服务器请求失败')
- }
- })
- })
- })
|