feat: 获取物料标签信息
This commit is contained in:
parent
107818301f
commit
419dbf3560
|
@ -1,7 +1,7 @@
|
||||||
from django.shortcuts import render
|
from django.shortcuts import render
|
||||||
from apps.cm.models import LableMat
|
from apps.cm.models import LableMat
|
||||||
from rest_framework.decorators import action
|
from rest_framework.decorators import action
|
||||||
from apps.cm.serializers import TidSerializer
|
from apps.cm.serializers import TidSerializer, LabelMatSerializer
|
||||||
from apps.inm.models import MaterialBatch
|
from apps.inm.models import MaterialBatch
|
||||||
from rest_framework.exceptions import ParseError
|
from rest_framework.exceptions import ParseError
|
||||||
from rest_framework.response import Response
|
from rest_framework.response import Response
|
||||||
|
@ -30,4 +30,13 @@ class LableMatViewSet(CustomGenericViewSet):
|
||||||
"supplier": mb.supplier
|
"supplier": mb.supplier
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
return Response({"label": f"mat:{obj.id}"})
|
return Response({"label": f"mat:{obj.id}"})
|
||||||
|
|
||||||
|
def info(self, request, pk=None):
|
||||||
|
"""
|
||||||
|
获取物料标签信息
|
||||||
|
|
||||||
|
获取物料标签信息
|
||||||
|
"""
|
||||||
|
obj = self.get_object()
|
||||||
|
return Response(LabelMatSerializer(obj).data)
|
Loading…
Reference in New Issue