refector: 检验撤回根据count_notok进行update_mb

This commit is contained in:
caoqianming 2024-04-24 16:22:36 +08:00
parent e33b4e5902
commit 7b83cd1095
1 changed files with 4 additions and 3 deletions

View File

@ -266,6 +266,7 @@ class MIOItemViewSet(ListModelMixin, BulkCreateModelMixin, BulkDestroyModelMixin
mio: MIO = ins.mio mio: MIO = ins.mio
if ins.test_date is None: if ins.test_date is None:
raise ParseError('该明细还未检验') raise ParseError('该明细还未检验')
if ins.count_notok > 0:
InmService.update_mb_item(ins, 1, 'count_notok', mio.type, mio.belong_dept) InmService.update_mb_item(ins, 1, 'count_notok', mio.type, mio.belong_dept)
ins.test_date = None ins.test_date = None
ins.save() ins.save()