fix: enm、fim 修改费用过滤和能源加入班组开始结束时间

This commit is contained in:
zty 2024-09-23 10:04:43 +08:00
parent 6c6a6ce440
commit d5e48c1ab8
2 changed files with 10 additions and 1 deletions

View File

@ -82,6 +82,8 @@ class MpointStatSerializer(CustomModelSerializer):
ep_belong_name = serializers.CharField(source="mpoint.ep_belong.name", read_only=True)
mgroup_name = serializers.CharField(source="mgroup.name", read_only=True)
belong_dept_name = serializers.CharField(source="mgroup.belong_dept.name", read_only=True)
sflog_start_time = serializers.CharField(source="sflog.start_time", read_only=True)
sflog_end_time = serializers.CharField(source="sflog.end_time", read_only=True)
class Meta:
model = MpointStat

View File

@ -46,5 +46,12 @@ class FeeSetViewSet(CustomModelViewSet):
queryset = FeeSet.objects.all()
serializer_class = FeeSetSerializer
select_related_fields = ['fee', 'mgroup']
filterset_fields = ['fee', 'mgroup', 'year', 'month', 'mgroup__cate']
filterset_fields = {
"fee": ["exact"],
"mgroup__name": ["exact", "in"],
"mgroup": ["exact"],
"month": ["exact"],
"year": ["exact"],
"mgroup__cate": ["exact", "in"]
}
search_fields = ['fee__name', 'mgroup__name']