feat: 供应商审核通过后即可添加供应商
This commit is contained in:
parent
72f8637e19
commit
700f238a8e
|
|
@ -12,6 +12,7 @@ from rest_framework.response import Response
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
from apps.pum.services import PumService
|
from apps.pum.services import PumService
|
||||||
from apps.wf.mixins import TicketMixin
|
from apps.wf.mixins import TicketMixin
|
||||||
|
from apps.wf.models import Ticket
|
||||||
# Create your views here.
|
# Create your views here.
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -42,6 +43,13 @@ class SupplierAuditViewSet(TicketMixin, CustomModelViewSet):
|
||||||
search_fields = ['name', 'material_name', 'material_cate']
|
search_fields = ['name', 'material_name', 'material_cate']
|
||||||
workflow_key = "wf_supplieraudit"
|
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):
|
class PuPlanViewSet(CustomModelViewSet):
|
||||||
"""
|
"""
|
||||||
list: 采购计划
|
list: 采购计划
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue