Merge branch 'dev_partners' of https://bdgit.educoder.net/Hjqreturn/pgfqe6ch8 into dev_partners

dev_local
jasder 6 years ago
commit 402eaa52da

@ -23,7 +23,7 @@ class CooperatesController < ApplicationController
def find_partner
@partner = Partner.find_by_id(params[:id])
render_404 if @partner.nil? || @partner.status == -1
render_404 if @partner.nil?
rescue ActiveRecord::RecordNotFound
render_404
end

@ -792,12 +792,22 @@ class ManagementsController < ApplicationController
@menu_type = 8
@sub_type = 2
@search = params[:search]
@beginTime = params[:beginTime]
@endTime = params[:endTime]
if @search.present?
shixun_ids = Shixun.where("name like ?", "%#{params[:search]}%").pluck(:id)
@discusses = Discuss.where(:dis_type => "Shixun", :dis_id => shixun_ids).reorder("created_at desc")
else
@discusses = Discuss.where(:dis_type => "Shixun").reorder("created_at desc")
end
if params[:beginTime] && params[:beginTime].strip != ""
@discusses = @discusses.where("created_at >= '#{Time.parse(params[:beginTime])}'")
end
if params[:endTime] && params[:endTime].strip != ""
@discusses = @discusses.where("created_at <= '#{Time.parse(params[:endTime])}'")
end
@all_discusses = @discusses
@discusses_count = @discusses.count
@limit = 20
@ -1242,6 +1252,15 @@ end
end
end
def delete_customers
if params[:customer]
customer = Customer.where(id: params[:customer]).first
@current_partner = customer.partner
customer.school.update_attributes(:customer_id => nil)
customer.destroy if customer && @current_partner
end
end
def all_partners
@search = params[:search]
@province = params[:province]
@ -1275,13 +1294,14 @@ end
if school_ids.length > 0
school_ids.each do |s|
school = School.where("id = ?",s).first
if school.present?
if school.present? && school.partner_id.nil?
partner = Partner.new(name: school.name)
partner.save
school.update_attributes(:partner_id => partner.id)
end
end
end
render :json => {status: 1, message: "创建成功!"}
end
@ -1354,6 +1374,16 @@ end
end
end
# 合作伙伴删除管理员
def delete_partner_member
if params[:partner] && params[:partner_member]
@partner = Partner.find_by_id params[:partner]
user = User.find_by_id params[:partner_member]
user.update_attributes(partner_id: nil) if !@partner.nil? && !user.nil?
end
end
# check 部门 identifier是否重复
def check_depart_identifier
logger.info("###############{params}")
@ -4232,7 +4262,8 @@ end
sheet1[count_row, 5] = discusses.count
discusses.each_with_index do |discuss, j|
user = discuss.user
sheet1[count_row, 6] = discuss.content.gsub(/<img.*\/>/, "【图片评论】").gsub(/!\[\].+\)/, "【图片评论】")
content = discuss.content.gsub(/<img.*\/>/, "【图片评论】").gsub(/!\[\].+\)/, "【图片评论】")
sheet1[count_row, 6] = strip_html content
sheet1[count_row, 7] = "#{discuss.position}"
sheet1[count_row, 8] = user.show_real_name
sheet1[count_row, 9] = user.identity

@ -61,7 +61,7 @@
s_html = s_html+ "<p class='clearfix mt5'>" +
" <span class='fl with70'>" +
" <span>" +
" <input type='checkbox' name='school[id]' value='"+array["school"]["id"]+"' id='school_'"+array["school"]["id"]+"'class='magic-checkbox'>" +
" <input type='checkbox' name='school[id]' value='"+array["school"]["id"]+"' id='school_"+array["school"]["id"]+"' class='magic-checkbox'>" +
" <label for='school_'"+array["school"]["id"]+">"+array["school"]["name"]+"</label>" +
" </span>\n" +
" </span>\n" +

