diff --git a/src/back/about_inspection/admin.py b/src/back/about_inspection/admin.py index 3686415fb..58138474c 100644 --- a/src/back/about_inspection/admin.py +++ b/src/back/about_inspection/admin.py @@ -1,7 +1,29 @@ from django.contrib import admin from .models import * +from userauth.models import DictDepartment +from django.db.models import Q +class InspectionDirectionsAdmin(admin.ModelAdmin): + list_display=('direction_title',) + fields=('direction_title','icon_name',) + def get_form(self, request, obj=None, **kwargs): + form = super().get_form(request, obj, **kwargs) + print("form.base_fields") + form.base_fields['direction_title'].label += " инспекции" + return form + def get_queryset(self, request): + qs = super().get_queryset(request) + qs = qs.filter(department__isnull=True) + return qs +class VacanciesAdmin(admin.ModelAdmin): + def get_form(self, request, obj=None, **kwargs): + form = super().get_form(request, obj, **kwargs) + form.base_fields['department'].queryset = DictDepartment.objects.filter(~Q(name="Все сотрудники"),deleted=0) + return form + +admin.site.register(Vacancies,VacanciesAdmin) admin.site.register(StateSize) admin.site.register(FactSize) -admin.site.register(InspectionDirections) +admin.site.register(InspectionDirections, InspectionDirectionsAdmin) + diff --git a/src/back/about_inspection/models.py b/src/back/about_inspection/models.py index a677f0880..0da8e5cf9 100644 --- a/src/back/about_inspection/models.py +++ b/src/back/about_inspection/models.py @@ -1,6 +1,6 @@ from django.db import models - - +from userauth.models import DictDepartment +from ckeditor_uploader.fields import RichTextUploadingField # Модель Штатная численность class StateSize(models.Model): @@ -24,10 +24,25 @@ class FactSize(models.Model): # Модель Направление деятельности инспекции class InspectionDirections(models.Model): - direction_title = models.CharField(max_length=255, verbose_name="Направление деятельности инспекции") - icon_name = models.CharField(max_length=100, verbose_name="Название иконки", default="none" ,blank=True) + direction_title = models.CharField(max_length=255, verbose_name="Направление деятельности") + icon_name = models.CharField(max_length=100, verbose_name="Название иконки", default="mdi-sign-direction" ,blank=True) + department = models.ForeignKey (DictDepartment,on_delete=models.PROTECT, null=True, blank=True, verbose_name='Отдел', related_name='department_directions') + class Meta: - verbose_name = "Направление деятельности инспекции" - verbose_name_plural = "Направление деятельности инспекции" + verbose_name = "Направление деятельности " + verbose_name_plural = "Направления деятельности" def __str__(self): - return self.direction_title \ No newline at end of file + return self.direction_title + +class Vacancies(models.Model): + name=models.TextField(verbose_name="Наименование") + department = models.ForeignKey (DictDepartment,on_delete=models.PROTECT, null=True, blank=True, verbose_name='Отдел') + functional = RichTextUploadingField(null=True, blank= True, verbose_name='Функционал и должностные обязанности') + requirements = RichTextUploadingField(null=True, blank= True, verbose_name='Базовые требования к соискателю') + published = models.BooleanField(default = False, verbose_name="Опубликована") + + class Meta: + verbose_name = "Вакансия " + verbose_name_plural = "Вакансии" + def __str__(self): + return self.name \ No newline at end of file diff --git a/src/back/about_inspection/serializers.py b/src/back/about_inspection/serializers.py index 2db52410a..368d12ee1 100644 --- a/src/back/about_inspection/serializers.py +++ b/src/back/about_inspection/serializers.py @@ -53,3 +53,28 @@ class DepsSerializer(serializers.ModelSerializer): def get_chief_deps(self, obj): return InfoUserCardSerializer(obj.id_chief).data + +class DepartmentDirectionsSerializer(serializers.ModelSerializer): + class Meta: + model = InspectionDirections + fields = ["id","direction_title"] + ordering = ['direction_title'] + + + + +class DepartmentSerializerVac(serializers.ModelSerializer): + department_directions= DepartmentDirectionsSerializer(many=True, read_only=True) + class Meta: + model = DictDepartment + fields = ['id','name','department_directions'] + + + +class VacanciesSerializer(serializers.ModelSerializer): + department = DepartmentSerializerVac(read_only=True) + class Meta: + model = Vacancies + + fields = ["id", "department", "name","functional","requirements"] + \ No newline at end of file diff --git a/src/back/about_inspection/urls.py b/src/back/about_inspection/urls.py index f7faa91ea..d2819fb52 100644 --- a/src/back/about_inspection/urls.py +++ b/src/back/about_inspection/urls.py @@ -8,4 +8,7 @@ urlpatterns = [ path('getstatesize/', GetStateSize.as_view(), name='getstatesize'), path('getinspectiondirections/', GetInspectionDirections.as_view(), name='getinspectiondirections'), path('getstructure/', GetStructure.as_view(), name='getstructure'), + path('getvacancy/', GetVacancies.as_view(), name='getvacancy'), + + ] \ No newline at end of file diff --git a/src/back/about_inspection/views.py b/src/back/about_inspection/views.py index a097f6d69..35e76cfc5 100644 --- a/src/back/about_inspection/views.py +++ b/src/back/about_inspection/views.py @@ -20,7 +20,7 @@ class GetFactSize(ListAPIView): class GetInspectionDirections(ListAPIView): - queryset = InspectionDirections.objects.all() + queryset = InspectionDirections.objects.filter(department__isnull=True) serializer_class = InspectionDirectionsSerializer # отключает вывод информации о пагинации(count,previous,next, results) paginator = None @@ -28,4 +28,10 @@ class GetInspectionDirections(ListAPIView): class GetStructure(ListAPIView): def get(self, request): queryset = DictEmployee.objects.filter(id_dict_position__order_position__lte = 2, deleted=0).order_by('id_dict_position__order_position','familyname') - return Response(StructureSerializer(queryset, many=True).data) \ No newline at end of file + return Response(StructureSerializer(queryset, many=True).data) + + +class GetVacancies(ListAPIView): + def get(self, request): + queryset = Vacancies.objects.filter(published=True).order_by('department__order_department') + return Response(VacanciesSerializer(queryset, many=True).data) \ No newline at end of file diff --git a/src/back/accounts/views.py b/src/back/accounts/views.py index aa8f8fa5c..123f3cb5e 100644 --- a/src/back/accounts/views.py +++ b/src/back/accounts/views.py @@ -25,3 +25,4 @@ class getuserAPIView(APIView): return Response(CardUserSerializer(queryset).data) + diff --git a/src/back/portal/ds_FISH.py b/src/back/portal/ds_FISH.py new file mode 100644 index 000000000..1f2f824e8 --- /dev/null +++ b/src/back/portal/ds_FISH.py @@ -0,0 +1,9 @@ +class Settings(): + def __init__(self) -> None: + self.secret_key='' + self.redis_hosts = [] + self.db = { + + } + + pass diff --git a/src/back/userauth/admin.py b/src/back/userauth/admin.py index b46f26738..d2e6a32eb 100644 --- a/src/back/userauth/admin.py +++ b/src/back/userauth/admin.py @@ -1,6 +1,7 @@ from django.contrib import admin from .models import * from django.db.models import Q +from about_inspection.models import InspectionDirections # Register your models here. class DictEmployeeAdmin(admin.ModelAdmin): # A handy constant for the name of the alternate database. @@ -9,9 +10,25 @@ class DictEmployeeAdmin(admin.ModelAdmin): search_fields = ('login', 'fio',) list_editable=('birthdate',) +class DepartmentDirections(admin.TabularInline): + model =InspectionDirections + fields = ( 'direction_title',) + verbose_name="Направление деятельности отдела" + verbose_name_plural= "Направления деятельности отдела" + can_delete = True + # show_change_link = False + extra = 0 + -# class DictEmployeeAdmin(admin.ModelAdmin): +class DictDepartmentAdmin(admin.ModelAdmin): + readonly_fields=( 'name', 'name_from_ad') + inlines = [DepartmentDirections] + def get_queryset(self, request): + qs = super().get_queryset(request) + qs = qs.filter(deleted=0) + return qs admin.site.register(DictEmployee,DictEmployeeAdmin) +admin.site.register(DictDepartment, DictDepartmentAdmin ) \ No newline at end of file diff --git a/src/back/userauth/models.py b/src/back/userauth/models.py index 46bc6f9eb..11d4c58ce 100644 --- a/src/back/userauth/models.py +++ b/src/back/userauth/models.py @@ -109,6 +109,7 @@ class DictCompetencesType(models.Model): class DictDepartment(models.Model): + id = models.PositiveIntegerField(primary_key=True, db_comment='╥рсхы№э√щ эюьхЁ') id_curator = models.ForeignKey('DictEmployee', models.DO_NOTHING, db_column='id_curator', blank=True, null=True, db_comment='╚─ ъєЁрЄюЁр юЄфхыр', related_name='deps_curator') id_chief = models.ForeignKey('DictEmployee', models.DO_NOTHING, db_column='id_chief', related_name='dictdepartment_id_chief_set', blank=True, null=True, db_comment='╚─ эрўры№эшър юЄфхыр') name = models.CharField(max_length=500, db_comment='═рчтрэшх юЄфхыр') @@ -119,10 +120,13 @@ class DictDepartment(models.Model): order_department = models.IntegerField() class Meta: + verbose_name = "Отдел" + verbose_name_plural = "Отделы" managed = False db_table = 'dict_department' db_table_comment = '╤яЁртюўэшъ юЄфхыют' - + def __str__(self): + return str(self.name) class DictEmployee(models.Model): id = models.PositiveIntegerField(primary_key=True, db_comment='╥рсхы№э√щ эюьхЁ') diff --git a/src/front/package-lock.json b/src/front/package-lock.json index 20d8a784d..8082549c2 100644 --- a/src/front/package-lock.json +++ b/src/front/package-lock.json @@ -1,12 +1,12 @@ { "name": "front", - "version": "0.0.61", + "version": "0.0.63", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "front", - "version": "0.0.61", + "version": "0.0.63", "dependencies": { "-": "^0.0.1", "@ckeditor/ckeditor5-build-classic": "^41.3.1", diff --git a/src/front/package.json b/src/front/package.json index abc6aa9d1..6d34d02c5 100644 --- a/src/front/package.json +++ b/src/front/package.json @@ -1,6 +1,6 @@ { "name": "front", - "version": "0.0.61", + "version": "0.0.63", "scripts": { "dev": "vite", "build": "vite build", diff --git a/src/front/src/components/about_inspection/contacts/ContactInfo.vue b/src/front/src/components/about_inspection/contacts/ContactInfo.vue index 96f1da2c6..3aa587f89 100644 --- a/src/front/src/components/about_inspection/contacts/ContactInfo.vue +++ b/src/front/src/components/about_inspection/contacts/ContactInfo.vue @@ -2,12 +2,16 @@ -
+
- {{ marker.tooltip }} + +

