111 lines
3.5 KiB
JavaScript
111 lines
3.5 KiB
JavaScript
$(document).ready(function () {
|
|
|
|
$('.time-input').mask('00:00', {
|
|
translation: {
|
|
'0': { pattern: /[0-9]/ },
|
|
// برای اولین رقم ساعت فقط 0-2
|
|
'H': { pattern: /[0-2]/ },
|
|
// اگر اولین رقم 2 باشد دومین رقم فقط 0-3
|
|
'h': { pattern: /[0-3]/ },
|
|
// برای دقیقه
|
|
'M': { pattern: /[0-5]/ },
|
|
'm': { pattern: /[0-9]/ },
|
|
}
|
|
});
|
|
|
|
|
|
|
|
// پیشفرض: لود تب اول با workshopId
|
|
loadPartial("/Admin/Company/SmsResult/SmsSettings?handler=InstitutionContractDebtReminderTab");
|
|
$("#institutionContractDebtReminderTab").addClass("active");
|
|
|
|
// کلیک روی تبها
|
|
$("#institutionContractDebtReminderTab, #blockContractingPartyTab, #legalActionTab, #warningTab, #institutionContractConfirmTab").click(function (e) {
|
|
e.preventDefault();
|
|
|
|
|
|
|
|
let url = $(this).data("url");
|
|
|
|
|
|
|
|
switch (this.id) {
|
|
case "institutionContractDebtReminderTab":
|
|
|
|
loadPartial(url);
|
|
|
|
$("#institutionContractDebtReminderTab, #blockContractingPartyTab, #legalActionTab, #warningTab, #institutionContractConfirmTab").removeClass("active");
|
|
$(this).addClass("active");
|
|
break;
|
|
case "blockContractingPartyTab":
|
|
|
|
loadPartial(url);
|
|
$("#institutionContractDebtReminderTab, #blockContractingPartyTab, #legalActionTab, #warningTab, #institutionContractConfirmTab").removeClass("active");
|
|
$(this).addClass("active");
|
|
|
|
break;
|
|
case "legalActionTab":
|
|
loadPartial(url);
|
|
$("#institutionContractDebtReminderTab, #blockContractingPartyTab, #legalActionTab, #warningTab, #institutionContractConfirmTab").removeClass("active");
|
|
$(this).addClass("active");
|
|
break;
|
|
case "warningTab":
|
|
loadPartial(url);
|
|
$("#institutionContractDebtReminderTab, #blockContractingPartyTab, #legalActionTab, #warningTab, #institutionContractConfirmTab").removeClass("active");
|
|
$(this).addClass("active");
|
|
break;
|
|
case "institutionContractConfirmTab":
|
|
loadPartial(url);
|
|
$("#institutionContractDebtReminderTab, #blockContractingPartyTab, #legalActionTab, #warningTab, #institutionContractConfirmTab").removeClass("active");
|
|
$(this).addClass("active");
|
|
break;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
function loadPartial(url) {
|
|
$.get(url, function (data) {
|
|
$("#partialContainer").html(data);
|
|
});
|
|
}
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
function remove(id) {
|
|
|
|
|
|
|
|
$.ajax({
|
|
dataType: 'json',
|
|
type: 'GET',
|
|
url: urlAjaxToRemove,
|
|
headers: { "RequestVerificationToken": antiforgeryToken },
|
|
data: { id: id },
|
|
|
|
success: function (response) {
|
|
if (response.isSuccess) {
|
|
$.Notification.autoHideNotify('success', 'top center', 'پیام سیستم ', response.message);
|
|
|
|
|
|
setTimeout(function () {
|
|
$(".li-wizard.step.active").trigger("click");
|
|
|
|
|
|
|
|
}, 500);
|
|
} else {
|
|
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', response.message);
|
|
}
|
|
|
|
},
|
|
failure: function (response) {
|
|
//console.log(5, response);
|
|
}
|
|
});
|
|
} |