oxpi-nglib 1.0.0 → 1.0.3
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.
- package/esm2020/lib/cadastros/funcionarios/funcionario-add-dialog/funcionario-add-dialog.component.mjs +74 -0
- package/esm2020/lib/cadastros/funcionarios/funcionario-edit-dialog/funcionario-edit-dialog.component.mjs +68 -0
- package/esm2020/lib/cadastros/funcionarios/funcionario-form/funcionario-form.component.mjs +38 -0
- package/esm2020/lib/cadastros/funcionarios/funcionarios/funcionarios.component.mjs +157 -0
- package/esm2020/lib/cadastros/produtos/produto-add-dialog/produto-add-dialog.component.mjs +79 -0
- package/esm2020/lib/cadastros/produtos/produto-busca-filtros-dialog/produto-busca-filtros-dialog.component.mjs +56 -0
- package/esm2020/lib/cadastros/produtos/produto-edit-dialog/produto-edit-dialog.component.mjs +68 -0
- package/esm2020/lib/cadastros/produtos/produto-form/produto-form.component.mjs +343 -0
- package/esm2020/lib/cadastros/produtos/produtos/produtos.component.mjs +211 -0
- package/esm2020/lib/cadastros/produtos-categoria-cardapio/produto-categoria-cardapio-add-dialog/produto-categoria-cardapio-add-dialog.component.mjs +69 -0
- package/esm2020/lib/cadastros/produtos-categoria-cardapio/produto-categoria-cardapio-edit-dialog/produto-categoria-cardapio-edit-dialog.component.mjs +68 -0
- package/esm2020/lib/cadastros/produtos-categoria-cardapio/produto-categoria-cardapio-selecao-dialog/produto-categoria-cardapio-selecao-dialog.component.mjs +106 -0
- package/esm2020/lib/cadastros/produtos-categoria-cardapio/produtos-categorias-cardapio/produtos-categorias-cardapio.component.mjs +156 -0
- package/esm2020/lib/cadastros/produtos-grupos/mover-grupo-dialog/mover-grupo-dialog.component.mjs +65 -0
- package/esm2020/lib/cadastros/produtos-grupos/produto-grupo-add-dialog/produto-grupo-add-dialog.component.mjs +69 -0
- package/esm2020/lib/cadastros/produtos-grupos/produto-grupo-edit-dialog/produto-grupo-edit-dialog.component.mjs +68 -0
- package/esm2020/lib/cadastros/produtos-grupos/produto-grupo-form/produto-grupo-form.component.mjs +18 -0
- package/esm2020/lib/cadastros/produtos-grupos/produto-grupo-selecao-dialog/produto-grupo-selecao-dialog.component.mjs +106 -0
- package/esm2020/lib/cadastros/produtos-grupos/produtos-grupos/produtos-grupos.component.mjs +179 -0
- package/esm2020/lib/cadastros/produtos-ncm-dialog/produtos-ncm-dialog.component.mjs +58 -0
- package/esm2020/lib/cadastros/produtos-subgrupos/produto-subgrupo-add-dialog/produto-subgrupo-add-dialog.component.mjs +71 -0
- package/esm2020/lib/cadastros/produtos-subgrupos/produto-subgrupo-edit-dialog/produto-subgrupo-edit-dialog.component.mjs +68 -0
- package/esm2020/lib/cadastros/produtos-subgrupos/produto-subgrupo-selecao-dialog/produto-subgrupo-selecao-dialog.component.mjs +106 -0
- package/esm2020/lib/cadastros/produtos-subgrupos/produtos-subgrupos/produtos-subgrupos.component.mjs +156 -0
- package/esm2020/lib/models/entidades/funcionario.mjs +12 -0
- package/esm2020/lib/models/entidades/produto-grupo.mjs +9 -0
- package/esm2020/lib/models/entidades/produto-ncm.mjs +2 -0
- package/esm2020/lib/models/entidades/produto.mjs +106 -0
- package/esm2020/lib/models/entidades/setor-estoque.mjs +2 -0
- package/esm2020/lib/models/infra/number-parser.mjs +1 -1
- package/esm2020/lib/models/infra/selecao-utils.mjs +4 -2
- package/esm2020/lib/models/infra/validations.mjs +1 -1
- package/esm2020/lib/models/tuple.mjs +2 -0
- package/esm2020/lib/oxpi-nglib.module.mjs +92 -5
- package/esm2020/lib/providers/auth-data.service.mjs +219 -0
- package/esm2020/lib/providers/common-web-service.mjs +220 -0
- package/esm2020/lib/providers/notification.service.mjs +29 -0
- package/esm2020/public-api.mjs +32 -1
- package/fesm2015/oxpi-nglib.mjs +3417 -663
- package/fesm2015/oxpi-nglib.mjs.map +1 -1
- package/fesm2020/oxpi-nglib.mjs +3392 -663
- package/fesm2020/oxpi-nglib.mjs.map +1 -1
- package/lib/cadastros/funcionarios/funcionario-add-dialog/funcionario-add-dialog.component.d.ts +27 -0
- package/lib/cadastros/funcionarios/funcionario-edit-dialog/funcionario-edit-dialog.component.d.ts +27 -0
- package/lib/cadastros/funcionarios/funcionario-form/funcionario-form.component.d.ts +15 -0
- package/lib/cadastros/funcionarios/funcionarios/funcionarios.component.d.ts +36 -0
- package/lib/cadastros/produtos/produto-add-dialog/produto-add-dialog.component.d.ts +28 -0
- package/lib/cadastros/produtos/produto-busca-filtros-dialog/produto-busca-filtros-dialog.component.d.ts +27 -0
- package/lib/cadastros/produtos/produto-edit-dialog/produto-edit-dialog.component.d.ts +27 -0
- package/lib/cadastros/produtos/produto-form/produto-form.component.d.ts +78 -0
- package/lib/cadastros/produtos/produtos/produtos.component.d.ts +44 -0
- package/lib/cadastros/produtos-categoria-cardapio/produto-categoria-cardapio-add-dialog/produto-categoria-cardapio-add-dialog.component.d.ts +27 -0
- package/lib/cadastros/produtos-categoria-cardapio/produto-categoria-cardapio-edit-dialog/produto-categoria-cardapio-edit-dialog.component.d.ts +27 -0
- package/lib/cadastros/produtos-categoria-cardapio/produto-categoria-cardapio-selecao-dialog/produto-categoria-cardapio-selecao-dialog.component.d.ts +35 -0
- package/lib/cadastros/produtos-categoria-cardapio/produtos-categorias-cardapio/produtos-categorias-cardapio.component.d.ts +36 -0
- package/lib/cadastros/produtos-grupos/mover-grupo-dialog/mover-grupo-dialog.component.d.ts +21 -0
- package/lib/cadastros/produtos-grupos/produto-grupo-add-dialog/produto-grupo-add-dialog.component.d.ts +27 -0
- package/lib/cadastros/produtos-grupos/produto-grupo-edit-dialog/produto-grupo-edit-dialog.component.d.ts +27 -0
- package/lib/cadastros/produtos-grupos/produto-grupo-form/produto-grupo-form.component.d.ts +10 -0
- package/lib/cadastros/produtos-grupos/produto-grupo-selecao-dialog/produto-grupo-selecao-dialog.component.d.ts +35 -0
- package/lib/cadastros/produtos-grupos/produtos-grupos/produtos-grupos.component.d.ts +37 -0
- package/lib/cadastros/produtos-ncm-dialog/produtos-ncm-dialog.component.d.ts +29 -0
- package/lib/cadastros/produtos-subgrupos/produto-subgrupo-add-dialog/produto-subgrupo-add-dialog.component.d.ts +27 -0
- package/lib/cadastros/produtos-subgrupos/produto-subgrupo-edit-dialog/produto-subgrupo-edit-dialog.component.d.ts +28 -0
- package/lib/cadastros/produtos-subgrupos/produto-subgrupo-selecao-dialog/produto-subgrupo-selecao-dialog.component.d.ts +35 -0
- package/lib/cadastros/produtos-subgrupos/produtos-subgrupos/produtos-subgrupos.component.d.ts +36 -0
- package/lib/models/entidades/funcionario.d.ts +15 -0
- package/lib/models/entidades/produto-grupo.d.ts +20 -0
- package/lib/models/entidades/produto-ncm.d.ts +10 -0
- package/lib/models/entidades/produto.d.ts +74 -0
- package/lib/models/entidades/setor-estoque.d.ts +7 -0
- package/lib/models/infra/number-parser.d.ts +1 -1
- package/lib/models/infra/selecao-utils.d.ts +1 -1
- package/lib/models/infra/validations.d.ts +3 -3
- package/lib/models/tuple.d.ts +4 -0
- package/lib/oxpi-nglib.module.d.ts +34 -7
- package/lib/providers/auth-data.service.d.ts +20 -0
- package/lib/providers/common-web-service.d.ts +80 -0
- package/lib/providers/notification.service.d.ts +12 -0
- package/package.json +1 -1
- package/public-api.d.ts +31 -0
- package/styles/cadastros-listagens-form.scss +15 -0
package/fesm2015/oxpi-nglib.mjs
CHANGED
|
@@ -1,68 +1,3310 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component, Input,
|
|
3
|
-
import * as
|
|
4
|
-
import
|
|
2
|
+
import { Injectable, EventEmitter, Component, Input, Inject, Output, HostListener, Pipe, NgModule } from '@angular/core';
|
|
3
|
+
import * as i3 from '@angular/material/dialog';
|
|
4
|
+
import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
|
|
5
|
+
import * as i1 from '@angular/common/http';
|
|
6
|
+
import { HttpParams, HttpHeaders, HttpEventType } from '@angular/common/http';
|
|
7
|
+
import { map } from 'rxjs';
|
|
8
|
+
import * as i1$1 from '@angular/material/snack-bar';
|
|
9
|
+
import * as i6 from '@angular/common';
|
|
10
|
+
import * as i6$1 from '@angular/material/button';
|
|
5
11
|
import { MatButtonModule } from '@angular/material/button';
|
|
6
|
-
import * as
|
|
12
|
+
import * as i7$1 from '@angular/material/icon';
|
|
7
13
|
import { MatIconModule } from '@angular/material/icon';
|
|
8
|
-
import * as
|
|
14
|
+
import * as i7 from '@angular/forms';
|
|
9
15
|
import { FormsModule } from '@angular/forms';
|
|
10
|
-
import * as
|
|
11
|
-
import {
|
|
16
|
+
import * as i4 from '@angular/material/select';
|
|
17
|
+
import { MatSelectModule } from '@angular/material/select';
|
|
18
|
+
import * as i5 from '@angular/material/core';
|
|
19
|
+
import { trigger, transition, style, animate } from '@angular/animations';
|
|
20
|
+
import * as i12 from '@angular/material/autocomplete';
|
|
21
|
+
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
|
12
22
|
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|
13
|
-
import * as i1$
|
|
23
|
+
import * as i1$2 from '@angular/platform-browser';
|
|
14
24
|
import { BrowserModule } from '@angular/platform-browser';
|
|
15
|
-
import { trigger, transition, style, animate } from '@angular/animations';
|
|
16
25
|
import * as FileSaver from 'file-saver';
|
|
17
26
|
|
|
18
|
-
|
|
19
|
-
|
|
27
|
+
function valTextEmpty(v) {
|
|
28
|
+
return v === null ||
|
|
29
|
+
v === undefined ||
|
|
30
|
+
v.trim() === '';
|
|
31
|
+
}
|
|
32
|
+
function valNumberEmpty(v) {
|
|
33
|
+
return v === null ||
|
|
34
|
+
v === undefined ||
|
|
35
|
+
v === 0;
|
|
36
|
+
}
|
|
37
|
+
function valTextMax(v, max) {
|
|
38
|
+
return v.length > max;
|
|
39
|
+
}
|
|
40
|
+
function valNumberMin(v, min) {
|
|
41
|
+
if (v === null || v === undefined)
|
|
42
|
+
return true;
|
|
43
|
+
return v <= min;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function valida(item, focus) {
|
|
47
|
+
if (valTextEmpty(item.nome)) {
|
|
48
|
+
focus.set('nome');
|
|
49
|
+
return 'Digite um nome válido.';
|
|
50
|
+
}
|
|
51
|
+
if (valNumberEmpty(item.cargoId)) {
|
|
52
|
+
return 'Escolha um cargo.';
|
|
53
|
+
}
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
class FocusService {
|
|
58
|
+
constructor() {
|
|
59
|
+
}
|
|
60
|
+
hasInit() {
|
|
61
|
+
return this._element !== undefined;
|
|
62
|
+
}
|
|
63
|
+
registerElementById(name) {
|
|
64
|
+
this.registerElement(document.getElementById(name));
|
|
65
|
+
}
|
|
66
|
+
registerElement(element) {
|
|
67
|
+
if (element === null || element === undefined)
|
|
68
|
+
return;
|
|
69
|
+
this._element = element;
|
|
70
|
+
//this._items = this.getItems();
|
|
71
|
+
console.info(element);
|
|
72
|
+
element.addEventListener('keydown', (ev) => this.handleKeyboardEvent(ev));
|
|
73
|
+
}
|
|
74
|
+
registerWindow() {
|
|
75
|
+
this._element = null;
|
|
76
|
+
//this._items = this.getItems();
|
|
77
|
+
window.addEventListener('keydown', (ev) => this.handleKeyboardEvent(ev));
|
|
78
|
+
}
|
|
79
|
+
unregisterElementById(name) {
|
|
80
|
+
this.unregisterElement(document.getElementById(name));
|
|
81
|
+
}
|
|
82
|
+
unregisterElement(element) {
|
|
83
|
+
if (element === null || element === undefined)
|
|
84
|
+
return;
|
|
85
|
+
element.removeEventListener('keydown', (ev) => this.handleKeyboardEvent(ev));
|
|
86
|
+
}
|
|
87
|
+
handleKeyboardEvent(event) {
|
|
88
|
+
if (event.keyCode !== 13)
|
|
89
|
+
return;
|
|
90
|
+
if (event.target.nodeName === "BUTTON")
|
|
91
|
+
return;
|
|
92
|
+
const items = this.getItems();
|
|
93
|
+
const index = Array.prototype.indexOf.call(items, event.target);
|
|
94
|
+
const nextIndex = index + 1;
|
|
95
|
+
if (nextIndex > items.length - 1)
|
|
96
|
+
return;
|
|
97
|
+
const i = items[index + 1];
|
|
98
|
+
if (i.tabIndex > -1)
|
|
99
|
+
i.focus();
|
|
100
|
+
event.preventDefault();
|
|
101
|
+
}
|
|
102
|
+
setFirst() {
|
|
103
|
+
const el = this.getItems()[0]; //[0];
|
|
104
|
+
if (el !== undefined)
|
|
105
|
+
el.focus();
|
|
106
|
+
}
|
|
107
|
+
getItems() {
|
|
108
|
+
const query = this._element !== null && this._element !== undefined ?
|
|
109
|
+
this._element.querySelectorAll('input,button, [tabindex]:not([tabindex="-1"])') :
|
|
110
|
+
document.querySelectorAll('input,button, [tabindex]:not([tabindex="-1"])');
|
|
111
|
+
const items = [];
|
|
112
|
+
for (let index = 0; index < query.length; index++) {
|
|
113
|
+
const el = query[index];
|
|
114
|
+
if (el.tabIndex > 0)
|
|
115
|
+
items.push(el);
|
|
116
|
+
}
|
|
117
|
+
return items;
|
|
118
|
+
}
|
|
119
|
+
set(id) {
|
|
120
|
+
const el = document.getElementById(id);
|
|
121
|
+
if (el === null)
|
|
122
|
+
return;
|
|
123
|
+
el.focus();
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
class CommonWebService {
|
|
128
|
+
constructor(http) {
|
|
129
|
+
this.http = http;
|
|
130
|
+
this.ROOT_URL = '';
|
|
131
|
+
this.GERENCIAL_URL = '';
|
|
132
|
+
this.FUNCIONARIO_BASE_URL = '';
|
|
133
|
+
this.FUNCIONARIO_CARGO_BASE_URL = '';
|
|
134
|
+
this.token = '';
|
|
135
|
+
this.PRODUTO_BASE_URL = '';
|
|
136
|
+
this.PRODUTO_GRUPO_BASE_URL = '';
|
|
137
|
+
this.PRODUTO_SUBGRUPO_BASE_URL = '';
|
|
138
|
+
this.PRODUTO_CATEGORIA_CARDAPIO_BASE_URL = '';
|
|
139
|
+
this.ESTOQUE_URL = '';
|
|
140
|
+
this.MEDIA_BASE_URL = '';
|
|
141
|
+
this.MEDIA_PRODUTO_IMAGEM_URL = '';
|
|
142
|
+
}
|
|
143
|
+
setToken(token) {
|
|
144
|
+
this.token = token;
|
|
145
|
+
}
|
|
146
|
+
start(rootUrl) {
|
|
147
|
+
this.ROOT_URL = rootUrl;
|
|
148
|
+
this.FUNCIONARIO_BASE_URL = rootUrl + "Funcionario/";
|
|
149
|
+
this.FUNCIONARIO_CARGO_BASE_URL = rootUrl + "FuncionarioCargo/";
|
|
150
|
+
this.PRODUTO_BASE_URL = rootUrl + "ProdutoFiscal/";
|
|
151
|
+
this.PRODUTO_GRUPO_BASE_URL = rootUrl + "ProdutoGrupo/";
|
|
152
|
+
this.PRODUTO_SUBGRUPO_BASE_URL = rootUrl + "ProdutoSubgrupo/";
|
|
153
|
+
this.PRODUTO_CATEGORIA_CARDAPIO_BASE_URL = rootUrl + "ProdutoCategoriaCardapio/";
|
|
154
|
+
this.ESTOQUE_URL = rootUrl + 'Estoque/';
|
|
155
|
+
this.GERENCIAL_URL = rootUrl + 'Gerencial/';
|
|
156
|
+
this.MEDIA_BASE_URL = this.GERENCIAL_URL + "Media/";
|
|
157
|
+
this.MEDIA_PRODUTO_IMAGEM_URL = this.GERENCIAL_URL + 'GetProdutoImagem/';
|
|
158
|
+
}
|
|
159
|
+
getFuncionarios() {
|
|
160
|
+
const url = this.FUNCIONARIO_BASE_URL;
|
|
161
|
+
return this.http.get(url, this.getHttpOptions()).pipe(map(data => data));
|
|
162
|
+
}
|
|
163
|
+
getFuncionariosCargos() {
|
|
164
|
+
const url = this.FUNCIONARIO_CARGO_BASE_URL;
|
|
165
|
+
return this.http.get(url, this.getHttpOptions()).pipe(map(data => data));
|
|
166
|
+
}
|
|
167
|
+
buscaFuncionario(setting) {
|
|
168
|
+
const url = this.FUNCIONARIO_BASE_URL + CommonWebService.URL_PART_BUSCA;
|
|
169
|
+
return this.http.post(url, JSON.stringify(setting), this.getHttpOptions()).pipe(map(data => data));
|
|
170
|
+
}
|
|
171
|
+
getNextIdFuncionario() {
|
|
172
|
+
const url = this.FUNCIONARIO_BASE_URL + CommonWebService.URL_PART_NEXT_ID;
|
|
173
|
+
return this.http.get(url, this.getHttpOptions()).pipe(map(data => data));
|
|
174
|
+
}
|
|
175
|
+
getAllFuncionario() {
|
|
176
|
+
const url = this.FUNCIONARIO_BASE_URL;
|
|
177
|
+
return this.http.get(url, this.getHttpOptions()).pipe(map(data => data));
|
|
178
|
+
}
|
|
179
|
+
saveFuncionario(s) {
|
|
180
|
+
const url = this.FUNCIONARIO_BASE_URL;
|
|
181
|
+
return this.http.post(url, JSON.stringify(s), this.getHttpOptions()).pipe(map(data => data));
|
|
182
|
+
}
|
|
183
|
+
addFuncionario(p) {
|
|
184
|
+
const url = this.FUNCIONARIO_BASE_URL;
|
|
185
|
+
return this.http.put(url, JSON.stringify(p), this.getHttpOptions()).pipe(map(data => data));
|
|
186
|
+
}
|
|
187
|
+
deleteFuncionario(id) {
|
|
188
|
+
const url = this.FUNCIONARIO_BASE_URL + id;
|
|
189
|
+
return this.http.delete(url, this.getHttpOptions()).pipe(map(data => data));
|
|
190
|
+
}
|
|
191
|
+
buscaPaginadaProdutos(setting, page, pageSize) {
|
|
192
|
+
const url = this.PRODUTO_BASE_URL + CommonWebService.URL_PART_BUSCA_PAGINADA;
|
|
193
|
+
const p = { setting: setting, page: page, pageSize: pageSize };
|
|
194
|
+
return this.http.post(url, JSON.stringify(p), this.getHttpOptions()).pipe(map(data => data));
|
|
195
|
+
}
|
|
196
|
+
getNextIdProduto() {
|
|
197
|
+
const url = this.PRODUTO_BASE_URL + CommonWebService.URL_PART_NEXT_ID;
|
|
198
|
+
return this.http.get(url, this.getHttpOptions()).pipe(map(data => data));
|
|
199
|
+
}
|
|
200
|
+
saveProduto(s) {
|
|
201
|
+
const url = this.PRODUTO_BASE_URL;
|
|
202
|
+
return this.http.post(url, JSON.stringify(s), this.getHttpOptions()).pipe(map(data => data));
|
|
203
|
+
}
|
|
204
|
+
addProduto(p) {
|
|
205
|
+
const url = this.PRODUTO_BASE_URL;
|
|
206
|
+
return this.http.put(url, JSON.stringify(p), this.getHttpOptions()).pipe(map(data => data));
|
|
207
|
+
}
|
|
208
|
+
deleteProduto(id) {
|
|
209
|
+
const url = this.PRODUTO_BASE_URL + id;
|
|
210
|
+
return this.http.delete(url, this.getHttpOptions()).pipe(map(data => data));
|
|
211
|
+
}
|
|
212
|
+
buscaProdutoGrupo(setting) {
|
|
213
|
+
const url = this.PRODUTO_GRUPO_BASE_URL + CommonWebService.URL_PART_BUSCA;
|
|
214
|
+
return this.http.post(url, JSON.stringify(setting), this.getHttpOptions()).pipe(map(data => data));
|
|
215
|
+
}
|
|
216
|
+
getAllProdutoGrupo() {
|
|
217
|
+
const url = this.PRODUTO_GRUPO_BASE_URL;
|
|
218
|
+
return this.http.get(url, this.getHttpOptions()).pipe(map(data => data));
|
|
219
|
+
}
|
|
220
|
+
getNextIdProdutoGrupo() {
|
|
221
|
+
const url = this.PRODUTO_GRUPO_BASE_URL + CommonWebService.URL_PART_NEXT_ID;
|
|
222
|
+
return this.http.get(url, this.getHttpOptions()).pipe(map(data => data));
|
|
223
|
+
}
|
|
224
|
+
saveProdutoGrupo(s) {
|
|
225
|
+
const url = this.PRODUTO_GRUPO_BASE_URL;
|
|
226
|
+
return this.http.post(url, JSON.stringify(s), this.getHttpOptions()).pipe(map(data => data));
|
|
227
|
+
}
|
|
228
|
+
transfereProdutoGrupo(grupoId, novoGrupoId) {
|
|
229
|
+
const url = this.PRODUTO_BASE_URL + 'AlteraGrupo';
|
|
230
|
+
const p = { oldId: grupoId, newId: novoGrupoId };
|
|
231
|
+
return this.http.post(url, JSON.stringify(p), this.getHttpOptions()).pipe(map(data => data));
|
|
232
|
+
}
|
|
233
|
+
addProdutoGrupo(p) {
|
|
234
|
+
const url = this.PRODUTO_GRUPO_BASE_URL;
|
|
235
|
+
return this.http.put(url, JSON.stringify(p), this.getHttpOptions()).pipe(map(data => data));
|
|
236
|
+
}
|
|
237
|
+
deleteProdutoGrupo(id) {
|
|
238
|
+
const url = this.PRODUTO_GRUPO_BASE_URL + id;
|
|
239
|
+
return this.http.delete(url, this.getHttpOptions()).pipe(map(data => data));
|
|
240
|
+
}
|
|
241
|
+
buscaNcm(ncm) {
|
|
242
|
+
const url = this.PRODUTO_BASE_URL + 'BuscaNCM/';
|
|
243
|
+
const params = new HttpParams()
|
|
244
|
+
.set("ncm", '' + ncm);
|
|
245
|
+
return this.http.get(url, this.getHttpOptions(params)).pipe(map(data => data));
|
|
246
|
+
}
|
|
247
|
+
findNcm(ncm) {
|
|
248
|
+
const url = this.PRODUTO_BASE_URL + 'FindNCM/';
|
|
249
|
+
const params = new HttpParams()
|
|
250
|
+
.set("ncm", '' + ncm);
|
|
251
|
+
return this.http.get(url, this.getHttpOptions(params)).pipe(map(data => data));
|
|
252
|
+
}
|
|
253
|
+
buscaProdutoSubgrupo(setting) {
|
|
254
|
+
const url = this.PRODUTO_SUBGRUPO_BASE_URL + CommonWebService.URL_PART_BUSCA;
|
|
255
|
+
return this.http.post(url, JSON.stringify(setting), this.getHttpOptions()).pipe(map(data => data));
|
|
256
|
+
}
|
|
257
|
+
getNextIdProdutoSubgrupo() {
|
|
258
|
+
const url = this.PRODUTO_SUBGRUPO_BASE_URL + CommonWebService.URL_PART_NEXT_ID;
|
|
259
|
+
return this.http.get(url, this.getHttpOptions()).pipe(map(data => data));
|
|
260
|
+
}
|
|
261
|
+
saveProdutoSubgrupo(s) {
|
|
262
|
+
const url = this.PRODUTO_SUBGRUPO_BASE_URL;
|
|
263
|
+
return this.http.post(url, JSON.stringify(s), this.getHttpOptions()).pipe(map(data => data));
|
|
264
|
+
}
|
|
265
|
+
addProdutoSubgrupo(p) {
|
|
266
|
+
const url = this.PRODUTO_SUBGRUPO_BASE_URL;
|
|
267
|
+
return this.http.put(url, JSON.stringify(p), this.getHttpOptions()).pipe(map(data => data));
|
|
268
|
+
}
|
|
269
|
+
deleteProdutoSubgrupo(id) {
|
|
270
|
+
const url = this.PRODUTO_SUBGRUPO_BASE_URL + id;
|
|
271
|
+
return this.http.delete(url, this.getHttpOptions()).pipe(map(data => data));
|
|
272
|
+
}
|
|
273
|
+
buscaProdutoCategoriaCardapio(setting) {
|
|
274
|
+
const url = this.PRODUTO_CATEGORIA_CARDAPIO_BASE_URL + CommonWebService.URL_PART_BUSCA;
|
|
275
|
+
return this.http.post(url, JSON.stringify(setting), this.getHttpOptions()).pipe(map(data => data));
|
|
276
|
+
}
|
|
277
|
+
getNextIdProdutoCategoriaCardapio() {
|
|
278
|
+
const url = this.PRODUTO_CATEGORIA_CARDAPIO_BASE_URL + CommonWebService.URL_PART_NEXT_ID;
|
|
279
|
+
return this.http.get(url, this.getHttpOptions()).pipe(map(data => data));
|
|
280
|
+
}
|
|
281
|
+
saveProdutoCategoriaCardapio(s) {
|
|
282
|
+
const url = this.PRODUTO_CATEGORIA_CARDAPIO_BASE_URL;
|
|
283
|
+
return this.http.post(url, JSON.stringify(s), this.getHttpOptions()).pipe(map(data => data));
|
|
284
|
+
}
|
|
285
|
+
addProdutoCategoriaCardapio(p) {
|
|
286
|
+
const url = this.PRODUTO_CATEGORIA_CARDAPIO_BASE_URL;
|
|
287
|
+
return this.http.put(url, JSON.stringify(p), this.getHttpOptions()).pipe(map(data => data));
|
|
288
|
+
}
|
|
289
|
+
deleteProdutoCategoriaCardapio(id) {
|
|
290
|
+
const url = this.PRODUTO_CATEGORIA_CARDAPIO_BASE_URL + id;
|
|
291
|
+
return this.http.delete(url, this.getHttpOptions()).pipe(map(data => data));
|
|
292
|
+
}
|
|
293
|
+
getAllSetores() {
|
|
294
|
+
const url = this.ESTOQUE_URL + 'Setor/';
|
|
295
|
+
return this.http.get(url, this.getHttpOptions()).pipe(map(data => data));
|
|
296
|
+
}
|
|
297
|
+
getHttpOptions(parameters) {
|
|
298
|
+
return {
|
|
299
|
+
headers: new HttpHeaders({
|
|
300
|
+
'Content-Type': 'application/json',
|
|
301
|
+
"Accept": "application/json",
|
|
302
|
+
"Authorization": 'token ' + this.token,
|
|
303
|
+
}),
|
|
304
|
+
params: parameters
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
getExcelOptions(parameters) {
|
|
308
|
+
return {
|
|
309
|
+
headers: new HttpHeaders({
|
|
310
|
+
'Content-Type': 'application/json',
|
|
311
|
+
"Accept": "application/json",
|
|
312
|
+
"Authorization": 'token ' + this.token,
|
|
313
|
+
}),
|
|
314
|
+
params: parameters,
|
|
315
|
+
responseType: 'arraybuffer',
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
getHtmlOptions(parameters) {
|
|
319
|
+
return {
|
|
320
|
+
headers: new HttpHeaders({
|
|
321
|
+
'Content-Type': 'application/json',
|
|
322
|
+
"Accept": "application/json",
|
|
323
|
+
"Authorization": 'token ' + this.token,
|
|
324
|
+
}),
|
|
325
|
+
params: parameters,
|
|
326
|
+
responseType: 'text',
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
CommonWebService.URL_PART_BUSCA = "Busca/";
|
|
331
|
+
CommonWebService.URL_PART_NEXT_ID = "GetNextId/";
|
|
332
|
+
CommonWebService.URL_PART_BUSCA_PAGINADA = "BuscaPaginada/";
|
|
333
|
+
CommonWebService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: CommonWebService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
334
|
+
CommonWebService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: CommonWebService, providedIn: 'root' });
|
|
335
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: CommonWebService, decorators: [{
|
|
336
|
+
type: Injectable,
|
|
337
|
+
args: [{
|
|
338
|
+
providedIn: 'root'
|
|
339
|
+
}]
|
|
340
|
+
}], ctorParameters: function () { return [{ type: i1.HttpClient }]; } });
|
|
341
|
+
|
|
342
|
+
class NotificationService {
|
|
343
|
+
constructor(snackBar) {
|
|
344
|
+
this.snackBar = snackBar;
|
|
345
|
+
}
|
|
346
|
+
showHttpError(res) {
|
|
347
|
+
this.snackBar.open(`Ocorreu um erro de conexão. Erro ${res.status}: ${res.statusText}`);
|
|
348
|
+
}
|
|
349
|
+
showMsg(msg) {
|
|
350
|
+
this.snackBar.open(msg);
|
|
351
|
+
}
|
|
352
|
+
showMsgError(msg) {
|
|
353
|
+
this.snackBar.open(msg, undefined, {
|
|
354
|
+
duration: 2000,
|
|
355
|
+
panelClass: ['red-snackbar']
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
NotificationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: NotificationService, deps: [{ token: i1$1.MatSnackBar }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
360
|
+
NotificationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: NotificationService, providedIn: 'root' });
|
|
361
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: NotificationService, decorators: [{
|
|
362
|
+
type: Injectable,
|
|
363
|
+
args: [{
|
|
364
|
+
providedIn: 'root'
|
|
365
|
+
}]
|
|
366
|
+
}], ctorParameters: function () { return [{ type: i1$1.MatSnackBar }]; } });
|
|
367
|
+
|
|
368
|
+
const SM_WIDTH = 576;
|
|
369
|
+
const MD_WIDTH = 768;
|
|
370
|
+
const LG_WIDTH = 992;
|
|
371
|
+
const XL_WIDTH = 1200;
|
|
372
|
+
const XXL_WIDTH = 1400;
|
|
373
|
+
class ScreenHelperService {
|
|
374
|
+
constructor() {
|
|
375
|
+
this.changedMobileScreen = new EventEmitter();
|
|
376
|
+
this.changedMediumScreen = new EventEmitter();
|
|
377
|
+
this.changedLargeScreen = new EventEmitter();
|
|
378
|
+
this.changedXLargeScreen = new EventEmitter();
|
|
379
|
+
this.changedXXLargeScreen = new EventEmitter();
|
|
380
|
+
this.changedMinSmallScreen = new EventEmitter();
|
|
381
|
+
this.changedMinMediumScreen = new EventEmitter();
|
|
382
|
+
this.changedMinLargeScreen = new EventEmitter();
|
|
383
|
+
this.changedMinXLargeScreen = new EventEmitter();
|
|
384
|
+
this.changedMinXXLargeScreen = new EventEmitter();
|
|
385
|
+
this.mobileScreen = false;
|
|
386
|
+
this.isMedium = false;
|
|
387
|
+
this.isLarge = false;
|
|
388
|
+
this.isXLarge = false;
|
|
389
|
+
this.isXXLarge = false;
|
|
390
|
+
this.minSmall = false;
|
|
391
|
+
this.minMedium = false;
|
|
392
|
+
this.minLarge = false;
|
|
393
|
+
this.minXLarge = false;
|
|
394
|
+
this.minXXLarge = false;
|
|
395
|
+
this.determinaMobileScreen();
|
|
396
|
+
window.addEventListener('resize', (event) => {
|
|
397
|
+
this.determinaMobileScreen();
|
|
398
|
+
});
|
|
399
|
+
}
|
|
400
|
+
determinaMobileScreen() {
|
|
401
|
+
const width = window.innerWidth;
|
|
402
|
+
const isSmall = width <= SM_WIDTH;
|
|
403
|
+
const isMedium = width <= MD_WIDTH;
|
|
404
|
+
const isLarge = width <= LG_WIDTH;
|
|
405
|
+
const isXLarge = width <= XL_WIDTH;
|
|
406
|
+
const isXXLarge = width <= XXL_WIDTH;
|
|
407
|
+
const minSmall = width >= SM_WIDTH;
|
|
408
|
+
const minMedium = width >= MD_WIDTH;
|
|
409
|
+
const minLarge = width >= LG_WIDTH;
|
|
410
|
+
const minXLarge = width >= XL_WIDTH;
|
|
411
|
+
const minXXLarge = width >= XXL_WIDTH;
|
|
412
|
+
if (isSmall !== this.mobileScreen) {
|
|
413
|
+
this.changedMobileScreen.emit(isSmall);
|
|
414
|
+
this.mobileScreen = isSmall;
|
|
415
|
+
}
|
|
416
|
+
if (isMedium !== this.isMedium) {
|
|
417
|
+
this.changedMediumScreen.emit(isMedium);
|
|
418
|
+
this.isMedium = isMedium;
|
|
419
|
+
}
|
|
420
|
+
if (isLarge !== this.isLarge) {
|
|
421
|
+
this.changedLargeScreen.emit(isLarge);
|
|
422
|
+
this.isLarge = isLarge;
|
|
423
|
+
}
|
|
424
|
+
if (isXLarge !== this.isXLarge) {
|
|
425
|
+
this.changedXLargeScreen.emit(isXLarge);
|
|
426
|
+
this.isXLarge = isXLarge;
|
|
427
|
+
}
|
|
428
|
+
if (isXXLarge !== this.isXXLarge) {
|
|
429
|
+
this.changedXXLargeScreen.emit(isXXLarge);
|
|
430
|
+
this.isXXLarge = isXXLarge;
|
|
431
|
+
}
|
|
432
|
+
if (minSmall !== this.minSmall) {
|
|
433
|
+
this.changedMinSmallScreen.emit(isSmall);
|
|
434
|
+
this.minMedium = isSmall;
|
|
435
|
+
}
|
|
436
|
+
if (minMedium !== this.minMedium) {
|
|
437
|
+
this.changedMinMediumScreen.emit(isMedium);
|
|
438
|
+
this.minMedium = isMedium;
|
|
439
|
+
}
|
|
440
|
+
if (minLarge !== this.minLarge) {
|
|
441
|
+
this.changedMinLargeScreen.emit(minLarge);
|
|
442
|
+
this.minLarge = minLarge;
|
|
443
|
+
}
|
|
444
|
+
if (minXLarge !== this.minXLarge) {
|
|
445
|
+
this.changedMinXLargeScreen.emit(minXLarge);
|
|
446
|
+
this.minXLarge = minXLarge;
|
|
447
|
+
}
|
|
448
|
+
if (minXXLarge !== this.minXXLarge) {
|
|
449
|
+
this.changedMinXXLargeScreen.emit(minXXLarge);
|
|
450
|
+
this.minXXLarge = minXXLarge;
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
ScreenHelperService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ScreenHelperService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
455
|
+
ScreenHelperService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ScreenHelperService, providedIn: 'root' });
|
|
456
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ScreenHelperService, decorators: [{
|
|
457
|
+
type: Injectable,
|
|
458
|
+
args: [{
|
|
459
|
+
providedIn: 'root'
|
|
460
|
+
}]
|
|
461
|
+
}], ctorParameters: function () { return []; } });
|
|
462
|
+
|
|
463
|
+
class BusyIndicatorComponent {
|
|
464
|
+
constructor() {
|
|
465
|
+
this.isBusy = false;
|
|
466
|
+
}
|
|
467
|
+
ngOnInit() {
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
BusyIndicatorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: BusyIndicatorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
471
|
+
BusyIndicatorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: BusyIndicatorComponent, selector: "ox-busy-indicator", inputs: { isBusy: "isBusy" }, ngImport: i0, template: "<div class=\"busy-indicator-container\" *ngIf=\"isBusy\">\n <div class=\"busy-indicator\"></div>\n</div>", styles: [".busy-indicator-container{position:fixed;left:50%;top:35%;text-align:center;z-index:1000;margin-left:-47px;background:rgb(255,255,255);border-radius:8px;padding:20px;border:solid 2px transparent;background-clip:padding-box;box-shadow:10px 10px 10px #2e364414}.busy-indicator{border:10px solid #e2e2e2;border-top:10px solid var(--app-color, black);border-radius:50%;width:50px;height:50px;animation:spin .5s linear infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n"], dependencies: [{ kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
472
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: BusyIndicatorComponent, decorators: [{
|
|
473
|
+
type: Component,
|
|
474
|
+
args: [{ selector: 'ox-busy-indicator', template: "<div class=\"busy-indicator-container\" *ngIf=\"isBusy\">\n <div class=\"busy-indicator\"></div>\n</div>", styles: [".busy-indicator-container{position:fixed;left:50%;top:35%;text-align:center;z-index:1000;margin-left:-47px;background:rgb(255,255,255);border-radius:8px;padding:20px;border:solid 2px transparent;background-clip:padding-box;box-shadow:10px 10px 10px #2e364414}.busy-indicator{border:10px solid #e2e2e2;border-top:10px solid var(--app-color, black);border-radius:50%;width:50px;height:50px;animation:spin .5s linear infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n"] }]
|
|
475
|
+
}], ctorParameters: function () { return []; }, propDecorators: { isBusy: [{
|
|
476
|
+
type: Input
|
|
477
|
+
}] } });
|
|
478
|
+
|
|
479
|
+
class FuncionarioFormComponent {
|
|
480
|
+
constructor(ws) {
|
|
481
|
+
this.ws = ws;
|
|
482
|
+
this.isBusy = false;
|
|
483
|
+
this.cargos = [];
|
|
484
|
+
}
|
|
485
|
+
ngOnInit() {
|
|
486
|
+
this.getCargos();
|
|
487
|
+
}
|
|
488
|
+
getCargos() {
|
|
489
|
+
this.isBusy = true;
|
|
490
|
+
this.ws.getFuncionariosCargos()
|
|
491
|
+
.subscribe(r => {
|
|
492
|
+
this.cargos = r;
|
|
493
|
+
console.info(r);
|
|
494
|
+
this.isBusy = false;
|
|
495
|
+
}, err => {
|
|
496
|
+
this.isBusy = false;
|
|
497
|
+
});
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
FuncionarioFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: FuncionarioFormComponent, deps: [{ token: CommonWebService }], target: i0.ɵɵFactoryTarget.Component });
|
|
501
|
+
FuncionarioFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: FuncionarioFormComponent, selector: "ox-funcionario-form", inputs: { model: "model" }, ngImport: i0, template: "<ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>\n<div class=\"form-group\" *ngIf=\"model\">\n <label for=\"nome\">Nome</label>\n <input id=\"nome\" [(ngModel)]=\"model.nome\" required class=\"form-control input-300\" tabindex=\"2\">\n</div>\n<div class=\"form-group\" *ngIf=\"model\">\n <label for=\"cargo\">Cargo</label>\n <mat-select id=\"cargo\" [(value)]=\"model.cargoId\" tabindex=\"2\"\n class=\"form-control input-300\" color=\"primary\">\n <mat-option *ngFor=\"let m of cargos\" [value]=\"m.id\">\n {{m.nome}}\n </mat-option>\n </mat-select>\n</div>", styles: [""], 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: "directive", type: i7.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i7.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i4.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "component", type: i5.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: BusyIndicatorComponent, selector: "ox-busy-indicator", inputs: ["isBusy"] }] });
|
|
502
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: FuncionarioFormComponent, decorators: [{
|
|
503
|
+
type: Component,
|
|
504
|
+
args: [{ selector: 'ox-funcionario-form', template: "<ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>\n<div class=\"form-group\" *ngIf=\"model\">\n <label for=\"nome\">Nome</label>\n <input id=\"nome\" [(ngModel)]=\"model.nome\" required class=\"form-control input-300\" tabindex=\"2\">\n</div>\n<div class=\"form-group\" *ngIf=\"model\">\n <label for=\"cargo\">Cargo</label>\n <mat-select id=\"cargo\" [(value)]=\"model.cargoId\" tabindex=\"2\"\n class=\"form-control input-300\" color=\"primary\">\n <mat-option *ngFor=\"let m of cargos\" [value]=\"m.id\">\n {{m.nome}}\n </mat-option>\n </mat-select>\n</div>" }]
|
|
505
|
+
}], ctorParameters: function () { return [{ type: CommonWebService }]; }, propDecorators: { model: [{
|
|
506
|
+
type: Input
|
|
507
|
+
}] } });
|
|
508
|
+
|
|
509
|
+
class FuncionarioAddDialogComponent {
|
|
510
|
+
constructor(ws, notification, dataDialog, dialog, elRef, dialogRef, screenHelper) {
|
|
511
|
+
this.ws = ws;
|
|
512
|
+
this.notification = notification;
|
|
513
|
+
this.dataDialog = dataDialog;
|
|
514
|
+
this.dialog = dialog;
|
|
515
|
+
this.elRef = elRef;
|
|
516
|
+
this.dialogRef = dialogRef;
|
|
517
|
+
this.screenHelper = screenHelper;
|
|
518
|
+
this.isBusy = false;
|
|
519
|
+
this.focus = new FocusService();
|
|
520
|
+
this.model = {
|
|
521
|
+
id: 0,
|
|
522
|
+
nome: '',
|
|
523
|
+
login: '',
|
|
524
|
+
senha: '',
|
|
525
|
+
enviadoPC: false,
|
|
526
|
+
isAtivo: true,
|
|
527
|
+
cargoId: 1
|
|
528
|
+
};
|
|
529
|
+
this.mobile = this.screenHelper.isMedium;
|
|
530
|
+
this.screenHelper.changedMediumScreen.subscribe(x => this.mobile = x);
|
|
531
|
+
}
|
|
532
|
+
ngOnInit() {
|
|
533
|
+
this.focus.registerElement(this.elRef.nativeElement);
|
|
534
|
+
}
|
|
535
|
+
ngOnDestroy() {
|
|
536
|
+
this.focus.unregisterElement(this.elRef.nativeElement);
|
|
537
|
+
}
|
|
538
|
+
salvar() {
|
|
539
|
+
if (this.model)
|
|
540
|
+
return;
|
|
541
|
+
const valMsg = valida(this.model, this.focus);
|
|
542
|
+
if (valMsg) {
|
|
543
|
+
this.notification.showMsgError(valMsg);
|
|
544
|
+
return;
|
|
545
|
+
}
|
|
546
|
+
this.isBusy = true;
|
|
547
|
+
this.ws.addFuncionario(this.model)
|
|
548
|
+
.subscribe(r => {
|
|
549
|
+
this.isBusy = false;
|
|
550
|
+
this.notification.showMsg("Salvo com sucesso.");
|
|
551
|
+
if (this.dialogRef)
|
|
552
|
+
this.dialogRef.close(true);
|
|
553
|
+
}, err => {
|
|
554
|
+
this.isBusy = false;
|
|
555
|
+
this.notification.showMsg(err.error);
|
|
556
|
+
});
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
FuncionarioAddDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: FuncionarioAddDialogComponent, deps: [{ token: CommonWebService }, { token: NotificationService }, { token: MAT_DIALOG_DATA }, { token: i3.MatDialog }, { token: i0.ElementRef }, { token: i3.MatDialogRef }, { token: ScreenHelperService }], target: i0.ɵɵFactoryTarget.Component });
|
|
560
|
+
FuncionarioAddDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: FuncionarioAddDialogComponent, selector: "ox-funcionario-add-dialog", ngImport: i0, template: "<div class=\"ox-header\">\n <h2 class=\"titulo\">Novo Funcion\u00E1rio</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-funcionario-form [model]=\"model\" *ngIf=\"model\"></ox-funcionario-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$1.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: FuncionarioFormComponent, selector: "ox-funcionario-form", inputs: ["model"] }] });
|
|
561
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: FuncionarioAddDialogComponent, decorators: [{
|
|
562
|
+
type: Component,
|
|
563
|
+
args: [{ selector: 'ox-funcionario-add-dialog', template: "<div class=\"ox-header\">\n <h2 class=\"titulo\">Novo Funcion\u00E1rio</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-funcionario-form [model]=\"model\" *ngIf=\"model\"></ox-funcionario-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"] }]
|
|
564
|
+
}], ctorParameters: function () {
|
|
565
|
+
return [{ type: CommonWebService }, { type: NotificationService }, { type: undefined, decorators: [{
|
|
566
|
+
type: Inject,
|
|
567
|
+
args: [MAT_DIALOG_DATA]
|
|
568
|
+
}] }, { type: i3.MatDialog }, { type: i0.ElementRef }, { type: i3.MatDialogRef }, { type: ScreenHelperService }];
|
|
569
|
+
} });
|
|
570
|
+
|
|
571
|
+
class FuncionarioEditDialogComponent {
|
|
572
|
+
constructor(ws, notification, dataDialog, dialog, elRef, dialogRef, screenHelper) {
|
|
573
|
+
this.ws = ws;
|
|
574
|
+
this.notification = notification;
|
|
575
|
+
this.dataDialog = dataDialog;
|
|
576
|
+
this.dialog = dialog;
|
|
577
|
+
this.elRef = elRef;
|
|
578
|
+
this.dialogRef = dialogRef;
|
|
579
|
+
this.screenHelper = screenHelper;
|
|
580
|
+
this.isBusy = false;
|
|
581
|
+
this.focus = new FocusService();
|
|
582
|
+
if (dataDialog) {
|
|
583
|
+
this.model = dataDialog;
|
|
584
|
+
}
|
|
585
|
+
this.mobile = this.screenHelper.isMedium;
|
|
586
|
+
this.screenHelper.changedMediumScreen.subscribe(x => this.mobile = x);
|
|
587
|
+
}
|
|
588
|
+
ngOnInit() {
|
|
589
|
+
this.focus.registerElement(this.elRef.nativeElement);
|
|
590
|
+
}
|
|
591
|
+
ngOnDestroy() {
|
|
592
|
+
this.focus.unregisterElement(this.elRef.nativeElement);
|
|
593
|
+
}
|
|
594
|
+
salvar() {
|
|
595
|
+
if (!this.model)
|
|
596
|
+
return;
|
|
597
|
+
const valMsg = valida(this.model, this.focus);
|
|
598
|
+
if (valMsg) {
|
|
599
|
+
this.notification.showMsgError(valMsg);
|
|
600
|
+
return;
|
|
601
|
+
}
|
|
602
|
+
this.isBusy = true;
|
|
603
|
+
this.ws.saveFuncionario(this.model)
|
|
604
|
+
.subscribe(r => {
|
|
605
|
+
this.isBusy = false;
|
|
606
|
+
this.notification.showMsg("Salvo com sucesso.");
|
|
607
|
+
if (this.dialogRef)
|
|
608
|
+
this.dialogRef.close(true);
|
|
609
|
+
}, err => {
|
|
610
|
+
this.isBusy = false;
|
|
611
|
+
this.notification.showMsg(err.error);
|
|
612
|
+
});
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
FuncionarioEditDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: FuncionarioEditDialogComponent, deps: [{ token: CommonWebService }, { token: NotificationService }, { token: MAT_DIALOG_DATA }, { token: i3.MatDialog }, { token: i0.ElementRef }, { token: i3.MatDialogRef }, { token: ScreenHelperService }], target: i0.ɵɵFactoryTarget.Component });
|
|
616
|
+
FuncionarioEditDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: FuncionarioEditDialogComponent, selector: "ox-funcionario-edit-dialog", ngImport: i0, template: "<div class=\"ox-header\">\n <h2 class=\"titulo\">Editando Funcion\u00E1rio</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-funcionario-form [model]=\"model\" *ngIf=\"model\"></ox-funcionario-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$1.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: FuncionarioFormComponent, selector: "ox-funcionario-form", inputs: ["model"] }] });
|
|
617
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: FuncionarioEditDialogComponent, decorators: [{
|
|
618
|
+
type: Component,
|
|
619
|
+
args: [{ selector: 'ox-funcionario-edit-dialog', template: "<div class=\"ox-header\">\n <h2 class=\"titulo\">Editando Funcion\u00E1rio</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-funcionario-form [model]=\"model\" *ngIf=\"model\"></ox-funcionario-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"] }]
|
|
620
|
+
}], ctorParameters: function () {
|
|
621
|
+
return [{ type: CommonWebService }, { type: NotificationService }, { type: undefined, decorators: [{
|
|
622
|
+
type: Inject,
|
|
623
|
+
args: [MAT_DIALOG_DATA]
|
|
624
|
+
}] }, { type: i3.MatDialog }, { type: i0.ElementRef }, { type: i3.MatDialogRef }, { type: ScreenHelperService }];
|
|
625
|
+
} });
|
|
626
|
+
|
|
627
|
+
const fadeAnimation = trigger('fade', [
|
|
628
|
+
transition(':enter', [
|
|
629
|
+
style({ transform: 'translateY(100%)', opacity: 0 }),
|
|
630
|
+
animate('250ms', style({ transform: 'translateY(0)', 'opacity': 1 }))
|
|
631
|
+
]),
|
|
632
|
+
transition(':leave', [
|
|
633
|
+
style({ transform: 'translateY(0)', 'opacity': 1 }),
|
|
634
|
+
animate('250ms', style({ transform: 'translateY(100%)', 'opacity': 0 })),
|
|
635
|
+
])
|
|
636
|
+
]);
|
|
637
|
+
const menuLateralAnimation = trigger('menuLateral', [
|
|
638
|
+
transition(':enter', [
|
|
639
|
+
style({ transform: 'translateX(-100%)', opacity: 1 }),
|
|
640
|
+
animate('200ms', style({ transform: 'translateX(0)', 'opacity': 1 }))
|
|
641
|
+
]),
|
|
642
|
+
transition(':leave', [
|
|
643
|
+
style({ 'opacity': 1 }),
|
|
644
|
+
animate('200ms', style({ 'opacity': 0 })),
|
|
645
|
+
])
|
|
646
|
+
]);
|
|
647
|
+
|
|
648
|
+
class LazyTrigger {
|
|
649
|
+
constructor(doFunc, timeout = 800) {
|
|
650
|
+
this.doFunc = doFunc;
|
|
651
|
+
this.timeout = timeout;
|
|
652
|
+
}
|
|
653
|
+
fire() {
|
|
654
|
+
console.debug("lazyTimeoutId");
|
|
655
|
+
if (this.lazyTimeoutId != undefined)
|
|
656
|
+
clearTimeout(this.lazyTimeoutId);
|
|
657
|
+
this.lazyTimeoutId = window.setTimeout(() => { this.doFunc(); }, this.timeout);
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
class AlertDialogComponent {
|
|
662
|
+
constructor(dialogRef, args) {
|
|
663
|
+
this.dialogRef = dialogRef;
|
|
664
|
+
this.args = args;
|
|
665
|
+
}
|
|
666
|
+
ngOnInit() {
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
AlertDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: AlertDialogComponent, deps: [{ token: i3.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
|
|
670
|
+
AlertDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: AlertDialogComponent, selector: "app-alert-dialog", ngImport: i0, template: "<h1 mat-dialog-title>{{args.titulo}}</h1>\n<div mat-dialog-content>\n <p>{{args.msg}}</p>\n</div>\n<mat-dialog-actions align=\"end\">\n <button mat-button [mat-dialog-close]=\"false\">Cancelar</button>\n <button mat-button [mat-dialog-close]=\"true\" cdkFocusInitial>Continuar</button>\n</mat-dialog-actions>", styles: [""], dependencies: [{ kind: "component", type: i6$1.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: "directive", type: i3.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i3.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i3.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i3.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }] });
|
|
671
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: AlertDialogComponent, decorators: [{
|
|
672
|
+
type: Component,
|
|
673
|
+
args: [{ selector: 'app-alert-dialog', template: "<h1 mat-dialog-title>{{args.titulo}}</h1>\n<div mat-dialog-content>\n <p>{{args.msg}}</p>\n</div>\n<mat-dialog-actions align=\"end\">\n <button mat-button [mat-dialog-close]=\"false\">Cancelar</button>\n <button mat-button [mat-dialog-close]=\"true\" cdkFocusInitial>Continuar</button>\n</mat-dialog-actions>" }]
|
|
674
|
+
}], ctorParameters: function () {
|
|
675
|
+
return [{ type: i3.MatDialogRef }, { type: undefined, decorators: [{
|
|
676
|
+
type: Inject,
|
|
677
|
+
args: [MAT_DIALOG_DATA]
|
|
678
|
+
}] }];
|
|
679
|
+
} });
|
|
680
|
+
|
|
681
|
+
class NavegacaoSelecaoDialogUtil {
|
|
682
|
+
constructor(view) {
|
|
683
|
+
this.view = view;
|
|
684
|
+
}
|
|
685
|
+
onKeyDown(event) {
|
|
686
|
+
console.info(event.keyCode);
|
|
687
|
+
let key = event.keyCode;
|
|
688
|
+
const selected = this.view.selectedItem;
|
|
689
|
+
const enterKey = 13, keyDown = 40, keyUp = 38;
|
|
690
|
+
if (key === enterKey) {
|
|
691
|
+
event.cancelBubble = true;
|
|
692
|
+
if (selected !== null && selected !== undefined) {
|
|
693
|
+
this.view.dialogRef.close(selected);
|
|
694
|
+
return;
|
|
695
|
+
}
|
|
696
|
+
key = keyDown;
|
|
697
|
+
}
|
|
698
|
+
if (key !== keyDown && key !== keyUp)
|
|
699
|
+
return;
|
|
700
|
+
let index = -1;
|
|
701
|
+
if (selected)
|
|
702
|
+
this.view.items.indexOf(selected, 0);
|
|
703
|
+
if (key === keyDown)
|
|
704
|
+
index++;
|
|
705
|
+
if (key === keyUp && index > 0)
|
|
706
|
+
index--;
|
|
707
|
+
if (index > (this.view.items.length - 1))
|
|
708
|
+
return;
|
|
709
|
+
this.view.selectedItem = this.view.items[index];
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
function confirmaExclusao(dialog, msg, continueFunc) {
|
|
713
|
+
const args = {
|
|
714
|
+
titulo: "Atenção",
|
|
715
|
+
msg: msg
|
|
716
|
+
};
|
|
717
|
+
const dialogRef = dialog.open(AlertDialogComponent, {
|
|
718
|
+
data: args
|
|
719
|
+
});
|
|
720
|
+
dialogRef.afterClosed().subscribe(dialogResult => {
|
|
721
|
+
if (dialogResult !== true)
|
|
722
|
+
return;
|
|
723
|
+
continueFunc();
|
|
724
|
+
});
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
class SearchSetting {
|
|
728
|
+
constructor(propChanged) {
|
|
729
|
+
this.propChanged = propChanged;
|
|
730
|
+
this._meses = ["JANEIRO", "FEVEREIRO", "MARÇO", "ABRIL", "MAIO", "JUNHO", "JULHO", "AGOSTO", "SETEMBRO", "OUTUBRO", "NOVEMBRO", "DEZEMBRO"];
|
|
731
|
+
this._mesesShort = ["JAN", "FEV", "MAR", "ABR", "MAI", "JUN", "JUL", "AGO", "SET", "OUT", "NOV", "DEZ"];
|
|
732
|
+
const now = new Date();
|
|
733
|
+
const hj = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 0, 0, 0, 0);
|
|
734
|
+
console.info(hj);
|
|
735
|
+
this.modo = SearchMode.Mensal;
|
|
736
|
+
this.mes = hj.getMonth() + 1;
|
|
737
|
+
this.ano = hj.getFullYear();
|
|
738
|
+
this.inicial = hj.addDays(-30);
|
|
739
|
+
this.final = hj;
|
|
740
|
+
}
|
|
741
|
+
set(prop, value) {
|
|
742
|
+
const me = this;
|
|
743
|
+
me[prop] = value;
|
|
744
|
+
if (this.propChanged !== undefined)
|
|
745
|
+
this.propChanged();
|
|
746
|
+
}
|
|
747
|
+
toStringArquivo() {
|
|
748
|
+
const ini = this.inicial;
|
|
749
|
+
const fim = this.final;
|
|
750
|
+
if (this.modo === SearchMode.Mensal)
|
|
751
|
+
return this.ano + "_" + this.mes;
|
|
752
|
+
if (this.modo === SearchMode.Anual)
|
|
753
|
+
return "" + this.ano;
|
|
754
|
+
if (this.modo === SearchMode.Diario)
|
|
755
|
+
return `${ini.getDate()}_${ini.getMonth() + 1}_${ini.getFullYear()}`;
|
|
756
|
+
return `${ini.getDate()}_${ini.getMonth() + 1}_${ini.getFullYear()}_ate_${fim.getDate()}_${fim.getMonth() + 1}_${fim.getFullYear()}`;
|
|
757
|
+
}
|
|
758
|
+
getDatasTexto(short = false) {
|
|
759
|
+
const ini = this.inicial;
|
|
760
|
+
const fim = this.final;
|
|
761
|
+
if (this.modo === SearchMode.Mensal && short)
|
|
762
|
+
return this._mesesShort[this.mes - 1] + " DE " + this.ano;
|
|
763
|
+
if (this.modo === SearchMode.Mensal)
|
|
764
|
+
return this._meses[this.mes - 1] + " DE " + this.ano;
|
|
765
|
+
if (this.modo === SearchMode.Anual)
|
|
766
|
+
return "" + this.ano;
|
|
767
|
+
if (this.modo === SearchMode.Diario)
|
|
768
|
+
return `${ini.getDate()}/${ini.getMonth() + 1}/${ini.getFullYear()}`;
|
|
769
|
+
return `${ini.getDate()}/${ini.getMonth() + 1}/${ini.getFullYear()} ATÉ ${fim.getDate()}/${fim.getMonth() + 1}/${fim.getFullYear()}`;
|
|
770
|
+
}
|
|
771
|
+
goNextMonth() {
|
|
772
|
+
this.mes++;
|
|
773
|
+
if (this.mes > 12) {
|
|
774
|
+
this.mes = 1;
|
|
775
|
+
this.ano += 1;
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
goBackMonth() {
|
|
779
|
+
this.mes--;
|
|
780
|
+
if (this.mes < 1) {
|
|
781
|
+
this.mes = 12;
|
|
782
|
+
this.ano -= 1;
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
var SearchMode;
|
|
787
|
+
(function (SearchMode) {
|
|
788
|
+
SearchMode[SearchMode["Mensal"] = 0] = "Mensal";
|
|
789
|
+
SearchMode[SearchMode["Anual"] = 1] = "Anual";
|
|
790
|
+
SearchMode[SearchMode["Periodo"] = 2] = "Periodo";
|
|
791
|
+
SearchMode[SearchMode["Diario"] = 3] = "Diario";
|
|
792
|
+
})(SearchMode || (SearchMode = {}));
|
|
793
|
+
|
|
794
|
+
class AuthDataService {
|
|
795
|
+
constructor() {
|
|
796
|
+
this.isLoggedIn = false;
|
|
797
|
+
this.token = '';
|
|
798
|
+
this.sensoresDef = { energizacao: false, garagem: false, portaCliente: false, portaServico: false };
|
|
799
|
+
this.permissoes = {
|
|
800
|
+
gerencialCaixasAgrupadoMensal: false,
|
|
801
|
+
financasLogin: false,
|
|
802
|
+
financasDespesaAdd: false,
|
|
803
|
+
financasDespesaUltimosCadastros: false,
|
|
804
|
+
financasDespesaPesquisar: false,
|
|
805
|
+
financasDespesaDelete: false,
|
|
806
|
+
financasDespesaEditar: false,
|
|
807
|
+
financasReceitaAdd: false,
|
|
808
|
+
financasReceitaUltimosCadastros: false,
|
|
809
|
+
financasReceitaPesquisar: false,
|
|
810
|
+
financasReceitaDelete: false,
|
|
811
|
+
financasReceitaEditar: false,
|
|
812
|
+
financasClientePesquisa: false,
|
|
813
|
+
financasClienteAdd: false,
|
|
814
|
+
financasClienteDelete: false,
|
|
815
|
+
financasFornecedorPesquisa: false,
|
|
816
|
+
financasFornecedorAdd: false,
|
|
817
|
+
financasFornecedorDelete: false,
|
|
818
|
+
financasMarcadorPesquisa: false,
|
|
819
|
+
financasMarcadorAdd: false,
|
|
820
|
+
financasMarcadorDelete: false,
|
|
821
|
+
financasDespesaGrupoPesquisa: false,
|
|
822
|
+
financasDespesaGrupoAdd: false,
|
|
823
|
+
financasDespesaGrupoDelete: false,
|
|
824
|
+
financasReceitaGrupoPesquisa: false,
|
|
825
|
+
financasReceitaGrupoAdd: false,
|
|
826
|
+
financasReceitaGrupoDelete: false,
|
|
827
|
+
financasContaPesquisa: false,
|
|
828
|
+
financasContaAdd: false,
|
|
829
|
+
financasContaDelete: false,
|
|
830
|
+
financasExtrato: false,
|
|
831
|
+
financasContaAjuste: false,
|
|
832
|
+
financasGradeAnualDespesa: false,
|
|
833
|
+
financasGradeAnualReceita: false,
|
|
834
|
+
financasMensal: false,
|
|
835
|
+
financasConfiguracoes: false,
|
|
836
|
+
recepcaoEnergizar: false,
|
|
837
|
+
recepcaoConfiguracoes: false,
|
|
838
|
+
recepcaoTrocaOperador: false,
|
|
839
|
+
recepcaoCancelarOcupacao: false,
|
|
840
|
+
recepcaoAcrescimo: false,
|
|
841
|
+
recepcaoDesconto: false,
|
|
842
|
+
recepcaoLimpeza: false,
|
|
843
|
+
recepcaoAtrasarHora: false,
|
|
844
|
+
gerencialLogin: false,
|
|
845
|
+
gerencialPrincipal: false,
|
|
846
|
+
gerencialPrincipalCaixa: false,
|
|
847
|
+
gerencialPrincipalInfo: false,
|
|
848
|
+
gerencialPrincipalQuantidadeOcupacoesDia: false,
|
|
849
|
+
gerencialDiario: false,
|
|
850
|
+
gerencialMensal: false,
|
|
851
|
+
gerencialResumoMensal: false,
|
|
852
|
+
gerencialPorFormaPagamento: false,
|
|
853
|
+
gerencialMediaTempoOcupacao: false,
|
|
854
|
+
gerencialPorOcupacao: false,
|
|
855
|
+
gerencialOcupacoesCanceladas: false,
|
|
856
|
+
gerencialAgrupado: false,
|
|
857
|
+
gerencialPorTurno: false,
|
|
858
|
+
gerencialConsumoFuncionarios: false,
|
|
859
|
+
gerencialConsumoProdutos: false,
|
|
860
|
+
gerencialImagensrecepcao: false,
|
|
861
|
+
gerencialCaixas: false,
|
|
862
|
+
gerencialVerificacaoCaixa: false,
|
|
863
|
+
gerencialComandasPorCaixa: false,
|
|
864
|
+
gerencialRegistrorecepcao: false,
|
|
865
|
+
gerencialAgrupadoDia: false,
|
|
866
|
+
gerencialLogUsuarios: false,
|
|
867
|
+
gerencialPesquisaOcupacoes: false,
|
|
868
|
+
gerencialDescontos: false,
|
|
869
|
+
gerencialGraficoMensal: false,
|
|
870
|
+
gerencialGraficoDiaSemana: false,
|
|
871
|
+
gerencialGraficoAnual: false,
|
|
872
|
+
gerencialGraficoSituacaoSuite: false,
|
|
873
|
+
gerencialOcupacoesHoraClasse: false,
|
|
874
|
+
gerencialLimpezasStatus: false,
|
|
875
|
+
gerencialVendasPorRecepcionistas: false,
|
|
876
|
+
estoqueLogin: false,
|
|
877
|
+
estoqueListaCompras: false,
|
|
878
|
+
estoqueListaProdutoGrupo: false,
|
|
879
|
+
estoqueMovimento: false,
|
|
880
|
+
estoqueSaldoProdutos: false,
|
|
881
|
+
estoqueNotaEntradaAdd: false,
|
|
882
|
+
estoqueNotaEntradaDelete: false,
|
|
883
|
+
estoqueNotaSaidaAdd: false,
|
|
884
|
+
estoqueNotaSaidaDelete: false,
|
|
885
|
+
estoqueAjusteAdd: false,
|
|
886
|
+
estoqueAjusteDelete: false,
|
|
887
|
+
estoqueTrocaSetorAdd: false,
|
|
888
|
+
estoqueTrocaSetorDelete: false,
|
|
889
|
+
estoqueFornecedorPesquisa: false,
|
|
890
|
+
estoqueFornecedorAdd: false,
|
|
891
|
+
estoqueFornecedorDelete: false,
|
|
892
|
+
estoqueClientePesquisa: false,
|
|
893
|
+
estoqueClienteAdd: false,
|
|
894
|
+
estoqueClienteDelete: false,
|
|
895
|
+
estoqueSetorPesquisa: false,
|
|
896
|
+
estoqueSetorAdd: false,
|
|
897
|
+
estoqueSetorDelete: false,
|
|
898
|
+
estoqueProdutoPesquisa: false,
|
|
899
|
+
estoqueProdutoAdd: false,
|
|
900
|
+
estoqueProdutoDelete: false,
|
|
901
|
+
estoqueProdutoGrupoPesquisa: false,
|
|
902
|
+
estoqueProdutoGrupoAdd: false,
|
|
903
|
+
estoqueProdutoGrupoDelete: false,
|
|
904
|
+
estoqueConfiguracao: false,
|
|
905
|
+
adminLogin: false,
|
|
906
|
+
adminProdutoPesquisa: false,
|
|
907
|
+
adminProdutoAdd: false,
|
|
908
|
+
adminProdutoDelete: false,
|
|
909
|
+
adminProdutoGrupoPesquisa: false,
|
|
910
|
+
adminProdutoGrupoAdd: false,
|
|
911
|
+
adminProdutoGrupoDelete: false,
|
|
912
|
+
adminSuitePesquisa: false,
|
|
913
|
+
adminSuiteAdd: false,
|
|
914
|
+
adminSuiteDelete: false,
|
|
915
|
+
adminSuiteClassePesquisa: false,
|
|
916
|
+
adminSuiteClasseAdd: false,
|
|
917
|
+
adminSuiteClasseDelete: false,
|
|
918
|
+
adminOperadorPesquisa: false,
|
|
919
|
+
adminOperadorAdd: false,
|
|
920
|
+
adminOperadorDelete: false,
|
|
921
|
+
adminFuncionarioPesquisa: false,
|
|
922
|
+
adminFuncionarioAdd: false,
|
|
923
|
+
adminFuncionarioDelete: false,
|
|
924
|
+
adminUsuariosPesquisa: false,
|
|
925
|
+
adminUsuariosAdd: false,
|
|
926
|
+
adminUsuariosDelete: false,
|
|
927
|
+
adminPrecos: false,
|
|
928
|
+
adminPatrimonios: false,
|
|
929
|
+
adminDefinicoesGerais: false,
|
|
930
|
+
adminEditarComanda: false,
|
|
931
|
+
adminCortesiaVale: false,
|
|
932
|
+
adminClienteFidelidade: false,
|
|
933
|
+
adminConfiguracoes: false,
|
|
934
|
+
adminPesquisaSatisfacao: false,
|
|
935
|
+
onGerencialLogin: false,
|
|
936
|
+
onGerencialPrincipal: false,
|
|
937
|
+
onGerencialDiario: false,
|
|
938
|
+
onGerencialMensal: false,
|
|
939
|
+
onGerencialPorFormaPagamento: false,
|
|
940
|
+
onGerencialMediaTempoOcupacao: false,
|
|
941
|
+
onGerencialPorOcupacao: false,
|
|
942
|
+
onGerencialOcupacoesCanceladas: false,
|
|
943
|
+
onGerencialAgrupadoDia: false,
|
|
944
|
+
onGerencialPorTurno: false,
|
|
945
|
+
onGerencialConsumoFuncionarios: false,
|
|
946
|
+
onGerencialConsumoProdutos: false,
|
|
947
|
+
onGerencialImagensRecepcao: false,
|
|
948
|
+
onGerencialCaixas: false,
|
|
949
|
+
onGerencialComandasPorCaixa: false,
|
|
950
|
+
onGerencialRegistroRecepcao: false,
|
|
951
|
+
onGerencialGraficoMensal: false,
|
|
952
|
+
onGerencialGraficoDiaSemana: false,
|
|
953
|
+
onGerencialGraficoAnual: false,
|
|
954
|
+
onGerencialGraficoSituacaoSuite: false,
|
|
955
|
+
onGerencialOcupacoesHoraClasse: false,
|
|
956
|
+
onadminLogin: false,
|
|
957
|
+
onadminProdutoPesquisa: false,
|
|
958
|
+
onadminProdutoAdd: false,
|
|
959
|
+
onadminProdutoDelete: false,
|
|
960
|
+
onadminProdutoGrupoPesquisa: false,
|
|
961
|
+
onadminProdutoGrupoAdd: false,
|
|
962
|
+
onadminProdutoGrupoDelete: false,
|
|
963
|
+
onadminSuitePesquisa: false,
|
|
964
|
+
onadminSuiteAdd: false,
|
|
965
|
+
onadminSuiteDelete: false,
|
|
966
|
+
onadminSuiteClassePesquisa: false,
|
|
967
|
+
onadminSuiteClasseAdd: false,
|
|
968
|
+
onadminSuiteClasseDelete: false,
|
|
969
|
+
onadminUsuariosPesquisa: false,
|
|
970
|
+
onadminUsuariosAdd: false,
|
|
971
|
+
onadminUsuariosDelete: false,
|
|
972
|
+
onadminOperadorPesquisa: false,
|
|
973
|
+
onadminOperadorAdd: false,
|
|
974
|
+
onadminOperadorDelete: false,
|
|
975
|
+
onadminFuncionarioPesquisa: false,
|
|
976
|
+
onadminFuncionarioAdd: false,
|
|
977
|
+
onadminFuncionarioDelete: false,
|
|
978
|
+
onadminPrecos: false,
|
|
979
|
+
onadminDefinicoesGerais: false,
|
|
980
|
+
onadminCortesiaVale: false,
|
|
981
|
+
};
|
|
982
|
+
this.empresaNome = '';
|
|
983
|
+
this.empresaId = 0;
|
|
984
|
+
this.loginNome = '';
|
|
985
|
+
this.userId = 0;
|
|
986
|
+
this.email = '';
|
|
987
|
+
this.nome = '';
|
|
988
|
+
}
|
|
989
|
+
login(result) {
|
|
990
|
+
this.isLoggedIn = true;
|
|
991
|
+
this.token = result.token;
|
|
992
|
+
this.sensoresDef = result.sensoresDef;
|
|
993
|
+
this.permissoes = result.permissoes;
|
|
994
|
+
this.empresaNome = result.empresaNome;
|
|
995
|
+
this.empresaId = result.empresaId;
|
|
996
|
+
this.loginNome = result.login;
|
|
997
|
+
this.userId = result.userId;
|
|
998
|
+
this.nome = result.nome;
|
|
999
|
+
this.email = result.email;
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
AuthDataService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: AuthDataService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1003
|
+
AuthDataService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: AuthDataService, providedIn: 'root' });
|
|
1004
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: AuthDataService, decorators: [{
|
|
1005
|
+
type: Injectable,
|
|
1006
|
+
args: [{
|
|
1007
|
+
providedIn: 'root'
|
|
1008
|
+
}]
|
|
1009
|
+
}], ctorParameters: function () { return []; } });
|
|
1010
|
+
|
|
1011
|
+
class ItemCardComponent {
|
|
1012
|
+
constructor() { }
|
|
1013
|
+
ngOnInit() {
|
|
1014
|
+
}
|
|
1015
|
+
}
|
|
1016
|
+
ItemCardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ItemCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1017
|
+
ItemCardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: ItemCardComponent, selector: "ox-item-card", inputs: { nome: "nome", codigo: "codigo", star: "star", cloud: "cloud", desativado: "desativado" }, ngImport: i0, template: "<div class=\"nome-codigo-row\"><span class=\"codigo\" *ngIf=\"codigo\">{{codigo}}</span>{{nome}}</div>\n<div class=\"icons-row\">\n <span class=\"material-icons star\" *ngIf=\"star\">\n grade\n </span>\n <span class=\"material-icons desativado\" *ngIf=\"desativado === true\">\n dangerous\n </span>\n <span class=\"material-icons sync-pendente\" *ngIf=\"cloud === false\">\n cloud_queue\n </span>\n <span class=\"material-icons sync-concluido\" *ngIf=\"cloud === true\">\n cloud_done\n </span>\n</div>\n", styles: [":host{display:flex;flex-direction:row;border-bottom:1px solid #e6e9ec;border-left:3px solid #e6e9ec;padding:12px 16px;background:#fff;justify-content:space-between;cursor:pointer;flex-shrink:0;align-items:center;transition:border-left-color 1s;-webkit-user-select:none;user-select:none;font-size:small}:host:hover{box-shadow:0 0 16px #0000000f;background:transparent;z-index:1}:host(.selected){border-left-color:var(--app-color, black);z-index:1;box-shadow:0 0 8px 5px #00000008;flex-shrink:0;background:linear-gradient(45deg,var(--item-card-selected-bg, rgba(0, 0, 0, .05)),transparent)}.nome-codigo-row{display:flex;flex-direction:row;flex-grow:1;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;margin-right:8px}.icons-row{display:flex;flex-direction:row;align-items:center;gap:8px}.codigo{color:#666;font-size:x-small;border-radius:4px;padding:0 4px;width:50px;min-width:50px;text-align:center;border:1px solid #eee;margin-right:16px;display:flex;align-items:center;justify-content:center}.sync-pendente{color:#141212;font-size:16px}.sync-concluido{color:#dbdbdb;font-size:16px}.star{color:#000}.desativado{color:#8f07bb;font-size:16px}\n"], dependencies: [{ kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
1018
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ItemCardComponent, decorators: [{
|
|
1019
|
+
type: Component,
|
|
1020
|
+
args: [{ selector: 'ox-item-card', template: "<div class=\"nome-codigo-row\"><span class=\"codigo\" *ngIf=\"codigo\">{{codigo}}</span>{{nome}}</div>\n<div class=\"icons-row\">\n <span class=\"material-icons star\" *ngIf=\"star\">\n grade\n </span>\n <span class=\"material-icons desativado\" *ngIf=\"desativado === true\">\n dangerous\n </span>\n <span class=\"material-icons sync-pendente\" *ngIf=\"cloud === false\">\n cloud_queue\n </span>\n <span class=\"material-icons sync-concluido\" *ngIf=\"cloud === true\">\n cloud_done\n </span>\n</div>\n", styles: [":host{display:flex;flex-direction:row;border-bottom:1px solid #e6e9ec;border-left:3px solid #e6e9ec;padding:12px 16px;background:#fff;justify-content:space-between;cursor:pointer;flex-shrink:0;align-items:center;transition:border-left-color 1s;-webkit-user-select:none;user-select:none;font-size:small}:host:hover{box-shadow:0 0 16px #0000000f;background:transparent;z-index:1}:host(.selected){border-left-color:var(--app-color, black);z-index:1;box-shadow:0 0 8px 5px #00000008;flex-shrink:0;background:linear-gradient(45deg,var(--item-card-selected-bg, rgba(0, 0, 0, .05)),transparent)}.nome-codigo-row{display:flex;flex-direction:row;flex-grow:1;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;margin-right:8px}.icons-row{display:flex;flex-direction:row;align-items:center;gap:8px}.codigo{color:#666;font-size:x-small;border-radius:4px;padding:0 4px;width:50px;min-width:50px;text-align:center;border:1px solid #eee;margin-right:16px;display:flex;align-items:center;justify-content:center}.sync-pendente{color:#141212;font-size:16px}.sync-concluido{color:#dbdbdb;font-size:16px}.star{color:#000}.desativado{color:#8f07bb;font-size:16px}\n"] }]
|
|
1021
|
+
}], ctorParameters: function () { return []; }, propDecorators: { nome: [{
|
|
1022
|
+
type: Input
|
|
1023
|
+
}], codigo: [{
|
|
1024
|
+
type: Input
|
|
1025
|
+
}], star: [{
|
|
1026
|
+
type: Input
|
|
1027
|
+
}], cloud: [{
|
|
1028
|
+
type: Input
|
|
1029
|
+
}], desativado: [{
|
|
1030
|
+
type: Input
|
|
1031
|
+
}] } });
|
|
1032
|
+
|
|
1033
|
+
class FuncionariosComponent {
|
|
1034
|
+
constructor(ws, notification, dialog, auth, screenHelper) {
|
|
1035
|
+
this.ws = ws;
|
|
1036
|
+
this.notification = notification;
|
|
1037
|
+
this.dialog = dialog;
|
|
1038
|
+
this.screenHelper = screenHelper;
|
|
1039
|
+
this.isBusy = false;
|
|
1040
|
+
this.items = [];
|
|
1041
|
+
this.selectedItem = null;
|
|
1042
|
+
this.lazyTrigger = new LazyTrigger(() => { this.atualiza(); });
|
|
1043
|
+
this.setting = new SearchSetting();
|
|
1044
|
+
this.focus = new FocusService();
|
|
1045
|
+
this.allowAdd = auth.permissoes.adminFuncionarioAdd;
|
|
1046
|
+
this.allowExcluir = auth.permissoes.adminFuncionarioDelete;
|
|
1047
|
+
this.mobile = this.screenHelper.isMedium;
|
|
1048
|
+
this.screenHelper.changedMediumScreen.subscribe(x => this.mobile = x);
|
|
1049
|
+
}
|
|
1050
|
+
ngOnInit() {
|
|
1051
|
+
this.setting.ordem = "nome";
|
|
1052
|
+
this.atualiza();
|
|
1053
|
+
}
|
|
1054
|
+
onSelectItem() {
|
|
1055
|
+
if (!this.focus.hasInit()) {
|
|
1056
|
+
setTimeout(() => {
|
|
1057
|
+
this.focus.registerElementById("form-column");
|
|
1058
|
+
this.focus.setFirst();
|
|
1059
|
+
}, 500);
|
|
1060
|
+
//this._focus.registerElementById("form-column");
|
|
1061
|
+
}
|
|
1062
|
+
else {
|
|
1063
|
+
this.focus.setFirst();
|
|
1064
|
+
}
|
|
1065
|
+
}
|
|
1066
|
+
ngOnDestroy() {
|
|
1067
|
+
this.focus.unregisterElementById("form-column");
|
|
1068
|
+
}
|
|
1069
|
+
atualiza() {
|
|
1070
|
+
this.isBusy = true;
|
|
1071
|
+
this.ws.buscaFuncionario(this.setting)
|
|
1072
|
+
.subscribe(r => {
|
|
1073
|
+
this.items = r;
|
|
1074
|
+
this.selectedItem = null;
|
|
1075
|
+
console.info(r);
|
|
1076
|
+
this.isBusy = false;
|
|
1077
|
+
}, err => {
|
|
1078
|
+
this.isBusy = false;
|
|
1079
|
+
this.notification.showHttpError(err);
|
|
1080
|
+
});
|
|
1081
|
+
}
|
|
1082
|
+
excluir() {
|
|
1083
|
+
const item = this.selectedItem;
|
|
1084
|
+
if (!item)
|
|
1085
|
+
return;
|
|
1086
|
+
confirmaExclusao(this.dialog, `Deseja prosseguir com a exclusão do funcionário ${item.nome}?`, () => {
|
|
1087
|
+
this.isBusy = true;
|
|
1088
|
+
this.ws.deleteFuncionario(item.id)
|
|
1089
|
+
.subscribe(r => {
|
|
1090
|
+
this.notification.showMsg("O funcionário foi excluído com sucesso.");
|
|
1091
|
+
this.items.remove(item);
|
|
1092
|
+
this.selectedItem = null;
|
|
1093
|
+
this.isBusy = false;
|
|
1094
|
+
}, err => {
|
|
1095
|
+
this.isBusy = false;
|
|
1096
|
+
this.notification.showMsg(err.error);
|
|
1097
|
+
});
|
|
1098
|
+
});
|
|
1099
|
+
}
|
|
1100
|
+
novo() {
|
|
1101
|
+
let height = (window.innerHeight * 0.90) + 'px';
|
|
1102
|
+
let width = 550 + 'px';
|
|
1103
|
+
if (this.mobile) {
|
|
1104
|
+
width = (window.innerWidth * 0.99) + 'px';
|
|
1105
|
+
//height = (window.innerHeight * 0.98) + 'px';
|
|
1106
|
+
}
|
|
1107
|
+
const dialog = this.dialog.open(FuncionarioAddDialogComponent, {
|
|
1108
|
+
width: width,
|
|
1109
|
+
//height: height,
|
|
1110
|
+
maxWidth: '100%',
|
|
1111
|
+
panelClass: 'dialog-p0',
|
|
1112
|
+
});
|
|
1113
|
+
dialog.afterClosed().subscribe(result => {
|
|
1114
|
+
if (result === undefined)
|
|
1115
|
+
return;
|
|
1116
|
+
this.notification.showMsg("Salvo com sucesso.");
|
|
1117
|
+
this.atualiza();
|
|
1118
|
+
});
|
|
1119
|
+
}
|
|
1120
|
+
abreCadastro(item) {
|
|
1121
|
+
let height = undefined;
|
|
1122
|
+
let width = 550 + 'px';
|
|
1123
|
+
if (this.mobile) {
|
|
1124
|
+
width = (window.innerWidth * 0.99) + 'px';
|
|
1125
|
+
height = (window.innerHeight * 0.99) + 'px';
|
|
1126
|
+
}
|
|
1127
|
+
const dialog = this.dialog.open(FuncionarioEditDialogComponent, {
|
|
1128
|
+
data: item,
|
|
1129
|
+
width: width,
|
|
1130
|
+
//height: height,
|
|
1131
|
+
maxWidth: '100%',
|
|
1132
|
+
panelClass: 'dialog-p0',
|
|
1133
|
+
});
|
|
1134
|
+
dialog.afterClosed().subscribe(result => {
|
|
1135
|
+
if (result !== true)
|
|
1136
|
+
return;
|
|
1137
|
+
this.notification.showMsg("Salvo com sucesso.");
|
|
1138
|
+
this.atualiza();
|
|
1139
|
+
});
|
|
1140
|
+
}
|
|
1141
|
+
salvar() {
|
|
1142
|
+
const item = this.selectedItem;
|
|
1143
|
+
if (!item)
|
|
1144
|
+
return;
|
|
1145
|
+
const valMsg = valida(item, this.focus);
|
|
1146
|
+
if (valMsg) {
|
|
1147
|
+
this.notification.showMsgError(valMsg);
|
|
1148
|
+
return;
|
|
1149
|
+
}
|
|
1150
|
+
this.isBusy = true;
|
|
1151
|
+
this.ws.saveFuncionario(item)
|
|
1152
|
+
.subscribe(r => {
|
|
1153
|
+
this.notification.showMsg("Salvo com sucesso.");
|
|
1154
|
+
this.isBusy = false;
|
|
1155
|
+
}, err => {
|
|
1156
|
+
this.isBusy = false;
|
|
1157
|
+
this.notification.showMsg(err.error);
|
|
1158
|
+
});
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
1161
|
+
FuncionariosComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: FuncionariosComponent, deps: [{ token: CommonWebService }, { token: NotificationService }, { token: i3.MatDialog }, { token: AuthDataService }, { token: ScreenHelperService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1162
|
+
FuncionariosComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: FuncionariosComponent, selector: "ox-funcionarios", ngImport: i0, template: "<ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>\n<div class=\"tool-panel\" *ngIf=\"mobile\">\n <div class=\"tool-section\">\n <label>Pesquisa</label>\n <div class=\"search-input-container\">\n <input [(ngModel)]=\"setting.frase\" placeholder=\"Digite um termo de busca...\" (input)=\"lazyTrigger.fire()\">\n </div>\n </div>\n <div class=\"tool-section ordem-sm2\">\n <label>A\u00E7\u00F5es</label>\n <div class=\"tool-row\">\n <button mat-icon-button (click)=\"atualiza()\">\n <mat-icon aria-label=\"Atualizar\">refresh</mat-icon>\n </button>\n <button mat-icon-button (click)=\"novo()\" *ngIf=\"allowAdd\">\n <mat-icon aria-label=\"Novo\">add</mat-icon>\n </button>\n <button mat-icon-button (click)=\"excluir()\" *ngIf=\"selectedItem && allowExcluir\" [@fade]>\n <mat-icon aria-label=\"Excluir\">delete</mat-icon>\n </button>\n </div>\n </div>\n</div>\n<div class=\"result-container\" *ngIf=\"items\">\n <div class=\"cards-container cards-container-shadow\" *ngIf=\"mobile\">\n <ox-item-card [cloud]=\"i.enviadoPC\" [nome]=\"i.nome\" *ngFor=\"let i of items\" (click)=\"abreCadastro(i)\"></ox-item-card>\n </div>\n <div class=\"listagem-desktop-grid\" *ngIf=\"!mobile\">\n <div class=\"listagem-column-container listagem-list-column\">\n <h3>Funcion\u00E1rios</h3>\n <div class=\"tool-panel tool-panel-float\">\n <div class=\"tool-section\">\n <label>Pesquisa</label>\n <div class=\"search-input-container\">\n <input [(ngModel)]=\"setting.frase\" placeholder=\"Digite um termo de busca...\" (input)=\"lazyTrigger.fire()\">\n </div>\n </div>\n <div class=\"tool-section ordem-sm2\">\n <label>A\u00E7\u00F5es</label>\n <div class=\"tool-row\">\n <button mat-icon-button (click)=\"atualiza()\">\n <mat-icon aria-label=\"Atualizar\">refresh</mat-icon>\n </button>\n <button mat-icon-button (click)=\"novo()\" *ngIf=\"allowAdd\">\n <mat-icon aria-label=\"Novo\">add</mat-icon>\n </button>\n <button mat-icon-button (click)=\"excluir()\" *ngIf=\"selectedItem && allowExcluir\" [@fade]>\n <mat-icon aria-label=\"Excluir\">delete</mat-icon>\n </button>\n </div>\n </div>\n </div>\n <div class=\"listagem-list-container\">\n <h4 *ngIf=\"items.length === 0\" class=\"nenhum-item-msg\">A busca n\u00E3o retornou resultados</h4>\n\n <ox-item-card [cloud]=\"i.enviadoPC\" [nome]=\"i.nome\" *ngFor=\"let i of items\" [class.selected]=\"i === selectedItem\"\n (click)=\"selectedItem = i;\"></ox-item-card>\n\n </div>\n </div>\n <div class=\"listagem-column-container listagem-column-form\">\n <h3 *ngIf=\"!selectedItem\">Selecione um funcion\u00E1rio no lado direito</h3>\n <h3 *ngIf=\"selectedItem\">{{selectedItem.nome | uppercase}}</h3>\n <div class=\"listagem-form-container\">\n <ox-funcionario-form [@fade] [model]=\"selectedItem\" *ngIf=\"selectedItem\">\n </ox-funcionario-form>\n </div>\n\n <div class=\"listagem-form-acoes\">\n <button (click)=\"salvar()\" mat-fab color=\"primary\" *ngIf=\"selectedItem\" tabindex=\"20\">\n <mat-icon>save</mat-icon>\n </button>\n </div>\n </div>\n </div>\n</div>", styles: [":host{height:calc(100% - 48px);display:flex;flex-grow:1;flex-direction:column;background:#F0F0F0}:host{background-color:#fdfdfd}\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: "directive", type: i7.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i6$1.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: "component", type: BusyIndicatorComponent, selector: "ox-busy-indicator", inputs: ["isBusy"] }, { kind: "component", type: ItemCardComponent, selector: "ox-item-card", inputs: ["nome", "codigo", "star", "cloud", "desativado"] }, { kind: "component", type: FuncionarioFormComponent, selector: "ox-funcionario-form", inputs: ["model"] }, { kind: "pipe", type: i6.UpperCasePipe, name: "uppercase" }], animations: [fadeAnimation] });
|
|
1163
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: FuncionariosComponent, decorators: [{
|
|
1164
|
+
type: Component,
|
|
1165
|
+
args: [{ selector: 'ox-funcionarios', animations: [fadeAnimation], template: "<ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>\n<div class=\"tool-panel\" *ngIf=\"mobile\">\n <div class=\"tool-section\">\n <label>Pesquisa</label>\n <div class=\"search-input-container\">\n <input [(ngModel)]=\"setting.frase\" placeholder=\"Digite um termo de busca...\" (input)=\"lazyTrigger.fire()\">\n </div>\n </div>\n <div class=\"tool-section ordem-sm2\">\n <label>A\u00E7\u00F5es</label>\n <div class=\"tool-row\">\n <button mat-icon-button (click)=\"atualiza()\">\n <mat-icon aria-label=\"Atualizar\">refresh</mat-icon>\n </button>\n <button mat-icon-button (click)=\"novo()\" *ngIf=\"allowAdd\">\n <mat-icon aria-label=\"Novo\">add</mat-icon>\n </button>\n <button mat-icon-button (click)=\"excluir()\" *ngIf=\"selectedItem && allowExcluir\" [@fade]>\n <mat-icon aria-label=\"Excluir\">delete</mat-icon>\n </button>\n </div>\n </div>\n</div>\n<div class=\"result-container\" *ngIf=\"items\">\n <div class=\"cards-container cards-container-shadow\" *ngIf=\"mobile\">\n <ox-item-card [cloud]=\"i.enviadoPC\" [nome]=\"i.nome\" *ngFor=\"let i of items\" (click)=\"abreCadastro(i)\"></ox-item-card>\n </div>\n <div class=\"listagem-desktop-grid\" *ngIf=\"!mobile\">\n <div class=\"listagem-column-container listagem-list-column\">\n <h3>Funcion\u00E1rios</h3>\n <div class=\"tool-panel tool-panel-float\">\n <div class=\"tool-section\">\n <label>Pesquisa</label>\n <div class=\"search-input-container\">\n <input [(ngModel)]=\"setting.frase\" placeholder=\"Digite um termo de busca...\" (input)=\"lazyTrigger.fire()\">\n </div>\n </div>\n <div class=\"tool-section ordem-sm2\">\n <label>A\u00E7\u00F5es</label>\n <div class=\"tool-row\">\n <button mat-icon-button (click)=\"atualiza()\">\n <mat-icon aria-label=\"Atualizar\">refresh</mat-icon>\n </button>\n <button mat-icon-button (click)=\"novo()\" *ngIf=\"allowAdd\">\n <mat-icon aria-label=\"Novo\">add</mat-icon>\n </button>\n <button mat-icon-button (click)=\"excluir()\" *ngIf=\"selectedItem && allowExcluir\" [@fade]>\n <mat-icon aria-label=\"Excluir\">delete</mat-icon>\n </button>\n </div>\n </div>\n </div>\n <div class=\"listagem-list-container\">\n <h4 *ngIf=\"items.length === 0\" class=\"nenhum-item-msg\">A busca n\u00E3o retornou resultados</h4>\n\n <ox-item-card [cloud]=\"i.enviadoPC\" [nome]=\"i.nome\" *ngFor=\"let i of items\" [class.selected]=\"i === selectedItem\"\n (click)=\"selectedItem = i;\"></ox-item-card>\n\n </div>\n </div>\n <div class=\"listagem-column-container listagem-column-form\">\n <h3 *ngIf=\"!selectedItem\">Selecione um funcion\u00E1rio no lado direito</h3>\n <h3 *ngIf=\"selectedItem\">{{selectedItem.nome | uppercase}}</h3>\n <div class=\"listagem-form-container\">\n <ox-funcionario-form [@fade] [model]=\"selectedItem\" *ngIf=\"selectedItem\">\n </ox-funcionario-form>\n </div>\n\n <div class=\"listagem-form-acoes\">\n <button (click)=\"salvar()\" mat-fab color=\"primary\" *ngIf=\"selectedItem\" tabindex=\"20\">\n <mat-icon>save</mat-icon>\n </button>\n </div>\n </div>\n </div>\n</div>", styles: [":host{height:calc(100% - 48px);display:flex;flex-grow:1;flex-direction:column;background:#F0F0F0}:host{background-color:#fdfdfd}\n"] }]
|
|
1166
|
+
}], ctorParameters: function () { return [{ type: CommonWebService }, { type: NotificationService }, { type: i3.MatDialog }, { type: AuthDataService }, { type: ScreenHelperService }]; } });
|
|
1167
|
+
|
|
1168
|
+
var ModalidadeBaseICMS;
|
|
1169
|
+
(function (ModalidadeBaseICMS) {
|
|
1170
|
+
ModalidadeBaseICMS[ModalidadeBaseICMS["MargemValorAgregado"] = 0] = "MargemValorAgregado";
|
|
1171
|
+
ModalidadeBaseICMS[ModalidadeBaseICMS["PautaValor"] = 1] = "PautaValor";
|
|
1172
|
+
ModalidadeBaseICMS[ModalidadeBaseICMS["Pre\u00E7oTabeladoMax"] = 2] = "Pre\u00E7oTabeladoMax";
|
|
1173
|
+
ModalidadeBaseICMS[ModalidadeBaseICMS["ValorDaOpera\u00E7\u00E3o"] = 3] = "ValorDaOpera\u00E7\u00E3o";
|
|
1174
|
+
})(ModalidadeBaseICMS || (ModalidadeBaseICMS = {}));
|
|
1175
|
+
function createProduct() {
|
|
1176
|
+
return {
|
|
1177
|
+
id: 0,
|
|
1178
|
+
nome: '',
|
|
1179
|
+
unidade: 'UN',
|
|
1180
|
+
precoCusto: 0,
|
|
1181
|
+
precoVenda: 0,
|
|
1182
|
+
precoFuncionario: 0,
|
|
1183
|
+
estoqueMinimo: 0,
|
|
1184
|
+
referencia: '',
|
|
1185
|
+
aliquotaICMS: null,
|
|
1186
|
+
ncm: null,
|
|
1187
|
+
grupoId: 0,
|
|
1188
|
+
grupoNome: null,
|
|
1189
|
+
subgrupoId: 0,
|
|
1190
|
+
subgrupoNome: null,
|
|
1191
|
+
quantidadeSuite: 0,
|
|
1192
|
+
estoqueControlado: true,
|
|
1193
|
+
imprimiCozinha: true,
|
|
1194
|
+
imprimeCorredor: false,
|
|
1195
|
+
verNaRecepcao: true,
|
|
1196
|
+
prato: false,
|
|
1197
|
+
isAtivo: true,
|
|
1198
|
+
isComposto: true,
|
|
1199
|
+
isIngrediente: true,
|
|
1200
|
+
omiteCliente: false,
|
|
1201
|
+
estoqueRecepcao: false,
|
|
1202
|
+
estoqueRecepcaoQuantidade: 0,
|
|
1203
|
+
gtin: null,
|
|
1204
|
+
cfop: null,
|
|
1205
|
+
csT_icms: null,
|
|
1206
|
+
modBC_icms: 0,
|
|
1207
|
+
pICMS_icms: null,
|
|
1208
|
+
pRedBC_icms: null,
|
|
1209
|
+
pfcP_icms: null,
|
|
1210
|
+
vbcfcP_icms: null,
|
|
1211
|
+
pfcpsT_icms: null,
|
|
1212
|
+
pRedBCEfet_icms: null,
|
|
1213
|
+
vbcEfet_icms: null,
|
|
1214
|
+
picmsEfet_icms: null,
|
|
1215
|
+
vicmsEfet_icms: null,
|
|
1216
|
+
csT_pis: null,
|
|
1217
|
+
vbC_pis: null,
|
|
1218
|
+
ppiS_pis: null,
|
|
1219
|
+
csT_cofins: null,
|
|
1220
|
+
vbC_cofins: null,
|
|
1221
|
+
pcofinS_cofins: null,
|
|
1222
|
+
psT_icms: null,
|
|
1223
|
+
vbcstRet_icms: null,
|
|
1224
|
+
vicmsSubstituto_icms: null,
|
|
1225
|
+
vicmsstRet_icms: null,
|
|
1226
|
+
emiteNFCe: false,
|
|
1227
|
+
cest: null,
|
|
1228
|
+
vbcfcpsT_icms: null,
|
|
1229
|
+
vbcfcpstRet_icms: null,
|
|
1230
|
+
pfcpstRet_icms: null,
|
|
1231
|
+
sitTrib: null,
|
|
1232
|
+
setorSubEstoqueId: null,
|
|
1233
|
+
setorSubEstoqueNome: null,
|
|
1234
|
+
setorPrincipalId: null,
|
|
1235
|
+
setorPrincipalNome: null,
|
|
1236
|
+
qtdMinSubEstoque: null,
|
|
1237
|
+
disponivelCardapio: false,
|
|
1238
|
+
categoriaCardapioId: null,
|
|
1239
|
+
categoriaCardapioNome: null,
|
|
1240
|
+
descricao: null,
|
|
1241
|
+
enviadoPC: false,
|
|
1242
|
+
qbcProd_cofins: null,
|
|
1243
|
+
vAliqProd_cofins: null
|
|
1244
|
+
};
|
|
1245
|
+
}
|
|
1246
|
+
;
|
|
1247
|
+
function validaProduto(item, focus) {
|
|
1248
|
+
if (valTextEmpty(item.nome)) {
|
|
1249
|
+
focus.set('nome');
|
|
1250
|
+
return 'Digite um nome válido.';
|
|
1251
|
+
}
|
|
1252
|
+
if (valNumberEmpty(item.grupoId)) {
|
|
1253
|
+
return 'Escolha um grupo de produto.';
|
|
1254
|
+
}
|
|
1255
|
+
if (valNumberEmpty(item.subgrupoId)) {
|
|
1256
|
+
return 'Escolha um subgrupo de produto.';
|
|
1257
|
+
}
|
|
1258
|
+
if (valTextEmpty(item.unidade)) {
|
|
1259
|
+
focus.set('unidade');
|
|
1260
|
+
return 'Digite uma unidade.';
|
|
1261
|
+
}
|
|
1262
|
+
if (item.disponivelCardapio) {
|
|
1263
|
+
if (valNumberEmpty(item.categoriaCardapioId))
|
|
1264
|
+
return 'Escolha uma categoria do cardápio digital.';
|
|
1265
|
+
if (valTextEmpty(item.descricao)) {
|
|
1266
|
+
focus.set('descricao');
|
|
1267
|
+
return 'Digite uma descrição para o cardápio digital.';
|
|
1268
|
+
}
|
|
1269
|
+
}
|
|
1270
|
+
return null;
|
|
1271
|
+
}
|
|
1272
|
+
|
|
1273
|
+
class NumberParser {
|
|
1274
|
+
constructor(setPropFunc, getPropFunc, min, max, triggerMilliseconds = 1500) {
|
|
1275
|
+
this.setPropFunc = setPropFunc;
|
|
1276
|
+
this.getPropFunc = getPropFunc;
|
|
1277
|
+
this.min = min;
|
|
1278
|
+
this.max = max;
|
|
1279
|
+
this.parsed = false;
|
|
1280
|
+
this._parseTrigger = new LazyTrigger(() => this.parseValor(), triggerMilliseconds);
|
|
1281
|
+
}
|
|
1282
|
+
parse(vlr) {
|
|
1283
|
+
this.valor = vlr;
|
|
1284
|
+
this.parsed = false;
|
|
1285
|
+
this._parseTrigger.fire();
|
|
1286
|
+
}
|
|
1287
|
+
store(vlr) {
|
|
1288
|
+
this.valor = vlr;
|
|
1289
|
+
this.parsed = false;
|
|
1290
|
+
}
|
|
1291
|
+
checkout() {
|
|
1292
|
+
if (this.parsed || !this.valor)
|
|
1293
|
+
return;
|
|
1294
|
+
this.parseValor();
|
|
1295
|
+
}
|
|
1296
|
+
parseValor() {
|
|
1297
|
+
if (this.valor === undefined)
|
|
1298
|
+
return;
|
|
1299
|
+
this.parsed = true;
|
|
1300
|
+
const vlrTxt = this.valor.split(",").join(".");
|
|
1301
|
+
;
|
|
1302
|
+
const spTxt = vlrTxt.split(".");
|
|
1303
|
+
let toParseTxt = "";
|
|
1304
|
+
if (spTxt.length > 2) {
|
|
1305
|
+
const chars = vlrTxt.split("");
|
|
1306
|
+
const lastIndex = vlrTxt.lastIndexOf(".");
|
|
1307
|
+
for (let i = 0; i < chars.length; i++) {
|
|
1308
|
+
const c = chars[i];
|
|
1309
|
+
if (c === "." && i != lastIndex)
|
|
1310
|
+
continue;
|
|
1311
|
+
toParseTxt = toParseTxt.concat(c);
|
|
1312
|
+
}
|
|
1313
|
+
}
|
|
1314
|
+
else {
|
|
1315
|
+
toParseTxt = vlrTxt;
|
|
1316
|
+
}
|
|
1317
|
+
const vlr = parseFloat(toParseTxt);
|
|
1318
|
+
if (isNaN(vlr) || !this.validaMinMax(vlr)) {
|
|
1319
|
+
const original = this.getPropFunc();
|
|
1320
|
+
this.setPropFunc(0);
|
|
1321
|
+
setTimeout(() => this.setPropFunc(original));
|
|
1322
|
+
}
|
|
1323
|
+
else {
|
|
1324
|
+
this.setPropFunc(vlr);
|
|
1325
|
+
}
|
|
1326
|
+
}
|
|
1327
|
+
validaMinMax(value) {
|
|
1328
|
+
if ((this.min === undefined) && this.max === undefined)
|
|
1329
|
+
return true;
|
|
1330
|
+
if (!(this.min === undefined) && value < this.min)
|
|
1331
|
+
return false;
|
|
1332
|
+
if (!(this.max === undefined) && value > this.max)
|
|
1333
|
+
return false;
|
|
1334
|
+
return true;
|
|
1335
|
+
}
|
|
1336
|
+
}
|
|
1337
|
+
|
|
1338
|
+
function validaProdutoGrupo(item, focus) {
|
|
1339
|
+
if (valTextEmpty(item.nome)) {
|
|
1340
|
+
focus.set('nome');
|
|
1341
|
+
return 'Digite um nome válido.';
|
|
1342
|
+
}
|
|
1343
|
+
return null;
|
|
1344
|
+
}
|
|
1345
|
+
|
|
1346
|
+
class ProdutoGrupoFormComponent {
|
|
1347
|
+
constructor() { }
|
|
1348
|
+
ngOnInit() {
|
|
1349
|
+
}
|
|
1350
|
+
}
|
|
1351
|
+
ProdutoGrupoFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoGrupoFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1352
|
+
ProdutoGrupoFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: ProdutoGrupoFormComponent, selector: "app-produto-grupo-form", inputs: { model: "model" }, ngImport: i0, template: "<div class=\"form-group\" *ngIf=\"model\">\n <label>Nome</label>\n <input id=\"nome\" [(ngModel)]=\"model.nome\" required class=\"form-control input-300\" cdkFocusInitial tabindex=\"1\">\n</div>", styles: [":host{display:flex;flex-direction:column}\n"], dependencies: [{ kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i7.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i7.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
|
|
1353
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoGrupoFormComponent, decorators: [{
|
|
1354
|
+
type: Component,
|
|
1355
|
+
args: [{ selector: 'app-produto-grupo-form', template: "<div class=\"form-group\" *ngIf=\"model\">\n <label>Nome</label>\n <input id=\"nome\" [(ngModel)]=\"model.nome\" required class=\"form-control input-300\" cdkFocusInitial tabindex=\"1\">\n</div>", styles: [":host{display:flex;flex-direction:column}\n"] }]
|
|
1356
|
+
}], ctorParameters: function () { return []; }, propDecorators: { model: [{
|
|
1357
|
+
type: Input
|
|
1358
|
+
}] } });
|
|
1359
|
+
|
|
1360
|
+
class ProdutoCategoriaCardapioAddDialogComponent {
|
|
1361
|
+
constructor(ws, notification, dataDialog, dialog, elRef, dialogRef, screenHelper) {
|
|
1362
|
+
this.ws = ws;
|
|
1363
|
+
this.notification = notification;
|
|
1364
|
+
this.dataDialog = dataDialog;
|
|
1365
|
+
this.dialog = dialog;
|
|
1366
|
+
this.elRef = elRef;
|
|
1367
|
+
this.dialogRef = dialogRef;
|
|
1368
|
+
this.screenHelper = screenHelper;
|
|
1369
|
+
this.isBusy = false;
|
|
1370
|
+
this.focus = new FocusService();
|
|
1371
|
+
this.model = {
|
|
1372
|
+
id: 0,
|
|
1373
|
+
nome: '',
|
|
1374
|
+
isAtivo: true,
|
|
1375
|
+
enviadoPC: false
|
|
1376
|
+
};
|
|
1377
|
+
this.mobile = this.screenHelper.isMedium;
|
|
1378
|
+
this.screenHelper.changedMediumScreen.subscribe(x => this.mobile = x);
|
|
1379
|
+
}
|
|
1380
|
+
ngOnInit() {
|
|
1381
|
+
this.focus.registerElement(this.elRef.nativeElement);
|
|
1382
|
+
}
|
|
1383
|
+
ngOnDestroy() {
|
|
1384
|
+
this.focus.unregisterElement(this.elRef.nativeElement);
|
|
1385
|
+
}
|
|
1386
|
+
salvar() {
|
|
1387
|
+
const valMsg = validaProdutoGrupo(this.model, this.focus);
|
|
1388
|
+
if (valMsg) {
|
|
1389
|
+
this.notification.showMsgError(valMsg);
|
|
1390
|
+
return;
|
|
1391
|
+
}
|
|
1392
|
+
this.isBusy = true;
|
|
1393
|
+
this.ws.addProdutoCategoriaCardapio(this.model)
|
|
1394
|
+
.subscribe(r => {
|
|
1395
|
+
this.isBusy = false;
|
|
1396
|
+
this.notification.showMsg("Salvo com sucesso.");
|
|
1397
|
+
if (this.dialogRef)
|
|
1398
|
+
this.dialogRef.close(true);
|
|
1399
|
+
}, err => {
|
|
1400
|
+
this.isBusy = false;
|
|
1401
|
+
this.notification.showMsg(err.error);
|
|
1402
|
+
});
|
|
1403
|
+
}
|
|
1404
|
+
}
|
|
1405
|
+
ProdutoCategoriaCardapioAddDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoCategoriaCardapioAddDialogComponent, deps: [{ token: CommonWebService }, { token: NotificationService }, { token: MAT_DIALOG_DATA }, { token: i3.MatDialog }, { token: i0.ElementRef }, { token: i3.MatDialogRef }, { token: ScreenHelperService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1406
|
+
ProdutoCategoriaCardapioAddDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: ProdutoCategoriaCardapioAddDialogComponent, selector: "app-produto-categoria-cardapio-add-dialog", ngImport: i0, template: "<div class=\"ox-header\">\n <h2 class=\"titulo\">Nova Categoria</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 <app-produto-grupo-form [model]=\"model\" *ngIf=\"model\"></app-produto-grupo-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$1.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: ProdutoGrupoFormComponent, selector: "app-produto-grupo-form", inputs: ["model"] }] });
|
|
1407
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoCategoriaCardapioAddDialogComponent, decorators: [{
|
|
1408
|
+
type: Component,
|
|
1409
|
+
args: [{ selector: 'app-produto-categoria-cardapio-add-dialog', template: "<div class=\"ox-header\">\n <h2 class=\"titulo\">Nova Categoria</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 <app-produto-grupo-form [model]=\"model\" *ngIf=\"model\"></app-produto-grupo-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"] }]
|
|
1410
|
+
}], ctorParameters: function () {
|
|
1411
|
+
return [{ type: CommonWebService }, { type: NotificationService }, { type: undefined, decorators: [{
|
|
1412
|
+
type: Inject,
|
|
1413
|
+
args: [MAT_DIALOG_DATA]
|
|
1414
|
+
}] }, { type: i3.MatDialog }, { type: i0.ElementRef }, { type: i3.MatDialogRef }, { type: ScreenHelperService }];
|
|
1415
|
+
} });
|
|
1416
|
+
|
|
1417
|
+
class ProdutoCategoriaCardapioEditDialogComponent {
|
|
1418
|
+
constructor(ws, notification, dataDialog, dialog, elRef, dialogRef, screenHelper) {
|
|
1419
|
+
this.ws = ws;
|
|
1420
|
+
this.notification = notification;
|
|
1421
|
+
this.dataDialog = dataDialog;
|
|
1422
|
+
this.dialog = dialog;
|
|
1423
|
+
this.elRef = elRef;
|
|
1424
|
+
this.dialogRef = dialogRef;
|
|
1425
|
+
this.screenHelper = screenHelper;
|
|
1426
|
+
this.isBusy = false;
|
|
1427
|
+
this.focus = new FocusService();
|
|
1428
|
+
if (dataDialog) {
|
|
1429
|
+
this.model = dataDialog;
|
|
1430
|
+
}
|
|
1431
|
+
this.mobile = this.screenHelper.isMedium;
|
|
1432
|
+
this.screenHelper.changedMediumScreen.subscribe(x => this.mobile = x);
|
|
1433
|
+
}
|
|
1434
|
+
ngOnInit() {
|
|
1435
|
+
this.focus.registerElement(this.elRef.nativeElement);
|
|
1436
|
+
}
|
|
1437
|
+
ngOnDestroy() {
|
|
1438
|
+
this.focus.unregisterElement(this.elRef.nativeElement);
|
|
1439
|
+
}
|
|
1440
|
+
salvar() {
|
|
1441
|
+
if (!this.model)
|
|
1442
|
+
return;
|
|
1443
|
+
const valMsg = validaProdutoGrupo(this.model, this.focus);
|
|
1444
|
+
if (valMsg) {
|
|
1445
|
+
this.notification.showMsgError(valMsg);
|
|
1446
|
+
return;
|
|
1447
|
+
}
|
|
1448
|
+
this.isBusy = true;
|
|
1449
|
+
this.ws.saveProdutoCategoriaCardapio(this.model)
|
|
1450
|
+
.subscribe(r => {
|
|
1451
|
+
this.isBusy = false;
|
|
1452
|
+
this.notification.showMsg("Salvo com sucesso.");
|
|
1453
|
+
if (this.dialogRef)
|
|
1454
|
+
this.dialogRef.close(true);
|
|
1455
|
+
}, err => {
|
|
1456
|
+
this.isBusy = false;
|
|
1457
|
+
this.notification.showMsg(err.error);
|
|
1458
|
+
});
|
|
1459
|
+
}
|
|
1460
|
+
}
|
|
1461
|
+
ProdutoCategoriaCardapioEditDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoCategoriaCardapioEditDialogComponent, deps: [{ token: CommonWebService }, { token: NotificationService }, { token: MAT_DIALOG_DATA }, { token: i3.MatDialog }, { token: i0.ElementRef }, { token: i3.MatDialogRef }, { token: ScreenHelperService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1462
|
+
ProdutoCategoriaCardapioEditDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: ProdutoCategoriaCardapioEditDialogComponent, selector: "app-produto-categoria-cardapio-edit-dialog", ngImport: i0, template: "<div class=\"ox-header\">\n <h2 class=\"titulo\">Editando Categoria do Card\u00E1pio</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 <app-produto-grupo-form [model]=\"model\" *ngIf=\"model\"></app-produto-grupo-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$1.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: ProdutoGrupoFormComponent, selector: "app-produto-grupo-form", inputs: ["model"] }] });
|
|
1463
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoCategoriaCardapioEditDialogComponent, decorators: [{
|
|
1464
|
+
type: Component,
|
|
1465
|
+
args: [{ selector: 'app-produto-categoria-cardapio-edit-dialog', template: "<div class=\"ox-header\">\n <h2 class=\"titulo\">Editando Categoria do Card\u00E1pio</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 <app-produto-grupo-form [model]=\"model\" *ngIf=\"model\"></app-produto-grupo-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"] }]
|
|
1466
|
+
}], ctorParameters: function () {
|
|
1467
|
+
return [{ type: CommonWebService }, { type: NotificationService }, { type: undefined, decorators: [{
|
|
1468
|
+
type: Inject,
|
|
1469
|
+
args: [MAT_DIALOG_DATA]
|
|
1470
|
+
}] }, { type: i3.MatDialog }, { type: i0.ElementRef }, { type: i3.MatDialogRef }, { type: ScreenHelperService }];
|
|
1471
|
+
} });
|
|
1472
|
+
|
|
1473
|
+
class ProdutoCategoriaCardapioSelecaoDialogComponent {
|
|
1474
|
+
constructor(dialogRef, dialog, ws, notification, auth, screenHelper) {
|
|
1475
|
+
this.dialogRef = dialogRef;
|
|
1476
|
+
this.dialog = dialog;
|
|
1477
|
+
this.ws = ws;
|
|
1478
|
+
this.notification = notification;
|
|
1479
|
+
this.screenHelper = screenHelper;
|
|
1480
|
+
this.items = [];
|
|
1481
|
+
this.selectedItem = null;
|
|
1482
|
+
this.isBusy = false;
|
|
1483
|
+
this.setting = new SearchSetting();
|
|
1484
|
+
this.lazyTrigger = new LazyTrigger(() => { this.atualiza(); });
|
|
1485
|
+
this.nav = new NavegacaoSelecaoDialogUtil(this);
|
|
1486
|
+
this.mobile = this.screenHelper.isMedium;
|
|
1487
|
+
this.allowAdd = auth.permissoes.adminProdutoGrupoAdd;
|
|
1488
|
+
this.allowEdit = auth.permissoes.adminProdutoGrupoPesquisa;
|
|
1489
|
+
}
|
|
1490
|
+
ngOnInit() {
|
|
1491
|
+
this.setting.ordem = "nome";
|
|
1492
|
+
this.atualiza();
|
|
1493
|
+
}
|
|
1494
|
+
atualiza() {
|
|
1495
|
+
this.isBusy = true;
|
|
1496
|
+
this.ws.buscaProdutoCategoriaCardapio(this.setting)
|
|
1497
|
+
.subscribe(r => {
|
|
1498
|
+
this.isBusy = false;
|
|
1499
|
+
this.items = r;
|
|
1500
|
+
console.info(r);
|
|
1501
|
+
}, err => {
|
|
1502
|
+
this.isBusy = false;
|
|
1503
|
+
this.notification.showHttpError(err);
|
|
1504
|
+
});
|
|
1505
|
+
}
|
|
1506
|
+
selectItem(i) {
|
|
1507
|
+
if (this.selectedItem === i) {
|
|
1508
|
+
this.dialogRef.close(i);
|
|
1509
|
+
}
|
|
1510
|
+
this.selectedItem = i;
|
|
1511
|
+
}
|
|
1512
|
+
novo() {
|
|
1513
|
+
let height = (window.innerHeight * 0.90) + 'px';
|
|
1514
|
+
let width = 550 + 'px';
|
|
1515
|
+
if (this.mobile) {
|
|
1516
|
+
width = (window.innerWidth * 0.99) + 'px';
|
|
1517
|
+
//height = (window.innerHeight * 0.98) + 'px';
|
|
1518
|
+
}
|
|
1519
|
+
const dialog = this.dialog.open(ProdutoCategoriaCardapioAddDialogComponent, {
|
|
1520
|
+
width: width,
|
|
1521
|
+
height: height,
|
|
1522
|
+
maxWidth: '100%',
|
|
1523
|
+
panelClass: 'dialog-p0',
|
|
1524
|
+
});
|
|
1525
|
+
dialog.afterClosed().subscribe(result => {
|
|
1526
|
+
if (result === undefined)
|
|
1527
|
+
return;
|
|
1528
|
+
this.notification.showMsg("Salvo com sucesso.");
|
|
1529
|
+
this.atualiza();
|
|
1530
|
+
});
|
|
1531
|
+
}
|
|
1532
|
+
editar() {
|
|
1533
|
+
let height = (window.innerHeight * 0.90) + 'px';
|
|
1534
|
+
let width = 550 + 'px';
|
|
1535
|
+
if (this.mobile) {
|
|
1536
|
+
width = (window.innerWidth * 0.99) + 'px';
|
|
1537
|
+
//height = (window.innerHeight * 0.98) + 'px';
|
|
1538
|
+
}
|
|
1539
|
+
const dialog = this.dialog.open(ProdutoCategoriaCardapioEditDialogComponent, {
|
|
1540
|
+
width: width,
|
|
1541
|
+
height: height,
|
|
1542
|
+
maxWidth: '100%',
|
|
1543
|
+
panelClass: 'dialog-p0',
|
|
1544
|
+
data: this.selectedItem
|
|
1545
|
+
});
|
|
1546
|
+
dialog.afterClosed().subscribe(result => {
|
|
1547
|
+
if (result === undefined)
|
|
1548
|
+
return;
|
|
1549
|
+
this.notification.showMsg("Salvo com sucesso.");
|
|
1550
|
+
this.atualiza();
|
|
1551
|
+
});
|
|
1552
|
+
}
|
|
1553
|
+
}
|
|
1554
|
+
ProdutoCategoriaCardapioSelecaoDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoCategoriaCardapioSelecaoDialogComponent, deps: [{ token: i3.MatDialogRef }, { token: i3.MatDialog }, { token: CommonWebService }, { token: NotificationService }, { token: AuthDataService }, { token: ScreenHelperService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1555
|
+
ProdutoCategoriaCardapioSelecaoDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: ProdutoCategoriaCardapioSelecaoDialogComponent, selector: "app-produto-categoria-cardapio-selecao-dialog", ngImport: i0, template: "<div class=\"dialog-header\">\n <h2>Sele\u00E7\u00E3o de Grupos</h2>\n </div>\n <div class=\"tool-panel\">\n <div class=\"tool-section\">\n <label>Pesquisa</label>\n <div class=\"search-input-container\">\n <input (keydown)=\"nav.onKeyDown($event)\" cdkFocusInitial [(ngModel)]=\"setting.frase\" placeholder=\"Digite um termo de busca...\" (input)=\"lazyTrigger.fire()\">\n </div>\n </div>\n <div class=\"tool-section\">\n <label>A\u00E7\u00F5es</label>\n <div class=\"tool-row\">\n <button mat-icon-button (click)=\"atualiza()\">\n <mat-icon aria-label=\"Atualizar\">refresh</mat-icon>\n </button>\n <button mat-icon-button (click)=\"novo()\" *ngIf=\"allowAdd\">\n <mat-icon aria-label=\"novo\">add</mat-icon>\n </button>\n <button mat-icon-button (click)=\"editar()\" *ngIf=\"selectedItem && allowEdit\">\n <mat-icon aria-label=\"editar\">edit</mat-icon>\n </button>\n </div>\n </div>\n </div>\n <div class=\"dialog-content\">\n <ox-item-card [nome]=\"i.nome\" (click)=\"selectItem(i)\" *ngFor=\"let i of items\" [class.selected]=\"i === selectedItem\"></ox-item-card>\n<!--\n <div (click)=\"selectItem(i)\" [ngClass]=\"{selected: selectedItem === i}\" class=\"list-item\" *ngFor=\"let i of items\">\n <span>{{i.nome}}</span>\n </div>\n-->\n </div>\n <div class=\"dialog-footer\">\n <button mat-button [disabled]=\"selectedItem == undefined\" color=\"primary\" [mat-dialog-close]=\"selectedItem\">CONFIRMAR</button>\n <button mat-button [mat-dialog-close]=\"undefined\">VOLTAR</button>\n </div>\n <ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>\n ", styles: [":host{background:#fafafa;display:flex;flex-direction:column;height:100%;max-height:99vh}\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: "directive", type: i7.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i6$1.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: ItemCardComponent, selector: "ox-item-card", inputs: ["nome", "codigo", "star", "cloud", "desativado"] }] });
|
|
1556
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoCategoriaCardapioSelecaoDialogComponent, decorators: [{
|
|
1557
|
+
type: Component,
|
|
1558
|
+
args: [{ selector: 'app-produto-categoria-cardapio-selecao-dialog', template: "<div class=\"dialog-header\">\n <h2>Sele\u00E7\u00E3o de Grupos</h2>\n </div>\n <div class=\"tool-panel\">\n <div class=\"tool-section\">\n <label>Pesquisa</label>\n <div class=\"search-input-container\">\n <input (keydown)=\"nav.onKeyDown($event)\" cdkFocusInitial [(ngModel)]=\"setting.frase\" placeholder=\"Digite um termo de busca...\" (input)=\"lazyTrigger.fire()\">\n </div>\n </div>\n <div class=\"tool-section\">\n <label>A\u00E7\u00F5es</label>\n <div class=\"tool-row\">\n <button mat-icon-button (click)=\"atualiza()\">\n <mat-icon aria-label=\"Atualizar\">refresh</mat-icon>\n </button>\n <button mat-icon-button (click)=\"novo()\" *ngIf=\"allowAdd\">\n <mat-icon aria-label=\"novo\">add</mat-icon>\n </button>\n <button mat-icon-button (click)=\"editar()\" *ngIf=\"selectedItem && allowEdit\">\n <mat-icon aria-label=\"editar\">edit</mat-icon>\n </button>\n </div>\n </div>\n </div>\n <div class=\"dialog-content\">\n <ox-item-card [nome]=\"i.nome\" (click)=\"selectItem(i)\" *ngFor=\"let i of items\" [class.selected]=\"i === selectedItem\"></ox-item-card>\n<!--\n <div (click)=\"selectItem(i)\" [ngClass]=\"{selected: selectedItem === i}\" class=\"list-item\" *ngFor=\"let i of items\">\n <span>{{i.nome}}</span>\n </div>\n-->\n </div>\n <div class=\"dialog-footer\">\n <button mat-button [disabled]=\"selectedItem == undefined\" color=\"primary\" [mat-dialog-close]=\"selectedItem\">CONFIRMAR</button>\n <button mat-button [mat-dialog-close]=\"undefined\">VOLTAR</button>\n </div>\n <ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>\n ", styles: [":host{background:#fafafa;display:flex;flex-direction:column;height:100%;max-height:99vh}\n"] }]
|
|
1559
|
+
}], ctorParameters: function () { return [{ type: i3.MatDialogRef }, { type: i3.MatDialog }, { type: CommonWebService }, { type: NotificationService }, { type: AuthDataService }, { type: ScreenHelperService }]; } });
|
|
1560
|
+
|
|
1561
|
+
class ProdutoGrupoAddDialogComponent {
|
|
1562
|
+
constructor(ws, notification, dataDialog, dialog, elRef, dialogRef, screenHelper) {
|
|
1563
|
+
this.ws = ws;
|
|
1564
|
+
this.notification = notification;
|
|
1565
|
+
this.dataDialog = dataDialog;
|
|
1566
|
+
this.dialog = dialog;
|
|
1567
|
+
this.elRef = elRef;
|
|
1568
|
+
this.dialogRef = dialogRef;
|
|
1569
|
+
this.screenHelper = screenHelper;
|
|
1570
|
+
this.isBusy = false;
|
|
1571
|
+
this.focus = new FocusService();
|
|
1572
|
+
this.model = {
|
|
1573
|
+
id: 0,
|
|
1574
|
+
nome: '',
|
|
1575
|
+
isAtivo: true,
|
|
1576
|
+
enviadoPC: false
|
|
1577
|
+
};
|
|
1578
|
+
this.mobile = this.screenHelper.isMedium;
|
|
1579
|
+
this.screenHelper.changedMediumScreen.subscribe(x => this.mobile = x);
|
|
1580
|
+
}
|
|
1581
|
+
ngOnInit() {
|
|
1582
|
+
this.focus.registerElement(this.elRef.nativeElement);
|
|
1583
|
+
}
|
|
1584
|
+
ngOnDestroy() {
|
|
1585
|
+
this.focus.unregisterElement(this.elRef.nativeElement);
|
|
1586
|
+
}
|
|
1587
|
+
salvar() {
|
|
1588
|
+
const valMsg = validaProdutoGrupo(this.model, this.focus);
|
|
1589
|
+
if (valMsg) {
|
|
1590
|
+
this.notification.showMsgError(valMsg);
|
|
1591
|
+
return;
|
|
1592
|
+
}
|
|
1593
|
+
this.isBusy = true;
|
|
1594
|
+
this.ws.addProdutoGrupo(this.model)
|
|
1595
|
+
.subscribe(r => {
|
|
1596
|
+
this.isBusy = false;
|
|
1597
|
+
this.notification.showMsg("Salvo com sucesso.");
|
|
1598
|
+
if (this.dialogRef)
|
|
1599
|
+
this.dialogRef.close(true);
|
|
1600
|
+
}, err => {
|
|
1601
|
+
this.isBusy = false;
|
|
1602
|
+
this.notification.showMsg(err.error);
|
|
1603
|
+
});
|
|
1604
|
+
}
|
|
1605
|
+
}
|
|
1606
|
+
ProdutoGrupoAddDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoGrupoAddDialogComponent, deps: [{ token: CommonWebService }, { token: NotificationService }, { token: MAT_DIALOG_DATA }, { token: i3.MatDialog }, { token: i0.ElementRef }, { token: i3.MatDialogRef }, { token: ScreenHelperService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1607
|
+
ProdutoGrupoAddDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: ProdutoGrupoAddDialogComponent, selector: "app-produto-grupo-add-dialog", ngImport: i0, template: "<div class=\"ox-header\">\n <h2 class=\"titulo\">Novo Grupo</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 <app-produto-grupo-form [model]=\"model\" *ngIf=\"model\"></app-produto-grupo-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$1.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: ProdutoGrupoFormComponent, selector: "app-produto-grupo-form", inputs: ["model"] }] });
|
|
1608
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoGrupoAddDialogComponent, decorators: [{
|
|
1609
|
+
type: Component,
|
|
1610
|
+
args: [{ selector: 'app-produto-grupo-add-dialog', template: "<div class=\"ox-header\">\n <h2 class=\"titulo\">Novo Grupo</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 <app-produto-grupo-form [model]=\"model\" *ngIf=\"model\"></app-produto-grupo-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"] }]
|
|
1611
|
+
}], ctorParameters: function () {
|
|
1612
|
+
return [{ type: CommonWebService }, { type: NotificationService }, { type: undefined, decorators: [{
|
|
1613
|
+
type: Inject,
|
|
1614
|
+
args: [MAT_DIALOG_DATA]
|
|
1615
|
+
}] }, { type: i3.MatDialog }, { type: i0.ElementRef }, { type: i3.MatDialogRef }, { type: ScreenHelperService }];
|
|
1616
|
+
} });
|
|
1617
|
+
|
|
1618
|
+
class ProdutoGrupoEditDialogComponent {
|
|
1619
|
+
constructor(ws, notification, dataDialog, dialog, elRef, dialogRef, screenHelper) {
|
|
1620
|
+
this.ws = ws;
|
|
1621
|
+
this.notification = notification;
|
|
1622
|
+
this.dataDialog = dataDialog;
|
|
1623
|
+
this.dialog = dialog;
|
|
1624
|
+
this.elRef = elRef;
|
|
1625
|
+
this.dialogRef = dialogRef;
|
|
1626
|
+
this.screenHelper = screenHelper;
|
|
1627
|
+
this.isBusy = false;
|
|
1628
|
+
this.focus = new FocusService();
|
|
1629
|
+
if (dataDialog) {
|
|
1630
|
+
this.model = dataDialog;
|
|
1631
|
+
}
|
|
1632
|
+
this.mobile = this.screenHelper.isMedium;
|
|
1633
|
+
this.screenHelper.changedMediumScreen.subscribe(x => this.mobile = x);
|
|
1634
|
+
}
|
|
1635
|
+
ngOnInit() {
|
|
1636
|
+
this.focus.registerElement(this.elRef.nativeElement);
|
|
1637
|
+
}
|
|
1638
|
+
ngOnDestroy() {
|
|
1639
|
+
this.focus.unregisterElement(this.elRef.nativeElement);
|
|
1640
|
+
}
|
|
1641
|
+
salvar() {
|
|
1642
|
+
if (!this.model)
|
|
1643
|
+
return;
|
|
1644
|
+
const valMsg = validaProdutoGrupo(this.model, this.focus);
|
|
1645
|
+
if (valMsg) {
|
|
1646
|
+
this.notification.showMsgError(valMsg);
|
|
1647
|
+
return;
|
|
1648
|
+
}
|
|
1649
|
+
this.isBusy = true;
|
|
1650
|
+
this.ws.saveProdutoGrupo(this.model)
|
|
1651
|
+
.subscribe(r => {
|
|
1652
|
+
this.isBusy = false;
|
|
1653
|
+
this.notification.showMsg("Salvo com sucesso.");
|
|
1654
|
+
if (this.dialogRef)
|
|
1655
|
+
this.dialogRef.close(true);
|
|
1656
|
+
}, err => {
|
|
1657
|
+
this.isBusy = false;
|
|
1658
|
+
this.notification.showMsg(err.error);
|
|
1659
|
+
});
|
|
1660
|
+
}
|
|
1661
|
+
}
|
|
1662
|
+
ProdutoGrupoEditDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoGrupoEditDialogComponent, deps: [{ token: CommonWebService }, { token: NotificationService }, { token: MAT_DIALOG_DATA }, { token: i3.MatDialog }, { token: i0.ElementRef }, { token: i3.MatDialogRef }, { token: ScreenHelperService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1663
|
+
ProdutoGrupoEditDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: ProdutoGrupoEditDialogComponent, selector: "app-produto-grupo-edit-dialog", ngImport: i0, template: "<div class=\"ox-header\">\n <h2 class=\"titulo\">Editando Grupo</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 <app-produto-grupo-form [model]=\"model\" *ngIf=\"model\"></app-produto-grupo-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$1.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: ProdutoGrupoFormComponent, selector: "app-produto-grupo-form", inputs: ["model"] }] });
|
|
1664
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoGrupoEditDialogComponent, decorators: [{
|
|
1665
|
+
type: Component,
|
|
1666
|
+
args: [{ selector: 'app-produto-grupo-edit-dialog', template: "<div class=\"ox-header\">\n <h2 class=\"titulo\">Editando Grupo</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 <app-produto-grupo-form [model]=\"model\" *ngIf=\"model\"></app-produto-grupo-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"] }]
|
|
1667
|
+
}], ctorParameters: function () {
|
|
1668
|
+
return [{ type: CommonWebService }, { type: NotificationService }, { type: undefined, decorators: [{
|
|
1669
|
+
type: Inject,
|
|
1670
|
+
args: [MAT_DIALOG_DATA]
|
|
1671
|
+
}] }, { type: i3.MatDialog }, { type: i0.ElementRef }, { type: i3.MatDialogRef }, { type: ScreenHelperService }];
|
|
1672
|
+
} });
|
|
1673
|
+
|
|
1674
|
+
class ProdutoGrupoSelecaoDialogComponent {
|
|
1675
|
+
constructor(dialogRef, dialog, ws, notification, auth, screenHelper) {
|
|
1676
|
+
this.dialogRef = dialogRef;
|
|
1677
|
+
this.dialog = dialog;
|
|
1678
|
+
this.ws = ws;
|
|
1679
|
+
this.notification = notification;
|
|
1680
|
+
this.screenHelper = screenHelper;
|
|
1681
|
+
this.items = [];
|
|
1682
|
+
this.selectedItem = null;
|
|
1683
|
+
this.isBusy = false;
|
|
1684
|
+
this.setting = new SearchSetting();
|
|
1685
|
+
this.lazyTrigger = new LazyTrigger(() => { this.atualiza(); });
|
|
1686
|
+
this.nav = new NavegacaoSelecaoDialogUtil(this);
|
|
1687
|
+
this.mobile = this.screenHelper.isMedium;
|
|
1688
|
+
this.allowAdd = auth.permissoes.adminProdutoGrupoAdd;
|
|
1689
|
+
this.allowEdit = auth.permissoes.adminProdutoGrupoPesquisa;
|
|
1690
|
+
}
|
|
1691
|
+
ngOnInit() {
|
|
1692
|
+
this.setting.ordem = "nome";
|
|
1693
|
+
this.atualiza();
|
|
1694
|
+
}
|
|
1695
|
+
atualiza() {
|
|
1696
|
+
this.isBusy = true;
|
|
1697
|
+
this.ws.buscaProdutoGrupo(this.setting)
|
|
1698
|
+
.subscribe(r => {
|
|
1699
|
+
this.isBusy = false;
|
|
1700
|
+
this.items = r;
|
|
1701
|
+
console.info(r);
|
|
1702
|
+
}, err => {
|
|
1703
|
+
this.isBusy = false;
|
|
1704
|
+
this.notification.showHttpError(err);
|
|
1705
|
+
});
|
|
1706
|
+
}
|
|
1707
|
+
selectItem(i) {
|
|
1708
|
+
if (this.selectedItem === i) {
|
|
1709
|
+
this.dialogRef.close(i);
|
|
1710
|
+
}
|
|
1711
|
+
this.selectedItem = i;
|
|
1712
|
+
}
|
|
1713
|
+
novo() {
|
|
1714
|
+
let height = (window.innerHeight * 0.90) + 'px';
|
|
1715
|
+
let width = 550 + 'px';
|
|
1716
|
+
if (this.mobile) {
|
|
1717
|
+
width = (window.innerWidth * 0.99) + 'px';
|
|
1718
|
+
//height = (window.innerHeight * 0.98) + 'px';
|
|
1719
|
+
}
|
|
1720
|
+
const dialog = this.dialog.open(ProdutoGrupoAddDialogComponent, {
|
|
1721
|
+
width: width,
|
|
1722
|
+
height: height,
|
|
1723
|
+
maxWidth: '100%',
|
|
1724
|
+
panelClass: 'dialog-p0',
|
|
1725
|
+
});
|
|
1726
|
+
dialog.afterClosed().subscribe(result => {
|
|
1727
|
+
if (result === undefined)
|
|
1728
|
+
return;
|
|
1729
|
+
this.notification.showMsg("Salvo com sucesso.");
|
|
1730
|
+
this.atualiza();
|
|
1731
|
+
});
|
|
1732
|
+
}
|
|
1733
|
+
editar() {
|
|
1734
|
+
let height = (window.innerHeight * 0.90) + 'px';
|
|
1735
|
+
let width = 550 + 'px';
|
|
1736
|
+
if (this.mobile) {
|
|
1737
|
+
width = (window.innerWidth * 0.99) + 'px';
|
|
1738
|
+
//height = (window.innerHeight * 0.98) + 'px';
|
|
1739
|
+
}
|
|
1740
|
+
const dialog = this.dialog.open(ProdutoGrupoEditDialogComponent, {
|
|
1741
|
+
width: width,
|
|
1742
|
+
height: height,
|
|
1743
|
+
maxWidth: '100%',
|
|
1744
|
+
panelClass: 'dialog-p0',
|
|
1745
|
+
data: this.selectedItem
|
|
1746
|
+
});
|
|
1747
|
+
dialog.afterClosed().subscribe(result => {
|
|
1748
|
+
if (result === undefined)
|
|
1749
|
+
return;
|
|
1750
|
+
this.notification.showMsg("Salvo com sucesso.");
|
|
1751
|
+
this.atualiza();
|
|
1752
|
+
});
|
|
1753
|
+
}
|
|
1754
|
+
}
|
|
1755
|
+
ProdutoGrupoSelecaoDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoGrupoSelecaoDialogComponent, deps: [{ token: i3.MatDialogRef }, { token: i3.MatDialog }, { token: CommonWebService }, { token: NotificationService }, { token: AuthDataService }, { token: ScreenHelperService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1756
|
+
ProdutoGrupoSelecaoDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: ProdutoGrupoSelecaoDialogComponent, selector: "app-produto-grupo-selecao-dialog", ngImport: i0, template: "<div class=\"dialog-header\">\n <h2>Sele\u00E7\u00E3o de Grupos</h2>\n </div>\n <div class=\"tool-panel\">\n <div class=\"tool-section\">\n <label>Pesquisa</label>\n <div class=\"search-input-container\">\n <input (keydown)=\"nav.onKeyDown($event)\" cdkFocusInitial [(ngModel)]=\"setting.frase\" placeholder=\"Digite um termo de busca...\" (input)=\"lazyTrigger.fire()\">\n </div>\n </div>\n <div class=\"tool-section\">\n <label>A\u00E7\u00F5es</label>\n <div class=\"tool-row\">\n <button mat-icon-button (click)=\"atualiza()\">\n <mat-icon aria-label=\"Atualizar\">refresh</mat-icon>\n </button>\n <button mat-icon-button (click)=\"novo()\" *ngIf=\"allowAdd\">\n <mat-icon aria-label=\"novo\">add</mat-icon>\n </button>\n <button mat-icon-button (click)=\"editar()\" *ngIf=\"selectedItem && allowEdit\">\n <mat-icon aria-label=\"editar\">edit</mat-icon>\n </button>\n </div>\n </div>\n </div>\n <div class=\"dialog-content\">\n <ox-item-card [nome]=\"i.nome\" (click)=\"selectItem(i)\" *ngFor=\"let i of items\" [class.selected]=\"i === selectedItem\"></ox-item-card>\n </div>\n <div class=\"dialog-footer\">\n <button mat-button [disabled]=\"selectedItem == undefined\" color=\"primary\" [mat-dialog-close]=\"selectedItem\">CONFIRMAR</button>\n <button mat-button [mat-dialog-close]=\"undefined\">VOLTAR</button>\n </div>\n <ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>\n ", styles: [":host{background:#fafafa;display:flex;flex-direction:column;height:100%;max-height:99vh}\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: "directive", type: i7.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i6$1.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: ItemCardComponent, selector: "ox-item-card", inputs: ["nome", "codigo", "star", "cloud", "desativado"] }] });
|
|
1757
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoGrupoSelecaoDialogComponent, decorators: [{
|
|
1758
|
+
type: Component,
|
|
1759
|
+
args: [{ selector: 'app-produto-grupo-selecao-dialog', template: "<div class=\"dialog-header\">\n <h2>Sele\u00E7\u00E3o de Grupos</h2>\n </div>\n <div class=\"tool-panel\">\n <div class=\"tool-section\">\n <label>Pesquisa</label>\n <div class=\"search-input-container\">\n <input (keydown)=\"nav.onKeyDown($event)\" cdkFocusInitial [(ngModel)]=\"setting.frase\" placeholder=\"Digite um termo de busca...\" (input)=\"lazyTrigger.fire()\">\n </div>\n </div>\n <div class=\"tool-section\">\n <label>A\u00E7\u00F5es</label>\n <div class=\"tool-row\">\n <button mat-icon-button (click)=\"atualiza()\">\n <mat-icon aria-label=\"Atualizar\">refresh</mat-icon>\n </button>\n <button mat-icon-button (click)=\"novo()\" *ngIf=\"allowAdd\">\n <mat-icon aria-label=\"novo\">add</mat-icon>\n </button>\n <button mat-icon-button (click)=\"editar()\" *ngIf=\"selectedItem && allowEdit\">\n <mat-icon aria-label=\"editar\">edit</mat-icon>\n </button>\n </div>\n </div>\n </div>\n <div class=\"dialog-content\">\n <ox-item-card [nome]=\"i.nome\" (click)=\"selectItem(i)\" *ngFor=\"let i of items\" [class.selected]=\"i === selectedItem\"></ox-item-card>\n </div>\n <div class=\"dialog-footer\">\n <button mat-button [disabled]=\"selectedItem == undefined\" color=\"primary\" [mat-dialog-close]=\"selectedItem\">CONFIRMAR</button>\n <button mat-button [mat-dialog-close]=\"undefined\">VOLTAR</button>\n </div>\n <ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>\n ", styles: [":host{background:#fafafa;display:flex;flex-direction:column;height:100%;max-height:99vh}\n"] }]
|
|
1760
|
+
}], ctorParameters: function () { return [{ type: i3.MatDialogRef }, { type: i3.MatDialog }, { type: CommonWebService }, { type: NotificationService }, { type: AuthDataService }, { type: ScreenHelperService }]; } });
|
|
1761
|
+
|
|
1762
|
+
class ProdutosNcmDialogComponent {
|
|
1763
|
+
constructor(dialogRef, dialog, ws, notification, screenHelper) {
|
|
1764
|
+
this.dialogRef = dialogRef;
|
|
1765
|
+
this.dialog = dialog;
|
|
1766
|
+
this.ws = ws;
|
|
1767
|
+
this.notification = notification;
|
|
1768
|
+
this.screenHelper = screenHelper;
|
|
1769
|
+
this.isBusy = false;
|
|
1770
|
+
this.frase = '';
|
|
1771
|
+
this.items = [];
|
|
1772
|
+
this.selectedItem = null;
|
|
1773
|
+
this.lazyTrigger = new LazyTrigger(() => { this.atualiza(); });
|
|
1774
|
+
this.nav = new NavegacaoSelecaoDialogUtil(this);
|
|
1775
|
+
this.mobile = this.screenHelper.isMedium;
|
|
1776
|
+
}
|
|
1777
|
+
ngOnInit() {
|
|
1778
|
+
this.atualiza();
|
|
1779
|
+
}
|
|
1780
|
+
atualiza() {
|
|
1781
|
+
this.isBusy = true;
|
|
1782
|
+
this.ws.buscaNcm(this.frase)
|
|
1783
|
+
.subscribe(r => {
|
|
1784
|
+
this.isBusy = false;
|
|
1785
|
+
this.items = r;
|
|
1786
|
+
console.info(r);
|
|
1787
|
+
}, err => {
|
|
1788
|
+
this.isBusy = false;
|
|
1789
|
+
this.notification.showHttpError(err);
|
|
1790
|
+
});
|
|
1791
|
+
}
|
|
1792
|
+
selectItem(i) {
|
|
1793
|
+
if (this.selectedItem === i) {
|
|
1794
|
+
this.dialogRef.close(i);
|
|
1795
|
+
}
|
|
1796
|
+
this.selectedItem = i;
|
|
1797
|
+
}
|
|
1798
|
+
}
|
|
1799
|
+
ProdutosNcmDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutosNcmDialogComponent, deps: [{ token: i3.MatDialogRef }, { token: i3.MatDialog }, { token: CommonWebService }, { token: NotificationService }, { token: ScreenHelperService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1800
|
+
ProdutosNcmDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: ProdutosNcmDialogComponent, selector: "app-produtos-ncm-dialog", ngImport: i0, template: "<div class=\"dialog-header\">\n <h2>Sele\u00E7\u00E3o de Grupos</h2>\n </div>\n <div class=\"tool-panel\">\n <div class=\"tool-section\">\n <label>Pesquisa</label>\n <div class=\"search-input-container\">\n <input (keydown)=\"nav.onKeyDown($event)\" cdkFocusInitial [(ngModel)]=\"frase\" placeholder=\"Digite um termo de busca...\" (input)=\"lazyTrigger.fire()\">\n </div>\n </div>\n <div class=\"tool-section\">\n <label>A\u00E7\u00F5es</label>\n <div class=\"tool-row\">\n <button mat-icon-button (click)=\"atualiza()\">\n <mat-icon aria-label=\"Atualizar\">refresh</mat-icon>\n </button>\n </div>\n </div>\n </div>\n <div class=\"dialog-content\">\n <ox-item-card [codigo]=\"i.codigo\" [nome]=\"i.descricao\" (click)=\"selectItem(i)\" *ngFor=\"let i of items\" [class.selected]=\"i === selectedItem\"></ox-item-card>\n </div>\n <div class=\"dialog-footer\">\n <button mat-button [disabled]=\"selectedItem == undefined\" color=\"primary\" [mat-dialog-close]=\"selectedItem\">CONFIRMAR</button>\n <button mat-button [mat-dialog-close]=\"undefined\">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.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i7.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i6$1.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: ItemCardComponent, selector: "ox-item-card", inputs: ["nome", "codigo", "star", "cloud", "desativado"] }] });
|
|
1801
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutosNcmDialogComponent, decorators: [{
|
|
1802
|
+
type: Component,
|
|
1803
|
+
args: [{ selector: 'app-produtos-ncm-dialog', template: "<div class=\"dialog-header\">\n <h2>Sele\u00E7\u00E3o de Grupos</h2>\n </div>\n <div class=\"tool-panel\">\n <div class=\"tool-section\">\n <label>Pesquisa</label>\n <div class=\"search-input-container\">\n <input (keydown)=\"nav.onKeyDown($event)\" cdkFocusInitial [(ngModel)]=\"frase\" placeholder=\"Digite um termo de busca...\" (input)=\"lazyTrigger.fire()\">\n </div>\n </div>\n <div class=\"tool-section\">\n <label>A\u00E7\u00F5es</label>\n <div class=\"tool-row\">\n <button mat-icon-button (click)=\"atualiza()\">\n <mat-icon aria-label=\"Atualizar\">refresh</mat-icon>\n </button>\n </div>\n </div>\n </div>\n <div class=\"dialog-content\">\n <ox-item-card [codigo]=\"i.codigo\" [nome]=\"i.descricao\" (click)=\"selectItem(i)\" *ngFor=\"let i of items\" [class.selected]=\"i === selectedItem\"></ox-item-card>\n </div>\n <div class=\"dialog-footer\">\n <button mat-button [disabled]=\"selectedItem == undefined\" color=\"primary\" [mat-dialog-close]=\"selectedItem\">CONFIRMAR</button>\n <button mat-button [mat-dialog-close]=\"undefined\">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"] }]
|
|
1804
|
+
}], ctorParameters: function () { return [{ type: i3.MatDialogRef }, { type: i3.MatDialog }, { type: CommonWebService }, { type: NotificationService }, { type: ScreenHelperService }]; } });
|
|
1805
|
+
|
|
1806
|
+
class ProdutoSubgrupoAddDialogComponent {
|
|
1807
|
+
constructor(ws, notification, dataDialog, dialog, elRef, dialogRef, screenHelper) {
|
|
1808
|
+
this.ws = ws;
|
|
1809
|
+
this.notification = notification;
|
|
1810
|
+
this.dataDialog = dataDialog;
|
|
1811
|
+
this.dialog = dialog;
|
|
1812
|
+
this.elRef = elRef;
|
|
1813
|
+
this.dialogRef = dialogRef;
|
|
1814
|
+
this.screenHelper = screenHelper;
|
|
1815
|
+
this.isBusy = false;
|
|
1816
|
+
this.focus = new FocusService();
|
|
1817
|
+
this.model = {
|
|
1818
|
+
id: 0,
|
|
1819
|
+
nome: '',
|
|
1820
|
+
isAtivo: true,
|
|
1821
|
+
enviadoPC: false
|
|
1822
|
+
};
|
|
1823
|
+
this.mobile = this.screenHelper.isMedium;
|
|
1824
|
+
this.screenHelper.changedMediumScreen.subscribe(x => this.mobile = x);
|
|
1825
|
+
}
|
|
1826
|
+
ngOnInit() {
|
|
1827
|
+
this.focus.registerElement(this.elRef.nativeElement);
|
|
1828
|
+
}
|
|
1829
|
+
ngOnDestroy() {
|
|
1830
|
+
this.focus.unregisterElement(this.elRef.nativeElement);
|
|
1831
|
+
}
|
|
1832
|
+
salvar() {
|
|
1833
|
+
if (!this.model)
|
|
1834
|
+
return;
|
|
1835
|
+
const valMsg = validaProdutoGrupo(this.model, this.focus);
|
|
1836
|
+
if (valMsg) {
|
|
1837
|
+
this.notification.showMsgError(valMsg);
|
|
1838
|
+
return;
|
|
1839
|
+
}
|
|
1840
|
+
this.isBusy = true;
|
|
1841
|
+
this.ws.addProdutoSubgrupo(this.model)
|
|
1842
|
+
.subscribe(r => {
|
|
1843
|
+
this.isBusy = false;
|
|
1844
|
+
this.notification.showMsg("Salvo com sucesso.");
|
|
1845
|
+
if (this.dialogRef)
|
|
1846
|
+
this.dialogRef.close(true);
|
|
1847
|
+
}, err => {
|
|
1848
|
+
this.isBusy = false;
|
|
1849
|
+
this.notification.showMsg(err.error);
|
|
1850
|
+
});
|
|
1851
|
+
}
|
|
1852
|
+
}
|
|
1853
|
+
ProdutoSubgrupoAddDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoSubgrupoAddDialogComponent, deps: [{ token: CommonWebService }, { token: NotificationService }, { token: MAT_DIALOG_DATA }, { token: i3.MatDialog }, { token: i0.ElementRef }, { token: i3.MatDialogRef }, { token: ScreenHelperService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1854
|
+
ProdutoSubgrupoAddDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: ProdutoSubgrupoAddDialogComponent, selector: "app-produto-subgrupo-add-dialog", ngImport: i0, template: "<div class=\"ox-header\">\n <h2 class=\"titulo\">Novo Subgrupo</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 <app-produto-grupo-form [model]=\"model\" *ngIf=\"model\"></app-produto-grupo-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$1.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: ProdutoGrupoFormComponent, selector: "app-produto-grupo-form", inputs: ["model"] }] });
|
|
1855
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoSubgrupoAddDialogComponent, decorators: [{
|
|
1856
|
+
type: Component,
|
|
1857
|
+
args: [{ selector: 'app-produto-subgrupo-add-dialog', template: "<div class=\"ox-header\">\n <h2 class=\"titulo\">Novo Subgrupo</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 <app-produto-grupo-form [model]=\"model\" *ngIf=\"model\"></app-produto-grupo-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"] }]
|
|
1858
|
+
}], ctorParameters: function () {
|
|
1859
|
+
return [{ type: CommonWebService }, { type: NotificationService }, { type: undefined, decorators: [{
|
|
1860
|
+
type: Inject,
|
|
1861
|
+
args: [MAT_DIALOG_DATA]
|
|
1862
|
+
}] }, { type: i3.MatDialog }, { type: i0.ElementRef }, { type: i3.MatDialogRef }, { type: ScreenHelperService }];
|
|
1863
|
+
} });
|
|
1864
|
+
|
|
1865
|
+
class ProdutoSubgrupoEditDialogComponent {
|
|
1866
|
+
constructor(ws, notification, dataDialog, dialog, elRef, dialogRef, screenHelper) {
|
|
1867
|
+
this.ws = ws;
|
|
1868
|
+
this.notification = notification;
|
|
1869
|
+
this.dataDialog = dataDialog;
|
|
1870
|
+
this.dialog = dialog;
|
|
1871
|
+
this.elRef = elRef;
|
|
1872
|
+
this.dialogRef = dialogRef;
|
|
1873
|
+
this.screenHelper = screenHelper;
|
|
1874
|
+
this.isBusy = false;
|
|
1875
|
+
this.focus = new FocusService();
|
|
1876
|
+
if (dataDialog) {
|
|
1877
|
+
this.model = dataDialog;
|
|
1878
|
+
}
|
|
1879
|
+
this.mobile = this.screenHelper.isMedium;
|
|
1880
|
+
this.screenHelper.changedMediumScreen.subscribe(x => this.mobile = x);
|
|
1881
|
+
}
|
|
1882
|
+
ngOnInit() {
|
|
1883
|
+
this.focus.registerElement(this.elRef.nativeElement);
|
|
1884
|
+
}
|
|
1885
|
+
ngOnDestroy() {
|
|
1886
|
+
this.focus.unregisterElement(this.elRef.nativeElement);
|
|
1887
|
+
}
|
|
1888
|
+
salvar() {
|
|
1889
|
+
if (!this.model)
|
|
1890
|
+
return;
|
|
1891
|
+
const valMsg = validaProdutoGrupo(this.model, this.focus);
|
|
1892
|
+
if (valMsg) {
|
|
1893
|
+
this.notification.showMsgError(valMsg);
|
|
1894
|
+
return;
|
|
1895
|
+
}
|
|
1896
|
+
this.isBusy = true;
|
|
1897
|
+
this.ws.saveProdutoSubgrupo(this.model)
|
|
1898
|
+
.subscribe(r => {
|
|
1899
|
+
this.isBusy = false;
|
|
1900
|
+
this.notification.showMsg("Salvo com sucesso.");
|
|
1901
|
+
if (this.dialogRef)
|
|
1902
|
+
this.dialogRef.close(true);
|
|
1903
|
+
}, err => {
|
|
1904
|
+
this.isBusy = false;
|
|
1905
|
+
this.notification.showMsg(err.error);
|
|
1906
|
+
});
|
|
1907
|
+
}
|
|
1908
|
+
}
|
|
1909
|
+
ProdutoSubgrupoEditDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoSubgrupoEditDialogComponent, deps: [{ token: CommonWebService }, { token: NotificationService }, { token: MAT_DIALOG_DATA }, { token: i3.MatDialog }, { token: i0.ElementRef }, { token: i3.MatDialogRef }, { token: ScreenHelperService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1910
|
+
ProdutoSubgrupoEditDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: ProdutoSubgrupoEditDialogComponent, selector: "app-produto-subgrupo-edit-dialog", ngImport: i0, template: "<div class=\"ox-header\">\n <h2 class=\"titulo\">Editando Subgrupo</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 <app-produto-grupo-form [model]=\"model\" *ngIf=\"model\"></app-produto-grupo-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$1.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: ProdutoGrupoFormComponent, selector: "app-produto-grupo-form", inputs: ["model"] }] });
|
|
1911
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoSubgrupoEditDialogComponent, decorators: [{
|
|
1912
|
+
type: Component,
|
|
1913
|
+
args: [{ selector: 'app-produto-subgrupo-edit-dialog', template: "<div class=\"ox-header\">\n <h2 class=\"titulo\">Editando Subgrupo</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 <app-produto-grupo-form [model]=\"model\" *ngIf=\"model\"></app-produto-grupo-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"] }]
|
|
1914
|
+
}], ctorParameters: function () {
|
|
1915
|
+
return [{ type: CommonWebService }, { type: NotificationService }, { type: undefined, decorators: [{
|
|
1916
|
+
type: Inject,
|
|
1917
|
+
args: [MAT_DIALOG_DATA]
|
|
1918
|
+
}] }, { type: i3.MatDialog }, { type: i0.ElementRef }, { type: i3.MatDialogRef }, { type: ScreenHelperService }];
|
|
1919
|
+
} });
|
|
1920
|
+
|
|
1921
|
+
class ProdutoSubgrupoSelecaoDialogComponent {
|
|
1922
|
+
constructor(dialogRef, dialog, ws, notification, auth, screenHelper) {
|
|
1923
|
+
this.dialogRef = dialogRef;
|
|
1924
|
+
this.dialog = dialog;
|
|
1925
|
+
this.ws = ws;
|
|
1926
|
+
this.notification = notification;
|
|
1927
|
+
this.screenHelper = screenHelper;
|
|
1928
|
+
this.items = [];
|
|
1929
|
+
this.selectedItem = null;
|
|
1930
|
+
this.isBusy = false;
|
|
1931
|
+
this.setting = new SearchSetting();
|
|
1932
|
+
this.lazyTrigger = new LazyTrigger(() => { this.atualiza(); });
|
|
1933
|
+
this.nav = new NavegacaoSelecaoDialogUtil(this);
|
|
1934
|
+
this.mobile = this.screenHelper.isMedium;
|
|
1935
|
+
this.allowAdd = auth.permissoes.adminProdutoGrupoAdd;
|
|
1936
|
+
this.allowEdit = auth.permissoes.adminProdutoGrupoPesquisa;
|
|
1937
|
+
}
|
|
1938
|
+
ngOnInit() {
|
|
1939
|
+
this.setting.ordem = "nome";
|
|
1940
|
+
this.atualiza();
|
|
1941
|
+
}
|
|
1942
|
+
atualiza() {
|
|
1943
|
+
this.isBusy = true;
|
|
1944
|
+
this.ws.buscaProdutoSubgrupo(this.setting)
|
|
1945
|
+
.subscribe(r => {
|
|
1946
|
+
this.isBusy = false;
|
|
1947
|
+
this.items = r;
|
|
1948
|
+
console.info(r);
|
|
1949
|
+
}, err => {
|
|
1950
|
+
this.isBusy = false;
|
|
1951
|
+
this.notification.showHttpError(err);
|
|
1952
|
+
});
|
|
1953
|
+
}
|
|
1954
|
+
selectItem(i) {
|
|
1955
|
+
if (this.selectedItem === i) {
|
|
1956
|
+
this.dialogRef.close(i);
|
|
1957
|
+
}
|
|
1958
|
+
this.selectedItem = i;
|
|
1959
|
+
}
|
|
1960
|
+
novo() {
|
|
1961
|
+
let height = (window.innerHeight * 0.90) + 'px';
|
|
1962
|
+
let width = 550 + 'px';
|
|
1963
|
+
if (this.mobile) {
|
|
1964
|
+
width = (window.innerWidth * 0.99) + 'px';
|
|
1965
|
+
//height = (window.innerHeight * 0.98) + 'px';
|
|
1966
|
+
}
|
|
1967
|
+
const dialog = this.dialog.open(ProdutoSubgrupoAddDialogComponent, {
|
|
1968
|
+
width: width,
|
|
1969
|
+
height: height,
|
|
1970
|
+
maxWidth: '100%',
|
|
1971
|
+
panelClass: 'dialog-p0',
|
|
1972
|
+
});
|
|
1973
|
+
dialog.afterClosed().subscribe(result => {
|
|
1974
|
+
if (result === undefined)
|
|
1975
|
+
return;
|
|
1976
|
+
this.notification.showMsg("Salvo com sucesso.");
|
|
1977
|
+
this.atualiza();
|
|
1978
|
+
});
|
|
1979
|
+
}
|
|
1980
|
+
editar() {
|
|
1981
|
+
let height = (window.innerHeight * 0.90) + 'px';
|
|
1982
|
+
let width = 550 + 'px';
|
|
1983
|
+
if (this.mobile) {
|
|
1984
|
+
width = (window.innerWidth * 0.99) + 'px';
|
|
1985
|
+
//height = (window.innerHeight * 0.98) + 'px';
|
|
1986
|
+
}
|
|
1987
|
+
const dialog = this.dialog.open(ProdutoSubgrupoEditDialogComponent, {
|
|
1988
|
+
width: width,
|
|
1989
|
+
height: height,
|
|
1990
|
+
maxWidth: '100%',
|
|
1991
|
+
panelClass: 'dialog-p0',
|
|
1992
|
+
data: this.selectedItem
|
|
1993
|
+
});
|
|
1994
|
+
dialog.afterClosed().subscribe(result => {
|
|
1995
|
+
if (result === undefined)
|
|
1996
|
+
return;
|
|
1997
|
+
this.notification.showMsg("Salvo com sucesso.");
|
|
1998
|
+
this.atualiza();
|
|
1999
|
+
});
|
|
2000
|
+
}
|
|
2001
|
+
}
|
|
2002
|
+
ProdutoSubgrupoSelecaoDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoSubgrupoSelecaoDialogComponent, deps: [{ token: i3.MatDialogRef }, { token: i3.MatDialog }, { token: CommonWebService }, { token: NotificationService }, { token: AuthDataService }, { token: ScreenHelperService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2003
|
+
ProdutoSubgrupoSelecaoDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: ProdutoSubgrupoSelecaoDialogComponent, selector: "app-produto-subgrupo-selecao-dialog", ngImport: i0, template: "<div class=\"dialog-header\">\n <h2>Sele\u00E7\u00E3o de Subgrupos</h2>\n </div>\n <div class=\"tool-panel\">\n <div class=\"tool-section\">\n <label>Pesquisa</label>\n <div class=\"search-input-container\">\n <input (keydown)=\"nav.onKeyDown($event)\" cdkFocusInitial [(ngModel)]=\"setting.frase\" placeholder=\"Digite um termo de busca...\" (input)=\"lazyTrigger.fire()\">\n </div>\n </div>\n <div class=\"tool-section\">\n <label>A\u00E7\u00F5es</label>\n <div class=\"tool-row\">\n <button mat-icon-button (click)=\"atualiza()\">\n <mat-icon aria-label=\"Atualizar\">refresh</mat-icon>\n </button>\n <button mat-icon-button (click)=\"novo()\" *ngIf=\"allowAdd\">\n <mat-icon aria-label=\"novo\">add</mat-icon>\n </button>\n <button mat-icon-button (click)=\"editar()\" *ngIf=\"selectedItem && allowEdit\">\n <mat-icon aria-label=\"editar\">edit</mat-icon>\n </button>\n </div>\n </div>\n </div>\n <div class=\"dialog-content\">\n <ox-item-card [nome]=\"i.nome\" (click)=\"selectItem(i)\" *ngFor=\"let i of items\" [class.selected]=\"i === selectedItem\"></ox-item-card>\n </div>\n <div class=\"dialog-footer\">\n <button mat-button [disabled]=\"selectedItem == undefined\" color=\"primary\" [mat-dialog-close]=\"selectedItem\">CONFIRMAR</button>\n <button mat-button [mat-dialog-close]=\"undefined\">VOLTAR</button>\n </div>\n <ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>\n ", styles: [":host{background:#fafafa;display:flex;flex-direction:column;height:100%;max-height:99vh}\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: "directive", type: i7.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i6$1.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: ItemCardComponent, selector: "ox-item-card", inputs: ["nome", "codigo", "star", "cloud", "desativado"] }] });
|
|
2004
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoSubgrupoSelecaoDialogComponent, decorators: [{
|
|
2005
|
+
type: Component,
|
|
2006
|
+
args: [{ selector: 'app-produto-subgrupo-selecao-dialog', template: "<div class=\"dialog-header\">\n <h2>Sele\u00E7\u00E3o de Subgrupos</h2>\n </div>\n <div class=\"tool-panel\">\n <div class=\"tool-section\">\n <label>Pesquisa</label>\n <div class=\"search-input-container\">\n <input (keydown)=\"nav.onKeyDown($event)\" cdkFocusInitial [(ngModel)]=\"setting.frase\" placeholder=\"Digite um termo de busca...\" (input)=\"lazyTrigger.fire()\">\n </div>\n </div>\n <div class=\"tool-section\">\n <label>A\u00E7\u00F5es</label>\n <div class=\"tool-row\">\n <button mat-icon-button (click)=\"atualiza()\">\n <mat-icon aria-label=\"Atualizar\">refresh</mat-icon>\n </button>\n <button mat-icon-button (click)=\"novo()\" *ngIf=\"allowAdd\">\n <mat-icon aria-label=\"novo\">add</mat-icon>\n </button>\n <button mat-icon-button (click)=\"editar()\" *ngIf=\"selectedItem && allowEdit\">\n <mat-icon aria-label=\"editar\">edit</mat-icon>\n </button>\n </div>\n </div>\n </div>\n <div class=\"dialog-content\">\n <ox-item-card [nome]=\"i.nome\" (click)=\"selectItem(i)\" *ngFor=\"let i of items\" [class.selected]=\"i === selectedItem\"></ox-item-card>\n </div>\n <div class=\"dialog-footer\">\n <button mat-button [disabled]=\"selectedItem == undefined\" color=\"primary\" [mat-dialog-close]=\"selectedItem\">CONFIRMAR</button>\n <button mat-button [mat-dialog-close]=\"undefined\">VOLTAR</button>\n </div>\n <ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>\n ", styles: [":host{background:#fafafa;display:flex;flex-direction:column;height:100%;max-height:99vh}\n"] }]
|
|
2007
|
+
}], ctorParameters: function () { return [{ type: i3.MatDialogRef }, { type: i3.MatDialog }, { type: CommonWebService }, { type: NotificationService }, { type: AuthDataService }, { type: ScreenHelperService }]; } });
|
|
2008
|
+
|
|
2009
|
+
class CheckButtonComponent {
|
|
2010
|
+
constructor() {
|
|
2011
|
+
this.checked = false;
|
|
2012
|
+
this.radioBehavior = false;
|
|
2013
|
+
this.changed = new EventEmitter();
|
|
2014
|
+
this.checked = true;
|
|
2015
|
+
}
|
|
2016
|
+
ngOnInit() {
|
|
2017
|
+
}
|
|
2018
|
+
onClick(e) {
|
|
2019
|
+
if (!this.radioBehavior)
|
|
2020
|
+
this.checked = !this.checked;
|
|
2021
|
+
this.changed.emit(this.checked);
|
|
2022
|
+
}
|
|
2023
|
+
}
|
|
2024
|
+
CheckButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: CheckButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2025
|
+
CheckButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: CheckButtonComponent, selector: "ox-check-button", inputs: { checked: "checked", radioBehavior: "radioBehavior" }, outputs: { changed: "changed" }, host: { listeners: { "click": "onClick($event)" }, properties: { "class.checked": "checked" } }, ngImport: i0, template: "<ng-content></ng-content>", styles: [":host{padding:4px 8px;cursor:pointer;white-space:nowrap;color:#666;font-size:small;text-transform:uppercase;background-color:#ececec}:host:hover{background:rgba(0,0,0,.1)}:host(.checked){background:var(--app-tool-accent-color, black);color:#fff;box-shadow:0 8px 16px #0000001a}\n"] });
|
|
2026
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: CheckButtonComponent, decorators: [{
|
|
2027
|
+
type: Component,
|
|
2028
|
+
args: [{ selector: 'ox-check-button', host: {
|
|
2029
|
+
'[class.checked]': "checked",
|
|
2030
|
+
}, template: "<ng-content></ng-content>", styles: [":host{padding:4px 8px;cursor:pointer;white-space:nowrap;color:#666;font-size:small;text-transform:uppercase;background-color:#ececec}:host:hover{background:rgba(0,0,0,.1)}:host(.checked){background:var(--app-tool-accent-color, black);color:#fff;box-shadow:0 8px 16px #0000001a}\n"] }]
|
|
2031
|
+
}], ctorParameters: function () { return []; }, propDecorators: { checked: [{
|
|
2032
|
+
type: Input
|
|
2033
|
+
}], radioBehavior: [{
|
|
2034
|
+
type: Input
|
|
2035
|
+
}], changed: [{
|
|
2036
|
+
type: Output
|
|
2037
|
+
}], onClick: [{
|
|
2038
|
+
type: HostListener,
|
|
2039
|
+
args: ['click', ['$event']]
|
|
2040
|
+
}] } });
|
|
2041
|
+
|
|
2042
|
+
class RadioButtonGroupComponent {
|
|
2043
|
+
constructor() {
|
|
2044
|
+
this.change = new EventEmitter();
|
|
2045
|
+
this._items = [];
|
|
2046
|
+
//_init : boolean = false;
|
|
2047
|
+
this.selectedItem = null;
|
|
2048
|
+
}
|
|
2049
|
+
get items() {
|
|
2050
|
+
return this._items;
|
|
2051
|
+
}
|
|
2052
|
+
set items(val) {
|
|
2053
|
+
this._items = val;
|
|
2054
|
+
this.selectedItem = this.items.filter(x => x.default === true).firstOrNull();
|
|
2055
|
+
if (this.selectedItem === null)
|
|
2056
|
+
this.selectedItem = this.items.firstOrNull();
|
|
2057
|
+
}
|
|
2058
|
+
ngOnInit() {
|
|
2059
|
+
}
|
|
2060
|
+
raiseChange(item) {
|
|
2061
|
+
this.selectedItem = item;
|
|
2062
|
+
this.change.emit(this.selectedItem);
|
|
2063
|
+
}
|
|
2064
|
+
}
|
|
2065
|
+
RadioButtonGroupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: RadioButtonGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2066
|
+
RadioButtonGroupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: RadioButtonGroupComponent, selector: "ox-radio-button-group", inputs: { selectedItem: "selectedItem", items: "items" }, outputs: { change: "change" }, ngImport: i0, template: "<ox-check-button [radioBehavior]=\"true\" (changed)=\"raiseChange(item)\" [checked]=\"item == selectedItem\" *ngFor=\"let item of items\">\n {{item.name}}\n</ox-check-button>", styles: [":host>:first-child{border-radius:4px 0 0 4px}:host>:last-child{border-radius:0 4px 4px 0}\n"], dependencies: [{ kind: "directive", type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: CheckButtonComponent, selector: "ox-check-button", inputs: ["checked", "radioBehavior"], outputs: ["changed"] }] });
|
|
2067
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: RadioButtonGroupComponent, decorators: [{
|
|
2068
|
+
type: Component,
|
|
2069
|
+
args: [{ selector: 'ox-radio-button-group', template: "<ox-check-button [radioBehavior]=\"true\" (changed)=\"raiseChange(item)\" [checked]=\"item == selectedItem\" *ngFor=\"let item of items\">\n {{item.name}}\n</ox-check-button>", styles: [":host>:first-child{border-radius:4px 0 0 4px}:host>:last-child{border-radius:0 4px 4px 0}\n"] }]
|
|
2070
|
+
}], ctorParameters: function () { return []; }, propDecorators: { change: [{
|
|
2071
|
+
type: Output
|
|
2072
|
+
}], selectedItem: [{
|
|
2073
|
+
type: Input
|
|
2074
|
+
}], items: [{
|
|
2075
|
+
type: Input
|
|
2076
|
+
}] } });
|
|
2077
|
+
|
|
2078
|
+
const lateralAnimation = trigger('menuLateral', [
|
|
2079
|
+
transition(':enter', [
|
|
2080
|
+
style({ opacity: 0 }),
|
|
2081
|
+
animate('600ms', style({ 'opacity': 1 }))
|
|
2082
|
+
])
|
|
2083
|
+
]);
|
|
2084
|
+
class ProdutoFormComponent {
|
|
2085
|
+
constructor(dialog, ws, http, auth, notification, screenHelper) {
|
|
2086
|
+
this.dialog = dialog;
|
|
2087
|
+
this.ws = ws;
|
|
2088
|
+
this.http = http;
|
|
2089
|
+
this.auth = auth;
|
|
2090
|
+
this.notification = notification;
|
|
2091
|
+
this.screenHelper = screenHelper;
|
|
2092
|
+
this.cfopList = [
|
|
2093
|
+
{ item1: '5101', item2: 'Venda de produção do estabelecimento' },
|
|
2094
|
+
{ item1: '5102', item2: 'Venda de mercadoria adquirida ou recebida de terceiros' },
|
|
2095
|
+
{ item1: '5405', item2: 'Venda de mercadoria, adquirida ou recebida de terceiros, sujeita ao regime de substituição tributária, na condição de contribuinte-substituído' },
|
|
2096
|
+
{ item1: '5933', item2: 'Serviço' },
|
|
2097
|
+
];
|
|
2098
|
+
this.stList = [
|
|
2099
|
+
{ item1: 'F', item2: 'Subs. Trib.' },
|
|
2100
|
+
{ item1: 'I', item2: 'Isento' },
|
|
2101
|
+
{ item1: 'N', item2: 'Não Tributado' },
|
|
2102
|
+
{ item1: 'Q', item2: 'Isento ISSQN' },
|
|
2103
|
+
{ item1: 'S', item2: 'Tributado ISSQN' },
|
|
2104
|
+
{ item1: 'T', item2: 'Tributado ICMS' },
|
|
2105
|
+
];
|
|
2106
|
+
this.modBaseICMS = [
|
|
2107
|
+
{ item1: 0, item2: 'Margem Valor Agregado (%)' },
|
|
2108
|
+
{ item1: 1, item2: 'Pauta (Valor)' },
|
|
2109
|
+
{ item1: 2, item2: 'Preço Tabelado Máx. (valor)' },
|
|
2110
|
+
{ item1: 3, item2: 'Valor da operação' },
|
|
2111
|
+
];
|
|
2112
|
+
this.cstICMSList = [
|
|
2113
|
+
{ item1: '00', item2: 'Tributada integralmente' },
|
|
2114
|
+
{ item1: '10', item2: 'Tributada e com cobrança do ICMS por substituição tributária' },
|
|
2115
|
+
{ item1: '20', item2: 'Com redução de base de cálculo' },
|
|
2116
|
+
{ item1: '30', item2: 'Isenta ou não tributada e com cobrança do ICMS por substituição tributária' },
|
|
2117
|
+
{ item1: '40', item2: 'Isenta' },
|
|
2118
|
+
{ item1: '41', item2: 'Não tributada' },
|
|
2119
|
+
{ item1: '50', item2: 'Suspensão' },
|
|
2120
|
+
{ item1: '51', item2: 'Diferimento' },
|
|
2121
|
+
{ item1: '60', item2: 'ICMS cobrado anteriormente por substituição tributária' },
|
|
2122
|
+
{ item1: '70', item2: 'Com redução de base de cálculo e cobrança do ICMS por substituição tributária' },
|
|
2123
|
+
{ item1: '90', item2: 'Outros' },
|
|
2124
|
+
{ item1: '101', item2: 'Tributada pelo Simples Nacional com permissão de crédito' },
|
|
2125
|
+
{ item1: '102', item2: 'Tributada pelo Simples Nacional sem permissão de crédito' },
|
|
2126
|
+
{ item1: '103', item2: 'Isenção do ICMS no Simples Nacional para faixa de receita bruta' },
|
|
2127
|
+
{ item1: '300', item2: 'Imune' },
|
|
2128
|
+
{ item1: '400', item2: 'Não tributada pelo Simples Nacional' },
|
|
2129
|
+
{ item1: '201', item2: 'Tributada pelo Simples Nacional com permissão de crédito e com cobrança do ICMS por Substituição Tributária' },
|
|
2130
|
+
{ item1: '202', item2: 'Tributada pelo Simples Nacional sem permissão de crédito e com cobrança do ICMS por Substituição Tributária' },
|
|
2131
|
+
{ item1: '203', item2: 'Isenção do ICMS nos Simples Nacional para faixa de receita bruta e com cobrança do ICMS por Substituição Tributária' },
|
|
2132
|
+
{ item1: '500', item2: 'ICMS cobrado anteriormente por substituição tributária (substituído) ou por antecipação' },
|
|
2133
|
+
{ item1: '900', item2: 'Outros' }
|
|
2134
|
+
];
|
|
2135
|
+
this.cstCofinsList = [
|
|
2136
|
+
{ item1: '01', item2: ' Operação Tributável (base de cálculo = valor da operação alíquota normal (cumulativo/não cumulativo));' },
|
|
2137
|
+
{ item1: '02', item2: ' Operação Tributável (base de cálculo = valor da operação (alíquota diferenciada));' },
|
|
2138
|
+
{ item1: '03', item2: ' Operação Tributável (base de cálculo = quantidade vendida x alíquota por unidade de produto);' },
|
|
2139
|
+
{ item1: '04', item2: ' Operação Tributável (tributação monofásica (alíquota zero));' },
|
|
2140
|
+
{ item1: '05', item2: ' Operação Tributável (Substituição Tributária);' },
|
|
2141
|
+
{ item1: '06', item2: ' Operação Tributável (alíquota zero);' },
|
|
2142
|
+
{ item1: '07', item2: ' Operação Isenta da Contribuição;' },
|
|
2143
|
+
{ item1: '08', item2: ' Operação Sem Incidência da Contribuição;' },
|
|
2144
|
+
{ item1: '09', item2: ' Operação com Suspensão da Contribuição;' },
|
|
2145
|
+
{ item1: '99', item2: ' Outras Operações;' },
|
|
2146
|
+
{ item1: '49', item2: ' Outras Operações de Saída; ' },
|
|
2147
|
+
{ item1: '50', item2: ' Operação com Direito a Crédito Vinculada Exclusivamente a Receita Tributada no Mercado Interno; ' },
|
|
2148
|
+
{ item1: '51', item2: ' Operação com Direito a Crédito Vinculada Exclusivamente a Receita Não Tributada no Mercado Interno ;' },
|
|
2149
|
+
{ item1: '52', item2: ' Operação com Direito a Crédito Vinculada Exclusivamente a Receita de Exportação; ' },
|
|
2150
|
+
{ item1: '53', item2: ' Operação com Direito a Crédito Vinculada a Receitas Tributadas e NãoTributadas no Mercado Interno; ' },
|
|
2151
|
+
{ item1: '54', item2: ' Operação com Direito a Crédito Vinculada a Receitas Tributadas no Mercado Interno e de Exportação ;' },
|
|
2152
|
+
{ item1: '55', item2: ' Operação com Direito a Crédito Vinculada a Receitas NãoTributadas no Mercado Interno e de Exportação; ' },
|
|
2153
|
+
{ item1: '56', item2: ' Operação com Direito a Crédito Vinculada a Receitas Tributadas e NãoTributadas no Mercado Interno, e de Exportação;' },
|
|
2154
|
+
{ item1: '60', item2: ' Crédito Presumido Operação de Aquisição Vinculada Exclusivamente a Receita Tributada no Mercado Interno; ' },
|
|
2155
|
+
{ item1: '61', item2: ' Crédito Presumido Operação de Aquisição Vinculada Exclusivamente a Receita Não Tributada no Mercado Interno; ' },
|
|
2156
|
+
{ item1: '62', item2: ' Crédito Presumido Operação de Aquisição Vinculada Exclusivamente a Receita de Exportação; ' },
|
|
2157
|
+
{ item1: '63', item2: ' Crédito Presumido Operação de Aquisição Vinculada a Receitas Tributadas e NãoTributadas no Mercado Interno; ' },
|
|
2158
|
+
{ item1: '64', item2: ' Crédito Presumido Operação de Aquisição Vinculada a Receitas Tributadas no Mercado Interno e de Exportação; ' },
|
|
2159
|
+
{ item1: '65', item2: ' Crédito Presumido Operação de Aquisição Vinculada a Receitas NãoTributadas no Mercado Interno e de Exportação; ' },
|
|
2160
|
+
{ item1: '66', item2: ' Crédito Presumido Operação de Aquisição Vinculada a Receitas Tributadas e NãoTributadas no Mercado Interno, e de Exportação; ' },
|
|
2161
|
+
{ item1: '67', item2: ' Crédito Presumido Outras Operações; ' },
|
|
2162
|
+
{ item1: '70', item2: ' Operação de Aquisição sem Direito a Crédito; ' },
|
|
2163
|
+
{ item1: '71', item2: ' Operação de Aquisição com Isenção; ' },
|
|
2164
|
+
{ item1: '72', item2: ' Operação de Aquisição com Suspensão; ' },
|
|
2165
|
+
{ item1: '73', item2: ' Operação de Aquisição a Alíquota Zero; ' },
|
|
2166
|
+
{ item1: '74', item2: ' Operação de Aquisição sem Incidência da Contribuição; ' },
|
|
2167
|
+
{ item1: '75', item2: ' Operação de Aquisição por Substituição Tributária;' },
|
|
2168
|
+
{ item1: '98', item2: ' Outras Operações de Entrada;' },
|
|
2169
|
+
];
|
|
2170
|
+
this.ncmEncontrado = false;
|
|
2171
|
+
this.ncmNaoEncontrado = false;
|
|
2172
|
+
this.isBusy = false;
|
|
2173
|
+
this.pRedBCEfet_icmsParser = new NumberParser(v => this.model.pRedBCEfet_icms = v, () => this.model.pRedBCEfet_icms);
|
|
2174
|
+
this.picmsEfet_icmsParser = new NumberParser(v => this.model.picmsEfet_icms = v, () => this.model.picmsEfet_icms);
|
|
2175
|
+
this.vbcEfet_icmsParser = new NumberParser(v => this.model.vbcEfet_icms = v, () => this.model.vbcEfet_icms);
|
|
2176
|
+
this.vicmsEfet_icmsParser = new NumberParser(v => this.model.vicmsEfet_icms = v, () => this.model.vicmsEfet_icms);
|
|
2177
|
+
this.psT_icmsParser = new NumberParser(v => this.model.psT_icms = v, () => this.model.psT_icms);
|
|
2178
|
+
this.vbcstRet_icmsParser = new NumberParser(v => this.model.vbcstRet_icms = v, () => this.model.vbcstRet_icms);
|
|
2179
|
+
this.vicmsSubstituto_icmsParser = new NumberParser(v => this.model.vicmsSubstituto_icms = v, () => this.model.vicmsSubstituto_icms);
|
|
2180
|
+
this.vicmsstRet_icmsParser = new NumberParser(v => this.model.vicmsstRet_icms = v, () => this.model.vicmsstRet_icms);
|
|
2181
|
+
this.pfcP_icmsParser = new NumberParser(v => this.model.pfcP_icms = v, () => this.model.pfcP_icms);
|
|
2182
|
+
this.vbcfcP_icmsParser = new NumberParser(v => this.model.vbcfcP_icms = v, () => this.model.vbcfcP_icms);
|
|
2183
|
+
this.pfcpsT_icmsParser = new NumberParser(v => this.model.pfcpsT_icms = v, () => this.model.pfcpsT_icms);
|
|
2184
|
+
this.vbcfcpsT_icmsParser = new NumberParser(v => this.model.vbcfcpsT_icms = v, () => this.model.vbcfcpsT_icms);
|
|
2185
|
+
this.pfcpstRet_icmsParser = new NumberParser(v => this.model.pfcpstRet_icms = v, () => this.model.pfcpstRet_icms);
|
|
2186
|
+
this.vbcfcpstRet_icmsParser = new NumberParser(v => this.model.vbcfcpstRet_icms = v, () => this.model.vbcfcpstRet_icms);
|
|
2187
|
+
this.ppiS_pisParser = new NumberParser(v => this.model.ppiS_pis = v, () => this.model.ppiS_pis);
|
|
2188
|
+
this.vbC_pisParser = new NumberParser(v => this.model.vbC_pis = v, () => this.model.vbC_pis);
|
|
2189
|
+
this.pcofinS_cofinsParser = new NumberParser(v => this.model.pcofinS_cofins = v, () => this.model.pcofinS_cofins);
|
|
2190
|
+
this.vbC_cofinsParser = new NumberParser(v => this.model.vbC_cofins = v, () => this.model.vbC_cofins);
|
|
2191
|
+
this.precoVendaParser = new NumberParser((v) => this.model.precoVenda = v !== null && v !== void 0 ? v : 0, () => this.model.precoVenda);
|
|
2192
|
+
this.precoCustoParser = new NumberParser((v) => this.model.precoCusto = v !== null && v !== void 0 ? v : 0, () => this.model.precoCusto);
|
|
2193
|
+
this.precoFuncParser = new NumberParser((v) => this.model.precoFuncionario = v !== null && v !== void 0 ? v : 0, () => this.model.precoFuncionario);
|
|
2194
|
+
this.pICMS_icmsParser = new NumberParser((v) => this.model.pICMS_icms = v, () => this.model.pICMS_icms);
|
|
2195
|
+
this.lazyTriggerNcm = new LazyTrigger(() => { this.findNCM(); });
|
|
2196
|
+
this.editMode = false;
|
|
2197
|
+
this.nextIdClick = new EventEmitter();
|
|
2198
|
+
this.progress = 0;
|
|
2199
|
+
this.message = '';
|
|
2200
|
+
this._model = createProduct();
|
|
2201
|
+
this.tabs = [
|
|
2202
|
+
{ name: "Campos Gerais", value: 0 },
|
|
2203
|
+
{ name: "Campos Fiscais", value: 1 },
|
|
2204
|
+
{ name: "Cardápio Digital", value: 2 }
|
|
2205
|
+
];
|
|
2206
|
+
this.selectedTab = 0;
|
|
2207
|
+
this.setores = [];
|
|
2208
|
+
}
|
|
2209
|
+
get model() {
|
|
2210
|
+
return this._model;
|
|
2211
|
+
}
|
|
2212
|
+
set model(value) {
|
|
2213
|
+
this._model = value;
|
|
2214
|
+
this.setImgUrl();
|
|
2215
|
+
this.findNCM();
|
|
2216
|
+
}
|
|
2217
|
+
ngOnInit() {
|
|
2218
|
+
this.loadSetores();
|
|
2219
|
+
}
|
|
2220
|
+
loadSetores() {
|
|
2221
|
+
this.isBusy = true;
|
|
2222
|
+
this.ws.getAllSetores()
|
|
2223
|
+
.subscribe(r => {
|
|
2224
|
+
this.setores = r;
|
|
2225
|
+
console.info(r);
|
|
2226
|
+
this.isBusy = false;
|
|
2227
|
+
}, err => {
|
|
2228
|
+
this.isBusy = false;
|
|
2229
|
+
this.notification.showHttpError(err);
|
|
2230
|
+
});
|
|
2231
|
+
}
|
|
2232
|
+
editarNCM() {
|
|
2233
|
+
let height = (window.innerHeight * 0.95) + 'px';
|
|
2234
|
+
let width = 550 + 'px';
|
|
2235
|
+
if (this.screenHelper.mobileScreen) {
|
|
2236
|
+
width = (window.innerWidth * 0.99) + 'px';
|
|
2237
|
+
height = (window.innerHeight * 0.99) + 'px';
|
|
2238
|
+
}
|
|
2239
|
+
let dialogRef = this.dialog.open(ProdutosNcmDialogComponent, {
|
|
2240
|
+
height: height,
|
|
2241
|
+
width: width,
|
|
2242
|
+
maxWidth: '100%',
|
|
2243
|
+
panelClass: 'dialog-p0',
|
|
2244
|
+
});
|
|
2245
|
+
dialogRef.afterClosed().subscribe(result => {
|
|
2246
|
+
if (result == undefined)
|
|
2247
|
+
return;
|
|
2248
|
+
if (!this.model)
|
|
2249
|
+
return;
|
|
2250
|
+
this.model.ncm = result.codigoApenasDigitos;
|
|
2251
|
+
this.lazyTriggerNcm.fire();
|
|
2252
|
+
});
|
|
2253
|
+
}
|
|
2254
|
+
editarSubgrupo() {
|
|
2255
|
+
let height = (window.innerHeight * 0.95) + 'px';
|
|
2256
|
+
let width = 550 + 'px';
|
|
2257
|
+
if (this.screenHelper.mobileScreen) {
|
|
2258
|
+
width = (window.innerWidth * 0.99) + 'px';
|
|
2259
|
+
height = (window.innerHeight * 0.99) + 'px';
|
|
2260
|
+
}
|
|
2261
|
+
let dialogRef = this.dialog.open(ProdutoSubgrupoSelecaoDialogComponent, {
|
|
2262
|
+
height: height,
|
|
2263
|
+
width: width,
|
|
2264
|
+
maxWidth: '100%',
|
|
2265
|
+
panelClass: 'dialog-p0',
|
|
2266
|
+
});
|
|
2267
|
+
dialogRef.afterClosed().subscribe(result => {
|
|
2268
|
+
if (result == undefined)
|
|
2269
|
+
return;
|
|
2270
|
+
if (!this.model)
|
|
2271
|
+
return;
|
|
2272
|
+
this.model.subgrupoId = result.id;
|
|
2273
|
+
this.model.subgrupoNome = result.nome;
|
|
2274
|
+
});
|
|
2275
|
+
}
|
|
2276
|
+
editarGrupo() {
|
|
2277
|
+
let height = (window.innerHeight * 0.95) + 'px';
|
|
2278
|
+
let width = 550 + 'px';
|
|
2279
|
+
if (this.screenHelper.mobileScreen) {
|
|
2280
|
+
width = (window.innerWidth * 0.99) + 'px';
|
|
2281
|
+
height = (window.innerHeight * 0.99) + 'px';
|
|
2282
|
+
}
|
|
2283
|
+
let dialogRef = this.dialog.open(ProdutoGrupoSelecaoDialogComponent, {
|
|
2284
|
+
height: height,
|
|
2285
|
+
width: width,
|
|
2286
|
+
maxWidth: '100%',
|
|
2287
|
+
panelClass: 'dialog-p0',
|
|
2288
|
+
});
|
|
2289
|
+
dialogRef.afterClosed().subscribe(result => {
|
|
2290
|
+
if (result == undefined)
|
|
2291
|
+
return;
|
|
2292
|
+
if (!this.model)
|
|
2293
|
+
return;
|
|
2294
|
+
this.model.grupoId = result.id;
|
|
2295
|
+
this.model.grupoNome = result.nome;
|
|
2296
|
+
});
|
|
2297
|
+
}
|
|
2298
|
+
editarCategoriaCardapio() {
|
|
2299
|
+
let height = (window.innerHeight * 0.95) + 'px';
|
|
2300
|
+
let width = 550 + 'px';
|
|
2301
|
+
if (this.screenHelper.mobileScreen) {
|
|
2302
|
+
width = (window.innerWidth * 0.99) + 'px';
|
|
2303
|
+
height = (window.innerHeight * 0.99) + 'px';
|
|
2304
|
+
}
|
|
2305
|
+
let dialogRef = this.dialog.open(ProdutoCategoriaCardapioSelecaoDialogComponent, {
|
|
2306
|
+
height: height,
|
|
2307
|
+
width: width,
|
|
2308
|
+
maxWidth: '100%',
|
|
2309
|
+
panelClass: 'dialog-p0',
|
|
2310
|
+
});
|
|
2311
|
+
dialogRef.afterClosed().subscribe(result => {
|
|
2312
|
+
if (result == undefined)
|
|
2313
|
+
return;
|
|
2314
|
+
if (!this.model)
|
|
2315
|
+
return;
|
|
2316
|
+
this.model.categoriaCardapioId = result.id;
|
|
2317
|
+
this.model.categoriaCardapioNome = result.nome;
|
|
2318
|
+
});
|
|
2319
|
+
}
|
|
2320
|
+
changeModo(ev) {
|
|
2321
|
+
this.selectedTab = ev.value;
|
|
2322
|
+
}
|
|
2323
|
+
uploadFile(files) {
|
|
2324
|
+
if (!this.model)
|
|
2325
|
+
return;
|
|
2326
|
+
if (files.length === 0) {
|
|
2327
|
+
return;
|
|
2328
|
+
}
|
|
2329
|
+
let fileToUpload = files[0];
|
|
2330
|
+
const formData = new FormData();
|
|
2331
|
+
formData.append('file', fileToUpload, fileToUpload.name);
|
|
2332
|
+
this.http.post(this.ws.PRODUTO_BASE_URL + "Imagem?produtoId=" + this.model.id, formData, {
|
|
2333
|
+
reportProgress: true,
|
|
2334
|
+
observe: 'events',
|
|
2335
|
+
headers: {
|
|
2336
|
+
"Authorization": 'token ' + this.auth.token,
|
|
2337
|
+
}
|
|
2338
|
+
})
|
|
2339
|
+
.subscribe(event => {
|
|
2340
|
+
var _a;
|
|
2341
|
+
if (event.type === HttpEventType.UploadProgress) {
|
|
2342
|
+
const total = (_a = event.total) !== null && _a !== void 0 ? _a : -1;
|
|
2343
|
+
this.progress = Math.round(100 * event.loaded / total);
|
|
2344
|
+
}
|
|
2345
|
+
else if (event.type === HttpEventType.Response) {
|
|
2346
|
+
this.message = 'Sucesso';
|
|
2347
|
+
this.imgUrl = undefined;
|
|
2348
|
+
setTimeout(() => {
|
|
2349
|
+
this.setImgUrl(new Date().getMinutes() + "");
|
|
2350
|
+
}, 1000);
|
|
2351
|
+
}
|
|
2352
|
+
}, err => {
|
|
2353
|
+
const httpError = err;
|
|
2354
|
+
this.message = httpError.error;
|
|
2355
|
+
});
|
|
2356
|
+
}
|
|
2357
|
+
setImgUrl(upload = undefined) {
|
|
2358
|
+
if (!this.model)
|
|
2359
|
+
return;
|
|
2360
|
+
this.imgUrl = this.ws.MEDIA_PRODUTO_IMAGEM_URL +
|
|
2361
|
+
'?produtoId=' + this.model.id +
|
|
2362
|
+
'&token=' + this.auth.token +
|
|
2363
|
+
(upload !== undefined ? '&upload=' + upload : '');
|
|
2364
|
+
}
|
|
2365
|
+
findNCM() {
|
|
2366
|
+
this.ncmEncontrado = false;
|
|
2367
|
+
this.ncmNaoEncontrado = false;
|
|
2368
|
+
if (!this.model)
|
|
2369
|
+
return;
|
|
2370
|
+
if (!this.model.ncm)
|
|
2371
|
+
return;
|
|
2372
|
+
this.isBusy = true;
|
|
2373
|
+
this.ws.findNcm(this.model.ncm)
|
|
2374
|
+
.subscribe(r => {
|
|
2375
|
+
this.ncmEncontrado = r != null;
|
|
2376
|
+
this.ncmNaoEncontrado = r == null;
|
|
2377
|
+
console.info(r);
|
|
2378
|
+
this.isBusy = false;
|
|
2379
|
+
}, err => {
|
|
2380
|
+
this.isBusy = false;
|
|
2381
|
+
this.notification.showHttpError(err);
|
|
2382
|
+
});
|
|
2383
|
+
}
|
|
2384
|
+
}
|
|
2385
|
+
ProdutoFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoFormComponent, deps: [{ token: i3.MatDialog }, { token: CommonWebService }, { token: i1.HttpClient }, { token: AuthDataService }, { token: NotificationService }, { token: ScreenHelperService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2386
|
+
ProdutoFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: ProdutoFormComponent, selector: "app-produto-form", inputs: { editMode: "editMode", model: "model" }, outputs: { nextIdClick: "nextIdClick" }, ngImport: i0, template: "<div style=\"margin-bottom: 16px\">\n <ox-radio-button-group (change)=\"changeModo($event)\" [items]=\"tabs\" class=\"tool-item-container\">\n </ox-radio-button-group>\n</div>\n<div [@menuLateral] class=\"vbox\" *ngIf=\"selectedTab == 0\">\n <div class=\"hbox\">\n <div class=\"form-group\">\n <label>C\u00F3digo</label>\n <div class=\"hbox\">\n <input id=\"id\" [attr.readonly]=\"editMode\" [(ngModel)]=\"model.id\" class=\"form-control input-120\"\n tabindex=\"2\">\n <button (click)=\"nextIdClick.emit()\" *ngIf=\"!editMode\" class=\"form-inline-button btn-form-margin\">\n <span class=\"material-icons\">\n lightbulb\n </span>\n </button>\n </div>\n </div>\n <div class=\"form-group margin-left-8\">\n <label>Refer\u00EAncia</label>\n <input id=\"referencia\" [(ngModel)]=\"model.referencia\" class=\"form-control input-120\" tabindex=\"2\">\n </div>\n </div>\n <div class=\"form-group\">\n <label>Nome</label>\n <input id=\"nome\" [(ngModel)]=\"model.nome\" cdkFocusInitial class=\"form-control input-300\" tabindex=\"2\">\n </div>\n <div class=\"hbox\">\n <div class=\"form-group\">\n <label>Pre\u00E7o de Venda</label>\n <input id=\"precoVenda\" [ngModel]=\"model.precoVenda | number:'1.2-2'\"\n (ngModelChange)=\"precoVendaParser.parse($event)\" (focusout)=\"precoVendaParser.checkout()\"\n class=\"form-control input-100 text-right\" tabindex=\"2\">\n </div>\n <div class=\"form-group margin-left-8\">\n <label>Pre\u00E7o p/ Func.</label>\n <input id=\"precoFuncionario\" [ngModel]=\"model.precoFuncionario | number:'1.2-2'\"\n (ngModelChange)=\"precoFuncParser.parse($event)\" (focusout)=\"precoFuncParser.checkout()\"\n class=\"form-control input-100 text-right\" tabindex=\"2\">\n </div>\n <div class=\"form-group margin-left-8\">\n <label>Pre\u00E7o de Custo</label>\n <input id=\"precoCusto\" [ngModel]=\"model.precoCusto | number:'1.2-2'\"\n (ngModelChange)=\"precoCustoParser.parse($event)\" (focusout)=\"precoCustoParser.checkout()\"\n class=\"form-control input-100 text-right\" tabindex=\"2\">\n </div>\n </div>\n <div class=\"form-group\">\n <label>Grupo</label>\n <div class=\"hbox\">\n <div id=\"grupo\" (click)=\"editarGrupo()\" class=\"form-control grow-1 input-selecao input-300\">\n {{model.grupoNome}} </div>\n <button (click)=\"editarGrupo()\" class=\"form-inline-button btn-form-margin\">\n <span class=\"material-icons\">\n search\n </span>\n </button>\n </div>\n </div>\n <div class=\"form-group\">\n <label>Subgrupo</label>\n <div class=\"hbox\">\n <div id=\"subgrupo\" (click)=\"editarSubgrupo()\" class=\"form-control grow-1 input-selecao input-300\">\n {{model.subgrupoNome}} </div>\n <button (click)=\"editarSubgrupo()\" class=\"form-inline-button btn-form-margin\">\n <span class=\"material-icons\">\n search\n </span>\n </button>\n </div>\n </div>\n\n <div class=\"hbox gap-8\">\n <div class=\"form-group\">\n <label>Unidade</label>\n <input id=\"unidade\" [(ngModel)]=\"model.unidade\" class=\"form-control input-120\">\n </div>\n <div class=\"form-group\">\n <label>Estoque Min.</label>\n <input id=\"estoqueMinimo\" [(ngModel)]=\"model.estoqueMinimo\" class=\"form-control input-120\">\n </div>\n </div>\n\n <div class=\"hbox gap-8\">\n <div class=\"form-group\">\n <label>C\u00F3digo Patrim\u00F4nio</label>\n <input id=\"codigoPatrimonio\" [(ngModel)]=\"model.codigoPatrimonio\" class=\"form-control input-120\"\n maxlength=\"36\">\n </div>\n <div class=\"form-group\">\n <label>Obs.</label>\n <input id=\"obs\" [(ngModel)]=\"model.obs\" class=\"form-control input-300\" maxlength=\"300\">\n </div>\n </div>\n \n <div class=\"hbox gap-8\">\n <div class=\"form-group\">\n <label>Setor Subestoque</label>\n <mat-select [(value)]=\"model.setorSubEstoqueId\" class=\"form-control input-120\">\n <mat-option *ngFor=\"let i of setores\" [value]=\"i.id\">\n {{i.nome}}\n </mat-option>\n </mat-select>\n </div>\n <div class=\"form-group\">\n <label>Qtd. Subestoque</label>\n <input id=\"qtdMinSubEstoque\" [(ngModel)]=\"model.qtdMinSubEstoque\" class=\"form-control input-120 text-right\">\n </div>\n </div>\n <div class=\"vbox\">\n <mat-slide-toggle [(ngModel)]=\"model.estoqueControlado\" tabindex=-1>Controlado no Estoque</mat-slide-toggle>\n <mat-slide-toggle [(ngModel)]=\"model.imprimiCozinha\" tabindex=-1>Imprime Cozinha</mat-slide-toggle>\n <mat-slide-toggle [(ngModel)]=\"model.imprimeCorredor\" tabindex=-1>Imprime Corredor</mat-slide-toggle>\n <mat-slide-toggle [(ngModel)]=\"model.verNaRecepcao\" tabindex=-1>Ver na Recep\u00E7\u00E3o</mat-slide-toggle>\n <mat-slide-toggle [(ngModel)]=\"model.omiteCliente\" tabindex=-1>N\u00E3o Exibe para o Cliente na Sa\u00EDda\n </mat-slide-toggle>\n <mat-slide-toggle [(ngModel)]=\"model.isAtivo\" tabindex=-1>Ativado</mat-slide-toggle>\n </div>\n\n</div>\n\n<div [@menuLateral] class=\"vbox\" *ngIf=\"selectedTab == 1\">\n\n <div style=\"margin-bottom: 16px;\" class=\"vbox\">\n <mat-slide-toggle [(ngModel)]=\"model.emiteNFCe\" tabindex=-1>Emite Fiscal\n </mat-slide-toggle>\n </div>\n <div class=\"hbox gap-8\">\n <div class=\"form-group\">\n <label>GTIN</label>\n <input id=\"gtin\" [(ngModel)]=\"model.gtin\" class=\"form-control input-120\" placeholder=\"SEM GTIN\"\n maxlength=\"14\">\n </div>\n <div class=\"form-group\">\n <label>CFOP</label>\n <input id=\"cfop\" [(ngModel)]=\"model.cfop\" [matAutocomplete]=\"auto\" matInput class=\"form-control input-100\"\n maxlength=\"4\">\n <mat-autocomplete #auto=\"matAutocomplete\">\n <mat-option *ngFor=\"let option of cfopList\" [value]=\"option.item1\">\n {{option.item1}} <small>{{option.item2}}</small>\n </mat-option>\n </mat-autocomplete>\n </div>\n <div class=\"form-group\">\n <label>NCM</label>\n <div class=\"hbox\">\n <input id=\"ncm\" (input)=\"lazyTriggerNcm.fire()\" [(ngModel)]=\"model.ncm\" class=\"form-control input-100\"\n maxlength=\"8\">\n <button (click)=\"editarNCM()\" class=\"form-inline-button btn-form-margin\">\n <span class=\"material-icons\">\n search\n </span>\n </button>\n <span class=\"badge buscando\" *ngIf=\"isBusy\">Buscando...</span>\n <span class=\"badge encontrado\" *ngIf=\"ncmEncontrado\">Encontrado</span>\n <span class=\"badge nao-encontrado\" *ngIf=\"ncmNaoEncontrado\">N\u00E3o encontrado</span>\n </div>\n </div>\n </div>\n <div class=\"hbox gap-8\">\n <div class=\"form-group\">\n <label>CEST</label>\n <input id=\"cest\" [(ngModel)]=\"model.cest\" autocomplete=\"off\" class=\"form-control input-120\" maxlength=\"7\">\n </div>\n <div class=\"form-group\">\n <label>ICMS (ECF/SAT)</label>\n <input id=\"aliquotaICMS\" [(ngModel)]=\"model.aliquotaICMS\" autocomplete=\"off\" class=\"form-control input-100 text-right\"\n maxlength=\"5\">\n </div>\n <div class=\"form-group\">\n <label>S. T. (ECF/SAT)</label>\n <input id=\"sitTrib\" [(ngModel)]=\"model.sitTrib\" autocomplete=\"off\" [matAutocomplete]=\"autoST\" matInput\n class=\"form-control input-120\" maxlength=\"5\">\n <mat-autocomplete #autoST=\"matAutocomplete\">\n <mat-option *ngFor=\"let option of stList\" [value]=\"option.item1\">\n {{option.item1}} <small>{{option.item2}}</small>\n </mat-option>\n </mat-autocomplete>\n </div>\n </div>\n <h4>Campos da NFC-e</h4>\n <div class=\"hbox gap-8\">\n <div class=\"form-group\">\n <label>CST/CSOSN</label>\n <mat-select [(value)]=\"model.csT_icms\" class=\"form-control input-120\">\n <mat-option *ngFor=\"let i of cstICMSList\" [value]=\"i.item1\">\n {{i.item1}}\n </mat-option>\n </mat-select>\n </div>\n <div class=\"form-group\">\n <label>Aliq. ICMS (%)</label>\n <input id=\"pICMS_icms\" [ngModel]=\"model.pICMS_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"pICMS_icmsParser.parse($event)\" (focusout)=\"pICMS_icmsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n <div class=\"form-group\">\n <label>Modalidade BC</label>\n <mat-select [(value)]=\"model.modBC_icms\" class=\"form-control input-120\">\n <mat-option *ngFor=\"let i of modBaseICMS\" [value]=\"i.item1\">\n {{i.item1}} <small>{{i.item2}}</small>\n </mat-option>\n </mat-select>\n </div>\n </div>\n <h6>ICMS Efetivo CST60/CSOSN500</h6>\n <div class=\"hbox gap-8\">\n <div class=\"form-group\">\n <label>pRedBCEfet (%)</label>\n <input id=\"pRedBCEfet_icms\" [ngModel]=\"model.pRedBCEfet_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"pRedBCEfet_icmsParser.parse($event)\" (focusout)=\"pRedBCEfet_icmsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n <div class=\"form-group\">\n <label>pICMSEfet (%)</label>\n <input id=\"picmsEfet_icms\" [ngModel]=\"model.picmsEfet_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"picmsEfet_icmsParser.parse($event)\" (focusout)=\"picmsEfet_icmsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n <div class=\"form-group\">\n <label>vBCEfet (R$)</label>\n <input id=\"vbcEfet_icms\" [ngModel]=\"model.vbcEfet_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"vbcEfet_icmsParser.parse($event)\" (focusout)=\"vbcEfet_icmsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n <div class=\"form-group\">\n <label>vICMSEfet (R$)</label>\n <input id=\"vicmsEfet_icms\" [ngModel]=\"model.vicmsEfet_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"vicmsEfet_icmsParser.parse($event)\" (focusout)=\"vicmsEfet_icmsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n </div>\n <h6>Substitui\u00E7\u00E3o Tribut\u00E1ria (ST)</h6>\n <div class=\"hbox gap-8\">\n <div class=\"form-group\">\n <label>pST (%)</label>\n <input id=\"psT_icms\" [ngModel]=\"model.psT_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"psT_icmsParser.parse($event)\" (focusout)=\"psT_icmsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n <div class=\"form-group\">\n <label>vBCSTRet (R$)</label>\n <input id=\"vbcstRet_icms\" [ngModel]=\"model.vbcstRet_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"vbcstRet_icmsParser.parse($event)\" (focusout)=\"vbcstRet_icmsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n <div class=\"form-group\">\n <label>vICMSSubs (R$)</label>\n <input id=\"vicmsSubstituto_icms\" [ngModel]=\"model.vicmsSubstituto_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"vicmsSubstituto_icmsParser.parse($event)\"\n (focusout)=\"vicmsSubstituto_icmsParser.checkout()\" class=\"form-control input-100 text-right\">\n </div>\n <div class=\"form-group\">\n <label>vICMSSTRet (R$)</label>\n <input id=\"vicmsstRet_icms\" [ngModel]=\"model.vicmsstRet_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"vicmsstRet_icmsParser.parse($event)\" (focusout)=\"vicmsstRet_icmsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n </div>\n <h6>Fundo de Combate a Pobresa</h6>\n <div class=\"hbox gap-8\">\n <div class=\"form-group\">\n <label>pFCP (%)</label>\n <input id=\"pfcP_icms\" [ngModel]=\"model.pfcP_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"pfcP_icmsParser.parse($event)\" (focusout)=\"pfcP_icmsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n <div class=\"form-group\">\n <label>vBCFCP (R$)</label>\n <input id=\"vbcfcP_icms\" [ngModel]=\"model.vbcfcP_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"vbcfcP_icmsParser.parse($event)\" (focusout)=\"vbcfcP_icmsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n <div class=\"form-group\">\n <label>pFCPST (%)</label>\n <input id=\"pfcpsT_icms\" [ngModel]=\"model.pfcpsT_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"pfcpsT_icmsParser.parse($event)\" (focusout)=\"pfcpsT_icmsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n <div class=\"form-group\">\n <label>vBCFCPST (R$)</label>\n <input id=\"vbcfcpsT_icms\" [ngModel]=\"model.vbcfcpsT_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"vbcfcpsT_icmsParser.parse($event)\" (focusout)=\"vbcfcpsT_icmsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n <div class=\"form-group\">\n <label>pFCPSTRet (%)</label>\n <input id=\"pfcpstRet_icms\" [ngModel]=\"model.pfcpstRet_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"pfcpstRet_icmsParser.parse($event)\" (focusout)=\"pfcpstRet_icmsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n <div class=\"form-group\">\n <label>vBCFCPSTRet (R$)</label>\n <input id=\"vbcfcpstRet_icms\" [ngModel]=\"model.vbcfcpstRet_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"vbcfcpstRet_icmsParser.parse($event)\" (focusout)=\"vbcfcpstRet_icmsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n </div>\n <h6>PIS</h6>\n <div class=\"hbox gap-8\">\n <div class=\"form-group\">\n <label>CST/PIS</label>\n <mat-select [(value)]=\"model.csT_pis\" class=\"form-control input-120\">\n <mat-option [value]=\"null\">\n Nenhum\n </mat-option>\n <mat-option *ngFor=\"let i of cstCofinsList\" [value]=\"i.item1\">\n {{i.item1}}\n </mat-option>\n </mat-select>\n </div>\n <div class=\"form-group\">\n <label>Aliquota PIS (%)</label>\n <input id=\"ppiS_pis\" [ngModel]=\"model.ppiS_pis | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"ppiS_pisParser.parse($event)\" (focusout)=\"ppiS_pisParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n <div class=\"form-group\">\n <label>PIS BC %</label>\n <input id=\"vbC_pis\" [ngModel]=\"model.vbC_pis | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"vbC_pisParser.parse($event)\" (focusout)=\"vbC_pisParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n </div>\n \n <h6>COFINS</h6>\n <div class=\"hbox gap-8\">\n <div class=\"form-group\">\n <label>CST/COFINS</label>\n <mat-select [(value)]=\"model.csT_cofins\" class=\"form-control input-120\">\n <mat-option [value]=\"null\">\n Nenhum\n </mat-option>\n <mat-option *ngFor=\"let i of cstCofinsList\" [value]=\"i.item1\">\n {{i.item1}}\n </mat-option>\n </mat-select>\n </div>\n <div class=\"form-group\">\n <label>Aliq. COFINS (%)</label>\n <input id=\"pcofinS_cofins\" [ngModel]=\"model.pcofinS_cofins | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"pcofinS_cofinsParser.parse($event)\" (focusout)=\"pcofinS_cofinsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n <div class=\"form-group\">\n <label>COFINS BC %</label>\n <input id=\"vbC_cofins\" [ngModel]=\"model.vbC_cofins | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"vbC_cofinsParser.parse($event)\" (focusout)=\"vbC_cofinsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n </div>\n</div>\n\n<div [@menuLateral] class=\"vbox\" *ngIf=\"selectedTab == 2\">\n\n <div style=\"margin-bottom: 16px;\" class=\"vbox\">\n <mat-slide-toggle [(ngModel)]=\"model.disponivelCardapio\" tabindex=-1>Dispon\u00EDvel no Card\u00E1pio Digital\n </mat-slide-toggle>\n </div>\n <div class=\"form-group\">\n <label>Descri\u00E7\u00E3o</label>\n <textarea id=\"descricao\" [(ngModel)]=\"model.descricao\" cols=\"40\" rows=\"5\" class=\"form-control input-300\"\n tabindex=\"2\"></textarea>\n </div>\n <div class=\"form-group\">\n <label>Categoria</label>\n <div class=\"hbox\">\n <div id=\"categoriaCardapio\" (click)=\"editarCategoriaCardapio()\"\n class=\"form-control grow-1 input-selecao input-300\">\n {{model.categoriaCardapioNome}} </div>\n <button (click)=\"editarCategoriaCardapio()\" class=\"form-inline-button btn-form-margin\">\n <span class=\"material-icons\">\n search\n </span>\n </button>\n </div>\n </div>\n <div class=\"imagem-container\" *ngIf=\"editMode\">\n <img [src]=\"imgUrl\" class=\"img-fluid\" *ngIf=\"imgUrl\" />\n\n <input type=\"file\" #file placeholder=\"Choose file\" (change)=\"uploadFile(file.files)\" accept=\".jpg,.png\"\n style=\"display: none;\">\n\n <button mat-button color=\"primary\" type=\"button\" (click)=\"file.click()\">Escolher Imagem</button>\n\n <span class=\"upload\" *ngIf=\"progress > 0\">\n {{progress}}%\n </span>\n <span class=\"upload\" *ngIf=\"message\">\n {{message}}\n </span>\n </div>\n\n</div>", styles: [".imagem-container{border:1px solid #ced4da;display:flex;flex-direction:column;border-radius:9px;max-width:460px}small{font-size:xx-small}.badge{color:#fff;font-size:xx-small;display:flex;align-items:center;padding:4px;border-radius:13px;margin-left:2px}.badge.encontrado{background:#05a301;border:1px solid #28d112}.badge.nao-encontrado{background:#a30101;border:1px solid #d17812}.badge.buscando{background:#929292;border:1px solid #a3a3a3}h6{margin:8px 0;color:#666}\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: "directive", type: i7.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i7.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i6$1.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: i4.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "component", type: i5.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: i12.MatAutocomplete, selector: "mat-autocomplete", inputs: ["disableRipple"], exportAs: ["matAutocomplete"] }, { kind: "directive", type: i12.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", exportAs: ["matAutocompleteTrigger"] }, { kind: "component", type: RadioButtonGroupComponent, selector: "ox-radio-button-group", inputs: ["selectedItem", "items"], outputs: ["change"] }, { kind: "pipe", type: i6.DecimalPipe, name: "number" }], animations: [lateralAnimation] });
|
|
2387
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoFormComponent, decorators: [{
|
|
2388
|
+
type: Component,
|
|
2389
|
+
args: [{ selector: 'app-produto-form', animations: [lateralAnimation], template: "<div style=\"margin-bottom: 16px\">\n <ox-radio-button-group (change)=\"changeModo($event)\" [items]=\"tabs\" class=\"tool-item-container\">\n </ox-radio-button-group>\n</div>\n<div [@menuLateral] class=\"vbox\" *ngIf=\"selectedTab == 0\">\n <div class=\"hbox\">\n <div class=\"form-group\">\n <label>C\u00F3digo</label>\n <div class=\"hbox\">\n <input id=\"id\" [attr.readonly]=\"editMode\" [(ngModel)]=\"model.id\" class=\"form-control input-120\"\n tabindex=\"2\">\n <button (click)=\"nextIdClick.emit()\" *ngIf=\"!editMode\" class=\"form-inline-button btn-form-margin\">\n <span class=\"material-icons\">\n lightbulb\n </span>\n </button>\n </div>\n </div>\n <div class=\"form-group margin-left-8\">\n <label>Refer\u00EAncia</label>\n <input id=\"referencia\" [(ngModel)]=\"model.referencia\" class=\"form-control input-120\" tabindex=\"2\">\n </div>\n </div>\n <div class=\"form-group\">\n <label>Nome</label>\n <input id=\"nome\" [(ngModel)]=\"model.nome\" cdkFocusInitial class=\"form-control input-300\" tabindex=\"2\">\n </div>\n <div class=\"hbox\">\n <div class=\"form-group\">\n <label>Pre\u00E7o de Venda</label>\n <input id=\"precoVenda\" [ngModel]=\"model.precoVenda | number:'1.2-2'\"\n (ngModelChange)=\"precoVendaParser.parse($event)\" (focusout)=\"precoVendaParser.checkout()\"\n class=\"form-control input-100 text-right\" tabindex=\"2\">\n </div>\n <div class=\"form-group margin-left-8\">\n <label>Pre\u00E7o p/ Func.</label>\n <input id=\"precoFuncionario\" [ngModel]=\"model.precoFuncionario | number:'1.2-2'\"\n (ngModelChange)=\"precoFuncParser.parse($event)\" (focusout)=\"precoFuncParser.checkout()\"\n class=\"form-control input-100 text-right\" tabindex=\"2\">\n </div>\n <div class=\"form-group margin-left-8\">\n <label>Pre\u00E7o de Custo</label>\n <input id=\"precoCusto\" [ngModel]=\"model.precoCusto | number:'1.2-2'\"\n (ngModelChange)=\"precoCustoParser.parse($event)\" (focusout)=\"precoCustoParser.checkout()\"\n class=\"form-control input-100 text-right\" tabindex=\"2\">\n </div>\n </div>\n <div class=\"form-group\">\n <label>Grupo</label>\n <div class=\"hbox\">\n <div id=\"grupo\" (click)=\"editarGrupo()\" class=\"form-control grow-1 input-selecao input-300\">\n {{model.grupoNome}} </div>\n <button (click)=\"editarGrupo()\" class=\"form-inline-button btn-form-margin\">\n <span class=\"material-icons\">\n search\n </span>\n </button>\n </div>\n </div>\n <div class=\"form-group\">\n <label>Subgrupo</label>\n <div class=\"hbox\">\n <div id=\"subgrupo\" (click)=\"editarSubgrupo()\" class=\"form-control grow-1 input-selecao input-300\">\n {{model.subgrupoNome}} </div>\n <button (click)=\"editarSubgrupo()\" class=\"form-inline-button btn-form-margin\">\n <span class=\"material-icons\">\n search\n </span>\n </button>\n </div>\n </div>\n\n <div class=\"hbox gap-8\">\n <div class=\"form-group\">\n <label>Unidade</label>\n <input id=\"unidade\" [(ngModel)]=\"model.unidade\" class=\"form-control input-120\">\n </div>\n <div class=\"form-group\">\n <label>Estoque Min.</label>\n <input id=\"estoqueMinimo\" [(ngModel)]=\"model.estoqueMinimo\" class=\"form-control input-120\">\n </div>\n </div>\n\n <div class=\"hbox gap-8\">\n <div class=\"form-group\">\n <label>C\u00F3digo Patrim\u00F4nio</label>\n <input id=\"codigoPatrimonio\" [(ngModel)]=\"model.codigoPatrimonio\" class=\"form-control input-120\"\n maxlength=\"36\">\n </div>\n <div class=\"form-group\">\n <label>Obs.</label>\n <input id=\"obs\" [(ngModel)]=\"model.obs\" class=\"form-control input-300\" maxlength=\"300\">\n </div>\n </div>\n \n <div class=\"hbox gap-8\">\n <div class=\"form-group\">\n <label>Setor Subestoque</label>\n <mat-select [(value)]=\"model.setorSubEstoqueId\" class=\"form-control input-120\">\n <mat-option *ngFor=\"let i of setores\" [value]=\"i.id\">\n {{i.nome}}\n </mat-option>\n </mat-select>\n </div>\n <div class=\"form-group\">\n <label>Qtd. Subestoque</label>\n <input id=\"qtdMinSubEstoque\" [(ngModel)]=\"model.qtdMinSubEstoque\" class=\"form-control input-120 text-right\">\n </div>\n </div>\n <div class=\"vbox\">\n <mat-slide-toggle [(ngModel)]=\"model.estoqueControlado\" tabindex=-1>Controlado no Estoque</mat-slide-toggle>\n <mat-slide-toggle [(ngModel)]=\"model.imprimiCozinha\" tabindex=-1>Imprime Cozinha</mat-slide-toggle>\n <mat-slide-toggle [(ngModel)]=\"model.imprimeCorredor\" tabindex=-1>Imprime Corredor</mat-slide-toggle>\n <mat-slide-toggle [(ngModel)]=\"model.verNaRecepcao\" tabindex=-1>Ver na Recep\u00E7\u00E3o</mat-slide-toggle>\n <mat-slide-toggle [(ngModel)]=\"model.omiteCliente\" tabindex=-1>N\u00E3o Exibe para o Cliente na Sa\u00EDda\n </mat-slide-toggle>\n <mat-slide-toggle [(ngModel)]=\"model.isAtivo\" tabindex=-1>Ativado</mat-slide-toggle>\n </div>\n\n</div>\n\n<div [@menuLateral] class=\"vbox\" *ngIf=\"selectedTab == 1\">\n\n <div style=\"margin-bottom: 16px;\" class=\"vbox\">\n <mat-slide-toggle [(ngModel)]=\"model.emiteNFCe\" tabindex=-1>Emite Fiscal\n </mat-slide-toggle>\n </div>\n <div class=\"hbox gap-8\">\n <div class=\"form-group\">\n <label>GTIN</label>\n <input id=\"gtin\" [(ngModel)]=\"model.gtin\" class=\"form-control input-120\" placeholder=\"SEM GTIN\"\n maxlength=\"14\">\n </div>\n <div class=\"form-group\">\n <label>CFOP</label>\n <input id=\"cfop\" [(ngModel)]=\"model.cfop\" [matAutocomplete]=\"auto\" matInput class=\"form-control input-100\"\n maxlength=\"4\">\n <mat-autocomplete #auto=\"matAutocomplete\">\n <mat-option *ngFor=\"let option of cfopList\" [value]=\"option.item1\">\n {{option.item1}} <small>{{option.item2}}</small>\n </mat-option>\n </mat-autocomplete>\n </div>\n <div class=\"form-group\">\n <label>NCM</label>\n <div class=\"hbox\">\n <input id=\"ncm\" (input)=\"lazyTriggerNcm.fire()\" [(ngModel)]=\"model.ncm\" class=\"form-control input-100\"\n maxlength=\"8\">\n <button (click)=\"editarNCM()\" class=\"form-inline-button btn-form-margin\">\n <span class=\"material-icons\">\n search\n </span>\n </button>\n <span class=\"badge buscando\" *ngIf=\"isBusy\">Buscando...</span>\n <span class=\"badge encontrado\" *ngIf=\"ncmEncontrado\">Encontrado</span>\n <span class=\"badge nao-encontrado\" *ngIf=\"ncmNaoEncontrado\">N\u00E3o encontrado</span>\n </div>\n </div>\n </div>\n <div class=\"hbox gap-8\">\n <div class=\"form-group\">\n <label>CEST</label>\n <input id=\"cest\" [(ngModel)]=\"model.cest\" autocomplete=\"off\" class=\"form-control input-120\" maxlength=\"7\">\n </div>\n <div class=\"form-group\">\n <label>ICMS (ECF/SAT)</label>\n <input id=\"aliquotaICMS\" [(ngModel)]=\"model.aliquotaICMS\" autocomplete=\"off\" class=\"form-control input-100 text-right\"\n maxlength=\"5\">\n </div>\n <div class=\"form-group\">\n <label>S. T. (ECF/SAT)</label>\n <input id=\"sitTrib\" [(ngModel)]=\"model.sitTrib\" autocomplete=\"off\" [matAutocomplete]=\"autoST\" matInput\n class=\"form-control input-120\" maxlength=\"5\">\n <mat-autocomplete #autoST=\"matAutocomplete\">\n <mat-option *ngFor=\"let option of stList\" [value]=\"option.item1\">\n {{option.item1}} <small>{{option.item2}}</small>\n </mat-option>\n </mat-autocomplete>\n </div>\n </div>\n <h4>Campos da NFC-e</h4>\n <div class=\"hbox gap-8\">\n <div class=\"form-group\">\n <label>CST/CSOSN</label>\n <mat-select [(value)]=\"model.csT_icms\" class=\"form-control input-120\">\n <mat-option *ngFor=\"let i of cstICMSList\" [value]=\"i.item1\">\n {{i.item1}}\n </mat-option>\n </mat-select>\n </div>\n <div class=\"form-group\">\n <label>Aliq. ICMS (%)</label>\n <input id=\"pICMS_icms\" [ngModel]=\"model.pICMS_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"pICMS_icmsParser.parse($event)\" (focusout)=\"pICMS_icmsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n <div class=\"form-group\">\n <label>Modalidade BC</label>\n <mat-select [(value)]=\"model.modBC_icms\" class=\"form-control input-120\">\n <mat-option *ngFor=\"let i of modBaseICMS\" [value]=\"i.item1\">\n {{i.item1}} <small>{{i.item2}}</small>\n </mat-option>\n </mat-select>\n </div>\n </div>\n <h6>ICMS Efetivo CST60/CSOSN500</h6>\n <div class=\"hbox gap-8\">\n <div class=\"form-group\">\n <label>pRedBCEfet (%)</label>\n <input id=\"pRedBCEfet_icms\" [ngModel]=\"model.pRedBCEfet_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"pRedBCEfet_icmsParser.parse($event)\" (focusout)=\"pRedBCEfet_icmsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n <div class=\"form-group\">\n <label>pICMSEfet (%)</label>\n <input id=\"picmsEfet_icms\" [ngModel]=\"model.picmsEfet_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"picmsEfet_icmsParser.parse($event)\" (focusout)=\"picmsEfet_icmsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n <div class=\"form-group\">\n <label>vBCEfet (R$)</label>\n <input id=\"vbcEfet_icms\" [ngModel]=\"model.vbcEfet_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"vbcEfet_icmsParser.parse($event)\" (focusout)=\"vbcEfet_icmsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n <div class=\"form-group\">\n <label>vICMSEfet (R$)</label>\n <input id=\"vicmsEfet_icms\" [ngModel]=\"model.vicmsEfet_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"vicmsEfet_icmsParser.parse($event)\" (focusout)=\"vicmsEfet_icmsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n </div>\n <h6>Substitui\u00E7\u00E3o Tribut\u00E1ria (ST)</h6>\n <div class=\"hbox gap-8\">\n <div class=\"form-group\">\n <label>pST (%)</label>\n <input id=\"psT_icms\" [ngModel]=\"model.psT_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"psT_icmsParser.parse($event)\" (focusout)=\"psT_icmsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n <div class=\"form-group\">\n <label>vBCSTRet (R$)</label>\n <input id=\"vbcstRet_icms\" [ngModel]=\"model.vbcstRet_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"vbcstRet_icmsParser.parse($event)\" (focusout)=\"vbcstRet_icmsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n <div class=\"form-group\">\n <label>vICMSSubs (R$)</label>\n <input id=\"vicmsSubstituto_icms\" [ngModel]=\"model.vicmsSubstituto_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"vicmsSubstituto_icmsParser.parse($event)\"\n (focusout)=\"vicmsSubstituto_icmsParser.checkout()\" class=\"form-control input-100 text-right\">\n </div>\n <div class=\"form-group\">\n <label>vICMSSTRet (R$)</label>\n <input id=\"vicmsstRet_icms\" [ngModel]=\"model.vicmsstRet_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"vicmsstRet_icmsParser.parse($event)\" (focusout)=\"vicmsstRet_icmsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n </div>\n <h6>Fundo de Combate a Pobresa</h6>\n <div class=\"hbox gap-8\">\n <div class=\"form-group\">\n <label>pFCP (%)</label>\n <input id=\"pfcP_icms\" [ngModel]=\"model.pfcP_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"pfcP_icmsParser.parse($event)\" (focusout)=\"pfcP_icmsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n <div class=\"form-group\">\n <label>vBCFCP (R$)</label>\n <input id=\"vbcfcP_icms\" [ngModel]=\"model.vbcfcP_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"vbcfcP_icmsParser.parse($event)\" (focusout)=\"vbcfcP_icmsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n <div class=\"form-group\">\n <label>pFCPST (%)</label>\n <input id=\"pfcpsT_icms\" [ngModel]=\"model.pfcpsT_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"pfcpsT_icmsParser.parse($event)\" (focusout)=\"pfcpsT_icmsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n <div class=\"form-group\">\n <label>vBCFCPST (R$)</label>\n <input id=\"vbcfcpsT_icms\" [ngModel]=\"model.vbcfcpsT_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"vbcfcpsT_icmsParser.parse($event)\" (focusout)=\"vbcfcpsT_icmsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n <div class=\"form-group\">\n <label>pFCPSTRet (%)</label>\n <input id=\"pfcpstRet_icms\" [ngModel]=\"model.pfcpstRet_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"pfcpstRet_icmsParser.parse($event)\" (focusout)=\"pfcpstRet_icmsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n <div class=\"form-group\">\n <label>vBCFCPSTRet (R$)</label>\n <input id=\"vbcfcpstRet_icms\" [ngModel]=\"model.vbcfcpstRet_icms | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"vbcfcpstRet_icmsParser.parse($event)\" (focusout)=\"vbcfcpstRet_icmsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n </div>\n <h6>PIS</h6>\n <div class=\"hbox gap-8\">\n <div class=\"form-group\">\n <label>CST/PIS</label>\n <mat-select [(value)]=\"model.csT_pis\" class=\"form-control input-120\">\n <mat-option [value]=\"null\">\n Nenhum\n </mat-option>\n <mat-option *ngFor=\"let i of cstCofinsList\" [value]=\"i.item1\">\n {{i.item1}}\n </mat-option>\n </mat-select>\n </div>\n <div class=\"form-group\">\n <label>Aliquota PIS (%)</label>\n <input id=\"ppiS_pis\" [ngModel]=\"model.ppiS_pis | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"ppiS_pisParser.parse($event)\" (focusout)=\"ppiS_pisParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n <div class=\"form-group\">\n <label>PIS BC %</label>\n <input id=\"vbC_pis\" [ngModel]=\"model.vbC_pis | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"vbC_pisParser.parse($event)\" (focusout)=\"vbC_pisParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n </div>\n \n <h6>COFINS</h6>\n <div class=\"hbox gap-8\">\n <div class=\"form-group\">\n <label>CST/COFINS</label>\n <mat-select [(value)]=\"model.csT_cofins\" class=\"form-control input-120\">\n <mat-option [value]=\"null\">\n Nenhum\n </mat-option>\n <mat-option *ngFor=\"let i of cstCofinsList\" [value]=\"i.item1\">\n {{i.item1}}\n </mat-option>\n </mat-select>\n </div>\n <div class=\"form-group\">\n <label>Aliq. COFINS (%)</label>\n <input id=\"pcofinS_cofins\" [ngModel]=\"model.pcofinS_cofins | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"pcofinS_cofinsParser.parse($event)\" (focusout)=\"pcofinS_cofinsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n <div class=\"form-group\">\n <label>COFINS BC %</label>\n <input id=\"vbC_cofins\" [ngModel]=\"model.vbC_cofins | number:'1.2-2'\" autocomplete=\"off\"\n (ngModelChange)=\"vbC_cofinsParser.parse($event)\" (focusout)=\"vbC_cofinsParser.checkout()\"\n class=\"form-control input-100 text-right\">\n </div>\n </div>\n</div>\n\n<div [@menuLateral] class=\"vbox\" *ngIf=\"selectedTab == 2\">\n\n <div style=\"margin-bottom: 16px;\" class=\"vbox\">\n <mat-slide-toggle [(ngModel)]=\"model.disponivelCardapio\" tabindex=-1>Dispon\u00EDvel no Card\u00E1pio Digital\n </mat-slide-toggle>\n </div>\n <div class=\"form-group\">\n <label>Descri\u00E7\u00E3o</label>\n <textarea id=\"descricao\" [(ngModel)]=\"model.descricao\" cols=\"40\" rows=\"5\" class=\"form-control input-300\"\n tabindex=\"2\"></textarea>\n </div>\n <div class=\"form-group\">\n <label>Categoria</label>\n <div class=\"hbox\">\n <div id=\"categoriaCardapio\" (click)=\"editarCategoriaCardapio()\"\n class=\"form-control grow-1 input-selecao input-300\">\n {{model.categoriaCardapioNome}} </div>\n <button (click)=\"editarCategoriaCardapio()\" class=\"form-inline-button btn-form-margin\">\n <span class=\"material-icons\">\n search\n </span>\n </button>\n </div>\n </div>\n <div class=\"imagem-container\" *ngIf=\"editMode\">\n <img [src]=\"imgUrl\" class=\"img-fluid\" *ngIf=\"imgUrl\" />\n\n <input type=\"file\" #file placeholder=\"Choose file\" (change)=\"uploadFile(file.files)\" accept=\".jpg,.png\"\n style=\"display: none;\">\n\n <button mat-button color=\"primary\" type=\"button\" (click)=\"file.click()\">Escolher Imagem</button>\n\n <span class=\"upload\" *ngIf=\"progress > 0\">\n {{progress}}%\n </span>\n <span class=\"upload\" *ngIf=\"message\">\n {{message}}\n </span>\n </div>\n\n</div>", styles: [".imagem-container{border:1px solid #ced4da;display:flex;flex-direction:column;border-radius:9px;max-width:460px}small{font-size:xx-small}.badge{color:#fff;font-size:xx-small;display:flex;align-items:center;padding:4px;border-radius:13px;margin-left:2px}.badge.encontrado{background:#05a301;border:1px solid #28d112}.badge.nao-encontrado{background:#a30101;border:1px solid #d17812}.badge.buscando{background:#929292;border:1px solid #a3a3a3}h6{margin:8px 0;color:#666}\n"] }]
|
|
2390
|
+
}], ctorParameters: function () { return [{ type: i3.MatDialog }, { type: CommonWebService }, { type: i1.HttpClient }, { type: AuthDataService }, { type: NotificationService }, { type: ScreenHelperService }]; }, propDecorators: { editMode: [{
|
|
2391
|
+
type: Input
|
|
2392
|
+
}], nextIdClick: [{
|
|
2393
|
+
type: Output
|
|
2394
|
+
}], model: [{
|
|
2395
|
+
type: Input
|
|
2396
|
+
}] } });
|
|
2397
|
+
|
|
2398
|
+
class ProdutoAddDialogComponent {
|
|
2399
|
+
constructor(ws, notification, dataDialog, dialog, elRef, dialogRef, screenHelper) {
|
|
2400
|
+
this.ws = ws;
|
|
2401
|
+
this.notification = notification;
|
|
2402
|
+
this.dataDialog = dataDialog;
|
|
2403
|
+
this.dialog = dialog;
|
|
2404
|
+
this.elRef = elRef;
|
|
2405
|
+
this.dialogRef = dialogRef;
|
|
2406
|
+
this.screenHelper = screenHelper;
|
|
2407
|
+
this.isBusy = false;
|
|
2408
|
+
this.focus = new FocusService();
|
|
2409
|
+
this.model = createProduct();
|
|
2410
|
+
this.mobile = this.screenHelper.isMedium;
|
|
2411
|
+
this.screenHelper.changedMediumScreen.subscribe(x => this.mobile = x);
|
|
2412
|
+
}
|
|
2413
|
+
ngOnInit() {
|
|
2414
|
+
this.focus.registerElement(this.elRef.nativeElement);
|
|
2415
|
+
this.getNextId();
|
|
2416
|
+
}
|
|
2417
|
+
ngOnDestroy() {
|
|
2418
|
+
this.focus.unregisterElement(this.elRef.nativeElement);
|
|
2419
|
+
}
|
|
2420
|
+
salvar() {
|
|
2421
|
+
if (!this.model)
|
|
2422
|
+
return;
|
|
2423
|
+
const valMsg = validaProduto(this.model, this.focus);
|
|
2424
|
+
if (valMsg) {
|
|
2425
|
+
this.notification.showMsgError(valMsg);
|
|
2426
|
+
return;
|
|
2427
|
+
}
|
|
2428
|
+
this.isBusy = true;
|
|
2429
|
+
this.ws.addProduto(this.model)
|
|
2430
|
+
.subscribe(r => {
|
|
2431
|
+
this.isBusy = false;
|
|
2432
|
+
this.notification.showMsg("Salvo com sucesso.");
|
|
2433
|
+
if (this.dialogRef)
|
|
2434
|
+
this.dialogRef.close(true);
|
|
2435
|
+
}, err => {
|
|
2436
|
+
this.isBusy = false;
|
|
2437
|
+
this.notification.showMsg(err.error);
|
|
2438
|
+
});
|
|
2439
|
+
}
|
|
2440
|
+
getNextId() {
|
|
2441
|
+
this.isBusy = true;
|
|
2442
|
+
this.ws.getNextIdProduto()
|
|
2443
|
+
.subscribe(r => {
|
|
2444
|
+
this.model.id = r;
|
|
2445
|
+
this.model.referencia = '' + r;
|
|
2446
|
+
this.isBusy = false;
|
|
2447
|
+
}, err => {
|
|
2448
|
+
this.isBusy = false;
|
|
2449
|
+
this.notification.showMsg(err.error);
|
|
2450
|
+
});
|
|
2451
|
+
}
|
|
2452
|
+
}
|
|
2453
|
+
ProdutoAddDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoAddDialogComponent, deps: [{ token: CommonWebService }, { token: NotificationService }, { token: MAT_DIALOG_DATA }, { token: i3.MatDialog }, { token: i0.ElementRef }, { token: i3.MatDialogRef }, { token: ScreenHelperService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2454
|
+
ProdutoAddDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: ProdutoAddDialogComponent, selector: "app-produto-add-dialog", ngImport: i0, template: "<div class=\"ox-header\">\n <h2 class=\"titulo\">Novo 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 <app-produto-form (nextIdClick)=\"getNextId()\" [model]=\"model\" *ngIf=\"model\"></app-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$1.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: "app-produto-form", inputs: ["editMode", "model"], outputs: ["nextIdClick"] }] });
|
|
2455
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoAddDialogComponent, decorators: [{
|
|
2456
|
+
type: Component,
|
|
2457
|
+
args: [{ selector: 'app-produto-add-dialog', template: "<div class=\"ox-header\">\n <h2 class=\"titulo\">Novo 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 <app-produto-form (nextIdClick)=\"getNextId()\" [model]=\"model\" *ngIf=\"model\"></app-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"] }]
|
|
2458
|
+
}], ctorParameters: function () {
|
|
2459
|
+
return [{ type: CommonWebService }, { type: NotificationService }, { type: undefined, decorators: [{
|
|
2460
|
+
type: Inject,
|
|
2461
|
+
args: [MAT_DIALOG_DATA]
|
|
2462
|
+
}] }, { type: i3.MatDialog }, { type: i0.ElementRef }, { type: i3.MatDialogRef }, { type: ScreenHelperService }];
|
|
2463
|
+
} });
|
|
2464
|
+
|
|
2465
|
+
class ProdutoBuscaFiltrosDialogComponent {
|
|
2466
|
+
constructor(d, ws, notification, dialogRef) {
|
|
2467
|
+
this.d = d;
|
|
2468
|
+
this.ws = ws;
|
|
2469
|
+
this.notification = notification;
|
|
2470
|
+
this.dialogRef = dialogRef;
|
|
2471
|
+
this.isBusy = false;
|
|
2472
|
+
this.produtosGrupos = [];
|
|
2473
|
+
this.d.setting.grupos = undefined;
|
|
2474
|
+
}
|
|
2475
|
+
ngOnInit() {
|
|
2476
|
+
this.getProdutos();
|
|
2477
|
+
}
|
|
2478
|
+
getProdutos() {
|
|
2479
|
+
this.isBusy = true;
|
|
2480
|
+
this.ws.getAllProdutoGrupo()
|
|
2481
|
+
.subscribe(r => {
|
|
2482
|
+
this.produtosGrupos = r;
|
|
2483
|
+
console.info(r);
|
|
2484
|
+
this.isBusy = false;
|
|
2485
|
+
}, err => {
|
|
2486
|
+
this.isBusy = false;
|
|
2487
|
+
this.notification.showHttpError(err);
|
|
2488
|
+
});
|
|
2489
|
+
}
|
|
2490
|
+
salvar() {
|
|
2491
|
+
this.dialogRef.close(this.d);
|
|
2492
|
+
}
|
|
2493
|
+
changeGruposProdutos(ev) {
|
|
2494
|
+
const itens = ev.value;
|
|
2495
|
+
this.d.setting.grupos = itens;
|
|
2496
|
+
}
|
|
2497
|
+
}
|
|
2498
|
+
ProdutoBuscaFiltrosDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoBuscaFiltrosDialogComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: CommonWebService }, { token: NotificationService }, { token: i3.MatDialogRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
2499
|
+
ProdutoBuscaFiltrosDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: ProdutoBuscaFiltrosDialogComponent, selector: "app-produto-busca-filtros-dialog", ngImport: i0, template: "<div class=\"ox-header\">\n <span class=\"titulo\">Filtros de Pesquisa</span>\n <button mat-icon-button mat-dialog-close>\n <mat-icon>close</mat-icon>\n </button>\n</div>\n<ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>\n<div class=\"dialog-content\">\n <div class=\"vbox\">\n <h4>Op\u00E7\u00F5es de exibi\u00E7\u00E3o</h4>\n <mat-slide-toggle [(ngModel)]=\"d.setting.exibeNaoControladoEstoque\" tabindex=-1>Exibir n\u00E3o controlado no\n estoque</mat-slide-toggle>\n <mat-slide-toggle [(ngModel)]=\"d.setting.exibeApenasMostraRecepcao\" tabindex=-1>Apenas o que mostra na recep\u00E7\u00E3o\n </mat-slide-toggle>\n <mat-slide-toggle [(ngModel)]=\"d.setting.exibeImprimiCozinha\" tabindex=-1>Exibir imprime na cozinha\n </mat-slide-toggle>\n <mat-slide-toggle [(ngModel)]=\"d.setting.exibeInativo\" tabindex=-1>Exibir desativados</mat-slide-toggle>\n </div>\n <div class=\"vbox margin-top-16\">\n <h4>Selecione um ou mais grupos</h4>\n <mat-select (selectionChange)=\"changeGruposProdutos($event)\" multiple>\n <mat-option *ngFor=\"let i of produtosGrupos\" [value]=\"i.id\">\n {{i.nome}}\n </mat-option>\n </mat-select>\n </div>\n <div class=\"vbox margin-top-32\">\n <h4>Quantidade de Itens por P\u00E1gina</h4>\n\n <div class=\"form-group\">\n <label>Quantidade</label>\n <input [(ngModel)]=\"d.qtd\" class=\"form-control input-120\" maxlength=\"10\" type=\"number\">\n </div>\n </div>\n</div>\n<div class=\"dialog-footer\">\n <button mat-button (click)=\"salvar()\">CONFIRMAR</button>\n</div>", styles: [":host{background:#fafafa;display:flex;flex-direction:column;height:100%;max-height:99vh}.header{display:flex;background:white;border-bottom:1px solid #eee}.header .titulo{align-self:center;margin-left:16px;text-transform:uppercase;flex-grow:1}mat-select{background:white;height:36px;padding:8px 16px;border-radius:.25rem;border:1px solid #ced4da}h4{margin:0 0 16px}\n"], dependencies: [{ kind: "directive", type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i7.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i7.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i7.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i6$1.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: i4.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "component", type: i5.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: BusyIndicatorComponent, selector: "ox-busy-indicator", inputs: ["isBusy"] }] });
|
|
2500
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoBuscaFiltrosDialogComponent, decorators: [{
|
|
2501
|
+
type: Component,
|
|
2502
|
+
args: [{ selector: 'app-produto-busca-filtros-dialog', template: "<div class=\"ox-header\">\n <span class=\"titulo\">Filtros de Pesquisa</span>\n <button mat-icon-button mat-dialog-close>\n <mat-icon>close</mat-icon>\n </button>\n</div>\n<ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>\n<div class=\"dialog-content\">\n <div class=\"vbox\">\n <h4>Op\u00E7\u00F5es de exibi\u00E7\u00E3o</h4>\n <mat-slide-toggle [(ngModel)]=\"d.setting.exibeNaoControladoEstoque\" tabindex=-1>Exibir n\u00E3o controlado no\n estoque</mat-slide-toggle>\n <mat-slide-toggle [(ngModel)]=\"d.setting.exibeApenasMostraRecepcao\" tabindex=-1>Apenas o que mostra na recep\u00E7\u00E3o\n </mat-slide-toggle>\n <mat-slide-toggle [(ngModel)]=\"d.setting.exibeImprimiCozinha\" tabindex=-1>Exibir imprime na cozinha\n </mat-slide-toggle>\n <mat-slide-toggle [(ngModel)]=\"d.setting.exibeInativo\" tabindex=-1>Exibir desativados</mat-slide-toggle>\n </div>\n <div class=\"vbox margin-top-16\">\n <h4>Selecione um ou mais grupos</h4>\n <mat-select (selectionChange)=\"changeGruposProdutos($event)\" multiple>\n <mat-option *ngFor=\"let i of produtosGrupos\" [value]=\"i.id\">\n {{i.nome}}\n </mat-option>\n </mat-select>\n </div>\n <div class=\"vbox margin-top-32\">\n <h4>Quantidade de Itens por P\u00E1gina</h4>\n\n <div class=\"form-group\">\n <label>Quantidade</label>\n <input [(ngModel)]=\"d.qtd\" class=\"form-control input-120\" maxlength=\"10\" type=\"number\">\n </div>\n </div>\n</div>\n<div class=\"dialog-footer\">\n <button mat-button (click)=\"salvar()\">CONFIRMAR</button>\n</div>", styles: [":host{background:#fafafa;display:flex;flex-direction:column;height:100%;max-height:99vh}.header{display:flex;background:white;border-bottom:1px solid #eee}.header .titulo{align-self:center;margin-left:16px;text-transform:uppercase;flex-grow:1}mat-select{background:white;height:36px;padding:8px 16px;border-radius:.25rem;border:1px solid #ced4da}h4{margin:0 0 16px}\n"] }]
|
|
2503
|
+
}], ctorParameters: function () {
|
|
2504
|
+
return [{ type: undefined, decorators: [{
|
|
2505
|
+
type: Inject,
|
|
2506
|
+
args: [MAT_DIALOG_DATA]
|
|
2507
|
+
}] }, { type: CommonWebService }, { type: NotificationService }, { type: i3.MatDialogRef }];
|
|
2508
|
+
} });
|
|
2509
|
+
|
|
2510
|
+
class ProdutoEditDialogComponent {
|
|
2511
|
+
constructor(ws, notification, dataDialog, dialog, elRef, dialogRef, screenHelper) {
|
|
2512
|
+
this.ws = ws;
|
|
2513
|
+
this.notification = notification;
|
|
2514
|
+
this.dataDialog = dataDialog;
|
|
2515
|
+
this.dialog = dialog;
|
|
2516
|
+
this.elRef = elRef;
|
|
2517
|
+
this.dialogRef = dialogRef;
|
|
2518
|
+
this.screenHelper = screenHelper;
|
|
2519
|
+
this.isBusy = false;
|
|
2520
|
+
this.focus = new FocusService();
|
|
2521
|
+
if (dataDialog) {
|
|
2522
|
+
this.model = dataDialog;
|
|
2523
|
+
}
|
|
2524
|
+
this.mobile = this.screenHelper.isMedium;
|
|
2525
|
+
this.screenHelper.changedMediumScreen.subscribe(x => this.mobile = x);
|
|
2526
|
+
}
|
|
2527
|
+
ngOnInit() {
|
|
2528
|
+
this.focus.registerElement(this.elRef.nativeElement);
|
|
2529
|
+
}
|
|
2530
|
+
ngOnDestroy() {
|
|
2531
|
+
this.focus.unregisterElement(this.elRef.nativeElement);
|
|
2532
|
+
}
|
|
2533
|
+
salvar() {
|
|
2534
|
+
if (!this.model)
|
|
2535
|
+
return;
|
|
2536
|
+
const valMsg = validaProduto(this.model, this.focus);
|
|
2537
|
+
if (valMsg) {
|
|
2538
|
+
this.notification.showMsgError(valMsg);
|
|
2539
|
+
return;
|
|
2540
|
+
}
|
|
2541
|
+
this.isBusy = true;
|
|
2542
|
+
this.ws.saveProduto(this.model)
|
|
2543
|
+
.subscribe(r => {
|
|
2544
|
+
this.isBusy = false;
|
|
2545
|
+
this.notification.showMsg("Salvo com sucesso.");
|
|
2546
|
+
if (this.dialogRef)
|
|
2547
|
+
this.dialogRef.close(true);
|
|
2548
|
+
}, err => {
|
|
2549
|
+
this.isBusy = false;
|
|
2550
|
+
this.notification.showMsg(err.error);
|
|
2551
|
+
});
|
|
2552
|
+
}
|
|
2553
|
+
}
|
|
2554
|
+
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 });
|
|
2555
|
+
ProdutoEditDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: ProdutoEditDialogComponent, selector: "app-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 <app-produto-form [model]=\"model\" [editMode]=\"true\" *ngIf=\"model\"></app-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$1.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: "app-produto-form", inputs: ["editMode", "model"], outputs: ["nextIdClick"] }] });
|
|
2556
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutoEditDialogComponent, decorators: [{
|
|
2557
|
+
type: Component,
|
|
2558
|
+
args: [{ selector: 'app-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 <app-produto-form [model]=\"model\" [editMode]=\"true\" *ngIf=\"model\"></app-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"] }]
|
|
2559
|
+
}], ctorParameters: function () {
|
|
2560
|
+
return [{ type: CommonWebService }, { type: NotificationService }, { type: undefined, decorators: [{
|
|
2561
|
+
type: Inject,
|
|
2562
|
+
args: [MAT_DIALOG_DATA]
|
|
2563
|
+
}] }, { type: i3.MatDialog }, { type: i0.ElementRef }, { type: i3.MatDialogRef }, { type: ScreenHelperService }];
|
|
2564
|
+
} });
|
|
2565
|
+
|
|
2566
|
+
class ProdutoSearchSetting extends SearchSetting {
|
|
2567
|
+
constructor() {
|
|
2568
|
+
super();
|
|
2569
|
+
this.exibeNaoControladoEstoque = true;
|
|
2570
|
+
this.exibeApenasMostraRecepcao = false;
|
|
2571
|
+
this.exibeInativo = false;
|
|
2572
|
+
this.exibeImprimiCozinha = false;
|
|
2573
|
+
this.exibeHePrato = false;
|
|
2574
|
+
}
|
|
2575
|
+
}
|
|
2576
|
+
|
|
2577
|
+
class PaginatorComponent {
|
|
2578
|
+
constructor() {
|
|
2579
|
+
this.paginaAtualChange = new EventEmitter();
|
|
2580
|
+
this.totalPaginasChange = new EventEmitter();
|
|
2581
|
+
this.change = new EventEmitter();
|
|
2582
|
+
this._paginaAtual = 1;
|
|
2583
|
+
this._totalPaginas = 1;
|
|
2584
|
+
this.inicio = true;
|
|
2585
|
+
this.fim = true;
|
|
2586
|
+
this.pageSize = 0;
|
|
2587
|
+
}
|
|
2588
|
+
get paginaAtual() {
|
|
2589
|
+
return this._paginaAtual;
|
|
2590
|
+
}
|
|
2591
|
+
set paginaAtual(val) {
|
|
2592
|
+
this._paginaAtual = val;
|
|
2593
|
+
this.paginaAtualChange.emit(val);
|
|
2594
|
+
this.refreshUI();
|
|
2595
|
+
}
|
|
2596
|
+
get totalPaginas() {
|
|
2597
|
+
return this._totalPaginas;
|
|
2598
|
+
}
|
|
2599
|
+
set totalPaginas(val) {
|
|
2600
|
+
this._totalPaginas = val;
|
|
2601
|
+
this.totalPaginasChange.emit(val);
|
|
2602
|
+
this.refreshUI();
|
|
2603
|
+
}
|
|
2604
|
+
ngOnInit() {
|
|
2605
|
+
}
|
|
2606
|
+
trocaPagina(pagina) {
|
|
2607
|
+
if (pagina > this.totalPaginas || pagina < 1)
|
|
2608
|
+
return;
|
|
2609
|
+
this.paginaAtual = pagina;
|
|
2610
|
+
this.refreshUI();
|
|
2611
|
+
this.change.emit(this.paginaAtual);
|
|
2612
|
+
}
|
|
2613
|
+
refreshUI() {
|
|
2614
|
+
this.inicio = this.paginaAtual == 1;
|
|
2615
|
+
this.fim = this.paginaAtual == this.totalPaginas;
|
|
2616
|
+
}
|
|
2617
|
+
goBack() {
|
|
2618
|
+
this.trocaPagina(this.paginaAtual - 1);
|
|
2619
|
+
}
|
|
2620
|
+
goNext() {
|
|
2621
|
+
this.trocaPagina(this.paginaAtual + 1);
|
|
2622
|
+
}
|
|
2623
|
+
}
|
|
2624
|
+
PaginatorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: PaginatorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2625
|
+
PaginatorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: PaginatorComponent, selector: "ox-paginator", inputs: { pageSize: "pageSize", paginaAtual: "paginaAtual", totalPaginas: "totalPaginas" }, outputs: { paginaAtualChange: "paginaAtualChange", totalPaginasChange: "totalPaginasChange", change: "change" }, ngImport: i0, template: "<button [disabled]=\"inicio\" mat-icon-button (click)=\"goBack()\">\n <mat-icon>chevron_left</mat-icon>\n</button>\n<span class=\"picker-text\">\n {{paginaAtual}}/{{totalPaginas}}\n</span>\n<button [disabled]=\"fim\" mat-icon-button (click)=\"goNext()\">\n <mat-icon>chevron_right</mat-icon>\n</button>\n", styles: [":host{display:flex;flex-direction:row;justify-content:center;align-items:center;background:transparent;flex-wrap:nowrap}.picker-text{flex-flow:1;flex-grow:1;text-align:center}\n"], dependencies: [{ kind: "component", type: i6$1.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"] }] });
|
|
2626
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: PaginatorComponent, decorators: [{
|
|
2627
|
+
type: Component,
|
|
2628
|
+
args: [{ selector: 'ox-paginator', template: "<button [disabled]=\"inicio\" mat-icon-button (click)=\"goBack()\">\n <mat-icon>chevron_left</mat-icon>\n</button>\n<span class=\"picker-text\">\n {{paginaAtual}}/{{totalPaginas}}\n</span>\n<button [disabled]=\"fim\" mat-icon-button (click)=\"goNext()\">\n <mat-icon>chevron_right</mat-icon>\n</button>\n", styles: [":host{display:flex;flex-direction:row;justify-content:center;align-items:center;background:transparent;flex-wrap:nowrap}.picker-text{flex-flow:1;flex-grow:1;text-align:center}\n"] }]
|
|
2629
|
+
}], ctorParameters: function () { return []; }, propDecorators: { paginaAtualChange: [{
|
|
2630
|
+
type: Output
|
|
2631
|
+
}], totalPaginasChange: [{
|
|
2632
|
+
type: Output
|
|
2633
|
+
}], change: [{
|
|
2634
|
+
type: Output
|
|
2635
|
+
}], pageSize: [{
|
|
2636
|
+
type: Input
|
|
2637
|
+
}], paginaAtual: [{
|
|
2638
|
+
type: Input
|
|
2639
|
+
}], totalPaginas: [{
|
|
2640
|
+
type: Input
|
|
2641
|
+
}] } });
|
|
2642
|
+
|
|
2643
|
+
class ProdutosComponent {
|
|
2644
|
+
constructor(ws, notification, dialog, auth, screenHelper) {
|
|
2645
|
+
this.ws = ws;
|
|
2646
|
+
this.notification = notification;
|
|
2647
|
+
this.dialog = dialog;
|
|
2648
|
+
this.screenHelper = screenHelper;
|
|
2649
|
+
this.isBusy = false;
|
|
2650
|
+
this.items = [];
|
|
2651
|
+
this.result = {
|
|
2652
|
+
finalQtd: 0,
|
|
2653
|
+
inicioQtd: 0,
|
|
2654
|
+
items: [],
|
|
2655
|
+
pagina: 0,
|
|
2656
|
+
quantidade: 0,
|
|
2657
|
+
valor: 0,
|
|
2658
|
+
totalPaginas: 0
|
|
2659
|
+
};
|
|
2660
|
+
this._selectedItem = null;
|
|
2661
|
+
this.lazyTrigger = new LazyTrigger(() => { this.atualiza(); });
|
|
2662
|
+
this.setting = new ProdutoSearchSetting();
|
|
2663
|
+
this.focus = new FocusService();
|
|
2664
|
+
this.paginaAtual = 1;
|
|
2665
|
+
this.quantidadePagina = 50;
|
|
2666
|
+
this.allowAdd = auth.permissoes.adminProdutoAdd;
|
|
2667
|
+
this.allowExcluir = auth.permissoes.adminProdutoDelete;
|
|
2668
|
+
this.mobile = this.screenHelper.isMedium;
|
|
2669
|
+
this.screenHelper.changedMediumScreen.subscribe(x => this.mobile = x);
|
|
2670
|
+
this.setting.exibeNaoControladoEstoque = true;
|
|
2671
|
+
this.setting.exibeImprimiCozinha = true;
|
|
2672
|
+
}
|
|
2673
|
+
get selectedItem() {
|
|
2674
|
+
return this._selectedItem;
|
|
2675
|
+
}
|
|
2676
|
+
set selectedItem(p) {
|
|
2677
|
+
this._selectedItem = p;
|
|
2678
|
+
}
|
|
2679
|
+
ngOnInit() {
|
|
2680
|
+
this.setting.ordem = "nome";
|
|
2681
|
+
this.atualiza();
|
|
2682
|
+
}
|
|
2683
|
+
onSelectItem() {
|
|
2684
|
+
if (!this.focus.hasInit()) {
|
|
2685
|
+
setTimeout(() => {
|
|
2686
|
+
this.focus.registerElementById("form-column");
|
|
2687
|
+
this.focus.setFirst();
|
|
2688
|
+
}, 500);
|
|
2689
|
+
//this._focus.registerElementById("form-column");
|
|
2690
|
+
}
|
|
2691
|
+
else {
|
|
2692
|
+
this.focus.setFirst();
|
|
2693
|
+
}
|
|
2694
|
+
}
|
|
2695
|
+
ngOnDestroy() {
|
|
2696
|
+
this.focus.unregisterElementById("form-column");
|
|
2697
|
+
}
|
|
2698
|
+
trocaPagina() {
|
|
2699
|
+
this.atualiza(this.paginaAtual);
|
|
2700
|
+
}
|
|
2701
|
+
atualiza(pagina) {
|
|
2702
|
+
if (pagina == undefined)
|
|
2703
|
+
this.paginaAtual = 1;
|
|
2704
|
+
else
|
|
2705
|
+
this.paginaAtual = pagina;
|
|
2706
|
+
this.isBusy = true;
|
|
2707
|
+
this.ws.buscaPaginadaProdutos(this.setting, this.paginaAtual, this.quantidadePagina)
|
|
2708
|
+
.subscribe(r => {
|
|
2709
|
+
this.items = r.items;
|
|
2710
|
+
this.result = r;
|
|
2711
|
+
this.selectedItem = null;
|
|
2712
|
+
console.info(r);
|
|
2713
|
+
this.isBusy = false;
|
|
2714
|
+
}, err => {
|
|
2715
|
+
this.isBusy = false;
|
|
2716
|
+
this.notification.showHttpError(err);
|
|
2717
|
+
});
|
|
2718
|
+
}
|
|
2719
|
+
excluir() {
|
|
2720
|
+
const item = this.selectedItem;
|
|
2721
|
+
if (!item)
|
|
2722
|
+
return;
|
|
2723
|
+
confirmaExclusao(this.dialog, `Deseja prosseguir com a exclusão do produto ${item.nome}?`, () => {
|
|
2724
|
+
this.isBusy = true;
|
|
2725
|
+
this.ws.deleteProduto(item.id)
|
|
2726
|
+
.subscribe(r => {
|
|
2727
|
+
this.notification.showMsg("O produto foi excluído com sucesso.");
|
|
2728
|
+
this.items.remove(item);
|
|
2729
|
+
this.selectedItem = null;
|
|
2730
|
+
this.isBusy = false;
|
|
2731
|
+
}, err => {
|
|
2732
|
+
this.isBusy = false;
|
|
2733
|
+
this.notification.showMsg(err.error);
|
|
2734
|
+
});
|
|
2735
|
+
});
|
|
2736
|
+
}
|
|
2737
|
+
novo() {
|
|
2738
|
+
let height = (window.innerHeight * 0.90) + 'px';
|
|
2739
|
+
let width = 550 + 'px';
|
|
2740
|
+
if (this.mobile) {
|
|
2741
|
+
width = (window.innerWidth * 0.99) + 'px';
|
|
2742
|
+
//height = (window.innerHeight * 0.98) + 'px';
|
|
2743
|
+
}
|
|
2744
|
+
const dialog = this.dialog.open(ProdutoAddDialogComponent, {
|
|
2745
|
+
width: width,
|
|
2746
|
+
height: height,
|
|
2747
|
+
maxWidth: '100%',
|
|
2748
|
+
panelClass: 'dialog-p0',
|
|
2749
|
+
});
|
|
2750
|
+
dialog.afterClosed().subscribe(result => {
|
|
2751
|
+
if (result === undefined)
|
|
2752
|
+
return;
|
|
2753
|
+
this.notification.showMsg("Salvo com sucesso.");
|
|
2754
|
+
this.atualiza();
|
|
2755
|
+
});
|
|
2756
|
+
}
|
|
2757
|
+
abreCadastro(item) {
|
|
2758
|
+
let height = undefined;
|
|
2759
|
+
let width = 550 + 'px';
|
|
2760
|
+
if (this.mobile) {
|
|
2761
|
+
width = (window.innerWidth * 0.99) + 'px';
|
|
2762
|
+
height = (window.innerHeight * 0.99) + 'px';
|
|
2763
|
+
}
|
|
2764
|
+
const dialog = this.dialog.open(ProdutoEditDialogComponent, {
|
|
2765
|
+
data: item,
|
|
2766
|
+
width: width,
|
|
2767
|
+
height: height,
|
|
2768
|
+
maxWidth: '100%',
|
|
2769
|
+
panelClass: 'dialog-p0',
|
|
2770
|
+
});
|
|
2771
|
+
dialog.afterClosed().subscribe(result => {
|
|
2772
|
+
if (result !== true)
|
|
2773
|
+
return;
|
|
2774
|
+
this.notification.showMsg("Salvo com sucesso.");
|
|
2775
|
+
this.atualiza();
|
|
2776
|
+
});
|
|
2777
|
+
}
|
|
2778
|
+
salvar() {
|
|
2779
|
+
if (!this.selectedItem)
|
|
2780
|
+
return;
|
|
2781
|
+
const valMsg = validaProduto(this.selectedItem, this.focus);
|
|
2782
|
+
if (valMsg) {
|
|
2783
|
+
this.notification.showMsgError(valMsg);
|
|
2784
|
+
return;
|
|
2785
|
+
}
|
|
2786
|
+
this.isBusy = true;
|
|
2787
|
+
this.ws.saveProduto(this.selectedItem)
|
|
2788
|
+
.subscribe(r => {
|
|
2789
|
+
this.notification.showMsg("Salvo com sucesso.");
|
|
2790
|
+
this.isBusy = false;
|
|
2791
|
+
}, err => {
|
|
2792
|
+
this.isBusy = false;
|
|
2793
|
+
this.notification.showMsg(err.error);
|
|
2794
|
+
});
|
|
2795
|
+
}
|
|
2796
|
+
filtros() {
|
|
2797
|
+
let height = undefined;
|
|
2798
|
+
let width = 550 + 'px';
|
|
2799
|
+
if (this.mobile) {
|
|
2800
|
+
width = (window.innerWidth * 0.99) + 'px';
|
|
2801
|
+
height = (window.innerHeight * 0.99) + 'px';
|
|
2802
|
+
}
|
|
2803
|
+
const p = {
|
|
2804
|
+
qtd: this.quantidadePagina,
|
|
2805
|
+
setting: this.setting
|
|
2806
|
+
};
|
|
2807
|
+
const dialog = this.dialog.open(ProdutoBuscaFiltrosDialogComponent, {
|
|
2808
|
+
data: p,
|
|
2809
|
+
width: width,
|
|
2810
|
+
height: height,
|
|
2811
|
+
maxWidth: '100%',
|
|
2812
|
+
panelClass: 'dialog-p0',
|
|
2813
|
+
});
|
|
2814
|
+
dialog.afterClosed().subscribe(result => {
|
|
2815
|
+
if (!result)
|
|
2816
|
+
return;
|
|
2817
|
+
const r = result;
|
|
2818
|
+
this.quantidadePagina = r.qtd;
|
|
2819
|
+
this.atualiza();
|
|
2820
|
+
});
|
|
2821
|
+
}
|
|
2822
|
+
}
|
|
2823
|
+
ProdutosComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutosComponent, deps: [{ token: CommonWebService }, { token: NotificationService }, { token: i3.MatDialog }, { token: AuthDataService }, { token: ScreenHelperService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2824
|
+
ProdutosComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: ProdutosComponent, selector: "app-produtos", ngImport: i0, template: "<ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>\n<div class=\"tool-panel\" *ngIf=\"mobile\">\n <div class=\"tool-section\">\n <label>Pesquisa</label>\n <div class=\"search-input-container\">\n <input [(ngModel)]=\"setting.frase\" placeholder=\"Digite um termo de busca...\" (input)=\"lazyTrigger.fire()\">\n <button mat-icon-button (click)=\"filtros()\">\n <mat-icon aria-label=\"Filtros\">manage_search</mat-icon>\n </button>\n </div>\n </div>\n <div class=\"tool-section ordem-sm2\">\n <label>A\u00E7\u00F5es</label>\n <div class=\"tool-row\">\n <button mat-icon-button (click)=\"atualiza()\">\n <mat-icon aria-label=\"Atualizar\">refresh</mat-icon>\n </button>\n <button mat-icon-button (click)=\"novo()\" *ngIf=\"allowAdd\">\n <mat-icon aria-label=\"Novo Grupo\">add</mat-icon>\n </button>\n <button mat-icon-button (click)=\"excluir()\" *ngIf=\"selectedItem && allowExcluir\" [@fade]>\n <mat-icon aria-label=\"Excluir Grupo\">delete</mat-icon>\n </button>\n </div>\n </div>\n</div>\n<div class=\"result-container\" *ngIf=\"items\">\n <div class=\"cards-container cards-container-shadow\" *ngIf=\"mobile\">\n <ox-item-card [desativado]=\"!i.isAtivo\" [cloud]=\"i.enviadoPC\" [nome]=\"i.nome\" *ngFor=\"let i of items\" (click)=\"abreCadastro(i)\"></ox-item-card>\n </div> \n <div class=\"hbox\" *ngIf=\"mobile\">\n <ox-paginator (change)=\"trocaPagina()\" [(paginaAtual)]=\"paginaAtual\" [(totalPaginas)]=\"result.totalPaginas\">\n </ox-paginator>\n </div>\n <div class=\"listagem-desktop-grid\" *ngIf=\"!mobile\">\n <div class=\"listagem-column-container listagem-list-column\">\n <h3>Produtos</h3>\n <div class=\"tool-panel tool-panel-float\">\n <div class=\"tool-section\">\n <label>Pesquisa</label>\n <div class=\"search-input-container\">\n <input [(ngModel)]=\"setting.frase\" placeholder=\"Digite um termo de busca...\" (input)=\"lazyTrigger.fire()\">\n <button mat-icon-button (click)=\"filtros()\">\n <mat-icon aria-label=\"Filtros\">manage_search</mat-icon>\n </button>\n </div>\n </div>\n <div class=\"tool-section ordem-sm2\">\n <label>A\u00E7\u00F5es</label>\n <div class=\"tool-row\">\n <button mat-icon-button (click)=\"atualiza()\">\n <mat-icon aria-label=\"Atualizar\">refresh</mat-icon>\n </button>\n <button mat-icon-button (click)=\"novo()\" *ngIf=\"allowAdd\">\n <mat-icon aria-label=\"Novo\">add</mat-icon>\n </button>\n <button mat-icon-button (click)=\"excluir()\" *ngIf=\"selectedItem && allowExcluir\" [@fade]>\n <mat-icon aria-label=\"Excluir\">delete</mat-icon>\n </button>\n </div>\n </div>\n </div>\n <div class=\"listagem-list-container\">\n <h4 *ngIf=\"items.length === 0\" class=\"nenhum-item-msg\">A busca n\u00E3o retornou resultados</h4>\n\n <ox-item-card [desativado]=\"!i.isAtivo\" [cloud]=\"i.enviadoPC\" [codigo]=\"i.id\" [nome]=\"i.nome\" *ngFor=\"let i of items\" [class.selected]=\"i === selectedItem\"\n (click)=\"selectedItem = i;\"></ox-item-card>\n\n </div>\n <div class=\"hbox\">\n <ox-paginator (change)=\"trocaPagina()\" [(paginaAtual)]=\"paginaAtual\" [(totalPaginas)]=\"result.totalPaginas\">\n </ox-paginator>\n <div class=\"total-qtd\">Exibindo {{result.inicioQtd}}-{{result.finalQtd}} de {{result.quantidade}}</div>\n \n </div>\n </div>\n <div class=\"listagem-column-container listagem-column-form\">\n <h3 *ngIf=\"!selectedItem\">Selecione um produto no lado direito</h3>\n <h3 *ngIf=\"selectedItem\">{{selectedItem.nome | uppercase}}</h3>\n <div class=\"listagem-form-container\">\n <app-produto-form [@fade] [model]=\"selectedItem\" *ngIf=\"selectedItem\" [editMode]=\"true\">\n </app-produto-form>\n </div>\n\n <div class=\"listagem-form-acoes\">\n <button (click)=\"salvar()\" mat-fab color=\"primary\" *ngIf=\"selectedItem\" tabindex=\"20\">\n <mat-icon>save</mat-icon>\n </button>\n </div>\n </div>\n </div>\n</div>", styles: [":host{height:calc(100% - 48px);display:flex;flex-grow:1;flex-direction:column;background:#F0F0F0}:host{background-color:#fdfdfd}.total-qtd{align-self:center;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: "directive", type: i7.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i6$1.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: "component", type: BusyIndicatorComponent, selector: "ox-busy-indicator", inputs: ["isBusy"] }, { kind: "component", type: PaginatorComponent, selector: "ox-paginator", inputs: ["pageSize", "paginaAtual", "totalPaginas"], outputs: ["paginaAtualChange", "totalPaginasChange", "change"] }, { kind: "component", type: ItemCardComponent, selector: "ox-item-card", inputs: ["nome", "codigo", "star", "cloud", "desativado"] }, { kind: "component", type: ProdutoFormComponent, selector: "app-produto-form", inputs: ["editMode", "model"], outputs: ["nextIdClick"] }, { kind: "pipe", type: i6.UpperCasePipe, name: "uppercase" }], animations: [fadeAnimation] });
|
|
2825
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutosComponent, decorators: [{
|
|
2826
|
+
type: Component,
|
|
2827
|
+
args: [{ selector: 'app-produtos', animations: [fadeAnimation], template: "<ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>\n<div class=\"tool-panel\" *ngIf=\"mobile\">\n <div class=\"tool-section\">\n <label>Pesquisa</label>\n <div class=\"search-input-container\">\n <input [(ngModel)]=\"setting.frase\" placeholder=\"Digite um termo de busca...\" (input)=\"lazyTrigger.fire()\">\n <button mat-icon-button (click)=\"filtros()\">\n <mat-icon aria-label=\"Filtros\">manage_search</mat-icon>\n </button>\n </div>\n </div>\n <div class=\"tool-section ordem-sm2\">\n <label>A\u00E7\u00F5es</label>\n <div class=\"tool-row\">\n <button mat-icon-button (click)=\"atualiza()\">\n <mat-icon aria-label=\"Atualizar\">refresh</mat-icon>\n </button>\n <button mat-icon-button (click)=\"novo()\" *ngIf=\"allowAdd\">\n <mat-icon aria-label=\"Novo Grupo\">add</mat-icon>\n </button>\n <button mat-icon-button (click)=\"excluir()\" *ngIf=\"selectedItem && allowExcluir\" [@fade]>\n <mat-icon aria-label=\"Excluir Grupo\">delete</mat-icon>\n </button>\n </div>\n </div>\n</div>\n<div class=\"result-container\" *ngIf=\"items\">\n <div class=\"cards-container cards-container-shadow\" *ngIf=\"mobile\">\n <ox-item-card [desativado]=\"!i.isAtivo\" [cloud]=\"i.enviadoPC\" [nome]=\"i.nome\" *ngFor=\"let i of items\" (click)=\"abreCadastro(i)\"></ox-item-card>\n </div> \n <div class=\"hbox\" *ngIf=\"mobile\">\n <ox-paginator (change)=\"trocaPagina()\" [(paginaAtual)]=\"paginaAtual\" [(totalPaginas)]=\"result.totalPaginas\">\n </ox-paginator>\n </div>\n <div class=\"listagem-desktop-grid\" *ngIf=\"!mobile\">\n <div class=\"listagem-column-container listagem-list-column\">\n <h3>Produtos</h3>\n <div class=\"tool-panel tool-panel-float\">\n <div class=\"tool-section\">\n <label>Pesquisa</label>\n <div class=\"search-input-container\">\n <input [(ngModel)]=\"setting.frase\" placeholder=\"Digite um termo de busca...\" (input)=\"lazyTrigger.fire()\">\n <button mat-icon-button (click)=\"filtros()\">\n <mat-icon aria-label=\"Filtros\">manage_search</mat-icon>\n </button>\n </div>\n </div>\n <div class=\"tool-section ordem-sm2\">\n <label>A\u00E7\u00F5es</label>\n <div class=\"tool-row\">\n <button mat-icon-button (click)=\"atualiza()\">\n <mat-icon aria-label=\"Atualizar\">refresh</mat-icon>\n </button>\n <button mat-icon-button (click)=\"novo()\" *ngIf=\"allowAdd\">\n <mat-icon aria-label=\"Novo\">add</mat-icon>\n </button>\n <button mat-icon-button (click)=\"excluir()\" *ngIf=\"selectedItem && allowExcluir\" [@fade]>\n <mat-icon aria-label=\"Excluir\">delete</mat-icon>\n </button>\n </div>\n </div>\n </div>\n <div class=\"listagem-list-container\">\n <h4 *ngIf=\"items.length === 0\" class=\"nenhum-item-msg\">A busca n\u00E3o retornou resultados</h4>\n\n <ox-item-card [desativado]=\"!i.isAtivo\" [cloud]=\"i.enviadoPC\" [codigo]=\"i.id\" [nome]=\"i.nome\" *ngFor=\"let i of items\" [class.selected]=\"i === selectedItem\"\n (click)=\"selectedItem = i;\"></ox-item-card>\n\n </div>\n <div class=\"hbox\">\n <ox-paginator (change)=\"trocaPagina()\" [(paginaAtual)]=\"paginaAtual\" [(totalPaginas)]=\"result.totalPaginas\">\n </ox-paginator>\n <div class=\"total-qtd\">Exibindo {{result.inicioQtd}}-{{result.finalQtd}} de {{result.quantidade}}</div>\n \n </div>\n </div>\n <div class=\"listagem-column-container listagem-column-form\">\n <h3 *ngIf=\"!selectedItem\">Selecione um produto no lado direito</h3>\n <h3 *ngIf=\"selectedItem\">{{selectedItem.nome | uppercase}}</h3>\n <div class=\"listagem-form-container\">\n <app-produto-form [@fade] [model]=\"selectedItem\" *ngIf=\"selectedItem\" [editMode]=\"true\">\n </app-produto-form>\n </div>\n\n <div class=\"listagem-form-acoes\">\n <button (click)=\"salvar()\" mat-fab color=\"primary\" *ngIf=\"selectedItem\" tabindex=\"20\">\n <mat-icon>save</mat-icon>\n </button>\n </div>\n </div>\n </div>\n</div>", styles: [":host{height:calc(100% - 48px);display:flex;flex-grow:1;flex-direction:column;background:#F0F0F0}:host{background-color:#fdfdfd}.total-qtd{align-self:center;font-size:small}\n"] }]
|
|
2828
|
+
}], ctorParameters: function () { return [{ type: CommonWebService }, { type: NotificationService }, { type: i3.MatDialog }, { type: AuthDataService }, { type: ScreenHelperService }]; } });
|
|
2829
|
+
|
|
2830
|
+
class ProdutosCategoriasCardapioComponent {
|
|
2831
|
+
constructor(ws, notification, dialog, auth, screenHelper) {
|
|
2832
|
+
this.ws = ws;
|
|
2833
|
+
this.notification = notification;
|
|
2834
|
+
this.dialog = dialog;
|
|
2835
|
+
this.screenHelper = screenHelper;
|
|
2836
|
+
this.isBusy = false;
|
|
2837
|
+
this.items = [];
|
|
2838
|
+
this.selectedItem = null;
|
|
2839
|
+
this.lazyTrigger = new LazyTrigger(() => { this.atualiza(); });
|
|
2840
|
+
this.setting = new SearchSetting();
|
|
2841
|
+
this.focus = new FocusService();
|
|
2842
|
+
this.allowAdd = auth.permissoes.adminProdutoGrupoAdd;
|
|
2843
|
+
this.allowExcluir = auth.permissoes.adminProdutoGrupoDelete;
|
|
2844
|
+
this.mobile = this.screenHelper.isMedium;
|
|
2845
|
+
this.screenHelper.changedMediumScreen.subscribe(x => this.mobile = x);
|
|
2846
|
+
}
|
|
2847
|
+
ngOnInit() {
|
|
2848
|
+
this.setting.ordem = "nome";
|
|
2849
|
+
this.atualiza();
|
|
2850
|
+
}
|
|
2851
|
+
onSelectItem() {
|
|
2852
|
+
if (!this.focus.hasInit()) {
|
|
2853
|
+
setTimeout(() => {
|
|
2854
|
+
this.focus.registerElementById("form-column");
|
|
2855
|
+
this.focus.setFirst();
|
|
2856
|
+
}, 500);
|
|
2857
|
+
//this._focus.registerElementById("form-column");
|
|
2858
|
+
}
|
|
2859
|
+
else {
|
|
2860
|
+
this.focus.setFirst();
|
|
2861
|
+
}
|
|
2862
|
+
}
|
|
2863
|
+
ngOnDestroy() {
|
|
2864
|
+
this.focus.unregisterElementById("form-column");
|
|
2865
|
+
}
|
|
2866
|
+
atualiza() {
|
|
2867
|
+
this.isBusy = true;
|
|
2868
|
+
this.ws.buscaProdutoCategoriaCardapio(this.setting)
|
|
2869
|
+
.subscribe(r => {
|
|
2870
|
+
this.items = r;
|
|
2871
|
+
this.selectedItem = null;
|
|
2872
|
+
console.info(r);
|
|
2873
|
+
this.isBusy = false;
|
|
2874
|
+
}, err => {
|
|
2875
|
+
this.isBusy = false;
|
|
2876
|
+
this.notification.showHttpError(err);
|
|
2877
|
+
});
|
|
2878
|
+
}
|
|
2879
|
+
excluir() {
|
|
2880
|
+
const item = this.selectedItem;
|
|
2881
|
+
if (!item)
|
|
2882
|
+
return;
|
|
2883
|
+
confirmaExclusao(this.dialog, `Deseja prosseguir com a exclusão do grupo ${item.nome}?`, () => {
|
|
2884
|
+
this.isBusy = true;
|
|
2885
|
+
this.ws.deleteProdutoCategoriaCardapio(item.id)
|
|
2886
|
+
.subscribe(r => {
|
|
2887
|
+
this.notification.showMsg("O grupo foi excluído com sucesso.");
|
|
2888
|
+
this.items.remove(item);
|
|
2889
|
+
this.selectedItem = null;
|
|
2890
|
+
this.isBusy = false;
|
|
2891
|
+
}, err => {
|
|
2892
|
+
this.isBusy = false;
|
|
2893
|
+
this.notification.showMsg(err.error);
|
|
2894
|
+
});
|
|
2895
|
+
});
|
|
2896
|
+
}
|
|
2897
|
+
novo() {
|
|
2898
|
+
let height = (window.innerHeight * 0.90) + 'px';
|
|
2899
|
+
let width = 550 + 'px';
|
|
2900
|
+
if (this.mobile) {
|
|
2901
|
+
width = (window.innerWidth * 0.99) + 'px';
|
|
2902
|
+
//height = (window.innerHeight * 0.98) + 'px';
|
|
2903
|
+
}
|
|
2904
|
+
const dialog = this.dialog.open(ProdutoCategoriaCardapioAddDialogComponent, {
|
|
2905
|
+
width: width,
|
|
2906
|
+
//height: height,
|
|
2907
|
+
maxWidth: '100%',
|
|
2908
|
+
panelClass: 'dialog-p0',
|
|
2909
|
+
});
|
|
2910
|
+
dialog.afterClosed().subscribe(result => {
|
|
2911
|
+
if (result === undefined)
|
|
2912
|
+
return;
|
|
2913
|
+
this.notification.showMsg("Salvo com sucesso.");
|
|
2914
|
+
this.atualiza();
|
|
2915
|
+
});
|
|
2916
|
+
}
|
|
2917
|
+
abreCadastro(item) {
|
|
2918
|
+
let height = undefined;
|
|
2919
|
+
let width = 550 + 'px';
|
|
2920
|
+
if (this.mobile) {
|
|
2921
|
+
width = (window.innerWidth * 0.99) + 'px';
|
|
2922
|
+
height = (window.innerHeight * 0.99) + 'px';
|
|
2923
|
+
}
|
|
2924
|
+
const dialog = this.dialog.open(ProdutoCategoriaCardapioEditDialogComponent, {
|
|
2925
|
+
data: item,
|
|
2926
|
+
width: width,
|
|
2927
|
+
//height: height,
|
|
2928
|
+
maxWidth: '100%',
|
|
2929
|
+
panelClass: 'dialog-p0',
|
|
2930
|
+
});
|
|
2931
|
+
dialog.afterClosed().subscribe(result => {
|
|
2932
|
+
if (result !== true)
|
|
2933
|
+
return;
|
|
2934
|
+
this.notification.showMsg("Salvo com sucesso.");
|
|
2935
|
+
this.atualiza();
|
|
2936
|
+
});
|
|
2937
|
+
}
|
|
2938
|
+
salvar() {
|
|
2939
|
+
if (!this.selectedItem)
|
|
2940
|
+
return;
|
|
2941
|
+
const valMsg = validaProdutoGrupo(this.selectedItem, this.focus);
|
|
2942
|
+
if (valMsg) {
|
|
2943
|
+
this.notification.showMsgError(valMsg);
|
|
2944
|
+
return;
|
|
2945
|
+
}
|
|
2946
|
+
this.isBusy = true;
|
|
2947
|
+
this.ws.saveProdutoCategoriaCardapio(this.selectedItem)
|
|
2948
|
+
.subscribe(r => {
|
|
2949
|
+
this.notification.showMsg("Salvo com sucesso.");
|
|
2950
|
+
this.isBusy = false;
|
|
2951
|
+
}, err => {
|
|
2952
|
+
this.isBusy = false;
|
|
2953
|
+
this.notification.showMsg(err.error);
|
|
2954
|
+
});
|
|
2955
|
+
}
|
|
2956
|
+
}
|
|
2957
|
+
ProdutosCategoriasCardapioComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutosCategoriasCardapioComponent, deps: [{ token: CommonWebService }, { token: NotificationService }, { token: i3.MatDialog }, { token: AuthDataService }, { token: ScreenHelperService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2958
|
+
ProdutosCategoriasCardapioComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: ProdutosCategoriasCardapioComponent, selector: "app-produtos-categorias-cardapio", ngImport: i0, template: "<ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>\n<div class=\"tool-panel\" *ngIf=\"mobile\">\n <div class=\"tool-section\">\n <label>Pesquisa</label>\n <div class=\"search-input-container\">\n <input [(ngModel)]=\"setting.frase\" placeholder=\"Digite um termo de busca...\" (input)=\"lazyTrigger.fire()\">\n </div>\n </div>\n <div class=\"tool-section ordem-sm2\">\n <label>A\u00E7\u00F5es</label>\n <div class=\"tool-row\">\n <button mat-icon-button (click)=\"atualiza()\">\n <mat-icon aria-label=\"Atualizar\">refresh</mat-icon>\n </button>\n <button mat-icon-button (click)=\"novo()\" *ngIf=\"allowAdd\">\n <mat-icon aria-label=\"Novo Grupo\">add</mat-icon>\n </button>\n <button mat-icon-button (click)=\"excluir()\" *ngIf=\"selectedItem && allowExcluir\" [@fade]>\n <mat-icon aria-label=\"Excluir Grupo\">delete</mat-icon>\n </button>\n </div>\n </div>\n</div>\n<div class=\"result-container\" *ngIf=\"items\">\n <div class=\"cards-container cards-container-shadow\" *ngIf=\"mobile\">\n <ox-item-card [nome]=\"i.nome\" *ngFor=\"let i of items\" (click)=\"abreCadastro(i)\"></ox-item-card>\n </div>\n <div class=\"listagem-desktop-grid\" *ngIf=\"!mobile\">\n <div class=\"listagem-column-container listagem-list-column\">\n <h3>Grupos de Produtos</h3>\n <div class=\"tool-panel tool-panel-float\">\n <div class=\"tool-section\">\n <label>Pesquisa</label>\n <div class=\"search-input-container\">\n <input [(ngModel)]=\"setting.frase\" placeholder=\"Digite um termo de busca...\" (input)=\"lazyTrigger.fire()\">\n </div>\n </div>\n <div class=\"tool-section ordem-sm2\">\n <label>A\u00E7\u00F5es</label>\n <div class=\"tool-row\">\n <button mat-icon-button (click)=\"atualiza()\">\n <mat-icon aria-label=\"Atualizar\">refresh</mat-icon>\n </button>\n <button mat-icon-button (click)=\"novo()\" *ngIf=\"allowAdd\">\n <mat-icon aria-label=\"Novo\">add</mat-icon>\n </button>\n <button mat-icon-button (click)=\"excluir()\" *ngIf=\"selectedItem && allowExcluir\" [@fade]>\n <mat-icon aria-label=\"Excluir\">delete</mat-icon>\n </button>\n </div>\n </div>\n </div>\n <div class=\"listagem-list-container\">\n <h4 *ngIf=\"items.length === 0\" class=\"nenhum-item-msg\">A busca n\u00E3o retornou resultados</h4>\n\n <ox-item-card [nome]=\"i.nome\" *ngFor=\"let i of items\" [class.selected]=\"i === selectedItem\"\n (click)=\"selectedItem = i;\"></ox-item-card>\n\n </div>\n </div>\n <div class=\"listagem-column-container listagem-column-form\">\n <h3 *ngIf=\"!selectedItem\">Selecione um grupo no lado direito</h3>\n <h3 *ngIf=\"selectedItem\">{{selectedItem.nome | uppercase}}</h3>\n <div class=\"listagem-form-container\">\n <app-produto-grupo-form [@fade] [model]=\"selectedItem\" *ngIf=\"selectedItem\">\n </app-produto-grupo-form>\n </div>\n\n <div class=\"listagem-form-acoes\">\n <button (click)=\"salvar()\" mat-fab color=\"primary\" *ngIf=\"selectedItem\" tabindex=\"20\">\n <mat-icon>save</mat-icon>\n </button>\n </div>\n </div>\n </div>\n</div>", styles: [":host{height:calc(100% - 48px);display:flex;flex-grow:1;flex-direction:column;background:#F0F0F0}:host{background-color:#fdfdfd}\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: "directive", type: i7.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i6$1.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: "component", type: BusyIndicatorComponent, selector: "ox-busy-indicator", inputs: ["isBusy"] }, { kind: "component", type: ItemCardComponent, selector: "ox-item-card", inputs: ["nome", "codigo", "star", "cloud", "desativado"] }, { kind: "component", type: ProdutoGrupoFormComponent, selector: "app-produto-grupo-form", inputs: ["model"] }, { kind: "pipe", type: i6.UpperCasePipe, name: "uppercase" }], animations: [fadeAnimation] });
|
|
2959
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutosCategoriasCardapioComponent, decorators: [{
|
|
2960
|
+
type: Component,
|
|
2961
|
+
args: [{ selector: 'app-produtos-categorias-cardapio', animations: [fadeAnimation], template: "<ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>\n<div class=\"tool-panel\" *ngIf=\"mobile\">\n <div class=\"tool-section\">\n <label>Pesquisa</label>\n <div class=\"search-input-container\">\n <input [(ngModel)]=\"setting.frase\" placeholder=\"Digite um termo de busca...\" (input)=\"lazyTrigger.fire()\">\n </div>\n </div>\n <div class=\"tool-section ordem-sm2\">\n <label>A\u00E7\u00F5es</label>\n <div class=\"tool-row\">\n <button mat-icon-button (click)=\"atualiza()\">\n <mat-icon aria-label=\"Atualizar\">refresh</mat-icon>\n </button>\n <button mat-icon-button (click)=\"novo()\" *ngIf=\"allowAdd\">\n <mat-icon aria-label=\"Novo Grupo\">add</mat-icon>\n </button>\n <button mat-icon-button (click)=\"excluir()\" *ngIf=\"selectedItem && allowExcluir\" [@fade]>\n <mat-icon aria-label=\"Excluir Grupo\">delete</mat-icon>\n </button>\n </div>\n </div>\n</div>\n<div class=\"result-container\" *ngIf=\"items\">\n <div class=\"cards-container cards-container-shadow\" *ngIf=\"mobile\">\n <ox-item-card [nome]=\"i.nome\" *ngFor=\"let i of items\" (click)=\"abreCadastro(i)\"></ox-item-card>\n </div>\n <div class=\"listagem-desktop-grid\" *ngIf=\"!mobile\">\n <div class=\"listagem-column-container listagem-list-column\">\n <h3>Grupos de Produtos</h3>\n <div class=\"tool-panel tool-panel-float\">\n <div class=\"tool-section\">\n <label>Pesquisa</label>\n <div class=\"search-input-container\">\n <input [(ngModel)]=\"setting.frase\" placeholder=\"Digite um termo de busca...\" (input)=\"lazyTrigger.fire()\">\n </div>\n </div>\n <div class=\"tool-section ordem-sm2\">\n <label>A\u00E7\u00F5es</label>\n <div class=\"tool-row\">\n <button mat-icon-button (click)=\"atualiza()\">\n <mat-icon aria-label=\"Atualizar\">refresh</mat-icon>\n </button>\n <button mat-icon-button (click)=\"novo()\" *ngIf=\"allowAdd\">\n <mat-icon aria-label=\"Novo\">add</mat-icon>\n </button>\n <button mat-icon-button (click)=\"excluir()\" *ngIf=\"selectedItem && allowExcluir\" [@fade]>\n <mat-icon aria-label=\"Excluir\">delete</mat-icon>\n </button>\n </div>\n </div>\n </div>\n <div class=\"listagem-list-container\">\n <h4 *ngIf=\"items.length === 0\" class=\"nenhum-item-msg\">A busca n\u00E3o retornou resultados</h4>\n\n <ox-item-card [nome]=\"i.nome\" *ngFor=\"let i of items\" [class.selected]=\"i === selectedItem\"\n (click)=\"selectedItem = i;\"></ox-item-card>\n\n </div>\n </div>\n <div class=\"listagem-column-container listagem-column-form\">\n <h3 *ngIf=\"!selectedItem\">Selecione um grupo no lado direito</h3>\n <h3 *ngIf=\"selectedItem\">{{selectedItem.nome | uppercase}}</h3>\n <div class=\"listagem-form-container\">\n <app-produto-grupo-form [@fade] [model]=\"selectedItem\" *ngIf=\"selectedItem\">\n </app-produto-grupo-form>\n </div>\n\n <div class=\"listagem-form-acoes\">\n <button (click)=\"salvar()\" mat-fab color=\"primary\" *ngIf=\"selectedItem\" tabindex=\"20\">\n <mat-icon>save</mat-icon>\n </button>\n </div>\n </div>\n </div>\n</div>", styles: [":host{height:calc(100% - 48px);display:flex;flex-grow:1;flex-direction:column;background:#F0F0F0}:host{background-color:#fdfdfd}\n"] }]
|
|
2962
|
+
}], ctorParameters: function () { return [{ type: CommonWebService }, { type: NotificationService }, { type: i3.MatDialog }, { type: AuthDataService }, { type: ScreenHelperService }]; } });
|
|
2963
|
+
|
|
2964
|
+
class MoverGrupoDialogComponent {
|
|
2965
|
+
constructor(ws, dialogRef, notification, dataDialog) {
|
|
2966
|
+
this.ws = ws;
|
|
2967
|
+
this.dialogRef = dialogRef;
|
|
2968
|
+
this.notification = notification;
|
|
2969
|
+
this.dataDialog = dataDialog;
|
|
2970
|
+
this.grupos = [];
|
|
2971
|
+
this.selected = null;
|
|
2972
|
+
this.isBusy = false;
|
|
2973
|
+
}
|
|
2974
|
+
ngOnInit() {
|
|
2975
|
+
this.atualiza();
|
|
2976
|
+
}
|
|
2977
|
+
atualiza() {
|
|
2978
|
+
this.isBusy = true;
|
|
2979
|
+
this.ws.getAllProdutoGrupo()
|
|
2980
|
+
.subscribe(r => {
|
|
2981
|
+
this.grupos = r;
|
|
2982
|
+
console.info(r);
|
|
2983
|
+
this.isBusy = false;
|
|
2984
|
+
}, err => {
|
|
2985
|
+
this.isBusy = false;
|
|
2986
|
+
this.notification.showHttpError(err);
|
|
2987
|
+
});
|
|
2988
|
+
}
|
|
2989
|
+
salvar() {
|
|
2990
|
+
if (!this.selected) {
|
|
2991
|
+
this.notification.showMsgError("Selecione um novo grupo.");
|
|
2992
|
+
return;
|
|
2993
|
+
}
|
|
2994
|
+
this.isBusy = true;
|
|
2995
|
+
this.ws.transfereProdutoGrupo(this.dataDialog.id, this.selected.id)
|
|
2996
|
+
.subscribe(r => {
|
|
2997
|
+
console.info(r);
|
|
2998
|
+
this.notification.showMsg(`${r} produtos foram atualizados com sucesso.`);
|
|
2999
|
+
this.dialogRef.close();
|
|
3000
|
+
this.isBusy = false;
|
|
3001
|
+
}, err => {
|
|
3002
|
+
this.isBusy = false;
|
|
3003
|
+
this.notification.showHttpError(err);
|
|
3004
|
+
});
|
|
3005
|
+
}
|
|
3006
|
+
}
|
|
3007
|
+
MoverGrupoDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: MoverGrupoDialogComponent, deps: [{ token: CommonWebService }, { token: i3.MatDialogRef }, { token: NotificationService }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
|
|
3008
|
+
MoverGrupoDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: MoverGrupoDialogComponent, selector: "app-mover-grupo-dialog", ngImport: i0, template: "<div class=\"ox-header\">\n <h2 class=\"titulo\">Transferir Produtos para um Novo Grupo</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 <div class=\"vbox\">\n <p *ngIf=\"!selected\">Voc\u00EA pode transferir todos os produtos que utilizam o grupo <strong>'{{dataDialog.nome}}'</strong> para outro grupo.</p>\n <p class=\"alert alert-warning\" *ngIf=\"selected\">Transferir produtos com grupo '{{dataDialog.nome}}'' para '{{selected?.nome}}'</p>\n <h4>Selecione um novo grupo para transferir os produtos do grupo</h4>\n \n <mat-select class=\"form-group\" [(value)]=\"selected\">\n <mat-option *ngFor=\"let i of grupos\" [value]=\"i\">\n {{i.nome}}\n </mat-option>\n </mat-select>\n \n </div>\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.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i6$1.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: i4.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "component", type: i5.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: BusyIndicatorComponent, selector: "ox-busy-indicator", inputs: ["isBusy"] }] });
|
|
3009
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: MoverGrupoDialogComponent, decorators: [{
|
|
3010
|
+
type: Component,
|
|
3011
|
+
args: [{ selector: 'app-mover-grupo-dialog', template: "<div class=\"ox-header\">\n <h2 class=\"titulo\">Transferir Produtos para um Novo Grupo</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 <div class=\"vbox\">\n <p *ngIf=\"!selected\">Voc\u00EA pode transferir todos os produtos que utilizam o grupo <strong>'{{dataDialog.nome}}'</strong> para outro grupo.</p>\n <p class=\"alert alert-warning\" *ngIf=\"selected\">Transferir produtos com grupo '{{dataDialog.nome}}'' para '{{selected?.nome}}'</p>\n <h4>Selecione um novo grupo para transferir os produtos do grupo</h4>\n \n <mat-select class=\"form-group\" [(value)]=\"selected\">\n <mat-option *ngFor=\"let i of grupos\" [value]=\"i\">\n {{i.nome}}\n </mat-option>\n </mat-select>\n \n </div>\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"] }]
|
|
3012
|
+
}], ctorParameters: function () {
|
|
3013
|
+
return [{ type: CommonWebService }, { type: i3.MatDialogRef }, { type: NotificationService }, { type: undefined, decorators: [{
|
|
3014
|
+
type: Inject,
|
|
3015
|
+
args: [MAT_DIALOG_DATA]
|
|
3016
|
+
}] }];
|
|
3017
|
+
} });
|
|
3018
|
+
|
|
3019
|
+
class ProdutosGruposComponent {
|
|
3020
|
+
constructor(ws, notification, dialog, auth, screenHelper) {
|
|
3021
|
+
this.ws = ws;
|
|
3022
|
+
this.notification = notification;
|
|
3023
|
+
this.dialog = dialog;
|
|
3024
|
+
this.screenHelper = screenHelper;
|
|
20
3025
|
this.isBusy = false;
|
|
3026
|
+
this.items = [];
|
|
3027
|
+
this.selectedItem = null;
|
|
3028
|
+
this.lazyTrigger = new LazyTrigger(() => { this.atualiza(); });
|
|
3029
|
+
this.setting = new SearchSetting();
|
|
3030
|
+
this.focus = new FocusService();
|
|
3031
|
+
this.allowAdd = auth.permissoes.adminProdutoGrupoAdd;
|
|
3032
|
+
this.allowExcluir = auth.permissoes.adminProdutoGrupoDelete;
|
|
3033
|
+
this.mobile = this.screenHelper.isMedium;
|
|
3034
|
+
this.screenHelper.changedMediumScreen.subscribe(x => this.mobile = x);
|
|
21
3035
|
}
|
|
22
3036
|
ngOnInit() {
|
|
3037
|
+
this.setting.ordem = "nome";
|
|
3038
|
+
this.atualiza();
|
|
3039
|
+
}
|
|
3040
|
+
onSelectItem() {
|
|
3041
|
+
if (!this.focus.hasInit()) {
|
|
3042
|
+
setTimeout(() => {
|
|
3043
|
+
this.focus.registerElementById("form-column");
|
|
3044
|
+
this.focus.setFirst();
|
|
3045
|
+
}, 500);
|
|
3046
|
+
//this._focus.registerElementById("form-column");
|
|
3047
|
+
}
|
|
3048
|
+
else {
|
|
3049
|
+
this.focus.setFirst();
|
|
3050
|
+
}
|
|
3051
|
+
}
|
|
3052
|
+
ngOnDestroy() {
|
|
3053
|
+
this.focus.unregisterElementById("form-column");
|
|
3054
|
+
}
|
|
3055
|
+
atualiza() {
|
|
3056
|
+
this.isBusy = true;
|
|
3057
|
+
this.ws.buscaProdutoGrupo(this.setting)
|
|
3058
|
+
.subscribe(r => {
|
|
3059
|
+
this.items = r;
|
|
3060
|
+
this.selectedItem = null;
|
|
3061
|
+
console.info(r);
|
|
3062
|
+
this.isBusy = false;
|
|
3063
|
+
}, err => {
|
|
3064
|
+
this.isBusy = false;
|
|
3065
|
+
this.notification.showHttpError(err);
|
|
3066
|
+
});
|
|
3067
|
+
}
|
|
3068
|
+
excluir() {
|
|
3069
|
+
const item = this.selectedItem;
|
|
3070
|
+
if (!item)
|
|
3071
|
+
return;
|
|
3072
|
+
confirmaExclusao(this.dialog, `Deseja prosseguir com a exclusão do grupo ${item.nome}?`, () => {
|
|
3073
|
+
this.isBusy = true;
|
|
3074
|
+
this.ws.deleteProdutoGrupo(item.id)
|
|
3075
|
+
.subscribe(r => {
|
|
3076
|
+
this.notification.showMsg("O grupo foi excluído com sucesso.");
|
|
3077
|
+
this.items.remove(item);
|
|
3078
|
+
this.selectedItem = null;
|
|
3079
|
+
this.isBusy = false;
|
|
3080
|
+
}, err => {
|
|
3081
|
+
this.isBusy = false;
|
|
3082
|
+
this.notification.showMsg(err.error);
|
|
3083
|
+
});
|
|
3084
|
+
});
|
|
3085
|
+
}
|
|
3086
|
+
novo() {
|
|
3087
|
+
let height = (window.innerHeight * 0.90) + 'px';
|
|
3088
|
+
let width = 550 + 'px';
|
|
3089
|
+
if (this.mobile) {
|
|
3090
|
+
width = (window.innerWidth * 0.99) + 'px';
|
|
3091
|
+
//height = (window.innerHeight * 0.98) + 'px';
|
|
3092
|
+
}
|
|
3093
|
+
const dialog = this.dialog.open(ProdutoGrupoAddDialogComponent, {
|
|
3094
|
+
width: width,
|
|
3095
|
+
//height: height,
|
|
3096
|
+
maxWidth: '100%',
|
|
3097
|
+
panelClass: 'dialog-p0',
|
|
3098
|
+
});
|
|
3099
|
+
dialog.afterClosed().subscribe(result => {
|
|
3100
|
+
if (result === undefined)
|
|
3101
|
+
return;
|
|
3102
|
+
this.notification.showMsg("Salvo com sucesso.");
|
|
3103
|
+
this.atualiza();
|
|
3104
|
+
});
|
|
3105
|
+
}
|
|
3106
|
+
abreCadastro(item) {
|
|
3107
|
+
let height = undefined;
|
|
3108
|
+
let width = 550 + 'px';
|
|
3109
|
+
if (this.mobile) {
|
|
3110
|
+
width = (window.innerWidth * 0.99) + 'px';
|
|
3111
|
+
height = (window.innerHeight * 0.99) + 'px';
|
|
3112
|
+
}
|
|
3113
|
+
const dialog = this.dialog.open(ProdutoGrupoEditDialogComponent, {
|
|
3114
|
+
data: item,
|
|
3115
|
+
width: width,
|
|
3116
|
+
//height: height,
|
|
3117
|
+
maxWidth: '100%',
|
|
3118
|
+
panelClass: 'dialog-p0',
|
|
3119
|
+
});
|
|
3120
|
+
dialog.afterClosed().subscribe(result => {
|
|
3121
|
+
if (result !== true)
|
|
3122
|
+
return;
|
|
3123
|
+
this.notification.showMsg("Salvo com sucesso.");
|
|
3124
|
+
this.atualiza();
|
|
3125
|
+
});
|
|
3126
|
+
}
|
|
3127
|
+
salvar() {
|
|
3128
|
+
const item = this.selectedItem;
|
|
3129
|
+
if (!item)
|
|
3130
|
+
return;
|
|
3131
|
+
const valMsg = validaProdutoGrupo(item, this.focus);
|
|
3132
|
+
if (valMsg) {
|
|
3133
|
+
this.notification.showMsgError(valMsg);
|
|
3134
|
+
return;
|
|
3135
|
+
}
|
|
3136
|
+
this.isBusy = true;
|
|
3137
|
+
this.ws.saveProdutoGrupo(item)
|
|
3138
|
+
.subscribe(r => {
|
|
3139
|
+
this.notification.showMsg("Salvo com sucesso.");
|
|
3140
|
+
this.isBusy = false;
|
|
3141
|
+
}, err => {
|
|
3142
|
+
this.isBusy = false;
|
|
3143
|
+
this.notification.showMsg(err.error);
|
|
3144
|
+
});
|
|
3145
|
+
}
|
|
3146
|
+
moverGrupo() {
|
|
3147
|
+
let height = (window.innerHeight * 0.90) + 'px';
|
|
3148
|
+
let width = 550 + 'px';
|
|
3149
|
+
if (this.mobile) {
|
|
3150
|
+
width = (window.innerWidth * 0.99) + 'px';
|
|
3151
|
+
//height = (window.innerHeight * 0.98) + 'px';
|
|
3152
|
+
}
|
|
3153
|
+
const dialog = this.dialog.open(MoverGrupoDialogComponent, {
|
|
3154
|
+
width: width,
|
|
3155
|
+
data: this.selectedItem,
|
|
3156
|
+
//height: height,
|
|
3157
|
+
maxWidth: '100%',
|
|
3158
|
+
panelClass: 'dialog-p0',
|
|
3159
|
+
});
|
|
3160
|
+
dialog.afterClosed().subscribe(result => {
|
|
3161
|
+
if (result === undefined)
|
|
3162
|
+
return;
|
|
3163
|
+
this.notification.showMsg("Salvo com sucesso.");
|
|
3164
|
+
this.atualiza();
|
|
3165
|
+
});
|
|
23
3166
|
}
|
|
24
3167
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type:
|
|
3168
|
+
ProdutosGruposComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutosGruposComponent, deps: [{ token: CommonWebService }, { token: NotificationService }, { token: i3.MatDialog }, { token: AuthDataService }, { token: ScreenHelperService }], target: i0.ɵɵFactoryTarget.Component });
|
|
3169
|
+
ProdutosGruposComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: ProdutosGruposComponent, selector: "app-produtos-grupos", ngImport: i0, template: "<ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>\n<div class=\"tool-panel\" *ngIf=\"mobile\">\n <div class=\"tool-section\">\n <label>Pesquisa</label>\n <div class=\"search-input-container\">\n <input [(ngModel)]=\"setting.frase\" placeholder=\"Digite um termo de busca...\" (input)=\"lazyTrigger.fire()\">\n </div>\n </div>\n <div class=\"tool-section ordem-sm2\">\n <label>A\u00E7\u00F5es</label>\n <div class=\"tool-row\">\n <button mat-icon-button (click)=\"atualiza()\">\n <mat-icon aria-label=\"Atualizar\">refresh</mat-icon>\n </button>\n <button mat-icon-button (click)=\"novo()\" *ngIf=\"allowAdd\">\n <mat-icon aria-label=\"Novo Grupo\">add</mat-icon>\n </button>\n <button mat-icon-button (click)=\"excluir()\" *ngIf=\"selectedItem && allowExcluir\" [@fade]>\n <mat-icon aria-label=\"Excluir Grupo\">delete</mat-icon>\n </button>\n <button mat-icon-button (click)=\"moverGrupo()\" *ngIf=\"selectedItem\" [@fade]>\n <mat-icon aria-label=\"Transferir Grupo\">sync_alt</mat-icon>\n </button>\n </div>\n </div>\n</div>\n<div class=\"result-container\" *ngIf=\"items\">\n <div class=\"cards-container cards-container-shadow\" *ngIf=\"mobile\">\n <ox-item-card [cloud]=\"i.enviadoPC\" [nome]=\"i.nome\" *ngFor=\"let i of items\" (click)=\"abreCadastro(i)\"></ox-item-card>\n </div>\n <div class=\"listagem-desktop-grid\" *ngIf=\"!mobile\">\n <div class=\"listagem-column-container listagem-list-column\">\n <h3>Grupos de Produtos</h3>\n <div class=\"tool-panel tool-panel-float\">\n <div class=\"tool-section\">\n <label>Pesquisa</label>\n <div class=\"search-input-container\">\n <input [(ngModel)]=\"setting.frase\" placeholder=\"Digite um termo de busca...\" (input)=\"lazyTrigger.fire()\">\n </div>\n </div>\n <div class=\"tool-section ordem-sm2\">\n <label>A\u00E7\u00F5es</label>\n <div class=\"tool-row\">\n <button mat-icon-button (click)=\"atualiza()\">\n <mat-icon aria-label=\"Atualizar\">refresh</mat-icon>\n </button>\n <button mat-icon-button (click)=\"novo()\" *ngIf=\"allowAdd\">\n <mat-icon aria-label=\"Novo\">add</mat-icon>\n </button>\n <button mat-icon-button (click)=\"excluir()\" *ngIf=\"selectedItem && allowExcluir\" [@fade]>\n <mat-icon aria-label=\"Excluir\">delete</mat-icon>\n </button>\n <button mat-icon-button (click)=\"moverGrupo()\" *ngIf=\"selectedItem\" [@fade]>\n <mat-icon aria-label=\"Transferir Grupo\">move_up</mat-icon>\n </button>\n </div>\n </div>\n </div>\n <div class=\"listagem-list-container\">\n <h4 *ngIf=\"items.length === 0\" class=\"nenhum-item-msg\">A busca n\u00E3o retornou resultados</h4>\n\n <ox-item-card [cloud]=\"i.enviadoPC\" [nome]=\"i.nome\" *ngFor=\"let i of items\" [class.selected]=\"i === selectedItem\"\n (click)=\"selectedItem = i;\"></ox-item-card>\n\n </div>\n </div>\n <div class=\"listagem-column-container listagem-column-form\">\n <h3 *ngIf=\"!selectedItem\">Selecione um grupo no lado direito</h3>\n <h3 *ngIf=\"selectedItem\">{{selectedItem.nome | uppercase}}</h3>\n <div class=\"listagem-form-container\">\n <app-produto-grupo-form [@fade] [model]=\"selectedItem\" *ngIf=\"selectedItem\">\n </app-produto-grupo-form>\n </div>\n\n <div class=\"listagem-form-acoes\">\n <button (click)=\"salvar()\" mat-fab color=\"primary\" *ngIf=\"selectedItem\" tabindex=\"20\">\n <mat-icon>save</mat-icon>\n </button>\n </div>\n </div>\n </div>\n</div>", styles: [":host{height:calc(100% - 48px);display:flex;flex-grow:1;flex-direction:column;background:#F0F0F0}:host{background-color:#fdfdfd}\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: "directive", type: i7.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i6$1.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: "component", type: BusyIndicatorComponent, selector: "ox-busy-indicator", inputs: ["isBusy"] }, { kind: "component", type: ItemCardComponent, selector: "ox-item-card", inputs: ["nome", "codigo", "star", "cloud", "desativado"] }, { kind: "component", type: ProdutoGrupoFormComponent, selector: "app-produto-grupo-form", inputs: ["model"] }, { kind: "pipe", type: i6.UpperCasePipe, name: "uppercase" }], animations: [fadeAnimation] });
|
|
3170
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutosGruposComponent, decorators: [{
|
|
28
3171
|
type: Component,
|
|
29
|
-
args: [{ selector: '
|
|
30
|
-
}], ctorParameters: function () { return [
|
|
31
|
-
type: Input
|
|
32
|
-
}] } });
|
|
3172
|
+
args: [{ selector: 'app-produtos-grupos', animations: [fadeAnimation], template: "<ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>\n<div class=\"tool-panel\" *ngIf=\"mobile\">\n <div class=\"tool-section\">\n <label>Pesquisa</label>\n <div class=\"search-input-container\">\n <input [(ngModel)]=\"setting.frase\" placeholder=\"Digite um termo de busca...\" (input)=\"lazyTrigger.fire()\">\n </div>\n </div>\n <div class=\"tool-section ordem-sm2\">\n <label>A\u00E7\u00F5es</label>\n <div class=\"tool-row\">\n <button mat-icon-button (click)=\"atualiza()\">\n <mat-icon aria-label=\"Atualizar\">refresh</mat-icon>\n </button>\n <button mat-icon-button (click)=\"novo()\" *ngIf=\"allowAdd\">\n <mat-icon aria-label=\"Novo Grupo\">add</mat-icon>\n </button>\n <button mat-icon-button (click)=\"excluir()\" *ngIf=\"selectedItem && allowExcluir\" [@fade]>\n <mat-icon aria-label=\"Excluir Grupo\">delete</mat-icon>\n </button>\n <button mat-icon-button (click)=\"moverGrupo()\" *ngIf=\"selectedItem\" [@fade]>\n <mat-icon aria-label=\"Transferir Grupo\">sync_alt</mat-icon>\n </button>\n </div>\n </div>\n</div>\n<div class=\"result-container\" *ngIf=\"items\">\n <div class=\"cards-container cards-container-shadow\" *ngIf=\"mobile\">\n <ox-item-card [cloud]=\"i.enviadoPC\" [nome]=\"i.nome\" *ngFor=\"let i of items\" (click)=\"abreCadastro(i)\"></ox-item-card>\n </div>\n <div class=\"listagem-desktop-grid\" *ngIf=\"!mobile\">\n <div class=\"listagem-column-container listagem-list-column\">\n <h3>Grupos de Produtos</h3>\n <div class=\"tool-panel tool-panel-float\">\n <div class=\"tool-section\">\n <label>Pesquisa</label>\n <div class=\"search-input-container\">\n <input [(ngModel)]=\"setting.frase\" placeholder=\"Digite um termo de busca...\" (input)=\"lazyTrigger.fire()\">\n </div>\n </div>\n <div class=\"tool-section ordem-sm2\">\n <label>A\u00E7\u00F5es</label>\n <div class=\"tool-row\">\n <button mat-icon-button (click)=\"atualiza()\">\n <mat-icon aria-label=\"Atualizar\">refresh</mat-icon>\n </button>\n <button mat-icon-button (click)=\"novo()\" *ngIf=\"allowAdd\">\n <mat-icon aria-label=\"Novo\">add</mat-icon>\n </button>\n <button mat-icon-button (click)=\"excluir()\" *ngIf=\"selectedItem && allowExcluir\" [@fade]>\n <mat-icon aria-label=\"Excluir\">delete</mat-icon>\n </button>\n <button mat-icon-button (click)=\"moverGrupo()\" *ngIf=\"selectedItem\" [@fade]>\n <mat-icon aria-label=\"Transferir Grupo\">move_up</mat-icon>\n </button>\n </div>\n </div>\n </div>\n <div class=\"listagem-list-container\">\n <h4 *ngIf=\"items.length === 0\" class=\"nenhum-item-msg\">A busca n\u00E3o retornou resultados</h4>\n\n <ox-item-card [cloud]=\"i.enviadoPC\" [nome]=\"i.nome\" *ngFor=\"let i of items\" [class.selected]=\"i === selectedItem\"\n (click)=\"selectedItem = i;\"></ox-item-card>\n\n </div>\n </div>\n <div class=\"listagem-column-container listagem-column-form\">\n <h3 *ngIf=\"!selectedItem\">Selecione um grupo no lado direito</h3>\n <h3 *ngIf=\"selectedItem\">{{selectedItem.nome | uppercase}}</h3>\n <div class=\"listagem-form-container\">\n <app-produto-grupo-form [@fade] [model]=\"selectedItem\" *ngIf=\"selectedItem\">\n </app-produto-grupo-form>\n </div>\n\n <div class=\"listagem-form-acoes\">\n <button (click)=\"salvar()\" mat-fab color=\"primary\" *ngIf=\"selectedItem\" tabindex=\"20\">\n <mat-icon>save</mat-icon>\n </button>\n </div>\n </div>\n </div>\n</div>", styles: [":host{height:calc(100% - 48px);display:flex;flex-grow:1;flex-direction:column;background:#F0F0F0}:host{background-color:#fdfdfd}\n"] }]
|
|
3173
|
+
}], ctorParameters: function () { return [{ type: CommonWebService }, { type: NotificationService }, { type: i3.MatDialog }, { type: AuthDataService }, { type: ScreenHelperService }]; } });
|
|
33
3174
|
|
|
34
|
-
class
|
|
35
|
-
constructor() {
|
|
36
|
-
this.
|
|
37
|
-
this.
|
|
38
|
-
this.
|
|
39
|
-
this.
|
|
3175
|
+
class ProdutosSubgruposComponent {
|
|
3176
|
+
constructor(ws, notification, dialog, auth, screenHelper) {
|
|
3177
|
+
this.ws = ws;
|
|
3178
|
+
this.notification = notification;
|
|
3179
|
+
this.dialog = dialog;
|
|
3180
|
+
this.screenHelper = screenHelper;
|
|
3181
|
+
this.isBusy = false;
|
|
3182
|
+
this.items = [];
|
|
3183
|
+
this.selectedItem = null;
|
|
3184
|
+
this.lazyTrigger = new LazyTrigger(() => { this.atualiza(); });
|
|
3185
|
+
this.setting = new SearchSetting();
|
|
3186
|
+
this.focus = new FocusService();
|
|
3187
|
+
this.allowAdd = auth.permissoes.adminProdutoGrupoAdd;
|
|
3188
|
+
this.allowExcluir = auth.permissoes.adminProdutoGrupoDelete;
|
|
3189
|
+
this.mobile = this.screenHelper.isMedium;
|
|
3190
|
+
this.screenHelper.changedMediumScreen.subscribe(x => this.mobile = x);
|
|
40
3191
|
}
|
|
41
3192
|
ngOnInit() {
|
|
3193
|
+
this.setting.ordem = "nome";
|
|
3194
|
+
this.atualiza();
|
|
3195
|
+
}
|
|
3196
|
+
onSelectItem() {
|
|
3197
|
+
if (!this.focus.hasInit()) {
|
|
3198
|
+
setTimeout(() => {
|
|
3199
|
+
this.focus.registerElementById("form-column");
|
|
3200
|
+
this.focus.setFirst();
|
|
3201
|
+
}, 500);
|
|
3202
|
+
//this._focus.registerElementById("form-column");
|
|
3203
|
+
}
|
|
3204
|
+
else {
|
|
3205
|
+
this.focus.setFirst();
|
|
3206
|
+
}
|
|
42
3207
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
3208
|
+
ngOnDestroy() {
|
|
3209
|
+
this.focus.unregisterElementById("form-column");
|
|
3210
|
+
}
|
|
3211
|
+
atualiza() {
|
|
3212
|
+
this.isBusy = true;
|
|
3213
|
+
this.ws.buscaProdutoSubgrupo(this.setting)
|
|
3214
|
+
.subscribe(r => {
|
|
3215
|
+
this.items = r;
|
|
3216
|
+
this.selectedItem = null;
|
|
3217
|
+
console.info(r);
|
|
3218
|
+
this.isBusy = false;
|
|
3219
|
+
}, err => {
|
|
3220
|
+
this.isBusy = false;
|
|
3221
|
+
this.notification.showHttpError(err);
|
|
3222
|
+
});
|
|
3223
|
+
}
|
|
3224
|
+
excluir() {
|
|
3225
|
+
const item = this.selectedItem;
|
|
3226
|
+
if (!item)
|
|
3227
|
+
return;
|
|
3228
|
+
confirmaExclusao(this.dialog, `Deseja prosseguir com a exclusão do subgrupo ${item.nome}?`, () => {
|
|
3229
|
+
this.isBusy = true;
|
|
3230
|
+
this.ws.deleteProdutoSubgrupo(item.id)
|
|
3231
|
+
.subscribe(r => {
|
|
3232
|
+
this.notification.showMsg("O subgrupo foi excluído com sucesso.");
|
|
3233
|
+
this.items.remove(item);
|
|
3234
|
+
this.selectedItem = null;
|
|
3235
|
+
this.isBusy = false;
|
|
3236
|
+
}, err => {
|
|
3237
|
+
this.isBusy = false;
|
|
3238
|
+
this.notification.showMsg(err.error);
|
|
3239
|
+
});
|
|
3240
|
+
});
|
|
3241
|
+
}
|
|
3242
|
+
novo() {
|
|
3243
|
+
let height = (window.innerHeight * 0.90) + 'px';
|
|
3244
|
+
let width = 550 + 'px';
|
|
3245
|
+
if (this.mobile) {
|
|
3246
|
+
width = (window.innerWidth * 0.99) + 'px';
|
|
3247
|
+
//height = (window.innerHeight * 0.98) + 'px';
|
|
3248
|
+
}
|
|
3249
|
+
const dialog = this.dialog.open(ProdutoSubgrupoAddDialogComponent, {
|
|
3250
|
+
width: width,
|
|
3251
|
+
//height: height,
|
|
3252
|
+
maxWidth: '100%',
|
|
3253
|
+
panelClass: 'dialog-p0',
|
|
3254
|
+
});
|
|
3255
|
+
dialog.afterClosed().subscribe(result => {
|
|
3256
|
+
if (result === undefined)
|
|
3257
|
+
return;
|
|
3258
|
+
this.notification.showMsg("Salvo com sucesso.");
|
|
3259
|
+
this.atualiza();
|
|
3260
|
+
});
|
|
3261
|
+
}
|
|
3262
|
+
abreCadastro(item) {
|
|
3263
|
+
let height = undefined;
|
|
3264
|
+
let width = 550 + 'px';
|
|
3265
|
+
if (this.mobile) {
|
|
3266
|
+
width = (window.innerWidth * 0.99) + 'px';
|
|
3267
|
+
height = (window.innerHeight * 0.99) + 'px';
|
|
3268
|
+
}
|
|
3269
|
+
const dialog = this.dialog.open(ProdutoSubgrupoEditDialogComponent, {
|
|
3270
|
+
data: item,
|
|
3271
|
+
width: width,
|
|
3272
|
+
//height: height,
|
|
3273
|
+
maxWidth: '100%',
|
|
3274
|
+
panelClass: 'dialog-p0',
|
|
3275
|
+
});
|
|
3276
|
+
dialog.afterClosed().subscribe(result => {
|
|
3277
|
+
if (result !== true)
|
|
3278
|
+
return;
|
|
3279
|
+
this.notification.showMsg("Salvo com sucesso.");
|
|
3280
|
+
this.atualiza();
|
|
3281
|
+
});
|
|
3282
|
+
}
|
|
3283
|
+
salvar() {
|
|
3284
|
+
if (!this.selectedItem)
|
|
3285
|
+
return;
|
|
3286
|
+
const valMsg = validaProdutoGrupo(this.selectedItem, this.focus);
|
|
3287
|
+
if (valMsg) {
|
|
3288
|
+
this.notification.showMsgError(valMsg);
|
|
3289
|
+
return;
|
|
3290
|
+
}
|
|
3291
|
+
this.isBusy = true;
|
|
3292
|
+
this.ws.saveProdutoSubgrupo(this.selectedItem)
|
|
3293
|
+
.subscribe(r => {
|
|
3294
|
+
this.notification.showMsg("Salvo com sucesso.");
|
|
3295
|
+
this.isBusy = false;
|
|
3296
|
+
}, err => {
|
|
3297
|
+
this.isBusy = false;
|
|
3298
|
+
this.notification.showMsg(err.error);
|
|
3299
|
+
});
|
|
47
3300
|
}
|
|
48
3301
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type:
|
|
3302
|
+
ProdutosSubgruposComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutosSubgruposComponent, deps: [{ token: CommonWebService }, { token: NotificationService }, { token: i3.MatDialog }, { token: AuthDataService }, { token: ScreenHelperService }], target: i0.ɵɵFactoryTarget.Component });
|
|
3303
|
+
ProdutosSubgruposComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: ProdutosSubgruposComponent, selector: "app-produtos-subgrupos", ngImport: i0, template: "<ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>\n<div class=\"tool-panel\" *ngIf=\"mobile\">\n <div class=\"tool-section\">\n <label>Pesquisa</label>\n <div class=\"search-input-container\">\n <input [(ngModel)]=\"setting.frase\" placeholder=\"Digite um termo de busca...\" (input)=\"lazyTrigger.fire()\">\n </div>\n </div>\n <div class=\"tool-section ordem-sm2\">\n <label>A\u00E7\u00F5es</label>\n <div class=\"tool-row\">\n <button mat-icon-button (click)=\"atualiza()\">\n <mat-icon aria-label=\"Atualizar\">refresh</mat-icon>\n </button>\n <button mat-icon-button (click)=\"novo()\" *ngIf=\"allowAdd\">\n <mat-icon aria-label=\"Novo Subgrupo\">add</mat-icon>\n </button>\n <button mat-icon-button (click)=\"excluir()\" *ngIf=\"selectedItem && allowExcluir\" [@fade]>\n <mat-icon aria-label=\"Excluir Subgrupo\">delete</mat-icon>\n </button>\n </div>\n </div>\n</div>\n<div class=\"result-container\" *ngIf=\"items\">\n <div class=\"cards-container cards-container-shadow\" *ngIf=\"mobile\">\n <ox-item-card [cloud]=\"i.enviadoPC\" [nome]=\"i.nome\" *ngFor=\"let i of items\" (click)=\"abreCadastro(i)\"></ox-item-card>\n </div>\n <div class=\"listagem-desktop-grid\" *ngIf=\"!mobile\">\n <div class=\"listagem-column-container listagem-list-column\">\n <h3>Subgrupos de Produtos</h3>\n <div class=\"tool-panel tool-panel-float\">\n <div class=\"tool-section\">\n <label>Pesquisa</label>\n <div class=\"search-input-container\">\n <input [(ngModel)]=\"setting.frase\" placeholder=\"Digite um termo de busca...\" (input)=\"lazyTrigger.fire()\">\n </div>\n </div>\n <div class=\"tool-section ordem-sm2\">\n <label>A\u00E7\u00F5es</label>\n <div class=\"tool-row\">\n <button mat-icon-button (click)=\"atualiza()\">\n <mat-icon aria-label=\"Atualizar\">refresh</mat-icon>\n </button>\n <button mat-icon-button (click)=\"novo()\" *ngIf=\"allowAdd\">\n <mat-icon aria-label=\"Novo\">add</mat-icon>\n </button>\n <button mat-icon-button (click)=\"excluir()\" *ngIf=\"selectedItem && allowExcluir\" [@fade]>\n <mat-icon aria-label=\"Excluir\">delete</mat-icon>\n </button>\n </div>\n </div>\n </div>\n <div class=\"listagem-list-container\">\n <h4 *ngIf=\"items.length === 0\" class=\"nenhum-item-msg\">A busca n\u00E3o retornou resultados</h4>\n\n <ox-item-card [cloud]=\"i.enviadoPC\" [nome]=\"i.nome\" *ngFor=\"let i of items\" [class.selected]=\"i === selectedItem\"\n (click)=\"selectedItem = i;\"></ox-item-card>\n\n </div>\n </div>\n <div class=\"listagem-column-container listagem-column-form\">\n <h3 *ngIf=\"!selectedItem\">Selecione um subgrupo no lado direito</h3>\n <h3 *ngIf=\"selectedItem\">{{selectedItem.nome | uppercase}}</h3>\n <div class=\"listagem-form-container\">\n <app-produto-grupo-form [@fade] [model]=\"selectedItem\" *ngIf=\"selectedItem\">\n </app-produto-grupo-form>\n </div>\n\n <div class=\"listagem-form-acoes\">\n <button (click)=\"salvar()\" mat-fab color=\"primary\" *ngIf=\"selectedItem\" tabindex=\"20\">\n <mat-icon>save</mat-icon>\n </button>\n </div>\n </div>\n </div>\n</div>", styles: [":host{height:calc(100% - 48px);display:flex;flex-grow:1;flex-direction:column;background:#F0F0F0}:host{background-color:#fdfdfd}\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: "directive", type: i7.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i6$1.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: "component", type: BusyIndicatorComponent, selector: "ox-busy-indicator", inputs: ["isBusy"] }, { kind: "component", type: ItemCardComponent, selector: "ox-item-card", inputs: ["nome", "codigo", "star", "cloud", "desativado"] }, { kind: "component", type: ProdutoGrupoFormComponent, selector: "app-produto-grupo-form", inputs: ["model"] }, { kind: "pipe", type: i6.UpperCasePipe, name: "uppercase" }], animations: [fadeAnimation] });
|
|
3304
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ProdutosSubgruposComponent, decorators: [{
|
|
52
3305
|
type: Component,
|
|
53
|
-
args: [{ selector: 'ox-
|
|
54
|
-
|
|
55
|
-
}, template: "<ng-content></ng-content>", styles: [":host{padding:4px 8px;cursor:pointer;white-space:nowrap;color:#666;font-size:small;text-transform:uppercase;background-color:#ececec}:host:hover{background:rgba(0,0,0,.1)}:host(.checked){background:var(--app-tool-accent-color, black);color:#fff;box-shadow:0 8px 16px #0000001a}\n"] }]
|
|
56
|
-
}], ctorParameters: function () { return []; }, propDecorators: { checked: [{
|
|
57
|
-
type: Input
|
|
58
|
-
}], radioBehavior: [{
|
|
59
|
-
type: Input
|
|
60
|
-
}], changed: [{
|
|
61
|
-
type: Output
|
|
62
|
-
}], onClick: [{
|
|
63
|
-
type: HostListener,
|
|
64
|
-
args: ['click', ['$event']]
|
|
65
|
-
}] } });
|
|
3306
|
+
args: [{ selector: 'app-produtos-subgrupos', animations: [fadeAnimation], template: "<ox-busy-indicator [isBusy]=\"isBusy\"></ox-busy-indicator>\n<div class=\"tool-panel\" *ngIf=\"mobile\">\n <div class=\"tool-section\">\n <label>Pesquisa</label>\n <div class=\"search-input-container\">\n <input [(ngModel)]=\"setting.frase\" placeholder=\"Digite um termo de busca...\" (input)=\"lazyTrigger.fire()\">\n </div>\n </div>\n <div class=\"tool-section ordem-sm2\">\n <label>A\u00E7\u00F5es</label>\n <div class=\"tool-row\">\n <button mat-icon-button (click)=\"atualiza()\">\n <mat-icon aria-label=\"Atualizar\">refresh</mat-icon>\n </button>\n <button mat-icon-button (click)=\"novo()\" *ngIf=\"allowAdd\">\n <mat-icon aria-label=\"Novo Subgrupo\">add</mat-icon>\n </button>\n <button mat-icon-button (click)=\"excluir()\" *ngIf=\"selectedItem && allowExcluir\" [@fade]>\n <mat-icon aria-label=\"Excluir Subgrupo\">delete</mat-icon>\n </button>\n </div>\n </div>\n</div>\n<div class=\"result-container\" *ngIf=\"items\">\n <div class=\"cards-container cards-container-shadow\" *ngIf=\"mobile\">\n <ox-item-card [cloud]=\"i.enviadoPC\" [nome]=\"i.nome\" *ngFor=\"let i of items\" (click)=\"abreCadastro(i)\"></ox-item-card>\n </div>\n <div class=\"listagem-desktop-grid\" *ngIf=\"!mobile\">\n <div class=\"listagem-column-container listagem-list-column\">\n <h3>Subgrupos de Produtos</h3>\n <div class=\"tool-panel tool-panel-float\">\n <div class=\"tool-section\">\n <label>Pesquisa</label>\n <div class=\"search-input-container\">\n <input [(ngModel)]=\"setting.frase\" placeholder=\"Digite um termo de busca...\" (input)=\"lazyTrigger.fire()\">\n </div>\n </div>\n <div class=\"tool-section ordem-sm2\">\n <label>A\u00E7\u00F5es</label>\n <div class=\"tool-row\">\n <button mat-icon-button (click)=\"atualiza()\">\n <mat-icon aria-label=\"Atualizar\">refresh</mat-icon>\n </button>\n <button mat-icon-button (click)=\"novo()\" *ngIf=\"allowAdd\">\n <mat-icon aria-label=\"Novo\">add</mat-icon>\n </button>\n <button mat-icon-button (click)=\"excluir()\" *ngIf=\"selectedItem && allowExcluir\" [@fade]>\n <mat-icon aria-label=\"Excluir\">delete</mat-icon>\n </button>\n </div>\n </div>\n </div>\n <div class=\"listagem-list-container\">\n <h4 *ngIf=\"items.length === 0\" class=\"nenhum-item-msg\">A busca n\u00E3o retornou resultados</h4>\n\n <ox-item-card [cloud]=\"i.enviadoPC\" [nome]=\"i.nome\" *ngFor=\"let i of items\" [class.selected]=\"i === selectedItem\"\n (click)=\"selectedItem = i;\"></ox-item-card>\n\n </div>\n </div>\n <div class=\"listagem-column-container listagem-column-form\">\n <h3 *ngIf=\"!selectedItem\">Selecione um subgrupo no lado direito</h3>\n <h3 *ngIf=\"selectedItem\">{{selectedItem.nome | uppercase}}</h3>\n <div class=\"listagem-form-container\">\n <app-produto-grupo-form [@fade] [model]=\"selectedItem\" *ngIf=\"selectedItem\">\n </app-produto-grupo-form>\n </div>\n\n <div class=\"listagem-form-acoes\">\n <button (click)=\"salvar()\" mat-fab color=\"primary\" *ngIf=\"selectedItem\" tabindex=\"20\">\n <mat-icon>save</mat-icon>\n </button>\n </div>\n </div>\n </div>\n</div>", styles: [":host{height:calc(100% - 48px);display:flex;flex-grow:1;flex-direction:column;background:#F0F0F0}:host{background-color:#fdfdfd}\n"] }]
|
|
3307
|
+
}], ctorParameters: function () { return [{ type: CommonWebService }, { type: NotificationService }, { type: i3.MatDialog }, { type: AuthDataService }, { type: ScreenHelperService }]; } });
|
|
66
3308
|
|
|
67
3309
|
class ImageViewerComponent {
|
|
68
3310
|
constructor() {
|
|
@@ -115,7 +3357,7 @@ class ImageViewerComponent {
|
|
|
115
3357
|
}
|
|
116
3358
|
}
|
|
117
3359
|
ImageViewerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ImageViewerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
118
|
-
ImageViewerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: ImageViewerComponent, selector: "ox-image-viewer", inputs: { info: "info", infos: "infos", isOpen: "isOpen" }, outputs: { isOpenChange: "isOpenChange" }, host: { listeners: { "click": "onClick($event)" } }, ngImport: i0, template: "<div class=\"image-fullsize\" *ngIf=\"isOpen\">\n <div class=\"titulo\">\n {{info?.titulo}}\n </div>\n <div class=\"img-container\" (click)=\"isOpen = !isOpen\">\n <img class=\"image\" *ngIf=\"info\" [src]=\"info?.url\" />\n </div>\n <div class=\"action-bar\" *ngIf=\"infos\">\n <button (click)=\"goBack()\" [disabled]=\"disableBack\" mat-icon-button>\n <mat-icon>chevron_left</mat-icon>\n </button>\n <span class=\"picker-text\">\n {{paginaAtual}}/{{infos?.length}}\n </span>\n <button (click)=\"goNext()\" [disabled]=\"disableNext\" mat-icon-button>\n <mat-icon>chevron_right</mat-icon>\n </button>\n </div>\n</div>\n", styles: [".image-fullsize{position:absolute;left:0;top:0;background:rgba(0,0,0,.8);width:100%;height:100%;display:flex;flex-flow:column}.titulo{color:#fff;text-align:center;padding:16px;font-size:large;font-weight:300}.action-bar{background:linear-gradient(135deg,rgba(0,0,0,.8) 0%,rgba(0,0,0,.9) 50%,rgba(0,0,0,.8) 100%);color:#fff;padding:8px}.img-container{flex-grow:1;display:flex;justify-content:center;align-items:center}.image{box-shadow:0 5px 35px #000000a6;max-width:100%;height:auto}\n"], dependencies: [{ kind: "directive", type:
|
|
3360
|
+
ImageViewerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: ImageViewerComponent, selector: "ox-image-viewer", inputs: { info: "info", infos: "infos", isOpen: "isOpen" }, outputs: { isOpenChange: "isOpenChange" }, host: { listeners: { "click": "onClick($event)" } }, ngImport: i0, template: "<div class=\"image-fullsize\" *ngIf=\"isOpen\">\n <div class=\"titulo\">\n {{info?.titulo}}\n </div>\n <div class=\"img-container\" (click)=\"isOpen = !isOpen\">\n <img class=\"image\" *ngIf=\"info\" [src]=\"info?.url\" />\n </div>\n <div class=\"action-bar\" *ngIf=\"infos\">\n <button (click)=\"goBack()\" [disabled]=\"disableBack\" mat-icon-button>\n <mat-icon>chevron_left</mat-icon>\n </button>\n <span class=\"picker-text\">\n {{paginaAtual}}/{{infos?.length}}\n </span>\n <button (click)=\"goNext()\" [disabled]=\"disableNext\" mat-icon-button>\n <mat-icon>chevron_right</mat-icon>\n </button>\n </div>\n</div>\n", styles: [".image-fullsize{position:absolute;left:0;top:0;background:rgba(0,0,0,.8);width:100%;height:100%;display:flex;flex-flow:column}.titulo{color:#fff;text-align:center;padding:16px;font-size:large;font-weight:300}.action-bar{background:linear-gradient(135deg,rgba(0,0,0,.8) 0%,rgba(0,0,0,.9) 50%,rgba(0,0,0,.8) 100%);color:#fff;padding:8px}.img-container{flex-grow:1;display:flex;justify-content:center;align-items:center}.image{box-shadow:0 5px 35px #000000a6;max-width:100%;height:auto}\n"], dependencies: [{ kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i6$1.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"] }] });
|
|
119
3361
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ImageViewerComponent, decorators: [{
|
|
120
3362
|
type: Component,
|
|
121
3363
|
args: [{ selector: 'ox-image-viewer', template: "<div class=\"image-fullsize\" *ngIf=\"isOpen\">\n <div class=\"titulo\">\n {{info?.titulo}}\n </div>\n <div class=\"img-container\" (click)=\"isOpen = !isOpen\">\n <img class=\"image\" *ngIf=\"info\" [src]=\"info?.url\" />\n </div>\n <div class=\"action-bar\" *ngIf=\"infos\">\n <button (click)=\"goBack()\" [disabled]=\"disableBack\" mat-icon-button>\n <mat-icon>chevron_left</mat-icon>\n </button>\n <span class=\"picker-text\">\n {{paginaAtual}}/{{infos?.length}}\n </span>\n <button (click)=\"goNext()\" [disabled]=\"disableNext\" mat-icon-button>\n <mat-icon>chevron_right</mat-icon>\n </button>\n </div>\n</div>\n", styles: [".image-fullsize{position:absolute;left:0;top:0;background:rgba(0,0,0,.8);width:100%;height:100%;display:flex;flex-flow:column}.titulo{color:#fff;text-align:center;padding:16px;font-size:large;font-weight:300}.action-bar{background:linear-gradient(135deg,rgba(0,0,0,.8) 0%,rgba(0,0,0,.9) 50%,rgba(0,0,0,.8) 100%);color:#fff;padding:8px}.img-container{flex-grow:1;display:flex;justify-content:center;align-items:center}.image{box-shadow:0 5px 35px #000000a6;max-width:100%;height:auto}\n"] }]
|
|
@@ -233,7 +3475,7 @@ class MonthYearPickerComponent {
|
|
|
233
3475
|
}
|
|
234
3476
|
}
|
|
235
3477
|
MonthYearPickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: MonthYearPickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
236
|
-
MonthYearPickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: MonthYearPickerComponent, selector: "ox-month-year-picker", inputs: { blockFuture: "blockFuture", modoAnual: "modoAnual", ano: "ano", mes: "mes" }, outputs: { anoChange: "anoChange", mesChange: "mesChange", changed: "changed" }, ngImport: i0, template: "<div class=\"picker-container\">\n <div>\n <button mat-icon-button (click)=\"goBack()\">\n <mat-icon>chevron_left</mat-icon>\n </button>\n </div>\n <span class=\"picker-text\">\n {{text}}\n </span>\n <div>\n <button mat-icon-button (click)=\"goNext()\" [disabled]=\"disableNext\" >\n <mat-icon>chevron_right</mat-icon>\n </button>\n </div>\n</div>", styles: [".picker-container{display:flex;flex-direction:row;justify-content:center;align-items:center;background:transparent;min-width:250px}.picker-text{flex-flow:1;flex-grow:1;text-align:center;font-weight:700}\n"], dependencies: [{ kind: "component", type:
|
|
3478
|
+
MonthYearPickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: MonthYearPickerComponent, selector: "ox-month-year-picker", inputs: { blockFuture: "blockFuture", modoAnual: "modoAnual", ano: "ano", mes: "mes" }, outputs: { anoChange: "anoChange", mesChange: "mesChange", changed: "changed" }, ngImport: i0, template: "<div class=\"picker-container\">\n <div>\n <button mat-icon-button (click)=\"goBack()\">\n <mat-icon>chevron_left</mat-icon>\n </button>\n </div>\n <span class=\"picker-text\">\n {{text}}\n </span>\n <div>\n <button mat-icon-button (click)=\"goNext()\" [disabled]=\"disableNext\" >\n <mat-icon>chevron_right</mat-icon>\n </button>\n </div>\n</div>", styles: [".picker-container{display:flex;flex-direction:row;justify-content:center;align-items:center;background:transparent;min-width:250px}.picker-text{flex-flow:1;flex-grow:1;text-align:center;font-weight:700}\n"], dependencies: [{ kind: "component", type: i6$1.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"] }] });
|
|
237
3479
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: MonthYearPickerComponent, decorators: [{
|
|
238
3480
|
type: Component,
|
|
239
3481
|
args: [{ selector: 'ox-month-year-picker', template: "<div class=\"picker-container\">\n <div>\n <button mat-icon-button (click)=\"goBack()\">\n <mat-icon>chevron_left</mat-icon>\n </button>\n </div>\n <span class=\"picker-text\">\n {{text}}\n </span>\n <div>\n <button mat-icon-button (click)=\"goNext()\" [disabled]=\"disableNext\" >\n <mat-icon>chevron_right</mat-icon>\n </button>\n </div>\n</div>", styles: [".picker-container{display:flex;flex-direction:row;justify-content:center;align-items:center;background:transparent;min-width:250px}.picker-text{flex-flow:1;flex-grow:1;text-align:center;font-weight:700}\n"] }]
|
|
@@ -323,176 +3565,32 @@ class NumericPickerComponent {
|
|
|
323
3565
|
valida(val) {
|
|
324
3566
|
if (isNaN(val))
|
|
325
3567
|
return false;
|
|
326
|
-
if (this.max !== undefined && val > this.max)
|
|
327
|
-
return false;
|
|
328
|
-
if (this.min !== undefined && val < this.min)
|
|
329
|
-
return false;
|
|
330
|
-
return true;
|
|
331
|
-
}
|
|
332
|
-
raiseChange() {
|
|
333
|
-
this.change.emit(this.value);
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
NumericPickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: NumericPickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
337
|
-
NumericPickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: NumericPickerComponent, selector: "ox-numeric-picker", inputs: { value: "value", max: "max", min: "min" }, outputs: { valueChange: "valueChange", change: "change" }, ngImport: i0, template: "<div>\n <button mat-icon-button (click)=\"goBack()\" [disabled]=\"disableBack\">\n <mat-icon>chevron_left</mat-icon>\n </button>\n</div>\n<input [(ngModel)]=\"text\" (change)=\"onTextEdit($event)\" class=\"date\">\n<div>\n <button mat-icon-button (click)=\"goNext()\" [disabled]=\"disableNext\" >\n <mat-icon>chevron_right</mat-icon>\n </button>\n</div>", styles: [":host{display:flex;flex-direction:row;justify-content:center;align-items:center;background:transparent;min-width:60px}\n"], dependencies: [{ kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i2.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: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
|
|
338
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: NumericPickerComponent, decorators: [{
|
|
339
|
-
type: Component,
|
|
340
|
-
args: [{ selector: 'ox-numeric-picker', template: "<div>\n <button mat-icon-button (click)=\"goBack()\" [disabled]=\"disableBack\">\n <mat-icon>chevron_left</mat-icon>\n </button>\n</div>\n<input [(ngModel)]=\"text\" (change)=\"onTextEdit($event)\" class=\"date\">\n<div>\n <button mat-icon-button (click)=\"goNext()\" [disabled]=\"disableNext\" >\n <mat-icon>chevron_right</mat-icon>\n </button>\n</div>", styles: [":host{display:flex;flex-direction:row;justify-content:center;align-items:center;background:transparent;min-width:60px}\n"] }]
|
|
341
|
-
}], ctorParameters: function () { return []; }, propDecorators: { valueChange: [{
|
|
342
|
-
type: Output
|
|
343
|
-
}], change: [{
|
|
344
|
-
type: Output
|
|
345
|
-
}], value: [{
|
|
346
|
-
type: Input
|
|
347
|
-
}], max: [{
|
|
348
|
-
type: Input
|
|
349
|
-
}], min: [{
|
|
350
|
-
type: Input
|
|
351
|
-
}] } });
|
|
352
|
-
|
|
353
|
-
class PaginatorComponent {
|
|
354
|
-
constructor() {
|
|
355
|
-
this.paginaAtualChange = new EventEmitter();
|
|
356
|
-
this.totalPaginasChange = new EventEmitter();
|
|
357
|
-
this.change = new EventEmitter();
|
|
358
|
-
this._paginaAtual = 1;
|
|
359
|
-
this._totalPaginas = 1;
|
|
360
|
-
this.inicio = true;
|
|
361
|
-
this.fim = true;
|
|
362
|
-
this.pageSize = 0;
|
|
363
|
-
}
|
|
364
|
-
get paginaAtual() {
|
|
365
|
-
return this._paginaAtual;
|
|
366
|
-
}
|
|
367
|
-
set paginaAtual(val) {
|
|
368
|
-
this._paginaAtual = val;
|
|
369
|
-
this.paginaAtualChange.emit(val);
|
|
370
|
-
this.refreshUI();
|
|
371
|
-
}
|
|
372
|
-
get totalPaginas() {
|
|
373
|
-
return this._totalPaginas;
|
|
374
|
-
}
|
|
375
|
-
set totalPaginas(val) {
|
|
376
|
-
this._totalPaginas = val;
|
|
377
|
-
this.totalPaginasChange.emit(val);
|
|
378
|
-
this.refreshUI();
|
|
379
|
-
}
|
|
380
|
-
ngOnInit() {
|
|
381
|
-
}
|
|
382
|
-
trocaPagina(pagina) {
|
|
383
|
-
if (pagina > this.totalPaginas || pagina < 1)
|
|
384
|
-
return;
|
|
385
|
-
this.paginaAtual = pagina;
|
|
386
|
-
this.refreshUI();
|
|
387
|
-
this.change.emit(this.paginaAtual);
|
|
388
|
-
}
|
|
389
|
-
refreshUI() {
|
|
390
|
-
this.inicio = this.paginaAtual == 1;
|
|
391
|
-
this.fim = this.paginaAtual == this.totalPaginas;
|
|
392
|
-
}
|
|
393
|
-
goBack() {
|
|
394
|
-
this.trocaPagina(this.paginaAtual - 1);
|
|
395
|
-
}
|
|
396
|
-
goNext() {
|
|
397
|
-
this.trocaPagina(this.paginaAtual + 1);
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
PaginatorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: PaginatorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
401
|
-
PaginatorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: PaginatorComponent, selector: "ox-paginator", inputs: { pageSize: "pageSize", paginaAtual: "paginaAtual", totalPaginas: "totalPaginas" }, outputs: { paginaAtualChange: "paginaAtualChange", totalPaginasChange: "totalPaginasChange", change: "change" }, ngImport: i0, template: "<button [disabled]=\"inicio\" mat-icon-button (click)=\"goBack()\">\n <mat-icon>chevron_left</mat-icon>\n</button>\n<span class=\"picker-text\">\n {{paginaAtual}}/{{totalPaginas}}\n</span>\n<button [disabled]=\"fim\" mat-icon-button (click)=\"goNext()\">\n <mat-icon>chevron_right</mat-icon>\n</button>\n", styles: [":host{display:flex;flex-direction:row;justify-content:center;align-items:center;background:transparent;flex-wrap:nowrap}.picker-text{flex-flow:1;flex-grow:1;text-align:center}\n"], dependencies: [{ kind: "component", type: i2.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: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
|
|
402
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: PaginatorComponent, decorators: [{
|
|
403
|
-
type: Component,
|
|
404
|
-
args: [{ selector: 'ox-paginator', template: "<button [disabled]=\"inicio\" mat-icon-button (click)=\"goBack()\">\n <mat-icon>chevron_left</mat-icon>\n</button>\n<span class=\"picker-text\">\n {{paginaAtual}}/{{totalPaginas}}\n</span>\n<button [disabled]=\"fim\" mat-icon-button (click)=\"goNext()\">\n <mat-icon>chevron_right</mat-icon>\n</button>\n", styles: [":host{display:flex;flex-direction:row;justify-content:center;align-items:center;background:transparent;flex-wrap:nowrap}.picker-text{flex-flow:1;flex-grow:1;text-align:center}\n"] }]
|
|
405
|
-
}], ctorParameters: function () { return []; }, propDecorators: { paginaAtualChange: [{
|
|
406
|
-
type: Output
|
|
407
|
-
}], totalPaginasChange: [{
|
|
408
|
-
type: Output
|
|
409
|
-
}], change: [{
|
|
410
|
-
type: Output
|
|
411
|
-
}], pageSize: [{
|
|
412
|
-
type: Input
|
|
413
|
-
}], paginaAtual: [{
|
|
414
|
-
type: Input
|
|
415
|
-
}], totalPaginas: [{
|
|
416
|
-
type: Input
|
|
417
|
-
}] } });
|
|
418
|
-
|
|
419
|
-
class RadioButtonGroupComponent {
|
|
420
|
-
constructor() {
|
|
421
|
-
this.change = new EventEmitter();
|
|
422
|
-
this._items = [];
|
|
423
|
-
//_init : boolean = false;
|
|
424
|
-
this.selectedItem = null;
|
|
425
|
-
}
|
|
426
|
-
get items() {
|
|
427
|
-
return this._items;
|
|
428
|
-
}
|
|
429
|
-
set items(val) {
|
|
430
|
-
this._items = val;
|
|
431
|
-
this.selectedItem = this.items.filter(x => x.default === true).firstOrNull();
|
|
432
|
-
if (this.selectedItem === null)
|
|
433
|
-
this.selectedItem = this.items.firstOrNull();
|
|
434
|
-
}
|
|
435
|
-
ngOnInit() {
|
|
436
|
-
}
|
|
437
|
-
raiseChange(item) {
|
|
438
|
-
this.selectedItem = item;
|
|
439
|
-
this.change.emit(this.selectedItem);
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
RadioButtonGroupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: RadioButtonGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
443
|
-
RadioButtonGroupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: RadioButtonGroupComponent, selector: "ox-radio-button-group", inputs: { selectedItem: "selectedItem", items: "items" }, outputs: { change: "change" }, ngImport: i0, template: "<ox-check-button [radioBehavior]=\"true\" (changed)=\"raiseChange(item)\" [checked]=\"item == selectedItem\" *ngFor=\"let item of items\">\n {{item.name}}\n</ox-check-button>", styles: [":host>:first-child{border-radius:4px 0 0 4px}:host>:last-child{border-radius:0 4px 4px 0}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: CheckButtonComponent, selector: "ox-check-button", inputs: ["checked", "radioBehavior"], outputs: ["changed"] }] });
|
|
444
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: RadioButtonGroupComponent, decorators: [{
|
|
445
|
-
type: Component,
|
|
446
|
-
args: [{ selector: 'ox-radio-button-group', template: "<ox-check-button [radioBehavior]=\"true\" (changed)=\"raiseChange(item)\" [checked]=\"item == selectedItem\" *ngFor=\"let item of items\">\n {{item.name}}\n</ox-check-button>", styles: [":host>:first-child{border-radius:4px 0 0 4px}:host>:last-child{border-radius:0 4px 4px 0}\n"] }]
|
|
447
|
-
}], ctorParameters: function () { return []; }, propDecorators: { change: [{
|
|
448
|
-
type: Output
|
|
449
|
-
}], selectedItem: [{
|
|
450
|
-
type: Input
|
|
451
|
-
}], items: [{
|
|
452
|
-
type: Input
|
|
453
|
-
}] } });
|
|
454
|
-
|
|
455
|
-
class ItemCardComponent {
|
|
456
|
-
constructor() { }
|
|
457
|
-
ngOnInit() {
|
|
458
|
-
}
|
|
459
|
-
}
|
|
460
|
-
ItemCardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ItemCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
461
|
-
ItemCardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: ItemCardComponent, selector: "ox-item-card", inputs: { nome: "nome", codigo: "codigo", star: "star", cloud: "cloud", desativado: "desativado" }, ngImport: i0, template: "<div class=\"nome-codigo-row\"><span class=\"codigo\" *ngIf=\"codigo\">{{codigo}}</span>{{nome}}</div>\n<div class=\"icons-row\">\n <span class=\"material-icons star\" *ngIf=\"star\">\n grade\n </span>\n <span class=\"material-icons desativado\" *ngIf=\"desativado === true\">\n dangerous\n </span>\n <span class=\"material-icons sync-pendente\" *ngIf=\"cloud === false\">\n cloud_queue\n </span>\n <span class=\"material-icons sync-concluido\" *ngIf=\"cloud === true\">\n cloud_done\n </span>\n</div>\n", styles: [":host{display:flex;flex-direction:row;border-bottom:1px solid #e6e9ec;border-left:3px solid #e6e9ec;padding:12px 16px;background:#fff;justify-content:space-between;cursor:pointer;flex-shrink:0;align-items:center;transition:border-left-color 1s;-webkit-user-select:none;user-select:none;font-size:small}:host:hover{box-shadow:0 0 16px #0000000f;background:transparent;z-index:1}:host(.selected){border-left-color:var(--app-color, black);z-index:1;box-shadow:0 0 8px 5px #00000008;flex-shrink:0;background:linear-gradient(45deg,var(--item-card-selected-bg, rgba(0, 0, 0, .05)),transparent)}.nome-codigo-row{display:flex;flex-direction:row;flex-grow:1;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;margin-right:8px}.icons-row{display:flex;flex-direction:row;align-items:center;gap:8px}.codigo{color:#666;font-size:x-small;border-radius:4px;padding:0 4px;width:50px;min-width:50px;text-align:center;border:1px solid #eee;margin-right:16px;display:flex;align-items:center;justify-content:center}.sync-pendente{color:#141212;font-size:16px}.sync-concluido{color:#dbdbdb;font-size:16px}.star{color:#000}.desativado{color:#8f07bb;font-size:16px}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
462
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ItemCardComponent, decorators: [{
|
|
463
|
-
type: Component,
|
|
464
|
-
args: [{ selector: 'ox-item-card', template: "<div class=\"nome-codigo-row\"><span class=\"codigo\" *ngIf=\"codigo\">{{codigo}}</span>{{nome}}</div>\n<div class=\"icons-row\">\n <span class=\"material-icons star\" *ngIf=\"star\">\n grade\n </span>\n <span class=\"material-icons desativado\" *ngIf=\"desativado === true\">\n dangerous\n </span>\n <span class=\"material-icons sync-pendente\" *ngIf=\"cloud === false\">\n cloud_queue\n </span>\n <span class=\"material-icons sync-concluido\" *ngIf=\"cloud === true\">\n cloud_done\n </span>\n</div>\n", styles: [":host{display:flex;flex-direction:row;border-bottom:1px solid #e6e9ec;border-left:3px solid #e6e9ec;padding:12px 16px;background:#fff;justify-content:space-between;cursor:pointer;flex-shrink:0;align-items:center;transition:border-left-color 1s;-webkit-user-select:none;user-select:none;font-size:small}:host:hover{box-shadow:0 0 16px #0000000f;background:transparent;z-index:1}:host(.selected){border-left-color:var(--app-color, black);z-index:1;box-shadow:0 0 8px 5px #00000008;flex-shrink:0;background:linear-gradient(45deg,var(--item-card-selected-bg, rgba(0, 0, 0, .05)),transparent)}.nome-codigo-row{display:flex;flex-direction:row;flex-grow:1;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;margin-right:8px}.icons-row{display:flex;flex-direction:row;align-items:center;gap:8px}.codigo{color:#666;font-size:x-small;border-radius:4px;padding:0 4px;width:50px;min-width:50px;text-align:center;border:1px solid #eee;margin-right:16px;display:flex;align-items:center;justify-content:center}.sync-pendente{color:#141212;font-size:16px}.sync-concluido{color:#dbdbdb;font-size:16px}.star{color:#000}.desativado{color:#8f07bb;font-size:16px}\n"] }]
|
|
465
|
-
}], ctorParameters: function () { return []; }, propDecorators: { nome: [{
|
|
466
|
-
type: Input
|
|
467
|
-
}], codigo: [{
|
|
468
|
-
type: Input
|
|
469
|
-
}], star: [{
|
|
470
|
-
type: Input
|
|
471
|
-
}], cloud: [{
|
|
472
|
-
type: Input
|
|
473
|
-
}], desativado: [{
|
|
474
|
-
type: Input
|
|
475
|
-
}] } });
|
|
476
|
-
|
|
477
|
-
class AlertDialogComponent {
|
|
478
|
-
constructor(dialogRef, args) {
|
|
479
|
-
this.dialogRef = dialogRef;
|
|
480
|
-
this.args = args;
|
|
3568
|
+
if (this.max !== undefined && val > this.max)
|
|
3569
|
+
return false;
|
|
3570
|
+
if (this.min !== undefined && val < this.min)
|
|
3571
|
+
return false;
|
|
3572
|
+
return true;
|
|
481
3573
|
}
|
|
482
|
-
|
|
3574
|
+
raiseChange() {
|
|
3575
|
+
this.change.emit(this.value);
|
|
483
3576
|
}
|
|
484
3577
|
}
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type:
|
|
3578
|
+
NumericPickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: NumericPickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3579
|
+
NumericPickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.5", type: NumericPickerComponent, selector: "ox-numeric-picker", inputs: { value: "value", max: "max", min: "min" }, outputs: { valueChange: "valueChange", change: "change" }, ngImport: i0, template: "<div>\n <button mat-icon-button (click)=\"goBack()\" [disabled]=\"disableBack\">\n <mat-icon>chevron_left</mat-icon>\n </button>\n</div>\n<input [(ngModel)]=\"text\" (change)=\"onTextEdit($event)\" class=\"date\">\n<div>\n <button mat-icon-button (click)=\"goNext()\" [disabled]=\"disableNext\" >\n <mat-icon>chevron_right</mat-icon>\n </button>\n</div>", styles: [":host{display:flex;flex-direction:row;justify-content:center;align-items:center;background:transparent;min-width:60px}\n"], dependencies: [{ kind: "directive", type: i7.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i6$1.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"] }] });
|
|
3580
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: NumericPickerComponent, decorators: [{
|
|
488
3581
|
type: Component,
|
|
489
|
-
args: [{ selector: '
|
|
490
|
-
}], ctorParameters: function () {
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
3582
|
+
args: [{ selector: 'ox-numeric-picker', template: "<div>\n <button mat-icon-button (click)=\"goBack()\" [disabled]=\"disableBack\">\n <mat-icon>chevron_left</mat-icon>\n </button>\n</div>\n<input [(ngModel)]=\"text\" (change)=\"onTextEdit($event)\" class=\"date\">\n<div>\n <button mat-icon-button (click)=\"goNext()\" [disabled]=\"disableNext\" >\n <mat-icon>chevron_right</mat-icon>\n </button>\n</div>", styles: [":host{display:flex;flex-direction:row;justify-content:center;align-items:center;background:transparent;min-width:60px}\n"] }]
|
|
3583
|
+
}], ctorParameters: function () { return []; }, propDecorators: { valueChange: [{
|
|
3584
|
+
type: Output
|
|
3585
|
+
}], change: [{
|
|
3586
|
+
type: Output
|
|
3587
|
+
}], value: [{
|
|
3588
|
+
type: Input
|
|
3589
|
+
}], max: [{
|
|
3590
|
+
type: Input
|
|
3591
|
+
}], min: [{
|
|
3592
|
+
type: Input
|
|
3593
|
+
}] } });
|
|
496
3594
|
|
|
497
3595
|
class SafeHtmlPipe {
|
|
498
3596
|
constructor(sanitizer) {
|
|
@@ -502,15 +3600,22 @@ class SafeHtmlPipe {
|
|
|
502
3600
|
return this.sanitizer.bypassSecurityTrustHtml(html);
|
|
503
3601
|
}
|
|
504
3602
|
}
|
|
505
|
-
SafeHtmlPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: SafeHtmlPipe, deps: [{ token: i1$
|
|
3603
|
+
SafeHtmlPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: SafeHtmlPipe, deps: [{ token: i1$2.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
506
3604
|
SafeHtmlPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.0.5", ngImport: i0, type: SafeHtmlPipe, name: "safeHtml" });
|
|
507
3605
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: SafeHtmlPipe, decorators: [{
|
|
508
3606
|
type: Pipe,
|
|
509
3607
|
args: [{
|
|
510
3608
|
name: 'safeHtml'
|
|
511
3609
|
}]
|
|
512
|
-
}], ctorParameters: function () { return [{ type: i1$
|
|
3610
|
+
}], ctorParameters: function () { return [{ type: i1$2.DomSanitizer }]; } });
|
|
513
3611
|
|
|
3612
|
+
Array.prototype.remove = function (item) {
|
|
3613
|
+
const index = this.indexOf(item);
|
|
3614
|
+
if (index === -1)
|
|
3615
|
+
return false;
|
|
3616
|
+
this.splice(index, 1);
|
|
3617
|
+
return true;
|
|
3618
|
+
};
|
|
514
3619
|
Array.prototype.firstOrNull = function () {
|
|
515
3620
|
if (this.length > 0)
|
|
516
3621
|
return this[0];
|
|
@@ -533,12 +3638,38 @@ OxpiNglibModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version
|
|
|
533
3638
|
RadioButtonGroupComponent,
|
|
534
3639
|
ItemCardComponent,
|
|
535
3640
|
SafeHtmlPipe,
|
|
536
|
-
AlertDialogComponent
|
|
3641
|
+
AlertDialogComponent,
|
|
3642
|
+
FuncionariosComponent,
|
|
3643
|
+
FuncionarioFormComponent,
|
|
3644
|
+
FuncionarioEditDialogComponent,
|
|
3645
|
+
FuncionarioAddDialogComponent,
|
|
3646
|
+
ProdutosComponent,
|
|
3647
|
+
ProdutoFormComponent,
|
|
3648
|
+
ProdutoAddDialogComponent,
|
|
3649
|
+
ProdutoBuscaFiltrosDialogComponent,
|
|
3650
|
+
ProdutoEditDialogComponent,
|
|
3651
|
+
ProdutosGruposComponent,
|
|
3652
|
+
MoverGrupoDialogComponent,
|
|
3653
|
+
ProdutoGrupoSelecaoDialogComponent,
|
|
3654
|
+
ProdutoGrupoAddDialogComponent,
|
|
3655
|
+
ProdutoGrupoEditDialogComponent,
|
|
3656
|
+
ProdutoGrupoFormComponent,
|
|
3657
|
+
ProdutosNcmDialogComponent,
|
|
3658
|
+
ProdutosSubgruposComponent,
|
|
3659
|
+
ProdutoSubgrupoSelecaoDialogComponent,
|
|
3660
|
+
ProdutoSubgrupoAddDialogComponent,
|
|
3661
|
+
ProdutoSubgrupoEditDialogComponent,
|
|
3662
|
+
ProdutosCategoriasCardapioComponent,
|
|
3663
|
+
ProdutoCategoriaCardapioAddDialogComponent,
|
|
3664
|
+
ProdutoCategoriaCardapioEditDialogComponent,
|
|
3665
|
+
ProdutoCategoriaCardapioSelecaoDialogComponent], imports: [BrowserModule,
|
|
537
3666
|
BrowserAnimationsModule,
|
|
538
3667
|
FormsModule,
|
|
539
3668
|
MatButtonModule,
|
|
540
3669
|
MatIconModule,
|
|
541
|
-
MatDialogModule
|
|
3670
|
+
MatDialogModule,
|
|
3671
|
+
MatSelectModule,
|
|
3672
|
+
MatAutocompleteModule], exports: [BusyIndicatorComponent,
|
|
542
3673
|
MonthYearPickerComponent,
|
|
543
3674
|
ImageViewerComponent,
|
|
544
3675
|
NumericPickerComponent,
|
|
@@ -552,7 +3683,9 @@ OxpiNglibModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version
|
|
|
552
3683
|
FormsModule,
|
|
553
3684
|
MatButtonModule,
|
|
554
3685
|
MatIconModule,
|
|
555
|
-
MatDialogModule
|
|
3686
|
+
MatDialogModule,
|
|
3687
|
+
MatSelectModule,
|
|
3688
|
+
MatAutocompleteModule] });
|
|
556
3689
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: OxpiNglibModule, decorators: [{
|
|
557
3690
|
type: NgModule,
|
|
558
3691
|
args: [{
|
|
@@ -566,7 +3699,31 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImpor
|
|
|
566
3699
|
RadioButtonGroupComponent,
|
|
567
3700
|
ItemCardComponent,
|
|
568
3701
|
SafeHtmlPipe,
|
|
569
|
-
AlertDialogComponent
|
|
3702
|
+
AlertDialogComponent,
|
|
3703
|
+
FuncionariosComponent,
|
|
3704
|
+
FuncionarioFormComponent,
|
|
3705
|
+
FuncionarioEditDialogComponent,
|
|
3706
|
+
FuncionarioAddDialogComponent,
|
|
3707
|
+
ProdutosComponent,
|
|
3708
|
+
ProdutoFormComponent,
|
|
3709
|
+
ProdutoAddDialogComponent,
|
|
3710
|
+
ProdutoBuscaFiltrosDialogComponent,
|
|
3711
|
+
ProdutoEditDialogComponent,
|
|
3712
|
+
ProdutosGruposComponent,
|
|
3713
|
+
MoverGrupoDialogComponent,
|
|
3714
|
+
ProdutoGrupoSelecaoDialogComponent,
|
|
3715
|
+
ProdutoGrupoAddDialogComponent,
|
|
3716
|
+
ProdutoGrupoEditDialogComponent,
|
|
3717
|
+
ProdutoGrupoFormComponent,
|
|
3718
|
+
ProdutosNcmDialogComponent,
|
|
3719
|
+
ProdutosSubgruposComponent,
|
|
3720
|
+
ProdutoSubgrupoSelecaoDialogComponent,
|
|
3721
|
+
ProdutoSubgrupoAddDialogComponent,
|
|
3722
|
+
ProdutoSubgrupoEditDialogComponent,
|
|
3723
|
+
ProdutosCategoriasCardapioComponent,
|
|
3724
|
+
ProdutoCategoriaCardapioAddDialogComponent,
|
|
3725
|
+
ProdutoCategoriaCardapioEditDialogComponent,
|
|
3726
|
+
ProdutoCategoriaCardapioSelecaoDialogComponent
|
|
570
3727
|
],
|
|
571
3728
|
imports: [
|
|
572
3729
|
BrowserModule,
|
|
@@ -575,6 +3732,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImpor
|
|
|
575
3732
|
MatButtonModule,
|
|
576
3733
|
MatIconModule,
|
|
577
3734
|
MatDialogModule,
|
|
3735
|
+
MatSelectModule,
|
|
3736
|
+
MatAutocompleteModule,
|
|
578
3737
|
],
|
|
579
3738
|
exports: [
|
|
580
3739
|
BusyIndicatorComponent,
|
|
@@ -595,279 +3754,50 @@ class BusyState {
|
|
|
595
3754
|
this.isBusy = false;
|
|
596
3755
|
this.counter = 0;
|
|
597
3756
|
}
|
|
598
|
-
show() {
|
|
599
|
-
this.counter++;
|
|
600
|
-
this.isBusy = true;
|
|
601
|
-
}
|
|
602
|
-
hide() {
|
|
603
|
-
this.counter--;
|
|
604
|
-
if (this.counter < 0)
|
|
605
|
-
this.counter = 0;
|
|
606
|
-
if (this.counter == 0)
|
|
607
|
-
this.isBusy = false;
|
|
608
|
-
}
|
|
609
|
-
}
|
|
610
|
-
|
|
611
|
-
class LazyTrigger {
|
|
612
|
-
constructor(doFunc, timeout = 800) {
|
|
613
|
-
this.doFunc = doFunc;
|
|
614
|
-
this.timeout = timeout;
|
|
615
|
-
}
|
|
616
|
-
fire() {
|
|
617
|
-
console.debug("lazyTimeoutId");
|
|
618
|
-
if (this.lazyTimeoutId != undefined)
|
|
619
|
-
clearTimeout(this.lazyTimeoutId);
|
|
620
|
-
this.lazyTimeoutId = window.setTimeout(() => { this.doFunc(); }, this.timeout);
|
|
621
|
-
}
|
|
622
|
-
}
|
|
623
|
-
|
|
624
|
-
class NumberParser {
|
|
625
|
-
constructor(setPropFunc, getPropFunc, min, max, triggerMilliseconds = 1500) {
|
|
626
|
-
this.setPropFunc = setPropFunc;
|
|
627
|
-
this.getPropFunc = getPropFunc;
|
|
628
|
-
this.min = min;
|
|
629
|
-
this.max = max;
|
|
630
|
-
this.parsed = false;
|
|
631
|
-
this._parseTrigger = new LazyTrigger(() => this.parseValor(), triggerMilliseconds);
|
|
632
|
-
}
|
|
633
|
-
parse(vlr) {
|
|
634
|
-
this.valor = vlr;
|
|
635
|
-
this.parsed = false;
|
|
636
|
-
this._parseTrigger.fire();
|
|
637
|
-
}
|
|
638
|
-
store(vlr) {
|
|
639
|
-
this.valor = vlr;
|
|
640
|
-
this.parsed = false;
|
|
641
|
-
}
|
|
642
|
-
checkout() {
|
|
643
|
-
if (this.parsed || !this.valor)
|
|
644
|
-
return;
|
|
645
|
-
this.parseValor();
|
|
646
|
-
}
|
|
647
|
-
parseValor() {
|
|
648
|
-
if (this.valor === undefined)
|
|
649
|
-
return;
|
|
650
|
-
this.parsed = true;
|
|
651
|
-
const vlrTxt = this.valor.split(",").join(".");
|
|
652
|
-
;
|
|
653
|
-
const spTxt = vlrTxt.split(".");
|
|
654
|
-
let toParseTxt = "";
|
|
655
|
-
if (spTxt.length > 2) {
|
|
656
|
-
const chars = vlrTxt.split("");
|
|
657
|
-
const lastIndex = vlrTxt.lastIndexOf(".");
|
|
658
|
-
for (let i = 0; i < chars.length; i++) {
|
|
659
|
-
const c = chars[i];
|
|
660
|
-
if (c === "." && i != lastIndex)
|
|
661
|
-
continue;
|
|
662
|
-
toParseTxt = toParseTxt.concat(c);
|
|
663
|
-
}
|
|
664
|
-
}
|
|
665
|
-
else {
|
|
666
|
-
toParseTxt = vlrTxt;
|
|
667
|
-
}
|
|
668
|
-
const vlr = parseFloat(toParseTxt);
|
|
669
|
-
if (isNaN(vlr) || !this.validaMinMax(vlr)) {
|
|
670
|
-
const original = this.getPropFunc();
|
|
671
|
-
this.setPropFunc(0);
|
|
672
|
-
setTimeout(() => this.setPropFunc(original));
|
|
673
|
-
}
|
|
674
|
-
else {
|
|
675
|
-
this.setPropFunc(vlr);
|
|
676
|
-
}
|
|
677
|
-
}
|
|
678
|
-
validaMinMax(value) {
|
|
679
|
-
if ((this.min === undefined) && this.max === undefined)
|
|
680
|
-
return true;
|
|
681
|
-
if (!(this.min === undefined) && value < this.min)
|
|
682
|
-
return false;
|
|
683
|
-
if (!(this.max === undefined) && value > this.max)
|
|
684
|
-
return false;
|
|
685
|
-
return true;
|
|
686
|
-
}
|
|
687
|
-
}
|
|
688
|
-
|
|
689
|
-
class Ordem {
|
|
690
|
-
constructor(ordens, isCrescente, onToggle) {
|
|
691
|
-
const d = ordens.filter(x => x.default === true).firstOrNull();
|
|
692
|
-
this.colName = d === null ? ordens[0].value : d.value;
|
|
693
|
-
this.isCrescente = isCrescente;
|
|
694
|
-
this.onToggle = onToggle;
|
|
695
|
-
}
|
|
696
|
-
toggle() {
|
|
697
|
-
this.isCrescente = !this.isCrescente;
|
|
698
|
-
if (this.onToggle !== undefined)
|
|
699
|
-
this.onToggle();
|
|
700
|
-
}
|
|
701
|
-
toString() {
|
|
702
|
-
return this.colName + (!this.isCrescente ? " desc" : "");
|
|
703
|
-
}
|
|
704
|
-
}
|
|
705
|
-
|
|
706
|
-
function printTxt(txt) {
|
|
707
|
-
const r = "<!doctype html><head><meta charset=\"utf-8\"></head><body><div style='font-family: \"Courier New\", Courier, monospace; white-space: pre-wrap;color: black;font-weight: bold;word-wrap: break-word;word-break: break-all;overflow-wrap: break-word;'>" + txt + '</div></body>';
|
|
708
|
-
printHtml(r);
|
|
709
|
-
}
|
|
710
|
-
function printHtml(r) {
|
|
711
|
-
const blob = new Blob([r], { type: 'text/html' });
|
|
712
|
-
const url = window.URL.createObjectURL(blob);
|
|
713
|
-
const w = window.open(url, '_blank');
|
|
714
|
-
if (w != null)
|
|
715
|
-
w.print();
|
|
716
|
-
}
|
|
717
|
-
function selectText(ev) {
|
|
718
|
-
ev.target.select();
|
|
719
|
-
}
|
|
720
|
-
|
|
721
|
-
function valTextEmpty(v) {
|
|
722
|
-
return v === null ||
|
|
723
|
-
v === undefined ||
|
|
724
|
-
v.trim() === '';
|
|
725
|
-
}
|
|
726
|
-
function valNumberEmpty(v) {
|
|
727
|
-
return v === null ||
|
|
728
|
-
v === undefined ||
|
|
729
|
-
v === 0;
|
|
730
|
-
}
|
|
731
|
-
function valTextMax(v, max) {
|
|
732
|
-
return v.length > max;
|
|
733
|
-
}
|
|
734
|
-
function valNumberMin(v, min) {
|
|
735
|
-
if (v === null || v === undefined)
|
|
736
|
-
return true;
|
|
737
|
-
return v <= min;
|
|
738
|
-
}
|
|
739
|
-
|
|
740
|
-
class NavegacaoSelecaoDialogUtil {
|
|
741
|
-
constructor(view) {
|
|
742
|
-
this.view = view;
|
|
743
|
-
}
|
|
744
|
-
onKeyDown(event) {
|
|
745
|
-
console.info(event.keyCode);
|
|
746
|
-
let key = event.keyCode;
|
|
747
|
-
const selected = this.view.selectedItem;
|
|
748
|
-
const enterKey = 13, keyDown = 40, keyUp = 38;
|
|
749
|
-
if (key === enterKey) {
|
|
750
|
-
event.cancelBubble = true;
|
|
751
|
-
if (selected !== null && selected !== undefined) {
|
|
752
|
-
this.view.dialogRef.close(selected);
|
|
753
|
-
return;
|
|
754
|
-
}
|
|
755
|
-
key = keyDown;
|
|
756
|
-
}
|
|
757
|
-
if (key !== keyDown && key !== keyUp)
|
|
758
|
-
return;
|
|
759
|
-
let index = this.view.items.indexOf(selected, 0);
|
|
760
|
-
if (key === keyDown)
|
|
761
|
-
index++;
|
|
762
|
-
if (key === keyUp && index > 0)
|
|
763
|
-
index--;
|
|
764
|
-
if (index > (this.view.items.length - 1))
|
|
765
|
-
return;
|
|
766
|
-
this.view.selectedItem = this.view.items[index];
|
|
767
|
-
}
|
|
768
|
-
}
|
|
769
|
-
function confirmaExclusao(dialog, msg, continueFunc) {
|
|
770
|
-
const args = {
|
|
771
|
-
titulo: "Atenção",
|
|
772
|
-
msg: msg
|
|
773
|
-
};
|
|
774
|
-
const dialogRef = dialog.open(AlertDialogComponent, {
|
|
775
|
-
data: args
|
|
776
|
-
});
|
|
777
|
-
dialogRef.afterClosed().subscribe(dialogResult => {
|
|
778
|
-
if (dialogResult !== true)
|
|
779
|
-
return;
|
|
780
|
-
continueFunc();
|
|
781
|
-
});
|
|
782
|
-
}
|
|
783
|
-
|
|
784
|
-
const fadeAnimation = trigger('fade', [
|
|
785
|
-
transition(':enter', [
|
|
786
|
-
style({ transform: 'translateY(100%)', opacity: 0 }),
|
|
787
|
-
animate('250ms', style({ transform: 'translateY(0)', 'opacity': 1 }))
|
|
788
|
-
]),
|
|
789
|
-
transition(':leave', [
|
|
790
|
-
style({ transform: 'translateY(0)', 'opacity': 1 }),
|
|
791
|
-
animate('250ms', style({ transform: 'translateY(100%)', 'opacity': 0 })),
|
|
792
|
-
])
|
|
793
|
-
]);
|
|
794
|
-
const menuLateralAnimation = trigger('menuLateral', [
|
|
795
|
-
transition(':enter', [
|
|
796
|
-
style({ transform: 'translateX(-100%)', opacity: 1 }),
|
|
797
|
-
animate('200ms', style({ transform: 'translateX(0)', 'opacity': 1 }))
|
|
798
|
-
]),
|
|
799
|
-
transition(':leave', [
|
|
800
|
-
style({ 'opacity': 1 }),
|
|
801
|
-
animate('200ms', style({ 'opacity': 0 })),
|
|
802
|
-
])
|
|
803
|
-
]);
|
|
804
|
-
|
|
805
|
-
class SearchSetting {
|
|
806
|
-
constructor(propChanged) {
|
|
807
|
-
this.propChanged = propChanged;
|
|
808
|
-
this._meses = ["JANEIRO", "FEVEREIRO", "MARÇO", "ABRIL", "MAIO", "JUNHO", "JULHO", "AGOSTO", "SETEMBRO", "OUTUBRO", "NOVEMBRO", "DEZEMBRO"];
|
|
809
|
-
this._mesesShort = ["JAN", "FEV", "MAR", "ABR", "MAI", "JUN", "JUL", "AGO", "SET", "OUT", "NOV", "DEZ"];
|
|
810
|
-
const now = new Date();
|
|
811
|
-
const hj = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 0, 0, 0, 0);
|
|
812
|
-
console.info(hj);
|
|
813
|
-
this.modo = SearchMode.Mensal;
|
|
814
|
-
this.mes = hj.getMonth() + 1;
|
|
815
|
-
this.ano = hj.getFullYear();
|
|
816
|
-
this.inicial = hj.addDays(-30);
|
|
817
|
-
this.final = hj;
|
|
818
|
-
}
|
|
819
|
-
set(prop, value) {
|
|
820
|
-
const me = this;
|
|
821
|
-
me[prop] = value;
|
|
822
|
-
if (this.propChanged !== undefined)
|
|
823
|
-
this.propChanged();
|
|
824
|
-
}
|
|
825
|
-
toStringArquivo() {
|
|
826
|
-
const ini = this.inicial;
|
|
827
|
-
const fim = this.final;
|
|
828
|
-
if (this.modo === SearchMode.Mensal)
|
|
829
|
-
return this.ano + "_" + this.mes;
|
|
830
|
-
if (this.modo === SearchMode.Anual)
|
|
831
|
-
return "" + this.ano;
|
|
832
|
-
if (this.modo === SearchMode.Diario)
|
|
833
|
-
return `${ini.getDate()}_${ini.getMonth() + 1}_${ini.getFullYear()}`;
|
|
834
|
-
return `${ini.getDate()}_${ini.getMonth() + 1}_${ini.getFullYear()}_ate_${fim.getDate()}_${fim.getMonth() + 1}_${fim.getFullYear()}`;
|
|
3757
|
+
show() {
|
|
3758
|
+
this.counter++;
|
|
3759
|
+
this.isBusy = true;
|
|
835
3760
|
}
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
return this._meses[this.mes - 1] + " DE " + this.ano;
|
|
843
|
-
if (this.modo === SearchMode.Anual)
|
|
844
|
-
return "" + this.ano;
|
|
845
|
-
if (this.modo === SearchMode.Diario)
|
|
846
|
-
return `${ini.getDate()}/${ini.getMonth() + 1}/${ini.getFullYear()}`;
|
|
847
|
-
return `${ini.getDate()}/${ini.getMonth() + 1}/${ini.getFullYear()} ATÉ ${fim.getDate()}/${fim.getMonth() + 1}/${fim.getFullYear()}`;
|
|
3761
|
+
hide() {
|
|
3762
|
+
this.counter--;
|
|
3763
|
+
if (this.counter < 0)
|
|
3764
|
+
this.counter = 0;
|
|
3765
|
+
if (this.counter == 0)
|
|
3766
|
+
this.isBusy = false;
|
|
848
3767
|
}
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
3768
|
+
}
|
|
3769
|
+
|
|
3770
|
+
class Ordem {
|
|
3771
|
+
constructor(ordens, isCrescente, onToggle) {
|
|
3772
|
+
const d = ordens.filter(x => x.default === true).firstOrNull();
|
|
3773
|
+
this.colName = d === null ? ordens[0].value : d.value;
|
|
3774
|
+
this.isCrescente = isCrescente;
|
|
3775
|
+
this.onToggle = onToggle;
|
|
855
3776
|
}
|
|
856
|
-
|
|
857
|
-
this.
|
|
858
|
-
if (this.
|
|
859
|
-
this.
|
|
860
|
-
|
|
861
|
-
|
|
3777
|
+
toggle() {
|
|
3778
|
+
this.isCrescente = !this.isCrescente;
|
|
3779
|
+
if (this.onToggle !== undefined)
|
|
3780
|
+
this.onToggle();
|
|
3781
|
+
}
|
|
3782
|
+
toString() {
|
|
3783
|
+
return this.colName + (!this.isCrescente ? " desc" : "");
|
|
862
3784
|
}
|
|
3785
|
+
}
|
|
3786
|
+
|
|
3787
|
+
function printTxt(txt) {
|
|
3788
|
+
const r = "<!doctype html><head><meta charset=\"utf-8\"></head><body><div style='font-family: \"Courier New\", Courier, monospace; white-space: pre-wrap;color: black;font-weight: bold;word-wrap: break-word;word-break: break-all;overflow-wrap: break-word;'>" + txt + '</div></body>';
|
|
3789
|
+
printHtml(r);
|
|
863
3790
|
}
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
}
|
|
3791
|
+
function printHtml(r) {
|
|
3792
|
+
const blob = new Blob([r], { type: 'text/html' });
|
|
3793
|
+
const url = window.URL.createObjectURL(blob);
|
|
3794
|
+
const w = window.open(url, '_blank');
|
|
3795
|
+
if (w != null)
|
|
3796
|
+
w.print();
|
|
3797
|
+
}
|
|
3798
|
+
function selectText(ev) {
|
|
3799
|
+
ev.target.select();
|
|
3800
|
+
}
|
|
871
3801
|
|
|
872
3802
|
class PagamentoRecebimentoSearchSetting extends SearchSetting {
|
|
873
3803
|
constructor() {
|
|
@@ -940,17 +3870,6 @@ class DuplicataSearchSetting extends SearchSetting {
|
|
|
940
3870
|
}
|
|
941
3871
|
}
|
|
942
3872
|
|
|
943
|
-
class ProdutoSearchSetting extends SearchSetting {
|
|
944
|
-
constructor() {
|
|
945
|
-
super();
|
|
946
|
-
this.exibeNaoControladoEstoque = true;
|
|
947
|
-
this.exibeApenasMostraRecepcao = false;
|
|
948
|
-
this.exibeInativo = false;
|
|
949
|
-
this.exibeImprimiCozinha = false;
|
|
950
|
-
this.exibeHePrato = false;
|
|
951
|
-
}
|
|
952
|
-
}
|
|
953
|
-
|
|
954
3873
|
class SuitesIntervencoesSetting extends SearchSetting {
|
|
955
3874
|
}
|
|
956
3875
|
|
|
@@ -979,76 +3898,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImpor
|
|
|
979
3898
|
}]
|
|
980
3899
|
}], ctorParameters: function () { return []; } });
|
|
981
3900
|
|
|
982
|
-
class FocusService {
|
|
983
|
-
constructor() {
|
|
984
|
-
}
|
|
985
|
-
hasInit() {
|
|
986
|
-
return this._element !== undefined;
|
|
987
|
-
}
|
|
988
|
-
registerElementById(name) {
|
|
989
|
-
this.registerElement(document.getElementById(name));
|
|
990
|
-
}
|
|
991
|
-
registerElement(element) {
|
|
992
|
-
if (element === null || element === undefined)
|
|
993
|
-
return;
|
|
994
|
-
this._element = element;
|
|
995
|
-
//this._items = this.getItems();
|
|
996
|
-
console.info(element);
|
|
997
|
-
element.addEventListener('keydown', (ev) => this.handleKeyboardEvent(ev));
|
|
998
|
-
}
|
|
999
|
-
registerWindow() {
|
|
1000
|
-
this._element = null;
|
|
1001
|
-
//this._items = this.getItems();
|
|
1002
|
-
window.addEventListener('keydown', (ev) => this.handleKeyboardEvent(ev));
|
|
1003
|
-
}
|
|
1004
|
-
unregisterElementById(name) {
|
|
1005
|
-
this.unregisterElement(document.getElementById(name));
|
|
1006
|
-
}
|
|
1007
|
-
unregisterElement(element) {
|
|
1008
|
-
if (element === null || element === undefined)
|
|
1009
|
-
return;
|
|
1010
|
-
element.removeEventListener('keydown', (ev) => this.handleKeyboardEvent(ev));
|
|
1011
|
-
}
|
|
1012
|
-
handleKeyboardEvent(event) {
|
|
1013
|
-
if (event.keyCode !== 13)
|
|
1014
|
-
return;
|
|
1015
|
-
if (event.target.nodeName === "BUTTON")
|
|
1016
|
-
return;
|
|
1017
|
-
const items = this.getItems();
|
|
1018
|
-
const index = Array.prototype.indexOf.call(items, event.target);
|
|
1019
|
-
const nextIndex = index + 1;
|
|
1020
|
-
if (nextIndex > items.length - 1)
|
|
1021
|
-
return;
|
|
1022
|
-
const i = items[index + 1];
|
|
1023
|
-
if (i.tabIndex > -1)
|
|
1024
|
-
i.focus();
|
|
1025
|
-
event.preventDefault();
|
|
1026
|
-
}
|
|
1027
|
-
setFirst() {
|
|
1028
|
-
const el = this.getItems()[0]; //[0];
|
|
1029
|
-
if (el !== undefined)
|
|
1030
|
-
el.focus();
|
|
1031
|
-
}
|
|
1032
|
-
getItems() {
|
|
1033
|
-
const query = this._element !== null && this._element !== undefined ?
|
|
1034
|
-
this._element.querySelectorAll('input,button, [tabindex]:not([tabindex="-1"])') :
|
|
1035
|
-
document.querySelectorAll('input,button, [tabindex]:not([tabindex="-1"])');
|
|
1036
|
-
const items = [];
|
|
1037
|
-
for (let index = 0; index < query.length; index++) {
|
|
1038
|
-
const el = query[index];
|
|
1039
|
-
if (el.tabIndex > 0)
|
|
1040
|
-
items.push(el);
|
|
1041
|
-
}
|
|
1042
|
-
return items;
|
|
1043
|
-
}
|
|
1044
|
-
set(id) {
|
|
1045
|
-
const el = document.getElementById(id);
|
|
1046
|
-
if (el === null)
|
|
1047
|
-
return;
|
|
1048
|
-
el.focus();
|
|
1049
|
-
}
|
|
1050
|
-
}
|
|
1051
|
-
|
|
1052
3901
|
class Preferences {
|
|
1053
3902
|
constructor() {
|
|
1054
3903
|
}
|
|
@@ -1089,101 +3938,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImpor
|
|
|
1089
3938
|
}]
|
|
1090
3939
|
}], ctorParameters: function () { return []; } });
|
|
1091
3940
|
|
|
1092
|
-
const SM_WIDTH = 576;
|
|
1093
|
-
const MD_WIDTH = 768;
|
|
1094
|
-
const LG_WIDTH = 992;
|
|
1095
|
-
const XL_WIDTH = 1200;
|
|
1096
|
-
const XXL_WIDTH = 1400;
|
|
1097
|
-
class ScreenHelperService {
|
|
1098
|
-
constructor() {
|
|
1099
|
-
this.changedMobileScreen = new EventEmitter();
|
|
1100
|
-
this.changedMediumScreen = new EventEmitter();
|
|
1101
|
-
this.changedLargeScreen = new EventEmitter();
|
|
1102
|
-
this.changedXLargeScreen = new EventEmitter();
|
|
1103
|
-
this.changedXXLargeScreen = new EventEmitter();
|
|
1104
|
-
this.changedMinSmallScreen = new EventEmitter();
|
|
1105
|
-
this.changedMinMediumScreen = new EventEmitter();
|
|
1106
|
-
this.changedMinLargeScreen = new EventEmitter();
|
|
1107
|
-
this.changedMinXLargeScreen = new EventEmitter();
|
|
1108
|
-
this.changedMinXXLargeScreen = new EventEmitter();
|
|
1109
|
-
this.mobileScreen = false;
|
|
1110
|
-
this.isMedium = false;
|
|
1111
|
-
this.isLarge = false;
|
|
1112
|
-
this.isXLarge = false;
|
|
1113
|
-
this.isXXLarge = false;
|
|
1114
|
-
this.minSmall = false;
|
|
1115
|
-
this.minMedium = false;
|
|
1116
|
-
this.minLarge = false;
|
|
1117
|
-
this.minXLarge = false;
|
|
1118
|
-
this.minXXLarge = false;
|
|
1119
|
-
this.determinaMobileScreen();
|
|
1120
|
-
window.addEventListener('resize', (event) => {
|
|
1121
|
-
this.determinaMobileScreen();
|
|
1122
|
-
});
|
|
1123
|
-
}
|
|
1124
|
-
determinaMobileScreen() {
|
|
1125
|
-
const width = window.innerWidth;
|
|
1126
|
-
const isSmall = width <= SM_WIDTH;
|
|
1127
|
-
const isMedium = width <= MD_WIDTH;
|
|
1128
|
-
const isLarge = width <= LG_WIDTH;
|
|
1129
|
-
const isXLarge = width <= XL_WIDTH;
|
|
1130
|
-
const isXXLarge = width <= XXL_WIDTH;
|
|
1131
|
-
const minSmall = width >= SM_WIDTH;
|
|
1132
|
-
const minMedium = width >= MD_WIDTH;
|
|
1133
|
-
const minLarge = width >= LG_WIDTH;
|
|
1134
|
-
const minXLarge = width >= XL_WIDTH;
|
|
1135
|
-
const minXXLarge = width >= XXL_WIDTH;
|
|
1136
|
-
if (isSmall !== this.mobileScreen) {
|
|
1137
|
-
this.changedMobileScreen.emit(isSmall);
|
|
1138
|
-
this.mobileScreen = isSmall;
|
|
1139
|
-
}
|
|
1140
|
-
if (isMedium !== this.isMedium) {
|
|
1141
|
-
this.changedMediumScreen.emit(isMedium);
|
|
1142
|
-
this.isMedium = isMedium;
|
|
1143
|
-
}
|
|
1144
|
-
if (isLarge !== this.isLarge) {
|
|
1145
|
-
this.changedLargeScreen.emit(isLarge);
|
|
1146
|
-
this.isLarge = isLarge;
|
|
1147
|
-
}
|
|
1148
|
-
if (isXLarge !== this.isXLarge) {
|
|
1149
|
-
this.changedXLargeScreen.emit(isXLarge);
|
|
1150
|
-
this.isXLarge = isXLarge;
|
|
1151
|
-
}
|
|
1152
|
-
if (isXXLarge !== this.isXXLarge) {
|
|
1153
|
-
this.changedXXLargeScreen.emit(isXXLarge);
|
|
1154
|
-
this.isXXLarge = isXXLarge;
|
|
1155
|
-
}
|
|
1156
|
-
if (minSmall !== this.minSmall) {
|
|
1157
|
-
this.changedMinSmallScreen.emit(isSmall);
|
|
1158
|
-
this.minMedium = isSmall;
|
|
1159
|
-
}
|
|
1160
|
-
if (minMedium !== this.minMedium) {
|
|
1161
|
-
this.changedMinMediumScreen.emit(isMedium);
|
|
1162
|
-
this.minMedium = isMedium;
|
|
1163
|
-
}
|
|
1164
|
-
if (minLarge !== this.minLarge) {
|
|
1165
|
-
this.changedMinLargeScreen.emit(minLarge);
|
|
1166
|
-
this.minLarge = minLarge;
|
|
1167
|
-
}
|
|
1168
|
-
if (minXLarge !== this.minXLarge) {
|
|
1169
|
-
this.changedMinXLargeScreen.emit(minXLarge);
|
|
1170
|
-
this.minXLarge = minXLarge;
|
|
1171
|
-
}
|
|
1172
|
-
if (minXXLarge !== this.minXXLarge) {
|
|
1173
|
-
this.changedMinXXLargeScreen.emit(minXXLarge);
|
|
1174
|
-
this.minXXLarge = minXXLarge;
|
|
1175
|
-
}
|
|
1176
|
-
}
|
|
1177
|
-
}
|
|
1178
|
-
ScreenHelperService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ScreenHelperService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1179
|
-
ScreenHelperService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ScreenHelperService, providedIn: 'root' });
|
|
1180
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImport: i0, type: ScreenHelperService, decorators: [{
|
|
1181
|
-
type: Injectable,
|
|
1182
|
-
args: [{
|
|
1183
|
-
providedIn: 'root'
|
|
1184
|
-
}]
|
|
1185
|
-
}], ctorParameters: function () { return []; } });
|
|
1186
|
-
|
|
1187
3941
|
/*
|
|
1188
3942
|
* Public API Surface of oxpi-nglib
|
|
1189
3943
|
*/
|
|
@@ -1192,5 +3946,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.5", ngImpor
|
|
|
1192
3946
|
* Generated bundle index. Do not edit.
|
|
1193
3947
|
*/
|
|
1194
3948
|
|
|
1195
|
-
export { AlertDialogComponent, BusyIndicatorComponent, BusyState, CheckButtonComponent, ConsumoProdutoSearchSetting, DuplicataSearchSetting, ExportFileService, FocusService, ImageViewerComponent, ItemCardComponent, LazyTrigger, MonthYearPickerComponent, NavegacaoSelecaoDialogUtil, NumberParser, NumericPickerComponent, OcupacaoFilterSetting, OcupacaoSearchDateField, OcupacaoSearchSetting, OcupacaoSearchTipoEntrada, Ordem, OxpiNglibModule, PagamentoRecebimentoSearchSetting, PaginatorComponent, PorOcupacaoTipo, Preferences, ProdutoSearchSetting, RadioButtonGroupComponent, SafeHtmlPipe, ScreenHelperService, SearchMode, SearchSetting, SuitesIntervencoesSetting, confirmaExclusao, fadeAnimation, menuLateralAnimation, printHtml, printTxt, selectText, valNumberEmpty, valNumberMin, valTextEmpty, valTextMax };
|
|
3949
|
+
export { AlertDialogComponent, AuthDataService, BusyIndicatorComponent, BusyState, CheckButtonComponent, CommonWebService, ConsumoProdutoSearchSetting, DuplicataSearchSetting, ExportFileService, FocusService, FuncionarioAddDialogComponent, FuncionarioEditDialogComponent, FuncionarioFormComponent, FuncionariosComponent, ImageViewerComponent, ItemCardComponent, LazyTrigger, MonthYearPickerComponent, MoverGrupoDialogComponent, NavegacaoSelecaoDialogUtil, NotificationService, NumberParser, NumericPickerComponent, OcupacaoFilterSetting, OcupacaoSearchDateField, OcupacaoSearchSetting, OcupacaoSearchTipoEntrada, Ordem, OxpiNglibModule, PagamentoRecebimentoSearchSetting, PaginatorComponent, PorOcupacaoTipo, Preferences, ProdutoAddDialogComponent, ProdutoBuscaFiltrosDialogComponent, ProdutoCategoriaCardapioAddDialogComponent, ProdutoCategoriaCardapioEditDialogComponent, ProdutoCategoriaCardapioSelecaoDialogComponent, ProdutoEditDialogComponent, ProdutoFormComponent, ProdutoGrupoAddDialogComponent, ProdutoGrupoEditDialogComponent, ProdutoGrupoFormComponent, ProdutoGrupoSelecaoDialogComponent, ProdutoSearchSetting, ProdutoSubgrupoAddDialogComponent, ProdutoSubgrupoEditDialogComponent, ProdutosCategoriasCardapioComponent, ProdutosComponent, ProdutosGruposComponent, ProdutosNcmDialogComponent, ProdutosSubgruposComponent, RadioButtonGroupComponent, SafeHtmlPipe, ScreenHelperService, SearchMode, SearchSetting, SuitesIntervencoesSetting, confirmaExclusao, createProduct, fadeAnimation, lateralAnimation, menuLateralAnimation, printHtml, printTxt, selectText, valNumberEmpty, valNumberMin, valTextEmpty, valTextMax, validaProduto, validaProdutoGrupo };
|
|
1196
3950
|
//# sourceMappingURL=oxpi-nglib.mjs.map
|