diff --git a/Thermo.Active/wwwroot/src/app_modules_thermo/processo/components/gantt/gantt.ts b/Thermo.Active/wwwroot/src/app_modules_thermo/processo/components/gantt/gantt.ts index 16f0a1b5..f221412e 100644 --- a/Thermo.Active/wwwroot/src/app_modules_thermo/processo/components/gantt/gantt.ts +++ b/Thermo.Active/wwwroot/src/app_modules_thermo/processo/components/gantt/gantt.ts @@ -47,9 +47,8 @@ export default class Gantt extends Vue { (this.$refs.section3 as any).rowHeight; } - public print() { + public print(r) { this.ganttOptions.printing = true; - this.$nextTick(() => { @@ -61,7 +60,7 @@ export default class Gantt extends Vue { var svgBlob = new Blob([data], { type: 'image/svg+xml;charset=utf-8' }); // var url = DOMURL.createObjectURL(svgBlob); - recipeService.UploadImage(svgBlob, this.panel.nomeRicetta.replace('.rcp', '') + ".svg"); + recipeService.UploadImage(svgBlob, (r || this.panel.nomeRicetta).replace('.rcp', '') + ".svg"); this.ganttOptions.printing = false; // window.open(url, '_blank') }); diff --git a/Thermo.Active/wwwroot/src/app_modules_thermo/processo/components/printProcesso.ts b/Thermo.Active/wwwroot/src/app_modules_thermo/processo/components/printProcesso.ts index 384c12a9..116b3eaf 100644 --- a/Thermo.Active/wwwroot/src/app_modules_thermo/processo/components/printProcesso.ts +++ b/Thermo.Active/wwwroot/src/app_modules_thermo/processo/components/printProcesso.ts @@ -16,8 +16,8 @@ export default class PrintProcesso extends Vue { } mounted() { - messageService.subscribeToChannel("print", () => { - (this.$refs.gantt as any).print(); + messageService.subscribeToChannel("print", (r) => { + (this.$refs.gantt as any).print(...r); }) } } \ No newline at end of file diff --git a/Thermo.Active/wwwroot/src/modules/app-header.ts b/Thermo.Active/wwwroot/src/modules/app-header.ts index 20e24b42..c44ee6ed 100644 --- a/Thermo.Active/wwwroot/src/modules/app-header.ts +++ b/Thermo.Active/wwwroot/src/modules/app-header.ts @@ -94,6 +94,7 @@ export default class AppHeader extends Vue { public async showSaveAsModal() { let result = await ModalHelper.ShowModalAsync(saveAsModal, (this.$store.state as AppModel).prod.panel.nomeRicetta); await recipeService.SaveAs(result); + messageService.publishToChannel('print', result) } public async showChangeNoteModal() { @@ -131,11 +132,11 @@ export default class AppHeader extends Vue { async saveRecipe() { ModalHelper.AskConfirm(this.$options.filters.localize("modal_confirm_title", "Richiesta di conferma"), - this.$options.filters.localize("modal_confirm_save_recipe", "Confermi di voler sovrascrivere la ricetta?"), - async () => { - await recipeService.Save(); - messageService.publishToChannel('print') - }, () => void (0)) + this.$options.filters.localize("modal_confirm_save_recipe", "Confermi di voler sovrascrivere la ricetta?"), + async () => { + await recipeService.Save(); + messageService.publishToChannel('print') + }, () => void (0)) } }