feat: handover增加筛选条件
This commit is contained in:
parent
f7843621df
commit
73b3ab9377
|
@ -140,6 +140,7 @@ class HandoverFilter(filters.FilterSet):
|
|||
"recive_mgroup": ["exact"],
|
||||
"recive_mgroup__name": ["exact"],
|
||||
"type": ["exact", "in"],
|
||||
"mtype": ["exact", "in"]
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -951,7 +951,7 @@ class HandoverSerializer(CustomModelSerializer):
|
|||
if mtype == Handover.H_DIV:
|
||||
if not item["batch"]:
|
||||
raise ParseError(f'第{ind+1}行-请提供拆批批次号')
|
||||
handoverb = Handoverb.objects.create(handover=ins, batch=item["batch"], count=count)
|
||||
handoverb = Handoverb.objects.create(handover=ins, batch=item["batch"], count=count, wm=wm)
|
||||
else:
|
||||
handoverb = Handoverb.objects.create(handover=ins, wm=wm, count=count, batch=wm.batch)
|
||||
if wm.material.tracking == Material.MA_TRACKING_SINGLE:
|
||||
|
@ -980,7 +980,8 @@ class HandoverSerializer(CustomModelSerializer):
|
|||
if validated_data["mtype"] == Handover.H_DIV:
|
||||
if not item["batch"]:
|
||||
raise ParseError(f'第{ind+1}行-请提供拆批批次号')
|
||||
hb, _ = Handoverb.objects.get_or_create(handover=instance, batch=item["batch"], defaults={"count": count})
|
||||
hb, _ = Handoverb.objects.get_or_create(handover=instance, batch=item["batch"], wm=wm,
|
||||
defaults={"count": count})
|
||||
else:
|
||||
hb, _ = Handoverb.objects.get_or_create(handover=instance, wm=wm, defaults={"count": count,
|
||||
"batch": wm.batch})
|
||||
|
|
Loading…
Reference in New Issue