diff --git a/fzjgact/huodong/__pycache__/views.cpython-311.pyc b/fzjgact/huodong/__pycache__/views.cpython-311.pyc index 98f91c7..07310f2 100644 Binary files a/fzjgact/huodong/__pycache__/views.cpython-311.pyc and b/fzjgact/huodong/__pycache__/views.cpython-311.pyc differ diff --git a/fzjgact/huodong/templates/contact_list.html b/fzjgact/huodong/templates/contact_list.html index cb1d4a3..e882b53 100644 --- a/fzjgact/huodong/templates/contact_list.html +++ b/fzjgact/huodong/templates/contact_list.html @@ -7,9 +7,9 @@
- -
- + +
+
@@ -17,15 +17,19 @@ type="text" id="branchSearchInput" class="w-full pl-4 pr-10 py-2.5 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-300 focus:border-blue-500 outline-none text-sm" - placeholder="输入分支机构名称搜索..." + placeholder="点击选择分支机构(可多选)..." readonly onclick="toggleBranchDropdown()" > - - + +
@@ -46,15 +50,29 @@
    {% for branch in branches %} -
  • + {{ branch.name }}
  • {% endfor %}
+ +
+ + +
+ + +
+ +
+
- +
-
-
- - - - - -
- - -
+
@@ -119,10 +93,16 @@
-
+
+
+ + + @@ -154,6 +134,133 @@ diff --git a/fzjgact/huodong/views.py b/fzjgact/huodong/views.py index ba50a67..45ce71e 100644 --- a/fzjgact/huodong/views.py +++ b/fzjgact/huodong/views.py @@ -356,16 +356,19 @@ def equipment_images(request): def contact_list(request): # 获取筛选参数 - branch_id = request.GET.get('branch') + branches_param = request.GET.get('branches') # 支持多机构选择,使用逗号分隔的ID字符串 category = request.GET.get('category') contact_name = request.GET.get('contact_name') # 构建查询条件 filters = Q() - # 分支机构筛选 - if branch_id: - filters &= Q(branch_id=branch_id) + # 分支机构筛选(支持多选) + if branches_param: + # 将逗号分隔的字符串转换为ID列表 + branch_ids = [bid.strip() for bid in branches_param.split(',') if bid.strip().isdigit()] + if branch_ids: + filters &= Q(branch_id__in=branch_ids) # 联系人类别筛选 if category: @@ -386,7 +389,7 @@ def contact_list(request): 'contacts': contacts, 'branches': branches, 'categories': categories, - 'selected_branch': branch_id, + 'selected_branches': branches_param, # 传递选中的机构ID字符串 'selected_category': category, 'selected_contact_name': contact_name }