@senior-agronegocio/angular-components 0.0.57 → 0.0.59
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/bundles/senior-agronegocio-angular-components.umd.js +788 -681
- package/bundles/senior-agronegocio-angular-components.umd.js.map +1 -1
- package/bundles/senior-agronegocio-angular-components.umd.min.js +2 -2
- package/bundles/senior-agronegocio-angular-components.umd.min.js.map +1 -1
- package/common/agro-string-utils.class.d.ts +0 -13
- package/components/event-control-board/common/event-operation.d.ts +7 -1
- package/components/event-control-board/common/event-origin.d.ts +2 -1
- package/components/event-control-board/event-control-board.component.d.ts +10 -11
- package/components/event-control-board/index.d.ts +1 -0
- package/components/event-control-board/service/event-control-board.service.d.ts +3 -3
- package/components/event-control-board/service/fixation-entity/fixation-dto.d.ts +40 -0
- package/components/event-control-board/service/fixation-entity/fixation.module.d.ts +2 -0
- package/components/event-control-board/service/fixation-entity/fixation.service.d.ts +15 -0
- package/enums/agro-numbers.enum.d.ts +2 -1
- package/enums/fixation-status.d.ts +8 -0
- package/esm2015/common/agro-platform-utils.class.js +5 -6
- package/esm2015/common/agro-string-utils.class.js +58 -38
- package/esm2015/components/event-control-board/common/event-control-constants.js +8 -2
- package/esm2015/components/event-control-board/common/event-operation.js +7 -1
- package/esm2015/components/event-control-board/common/event-origin.js +2 -1
- package/esm2015/components/event-control-board/event-control-board.component.js +94 -104
- package/esm2015/components/event-control-board/event-control-board.module.js +7 -4
- package/esm2015/components/event-control-board/index.js +2 -1
- package/esm2015/components/event-control-board/service/event-control-board.service.js +10 -10
- package/esm2015/components/event-control-board/service/fixation-entity/fixation-dto.js +1 -0
- package/esm2015/components/event-control-board/service/fixation-entity/fixation.module.js +24 -0
- package/esm2015/components/event-control-board/service/fixation-entity/fixation.service.js +29 -0
- package/esm2015/enums/agro-numbers.enum.js +2 -1
- package/esm2015/enums/fixation-status.js +10 -0
- package/esm2015/form-validator/agro-form-validator.js +30 -39
- package/esm2015/services/i18n/en-US.js +17 -3
- package/esm2015/services/i18n/es-CO.js +17 -3
- package/esm2015/services/i18n/pt-BR.js +16 -2
- package/esm5/common/agro-platform-utils.class.js +5 -6
- package/esm5/common/agro-string-utils.class.js +58 -38
- package/esm5/components/event-control-board/common/event-control-constants.js +8 -2
- package/esm5/components/event-control-board/common/event-operation.js +7 -1
- package/esm5/components/event-control-board/common/event-origin.js +2 -1
- package/esm5/components/event-control-board/event-control-board.component.js +101 -111
- package/esm5/components/event-control-board/event-control-board.module.js +7 -4
- package/esm5/components/event-control-board/index.js +2 -1
- package/esm5/components/event-control-board/service/event-control-board.service.js +10 -10
- package/esm5/components/event-control-board/service/fixation-entity/fixation-dto.js +1 -0
- package/esm5/components/event-control-board/service/fixation-entity/fixation.module.js +27 -0
- package/esm5/components/event-control-board/service/fixation-entity/fixation.service.js +32 -0
- package/esm5/enums/agro-numbers.enum.js +2 -1
- package/esm5/enums/fixation-status.js +10 -0
- package/esm5/form-validator/agro-form-validator.js +31 -39
- package/esm5/services/i18n/en-US.js +17 -3
- package/esm5/services/i18n/es-CO.js +17 -3
- package/esm5/services/i18n/pt-BR.js +16 -2
- package/fesm2015/senior-agronegocio-angular-components.js +756 -657
- package/fesm2015/senior-agronegocio-angular-components.js.map +1 -1
- package/fesm5/senior-agronegocio-angular-components.js +790 -684
- package/fesm5/senior-agronegocio-angular-components.js.map +1 -1
- package/form-validator/agro-form-validator.d.ts +15 -17
- package/package.json +1 -1
- package/services/i18n/en-US.d.ts +14 -0
- package/services/i18n/es-CO.d.ts +14 -0
- package/services/i18n/pt-BR.d.ts +14 -0
- package/components/event-control-board/common/invoice-status.d.ts +0 -12
- package/components/event-control-board/common/invoice-type.d.ts +0 -5
- package/components/event-control-board/service/e012fam/e012fam.d.ts +0 -14
- package/components/event-control-board/service/e075der/e075der.d.ts +0 -18
- package/components/event-control-board/service/e113saf/e113saf.d.ts +0 -14
- package/components/event-control-board/service/e205dep/e205dep-dto.d.ts +0 -15
- package/components/event-control-board/service/e205dep/e205dep.d.ts +0 -16
- package/components/event-control-board/service/external-invoice/external-invoice.d.ts +0 -13
- package/components/event-control-board/service/invoice/invoice.d.ts +0 -21
- package/components/event-control-board/service/origination/operationType.d.ts +0 -5
- package/components/event-control-board/service/origination/origination.d.ts +0 -51
- package/components/event-control-board/service/producer-invoice/producer-invoice.d.ts +0 -27
- package/components/event-control-board/service/rural-estate/rural-estate.d.ts +0 -34
- package/components/event-control-board/service/ticket/ticket.d.ts +0 -18
- package/esm2015/components/event-control-board/common/invoice-status.js +0 -14
- package/esm2015/components/event-control-board/common/invoice-type.js +0 -7
- package/esm2015/components/event-control-board/service/e012fam/e012fam.js +0 -20
- package/esm2015/components/event-control-board/service/e075der/e075der.js +0 -31
- package/esm2015/components/event-control-board/service/e113saf/e113saf.js +0 -20
- package/esm2015/components/event-control-board/service/e205dep/e205dep-dto.js +0 -1
- package/esm2015/components/event-control-board/service/e205dep/e205dep.js +0 -20
- package/esm2015/components/event-control-board/service/external-invoice/external-invoice.js +0 -20
- package/esm2015/components/event-control-board/service/invoice/invoice.js +0 -43
- package/esm2015/components/event-control-board/service/origination/operationType.js +0 -7
- package/esm2015/components/event-control-board/service/origination/origination.js +0 -59
- package/esm2015/components/event-control-board/service/producer-invoice/producer-invoice.js +0 -32
- package/esm2015/components/event-control-board/service/rural-estate/rural-estate.js +0 -78
- package/esm2015/components/event-control-board/service/ticket/ticket.js +0 -39
- package/esm5/components/event-control-board/common/invoice-status.js +0 -14
- package/esm5/components/event-control-board/common/invoice-type.js +0 -7
- package/esm5/components/event-control-board/service/e012fam/e012fam.js +0 -25
- package/esm5/components/event-control-board/service/e075der/e075der.js +0 -36
- package/esm5/components/event-control-board/service/e113saf/e113saf.js +0 -25
- package/esm5/components/event-control-board/service/e205dep/e205dep-dto.js +0 -1
- package/esm5/components/event-control-board/service/e205dep/e205dep.js +0 -25
- package/esm5/components/event-control-board/service/external-invoice/external-invoice.js +0 -25
- package/esm5/components/event-control-board/service/invoice/invoice.js +0 -48
- package/esm5/components/event-control-board/service/origination/operationType.js +0 -7
- package/esm5/components/event-control-board/service/origination/origination.js +0 -62
- package/esm5/components/event-control-board/service/producer-invoice/producer-invoice.js +0 -37
- package/esm5/components/event-control-board/service/rural-estate/rural-estate.js +0 -83
- package/esm5/components/event-control-board/service/ticket/ticket.js +0 -44
|
@@ -210,6 +210,149 @@
|
|
|
210
210
|
DateComparisonType["lessThan"] = "lessThan";
|
|
211
211
|
})(exports.DateComparisonType || (exports.DateComparisonType = {}));
|
|
212
212
|
|
|
213
|
+
var AGRO_REGEX = {
|
|
214
|
+
/**
|
|
215
|
+
* Validação de E-mail
|
|
216
|
+
*/
|
|
217
|
+
isEmail: /^[^\s@]+@[^\s@]+\.[^\s@]+$/,
|
|
218
|
+
/**
|
|
219
|
+
* Validação de Números Inteiros Positivos
|
|
220
|
+
*/
|
|
221
|
+
positiveInteger: /^[1-9]\d*$/,
|
|
222
|
+
/**
|
|
223
|
+
* Validação de Números Decimais Positivos
|
|
224
|
+
*/
|
|
225
|
+
positiveDecimal: /^\d*\.?\d+$/,
|
|
226
|
+
/**
|
|
227
|
+
* Validação de string que consiste apenas em espaços em branco ou está vazia.
|
|
228
|
+
*/
|
|
229
|
+
onlyBlankSpaces: /^\s*$/,
|
|
230
|
+
/**
|
|
231
|
+
* Validação de CEP (Código Postal)
|
|
232
|
+
*/
|
|
233
|
+
zipCode: /^\d{8}$|^\d{5}-\d{3}$/,
|
|
234
|
+
/**
|
|
235
|
+
* Validação de String (qualquer caractere)
|
|
236
|
+
*/
|
|
237
|
+
isString: /^[\s\S]*$/,
|
|
238
|
+
/**
|
|
239
|
+
* Validação de UUID
|
|
240
|
+
*/
|
|
241
|
+
isUUID: /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/,
|
|
242
|
+
/**
|
|
243
|
+
* Validação de Número
|
|
244
|
+
*/
|
|
245
|
+
isNumber: /^-?\d+$/,
|
|
246
|
+
/**
|
|
247
|
+
* Validação de Número Decimal
|
|
248
|
+
*/
|
|
249
|
+
isDecimal: /^\d*\.?\d+$/,
|
|
250
|
+
/**
|
|
251
|
+
* Validação de Placa de Veículo
|
|
252
|
+
*/
|
|
253
|
+
isLicensePlate: /^[A-Za-z0-9]{1,7}-?[A-Za-z0-9]{1,7}$/,
|
|
254
|
+
/**
|
|
255
|
+
* Validação de Número de Telefone
|
|
256
|
+
*/
|
|
257
|
+
isPhoneNumber: /^\+?\d{1,4}-?\d{6,11}$/,
|
|
258
|
+
/**
|
|
259
|
+
* Validação de Data (Formato YYYY-MM-DD)
|
|
260
|
+
*/
|
|
261
|
+
isDate: /^\d{4}-\d{2}-\d{2}$/,
|
|
262
|
+
/**
|
|
263
|
+
* Validação de Hora (Formato HH:mm)
|
|
264
|
+
*/
|
|
265
|
+
isTime: /^(0\d|1\d|2[0-3]):[0-5]\d$/,
|
|
266
|
+
/**
|
|
267
|
+
* Validação de Data e Hora (Formato YYYY-MM-DD HH:mm)
|
|
268
|
+
*/
|
|
269
|
+
isDateTime: /^\d{4}-\d{2}-\d{2} (0\d|1\d|2[0-3]):[0-5]\d$/,
|
|
270
|
+
/**
|
|
271
|
+
* Validação de URL
|
|
272
|
+
*/
|
|
273
|
+
isURL: /^(http|https):\/\/([\w-]+\.)+[\w-]+(\/[\w- ./?%&=]*)?$/,
|
|
274
|
+
/**
|
|
275
|
+
* Validação de Número Hexadecimal
|
|
276
|
+
*/
|
|
277
|
+
isHexNumber: /^[0-9a-fA-F]+$/,
|
|
278
|
+
/**
|
|
279
|
+
* Validação de Base64
|
|
280
|
+
*/
|
|
281
|
+
isBase64: /^[a-zA-Z0-9+/]+={0,2}$/,
|
|
282
|
+
/**
|
|
283
|
+
* Validação de Nome de Usuário (3 a 20 caracteres alfanuméricos)
|
|
284
|
+
*/
|
|
285
|
+
isUsername: /^\w{3,20}$/,
|
|
286
|
+
/**
|
|
287
|
+
* Validação de Alfanumérico
|
|
288
|
+
*/
|
|
289
|
+
isAlphanumeric: /^[a-zA-Z0-9]+$/,
|
|
290
|
+
/**
|
|
291
|
+
* Validação de Slug (letras minúsculas, números e traços)
|
|
292
|
+
*/
|
|
293
|
+
isSlug: /^[a-z0-9-]+$/,
|
|
294
|
+
/**
|
|
295
|
+
* Validação de Número de Cartão de Crédito
|
|
296
|
+
*/
|
|
297
|
+
isCreditCard: /^\d{4}-\d{4}-\d{4}-\d{4}$/,
|
|
298
|
+
/**
|
|
299
|
+
* Validação de Número Hexadecimal
|
|
300
|
+
*/
|
|
301
|
+
isHexadecimal: /^[0-9a-fA-F]+$/,
|
|
302
|
+
/**
|
|
303
|
+
* Validação de Moeda
|
|
304
|
+
*/
|
|
305
|
+
isCurrency: /^\d+(\.\d{1,2})?$/,
|
|
306
|
+
/**
|
|
307
|
+
* Validação de Porcentagem
|
|
308
|
+
*/
|
|
309
|
+
isPercentage: /^(100(\.0{1,2})?|[1-9]?\d(\.\d{1,2})?)$/,
|
|
310
|
+
/**
|
|
311
|
+
* Validação de Tag HTML Simples
|
|
312
|
+
*/
|
|
313
|
+
isHTMLTag: /^<([a-z]+)([^<]+)*(?:>(.*)<\/\1>|\s+\/>)$/,
|
|
314
|
+
/**
|
|
315
|
+
* Validação de Nome de Usuário com Espaços (3 a 20 caracteres alfanuméricos e espaços)
|
|
316
|
+
*/
|
|
317
|
+
isUsernameWithSpaces: /^[a-zA-Z0-9_ ]{3,20}$/,
|
|
318
|
+
/**
|
|
319
|
+
* Validação de Senha Forte (mínimo 8 caracteres, uma letra minúscula, uma letra maiúscula, um número e um caractere especial)
|
|
320
|
+
*/
|
|
321
|
+
isStrongPassword: /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$/,
|
|
322
|
+
/**
|
|
323
|
+
* Validação de String Alfabética
|
|
324
|
+
*/
|
|
325
|
+
isAlphabetic: /^[a-zA-Z]+$/,
|
|
326
|
+
/**
|
|
327
|
+
* Validação de Hora no Formato de 12 Horas
|
|
328
|
+
*/
|
|
329
|
+
isTime12Hour: /^(0?[1-9]|1[0-2]):\d{2} (AM|PM)$/i,
|
|
330
|
+
/**
|
|
331
|
+
* Validação de Latitude
|
|
332
|
+
*/
|
|
333
|
+
isLatitude: /^[-+]?([1-8]?\d(\.\d+)?|90(\.0+)?)$/,
|
|
334
|
+
/**
|
|
335
|
+
* Validação de Longitude
|
|
336
|
+
*/
|
|
337
|
+
isLongitude: /^[-+]?(180(\.0+)?|((1[0-7]\d)|([1-9]?\d))(\.\d+)?)$/,
|
|
338
|
+
/**
|
|
339
|
+
* Validação de Endereço MAC
|
|
340
|
+
*/
|
|
341
|
+
isMACAddress: /^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$/,
|
|
342
|
+
/**
|
|
343
|
+
* Validação de Data de Expiração de Cartão de Crédito
|
|
344
|
+
*/
|
|
345
|
+
isCreditCardExpiration: /^(0[1-9]|1[0-2])\/\d{2}$/,
|
|
346
|
+
/**
|
|
347
|
+
* Validação de Número de Seguro Social (SSN)
|
|
348
|
+
*/
|
|
349
|
+
isSSN: /^\d{3}-\d{2}-\d{4}$/,
|
|
350
|
+
/**
|
|
351
|
+
* Validação se todos os dígitos são iguais
|
|
352
|
+
*/
|
|
353
|
+
isAllDigitsEqual: /^(.)\1+$/,
|
|
354
|
+
};
|
|
355
|
+
|
|
213
356
|
|
|
214
357
|
(function (NumberComparisonType) {
|
|
215
358
|
NumberComparisonType["EQUALS"] = "EQUALS";
|
|
@@ -1231,6 +1374,7 @@
|
|
|
1231
1374
|
AGRO_NUMBERS[AGRO_NUMBERS["TWO_HUNDRED_AND_TWENTY_ZERO"] = 220] = "TWO_HUNDRED_AND_TWENTY_ZERO";
|
|
1232
1375
|
AGRO_NUMBERS[AGRO_NUMBERS["TWO_HUNDRED_AND_TWO"] = 202] = "TWO_HUNDRED_AND_TWO";
|
|
1233
1376
|
AGRO_NUMBERS[AGRO_NUMBERS["ZERO"] = 0] = "ZERO";
|
|
1377
|
+
AGRO_NUMBERS[AGRO_NUMBERS["FIVE_SECONDS"] = 5000] = "FIVE_SECONDS";
|
|
1234
1378
|
})(exports.AGRO_NUMBERS || (exports.AGRO_NUMBERS = {}));
|
|
1235
1379
|
|
|
1236
1380
|
|
|
@@ -1558,76 +1702,310 @@
|
|
|
1558
1702
|
return AgroObjectUtils;
|
|
1559
1703
|
}());
|
|
1560
1704
|
|
|
1561
|
-
var
|
|
1562
|
-
function
|
|
1563
|
-
}
|
|
1564
|
-
AgroCookieUtils.getCookie = function (name, parseURIValue) {
|
|
1565
|
-
if (parseURIValue === void 0) { parseURIValue = false; }
|
|
1566
|
-
var cookieValue = document.cookie.split(';')
|
|
1567
|
-
.map(function (cookie) { return cookie.trim(); })
|
|
1568
|
-
.find(function (cookie) { return cookie.startsWith(name); });
|
|
1569
|
-
var result = cookieValue === null || cookieValue === void 0 ? void 0 : cookieValue.split('=')[1];
|
|
1570
|
-
if (parseURIValue && result) {
|
|
1571
|
-
result = decodeURIComponent(result);
|
|
1572
|
-
}
|
|
1573
|
-
return result;
|
|
1574
|
-
};
|
|
1575
|
-
AgroCookieUtils.parseCookieToObject = function (cookieString, parseURIString) {
|
|
1576
|
-
if (parseURIString === void 0) { parseURIString = false; }
|
|
1577
|
-
var cookieObject = {};
|
|
1578
|
-
if (parseURIString) {
|
|
1579
|
-
cookieString = decodeURIComponent(cookieString);
|
|
1580
|
-
}
|
|
1581
|
-
cookieString.split(';').forEach(function (cookie) {
|
|
1582
|
-
var _a = __read(cookie.split('=').map(function (c) { return c.trim(); }), 2), key = _a[0], value = _a[1];
|
|
1583
|
-
cookieObject[key] = value;
|
|
1584
|
-
});
|
|
1585
|
-
return cookieObject;
|
|
1586
|
-
};
|
|
1587
|
-
AgroCookieUtils.prototype.setCookie = function (name, value, days) {
|
|
1588
|
-
var date = new Date();
|
|
1589
|
-
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
|
|
1590
|
-
var expires = 'expires=' + date.toUTCString();
|
|
1591
|
-
document.cookie = name + '=' + value + ';' + expires + ';path=/';
|
|
1592
|
-
};
|
|
1593
|
-
return AgroCookieUtils;
|
|
1594
|
-
}());
|
|
1595
|
-
|
|
1596
|
-
var AgroDateUtils = /** @class */ (function () {
|
|
1597
|
-
function AgroDateUtils() {
|
|
1705
|
+
var AgroFormValidator = /** @class */ (function () {
|
|
1706
|
+
function AgroFormValidator() {
|
|
1598
1707
|
}
|
|
1599
1708
|
/**
|
|
1600
|
-
*
|
|
1601
|
-
*
|
|
1602
|
-
* @
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
* Verifica se uma data não é nula e não é indefinida.
|
|
1609
|
-
* @param date - A data a ser verificada.
|
|
1610
|
-
* @returns True se a data não for nula e não for indefinida, false caso contrário.
|
|
1709
|
+
* Validator para checar se o campo é um e-mail
|
|
1710
|
+
*
|
|
1711
|
+
* @example
|
|
1712
|
+
* this.myForm = this.fb.group({
|
|
1713
|
+
* EMAIL_FIELD: ['', [Validators.required, AgroFormValidator.emailValidator]]
|
|
1714
|
+
* });
|
|
1715
|
+
* @param control
|
|
1716
|
+
* @returns
|
|
1611
1717
|
*/
|
|
1612
|
-
|
|
1613
|
-
|
|
1718
|
+
AgroFormValidator.emailValidator = function (control) {
|
|
1719
|
+
if (control.value && !AGRO_REGEX.isEmail.test(control.value)) {
|
|
1720
|
+
control.setErrors({ emailValidator: true });
|
|
1721
|
+
return { emailValidator: true };
|
|
1722
|
+
}
|
|
1723
|
+
control.setErrors(null);
|
|
1724
|
+
return null;
|
|
1614
1725
|
};
|
|
1615
1726
|
/**
|
|
1616
|
-
*
|
|
1617
|
-
*
|
|
1618
|
-
*
|
|
1727
|
+
* Aplique esse validador em um campo do tipo Date, para verificar se a data selecionada é maior ou menor que a data atual.
|
|
1728
|
+
*
|
|
1729
|
+
* Utilize o parâmetro comparisonType para definir se a data selecionada deve ser maior ou menor que a data atual.
|
|
1730
|
+
* A validação será através do enum DateComparisonType.
|
|
1731
|
+
*
|
|
1732
|
+
* @example
|
|
1733
|
+
* this.myForm = this.fb.group({
|
|
1734
|
+
* NOME_CAMPO: ['', [Validators.required, AgroFormValidator.compareDateWithToday(DateComparisonType.greatherThan)]]
|
|
1735
|
+
* });
|
|
1736
|
+
* @param comparisonType
|
|
1737
|
+
* @returns
|
|
1619
1738
|
*/
|
|
1620
|
-
|
|
1621
|
-
|
|
1739
|
+
AgroFormValidator.compareDateWithToday = function (comparisonType) {
|
|
1740
|
+
var compareDate = function (control) {
|
|
1741
|
+
var _a, _b;
|
|
1742
|
+
var methodName = 'dateComparisonToday';
|
|
1743
|
+
var selectedDate = new Date(control.value);
|
|
1744
|
+
var currentDate = new Date();
|
|
1745
|
+
var conditions = (_a = {},
|
|
1746
|
+
_a[exports.DateComparisonType.greatherThan] = selectedDate <= currentDate,
|
|
1747
|
+
_a[exports.DateComparisonType.lessThan] = selectedDate >= currentDate,
|
|
1748
|
+
_a);
|
|
1749
|
+
if (conditions[comparisonType]) {
|
|
1750
|
+
return _b = {}, _b[methodName] = { value: control.value }, _b;
|
|
1751
|
+
}
|
|
1752
|
+
return null;
|
|
1753
|
+
};
|
|
1754
|
+
return compareDate;
|
|
1622
1755
|
};
|
|
1623
1756
|
/**
|
|
1624
|
-
*
|
|
1625
|
-
*
|
|
1626
|
-
*
|
|
1757
|
+
* Compara dois campos do tipo Date, verificando se o campo A é maior que o campo B. Se A for maior que B, então
|
|
1758
|
+
* o campo A é invalidado. Caso contrário, o campo A é validado.
|
|
1759
|
+
*
|
|
1760
|
+
* Aplique esse campo no FormGroup, passando os nomes dos campos que deseja comparar.
|
|
1761
|
+
* @example
|
|
1762
|
+
* this.myForm = this.fb.group({
|
|
1763
|
+
NOME_CAMPO_dateA: ['', Validators.required],
|
|
1764
|
+
NOME_CAMPO_dateB: ['', Validators.required]
|
|
1765
|
+
}, { validator: AgroFormValidator.dateComparisonValidator('NOME_CAMPO_dateA', 'NOME_CAMPO_dateB') });
|
|
1766
|
+
* @param controlNameA
|
|
1767
|
+
* @param controlNameB
|
|
1768
|
+
* @returns
|
|
1627
1769
|
*/
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1770
|
+
AgroFormValidator.compareDateWithOtherDateField = function (controlNameA, controlNameB) {
|
|
1771
|
+
var compareDate = function (control) {
|
|
1772
|
+
var _a, _b;
|
|
1773
|
+
var _c, _d, _e, _f, _g;
|
|
1774
|
+
var formGroup = control;
|
|
1775
|
+
var dateA = (_c = formGroup.get(controlNameA)) === null || _c === void 0 ? void 0 : _c.value;
|
|
1776
|
+
var dateB = (_d = formGroup.get(controlNameB)) === null || _d === void 0 ? void 0 : _d.value;
|
|
1777
|
+
var methodName = 'compareDateWithOtherDateField';
|
|
1778
|
+
if (dateA && dateB) {
|
|
1779
|
+
var dateAObj = new Date(dateA);
|
|
1780
|
+
var dateBObj = new Date(dateB);
|
|
1781
|
+
if (dateAObj < dateBObj) {
|
|
1782
|
+
(_e = formGroup.get(controlNameA)) === null || _e === void 0 ? void 0 : _e.setErrors((_a = {}, _a[methodName] = true, _a));
|
|
1783
|
+
return _b = {}, _b[methodName] = true, _b;
|
|
1784
|
+
}
|
|
1785
|
+
else if ((_f = formGroup.get(controlNameA)) === null || _f === void 0 ? void 0 : _f.hasError(methodName)) {
|
|
1786
|
+
(_g = formGroup.get(controlNameA)) === null || _g === void 0 ? void 0 : _g.setErrors(null);
|
|
1787
|
+
}
|
|
1788
|
+
}
|
|
1789
|
+
return null;
|
|
1790
|
+
};
|
|
1791
|
+
return compareDate;
|
|
1792
|
+
};
|
|
1793
|
+
/**
|
|
1794
|
+
* Validator para checar se o campo é um número de telefone de acordo com uma máscara informada.
|
|
1795
|
+
*
|
|
1796
|
+
* @example
|
|
1797
|
+
* this.myForm = this.fb.group({
|
|
1798
|
+
* TELEFONE_FIELD: ['', [Validators.required, AgroFormValidator.phoneValidator('(99) 9999-9999')]]
|
|
1799
|
+
* });
|
|
1800
|
+
* @param mask
|
|
1801
|
+
* @returns
|
|
1802
|
+
*/
|
|
1803
|
+
AgroFormValidator.phoneValidator = function (mask) {
|
|
1804
|
+
var phoneControlValidation = function (control) {
|
|
1805
|
+
var _a, _b;
|
|
1806
|
+
var methodName = 'phoneValidator';
|
|
1807
|
+
var regex = new RegExp("^" + mask.replace(/9/g, '\\d').replace(/\(/g, '\\(').replace(/\)/g, '\\)').replace(/-/g, '\\-') + "$");
|
|
1808
|
+
if (control.value && !regex.test(control.value)) {
|
|
1809
|
+
control.setErrors((_a = {}, _a[methodName] = true, _a));
|
|
1810
|
+
return _b = {}, _b[methodName] = true, _b;
|
|
1811
|
+
}
|
|
1812
|
+
control.setErrors(null);
|
|
1813
|
+
return null;
|
|
1814
|
+
};
|
|
1815
|
+
return phoneControlValidation;
|
|
1816
|
+
};
|
|
1817
|
+
/**
|
|
1818
|
+
* Validator para checar se um campo de números é maior ou menor que outro campo.
|
|
1819
|
+
*
|
|
1820
|
+
* Aplique esse validator no FormGroup, passando os nomes dos campos que deseja comparar.
|
|
1821
|
+
* @example
|
|
1822
|
+
* this.myForm = this.fb.group({
|
|
1823
|
+
* NUMERO_A: ['', Validators.required],
|
|
1824
|
+
* NUMERO_B: ['', Validators.required]
|
|
1825
|
+
* }, { validator: AgroFormValidator.compareNumberFields('NUMERO_A', 'NUMERO_B', NumberComparisonType.EQUALS) });
|
|
1826
|
+
*
|
|
1827
|
+
* Neste caso, a verificação será se o NUMERO_A é igual ao NUMERB_B.
|
|
1828
|
+
* @param controlNameA
|
|
1829
|
+
* @param controlNameB
|
|
1830
|
+
* @returns
|
|
1831
|
+
*/
|
|
1832
|
+
AgroFormValidator.compareNumberFields = function (controlNameA, controlNameB, comparisonMethod) {
|
|
1833
|
+
var compareNumber = function (control) {
|
|
1834
|
+
var _a, _b, _c;
|
|
1835
|
+
var _d, _e, _f;
|
|
1836
|
+
var formGroup = control;
|
|
1837
|
+
var numberA = (_d = formGroup.get(controlNameA)) === null || _d === void 0 ? void 0 : _d.value;
|
|
1838
|
+
var numberB = (_e = formGroup.get(controlNameB)) === null || _e === void 0 ? void 0 : _e.value;
|
|
1839
|
+
var methodName = 'compareNumberFields';
|
|
1840
|
+
if (numberA && numberB) {
|
|
1841
|
+
var errorType = exports.NumberComparisonType[comparisonMethod];
|
|
1842
|
+
var errorCondition = (_a = {},
|
|
1843
|
+
_a[exports.NumberComparisonType.EQUALS] = numberA !== numberB,
|
|
1844
|
+
_a[exports.NumberComparisonType.GREATER_THAN] = numberA <= numberB,
|
|
1845
|
+
_a[exports.NumberComparisonType.LESS_THAN] = numberA >= numberB,
|
|
1846
|
+
_a[exports.NumberComparisonType.GREATER_THAN_OR_EQUAL] = numberA < numberB,
|
|
1847
|
+
_a[exports.NumberComparisonType.LESS_THAN_OR_EQUAL] = numberA > numberB,
|
|
1848
|
+
_a[exports.NumberComparisonType.NOT_EQUALS] = numberA === numberB,
|
|
1849
|
+
_a);
|
|
1850
|
+
if (errorCondition[comparisonMethod]) {
|
|
1851
|
+
var controlA = formGroup.get(controlNameA);
|
|
1852
|
+
if (controlA) {
|
|
1853
|
+
controlA.setErrors((_b = {}, _b[methodName] = comparisonMethod, _b));
|
|
1854
|
+
}
|
|
1855
|
+
return _c = {}, _c[methodName] = errorType, _c;
|
|
1856
|
+
}
|
|
1857
|
+
else if ((_f = formGroup.get(controlNameA)) === null || _f === void 0 ? void 0 : _f.hasError(methodName)) {
|
|
1858
|
+
var controlA = formGroup.get(controlNameA);
|
|
1859
|
+
if (controlA) {
|
|
1860
|
+
controlA.setErrors(null);
|
|
1861
|
+
}
|
|
1862
|
+
}
|
|
1863
|
+
}
|
|
1864
|
+
return null;
|
|
1865
|
+
};
|
|
1866
|
+
return compareNumber;
|
|
1867
|
+
};
|
|
1868
|
+
/**
|
|
1869
|
+
* Validator para checar se um valor está entre os demais valores de três formControls.
|
|
1870
|
+
*
|
|
1871
|
+
* Aplique esse validator no FormGroup, passando os nomes dos três formControls que deseja comparar.
|
|
1872
|
+
* @example
|
|
1873
|
+
* this.myForm = this.fb.group({
|
|
1874
|
+
* minorFormControl: ['', Validators.required],
|
|
1875
|
+
* targetFormControl: ['', Validators.required],
|
|
1876
|
+
* majorFormControl: ['', Validators.required]
|
|
1877
|
+
* }, { validator: AgroFormValidator.checkValueBetween('minorFormControl', 'targetFormControl', 'majorFormControl') });
|
|
1878
|
+
*
|
|
1879
|
+
* Neste caso, a verificação será se o targetFormControl está entre o minorFormControl e o majorFormControl.
|
|
1880
|
+
* @param minorFormControl
|
|
1881
|
+
* @param targetFormControl
|
|
1882
|
+
* @param majorFormControl
|
|
1883
|
+
* @returns
|
|
1884
|
+
*/
|
|
1885
|
+
AgroFormValidator.checkValueBetween = function (minorFormControl, targetFormControl, majorFormControl) {
|
|
1886
|
+
var checkValue = function (control) {
|
|
1887
|
+
var _a, _b;
|
|
1888
|
+
var _c, _d, _e, _f;
|
|
1889
|
+
var formGroup = control;
|
|
1890
|
+
var valueA = (_c = formGroup.get(minorFormControl)) === null || _c === void 0 ? void 0 : _c.value;
|
|
1891
|
+
var valueB = (_d = formGroup.get(targetFormControl)) === null || _d === void 0 ? void 0 : _d.value;
|
|
1892
|
+
var valueC = (_e = formGroup.get(majorFormControl)) === null || _e === void 0 ? void 0 : _e.value;
|
|
1893
|
+
var methodName = 'checkValueBetween';
|
|
1894
|
+
if (valueA && valueB && valueC) {
|
|
1895
|
+
if (valueB < valueA || valueB > valueC) {
|
|
1896
|
+
var targetControl = formGroup.get(targetFormControl);
|
|
1897
|
+
if (targetControl) {
|
|
1898
|
+
targetControl.setErrors((_a = {}, _a[methodName] = true, _a));
|
|
1899
|
+
}
|
|
1900
|
+
return _b = {}, _b[methodName] = true, _b;
|
|
1901
|
+
}
|
|
1902
|
+
else if ((_f = formGroup.get(targetFormControl)) === null || _f === void 0 ? void 0 : _f.hasError(methodName)) {
|
|
1903
|
+
var targetControl = formGroup.get(targetFormControl);
|
|
1904
|
+
if (targetControl) {
|
|
1905
|
+
targetControl.setErrors(null);
|
|
1906
|
+
}
|
|
1907
|
+
}
|
|
1908
|
+
}
|
|
1909
|
+
return null;
|
|
1910
|
+
};
|
|
1911
|
+
return checkValue;
|
|
1912
|
+
};
|
|
1913
|
+
/**
|
|
1914
|
+
* Validator para checar se o campo é um objeto e se possui uma propriedade específica.
|
|
1915
|
+
*
|
|
1916
|
+
* @example
|
|
1917
|
+
* this.myForm = this.fb.group({
|
|
1918
|
+
* OBJETO_FIELD: ['', [Validators.required, AgroFormValidator.objectPropertyValidator('propriedade')]]
|
|
1919
|
+
* });
|
|
1920
|
+
* @param propertyName
|
|
1921
|
+
* @returns
|
|
1922
|
+
*/
|
|
1923
|
+
AgroFormValidator.objectPropertyValidator = function (propertyName) {
|
|
1924
|
+
var objectProperty = function (control) {
|
|
1925
|
+
var _a, _b;
|
|
1926
|
+
var methodName = 'objectProperty';
|
|
1927
|
+
if (AgroObjectUtils.isObject(control.value) && AgroObjectUtils.containsProperty(control.value, propertyName)) {
|
|
1928
|
+
control.setErrors(null);
|
|
1929
|
+
return null;
|
|
1930
|
+
}
|
|
1931
|
+
control.setErrors((_a = {}, _a[methodName] = true, _a));
|
|
1932
|
+
return _b = {}, _b[methodName] = true, _b;
|
|
1933
|
+
};
|
|
1934
|
+
return objectProperty;
|
|
1935
|
+
};
|
|
1936
|
+
return AgroFormValidator;
|
|
1937
|
+
}());
|
|
1938
|
+
|
|
1939
|
+
var AgroCookieUtils = /** @class */ (function () {
|
|
1940
|
+
function AgroCookieUtils() {
|
|
1941
|
+
}
|
|
1942
|
+
AgroCookieUtils.getCookie = function (name, parseURIValue) {
|
|
1943
|
+
if (parseURIValue === void 0) { parseURIValue = false; }
|
|
1944
|
+
var cookieValue = document.cookie.split(';')
|
|
1945
|
+
.map(function (cookie) { return cookie.trim(); })
|
|
1946
|
+
.find(function (cookie) { return cookie.startsWith(name); });
|
|
1947
|
+
var result = cookieValue === null || cookieValue === void 0 ? void 0 : cookieValue.split('=')[1];
|
|
1948
|
+
if (parseURIValue && result) {
|
|
1949
|
+
result = decodeURIComponent(result);
|
|
1950
|
+
}
|
|
1951
|
+
return result;
|
|
1952
|
+
};
|
|
1953
|
+
AgroCookieUtils.parseCookieToObject = function (cookieString, parseURIString) {
|
|
1954
|
+
if (parseURIString === void 0) { parseURIString = false; }
|
|
1955
|
+
var cookieObject = {};
|
|
1956
|
+
if (parseURIString) {
|
|
1957
|
+
cookieString = decodeURIComponent(cookieString);
|
|
1958
|
+
}
|
|
1959
|
+
cookieString.split(';').forEach(function (cookie) {
|
|
1960
|
+
var _a = __read(cookie.split('=').map(function (c) { return c.trim(); }), 2), key = _a[0], value = _a[1];
|
|
1961
|
+
cookieObject[key] = value;
|
|
1962
|
+
});
|
|
1963
|
+
return cookieObject;
|
|
1964
|
+
};
|
|
1965
|
+
AgroCookieUtils.prototype.setCookie = function (name, value, days) {
|
|
1966
|
+
var date = new Date();
|
|
1967
|
+
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
|
|
1968
|
+
var expires = 'expires=' + date.toUTCString();
|
|
1969
|
+
document.cookie = name + '=' + value + ';' + expires + ';path=/';
|
|
1970
|
+
};
|
|
1971
|
+
return AgroCookieUtils;
|
|
1972
|
+
}());
|
|
1973
|
+
|
|
1974
|
+
var AgroDateUtils = /** @class */ (function () {
|
|
1975
|
+
function AgroDateUtils() {
|
|
1976
|
+
}
|
|
1977
|
+
/**
|
|
1978
|
+
* Verifica se uma data é nula ou indefinida.
|
|
1979
|
+
* @param date - A data a ser verificada.
|
|
1980
|
+
* @returns True se a data for nula ou indefinida, false caso contrário.
|
|
1981
|
+
*/
|
|
1982
|
+
AgroDateUtils.isNullOrUndefined = function (date) {
|
|
1983
|
+
return date === null || date === undefined;
|
|
1984
|
+
};
|
|
1985
|
+
/**
|
|
1986
|
+
* Verifica se uma data não é nula e não é indefinida.
|
|
1987
|
+
* @param date - A data a ser verificada.
|
|
1988
|
+
* @returns True se a data não for nula e não for indefinida, false caso contrário.
|
|
1989
|
+
*/
|
|
1990
|
+
AgroDateUtils.isNotNullOrUndefined = function (date) {
|
|
1991
|
+
return !AgroDateUtils.isNullOrUndefined(date);
|
|
1992
|
+
};
|
|
1993
|
+
/**
|
|
1994
|
+
* Verifica se uma data é válida.
|
|
1995
|
+
* @param date - A data a ser verificada.
|
|
1996
|
+
* @returns True se a data for válida, false caso contrário.
|
|
1997
|
+
*/
|
|
1998
|
+
AgroDateUtils.isValid = function (date) {
|
|
1999
|
+
return !isNaN(Date.parse(date));
|
|
2000
|
+
};
|
|
2001
|
+
/**
|
|
2002
|
+
* Verifica se uma data é inválida.
|
|
2003
|
+
* @param date - A data a ser verificada.
|
|
2004
|
+
* @returns True se a data for inválida, false caso contrário.
|
|
2005
|
+
*/
|
|
2006
|
+
AgroDateUtils.isInvalid = function (date) {
|
|
2007
|
+
return !AgroDateUtils.isValid(date);
|
|
2008
|
+
};
|
|
1631
2009
|
/**
|
|
1632
2010
|
* Verifica se uma data é antes de outra data.
|
|
1633
2011
|
* @param date - A data a ser verificada.
|
|
@@ -1713,149 +2091,6 @@
|
|
|
1713
2091
|
return AgroDateUtils;
|
|
1714
2092
|
}());
|
|
1715
2093
|
|
|
1716
|
-
var AGRO_REGEX = {
|
|
1717
|
-
/**
|
|
1718
|
-
* Validação de E-mail
|
|
1719
|
-
*/
|
|
1720
|
-
isEmail: /^[^\s@]+@[^\s@]+\.[^\s@]+$/,
|
|
1721
|
-
/**
|
|
1722
|
-
* Validação de Números Inteiros Positivos
|
|
1723
|
-
*/
|
|
1724
|
-
positiveInteger: /^[1-9]\d*$/,
|
|
1725
|
-
/**
|
|
1726
|
-
* Validação de Números Decimais Positivos
|
|
1727
|
-
*/
|
|
1728
|
-
positiveDecimal: /^\d*\.?\d+$/,
|
|
1729
|
-
/**
|
|
1730
|
-
* Validação de string que consiste apenas em espaços em branco ou está vazia.
|
|
1731
|
-
*/
|
|
1732
|
-
onlyBlankSpaces: /^\s*$/,
|
|
1733
|
-
/**
|
|
1734
|
-
* Validação de CEP (Código Postal)
|
|
1735
|
-
*/
|
|
1736
|
-
zipCode: /^\d{8}$|^\d{5}-\d{3}$/,
|
|
1737
|
-
/**
|
|
1738
|
-
* Validação de String (qualquer caractere)
|
|
1739
|
-
*/
|
|
1740
|
-
isString: /^[\s\S]*$/,
|
|
1741
|
-
/**
|
|
1742
|
-
* Validação de UUID
|
|
1743
|
-
*/
|
|
1744
|
-
isUUID: /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/,
|
|
1745
|
-
/**
|
|
1746
|
-
* Validação de Número
|
|
1747
|
-
*/
|
|
1748
|
-
isNumber: /^-?\d+$/,
|
|
1749
|
-
/**
|
|
1750
|
-
* Validação de Número Decimal
|
|
1751
|
-
*/
|
|
1752
|
-
isDecimal: /^\d*\.?\d+$/,
|
|
1753
|
-
/**
|
|
1754
|
-
* Validação de Placa de Veículo
|
|
1755
|
-
*/
|
|
1756
|
-
isLicensePlate: /^[A-Za-z0-9]{1,7}-?[A-Za-z0-9]{1,7}$/,
|
|
1757
|
-
/**
|
|
1758
|
-
* Validação de Número de Telefone
|
|
1759
|
-
*/
|
|
1760
|
-
isPhoneNumber: /^\+?\d{1,4}-?\d{6,11}$/,
|
|
1761
|
-
/**
|
|
1762
|
-
* Validação de Data (Formato YYYY-MM-DD)
|
|
1763
|
-
*/
|
|
1764
|
-
isDate: /^\d{4}-\d{2}-\d{2}$/,
|
|
1765
|
-
/**
|
|
1766
|
-
* Validação de Hora (Formato HH:mm)
|
|
1767
|
-
*/
|
|
1768
|
-
isTime: /^(0\d|1\d|2[0-3]):[0-5]\d$/,
|
|
1769
|
-
/**
|
|
1770
|
-
* Validação de Data e Hora (Formato YYYY-MM-DD HH:mm)
|
|
1771
|
-
*/
|
|
1772
|
-
isDateTime: /^\d{4}-\d{2}-\d{2} (0\d|1\d|2[0-3]):[0-5]\d$/,
|
|
1773
|
-
/**
|
|
1774
|
-
* Validação de URL
|
|
1775
|
-
*/
|
|
1776
|
-
isURL: /^(http|https):\/\/([\w-]+\.)+[\w-]+(\/[\w- ./?%&=]*)?$/,
|
|
1777
|
-
/**
|
|
1778
|
-
* Validação de Número Hexadecimal
|
|
1779
|
-
*/
|
|
1780
|
-
isHexNumber: /^[0-9a-fA-F]+$/,
|
|
1781
|
-
/**
|
|
1782
|
-
* Validação de Base64
|
|
1783
|
-
*/
|
|
1784
|
-
isBase64: /^[a-zA-Z0-9+/]+={0,2}$/,
|
|
1785
|
-
/**
|
|
1786
|
-
* Validação de Nome de Usuário (3 a 20 caracteres alfanuméricos)
|
|
1787
|
-
*/
|
|
1788
|
-
isUsername: /^\w{3,20}$/,
|
|
1789
|
-
/**
|
|
1790
|
-
* Validação de Alfanumérico
|
|
1791
|
-
*/
|
|
1792
|
-
isAlphanumeric: /^[a-zA-Z0-9]+$/,
|
|
1793
|
-
/**
|
|
1794
|
-
* Validação de Slug (letras minúsculas, números e traços)
|
|
1795
|
-
*/
|
|
1796
|
-
isSlug: /^[a-z0-9-]+$/,
|
|
1797
|
-
/**
|
|
1798
|
-
* Validação de Número de Cartão de Crédito
|
|
1799
|
-
*/
|
|
1800
|
-
isCreditCard: /^\d{4}-\d{4}-\d{4}-\d{4}$/,
|
|
1801
|
-
/**
|
|
1802
|
-
* Validação de Número Hexadecimal
|
|
1803
|
-
*/
|
|
1804
|
-
isHexadecimal: /^[0-9a-fA-F]+$/,
|
|
1805
|
-
/**
|
|
1806
|
-
* Validação de Moeda
|
|
1807
|
-
*/
|
|
1808
|
-
isCurrency: /^\d+(\.\d{1,2})?$/,
|
|
1809
|
-
/**
|
|
1810
|
-
* Validação de Porcentagem
|
|
1811
|
-
*/
|
|
1812
|
-
isPercentage: /^(100(\.0{1,2})?|[1-9]?\d(\.\d{1,2})?)$/,
|
|
1813
|
-
/**
|
|
1814
|
-
* Validação de Tag HTML Simples
|
|
1815
|
-
*/
|
|
1816
|
-
isHTMLTag: /^<([a-z]+)([^<]+)*(?:>(.*)<\/\1>|\s+\/>)$/,
|
|
1817
|
-
/**
|
|
1818
|
-
* Validação de Nome de Usuário com Espaços (3 a 20 caracteres alfanuméricos e espaços)
|
|
1819
|
-
*/
|
|
1820
|
-
isUsernameWithSpaces: /^[a-zA-Z0-9_ ]{3,20}$/,
|
|
1821
|
-
/**
|
|
1822
|
-
* Validação de Senha Forte (mínimo 8 caracteres, uma letra minúscula, uma letra maiúscula, um número e um caractere especial)
|
|
1823
|
-
*/
|
|
1824
|
-
isStrongPassword: /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$/,
|
|
1825
|
-
/**
|
|
1826
|
-
* Validação de String Alfabética
|
|
1827
|
-
*/
|
|
1828
|
-
isAlphabetic: /^[a-zA-Z]+$/,
|
|
1829
|
-
/**
|
|
1830
|
-
* Validação de Hora no Formato de 12 Horas
|
|
1831
|
-
*/
|
|
1832
|
-
isTime12Hour: /^(0?[1-9]|1[0-2]):\d{2} (AM|PM)$/i,
|
|
1833
|
-
/**
|
|
1834
|
-
* Validação de Latitude
|
|
1835
|
-
*/
|
|
1836
|
-
isLatitude: /^[-+]?([1-8]?\d(\.\d+)?|90(\.0+)?)$/,
|
|
1837
|
-
/**
|
|
1838
|
-
* Validação de Longitude
|
|
1839
|
-
*/
|
|
1840
|
-
isLongitude: /^[-+]?(180(\.0+)?|((1[0-7]\d)|([1-9]?\d))(\.\d+)?)$/,
|
|
1841
|
-
/**
|
|
1842
|
-
* Validação de Endereço MAC
|
|
1843
|
-
*/
|
|
1844
|
-
isMACAddress: /^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$/,
|
|
1845
|
-
/**
|
|
1846
|
-
* Validação de Data de Expiração de Cartão de Crédito
|
|
1847
|
-
*/
|
|
1848
|
-
isCreditCardExpiration: /^(0[1-9]|1[0-2])\/\d{2}$/,
|
|
1849
|
-
/**
|
|
1850
|
-
* Validação de Número de Seguro Social (SSN)
|
|
1851
|
-
*/
|
|
1852
|
-
isSSN: /^\d{3}-\d{2}-\d{4}$/,
|
|
1853
|
-
/**
|
|
1854
|
-
* Validação se todos os dígitos são iguais
|
|
1855
|
-
*/
|
|
1856
|
-
isAllDigitsEqual: /^(.)\1+$/,
|
|
1857
|
-
};
|
|
1858
|
-
|
|
1859
2094
|
/**
|
|
1860
2095
|
* Classe utilitária para operações de string.
|
|
1861
2096
|
*/
|
|
@@ -2108,31 +2343,70 @@
|
|
|
2108
2343
|
return matches ? matches.length : exports.AGRO_NUMBERS.ZERO;
|
|
2109
2344
|
};
|
|
2110
2345
|
AgroStringUtils.validateCPF = function (cpf) {
|
|
2346
|
+
// Remover caracteres não numéricos
|
|
2111
2347
|
cpf = cpf.replace(/\D/g, "");
|
|
2112
|
-
|
|
2348
|
+
// Verificar se o CPF tem 11 dígitos
|
|
2349
|
+
if (cpf.length !== exports.AGRO_NUMBERS.ELEVEN) {
|
|
2350
|
+
return false;
|
|
2351
|
+
}
|
|
2352
|
+
// Verificar se todos os dígitos são iguais (caso contrário, é um sinal de CPF inválido)
|
|
2353
|
+
if (/^(\d)\1{10}$/.test(cpf)) {
|
|
2354
|
+
return false;
|
|
2355
|
+
}
|
|
2356
|
+
// Calcular o primeiro dígito verificador
|
|
2357
|
+
var sum = exports.AGRO_NUMBERS.ZERO;
|
|
2358
|
+
var remainder;
|
|
2359
|
+
for (var i = exports.AGRO_NUMBERS.ONE; i <= exports.AGRO_NUMBERS.NINE; i++) {
|
|
2360
|
+
sum += parseInt(cpf[i - exports.AGRO_NUMBERS.ONE]) * (exports.AGRO_NUMBERS.ELEVEN - i);
|
|
2361
|
+
}
|
|
2362
|
+
remainder = sum % exports.AGRO_NUMBERS.ELEVEN;
|
|
2363
|
+
if (remainder === exports.AGRO_NUMBERS.TEN || remainder === exports.AGRO_NUMBERS.ELEVEN) {
|
|
2364
|
+
remainder = exports.AGRO_NUMBERS.ZERO;
|
|
2365
|
+
}
|
|
2366
|
+
if (remainder !== parseInt(cpf[exports.AGRO_NUMBERS.NINE])) {
|
|
2367
|
+
return false;
|
|
2368
|
+
}
|
|
2369
|
+
// Calcular o segundo dígito verificador
|
|
2370
|
+
sum = exports.AGRO_NUMBERS.ZERO;
|
|
2371
|
+
for (var i = exports.AGRO_NUMBERS.ONE; i <= exports.AGRO_NUMBERS.TEN; i++) {
|
|
2372
|
+
sum += parseInt(cpf[i - exports.AGRO_NUMBERS.ONE]) * (exports.AGRO_NUMBERS.TWELVE - i);
|
|
2373
|
+
}
|
|
2374
|
+
remainder = sum % exports.AGRO_NUMBERS.ELEVEN;
|
|
2375
|
+
if (remainder === exports.AGRO_NUMBERS.TEN || remainder === exports.AGRO_NUMBERS.ELEVEN) {
|
|
2376
|
+
remainder = exports.AGRO_NUMBERS.ZERO;
|
|
2377
|
+
}
|
|
2378
|
+
if (remainder !== parseInt(cpf[exports.AGRO_NUMBERS.TEN])) {
|
|
2113
2379
|
return false;
|
|
2114
2380
|
}
|
|
2115
|
-
|
|
2116
|
-
var sum = 0;
|
|
2117
|
-
for (var i = 0; i < length; i++) {
|
|
2118
|
-
sum += Number(cpf[i]) * (length + 1 - i);
|
|
2119
|
-
}
|
|
2120
|
-
var remainder = sum % 11;
|
|
2121
|
-
return remainder < 2 ? 0 : 11 - remainder;
|
|
2122
|
-
};
|
|
2123
|
-
return calcCheckDigit(9) === Number(cpf[9]) && calcCheckDigit(10) === Number(cpf[10]);
|
|
2381
|
+
return true;
|
|
2124
2382
|
};
|
|
2125
2383
|
AgroStringUtils.validateCNPJ = function (cnpj) {
|
|
2384
|
+
// Remove todos os caracteres não numéricos
|
|
2126
2385
|
cnpj = cnpj.replace(/\D/g, "");
|
|
2127
|
-
|
|
2386
|
+
// Verifica se tem 14 dígitos
|
|
2387
|
+
if (cnpj.length !== 14)
|
|
2128
2388
|
return false;
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2389
|
+
// Verifica se o CNPJ é uma sequência repetida (ex: 11111111111111, 22222222222222, etc.)
|
|
2390
|
+
if (/^(\d)\1{13}$/.test(cnpj))
|
|
2391
|
+
return false;
|
|
2392
|
+
// Cálculo do primeiro dígito verificador
|
|
2393
|
+
var soma = 0;
|
|
2394
|
+
var pesos1 = [5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2];
|
|
2395
|
+
for (var i = 0; i < 12; i++) {
|
|
2396
|
+
soma += parseInt(cnpj.charAt(i)) * pesos1[i];
|
|
2397
|
+
}
|
|
2398
|
+
var resto = soma % 11;
|
|
2399
|
+
var digito1 = resto < 2 ? 0 : 11 - resto;
|
|
2400
|
+
// Cálculo do segundo dígito verificador
|
|
2401
|
+
soma = 0;
|
|
2402
|
+
var pesos2 = [6, 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2];
|
|
2403
|
+
for (var i = 0; i < 13; i++) {
|
|
2404
|
+
soma += parseInt(cnpj.charAt(i)) * pesos2[i];
|
|
2405
|
+
}
|
|
2406
|
+
resto = soma % 11;
|
|
2407
|
+
var digito2 = resto < 2 ? 0 : 11 - resto;
|
|
2408
|
+
// Verifica se os dígitos verificadores são válidos
|
|
2409
|
+
return parseInt(cnpj.charAt(12)) === digito1 && parseInt(cnpj.charAt(13)) === digito2;
|
|
2136
2410
|
};
|
|
2137
2411
|
/**
|
|
2138
2412
|
* Método para aplicar uma máscara em uma string. Considere a máscara com valores 9 para aplicação
|
|
@@ -2192,25 +2466,6 @@
|
|
|
2192
2466
|
AgroStringUtils.isInvalid = function (str) {
|
|
2193
2467
|
return !AgroStringUtils.isValid(str);
|
|
2194
2468
|
};
|
|
2195
|
-
/**
|
|
2196
|
-
* Valida se uma string é um e-mail válido ou não
|
|
2197
|
-
* Retorna um booleano para indicar se é um e-mail válido ou não
|
|
2198
|
-
* @param email - A string a ser verificada
|
|
2199
|
-
* @returns True se a string for um e-mail válido, false caso contrário
|
|
2200
|
-
*/
|
|
2201
|
-
AgroStringUtils.isValidEmail = function (email) {
|
|
2202
|
-
return AGRO_REGEX.isEmail.test(email);
|
|
2203
|
-
};
|
|
2204
|
-
/**
|
|
2205
|
-
* Valida se uma string é uma placa de veículo BR válida ou não.
|
|
2206
|
-
* Retorna um booleano para indicar se é uma placa válida ou não.
|
|
2207
|
-
* @param plate - A string a ser verificada
|
|
2208
|
-
*/
|
|
2209
|
-
AgroStringUtils.isValidLicensePlate = function (plate) {
|
|
2210
|
-
var oldFormat = /^[A-Z]{3}-?\d{4}$/;
|
|
2211
|
-
var mercosulFormat = /^[A-Z]{3}\d[A-Z]\d{2}$/;
|
|
2212
|
-
return oldFormat.test(plate) || mercosulFormat.test(plate);
|
|
2213
|
-
};
|
|
2214
2469
|
return AgroStringUtils;
|
|
2215
2470
|
}());
|
|
2216
2471
|
|
|
@@ -2256,11 +2511,10 @@
|
|
|
2256
2511
|
*/
|
|
2257
2512
|
AgroPlatformUtils.getCurrentUserName = function () {
|
|
2258
2513
|
var _a;
|
|
2259
|
-
var cookie = AgroCookieUtils.getCookie('com.senior.token'
|
|
2514
|
+
var cookie = AgroCookieUtils.getCookie('com.senior.token');
|
|
2260
2515
|
if (cookie) {
|
|
2261
|
-
var str = (_a =
|
|
2516
|
+
var str = (_a = AgroCookieUtils.parseCookieToObject(cookie)) === null || _a === void 0 ? void 0 : _a.fullName;
|
|
2262
2517
|
if (str) {
|
|
2263
|
-
str = str.replace(/\+/g, ' ');
|
|
2264
2518
|
return str;
|
|
2265
2519
|
}
|
|
2266
2520
|
}
|
|
@@ -2273,9 +2527,9 @@
|
|
|
2273
2527
|
*/
|
|
2274
2528
|
AgroPlatformUtils.getCurrentUserEmail = function () {
|
|
2275
2529
|
var _a;
|
|
2276
|
-
var cookie = AgroCookieUtils.getCookie('com.senior.token'
|
|
2530
|
+
var cookie = AgroCookieUtils.getCookie('com.senior.token');
|
|
2277
2531
|
if (cookie) {
|
|
2278
|
-
var str = (_a =
|
|
2532
|
+
var str = (_a = AgroCookieUtils.parseCookieToObject(cookie)) === null || _a === void 0 ? void 0 : _a.email;
|
|
2279
2533
|
if (str) {
|
|
2280
2534
|
return str;
|
|
2281
2535
|
}
|
|
@@ -2623,268 +2877,26 @@
|
|
|
2623
2877
|
/**
|
|
2624
2878
|
* Localiza um item em um array de objetos de acordo com a propriedade e valor informados.
|
|
2625
2879
|
*/
|
|
2626
|
-
AgroArrayUtils.findItemByProperty = function (array, property, value) {
|
|
2627
|
-
var e_1, _a;
|
|
2628
|
-
try {
|
|
2629
|
-
for (var array_1 = __values(array), array_1_1 = array_1.next(); !array_1_1.done; array_1_1 = array_1.next()) {
|
|
2630
|
-
var item = array_1_1.value;
|
|
2631
|
-
if (item[property] === value) {
|
|
2632
|
-
return item;
|
|
2633
|
-
}
|
|
2634
|
-
}
|
|
2635
|
-
}
|
|
2636
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
2637
|
-
finally {
|
|
2638
|
-
try {
|
|
2639
|
-
if (array_1_1 && !array_1_1.done && (_a = array_1.return)) _a.call(array_1);
|
|
2640
|
-
}
|
|
2641
|
-
finally { if (e_1) throw e_1.error; }
|
|
2642
|
-
}
|
|
2643
|
-
return null;
|
|
2644
|
-
};
|
|
2645
|
-
return AgroArrayUtils;
|
|
2646
|
-
}());
|
|
2647
|
-
|
|
2648
|
-
var AgroFormValidator = /** @class */ (function () {
|
|
2649
|
-
function AgroFormValidator() {
|
|
2650
|
-
}
|
|
2651
|
-
/**
|
|
2652
|
-
* Validator para checar se o campo é um e-mail
|
|
2653
|
-
*
|
|
2654
|
-
* @example
|
|
2655
|
-
* this.myForm = this.fb.group({
|
|
2656
|
-
* EMAIL_FIELD: ['', [Validators.required, AgroFormValidator.emailValidator]]
|
|
2657
|
-
* });
|
|
2658
|
-
* @param control
|
|
2659
|
-
* @returns
|
|
2660
|
-
*/
|
|
2661
|
-
AgroFormValidator.emailValidator = function (control) {
|
|
2662
|
-
var email = control.value;
|
|
2663
|
-
if (!email) {
|
|
2664
|
-
return null;
|
|
2665
|
-
}
|
|
2666
|
-
return AgroStringUtils.isValidEmail(email) ? null : { emailValidator: true };
|
|
2667
|
-
};
|
|
2668
|
-
/**
|
|
2669
|
-
* Aplique esse validador em um campo do tipo Date, para verificar se a data selecionada é maior ou menor que a data atual.
|
|
2670
|
-
*
|
|
2671
|
-
* Utilize o parâmetro comparisonType para definir se a data selecionada deve ser maior ou menor que a data atual.
|
|
2672
|
-
* A validação será através do enum DateComparisonType.
|
|
2673
|
-
*
|
|
2674
|
-
* @example
|
|
2675
|
-
* this.myForm = this.fb.group({
|
|
2676
|
-
* NOME_CAMPO: ['', [Validators.required, AgroFormValidator.compareDateWithToday(DateComparisonType.greatherThan)]]
|
|
2677
|
-
* });
|
|
2678
|
-
* @param comparisonType
|
|
2679
|
-
* @returns
|
|
2680
|
-
*/
|
|
2681
|
-
AgroFormValidator.compareDateWithToday = function (comparisonType) {
|
|
2682
|
-
var compareDate = function (control) {
|
|
2683
|
-
var _a, _b;
|
|
2684
|
-
var methodName = 'dateComparisonToday';
|
|
2685
|
-
var selectedDate = new Date(control.value);
|
|
2686
|
-
var currentDate = new Date();
|
|
2687
|
-
var conditions = (_a = {},
|
|
2688
|
-
_a[exports.DateComparisonType.greatherThan] = selectedDate <= currentDate,
|
|
2689
|
-
_a[exports.DateComparisonType.lessThan] = selectedDate >= currentDate,
|
|
2690
|
-
_a);
|
|
2691
|
-
if (conditions[comparisonType]) {
|
|
2692
|
-
return _b = {}, _b[methodName] = { value: control.value }, _b;
|
|
2693
|
-
}
|
|
2694
|
-
return null;
|
|
2695
|
-
};
|
|
2696
|
-
return compareDate;
|
|
2697
|
-
};
|
|
2698
|
-
/**
|
|
2699
|
-
* Compara dois campos do tipo Date, verificando se o campo A é maior que o campo B. Se A for maior que B, então
|
|
2700
|
-
* o campo A é invalidado. Caso contrário, o campo A é validado.
|
|
2701
|
-
*
|
|
2702
|
-
* Aplique esse campo no FormGroup, passando os nomes dos campos que deseja comparar.
|
|
2703
|
-
* @example
|
|
2704
|
-
* this.myForm = this.fb.group({
|
|
2705
|
-
NOME_CAMPO_dateA: ['', Validators.required],
|
|
2706
|
-
NOME_CAMPO_dateB: ['', Validators.required]
|
|
2707
|
-
}, { validator: AgroFormValidator.dateComparisonValidator('NOME_CAMPO_dateA', 'NOME_CAMPO_dateB') });
|
|
2708
|
-
* @param controlNameA
|
|
2709
|
-
* @param controlNameB
|
|
2710
|
-
* @returns
|
|
2711
|
-
*/
|
|
2712
|
-
AgroFormValidator.compareDateWithOtherDateField = function (controlNameA, controlNameB) {
|
|
2713
|
-
var compareDate = function (control) {
|
|
2714
|
-
var _a, _b;
|
|
2715
|
-
var _c, _d, _e, _f, _g;
|
|
2716
|
-
var formGroup = control;
|
|
2717
|
-
var dateA = (_c = formGroup.get(controlNameA)) === null || _c === void 0 ? void 0 : _c.value;
|
|
2718
|
-
var dateB = (_d = formGroup.get(controlNameB)) === null || _d === void 0 ? void 0 : _d.value;
|
|
2719
|
-
var methodName = 'compareDateWithOtherDateField';
|
|
2720
|
-
if (dateA && dateB) {
|
|
2721
|
-
var dateAObj = new Date(dateA);
|
|
2722
|
-
var dateBObj = new Date(dateB);
|
|
2723
|
-
if (dateAObj < dateBObj) {
|
|
2724
|
-
(_e = formGroup.get(controlNameA)) === null || _e === void 0 ? void 0 : _e.setErrors((_a = {}, _a[methodName] = true, _a));
|
|
2725
|
-
return _b = {}, _b[methodName] = true, _b;
|
|
2726
|
-
}
|
|
2727
|
-
else if ((_f = formGroup.get(controlNameA)) === null || _f === void 0 ? void 0 : _f.hasError(methodName)) {
|
|
2728
|
-
(_g = formGroup.get(controlNameA)) === null || _g === void 0 ? void 0 : _g.setErrors(null);
|
|
2729
|
-
}
|
|
2730
|
-
}
|
|
2731
|
-
return null;
|
|
2732
|
-
};
|
|
2733
|
-
return compareDate;
|
|
2734
|
-
};
|
|
2735
|
-
/**
|
|
2736
|
-
* Validator para checar se um campo de números é maior ou menor que outro campo.
|
|
2737
|
-
*
|
|
2738
|
-
* Aplique esse validator no FormGroup, passando os nomes dos campos que deseja comparar.
|
|
2739
|
-
* @example
|
|
2740
|
-
* this.myForm = this.fb.group({
|
|
2741
|
-
* NUMERO_A: ['', Validators.required],
|
|
2742
|
-
* NUMERO_B: ['', Validators.required]
|
|
2743
|
-
* }, { validator: AgroFormValidator.compareNumberFields('NUMERO_A', 'NUMERO_B', NumberComparisonType.EQUALS) });
|
|
2744
|
-
*
|
|
2745
|
-
* Neste caso, a verificação será se o NUMERO_A é igual ao NUMERB_B.
|
|
2746
|
-
* @param controlNameA
|
|
2747
|
-
* @param controlNameB
|
|
2748
|
-
* @returns
|
|
2749
|
-
*/
|
|
2750
|
-
AgroFormValidator.compareNumberFields = function (controlNameA, controlNameB, comparisonMethod) {
|
|
2751
|
-
var compareNumber = function (control) {
|
|
2752
|
-
var _a, _b, _c;
|
|
2753
|
-
var _d, _e, _f;
|
|
2754
|
-
var formGroup = control;
|
|
2755
|
-
var numberA = (_d = formGroup.get(controlNameA)) === null || _d === void 0 ? void 0 : _d.value;
|
|
2756
|
-
var numberB = (_e = formGroup.get(controlNameB)) === null || _e === void 0 ? void 0 : _e.value;
|
|
2757
|
-
var methodName = 'compareNumberFields';
|
|
2758
|
-
if (numberA && numberB) {
|
|
2759
|
-
var errorType = exports.NumberComparisonType[comparisonMethod];
|
|
2760
|
-
var errorCondition = (_a = {},
|
|
2761
|
-
_a[exports.NumberComparisonType.EQUALS] = numberA !== numberB,
|
|
2762
|
-
_a[exports.NumberComparisonType.GREATER_THAN] = numberA <= numberB,
|
|
2763
|
-
_a[exports.NumberComparisonType.LESS_THAN] = numberA >= numberB,
|
|
2764
|
-
_a[exports.NumberComparisonType.GREATER_THAN_OR_EQUAL] = numberA < numberB,
|
|
2765
|
-
_a[exports.NumberComparisonType.LESS_THAN_OR_EQUAL] = numberA > numberB,
|
|
2766
|
-
_a[exports.NumberComparisonType.NOT_EQUALS] = numberA === numberB,
|
|
2767
|
-
_a);
|
|
2768
|
-
if (errorCondition[comparisonMethod]) {
|
|
2769
|
-
var controlA = formGroup.get(controlNameA);
|
|
2770
|
-
if (controlA) {
|
|
2771
|
-
controlA.setErrors((_b = {}, _b[methodName] = comparisonMethod, _b));
|
|
2772
|
-
}
|
|
2773
|
-
return _c = {}, _c[methodName] = errorType, _c;
|
|
2774
|
-
}
|
|
2775
|
-
else if ((_f = formGroup.get(controlNameA)) === null || _f === void 0 ? void 0 : _f.hasError(methodName)) {
|
|
2776
|
-
var controlA = formGroup.get(controlNameA);
|
|
2777
|
-
if (controlA) {
|
|
2778
|
-
controlA.setErrors(null);
|
|
2779
|
-
}
|
|
2780
|
-
}
|
|
2781
|
-
}
|
|
2782
|
-
return null;
|
|
2783
|
-
};
|
|
2784
|
-
return compareNumber;
|
|
2785
|
-
};
|
|
2786
|
-
/**
|
|
2787
|
-
* Validator para checar se um valor está entre os demais valores de três formControls.
|
|
2788
|
-
*
|
|
2789
|
-
* Aplique esse validator no FormGroup, passando os nomes dos três formControls que deseja comparar.
|
|
2790
|
-
* @example
|
|
2791
|
-
* this.myForm = this.fb.group({
|
|
2792
|
-
* minorFormControl: ['', Validators.required],
|
|
2793
|
-
* targetFormControl: ['', Validators.required],
|
|
2794
|
-
* majorFormControl: ['', Validators.required]
|
|
2795
|
-
* }, { validator: AgroFormValidator.checkValueBetween('minorFormControl', 'targetFormControl', 'majorFormControl') });
|
|
2796
|
-
*
|
|
2797
|
-
* Neste caso, a verificação será se o targetFormControl está entre o minorFormControl e o majorFormControl.
|
|
2798
|
-
* @param minorFormControl
|
|
2799
|
-
* @param targetFormControl
|
|
2800
|
-
* @param majorFormControl
|
|
2801
|
-
* @returns
|
|
2802
|
-
*/
|
|
2803
|
-
AgroFormValidator.checkValueBetween = function (minorFormControl, targetFormControl, majorFormControl) {
|
|
2804
|
-
var checkValue = function (control) {
|
|
2805
|
-
var _a, _b;
|
|
2806
|
-
var _c, _d, _e, _f;
|
|
2807
|
-
var formGroup = control;
|
|
2808
|
-
var valueA = (_c = formGroup.get(minorFormControl)) === null || _c === void 0 ? void 0 : _c.value;
|
|
2809
|
-
var valueB = (_d = formGroup.get(targetFormControl)) === null || _d === void 0 ? void 0 : _d.value;
|
|
2810
|
-
var valueC = (_e = formGroup.get(majorFormControl)) === null || _e === void 0 ? void 0 : _e.value;
|
|
2811
|
-
var methodName = 'checkValueBetween';
|
|
2812
|
-
if (valueA && valueB && valueC) {
|
|
2813
|
-
if (valueB < valueA || valueB > valueC) {
|
|
2814
|
-
var targetControl = formGroup.get(targetFormControl);
|
|
2815
|
-
if (targetControl) {
|
|
2816
|
-
targetControl.setErrors((_a = {}, _a[methodName] = true, _a));
|
|
2817
|
-
}
|
|
2818
|
-
return _b = {}, _b[methodName] = true, _b;
|
|
2819
|
-
}
|
|
2820
|
-
else if ((_f = formGroup.get(targetFormControl)) === null || _f === void 0 ? void 0 : _f.hasError(methodName)) {
|
|
2821
|
-
var targetControl = formGroup.get(targetFormControl);
|
|
2822
|
-
if (targetControl) {
|
|
2823
|
-
targetControl.setErrors(null);
|
|
2824
|
-
}
|
|
2825
|
-
}
|
|
2826
|
-
}
|
|
2827
|
-
return null;
|
|
2828
|
-
};
|
|
2829
|
-
return checkValue;
|
|
2830
|
-
};
|
|
2831
|
-
/**
|
|
2832
|
-
* Validator para checar se o campo é um objeto e se possui uma propriedade específica.
|
|
2833
|
-
*
|
|
2834
|
-
* @example
|
|
2835
|
-
* this.myForm = this.fb.group({
|
|
2836
|
-
* OBJETO_FIELD: ['', [Validators.required, AgroFormValidator.objectPropertyValidator('propriedade')]]
|
|
2837
|
-
* });
|
|
2838
|
-
* @param propertyName
|
|
2839
|
-
* @returns
|
|
2840
|
-
*/
|
|
2841
|
-
AgroFormValidator.objectPropertyValidator = function (propertyName) {
|
|
2842
|
-
var objectProperty = function (control) {
|
|
2843
|
-
var _a, _b;
|
|
2844
|
-
var methodName = 'objectProperty';
|
|
2845
|
-
if (AgroObjectUtils.isObject(control.value) && AgroObjectUtils.containsProperty(control.value, propertyName)) {
|
|
2846
|
-
control.setErrors(null);
|
|
2847
|
-
return null;
|
|
2848
|
-
}
|
|
2849
|
-
control.setErrors((_a = {}, _a[methodName] = true, _a));
|
|
2850
|
-
return _b = {}, _b[methodName] = true, _b;
|
|
2851
|
-
};
|
|
2852
|
-
return objectProperty;
|
|
2853
|
-
};
|
|
2854
|
-
/**
|
|
2855
|
-
* Verifica se a string informada é um CPF válido.
|
|
2856
|
-
* Se a validação for false, retorna um objeto com a chave cpfValidator.
|
|
2857
|
-
*/
|
|
2858
|
-
AgroFormValidator.CPFValidator = function (control) {
|
|
2859
|
-
var cpf = control.value;
|
|
2860
|
-
if (!cpf) {
|
|
2861
|
-
return null;
|
|
2862
|
-
}
|
|
2863
|
-
return AgroStringUtils.validateCPF(cpf) ? null : { cpfValidator: true };
|
|
2864
|
-
};
|
|
2865
|
-
/**
|
|
2866
|
-
* Verifica se a string informada é um CNPJ válido.
|
|
2867
|
-
* Se a validação for false, retorna um objeto com a chave cnpjValidator.
|
|
2868
|
-
*/
|
|
2869
|
-
AgroFormValidator.CNPJValidator = function (control) {
|
|
2870
|
-
var cnpj = control.value;
|
|
2871
|
-
if (!cnpj) {
|
|
2872
|
-
return null;
|
|
2873
|
-
}
|
|
2874
|
-
return AgroStringUtils.validateCNPJ(cnpj) ? null : { cnpjValidator: true };
|
|
2875
|
-
};
|
|
2876
|
-
/**
|
|
2877
|
-
* Verifica se a string informada é uma placa de veículo válido.
|
|
2878
|
-
* Se a validação for false, retorna um objeto com a chave licensePlate.
|
|
2879
|
-
*/
|
|
2880
|
-
AgroFormValidator.licensePlateValidator = function (control) {
|
|
2881
|
-
var plate = control.value;
|
|
2882
|
-
if (!plate) {
|
|
2883
|
-
return null;
|
|
2880
|
+
AgroArrayUtils.findItemByProperty = function (array, property, value) {
|
|
2881
|
+
var e_1, _a;
|
|
2882
|
+
try {
|
|
2883
|
+
for (var array_1 = __values(array), array_1_1 = array_1.next(); !array_1_1.done; array_1_1 = array_1.next()) {
|
|
2884
|
+
var item = array_1_1.value;
|
|
2885
|
+
if (item[property] === value) {
|
|
2886
|
+
return item;
|
|
2887
|
+
}
|
|
2888
|
+
}
|
|
2889
|
+
}
|
|
2890
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
2891
|
+
finally {
|
|
2892
|
+
try {
|
|
2893
|
+
if (array_1_1 && !array_1_1.done && (_a = array_1.return)) _a.call(array_1);
|
|
2894
|
+
}
|
|
2895
|
+
finally { if (e_1) throw e_1.error; }
|
|
2884
2896
|
}
|
|
2885
|
-
return
|
|
2897
|
+
return null;
|
|
2886
2898
|
};
|
|
2887
|
-
return
|
|
2899
|
+
return AgroArrayUtils;
|
|
2888
2900
|
}());
|
|
2889
2901
|
|
|
2890
2902
|
var AsyncLock = /** @class */ (function () {
|
|
@@ -3467,7 +3479,7 @@
|
|
|
3467
3479
|
"agro.angular_components.ticket": "Ticket",
|
|
3468
3480
|
"agro.angular_components.company": "Empresa",
|
|
3469
3481
|
"agro.angular_components.label_branch": "Filial",
|
|
3470
|
-
"agro.angular_components.event_sidebar_title": "Evento - {
|
|
3482
|
+
"agro.angular_components.event_sidebar_title": "Evento - {event}",
|
|
3471
3483
|
"agro.angular_components.reprocessing_event_message_title": "Reprocessando Evento",
|
|
3472
3484
|
"agro.angular_components.reprocessing_event_message_description": "O evento selecionado está sendo reprocessado.",
|
|
3473
3485
|
"agro.angular_components.error_reprocessing_event_message_title": "Erro ao reprocessar evento",
|
|
@@ -3636,6 +3648,20 @@
|
|
|
3636
3648
|
"agro.angular_components.TRANSFER_CREATE_INCOMING_INVOICE": "Criação da nota fiscal de entrada da transferencia",
|
|
3637
3649
|
"agro.angular_components.TRANSFER_CREATE_OUTGOING_INVOICE": "Criação da nota fiscal de saida da transferencia",
|
|
3638
3650
|
"agro.angular_components.TRANSFER_PRODUCER_BALANCE": "Transferência de saldo entre produtores",
|
|
3651
|
+
"agro.angular_components.control_code": "Identificador",
|
|
3652
|
+
"agro.angular_components.fixation_event": "Fixação",
|
|
3653
|
+
"agro.angular_components.FINISH_FINANCIAL_FIXATION": "Baixa de títulos",
|
|
3654
|
+
"agro.angular_components.FINISH_PRODUCER_NET_VALUE_FIXATION": "Atualização de saldos",
|
|
3655
|
+
"agro.angular_components.CONCLUDE_FIXATION": "Conclusão da fixação",
|
|
3656
|
+
"agro.angular_components.CANCEL_FINANCIAL_FIXATION": "Cancela baixa de títulos",
|
|
3657
|
+
"agro.angular_components.CANCEL_PRODUCER_NET_VALUE_FIXATION": "Reverte atualização de saldos",
|
|
3658
|
+
"agro.angular_components.CANCEL_FIXATION": "Cancela fixação",
|
|
3659
|
+
"agro.angular_components.cancel_fixation_title": "Cancelar fixação",
|
|
3660
|
+
"agro.angular_components.cancel_fixation_description": "Tem certeza que deseja cancelar a fixação?",
|
|
3661
|
+
"agro.angular_components.error_cancel_fixation_message_title": "Erro ao cancelar fixação",
|
|
3662
|
+
"agro.angular_components.error_cancel_fixation_message_description": "Houve um erro ao cancelar a fixação. Tente novamente mais tarde.",
|
|
3663
|
+
"agro.angular_components.cancel_fixation_message_title": "Cancelamento de fixação",
|
|
3664
|
+
"agro.angular_components.cancel_fixation_message_description": "O processo de cancelamento da fixação foi iniciado com sucesso."
|
|
3639
3665
|
};
|
|
3640
3666
|
|
|
3641
3667
|
var enUS = {
|
|
@@ -3664,7 +3690,7 @@
|
|
|
3664
3690
|
"agro.angular_components.balance_entry_control_event": "Balance Entry/Exit",
|
|
3665
3691
|
"agro.angular_components.event_origin_label": "Event origin",
|
|
3666
3692
|
"agro.angular_components.event_details_header": "Event Details",
|
|
3667
|
-
"agro.angular_components.registers_found": "{
|
|
3693
|
+
"agro.angular_components.registers_found": "{total} record(s) found",
|
|
3668
3694
|
"agro.angular_components.change_request_event": "Weight Change",
|
|
3669
3695
|
"agro.angular_components.status_label": "Status",
|
|
3670
3696
|
"agro.angular_components.panel_title_events_completed_successfully": "Success",
|
|
@@ -3672,7 +3698,7 @@
|
|
|
3672
3698
|
"agro.angular_components.ticket": "Ticket",
|
|
3673
3699
|
"agro.angular_components.company": "Company",
|
|
3674
3700
|
"agro.angular_components.label_branch": "Branch",
|
|
3675
|
-
"agro.angular_components.event_sidebar_title": "Event - {
|
|
3701
|
+
"agro.angular_components.event_sidebar_title": "Event - {event}",
|
|
3676
3702
|
"agro.angular_components.reprocessing_event_message_title": "Reprocessing Event",
|
|
3677
3703
|
"agro.angular_components.reprocessing_event_message_description": "The selected event is being reprocessed.",
|
|
3678
3704
|
"agro.angular_components.error_reprocessing_event_message_title": "Error reprocessing event",
|
|
@@ -3841,6 +3867,20 @@
|
|
|
3841
3867
|
"agro.angular_components.TRANSFER_CREATE_INCOMING_INVOICE": "Creation of invoice transfer input",
|
|
3842
3868
|
"agro.angular_components.TRANSFER_CREATE_OUTGOING_INVOICE": "Creation of the outgoing transfer invoice",
|
|
3843
3869
|
"agro.angular_components.TRANSFER_PRODUCER_BALANCE": "Balance transfer between producers",
|
|
3870
|
+
"agro.angular_components.control_code": "Identifier",
|
|
3871
|
+
"agro.angular_components.fixation_event": "Fixation",
|
|
3872
|
+
"agro.angular_components.FINISH_FINANCIAL_FIXATION": "Financial settlement",
|
|
3873
|
+
"agro.angular_components.FINISH_PRODUCER_NET_VALUE_FIXATION": "Balance update",
|
|
3874
|
+
"agro.angular_components.CONCLUDE_FIXATION": "Fixation conclusion",
|
|
3875
|
+
"agro.angular_components.CANCEL_FINANCIAL_FIXATION": "Cancel financial fixation",
|
|
3876
|
+
"agro.angular_components.CANCEL_PRODUCER_NET_VALUE_FIXATION": "Cancel producer net value fixation",
|
|
3877
|
+
"agro.angular_components.CANCEL_FIXATION": "Cancel fixation",
|
|
3878
|
+
"agro.angular_components.cancel_fixation_title": "Cancel fixation",
|
|
3879
|
+
"agro.angular_components.cancel_fixation_description": "Are you sure you want to cancel the fixation?",
|
|
3880
|
+
"agro.angular_components.error_cancel_fixation_message_title": "Error canceling fixation",
|
|
3881
|
+
"agro.angular_components.error_cancel_fixation_message_description": "An error occurred while canceling the fixation. Please try again later.",
|
|
3882
|
+
"agro.angular_components.cancel_fixation_message_title": "Fixation cancellation",
|
|
3883
|
+
"agro.angular_components.cancel_fixation_message_description": "The fixation cancellation process has been successfully initiated."
|
|
3844
3884
|
};
|
|
3845
3885
|
|
|
3846
3886
|
var esCO = {
|
|
@@ -3869,7 +3909,7 @@
|
|
|
3869
3909
|
"agro.angular_components.balance_entry_control_event": "Entrada/salida balanza",
|
|
3870
3910
|
"agro.angular_components.event_origin_label": "Origen del evento",
|
|
3871
3911
|
"agro.angular_components.event_details_header": "Detalles del Evento",
|
|
3872
|
-
"agro.angular_components.registers_found": "{
|
|
3912
|
+
"agro.angular_components.registers_found": "{total} registro(s) encontrado(s)",
|
|
3873
3913
|
"agro.angular_components.change_request_event": "Cambio de Pesaje",
|
|
3874
3914
|
"agro.angular_components.status_label": "Estado",
|
|
3875
3915
|
"agro.angular_components.panel_title_events_completed_successfully": "Éxito",
|
|
@@ -3877,7 +3917,7 @@
|
|
|
3877
3917
|
"agro.angular_components.ticket": "Ticket",
|
|
3878
3918
|
"agro.angular_components.company": "Empresa",
|
|
3879
3919
|
"agro.angular_components.label_branch": "Sucursal",
|
|
3880
|
-
"agro.angular_components.event_sidebar_title": "Evento - {
|
|
3920
|
+
"agro.angular_components.event_sidebar_title": "Evento - {event}",
|
|
3881
3921
|
"agro.angular_components.reprocessing_event_message_title": "Reprocesando Evento",
|
|
3882
3922
|
"agro.angular_components.reprocessing_event_message_description": "El evento seleccionado está siendo reprocesado.",
|
|
3883
3923
|
"agro.angular_components.error_reprocessing_event_message_title": "Error al reprocesar evento",
|
|
@@ -4046,6 +4086,20 @@
|
|
|
4046
4086
|
"agro.angular_components.TRANSFER_CREATE_INCOMING_INVOICE": "Creación de la factura entrante de transferencia",
|
|
4047
4087
|
"agro.angular_components.TRANSFER_CREATE_OUTGOING_INVOICE": "Creación de la factura de transferencia saliente",
|
|
4048
4088
|
"agro.angular_components.TRANSFER_PRODUCER_BALANCE": "Transferir saldo entre productores",
|
|
4089
|
+
"agro.angular_components.control_code": "Identificador",
|
|
4090
|
+
"agro.angular_components.fixation_event": "Fijación",
|
|
4091
|
+
"agro.angular_components.FINISH_FINANCIAL_FIXATION": "Liquidación financiera",
|
|
4092
|
+
"agro.angular_components.FINISH_PRODUCER_NET_VALUE_FIXATION": "Actualización de saldos",
|
|
4093
|
+
"agro.angular_components.CONCLUDE_FIXATION": "Conclusión de la fijación",
|
|
4094
|
+
"agro.angular_components.CANCEL_FINANCIAL_FIXATION": "Cancelar fijación financiera",
|
|
4095
|
+
"agro.angular_components.CANCEL_PRODUCER_NET_VALUE_FIXATION": "Cancelar fijación de valor neto del productor",
|
|
4096
|
+
"agro.angular_components.CANCEL_FIXATION": "Cancelar fijación",
|
|
4097
|
+
"agro.angular_components.cancel_fixation_title": "Cancelar fijación",
|
|
4098
|
+
"agro.angular_components.cancel_fixation_description": "¿Está seguro de que desea cancelar la fijación?",
|
|
4099
|
+
"agro.angular_components.error_cancel_fixation_message_title": "Error al cancelar la fijación",
|
|
4100
|
+
"agro.angular_components.error_cancel_fixation_message_description": "Ocurrió un error al cancelar la fijación. Por favor, inténtelo de nuevo más tarde.",
|
|
4101
|
+
"agro.angular_components.cancel_fixation_message_title": "Cancelación de fijación",
|
|
4102
|
+
"agro.angular_components.cancel_fixation_message_description": "El proceso de cancelación de la fijación se ha iniciado con éxito."
|
|
4049
4103
|
};
|
|
4050
4104
|
|
|
4051
4105
|
var LibTranslationService = /** @class */ (function () {
|
|
@@ -4203,6 +4257,12 @@
|
|
|
4203
4257
|
EventOperation["TRANSFER_CREATE_INCOMING_INVOICE"] = "TRANSFER_CREATE_INCOMING_INVOICE";
|
|
4204
4258
|
EventOperation["TRANSFER_CREATE_OUTGOING_INVOICE"] = "TRANSFER_CREATE_OUTGOING_INVOICE";
|
|
4205
4259
|
EventOperation["TRANSFER_PRODUCER_BALANCE"] = "TRANSFER_PRODUCER_BALANCE";
|
|
4260
|
+
EventOperation["FINISH_FINANCIAL_FIXATION"] = "FINISH_FINANCIAL_FIXATION";
|
|
4261
|
+
EventOperation["FINISH_PRODUCER_NET_VALUE_FIXATION"] = "FINISH_PRODUCER_NET_VALUE_FIXATION";
|
|
4262
|
+
EventOperation["CONCLUDE_FIXATION"] = "CONCLUDE_FIXATION";
|
|
4263
|
+
EventOperation["CANCEL_FINANCIAL_FIXATION"] = "CANCEL_FINANCIAL_FIXATION";
|
|
4264
|
+
EventOperation["CANCEL_PRODUCER_NET_VALUE_FIXATION"] = "CANCEL_PRODUCER_NET_VALUE_FIXATION";
|
|
4265
|
+
EventOperation["CANCEL_FIXATION"] = "CANCEL_FIXATION";
|
|
4206
4266
|
})(EventOperation || (EventOperation = {}));
|
|
4207
4267
|
|
|
4208
4268
|
var EventOrigin;
|
|
@@ -4213,6 +4273,7 @@
|
|
|
4213
4273
|
EventOrigin["TRANSFER"] = "TRANSFER";
|
|
4214
4274
|
EventOrigin["CHANGE_REQUEST"] = "CHANGE_REQUEST";
|
|
4215
4275
|
EventOrigin["CREATE_INVOICE"] = "CREATE_INVOICE";
|
|
4276
|
+
EventOrigin["FIXATION"] = "FIXATION";
|
|
4216
4277
|
})(EventOrigin || (EventOrigin = {}));
|
|
4217
4278
|
|
|
4218
4279
|
var eventOrigin = [
|
|
@@ -4230,7 +4291,7 @@
|
|
|
4230
4291
|
{ label: "agro.angular_components.effective_confirmation_event", value: EventOperation.EFFECTIVE_CONFIRMATION },
|
|
4231
4292
|
{ label: "agro.angular_components.change_request_event_summary", value: EventOperation.CHANGE_REQUEST },
|
|
4232
4293
|
{ label: "agro.angular_components.change_response_event", value: EventOperation.CHANGE_RESPONSE },
|
|
4233
|
-
{ label: "agro.angular_components.
|
|
4294
|
+
{ label: "agro.angular_components.fixation_event", value: EventOperation.PROCESS_FIXATION },
|
|
4234
4295
|
{ label: "agro.angular_components." + EventOperation.CANCEL_INVOICE, value: EventOperation.CANCEL_INVOICE },
|
|
4235
4296
|
{ label: "agro.angular_components." + EventOperation.REPROCESS_INVOICE, value: EventOperation.REPROCESS_INVOICE },
|
|
4236
4297
|
{ label: "agro.angular_components." + EventOperation.EFFECTIVE_CONFIRMATION, value: EventOperation.EFFECTIVE_CONFIRMATION },
|
|
@@ -4240,6 +4301,12 @@
|
|
|
4240
4301
|
{ label: "agro.angular_components." + EventOperation.TRANSFER_CREATE_INCOMING_INVOICE, value: EventOperation.TRANSFER_CREATE_INCOMING_INVOICE },
|
|
4241
4302
|
{ label: "agro.angular_components." + EventOperation.TRANSFER_CREATE_OUTGOING_INVOICE, value: EventOperation.TRANSFER_CREATE_OUTGOING_INVOICE },
|
|
4242
4303
|
{ label: "agro.angular_components." + EventOperation.TRANSFER_PRODUCER_BALANCE, value: EventOperation.TRANSFER_PRODUCER_BALANCE },
|
|
4304
|
+
{ label: "agro.angular_components." + EventOperation.FINISH_FINANCIAL_FIXATION, value: EventOperation.FINISH_FINANCIAL_FIXATION },
|
|
4305
|
+
{ label: "agro.angular_components." + EventOperation.FINISH_PRODUCER_NET_VALUE_FIXATION, value: EventOperation.FINISH_PRODUCER_NET_VALUE_FIXATION },
|
|
4306
|
+
{ label: "agro.angular_components." + EventOperation.CONCLUDE_FIXATION, value: EventOperation.CONCLUDE_FIXATION },
|
|
4307
|
+
{ label: "agro.angular_components." + EventOperation.CANCEL_FINANCIAL_FIXATION, value: EventOperation.CANCEL_FINANCIAL_FIXATION },
|
|
4308
|
+
{ label: "agro.angular_components." + EventOperation.CANCEL_PRODUCER_NET_VALUE_FIXATION, value: EventOperation.CANCEL_PRODUCER_NET_VALUE_FIXATION },
|
|
4309
|
+
{ label: "agro.angular_components." + EventOperation.CANCEL_FIXATION, value: EventOperation.CANCEL_FIXATION },
|
|
4243
4310
|
];
|
|
4244
4311
|
var eventStatus = [
|
|
4245
4312
|
{ label: "agro.angular_components.panel_title_events_completed_successfully", value: EventStatus.SUCCESS },
|
|
@@ -4449,61 +4516,6 @@
|
|
|
4449
4516
|
return ProducerInvoiceService;
|
|
4450
4517
|
}(EntityService));
|
|
4451
4518
|
|
|
4452
|
-
var TicketService = /** @class */ (function (_super) {
|
|
4453
|
-
__extends(TicketService, _super);
|
|
4454
|
-
function TicketService(http, messageService, translate) {
|
|
4455
|
-
var _this = _super.call(this, http, messageService, "agro/origination/entities/ticket", "agro/origination/actions", "agro/origination/queries", translate) || this;
|
|
4456
|
-
_this.http = http;
|
|
4457
|
-
_this.messageService = messageService;
|
|
4458
|
-
_this.translate = translate;
|
|
4459
|
-
return _this;
|
|
4460
|
-
}
|
|
4461
|
-
TicketService.prototype.getTicketSummaryByParent = function (parent) {
|
|
4462
|
-
return this.http
|
|
4463
|
-
.post(this.queriesUrl + "/getTicketSummaryByParent/", { parent: parent })
|
|
4464
|
-
.pipe(this.defaultCatch());
|
|
4465
|
-
};
|
|
4466
|
-
TicketService.prototype.listMainteinerTickets = function (filter) {
|
|
4467
|
-
return this.http
|
|
4468
|
-
.post(this.queriesUrl + "/listMainteinerTickets/", filter)
|
|
4469
|
-
.pipe(this.defaultCatch());
|
|
4470
|
-
};
|
|
4471
|
-
TicketService.prototype.searchTotalWeightResultFromTickets = function (body) {
|
|
4472
|
-
return this.http
|
|
4473
|
-
.post(this.queriesUrl + "/searchTotalWeightResultFromTickets/", body)
|
|
4474
|
-
.pipe(this.defaultCatch());
|
|
4475
|
-
};
|
|
4476
|
-
TicketService.prototype.cancelTicket = function (body) {
|
|
4477
|
-
return this.http
|
|
4478
|
-
.post(this.actionsUrl + "/cancelTicket/", body);
|
|
4479
|
-
};
|
|
4480
|
-
TicketService.prototype.mergeTickets = function (body) {
|
|
4481
|
-
return this.http.post(this.actionsUrl + "/mergeTickets/", body).pipe(this.defaultCatch());
|
|
4482
|
-
};
|
|
4483
|
-
TicketService.prototype.unMergeTickets = function (body) {
|
|
4484
|
-
return this.http.post(this.actionsUrl + "/unMergeTickets/", body).pipe(this.defaultCatch());
|
|
4485
|
-
};
|
|
4486
|
-
TicketService.prototype.checkGroupInvoicePermission = function (body) {
|
|
4487
|
-
return this.http
|
|
4488
|
-
.post(this.queriesUrl + "/checkGroupInvoicePermission/", body)
|
|
4489
|
-
.pipe(this.defaultCatch());
|
|
4490
|
-
};
|
|
4491
|
-
TicketService.prototype.getContractTickets = function (tickets) {
|
|
4492
|
-
return this.http
|
|
4493
|
-
.post(this.queriesUrl + "/getContractTickets/", { tickets: tickets })
|
|
4494
|
-
.pipe(this.defaultCatch());
|
|
4495
|
-
};
|
|
4496
|
-
TicketService.ctorParameters = function () { return [
|
|
4497
|
-
{ type: http.HttpClient },
|
|
4498
|
-
{ type: api.MessageService },
|
|
4499
|
-
{ type: LibTranslationService }
|
|
4500
|
-
]; };
|
|
4501
|
-
TicketService = __decorate([
|
|
4502
|
-
core.Injectable()
|
|
4503
|
-
], TicketService);
|
|
4504
|
-
return TicketService;
|
|
4505
|
-
}(EntityService));
|
|
4506
|
-
|
|
4507
4519
|
var TransferService = /** @class */ (function (_super) {
|
|
4508
4520
|
__extends(TransferService, _super);
|
|
4509
4521
|
function TransferService(http, messageService, translate) {
|
|
@@ -4534,22 +4546,47 @@
|
|
|
4534
4546
|
return TransferService;
|
|
4535
4547
|
}(EntityService));
|
|
4536
4548
|
|
|
4549
|
+
var FixationService = /** @class */ (function (_super) {
|
|
4550
|
+
__extends(FixationService, _super);
|
|
4551
|
+
function FixationService(http, messageService, translate) {
|
|
4552
|
+
var _this = _super.call(this, http, messageService, "agro/fixation/entities/fixation", "agro/fixation/actions", "agro/fixation/queries", translate) || this;
|
|
4553
|
+
_this.http = http;
|
|
4554
|
+
_this.messageService = messageService;
|
|
4555
|
+
_this.translate = translate;
|
|
4556
|
+
return _this;
|
|
4557
|
+
}
|
|
4558
|
+
FixationService.prototype.cancelFixation = function (body) {
|
|
4559
|
+
return this.http
|
|
4560
|
+
.post(this.actionsUrl + "/cancelFixationEvent", body)
|
|
4561
|
+
.pipe(this.defaultCatch());
|
|
4562
|
+
};
|
|
4563
|
+
FixationService.ctorParameters = function () { return [
|
|
4564
|
+
{ type: http.HttpClient },
|
|
4565
|
+
{ type: api.MessageService },
|
|
4566
|
+
{ type: LibTranslationService }
|
|
4567
|
+
]; };
|
|
4568
|
+
FixationService = __decorate([
|
|
4569
|
+
core.Injectable()
|
|
4570
|
+
], FixationService);
|
|
4571
|
+
return FixationService;
|
|
4572
|
+
}(EntityService));
|
|
4573
|
+
|
|
4537
4574
|
var EventControlBoardService = /** @class */ (function () {
|
|
4538
|
-
function EventControlBoardService(eventControlService, eventControlItemService,
|
|
4575
|
+
function EventControlBoardService(eventControlService, eventControlItemService, transferService, producerInvoiceService, fixationService) {
|
|
4539
4576
|
this.eventControlService = eventControlService;
|
|
4540
4577
|
this.eventControlItemService = eventControlItemService;
|
|
4541
|
-
this.ticketService = ticketService;
|
|
4542
4578
|
this.transferService = transferService;
|
|
4543
4579
|
this.producerInvoiceService = producerInvoiceService;
|
|
4580
|
+
this.fixationService = fixationService;
|
|
4544
4581
|
}
|
|
4545
4582
|
EventControlBoardService.ctorParameters = function () { return [
|
|
4546
4583
|
{ type: EventControlService },
|
|
4547
4584
|
{ type: EventControlItemService },
|
|
4548
|
-
{ type: TicketService },
|
|
4549
4585
|
{ type: TransferService },
|
|
4550
|
-
{ type: ProducerInvoiceService }
|
|
4586
|
+
{ type: ProducerInvoiceService },
|
|
4587
|
+
{ type: FixationService }
|
|
4551
4588
|
]; };
|
|
4552
|
-
EventControlBoardService.ɵprov = core["ɵɵdefineInjectable"]({ factory: function EventControlBoardService_Factory() { return new EventControlBoardService(core["ɵɵinject"](EventControlService), core["ɵɵinject"](EventControlItemService), core["ɵɵinject"](
|
|
4589
|
+
EventControlBoardService.ɵprov = core["ɵɵdefineInjectable"]({ factory: function EventControlBoardService_Factory() { return new EventControlBoardService(core["ɵɵinject"](EventControlService), core["ɵɵinject"](EventControlItemService), core["ɵɵinject"](TransferService), core["ɵɵinject"](ProducerInvoiceService), core["ɵɵinject"](FixationService)); }, token: EventControlBoardService, providedIn: "root" });
|
|
4553
4590
|
EventControlBoardService = __decorate([
|
|
4554
4591
|
core.Injectable({
|
|
4555
4592
|
providedIn: "root",
|
|
@@ -4559,13 +4596,14 @@
|
|
|
4559
4596
|
}());
|
|
4560
4597
|
|
|
4561
4598
|
var EventControlBoardComponent = /** @class */ (function () {
|
|
4562
|
-
function EventControlBoardComponent(translate, formBuilder, websocketService, eventControlBoardService, paginatorStorageService, messageService) {
|
|
4599
|
+
function EventControlBoardComponent(translate, formBuilder, websocketService, eventControlBoardService, paginatorStorageService, messageService, confirmationService) {
|
|
4563
4600
|
this.translate = translate;
|
|
4564
4601
|
this.formBuilder = formBuilder;
|
|
4565
4602
|
this.websocketService = websocketService;
|
|
4566
4603
|
this.eventControlBoardService = eventControlBoardService;
|
|
4567
4604
|
this.paginatorStorageService = paginatorStorageService;
|
|
4568
4605
|
this.messageService = messageService;
|
|
4606
|
+
this.confirmationService = confirmationService;
|
|
4569
4607
|
this.steps = [];
|
|
4570
4608
|
this.showSidebar = false;
|
|
4571
4609
|
this.showReprocessButton = false;
|
|
@@ -4585,7 +4623,6 @@
|
|
|
4585
4623
|
return __awaiter(this, void 0, void 0, function () {
|
|
4586
4624
|
return __generator(this, function (_a) {
|
|
4587
4625
|
this.gridColumns = this.setGridColumns();
|
|
4588
|
-
this.socketConnection = this.websocketService.onConnect();
|
|
4589
4626
|
this.callWebsocket();
|
|
4590
4627
|
return [2 /*return*/];
|
|
4591
4628
|
});
|
|
@@ -4597,7 +4634,7 @@
|
|
|
4597
4634
|
this.setFormFields();
|
|
4598
4635
|
}
|
|
4599
4636
|
this.updateCompanyAndBranchFormFields(changes);
|
|
4600
|
-
this.
|
|
4637
|
+
this.updateEventOriginAndControlCodeFormFields(changes);
|
|
4601
4638
|
this.updateEventStatusAndCreatedDateFormFields(changes);
|
|
4602
4639
|
this.onSearch();
|
|
4603
4640
|
};
|
|
@@ -4610,13 +4647,13 @@
|
|
|
4610
4647
|
(_c = this.filterFormGroup.get('e070fil')) === null || _c === void 0 ? void 0 : _c.setValue((_d = changes.e070fil.currentValue) !== null && _d !== void 0 ? _d : null);
|
|
4611
4648
|
}
|
|
4612
4649
|
};
|
|
4613
|
-
EventControlBoardComponent.prototype.
|
|
4650
|
+
EventControlBoardComponent.prototype.updateEventOriginAndControlCodeFormFields = function (changes) {
|
|
4614
4651
|
var _a, _b, _c, _d;
|
|
4615
4652
|
if (changes.eventOrigin && changes.eventOrigin.currentValue !== changes.eventOrigin.previousValue) {
|
|
4616
4653
|
(_a = this.filterFormGroup.get('eventOrigin')) === null || _a === void 0 ? void 0 : _a.setValue((_b = changes.eventOrigin.currentValue) !== null && _b !== void 0 ? _b : null);
|
|
4617
4654
|
}
|
|
4618
|
-
if (changes.
|
|
4619
|
-
(_c = this.filterFormGroup.get('
|
|
4655
|
+
if (changes.controlCode && changes.controlCode.currentValue !== changes.controlCode.previousValue) {
|
|
4656
|
+
(_c = this.filterFormGroup.get('controlCode')) === null || _c === void 0 ? void 0 : _c.setValue((_d = changes.controlCode.currentValue) !== null && _d !== void 0 ? _d : null);
|
|
4620
4657
|
}
|
|
4621
4658
|
};
|
|
4622
4659
|
EventControlBoardComponent.prototype.updateEventStatusAndCreatedDateFormFields = function (changes) {
|
|
@@ -4633,7 +4670,7 @@
|
|
|
4633
4670
|
this.filterFormGroup = this.formBuilder.group({
|
|
4634
4671
|
e070emp: [{ value: (_a = this.e070emp) !== null && _a !== void 0 ? _a : null, disabled: false }, forms.Validators.compose([])],
|
|
4635
4672
|
e070fil: [{ value: (_b = this.e070fil) !== null && _b !== void 0 ? _b : null, disabled: false }, forms.Validators.compose([])],
|
|
4636
|
-
|
|
4673
|
+
controlCode: [{ value: (_c = this.controlCode) !== null && _c !== void 0 ? _c : null, disabled: false }, forms.Validators.compose([])],
|
|
4637
4674
|
externalId: [{ value: (_d = this.externalId) !== null && _d !== void 0 ? _d : null, disabled: false }, forms.Validators.compose([])],
|
|
4638
4675
|
eventOrigin: [{ value: (_e = this.eventOrigin) !== null && _e !== void 0 ? _e : null, disabled: false }, forms.Validators.compose([])],
|
|
4639
4676
|
status: [{ value: (_f = this.eventStatus) !== null && _f !== void 0 ? _f : null, disabled: false }, forms.Validators.compose([])],
|
|
@@ -4651,7 +4688,7 @@
|
|
|
4651
4688
|
type: angularComponents.FieldType.Chips,
|
|
4652
4689
|
}),
|
|
4653
4690
|
new angularComponents.FormField({
|
|
4654
|
-
name: "
|
|
4691
|
+
name: "controlCode",
|
|
4655
4692
|
type: angularComponents.FieldType.Chips,
|
|
4656
4693
|
}),
|
|
4657
4694
|
new angularComponents.FormField({
|
|
@@ -4677,14 +4714,13 @@
|
|
|
4677
4714
|
{ field: 'e070emp', header: this.translate.instant("agro.angular_components.company") },
|
|
4678
4715
|
{ field: 'e070fil', header: this.translate.instant("agro.angular_components.label_branch") },
|
|
4679
4716
|
{ field: 'eventOrigin', header: this.translate.instant("agro.angular_components.event_origin_label") },
|
|
4680
|
-
{ field: '
|
|
4717
|
+
{ field: 'controlCode', header: this.translate.instant("agro.angular_components.control_code") },
|
|
4681
4718
|
];
|
|
4682
4719
|
};
|
|
4683
4720
|
EventControlBoardComponent.prototype.ngOnDestroy = function () {
|
|
4684
4721
|
this.ngUnsubscribe.next();
|
|
4685
4722
|
this.ngUnsubscribe.complete();
|
|
4686
4723
|
this.websocketService.disconnect();
|
|
4687
|
-
this.socketConnection = false;
|
|
4688
4724
|
};
|
|
4689
4725
|
EventControlBoardComponent.prototype.callWebsocket = function () {
|
|
4690
4726
|
var _this = this;
|
|
@@ -4730,91 +4766,27 @@
|
|
|
4730
4766
|
var _a = this.currentListParams, page = _a.page, size = _a.size;
|
|
4731
4767
|
var nSort = this.getSortedFields();
|
|
4732
4768
|
var filterQuery = this.getFilterQuery();
|
|
4733
|
-
var displayFields = [""];
|
|
4769
|
+
var displayFields = ["*", "eventControlItem"];
|
|
4734
4770
|
this.eventControlBoardService.eventControlService
|
|
4735
4771
|
.list({ sort: nSort, page: page, size: size, filterQuery: filterQuery, displayFields: displayFields })
|
|
4736
4772
|
.pipe(operators.takeUntil(this.ngUnsubscribe), operators.catchError(function (err) {
|
|
4737
4773
|
_this.gridLoading = false;
|
|
4738
4774
|
throw err;
|
|
4739
4775
|
}))
|
|
4740
|
-
.subscribe(function (list) {
|
|
4741
|
-
|
|
4742
|
-
|
|
4743
|
-
|
|
4744
|
-
var _a;
|
|
4745
|
-
var nSort = [];
|
|
4746
|
-
if (((_a = this.currentListParams.sort) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
4747
|
-
nSort = JSON.parse(JSON.stringify(this.currentListParams.sort));
|
|
4748
|
-
nSort.forEach(function (sortItem) {
|
|
4749
|
-
sortItem.field = _this.getFieldNameForSortRequest(sortItem.field);
|
|
4750
|
-
});
|
|
4751
|
-
}
|
|
4752
|
-
else {
|
|
4753
|
-
nSort.push({ field: 'lastModifiedDate', order: exports.AGRO_NUMBERS.MINUSONE });
|
|
4754
|
-
}
|
|
4755
|
-
return nSort;
|
|
4756
|
-
};
|
|
4757
|
-
EventControlBoardComponent.prototype.getFilterQuery = function () {
|
|
4758
|
-
var _this = this;
|
|
4759
|
-
var filterData = this.currentListParams.filterData;
|
|
4760
|
-
var filterJson = { filter: {} };
|
|
4761
|
-
return __spread(this.filterFields).filter(function (_a) {
|
|
4762
|
-
var name = _a.name;
|
|
4763
|
-
return filterData && filterData[name] !== undefined && filterData[name] !== null && filterData[name].length !== 0;
|
|
4764
|
-
})
|
|
4765
|
-
.map(function (formField) {
|
|
4766
|
-
var _a;
|
|
4767
|
-
var lookupFieldName = 'id';
|
|
4768
|
-
var finalFilterName = (_a = formField.name) !== null && _a !== void 0 ? _a : '';
|
|
4769
|
-
filterJson.filter[finalFilterName] = filterData[finalFilterName].id;
|
|
4770
|
-
return _this.createFilterString(finalFilterName, formField.type, filterData[finalFilterName], lookupFieldName);
|
|
4771
|
-
})
|
|
4772
|
-
.filter(function (filter) { return filter !== null && filter !== '' && filter !== undefined; })
|
|
4773
|
-
.join(' and ');
|
|
4774
|
-
};
|
|
4775
|
-
EventControlBoardComponent.prototype.handleListResponse = function (list) {
|
|
4776
|
-
this.gridData = list.contents;
|
|
4777
|
-
this.gridTotalRecords = list.totalElements;
|
|
4778
|
-
if (!this.gridData || this.gridData.length <= exports.AGRO_NUMBERS.ZERO) {
|
|
4779
|
-
this.gridLoading = false;
|
|
4780
|
-
return;
|
|
4781
|
-
}
|
|
4782
|
-
this.processDetailCalls();
|
|
4783
|
-
};
|
|
4784
|
-
EventControlBoardComponent.prototype.processDetailCalls = function () {
|
|
4785
|
-
var _this = this;
|
|
4786
|
-
var detailCalls$ = this.gridData.map(function (item) {
|
|
4787
|
-
return _this.eventControlBoardService.eventControlItemService.list({
|
|
4788
|
-
filterQuery: "eventControl eq '" + item.id + "'",
|
|
4789
|
-
sort: [{ field: 'sequence', order: exports.AGRO_NUMBERS.ONE }],
|
|
4790
|
-
size: exports.AGRO_NUMBERS.ONE_HUNDRED
|
|
4791
|
-
})
|
|
4792
|
-
.pipe(operators.takeUntil(_this.ngUnsubscribe), operators.catchError(function (err) {
|
|
4776
|
+
.subscribe(function (list) {
|
|
4777
|
+
_this.gridData = list.contents;
|
|
4778
|
+
_this.gridTotalRecords = list.totalElements;
|
|
4779
|
+
if (!_this.gridData || _this.gridData.length <= exports.AGRO_NUMBERS.ZERO) {
|
|
4793
4780
|
_this.gridLoading = false;
|
|
4794
|
-
|
|
4795
|
-
}
|
|
4796
|
-
|
|
4797
|
-
filterQuery: "id eq '" + item.externalId + "' or balanceEntryControl.id eq '" + item.externalId + "'",
|
|
4798
|
-
displayFields: ['number']
|
|
4799
|
-
})
|
|
4800
|
-
.pipe(operators.map(function (ticketResponse) { return ({ detailsResponse: detailsResponse, ticketResponse: ticketResponse }); }), operators.catchError(function (err) {
|
|
4801
|
-
_this.gridLoading = false;
|
|
4802
|
-
throw err;
|
|
4803
|
-
}));
|
|
4804
|
-
}));
|
|
4805
|
-
});
|
|
4806
|
-
rxjs.forkJoin(detailCalls$).subscribe(function (responses) {
|
|
4807
|
-
_this.processDetailsResponses(responses);
|
|
4781
|
+
return;
|
|
4782
|
+
}
|
|
4783
|
+
_this.processEventControlItems(_this.gridData.map(function (item) { return item.eventControlItem; }));
|
|
4808
4784
|
});
|
|
4809
4785
|
};
|
|
4810
|
-
EventControlBoardComponent.prototype.
|
|
4786
|
+
EventControlBoardComponent.prototype.processEventControlItems = function (detailsResponses) {
|
|
4811
4787
|
var _this = this;
|
|
4812
4788
|
this.gridData.forEach(function (item, index) {
|
|
4813
|
-
|
|
4814
|
-
var _c = detailsResponses[index], detailsResponse = _c.detailsResponse, ticketResponse = _c.ticketResponse;
|
|
4815
|
-
var tickets = (_a = ticketResponse === null || ticketResponse === void 0 ? void 0 : ticketResponse.contents) !== null && _a !== void 0 ? _a : [];
|
|
4816
|
-
item.details = (_b = detailsResponse === null || detailsResponse === void 0 ? void 0 : detailsResponse.contents) !== null && _b !== void 0 ? _b : [];
|
|
4817
|
-
item.tickets = tickets.map(function (ticket) { return ticket.number; }).join(', ');
|
|
4789
|
+
item.details = detailsResponses[index];
|
|
4818
4790
|
var groupedDetails = _this.groupByEventGroup(item.details);
|
|
4819
4791
|
item.groups = Object.keys(groupedDetails).map(function (eventGroupId) {
|
|
4820
4792
|
var groupDetails = groupedDetails[eventGroupId];
|
|
@@ -4825,17 +4797,18 @@
|
|
|
4825
4797
|
if (lastActiveIndex !== -1 && groupDetails[lastActiveIndex].status === EventStatus.SUCCESS) {
|
|
4826
4798
|
activeIndex = lastActiveIndex + 1;
|
|
4827
4799
|
}
|
|
4828
|
-
var steps = groupDetails
|
|
4800
|
+
var steps = groupDetails
|
|
4801
|
+
.map(function (detail, detailIndex) {
|
|
4829
4802
|
return {
|
|
4830
4803
|
item: detail,
|
|
4831
|
-
|
|
4832
|
-
eventType:
|
|
4804
|
+
controlCode: _this.gridData[index].controlCode,
|
|
4805
|
+
eventType: _this.gridData[index].eventOrigin,
|
|
4833
4806
|
label: _this.getEventLabel(detail),
|
|
4834
4807
|
disabled: detail.status === EventStatus.PENDING && detailIndex !== activeIndex,
|
|
4835
4808
|
tooltip: _this.getEventLabel(detail),
|
|
4836
4809
|
state: _this.determineStepState(detail),
|
|
4837
4810
|
};
|
|
4838
|
-
});
|
|
4811
|
+
}).sort(function (a, b) { return a.item.sequence - b.item.sequence; });
|
|
4839
4812
|
return {
|
|
4840
4813
|
eventGroupId: eventGroupId,
|
|
4841
4814
|
steps: steps,
|
|
@@ -4875,31 +4848,54 @@
|
|
|
4875
4848
|
var eventLabel = (_a = this.eventItem.find(function (e) { return e.value === detail.eventOperation; })) === null || _a === void 0 ? void 0 : _a.label;
|
|
4876
4849
|
return eventLabel ? this.translate.instant(eventLabel) : detail.eventOperation;
|
|
4877
4850
|
};
|
|
4851
|
+
EventControlBoardComponent.prototype.getSortedFields = function () {
|
|
4852
|
+
var _this = this;
|
|
4853
|
+
var _a;
|
|
4854
|
+
var nSort = [];
|
|
4855
|
+
if (((_a = this.currentListParams.sort) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
4856
|
+
nSort = JSON.parse(JSON.stringify(this.currentListParams.sort));
|
|
4857
|
+
nSort.forEach(function (sortItem) {
|
|
4858
|
+
sortItem.field = _this.getFieldNameForSortRequest(sortItem.field);
|
|
4859
|
+
});
|
|
4860
|
+
}
|
|
4861
|
+
else {
|
|
4862
|
+
nSort.push({ field: 'lastModifiedDate', order: exports.AGRO_NUMBERS.MINUSONE });
|
|
4863
|
+
}
|
|
4864
|
+
return nSort;
|
|
4865
|
+
};
|
|
4866
|
+
EventControlBoardComponent.prototype.getFilterQuery = function () {
|
|
4867
|
+
var _this = this;
|
|
4868
|
+
var filterData = this.currentListParams.filterData;
|
|
4869
|
+
var filterJson = { filter: {} };
|
|
4870
|
+
return __spread(this.filterFields).filter(function (_a) {
|
|
4871
|
+
var name = _a.name;
|
|
4872
|
+
return filterData && filterData[name] !== undefined && filterData[name] !== null && filterData[name].length !== 0;
|
|
4873
|
+
})
|
|
4874
|
+
.map(function (formField) {
|
|
4875
|
+
var _a;
|
|
4876
|
+
var lookupFieldName = 'id';
|
|
4877
|
+
var finalFilterName = (_a = formField.name) !== null && _a !== void 0 ? _a : '';
|
|
4878
|
+
filterJson.filter[finalFilterName] = filterData[finalFilterName].id;
|
|
4879
|
+
return _this.createFilterString(finalFilterName, formField.type, filterData[finalFilterName], lookupFieldName);
|
|
4880
|
+
})
|
|
4881
|
+
.filter(function (filter) { return filter !== null && filter !== '' && filter !== undefined; })
|
|
4882
|
+
.join(' and ');
|
|
4883
|
+
};
|
|
4878
4884
|
EventControlBoardComponent.prototype.getFieldNameForSortRequest = function (name) {
|
|
4879
4885
|
switch (name) {
|
|
4880
4886
|
case 'e070emp':
|
|
4881
4887
|
return 'e070emp.nomEmp';
|
|
4882
4888
|
case 'e070fil':
|
|
4883
4889
|
return 'e070fil.nomFil';
|
|
4884
|
-
case 'number':
|
|
4885
|
-
return 'createdDate';
|
|
4886
4890
|
default:
|
|
4887
4891
|
return name;
|
|
4888
4892
|
}
|
|
4889
4893
|
};
|
|
4890
4894
|
EventControlBoardComponent.prototype.createFilterString = function (name, type, value, lookupFieldName) {
|
|
4891
4895
|
if (lookupFieldName === void 0) { lookupFieldName = 'id'; }
|
|
4892
|
-
if (name === '
|
|
4896
|
+
if (name === 'controlCode') {
|
|
4893
4897
|
var filterParts_1 = [];
|
|
4894
|
-
value.forEach(function (
|
|
4895
|
-
filterParts_1.push("externalId eq '" + item.id + "'");
|
|
4896
|
-
if (item.invoice) {
|
|
4897
|
-
filterParts_1.push("externalId eq '" + item.invoice.id + "'");
|
|
4898
|
-
}
|
|
4899
|
-
if (item.balanceEntryControl) {
|
|
4900
|
-
filterParts_1.push("externalId eq '" + item.balanceEntryControl.id + "'");
|
|
4901
|
-
}
|
|
4902
|
-
});
|
|
4898
|
+
value.forEach(function (val) { return filterParts_1.push("controlCode eq '" + val + "'"); });
|
|
4903
4899
|
return "(" + filterParts_1.join(' or ') + ")";
|
|
4904
4900
|
}
|
|
4905
4901
|
return this.createFilterStringFromType(name, type, value, lookupFieldName);
|
|
@@ -4961,7 +4957,6 @@
|
|
|
4961
4957
|
EventControlBoardComponent.prototype.stepSelected = function (event) {
|
|
4962
4958
|
var _this = this;
|
|
4963
4959
|
this.selectedStep = event.step;
|
|
4964
|
-
console.log(event);
|
|
4965
4960
|
switch (this.selectedStep.eventType) {
|
|
4966
4961
|
case EventOrigin.BALANCE_ENTRY_CONTROL:
|
|
4967
4962
|
case EventOrigin.TICKET:
|
|
@@ -4980,8 +4975,8 @@
|
|
|
4980
4975
|
_this.sidebarLoading = false;
|
|
4981
4976
|
});
|
|
4982
4977
|
break;
|
|
4978
|
+
case EventOrigin.FIXATION:
|
|
4983
4979
|
case EventOrigin.CHANGE_REQUEST:
|
|
4984
|
-
break;
|
|
4985
4980
|
case EventOrigin.TRANSFER:
|
|
4986
4981
|
break;
|
|
4987
4982
|
}
|
|
@@ -5002,16 +4997,47 @@
|
|
|
5002
4997
|
_this.addMessage('error', 'agro.angular_components.error_reprocessing_event_message_title', 'agro.angular_components.error_reprocessing_event_message_description');
|
|
5003
4998
|
});
|
|
5004
4999
|
};
|
|
5005
|
-
EventControlBoardComponent.prototype.addMessage = function (severity, summary, detail) {
|
|
5000
|
+
EventControlBoardComponent.prototype.addMessage = function (severity, summary, detail, life) {
|
|
5001
|
+
if (life === void 0) { life = exports.AGRO_NUMBERS.FIVE_SECONDS; }
|
|
5006
5002
|
this.messageService.add({
|
|
5007
5003
|
severity: severity,
|
|
5008
5004
|
summary: this.translate.instant(summary),
|
|
5009
5005
|
detail: this.translate.instant(detail),
|
|
5006
|
+
life: life
|
|
5010
5007
|
});
|
|
5011
5008
|
};
|
|
5012
5009
|
EventControlBoardComponent.prototype.openModal = function () {
|
|
5013
5010
|
this.displayModal = true;
|
|
5014
5011
|
};
|
|
5012
|
+
EventControlBoardComponent.prototype.openCancelModal = function () {
|
|
5013
|
+
var _this = this;
|
|
5014
|
+
this.confirmationService.confirm({
|
|
5015
|
+
header: this.translate.instant("agro.angular_components.cancel_fixation_title"),
|
|
5016
|
+
message: this.translate.instant("agro.angular_components.cancel_fixation_description"),
|
|
5017
|
+
acceptLabel: this.translate.instant("agro.angular_components.yes"),
|
|
5018
|
+
rejectLabel: this.translate.instant("agro.angular_components.no"),
|
|
5019
|
+
accept: function () {
|
|
5020
|
+
_this.gridLoading = true;
|
|
5021
|
+
_this.cancelFixation();
|
|
5022
|
+
},
|
|
5023
|
+
reject: function () {
|
|
5024
|
+
_this.gridLoading = false;
|
|
5025
|
+
}
|
|
5026
|
+
});
|
|
5027
|
+
};
|
|
5028
|
+
EventControlBoardComponent.prototype.cancelFixation = function () {
|
|
5029
|
+
var _this = this;
|
|
5030
|
+
this.eventControlBoardService.fixationService.cancelFixation({ fixationId: this.gridData[exports.AGRO_NUMBERS.ZERO].externalId })
|
|
5031
|
+
.pipe(operators.takeUntil(this.ngUnsubscribe), operators.catchError(function (err) {
|
|
5032
|
+
_this.addMessage('error', 'agro.angular_components.error_cancel_fixation_message_title', 'agro.angular_components.error_cancel_fixation_message_description');
|
|
5033
|
+
_this.gridLoading = false;
|
|
5034
|
+
throw err;
|
|
5035
|
+
}))
|
|
5036
|
+
.subscribe(function () {
|
|
5037
|
+
_this.addMessage('info', 'agro.angular_components.cancel_fixation_message_title', 'agro.angular_components.cancel_fixation_message_description');
|
|
5038
|
+
_this.gridLoading = false;
|
|
5039
|
+
});
|
|
5040
|
+
};
|
|
5015
5041
|
EventControlBoardComponent.prototype.confirmModal = function () {
|
|
5016
5042
|
this.reprocessEvent();
|
|
5017
5043
|
this.displayModal = false;
|
|
@@ -5029,7 +5055,8 @@
|
|
|
5029
5055
|
{ type: WebsocketService },
|
|
5030
5056
|
{ type: EventControlBoardService },
|
|
5031
5057
|
{ type: PaginatorStorageService },
|
|
5032
|
-
{ type: primeng.MessageService }
|
|
5058
|
+
{ type: primeng.MessageService },
|
|
5059
|
+
{ type: primeng.ConfirmationService }
|
|
5033
5060
|
]; };
|
|
5034
5061
|
__decorate([
|
|
5035
5062
|
core.Input()
|
|
@@ -5039,7 +5066,7 @@
|
|
|
5039
5066
|
], EventControlBoardComponent.prototype, "e070fil", void 0);
|
|
5040
5067
|
__decorate([
|
|
5041
5068
|
core.Input()
|
|
5042
|
-
], EventControlBoardComponent.prototype, "
|
|
5069
|
+
], EventControlBoardComponent.prototype, "controlCode", void 0);
|
|
5043
5070
|
__decorate([
|
|
5044
5071
|
core.Input()
|
|
5045
5072
|
], EventControlBoardComponent.prototype, "eventOrigin", void 0);
|
|
@@ -5058,11 +5085,11 @@
|
|
|
5058
5085
|
EventControlBoardComponent = __decorate([
|
|
5059
5086
|
core.Component({
|
|
5060
5087
|
selector: 'event-control-board',
|
|
5061
|
-
template: "<div class=\"ui-g\" *sLoadingState=\"gridLoading\">\r\n <div class=\"ui-g-12\">\r\n <p-panel>\r\n <p-header>\r\n {{ \"agro.angular_components.event_control_header\" | libTranslate }}\r\n </p-header>\r\n <div class=\"ui-g\">\r\n <div class=\"ui-g-12\">\r\n <s-button\r\n id=\"refresh-button\"\r\n [priority]=\"ButtonPriority.Primary\"\r\n iconClass=\"fa fa-refresh\"\r\n [label]=\"'agro.angular_components.refresh' | libTranslate\"\r\n (click)=\"onSearch()\"\r\n >\r\n </s-button>\r\n </div>\r\n </div>\r\n <div class=\"ui-g\">\r\n <div class=\"ui-g-12 ui-md-12\" *ngIf=\"!gridData || gridData?.length === 0\">\r\n <s-empty-state\r\n iconClass=\"fa fa-exclamation-triangle\"\r\n title=\"{{ 'agro.angular_components.nothing_found' | libTranslate }}\"\r\n [showPrimaryAction]=\"false\"\r\n description=\"{{ 'agro.angular_components.table_empty_description' | libTranslate }}\"\r\n >\r\n </s-empty-state>\r\n </div>\r\n <ng-container *ngIf=\"gridData?.length > 0\">\r\n <p-table\r\n stylelass=\"custom-table\"\r\n #eventControlTable\r\n [value]=\"gridDataResolved\"\r\n [columns]=\"gridColumns\"\r\n dataKey=\"id\"\r\n [lazy]=\"true\"\r\n [scrollable]=\"true\"\r\n [resizableColumns]=\"true\"\r\n [paginator]=\"!standalone\"\r\n [totalRecords]=\"gridTotalRecords\"\r\n [rows]=\"10\"\r\n [responsive]=\"true\"\r\n (onLazyLoad)=\"onGridChange($event)\"\r\n [sortOrder]=\"getSortOrder()\"\r\n [first]=\"getRowIndex()\"\r\n [lazyLoadOnInit]=\"false\"\r\n sortMode=\"multiple\"\r\n [rows]=\"getPageSize()\"\r\n [rowsPerPageOptions]=\"[10, 20, 50, 100]\"\r\n >\r\n <ng-template pTemplate=\"header\" let-columns>\r\n <tr>\r\n <ng-container *ngIf=\"!standalone\">\r\n <th\r\n *ngFor=\"let col of columns\"\r\n class=\"ui-lg-1 ui-md-1\"\r\n [pSortableColumn]=\"col.field\"\r\n scope=\"col\"\r\n >\r\n <div class=\"senior-header\">\r\n <span class=\"senior-header-title\">{{\r\n col.header\r\n }}</span>\r\n <p-sortIcon [field]=\"col.field\"></p-sortIcon>\r\n </div>\r\n </th>\r\n </ng-container>\r\n <th class=\"ui-lg-8 ui-md-7\" scope=\"col\">\r\n {{ \"agro.angular_components.panel_title_events_events\" | libTranslate }}\r\n </th>\r\n </tr>\r\n </ng-template>\r\n <ng-template pTemplate=\"body\" let-rowData>\r\n <tr>\r\n <ng-container *ngIf=\"!standalone\">\r\n <td class=\"ui-lg-1 ui-md-1\">\r\n {{ rowData.e070emp?.nomEmp }}\r\n </td>\r\n <td class=\"ui-lg-1 ui-md-1\">\r\n {{ rowData.e070fil?.nomFil }}\r\n </td>\r\n <td class=\"ui-lg-1 ui-md-1\">\r\n <ng-container [ngSwitch]=\"rowData.eventOrigin\">\r\n <span *ngSwitchCase=\"'BALANCE_ENTRY_CONTROL'\">\r\n {{\r\n \"agro.angular_components.balance_entry_control_event\"\r\n | libTranslate\r\n }}\r\n </span>\r\n <span *ngSwitchCase=\"'TICKET'\">\r\n {{\r\n \"agro.angular_components.ticket_maintenance_header\"\r\n | libTranslate\r\n }}\r\n </span>\r\n <span *ngSwitchCase=\"'TRANSFER'\">\r\n {{\r\n \"agro.angular_components.transfer_origin_event\"\r\n | libTranslate\r\n }}\r\n </span>\r\n <span *ngSwitchCase=\"'INVOICE'\">\r\n {{\r\n \"agro.angular_components.invoice_creating_event\"\r\n | libTranslate\r\n }}\r\n </span>\r\n <span *ngSwitchCase=\"'CHANGE_REQUEST'\">\r\n {{\r\n \"agro.angular_components.change_request_event\"\r\n | libTranslate\r\n }}\r\n </span>\r\n </ng-container>\r\n </td>\r\n <td class=\"ui-lg-1 ui ui-md-1\">\r\n {{ rowData.tickets || \"\" }}\r\n </td>\r\n </ng-container>\r\n <td class=\"ui-lg-8 ui-md-7\">\r\n <ng-container *ngFor=\"let group of rowData.groups\">\r\n <s-event-steps\r\n [steps]=\"group.steps || []\"\r\n [activeIndex]=\"group.activeIndex\"\r\n (stepSelected)=\"stepSelected($event)\"\r\n >\r\n </s-event-steps>\r\n </ng-container>\r\n </td>\r\n </tr>\r\n </ng-template>\r\n <ng-template\r\n *ngIf=\"!standalone\"\r\n pTemplate=\"paginatorright\"\r\n class=\"custom-table\"\r\n >\r\n <span>\r\n {{\r\n \"agro.angular_components.registers_found\"\r\n | libTranslate : { total: gridTotalRecords }\r\n }}\r\n </span>\r\n </ng-template>\r\n </p-table>\r\n </ng-container>\r\n </div>\r\n </p-panel>\r\n </div>\r\n</div>\r\n<s-sidebar [visible]=\"showSidebar\" (visibleChange)=\"closeSidebar()\" header=\"{{ 'agro.angular_components.event_details_header' | libTranslate }}\">\r\n <div class=\"ui-fluid\">\r\n <p-fieldset legend=\"{{ sidebarTitle }}\" [toggleable]=\"false\">\r\n <div class=\"ui-g\">\r\n <div class=\"ui-g-4\">\r\n <span\r\n ><strong>{{\r\n \"agro.angular_components.event_origin_label\" | libTranslate\r\n }}</strong></span\r\n >\r\n <ng-container [ngSwitch]=\"selectedStep?.item.eventControl.eventOrigin\">\r\n <p *ngSwitchCase=\"'BALANCE_ENTRY_CONTROL'\">\r\n {{ \"agro.angular_components.balance_entry_control_event\" | libTranslate }}\r\n </p>\r\n <p *ngSwitchCase=\"'TICKET'\">\r\n {{ \"agro.angular_components.ticket_maintenance_header\" | libTranslate }}\r\n </p>\r\n <p *ngSwitchCase=\"'TRANSFER'\">\r\n {{ \"agro.angular_components.transfer_origin_event\" | libTranslate }}\r\n </p>\r\n <p *ngSwitchCase=\"'INVOICE'\">\r\n {{ \"agro.angular_components.invoice_creating_event\" | libTranslate }}\r\n </p>\r\n <p *ngSwitchCase=\"'CHANGE_REQUEST'\">\r\n {{ \"agro.angular_components.change_request_event\" | libTranslate }}\r\n </p>\r\n </ng-container>\r\n </div>\r\n <div class=\"ui-g-4\" *ngIf=\"producerInvoice?.e001pes.nomPes\">\r\n <span\r\n ><strong>{{ \"agro.angular_components.supplier\" | libTranslate }}</strong></span\r\n >\r\n <p>{{ producerInvoice?.e001pes.nomPes }}</p>\r\n </div>\r\n <div class=\"ui-g-4\" *ngIf=\"producerInvoice?.ruralEstate.name\">\r\n <span\r\n ><strong>{{ \"agro.angular_components.rural_estate\" | libTranslate }}</strong></span\r\n >\r\n <p>{{ producerInvoice?.ruralEstate.name }}</p>\r\n </div>\r\n <div class=\"ui-g-4\" *ngIf=\"selectedStep?.ticket\">\r\n <span\r\n ><strong>{{ \"agro.angular_components.ticket\" | libTranslate }}</strong></span\r\n >\r\n <p>{{ selectedStep?.ticket }}</p>\r\n </div>\r\n <div class=\"ui-g-4\">\r\n <span\r\n ><strong>{{ \"agro.angular_components.status_label\" | libTranslate }}</strong></span\r\n >\r\n <ng-container [ngSwitch]=\"selectedStep?.item.status\">\r\n <p *ngSwitchCase=\"'SUCCESS'\">\r\n <s-badge\r\n [color]=\"BadgeColors.Green\"\r\n text=\"{{\r\n 'agro.angular_components.panel_title_events_completed_successfully'\r\n | libTranslate\r\n }}\"\r\n [selectable]=\"false\"\r\n >\r\n </s-badge>\r\n </p>\r\n <p *ngSwitchCase=\"'PROCESSING'\">\r\n <s-badge\r\n [color]=\"BadgeColors.Orange\"\r\n text=\"{{ 'agro.angular_components.processing' | libTranslate }}\"\r\n [selectable]=\"false\"\r\n >\r\n </s-badge>\r\n </p>\r\n <p *ngSwitchCase=\"'FAILED'\">\r\n <s-badge\r\n [color]=\"BadgeColors.Red\"\r\n text=\"{{\r\n 'agro.angular_components.panel_title_events_ended_with_error'\r\n | libTranslate\r\n }}\"\r\n [selectable]=\"false\"\r\n >\r\n </s-badge>\r\n </p>\r\n <p *ngSwitchCase=\"'PENDING'\">\r\n <s-badge\r\n [color]=\"BadgeColors.Gray\"\r\n text=\"{{ 'agro.angular_components.pending' | libTranslate }}\"\r\n [selectable]=\"false\"\r\n >\r\n </s-badge>\r\n </p>\r\n </ng-container>\r\n </div>\r\n <div class=\"ui-g-4\">\r\n <span\r\n ><strong>{{\r\n \"agro.angular_components.last_update_date\" | libTranslate\r\n }}</strong></span\r\n >\r\n <p>{{ selectedStep?.item.lastModifiedDate | date : \"dd/MM/yyyy HH:mm:ss\" }}</p>\r\n </div>\r\n <div class=\"ui-g-4\" *ngIf=\"selectedStep?.item.status === 'FAILED'\">\r\n <span\r\n ><strong>{{\r\n \"agro.angular_components.event_error_message\" | libTranslate\r\n }}</strong></span\r\n >\r\n <p>{{ selectedStep?.item.message || \"-\" }}</p>\r\n </div>\r\n </div>\r\n </p-fieldset>\r\n </div>\r\n <s-footer>\r\n <div class=\"ui-g\">\r\n <div class=\"ui-g-12 width-fit\">\r\n <s-button\r\n id=\"sidebar-close-button\"\r\n [priority]=\"ButtonPriority.Primary\"\r\n [label]=\"'agro.angular_components.events_close' | libTranslate\"\r\n [auxiliary]=\"false\"\r\n (click)=\"closeSidebar()\"\r\n >\r\n </s-button>\r\n <s-button\r\n *ngIf=\"showReprocessButton\"\r\n id=\"sidebar-reprocess-button\"\r\n [priority]=\"ButtonPriority.Secondary\"\r\n iconClass=\"fa fa-refresh\"\r\n [label]=\"'agro.angular_components.reprocess_event' | libTranslate\"\r\n [auxiliary]=\"false\"\r\n (click)=\"openModal()\"\r\n >\r\n </s-button>\r\n </div>\r\n </div>\r\n </s-footer>\r\n</s-sidebar>\r\n\r\n<p-dialog [header]=\"'agro.angular_components.event_modal_title' | libTranslate\" [(visible)]=\"displayModal\" [modal]=\"true\" class=\"dialog\">\r\n <div class=\"event-modal-text\">{{ \"agro.angular_components.event_modal\" | libTranslate }}</div>\r\n <p-footer>\r\n <div class=\"ui-dialog-buttonpane ui-widget-content ui-helper-clearfix\">\r\n <button\r\n id=\"modal-yes\"\r\n type=\"button\"\r\n pButton\r\n icon=\"fa fa-check\"\r\n (click)=\"confirmModal()\"\r\n label=\"{{ 'agro.angular_components.yes' | libTranslate }}\"\r\n class=\"ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only\"\r\n ></button>\r\n <button\r\n id=\"modal-no\"\r\n type=\"button\"\r\n pButton\r\n icon=\"fa fa-close\"\r\n (click)=\"cancelModal()\"\r\n label=\"{{ 'agro.angular_components.no' | libTranslate }}\"\r\n class=\"ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only\"\r\n ></button>\r\n </div>\r\n </p-footer>\r\n</p-dialog>\r\n",
|
|
5088
|
+
template: "<div class=\"ui-g\" *sLoadingState=\"gridLoading\">\r\n <div class=\"ui-g-12\">\r\n <p-panel>\r\n <p-header>\r\n {{ \"agro.angular_components.event_control_header\" | libTranslate }}\r\n </p-header>\r\n <div class=\"ui-g\">\r\n <div class=\"ui-g-12\">\r\n <s-button\r\n id=\"refresh-button\"\r\n [priority]=\"ButtonPriority.Primary\"\r\n iconClass=\"fa fa-refresh\"\r\n [label]=\"'agro.angular_components.refresh' | libTranslate\"\r\n (click)=\"onSearch()\"\r\n >\r\n </s-button>\r\n <s-button\r\n *ngIf=\"standalone && eventOrigin === 'FIXATION'\"\r\n id=\"cancel-button\"\r\n iconClass=\"fa fa-times\"\r\n [label]=\"'agro.angular_components.cancel' | libTranslate\"\r\n (click)=\"openCancelModal()\"\r\n >\r\n </s-button>\r\n </div>\r\n </div>\r\n <div class=\"ui-g\">\r\n <div class=\"ui-g-12 ui-md-12\" *ngIf=\"!gridData || gridData?.length === 0\">\r\n <s-empty-state\r\n iconClass=\"fa fa-exclamation-triangle\"\r\n title=\"{{ 'agro.angular_components.nothing_found' | libTranslate }}\"\r\n [showPrimaryAction]=\"false\"\r\n description=\"{{ 'agro.angular_components.table_empty_description' | libTranslate }}\"\r\n >\r\n </s-empty-state>\r\n </div>\r\n <ng-container *ngIf=\"gridData?.length > 0\">\r\n <p-table\r\n stylelass=\"custom-table\"\r\n #eventControlTable\r\n [value]=\"gridDataResolved\"\r\n [columns]=\"gridColumns\"\r\n dataKey=\"id\"\r\n [lazy]=\"true\"\r\n [scrollable]=\"true\"\r\n [resizableColumns]=\"true\"\r\n [paginator]=\"!standalone\"\r\n [totalRecords]=\"gridTotalRecords\"\r\n [rows]=\"10\"\r\n [responsive]=\"true\"\r\n (onLazyLoad)=\"onGridChange($event)\"\r\n [sortOrder]=\"getSortOrder()\"\r\n [first]=\"getRowIndex()\"\r\n [lazyLoadOnInit]=\"false\"\r\n sortMode=\"multiple\"\r\n [rows]=\"getPageSize()\"\r\n [rowsPerPageOptions]=\"[10, 20, 50, 100]\"\r\n >\r\n <ng-template pTemplate=\"header\" let-columns>\r\n <tr>\r\n <ng-container *ngIf=\"!standalone\">\r\n <th\r\n *ngFor=\"let col of columns\"\r\n class=\"ui-lg-1 ui-md-1\"\r\n [pSortableColumn]=\"col.field\"\r\n scope=\"col\"\r\n >\r\n <div class=\"senior-header\">\r\n <span class=\"senior-header-title\">{{\r\n col.header\r\n }}</span>\r\n <p-sortIcon [field]=\"col.field\"></p-sortIcon>\r\n </div>\r\n </th>\r\n </ng-container>\r\n <th class=\"ui-lg-8 ui-md-7\" scope=\"col\">\r\n {{ \"agro.angular_components.panel_title_events_events\" | libTranslate }}\r\n </th>\r\n </tr>\r\n </ng-template>\r\n <ng-template pTemplate=\"body\" let-rowData>\r\n <tr>\r\n <ng-container *ngIf=\"!standalone\">\r\n <td class=\"ui-lg-1 ui-md-1\">\r\n {{ rowData.e070emp?.nomEmp }}\r\n </td>\r\n <td class=\"ui-lg-1 ui-md-1\">\r\n {{ rowData.e070fil?.nomFil }}\r\n </td>\r\n <td class=\"ui-lg-1 ui-md-1\">\r\n <ng-container [ngSwitch]=\"rowData.eventOrigin\">\r\n <span *ngSwitchCase=\"'BALANCE_ENTRY_CONTROL'\">\r\n {{\r\n \"agro.angular_components.balance_entry_control_event\"\r\n | libTranslate\r\n }}\r\n </span>\r\n <span *ngSwitchCase=\"'TICKET'\">\r\n {{\r\n \"agro.angular_components.ticket_maintenance_header\"\r\n | libTranslate\r\n }}\r\n </span>\r\n <span *ngSwitchCase=\"'TRANSFER'\">\r\n {{\r\n \"agro.angular_components.transfer_origin_event\"\r\n | libTranslate\r\n }}\r\n </span>\r\n <span *ngSwitchCase=\"'INVOICE'\">\r\n {{\r\n \"agro.angular_components.invoice_creating_event\"\r\n | libTranslate\r\n }}\r\n </span>\r\n <span *ngSwitchCase=\"'CHANGE_REQUEST'\">\r\n {{\r\n \"agro.angular_components.change_request_event\"\r\n | libTranslate\r\n }}\r\n </span>\r\n <span *ngSwitchCase=\"'FIXATION'\">\r\n {{\r\n \"agro.angular_components.fixation_event\"\r\n | libTranslate\r\n }}\r\n </span>\r\n </ng-container>\r\n </td>\r\n <td class=\"ui-lg-1 ui ui-md-1\">\r\n {{ rowData.controlCode || \"\" }}\r\n </td>\r\n </ng-container>\r\n <td class=\"ui-lg-8 ui-md-7\">\r\n <ng-container *ngFor=\"let group of rowData.groups\">\r\n <s-event-steps\r\n [steps]=\"group.steps || []\"\r\n [activeIndex]=\"group.activeIndex\"\r\n (stepSelected)=\"stepSelected($event)\"\r\n >\r\n </s-event-steps>\r\n </ng-container>\r\n </td>\r\n </tr>\r\n </ng-template>\r\n <ng-template\r\n *ngIf=\"!standalone\"\r\n pTemplate=\"paginatorright\"\r\n class=\"custom-table\"\r\n >\r\n <span>\r\n {{\r\n \"agro.angular_components.registers_found\"\r\n | libTranslate : { total: gridTotalRecords }\r\n }}\r\n </span>\r\n </ng-template>\r\n </p-table>\r\n </ng-container>\r\n </div>\r\n </p-panel>\r\n </div>\r\n</div>\r\n<s-sidebar [visible]=\"showSidebar\" (visibleChange)=\"closeSidebar()\" header=\"{{ 'agro.angular_components.event_details_header' | libTranslate }}\">\r\n <div class=\"ui-fluid\">\r\n <p-fieldset [legend]=\"sidebarTitle\" [toggleable]=\"false\">\r\n <div class=\"ui-g\">\r\n <div class=\"ui-g-4\">\r\n <span\r\n ><strong>{{\r\n \"agro.angular_components.event_origin_label\" | libTranslate\r\n }}</strong></span\r\n >\r\n <ng-container [ngSwitch]=\"selectedStep?.eventType\">\r\n <p *ngSwitchCase=\"'BALANCE_ENTRY_CONTROL'\">\r\n {{ \"agro.angular_components.balance_entry_control_event\" | libTranslate }}\r\n </p>\r\n <p *ngSwitchCase=\"'TICKET'\">\r\n {{ \"agro.angular_components.ticket_maintenance_header\" | libTranslate }}\r\n </p>\r\n <p *ngSwitchCase=\"'TRANSFER'\">\r\n {{ \"agro.angular_components.transfer_origin_event\" | libTranslate }}\r\n </p>\r\n <p *ngSwitchCase=\"'INVOICE'\">\r\n {{ \"agro.angular_components.invoice_creating_event\" | libTranslate }}\r\n </p>\r\n <p *ngSwitchCase=\"'CHANGE_REQUEST'\">\r\n {{ \"agro.angular_components.change_request_event\" | libTranslate }}\r\n </p>\r\n <p *ngSwitchCase=\"'FIXATION'\">\r\n {{ \"agro.angular_components.fixation_event\" | libTranslate }}\r\n </p>\r\n </ng-container>\r\n </div>\r\n <div class=\"ui-g-4\" *ngIf=\"producerInvoice?.e001pes.nomPes\">\r\n <span\r\n ><strong>{{ \"agro.angular_components.supplier\" | libTranslate }}</strong></span\r\n >\r\n <p>{{ producerInvoice?.e001pes.nomPes }}</p>\r\n </div>\r\n <div class=\"ui-g-4\" *ngIf=\"producerInvoice?.ruralEstate.name\">\r\n <span\r\n ><strong>{{ \"agro.angular_components.rural_estate\" | libTranslate }}</strong></span\r\n >\r\n <p>{{ producerInvoice?.ruralEstate.name }}</p>\r\n </div>\r\n <div class=\"ui-g-4\" *ngIf=\"selectedStep?.controlCode\">\r\n <span\r\n ><strong>{{ \"agro.angular_components.control_code\" | libTranslate }}</strong></span\r\n >\r\n <p>{{ selectedStep?.controlCode }}</p>\r\n </div>\r\n <div class=\"ui-g-4\">\r\n <span\r\n ><strong>{{ \"agro.angular_components.status_label\" | libTranslate }}</strong></span\r\n >\r\n <ng-container [ngSwitch]=\"selectedStep?.item.status\">\r\n <p *ngSwitchCase=\"'SUCCESS'\">\r\n <s-badge\r\n [color]=\"BadgeColors.Green\"\r\n text=\"{{\r\n 'agro.angular_components.panel_title_events_completed_successfully'\r\n | libTranslate\r\n }}\"\r\n [selectable]=\"false\"\r\n >\r\n </s-badge>\r\n </p>\r\n <p *ngSwitchCase=\"'PROCESSING'\">\r\n <s-badge\r\n [color]=\"BadgeColors.Orange\"\r\n text=\"{{ 'agro.angular_components.processing' | libTranslate }}\"\r\n [selectable]=\"false\"\r\n >\r\n </s-badge>\r\n </p>\r\n <p *ngSwitchCase=\"'FAILED'\">\r\n <s-badge\r\n [color]=\"BadgeColors.Red\"\r\n text=\"{{\r\n 'agro.angular_components.panel_title_events_ended_with_error'\r\n | libTranslate\r\n }}\"\r\n [selectable]=\"false\"\r\n >\r\n </s-badge>\r\n </p>\r\n <p *ngSwitchCase=\"'PENDING'\">\r\n <s-badge\r\n [color]=\"BadgeColors.Gray\"\r\n text=\"{{ 'agro.angular_components.pending' | libTranslate }}\"\r\n [selectable]=\"false\"\r\n >\r\n </s-badge>\r\n </p>\r\n </ng-container>\r\n </div>\r\n <div class=\"ui-g-4\">\r\n <span\r\n ><strong>{{\r\n \"agro.angular_components.last_update_date\" | libTranslate\r\n }}</strong></span\r\n >\r\n <p>{{ selectedStep?.item.lastModifiedDate | date : \"dd/MM/yyyy HH:mm:ss\" }}</p>\r\n </div>\r\n <div class=\"ui-g-4\" *ngIf=\"selectedStep?.item.status === 'FAILED'\">\r\n <span\r\n ><strong>{{\r\n \"agro.angular_components.event_error_message\" | libTranslate\r\n }}</strong></span\r\n >\r\n <p>{{ selectedStep?.item.message || \"-\" }}</p>\r\n </div>\r\n </div>\r\n </p-fieldset>\r\n </div>\r\n <s-footer>\r\n <div class=\"ui-g\">\r\n <div class=\"ui-g-12 width-fit\">\r\n <s-button\r\n id=\"sidebar-close-button\"\r\n [priority]=\"ButtonPriority.Primary\"\r\n [label]=\"'agro.angular_components.events_close' | libTranslate\"\r\n [auxiliary]=\"false\"\r\n (click)=\"closeSidebar()\"\r\n >\r\n </s-button>\r\n <s-button\r\n *ngIf=\"showReprocessButton\"\r\n id=\"sidebar-reprocess-button\"\r\n [priority]=\"ButtonPriority.Secondary\"\r\n iconClass=\"fa fa-refresh\"\r\n [label]=\"'agro.angular_components.reprocess_event' | libTranslate\"\r\n [auxiliary]=\"false\"\r\n (click)=\"openModal()\"\r\n >\r\n </s-button>\r\n </div>\r\n </div>\r\n </s-footer>\r\n</s-sidebar>\r\n\r\n<p-dialog [header]=\"'agro.angular_components.event_modal_title' | libTranslate\" [(visible)]=\"displayModal\" [modal]=\"true\" class=\"dialog\">\r\n <div class=\"event-modal-text\">{{ \"agro.angular_components.event_modal\" | libTranslate }}</div>\r\n <p-footer>\r\n <div class=\"ui-dialog-buttonpane ui-widget-content ui-helper-clearfix\">\r\n <button\r\n id=\"modal-yes\"\r\n type=\"button\"\r\n pButton\r\n icon=\"fa fa-check\"\r\n (click)=\"confirmModal()\"\r\n label=\"{{ 'agro.angular_components.yes' | libTranslate }}\"\r\n class=\"ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only\"\r\n ></button>\r\n <button\r\n id=\"modal-no\"\r\n type=\"button\"\r\n pButton\r\n icon=\"fa fa-close\"\r\n (click)=\"cancelModal()\"\r\n label=\"{{ 'agro.angular_components.no' | libTranslate }}\"\r\n class=\"ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only\"\r\n ></button>\r\n </div>\r\n </p-footer>\r\n</p-dialog>\r\n\r\n<p-confirmDialog\r\n [acceptLabel]=\"'agro.angular_components.yes' | libTranslate\"\r\n acceptIcon=\"\"\r\n acceptButtonStyleClass=\"ui-button\"\r\n [rejectLabel]=\"'agro.angular_components.no' | libTranslate\"\r\n rejectIcon=\"\"\r\n rejectButtonStyleClass=\"ui-button-secondary\">\r\n</p-confirmDialog>\r\n",
|
|
5062
5089
|
providers: [
|
|
5063
5090
|
{ provide: core.LOCALE_ID, useValue: 'pt-BR' }
|
|
5064
5091
|
],
|
|
5065
|
-
styles: [".frozen{border-left:2px solid #ddd}.dialog{width:\"600px\";height:\"300px\";z-index:100000}"]
|
|
5092
|
+
styles: [".frozen{border-left:2px solid #ddd}.dialog{width:\"600px\";height:\"300px\";z-index:100000}::ng-deep #cancel-button{background-color:#9c3a3a!important;border-color:#9c3a3a!important}::ng-deep #cancel-button:hover{background-color:#642525!important}"]
|
|
5066
5093
|
})
|
|
5067
5094
|
], EventControlBoardComponent);
|
|
5068
5095
|
return EventControlBoardComponent;
|
|
@@ -5763,6 +5790,61 @@
|
|
|
5763
5790
|
return RuralEstateModule;
|
|
5764
5791
|
}());
|
|
5765
5792
|
|
|
5793
|
+
var TicketService = /** @class */ (function (_super) {
|
|
5794
|
+
__extends(TicketService, _super);
|
|
5795
|
+
function TicketService(http, messageService, translate) {
|
|
5796
|
+
var _this = _super.call(this, http, messageService, "agro/origination/entities/ticket", "agro/origination/actions", "agro/origination/queries", translate) || this;
|
|
5797
|
+
_this.http = http;
|
|
5798
|
+
_this.messageService = messageService;
|
|
5799
|
+
_this.translate = translate;
|
|
5800
|
+
return _this;
|
|
5801
|
+
}
|
|
5802
|
+
TicketService.prototype.getTicketSummaryByParent = function (parent) {
|
|
5803
|
+
return this.http
|
|
5804
|
+
.post(this.queriesUrl + "/getTicketSummaryByParent/", { parent: parent })
|
|
5805
|
+
.pipe(this.defaultCatch());
|
|
5806
|
+
};
|
|
5807
|
+
TicketService.prototype.listMainteinerTickets = function (filter) {
|
|
5808
|
+
return this.http
|
|
5809
|
+
.post(this.queriesUrl + "/listMainteinerTickets/", filter)
|
|
5810
|
+
.pipe(this.defaultCatch());
|
|
5811
|
+
};
|
|
5812
|
+
TicketService.prototype.searchTotalWeightResultFromTickets = function (body) {
|
|
5813
|
+
return this.http
|
|
5814
|
+
.post(this.queriesUrl + "/searchTotalWeightResultFromTickets/", body)
|
|
5815
|
+
.pipe(this.defaultCatch());
|
|
5816
|
+
};
|
|
5817
|
+
TicketService.prototype.cancelTicket = function (body) {
|
|
5818
|
+
return this.http
|
|
5819
|
+
.post(this.actionsUrl + "/cancelTicket/", body);
|
|
5820
|
+
};
|
|
5821
|
+
TicketService.prototype.mergeTickets = function (body) {
|
|
5822
|
+
return this.http.post(this.actionsUrl + "/mergeTickets/", body).pipe(this.defaultCatch());
|
|
5823
|
+
};
|
|
5824
|
+
TicketService.prototype.unMergeTickets = function (body) {
|
|
5825
|
+
return this.http.post(this.actionsUrl + "/unMergeTickets/", body).pipe(this.defaultCatch());
|
|
5826
|
+
};
|
|
5827
|
+
TicketService.prototype.checkGroupInvoicePermission = function (body) {
|
|
5828
|
+
return this.http
|
|
5829
|
+
.post(this.queriesUrl + "/checkGroupInvoicePermission/", body)
|
|
5830
|
+
.pipe(this.defaultCatch());
|
|
5831
|
+
};
|
|
5832
|
+
TicketService.prototype.getContractTickets = function (tickets) {
|
|
5833
|
+
return this.http
|
|
5834
|
+
.post(this.queriesUrl + "/getContractTickets/", { tickets: tickets })
|
|
5835
|
+
.pipe(this.defaultCatch());
|
|
5836
|
+
};
|
|
5837
|
+
TicketService.ctorParameters = function () { return [
|
|
5838
|
+
{ type: http.HttpClient },
|
|
5839
|
+
{ type: api.MessageService },
|
|
5840
|
+
{ type: LibTranslationService }
|
|
5841
|
+
]; };
|
|
5842
|
+
TicketService = __decorate([
|
|
5843
|
+
core.Injectable()
|
|
5844
|
+
], TicketService);
|
|
5845
|
+
return TicketService;
|
|
5846
|
+
}(EntityService));
|
|
5847
|
+
|
|
5766
5848
|
var TicketModule = /** @class */ (function () {
|
|
5767
5849
|
function TicketModule() {
|
|
5768
5850
|
}
|
|
@@ -5855,6 +5937,28 @@
|
|
|
5855
5937
|
return TransferModule;
|
|
5856
5938
|
}());
|
|
5857
5939
|
|
|
5940
|
+
var FixationModule = /** @class */ (function () {
|
|
5941
|
+
function FixationModule() {
|
|
5942
|
+
}
|
|
5943
|
+
FixationModule = __decorate([
|
|
5944
|
+
core.NgModule({
|
|
5945
|
+
imports: [
|
|
5946
|
+
platformComponents.PermissionsModule.forChild([
|
|
5947
|
+
{
|
|
5948
|
+
name: 'fixation',
|
|
5949
|
+
actions: ['Visualizar', 'Incluir', 'Editar', 'Excluir'],
|
|
5950
|
+
uri: "res://senior.com.br/agro/fixation/entities/fixation",
|
|
5951
|
+
},
|
|
5952
|
+
]),
|
|
5953
|
+
],
|
|
5954
|
+
providers: [FixationService],
|
|
5955
|
+
declarations: [],
|
|
5956
|
+
exports: [],
|
|
5957
|
+
})
|
|
5958
|
+
], FixationModule);
|
|
5959
|
+
return FixationModule;
|
|
5960
|
+
}());
|
|
5961
|
+
|
|
5858
5962
|
var EventControlBoardModule = /** @class */ (function () {
|
|
5859
5963
|
function EventControlBoardModule() {
|
|
5860
5964
|
}
|
|
@@ -5883,11 +5987,13 @@
|
|
|
5883
5987
|
RuralEstateModule,
|
|
5884
5988
|
TicketModule,
|
|
5885
5989
|
WebsocketModule,
|
|
5886
|
-
LibTranslationModule
|
|
5990
|
+
LibTranslationModule,
|
|
5991
|
+
FixationModule
|
|
5887
5992
|
],
|
|
5888
5993
|
declarations: [EventControlBoardComponent],
|
|
5889
5994
|
exports: [EventControlBoardComponent],
|
|
5890
|
-
providers: [E012famService, E205depService, PaginatorStorageService,
|
|
5995
|
+
providers: [E012famService, E205depService, PaginatorStorageService,
|
|
5996
|
+
EventControlService, EventControlBoardService, primeng.ConfirmationService],
|
|
5891
5997
|
})
|
|
5892
5998
|
], EventControlBoardModule);
|
|
5893
5999
|
return EventControlBoardModule;
|
|
@@ -5943,6 +6049,7 @@
|
|
|
5943
6049
|
exports.EventStepsComponent = EventStepsComponent;
|
|
5944
6050
|
exports.EventStepsModule = EventStepsModule;
|
|
5945
6051
|
exports.ExternalInvoiceModule = ExternalInvoiceModule;
|
|
6052
|
+
exports.FixationModule = FixationModule;
|
|
5946
6053
|
exports.HostProjectConfigsInjectionToken = HostProjectConfigsInjectionToken;
|
|
5947
6054
|
exports.InvoiceModule = InvoiceModule;
|
|
5948
6055
|
exports.LibTranslatePipe = LibTranslatePipe;
|