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