KẾ HOẠCH XE TẢI

Go to top
`); printWindow.document.close();// 5. Kích hoạt lệnh in printWindow.focus(); setTimeout(function() { printWindow.print(); printWindow.close(); }, 400); }function getHour(strDate){ if(strDate){ // Cắt chuỗi bằng khoảng trắng để tách riêng giờ và ngày let cacPhan = strDate.split(" "); // Tìm phần có chứa dấu "/" return cacPhan.find(phan => phan.includes(":")); } else return ''; }function parseDDMMYYYY(dateString) { var tmp = dateString; var hours = ''; // Works for both "/" and "-" separators if(dateString.includes(' ')){ const parts = dateString.split(' '); tmp = parts.find(x=>x.includes('/') || x.includes('-')); hours = parts.find(x=>x.includes(':')); } const seprator = tmp.includes('/') ? '/' : '-'; if(hours != '' && hours != undefined){ const [day, month, year] = tmp.split(seprator); const [hour, min] = hours.split(":"); return new Date(+year, +month - 1, +day, +hour, +min); } else{ const [day, month, year] = tmp.split(seprator); return new Date(+year, +month - 1, +day); } // Use unary plus (+) to convert string components to numbers // Subtract 1 from month because JS months range from 0 to 11 }jQuery(document).ready(function($){ const inputEl = document.querySelector(".ninja_filter_date_picker.fp-patched.flatpickr-input"); //console.log(inputEl); if (!inputEl) return;// Lưu trữ hàm gán giá trị gốc của trình duyệt const originalSet = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value').set;// Định nghĩa lại thuộc tính "value" để can thiệp bộ lọc hệ thống Object.defineProperty(inputEl, 'value', { set: function(val) { let finalVal = val; // Nếu hệ thống cố tình gán chuỗi ngày lỗi (ví dụ chứa chữ tiếng Anh hoặc bị đảo) if (val && (val.includes("Jan") || val.includes("Feb") || val.includes("Mar") || val.includes("Apr") || val.includes("May") || val.includes("Jun") || val.includes("Jul") || val.includes("Aug") || val.includes("Sep") || val.includes("Oct") || val.includes("Nov") || val.includes("Dec"))) { // Thử lấy ngày xịn trực tiếp từ bộ nhớ lịch Flatpickr đang chạy ngầm if (this._flatpickr && this._flatpickr.selectedDates.length > 0) { const date = this._flatpickr.selectedDates[0]; const day = String(date.getDate()).padStart(2, '0'); const month = String(date.getMonth() + 1).padStart(2, '0'); const year = date.getFullYear(); finalVal = `${day}/${month}/${year}`; // Ép cứng lại định dạng chuẩn Việt Nam } } // Gọi hàm gốc để lưu giá trị chuẩn vào HTML originalSet.call(this, finalVal); }, get: function() { return this.getAttribute('value'); }, configurable: true }); });$table.on('after.ft.filtering', async function() { if(window.location.href.endsWith("quy-trinh-xe-tai/") || window.location.href.includes('#_1') || window.location.href.includes('43271') || window.location.href.includes('customize')){ /*if($('#preloader').hasClass('loaded')) $('#preloader').removeClass('loaded'); let selectedDate = $('.ninja_filter_date_picker').val(); skip_ajax = true; Promise.all([ renderSttForKeHoach(selectedDate), createTableXeKhongKeHoach(selectedDate) ]).then((result)=>{ if (!$table.find('tfoot .final_result').length) { setSumAmount(renderTfoot(), getSum()); } else { setSumAmount(); } setFormatTextTd(); adjustColspan();skip_ajax = false; })*/} }); } catch (e) { console.warn('Error in custom JS of Ninja Table ID: ' + tableConfig.table_id); console.error(e); } }); `); printWindow.document.close();// 5. Kích hoạt lệnh in printWindow.focus(); setTimeout(function() { printWindow.print(); printWindow.close(); }, 400); }function getHour(strDate){ if(strDate){ // Cắt chuỗi bằng khoảng trắng để tách riêng giờ và ngày let cacPhan = strDate.split(" "); // Tìm phần có chứa dấu "/" return cacPhan.find(phan => phan.includes(":")); } else return ''; }function parseDDMMYYYY(dateString) { var tmp = dateString; var hours = ''; // Works for both "/" and "-" separators if(dateString.includes(' ')){ const parts = dateString.split(' '); tmp = parts.find(x=>x.includes('/') || x.includes('-')); hours = parts.find(x=>x.includes(':')); } const seprator = tmp.includes('/') ? '/' : '-'; if(hours != '' && hours != undefined){ const [day, month, year] = tmp.split(seprator); const [hour, min] = hours.split(":"); return new Date(+year, +month - 1, +day, +hour, +min); } else{ const [day, month, year] = tmp.split(seprator); return new Date(+year, +month - 1, +day); } // Use unary plus (+) to convert string components to numbers // Subtract 1 from month because JS months range from 0 to 11 }jQuery(document).ready(function($){ const inputEl = document.querySelector(".ninja_filter_date_picker.fp-patched.flatpickr-input"); //console.log(inputEl); if (!inputEl) return;// Lưu trữ hàm gán giá trị gốc của trình duyệt const originalSet = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value').set;// Định nghĩa lại thuộc tính "value" để can thiệp bộ lọc hệ thống Object.defineProperty(inputEl, 'value', { set: function(val) { let finalVal = val; // Nếu hệ thống cố tình gán chuỗi ngày lỗi (ví dụ chứa chữ tiếng Anh hoặc bị đảo) if (val && (val.includes("Jan") || val.includes("Feb") || val.includes("Mar") || val.includes("Apr") || val.includes("May") || val.includes("Jun") || val.includes("Jul") || val.includes("Aug") || val.includes("Sep") || val.includes("Oct") || val.includes("Nov") || val.includes("Dec"))) { // Thử lấy ngày xịn trực tiếp từ bộ nhớ lịch Flatpickr đang chạy ngầm if (this._flatpickr && this._flatpickr.selectedDates.length > 0) { const date = this._flatpickr.selectedDates[0]; const day = String(date.getDate()).padStart(2, '0'); const month = String(date.getMonth() + 1).padStart(2, '0'); const year = date.getFullYear(); finalVal = `${day}/${month}/${year}`; // Ép cứng lại định dạng chuẩn Việt Nam } } // Gọi hàm gốc để lưu giá trị chuẩn vào HTML originalSet.call(this, finalVal); }, get: function() { return this.getAttribute('value'); }, configurable: true }); });$table.on('after.ft.filtering', async function() { if(window.location.href.endsWith("quy-trinh-xe-tai/") || window.location.href.includes('#_1') || window.location.href.includes('43271') || window.location.href.includes('customize')){ /*if($('#preloader').hasClass('loaded')) $('#preloader').removeClass('loaded'); let selectedDate = $('.ninja_filter_date_picker').val(); skip_ajax = true; Promise.all([ renderSttForKeHoach(selectedDate), createTableXeKhongKeHoach(selectedDate) ]).then((result)=>{ if (!$table.find('tfoot .final_result').length) { setSumAmount(renderTfoot(), getSum()); } else { setSumAmount(); } setFormatTextTd(); adjustColspan();skip_ajax = false; })*/} }); } catch (e) { console.warn('Error in custom JS of Ninja Table ID: ' + tableConfig.table_id); console.error(e); } });