@ -60,7 +60,7 @@
$.each(members,function (index,array) {
s_html = s_html+ "<p class='clearfix'>" +
" <span class='fl edu-txt-w90'>" +
" <input type='checkbox' name='partner_member[]' value='"+array["id"]+"' id='user_'"+array["id"]+"'class='magic-checkbox'>" +
" <input type='checkbox' name='partner_member[]' value='"+array["id"]+"' id='user_"+array["id"]+"' class='magic-checkbox'>" +
" <label for='user_'"+array["id"]+">"+array["real_name"]+"</label>" +
" </span>\n" +
"<span class='fl edu-txt-w90 mt5 edu-txt-center color-grey-6 pointer'>"+array["identity"]+"</span>" +

@ -59,7 +59,7 @@
s_html = s_html+ "<p class='clearfix mt5'>" +
" <span class='fl with70'>" +
" <span>" +
" <input type='checkbox' name='school[id]' value='"+array["school"]["id"]+"' id='school_'"+array["school"]["id"]+"'class='magic-checkbox'>" +
" <input type='checkbox' name='school[id]' value='"+array["school"]["id"]+"' id='school_"+array["school"]["id"]+"' class='magic-checkbox'>" +
" <label for='school_'"+array["school"]["id"]+">"+array["school"]["name"]+"</label>" +
" </span>\n" +
" </span>\n" +

@ -0,0 +1,20 @@
<li class="clearfix tableHead">
<span>序号</span>
<span>客户名称</span>
<span><a href="<%= customers_list_managements_path(:partner_id => @current_partner.try(:id)) %>"
data-remote="true" class="color-blue">+添加</a></span>
<span>添加时间</span>
</li>
<% @current_partner.try(:customers).try(:each) do |customer| %>
<li>
<span><%= customer.school.id %></span>
<span class="task-hide"><%= customer.school.name %></span>
<span>
<a href="javascript:void(0)" onclick="delete_confirm_box_2('<%= delete_customers_managements_path(customer: customer.id) %>',
'确定要删除该客户吗')" class="color-grey-9">删除</a>
</span>
<span>
<%= format_time customer.created_at %>
</span>
</li>
<% end %>

@ -1,8 +1,10 @@
<% partner.users.each do |user| %>
<li>
<%= image_tag(url_to_avatar(user)) %>
<a href="javascript:void(0)" class="removeImg">
<a href="javascript:void(0)" onclick="delete_confirm_box_2('<%= delete_partner_member_managements_path(partner: partner.id,
partner_member: user.id) %>', '确定要删除该管理员吗')" class="removeImg">
<i class="iconfont icon-htmal5icon19 color-grey-9"></i>
</a>
<span class="task-hide managementName"><%= user.show_real_name %></span>
</li>
<% end %>

@ -24,7 +24,11 @@
<span class="mr45 color-grey-9 fl">管理员</span>
<ul class="manageList">
<li><a href="javascript:void(0)" class="addManage">+</a></li>
<li><img src="https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=105293018,2500805440&fm=27&gp=0.jpg"/><a href="javascript:void(0)" class="removeImg"><i class="iconfont icon-htmal5icon19 color-grey-9"></i></a></li>
<li>
<img src="https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=105293018,2500805440&fm=27&gp=0.jpg"/>
<a href="javascript:void(0)" class="removeImg"><i class="iconfont icon-htmal5icon19 color-grey-9"></i></a>
<span class="task-hide manageName">胡莎莎</span>
</li>
</ul>
</div>
</div>

@ -0,0 +1 @@
$("#partner_customer_list").html("<%= j(render :partial => "partner_customer_list") %>")

@ -0,0 +1 @@
$("#partner_member_list").html("<%= j(render :partial => "partner_member_list", :locals => {partner: @partner}) %>")