{{ marker.tooltip }}

+

{{ marker.tooltip_bus }} +

+
@@ -18,28 +22,37 @@ + - Адрес + + Адрес + Время работы + - - {{ address.building }} - - - {{ address.phone }} - - - Время работы - - - - - - {{ work_time.day }} - {{ work_time.time }} - - - - + + + + {{ address.building }} + + + {{ address.phone }} + + + + + + + {{ + work_time.day + }} + {{ + work_time.time + }} + + + + + @@ -47,7 +60,7 @@ - + {{ address_path.title_path }}{{ address_path.path }} @@ -97,23 +110,24 @@ export default { }, icon_bus: { iconUrl: pathbuild(`bus`), - iconSize: [25, 25], - iconAnchor: [10, 10] + iconSize: [18, 18], + iconAnchor: [1, 1] } } const markers = ref([ - { coordinate: [55.83451, 37.40848], icon: icons.icon_cod, tooltip: "МИ ФНС России по ЦОД №2" }, - { coordinate: [55.83309, 37.39933], icon: icons.icon_mcd, tooltip: "МЦД D2 пл.\"Трикотажная\"" }, - { coordinate: [55.82741, 37.43715], icon: icons.icon_metro, tooltip: "ст.метро \"Тушинская\"" }, - { coordinate: [55.82705, 37.4411], icon: icons.icon_mcd, tooltip: "МЦД D2 пл. \"Тушинская\"" }, - { coordinate: [55.8496, 37.43925], icon: icons.icon_metro, tooltip: "ст.метро \"Сходненская\"" }, - { coordinate: [55.83478, 37.41034], icon: icons.icon_bus, tooltip: "остановка \"Налоговый городок\"" }, - { coordinate: [55.83319, 37.40128], icon: icons.icon_bus, tooltip: "остановка автобуса №368" }, - { coordinate: [55.82524, 37.43575], icon: icons.icon_bus, tooltip: "остановки автобусов: № 400, № 741, 741к, 856, 436, 575" }, - { coordinate: [55.8501, 37.43905], icon: icons.icon_bus, tooltip: "остановка автобуса №368" }, - { coordinate: [55.83132, 37.40340], icon: icons.icon_bus, tooltip: "остановка \"МЦД Трикотажная\"" }, + { coordinate: [55.83451, 37.40848], icon: icons.icon_cod, tooltip: "МИ ФНС России по ЦОД №2", tooltip_bus: "" }, + { coordinate: [55.83309, 37.39933], icon: icons.icon_mcd, tooltip: "МЦД D2: пл.\"Трикотажная\"", tooltip_bus: "" }, + { coordinate: [55.82741, 37.43715], icon: icons.icon_metro, tooltip: "Ст.метро: \"Тушинская\"", tooltip_bus: "" }, + { coordinate: [55.82705, 37.4411], icon: icons.icon_mcd, tooltip: "МЦД D2: пл. \"Тушинская\"", tooltip_bus: "" }, + { coordinate: [55.8496, 37.43925], icon: icons.icon_metro, tooltip: "Ст.метро: \"Сходненская\"", tooltip_bus: "" }, + { coordinate: [55.835274, 37.411052], icon: icons.icon_bus, tooltip: "Остановка: \"Налоговый городок\"", tooltip_bus: "Автобусы:№368, №с377" }, + { coordinate: [55.833193, 37.400858], icon: icons.icon_bus, tooltip: "Остановка:\"МЦД Трикотажная\"", tooltip_bus: "Автобусы: №26, №368, №с377, №с396" }, + { coordinate: [55.82524, 37.43575], icon: icons.icon_bus, tooltip: "Остановка: \"метро Тушинская\", выход:5 ", tooltip_bus: "Автобусы: №400, №741, №741к, №856, №436, №575" }, + { coordinate: [55.8501, 37.43905], icon: icons.icon_bus, tooltip: "Остановка: \"метро Сходненская\", выход:9", tooltip_bus: "Автобус: №368" }, + { coordinate: [55.83607, 37.40569], icon: icons.icon_bus, tooltip: "Остановка \"Храм Сергия Радонежского\"", tooltip_bus: "Автобусы: №88, №488, №с377, №с396" }, + { coordinate: [55.83132, 37.40340], icon: icons.icon_bus, tooltip: "Остановка \"МЦД Трикотажная\"", tooltip_bus: "Автобусы: №2, №210, №400Т, №741, №741к, №856, №436, №575" }, ]) @@ -128,10 +142,11 @@ export default { "phone": "Телефон: 8(495) 198-53-12" }, address_pathes: [ - { "title_path": "От станции МЦД «Трикотажная»,", "path": " далее на автобусе 368, до остановки \"Налоговый городок\" или пешком (10 минут) до территории Налоговго городка" }, - { "title_path": "От станции метро «Сходненская»,", "path": " 1-й вагон из центра, далее на автобусе № 368" }, + { "title_path": "От станции МЦД «Трикотажная»,", "path": "на автобусе 368, до остановки \"Налоговый городок\" или пешком (10 минут) до территории Налоговго городка" }, + { "title_path": "От станции метро «Сходненская», выход:9,", "path": " 1-й вагон из центра, далее на автобусе № 368" }, { "title_path": "От станции МЦД «Тушинская»,", "path": " проехать одну остановку до станции МЦД «Трикотажная» и далее на автобусе 368 до остановки «Налоговый городок» или пешком(10 минут) до территории Налогового городка" }, - { "title_path": "От станции метро «Тушинская»,", "path": " последний вагон из центра, автобусы № 400, № 741, 741к, 856, 436, 575 до остановки «пл. Трикотажная» или от станции МЦД «Тушинская» проехать одну остановку до станции МЦД «Трикотажная» и далее на автобусе 368 до остановки «Налоговый городок» или пешком(10 минут) до территории Налогового городка" }, + { "title_path": "От станции метро «Тушинская», выход:5,", "path": " последний вагон из центра, автобусы №2, №210, №400Т, №741, №741к, №856, №436, №575 до остановки «пл. Трикотажная» или от станции МЦД «Тушинская» проехать одну остановку до станции МЦД «Трикотажная» и далее на автобусе 368 до остановки «Налоговый городок» или пешком(10 минут) до территории Налогового городка" }, + { "title_path": "От остановки автобуса «Храм Сергия Радонежского»", "path": " и далее пешком (10 минут) до территории Налоговго городка" }, ],