生成子计划序列化
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 rest_framework.views import APIView
|
||||||
from apps.em.models import Equipment
|
from apps.em.models import Equipment
|
||||||
from apps.em.serializers import EquipmentSerializer
|
from apps.em.serializers import EquipmentSerializer
|
||||||
|
@ -40,7 +41,9 @@ class ProductionPlanViewSet(CreateUpdateModelAMixin, ListModelMixin, CreateModel
|
||||||
def get_serializer_class(self):
|
def get_serializer_class(self):
|
||||||
if self.action in ['create']:
|
if self.action in ['create']:
|
||||||
return ProductionPlanCreateFromOrderSerializer
|
return ProductionPlanCreateFromOrderSerializer
|
||||||
|
elif self.action == 'list':
|
||||||
return ProductionPlanSerializer
|
return ProductionPlanSerializer
|
||||||
|
return super().get_serializer_class()
|
||||||
|
|
||||||
def create(self, request, *args, **kwargs):
|
def create(self, request, *args, **kwargs):
|
||||||
data = request.data
|
data = request.data
|
||||||
|
@ -56,7 +59,7 @@ class ProductionPlanViewSet(CreateUpdateModelAMixin, ListModelMixin, CreateModel
|
||||||
updateOrderPlanedCount(instance.order)
|
updateOrderPlanedCount(instance.order)
|
||||||
return Response()
|
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):
|
def gen_subplan(self, request, pk=None):
|
||||||
"""
|
"""
|
||||||
生成子计划
|
生成子计划
|
||||||
|
|
Loading…
Reference in New Issue