reuse form
This commit is contained in:
@@ -1 +1,27 @@
|
||||
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');
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user