diff --git a/apps/wpm/views.py b/apps/wpm/views.py index d54afa1b..eaececeb 100644 --- a/apps/wpm/views.py +++ b/apps/wpm/views.py @@ -695,9 +695,12 @@ class MlogbInViewSet(CreateModelMixin, UpdateModelMixin, DestroyModelMixin, Cust c_month = now.month m_model = material_out.model wpr = Wpr.objects.filter(material_start=material_out, create_time__year=c_year, create_time__month=c_month).order_by("number").last() + cq_w = 4 + if '02d' in rule: + cq_w = 2 if wpr: try: - n_count = int(wpr.number.split("-")[-1].lstrip('0')) + n_count = int(wpr.number[-cq_w:].lstrip('0')) except Exception as e: raise ParseError(f"获取该类产品最后编号错误: {str(e)}") try: