mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
Gabinete Digital on work.
This commit is contained in:
@@ -3,4 +3,5 @@ export class DailyWorkTask{
|
||||
Folio: string;
|
||||
Senders: string;
|
||||
CreateDate: string;
|
||||
DocumentURL: string;
|
||||
}
|
||||
+4
-8
@@ -3,7 +3,7 @@
|
||||
<ion-buttons slot="start">
|
||||
<ion-back-button defaultHref="/expediente"></ion-back-button>
|
||||
</ion-buttons>
|
||||
<ion-title>Detalhes do Processo</ion-title>
|
||||
<ion-title>Expediente</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<ion-item-group>
|
||||
<ion-item>
|
||||
<ion-label position="stacked">Assunto</ion-label>
|
||||
<ion-input >{{task.Folio }}</ion-input>
|
||||
<ion-input >{{ task.Folio }}</ion-input>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-label position="stacked">Remetentes</ion-label>
|
||||
@@ -26,15 +26,11 @@
|
||||
<ion-input value=''>{{ task.CreateDate }}</ion-input>
|
||||
</ion-item>
|
||||
<ion-list>
|
||||
<ion-list-header>Documentos a Anexar</ion-list-header>
|
||||
<ion-item>
|
||||
<ion-item (click)="viewDocument()">
|
||||
<ion-icon name="attach" slot="start"></ion-icon>
|
||||
<ion-label>Lei do orçamento geral do Estado</ion-label>
|
||||
<ion-label>Ver documento</ion-label>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</ion-item-group>
|
||||
<div class="event-detail-buttons">
|
||||
<ion-button class="ion-button-right">Guardar</ion-button>
|
||||
</div>
|
||||
</ion-content>
|
||||
|
||||
|
||||
+19
-5
@@ -1,8 +1,9 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
|
||||
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
|
||||
import { DailyWorkTask } from '../../../../models/dailyworktask.model';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { formatDate } from '@angular/common';
|
||||
|
||||
@Component({
|
||||
selector: 'app-expediente-detail',
|
||||
@@ -11,11 +12,11 @@ import { ActivatedRoute } from '@angular/router';
|
||||
})
|
||||
export class ExpedienteDetailPage implements OnInit {
|
||||
|
||||
constructor(private activateRoute: ActivatedRoute,private processes:ProcessesService) { }
|
||||
constructor(private activateRoute: ActivatedRoute,private processes:ProcessesService,private iab: InAppBrowser) { }
|
||||
|
||||
task:DailyWorkTask;
|
||||
task: DailyWorkTask;
|
||||
|
||||
serialnumber:string;
|
||||
serialnumber:string;
|
||||
|
||||
ngOnInit() {
|
||||
this.activateRoute.paramMap.subscribe(paramMap => {
|
||||
@@ -29,7 +30,20 @@ serialnumber:string;
|
||||
|
||||
LoadTaskDetail(serial:string)
|
||||
{
|
||||
this.task = this.processes.GetTaskDetail(serial);
|
||||
this.processes.GetTask(serial).subscribe(result => {
|
||||
this.task = {
|
||||
"SerialNumber": result.serialNumber,
|
||||
"Folio": result.workflowInstanceFolio,
|
||||
"Senders": result.originator.email,
|
||||
"CreateDate": formatDate(new Date(result.taskStartDate), 'yyyy-MM-dd HH:mm', 'pt'),
|
||||
"DocumentURL": result.formURL
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
viewDocument()
|
||||
{
|
||||
const browser = this.iab.create(this.task.DocumentURL);
|
||||
browser.show();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
<ion-list *ngSwitchCase="'pendentes'">
|
||||
<ion-item-group>
|
||||
<ion-item-sliding>
|
||||
<ion-item lines="none">
|
||||
<!-- <ion-item lines="none">
|
||||
<div class="div-content-pendentes">
|
||||
<ion-item lines="none">
|
||||
<ion-icon slot="end" name="document-outline"></ion-icon>
|
||||
@@ -47,7 +47,7 @@
|
||||
</ion-item>
|
||||
<p><span class="span-left">MINEC, MINFIN</span><span class="span-right">05 JAN</span></p>
|
||||
</div>
|
||||
</ion-item>
|
||||
</ion-item> -->
|
||||
</ion-item-sliding>
|
||||
</ion-item-group>
|
||||
</ion-list>
|
||||
|
||||
@@ -6,6 +6,7 @@ import { CalendarComponent } from 'ionic2-calendar';
|
||||
|
||||
import { DailyWorkTask } from '../../../models/dailyworktask.model';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { formatDate } from '@angular/common';
|
||||
|
||||
@Component({
|
||||
selector: 'app-expediente',
|
||||
@@ -57,17 +58,25 @@ export class ExpedientePage implements OnInit {
|
||||
)
|
||||
);
|
||||
}
|
||||
/* Here you save the data entered */
|
||||
/* this.eventSource.push(result.data.event); */
|
||||
/* Here you load the data saved */
|
||||
/* this.myCal.loadEvents(); */
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
LoadList()
|
||||
{
|
||||
this.taskslist = this.processes.GetDailyWorkTasks();
|
||||
this.processes.GetTasksList("Expediente", false).subscribe(result => {
|
||||
this.taskslist = new Array();
|
||||
result.forEach(element => {
|
||||
let task: DailyWorkTask = {
|
||||
"SerialNumber": element.serialNumber,
|
||||
"Folio": element.workflowInstanceFolio,
|
||||
"Senders": element.originator.email,
|
||||
"CreateDate": formatDate(new Date(element.taskStartDate), 'yyyy-MM-dd HH:mm', 'pt'),
|
||||
"DocumentURL": element.formURL
|
||||
}
|
||||
this.taskslist.push(task);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -23,12 +23,11 @@ export class GabineteDigitalPage implements OnInit {
|
||||
this.LoadCounts();
|
||||
}
|
||||
|
||||
load(){
|
||||
|
||||
}
|
||||
|
||||
LoadCounts() {
|
||||
this.count_exp_dailywork = this.processesbackend.GetDailyWorkCount();
|
||||
this.processesbackend.GetTasksList("Expediente", true).subscribe(result =>{
|
||||
this.count_exp_dailywork = result;
|
||||
});
|
||||
|
||||
this.count_exp_pp = "-";
|
||||
this.count_exp_pd = "-";
|
||||
this.count_dip_apr = "-";
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { StorageService } from './storage.service';
|
||||
import { HttpService } from './http.service';
|
||||
import { Router } from '@angular/router';
|
||||
import { AuthConnstants } from '../config/auth-constants';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { User } from '../models/user.model';
|
||||
import { environment } from 'src/environments/environment';
|
||||
@@ -15,8 +13,6 @@ export class AuthService {
|
||||
|
||||
|
||||
constructor(
|
||||
private storageService: StorageService,
|
||||
private router: Router,
|
||||
private http: HttpClient
|
||||
) { }
|
||||
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { HttpService } from './http.service';
|
||||
|
||||
describe('HttpService', () => {
|
||||
let service: HttpService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(HttpService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -1,45 +0,0 @@
|
||||
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { environment } from '../../environments/environment';
|
||||
import { reject } from 'q';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class HttpService {
|
||||
constructor(private http: HttpClient) {}
|
||||
|
||||
/* post(serviceName: string, data: any) {
|
||||
const headers = new HttpHeaders();
|
||||
const options = { headers: headers, withCredintials: false };
|
||||
const url = environment.apiURL + serviceName;
|
||||
|
||||
return this.http.post(url, JSON.stringify(data), options);
|
||||
} */
|
||||
|
||||
private API_URL = 'https://gpr-dev-08.gabinetedigital.local/api/v2.0/me/calendarview';
|
||||
|
||||
/* loginRequest(username:string, password: string, domain: string){
|
||||
return new Promise((resolve, reject) => {
|
||||
var data = {
|
||||
emusernameail: username,
|
||||
password: password,
|
||||
domain: domain
|
||||
};
|
||||
this.http.post(this.API_URL, data)
|
||||
.subscribe(result: any)=> {
|
||||
resolve(result.json());
|
||||
},
|
||||
(error)=>{
|
||||
reject(error.json());
|
||||
}
|
||||
|
||||
})
|
||||
} */
|
||||
/* request(API_URL, { json: true },{username:"tiago.kayaya"}, {password:"tabteste@006"}, {domain:"gabinetedigital.local"} ,(err, res, body) => {
|
||||
if (err) { return console.log(err); }
|
||||
console.log(body.url);
|
||||
console.log(body.explanation);
|
||||
}); */
|
||||
|
||||
}
|
||||
@@ -1,48 +1,55 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
|
||||
import { DailyWorkTask } from '../models/dailyworktask.model';
|
||||
import { AuthService } from '../services/auth.service';
|
||||
import { User } from '../models/user.model';
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class ProcessesService {
|
||||
|
||||
constructor() { }
|
||||
authheader = {};
|
||||
loggeduser: User;
|
||||
headers: HttpHeaders;
|
||||
|
||||
GetDailyWorkCount()
|
||||
{
|
||||
return 100;
|
||||
constructor(private http: HttpClient, user: AuthService) {
|
||||
this.loggeduser = user.ValidatedUser;
|
||||
this.headers = new HttpHeaders();
|
||||
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||
}
|
||||
|
||||
private tasks: DailyWorkTask[] = [
|
||||
{
|
||||
SerialNumber: "1",
|
||||
Folio: "Teste 1",
|
||||
Senders: "MINEC, MINPLAN, MINFIN",
|
||||
CreateDate: "2020-08-18"
|
||||
},
|
||||
{
|
||||
SerialNumber: "2",
|
||||
Folio: "Teste 2",
|
||||
Senders: "MINFIN",
|
||||
CreateDate: "2020-08-19"
|
||||
},{
|
||||
SerialNumber: "3",
|
||||
Folio: "Teste 3",
|
||||
Senders: "MINEC",
|
||||
CreateDate: "2020-08-20"
|
||||
}
|
||||
];
|
||||
|
||||
GetDailyWorkTasks()
|
||||
GetTasksList(processname:string, onlycount:boolean): Observable<any>
|
||||
{
|
||||
return this.tasks;
|
||||
const geturl = environment.apiURL + 'processes/GetTasksList';
|
||||
let params = new HttpParams();
|
||||
|
||||
params = params.set("ProcessName", processname);
|
||||
params = params.set("OnlyCount", onlycount.toString());
|
||||
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
params: params
|
||||
};
|
||||
|
||||
return this.http.get<any>(`${geturl}`, options);
|
||||
}
|
||||
|
||||
GetTaskDetail(serialnumber:string)
|
||||
GetTask(serialnumber:string): Observable<any>
|
||||
{
|
||||
console.log(serialnumber);
|
||||
return this.tasks.find(t => t.SerialNumber = serialnumber);
|
||||
const geturl = environment.apiURL + 'processes/GetTask';
|
||||
let params = new HttpParams();
|
||||
|
||||
params = params.set("TaskSerialNumber", serialnumber);
|
||||
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
params: params
|
||||
};
|
||||
|
||||
return this.http.get<any>(`${geturl}`, options);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user