oxpi-nglib 1.0.70 → 1.0.71

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -234,6 +234,10 @@ class CommonWebService {
234
234
  const url = this.PRODUTO_BASE_URL + CommonWebService.URL_PART_NEXT_ID;
235
235
  return this.http.get(url, this.getHttpOptions()).pipe(map(data => data));
236
236
  }
237
+ getProdutoHistory(id) {
238
+ const url = this.PRODUTO_BASE_URL + 'GetHistory/' + id;
239
+ return this.http.get(url, this.getHttpOptions()).pipe(map(data => data));
240
+ }
237
241
  findProduto(produtoId) {
238
242
  const url = this.PRODUTO_BASE_URL + produtoId;
239
243
  return this.http.get(url, this.getHttpOptions()).pipe(map(data => data));
@@ -1450,6 +1454,8 @@ function createProduct() {
1450
1454
  adicionalDeProdutoId: null,
1451
1455
  produtoVerificaoGrupoId: null,
1452
1456
  produtoVerificaoGrupoNome: null,
1457
+ startTime: undefined,
1458
+ endTime: undefined
1453
1459
  };
1454
1460
  }
1455
1461
  ;
@@ -3027,10 +3033,10 @@ class ProdutoEditDialogComponent {
3027
3033
  }
3028
3034
  }
3029
3035
  ProdutoEditDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoEditDialogComponent, deps: [{ token: CommonWebService }, { token: NotificationService }, { token: MAT_DIALOG_DATA }, { token: i3.MatDialog }, { token: i0.ElementRef }, { token: i3.MatDialogRef }, { token: ScreenHelperService }], target: i0.ɵɵFactoryTarget.Component });
3030
- ProdutoEditDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: ProdutoEditDialogComponent, selector: "ox-produto-edit-dialog", ngImport: i0, template: "<div class=\"ox-header\">\n <h2 class=\"titulo\">Editando Produto</h2>\n <button mat-icon-button [mat-dialog-close]>\n <mat-icon>close</mat-icon>\n </button>\n</div>\n<div class=\"dialog-content\">\n <ox-produto-form [model]=\"model\" [editMode]=\"true\" *ngIf=\"model\"></ox-produto-form>\n</div>\n<div class=\"dialog-footer\">\n <button mat-button color=\"primary\" (click)=\"salvar()\" tabindex=\"9\">SALVAR</button>\n <button mat-button [mat-dialog-close]>VOLTAR</button>\n</div>\n<ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>", styles: [":host{background:#fafafa;display:flex;flex-direction:column;height:100%;max-height:99vh}\n"], dependencies: [{ kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i6$2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i7$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i3.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "component", type: BusyIndicatorComponent, selector: "ox-busy-indicator", inputs: ["isBusy"] }, { kind: "component", type: ProdutoFormComponent, selector: "ox-produto-form", inputs: ["editMode", "model"], outputs: ["nextIdClick"] }] });
3036
+ ProdutoEditDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: ProdutoEditDialogComponent, selector: "ox-produto-edit-dialog", ngImport: i0, template: "<div class=\"ox-header\">\n <h2 class=\"titulo\">Editando Produto</h2>\n <button mat-icon-button [mat-dialog-close]>\n <mat-icon>close</mat-icon>\n </button>\n</div>\n<div class=\"dialog-content\">\n <ox-produto-form [model]=\"model\" [editMode]=\"true\" *ngIf=\"model\"></ox-produto-form>\n</div>\n<div class=\"dialog-footer\">\n <button *ngIf=\"model?.isHistorico !== true\" mat-button color=\"primary\" (click)=\"salvar()\" tabindex=\"9\">SALVAR</button>\n <button mat-button [mat-dialog-close]>VOLTAR</button>\n</div>\n<ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>", styles: [":host{background:#fafafa;display:flex;flex-direction:column;height:100%;max-height:99vh}\n"], dependencies: [{ kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i6$2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i7$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i3.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "component", type: BusyIndicatorComponent, selector: "ox-busy-indicator", inputs: ["isBusy"] }, { kind: "component", type: ProdutoFormComponent, selector: "ox-produto-form", inputs: ["editMode", "model"], outputs: ["nextIdClick"] }] });
3031
3037
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoEditDialogComponent, decorators: [{
3032
3038
  type: Component,
3033
- args: [{ selector: 'ox-produto-edit-dialog', template: "<div class=\"ox-header\">\n <h2 class=\"titulo\">Editando Produto</h2>\n <button mat-icon-button [mat-dialog-close]>\n <mat-icon>close</mat-icon>\n </button>\n</div>\n<div class=\"dialog-content\">\n <ox-produto-form [model]=\"model\" [editMode]=\"true\" *ngIf=\"model\"></ox-produto-form>\n</div>\n<div class=\"dialog-footer\">\n <button mat-button color=\"primary\" (click)=\"salvar()\" tabindex=\"9\">SALVAR</button>\n <button mat-button [mat-dialog-close]>VOLTAR</button>\n</div>\n<ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>", styles: [":host{background:#fafafa;display:flex;flex-direction:column;height:100%;max-height:99vh}\n"] }]
3039
+ args: [{ selector: 'ox-produto-edit-dialog', template: "<div class=\"ox-header\">\n <h2 class=\"titulo\">Editando Produto</h2>\n <button mat-icon-button [mat-dialog-close]>\n <mat-icon>close</mat-icon>\n </button>\n</div>\n<div class=\"dialog-content\">\n <ox-produto-form [model]=\"model\" [editMode]=\"true\" *ngIf=\"model\"></ox-produto-form>\n</div>\n<div class=\"dialog-footer\">\n <button *ngIf=\"model?.isHistorico !== true\" mat-button color=\"primary\" (click)=\"salvar()\" tabindex=\"9\">SALVAR</button>\n <button mat-button [mat-dialog-close]>VOLTAR</button>\n</div>\n<ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>", styles: [":host{background:#fafafa;display:flex;flex-direction:column;height:100%;max-height:99vh}\n"] }]
3034
3040
  }], ctorParameters: function () {
3035
3041
  return [{ type: CommonWebService }, { type: NotificationService }, { type: undefined, decorators: [{
3036
3042
  type: Inject,
@@ -5337,6 +5343,73 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImpor
5337
5343
  }]
5338
5344
  }], ctorParameters: function () { return [{ type: i1$2.DomSanitizer }]; } });
