dev_haigong
cxt 6 years ago
parent e3a7e90805
commit f1b17212b4

@ -891,7 +891,7 @@ class AccountController < ApplicationController
@user = User.current
@se = @user.extensions
# 已授权的用户修改单位名称,需要重新授权
if @se.school_id != params[:occupation].to_i && @user.certification == 1
if (@se.school_id != params[:occupation].to_i || @se.identity != params[:identity].to_i) && @user.certification == 1
@user.certification = 0
apply_user = ApplyAction.where(:user_id => @user.id, :container_type => "TrialAuthorization")
apply_user.update_all(:status => 2) unless apply_user.blank?

@ -3194,15 +3194,17 @@ end
def trial_authorization
@menu_type =10
@sub_type = 2
search = params[:search]
name_search = params[:search]
@status = trial_authorization_status(params[:status])
# @status = (params[:status].blank? || params[:status] == "0") ? 0 : [1,2]
user_id = []
search = false
@authorizations = ApplyAction.where(:container_type => "TrialAuthorization", :status => @status)
unless search.blank?
user_id = User.find_by_sql("select id from users where concat(lastname,firstname) like '%#{search}%'").map(&:id)
unless name_search.blank?
new_user_id = User.find_by_sql("select id from users where concat(lastname,firstname) like '%#{name_search}%'").map(&:id)
user_id = user_id.size == 0 ? new_user_id : user_id & new_user_id
search = true
end
if params[:sname] && params[:sname].strip != ''

@ -10,6 +10,9 @@
<ul class="abouttable clearfix">
<li class="clearfix">
<label class="second-label fl"><span class="color-orange">* </span>职业:</label>
<% if @user.certification == 1 %>
<input type="hidden" id="user_certi_identity" value="<%= @user.user_extensions.identity %>">
<% end %>
<select id="userIdentity" name="identity" class="fl winput-240-40">
<option value="-1" style="display:none">请选择职业</option>
<option value="0">教师</option>

@ -28,6 +28,9 @@
<ul class="abouttable clearfix">
<li class="clearfix">
<label class="second-label fl"><span class="color-orange">* </span>职业:</label>
<% if @user.certification == 1 %>
<input type="hidden" id="user_certi_identity" value="<%= @user.user_extensions.identity %>">
<% end %>
<select id="userIdentity" name="identity" class="fl winput-240-40">
<option value="-1" style="display:none">请选择职业</option>
<option value="0">教师</option>

@ -1032,9 +1032,10 @@ function submit_pro_certification(type){
}
}
else if (data.result == 1){
if($("#user_certi_school_id").length == 1 && $("#user_certi_school_id").val() != $("input[name='occupation']").val().trim()){
if(($("#user_certi_school_id").length == 1 && $("#user_certi_school_id").val() != $("input[name='occupation']").val().trim()) ||
($("#user_certi_identity").length == 1 && $("#user_certi_identity").val() != $("input[name='identity']").val().trim())){
var htmlvalue = '<div class="task-popup" style="width:480px;"><div class="task-popup-title clearfix">提示</div>'+
'<div class="task-popup-content"><p class="task-popup-text-center font-16">修改单位名称后需要重新申请试用授权</p></div><div class="task-popup-submit clearfix"><a href="javascript:void(0);" onclick="cancel_submit_pro('+type+');" class="task-btn fl">取消</a>'+
'<div class="task-popup-content"><p class="task-popup-text-center font-16">修改单位名称/职业后需要重新申请试用授权</p></div><div class="task-popup-submit clearfix"><a href="javascript:void(0);" onclick="cancel_submit_pro('+type+');" class="task-btn fl">取消</a>'+
'<a href="javascript:void(0);" class="task-btn task-btn-orange fr pop_close" onclick="$(\'#my_pro_certification_form\').submit();">确定</a></div></div>';
pop_box_new(htmlvalue, 480, 160);
} else{
@ -1054,9 +1055,10 @@ function submit_pro_certification(type){
}
});
} else{
if($("#user_certi_school_id").length == 1 && $("#user_certi_school_id").val() != $("input[name='occupation']").val().trim()){
if(($("#user_certi_school_id").length == 1 && $("#user_certi_school_id").val() != $("input[name='occupation']").val().trim()) ||
($("#user_certi_identity").length == 1 && $("#user_certi_identity").val() != $("input[name='identity']").val().trim())){
var htmlvalue = '<div class="task-popup" style="width:480px;"><div class="task-popup-title clearfix">提示</div>'+
'<div class="task-popup-content"><p class="task-popup-text-center font-16">修改单位名称后需要重新申请试用授权</p></div><div class="task-popup-submit clearfix"><a href="javascript:void(0);" onclick="cancel_submit_pro('+type+');" class="task-btn fl">取消</a>'+
'<div class="task-popup-content"><p class="task-popup-text-center font-16">修改单位名称/职业后需要重新申请试用授权</p></div><div class="task-popup-submit clearfix"><a href="javascript:void(0);" onclick="cancel_submit_pro('+type+');" class="task-btn fl">取消</a>'+
'<a href="javascript:void(0);" class="task-btn task-btn-orange fr pop_close" onclick="$(\'#my_pro_certification_form\').submit();">确定</a></div></div>';
pop_box_new(htmlvalue, 480, 160);
} else{
@ -1610,9 +1612,10 @@ function my_account_form_submit() {
notice_box("该学号已被另一个账号(" + data.account + ")使用");
}
else if (data.result == 1){
if($("#user_certi_school_id").length == 1 && $("#user_certi_school_id").val() != $("input[name='occupation']").val().trim()){
if(($("#user_certi_school_id").length == 1 && $("#user_certi_school_id").val() != $("input[name='occupation']").val().trim()) ||
($("#user_certi_identity").length == 1 && $("#user_certi_identity").val() != $("input[name='identity']").val().trim())){
var htmlvalue = '<div class="task-popup" style="width:480px;"><div class="task-popup-title clearfix">提示</div>'+
'<div class="task-popup-content"><p class="task-popup-text-center font-16">修改单位名称后需要重新申请试用授权</p></div><div class="task-popup-submit clearfix"><a href="javascript:void(0);" onclick="hideModal();" class="task-btn fl">取消</a>'+
'<div class="task-popup-content"><p class="task-popup-text-center font-16">修改单位名称/职业后需要重新申请试用授权</p></div><div class="task-popup-submit clearfix"><a href="javascript:void(0);" onclick="hideModal();" class="task-btn fl">取消</a>'+
'<a href="javascript:void(0);" class="task-btn task-btn-orange fr pop_close" onclick="$(\'#my_account_form\').submit();">确定</a></div></div>';
pop_box_new(htmlvalue, 480, 160);
} else{

Loading…
Cancel
Save