244 lines
9.0 KiB
HTML
244 lines
9.0 KiB
HTML
{% load i18n %}
|
|
<!DOCTYPE html>
|
|
<html lang="ar" dir="rtl">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>تقرير الشكوى - {{ complaint.reference_number }}</title>
|
|
<style>
|
|
@page { size: A4; margin: 0; }
|
|
@page :first { margin: 0; }
|
|
|
|
@font-face { font-family: 'Noto Kufi Arabic'; font-style: normal; font-weight: 400; src: url('vendor/fonts/noto-kufi-arabic/files/noto-kufi-arabic-full-regular.ttf') format('truetype'); }
|
|
@font-face { font-family: 'Noto Kufi Arabic'; font-style: normal; font-weight: 700; src: url('vendor/fonts/noto-kufi-arabic/files/noto-kufi-arabic-full-bold.ttf') format('truetype'); }
|
|
|
|
:root {
|
|
--blue: #005696;
|
|
--blue-light: #007bbd;
|
|
--ink: #1e293b;
|
|
--body: #334155;
|
|
--muted: #64748b;
|
|
--border: #cbd5e1;
|
|
--surface: #f1f5f9;
|
|
--white: #ffffff;
|
|
--font: 'Noto Kufi Arabic', sans-serif;
|
|
}
|
|
|
|
* { box-sizing: border-box; margin: 0; padding: 0; font-family: var(--font); }
|
|
body { background: var(--white); color: var(--ink); }
|
|
|
|
.page {
|
|
width: 210mm;
|
|
min-height: 297mm;
|
|
position: relative;
|
|
overflow: hidden;
|
|
page-break-after: always;
|
|
background-image: url('{{ letterhead_path }}');
|
|
background-size: 210mm 297mm;
|
|
background-repeat: no-repeat;
|
|
background-position: top left;
|
|
}
|
|
.page:last-child { page-break-after: auto; }
|
|
|
|
.stamp {
|
|
position: fixed;
|
|
bottom: 18mm;
|
|
right: 20mm;
|
|
width: 40mm;
|
|
height: auto;
|
|
z-index: 100;
|
|
}
|
|
|
|
.form-body {
|
|
padding: 38mm 20mm 35mm 20mm;
|
|
position: relative;
|
|
z-index: 1;
|
|
}
|
|
|
|
.form-title {
|
|
text-align: center;
|
|
font-size: 16px;
|
|
color: var(--blue);
|
|
padding: 10px 0 16px 0;
|
|
}
|
|
|
|
.data-table {
|
|
width: 100%;
|
|
border-collapse: collapse;
|
|
margin-top: 12px;
|
|
}
|
|
.data-table th {
|
|
background: var(--surface);
|
|
color: var(--blue);
|
|
font-size: 12px;
|
|
padding: 6px 12px;
|
|
border-right: 3px solid var(--blue);
|
|
border: 1px solid var(--border);
|
|
text-align: right;
|
|
}
|
|
.data-table td {
|
|
border: 1px solid var(--border);
|
|
font-size: 11px;
|
|
padding: 8px 12px;
|
|
}
|
|
.data-table .lbl {
|
|
background: var(--surface);
|
|
color: var(--body);
|
|
font-weight: 700;
|
|
width: 15%;
|
|
}
|
|
.data-table .val {
|
|
color: var(--ink);
|
|
width: 35%;
|
|
}
|
|
.data-table .text-cell {
|
|
padding: 12px;
|
|
line-height: 2;
|
|
text-align: justify;
|
|
}
|
|
.section-header {
|
|
background: var(--surface);
|
|
color: var(--blue);
|
|
font-size: 12px;
|
|
font-weight: 700;
|
|
padding: 6px 12px;
|
|
border-right: 3px solid var(--blue);
|
|
border: 1px solid var(--border);
|
|
border-bottom: none;
|
|
margin-top: 8mm;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<div class="page">
|
|
<div class="form-body">
|
|
<div class="form-title">تقرير الشكوى</div>
|
|
|
|
<!-- Complaint Info -->
|
|
<table class="data-table">
|
|
<tr>
|
|
<td class="lbl">رقم الشكوى</td>
|
|
<td class="val">{{ complaint.reference_number }}</td>
|
|
<td class="lbl">الحالة</td>
|
|
<td class="val">{{ complaint.get_status_display }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="lbl">العنوان</td>
|
|
<td class="val">{{ complaint.title }}</td>
|
|
<td class="lbl">نوع الشكوى</td>
|
|
<td class="val">{{ complaint.get_complaint_type_display }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="lbl">القسم</td>
|
|
<td class="val">{% if complaint.department %}{{ complaint.department.name_ar|default:complaint.department.name_en }}{% else %}—{% endif %}</td>
|
|
<td class="lbl">الخطورة</td>
|
|
<td class="val">{{ complaint.get_severity_display }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="lbl">الموظف المشكو عليه</td>
|
|
<td class="val">{% if complaint.staff %}{{ complaint.staff.get_full_name }}{% else %}—{% endif %}</td>
|
|
<td class="lbl">جهة الادعاء</td>
|
|
<td class="val">{% if complaint.source %}{{ complaint.source.name_ar|default:complaint.source.name_en }}{% else %}—{% endif %}</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="lbl">تاريخ التقديم</td>
|
|
<td class="val">{{ complaint.created_at|date:"Y/m/d H:i" }}</td>
|
|
<td class="lbl">تاريخ الحادثة</td>
|
|
<td class="val">{% if complaint.incident_date %}{{ complaint.incident_date|date:"Y/m/d" }}{% else %}—{% endif %}</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<!-- Description -->
|
|
<div class="section-header">مختصر الشكوى</div>
|
|
<table class="data-table">
|
|
<tr>
|
|
<td colspan="4" class="text-cell">{{ complaint.description }}</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<!-- Patient Info (if available) -->
|
|
{% if complaint.patient %}
|
|
<div class="section-header">بيانات المريض</div>
|
|
<table class="data-table">
|
|
<tr>
|
|
<td class="lbl">اسم المريض</td>
|
|
<td class="val">{{ complaint.patient.get_full_name }}</td>
|
|
<td class="lbl">رقم الملف</td>
|
|
<td class="val">{{ complaint.patient.mrn|default:"—" }}</td>
|
|
</tr>
|
|
</table>
|
|
{% endif %}
|
|
|
|
<!-- Contact Info -->
|
|
{% if complaint.contact_name or complaint.contact_phone %}
|
|
<div class="section-header">بيانات مقدم الشكوى</div>
|
|
<table class="data-table">
|
|
<tr>
|
|
<td class="lbl">الاسم</td>
|
|
<td class="val">{{ complaint.contact_name|default:"—" }}</td>
|
|
<td class="lbl">الهاتف</td>
|
|
<td class="val">{{ complaint.contact_phone|default:"—" }}</td>
|
|
</tr>
|
|
</table>
|
|
{% endif %}
|
|
|
|
<!-- Department Responses -->
|
|
{% if complaint.involved_departments.exists %}
|
|
<div class="section-header">ردود الأقسام</div>
|
|
{% for dept in complaint.involved_departments.all %}
|
|
<table class="data-table">
|
|
<tr>
|
|
<td class="lbl">القسم</td>
|
|
<td class="val">{{ dept.department.name_ar|default:dept.department.name_en }}</td>
|
|
<td class="lbl">تاريخ الرد</td>
|
|
<td class="val">{% if dept.response_submitted_at %}{{ dept.response_submitted_at|date:"Y/m/d H:i" }}{% else %}—{% endif %}</td>
|
|
</tr>
|
|
{% if dept.response_notes %}
|
|
<tr>
|
|
<td colspan="4" class="text-cell">{{ dept.response_notes }}</td>
|
|
</tr>
|
|
{% endif %}
|
|
</table>
|
|
{% endfor %}
|
|
{% endif %}
|
|
|
|
<!-- Explanations -->
|
|
{% if explanations %}
|
|
<div class="section-header">الردود المباشرة</div>
|
|
{% for exp in explanations %}
|
|
{% if exp.explanation %}
|
|
<table class="data-table">
|
|
<tr>
|
|
<td class="lbl">الموظف</td>
|
|
<td class="val">{{ exp.staff.get_full_name|default:"—" }}</td>
|
|
<td class="lbl">تاريخ الرد</td>
|
|
<td class="val">{% if exp.responded_at %}{{ exp.responded_at|date:"Y/m/d H:i" }}{% else %}—{% endif %}</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="4" class="text-cell">{{ exp.explanation }}</td>
|
|
</tr>
|
|
</table>
|
|
{% endif %}
|
|
{% endfor %}
|
|
{% endif %}
|
|
|
|
<!-- Resolution -->
|
|
{% if complaint.resolution %}
|
|
<div class="section-header">الحل</div>
|
|
<table class="data-table">
|
|
<tr>
|
|
<td colspan="4" class="text-cell">{{ complaint.resolution }}</td>
|
|
</tr>
|
|
</table>
|
|
{% endif %}
|
|
|
|
</div>
|
|
</div>
|
|
|
|
{% if stamp_path %}
|
|
<img class="stamp" src="{{ stamp_path }}" alt="">
|
|
{% endif %}
|
|
|
|
</body>
|
|
</html>
|