diff --git a/apps/wpm/views.py b/apps/wpm/views.py index be8b92c5..6f40d7ff 100644 --- a/apps/wpm/views.py +++ b/apps/wpm/views.py @@ -544,11 +544,9 @@ class MlogbInViewSet(CreateModelMixin, UpdateModelMixin, DestroyModelMixin, Cust d_count_real = xcount d_count_ok = xcount # 找寻质检表 - qctmat = QctMat.objects.filter(material=material_out, qct__is_deleted=False).order_by("-create_time").first() - qct = None - if qctmat: - qct = qctmat.qct - mlogbout.qct = qct + if material_out.tracking == Material.MA_TRACKING_SINGLE: + qctmat = QctMat.objects.filter(material=material_out, qct__is_deleted=False).order_by("-create_time").first() + mlogbout.qct = qctmat.qct mlogbout.count_real = d_count_real mlogbout.count_ok = d_count_ok mlogbout.save()