feat: 供应商审核通过后即可添加供应商
This commit is contained in:
parent
39066f2124
commit
cad2a7e50a
|
|
@ -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: 采购计划
|
||||
|
|
|
|||
Loading…
Reference in New Issue