|
|
@@ -23,7 +23,27 @@ function getAccountInfo() {
|
|
|
}
|
|
|
$('.link-mall').attr('href', 'http://www.usoftmall.com/login/proxy');
|
|
|
window._hasAccountInfo = true;
|
|
|
- }
|
|
|
+ var user = data.content;
|
|
|
+ // 管理员
|
|
|
+ if(user.uid == user.uuzcUserSpaceDetail.adminTel) {
|
|
|
+ // 如果是hr
|
|
|
+ if(user.hr == 1) {
|
|
|
+ $('.link-job-get').show();
|
|
|
+ $('.link-hr-set').hide();
|
|
|
+ } else {
|
|
|
+ $('.link-hr-set').show();
|
|
|
+ $('.link-job-get').hide();
|
|
|
+ }
|
|
|
+ } else {// 非管理员
|
|
|
+ $('.link-job-get').show();
|
|
|
+ $('.link-hr-set').hide();
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ var location = window.location.pathname;
|
|
|
+ if(location.indexOf('setHrAccount') > -1) {// 如果是在设置hr页面,没有登录的话跳转到登录页面
|
|
|
+ login(event);
|
|
|
+ }
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
|
|
|
@@ -111,6 +131,31 @@ function jobUuzc() {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * 存储hrInfo,不用重新加载
|
|
|
+ *
|
|
|
+ * @type {null}
|
|
|
+ */
|
|
|
+var hrInfo = null;
|
|
|
+
|
|
|
+function getHrInfo() {
|
|
|
+ if(hrInfo == null) {
|
|
|
+ $.get('uuzc/hrInfo', function(userInfo) {
|
|
|
+ if(null != userInfo.user)
|
|
|
+ hrInfo = userInfo.user;
|
|
|
+ // 默认给相关字段赋值
|
|
|
+ $('#hrname').val(hrInfo.name);
|
|
|
+ $('#hremail').val(hrInfo.secondUID);
|
|
|
+ $('#hrtel').val(hrInfo.uid);
|
|
|
+ $('#username').val(hrInfo.name);
|
|
|
+ $('#usertel').val(hrInfo.uid);
|
|
|
+ $('#useruu').val(hrInfo.dialectUID);
|
|
|
+ $('#useremail').val(hrInfo.secondUID);
|
|
|
+ $('#userList').css('display','none');
|
|
|
+ });
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* 链接到优软众创人才招聘(招聘入口)
|
|
|
*/
|
|
|
@@ -122,14 +167,15 @@ function jobUuzcGet() {
|
|
|
if(null != data && 'personal' == data.usertype) {
|
|
|
toastr.error("您的账号为个人账号,不可进行此操作");
|
|
|
} else if(null != data && 'company' == data.usertype) {
|
|
|
- if(!data.hr) {// 企业不存在hr账号
|
|
|
- if(data.manager) {// 管理员停留设置hr
|
|
|
+ // 先判断是否管理员
|
|
|
+ if(data.manager) {
|
|
|
+ // if(!data.hr) {// 企业不存在hr账号
|
|
|
window.location.href = window.location.origin + window.location.pathname + "setHrAccount";
|
|
|
- } else {
|
|
|
- toastr.error('请通知管理员' + data.managerName + '设置HR账号');
|
|
|
- }
|
|
|
- } else {// 如果企业存在hr
|
|
|
- toastr.error('您的账号非HR账号,不可进行此操作');
|
|
|
+ // } else {// 如果企业存在hr
|
|
|
+ // toastr.error('您的账号非HR账号,不可进行此操作');
|
|
|
+ // }
|
|
|
+ } else {
|
|
|
+ toastr.error('请通知管理员' + data.managerName + '设置HR账号');
|
|
|
}
|
|
|
} else if(data.usertype =='hr') {
|
|
|
loginJobUuzc(user, loginUrl, 'hr');
|
|
|
@@ -204,18 +250,19 @@ function addHrAccount() {
|
|
|
var result = data.result;
|
|
|
if(result == 'success') {
|
|
|
toastr.success('设置HR账号成功');
|
|
|
- setTimeout(window.location.href = 'http://www.ubtob.com/#/uuzcJob', 500);
|
|
|
+ hrInfo = null; // 清空已查询的数据,重新加载
|
|
|
+ setTimeout(window.location.href = 'http://www.ubtob.com/#/uuzcJob', 2000);
|
|
|
}
|
|
|
if(result == 'exist') {
|
|
|
toastr.error('该企业HR账号已存在');
|
|
|
}
|
|
|
if(result == 'setFailure') {
|
|
|
- toastr.erroror('设置HR账号失败');
|
|
|
+ toastr.error('设置HR账号失败');
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
error: function (error) {
|
|
|
- toastr.erroror(error);
|
|
|
+ toastr.error(error);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
@@ -240,7 +287,8 @@ function setHrAccount() {
|
|
|
var result = data.result;
|
|
|
if(result == 'success') {
|
|
|
toastr.success('设置HR账号成功');
|
|
|
- setTimeout(window.location.href = 'http://www.ubtob.com/#/uuzcJob', 500);
|
|
|
+ hrInfo = null; // 清空已查询的数据,重新加载
|
|
|
+ setTimeout(window.location.href = 'http://www.ubtob.com/#/uuzcJob', 2000);
|
|
|
}
|
|
|
if(result == 'exist') {
|
|
|
toastr.error('该企业HR账号已存在');
|
|
|
@@ -298,7 +346,6 @@ function getExistUser() {
|
|
|
$('#userList').css('display','none');
|
|
|
});
|
|
|
})(i)
|
|
|
- console.log(ul.height);
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
@@ -325,7 +372,9 @@ function suspendMessage() {
|
|
|
toastr.error('网站正在升级中,敬请期待!');
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+/**
|
|
|
+ * 监听输入框值的变化设置联想
|
|
|
+ */
|
|
|
$('#username').bind('input propertychange', function() {
|
|
|
var nameList = [];
|
|
|
$("#userList").find("li").remove();// 先清除以前的样式
|
|
|
@@ -379,6 +428,9 @@ $(function() {
|
|
|
|
|
|
// 查询登录信息
|
|
|
getAccountInfo();
|
|
|
+
|
|
|
+ // 获取当前企业HR信息
|
|
|
+ getHrInfo();
|
|
|
|
|
|
// 登录点击
|
|
|
$('.link-login').click(login);
|
|
|
@@ -392,9 +444,12 @@ $(function() {
|
|
|
// 连接到众创招聘
|
|
|
$('.link-job').click(jobUuzc);
|
|
|
|
|
|
- // 求职
|
|
|
+ // 点击链接到众创人才招聘(求职)
|
|
|
$('.link-job-post').click(jobUuzcPost);
|
|
|
|
|
|
+ // 点击链接到众创人才招聘(设置hr)
|
|
|
+ $('.link-hr-set').click(jobUuzcGet);
|
|
|
+
|
|
|
// 添加hr账号(新增)
|
|
|
$('#addHrAccount').click(addHrAccount);
|
|
|
|