You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pgfqe6ch8/app/views/managements/profession.html.erb

64 lines
3.5 KiB

<%= form_tag(url_for(profession_managements_path),:id=>"profession",:method => "post",:remote=>true) do %>
<div class="edu-con-top clearfix xmt10">
<%= select_tag :major_level,options_for_select(major_level_option, 0), {:id=>"major_level_p", :class=>"fl task-form-15 task-height-30", :style => "margin:0px 10px 0px 25px;"} %>
<%= select_tag :discipline_category_id,options_for_select(discipline_category_option, nil), {:id=>"discipline_category_id_p", :class=>"fl task-form-15 task-height-30", :style => "margin:0px 30px 0px 50px;"} %>
<%= select_tag :first_level_discipline_id,options_for_select(first_level_discipline_option, nil), {:id=> "first_level_discipline_id_p", :class=>"fl task-form-20 task-height-30", :style => "margin:0px 30px 0px 25px;"} %>
<a href="javascript:void(0);" class="fl task-btn task-btn-orange ml5 " onclick="$('#profession').submit();">搜索</a>
<a href="javascript:clearSearchCondition()" class="fl task-btn ml5 mt2 " id="clear_contents">清除</a>
<%= link_to '新增',{ :controller => 'managements', :action => 'new_major', }, :remote => true, :class => "task-btn task-btn-green fr mr30" %>
<input type="hidden" name="sx_order"/>
<span class="fr shixun_webssh">
<input type="checkbox" name="support_shixuns" class="mr5 magic-checkbox" id="join_course_role_0" value="1">
<label style="top:2px;padding-left:23px;" for="join_course_role_0"><span class="only_view" >只看支撑实训</span></label>
</span>
</div>
<% end %>
<div class="edu-con-bg01 mt15" id="classroom_list">
<%= render :partial => "managements/profession_list" %>
</div>
<script>
function clearSearchCondition(){
$("#major_level_p").val("");
$("#discipline_category_id_p").val("");
$("#first_level_discipline_id_p").val("");
$.get('<%= profession_managements_path() %>');
};
$("#join_course_role_0").on('click', function(){
$("#profession").submit();
});
$("#major_level_p").change(function(e){
$("#discipline_category_id_p").html('<option value="0">选择课程所属学科门类</option>');
$("#first_level_discipline_id_p").html('<option value="0">选择课程所属一级学科</option>');
$.ajax({
url: '/syllabuses/get_discipline_categories',
type: 'get',
data: {major_level:$(this).children('option:selected').val()},
success: function(data){
if (data.result == 1){
for(var i=0; i<data.options.length; i++){
$("#discipline_category_id_p").append("<option value='" + data.options[i][1] + "'>" + data.options[i][0] + "</option>");
}
};
}
});
});
$("#discipline_category_id_p").change(function(){
$("#first_level_discipline_id_p").html('<option value="0">选择课程所属一级学科</option>');
$.ajax({
url: '/syllabuses/get_first_level_disciplines',
type: 'get',
data: {discipline_category_id:$(this).children('option:selected').val()},
success: function(data){
if (data.result == 1){
for(var i=0; i<data.options.length; i++){
console.log(data.options.length);
$("#first_level_discipline_id_p").append("<option value='" + data.options[i][1] + "'>" + data.options[i][0] + "</option>");
}
}
}
});
});
</script>