fix fish variz name, dalilrad, sms, bale
This commit is contained in:
1 parent
90931a5a64
commit
35a1ec1794
30 files changed
+674
-39
No files matched your search
@@ -121,3 +121,5 @@
|
||||
@media(max-width:639px){.pay-identifier-control{flex-direction:column;gap:8px}.pay-identifier-control>.pay-button{align-self:stretch}}
|
||||
.pay-pagination{flex-wrap:wrap}.pay-pagination small{flex-basis:100%;text-align:center;color:#526c86}.pay-sms-panel{overflow-wrap:anywhere}.pay-sms-panel>form>.pay-button{width:100%;white-space:normal;line-height:1.8}.pay-sms-panel button:disabled{opacity:.6;cursor:not-allowed}.pay-sms-record{padding:16px 0;border-top:1px solid #e7edf2}.pay-sms-record header{display:flex;justify-content:space-between;gap:8px;flex-wrap:wrap}.pay-sms-record p{margin:8px 0;font-size:13px;line-height:1.9}.pay-sms-record time{font-size:12px;color:#526c86}.pay-sms-panel .pay-status{white-space:normal;max-width:100%;line-height:1.8}.pay-sms-record summary{cursor:pointer;font-size:13px;padding:10px 0;color:#17435d}.pay-sms-body{font-size:13px;line-height:1.9;background:#f0f8fc;padding:12px;border-radius:10px}.pay-sms-attempt{padding:10px 0;border-top:1px dashed #dce5ed}.pay-sms-error{color:#9f1f1f}
|
||||
.receipt-upload{padding:18px;margin:16px 0;border:1px solid #c7dfeb;border-radius:16px;background:#f0f8fc;color:#17435d;overflow-wrap:anywhere}.receipt-upload[hidden]{display:none}.receipt-upload p{margin:8px 0;font-size:14px}.receipt-upload small{display:block;color:#526c86}.receipt-upload-meter{display:flex;align-items:center;gap:12px;margin-top:12px}.receipt-upload-meter progress{width:100%;flex:1;min-width:0;height:12px;accent-color:#087d8b;direction:ltr}.receipt-upload-meter span{min-width:44px;text-align:center;font-weight:700;font-variant-numeric:tabular-nums}.customer-receipt-actions button:disabled{opacity:.65;cursor:wait}.customer-receipt-form.is-uploading input,.customer-receipt-form.is-uploading select,.customer-receipt-form.is-uploading textarea{opacity:.75}
|
||||
|
||||
.chaharsu .pay-deposit-warning{color:#b42318;background:#fff4f2;border:1px solid #f5b5ad;border-radius:12px;padding:14px 16px;font-size:14px;line-height:2;overflow-wrap:anywhere}
|
||||
@@ -0,0 +1,26 @@
|
||||
/* Preview the exact rejection reason before submitting the staff decision. */
|
||||
(() => {
|
||||
const form = document.querySelector('.pay-decision-form');
|
||||
if (!form) return;
|
||||
form.addEventListener('submit', event => {
|
||||
const confirmation = form.elements.namedItem('confirm_rejection');
|
||||
confirmation.value = '';
|
||||
if (event.submitter?.value !== 'REJECT') return;
|
||||
const reason = form.elements.namedItem('reason');
|
||||
if (!reason.value.trim()) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
reason.setCustomValidity('دلیل رد فیش را برای مشتری بنویسید.');
|
||||
reason.reportValidity();
|
||||
reason.setCustomValidity('');
|
||||
reason.focus();
|
||||
return;
|
||||
}
|
||||
if (!window.confirm('این فیش رد میشود و دلیل زیر با پیامک برای مشتری ارسال خواهد شد:\n\n' + reason.value.trim() + '\n\nرد فیش و ارسال این دلیل را تأیید میکنید؟')) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
return;
|
||||
}
|
||||
confirmation.value = '1';
|
||||
});
|
||||
})();
|
||||
@@ -5,6 +5,7 @@
|
||||
const form=document.querySelector('#receipt-form');if(!form)return;
|
||||
const q=name=>form.elements.namedItem(name),button=document.querySelector('#submit-receipt');
|
||||
const notices=JSON.parse(document.querySelector('#notice-data').textContent);
|
||||
const accounts=JSON.parse(document.querySelector('#account-requirements').textContent);
|
||||
const day=q('paid_day'),month=q('paid_month'),year=q('paid_year');
|
||||
const digits=value=>String(value).replace(/[۰-۹]/g,x=>String(x.charCodeAt(0)-1776)).replace(/[٠-٩]/g,x=>String(x.charCodeAt(0)-1632));
|
||||
const formatter=new Intl.DateTimeFormat('en-US',{calendar:'persian',numberingSystem:'latn',timeZone:'Asia/Tehran',year:'numeric',month:'numeric',day:'numeric'});
|
||||
@@ -24,6 +25,10 @@ function monthUpdate(){
|
||||
[month,year].forEach(control=>control.addEventListener('change',monthUpdate));day.addEventListener('change',dateUpdate);
|
||||
document.querySelector('#date-today').addEventListener('click',()=>{const p=parts(new Date());year.value=p.year;month.value=p.month;monthUpdate();day.value=p.day;dateUpdate();day.focus();});monthUpdate();
|
||||
function sync(){
|
||||
const destination=accounts[q('destination_account').value];
|
||||
const warning=document.querySelector('#destination-deposit-warning');
|
||||
warning.hidden=!destination?.required;
|
||||
warning.querySelector('[data-destination-bank]').textContent=destination?.bank || '';
|
||||
const linked=q('receipt_mode').value==='linked';const select=q('notice_id');form.querySelector('[data-field=notice_id]').hidden=!linked;select.disabled=!linked;select.required=linked;
|
||||
if(!linked)select.value='';
|
||||
const notice=linked?notices.find(n=>n.id===select.value):null;const summary=document.querySelector('#selected-payment');summary.hidden=!notice;
|
||||
@@ -55,6 +60,7 @@ let revision=0;form.addEventListener('input',()=>revision++);form.addEventListen
|
||||
form.addEventListener('submit',async event=>{
|
||||
event.preventDefault();if(busy)return;busy=true;button.disabled=true;button.textContent='در حال بررسی تصویر…';document.querySelector('#form-status').textContent='';const version=revision,errors=new Map();let navigating=false;
|
||||
try{
|
||||
if(!q('depositor_name').value.replace(/[\s\u200c\u200b]/g,''))errors.set('depositor_name','نام واریزکننده را وارد کنید.');
|
||||
const value=digits(q('paid_amount').value).trim();if(!/^\d+$/.test(value) && !/^\d{1,3}(?:[,٬ ]\d{3})+$/.test(value))errors.set('paid_amount','مبلغ را به ریال و با عدد صحیح وارد کنید.');else{const amount=BigInt(value.replace(/[,٬ ]/g,''));if(amount<=0n || amount>9007199254740991n)errors.set('paid_amount','مبلغ باید مثبت و در محدوده مجاز باشد.');}
|
||||
if(q('receipt_mode').value==='linked' && !q('notice_id').value)errors.set('notice_id','اعلامیه را انتخاب کنید یا واریز مستقل را بزنید.');
|
||||
if(!q('destination_account').value)errors.set('destination_account','حساب مقصد را انتخاب کنید.');
|
||||
|
||||
Reference in new issue
Block a user