mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
Merge branch 'developer' of https://bitbucket.org/equilibriumito/gabinete-digital into release/uats
This commit is contained in:
@@ -28,27 +28,27 @@ export class NewActionPage implements OnInit {
|
||||
public stepMinute = 5;
|
||||
public stepSecond = 5;
|
||||
public endMinDate = new Date(new Date().getTime() + 15 * 60000);
|
||||
|
||||
|
||||
Form: FormGroup;
|
||||
validateFrom = false
|
||||
|
||||
public dateControlStart = new FormControl(moment("DD MM YYYY hh"));
|
||||
public dateControlEnd = new FormControl(moment("DD MM YYYY hh"));
|
||||
|
||||
|
||||
|
||||
@Output() closeDesktopComponent= new EventEmitter<any>();
|
||||
@Output() getActions= new EventEmitter<any>();
|
||||
|
||||
constructor(
|
||||
private publication: PublicationsService,
|
||||
private toastService: ToastService
|
||||
) {
|
||||
) {
|
||||
this.folder = new PublicationFolder();
|
||||
|
||||
|
||||
this.folder = Object.assign(this.folder, {
|
||||
DateBegin: moment(new Date()),
|
||||
DateEnd: moment(new Date(new Date().getTime() + 15 * 60000)),
|
||||
DateBegin: new Date().toISOString(),
|
||||
DateEnd: (new Date(new Date().getTime() + 15 * 60000)).toISOString(),
|
||||
})
|
||||
|
||||
}
|
||||
@@ -76,9 +76,15 @@ export class NewActionPage implements OnInit {
|
||||
return ['ok']
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
runValidation() {
|
||||
this.validateFrom = true
|
||||
this.validateFrom = true;
|
||||
if((new Date(this.folder.DateBegin).getTime()) > (new Date(this.folder.DateEnd).getTime())){
|
||||
this.toastService._badRequest("A data de início não pode ser superior a data de fim");
|
||||
}
|
||||
else if(new Date(this.folder.DateBegin).getTime() > new Date().getTime()){
|
||||
this.toastService._badRequest("A data de início não pode ser superior a data actual");
|
||||
}
|
||||
}
|
||||
|
||||
injectValidation() {
|
||||
@@ -119,21 +125,21 @@ export class NewActionPage implements OnInit {
|
||||
ActionType: this.segment,
|
||||
}
|
||||
console.log(this.folder);
|
||||
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
try {
|
||||
await this.publication.CreatePublicationFolder(this.folder).toPromise()
|
||||
this.close();
|
||||
this.toastService.successMessage('Acção presidencial criada')
|
||||
this.toastService._successMessage('Acção presidencial criada')
|
||||
|
||||
this.getActions.emit()
|
||||
} catch (error) {
|
||||
this.toastService.badRequest('Não foi possivel criar a acção presidencial')
|
||||
this.toastService._badRequest('Não foi possivel criar a acção presidencial')
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
close(){
|
||||
|
||||
@@ -89,12 +89,10 @@ export class ViewPublicationsPage implements OnInit {
|
||||
}
|
||||
|
||||
getPublicationDetail() {
|
||||
|
||||
setTimeout(() => {
|
||||
let allActions = this.publicationEventFolderStorage.list.concat(this.publicationTravelFolderService.list)
|
||||
this.item = allActions.find((e)=> e.ProcessId == this.folderId);
|
||||
},100);
|
||||
|
||||
this.publications.GetPresidentialAction(this.folderId).subscribe(res=>{
|
||||
console.log(res);
|
||||
this.item = res;
|
||||
});
|
||||
}
|
||||
|
||||
getPublications() {
|
||||
|
||||
Reference in New Issue
Block a user