From f6db92f815a1940c0606d38b456243a36a05f2d9 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Wed, 6 Mar 2024 15:50:29 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0wmaterial=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wpm/filters.py | 1 + apps/wpm/views.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/apps/wpm/filters.py b/apps/wpm/filters.py index 91a59c68..9bd1a6d0 100644 --- a/apps/wpm/filters.py +++ b/apps/wpm/filters.py @@ -37,6 +37,7 @@ class WMaterialFilter(filters.FilterSet): "material": ["exact", "in"], "material__type": ["exact", "in"], "material__process": ["exact", "in"], + "material__process__name": ["exact", "contains", "in"], "belong_dept": ["exact"], "belong_dept__name": ["exact", "in"], "batch": ["exact"], diff --git a/apps/wpm/views.py b/apps/wpm/views.py index 941aa779..695a5778 100644 --- a/apps/wpm/views.py +++ b/apps/wpm/views.py @@ -154,6 +154,8 @@ class MlogViewSet(CustomModelViewSet): @transaction.atomic def perform_update(self, serializer): ins = serializer.instance + if ins.submit_time is not None: + raise ParseError('该日志已提交!') val_old = MlogSerializer(instance=ins).data serializer.save() val_new = MlogSerializer(instance=ins).data