From f70605129ce2ef07bcf62d4a4ca8ef7075299add Mon Sep 17 00:00:00 2001 From: caoqianming Date: Mon, 24 Nov 2025 15:53:56 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20resignatioin=E6=8F=90=E4=BA=A4=E6=97=B6?= =?UTF-8?q?=E8=B0=83=E7=94=A8=E7=9A=84=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/hrm/views.py | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/apps/hrm/views.py b/apps/hrm/views.py index 7c13f17d..6152ead1 100755 --- a/apps/hrm/views.py +++ b/apps/hrm/views.py @@ -399,4 +399,24 @@ class ResignationViewSet(TicketMixin, EuModelViewSet): queryset = Resignation.objects.all() serializer_class = ResignationSerializer search_fields = ["employee__name"] - workflow_key = "wf_resignation" \ No newline at end of file + workflow_key = "wf_resignation" + + @staticmethod + def update_handle_date(ticket: Ticket, transition, new_ticket_data: dict): + handle_date = new_ticket_data.get("handle_date", None) + if handle_date: + resignation = Resignation.objects.get(ticket=ticket) + resignation.handle_date = handle_date + resignation.save() + else: + raise ParseError("请填写办理离职的交接日期") + + @staticmethod + def make_job_off(ticket: Ticket, transition, new_ticket_data: dict): + resignation = Resignation.objects.get(ticket=ticket) + emp = resignation.employee + emp.job_state = Employee.JOB_OFF + emp.save(update_fields=['job_state']) + user = emp.user + user.is_deleted = True + user.save(update_fields=['is_deleted']) \ No newline at end of file