待办中返回列表文件数据

This commit is contained in:
ddrwode
2026-02-05 11:50:50 +08:00
parent 9228327a76
commit f69ef6c930

View File

@@ -3280,16 +3280,23 @@ class DeleteSchedule(APIView):
class ScheduleDetail(APIView):
def post(self, request, *args, **kwargs):
"""
日程展示
日程展示(仅展示用户主动创建的日程/待办,不包含结案申请等审批承载的 Schedule
:param request:
:param args:
:param kwargs:
:return:
"""
title = request.data.get('title')
obj =Q(is_deleted=False)
obj = Q(is_deleted=False)
if title:
obj &= Q(title__contains=title)
# 排除作为「结案申请」审批承载的 Schedule结案申请应出现在「审核中」而非「日程中」
closing_application_schedule_ids = Approval.objects.filter(
type="结案申请", is_deleted=False
).values_list('user_id', flat=True)
closing_application_schedule_ids = [int(sid) for sid in closing_application_schedule_ids if sid and str(sid).isdigit()]
if closing_application_schedule_ids:
obj &= ~Q(id__in=closing_application_schedule_ids)
sches = Schedule.objects.filter(obj).order_by('-id')
page = request.data.get('page')
per_page = request.data.get('per_page')