5339
5345
 
5346
+ class ProdutosHistoryComponent {
5347
+ constructor(ws, notification, dataDialog, dialog, elRef, dialogRef, screenHelper) {
5348
+ this.ws = ws;
5349
+ this.notification = notification;
5350
+ this.dataDialog = dataDialog;
5351
+ this.dialog = dialog;
5352
+ this.elRef = elRef;
5353
+ this.dialogRef = dialogRef;
5354
+ this.screenHelper = screenHelper;
5355
+ this.items = [];
5356
+ this.isBusy = false;
5357
+ this.model = dataDialog;
5358
+ }
5359
+ ngOnInit() {
5360
+ this.atualiza();
5361
+ }
5362
+ atualiza() {
5363
+ this.isBusy = true;
5364
+ this.ws.getProdutoHistory(this.model.id)
5365
+ .subscribe({
5366
+ next: r => {
5367
+ for (const p of r) {
5368
+ p.isHistorico = true;
5369
+ }
5370
+ this.items = r;
5371
+ console.info(r);
5372
+ this.isBusy = false;
5373
+ }, error: err => {
5374
+ this.isBusy = false;
5375
+ this.notification.showHttpError(err);
5376
+ }
5377
+ });
5378
+ }
5379
+ abreCadastro(item) {
5380
+ let height = undefined;
5381
+ let width = 550 + 'px';
5382
+ if (this.mobile) {
5383
+ width = (window.innerWidth * 0.99) + 'px';
5384
+ height = (window.innerHeight * 0.99) + 'px';
5385
+ }
5386
+ const dialog = this.dialog.open(ProdutoEditDialogComponent, {
5387
+ data: item,
5388
+ width: width,
5389
+ height: height,
5390
+ maxWidth: '100%',
5391
+ panelClass: 'dialog-p0',
5392
+ });
5393
+ dialog.afterClosed().subscribe(result => {
5394
+ if (result !== true)
5395
+ return;
5396
+ this.notification.showMsg("Salvo com sucesso.");
5397
+ this.atualiza();
5398
+ });
5399
+ }
5400
+ }
5401
+ ProdutosHistoryComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutosHistoryComponent, deps: [{ token: CommonWebService }, { token: NotificationService }, { token: MAT_DIALOG_DATA }, { token: i3.MatDialog }, { token: i0.ElementRef }, { token: i3.MatDialogRef }, { token: ScreenHelperService }], target: i0.ɵɵFactoryTarget.Component });
5402
+ ProdutosHistoryComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: ProdutosHistoryComponent, selector: "lib-produtos-history", ngImport: i0, template: "<div class=\"ox-header\">\n <h2 class=\"titulo\">Hist\u00F3rico do Produto '{{model.id}}'</h2>\n <button mat-icon-button [mat-dialog-close]>\n <mat-icon>close</mat-icon>\n </button>\n</div>\n<div class=\"result-container\" *ngIf=\"items\">\n <div class=\"reservas-container\">\n <h4 *ngIf=\"items.length === 0\" class=\"nenhum-item-msg\">Nenhum registro para ser exibido</h4>\n <div (click)=\"abreCadastro(item)\" class=\"historico-item\" *ngFor=\"let item of items\">\n <div class=\"historico-icon\">\n <i class=\"material-icons\">history</i>\n </div>\n <div class=\"historico-content\">\n <p class=\"historico-date\">{{ item.startTime | date:'EEE dd/MM/yy HH:mm' }} - {{ item.endTime | date:'EEE dd/MM/yy HH:mm' }}</p>\n <p class=\"historico-user\">{{ item.usuarioLogin }}</p>\n <p class=\"historico-modulo\">{{ item.modulo }}</p>\n </div>\n </div>\n </div>\n</div>", styles: [":host{background:#fafafa;display:flex;flex-direction:column;height:100%;max-height:99vh;position:relative}.reservas-container{display:flex;flex-direction:column}.historico-item{display:flex;align-items:center;padding:10px;border-bottom:1px solid #ccc;font-family:Open Sans,sans-serif;background-color:#fff;cursor:pointer}.historico-item:hover{background-color:var(--item-card-selected-bg)}.historico-icon{font-size:24px;color:#39b7ab;margin-right:32px}.historico-content{flex:1;display:flex;flex-direction:column;gap:4px}.historico-date{margin:0;font-weight:500}.historico-user{margin:0;color:purple}.historico-modulo{margin:0;font-style:italic;color:#666;font-size:small}\n"], dependencies: [{ kind: "directive", type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i6$2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i7$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i3.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "pipe", type: i6.DatePipe, name: "date" }] });
5403
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutosHistoryComponent, decorators: [{
5404
+ type: Component,
5405
+ args: [{ selector: 'lib-produtos-history', template: "<div class=\"ox-header\">\n <h2 class=\"titulo\">Hist\u00F3rico do Produto '{{model.id}}'</h2>\n <button mat-icon-button [mat-dialog-close]>\n <mat-icon>close</mat-icon>\n </button>\n</div>\n<div class=\"result-container\" *ngIf=\"items\">\n <div class=\"reservas-container\">\n <h4 *ngIf=\"items.length === 0\" class=\"nenhum-item-msg\">Nenhum registro para ser exibido</h4>\n <div (click)=\"abreCadastro(item)\" class=\"historico-item\" *ngFor=\"let item of items\">\n <div class=\"historico-icon\">\n <i class=\"material-icons\">history</i>\n </div>\n <div class=\"historico-content\">\n <p class=\"historico-date\">{{ item.startTime | date:'EEE dd/MM/yy HH:mm' }} - {{ item.endTime | date:'EEE dd/MM/yy HH:mm' }}</p>\n <p class=\"historico-user\">{{ item.usuarioLogin }}</p>\n <p class=\"historico-modulo\">{{ item.modulo }}</p>\n </div>\n </div>\n </div>\n</div>", styles: [":host{background:#fafafa;display:flex;flex-direction:column;height:100%;max-height:99vh;position:relative}.reservas-container{display:flex;flex-direction:column}.historico-item{display:flex;align-items:center;padding:10px;border-bottom:1px solid #ccc;font-family:Open Sans,sans-serif;background-color:#fff;cursor:pointer}.historico-item:hover{background-color:var(--item-card-selected-bg)}.historico-icon{font-size:24px;color:#39b7ab;margin-right:32px}.historico-content{flex:1;display:flex;flex-direction:column;gap:4px}.historico-date{margin:0;font-weight:500}.historico-user{margin:0;color:purple}.historico-modulo{margin:0;font-style:italic;color:#666;font-size:small}\n"] }]
5406
+ }], ctorParameters: function () {
5407
+ return [{ type: CommonWebService }, { type: NotificationService }, { type: undefined, decorators: [{
5408
+ type: Inject,
5409
+ args: [MAT_DIALOG_DATA]
5410
+ }] }, { type: i3.MatDialog }, { type: i0.ElementRef }, { type: i3.MatDialogRef }, { type: ScreenHelperService }];
5411
+ } });
5412
+
5340
5413
  Array.prototype.remove = function (item) {
5341
5414
  const index = this.indexOf(item);
5342
5415
  if (index === -1)
@@ -5407,7 +5480,8 @@ OxpiNglibModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version
5407
5480
  FornecedoresComponent,
5408
5481
  FornecedoresAddDialogComponent,
5409
5482
  FornecedoresEditDialogComponent,
5410
- SelecaoFornecedorDialogComponent], imports: [BrowserModule,
5483
+ SelecaoFornecedorDialogComponent,
5484
+ ProdutosHistoryComponent], imports: [BrowserModule,
5411
5485
  BrowserAnimationsModule,
5412
5486
  FormsModule,
5413
5487
  MatButtonModule,
@@ -5487,7 +5561,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImpor
5487
5561
  FornecedoresComponent,
5488
5562
  FornecedoresAddDialogComponent,
5489
5563
  FornecedoresEditDialogComponent,
5490
- SelecaoFornecedorDialogComponent
5564
+ SelecaoFornecedorDialogComponent,
5565
+ ProdutosHistoryComponent
5491
5566
  ],
5492
5567
  imports: [
5493
5568
  BrowserModule,