modal add check data

This commit is contained in:
javad committed 2026-07-31 22:25:48 +03:30
1 parent 8b73db4de3
commit b66fe69660
4 files changed
+416 -64

No files matched your search

@@ -122,6 +122,7 @@
<th>نوع</th>
<th>وضعیت</th>
<th>عملیات</th>
<th>تکمیل اطلاعات چک</th>
<th>تاریخ سررسید</th>
<th>ردیف چک</th>
<th>شناسه صیادی</th>
@@ -171,6 +172,22 @@
{% endif %}
</td>
<td>
{% if sarresid.type == 'check' %}
<button class="button is-small is-info is-light has-text-weight-bold btn-update-check"
data-id="{{ sarresid.id }}"
data-row="{{ sarresid.check_row_number|default:'' }}"
data-sayyad="{{ sarresid.check_sayyad_id|default:'' }}"
data-owner="{{ sarresid.check_owner_name|default:'' }}"
data-phone="{{ sarresid.check_owner_phone|default:'' }}">
<span class="icon is-small"><i class="fas fa-edit"></i></span>
<span>افزودن اطلاعات</span>
</button>
{% else %}
<span class="has-text-grey-light">-</span>
{% endif %}
</td>
<td>{{ sarresid.sarresidDT | toJalali }}</td>
<td class="search-row-num has-text-weight-semibold">
@@ -301,6 +318,54 @@
</div>
</form>
<form class="modal modalUpdateCheck" method="post" action="" id="updateCheckForm">
{% csrf_token %}
<div class="modal-background"></div>
<div class="modal-card">
<header class="modal-card-head">
<p class="modal-card-title">تکمیل اطلاعات چک صیادی</p>
<button type="button" class="delete" aria-label="close"></button>
</header>
<section class="modal-card-body">
<div class="field">
<label class="label">شماره ردیف / سریال چک <span class="has-text-danger">*</span></label>
<div class="control">
<input id="up_check_row" name="check_row_number" class="input reset_input" type="text" required placeholder="مثال: 123456">
</div>
</div>
<div class="field">
<label class="label">شناسه صیادی (۱۶ رقم) <span class="has-text-danger">*</span></label>
<div class="control">
<input id="up_check_sayyad" name="check_sayyad_id" class="input reset_input" type="text" required inputmode="numeric" pattern="[0-9]{16}" minlength="16" maxlength="16" placeholder="فقط اعداد ۱۶ رقمی" title="لطفاً دقیقاً ۱۶ رقم وارد کنید">
</div>
</div>
<div class="field">
<label class="label">نام و نام‌خانوادگی صاحب حساب <span class="has-text-danger">*</span></label>
<div class="control">
<input id="up_check_owner" name="check_owner_name" class="input reset_input" type="text" required placeholder="نام مالک چک">
</div>
</div>
<div class="field">
<label class="label">تلفن مالک چک (اختیاری)</label>
<div class="control">
<input id="up_check_phone" name="check_owner_phone" class="input reset_input" type="text" inputmode="numeric" pattern="[0-9]*" maxlength="11" placeholder="مثال: 09123456789">
</div>
</div>
</section>
<footer class="modal-card-foot">
<button type="submit" class="button is-info">
<i class="fas fa-check ml-1"></i> ذخیره اطلاعات
</button>
<span class="button cancellBTNSR">لغو</span>
</footer>
</div>
</form>
<form class="modal nesiyeModal" method="post" action="{% url 'admin_panel:pardakhtNesiye' customer.id %}" id="pardakhtNesiyeForm">
{% csrf_token %}
<div class="modal-background"></div>
@@ -432,22 +497,44 @@
});
// ----------------------------------------------------
// مودال‌ها
// مودال‌ها و باز و بسته شدن آنها
// ----------------------------------------------------
$("#newSarresid").click(function(){
$(".modalAddNew").addClass("is-active");
});
// رویداد کلیک برای باز کردن مُدال تکمیل اطلاعات چک
$(".btn-update-check").click(function(){
let sarresidId = $(this).data('id');
let rowNum = $(this).data('row');
let sayyadId = $(this).data('sayyad');
let ownerName = $(this).data('owner');
let ownerPhone = $(this).data('phone');
// مقداردهی فرم با اطلاعات قبلی
$("#up_check_row").val(rowNum !== 'None' ? rowNum : '');
$("#up_check_sayyad").val(sayyadId !== 'None' ? sayyadId : '');
$("#up_check_owner").val(ownerName !== 'None' ? ownerName : '');
$("#up_check_phone").val(ownerPhone !== 'None' ? ownerPhone : '');
// تنظیم آدرس (Action) فرم برای این آیدی خاص
$("#updateCheckForm").attr('action', '/panel/sarresid/update-check-info/' + sarresidId);
// باز کردن مُدال
$(".modalUpdateCheck").addClass("is-active");
});
// بستن تمامی مدال‌ها
$(".modal-background, .delete, .cancellBTNSR").click(function(){
$(".modal").removeClass("is-active");
$('.reset_input').val('');
$('.reset_input').not(':hidden').val('');
$('#priceInWords, #nextPriceInWords').text('');
$("#check_extra_fields").hide();
$(".is-required-check").prop('required', false);
});
// ----------------------------------------------------
// تقویم شمسی (اصلاح شده)
// تقویم شمسی
// ----------------------------------------------------
$("#NewSarResid").pDatepicker({
initialValue: false,