Added AHA Report to download in Preorder Index
This commit is contained in:
@@ -939,12 +939,12 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
async function downloadWorkorderAh(workorder_id) {
|
||||
async function downloadWorkorderAha(workorder_id) {
|
||||
if(!workorder_id) return false;
|
||||
|
||||
var filename;
|
||||
|
||||
await fetch('<?=self::getUrl("RimoWorkorder", "downloadAh")?>?id=' + workorder_id)
|
||||
await fetch('<?=self::getUrl("RimoWorkorder", "downloadAha")?>?id=' + workorder_id)
|
||||
.then(resp => {
|
||||
const header = resp.headers.get("Content-disposition");
|
||||
let matches = header.match(/filename=['"]?([^'"]+)/i);
|
||||
@@ -953,7 +953,7 @@
|
||||
window.notify("error", "Fehler beim Download des AH-Blatts");
|
||||
return false;
|
||||
}
|
||||
resp.blob()
|
||||
return resp.blob();
|
||||
})
|
||||
.then(blob => {
|
||||
const url = window.URL.createObjectURL(blob);
|
||||
@@ -968,7 +968,9 @@
|
||||
window.notify("success", "Download gestartet...");
|
||||
//alert('your file has downloaded!'); // or you know, something with better UX...
|
||||
})
|
||||
.catch(() => window.notify("Fehler beim Download des AH-Blatts"));
|
||||
.catch(() => {
|
||||
window.notify("error", "Fehler beim Download des AH-Blatts");
|
||||
});
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user