生成子计划序列化
This commit is contained in:
parent
1dbc8e2398
commit
85b21dcbac
|
@ -1,3 +1,4 @@
|
|||
from rest_framework import serializers
|
||||
from rest_framework.views import APIView
|
||||
from apps.em.models import Equipment
|
||||
from apps.em.serializers import EquipmentSerializer
|
||||
|
@ -40,7 +41,9 @@ class ProductionPlanViewSet(CreateUpdateModelAMixin, ListModelMixin, CreateModel
|
|||
def get_serializer_class(self):
|
||||
if self.action in ['create']:
|
||||
return ProductionPlanCreateFromOrderSerializer
|
||||
return ProductionPlanSerializer
|
||||
elif self.action == 'list':
|
||||
return ProductionPlanSerializer
|
||||
return super().get_serializer_class()
|
||||
|
||||
def create(self, request, *args, **kwargs):
|
||||
data = request.data
|
||||
|
@ -56,7 +59,7 @@ class ProductionPlanViewSet(CreateUpdateModelAMixin, ListModelMixin, CreateModel
|
|||
updateOrderPlanedCount(instance.order)
|
||||
return Response()
|
||||
|
||||
@action(methods=['post'], detail=True, perms_map={'post':'*'})
|
||||
@action(methods=['post'], detail=True, perms_map={'post':'*'}, serializer_class=serializers.Serializer)
|
||||
def gen_subplan(self, request, pk=None):
|
||||
"""
|
||||
生成子计划
|
||||
|
|
Loading…
Reference in New Issue