From f068ce5a8e6b81179875a9e1364d9455b3db6211 Mon Sep 17 00:00:00 2001
From: jasder
单位 地区
- - - - - - - 湖南 -
-- - - - - - - 湖南 -
-- - - - - - - 湖南 -
++ +
" + + " " + + " " + + " " + + " " + + " \n" + + " \n" + + " "+array["school"]["province"]+"" + + "
" + }) + $("#serch_user_list").html(s_html) + }) + } function submit_add_partner(){ - if($("input[name='user_id[]']:checked").length==0){ + if($("input[name='school[id]']:checked").length==0){ $("#checkNotice").html("请选择需要添加的内容").removeClass("none"); return; + }else{ + let checked_array = []; + $("input[name='school[id]']:checked").each(function () { + checked_array.push($(this).val()) + }); + let check_ids = {ids:checked_array}; + $.ajax({ + url: "/managements/add_partner", + type: 'POST', + data: check_ids, + success: function (e) { + if(e.status === 1){} + $("#popupAll").remove() + } + }) } } \ No newline at end of file diff --git a/app/views/managements/_profession_index.html.erb b/app/views/managements/_profession_index.html.erb index 668aa0f1..f8f906b3 100644 --- a/app/views/managements/_profession_index.html.erb +++ b/app/views/managements/_profession_index.html.erb @@ -37,13 +37,13 @@- - - - - 学生 - 湖北工业大学 - 156****9087 -
-- - - - - 学生 - 湖北工业大学 - -
+ + <%= form_for @partner, :url => add_depart_member_managements_path,:html => {:id => 'add_depart_member_form', :remote => true, :method => :post} do |f| %> + <% @members.each do |member| %> ++ + + + + <%= member.identity %> + <%= member.school_name %> + <%= member.phone %> +
+ <% end %> + <% end %> + +- -
diff --git a/app/views/managements/partners.html.erb b/app/views/managements/partners.html.erb
index 1d39b899..cf16ead1 100644
--- a/app/views/managements/partners.html.erb
+++ b/app/views/managements/partners.html.erb
@@ -21,7 +21,9 @@
- 姓名:
- 单位:
-
From 45bdbab053cc9fe3c4e63a23340c9a3f264f56fe Mon Sep 17 00:00:00 2001
From: SylorHuang
@@ -35,27 +28,60 @@
$(function() {
unitDownOption();
showprovince("province");
+ submit_add_partner();
- get_schools()
+ var i = 1; //设置当前页数
+ var msg_list_loading = false;
+ $(function() {
+ var totalpage = <%= @total_pages.to_i %>; //总页数,防止超过总页数继续滚动
+ var winH = $(window).height(); //页面可视区域高度
+ get_schools(1)
+ $("#search_user_list").scroll(function() {
+ if (i < totalpage) { // 当滚动的页数小于总页数的时候,继续加载
+ var pageH = $(document.body).height();
- });
- function get_schools() {
- $.getJSON("/managements/all_partners",function(schools){
- let s_html = "";
- $.each(schools,function (index,array) {
- s_html =s_html+ " " +
- " " +
- " " +
- " " +
- " " +
- " \n" +
- " \n" +
- " "+array["school"]["province"]+"" +
- " " +
+ " " +
+ " " +
+ " " +
+ " " +
+ " \n" +
+ " \n" +
+ " "+array["school"]["province"]+"" +
+ "
@@ -31,7 +32,7 @@
请至少选择一个用户
-
<% @partners.each_with_index do |partner,index| %>
<% @partners.each_with_index do |partner,index| %>
-
" + - " " + - " " + - " " + - " " + - " \n" + - " \n" + - " "+array["school"]["province"]+"" + - "
" - }); - $("#search_user_list").html(s_html); - i ++; - } - }); - } - } - function submit_add_partner(){ - if($("input[name='school[id]']:checked").length==0){ - $("#checkNotice").html("请选择需要添加的内容").removeClass("none"); - return; - }else{ - let checked_array = []; - $("input[name='school[id]']:checked").each(function () { - checked_array.push($(this).val()) - }); - let check_ids = {ids:checked_array}; - $.ajax({ - url: "/managements/add_partner", - type: 'POST', - data: check_ids, - success: function (e) { - if(e.status === 1){} - $("#popupAll").remove() - } - }) - } - } - }); + function get_schools(page) { + var msg_list = $('#search_user_list'); + if (msg_list.height() + msg_list[0].scrollTop >= msg_list[0].scrollHeight - 60) { + msg_list_loading = true; + $.getJSON("<%= all_path %>?page="+page, function(schools) { + if (schools) { + msg_list_loading = false; + var s_html = ""; + $.each(schools,function (index,array) { + s_html = s_html+ "" + + " " + + " " + + " " + + " " + + " \n" + + " \n" + + " "+array["school"]["province"]+"" + + "
" + }); + $("#search_user_list").append(s_html); + i ++; + } + }); + } + } + function submit_add_partner(){ + if($("input[name='school[]']:checked").length==0){ + $("#checkNotice").html("请选择需要添加的内容").removeClass("none"); + return; + }else{ + let checked_array = []; + $("input[name='school[]']:checked").each(function () { + checked_array.push($(this).val()) + }); + let check_ids = {ids:checked_array}; + $.ajax({ + url: "/managements/add_partner", + type: 'POST', + data: check_ids, + success: function (e) { + if(e.status === 1){} + $("#popupAll").remove() + } + }) + } + } \ No newline at end of file diff --git a/app/views/managements/_partners_list.html.erb b/app/views/managements/_partners_list.html.erb index e69de29b..10069306 100644 --- a/app/views/managements/_partners_list.html.erb +++ b/app/views/managements/_partners_list.html.erb @@ -0,0 +1,11 @@ +<% @schools.each do |school| %> ++ + + + + + + <%= school.province %> +
+<% end %> \ No newline at end of file From dc2a59cad9f8e6448ab502f0e86645d113a0cad4 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 4 Apr 2019 11:49:42 +0800 Subject: [PATCH 21/35] 1 --- app/views/managements/partners.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/managements/partners.html.erb b/app/views/managements/partners.html.erb index a7f55eed..25600536 100644 --- a/app/views/managements/partners.html.erb +++ b/app/views/managements/partners.html.erb @@ -47,7 +47,7 @@ +添加 添加时间添加时间2019-04-03 15:40
+添加时间<%= format_time @current_partner.try(:created_at) %>
+ + + + + <%= member.identity %> + <%= member.school_name %> + <%= member.phone %> +
+<% end %> \ No newline at end of file diff --git a/app/views/managements/_partner_search_form.html.erb b/app/views/managements/_partner_search_form.html.erb index 35e3e8c9..cf6d9450 100644 --- a/app/views/managements/_partner_search_form.html.erb +++ b/app/views/managements/_partner_search_form.html.erb @@ -1,11 +1,11 @@ <%= form_for "", :url => {:controller=> 'managements', :action => 'all_partners', :type => @type}, :html => {:id => 'partners_search_form'}, :method => "get", :remote => true do |f| %>@@ -32,7 +32,7 @@ var totalpage = <%= @total_pages.to_i %>; //总页数,防止超过总页数继续滚动 var winH = $(window).height(); //页面可视区域高度 - $("#search_user_list").scroll(function() { + $("#search_customers_list").scroll(function() { if (i < totalpage) { // 当滚动的页数小于总页数的时候,继续加载 var pageH = $(document.body).height(); @@ -50,10 +50,10 @@ }); function get_schools(page) { - var msg_list = $('#search_user_list'); + var msg_list = $('#search_customers_list'); if (msg_list.height() + msg_list[0].scrollTop >= msg_list[0].scrollHeight - 60) { msg_list_loading = true; - $.getJSON("<%= all_path %>?page="+page, function(schools) { + $.getJSON("<%= all_path %>?partner_id=<%= @partner.id %>page="+page+"&search="+$("#partner_name_search").val()+"&province="+$("#partner_province").val(), function(schools) { if (schools) { msg_list_loading = false; var s_html = ""; @@ -68,7 +68,7 @@ " "+array["school"]["province"]+"" + " " }); - $("#search_user_list").append(s_html); + $("#search_customers_list").append(s_html); i ++; } }); @@ -90,7 +90,7 @@ success: function (e) { if(e.status === 1){ hideModal(); - window.location.href = "<%= partners_managements_path %>"; + window.location.href = "<%= partners_managements_path(partner: @partner.id) %>"; } } }) diff --git a/app/views/managements/_customers_search_form.html.erb b/app/views/managements/_customers_search_form.html.erb new file mode 100644 index 00000000..28c7ece0 --- /dev/null +++ b/app/views/managements/_customers_search_form.html.erb @@ -0,0 +1,19 @@ +<%= form_for "", :url => {:controller=> 'managements', :action => 'customers_list', :partner_id => @partner.id}, :html => {:id => 'partners_search_form'}, :method => "get", :remote => true do |f| %> +
添加时间<%= format_time @current_partner.try(:created_at) %>
-+ 添加时间<%= format_time @current_partner.try(:created_at) %> +
+