From ba27d531a012665f321f1c00d4efb09fadf58c1e Mon Sep 17 00:00:00 2001 From: ddrwode <34234@3来 34> Date: Thu, 5 Feb 2026 10:46:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=85=E5=8A=9E=E4=B8=AD=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=96=87=E4=BB=B6=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- User/views.py | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/User/views.py b/User/views.py index 2a2a862..f17c9a0 100644 --- a/User/views.py +++ b/User/views.py @@ -8,7 +8,7 @@ from .models import User, Approval, Department, OperationLog, Team from business.models import permission from finance.models import Income, Accounts, Payment, Reimbursement, BonusChange from finance.models import Invoice -from business.models import ProjectRegistration, Case, SealApplication, PreFiling, Bid, CaseChangeRequest,Propaganda +from business.models import ProjectRegistration, Case, SealApplication, PreFiling, Bid, CaseChangeRequest, Propaganda, Schedule import datetime from utility.utility import flies from django.contrib.sessions.backends.db import SessionStore @@ -1549,6 +1549,37 @@ class roxyExhibition(APIView): itme["project_conflicts"] = [] itme["bid_conflicts"] = [] + # 如果是案件变更类型:返回变更协议附件 URL 列表,供审批人在审核页查看 + 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["change_agreement_urls"] = agreement_list if isinstance(agreement_list, list) else [] + except (json.JSONDecodeError, TypeError): + itme["change_agreement_urls"] = [] + else: + itme["change_agreement_urls"] = [] + except (ValueError, TypeError): + itme["change_agreement_urls"] = [] + + # 如果是结案申请类型:返回结案申请上传的文件 URL 列表,供审批人在审核页查看 + if info.type == "结案申请": + try: + schedule = Schedule.objects.filter(id=int(info.user_id), is_deleted=False).first() + if schedule and schedule.remark: + try: + remark_data = json.loads(schedule.remark) + closing_files = remark_data.get("closing_application_files", []) + itme["closing_application_urls"] = closing_files if isinstance(closing_files, list) else [] + except (json.JSONDecodeError, TypeError): + itme["closing_application_urls"] = [] + else: + itme["closing_application_urls"] = [] + except (ValueError, TypeError): + itme["closing_application_urls"] = [] + data.append(itme) return Response({'message': '展示成功', "total": total, 'data': data, 'code': 0}, status=status.HTTP_200_OK)