Files
thankcard-system/resources/js/app.js
T
2026-07-01 16:57:34 +07:00

28 lines
947 B
JavaScript

import './bootstrap';
import { AjaxTable } from './AjaxTable';
window.AjaxTable = AjaxTable;
document.addEventListener('DOMContentLoaded', () => {
if (document.getElementById('filterForm') && document.querySelector('.bg-white.shadow-sm')) {
new AjaxTable();
}
});
window.openDeleteModal = function(msnv, url) {
const messageEl = document.getElementById('deleteModal-message');
if (messageEl) {
messageEl.innerHTML = `Bạn có chắc chắn muốn đánh dấu nhân viên <span class="font-extrabold text-red-600">${msnv}</span> đã nghỉ việc?<br><br>Thao tác này sẽ ngăn user đăng nhập vào hệ thống, nhưng dữ liệu lịch sử vẫn được giữ lại.`;
}
const formEl = document.getElementById('deleteModal-form');
if (formEl) {
formEl.action = url;
}
if (typeof window.openModal === 'function') {
window.openModal('deleteModal');
}
};