Skip to content

Commit

Permalink
Merge branch 'develop' into create-pull-request/patch
Browse files Browse the repository at this point in the history
  • Loading branch information
urchinpro authored Feb 21, 2024
2 parents f7fee0b + ab7b12d commit d7d86f2
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 6 deletions.
6 changes: 4 additions & 2 deletions api/directions/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -4089,8 +4089,10 @@ def eds_to_sign(request):
elif mode == 'my':
d_qs = d_qs.filter(directiondocument__documentsign__sign_type='Врач', directiondocument__is_archive=False)
else:
# TODO: тут нужен фильтр, что получены все необходимые подписи, кроме Медицинская организация, если mode == 'mo'
# TODO: тут нужен фильтр, что не получена подпись Врач, если mode == 'my'
if mode == 'mo':
d_qs = d_qs.filter(directiondocument__documentsign__sign_type='Врач', directiondocument__is_archive=False)
elif mode == 'my':
d_qs = d_qs.exclude(directiondocument__documentsign__sign_type='Врач')
d_qs = d_qs.filter(eds_total_signed=False)

d: Napravleniya
Expand Down
1 change: 1 addition & 0 deletions api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,7 @@ def fill_user_data():
)

ret["fio"] = doctorprofile.get_full_fio()
ret["snils"] = doctorprofile.snils
ret["shortFio"] = doctorprofile.get_fio(with_space=False)
ret["hasTOTP"] = doctorprofile.totp_secret is not None
ret["email"] = doctorprofile.email or ""
Expand Down
24 changes: 20 additions & 4 deletions l2-frontend/src/pages/EDS.vue
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ import usersPoint from '@/api/user-point';
import RadioFieldById from '@/fields/RadioFieldById.vue';
import DateFieldNav2 from '@/fields/DateFieldNav2.vue';
import EDSDirection from '@/ui-cards/EDSDirection.vue';
import { convertSubjectNameToTitle, subjectNameHasOGRN } from '@/utils';
import { convertSubjectNameToCertObject, convertSubjectNameToTitle, subjectNameHasOGRN } from '@/utils';
const MODES = [
{ id: 'mo', label: 'Подписи медицинской организации' },
Expand Down Expand Up @@ -525,6 +525,10 @@ export default class EDS extends Vue {
return !subjectNameHasOGRN(null, cert.subjectName);
}
get snilsUser() {
return (this.$store.getters.user_data.snils);
}
get accessToMO() {
return (this.$store.getters.user_data.groups || []).includes('ЭЦП Медицинской организации');
}
Expand Down Expand Up @@ -573,15 +577,28 @@ export default class EDS extends Vue {
}
get certificatesDisplay() {
return this.certificates.map(c => ({
const filteredCertificates = this.certificates.filter((cert) => {
const certObj = convertSubjectNameToCertObject(cert.subjectName);
const snilsCert = certObj['СНИЛС'] || certObj.SNILS;
if (this.filters.mode === 'my') {
return snilsCert === this.snilsUser;
}
return !!(certObj.ORGN || certObj['ОГРН']);
});
if (filteredCertificates.length === 0) {
this.selectedCertificate = null;
} else {
this.selectedCertificate = filteredCertificates[0]?.thumbprint;
}
return filteredCertificates.map(c => ({
thumbprint: c.thumbprint,
name: convertSubjectNameToTitle(null, c.subjectName),
}));
}
get deps() {
return [
...this.users.map(d => ({ id: Number(d.id.split('-')[1]) || -1, label: d.label })),
...this.users.map(d => ({ id: d.id, label: d.label })),
{ id: -1, label: 'Все отделения' },
];
}
Expand Down Expand Up @@ -632,7 +649,6 @@ export default class EDS extends Vue {
if (this.certificates.length > 0) {
// eslint-disable-next-line no-console
console.log('getCertificates', true, this.certificates);
this.selectedCertificate = this.certificates[0]?.thumbprint;
} else {
// eslint-disable-next-line no-console
console.log('getCertificates', false);
Expand Down

0 comments on commit d7d86f2

Please sign in to comment.