28 lines
947 B
JavaScript
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');
|
|
}
|
|
};
|