Skip to content

Commit

Permalink
Merge pull request #3116 from moodpulse/control_cert_employee
Browse files Browse the repository at this point in the history
Control cert employee
  • Loading branch information
mikhailprivalov authored Oct 10, 2023
2 parents cecf416 + 5ce50cb commit f83e941
Show file tree
Hide file tree
Showing 3 changed files with 114 additions and 50 deletions.
14 changes: 14 additions & 0 deletions api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1439,6 +1439,8 @@ def user_view(request):
"sendPassword": False,
"external_access": False,
"date_stop_external_access": None,
"date_extract_employee": None,
"date_stop_certificate": None,
"resource_schedule": resource_researches,
"notControlAnketa": False,
}
Expand Down Expand Up @@ -1491,6 +1493,8 @@ def user_view(request):
"sendPassword": False,
"external_access": doc.external_access,
"date_stop_external_access": doc.date_stop_external_access,
"date_stop_certificate": doc.date_stop_certificate,
"date_extract_employee": doc.date_extract_employee,
"resource_schedule": resource_researches,
"notControlAnketa": doc.not_control_anketa,
}
Expand Down Expand Up @@ -1526,8 +1530,16 @@ def user_save_view(request):
external_access = ud.get("external_access", False)
not_control_anketa = ud.get("notControlAnketa", False)
date_stop_external_access = ud.get("date_stop_external_access")

if date_stop_external_access == "":
date_stop_external_access = None
date_extract_employee = ud.get("date_extract_employee")
if date_extract_employee == "":
date_extract_employee = None
date_stop_certificate = ud.get("date_stop_certificate")
if date_stop_certificate == "":
date_stop_certificate = None

if position == -1:
position = None
if district == -1:
Expand Down Expand Up @@ -1628,6 +1640,8 @@ def user_save_view(request):
doc.external_access = external_access
doc.not_control_anketa = not_control_anketa
doc.date_stop_external_access = date_stop_external_access
doc.date_extract_employee = date_extract_employee
doc.date_stop_certificate = date_stop_certificate
if rmis_login:
doc.rmis_login = rmis_login
if rmis_password:
Expand Down
147 changes: 98 additions & 49 deletions l2-frontend/src/pages/Profiles.vue
Original file line number Diff line number Diff line change
Expand Up @@ -732,65 +732,109 @@
</div>
</div>
</div>
<div class="more-title">
Анализаторы:
<button
class="btn btn-blue-nb sidebar-btn"
style="font-size: 13px"
>
<i
v-if="setup_analyzer"
v-tippy="{ placement: 'bottom'}"
class="glyphicon glyphicon-circle-arrow-up"
title="Скрыть"
@click="change_setup_analyzer"
/>
<i
v-else
v-tippy="{ placement: 'bottom' }"
class="glyphicon glyphicon-circle-arrow-down"
title="Выбрать"
@click="change_setup_analyzer"
/>
</button>
</div>
<div
v-if="setup_analyzer"
class="input-group"
style="width: 100%"
class="row left-padding-10"
>
<span class="input-group-addon">Анализаторы</span>
<select
v-model="analyzers"
class="form-control"
multiple
style="height: 136px"
>
<option
v-for="l in analyzers_list"
:key="l.pk"
:value="l.pk"
<div class="more-title">
Анализаторы:
<button
class="btn btn-blue-nb sidebar-btn"
style="font-size: 13px"
>
{{ l.label }}
</option>
</select>
<i
v-if="setup_analyzer"
v-tippy="{ placement: 'bottom'}"
class="glyphicon glyphicon-circle-arrow-up"
title="Скрыть"
@click="change_setup_analyzer"
/>
<i
v-else
v-tippy="{ placement: 'bottom' }"
class="glyphicon glyphicon-circle-arrow-down"
title="Выбрать"
@click="change_setup_analyzer"
/>
</button>
</div>
</div>
<div
class="col-xs-6 left-padding"
class="row left-padding-10"
>
<div
v-if="setup_analyzer"
class="input-group"
style="width: 100%"
>
<span class="input-group-addon">Кабинеты</span>
<Treeselect
v-model="user.rooms"
class="treeselect-nbr treeselect-wide treeselect-34px"
:multiple="true"
:options="user.rooms_list"
:flatten-search-results="true"
placeholder="Кабинеты не указаны"
/>
<span class="input-group-addon">Анализаторы</span>
<select
v-model="analyzers"
class="form-control"
multiple
style="height: 136px"
>
<option
v-for="l in analyzers_list"
:key="l.pk"
:value="l.pk"
>
{{ l.label }}
</option>
</select>
</div>
</div>
<div
class="row left-padding-10"
>
<div
class="col-xs-6 left-padding"
>
<div
class="input-group"
style="width: 100%"
>
<span class="input-group-addon">Кабинеты</span>
<Treeselect
v-model="user.rooms"
class="treeselect-nbr treeselect-wide treeselect-34px"
:multiple="true"
:options="user.rooms_list"
:flatten-search-results="true"
placeholder="Кабинеты не указаны"
/>
</div>
</div>
</div>
<div class="row left-padding-10">
<div
class="col-xs-4 left-padding right-padding"
>
<div
class="input-group"
style="width: 100%"
>
<span class="input-group-addon">Дата выписки из кадров</span>
<input
v-model="user.date_extract_employee"
class="form-control"
type="date"
>
</div>
</div>
<div
class="col-xs-4 left-padding right-padding"
>
<div
class="input-group"
style="width: 100%"
>
<span class="input-group-addon">Срок сертификата</span>
<input
v-model="user.date_stop_certificate"
class="form-control"
type="date"
>
</div>
</div>
</div>
</div>
Expand Down Expand Up @@ -925,6 +969,8 @@ export default {
date_stop_external_access: '',
resource_schedule: [],
notControlAnketa: false,
date_extract_employee: '',
date_stop_certificate: '',
},
selected_hospital: -1,
open_pk: -2,
Expand Down Expand Up @@ -1442,4 +1488,7 @@ li.selected {
.right-padding {
padding-right: 0
}
.left-padding-10 {
padding-left: 10px
}
</style>
3 changes: 2 additions & 1 deletion users/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,9 @@ class DoctorProfile(models.Model):
max_age_patient_registration = models.SmallIntegerField(help_text='Ограничения возраста записи указать в месяцах', default=-1)
available_quotas_time = models.TextField(default='', blank=True, help_text='Доступная запись для подразделений по времени {"id-подразделения": "10:00-15:00"}')
is_system_user = models.BooleanField(default=False, blank=True)

room_access = models.ManyToManyField('podrazdeleniya.Room', blank=True, help_text='Доступ к кабинетам')
date_extract_employee = models.DateField(help_text='Дата выписки запрошена', db_index=True, default=None, blank=True, null=True)
date_stop_certificate = models.DateField(help_text='Дата окончания сертификата', db_index=True, default=None, blank=True, null=True)

@staticmethod
def get_system_profile():
Expand Down

0 comments on commit f83e941

Please sign in to comment.