Compare commits

..

2 Commits

Author SHA1 Message Date
Luis Eduardo Estevao
806ac42eae feat: add cart sales component with Kendo UI grid for displaying shopping items.
All checks were successful
Build (develop) / Promote (main) / build-and-push-deploy (push) Successful in 7m25s
2026-02-10 11:09:26 -03:00
Luis Eduardo Estevao
461b3b01f7 feat: implement cart sales component for managing shopping items, customer details, and order processing. 2026-02-10 11:09:10 -03:00
3 changed files with 322 additions and 1025 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -79,8 +79,7 @@ export interface JsonModel {
],
})
export class CartSalesComponent
implements OnInit, AfterViewInit, OnDestroy, OnChanges
{
implements OnInit, AfterViewInit, OnDestroy, OnChanges {
public containerRef: ViewContainerRef;
public resultQuestion;
@@ -275,13 +274,13 @@ export class CartSalesComponent
private readonly messageService: MessageService,
private readonly productService: ProductService,
private readonly customerService: CustomerService
) {}
) { }
ngOnChanges(changes: SimpleChanges): void {
this.loadShopping();
}
ngAfterViewInit(): void {}
ngAfterViewInit(): void { }
ngOnDestroy(): void {
if (this.shoppingSubscription) {
@@ -1579,6 +1578,40 @@ export class CartSalesComponent
}
}
public updateCart(
cartId: string,
customerId: number,
addressId: number,
saleStoreId: string,
paymentPlanId: number,
billingId: string
) {
this.shoppingService.getShopping(cartId).subscribe((shopping) => {
if (shopping) {
shopping.codcli = customerId;
shopping.codendentcli = addressId;
shopping.saleStore = saleStoreId;
shopping.codplpag = paymentPlanId;
shopping.codcob = billingId;
this.shoppingService.updateShopping(shopping).subscribe(
(response) => {
console.log('Cart updated successfully:', response);
this.store.dispatch(
new LoadShoppingAction(this.shoppingService.getCart())
);
this.loadFormOrder();
},
(error) => {
console.error('Error updating cart:', error);
}
);
} else {
console.error('Shopping cart not found for ID:', cartId);
}
});
}
showDialogSelectAddress() {
if (this.customer == null) {
this.titleInformation = 'Selecionar endereço de entrega';
@@ -1654,8 +1687,7 @@ export class CartSalesComponent
this.informationDelivery = `Pedido com data de entrega para o dia
${dataTexto}
- Tipo de entrega: ${
dataDelivery.scheduleDelivery ? 'PROGRAMADA' : 'NORMAL'
- Tipo de entrega: ${dataDelivery.scheduleDelivery ? 'PROGRAMADA' : 'NORMAL'
}`;
}

View File

@@ -16,5 +16,6 @@ export class Shopping {
public totpeso: number;
public codfornecfrete: number;
public codtabelafrete: number;
public saleStore: string;
}