feat: materialbatch增加查询条件
This commit is contained in:
parent
cc0a2719de
commit
d94424131f
|
@ -9,5 +9,7 @@ class MaterialBatchFilter(filters.FilterSet):
|
||||||
fields = {
|
fields = {
|
||||||
"warehouse": ["exact"],
|
"warehouse": ["exact"],
|
||||||
"material": ["exact"],
|
"material": ["exact"],
|
||||||
|
"material__type": ["exact", "in"],
|
||||||
|
"material__process": ["exact", "in"],
|
||||||
"count": ["exact", "gte", "lte"]
|
"count": ["exact", "gte", "lte"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,8 @@ class MaterialBatchViewSet(ListModelMixin, CustomGenericViewSet):
|
||||||
retrieve_serializer_class = MaterialBatchDetailSerializer
|
retrieve_serializer_class = MaterialBatchDetailSerializer
|
||||||
select_related_fields = ['warehouse', 'material']
|
select_related_fields = ['warehouse', 'material']
|
||||||
filterset_class = MaterialBatchFilter
|
filterset_class = MaterialBatchFilter
|
||||||
search_fields = ['material__name']
|
search_fields = ['material__name', 'material__number',
|
||||||
|
'material__model', 'material__specification', 'batch']
|
||||||
|
|
||||||
|
|
||||||
class MioDoViewSet(BulkCreateModelMixin, BulkUpdateModelMixin, CustomGenericViewSet):
|
class MioDoViewSet(BulkCreateModelMixin, BulkUpdateModelMixin, CustomGenericViewSet):
|
||||||
|
|
Loading…
Reference in New Issue