|
@@ -307,6 +307,12 @@ export class EmployeeFormComponent implements OnInit {
|
|
|
public saveDocumentToUpdate(event: string) {
|
|
public saveDocumentToUpdate(event: string) {
|
|
|
this.nameUpdateDocument = event;
|
|
this.nameUpdateDocument = event;
|
|
|
this.disableDocumentButtons();
|
|
this.disableDocumentButtons();
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private removeItem(documentName:string) {
|
|
|
|
|
+ let arrDocuments = this.documentsEmployee.filter((element:string) => element !== documentName);
|
|
|
|
|
+ this.documentsEmployee = arrDocuments
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private disableDocumentButtons() {
|
|
private disableDocumentButtons() {
|
|
@@ -406,6 +412,7 @@ private enableDocumentButtons(){
|
|
|
this.dataSource = new MatTableDataSource(this.documents);
|
|
this.dataSource = new MatTableDataSource(this.documents);
|
|
|
event.target.value = '';
|
|
event.target.value = '';
|
|
|
// Limpia el select de los documentos
|
|
// Limpia el select de los documentos
|
|
|
|
|
+ this.removeItem(this.nameUpdateDocument);
|
|
|
this.nameUpdateDocument = "";
|
|
this.nameUpdateDocument = "";
|
|
|
this.enableDocumentButtons()
|
|
this.enableDocumentButtons()
|
|
|
this.updateDocuments.setValue("");
|
|
this.updateDocuments.setValue("");
|
|
@@ -428,6 +435,7 @@ private enableDocumentButtons(){
|
|
|
this.officeDoc = [];
|
|
this.officeDoc = [];
|
|
|
}
|
|
}
|
|
|
this.refactorTable(element.index);
|
|
this.refactorTable(element.index);
|
|
|
|
|
+ this.documentsEmployee.push(element.update);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private refactorTable(index: number) {
|
|
private refactorTable(index: number) {
|