diff --git a/src/back/about_inspection/views.py b/src/back/about_inspection/views.py index 05448ecfa..809becad2 100644 --- a/src/back/about_inspection/views.py +++ b/src/back/about_inspection/views.py @@ -50,11 +50,11 @@ class GetVacancies(ListAPIView): class PostResponseVacancies(ListAPIView): def post(self, request): - print('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!') + a = ResponseVacancy.objects.create(**json.loads(request.data['data']), file = request.data['file'] if 'file' in request.data else None) - - data = {'sendto':[a.vacancy.department.id_chief.lotus], 'subject': f'Отклик на вакансию {a.vacancy.name} от {a.fio}', 'body_text':f'Почта:{a.email} ----- Телефон: {a.tel} ---- Сопроводительное письмо: {a.text}'} - + okib = DictDepartment.objects.get(id=22) + data = {'sendto':[a.vacancy.department.id_chief.lotus, okib.id_chief.lotus], 'subject': f'Отклик на вакансию {a.vacancy.name} от {a.fio}', 'body_text':f'Почта:{a.email} ----- Телефон: {a.tel} ---- Сопроводительное письмо: {a.text}'} + try: requests.post('http://10.252.44.13:8005/', data = data, files = [request.data['file']] if 'file' in request.data else [], timeout=2) except Exception as e: diff --git a/src/back/accounts/backends.py b/src/back/accounts/backends.py index a62039af5..f26bf4129 100644 --- a/src/back/accounts/backends.py +++ b/src/back/accounts/backends.py @@ -30,6 +30,7 @@ class MyTokenObtainPairSerializer(TokenObtainPairSerializer): token['user']=model_to_dict(user.userinfo) token['user']['is_active']=user.is_active token['user']['is_staff']=user.is_staff + token['user']['is_superuser']=user.is_superuser # !ТУТ СДЕЛАТь ФОТО НАВЕРНОЕ # token['user']['last_login']= user.last_login # print(token) diff --git a/src/back/accounts/views.py b/src/back/accounts/views.py index 123f3cb5e..b3a72df86 100644 --- a/src/back/accounts/views.py +++ b/src/back/accounts/views.py @@ -17,12 +17,17 @@ class getuserAPIView(APIView): Параметр: userlogin Пример: GET /api/accounts/getuser/?userlogin=9966-00-107 Результат: Выдает все данные о пользователе + Если дать дополнительный параметр fullinfo = True, то будет выдаваться информация с комиссиями и ответсвенностью """ - + resp = None + fullinfo = request.query_params.get('fullinfo') queryset = DictEmployee.objects.get(login=request.query_params.get('userlogin')) + if(fullinfo is None or fullinfo == False ): + resp = InfoUserCardSerializer(queryset).data - - - return Response(CardUserSerializer(queryset).data) + else: + resp = CardUserSerializer(queryset).data + + return Response(resp) diff --git a/src/back/calendar_of_events/admin.py b/src/back/calendar_of_events/admin.py index 5c226230e..eb11e6d3d 100644 --- a/src/back/calendar_of_events/admin.py +++ b/src/back/calendar_of_events/admin.py @@ -1,5 +1,9 @@ from django.contrib import admin -from django.utils.safestring import mark_safe from .models import * # Register your models here. + +class ExclusionDatesAdmin(admin.ModelAdmin): + list_display=('exclusiondate',) + +admin.site.register(ExclusionDates, ExclusionDatesAdmin) diff --git a/src/back/calendar_of_events/models.py b/src/back/calendar_of_events/models.py index ea78acf4a..9a963246e 100644 --- a/src/back/calendar_of_events/models.py +++ b/src/back/calendar_of_events/models.py @@ -2,7 +2,7 @@ from django.db import models from accounts.models import * # Create your models here. from django.conf import settings -from enum import Enum +# from enum import Enum from ckeditor_uploader.fields import RichTextUploadingField class CalendarEventsName(models.Model): @@ -10,18 +10,18 @@ class CalendarEventsName(models.Model): name=models.CharField(max_length=300, verbose_name='Название Календаря') author = models.ForeignKey(settings.AUTH_USER_MODEL, editable=False, on_delete=models.PROTECT, verbose_name='Автор Календаря') -class EnumChoice(Enum): - @classmethod - def get_choices(cls): - return [(enum_.name, enum_.value) for enum_ in cls] +# class EnumChoice(Enum): +# @classmethod +# def get_choices(cls): +# return [(enum_.name, enum_.value) for enum_ in cls] -class FrequencyEvents(EnumChoice): - default = "Без периода" - daily = "Ежедневно" - weekly = "Еженедельно" - monthly = "Ежемесячно" - annually = "Ежегодно" - twice_a_year = "Два раза в год" +# class FrequencyEvents(EnumChoice): +# default = "Без периода" +# daily = "Ежедневно" +# weekly = "Еженедельно" +# monthly = "Ежемесячно" +# annually = "Ежегодно" +# twice_a_year = "Два раза в год" class CalendarEvents(models.Model): """ Основные данные по событиям""" @@ -55,6 +55,7 @@ class ParticipantsEvent(models.Model): participant = models.ForeignKey(settings.AUTH_USER_MODEL, editable=False, on_delete=models.PROTECT, verbose_name='Участник события') event = models.ForeignKey(CalendarEvents, on_delete=models.PROTECT, related_name='get_calendar_events', verbose_name='Событие') +# <<<<<<< HEAD ################################################ # Модели(Таблицы) для хранения календаря @@ -92,3 +93,16 @@ class TableEventParticipant(models.Model): +# ======= +class ExclusionDates(models.Model): + """ Таблица, которая содержит даты-исключения. То есть, все праздничные дни, + которые не попадают на выходные и все будни, которые праздничные """ + exclusiondate = models.DateField(null=True, blank= True, verbose_name='Дата-исключение') + + class Meta: + verbose_name = "Дата-исключение" + verbose_name_plural = "Даты-исключение" + + def __str__(self): + return str(self.exclusiondate) +# >>>>>>> 96ceeb3252de4f48195eb5969f6b3d1d7affbe84 diff --git a/src/back/userauth/serializers.py b/src/back/userauth/serializers.py index 41fa35c5f..feefe662a 100644 --- a/src/back/userauth/serializers.py +++ b/src/back/userauth/serializers.py @@ -127,6 +127,7 @@ class CardUserSerializer(serializers.ModelSerializer): return Committee2Serializer(obj.user_committe2.all(), many=True).data + class InfoUserCardSerializer(serializers.ModelSerializer): """ Собирает необходимую информацию о пользователе, содержит необходимые поля для отрисовки карточки информации о пользователе при клике на фамилию diff --git a/src/front/src/components/UI/aboutportal/line-chart.vue b/src/front/src/components/UI/aboutportal/line-chart.vue index 9fe1dee5f..b1df1e3e6 100644 --- a/src/front/src/components/UI/aboutportal/line-chart.vue +++ b/src/front/src/components/UI/aboutportal/line-chart.vue @@ -63,7 +63,7 @@ export default { type: String, default: 'd' } - }, + }, setup(props, {emit}) { const filterStore = usePortalFilterStore() diff --git a/src/front/src/components/UI/fiousercard/infoUserCard.vue b/src/front/src/components/UI/fiousercard/infoUserCard.vue index c8024615a..fec82aaec 100644 --- a/src/front/src/components/UI/fiousercard/infoUserCard.vue +++ b/src/front/src/components/UI/fiousercard/infoUserCard.vue @@ -5,7 +5,7 @@ width="600" class="mx-auto" > - + Информация @@ -63,7 +63,7 @@ - + -
- - - +
+ + - {{author.fio}} + {{ author.fio }} - {{author.post}} + {{ author.post }} - - - - - {{splitname(author)}} - - - - + + + + {{ splitname(author) }} + + - - - - - +
- - \ No newline at end of file + diff --git a/src/front/src/components/about_inspection/general_information/GeneralInformation.vue b/src/front/src/components/about_inspection/general_information/GeneralInformation.vue index 08f82126b..f079f467b 100644 --- a/src/front/src/components/about_inspection/general_information/GeneralInformation.vue +++ b/src/front/src/components/about_inspection/general_information/GeneralInformation.vue @@ -44,7 +44,6 @@

