From 8c557ced85103d8aa7cc06aaf1181d1ef6ad6532 Mon Sep 17 00:00:00 2001 From: "DESKTOP-T0O5CDB\\DESK-555BD" Date: Sat, 11 Jan 2025 12:04:01 -0700 Subject: [PATCH] draft PR for sticker printing. --- Views/Vehicle/_ReminderRecords.cshtml | 6 ++++++ wwwroot/css/site.css | 4 ++++ wwwroot/js/reports.js | 3 +++ wwwroot/js/shared.js | 11 +++++++++++ 4 files changed, 24 insertions(+) diff --git a/Views/Vehicle/_ReminderRecords.cshtml b/Views/Vehicle/_ReminderRecords.cshtml index 13c5507..204e107 100644 --- a/Views/Vehicle/_ReminderRecords.cshtml +++ b/Views/Vehicle/_ReminderRecords.cshtml @@ -193,6 +193,9 @@ +
+ +
diff --git a/wwwroot/css/site.css b/wwwroot/css/site.css index 4525b5d..df480c6 100644 --- a/wwwroot/css/site.css +++ b/wwwroot/css/site.css @@ -486,4 +486,8 @@ html[data-bs-theme="light"] .api-method:hover { .lubelogger-report-banner { border-top: thin solid black; text-align: center; +} + +.stickerPrintDiv { + z-index: 1030; } \ No newline at end of file diff --git a/wwwroot/js/reports.js b/wwwroot/js/reports.js index 78a4c54..a2e66dc 100644 --- a/wwwroot/js/reports.js +++ b/wwwroot/js/reports.js @@ -117,6 +117,9 @@ function generateVehicleHistoryReport() { $("#vehicleHistoryReport").html(data); setTimeout(function () { window.print(); + setTimeout(function () { + $("#vehicleHistoryReport").html(""); //clear out the div. + }, 1000) }, 500); } }) diff --git a/wwwroot/js/shared.js b/wwwroot/js/shared.js index b60da75..1cfaafa 100644 --- a/wwwroot/js/shared.js +++ b/wwwroot/js/shared.js @@ -617,6 +617,17 @@ function printTab() { window.print(); }, 500); } +function printTabStickers(ids, source) { + $(".stickerPrintDiv").addClass("showOnPrint"); + $(".stickerPrintDiv").removeClass("hideOnPrint"); + setTimeout(function () { + window.print(); + setTimeout(function () { + $(".stickerPrintDiv").removeClass("showOnPrint"); + $(".stickerPrintDiv").addClass("hideOnPrint"); + }, 1000); + }, 500); +} function exportVehicleData(mode) { var vehicleId = GetVehicleId().vehicleId; $.get('/Vehicle/ExportFromVehicleToCsv', { vehicleId: vehicleId, mode: mode }, function (data) {