feat: batchst返回material_start相关信息

This commit is contained in:
caoqianming 2025-08-29 09:48:09 +08:00
parent a249258ba6
commit 9d1c5415e1
2 changed files with 4 additions and 0 deletions

View File

@ -1464,6 +1464,9 @@ class MlogTCreateSerializer(CustomModelSerializer):
class BatchStSerializer(CustomModelSerializer):
material_start_name = serializers.CharField(source='material_start.name', read_only=True)
material_start_model = serializers.CharField(source='material_start.model', read_only=True)
material_start_specification = serializers.CharField(source='material_start.specification', read_only=True)
class Meta:
model = BatchSt
fields = "__all__"

View File

@ -901,6 +901,7 @@ class BatchStViewSet(ListModelMixin, ComplexQueryMixin, CustomGenericViewSet):
perms_map = {"get": "*"}
queryset = BatchSt.objects.all()
serializer_class = BatchStSerializer
select_related_fields = ["material_start"]
ordering_fields = ["batch", "last_time", "update_time"]
ordering = ["batch"]
filterset_class = BatchStFilter