From e5dc892abd229dbc7aea5f09eb30d0b00931e8dc Mon Sep 17 00:00:00 2001 From: 27942 Date: Thu, 22 Jan 2026 14:25:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=A1=88=E4=BB=B6=E6=A8=A1?= =?UTF-8?q?=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/views.py | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/business/views.py b/business/views.py index 996834c..8d7f15c 100644 --- a/business/views.py +++ b/business/views.py @@ -1758,11 +1758,15 @@ class caseManagementDetail(APIView): if not closing_application_list: closing_application_list = "" - # 将 AgencyContract 和 Closingapplication 字段的空数组转换为空字符串 + # 将 AgencyContract、Contractreturn 和 Closingapplication 字段的空数组转换为空字符串 agency_contract_str = info.AgencyContract or "" if agency_contract_str.strip() in ["[]", ""]: agency_contract_str = "" + contractreturn_str = info.Contractreturn or "" + if contractreturn_str.strip() in ["[]", ""]: + contractreturn_str = "" + closing_application_str = info.Closingapplication or "" if closing_application_str.strip() in ["[]", ""]: closing_application_str = "" @@ -1781,6 +1785,19 @@ class caseManagementDetail(APIView): invoice_status_value = normalize_amount_value(info.invoice_status) paymentcollection_value = normalize_amount_value(info.paymentcollection) + # 将 AgencyContract、Contractreturn 和 Closingapplication 字段的空数组转换为空字符串 + agency_contract_str = info.AgencyContract or "" + if agency_contract_str.strip() in ["[]", ""]: + agency_contract_str = "" + + contractreturn_str = info.Contractreturn or "" + if contractreturn_str.strip() in ["[]", ""]: + contractreturn_str = "" + + closing_application_str = info.Closingapplication or "" + if closing_application_str.strip() in ["[]", ""]: + closing_application_str = "" + # 获取案件标签 tags = info.tags.filter(is_deleted=False) tag_list = [] @@ -1814,7 +1831,7 @@ class caseManagementDetail(APIView): 'times': info.times or "", # 立案时间(没有数据时返回空字符串) "AgencyContract": agency_contract_str, # 代理合同(JSON字符串,没有文件时返回空字符串) "AgencyContractUrls": agency_contract_list if agency_contract_list else "", # 代理合同(URL列表,没有文件时返回空字符串) - "Contractreturn": info.Contractreturn or "", # 合同返还(没有数据时返回空字符串) + "Contractreturn": contractreturn_str, # 合同返还(没有数据时返回空字符串) "Closingapplication": closing_application_str, # 结案申请(JSON字符串,没有文件时返回空字符串) "ClosingapplicationUrls": closing_application_list if closing_application_list else "", # 结案申请(URL列表,没有文件时返回空字符串) "ChangeRequest": info.ChangeRequest or "", # 变更申请(兼容旧字段,没有数据时返回空字符串) @@ -4889,11 +4906,15 @@ class CaseListByTag(APIView): if not closing_application_list: closing_application_list = "" - # 将 AgencyContract 和 Closingapplication 字段的空数组转换为空字符串 + # 将 AgencyContract、Contractreturn 和 Closingapplication 字段的空数组转换为空字符串 agency_contract_str = info.AgencyContract or "" if agency_contract_str.strip() in ["[]", ""]: agency_contract_str = "" + contractreturn_str = info.Contractreturn or "" + if contractreturn_str.strip() in ["[]", ""]: + contractreturn_str = "" + closing_application_str = info.Closingapplication or "" if closing_application_str.strip() in ["[]", ""]: closing_application_str = "" @@ -4924,7 +4945,7 @@ class CaseListByTag(APIView): 'times': info.times, "AgencyContract": agency_contract_str, # 代理合同(JSON字符串,没有文件时返回空字符串) "AgencyContractUrls": agency_contract_list if agency_contract_list else "", # 代理合同(URL列表,没有文件时返回空字符串) - "Contractreturn": info.Contractreturn, + "Contractreturn": contractreturn_str, # 合同返还(没有数据时返回空字符串) "Closingapplication": closing_application_str, # 结案申请(JSON字符串,没有文件时返回空字符串) "ClosingapplicationUrls": closing_application_list if closing_application_list else "", # 结案申请(URL列表,没有文件时返回空字符串) "ChangeRequest": info.ChangeRequest,