From 700f238a8e3ec1bf12945edafa398026ab4a377d Mon Sep 17 00:00:00 2001 From: caoqianming Date: Mon, 1 Dec 2025 09:16:23 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BE=9B=E5=BA=94=E5=95=86=E5=AE=A1?= =?UTF-8?q?=E6=A0=B8=E9=80=9A=E8=BF=87=E5=90=8E=E5=8D=B3=E5=8F=AF=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E4=BE=9B=E5=BA=94=E5=95=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/pum/views.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/apps/pum/views.py b/apps/pum/views.py index 2a48665b..37793033 100644 --- a/apps/pum/views.py +++ b/apps/pum/views.py @@ -12,6 +12,7 @@ from rest_framework.response import Response from django.utils import timezone from apps.pum.services import PumService from apps.wf.mixins import TicketMixin +from apps.wf.models import Ticket # Create your views here. @@ -42,6 +43,13 @@ class SupplierAuditViewSet(TicketMixin, CustomModelViewSet): search_fields = ['name', 'material_name', 'material_cate'] workflow_key = "wf_supplieraudit" + @staticmethod + def add_supplier(ticket: Ticket, transition, new_ticket_data: dict): + supplieraudit = SupplierAudit.objects.get(ticket=ticket) + if Supplier.objects.filter(name=supplieraudit.name).exists(): + raise ParseError('供应商名称已存在') + Supplier.objects.create(name=supplieraudit.name) + class PuPlanViewSet(CustomModelViewSet): """ list: 采购计划