Merge branch '22_about_inspection' into 38_calendar_back

This commit is contained in:
iriska-gri committed 2024-05-16 09:52:25 +03:00
commit 57af6db9b7
12 files changed
+170 -53

No files matched your search

+23 -1
View File
@@ -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)
+22 -7
View File
@@ -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
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
+25
View File
@@ -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"]
+3
View File
@@ -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'),
]
+8 -2
View File
@@ -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)
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)
+1
View File
@@ -25,3 +25,4 @@ class getuserAPIView(APIView):
return Response(CardUserSerializer(queryset).data)
+9
View File
@@ -0,0 +1,9 @@
class Settings():
def __init__(self) -> None:
self.secret_key=''
self.redis_hosts = []
self.db = {
}
pass
+18 -1
View File
@@ -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 )
+5 -1
View File
@@ -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='╥рсхы№э√щ эюьхЁ')
+2 -2
View File
@@ -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",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "front",
"version": "0.0.61",
"version": "0.0.63",
"scripts": {
"dev": "vite",
"build": "vite build",
@@ -2,12 +2,16 @@
<v-row class="ma-1">
<v-col lg="6" class="d-flex justify-center align-start">
<v-card :elevation="5">
<div style="width:915px;height:823px; ">
<div style="width:915px;height:832px; ">
<l-map :zoom="13" :min-zoom="13" :center="markers[0].coordinate">
<l-tile-layer :url="`${baseURL}media/Tiles/{z}/{x}/{y}.png`" />
<l-marker v-for="marker in markers" :key="marker" :lat-lng="marker.coordinate"
:icon="icon(marker.icon)">
<l-tooltip>{{ marker.tooltip }}</l-tooltip>
<l-tooltip>
<p>{{ marker.tooltip }}</p>
<p style="max-width: 20%; min-width: 20%; word-wrap: break-word;">{{ marker.tooltip_bus }}
</p>
</l-tooltip>
</l-marker>
</l-map>
@@ -18,28 +22,37 @@
<v-col lg="6" class="d-flex flex-column gap">
<v-card :elevation="5">
<v-card-title class="d-flex justify-center bg-teal-lighten-5 text-teal-darken-4">
Адрес
<v-row>
<v-col lg="5" class="d-flex justify-center">Адрес</v-col>
<v-col lg="6" class="d-flex justify-center">Время работы</v-col>
</v-row>
</v-card-title>
<v-card-text class="text-subtitle-1 d-flex justify-center align-end">
{{ address.building }}
</v-card-text>
<v-card-text class="text-subtitle-1 d-flex justify-center align-center">
{{ address.phone }}
</v-card-text>
<v-card-title class=" d-flex justify-center">
Время работы
</v-card-title>
<v-list>
<v-list-item v-for="work_time in work_times">
<v-row class="d-flex justify-center">
<v-col lg="4">{{ work_time.day }}</v-col>
<v-col lg="3">{{ work_time.time }}</v-col>
</v-row>
</v-list-item>
</v-list>
<v-row class="d-flex justify-center align-center">
<v-col lg="4">
<v-card-text class="text-subtitle-1">
{{ address.building }}
</v-card-text>
<v-card-text class="text-subtitle-1">
{{ address.phone }}
</v-card-text>
</v-col>
<v-col lg="7">
<v-list>
<v-list-item v-for="work_time in work_times">
<v-row>
<v-col lg="6" class="text-subtitle-1 d-flex justify-center align-center">{{
work_time.day
}}</v-col>
<v-col lg="6" class="text-subtitle-1 d-flex justify-center align-center">{{
work_time.time
}}</v-col>
</v-row>
</v-list-item>
</v-list>
</v-col>
</v-row>
</v-card>
<v-card :elevation="5">
<v-card-title class="text-h6 d-flex justify-center bg-teal-lighten-5 text-teal-darken-4">
@@ -47,7 +60,7 @@
</v-card-title>
<v-card-text class="text-subtitle-1">
<v-list>
<v-list-item v-for="address_path in address_pathes" class="pa-6">
<v-list-item v-for="address_path in address_pathes" class="pa-7">
<strong>{{ address_path.title_path }}</strong>{{ address_path.path }}
</v-list-item>
</v-list>
@@ -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 минут) до территории Налоговго городка" },
],