feat: обоснования неприменимости показателей 8-14 для здравоохранения
- criteria_justifications.json: добавлены показатели 8 (ущерб субъекту КИИ), 9 (ущерб бюджету), 10-10.5 (банковские), 11 (экология), 12 (пункт управления), 13 (гособоронзаказ), 14 (оборона/правопорядок) — дословно из примера заказчика - ui.py: _just_text — поиск обоснования по группе показателя (2а→2, 3б→3, 10.6→10, 13а→13), покрыты все 30 показателей ПП 127
This commit is contained in:
+23
-11
@@ -1858,6 +1858,16 @@ class DokoGenApp:
|
||||
_sphere_just = self.is_sphere_combo.get() if hasattr(self, 'is_sphere_combo') else ''
|
||||
_just = justifications.get(_sphere_just, {}) if _sphere_just else {}
|
||||
|
||||
def _just_text(num):
|
||||
"""Обоснование для показателя: точный ключ, иначе группа по первым цифрам
|
||||
(2а→2, 3б→3, 10.6→10, 13а→13)."""
|
||||
if num in _just:
|
||||
return _just[num]
|
||||
m = _re.match(r'(\d+)', num)
|
||||
if m and m.group(1) in _just:
|
||||
return _just[m.group(1)]
|
||||
return None
|
||||
|
||||
dialog = tk.Toplevel(self.root)
|
||||
dialog.title("Показатели критериев значимости (ПП РФ № 127)")
|
||||
dialog.geometry("980x700")
|
||||
@@ -1924,16 +1934,17 @@ class DokoGenApp:
|
||||
|
||||
def _on_pick(_e, _num=num, _var=var, _name=name):
|
||||
# При выборе «не применим» — автоподстановка обоснования из словаря сферы
|
||||
if _var.get().strip() == 'не применим' and _num in _just:
|
||||
txt = _just[_num]
|
||||
if _var.get().strip() == 'не применим':
|
||||
txt = _just_text(_num)
|
||||
prefix = f"Показатель {_num}. {_name} — не применим."
|
||||
full = prefix + " " + txt
|
||||
cur = justify_txt.get('1.0', 'end-1c').strip()
|
||||
if prefix not in cur:
|
||||
if cur:
|
||||
justify_txt.insert('end', '\n' + full)
|
||||
else:
|
||||
justify_txt.insert('1.0', full)
|
||||
if txt:
|
||||
full = prefix + " " + txt
|
||||
cur = justify_txt.get('1.0', 'end-1c').strip()
|
||||
if prefix not in cur:
|
||||
if cur:
|
||||
justify_txt.insert('end', '\n' + full)
|
||||
else:
|
||||
justify_txt.insert('1.0', full)
|
||||
combo.bind('<<ComboboxSelected>>', _on_pick)
|
||||
|
||||
if not applicable_here:
|
||||
@@ -2036,8 +2047,9 @@ class DokoGenApp:
|
||||
)
|
||||
for num, name, _, _ in not_applicable:
|
||||
base = f"Показатель {num}. {name} — не применим"
|
||||
if num in _just:
|
||||
auto_parts.append(base + ": " + _just[num])
|
||||
jtxt = _just_text(num)
|
||||
if jtxt:
|
||||
auto_parts.append(base + ": " + jtxt)
|
||||
else:
|
||||
auto_parts.append(base + ".")
|
||||
if not_applicable and not chosen:
|
||||
|
||||
Reference in New Issue
Block a user