设备检查表删除接口

This commit is contained in:
caoqianming 2022-01-07 21:43:47 +08:00
parent 2991b44c56
commit e1abcb36d2
2 changed files with 13 additions and 1 deletions

View File

@ -5808,7 +5808,12 @@ def apioperation(req):
x['zyimg2'] = x['zyimg2'].split('?')
else:
x['zyimg2'] = []
x['fxcs'] = [int(i) for i in x['fxcs'].split('?')]
x['fxcs'] = []
for i in x['fxcs'].split('?'):
if i:
x['fxcs'].append(int(i))
x['fxcs_'] = list(Fxcs.objects.filter(
id__in=x['fxcs']).values('id', 'fxfx', 'aqcs', 'cslx'))
# 确认详情

View File

@ -5,6 +5,7 @@ from rest_framework.generics import ListAPIView
from rest_framework.viewsets import ModelViewSet
from rest_framework.response import Response
from rest_framework import generics
from rest_framework import status
class EquipmentCheckFormAPIView(APIView):
@ -68,3 +69,9 @@ class EquipmentCheckFormDetailView(generics.RetrieveUpdateDestroyAPIView):
queryset = EquipmentCheckForm.objects.all()
serializer_class = EquipmentCheckFormSerializers
def destroy(self, request, *args, **kwargs):
obj = EquipmentCheckForm.objects.get(id=kwargs['pk'])
obj.deletemark=0
obj.save()
return Response(status=status.HTTP_204_NO_CONTENT)