Государственный советник Российской Федерации 2 класса -

diff --git a/src/front/src/components/about_inspection/structure/StructureInspection.vue b/src/front/src/components/about_inspection/structure/StructureInspection.vue index 708feb345..52b3a487b 100644 --- a/src/front/src/components/about_inspection/structure/StructureInspection.vue +++ b/src/front/src/components/about_inspection/structure/StructureInspection.vue @@ -13,7 +13,7 @@ - + - - - - - - - - - - {{ structure.post }} + + + + + + + + + {{ structure.post }} + + + - - - - - - - - {{ structure.fio }} - - - - - - - - - - - - - - - - - {{ boss.name }} + + + + - - - - - Перейти на страницу отдела - - + + {{ structure.fio }} - - - - - - - - + + + + + + - - - - - - - + + + + + + + + + + {{ boss.name }} + + + + + + Перейти на страницу отдела + + + + + + + + + + + + + + - - + diff --git a/src/front/src/components/calendar_of_events/load-ical1.vue b/src/front/src/components/calendar_of_events/load-ical1.vue index 1c1cf1655..1a02e9f73 100644 --- a/src/front/src/components/calendar_of_events/load-ical1.vue +++ b/src/front/src/components/calendar_of_events/load-ical1.vue @@ -1,7 +1,7 @@