improve bazdid 3

This commit is contained in:
javad committed 2026-10-21 12:24:52 +03:30
1 parent f8d768a724
commit f86d060e4d
6 files changed
+337 -121

No files matched your search

@@ -62,7 +62,9 @@
{% endif %}
{% for action in actions %}
<div customer_id='{{ action.customer.id }}' action_id='{{ action.id }}' class="columns is-mobile is-multiline is-gapless actionBox {{ bgBox }}">
<div customer_id='{{ action.customer.id }}' action_id='{{ action.id }}'
customer_hold='{% if action.customer.visit_hold_until %}{{ action.customer.visit_hold_until|date:"c" }}{% endif %}'
class="columns is-mobile is-multiline is-gapless actionBox {{ bgBox }}">
<div class="column is-12-mobile is-12-desktop actionBoxDesc actionBoxOpenB">
<div class="pr-4 pl-4 pb-4 pt-4">
{% ifequal action.status 'finish' %}
@@ -113,7 +115,9 @@
<p style="text-align: center; margin-bottom: 20px; color: #d90000; font-size: 18px;"> کارهای مانده از روزهای قبل</p>
{% for action in actionPr %}
<div customer_id='{{ action.customer.id }}' action_id='{{ action.id }}' class="columns is-mobile is-multiline is-gapless actionBox {{ bgBox }}">
<div customer_id='{{ action.customer.id }}' action_id='{{ action.id }}'
customer_hold='{% if action.customer.visit_hold_until %}{{ action.customer.visit_hold_until|date:"c" }}{% endif %}'
class="columns is-mobile is-multiline is-gapless actionBox {{ bgBox }}">
<div class="column is-12-mobile is-12-desktop actionBoxDesc actionBoxOpenB">
<div class="pr-4 pl-4 pb-4 pt-4">
{% ifequal action.status 'finish' %}
@@ -474,6 +478,26 @@
// مقدار undefined می‌شود. بدون این محافظ، یک ناهم‌خوانی نام کلاس باعث
// TypeError می‌شد و بقیهٔ منطقِ هندلر (پنهان‌کردن فیلدها، برداشتن تیک خودکار)
// اجرا نمی‌شد.
// پرکردن پیکر «تا تاریخ پیگیری نشود» از مقدار ذخیره‌شدهٔ مشتری.
// بدون این، هنگام بازکردن مجدد یک اقدام، فیلد همیشه خالی دیده می‌شد
// (مقدار در دیتابیس بود ولی مودال آن را بارگذاری نمی‌کرد).
function seedHoldPicker(isoValue) {
var box = $("#visitHoldUntil");
if (!isoValue) {
resetHoldPicker();
return;
}
var ms = new Date(isoValue).getTime();
if (isNaN(ms)) {
resetHoldPicker();
return;
}
if (dateTimePickerHoldUntil && typeof dateTimePickerHoldUntil.setDate === 'function') {
dateTimePickerHoldUntil.setDate(ms);
}
box.val(String(ms));
}
function resetHoldPicker() {
if (dateTimePickerHoldUntil && typeof dateTimePickerHoldUntil.setDate === 'function') {
dateTimePickerHoldUntil.setDate();
@@ -576,8 +600,10 @@
isEditMode = true;
$("#sabtBtn05").val("ویرایش");
var actionEditUrl = "{% url 'admin_panel:customerEditAction' 1111 2222 %}";
var action_id = $(this).parent().attr("action_id");
var customer_id = $(this).parent().attr("customer_id");
var row = $(this).parent();
var action_id = row.attr("action_id");
var customer_id = row.attr("customer_id");
var customerHold = row.attr("customer_hold") || "";
actionEditUrl = actionEditUrl.replace('1111', customer_id);
actionEditUrl = actionEditUrl.replace('2222', action_id);
$("#ActionBox").prop("action", actionEditUrl);
@@ -602,6 +628,9 @@
// فیلد «تا تاریخ پیگیری نشود» با نوع اقدام هم‌راستا شود (در حالت ویرایش هم).
closeHoldHelp();
toggleCoordinationField(ActionParseData[0]['fields']['actionType']);
// مقدار ذخیره‌شدهٔ «قرار بعدی» را در همان فیلد نشان بده (بعد از toggle،
// چون toggle برای انواع غیرهماهنگی فیلد را پاک می‌کند).
seedHoldPicker(customerHold);
$("#desc").val(ActionParseData[0]['fields']['desc']);
$("#userID").val(ActionParseData[0]['fields']['forUser']);
if(ActionParseData[0]['fields']['status'] == 'finish'){
+35 -20
View File
@@ -24,7 +24,7 @@
-webkit-overflow-scrolling: touch;
}
@media (min-width: 1024px) {
.ez-stats { grid-auto-flow: row; grid-template-columns: repeat(5, 1fr); overflow: visible; }
.ez-stats { grid-auto-flow: row; grid-template-columns: repeat(6, 1fr); overflow: visible; }
}
.ez-stat {
display: flex; flex-direction: column; gap: .18rem;
@@ -40,6 +40,7 @@
.ez-stat.success { border-top-color: #16a34a; }
.ez-stat.warning { border-top-color: #d97706; }
.ez-stat.link { border-top-color: #0284c7; }
.ez-stat.violet { border-top-color: #7c3aed; }
.ez-stat-top {
display: flex; align-items: baseline; justify-content: space-between; gap: .4rem;
@@ -128,6 +129,7 @@
.ez-badge.success { background: #dcfce7; color: #15803d; }
.ez-badge.warning { background: #fef3c7; color: #b45309; }
.ez-badge.mixed { background: #e0f2fe; color: #0369a1; }
.ez-badge.coordination { background: #ede9fe; color: #6d28d9; }
/* تأخیر به‌صورت چیپ (خوانا در یک نگاه) */
.ez-late {
@@ -202,10 +204,8 @@
<b>بیش از {{ counts.period_months }} ماه</b> گذشته باشد.
روی هر کارت بزنید تا فقط همان گروه نمایش داده شود؛
<b>کل = بدون قرار + با قرار</b>.
{% if counts.both %}
({{ counts.both }} مشتری هم قرار هماهنگی دارند و هم بازدید
برنامه‌ریزی‌شده، پس در هر دو کارت شمرده می‌شوند.)
{% endif %}
سه کارتِ آخر سه نوع قرارِ جدا هستند؛ یک مشتری می‌تواند بیش از
یکی داشته باشد، پس جمع آن‌ها ممکن است از «با قرار» بیشتر شود.
</p>
</div>
@@ -259,6 +259,16 @@
</span>
<span class="ez-desc">اقدام «بازدید» با تاریخ آینده ثبت شده است</span>
</a>
<a href="?view=coordination&sort={{ sort }}{% if searchVal %}&searchVal={{ searchVal }}&searchOn={{ searchOn }}{% endif %}"
class="ez-stat violet {% if view == 'coordination' %}is-active{% endif %}"
title="اقدام «هماهنگی» با تاریخ پیگیری در آینده">
<span class="ez-stat-top">
<span class="ez-lbl">هماهنگی</span>
<span class="ez-num" style="color:#7c3aed">{{ counts.coordination }}</span>
</span>
<span class="ez-desc">تماس گرفته شده و پیگیری به آینده موکول شده است</span>
</a>
</div>
{# تفکیک مدت تأخیر در نمای جاری #}
@@ -293,21 +303,23 @@
<div class="table-container">
<table class="table ez-table">
<colgroup>
<col style="width: 23%">
<col style="width: 13%">
<col style="width: 21%">
<col style="width: 12%">
<col style="width: 10%">
<col style="width: 10%">
<col style="width: 11%">
<col style="width: 10%">
<col style="width: 9%">
<col style="width: 8%">
<col style="width: 9%">
<col style="width: 11%">
<col style="width: 13%">
</colgroup>
<thead>
<tr>
<th>نام و نام خانوادگی</th>
<th>وضعیت قرار</th>
<th>قرار هماهنگی</th>
<th>قرار دستی</th>
<th>بازدید برنامه‌ریزی‌شده</th>
<th>هماهنگی</th>
<th>آخرین بازدید</th>
<th>تأخیر</th>
<th>تلفن</th>
@@ -328,23 +340,26 @@
</td>
{% with appt=appointment_rows|row_for:customer.id %}
<td data-label="وضعیت" class="ez-nolabel">
{% if appt.manual and appt.scheduled or appt.manual and appt.coordination %}
<span class="ez-badge mixed">قرار + بازدید</span>
{% if appt.source_count > 1 %}
<span class="ez-badge mixed">{{ appt.source_count }} قرار</span>
{% elif appt.manual %}
<span class="ez-badge warning">قرار هماهنگی</span>
{% elif appt.scheduled or appt.coordination %}
<span class="ez-badge success">بازدید برنامه‌ریزی‌شده</span>
<span class="ez-badge warning">قرار دستی</span>
{% elif appt.scheduled %}
<span class="ez-badge success">بازدید برنامه</span>
{% elif appt.coordination %}
<span class="ez-badge coordination">هماهنگی</span>
{% else %}
<span class="ez-badge danger">بدون قرار</span>
{% endif %}
</td>
<td data-label="قرار هماهنگی" class="ez-num ez-nowrap">
<td data-label="قرار دستی" class="ez-num ez-nowrap">
{% if appt.manual %}{{ appt.manual|toJalali }}{% else %}<span class="ez-muted">—</span>{% endif %}
</td>
<td data-label="بازدید برنامه" class="ez-num ez-nowrap">
{% if appt.scheduled %}{{ appt.scheduled|toJalali }}
{% elif appt.coordination %}{{ appt.coordination|toJalali }}<div class="ez-sub">در انتظار تماس</div>
{% else %}<span class="ez-muted">—</span>{% endif %}
{% if appt.scheduled %}{{ appt.scheduled|toJalali }}{% else %}<span class="ez-muted">—</span>{% endif %}
</td>
<td data-label="هماهنگی" class="ez-num ez-nowrap">
{% if appt.coordination %}{{ appt.coordination|toJalali }}{% else %}<span class="ez-muted">—</span>{% endif %}
</td>
<td data-label="آخرین بازدید" class="ez-num ez-nowrap lastView">
{% if appt.last_visit %}{{ appt.last_visit|toJalali }}{% else %}<span class="ez-muted">بدون بازدید</span>{% endif %}
@@ -382,7 +397,7 @@
</tr>
{% empty %}
<tr>
<td colspan="8" class="has-text-centered py-5">
<td colspan="9" class="has-text-centered py-5">
<span class="has-text-grey">موردی در این نما پیدا نشد.</span>
</td>
</tr>