From b212702c03ebc3c297eb18245e846c3b72d3ebb7 Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 20 Nov 2023 16:49:16 +0300 Subject: [PATCH 1/3] =?UTF-8?q?=D1=84=D0=BE=D0=BD=20=D0=B4=D0=BB=D1=8F=20?= =?UTF-8?q?=D0=B7=D0=B0=D0=B3=D1=80=D1=83=D0=B7=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/front/src/components/cardUsers.vue | 2 +- src/front/src/components/digital-letna.vue | 35 +++++++++++----------- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/src/front/src/components/cardUsers.vue b/src/front/src/components/cardUsers.vue index 9d45ffcf5..852618e88 100644 --- a/src/front/src/components/cardUsers.vue +++ b/src/front/src/components/cardUsers.vue @@ -101,7 +101,7 @@ - + diff --git a/src/front/src/components/digital-letna.vue b/src/front/src/components/digital-letna.vue index 124fd7335..831a83ac5 100644 --- a/src/front/src/components/digital-letna.vue +++ b/src/front/src/components/digital-letna.vue @@ -41,14 +41,14 @@ + :image="`${burl}/media/newsimage/2023/09/28/sea.jpg`"> - + > --> - - - - + + + + - + - + - - + + - Данные не загружены + Данные не загружены - + - + From bb97902d95c3384e74348b4eb683e3293304bb7f Mon Sep 17 00:00:00 2001 From: iriska-gri <79623434+iriska-gri@users.noreply.github.com> Date: Mon, 20 Nov 2023 16:49:47 +0300 Subject: [PATCH 2/3] =?UTF-8?q?=D0=A8=D0=B0=D0=B1=D0=BB=D0=BE=D0=BD=20?= =?UTF-8?q?=D0=BE=D1=82=D0=BF=D1=83=D1=81=D0=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/db.sqlite3 | Bin 405504 -> 405504 bytes src/front/src/components/load-round.vue | 127 +++++++++++++++++++++--- src/general_vacation/admin.py | 12 +-- src/general_vacation/excel.py | 4 +- src/general_vacation/serializers.py | 8 +- src/general_vacation/views.py | 8 +- src/media/DailyRoundUp.xlsx | Bin 10050 -> 10047 bytes src/r.txt | Bin 2520 -> 2560 bytes 8 files changed, 134 insertions(+), 25 deletions(-) diff --git a/src/db.sqlite3 b/src/db.sqlite3 index 5bb61f3488d47b76163c9ad1b62c8552030dafc5..ddc3dacda8975e7f2671bbaf9955f8320faccf99 100644 GIT binary patch delta 70 zcmZp8AkpwZVuCbd+e8^># Y8`D{Z+clmu0WmWWvuxLR&U(WG0C^!9fB*mh diff --git a/src/front/src/components/load-round.vue b/src/front/src/components/load-round.vue index b323875d1..e90cee606 100644 --- a/src/front/src/components/load-round.vue +++ b/src/front/src/components/load-round.vue @@ -1,7 +1,107 @@ @@ -65,8 +160,8 @@ export default { const info = ref({}) const t_dailyRound = ref('') const alert = ref(false) - const excelOp = () => { - axiosApiInstance.get(`api/general_vacation/dailyroundup/`).then(result => { + const excelOp = (ex) => { + axiosApiInstance.get(`api/general_vacation/dailyroundup/?excel=${ex}`).then(result => { let link = document.createElement("a") link.href = baseURL+result.data.path link.click() @@ -74,6 +169,10 @@ export default { }) } + // const excelVacation = () => { + + // } + @@ -123,5 +222,7 @@ export default { \ No newline at end of file diff --git a/src/general_vacation/admin.py b/src/general_vacation/admin.py index 7437e8b6a..beb3a6603 100644 --- a/src/general_vacation/admin.py +++ b/src/general_vacation/admin.py @@ -1,13 +1,13 @@ from django.contrib import admin from .models import * -# class GeneralVacationAdmin(admin.ModelAdmin): -# fields = ('login', 'planned_date', 'count_days', 'type_of_vacation', 'start_work_period', 'end_work_period') -# list_display=('get_name', 'login', 'planned_date', 'count_days', 'type_of_vacation', 'start_work_period', 'end_work_period') -# readonly_fields=('get_name',) -# def get_name(self, obj): +class GeneralVacationAdmin(admin.ModelAdmin): + fields = ('login', 'planned_date', 'count_days', 'type_of_vacation', 'start_work_period', 'end_work_period') + list_display=('get_name', 'login', 'planned_date', 'count_days', 'type_of_vacation', 'start_work_period', 'end_work_period') + readonly_fields=('get_name',) + def get_name(self, obj): -# return obj.user.fio() + return obj.user.fio() class PlanCalendarAdmin(admin.ModelAdmin): list_display = ('name', 'start_work_period', 'end_work_period') diff --git a/src/general_vacation/excel.py b/src/general_vacation/excel.py index a0de38346..b5ba7f877 100644 --- a/src/general_vacation/excel.py +++ b/src/general_vacation/excel.py @@ -15,7 +15,7 @@ class roundExcel(): pass def excround(self): - + print(self.df ) self.df['tabel'] = self.df['login'].str.split('-', expand = True)[1]+self.df['login'].str.split('-', expand = True)[2] file_path = 'media/DailyRoundUp.xlsx' thins = Side(border_style="thin") @@ -167,6 +167,8 @@ class roundExcel(): PIXELS_PER_CHAR = 7 return (width) / PIXELS_PER_CHAR + def excelvacation(self): + print('helooooooooooooooooooooooooooooooooooooo') # def excroundread(self): # file = request.data['dailyfiles'] # ed = pd.read_excel(file) diff --git a/src/general_vacation/serializers.py b/src/general_vacation/serializers.py index aaa6a5a1a..374f14287 100644 --- a/src/general_vacation/serializers.py +++ b/src/general_vacation/serializers.py @@ -1,11 +1,11 @@ from rest_framework import serializers from .models import * -# class GeneralVacationSerializer(serializers.ModelSerializer): +class GeneralVacationSerializer(serializers.ModelSerializer): -# class Meta: -# model = GeneralVacation -# fields ='__all__' + class Meta: + model = GeneralVacation + fields ='__all__' class PlanCalendarSerializer(serializers.ModelSerializer): diff --git a/src/general_vacation/views.py b/src/general_vacation/views.py index 1d50530d6..e0d1e7efc 100644 --- a/src/general_vacation/views.py +++ b/src/general_vacation/views.py @@ -47,7 +47,13 @@ class DailyRoundUpAPIView(APIView): def get(self, request): user = DictEmployee.objects.using('user_directory').filter(deleted=0).values('login', 'department', 'familyname', 'name', 'parentname') re = roundExcel(user) - file_path = re.excround() + if request.GET.get("excel") == 'round': + file_path = re.excround() + if request.GET.get("excel") == 'vacation': + + file_path = re.excelvacation() + + diff --git a/src/media/DailyRoundUp.xlsx b/src/media/DailyRoundUp.xlsx index 2b4a94c1fe9f3bcf2925f02ef47439be8a43c036..52116ebbfa9aa941c3e1c2e4d14c917f4c730548 100644 GIT binary patch delta 519 zcmX@)x8IK^z?+#xgn@y9gJDMNM4ol^Gg?c+ZJ9aLUjfBVGcqs;0_l|e-SD!8_*QYnV(d+mmwCihw z*jqMfygQ(zx!B{N%9%e&DdI~nc3-M*$rF>{y|K{MU9jTZ!(&2h(*JX2Om3A)-W_n* z;EA(oai%g~zJI^|=TDKZl{A-6G`*CukXh@MvvKT`^U3NDqXXm8>P0WCxy0g_-k)9O z8@Kvw+4lppHfgNx`MgG_Y>!Z>?yKM5Pkvo2`(JI#-pucB?R&xjM zQ>iM$cyjVIRV5H-7m&j>`MRn)kTXe5hVkZPSv47ugteNCm6`$rLwr$cPO-iohz#&% zWD;S3#aT(XdH3vnb-BG0<|yxfxTgujp6-vY%>Gcqs;0_l|e z7;V1FXwSx!m%CYvRTO3tiX98o0aVZ0X1WW;t-qy%F z`HHGK$gaPtGK_a7OR33#I2LL$vYHAE4Dm&&ImP;VATq$4kx7IB7R!?h)npijCikhy oft0TUa`sL>t)>aKY<8Pdi!?CSuQQ`NXwhV0bv3qkDj*jC0MzHx7XSbN diff --git a/src/r.txt b/src/r.txt index 95a5881c53b837464122ca6192048ca0e788679c..d56d294a0baa343bb8185369baa1f8543aa7dea4 100644 GIT binary patch delta 48 xcmca1+#s^y2a9qpLnT8oLm@*BLoyI&GNdx(F_bXa0-+Iu9vB;J{><`}1pqxx3;_TD delta 12 TcmZn=xgosa2g_y!)(0#AA~gi) From 8a25109c0f572b5ee1e7ce5ba2bbb2ae1ba7a823 Mon Sep 17 00:00:00 2001 From: iriska-gri <79623434+iriska-gri@users.noreply.github.com> Date: Mon, 20 Nov 2023 16:51:00 +0300 Subject: [PATCH 3/3] =?UTF-8?q?=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/front/src/components/load-round.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/front/src/components/load-round.vue b/src/front/src/components/load-round.vue index e90cee606..bf89529e0 100644 --- a/src/front/src/components/load-round.vue +++ b/src/front/src/components/load-round.vue @@ -79,10 +79,10 @@ - 3 - 4 - 5 - 6 + + + +