feat: 检验撤回test_date在count_notok时直接置空

This commit is contained in:
caoqianming 2024-05-30 10:55:13 +08:00
parent 458385c0f6
commit 0473be4d30
1 changed files with 4 additions and 2 deletions

View File

@ -268,8 +268,10 @@ class MIOItemViewSet(ListModelMixin, BulkCreateModelMixin, BulkDestroyModelMixin
raise ParseError('该明细还未检验')
if ins.count_notok > 0:
InmService.update_mb_item(ins, 1, 'count_notok', mio.type, mio.belong_dept)
ins.test_date = None
ins.save()
elif ins.count_notok == 0:
pass
ins.test_date = None
ins.save()
return Response()
@action(methods=['post'], detail=True, perms_map={'post': 'mioitem.test'}, serializer_class=MIOItemPurInTestSerializer)