feat: ftestwork增加校验
This commit is contained in:
parent
305fda44c2
commit
5628a1ff83
|
@ -93,6 +93,8 @@ class FtestWorkCreateUpdateSerializer(CustomModelSerializer):
|
|||
else:
|
||||
raise ValidationError(f'不合格项{k_2}必须为非负整数')
|
||||
attrs['count_notok'] = count_notok
|
||||
if type2 == 20 and attrs['count'] != attrs['count_ok'] + attrs['count_notok']:
|
||||
raise ValidationError('全检时总数必须等于合格数+不合格数')
|
||||
elif 'mb' in attrs and attrs['mb']:
|
||||
attrs['wm'] = None
|
||||
attrs['material'] = attrs['mb'].material
|
||||
|
|
Loading…
Reference in New Issue