From edc139dc1a909d3ad05b02e9dcb7c967fd0d8572 Mon Sep 17 00:00:00 2001 From: sichan Date: Wed, 19 Jun 2024 05:34:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86=E4=B8=80=E4=BA=8C?= =?UTF-8?q?=E7=BA=A7=E9=83=A8=E9=97=A8=E5=85=B3=E8=81=94=E7=9A=84=E4=B8=80?= =?UTF-8?q?=E4=BA=9Bbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/views.py | 2 +- templates/form_partial.html | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/common/views.py b/common/views.py index 7cd1f24..6bca7ca 100644 --- a/common/views.py +++ b/common/views.py @@ -84,7 +84,7 @@ def load_secondary_departments(request): # 创建 HTML 字符串 options = '' for dept in secondary_departments: - options += f'' + options += f'' return HttpResponse(options) except Exception as e: diff --git a/templates/form_partial.html b/templates/form_partial.html index 6764363..dc14709 100644 --- a/templates/form_partial.html +++ b/templates/form_partial.html @@ -125,18 +125,17 @@ if (primaryDepartment) { updateSecondaryDepartments(primaryDepartment); } else { - $('#id_secondary_department').html(''); + $('#id_secondary_department').html(''); } }); // 如果在页面加载时已选择一级部门,则加载相应的二级部门 var initialPrimaryDepartment = $('#id_primary_department').val(); - var initialSecondaryDepartmentId = $('#id_secondary_department').val(); + var initialSecondaryDepartment = $('#id_secondary_department').val(); if (initialPrimaryDepartment) { - updateSecondaryDepartments(initialPrimaryDepartment, initialSecondaryDepartmentId); + updateSecondaryDepartments(initialPrimaryDepartment, initialSecondaryDepartment); } - // 动态生成id_seal_type的select选项 var sealTypeOptions = [ { value: '公章', text: '公章' },