Список
This commit is contained in:
1 parent
a41123acb8
commit
167075dcab
3 files changed
+34
-74
No files matched your search
BIN
Binary file not shown.
@@ -145,51 +145,40 @@
|
|||||||
|
|
||||||
<v-dialog
|
<v-dialog
|
||||||
v-model="dialogDetailRound"
|
v-model="dialogDetailRound"
|
||||||
width="auto"
|
width="500"
|
||||||
>
|
>
|
||||||
<v-card
|
<v-card class="pa-5">
|
||||||
class="mx-auto"
|
<v-divider class="my-6"/>
|
||||||
width="450"
|
<v-table
|
||||||
height="500"
|
v-for="(x, key) in t_dailyRound"
|
||||||
>
|
:key="key"
|
||||||
<my-helper :pretext = 't_dailyRound'/>
|
density="compact"
|
||||||
<!-- <v-toolbar color="cyan-lighten-1">
|
|
||||||
<v-btn variant="text" icon="mdi-menu"></v-btn>
|
|
||||||
|
|
||||||
<v-toolbar-title>Inbox</v-toolbar-title>
|
|
||||||
|
|
||||||
<v-spacer></v-spacer>
|
|
||||||
|
|
||||||
<v-btn variant="text" icon="mdi-magnify"></v-btn>
|
|
||||||
</v-toolbar> -->
|
|
||||||
|
|
||||||
<!-- <v-list
|
|
||||||
:items="items"
|
|
||||||
item-props
|
|
||||||
lines="three"
|
|
||||||
>
|
|
||||||
<template v-slot:subtitle="{ subtitle }">
|
|
||||||
<div v-html="subtitle"></div>
|
|
||||||
</template>
|
|
||||||
</v-list> -->
|
|
||||||
<v-table density="compact">
|
|
||||||
|
|
||||||
<tbody v-for="item in t_dailyRound"
|
|
||||||
:key="item.name">
|
|
||||||
<tr
|
|
||||||
|
|
||||||
>
|
>
|
||||||
<td>{{ item.department }}</td>
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th class="text-left">
|
||||||
|
{{key}}
|
||||||
|
</th>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
<tr v-for="i in item.author" :key="i">
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr
|
||||||
|
v-for="item in x"
|
||||||
|
:key="item.name"
|
||||||
|
>
|
||||||
|
<td>{{ item.fio }}</td>
|
||||||
|
|
||||||
|
|
||||||
<td >{{ i }}</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
<v-divider class="my-6"/>
|
||||||
</v-table>
|
</v-table>
|
||||||
</v-card>
|
</v-card>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</v-dialog>
|
</v-dialog>
|
||||||
</div>
|
</div>
|
||||||
</v-container>
|
</v-container>
|
||||||
|
|||||||
+10
-39
@@ -273,48 +273,19 @@ class DailyloadAPIView(APIView):
|
|||||||
def get(self, request):
|
def get(self, request):
|
||||||
|
|
||||||
if request.GET.__contains__('id'):
|
if request.GET.__contains__('id'):
|
||||||
print(request.GET.get("id"), '-------------------------------------')
|
|
||||||
|
|
||||||
|
daily = DailyRoundUp.objects.filter(position=request.GET.get("id"),todaysDate=date.today()).values_list('user')
|
||||||
|
result = {}
|
||||||
|
|
||||||
depart = DictEmployee.objects.using('user_directory').values('department')
|
u=DictEmployee.objects.using('user_directory').filter(login__in=[x[0] for x in daily])
|
||||||
daily = DailyRoundUp.objects.filter(position=request.GET.get("id"),todaysDate=datetime.now()).values('user')
|
for x in u:
|
||||||
result = []
|
|
||||||
|
|
||||||
for x in daily:
|
if x.department in result.keys():
|
||||||
for z in depart.filter(login=x['user']).distinct():
|
result[x.department].append({'login':x.login,'fio':x.fio})
|
||||||
if not z in result:
|
|
||||||
result.append(z)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# for r in result:
|
|
||||||
# r['author'] = [{"author":v.fio} for v in DictEmployee.objects.using('user_directory').filter(login=x['user'], department=r['department'])]
|
|
||||||
# print(user,'---------------------')
|
|
||||||
print(result, '---------------')
|
|
||||||
|
|
||||||
|
|
||||||
# z['author'] = [{v.fio for v in DictEmployee.objects.using('user_directory').filter(login=x['user'], department=z['department'])}]
|
|
||||||
# print(z, '---------------')
|
|
||||||
# result.append(z)
|
|
||||||
# for x in daily:
|
|
||||||
# z['author'] = [v.fio for v in DictEmployee.objects.using('user_directory').filter(login=x['user'], department=z['department'])]
|
|
||||||
# result.append(z)
|
|
||||||
daily = result
|
|
||||||
# for x in daily:
|
|
||||||
# x['user'] = DictEmployee.objects.using('user_directory').filter(login=x['user'])
|
|
||||||
# result.append(x)
|
|
||||||
# print(x,'---------------------------------')
|
|
||||||
|
|
||||||
# print(request.GET.get("id"), '-------------------------------------')
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# for x in daily:
|
|
||||||
# x['user'] = model_to_dict(DictEmployee.objects.using('user_directory').get(login=x['user']))
|
|
||||||
# result.append(x)
|
|
||||||
else:
|
else:
|
||||||
daily = DailyRoundUp.objects.values('position__name', 'position').annotate(Count('user'))
|
result[x.department]=[{'login':x.login,'fio':x.fio}]
|
||||||
|
daily = result
|
||||||
|
else:
|
||||||
|
daily = DailyRoundUp.objects.values('position__name', 'position').filter(todaysDate=date.today()).annotate(Count('user'))
|
||||||
|
|
||||||
return Response(daily)
|
return Response(daily)
|
||||||
Reference in new issue
Block a user