From e11beae8105835faf33b19d3fdd2c5f673cb2837 Mon Sep 17 00:00:00 2001 From: shilixia <2309368887@qq.com> Date: Thu, 29 Oct 2020 10:03:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8B=E6=8B=89=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/views/certapp/detectiontask.vue | 12 +- client/src/views/testorg/issued.vue | 184 ++++++++++++++------- server/apps/project/views.py | 8 +- 3 files changed, 137 insertions(+), 67 deletions(-) diff --git a/client/src/views/certapp/detectiontask.vue b/client/src/views/certapp/detectiontask.vue index 5d7c2c3..4516644 100644 --- a/client/src/views/certapp/detectiontask.vue +++ b/client/src/views/certapp/detectiontask.vue @@ -44,9 +44,10 @@ 下达实验室 + @@ -269,6 +270,15 @@ export default { var val='待实验室检验'; teststateCertappunit(id, {'teststate':val}).then(res=>{ this.$message.success('成功') + this.getList() + }) + + }, + updatestate(id){ + var val='待CTC下达'; + teststateCertappunit(id, {'teststate':val}).then(res=>{ + this.$message.success('成功') + this.getList() }) }, diff --git a/client/src/views/testorg/issued.vue b/client/src/views/testorg/issued.vue index 99d5af5..6c0ff6f 100644 --- a/client/src/views/testorg/issued.vue +++ b/client/src/views/testorg/issued.vue @@ -1,76 +1,132 @@ diff --git a/server/apps/project/views.py b/server/apps/project/views.py index c3e4d29..b5e2921 100644 --- a/server/apps/project/views.py +++ b/server/apps/project/views.py @@ -78,7 +78,7 @@ class CertappViewset(PageOrNot, RbacFilterSet, ModelViewSet): queryset = CertApp.objects.all() serializer_class = CertappSerializer ordering = ['-create_time'] - filterset_fields = ['state', 'project', 'cert_field'] + filterset_fields = ['state', 'project','cert_field'] # filterset_class = CertAppFilter @@ -197,7 +197,7 @@ class CertappunitViewset(PageOrNot, ModelViewSet): perms_map={'get': '*', '*':'certapp_view'} queryset = Certappunit.objects.all() serializer_class = CertappunitSerializer - filterset_fields = ['certapp'] + filterset_fields = ['certapp','teststate'] ordering= ['-id'] @action(methods=['put'], detail=True, perms_map={'put':'certapp_access'}, url_name='certappunit_access') @@ -237,6 +237,10 @@ class CertappunitViewset(PageOrNot, ModelViewSet): obj.inspectionstate = "待检验" obj.save() return Response(status=status.HTTP_200_OK) + elif obj.teststate == "待提交CTC": + obj.teststate = request.data['teststate'] + obj.save() + return Response(status=status.HTTP_200_OK) else: return Response('检测任务异常,操作失败', status=status.HTTP_400_BAD_REQUEST) @action(methods=['put'], detail=True, perms_map={'put':'certapp_createsamples'}, url_name='certappunit_createsamples')