|
$(document).ready(function() {
$(".onlogin .headnavbtn li").eq(0).addClass("navcurrent");
var id = $.cookie('orgId');
if(id == "" || id == null || id == "null"){
location.href = "cmp-settled-log.html";
}
/*获取企业未认证的用户*/
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();
/*企业未认证用户html*/
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 userRadius'>"
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('提示', '服务器请求失败')
}
})
})
})
|