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')