|
|
@@ -58,6 +58,7 @@ export class RegisterArtitleComponent implements OnInit {
|
|
|
generatedTag: string;
|
|
|
formGroup: FormGroup;
|
|
|
disableAttachActions: boolean;
|
|
|
+ directToStock: boolean;
|
|
|
|
|
|
locationsArr: LocationsListItem[];
|
|
|
levelsArr: any[];
|
|
|
@@ -168,6 +169,7 @@ export class RegisterArtitleComponent implements OnInit {
|
|
|
this.errorStr = "";
|
|
|
this.generatedTag = "";
|
|
|
this.disableAttachActions = false;
|
|
|
+ this.directToStock = false;
|
|
|
|
|
|
this.locationsArr = [];
|
|
|
this.levelsArr = [];
|
|
|
@@ -273,7 +275,6 @@ export class RegisterArtitleComponent implements OnInit {
|
|
|
if (dataUrlForm !== null) {
|
|
|
const decDataForm: string = await this._encService.decrypt(dataUrlForm);
|
|
|
const objDataForm: GetDataRegisterArtitle = JSON.parse(decDataForm);
|
|
|
- console.log(objDataForm);
|
|
|
if (objDataForm.action === 'new' && objDataForm.order === undefined && objDataForm.info === undefined && objDataForm.cantidad === undefined) {
|
|
|
this.action = 'Registrar';
|
|
|
await this.getLocations();
|
|
|
@@ -382,7 +383,6 @@ export class RegisterArtitleComponent implements OnInit {
|
|
|
}
|
|
|
});
|
|
|
|
|
|
-
|
|
|
this.formGroup.controls['acquisitionDateControl'].valueChanges.subscribe((dateAdquisition) => {
|
|
|
if (typeof dateAdquisition === 'object') {
|
|
|
this.minDateWarrantyStart = dateAdquisition;
|
|
|
@@ -395,11 +395,24 @@ export class RegisterArtitleComponent implements OnInit {
|
|
|
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
this.formGroup.controls['warrantyEndDateControl'].valueChanges.subscribe((dateEnd) => {
|
|
|
if (typeof dateEnd === 'object') {
|
|
|
this.maxDateWarrantyStart = dateEnd;
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
+ let currentLocation = window.location.href;
|
|
|
+ let currentLocationArr = currentLocation.split('#').reverse();
|
|
|
+
|
|
|
+ if(currentLocationArr.length > 1){
|
|
|
+ let currentLocationStr = currentLocationArr[0].replace('/sam/', '');
|
|
|
+ let moduleCode = currentLocationStr.substring(0, 4);
|
|
|
+
|
|
|
+ if(moduleCode == 'GIST'){
|
|
|
+ this.directToStock = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
private _filterEquipments(value: string): string[]{
|
|
|
@@ -2472,6 +2485,7 @@ export class RegisterArtitleComponent implements OnInit {
|
|
|
this.resourcesService.openSnackBar('Los documentos relacionados deben contener por lo menos 1 registro.');
|
|
|
}else{
|
|
|
this.resourcesService.openSnackBar('Guardando registro...');
|
|
|
+
|
|
|
let formValue = this.formGroup.getRawValue();
|
|
|
let formData = new FormData();
|
|
|
let idUser = localStorage.getItem('idusuario')!;
|
|
|
@@ -2505,18 +2519,16 @@ export class RegisterArtitleComponent implements OnInit {
|
|
|
formData.append('equipment_type', formValue.equipmentTypeControl);
|
|
|
formData.append('equipment_model', formValue.equipmentModelControl);
|
|
|
|
|
|
-
|
|
|
- let warehouseID = formValue.warehouseIDControl.replace('-enc', '');;
|
|
|
- let areaID = formValue.areaIDControl.replace('-enc', '');;
|
|
|
- let levelID = formValue.levelIDControl.replace('-enc', '');;
|
|
|
- let zoneID = formValue.zoneIDControl.replace('-enc', '');;
|
|
|
+ let warehouseID = formValue.warehouseIDControl.replace('-enc', '');
|
|
|
+ let areaID = formValue.areaIDControl.replace('-enc', '');
|
|
|
+ let levelID = formValue.levelIDControl.replace('-enc', '');
|
|
|
+ let zoneID = formValue.zoneIDControl.replace('-enc', '');
|
|
|
|
|
|
formData.append('warehouse', warehouseID);
|
|
|
formData.append('area', areaID);
|
|
|
formData.append('level', levelID);
|
|
|
formData.append('zone', zoneID);
|
|
|
formData.append('number_items', this.numberItems.toString());
|
|
|
-
|
|
|
|
|
|
let imagesArr = JSON.stringify(this.attachedImages);
|
|
|
let documentsArr = JSON.stringify(this.attachedDocuments);
|
|
|
@@ -2542,6 +2554,11 @@ export class RegisterArtitleComponent implements OnInit {
|
|
|
formData.append('acquisition_date', acquisitionDateStr);
|
|
|
formData.append('warranty_start_date', warrantyStartDateStr);
|
|
|
formData.append('warranty_end_date', warrantyEndDateStr);
|
|
|
+ console.log(formData);
|
|
|
+
|
|
|
+ /*
|
|
|
+
|
|
|
+
|
|
|
|
|
|
let providerArr = formValue.equipmentProviderControl.split(')');
|
|
|
let providerStr = providerArr[0].replace('(', '');
|
|
|
@@ -2620,7 +2637,7 @@ export class RegisterArtitleComponent implements OnInit {
|
|
|
)
|
|
|
} else if ( isExit) {
|
|
|
this.goBack(1);
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
}
|
|
|
}catch(error: any){
|