待办中返回列表文件数据

This commit is contained in:
ddrwode
2026-02-05 11:39:29 +08:00
parent a5ab26e3c1
commit d5aeae380c

View File

@@ -1549,20 +1549,21 @@ class roxyExhibition(APIView):
itme["project_conflicts"] = []
itme["bid_conflicts"] = []
# 案件变更、结案申请:返回上传文件 URL 列表,统一用 attachment_urls,供审批人在审核页查看
# 案件变更、结案申请:返回上传文件 URL统一用 attachment_urls(字符串,无文件时为空字符串)
if info.type == "案件变更":
try:
change_request = CaseChangeRequest.objects.filter(id=int(info.user_id), is_deleted=False).first()
if change_request and change_request.change_agreement:
try:
agreement_list = json.loads(change_request.change_agreement)
itme["attachment_urls"] = agreement_list if isinstance(agreement_list, list) else []
lst = agreement_list if isinstance(agreement_list, list) else []
itme["attachment_urls"] = json.dumps(lst, ensure_ascii=False) if lst else ""
except (json.JSONDecodeError, TypeError):
itme["attachment_urls"] = []
itme["attachment_urls"] = ""
else:
itme["attachment_urls"] = []
itme["attachment_urls"] = ""
except (ValueError, TypeError):
itme["attachment_urls"] = []
itme["attachment_urls"] = ""
elif info.type == "结案申请":
try:
schedule = Schedule.objects.filter(id=int(info.user_id), is_deleted=False).first()
@@ -1570,13 +1571,14 @@ class roxyExhibition(APIView):
try:
remark_data = json.loads(schedule.remark)
closing_files = remark_data.get("closing_application_files", [])
itme["attachment_urls"] = closing_files if isinstance(closing_files, list) else []
lst = closing_files if isinstance(closing_files, list) else []
itme["attachment_urls"] = json.dumps(lst, ensure_ascii=False) if lst else ""
except (json.JSONDecodeError, TypeError):
itme["attachment_urls"] = []
itme["attachment_urls"] = ""
else:
itme["attachment_urls"] = []
itme["attachment_urls"] = ""
except (ValueError, TypeError):
itme["attachment_urls"] = []
itme["attachment_urls"] = ""
data.append(itme)
return Response({'message': '展示成功', "total": total, 'data': data, 'code': 0}, status=status.HTTP_200_OK)