Compare commits

...

16 Commits

Author SHA1 Message Date
Gitea Action
fad2e1c0a8 chore: update image tag to 206b4a5 [skip ci] 2026-04-20 04:46:20 +00:00
206b4a5c6a Atualizar src/app/sales/cart-sales/cart-sales.component.ts
All checks were successful
Build (develop) / Promote (main) / build-and-push-deploy (push) Successful in 7m10s
2026-04-20 00:39:07 -04:00
71d0592778 Atualizar src/environments/environment.prod.ts
Some checks failed
Build (develop) / Promote (main) / build-and-push-deploy (push) Has been cancelled
2026-04-20 00:36:45 -04:00
Gitea Action
f059f5cca1 chore: update image tag to bbb5d68 [skip ci] 2026-04-19 20:59:33 +00:00
Luis Eduardo Estevao
bbb5d68af1 feat: implement shopping cart module with order management and discount components
All checks were successful
Build (develop) / Promote (main) / build-and-push-deploy (push) Successful in 6m18s
2026-04-19 17:53:03 -03:00
Gitea Action
4f5e2e5944 chore: update image tag to d76c186 [skip ci] 2026-04-13 20:10:32 +00:00
d76c18614d Atualizar src/app/sales/cart-sales/cart-sales.component.ts
All checks were successful
Build (develop) / Promote (main) / build-and-push-deploy (push) Successful in 12m3s
2026-04-13 15:58:31 -04:00
Gitea Action
9ddfc33514 chore: update image tag to e7bc050 [skip ci] 2026-04-13 19:21:33 +00:00
e7bc050b2e Atualizar src/environments/environment.prod.ts
All checks were successful
Build (develop) / Promote (main) / build-and-push-deploy (push) Successful in 9m1s
2026-04-13 15:12:30 -04:00
Gitea Action
e89895b07b chore: update image tag to c366a55 [skip ci] 2026-04-01 18:19:30 +00:00
Luis Eduardo Estevao
c366a55c15 Merge branch 'main' of https://git.simplifiquehc.com.br/simplifique/Vendaweb-portal
All checks were successful
Build (develop) / Promote (main) / build-and-push-deploy (push) Successful in 10m16s
2026-04-01 15:08:59 -03:00
Luis Eduardo Estevao
afd6b453d7 feat: create dashboard sales layout with responsive navigation and pre-order modal 2026-04-01 15:08:52 -03:00
Gitea Action
eee589174e chore: update image tag to 47945c9 [skip ci] 2026-03-16 18:02:03 +00:00
Luis Eduardo Estevao
47945c9b54 feat: Add discount order component to manage order discounts with authorization logic.
All checks were successful
Build (develop) / Promote (main) / build-and-push-deploy (push) Successful in 13m59s
2026-03-16 14:47:57 -03:00
Gitea Action
1c5652dae6 chore: update image tag to 1f5ab7b [skip ci] 2026-02-24 23:12:32 +00:00
1f5ab7b133 Merge pull request 'fix: update cart sales print viewer urls' (#1) from develop into main
All checks were successful
Build (develop) / Promote (main) / build-and-push-deploy (push) Successful in 5m45s
Reviewed-on: #1
2026-02-24 18:06:47 -05:00
11 changed files with 187 additions and 183 deletions

View File

@@ -7,4 +7,4 @@ spec:
spec:
containers:
- name: portal
image: 172.35.0.216:3000/simplifique/vendaweb-portal:b8cda80
image: 172.35.0.216:3000/simplifique/vendaweb-portal:206b4a5

View File

@@ -1,5 +1,11 @@
<app-header-admin></app-header-admin>
<div class="d-flex flex-column wrapper">
<div class="loading-overlay" *ngIf="(loading$ | async) || (updating$ | async)">
<div class="loading-content">
<kendo-loader type="converging-spinner" themeColor="primary" size="large"></kendo-loader>
<div class="mt-2">Carregando dados do pedido...</div>
</div>
</div>
<div class="container cart-container my-4">
<!-- Primeira Linha -->
<!-- <div class="row mb-3">
@@ -854,7 +860,7 @@
<span *ngIf="!isLoadingPreOrder" class="text-btn-order">Fechar orçamento</span>
</button> -->
<button *ngIf="!isLoadingPreOrder" kendoButton class="btn-order w-100"
<button *ngIf="!isLoadingPreOrder" kendoButton class="btn-pre-order w-100"
(click)="showConfirmation()" [disabled]="isLoadingPreOrder" [icon]="loadingIconOrder">
<span class="text-btn-order">Fechar orçamento</span>
</button>
@@ -933,7 +939,7 @@
message="{{ messageConfirmation }}" textButtonConfirmation="{{ textButtonConfirmation }}"
textButtonCancel="{{ textButtonCancel }}" (resultEvent)="confirmChangePaymentPlan($event)"></app-confirmation>
<app-discount-item-sales *ngIf="showDiscountItem" opened="showDiscountItem" title="{{ titleMessage }}"
<app-discount-item-sales *ngIf="showDiscountItem" opened="showDiscountItem" title="Desconto por Item"
textButtonConfirmation="{{ textButtonConfirmation }}" textButtonCancel="{{ textButtonCancel }}"
[shoppingItem]="itemSelect" (resultEvent)="returnDiscountItem($event)"></app-discount-item-sales>

View File

@@ -991,6 +991,26 @@ kendo-treeview:hover {
}
}
.loading-overlay {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background-color: rgba(255, 255, 255, 0.7);
z-index: 9999;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
.loading-content {
text-align: center;
font-weight: 600;
color: #2d2e83;
}
/* Responsividade para desktops maiores (largura > 1200px) */
@media (min-width: 1200px) {
.card-resume {

View File

@@ -278,7 +278,7 @@ export class CartSalesComponent
) { }
ngOnChanges(changes: SimpleChanges): void {
this.loadShopping();
//this.loadShopping();
}
ngAfterViewInit(): void { }
@@ -326,18 +326,9 @@ export class CartSalesComponent
}
}
loadShopping() {
this.shoppingSubscription = this.shopping$.subscribe((data) => {
this.shopping = data;
if (this.shopping !== null) {
this.totalWeight = data.totpeso;
this.loadFormOrder();
}
});
}
getTaxValue() {
const taxDelivery = JSON.parse(localStorage.getItem('taxDelivery'));
if (!this.formResumeOrder) return 0;
const taxValue = Number.parseFloat(
this.formResumeOrder.get('taxValue').value
);
@@ -345,19 +336,25 @@ export class CartSalesComponent
return taxDelivery != null ? taxDelivery.taxValue : taxValue;
}
loadFormOrder() {
this.subscriptionShopping = this.shopping$.subscribe((data) => {
loadFormOrder(data?: Shopping) {
if (!data && this.shopping) {
data = this.shopping;
}
if (!data) return;
const taxDelivery = JSON.parse(localStorage.getItem('taxDelivery'));
this.formResumeOrder = this.fb.group({
taxValue: [
taxDelivery.taxValue > 0 ? taxDelivery.taxValue.toFixed(2) : '0',
],
discount: [data.vldesconto > 0 ? data.vldesconto.toFixed(2) : '0,00'],
carrierId: [taxDelivery.carrierId],
deliveryTaxId: [taxDelivery.deliveryTaxId],
});
if (this.formResumeOrder) {
this.formResumeOrder.patchValue({
taxValue:
taxDelivery != null && taxDelivery.taxValue > 0
? taxDelivery.taxValue.toFixed(2)
: '0',
discount: data.vldesconto > 0 ? data.vldesconto.toFixed(2) : '0,00',
carrierId: taxDelivery != null ? taxDelivery.carrierId : 0,
deliveryTaxId: taxDelivery != null ? taxDelivery.deliveryTaxId : 0,
});
}
}
ngOnInit(): void {
this.userForm = this.fb.group({
@@ -449,6 +446,7 @@ export class CartSalesComponent
taxValue: new FormControl(this.cartData.taxValue.toFixed(2), []),
discount: new FormControl(this.cartData.discountValue.toFixed(2), []),
carrierId: new FormControl(this.cartData.carrierId, []),
deliveryTaxId: new FormControl(0, []),
});
this.formPayment = this.fb.group({
invoiceStore: new FormControl(null),
@@ -499,7 +497,7 @@ export class CartSalesComponent
this.shopping = data;
if (this.shopping !== null) {
this.totalWeight = data.totpeso;
this.loadFormOrder();
this.loadFormOrder(data);
}
});
@@ -1432,10 +1430,10 @@ export class CartSalesComponent
let carrierId = 0;
if (taxValue >= 0) {
deliveryTaxId = Number.parseFloat(
this.formResumeOrder.get('deliveryTaxId').value
this.formResumeOrder.get('deliveryTaxId') ? this.formResumeOrder.get('deliveryTaxId').value : 0
);
carrierId = Number.parseFloat(
this.formResumeOrder.get('carrierId').value
this.formResumeOrder.get('carrierId') ? this.formResumeOrder.get('carrierId').value : 0
);
}
const order: OrderDeliveryTax = {
@@ -1446,7 +1444,6 @@ export class CartSalesComponent
};
localStorage.setItem('taxDelivery', JSON.stringify(order));
this.loadFormOrder();
this.loadShopping();
/* this.store.dispatch(new UpdateDeliveryTaxAction(order));
this.updating$.subscribe((update) => {
@@ -2146,10 +2143,10 @@ export class CartSalesComponent
);
let percentOrder = (discountValue / orderValue) * 100;
console.log('Percentual do pedido: ' + percentOrder);
if (this.percentSeller < percentOrder) {
this.openedAuthUser = true;
return;
}
// if (this.percentSeller < percentOrder) {
// this.openedAuthUser = true;
// return;
// }
if (discountValue <= 0.01) {
percentOrder = 0;
}
@@ -2159,8 +2156,9 @@ export class CartSalesComponent
idUserAuth: this.authService.getUser(),
};
this.store.dispatch(new ApplyDiscountOrderAction(order));
this.store.dispatch(new LoadShoppingAction(this.shoppingService.getCart()));
// this.store.dispatch(new LoadShoppingAction(this.shoppingService.getCart())); // Reloader moved to Effect
this.loadFormOrder();
this.calculateTaxDelivery(true);
}
applyDiscountOrder() {
@@ -2249,6 +2247,7 @@ export class CartSalesComponent
this.showInformation = true;
return;
}
this.loadFormOrder();
}
calcDiscountOrderValue() {
@@ -2591,6 +2590,7 @@ export class CartSalesComponent
priorityDelivery: priorityDelivery,
};
console.log('dataDeliveryTax', JSON.stringify(dataDeliveryTax));
this.shoppingService.calculateDeliveryTax(dataDeliveryTax).subscribe(
(result) => {
this.dataDeliveryTax = result;

View File

@@ -3,7 +3,7 @@ import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
import { Store } from '@ngrx/store';
import { ActionsLayout } from '@progress/kendo-angular-dialog';
import { Observable, Subscription } from 'rxjs';
import { map } from 'rxjs/operators';
import { catchError, map } from 'rxjs/operators';
import { AuthService } from 'src/app/auth/services/auth.service';
import { ResultApi } from 'src/app/models/result-api.model';
import { UserAuth } from 'src/app/models/user-auth.model';
@@ -107,30 +107,28 @@ export class DiscountItemSalesComponent implements OnInit {
async confirmDiscount() {
let discount = Number.parseFloat(this.formDiscountItem.get('discount').value);
console.log('discount', discount);
const discountValue = Number.parseFloat(this.formDiscountItem.get('discountValue').value);
const salePrice = Number.parseFloat((this.shoppingItem.listPrice - discountValue).toFixed(2));
if (this.percentSeller < discount) {
this.openedAuthUser = true;
return;
}
// if (this.percentSeller < discount) {
// this.openedAuthUser = true;
// return;
// }
if (discountValue <= 0.01) {
discount = 0;
}
this.shoppingItem.discount = discount;
this.shoppingItem.discountValue = discountValue;
this.shoppingItem.price = salePrice;
this.shoppingItem.userDiscount = this.authService.getUser();
this.store.dispatch(new UpdatePriceItemAction(this.shoppingItem));
this.updating$.pipe(
map((updating) => {
if (!updating) {
console.log('shoppingItem', JSON.stringify(this.shoppingItem));
const updateItem = { ...this.shoppingItem };
updateItem.discount = discount;
updateItem.discountValue = discountValue;
updateItem.price = salePrice;
updateItem.userDiscount = this.authService.getUser();
this.store.dispatch(new UpdatePriceItemAction(updateItem));
this.resultEvent.emit(true);
}
})
);
}
async returnAuthUser(userAuth: any) {
this.openedAuthUser = false;
@@ -149,13 +147,7 @@ export class DiscountItemSalesComponent implements OnInit {
updateItem.price = salePrice;
updateItem.userDiscount = userAuth.id;
this.store.dispatch(new UpdatePriceItemAction(updateItem));
this.updating$.subscribe(
(updating) => {
if (!updating) {
this.resultEvent.emit(true);
}
}
);
} else {
console.log('Não localizou o id.');
}

View File

@@ -1,35 +1,24 @@
<div class="container-fluid">
<form class="k-form" [formGroup]="formDiscount">
<fieldset>
<legend>Dados do pedido</legend>
<legend>Dados do pedido xxx</legend>
<label class="k-form-field">
<span>Valor dos produtos</span>
<kendo-numerictextbox
[spinners]="false"
[readonly]="true"
[value]="orderValue"
formControlName="value"
>
<kendo-numerictextbox [spinners]="false" [readonly]="true" [value]="orderValue" formControlName="value">
</kendo-numerictextbox>
</label>
<div class="">
<label class="k-form-field">
<span>% Desconto desejado</span>
<kendo-numerictextbox
formControlName="discount"
[spinners]="false"
>
<kendo-numerictextbox formControlName="discount" [spinners]="false">
<kendo-formerror>Error: Percentual acima do permitido para o usuário.</kendo-formerror>
</kendo-numerictextbox>
</label>
<label class="k-form-field">
<span>Valor do desconto</span>
<kendo-numerictextbox
formControlName="discountValue"
[spinners]="false"
>
<kendo-numerictextbox formControlName="discountValue" [spinners]="false">
<kendo-formerror>Error: Percentual acima do permitido para o usuário.</kendo-formerror>
</kendo-numerictextbox>
</label>
@@ -37,12 +26,8 @@
<label class="k-form-field">
<span>Valor do pedido com desconto</span>
<kendo-numerictextbox
formcontrolName="valueWithDiscount"
[spinners]="false"
[readonly]="true"
[value]="orderWithDiscount"
>
<kendo-numerictextbox formcontrolName="valueWithDiscount" [spinners]="false" [readonly]="true"
[value]="orderWithDiscount">
</kendo-numerictextbox>
</label>
@@ -60,12 +45,7 @@
<fieldset>
<kendo-formfield>
<kendo-label [for]="email" text="Email"></kendo-label>
<kendo-textbox
formControlName="email"
[clearButton]="true"
#email
required
></kendo-textbox>
<kendo-textbox formControlName="email" [clearButton]="true" #email required></kendo-textbox>
<!--kendo-formerror *ngIf="formDiscount.controls.formUser.email.errors?.required"
>Erro: Email é obrigatório</kendo-formerror
@@ -77,13 +57,7 @@
<kendo-formfield class="mt-2">
<kendo-label [for]="password" text="Senha"></kendo-label>
<input
kendoTextBox
type="password"
placeholder="Password"
#password
formControlName="password"
/>
<input kendoTextBox type="password" placeholder="Password" #password formControlName="password" />
<kendo-formerror>Error: Password is required</kendo-formerror>
</kendo-formfield>
@@ -92,7 +66,8 @@
<div class="k-actions k-actions-end">
<button type="button" [disabled]="!formDiscount.valid" class="k-button" (click)="closeMsgDiscount()">Cancel</button>
<button type="button" [disabled]="!formDiscount.valid" class="k-button"
(click)="closeMsgDiscount()">Cancel</button>
<button type="button" class="k-button k-primary" (click)="confirmDiscount()">Submit</button>
</div>

View File

@@ -43,13 +43,13 @@ export class DiscountOrderComponent implements OnInit, OnDestroy {
discountValue: [(this.orderValue - this.orderWithDiscount),
Validators.compose([Validators.required])],
valueWithDiscount: [this.orderWithDiscount, [Validators.required]],
formUser: this.formBuilder.group({
email: new FormControl(null, Validators.required),
password: new FormControl(null, Validators.required),
}),
formGroup: this.formBuilder.group({
userAuth: new FormControl(null, Validators.required),
}),
// formUser: this.formBuilder.group({
// email: new FormControl(null, Validators.required),
// password: new FormControl(null, Validators.required),
// }),
// formGroup: this.formBuilder.group({
// userAuth: new FormControl(null, Validators.required),
// }),
});
this.formDiscount.valueChanges.subscribe(f => {
this.percent = this.formDiscount.get('discount').value;
@@ -84,18 +84,16 @@ export class DiscountOrderComponent implements OnInit, OnDestroy {
}
confirmDiscount() {
const domain = '@jurunense.com.br';
this.submitForm.emit(this.formDiscount);
return;
let email = this.formDiscount.get('formUser.email').value;
// Remover domínio se já estiver presente
if (email.toLowerCase().endsWith(domain)) {
email = email.substring(0, email.length - domain.length);
}
const emailUpperCase = (email + domain).toUpperCase();
const emailUpperCase = email.toUpperCase();
const passwordUpperCase = this.formDiscount.get('formUser.password').value.toUpperCase();
if (this.discountAuthorization < this.percent) {
// if (this.discountAuthorization < this.percent) {
if (this.formDiscount.controls.formGroup.get('userAuth').value) {
this.SubscriptionAuth = this.authService.authenticate({
email: emailUpperCase,
@@ -126,42 +124,42 @@ export class DiscountOrderComponent implements OnInit, OnDestroy {
}
} else {
this.close();
}
// } else {
// this.close();
// }
}
getAuthorization() {
return this.formDiscount.controls.formGroup.get('userAuth').value;
return false; //this.formDiscount.controls.formGroup.get('userAuth').value;
}
validationUser() {
this.formDiscount.markAllAsTouched();
if (this.formDiscount.valid) {
// this.loadingIcon = 'loading';
this.authService.authenticate({
email: this.formDiscount.get('formUser.email').value,
password: this.formDiscount.get('formUser.password').value
})
.subscribe((res: ResultApi) => {
console.log(res);
if (res.success) {
this.discountAuthorization = res.data.discountPercent;
return this.discountAuthorization;
// this.loadingIcon = '';
} else {
// this.loadingIcon = '';
// this.showErrorMessage(res.message);
return this.discountAuthorization;
}
}, err => {
return this.discountAuthorization;
// this.loadingIcon = '';
// this.showErrorMessage('Erro ao processar sua requisição,
// tente novamente e caso persista o erro contacte o departamento de TI.');
});
return this.discountAuthorization;
}
// if (this.formDiscount.valid) {
// // this.loadingIcon = 'loading';
// this.authService.authenticate({
// email: this.formDiscount.get('formUser.email').value,
// password: this.formDiscount.get('formUser.password').value
// })
// .subscribe((res: ResultApi) => {
// console.log(res);
// if (res.success) {
// this.discountAuthorization = res.data.discountPercent;
// return this.discountAuthorization;
// // this.loadingIcon = '';
// } else {
// // this.loadingIcon = '';
// // this.showErrorMessage(res.message);
// return this.discountAuthorization;
// }
// }, err => {
// return this.discountAuthorization;
// // this.loadingIcon = '';
// // this.showErrorMessage('Erro ao processar sua requisição,
// // tente novamente e caso persista o erro contacte o departamento de TI.');
// });
// return this.discountAuthorization;
// }
}
}

View File

@@ -40,8 +40,8 @@
</button>
<div *ngIf="isMobileMenuOpen" class="mobile-menu-items shadow-sm">
<button class="dropdown-item w-100" (click)="openNewOrder()">Novo pedido</button>
<button class="dropdown-item w-100" (click)="openDashTodaysale()">Dashboard Venda dia</button>
<button class="dropdown-item w-100" (click)="openDashSeller()">Dashboard Vendedor</button>
<!-- <button class="dropdown-item w-100" (click)="openDashTodaysale()">Dashboard Venda dia</button>
<button class="dropdown-item w-100" (click)="openDashSeller()">Dashboard Vendedor</button>-->
<button class="dropdown-item w-100" (click)="openOrders()">Pedidos de venda</button>
<button class="dropdown-item w-100" (click)="openProductOrder()">Produtos Vendidos</button>
<button class="dropdown-item w-100" (click)="openClose(true)">Orçamentos pendentes</button>

View File

@@ -38,7 +38,8 @@
</div>
<div class="col-md-6 col-sm-12 mt-3 mt-md-0">
<label>
<span class="d-block">CPF / CNPJ</span>
<span class="d-block">CPF / CNPJ ou</span>
<span class="d-block">Código do Cliente</span>
<kendo-textbox formControlName="document" placeholder="Informe o CPF ou CNPJ do cliente"></kendo-textbox>
</label>
</div>

View File

@@ -98,7 +98,10 @@ export class ShoppingEffects {
mergeMap(
(data) => this.shoppingService.updatePriceItemShopping(data.payload)
.pipe(
map(() => new UpdatePriceItemSuccessAction(data.payload)),
mergeMap(() => [
new UpdatePriceItemSuccessAction(data.payload),
new LoadShoppingAction(data.payload.idCart)
]),
catchError(error => of(new UpdatePriceItemFailureAction(error)))
)
)
@@ -110,7 +113,10 @@ export class ShoppingEffects {
mergeMap(
(data) => this.shoppingService.applyDiscountOrder(data.payload)
.pipe(
map((items) => new ApplyDiscountOrderSuccessAction(items)),
mergeMap((items) => [
new ApplyDiscountOrderSuccessAction(items),
new LoadShoppingAction(data.payload.id)
]),
catchError(error => of(new ApplyDiscountOrderFailureAction(error)))
)
)
@@ -122,7 +128,10 @@ export class ShoppingEffects {
mergeMap(
(data) => this.shoppingService.updateQuantityItemShopping(data.payload)
.pipe(
map(() => new UpdateQuantityItemSuccessAction(data.payload)),
mergeMap(() => [
new UpdateQuantityItemSuccessAction(data.payload),
new LoadShoppingAction(data.payload.idCart)
]),
catchError(error => of(new UpdateQuantityItemFailureAction(error)))
)
)
@@ -134,7 +143,10 @@ export class ShoppingEffects {
mergeMap(
(data) => this.shoppingService.deleteItemShopping(data.payload)
.pipe(
map((result) => new DeleteItemSuccessAction(result)),
mergeMap((result) => [
new DeleteItemSuccessAction(result),
new LoadShoppingAction(localStorage.getItem('cart'))
]),
catchError(error => of(new DeleteItemFailureAction(error)))
)
)

View File

@@ -1,6 +1,6 @@
export const environment = {
production: true,
// url: 'http://10.1.1.124:8065/api/v1/',
// url: 'http://172.35.0.217:32619/api/v1/',
url: 'https://api.vendaweb.simplifiquehc.com.br/api/v1/',
// url: 'http://vendaweb.jurunense.com.br/api/v1/',
URL_PIX: 'http://10.1.1.205:8078/api/v1/',