@senior-agronegocio/angular-components 0.0.58 → 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 -689
- 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-regex.constant.d.ts +0 -8
- 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-regex.constant.js +1 -9
- 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-regex.constant.js +1 -9
- 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 -665
- package/fesm2015/senior-agronegocio-angular-components.js.map +1 -1
- package/fesm5/senior-agronegocio-angular-components.js +790 -692
- 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,157 +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 Placa de veículo padrão mercosul
|
|
1759
|
-
*/
|
|
1760
|
-
isMercosulLicensePlate: /^[A-Z]{3}\d[A-Z]\d{2}$/,
|
|
1761
|
-
/**
|
|
1762
|
-
* Validação de Placa de veículo padrão antigo AAA-1234
|
|
1763
|
-
*/
|
|
1764
|
-
isOldLicensePlate: /^[A-Z]{3}-?\d{4}$/,
|
|
1765
|
-
/**
|
|
1766
|
-
* Validação de Número de Telefone
|
|
1767
|
-
*/
|
|
1768
|
-
isPhoneNumber: /^\+?\d{1,4}-?\d{6,11}$/,
|
|
1769
|
-
/**
|
|
1770
|
-
* Validação de Data (Formato YYYY-MM-DD)
|
|
1771
|
-
*/
|
|
1772
|
-
isDate: /^\d{4}-\d{2}-\d{2}$/,
|
|
1773
|
-
/**
|
|
1774
|
-
* Validação de Hora (Formato HH:mm)
|
|
1775
|
-
*/
|
|
1776
|
-
isTime: /^(0\d|1\d|2[0-3]):[0-5]\d$/,
|
|
1777
|
-
/**
|
|
1778
|
-
* Validação de Data e Hora (Formato YYYY-MM-DD HH:mm)
|
|
1779
|
-
*/
|
|
1780
|
-
isDateTime: /^\d{4}-\d{2}-\d{2} (0\d|1\d|2[0-3]):[0-5]\d$/,
|
|
1781
|
-
/**
|
|
1782
|
-
* Validação de URL
|
|
1783
|
-
*/
|
|
1784
|
-
isURL: /^(http|https):\/\/([\w-]+\.)+[\w-]+(\/[\w- ./?%&=]*)?$/,
|
|
1785
|
-
/**
|
|
1786
|
-
* Validação de Número Hexadecimal
|
|
1787
|
-
*/
|
|
1788
|
-
isHexNumber: /^[0-9a-fA-F]+$/,
|
|
1789
|
-
/**
|
|
1790
|
-
* Validação de Base64
|
|
1791
|
-
*/
|
|
1792
|
-
isBase64: /^[a-zA-Z0-9+/]+={0,2}$/,
|
|
1793
|
-
/**
|
|
1794
|
-
* Validação de Nome de Usuário (3 a 20 caracteres alfanuméricos)
|
|
1795
|
-
*/
|
|
1796
|
-
isUsername: /^\w{3,20}$/,
|
|
1797
|
-
/**
|
|
1798
|
-
* Validação de Alfanumérico
|
|
1799
|
-
*/
|
|
1800
|
-
isAlphanumeric: /^[a-zA-Z0-9]+$/,
|
|
1801
|
-
/**
|
|
1802
|
-
* Validação de Slug (letras minúsculas, números e traços)
|
|
1803
|
-
*/
|
|
1804
|
-
isSlug: /^[a-z0-9-]+$/,
|
|
1805
|
-
/**
|
|
1806
|
-
* Validação de Número de Cartão de Crédito
|
|
1807
|
-
*/
|
|
1808
|
-
isCreditCard: /^\d{4}-\d{4}-\d{4}-\d{4}$/,
|
|
1809
|
-
/**
|
|
1810
|
-
* Validação de Número Hexadecimal
|
|
1811
|
-
*/
|
|
1812
|
-
isHexadecimal: /^[0-9a-fA-F]+$/,
|
|
1813
|
-
/**
|
|
1814
|
-
* Validação de Moeda
|
|
1815
|
-
*/
|
|
1816
|
-
isCurrency: /^\d+(\.\d{1,2})?$/,
|
|
1817
|
-
/**
|
|
1818
|
-
* Validação de Porcentagem
|
|
1819
|
-
*/
|
|
1820
|
-
isPercentage: /^(100(\.0{1,2})?|[1-9]?\d(\.\d{1,2})?)$/,
|
|
1821
|
-
/**
|
|
1822
|
-
* Validação de Tag HTML Simples
|
|
1823
|
-
*/
|
|
1824
|
-
isHTMLTag: /^<([a-z]+)([^<]+)*(?:>(.*)<\/\1>|\s+\/>)$/,
|
|
1825
|
-
/**
|
|
1826
|
-
* Validação de Nome de Usuário com Espaços (3 a 20 caracteres alfanuméricos e espaços)
|
|
1827
|
-
*/
|
|
1828
|
-
isUsernameWithSpaces: /^[a-zA-Z0-9_ ]{3,20}$/,
|
|
1829
|
-
/**
|
|
1830
|
-
* Validação de Senha Forte (mínimo 8 caracteres, uma letra minúscula, uma letra maiúscula, um número e um caractere especial)
|
|
1831
|
-
*/
|
|
1832
|
-
isStrongPassword: /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$/,
|
|
1833
|
-
/**
|
|
1834
|
-
* Validação de String Alfabética
|
|
1835
|
-
*/
|
|
1836
|
-
isAlphabetic: /^[a-zA-Z]+$/,
|
|
1837
|
-
/**
|
|
1838
|
-
* Validação de Hora no Formato de 12 Horas
|
|
1839
|
-
*/
|
|
1840
|
-
isTime12Hour: /^(0?[1-9]|1[0-2]):\d{2} (AM|PM)$/i,
|
|
1841
|
-
/**
|
|
1842
|
-
* Validação de Latitude
|
|
1843
|
-
*/
|
|
1844
|
-
isLatitude: /^[-+]?([1-8]?\d(\.\d+)?|90(\.0+)?)$/,
|
|
1845
|
-
/**
|
|
1846
|
-
* Validação de Longitude
|
|
1847
|
-
*/
|
|
1848
|
-
isLongitude: /^[-+]?(180(\.0+)?|((1[0-7]\d)|([1-9]?\d))(\.\d+)?)$/,
|
|
1849
|
-
/**
|
|
1850
|
-
* Validação de Endereço MAC
|
|
1851
|
-
*/
|
|
1852
|
-
isMACAddress: /^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$/,
|
|
1853
|
-
/**
|
|
1854
|
-
* Validação de Data de Expiração de Cartão de Crédito
|
|
1855
|
-
*/
|
|
1856
|
-
isCreditCardExpiration: /^(0[1-9]|1[0-2])\/\d{2}$/,
|
|
1857
|
-
/**
|
|
1858
|
-
* Validação de Número de Seguro Social (SSN)
|
|
1859
|
-
*/
|
|
1860
|
-
isSSN: /^\d{3}-\d{2}-\d{4}$/,
|
|
1861
|
-
/**
|
|
1862
|
-
* Validação se todos os dígitos são iguais
|
|
1863
|
-
*/
|
|
1864
|
-
isAllDigitsEqual: /^(.)\1+$/,
|
|
1865
|
-
};
|
|
1866
|
-
|
|
1867
2094
|
/**
|
|
1868
2095
|
* Classe utilitária para operações de string.
|
|
1869
2096
|
*/
|
|
@@ -2116,31 +2343,70 @@
|
|
|
2116
2343
|
return matches ? matches.length : exports.AGRO_NUMBERS.ZERO;
|
|
2117
2344
|
};
|
|
2118
2345
|
AgroStringUtils.validateCPF = function (cpf) {
|
|
2346
|
+
// Remover caracteres não numéricos
|
|
2119
2347
|
cpf = cpf.replace(/\D/g, "");
|
|
2120
|
-
|
|
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])) {
|
|
2121
2379
|
return false;
|
|
2122
2380
|
}
|
|
2123
|
-
|
|
2124
|
-
var sum = 0;
|
|
2125
|
-
for (var i = 0; i < length; i++) {
|
|
2126
|
-
sum += Number(cpf[i]) * (length + 1 - i);
|
|
2127
|
-
}
|
|
2128
|
-
var remainder = sum % 11;
|
|
2129
|
-
return remainder < 2 ? 0 : 11 - remainder;
|
|
2130
|
-
};
|
|
2131
|
-
return calcCheckDigit(9) === Number(cpf[9]) && calcCheckDigit(10) === Number(cpf[10]);
|
|
2381
|
+
return true;
|
|
2132
2382
|
};
|
|
2133
2383
|
AgroStringUtils.validateCNPJ = function (cnpj) {
|
|
2384
|
+
// Remove todos os caracteres não numéricos
|
|
2134
2385
|
cnpj = cnpj.replace(/\D/g, "");
|
|
2135
|
-
|
|
2386
|
+
// Verifica se tem 14 dígitos
|
|
2387
|
+
if (cnpj.length !== 14)
|
|
2136
2388
|
return false;
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
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;
|
|
2144
2410
|
};
|
|
2145
2411
|
/**
|
|
2146
2412
|
* Método para aplicar uma máscara em uma string. Considere a máscara com valores 9 para aplicação
|
|
@@ -2200,25 +2466,6 @@
|
|
|
2200
2466
|
AgroStringUtils.isInvalid = function (str) {
|
|
2201
2467
|
return !AgroStringUtils.isValid(str);
|
|
2202
2468
|
};
|
|
2203
|
-
/**
|
|
2204
|
-
* Valida se uma string é um e-mail válido ou não
|
|
2205
|
-
* Retorna um booleano para indicar se é um e-mail válido ou não
|
|
2206
|
-
* @param email - A string a ser verificada
|
|
2207
|
-
* @returns True se a string for um e-mail válido, false caso contrário
|
|
2208
|
-
*/
|
|
2209
|
-
AgroStringUtils.isValidEmail = function (email) {
|
|
2210
|
-
return AGRO_REGEX.isEmail.test(email);
|
|
2211
|
-
};
|
|
2212
|
-
/**
|
|
2213
|
-
* Valida se uma string é uma placa de veículo BR válida ou não.
|
|
2214
|
-
* Retorna um booleano para indicar se é uma placa válida ou não.
|
|
2215
|
-
* @param plate - A string a ser verificada
|
|
2216
|
-
*/
|
|
2217
|
-
AgroStringUtils.isValidLicensePlate = function (plate) {
|
|
2218
|
-
var oldFormat = /^[A-Z]{3}-?\d{4}$/;
|
|
2219
|
-
var mercosulFormat = /^[A-Z]{3}\d[A-Z]\d{2}$/;
|
|
2220
|
-
return oldFormat.test(plate) || mercosulFormat.test(plate);
|
|
2221
|
-
};
|
|
2222
2469
|
return AgroStringUtils;
|
|
2223
2470
|
}());
|
|
2224
2471
|
|
|
@@ -2264,11 +2511,10 @@
|
|
|
2264
2511
|
*/
|
|
2265
2512
|
AgroPlatformUtils.getCurrentUserName = function () {
|
|
2266
2513
|
var _a;
|
|
2267
|
-
var cookie = AgroCookieUtils.getCookie('com.senior.token'
|
|
2514
|
+
var cookie = AgroCookieUtils.getCookie('com.senior.token');
|
|
2268
2515
|
if (cookie) {
|
|
2269
|
-
var str = (_a =
|
|
2516
|
+
var str = (_a = AgroCookieUtils.parseCookieToObject(cookie)) === null || _a === void 0 ? void 0 : _a.fullName;
|
|
2270
2517
|
if (str) {
|
|
2271
|
-
str = str.replace(/\+/g, ' ');
|
|
2272
2518
|
return str;
|
|
2273
2519
|
}
|
|
2274
2520
|
}
|
|
@@ -2281,9 +2527,9 @@
|
|
|
2281
2527
|
*/
|
|
2282
2528
|
AgroPlatformUtils.getCurrentUserEmail = function () {
|
|
2283
2529
|
var _a;
|
|
2284
|
-
var cookie = AgroCookieUtils.getCookie('com.senior.token'
|
|
2530
|
+
var cookie = AgroCookieUtils.getCookie('com.senior.token');
|
|
2285
2531
|
if (cookie) {
|
|
2286
|
-
var str = (_a =
|
|
2532
|
+
var str = (_a = AgroCookieUtils.parseCookieToObject(cookie)) === null || _a === void 0 ? void 0 : _a.email;
|
|
2287
2533
|
if (str) {
|
|
2288
2534
|
return str;
|
|
2289
2535
|
}
|
|
@@ -2631,268 +2877,26 @@
|
|
|
2631
2877
|
/**
|
|
2632
2878
|
* Localiza um item em um array de objetos de acordo com a propriedade e valor informados.
|
|
2633
2879
|
*/
|
|
2634
|
-
AgroArrayUtils.findItemByProperty = function (array, property, value) {
|
|
2635
|
-
var e_1, _a;
|
|
2636
|
-
try {
|
|
2637
|
-
for (var array_1 = __values(array), array_1_1 = array_1.next(); !array_1_1.done; array_1_1 = array_1.next()) {
|
|
2638
|
-
var item = array_1_1.value;
|
|
2639
|
-
if (item[property] === value) {
|
|
2640
|
-
return item;
|
|
2641
|
-
}
|
|
2642
|
-
}
|
|
2643
|
-
}
|
|
2644
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
2645
|
-
finally {
|
|
2646
|
-
try {
|
|
2647
|
-
if (array_1_1 && !array_1_1.done && (_a = array_1.return)) _a.call(array_1);
|
|
2648
|
-
}
|
|
2649
|
-
finally { if (e_1) throw e_1.error; }
|
|
2650
|
-
}
|
|
2651
|
-
return null;
|
|
2652
|
-
};
|
|
2653
|
-
return AgroArrayUtils;
|
|
2654
|
-
}());
|
|
2655
|
-
|
|
2656
|
-
var AgroFormValidator = /** @class */ (function () {
|
|
2657
|
-
function AgroFormValidator() {
|
|
2658
|
-
}
|
|
2659
|
-
/**
|
|
2660
|
-
* Validator para checar se o campo é um e-mail
|
|
2661
|
-
*
|
|
2662
|
-
* @example
|
|
2663
|
-
* this.myForm = this.fb.group({
|
|
2664
|
-
* EMAIL_FIELD: ['', [Validators.required, AgroFormValidator.emailValidator]]
|
|
2665
|
-
* });
|
|
2666
|
-
* @param control
|
|
2667
|
-
* @returns
|
|
2668
|
-
*/
|
|
2669
|
-
AgroFormValidator.emailValidator = function (control) {
|
|
2670
|
-
var email = control.value;
|
|
2671
|
-
if (!email) {
|
|
2672
|
-
return null;
|
|
2673
|
-
}
|
|
2674
|
-
return AgroStringUtils.isValidEmail(email) ? null : { emailValidator: true };
|
|
2675
|
-
};
|
|
2676
|
-
/**
|
|
2677
|
-
* Aplique esse validador em um campo do tipo Date, para verificar se a data selecionada é maior ou menor que a data atual.
|
|
2678
|
-
*
|
|
2679
|
-
* Utilize o parâmetro comparisonType para definir se a data selecionada deve ser maior ou menor que a data atual.
|
|
2680
|
-
* A validação será através do enum DateComparisonType.
|
|
2681
|
-
*
|
|
2682
|
-
* @example
|
|
2683
|
-
* this.myForm = this.fb.group({
|
|
2684
|
-
* NOME_CAMPO: ['', [Validators.required, AgroFormValidator.compareDateWithToday(DateComparisonType.greatherThan)]]
|
|
2685
|
-
* });
|
|
2686
|
-
* @param comparisonType
|
|
2687
|
-
* @returns
|
|
2688
|
-
*/
|
|
2689
|
-
AgroFormValidator.compareDateWithToday = function (comparisonType) {
|
|
2690
|
-
var compareDate = function (control) {
|
|
2691
|
-
var _a, _b;
|
|
2692
|
-
var methodName = 'dateComparisonToday';
|
|
2693
|
-
var selectedDate = new Date(control.value);
|
|
2694
|
-
var currentDate = new Date();
|
|
2695
|
-
var conditions = (_a = {},
|
|
2696
|
-
_a[exports.DateComparisonType.greatherThan] = selectedDate <= currentDate,
|
|
2697
|
-
_a[exports.DateComparisonType.lessThan] = selectedDate >= currentDate,
|
|
2698
|
-
_a);
|
|
2699
|
-
if (conditions[comparisonType]) {
|
|
2700
|
-
return _b = {}, _b[methodName] = { value: control.value }, _b;
|
|
2701
|
-
}
|
|
2702
|
-
return null;
|
|
2703
|
-
};
|
|
2704
|
-
return compareDate;
|
|
2705
|
-
};
|
|
2706
|
-
/**
|
|
2707
|
-
* Compara dois campos do tipo Date, verificando se o campo A é maior que o campo B. Se A for maior que B, então
|
|
2708
|
-
* o campo A é invalidado. Caso contrário, o campo A é validado.
|
|
2709
|
-
*
|
|
2710
|
-
* Aplique esse campo no FormGroup, passando os nomes dos campos que deseja comparar.
|
|
2711
|
-
* @example
|
|
2712
|
-
* this.myForm = this.fb.group({
|
|
2713
|
-
NOME_CAMPO_dateA: ['', Validators.required],
|
|
2714
|
-
NOME_CAMPO_dateB: ['', Validators.required]
|
|
2715
|
-
}, { validator: AgroFormValidator.dateComparisonValidator('NOME_CAMPO_dateA', 'NOME_CAMPO_dateB') });
|
|
2716
|
-
* @param controlNameA
|
|
2717
|
-
* @param controlNameB
|
|
2718
|
-
* @returns
|
|
2719
|
-
*/
|
|
2720
|
-
AgroFormValidator.compareDateWithOtherDateField = function (controlNameA, controlNameB) {
|
|
2721
|
-
var compareDate = function (control) {
|
|
2722
|
-
var _a, _b;
|
|
2723
|
-
var _c, _d, _e, _f, _g;
|
|
2724
|
-
var formGroup = control;
|
|
2725
|
-
var dateA = (_c = formGroup.get(controlNameA)) === null || _c === void 0 ? void 0 : _c.value;
|
|
2726
|
-
var dateB = (_d = formGroup.get(controlNameB)) === null || _d === void 0 ? void 0 : _d.value;
|
|
2727
|
-
var methodName = 'compareDateWithOtherDateField';
|
|
2728
|
-
if (dateA && dateB) {
|
|
2729
|
-
var dateAObj = new Date(dateA);
|
|
2730
|
-
var dateBObj = new Date(dateB);
|
|
2731
|
-
if (dateAObj < dateBObj) {
|
|
2732
|
-
(_e = formGroup.get(controlNameA)) === null || _e === void 0 ? void 0 : _e.setErrors((_a = {}, _a[methodName] = true, _a));
|
|
2733
|
-
return _b = {}, _b[methodName] = true, _b;
|
|
2734
|
-
}
|
|
2735
|
-
else if ((_f = formGroup.get(controlNameA)) === null || _f === void 0 ? void 0 : _f.hasError(methodName)) {
|
|
2736
|
-
(_g = formGroup.get(controlNameA)) === null || _g === void 0 ? void 0 : _g.setErrors(null);
|
|
2737
|
-
}
|
|
2738
|
-
}
|
|
2739
|
-
return null;
|
|
2740
|
-
};
|
|
2741
|
-
return compareDate;
|
|
2742
|
-
};
|
|
2743
|
-
/**
|
|
2744
|
-
* Validator para checar se um campo de números é maior ou menor que outro campo.
|
|
2745
|
-
*
|
|
2746
|
-
* Aplique esse validator no FormGroup, passando os nomes dos campos que deseja comparar.
|
|
2747
|
-
* @example
|
|
2748
|
-
* this.myForm = this.fb.group({
|
|
2749
|
-
* NUMERO_A: ['', Validators.required],
|
|
2750
|
-
* NUMERO_B: ['', Validators.required]
|
|
2751
|
-
* }, { validator: AgroFormValidator.compareNumberFields('NUMERO_A', 'NUMERO_B', NumberComparisonType.EQUALS) });
|
|
2752
|
-
*
|
|
2753
|
-
* Neste caso, a verificação será se o NUMERO_A é igual ao NUMERB_B.
|
|
2754
|
-
* @param controlNameA
|
|
2755
|
-
* @param controlNameB
|
|
2756
|
-
* @returns
|
|
2757
|
-
*/
|
|
2758
|
-
AgroFormValidator.compareNumberFields = function (controlNameA, controlNameB, comparisonMethod) {
|
|
2759
|
-
var compareNumber = function (control) {
|
|
2760
|
-
var _a, _b, _c;
|
|
2761
|
-
var _d, _e, _f;
|
|
2762
|
-
var formGroup = control;
|
|
2763
|
-
var numberA = (_d = formGroup.get(controlNameA)) === null || _d === void 0 ? void 0 : _d.value;
|
|
2764
|
-
var numberB = (_e = formGroup.get(controlNameB)) === null || _e === void 0 ? void 0 : _e.value;
|
|
2765
|
-
var methodName = 'compareNumberFields';
|
|
2766
|
-
if (numberA && numberB) {
|
|
2767
|
-
var errorType = exports.NumberComparisonType[comparisonMethod];
|
|
2768
|
-
var errorCondition = (_a = {},
|
|
2769
|
-
_a[exports.NumberComparisonType.EQUALS] = numberA !== numberB,
|
|
2770
|
-
_a[exports.NumberComparisonType.GREATER_THAN] = numberA <= numberB,
|
|
2771
|
-
_a[exports.NumberComparisonType.LESS_THAN] = numberA >= numberB,
|
|
2772
|
-
_a[exports.NumberComparisonType.GREATER_THAN_OR_EQUAL] = numberA < numberB,
|
|
2773
|
-
_a[exports.NumberComparisonType.LESS_THAN_OR_EQUAL] = numberA > numberB,
|
|
2774
|
-
_a[exports.NumberComparisonType.NOT_EQUALS] = numberA === numberB,
|
|
2775
|
-
_a);
|
|
2776
|
-
if (errorCondition[comparisonMethod]) {
|
|
2777
|
-
var controlA = formGroup.get(controlNameA);
|
|
2778
|
-
if (controlA) {
|
|
2779
|
-
controlA.setErrors((_b = {}, _b[methodName] = comparisonMethod, _b));
|
|
2780
|
-
}
|
|
2781
|
-
return _c = {}, _c[methodName] = errorType, _c;
|
|
2782
|
-
}
|
|
2783
|
-
else if ((_f = formGroup.get(controlNameA)) === null || _f === void 0 ? void 0 : _f.hasError(methodName)) {
|
|
2784
|
-
var controlA = formGroup.get(controlNameA);
|
|
2785
|
-
if (controlA) {
|
|
2786
|
-
controlA.setErrors(null);
|
|
2787
|
-
}
|
|
2788
|
-
}
|
|
2789
|
-
}
|
|
2790
|
-
return null;
|
|
2791
|
-
};
|
|
2792
|
-
return compareNumber;
|
|
2793
|
-
};
|
|
2794
|
-
/**
|
|
2795
|
-
* Validator para checar se um valor está entre os demais valores de três formControls.
|
|
2796
|
-
*
|
|
2797
|
-
* Aplique esse validator no FormGroup, passando os nomes dos três formControls que deseja comparar.
|
|
2798
|
-
* @example
|
|
2799
|
-
* this.myForm = this.fb.group({
|
|
2800
|
-
* minorFormControl: ['', Validators.required],
|
|
2801
|
-
* targetFormControl: ['', Validators.required],
|
|
2802
|
-
* majorFormControl: ['', Validators.required]
|
|
2803
|
-
* }, { validator: AgroFormValidator.checkValueBetween('minorFormControl', 'targetFormControl', 'majorFormControl') });
|
|
2804
|
-
*
|
|
2805
|
-
* Neste caso, a verificação será se o targetFormControl está entre o minorFormControl e o majorFormControl.
|
|
2806
|
-
* @param minorFormControl
|
|
2807
|
-
* @param targetFormControl
|
|
2808
|
-
* @param majorFormControl
|
|
2809
|
-
* @returns
|
|
2810
|
-
*/
|
|
2811
|
-
AgroFormValidator.checkValueBetween = function (minorFormControl, targetFormControl, majorFormControl) {
|
|
2812
|
-
var checkValue = function (control) {
|
|
2813
|
-
var _a, _b;
|
|
2814
|
-
var _c, _d, _e, _f;
|
|
2815
|
-
var formGroup = control;
|
|
2816
|
-
var valueA = (_c = formGroup.get(minorFormControl)) === null || _c === void 0 ? void 0 : _c.value;
|
|
2817
|
-
var valueB = (_d = formGroup.get(targetFormControl)) === null || _d === void 0 ? void 0 : _d.value;
|
|
2818
|
-
var valueC = (_e = formGroup.get(majorFormControl)) === null || _e === void 0 ? void 0 : _e.value;
|
|
2819
|
-
var methodName = 'checkValueBetween';
|
|
2820
|
-
if (valueA && valueB && valueC) {
|
|
2821
|
-
if (valueB < valueA || valueB > valueC) {
|
|
2822
|
-
var targetControl = formGroup.get(targetFormControl);
|
|
2823
|
-
if (targetControl) {
|
|
2824
|
-
targetControl.setErrors((_a = {}, _a[methodName] = true, _a));
|
|
2825
|
-
}
|
|
2826
|
-
return _b = {}, _b[methodName] = true, _b;
|
|
2827
|
-
}
|
|
2828
|
-
else if ((_f = formGroup.get(targetFormControl)) === null || _f === void 0 ? void 0 : _f.hasError(methodName)) {
|
|
2829
|
-
var targetControl = formGroup.get(targetFormControl);
|
|
2830
|
-
if (targetControl) {
|
|
2831
|
-
targetControl.setErrors(null);
|
|
2832
|
-
}
|
|
2833
|
-
}
|
|
2834
|
-
}
|
|
2835
|
-
return null;
|
|
2836
|
-
};
|
|
2837
|
-
return checkValue;
|
|
2838
|
-
};
|
|
2839
|
-
/**
|
|
2840
|
-
* Validator para checar se o campo é um objeto e se possui uma propriedade específica.
|
|
2841
|
-
*
|
|
2842
|
-
* @example
|
|
2843
|
-
* this.myForm = this.fb.group({
|
|
2844
|
-
* OBJETO_FIELD: ['', [Validators.required, AgroFormValidator.objectPropertyValidator('propriedade')]]
|
|
2845
|
-
* });
|
|
2846
|
-
* @param propertyName
|
|
2847
|
-
* @returns
|
|
2848
|
-
*/
|
|
2849
|
-
AgroFormValidator.objectPropertyValidator = function (propertyName) {
|
|
2850
|
-
var objectProperty = function (control) {
|
|
2851
|
-
var _a, _b;
|
|
2852
|
-
var methodName = 'objectProperty';
|
|
2853
|
-
if (AgroObjectUtils.isObject(control.value) && AgroObjectUtils.containsProperty(control.value, propertyName)) {
|
|
2854
|
-
control.setErrors(null);
|
|
2855
|
-
return null;
|
|
2856
|
-
}
|
|
2857
|
-
control.setErrors((_a = {}, _a[methodName] = true, _a));
|
|
2858
|
-
return _b = {}, _b[methodName] = true, _b;
|
|
2859
|
-
};
|
|
2860
|
-
return objectProperty;
|
|
2861
|
-
};
|
|
2862
|
-
/**
|
|
2863
|
-
* Verifica se a string informada é um CPF válido.
|
|
2864
|
-
* Se a validação for false, retorna um objeto com a chave cpfValidator.
|
|
2865
|
-
*/
|
|
2866
|
-
AgroFormValidator.CPFValidator = function (control) {
|
|
2867
|
-
var cpf = control.value;
|
|
2868
|
-
if (!cpf) {
|
|
2869
|
-
return null;
|
|
2870
|
-
}
|
|
2871
|
-
return AgroStringUtils.validateCPF(cpf) ? null : { cpfValidator: true };
|
|
2872
|
-
};
|
|
2873
|
-
/**
|
|
2874
|
-
* Verifica se a string informada é um CNPJ válido.
|
|
2875
|
-
* Se a validação for false, retorna um objeto com a chave cnpjValidator.
|
|
2876
|
-
*/
|
|
2877
|
-
AgroFormValidator.CNPJValidator = function (control) {
|
|
2878
|
-
var cnpj = control.value;
|
|
2879
|
-
if (!cnpj) {
|
|
2880
|
-
return null;
|
|
2881
|
-
}
|
|
2882
|
-
return AgroStringUtils.validateCNPJ(cnpj) ? null : { cnpjValidator: true };
|
|
2883
|
-
};
|
|
2884
|
-
/**
|
|
2885
|
-
* Verifica se a string informada é uma placa de veículo válido.
|
|
2886
|
-
* Se a validação for false, retorna um objeto com a chave licensePlate.
|
|
2887
|
-
*/
|
|
2888
|
-
AgroFormValidator.licensePlateValidator = function (control) {
|
|
2889
|
-
var plate = control.value;
|
|
2890
|
-
if (!plate) {
|
|
2891
|
-
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; }
|
|
2892
2896
|
}
|
|
2893
|
-
return
|
|
2897
|
+
return null;
|
|
2894
2898
|
};
|
|
2895
|
-
return
|
|
2899
|
+
return AgroArrayUtils;
|
|
2896
2900
|
}());
|
|
2897
2901
|
|
|
2898
2902
|
var AsyncLock = /** @class */ (function () {
|
|
@@ -3475,7 +3479,7 @@
|
|
|
3475
3479
|
"agro.angular_components.ticket": "Ticket",
|
|
3476
3480
|
"agro.angular_components.company": "Empresa",
|
|
3477
3481
|
"agro.angular_components.label_branch": "Filial",
|
|
3478
|
-
"agro.angular_components.event_sidebar_title": "Evento - {
|
|
3482
|
+
"agro.angular_components.event_sidebar_title": "Evento - {event}",
|
|
3479
3483
|
"agro.angular_components.reprocessing_event_message_title": "Reprocessando Evento",
|
|
3480
3484
|
"agro.angular_components.reprocessing_event_message_description": "O evento selecionado está sendo reprocessado.",
|
|
3481
3485
|
"agro.angular_components.error_reprocessing_event_message_title": "Erro ao reprocessar evento",
|
|
@@ -3644,6 +3648,20 @@
|
|
|
3644
3648
|
"agro.angular_components.TRANSFER_CREATE_INCOMING_INVOICE": "Criação da nota fiscal de entrada da transferencia",
|
|
3645
3649
|
"agro.angular_components.TRANSFER_CREATE_OUTGOING_INVOICE": "Criação da nota fiscal de saida da transferencia",
|
|
3646
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."
|
|
3647
3665
|
};
|
|
3648
3666
|
|
|
3649
3667
|
var enUS = {
|
|
@@ -3672,7 +3690,7 @@
|
|
|
3672
3690
|
"agro.angular_components.balance_entry_control_event": "Balance Entry/Exit",
|
|
3673
3691
|
"agro.angular_components.event_origin_label": "Event origin",
|
|
3674
3692
|
"agro.angular_components.event_details_header": "Event Details",
|
|
3675
|
-
"agro.angular_components.registers_found": "{
|
|
3693
|
+
"agro.angular_components.registers_found": "{total} record(s) found",
|
|
3676
3694
|
"agro.angular_components.change_request_event": "Weight Change",
|
|
3677
3695
|
"agro.angular_components.status_label": "Status",
|
|
3678
3696
|
"agro.angular_components.panel_title_events_completed_successfully": "Success",
|
|
@@ -3680,7 +3698,7 @@
|
|
|
3680
3698
|
"agro.angular_components.ticket": "Ticket",
|
|
3681
3699
|
"agro.angular_components.company": "Company",
|
|
3682
3700
|
"agro.angular_components.label_branch": "Branch",
|
|
3683
|
-
"agro.angular_components.event_sidebar_title": "Event - {
|
|
3701
|
+
"agro.angular_components.event_sidebar_title": "Event - {event}",
|
|
3684
3702
|
"agro.angular_components.reprocessing_event_message_title": "Reprocessing Event",
|
|
3685
3703
|
"agro.angular_components.reprocessing_event_message_description": "The selected event is being reprocessed.",
|
|
3686
3704
|
"agro.angular_components.error_reprocessing_event_message_title": "Error reprocessing event",
|
|
@@ -3849,6 +3867,20 @@
|
|
|
3849
3867
|
"agro.angular_components.TRANSFER_CREATE_INCOMING_INVOICE": "Creation of invoice transfer input",
|
|
3850
3868
|
"agro.angular_components.TRANSFER_CREATE_OUTGOING_INVOICE": "Creation of the outgoing transfer invoice",
|
|
3851
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."
|
|
3852
3884
|
};
|
|
3853
3885
|
|
|
3854
3886
|
var esCO = {
|
|
@@ -3877,7 +3909,7 @@
|
|
|
3877
3909
|
"agro.angular_components.balance_entry_control_event": "Entrada/salida balanza",
|
|
3878
3910
|
"agro.angular_components.event_origin_label": "Origen del evento",
|
|
3879
3911
|
"agro.angular_components.event_details_header": "Detalles del Evento",
|
|
3880
|
-
"agro.angular_components.registers_found": "{
|
|
3912
|
+
"agro.angular_components.registers_found": "{total} registro(s) encontrado(s)",
|
|
3881
3913
|
"agro.angular_components.change_request_event": "Cambio de Pesaje",
|
|
3882
3914
|
"agro.angular_components.status_label": "Estado",
|
|
3883
3915
|
"agro.angular_components.panel_title_events_completed_successfully": "Éxito",
|
|
@@ -3885,7 +3917,7 @@
|
|
|
3885
3917
|
"agro.angular_components.ticket": "Ticket",
|
|
3886
3918
|
"agro.angular_components.company": "Empresa",
|
|
3887
3919
|
"agro.angular_components.label_branch": "Sucursal",
|
|
3888
|
-
"agro.angular_components.event_sidebar_title": "Evento - {
|
|
3920
|
+
"agro.angular_components.event_sidebar_title": "Evento - {event}",
|
|
3889
3921
|
"agro.angular_components.reprocessing_event_message_title": "Reprocesando Evento",
|
|
3890
3922
|
"agro.angular_components.reprocessing_event_message_description": "El evento seleccionado está siendo reprocesado.",
|
|
3891
3923
|
"agro.angular_components.error_reprocessing_event_message_title": "Error al reprocesar evento",
|
|
@@ -4054,6 +4086,20 @@
|
|
|
4054
4086
|
"agro.angular_components.TRANSFER_CREATE_INCOMING_INVOICE": "Creación de la factura entrante de transferencia",
|
|
4055
4087
|
"agro.angular_components.TRANSFER_CREATE_OUTGOING_INVOICE": "Creación de la factura de transferencia saliente",
|
|
4056
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."
|
|
4057
4103
|
};
|
|
4058
4104
|
|
|
4059
4105
|
var LibTranslationService = /** @class */ (function () {
|
|
@@ -4211,6 +4257,12 @@
|
|
|
4211
4257
|
EventOperation["TRANSFER_CREATE_INCOMING_INVOICE"] = "TRANSFER_CREATE_INCOMING_INVOICE";
|
|
4212
4258
|
EventOperation["TRANSFER_CREATE_OUTGOING_INVOICE"] = "TRANSFER_CREATE_OUTGOING_INVOICE";
|
|
4213
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";
|
|
4214
4266
|
})(EventOperation || (EventOperation = {}));
|
|
4215
4267
|
|
|
4216
4268
|
var EventOrigin;
|
|
@@ -4221,6 +4273,7 @@
|
|
|
4221
4273
|
EventOrigin["TRANSFER"] = "TRANSFER";
|
|
4222
4274
|
EventOrigin["CHANGE_REQUEST"] = "CHANGE_REQUEST";
|
|
4223
4275
|
EventOrigin["CREATE_INVOICE"] = "CREATE_INVOICE";
|
|
4276
|
+
EventOrigin["FIXATION"] = "FIXATION";
|
|
4224
4277
|
})(EventOrigin || (EventOrigin = {}));
|
|
4225
4278
|
|
|
4226
4279
|
var eventOrigin = [
|
|
@@ -4238,7 +4291,7 @@
|
|
|
4238
4291
|
{ label: "agro.angular_components.effective_confirmation_event", value: EventOperation.EFFECTIVE_CONFIRMATION },
|
|
4239
4292
|
{ label: "agro.angular_components.change_request_event_summary", value: EventOperation.CHANGE_REQUEST },
|
|
4240
4293
|
{ label: "agro.angular_components.change_response_event", value: EventOperation.CHANGE_RESPONSE },
|
|
4241
|
-
{ label: "agro.angular_components.
|
|
4294
|
+
{ label: "agro.angular_components.fixation_event", value: EventOperation.PROCESS_FIXATION },
|
|
4242
4295
|
{ label: "agro.angular_components." + EventOperation.CANCEL_INVOICE, value: EventOperation.CANCEL_INVOICE },
|
|
4243
4296
|
{ label: "agro.angular_components." + EventOperation.REPROCESS_INVOICE, value: EventOperation.REPROCESS_INVOICE },
|
|
4244
4297
|
{ label: "agro.angular_components." + EventOperation.EFFECTIVE_CONFIRMATION, value: EventOperation.EFFECTIVE_CONFIRMATION },
|
|
@@ -4248,6 +4301,12 @@
|
|
|
4248
4301
|
{ label: "agro.angular_components." + EventOperation.TRANSFER_CREATE_INCOMING_INVOICE, value: EventOperation.TRANSFER_CREATE_INCOMING_INVOICE },
|
|
4249
4302
|
{ label: "agro.angular_components." + EventOperation.TRANSFER_CREATE_OUTGOING_INVOICE, value: EventOperation.TRANSFER_CREATE_OUTGOING_INVOICE },
|
|
4250
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 },
|
|
4251
4310
|
];
|
|
4252
4311
|
var eventStatus = [
|
|
4253
4312
|
{ label: "agro.angular_components.panel_title_events_completed_successfully", value: EventStatus.SUCCESS },
|
|
@@ -4457,61 +4516,6 @@
|
|
|
4457
4516
|
return ProducerInvoiceService;
|
|
4458
4517
|
}(EntityService));
|
|
4459
4518
|
|
|
4460
|
-
var TicketService = /** @class */ (function (_super) {
|
|
4461
|
-
__extends(TicketService, _super);
|
|
4462
|
-
function TicketService(http, messageService, translate) {
|
|
4463
|
-
var _this = _super.call(this, http, messageService, "agro/origination/entities/ticket", "agro/origination/actions", "agro/origination/queries", translate) || this;
|
|
4464
|
-
_this.http = http;
|
|
4465
|
-
_this.messageService = messageService;
|
|
4466
|
-
_this.translate = translate;
|
|
4467
|
-
return _this;
|
|
4468
|
-
}
|
|
4469
|
-
TicketService.prototype.getTicketSummaryByParent = function (parent) {
|
|
4470
|
-
return this.http
|
|
4471
|
-
.post(this.queriesUrl + "/getTicketSummaryByParent/", { parent: parent })
|
|
4472
|
-
.pipe(this.defaultCatch());
|
|
4473
|
-
};
|
|
4474
|
-
TicketService.prototype.listMainteinerTickets = function (filter) {
|
|
4475
|
-
return this.http
|
|
4476
|
-
.post(this.queriesUrl + "/listMainteinerTickets/", filter)
|
|
4477
|
-
.pipe(this.defaultCatch());
|
|
4478
|
-
};
|
|
4479
|
-
TicketService.prototype.searchTotalWeightResultFromTickets = function (body) {
|
|
4480
|
-
return this.http
|
|
4481
|
-
.post(this.queriesUrl + "/searchTotalWeightResultFromTickets/", body)
|
|
4482
|
-
.pipe(this.defaultCatch());
|
|
4483
|
-
};
|
|
4484
|
-
TicketService.prototype.cancelTicket = function (body) {
|
|
4485
|
-
return this.http
|
|
4486
|
-
.post(this.actionsUrl + "/cancelTicket/", body);
|
|
4487
|
-
};
|
|
4488
|
-
TicketService.prototype.mergeTickets = function (body) {
|
|
4489
|
-
return this.http.post(this.actionsUrl + "/mergeTickets/", body).pipe(this.defaultCatch());
|
|
4490
|
-
};
|
|
4491
|
-
TicketService.prototype.unMergeTickets = function (body) {
|
|
4492
|
-
return this.http.post(this.actionsUrl + "/unMergeTickets/", body).pipe(this.defaultCatch());
|
|
4493
|
-
};
|
|
4494
|
-
TicketService.prototype.checkGroupInvoicePermission = function (body) {
|
|
4495
|
-
return this.http
|
|
4496
|
-
.post(this.queriesUrl + "/checkGroupInvoicePermission/", body)
|
|
4497
|
-
.pipe(this.defaultCatch());
|
|
4498
|
-
};
|
|
4499
|
-
TicketService.prototype.getContractTickets = function (tickets) {
|
|
4500
|
-
return this.http
|
|
4501
|
-
.post(this.queriesUrl + "/getContractTickets/", { tickets: tickets })
|
|
4502
|
-
.pipe(this.defaultCatch());
|
|
4503
|
-
};
|
|
4504
|
-
TicketService.ctorParameters = function () { return [
|
|
4505
|
-
{ type: http.HttpClient },
|
|
4506
|
-
{ type: api.MessageService },
|
|
4507
|
-
{ type: LibTranslationService }
|
|
4508
|
-
]; };
|
|
4509
|
-
TicketService = __decorate([
|
|
4510
|
-
core.Injectable()
|
|
4511
|
-
], TicketService);
|
|
4512
|
-
return TicketService;
|
|
4513
|
-
}(EntityService));
|
|
4514
|
-
|
|
4515
4519
|
var TransferService = /** @class */ (function (_super) {
|
|
4516
4520
|
__extends(TransferService, _super);
|
|
4517
4521
|
function TransferService(http, messageService, translate) {
|
|
@@ -4542,22 +4546,47 @@
|
|
|
4542
4546
|
return TransferService;
|
|
4543
4547
|
}(EntityService));
|
|
4544
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
|
+
|
|
4545
4574
|
var EventControlBoardService = /** @class */ (function () {
|
|
4546
|
-
function EventControlBoardService(eventControlService, eventControlItemService,
|
|
4575
|
+
function EventControlBoardService(eventControlService, eventControlItemService, transferService, producerInvoiceService, fixationService) {
|
|
4547
4576
|
this.eventControlService = eventControlService;
|
|
4548
4577
|
this.eventControlItemService = eventControlItemService;
|
|
4549
|
-
this.ticketService = ticketService;
|
|
4550
4578
|
this.transferService = transferService;
|
|
4551
4579
|
this.producerInvoiceService = producerInvoiceService;
|
|
4580
|
+
this.fixationService = fixationService;
|
|
4552
4581
|
}
|
|
4553
4582
|
EventControlBoardService.ctorParameters = function () { return [
|
|
4554
4583
|
{ type: EventControlService },
|
|
4555
4584
|
{ type: EventControlItemService },
|
|
4556
|
-
{ type: TicketService },
|
|
4557
4585
|
{ type: TransferService },
|
|
4558
|
-
{ type: ProducerInvoiceService }
|
|
4586
|
+
{ type: ProducerInvoiceService },
|
|
4587
|
+
{ type: FixationService }
|
|
4559
4588
|
]; };
|
|
4560
|
-
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" });
|
|
4561
4590
|
EventControlBoardService = __decorate([
|
|
4562
4591
|
core.Injectable({
|
|
4563
4592
|
providedIn: "root",
|
|
@@ -4567,13 +4596,14 @@
|
|
|
4567
4596
|
}());
|
|
4568
4597
|
|
|
4569
4598
|
var EventControlBoardComponent = /** @class */ (function () {
|
|
4570
|
-
function EventControlBoardComponent(translate, formBuilder, websocketService, eventControlBoardService, paginatorStorageService, messageService) {
|
|
4599
|
+
function EventControlBoardComponent(translate, formBuilder, websocketService, eventControlBoardService, paginatorStorageService, messageService, confirmationService) {
|
|
4571
4600
|
this.translate = translate;
|
|
4572
4601
|
this.formBuilder = formBuilder;
|
|
4573
4602
|
this.websocketService = websocketService;
|
|
4574
4603
|
this.eventControlBoardService = eventControlBoardService;
|
|
4575
4604
|
this.paginatorStorageService = paginatorStorageService;
|
|
4576
4605
|
this.messageService = messageService;
|
|
4606
|
+
this.confirmationService = confirmationService;
|
|
4577
4607
|
this.steps = [];
|
|
4578
4608
|
this.showSidebar = false;
|
|
4579
4609
|
this.showReprocessButton = false;
|
|
@@ -4593,7 +4623,6 @@
|
|
|
4593
4623
|
return __awaiter(this, void 0, void 0, function () {
|
|
4594
4624
|
return __generator(this, function (_a) {
|
|
4595
4625
|
this.gridColumns = this.setGridColumns();
|
|
4596
|
-
this.socketConnection = this.websocketService.onConnect();
|
|
4597
4626
|
this.callWebsocket();
|
|
4598
4627
|
return [2 /*return*/];
|
|
4599
4628
|
});
|
|
@@ -4605,7 +4634,7 @@
|
|
|
4605
4634
|
this.setFormFields();
|
|
4606
4635
|
}
|
|
4607
4636
|
this.updateCompanyAndBranchFormFields(changes);
|
|
4608
|
-
this.
|
|
4637
|
+
this.updateEventOriginAndControlCodeFormFields(changes);
|
|
4609
4638
|
this.updateEventStatusAndCreatedDateFormFields(changes);
|
|
4610
4639
|
this.onSearch();
|
|
4611
4640
|
};
|
|
@@ -4618,13 +4647,13 @@
|
|
|
4618
4647
|
(_c = this.filterFormGroup.get('e070fil')) === null || _c === void 0 ? void 0 : _c.setValue((_d = changes.e070fil.currentValue) !== null && _d !== void 0 ? _d : null);
|
|
4619
4648
|
}
|
|
4620
4649
|
};
|
|
4621
|
-
EventControlBoardComponent.prototype.
|
|
4650
|
+
EventControlBoardComponent.prototype.updateEventOriginAndControlCodeFormFields = function (changes) {
|
|
4622
4651
|
var _a, _b, _c, _d;
|
|
4623
4652
|
if (changes.eventOrigin && changes.eventOrigin.currentValue !== changes.eventOrigin.previousValue) {
|
|
4624
4653
|
(_a = this.filterFormGroup.get('eventOrigin')) === null || _a === void 0 ? void 0 : _a.setValue((_b = changes.eventOrigin.currentValue) !== null && _b !== void 0 ? _b : null);
|
|
4625
4654
|
}
|
|
4626
|
-
if (changes.
|
|
4627
|
-
(_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);
|
|
4628
4657
|
}
|
|
4629
4658
|
};
|
|
4630
4659
|
EventControlBoardComponent.prototype.updateEventStatusAndCreatedDateFormFields = function (changes) {
|
|
@@ -4641,7 +4670,7 @@
|
|
|
4641
4670
|
this.filterFormGroup = this.formBuilder.group({
|
|
4642
4671
|
e070emp: [{ value: (_a = this.e070emp) !== null && _a !== void 0 ? _a : null, disabled: false }, forms.Validators.compose([])],
|
|
4643
4672
|
e070fil: [{ value: (_b = this.e070fil) !== null && _b !== void 0 ? _b : null, disabled: false }, forms.Validators.compose([])],
|
|
4644
|
-
|
|
4673
|
+
controlCode: [{ value: (_c = this.controlCode) !== null && _c !== void 0 ? _c : null, disabled: false }, forms.Validators.compose([])],
|
|
4645
4674
|
externalId: [{ value: (_d = this.externalId) !== null && _d !== void 0 ? _d : null, disabled: false }, forms.Validators.compose([])],
|
|
4646
4675
|
eventOrigin: [{ value: (_e = this.eventOrigin) !== null && _e !== void 0 ? _e : null, disabled: false }, forms.Validators.compose([])],
|
|
4647
4676
|
status: [{ value: (_f = this.eventStatus) !== null && _f !== void 0 ? _f : null, disabled: false }, forms.Validators.compose([])],
|
|
@@ -4659,7 +4688,7 @@
|
|
|
4659
4688
|
type: angularComponents.FieldType.Chips,
|
|
4660
4689
|
}),
|
|
4661
4690
|
new angularComponents.FormField({
|
|
4662
|
-
name: "
|
|
4691
|
+
name: "controlCode",
|
|
4663
4692
|
type: angularComponents.FieldType.Chips,
|
|
4664
4693
|
}),
|
|
4665
4694
|
new angularComponents.FormField({
|
|
@@ -4685,14 +4714,13 @@
|
|
|
4685
4714
|
{ field: 'e070emp', header: this.translate.instant("agro.angular_components.company") },
|
|
4686
4715
|
{ field: 'e070fil', header: this.translate.instant("agro.angular_components.label_branch") },
|
|
4687
4716
|
{ field: 'eventOrigin', header: this.translate.instant("agro.angular_components.event_origin_label") },
|
|
4688
|
-
{ field: '
|
|
4717
|
+
{ field: 'controlCode', header: this.translate.instant("agro.angular_components.control_code") },
|
|
4689
4718
|
];
|
|
4690
4719
|
};
|
|
4691
4720
|
EventControlBoardComponent.prototype.ngOnDestroy = function () {
|
|
4692
4721
|
this.ngUnsubscribe.next();
|
|
4693
4722
|
this.ngUnsubscribe.complete();
|
|
4694
4723
|
this.websocketService.disconnect();
|
|
4695
|
-
this.socketConnection = false;
|
|
4696
4724
|
};
|
|
4697
4725
|
EventControlBoardComponent.prototype.callWebsocket = function () {
|
|
4698
4726
|
var _this = this;
|
|
@@ -4738,91 +4766,27 @@
|
|
|
4738
4766
|
var _a = this.currentListParams, page = _a.page, size = _a.size;
|
|
4739
4767
|
var nSort = this.getSortedFields();
|
|
4740
4768
|
var filterQuery = this.getFilterQuery();
|
|
4741
|
-
var displayFields = [""];
|
|
4769
|
+
var displayFields = ["*", "eventControlItem"];
|
|
4742
4770
|
this.eventControlBoardService.eventControlService
|
|
4743
4771
|
.list({ sort: nSort, page: page, size: size, filterQuery: filterQuery, displayFields: displayFields })
|
|
4744
4772
|
.pipe(operators.takeUntil(this.ngUnsubscribe), operators.catchError(function (err) {
|
|
4745
4773
|
_this.gridLoading = false;
|
|
4746
4774
|
throw err;
|
|
4747
4775
|
}))
|
|
4748
|
-
.subscribe(function (list) {
|
|
4749
|
-
|
|
4750
|
-
|
|
4751
|
-
|
|
4752
|
-
var _a;
|
|
4753
|
-
var nSort = [];
|
|
4754
|
-
if (((_a = this.currentListParams.sort) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
4755
|
-
nSort = JSON.parse(JSON.stringify(this.currentListParams.sort));
|
|
4756
|
-
nSort.forEach(function (sortItem) {
|
|
4757
|
-
sortItem.field = _this.getFieldNameForSortRequest(sortItem.field);
|
|
4758
|
-
});
|
|
4759
|
-
}
|
|
4760
|
-
else {
|
|
4761
|
-
nSort.push({ field: 'lastModifiedDate', order: exports.AGRO_NUMBERS.MINUSONE });
|
|
4762
|
-
}
|
|
4763
|
-
return nSort;
|
|
4764
|
-
};
|
|
4765
|
-
EventControlBoardComponent.prototype.getFilterQuery = function () {
|
|
4766
|
-
var _this = this;
|
|
4767
|
-
var filterData = this.currentListParams.filterData;
|
|
4768
|
-
var filterJson = { filter: {} };
|
|
4769
|
-
return __spread(this.filterFields).filter(function (_a) {
|
|
4770
|
-
var name = _a.name;
|
|
4771
|
-
return filterData && filterData[name] !== undefined && filterData[name] !== null && filterData[name].length !== 0;
|
|
4772
|
-
})
|
|
4773
|
-
.map(function (formField) {
|
|
4774
|
-
var _a;
|
|
4775
|
-
var lookupFieldName = 'id';
|
|
4776
|
-
var finalFilterName = (_a = formField.name) !== null && _a !== void 0 ? _a : '';
|
|
4777
|
-
filterJson.filter[finalFilterName] = filterData[finalFilterName].id;
|
|
4778
|
-
return _this.createFilterString(finalFilterName, formField.type, filterData[finalFilterName], lookupFieldName);
|
|
4779
|
-
})
|
|
4780
|
-
.filter(function (filter) { return filter !== null && filter !== '' && filter !== undefined; })
|
|
4781
|
-
.join(' and ');
|
|
4782
|
-
};
|
|
4783
|
-
EventControlBoardComponent.prototype.handleListResponse = function (list) {
|
|
4784
|
-
this.gridData = list.contents;
|
|
4785
|
-
this.gridTotalRecords = list.totalElements;
|
|
4786
|
-
if (!this.gridData || this.gridData.length <= exports.AGRO_NUMBERS.ZERO) {
|
|
4787
|
-
this.gridLoading = false;
|
|
4788
|
-
return;
|
|
4789
|
-
}
|
|
4790
|
-
this.processDetailCalls();
|
|
4791
|
-
};
|
|
4792
|
-
EventControlBoardComponent.prototype.processDetailCalls = function () {
|
|
4793
|
-
var _this = this;
|
|
4794
|
-
var detailCalls$ = this.gridData.map(function (item) {
|
|
4795
|
-
return _this.eventControlBoardService.eventControlItemService.list({
|
|
4796
|
-
filterQuery: "eventControl eq '" + item.id + "'",
|
|
4797
|
-
sort: [{ field: 'sequence', order: exports.AGRO_NUMBERS.ONE }],
|
|
4798
|
-
size: exports.AGRO_NUMBERS.ONE_HUNDRED
|
|
4799
|
-
})
|
|
4800
|
-
.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) {
|
|
4801
4780
|
_this.gridLoading = false;
|
|
4802
|
-
|
|
4803
|
-
}
|
|
4804
|
-
|
|
4805
|
-
filterQuery: "id eq '" + item.externalId + "' or balanceEntryControl.id eq '" + item.externalId + "'",
|
|
4806
|
-
displayFields: ['number']
|
|
4807
|
-
})
|
|
4808
|
-
.pipe(operators.map(function (ticketResponse) { return ({ detailsResponse: detailsResponse, ticketResponse: ticketResponse }); }), operators.catchError(function (err) {
|
|
4809
|
-
_this.gridLoading = false;
|
|
4810
|
-
throw err;
|
|
4811
|
-
}));
|
|
4812
|
-
}));
|
|
4813
|
-
});
|
|
4814
|
-
rxjs.forkJoin(detailCalls$).subscribe(function (responses) {
|
|
4815
|
-
_this.processDetailsResponses(responses);
|
|
4781
|
+
return;
|
|
4782
|
+
}
|
|
4783
|
+
_this.processEventControlItems(_this.gridData.map(function (item) { return item.eventControlItem; }));
|
|
4816
4784
|
});
|
|
4817
4785
|
};
|
|
4818
|
-
EventControlBoardComponent.prototype.
|
|
4786
|
+
EventControlBoardComponent.prototype.processEventControlItems = function (detailsResponses) {
|
|
4819
4787
|
var _this = this;
|
|
4820
4788
|
this.gridData.forEach(function (item, index) {
|
|
4821
|
-
|
|
4822
|
-
var _c = detailsResponses[index], detailsResponse = _c.detailsResponse, ticketResponse = _c.ticketResponse;
|
|
4823
|
-
var tickets = (_a = ticketResponse === null || ticketResponse === void 0 ? void 0 : ticketResponse.contents) !== null && _a !== void 0 ? _a : [];
|
|
4824
|
-
item.details = (_b = detailsResponse === null || detailsResponse === void 0 ? void 0 : detailsResponse.contents) !== null && _b !== void 0 ? _b : [];
|
|
4825
|
-
item.tickets = tickets.map(function (ticket) { return ticket.number; }).join(', ');
|
|
4789
|
+
item.details = detailsResponses[index];
|
|
4826
4790
|
var groupedDetails = _this.groupByEventGroup(item.details);
|
|
4827
4791
|
item.groups = Object.keys(groupedDetails).map(function (eventGroupId) {
|
|
4828
4792
|
var groupDetails = groupedDetails[eventGroupId];
|
|
@@ -4833,17 +4797,18 @@
|
|
|
4833
4797
|
if (lastActiveIndex !== -1 && groupDetails[lastActiveIndex].status === EventStatus.SUCCESS) {
|
|
4834
4798
|
activeIndex = lastActiveIndex + 1;
|
|
4835
4799
|
}
|
|
4836
|
-
var steps = groupDetails
|
|
4800
|
+
var steps = groupDetails
|
|
4801
|
+
.map(function (detail, detailIndex) {
|
|
4837
4802
|
return {
|
|
4838
4803
|
item: detail,
|
|
4839
|
-
|
|
4840
|
-
eventType:
|
|
4804
|
+
controlCode: _this.gridData[index].controlCode,
|
|
4805
|
+
eventType: _this.gridData[index].eventOrigin,
|
|
4841
4806
|
label: _this.getEventLabel(detail),
|
|
4842
4807
|
disabled: detail.status === EventStatus.PENDING && detailIndex !== activeIndex,
|
|
4843
4808
|
tooltip: _this.getEventLabel(detail),
|
|
4844
4809
|
state: _this.determineStepState(detail),
|
|
4845
4810
|
};
|
|
4846
|
-
});
|
|
4811
|
+
}).sort(function (a, b) { return a.item.sequence - b.item.sequence; });
|
|
4847
4812
|
return {
|
|
4848
4813
|
eventGroupId: eventGroupId,
|
|
4849
4814
|
steps: steps,
|
|
@@ -4883,31 +4848,54 @@
|
|
|
4883
4848
|
var eventLabel = (_a = this.eventItem.find(function (e) { return e.value === detail.eventOperation; })) === null || _a === void 0 ? void 0 : _a.label;
|
|
4884
4849
|
return eventLabel ? this.translate.instant(eventLabel) : detail.eventOperation;
|
|
4885
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
|
+
};
|
|
4886
4884
|
EventControlBoardComponent.prototype.getFieldNameForSortRequest = function (name) {
|
|
4887
4885
|
switch (name) {
|
|
4888
4886
|
case 'e070emp':
|
|
4889
4887
|
return 'e070emp.nomEmp';
|
|
4890
4888
|
case 'e070fil':
|
|
4891
4889
|
return 'e070fil.nomFil';
|
|
4892
|
-
case 'number':
|
|
4893
|
-
return 'createdDate';
|
|
4894
4890
|
default:
|
|
4895
4891
|
return name;
|
|
4896
4892
|
}
|
|
4897
4893
|
};
|
|
4898
4894
|
EventControlBoardComponent.prototype.createFilterString = function (name, type, value, lookupFieldName) {
|
|
4899
4895
|
if (lookupFieldName === void 0) { lookupFieldName = 'id'; }
|
|
4900
|
-
if (name === '
|
|
4896
|
+
if (name === 'controlCode') {
|
|
4901
4897
|
var filterParts_1 = [];
|
|
4902
|
-
value.forEach(function (
|
|
4903
|
-
filterParts_1.push("externalId eq '" + item.id + "'");
|
|
4904
|
-
if (item.invoice) {
|
|
4905
|
-
filterParts_1.push("externalId eq '" + item.invoice.id + "'");
|
|
4906
|
-
}
|
|
4907
|
-
if (item.balanceEntryControl) {
|
|
4908
|
-
filterParts_1.push("externalId eq '" + item.balanceEntryControl.id + "'");
|
|
4909
|
-
}
|
|
4910
|
-
});
|
|
4898
|
+
value.forEach(function (val) { return filterParts_1.push("controlCode eq '" + val + "'"); });
|
|
4911
4899
|
return "(" + filterParts_1.join(' or ') + ")";
|
|
4912
4900
|
}
|
|
4913
4901
|
return this.createFilterStringFromType(name, type, value, lookupFieldName);
|
|
@@ -4969,7 +4957,6 @@
|
|
|
4969
4957
|
EventControlBoardComponent.prototype.stepSelected = function (event) {
|
|
4970
4958
|
var _this = this;
|
|
4971
4959
|
this.selectedStep = event.step;
|
|
4972
|
-
console.log(event);
|
|
4973
4960
|
switch (this.selectedStep.eventType) {
|
|
4974
4961
|
case EventOrigin.BALANCE_ENTRY_CONTROL:
|
|
4975
4962
|
case EventOrigin.TICKET:
|
|
@@ -4988,8 +4975,8 @@
|
|
|
4988
4975
|
_this.sidebarLoading = false;
|
|
4989
4976
|
});
|
|
4990
4977
|
break;
|
|
4978
|
+
case EventOrigin.FIXATION:
|
|
4991
4979
|
case EventOrigin.CHANGE_REQUEST:
|
|
4992
|
-
break;
|
|
4993
4980
|
case EventOrigin.TRANSFER:
|
|
4994
4981
|
break;
|
|
4995
4982
|
}
|
|
@@ -5010,16 +4997,47 @@
|
|
|
5010
4997
|
_this.addMessage('error', 'agro.angular_components.error_reprocessing_event_message_title', 'agro.angular_components.error_reprocessing_event_message_description');
|
|
5011
4998
|
});
|
|
5012
4999
|
};
|
|
5013
|
-
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; }
|
|
5014
5002
|
this.messageService.add({
|
|
5015
5003
|
severity: severity,
|
|
5016
5004
|
summary: this.translate.instant(summary),
|
|
5017
5005
|
detail: this.translate.instant(detail),
|
|
5006
|
+
life: life
|
|
5018
5007
|
});
|
|
5019
5008
|
};
|
|
5020
5009
|
EventControlBoardComponent.prototype.openModal = function () {
|
|
5021
5010
|
this.displayModal = true;
|
|
5022
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
|
+
};
|
|
5023
5041
|
EventControlBoardComponent.prototype.confirmModal = function () {
|
|
5024
5042
|
this.reprocessEvent();
|
|
5025
5043
|
this.displayModal = false;
|
|
@@ -5037,7 +5055,8 @@
|
|
|
5037
5055
|
{ type: WebsocketService },
|
|
5038
5056
|
{ type: EventControlBoardService },
|
|
5039
5057
|
{ type: PaginatorStorageService },
|
|
5040
|
-
{ type: primeng.MessageService }
|
|
5058
|
+
{ type: primeng.MessageService },
|
|
5059
|
+
{ type: primeng.ConfirmationService }
|
|
5041
5060
|
]; };
|
|
5042
5061
|
__decorate([
|
|
5043
5062
|
core.Input()
|
|
@@ -5047,7 +5066,7 @@
|
|
|
5047
5066
|
], EventControlBoardComponent.prototype, "e070fil", void 0);
|
|
5048
5067
|
__decorate([
|
|
5049
5068
|
core.Input()
|
|
5050
|
-
], EventControlBoardComponent.prototype, "
|
|
5069
|
+
], EventControlBoardComponent.prototype, "controlCode", void 0);
|
|
5051
5070
|
__decorate([
|
|
5052
5071
|
core.Input()
|
|
5053
5072
|
], EventControlBoardComponent.prototype, "eventOrigin", void 0);
|
|
@@ -5066,11 +5085,11 @@
|
|
|
5066
5085
|
EventControlBoardComponent = __decorate([
|
|
5067
5086
|
core.Component({
|
|
5068
5087
|
selector: 'event-control-board',
|
|
5069
|
-
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",
|
|
5070
5089
|
providers: [
|
|
5071
5090
|
{ provide: core.LOCALE_ID, useValue: 'pt-BR' }
|
|
5072
5091
|
],
|
|
5073
|
-
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}"]
|
|
5074
5093
|
})
|
|
5075
5094
|
], EventControlBoardComponent);
|
|
5076
5095
|
return EventControlBoardComponent;
|
|
@@ -5771,6 +5790,61 @@
|
|
|
5771
5790
|
return RuralEstateModule;
|
|
5772
5791
|
}());
|
|
5773
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
|
+
|
|
5774
5848
|
var TicketModule = /** @class */ (function () {
|
|
5775
5849
|
function TicketModule() {
|
|
5776
5850
|
}
|
|
@@ -5863,6 +5937,28 @@
|
|
|
5863
5937
|
return TransferModule;
|
|
5864
5938
|
}());
|
|
5865
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
|
+
|
|
5866
5962
|
var EventControlBoardModule = /** @class */ (function () {
|
|
5867
5963
|
function EventControlBoardModule() {
|
|
5868
5964
|
}
|
|
@@ -5891,11 +5987,13 @@
|
|
|
5891
5987
|
RuralEstateModule,
|
|
5892
5988
|
TicketModule,
|
|
5893
5989
|
WebsocketModule,
|
|
5894
|
-
LibTranslationModule
|
|
5990
|
+
LibTranslationModule,
|
|
5991
|
+
FixationModule
|
|
5895
5992
|
],
|
|
5896
5993
|
declarations: [EventControlBoardComponent],
|
|
5897
5994
|
exports: [EventControlBoardComponent],
|
|
5898
|
-
providers: [E012famService, E205depService, PaginatorStorageService,
|
|
5995
|
+
providers: [E012famService, E205depService, PaginatorStorageService,
|
|
5996
|
+
EventControlService, EventControlBoardService, primeng.ConfirmationService],
|
|
5899
5997
|
})
|
|
5900
5998
|
], EventControlBoardModule);
|
|
5901
5999
|
return EventControlBoardModule;
|
|
@@ -5951,6 +6049,7 @@
|
|
|
5951
6049
|
exports.EventStepsComponent = EventStepsComponent;
|
|
5952
6050
|
exports.EventStepsModule = EventStepsModule;
|
|
5953
6051
|
exports.ExternalInvoiceModule = ExternalInvoiceModule;
|
|
6052
|
+
exports.FixationModule = FixationModule;
|
|
5954
6053
|
exports.HostProjectConfigsInjectionToken = HostProjectConfigsInjectionToken;
|
|
5955
6054
|
exports.InvoiceModule = InvoiceModule;
|
|
5956
6055
|
exports.LibTranslatePipe = LibTranslatePipe;
|