@ -33,27 +33,8 @@
</ul>
</div>
</div>
<div class="tableList">
<li class="clearfix tableHead">
<span>序号</span>
<span>客户名称</span>
<span><a href="<%= customers_list_managements_path(:partner_id => @current_partner.try(:id)) %>"
data-remote="true" class="color-blue">+添加</a></span>
<span>添加时间</span>
</li>
<% @current_partner.try(:customers).try(:each) do |customer| %>
<li>
<span><%= customer.school.id %></span>
<span class="task-hide"><%= customer.school.name %></span>
<span>
<a href="javascript:void(0)" class="color-grey-9">删除</a>
</span>
<span>
2019-04-03 16:04
</span>
</li>
<% end %>
<div class="tableList" id="partner_customer_list">
<%= render :partial => "partner_customer_list" %>
</div>
</div>
</div>
@ -68,12 +49,6 @@
$(".partnerList li a").removeClass("active");
$(this).addClass("active");
})
$(".removeImg").on("click",function(){
$(this).parents("li").remove();
})
})
function submit_search_partner(){

@ -2,11 +2,17 @@
<%= form_tag(url_for(shixun_feedback_message_managements_path), :id => "managements_shixuns_search", :method => "post", :remote => true ) do %>
<div class="edu-con-top clearfix mb20">
<input class="fl task-form-20 task-height-30 ml25" id="shixun_Look_name" name="search" maxlength="" placeholder="输入实训名称关键字进行搜索" type="text" style="height: 21px;">
<li class="fl">
<span class="mr10 ml10 font-14">发布时间</span>
<input type="text" name="beginTime" readonly placeholder="请选择开始时间" class="winput-150-30 mr10"/>
<input type="text" name="endTime" readonly placeholder="请选择结束时间" class="winput-150-30"/>
</li>
<li class="fl ml10">
<a href="javascript:void(0)" class="task-btn task-btn-orange" onclick="$('#managements_shixuns_search').submit();">搜索</a>
<a href="javascript:clearSearchCondition();" class="task-btn mr10">清除</a>
</li>
<a href="<%= shixun_feedback_message_managements_path(:search => @search, :format => "xls") %>" id="shixun_search" class="task-btn mr10 task-btn-orange fr">导出</a>
<a href="<%= shixun_feedback_message_managements_path(:search => @search, :beginTime => @beginTime, :endTime => @endTime,:format => "xls") %>" id="shixun_search" class="task-btn mr10 task-btn-orange fr">导出</a>
</div>
<% end %>
<div class="ex_container" id="management_shixun_feedback_list">
@ -17,4 +23,16 @@
function clearSearchCondition(){
$("#shixun_Look_name").val('')
}
$("input[name='beginTime']").datetimepicker({
allowBlank:true,
lang:'ch',
format:'Y-m-d H:i',
validateOnBlur:false
});
$("input[name='endTime']").datetimepicker({
allowBlank:true,
lang:'ch',
format:'Y-m-d H:i',
validateOnBlur:false
});
</script>

@ -1,2 +1,2 @@
$("#management_shixun_feedback_list").html("<%= j(render :partial => 'shixun_feedback_list') %>");
$("#shixun_search").attr("href", "<%= shixun_feedback_message_managements_path(:search => @search, :format => "xls") %>")
$("#shixun_search").attr("href", "<%= shixun_feedback_message_managements_path(:search => @search, :beginTime => @beginTime, :endTime => @endTime,:format => "xls") %>")

@ -556,6 +556,7 @@ RedmineApp::Application.routes.draw do ## oauth相关
get 'partners'
get 'add_partner_member_box'
post 'add_partner_member'
delete 'delete_partner_member'
get 'get_partner'
get 'all_partners'
post 'add_partner'
@ -712,6 +713,7 @@ RedmineApp::Application.routes.draw do ## oauth相关
post 'delete_subject_level'
post 'update_level_for_subject'
post :add_customers
delete :delete_customers
get :customers_list
end
end

@ -2984,9 +2984,10 @@ a.singlepublishtwo{
}
.partnerList{max-height: 500px;overflow-y: auto;}
.manageList{float: left}
.manageList li{width: 60px;height: 60px;float: left;margin-right: 15px;border-radius: 50%;text-align: center;position: relative;margin-bottom: 10px;}
.manageList li>a.addManage,.manageList li>img{width: 60px;height: 60px;line-height: 49px;float: left;margin-right: 10px;border-radius: 50%;}
.manageList li{width: 60px;float: left;margin-right: 15px;border-radius: 50%;text-align: center;position: relative;margin-bottom: 10px;}
.manageList li>a.addManage,.manageList li>img{width: 60px;height: 60px;line-height: 49px;margin-right: 10px;border-radius: 50%;display: block}
.addManage{display: block;background: #cdcdcd;color: #fff!important;font-size: 55px;}
.managementName{display: block;width: 60px;color: #666;}
.removeImg{position: absolute;right: 1px;top: -12px;}
.tableList .tableHead{background: #fafafa}
.tableList{min-height: 400px;}
@ -3133,40 +3134,40 @@ line-height: 20px;display: inline-block;color: rgba(65, 140, 205, 1) !important;
width: calc( 100% )
}
#requireTable thead .td-head-child:last-child{border-right: none;}
/*用户列表*/
.managerPanels a{margin-right:24px;}
.managerPanels a:nth-child(16n){margin-right: 0px;}
.managerPanels a span{display: block;text-align: center;max-width: 70px;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;color: #666;}
.managerPanels a:hover span{color: #4cacff!important;}
.userimg{position: absolute;top: -16px;right: -5px;}
.useradd{font-size: 42px !important; position: absolute; top: -16px;}
.ListTableLines .column-2{
width: 150px;
text-align: center;
padding-left: 5px;
box-sizing: border-box;
color:#999999;
}
.ListTableLines .column-No{
color:#999999;
}
.courselist .column-2{
width: 150px;
text-align: center;
padding-left: 5px;
box-sizing: border-box;
color:#656565;
}
.courselist .column-No{
color:#999999;
}
.poll_list a {
display: inline-block;
padding: 20px;
font-size: 18px;
text-align: center;
position: relative;
color: #05101a;
/*用户列表*/
.managerPanels a{margin-right:24px;}
.managerPanels a:nth-child(16n){margin-right: 0px;}
.managerPanels a span{display: block;text-align: center;max-width: 70px;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;color: #666;}
.managerPanels a:hover span{color: #4cacff!important;}
.userimg{position: absolute;top: -16px;right: -5px;}
.useradd{font-size: 42px !important; position: absolute; top: -16px;}
.ListTableLines .column-2{
width: 150px;
text-align: center;
padding-left: 5px;
box-sizing: border-box;
color:#999999;
}
.ListTableLines .column-No{
color:#999999;
}
.courselist .column-2{
width: 150px;
text-align: center;
padding-left: 5px;
box-sizing: border-box;
color:#656565;
}
.courselist .column-No{
color:#999999;
}
.poll_list a {
display: inline-block;
padding: 20px;
font-size: 18px;
text-align: center;
position: relative;
color: #05101a;
}
Loading…
Cancel
Save