feat: ftestwork belong_dept默认test_user 所在部门

This commit is contained in:
caoqianming 2024-09-11 16:20:34 +08:00
parent ca2103db8e
commit 1caba24321
3 changed files with 7 additions and 1 deletions

View File

@ -34,5 +34,5 @@ class FtestWorkFilter(filters.FilterSet):
"mb": ["exact"],
"batch": ["exact"],
"type": ["exact"],
"type2": ["exact"],
"type2": ["exact"],
}

View File

@ -96,6 +96,8 @@ class FtestWorkCreateUpdateSerializer(CustomModelSerializer):
attrs['batch'] = attrs['mb'].batch
else:
raise ValidationError('请选择车间/仓库库存')
if attrs['test_user']:
attrs['belong_dept'] = attrs['test_user'].belong_dept
return attrs

View File

@ -110,3 +110,7 @@ class AnaViewSet(GenericViewSet):
return Response(ret)
perms_map = {}
@action(methods=['post'], detail=False, perms_map={'post': '*'}, serializer_class=Serializer)
def equip_last_mlog(self, request):
pass