feat: agregar generación de reportes PDF y recomendaciones para PDVs sin asignar
This commit is contained in:
@@ -2,23 +2,27 @@ import { Injectable } from '@angular/core';
|
||||
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class PlanningInputService {
|
||||
private projectId: string | null = null;
|
||||
private pdvFile: File | null = null;
|
||||
private usuariosFile: File | null = null;
|
||||
|
||||
setFiles(pdvFile: File, usuariosFile: File): void {
|
||||
setFiles(projectId: string, pdvFile: File, usuariosFile: File): void {
|
||||
this.projectId = projectId;
|
||||
this.pdvFile = pdvFile;
|
||||
this.usuariosFile = usuariosFile;
|
||||
}
|
||||
|
||||
getFormData(): FormData | null {
|
||||
if (!this.pdvFile || !this.usuariosFile) return null;
|
||||
getFormData(projectId: string): FormData | null {
|
||||
if (this.projectId !== projectId || !this.pdvFile || !this.usuariosFile) return null;
|
||||
const data = new FormData();
|
||||
data.append('pdv_file', this.pdvFile, this.pdvFile.name);
|
||||
data.append('usuarios_file', this.usuariosFile, this.usuariosFile.name);
|
||||
return data;
|
||||
}
|
||||
|
||||
clear(): void {
|
||||
clear(projectId?: string): void {
|
||||
if (projectId && this.projectId !== projectId) return;
|
||||
this.projectId = null;
|
||||
this.pdvFile = null;
|
||||
this.usuariosFile = null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user