Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions frontend/main/src/app/carriers/carriers.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,22 @@
<th>Taxa</th>
<th>E-mail</th>
<th>Cnpj</th>
<th>Ação</th>


</thead>
<tbody>
<tr *ngFor="let carrier of carriers;let i = index;">

<td>{{i}}</td>
<td>{{i+1}}</td>
<td>{{carrier.razao}}</td>
<td>{{carrier.taxa}}</td>
<td>{{carrier.email}}</td>
<td>{{carrier.cnpj}}</td>

<td>
<button class="btn btn-danger mr-2" (click)="deletar()">Deletar</button>
<button class="btn btn-primary mr-2" (click)="alterar()">Alterar</button>
</td>

</tr>
</tbody>
Expand Down
9 changes: 9 additions & 0 deletions frontend/main/src/app/carriers/carriers.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,13 @@ export class CarriersComponent implements OnInit {
this.carriers.push({razao:this.razao, taxa:this.taxa, email:this.email, cnpj:this.cnpj});
}

deletar(){


}

alterar(){

}

}
15 changes: 14 additions & 1 deletion frontend/main/src/app/quote.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@ export class QuoteService {

apiURL:string = 'http://localhost:8080/ship'
apiURL2:string = 'http://localhost:8080/quote'

apiURL3:string = 'http://localhost:8080/'

APIBouncePut:string = "http://localhost:8080/user/disbounce/"
newBounce!:any


constructor(private router: Router, private http: HttpClient, private login:LoginserviceService) { }

quote(cepOrigem:string, cepDestino:string):any{
Expand Down Expand Up @@ -58,7 +62,7 @@ export class QuoteService {
this.http.post(this.APIBouncePut+this.login.idBounce, this.newBounce)
//FIM DO BOUNCE

return this.http.get(this.apiURL)
return this.http.get(this.apiURL2+`/recent`)

}

Expand Down Expand Up @@ -92,6 +96,15 @@ export class QuoteService {

}

regPackage(object:any){
this.http.post(this.apiURL3+'/register',object)
.subscribe((response)=>{


console.log(response);



})
}
}
26 changes: 15 additions & 11 deletions frontend/main/src/app/rct-qt/rct-qt.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,27 @@
<th>ID</th>
<th>Preço do frete</th>
<th>Prazo</th>
<th>Transportadora</th>
<th>Origem</th>
<th>Destino</th>
<th>Transportadora</th>
<th>Peso cubado</th>
<th>Usuário</th>

</thead>
<tbody>
<!-- <tr *ngFor="let recQuote of recQuotes;let i = index;">
<td class="align-items-center"><button class="btn btn-primary" (click)="regPackage(this.quote.precoFrete, this.quote.tempo, this.quote.start_adress, this.quote.end_address, this.quote.carrierID, this.quote.cubagem, this.quote.pessoaID )">Save</button></td>
<td>{{i}}</td>
<td>R${{quote.precoFrete}}</td>
<td>{{quote.tempo}} dias úteis</td>
<td>{{quote.start_adress}}</td>
<td>{{quote.end_address}}</td>
<td>{{quote.carrier}}</td>
<td>{{quote.cubagem}} kg</td>
<tr *ngFor="let recQuote of recQuotes;let i = index;">
<td class="align-items-center"><button class="btn btn-primary" >Criar pacote</button></td>
<td>{{id}}</td>
<td>R${{recQuote.price}}</td>
<td>{{recQuote.await}} dias úteis</td>
<td>{{recQuote.razaoTransportadora}}</td>
<td>{{recQuote.origin}}</td>
<td>{{recQuote.destiny}}</td>
<td>{{recQuote.cub_height}} kg</td>
<td>{{recQuote.nomePessoa}} kg</td>



</tr>-->
</tr>
</tbody>
</table>
46 changes: 42 additions & 4 deletions frontend/main/src/app/rct-qt/rct-qt.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,62 @@ import { QuoteService } from '../quote.service';
})
export class RctQtComponent implements OnInit {



recQuotes!: Array<any>
id!: number
price!: number
await!: number
origin!: string
destiny!: string
carrier_id!: number
cub_height!: number
pessoa_id!: number
nomePessoa!: string
razaoTransportadora!: string


constructor(public quoteService: QuoteService, private router: Router, private http: HttpClient) { }

ngOnInit(): void {

this.quoteService.recQuote().pipe().subscribe((response: any) => {
this.quoteService.recQuote().pipe().subscribe((response: any) => {

var count = Object.keys(response).length;

for (let i = 0; i < count; i++) {


this.id = response[i].id
this.price = response[i].price
this.await = response[i].await
this.origin = response[i].origin
this.destiny = response[i].destiny
this.cub_height = response[i].cub_height



}

})
})
}


regPackage(price: number, time: number, origin: string, destiny: string, carrier_id: number, cub_height: number, pessoa_id: number) {

let build = {
"price": price,
"time": time,
"origin": origin,
"destiny": destiny,
"carrier_id": carrier_id,
"cub_height": cub_height,
"pessoa_id": pessoa_id
}

this.quoteService.regPackage(build)




}

}
3 changes: 2 additions & 1 deletion frontend/main/src/app/users/users.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@
<th>E-mail</th>
<th>CPF</th>
<th>Data nascimento</th>
<th>Ação</th>
</thead>
<tbody>
<tr *ngFor="let user of users;let i = index;">
<td>{{i}}</td>
<td>{{i+1}}</td>
<td>{{user.name}}</td>
<td>{{user.email}}</td>
<td>{{user.document}}</td>
Expand Down
1 change: 1 addition & 0 deletions frontend/main/src/app/users/users.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ birth!:string
this.email = response[i].email;
this.document = response[i].document;
this.birth = response[i].birth;


this.users.push({name:this.name, email:this.email, document:this.document, birth:this.birth});

Expand Down