diff --git a/src/db.sqlite3 b/src/db.sqlite3 index 1a8ef2ad5..534514b56 100644 Binary files a/src/db.sqlite3 and b/src/db.sqlite3 differ diff --git a/src/front/src/components/digital-letna.vue b/src/front/src/components/digital-letna.vue index af2eaf2e1..dd506cec6 100644 --- a/src/front/src/components/digital-letna.vue +++ b/src/front/src/components/digital-letna.vue @@ -90,12 +90,12 @@ flat - + {{t_dailyRound.position}} - + { + console.log(data, '-------------------data'); t_dailyRound.value = data.data - result.value=JSON.parse(JSON.stringify(data.data)) + result.value=JSON.parse(JSON.stringify(data.data.daily)) }) } @@ -238,16 +239,18 @@ export default { axiosApiInstance.get('api/general_vacation/dailyload/') .then(data => { - t_daily.value = data.data + t_daily.value = data.data.daily }) } const filterItems = (query) => { + console.log(t_dailyRound.value['daily'], '----------t_dailyRound.value'); + result.value={} - Object.keys(t_dailyRound.value).map(el1 => { - let myarr = t_dailyRound.value[el1].filter((el) =>el.fio.toLowerCase().includes(query.toLowerCase())) + Object.keys(t_dailyRound.value['daily']).map(el1 => { + let myarr = t_dailyRound.value['daily'][el1].filter((el) =>el.fio.toLowerCase().includes(query.toLowerCase())) if(myarr.length>0) { @@ -268,7 +271,7 @@ export default { } else { - result.value = JSON.parse(JSON.stringify(t_dailyRound.value)) + result.value = JSON.parse(JSON.stringify(t_dailyRound.value['daily'])) } diff --git a/src/general_vacation/views.py b/src/general_vacation/views.py index d305903a6..7c0d99393 100644 --- a/src/general_vacation/views.py +++ b/src/general_vacation/views.py @@ -297,10 +297,11 @@ class DailyloadAPIView(APIView): result={} - + if request.GET.__contains__('id'): df=df.loc[df['idpos']==int(request.GET.get("id"))] + pos=df['pos'].unique()[0] if request.GET.__contains__('searchname'): df = df.loc[df["fio"].str.contains(request.GET.get("searchname"))] @@ -312,17 +313,18 @@ class DailyloadAPIView(APIView): result[row['department']].append({'login':row['login'],'fio':row['fio'], 'post':row['post'], 'pos':row['pos']}) else: result[row['department']]=[{'login':row['login'],'fio':row['fio'], 'post':row['post'], 'pos':row['pos']}] - + daily = result + else: - + pos='' daily = DailyRoundUp.objects.values('position__name', 'position').filter(todaysDate=date.today()).annotate(Count('user')) except Exception as e: - + pos='' daily="" - return Response(daily) + return Response({'daily':daily, 'position':pos}) class SearchUserAPIView(APIView): def post(self, request):