feat: shift 视图改为完整 CRUD 以支持班次管理页
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
e2b1f266aa
commit
32b0313349
|
|
@ -102,16 +102,16 @@ class MaterialViewSet(CustomModelViewSet):
|
||||||
data = [list(getter(item)) for item in odata]
|
data = [list(getter(item)) for item in odata]
|
||||||
return Response({'path': export_excel(field_data, data, '物料清单')})
|
return Response({'path': export_excel(field_data, data, '物料清单')})
|
||||||
|
|
||||||
class ShiftViewSet(ListModelMixin, CustomGenericViewSet):
|
class ShiftViewSet(CustomModelViewSet):
|
||||||
"""
|
"""
|
||||||
list:班次
|
list:班次
|
||||||
|
|
||||||
班次
|
班次
|
||||||
"""
|
"""
|
||||||
perms_map = {'get': '*'}
|
|
||||||
queryset = Shift.objects.all()
|
queryset = Shift.objects.all()
|
||||||
serializer_class = ShiftSerializer
|
serializer_class = ShiftSerializer
|
||||||
search_fields = ['name']
|
search_fields = ['name', 'rule']
|
||||||
|
filterset_fields = ['rule']
|
||||||
ordering = ['rule', 'sort', 'id']
|
ordering = ['rule', 'sort', 'id']
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue