feat: supplieraudit采用新工作流挂载方式
This commit is contained in:
parent
53db1cdc35
commit
c21a39b52d
|
|
@ -150,4 +150,5 @@ class SupplierAuditSerializer(CustomModelSerializer):
|
|||
ticket_ = TicketSimpleSerializer(source="ticket", read_only=True)
|
||||
class Meta:
|
||||
model = SupplierAudit
|
||||
fields = "__all__"
|
||||
fields = "__all__"
|
||||
read_only_fields = EXCLUDE_FIELDS_BASE + ['ticket']
|
||||
|
|
@ -11,7 +11,7 @@ from django.db import transaction
|
|||
from rest_framework.response import Response
|
||||
from django.utils import timezone
|
||||
from apps.pum.services import PumService
|
||||
from apps.wf.models import Ticket
|
||||
from apps.wf.mixins import TicketMixin
|
||||
# Create your views here.
|
||||
|
||||
|
||||
|
|
@ -31,7 +31,7 @@ class SupplierViewSet(CustomModelViewSet):
|
|||
raise ParseError('该供应商存在采购订单不可删除')
|
||||
instance.delete()
|
||||
|
||||
class SupplierAuditViewSet(CustomModelViewSet):
|
||||
class SupplierAuditViewSet(TicketMixin, CustomModelViewSet):
|
||||
"""
|
||||
list: 供应商审核
|
||||
|
||||
|
|
@ -40,14 +40,7 @@ class SupplierAuditViewSet(CustomModelViewSet):
|
|||
queryset = SupplierAudit.objects.all()
|
||||
serializer_class = SupplierAuditSerializer
|
||||
search_fields = ['name', 'material_name', 'material_cate']
|
||||
|
||||
def perform_destroy(self, instance):
|
||||
ticket:Ticket = instance.ticket
|
||||
if ticket and ticket.state.type != 1:
|
||||
raise ParseError('该记录关联的工单已被处理,不可删除')
|
||||
instance.delete()
|
||||
if ticket:
|
||||
ticket.delete()
|
||||
workflow_key = "wf_supplieraudit"
|
||||
|
||||
class PuPlanViewSet(CustomModelViewSet):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Reference in New Issue