feat: 正常交接收料工段与送料工段不能相同

This commit is contained in:
caoqianming 2025-07-02 10:46:11 +08:00
parent e2f3c95748
commit 1d840e7c9d
1 changed files with 3 additions and 0 deletions

View File

@ -1075,6 +1075,9 @@ class HandoverSerializer(CustomModelSerializer):
raise ParseError('必须指定收料车间或收料工段')
if not attrs.get('send_dept', None) and not attrs.get('send_mgroup', None):
raise ParseError('必须指定送料车间或送料工段')
if attrs["type"] == Handover.H_NORMAL and attrs.get("recive_mgroup", None) == attrs.get("send_mgroup", None):
raise ParseError('正常交接收料工段与送料工段不能相同')
t_count = 0
tracking = attrs["material"].tracking
for ind, item in enumerate(attrs['handoverb']):