From 407b98e2064444f2726954f996636eac03c03cf1 Mon Sep 17 00:00:00 2001 From: iriska-gri <79623434+iriska-gri@users.noreply.github.com> Date: Fri, 27 Oct 2023 10:16:05 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=BA=D1=81=D0=B5=D0=BB=D1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db.sqlite3 | Bin 380928 -> 380928 bytes front/src/views/HomePage.vue | 10 +++---- front/src/views/nested_view/o_OKiB.vue | 35 +++++++++++++++++-------- general_vacation/views.py | 22 ++++++++-------- 4 files changed, 40 insertions(+), 27 deletions(-) diff --git a/db.sqlite3 b/db.sqlite3 index cf86ba9c609cce0cd0de84cf8df4230d83d17594..4bbf1d9b322d1732ec412c0667e0a0f27e141649 100644 GIT binary patch delta 5213 zcmeI0du$X%9LINOcXoTQw_7Z2%?%Bf8U$qP%-!DYoi7k1Xu_k2yjvdS{eDAv?yaB& zQ7n|YwbkU*gb+j%)Of}}pdmgIqM7}j?RC^zxv01zdQ5E zZ)az2W_~-D&J?FJ#dQ&#j1vT*ie3xoB_A7=0A$?R#V3c0hw9b)#z=>Z6(0=2<>C5j zb0i$GQJM_ukD4VwXskbDMwI5#<No=; zU{JYNkpT;{XENaFkhkF-kQAFe@eDA>$7K5vcc}Mf8+gb=SAZ)n^4_=tE~tYi2#*R? zA&*=JW4w+ZK?p`|(=G5Su7c9+`ES7_MJmgSdg=}E0H9ue0}KOsHD1LHFfzOC1~{jB zrN4p+a?}=@z07Tplx(4iRn>Oh0`!uyowsCT&Xh)NnP&WDd~JMbv=|>6@9E#^m-SZt zqW-CVPPg>Ix)S~~+!6jc90?bO^TUI}vi7&}gK^FHMjxgZ>G?*dUT*wmwCkhv5#HGG zaGR_P;m(Fnz>{OOKeP_5UAw7W)!MYLw9mEk+Q-^i?X>o`_PW-f9o1^Jw6;szqOH}I zd71IBG28kCJTb`eM_UmZ1M>oVHL!-jP6SpT*zv%Q1y&c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GE$otER(qK~j9 zwSF5e8D>P}IAx`Any6Fpv~G~r4br&KwgJvJ@h*DggFI%{xPy4i^1cHRs}GeogVT*p zt25PSd)3KKjLMdOo5ZT3twUA( zC`MBIj^GS3BHj*VW${ksWO1a5XK{jR&hlQCWpR(C!e?=;&=87ic^_-bG^R>z}QG)B;zd-MT|E{6f#zm7{N%8 z7|vKhqJXiK#2t)hNDN~vAd%0QOJXSFQ4&KK50S`YG>`~0>Pbk(6cT(~Mg@rw<1P|G z#&{9|XaQq12|wEc5GLWb8KK24e@ob;bt-e*&~%lHeNKc7i_`ZxReJUL&~5c!l5!<3)ns z8Ou!gjj`B-e#Sx*E;Hs6Tw*-#fnOO96I^68B3xk1Kse8sig1omP0+`15PBJt5Y94Y zmmu^oixAE*@(E5eLIkH6MDPoMxJ_`9ag89$=qEVAI7e`taf;v=qnn_c@gu=e#`gq2 zr)rzbuOl0p(Gvtd34T5@^0Lf!tczV;%^I~Xt|iZ(q=C)OL0|c(P1?8+e)pIM%5hl+T_%s)eac$sj zRsRBqxiqlSEv?n1^ITJ1$)?UVwK2#x)Ml;NPar2(yOe z>uy06>qV~S{{DDQ$9Q6YEVm$Dr=LGRgL^6G_4@{LIW=7C>vA>c`##I*YVPmbsP*7x ze5-QdN}bZIPOjoGFUB`bch`&ejmyoWgQRoyQB?3(u-7&E=)4C8%`iuI_il%X82it6 zwWv|;N|}YJ#Bwv?{iMyb!aja&2mfzor@~3|@|ZBc=`i>_-jD;bUtZ|QOLxnBj{zdA K2dRgU9`J9gfuke< diff --git a/front/src/views/HomePage.vue b/front/src/views/HomePage.vue index 9f583a60f..f5ff448cf 100644 --- a/front/src/views/HomePage.vue +++ b/front/src/views/HomePage.vue @@ -51,7 +51,7 @@ - {{[t_daily.daily]}} + @@ -158,10 +158,10 @@ height="500" flat > - + - +
diff --git a/front/src/views/nested_view/o_OKiB.vue b/front/src/views/nested_view/o_OKiB.vue index b1f71f8a9..a3364efe4 100644 --- a/front/src/views/nested_view/o_OKiB.vue +++ b/front/src/views/nested_view/o_OKiB.vue @@ -5,14 +5,11 @@ - - + {{t_dailyRound}} + + + Тык + { axiosApiInstance.get(`api/general_vacation/dailyroundup/`).then(result => { let link = document.createElement("a") @@ -68,21 +67,35 @@ export default { const sdata = new FormData() sdata.append('dailyfiles', dailyfiles.value[0]) - - axiosApiInstance.post(`api/general_vacation/dailyroundup/`, sdata).then(result => { - console.log(result.data, '----------------'); + info.value = result.data + console.log(result.data, '----------------') }) + } + const detailRound = () => { + + axiosApiInstance.get(`api/general_vacation/dailyload/?id=6`) + .then(data => { + console.log(data.data); + + t_dailyRound.value = data.data + }) + + } + return { visiting, excelOp, baseURL, dailyfiles, onPickFile, + info, + detailRound, + t_dailyRound } } diff --git a/general_vacation/views.py b/general_vacation/views.py index 7e3964751..6e4d1ea3e 100644 --- a/general_vacation/views.py +++ b/general_vacation/views.py @@ -214,7 +214,7 @@ class DailyRoundUpAPIView(APIView): dfuser = pd.DataFrame.from_records(user) try: - print(request.data['dailyfiles'], '============================================') + file = request.data['dailyfiles'] ed = pd.read_excel(file) df = pd.DataFrame(ed) @@ -258,9 +258,15 @@ class DailyRoundUpAPIView(APIView): base=BasePosition.objects.get(pk=keys) DailyRoundUp.objects.update_or_create(todaysDate=datetime.strptime(datas, '%d.%m.%Y').strftime('%Y-%m-%d'), user=df3['login'][ind], defaults={'position':base}) - print(df3, '-----------------------') + + pos = DailyRoundUp.objects.values('position__name', 'position').filter(position=6,todaysDate=date.today()).annotate(Count('user')) + + + print('-------', pos) + mess = "Файл загружен" + except Exception as e: - err = 'Файл не найден' + mess = 'Файл не найден' # serializer_for_daily = DailyRoundUpSerializer( @@ -270,7 +276,7 @@ class DailyRoundUpAPIView(APIView): - return Response('') + return Response({"mess": mess, "pos": pos}) class DailyloadAPIView(APIView): @@ -279,22 +285,16 @@ class DailyloadAPIView(APIView): if request.GET.__contains__('id'): daily = DailyRoundUp.objects.filter(position=request.GET.get("id"),todaysDate=date.today()).values_list('user', 'position__name') - print(daily,'0000000000000000000000000000000000000000000000000000000000000000000000000000000') - - result = {} - # base=BasePosition.objects.get(pk=keys) + result = {} 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, 'post':x.post}) else: result[x.department]=[{'login':x.login,'fio':x.fio, 'post':x.post}] - # result['position'] = request.GET.get("id") daily = result else: daily = DailyRoundUp.objects.values('position__name', 'position').filter(todaysDate=date.today()).annotate(Count('user')) - # return Response(daily) return Response({'daily':daily, 'position':request.GET.get("id")})