|
@@ -11,6 +11,7 @@ from utils.permission import isLogin, check_permission
|
|
|
from apps.customer.models import NewCustomer
|
|
|
from apps.order.models import Order,ProgressDetails
|
|
|
from apps.option.models import Option
|
|
|
+from apps.upload.models import Upload
|
|
|
|
|
|
class GetProcessView(APIView):
|
|
|
permission_classes = [isLogin]
|
|
@@ -73,4 +74,22 @@ class GetDetailsView(APIView):
|
|
|
for detail in details:
|
|
|
dict = detail.get_details()
|
|
|
data.append(dict)
|
|
|
- return response_ok(data)
|
|
|
+ return response_ok(data)
|
|
|
+
|
|
|
+class GetFilesView(APIView):
|
|
|
+ permission_classes = [isLogin]
|
|
|
+
|
|
|
+ def get(self, request):
|
|
|
+ progress_details_id = request.GET.get('progress_details_id')
|
|
|
+ images = Upload.objects.filter(progress_details_id=progress_details_id)
|
|
|
+ img_data = []
|
|
|
+ for img in images:
|
|
|
+ img_data.append(
|
|
|
+ {
|
|
|
+ 'url': img.picture,
|
|
|
+ 'create_time': img.create_time,
|
|
|
+ 'file_size': img.file_size,
|
|
|
+ 'user': img.user.name,
|
|
|
+ }
|
|
|
+ )
|
|
|
+ return response_ok(img_data)
|