@seniorsistemas/yms-integration 1.11.9 → 1.12.0

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.
Files changed (106) hide show
  1. package/bundles/seniorsistemas-yms-integration.umd.js +2006 -527
  2. package/bundles/seniorsistemas-yms-integration.umd.js.map +1 -1
  3. package/bundles/seniorsistemas-yms-integration.umd.min.js +1 -1
  4. package/bundles/seniorsistemas-yms-integration.umd.min.js.map +1 -1
  5. package/esm2015/index.js +7 -1
  6. package/esm2015/seniorsistemas-yms-integration.js +48 -39
  7. package/esm2015/src/erp-senior/core/entities/motorista/motorista.js +1 -1
  8. package/esm2015/src/sam-senior/components/credencial-form/credencial-form.component.js +123 -0
  9. package/esm2015/src/sam-senior/components/scheduling/lobby.service.js +22 -0
  10. package/esm2015/src/sam-senior/components/scheduling/scheduling.component.js +189 -0
  11. package/esm2015/src/sam-senior/components/scheduling/shechuling.service.js +40 -0
  12. package/esm2015/src/sam-senior/components/visited-info/visited-info.component.js +59 -0
  13. package/esm2015/src/sam-senior/components/visited-info/visited-info.service.js +26 -0
  14. package/esm2015/src/sam-senior/components/visitor-edit/visitor-edit-form/visitante-form/visitor-edit-form.component.js +81 -0
  15. package/esm2015/src/sam-senior/components/visitor-edit/visitor-edit-list/visitor-edit-list.component.js +335 -0
  16. package/esm2015/src/sam-senior/components/visitor-list/visitor-list.component.js +64 -0
  17. package/esm2015/src/sam-senior/components/visitor-list/visitor-list.service.js +26 -0
  18. package/esm2015/src/sam-senior/components/visitor-list.module.js +36 -0
  19. package/esm2015/src/sam-senior/core/entity-service.js +102 -0
  20. package/esm2015/src/sam-senior/core/lookup.js +184 -0
  21. package/esm2015/src/sam-senior/core/utils.js +26 -0
  22. package/esm2015/src/sam-senior/entities/credential-card-dto.js +9 -0
  23. package/esm2015/src/sam-senior/entities/lobby-dto.js +3 -0
  24. package/esm2015/src/sam-senior/entities/scheduling-dto.js +3 -0
  25. package/esm2015/src/sam-senior/entities/scheduling-visitors.js +3 -0
  26. package/esm2015/src/sam-senior/entities/scheduling.js +26 -0
  27. package/esm2015/src/sam-senior/entities/visited.js +3 -0
  28. package/esm2015/src/sam-senior/entities/visitor-credentials-dto.js +3 -0
  29. package/esm2015/src/sam-senior/entities/visitor-dto.js +1 -0
  30. package/esm2015/src/sam-senior/entities/visitor-situation.js +10 -0
  31. package/esm2015/src/sam-senior/form/form-sam.component.js +61 -0
  32. package/esm2015/src/sam-senior/models/card-credential.js +7 -0
  33. package/esm2015/src/sam-senior/models/visit-situation.js +8 -0
  34. package/esm2015/src/sam-senior/models/visitor-situation.js +10 -0
  35. package/esm2015/src/sam-senior/models/visitor.js +23 -0
  36. package/esm2015/src/sam-senior/sam-senior.module.js +76 -0
  37. package/esm5/index.js +7 -1
  38. package/esm5/seniorsistemas-yms-integration.js +48 -39
  39. package/esm5/src/erp-senior/core/entities/motorista/motorista.js +1 -1
  40. package/esm5/src/sam-senior/components/credencial-form/credencial-form.component.js +141 -0
  41. package/esm5/src/sam-senior/components/scheduling/lobby.service.js +25 -0
  42. package/esm5/src/sam-senior/components/scheduling/scheduling.component.js +197 -0
  43. package/esm5/src/sam-senior/components/scheduling/shechuling.service.js +43 -0
  44. package/esm5/src/sam-senior/components/visited-info/visited-info.component.js +56 -0
  45. package/esm5/src/sam-senior/components/visited-info/visited-info.service.js +29 -0
  46. package/esm5/src/sam-senior/components/visitor-edit/visitor-edit-form/visitante-form/visitor-edit-form.component.js +84 -0
  47. package/esm5/src/sam-senior/components/visitor-edit/visitor-edit-list/visitor-edit-list.component.js +352 -0
  48. package/esm5/src/sam-senior/components/visitor-list/visitor-list.component.js +82 -0
  49. package/esm5/src/sam-senior/components/visitor-list/visitor-list.service.js +29 -0
  50. package/esm5/src/sam-senior/components/visitor-list.module.js +37 -0
  51. package/esm5/src/sam-senior/core/entity-service.js +107 -0
  52. package/esm5/src/sam-senior/core/lookup.js +229 -0
  53. package/esm5/src/sam-senior/core/utils.js +28 -0
  54. package/esm5/src/sam-senior/entities/credential-card-dto.js +13 -0
  55. package/esm5/src/sam-senior/entities/lobby-dto.js +7 -0
  56. package/esm5/src/sam-senior/entities/scheduling-dto.js +7 -0
  57. package/esm5/src/sam-senior/entities/scheduling-visitors.js +7 -0
  58. package/esm5/src/sam-senior/entities/scheduling.js +30 -0
  59. package/esm5/src/sam-senior/entities/visited.js +7 -0
  60. package/esm5/src/sam-senior/entities/visitor-credentials-dto.js +7 -0
  61. package/esm5/src/sam-senior/entities/visitor-dto.js +1 -0
  62. package/esm5/src/sam-senior/entities/visitor-situation.js +10 -0
  63. package/esm5/src/sam-senior/form/form-sam.component.js +64 -0
  64. package/esm5/src/sam-senior/models/card-credential.js +7 -0
  65. package/esm5/src/sam-senior/models/visit-situation.js +8 -0
  66. package/esm5/src/sam-senior/models/visitor-situation.js +10 -0
  67. package/esm5/src/sam-senior/models/visitor.js +32 -0
  68. package/esm5/src/sam-senior/sam-senior.module.js +77 -0
  69. package/fesm2015/seniorsistemas-yms-integration.js +1902 -576
  70. package/fesm2015/seniorsistemas-yms-integration.js.map +1 -1
  71. package/fesm5/seniorsistemas-yms-integration.js +2108 -644
  72. package/fesm5/seniorsistemas-yms-integration.js.map +1 -1
  73. package/index.d.ts +5 -0
  74. package/package.json +3 -3
  75. package/seniorsistemas-yms-integration.d.ts +47 -38
  76. package/seniorsistemas-yms-integration.metadata.json +1 -1
  77. package/src/erp-senior/core/entities/motorista/motorista.d.ts +3 -0
  78. package/src/sam-senior/components/credencial-form/credencial-form.component.d.ts +29 -0
  79. package/src/sam-senior/components/scheduling/lobby.service.d.ts +9 -0
  80. package/src/sam-senior/components/scheduling/scheduling.component.d.ts +42 -0
  81. package/src/sam-senior/components/scheduling/shechuling.service.d.ts +14 -0
  82. package/src/sam-senior/components/visited-info/visited-info.component.d.ts +15 -0
  83. package/src/sam-senior/components/visited-info/visited-info.service.d.ts +10 -0
  84. package/src/sam-senior/components/visitor-edit/visitor-edit-form/visitante-form/visitor-edit-form.component.d.ts +22 -0
  85. package/src/sam-senior/components/visitor-edit/visitor-edit-list/visitor-edit-list.component.d.ts +53 -0
  86. package/src/sam-senior/components/visitor-list/visitor-list.component.d.ts +16 -0
  87. package/src/sam-senior/components/visitor-list/visitor-list.service.d.ts +10 -0
  88. package/src/sam-senior/components/visitor-list.module.d.ts +5 -0
  89. package/src/sam-senior/core/entity-service.d.ts +35 -0
  90. package/src/sam-senior/core/lookup.d.ts +38 -0
  91. package/src/sam-senior/core/utils.d.ts +18 -0
  92. package/src/sam-senior/entities/credential-card-dto.d.ts +12 -0
  93. package/src/sam-senior/entities/lobby-dto.d.ts +5 -0
  94. package/src/sam-senior/entities/scheduling-dto.d.ts +11 -0
  95. package/src/sam-senior/entities/scheduling-visitors.d.ts +6 -0
  96. package/src/sam-senior/entities/scheduling.d.ts +12 -0
  97. package/src/sam-senior/entities/visited.d.ts +4 -0
  98. package/src/sam-senior/entities/visitor-credentials-dto.d.ts +6 -0
  99. package/src/sam-senior/entities/visitor-dto.d.ts +10 -0
  100. package/src/sam-senior/entities/visitor-situation.d.ts +8 -0
  101. package/src/sam-senior/form/form-sam.component.d.ts +18 -0
  102. package/src/sam-senior/models/card-credential.d.ts +16 -0
  103. package/src/sam-senior/models/visit-situation.d.ts +6 -0
  104. package/src/sam-senior/models/visitor-situation.d.ts +8 -0
  105. package/src/sam-senior/models/visitor.d.ts +24 -0
  106. package/src/sam-senior/sam-senior.module.d.ts +6 -0
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('rxjs'), require('rxjs/operators'), require('@angular/common'), require('@angular/core'), require('@ngx-translate/core'), require('@seniorsistemas/angular-components'), require('primeng/message'), require('primeng/table'), require('@angular/common/http'), require('primeng/api'), require('@seniorsistemas/yms-routines'), require('@angular/animations'), require('@seniorsistemas/platform-components'), require('@stomp/ng2-stompjs'), require('ngx-cookie-service'), require('sockjs-client'), require('primeng/components/dynamicdialog/dynamicdialog'), require('primeng/primeng'), require('@seniorsistemas/yms-components'), require('@angular/router'), require('primeng/inputswitch'), require('primeng/inputtext'), require('@angular/forms'), require('primeng/components/common/messageservice'), require('moment'), require('ngx-highlightjs'), require('primeng/accordion'), require('primeng/confirmdialog'), require('primeng/dialog'), require('primeng/dropdown'), require('primeng/panel'), require('angular2-hotkeys'), require('primeng/components/common/api'), require('highlight.js/lib/languages/json'), require('highlight.js/lib/languages/xml')) :
3
- typeof define === 'function' && define.amd ? define('@seniorsistemas/yms-integration', ['exports', 'rxjs', 'rxjs/operators', '@angular/common', '@angular/core', '@ngx-translate/core', '@seniorsistemas/angular-components', 'primeng/message', 'primeng/table', '@angular/common/http', 'primeng/api', '@seniorsistemas/yms-routines', '@angular/animations', '@seniorsistemas/platform-components', '@stomp/ng2-stompjs', 'ngx-cookie-service', 'sockjs-client', 'primeng/components/dynamicdialog/dynamicdialog', 'primeng/primeng', '@seniorsistemas/yms-components', '@angular/router', 'primeng/inputswitch', 'primeng/inputtext', '@angular/forms', 'primeng/components/common/messageservice', 'moment', 'ngx-highlightjs', 'primeng/accordion', 'primeng/confirmdialog', 'primeng/dialog', 'primeng/dropdown', 'primeng/panel', 'angular2-hotkeys', 'primeng/components/common/api', 'highlight.js/lib/languages/json', 'highlight.js/lib/languages/xml'], factory) :
4
- (global = global || self, factory((global.seniorsistemas = global.seniorsistemas || {}, global.seniorsistemas['yms-integration'] = {}), global.rxjs, global.rxjs.operators, global.ng.common, global.ng.core, global.core$1, global.angularComponents, global.message, global.table, global.ng.common.http, global.api, global.ymsRoutines, global.ng.animations, global.platformComponents, global.ng2Stompjs, global.ngxCookieService, global.SockJS, global.dynamicdialog, global.primeng, global.ymsComponents, global.ng.router, global.inputswitch, global.inputtext, global.ng.forms, global.messageservice, global._moment, global.ngxHighlightjs, global.accordion, global.confirmdialog, global.dialog, global.dropdown, global.panel, global.angular2Hotkeys, global.api$1, global.jsonx, global.xmlx));
5
- }(this, (function (exports, rxjs, operators, common, core, core$1, angularComponents, message, table, http, api, ymsRoutines, animations, platformComponents, ng2Stompjs, ngxCookieService, SockJS, dynamicdialog, primeng, ymsComponents, router, inputswitch, inputtext, forms, messageservice, _moment, ngxHighlightjs, accordion, confirmdialog, dialog, dropdown, panel, angular2Hotkeys, api$1, jsonx, xmlx) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('rxjs'), require('rxjs/operators'), require('@angular/common'), require('@angular/core'), require('@ngx-translate/core'), require('@seniorsistemas/angular-components'), require('primeng/message'), require('primeng/table'), require('@angular/common/http'), require('primeng/api'), require('@seniorsistemas/yms-routines'), require('@angular/animations'), require('@seniorsistemas/platform-components'), require('@stomp/ng2-stompjs'), require('ngx-cookie-service'), require('sockjs-client'), require('primeng/components/dynamicdialog/dynamicdialog'), require('primeng/primeng'), require('@seniorsistemas/yms-components'), require('@angular/router'), require('primeng/inputswitch'), require('primeng/inputtext'), require('@angular/forms'), require('moment'), require('primeng/components/common/messageservice'), require('primeng/shared'), require('primeng/button'), require('ngx-highlightjs'), require('primeng/accordion'), require('primeng/confirmdialog'), require('primeng/dialog'), require('primeng/dropdown'), require('primeng/panel'), require('angular2-hotkeys'), require('primeng/components/common/api'), require('highlight.js/lib/languages/json'), require('highlight.js/lib/languages/xml')) :
3
+ typeof define === 'function' && define.amd ? define('@seniorsistemas/yms-integration', ['exports', 'rxjs', 'rxjs/operators', '@angular/common', '@angular/core', '@ngx-translate/core', '@seniorsistemas/angular-components', 'primeng/message', 'primeng/table', '@angular/common/http', 'primeng/api', '@seniorsistemas/yms-routines', '@angular/animations', '@seniorsistemas/platform-components', '@stomp/ng2-stompjs', 'ngx-cookie-service', 'sockjs-client', 'primeng/components/dynamicdialog/dynamicdialog', 'primeng/primeng', '@seniorsistemas/yms-components', '@angular/router', 'primeng/inputswitch', 'primeng/inputtext', '@angular/forms', 'moment', 'primeng/components/common/messageservice', 'primeng/shared', 'primeng/button', 'ngx-highlightjs', 'primeng/accordion', 'primeng/confirmdialog', 'primeng/dialog', 'primeng/dropdown', 'primeng/panel', 'angular2-hotkeys', 'primeng/components/common/api', 'highlight.js/lib/languages/json', 'highlight.js/lib/languages/xml'], factory) :
4
+ (global = global || self, factory((global.seniorsistemas = global.seniorsistemas || {}, global.seniorsistemas['yms-integration'] = {}), global.rxjs, global.rxjs.operators, global.ng.common, global.ng.core, global.core$1, global.angularComponents, global.message, global.table, global.ng.common.http, global.api, global.ymsRoutines, global.ng.animations, global.platformComponents, global.ng2Stompjs, global.ngxCookieService, global.SockJS, global.dynamicdialog, global.primeng, global.ymsComponents, global.ng.router, global.inputswitch, global.inputtext, global.ng.forms, global._moment, global.messageservice, global.shared, global.button, global.ngxHighlightjs, global.accordion, global.confirmdialog, global.dialog, global.dropdown, global.panel, global.angular2Hotkeys, global.api$1, global.jsonx, global.xmlx));
5
+ }(this, (function (exports, rxjs, operators, common, core, core$1, angularComponents, message, table, http, api, ymsRoutines, animations, platformComponents, ng2Stompjs, ngxCookieService, SockJS, dynamicdialog, primeng, ymsComponents, router, inputswitch, inputtext, forms, _moment, messageservice, shared, button, ngxHighlightjs, accordion, confirmdialog, dialog, dropdown, panel, angular2Hotkeys, api$1, jsonx, xmlx) { 'use strict';
6
6
 
7
7
  jsonx = jsonx && Object.prototype.hasOwnProperty.call(jsonx, 'default') ? jsonx['default'] : jsonx;
8
8
  xmlx = xmlx && Object.prototype.hasOwnProperty.call(xmlx, 'default') ? xmlx['default'] : xmlx;
@@ -1243,7 +1243,1759 @@
1243
1243
  return PortariasModule;
1244
1244
  }());
1245
1245
 
1246
+ var numberTypes = [angularComponents.FieldType.Integer, angularComponents.FieldType.Double];
1247
+ var numberPattern = /^\d+\b$/;
1248
+ var mergeUnique = function (array, otherArray) {
1249
+ return array.concat(otherArray.filter(function (item) { return !array.includes(item); }));
1250
+ };
1251
+ var isValidFilter = function (type, value) {
1252
+ var _a = getTypeInformation(type, value), isValidValue = _a.isValidValue, typeExists = _a.typeExists;
1253
+ return !(typeExists && !isValidValue);
1254
+ };
1255
+ var getTypeInformation = function (type, value) {
1256
+ switch (type) {
1257
+ case angularComponents.FieldType.Time:
1258
+ case angularComponents.FieldType.Date:
1259
+ case angularComponents.FieldType.DateTime:
1260
+ return { isValidValue: false, typeExists: true };
1261
+ case angularComponents.FieldType.Integer:
1262
+ case angularComponents.FieldType.Double:
1263
+ return {
1264
+ isValidValue: value.match(numberPattern),
1265
+ typeExists: numberTypes.includes(type),
1266
+ };
1267
+ default:
1268
+ return {
1269
+ isValidValue: value.match(numberPattern),
1270
+ typeExists: numberTypes.includes(type),
1271
+ };
1272
+ }
1273
+ };
1274
+ var userCanVisualize = function (formGroup, allPermissions) {
1275
+ return (Object.keys(formGroup.controls).filter(function (field) {
1276
+ var errors = formGroup.get(field).errors ? formGroup.get(field).errors.required : formGroup.get(field).errors;
1277
+ return allPermissions[field] && !allPermissions[field].visualizar && errors;
1278
+ }).length === 0);
1279
+ };
1280
+ var getProp = function (obj, path) {
1281
+ return path.split(".").reduce(function (result, prop) { return (result[prop] === undefined ? "" : result[prop]); }, obj);
1282
+ };
1283
+ var dialogConfig = {
1284
+ style: {
1285
+ "display": "flex",
1286
+ "flex-direction": "column",
1287
+ },
1288
+ height: "80%",
1289
+ styleClass: "ui-g-12 ui-md-4",
1290
+ contentStyle: {
1291
+ "overflow-y": "auto",
1292
+ "height": "auto",
1293
+ "max-height": "none",
1294
+ "margin-bottom": "0",
1295
+ "flex": 1
1296
+ },
1297
+ };
1298
+
1299
+ var moment = _moment;
1300
+ function getLookupLabel(data, fields, separator, translation) {
1301
+ if (data === void 0) { data = {}; }
1302
+ if (fields === void 0) { fields = []; }
1303
+ var concatenateLabelsLookup = function (texto) {
1304
+ var splitedLabel = texto.split('-');
1305
+ var concatenate = function (p, c) {
1306
+ if (p === void 0) { p = ' '; }
1307
+ if (c === void 0) { c = ' '; }
1308
+ if (p.trim() && c.trim())
1309
+ return p + " - " + c;
1310
+ if (p.trim() && !c.trim())
1311
+ return "" + p;
1312
+ if (!p.trim() && c.trim())
1313
+ return "" + c;
1314
+ };
1315
+ return splitedLabel.reduce(concatenate);
1316
+ };
1317
+ return concatenateLabelsLookup(fields.map(function (field) {
1318
+ if (field.indexOf(".") > 0)
1319
+ return getProp(data, field);
1320
+ return data[field];
1321
+ }).join(separator))
1322
+ || (translation ? 'yms.erp.sem_descricao' : ' - ');
1323
+ }
1324
+ var onLookupRequest = function (searchFields, lookupDisplayFields, advancedDisplayFields, lookupSeparator, service, value, customFilter) {
1325
+ if (customFilter === void 0) { customFilter = ''; }
1326
+ var sort = lookupDisplayFields.map(function (field) { return ({ field: field, order: 1 }); });
1327
+ var filterQuery = (searchFields)
1328
+ .filter(function (_a) {
1329
+ var type = _a.type;
1330
+ return isValidFilter(type, value);
1331
+ })
1332
+ .map(function (_a) {
1333
+ var name = _a.name, type = _a.type;
1334
+ if (typeof value == "number" || type === angularComponents.FieldType.Integer)
1335
+ return name + " eq " + value;
1336
+ else if (type == angularComponents.FieldType.Date)
1337
+ return name + " eq '" + moment(value).format("YYYY-MM-DD") + "'";
1338
+ else if (type == angularComponents.FieldType.Time)
1339
+ return name + " eq '" + moment(value).format("HH:mm:ss") + "'";
1340
+ else if (type == angularComponents.FieldType.DateTime)
1341
+ return name + " eq '" + moment(value).format() + "'";
1342
+ else if (type == angularComponents.FieldType.String)
1343
+ return "containing(lower(" + name + "), lower('" + value.replace(/'/g, "\\'") + "'))";
1344
+ else
1345
+ return name + " eq '" + value + "'";
1346
+ })
1347
+ .join(" or ");
1348
+ if (customFilter && customFilter.trim()) {
1349
+ filterQuery = filterQuery ? "(" + filterQuery + ") and " + customFilter : customFilter;
1350
+ }
1351
+ var displayFields = mergeUnique(lookupDisplayFields, advancedDisplayFields);
1352
+ return service
1353
+ .list({ sort: sort, filterQuery: filterQuery, displayFields: displayFields })
1354
+ .pipe(operators.map(function (list) { return (__assign({}, list, { contents: list.contents.map(function (item) { return (__assign({}, item, { label: getLookupLabel(item, lookupDisplayFields, lookupSeparator) })); }) })); }));
1355
+ };
1356
+ var onSearchRequest = function (searchFields, lookupDisplayFields, advancedDisplayFields, lookupSeparator, service, event, customFilter) {
1357
+ if (customFilter === void 0) { customFilter = ''; }
1358
+ var first = event.first, rows = event.rows, multiSortMeta = event.multiSortMeta, filterData = event.filterData;
1359
+ var page = first / rows;
1360
+ var sort = multiSortMeta;
1361
+ var filterQuery = searchFields
1362
+ .filter(function (_a) {
1363
+ var name = _a.name;
1364
+ return filterData[name] != undefined && filterData[name] != "";
1365
+ })
1366
+ .map(function (_a) {
1367
+ var name = _a.name, type = _a.type;
1368
+ var value = filterData[name];
1369
+ if (typeof value == "number" || type === angularComponents.FieldType.Integer)
1370
+ return name + " eq " + value;
1371
+ else if (type == angularComponents.FieldType.Date)
1372
+ return name + " eq '" + moment(value).format("YYYY-MM-DD") + "'";
1373
+ else if (type == angularComponents.FieldType.Time)
1374
+ return name + " eq '" + moment(value).format("HH:mm:ss") + "'";
1375
+ else if (type == angularComponents.FieldType.DateTime)
1376
+ return name + " eq '" + moment(value).format() + "'";
1377
+ else if (type == angularComponents.FieldType.Enum)
1378
+ return name + " eq '" + value + "'";
1379
+ else if (type == angularComponents.FieldType.Lookup)
1380
+ return name + " eq '" + value.id + "'";
1381
+ else if (type == angularComponents.FieldType.String && name.indexOf('.') !== -1) {
1382
+ return "containing(" + name + ", '" + value.replace(/'/g, "\\'") + "')";
1383
+ }
1384
+ else if (type == angularComponents.FieldType.String && name.indexOf('.') === -1) {
1385
+ return "containing(lower(" + name + "),lower('" + value.replace(/'/g, "\\'") + "'))";
1386
+ }
1387
+ else
1388
+ return name + " eq '" + value + "'";
1389
+ })
1390
+ .join(" and ");
1391
+ filterQuery = customFilter && customFilter.trim() ? filterQuery.concat(filterQuery ? ' and ' : '').concat(customFilter) : filterQuery;
1392
+ var displayFields = mergeUnique(lookupDisplayFields, advancedDisplayFields);
1393
+ return service
1394
+ .list({ page: page, sort: sort, filterQuery: filterQuery, displayFields: displayFields })
1395
+ .pipe(operators.map(function (list) { return (__assign({}, list, { contents: list.contents.map(function (item) { return (__assign({}, item, { label: getLookupLabel(item, lookupDisplayFields, lookupSeparator) })); }) })); }));
1396
+ };
1397
+
1398
+ var moment$1 = _moment;
1399
+ var Agenda = /** @class */ (function () {
1400
+ function Agenda() {
1401
+ }
1402
+ Agenda.fromDto = function (agendaDto, originEntity) {
1403
+ var model = __assign({}, agendaDto);
1404
+ model.createdDate = model.createdDate && moment$1(model.createdDate).toDate();
1405
+ model.lastModifiedDate = model.lastModifiedDate && moment$1(model.lastModifiedDate).toDate();
1406
+ var lookupSeparator = " - ";
1407
+ var displayFields = ["descricao"];
1408
+ model.label = getLookupLabel(model, displayFields, lookupSeparator);
1409
+ return model;
1410
+ };
1411
+ Agenda.toDto = function (agenda, originEntity) {
1412
+ var dto = __assign({}, agenda);
1413
+ dto.createdDate = dto.createdDate && moment$1(dto.createdDate).format();
1414
+ dto.lastModifiedDate = dto.lastModifiedDate && moment$1(dto.lastModifiedDate).format();
1415
+ delete dto.label;
1416
+ return dto;
1417
+ };
1418
+ return Agenda;
1419
+ }());
1420
+
1421
+ var SAM_SENIOR_HEADER = "Ronda";
1422
+ var FormSamDescritor = /** @class */ (function () {
1423
+ function FormSamDescritor() {
1424
+ }
1425
+ FormSamDescritor = __decorate([
1426
+ ymsRoutines.ChegadaVeiculo({
1427
+ header: SAM_SENIOR_HEADER,
1428
+ name: 'yms.integracao.sam',
1429
+ icon: 'fal fa-shield'
1430
+ })
1431
+ ], FormSamDescritor);
1432
+ return FormSamDescritor;
1433
+ }());
1434
+ var FormSamComponent = /** @class */ (function (_super) {
1435
+ __extends(FormSamComponent, _super);
1436
+ function FormSamComponent(integrationCallback) {
1437
+ var _this = _super.call(this) || this;
1438
+ _this.integrationCallback = integrationCallback;
1439
+ _this.save = [];
1440
+ _this.header = SAM_SENIOR_HEADER;
1441
+ _this.loading = false;
1442
+ _this.unsubscribe$ = new rxjs.Subject();
1443
+ _this._integrationCallback = integrationCallback;
1444
+ return _this;
1445
+ }
1446
+ FormSamComponent.prototype.ngOnInit = function () {
1447
+ var _this = this;
1448
+ this._integrationCallback.onAgendamentoSaved()
1449
+ .pipe(operators.takeUntil(this.unsubscribe$), operators.mergeMap(function (agenda) {
1450
+ var visitors = _this.save;
1451
+ _this.agenda = agenda;
1452
+ return rxjs.empty();
1453
+ }))
1454
+ .subscribe();
1455
+ };
1456
+ FormSamComponent.prototype.ngOnDestroy = function () {
1457
+ this.unsubscribe$.next();
1458
+ this.unsubscribe$.complete();
1459
+ };
1460
+ __decorate([
1461
+ core.Output(),
1462
+ __metadata("design:type", Agenda)
1463
+ ], FormSamComponent.prototype, "agenda", void 0);
1464
+ __decorate([
1465
+ core.Input(),
1466
+ __metadata("design:type", Array)
1467
+ ], FormSamComponent.prototype, "save", void 0);
1468
+ FormSamComponent = __decorate([
1469
+ core.Component({
1470
+ template: "\n <div *ngIf=\"agenda\">\n <scheduling [agenda]=\"agenda\"></scheduling>\n </div>\n "
1471
+ }),
1472
+ __metadata("design:paramtypes", [ymsRoutines.IntegrationEventsCallback])
1473
+ ], FormSamComponent);
1474
+ return FormSamComponent;
1475
+ }(FormSamDescritor));
1476
+
1477
+ var FocusService = /** @class */ (function () {
1478
+ function FocusService() {
1479
+ }
1480
+ FocusService.prototype.focusFirstInvalidInput = function () {
1481
+ var invalidFields = Array.from(document.getElementsByClassName("ng-invalid"));
1482
+ var firstField = invalidFields.find(function (f) { return f.nodeName !== "FORM"; });
1483
+ if (!firstField)
1484
+ return;
1485
+ if (firstField.nodeName === "P-CALENDAR") {
1486
+ var firstInputId = firstField.getAttribute("ng-reflect-input-id");
1487
+ var firstInvalidInput = document.getElementById(firstInputId);
1488
+ if (firstInvalidInput)
1489
+ firstInvalidInput.focus();
1490
+ }
1491
+ else if (firstField.nodeName === "S-LOOKUP") {
1492
+ var nestedInput = this.getNestedInput(firstField.firstElementChild);
1493
+ if (nestedInput)
1494
+ nestedInput.focus();
1495
+ }
1496
+ else
1497
+ firstField.focus();
1498
+ };
1499
+ FocusService.prototype.getNestedInput = function (element) {
1500
+ if (element.nodeName === "INPUT") {
1501
+ return element;
1502
+ }
1503
+ return this.getNestedInput(element.firstElementChild);
1504
+ };
1505
+ FocusService = __decorate([
1506
+ core.Injectable()
1507
+ ], FocusService);
1508
+ return FocusService;
1509
+ }());
1510
+
1511
+ var FieldCustomizationService = /** @class */ (function () {
1512
+ function FieldCustomizationService(http, messageService) {
1513
+ this.http = http;
1514
+ this.messageService = messageService;
1515
+ this.http = http;
1516
+ this.messageService = messageService;
1517
+ this.defaultCatch = this.defaultCatch.bind(this);
1518
+ }
1519
+ FieldCustomizationService.prototype.commitFiles = function (objects) {
1520
+ return this.http.post("platform/field_customization/actions/commitObject", { objects: objects }).pipe(this.defaultCatch());
1521
+ };
1522
+ FieldCustomizationService.prototype.deleteFiles = function (objects) {
1523
+ return this.http.post("platform/field_customization/actions/deleteObjects", objects).pipe(this.defaultCatch());
1524
+ };
1525
+ FieldCustomizationService.prototype.getFiles = function (formGroup) {
1526
+ var _this = this;
1527
+ var fieldCustomization = [];
1528
+ if (formGroup.value.custom) {
1529
+ fieldCustomization = formGroup.value.custom.fieldCustomization || [];
1530
+ delete formGroup.value.custom.fieldCustomization;
1531
+ }
1532
+ var filesToCommit = [];
1533
+ var filesToDelete = {};
1534
+ fieldCustomization.forEach(function (_a) {
1535
+ var domain = _a.domain, service = _a.service, entity = _a.entity, toDelete = _a.toDelete, toInsert = _a.toInsert;
1536
+ if (!_this.isEmpty(toInsert)) {
1537
+ var files = Object.keys(toInsert).map(function (key) {
1538
+ var version = toInsert[key].version;
1539
+ var fileName = toInsert[key].name;
1540
+ var objectId = toInsert[key].objectId;
1541
+ return { version: version, fileName: fileName, objectId: objectId };
1542
+ });
1543
+ if (!_this.isEmpty(files)) {
1544
+ filesToCommit.push.apply(filesToCommit, __spread(files));
1545
+ }
1546
+ }
1547
+ if (!_this.isEmpty(toDelete)) {
1548
+ var objects_1 = [];
1549
+ Object.keys(toDelete).forEach(function (key) {
1550
+ var fields = toDelete[key] || [];
1551
+ var files = fields.map(function (file) {
1552
+ return {
1553
+ field: key,
1554
+ objectId: file,
1555
+ };
1556
+ });
1557
+ objects_1.push.apply(objects_1, __spread(files));
1558
+ });
1559
+ filesToDelete = { domain: domain, service: service, entityName: entity, objects: objects_1 };
1560
+ }
1561
+ });
1562
+ return { filesToCommit: filesToCommit, filesToDelete: filesToDelete };
1563
+ };
1564
+ FieldCustomizationService.prototype.isEmpty = function (object) {
1565
+ if (Array.isArray(object)) {
1566
+ return object.length === 0;
1567
+ }
1568
+ return Object.entries(object).length === 0 && object.constructor === Object;
1569
+ };
1570
+ FieldCustomizationService.prototype.defaultCatch = function () {
1571
+ var _this = this;
1572
+ return operators.catchError(function (err) {
1573
+ if (err) {
1574
+ var summary = err.status ? String(err.status) : "Error";
1575
+ var detail = (err.error && err.error.message) || err.statusText || err.message || "Error";
1576
+ _this.messageService.add({
1577
+ severity: "error",
1578
+ summary: summary,
1579
+ detail: detail,
1580
+ });
1581
+ }
1582
+ return rxjs.throwError(err);
1583
+ });
1584
+ };
1585
+ FieldCustomizationService = __decorate([
1586
+ core.Injectable(),
1587
+ __metadata("design:paramtypes", [http.HttpClient, messageservice.MessageService])
1588
+ ], FieldCustomizationService);
1589
+ return FieldCustomizationService;
1590
+ }());
1591
+
1592
+ var VisitedInfoService = /** @class */ (function (_super) {
1593
+ __extends(VisitedInfoService, _super);
1594
+ function VisitedInfoService(http, messageService) {
1595
+ var _this = _super.call(this, messageService) || this;
1596
+ _this.http = http;
1597
+ _this.messageService = messageService;
1598
+ _this.domainService = "yms_int/sam";
1599
+ return _this;
1600
+ }
1601
+ VisitedInfoService.prototype.getVisited = function (agendaIdYMS) {
1602
+ return this.http.post("yms_int/sam/queries/getVisited", { id: agendaIdYMS });
1603
+ };
1604
+ VisitedInfoService.ngInjectableDef = core.defineInjectable({ factory: function VisitedInfoService_Factory() { return new VisitedInfoService(core.inject(http.HttpClient), core.inject(messageservice.MessageService)); }, token: VisitedInfoService, providedIn: "root" });
1605
+ VisitedInfoService = __decorate([
1606
+ core.Injectable({ providedIn: 'root' }),
1607
+ __metadata("design:paramtypes", [http.HttpClient, messageservice.MessageService])
1608
+ ], VisitedInfoService);
1609
+ return VisitedInfoService;
1610
+ }(Service));
1611
+
1612
+ var Visited = /** @class */ (function () {
1613
+ function Visited() {
1614
+ }
1615
+ return Visited;
1616
+ }());
1617
+
1618
+ var VisitedInfoDescritor = /** @class */ (function () {
1619
+ function VisitedInfoDescritor() {
1620
+ }
1621
+ return VisitedInfoDescritor;
1622
+ }());
1623
+ var VisitedInfoComponent = /** @class */ (function (_super) {
1624
+ __extends(VisitedInfoComponent, _super);
1625
+ function VisitedInfoComponent(service) {
1626
+ var _this = _super.call(this) || this;
1627
+ _this.service = service;
1628
+ _this.visited = new Visited();
1629
+ _this.ngUnsubscribe = new rxjs.Subject();
1630
+ _this.visitedService = service;
1631
+ return _this;
1632
+ }
1633
+ VisitedInfoComponent.prototype.ngOnInit = function () {
1634
+ // nada por enquanto
1635
+ };
1636
+ VisitedInfoComponent.prototype.ngAfterContentInit = function () {
1637
+ var _this = this;
1638
+ if (!this.agenda) {
1639
+ console.error("agenda not found");
1640
+ }
1641
+ this.visitedService
1642
+ .getVisited(this.agenda.id)
1643
+ .pipe(operators.takeUntil(this.ngUnsubscribe))
1644
+ .subscribe(function (response) {
1645
+ if (response) {
1646
+ _this.visited.name = response.name;
1647
+ _this.visited.contactPhone = response.contactPhone;
1648
+ }
1649
+ });
1650
+ };
1651
+ __decorate([
1652
+ core.Input(),
1653
+ __metadata("design:type", Object)
1654
+ ], VisitedInfoComponent.prototype, "agenda", void 0);
1655
+ VisitedInfoComponent = __decorate([
1656
+ core.Component({
1657
+ selector: "visited-info",
1658
+ template: "\n <div> \n <div class=\"info\">\n <div class=\"info-title\">\n Visitado:\n </div>\n <div class=\"info-data\">\n {{ visited.name }} {{ visited.contactPhone }}\n </div>\n </div>\n </div>\n",
1659
+ styles: [".info{width:40%;margin-top:5px;display:inline-block}.info .info-title{display:block;font-size:12px}.info .info-data{display:inline-block;font-size:16px;font-weight:800}"]
1660
+ }),
1661
+ __metadata("design:paramtypes", [VisitedInfoService])
1662
+ ], VisitedInfoComponent);
1663
+ return VisitedInfoComponent;
1664
+ }(VisitedInfoDescritor));
1665
+
1666
+ var VisitorCredentialsDto = /** @class */ (function () {
1667
+ function VisitorCredentialsDto() {
1668
+ }
1669
+ return VisitorCredentialsDto;
1670
+ }());
1671
+
1672
+ var CardTechnology;
1673
+ (function (CardTechnology) {
1674
+ CardTechnology["BARCODE_CARD"] = "BARCODE_CARD";
1675
+ CardTechnology["RFID_CARD"] = "RFID_CARD";
1676
+ CardTechnology["SMART_CARD"] = "SMART_CARD";
1677
+ })(CardTechnology || (CardTechnology = {}));
1678
+
1679
+ var VisitorSituation;
1680
+ (function (VisitorSituation) {
1681
+ VisitorSituation["CHECK_IN_PENDING"] = "CHECK_IN_PENDING";
1682
+ VisitorSituation["CHECK_IN_REALIZED"] = "CHECK_IN_REALIZED";
1683
+ VisitorSituation["VISITING"] = "VISITING";
1684
+ VisitorSituation["CHECK_OUT_REALIZED"] = "CHECK_OUT_REALIZED";
1685
+ VisitorSituation["CHECK_IN_NOT_REALIZED"] = "CHECK_IN_NOT_REALIZED";
1686
+ VisitorSituation["CHECK_IN_EXPIRED"] = "CHECK_IN_EXPIRED";
1687
+ })(VisitorSituation || (VisitorSituation = {}));
1688
+
1689
+ var CardTechnology$1;
1690
+ (function (CardTechnology) {
1691
+ CardTechnology["BARCODE_CARD"] = "BARCODE_CARD";
1692
+ CardTechnology["RFID_CARD"] = "RFID_CARD";
1693
+ CardTechnology["SMART_CARD"] = "SMART_CARD";
1694
+ })(CardTechnology$1 || (CardTechnology$1 = {}));
1695
+
1696
+ var moment$2 = _moment;
1697
+ var CredencialFormComponent = /** @class */ (function () {
1698
+ function CredencialFormComponent(fb, dialogRef, translate, route, dialogConfig) {
1699
+ this.fb = fb;
1700
+ this.dialogRef = dialogRef;
1701
+ this.translate = translate;
1702
+ this.route = route;
1703
+ this.dialogConfig = dialogConfig;
1704
+ this.unsubscribe$ = new rxjs.Subject();
1705
+ this.technologies = [];
1706
+ this.localeConfig = {};
1707
+ }
1708
+ CredencialFormComponent.prototype.ngOnInit = function () {
1709
+ var _this = this;
1710
+ this.formGroup = this.fb.group({
1711
+ tecnologiaCracha: [undefined, forms.Validators.compose([forms.Validators.required])],
1712
+ numero: [undefined, forms.Validators.compose([forms.Validators.required])],
1713
+ validadeCredencial: [undefined, forms.Validators.compose([forms.Validators.required])],
1714
+ hora: [undefined, forms.Validators.compose([forms.Validators.required])],
1715
+ });
1716
+ this.route.data.pipe(operators.takeUntil(this.unsubscribe$)).subscribe(function (data) {
1717
+ _this.localeConfig = data.localeConfig;
1718
+ });
1719
+ this.tecnologiaCracha(CardTechnology$1.BARCODE_CARD, CardTechnology$1.RFID_CARD, CardTechnology$1.SMART_CARD);
1720
+ this.formataDataEHoraDaCredencial();
1721
+ };
1722
+ CredencialFormComponent.prototype.ngOnDestroy = function () {
1723
+ this.unsubscribe$.next();
1724
+ this.unsubscribe$.complete();
1725
+ };
1726
+ CredencialFormComponent.prototype.gerar = function () {
1727
+ if (!this.formGroup.valid) {
1728
+ return this.validateAllFormFields(this.formGroup);
1729
+ }
1730
+ var endDate = this.getDataHora();
1731
+ var visitante = this.dialogConfig.data.visitante;
1732
+ var visitorCredentialCardList = this.gerarCredencial(visitante, endDate);
1733
+ this.close(visitorCredentialCardList);
1734
+ };
1735
+ CredencialFormComponent.prototype.tecnologiaCracha = function () {
1736
+ var cardTechnologies = [];
1737
+ for (var _i = 0; _i < arguments.length; _i++) {
1738
+ cardTechnologies[_i] = arguments[_i];
1739
+ }
1740
+ var e_1, _a;
1741
+ this.technologies = [];
1742
+ try {
1743
+ for (var cardTechnologies_1 = __values(cardTechnologies), cardTechnologies_1_1 = cardTechnologies_1.next(); !cardTechnologies_1_1.done; cardTechnologies_1_1 = cardTechnologies_1.next()) {
1744
+ var cardTechnology = cardTechnologies_1_1.value;
1745
+ this.technologies.push({
1746
+ label: this.getTecnologiaCrachaTraduzida(cardTechnology),
1747
+ value: cardTechnology,
1748
+ });
1749
+ }
1750
+ }
1751
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
1752
+ finally {
1753
+ try {
1754
+ if (cardTechnologies_1_1 && !cardTechnologies_1_1.done && (_a = cardTechnologies_1.return)) _a.call(cardTechnologies_1);
1755
+ }
1756
+ finally { if (e_1) throw e_1.error; }
1757
+ }
1758
+ };
1759
+ CredencialFormComponent.prototype.getTecnologiaCrachaTraduzida = function (cardTechnology) {
1760
+ if (cardTechnology === CardTechnology$1.BARCODE_CARD) {
1761
+ return this.translate.instant("yms.patio.cartao_credencial_codigo_barras");
1762
+ }
1763
+ if (cardTechnology === CardTechnology$1.RFID_CARD) {
1764
+ return this.translate.instant("yms.patio.cartao_credencial_rfid");
1765
+ }
1766
+ if (cardTechnology === CardTechnology$1.SMART_CARD) {
1767
+ return this.translate.instant("yms.patio.cartao_credencial_smart");
1768
+ }
1769
+ };
1770
+ CredencialFormComponent.prototype.formataDataEHoraDaCredencial = function () {
1771
+ var data = moment$2().add(1, "hour");
1772
+ this.formGroup.get("validadeCredencial").disable();
1773
+ this.definiValor("validadeCredencial", data.format("DD/MM/YYYY"));
1774
+ this.definiValor("hora", data.format("HH:mm"));
1775
+ };
1776
+ CredencialFormComponent.prototype.getDataHora = function () {
1777
+ var dataHora = new Date();
1778
+ var horaValue = this.formGroup.get("hora").value;
1779
+ var horas = moment$2().date(horaValue).add(1, "hour").hours();
1780
+ var minutos = moment$2().date(horaValue).minutes();
1781
+ dataHora.setHours(horas);
1782
+ dataHora.setMinutes(minutos);
1783
+ return dataHora;
1784
+ };
1785
+ CredencialFormComponent.prototype.gerarCredencial = function (visitante, endDate) {
1786
+ return {
1787
+ visitor: visitante,
1788
+ cardTechnology: this.formGroup.get("tecnologiaCracha").value,
1789
+ cardNumber: this.formGroup.get("numero").value,
1790
+ endDate: endDate,
1791
+ };
1792
+ };
1793
+ CredencialFormComponent.prototype.definiValor = function (campo, valor) {
1794
+ return this.formGroup.get(campo).setValue(valor);
1795
+ };
1796
+ CredencialFormComponent.prototype.close = function (data) {
1797
+ this.dialogRef.close(data);
1798
+ };
1799
+ CredencialFormComponent.prototype.validateAllFormFields = function (formGroup) {
1800
+ var _this = this;
1801
+ Object.keys(formGroup.controls).forEach(function (field) {
1802
+ var control = formGroup.get(field);
1803
+ if (control instanceof forms.FormControl) {
1804
+ control.markAsDirty({ onlySelf: true });
1805
+ }
1806
+ else if (control instanceof forms.FormGroup) {
1807
+ _this.validateAllFormFields(control);
1808
+ }
1809
+ });
1810
+ formGroup.markAsDirty({ onlySelf: true });
1811
+ };
1812
+ CredencialFormComponent = __decorate([
1813
+ core.Component({
1814
+ template: "<form [formGroup]=\"formGroup\">\n <div class=\"ui-g ui-fluid\">\n <div class=\"ui-g-12 required\">\n <label for=\"tecnologiaCracha\">{{\n \"yms.patio.motorista_tecnologiaCracha\" | translate\n }}</label>\n <p-dropdown\n inputId=\"tecnologiaCracha\"\n name=\"tecnologiaCracha\"\n [options]=\"this.technologies\"\n formControlName=\"tecnologiaCracha\"\n [autoWidth]=\"false\"\n placeholder=\"{{\n 'yms.patio.visitante_credencial_tecnologia_cracha_place_holder' | translate\n }}\"\n ></p-dropdown>\n <s-control-errors\n [control]=\"formGroup.controls['tecnologiaCracha']\"\n [errorMessages]=\"{ required: 'error_required' | translate }\"\n ></s-control-errors>\n </div>\n <div class=\"ui-g-12 required\">\n <label for=\"numero\">{{ \"yms.patio.visitante_credencial_numero\" | translate }}</label>\n <input\n type=\"text\"\n name=\"numero\"\n pInputText\n formControlName=\"numero\"\n autocomplete=\"off\"\n />\n <s-control-errors\n [control]=\"formGroup.controls['numero']\"\n [errorMessages]=\"{ required: 'error_required' | translate }\"\n ></s-control-errors>\n </div>\n <div class=\"ui-g-12 ui-md-6 required\">\n <label for=\"validadeCredencial\">{{\n \"yms.patio.visitante_validade_credencial\" | translate\n }}</label>\n <input\n type=\"text\"\n name=\"validadeCredencial\"\n pInputText\n formControlName=\"validadeCredencial\"\n autocomplete=\"off\"\n />\n <s-control-errors\n [control]=\"formGroup.controls['numero']\"\n [errorMessages]=\"{ required: 'error_required' | translate }\"\n ></s-control-errors>\n </div>\n <div class=\"ui-g-12 ui-md-6 required\">\n <label for=\"hora\">{{ \"yms.patio.visitante_credecnial_hora\" | translate }}</label>\n <p-calendar\n id=\"hora\"\n name=\"hora\"\n formControlName=\"hora\"\n [locale]=\"localeConfig.calendar\"\n inputId=\"hora\"\n [showTime]=\"true\"\n [hourFormat]=\"localeConfig.calendar.hourFormat\"\n [timeOnly]=\"true\"\n >\n </p-calendar>\n <s-control-errors\n [control]=\"formGroup.controls['numero']\"\n [errorMessages]=\"{ required: 'error_required' | translate }\"\n ></s-control-errors>\n </div>\n </div>\n\n <s-button\n [label]=\"'yms.patio.visitante_button_cancelar' | translate\"\n (onClick)=\"close()\"\n priority=\"link\"\n ></s-button>\n <s-button\n [label]=\"'yms.patio.visitante_button_gerar' | translate\"\n (onClick)=\"gerar()\"\n ></s-button>\n</form>\n",
1815
+ providers: [api.ConfirmationService]
1816
+ }),
1817
+ __metadata("design:paramtypes", [forms.FormBuilder,
1818
+ api.DynamicDialogRef,
1819
+ core$1.TranslateService,
1820
+ router.ActivatedRoute,
1821
+ api.DynamicDialogConfig])
1822
+ ], CredencialFormComponent);
1823
+ return CredencialFormComponent;
1824
+ }());
1825
+
1826
+ var VisitanteFormComponent = /** @class */ (function () {
1827
+ function VisitanteFormComponent(fb, dialogRef, dialogConfig) {
1828
+ this.dialogRef = dialogRef;
1829
+ this.dialogConfig = dialogConfig;
1830
+ this.unsubscribe$ = new rxjs.Subject();
1831
+ this.ngUnsubscribe = new rxjs.Subject();
1832
+ this.notSavedData = new core.EventEmitter();
1833
+ this.actualChanged = false;
1834
+ this.isFormModified = false;
1835
+ this.formGroup = fb.group({
1836
+ name: [undefined, forms.Validators.compose([forms.Validators.required])],
1837
+ document: [undefined, forms.Validators.compose([forms.Validators.required])],
1838
+ contact: [undefined, forms.Validators.compose([forms.Validators.required])],
1839
+ });
1840
+ }
1841
+ VisitanteFormComponent.prototype.ngOnInit = function () {
1842
+ var _this = this;
1843
+ var data = this.dialogConfig.data;
1844
+ if (data !== undefined) {
1845
+ this.id = data.id;
1846
+ this.formGroup.get("name").setValue(data.name);
1847
+ this.formGroup.get("document").setValue(data.document);
1848
+ this.formGroup.get("contact").setValue(data.contact);
1849
+ if (data.document !== undefined) {
1850
+ this.formGroup.get("document").disable();
1851
+ }
1852
+ }
1853
+ this.notSavedData
1854
+ .pipe(operators.takeUntil(this.ngUnsubscribe))
1855
+ .subscribe(function (val) { return (_this.actualChanged = val); });
1856
+ var rs = new rxjs.ReplaySubject();
1857
+ rs.subscribe(function (isIntact) { return (_this.isFormModified = !isIntact); });
1858
+ };
1859
+ VisitanteFormComponent.prototype.ngOnDestroy = function () {
1860
+ this.unsubscribe$.next();
1861
+ this.unsubscribe$.complete();
1862
+ };
1863
+ VisitanteFormComponent.prototype.save = function () {
1864
+ if (!this.formGroup.valid) {
1865
+ return this.validateAllFormFields(this.formGroup);
1866
+ }
1867
+ var visitante = this.formGroup.value;
1868
+ visitante.id = this.id;
1869
+ this.close(visitante);
1870
+ };
1871
+ VisitanteFormComponent.prototype.close = function (data) {
1872
+ this.dialogRef.close(data);
1873
+ };
1874
+ VisitanteFormComponent.prototype.validateAllFormFields = function (formGroup) {
1875
+ var _this = this;
1876
+ Object.keys(formGroup.controls).forEach(function (field) {
1877
+ var control = formGroup.get(field);
1878
+ if (control instanceof forms.FormControl) {
1879
+ control.markAsDirty({ onlySelf: true });
1880
+ }
1881
+ else if (control instanceof forms.FormGroup) {
1882
+ _this.validateAllFormFields(control);
1883
+ }
1884
+ });
1885
+ formGroup.markAsDirty({ onlySelf: true });
1886
+ };
1887
+ __decorate([
1888
+ core.Output(),
1889
+ __metadata("design:type", core.EventEmitter)
1890
+ ], VisitanteFormComponent.prototype, "notSavedData", void 0);
1891
+ VisitanteFormComponent = __decorate([
1892
+ core.Component({
1893
+ template: "<form [formGroup]=\"formGroup\">\n <div class=\"ui-g ui-fluid\">\n <div class=\"ui-g-12 required\">\n <label for=\"name\">{{ \"yms.visitante_nome\" | translate }}</label>\n <input\n type=\"text\"\n name=\"name\"\n pInputText\n formControlName=\"name\"\n dialog\n autocomplete=\"off\"\n />\n <s-control-errors\n [control]=\"formGroup.controls['name']\"\n [errorMessages]=\"{ required: 'error_required' | translate }\"\n ></s-control-errors>\n </div>\n <div class=\"ui-g-12 required\">\n <label for=\"document\">{{ \"yms.visitante_documento\" | translate }}</label>\n <input\n type=\"text\"\n name=\"document\"\n pInputText\n formControlName=\"document\"\n autocomplete=\"off\"\n />\n <s-control-errors\n [control]=\"formGroup.controls['document']\"\n [errorMessages]=\"{ required: 'error_required' | translate }\"\n ></s-control-errors>\n </div>\n <div class=\"ui-g-12 required\">\n <label for=\"contact\">{{ \"yms.visitante_contato\" | translate }}</label>\n <input\n type=\"text\"\n name=\"contact\"\n pInputText\n formControlName=\"contact\"\n autocomplete=\"off\"\n />\n <s-control-errors\n [control]=\"formGroup.controls['contact']\"\n [errorMessages]=\"{ required: 'error_required' | translate }\"\n ></s-control-errors>\n </div>\n </div>\n\n <s-button\n [label]=\"'yms.patio.visitante_button_cancelar' | translate\"\n (onClick)=\"close()\"\n priority=\"link\"\n ></s-button>\n <s-button\n [label]=\"'yms.patio.visitante_button_salvar' | translate\"\n (onClick)=\"save()\"\n ></s-button>\n</form>\n",
1894
+ providers: [api.ConfirmationService]
1895
+ }),
1896
+ __metadata("design:paramtypes", [forms.FormBuilder,
1897
+ api.DynamicDialogRef,
1898
+ api.DynamicDialogConfig])
1899
+ ], VisitanteFormComponent);
1900
+ return VisitanteFormComponent;
1901
+ }());
1902
+
1903
+ var VisitanteComponent = /** @class */ (function () {
1904
+ function VisitanteComponent(translate, dialogService, integrationCallback) {
1905
+ this.translate = translate;
1906
+ this.dialogService = dialogService;
1907
+ this.integrationCallback = integrationCallback;
1908
+ this.visitors = [];
1909
+ this.visitorsChange = new core.EventEmitter();
1910
+ this.ngUnsubscribe = new rxjs.Subject();
1911
+ this.credenciaisParaEntregar = [];
1912
+ this.unsubscribe$ = new rxjs.Subject();
1913
+ this._integrationCallback = integrationCallback;
1914
+ }
1915
+ VisitanteComponent.prototype.ngOnInit = function () {
1916
+ this.constroiCamposTabelaVistante();
1917
+ this.visitanteTotalRecords = 0;
1918
+ };
1919
+ VisitanteComponent.prototype.ngAfterContentInit = function () {
1920
+ var _this = this;
1921
+ this.visitanteGridLoading = false;
1922
+ this.adicionaVisitantesGrid();
1923
+ this._integrationCallback
1924
+ .onAgendamentoMotoristaChanged()
1925
+ .pipe(operators.takeUntil(this.unsubscribe$), operators.mergeMap(function (motorista) {
1926
+ _this.atualizaMotorista(motorista);
1927
+ return rxjs.empty();
1928
+ }))
1929
+ .subscribe();
1930
+ };
1931
+ VisitanteComponent.prototype.atualizaMotorista = function (mot) {
1932
+ var motoristaVisitante = this.visitanteGridData.find(function (item) { return item.driver; });
1933
+ if (motoristaVisitante && motoristaVisitante.cpf == mot.cpf) {
1934
+ return;
1935
+ }
1936
+ if (this.visitanteGridData.length > 0) {
1937
+ this.visitanteGridData[0] = {
1938
+ name: mot.nome,
1939
+ document: mot.cpf,
1940
+ contact: this.getContatoMotorista(mot),
1941
+ visitorSituation: VisitorSituation.CHECK_IN_PENDING,
1942
+ documentType: this.getDocumentType(),
1943
+ driver: true
1944
+ };
1945
+ }
1946
+ else {
1947
+ this.visitanteGridData.push({
1948
+ name: mot.nome,
1949
+ document: mot.cpf,
1950
+ contact: this.getContatoMotorista(mot),
1951
+ visitorSituation: VisitorSituation.CHECK_IN_PENDING,
1952
+ documentType: this.getDocumentType(),
1953
+ driver: true
1954
+ });
1955
+ }
1956
+ };
1957
+ VisitanteComponent.prototype.adicionaVisitantesGrid = function () {
1958
+ var _this = this;
1959
+ if (this.visitors.length) {
1960
+ this.visitanteGridData = [];
1961
+ this.adicionaMotoristaNoVisitanteGridData();
1962
+ this.visitors.forEach(function (visitor) {
1963
+ if (_this.motorista.cpf !== visitor.visitor.document) {
1964
+ _this.visitanteGridData.push({
1965
+ id: visitor.visitor.id,
1966
+ name: visitor.visitor.name,
1967
+ document: visitor.visitor.document,
1968
+ contact: visitor.visitor.contact,
1969
+ visitorSituation: _this.getVisitorSituation(visitor.visitor.visitorSituation),
1970
+ documentType: _this.getDocumentType(),
1971
+ driver: true
1972
+ });
1973
+ }
1974
+ _this.visitanteTotalRecords = _this.visitors.length;
1975
+ });
1976
+ }
1977
+ else {
1978
+ this.visitanteGridData = [];
1979
+ var novo_visitante_1 = new VisitorCredentialsDto();
1980
+ novo_visitante_1.visitor = {
1981
+ name: this.motorista.nome,
1982
+ document: this.motorista.cpf,
1983
+ contact: this.getContatoMotorista(this.motorista),
1984
+ documentType: this.getDocumentType(),
1985
+ visitorSituation: VisitorSituation.CHECK_IN_PENDING,
1986
+ driver: true
1987
+ };
1988
+ var visitanteBuscando = this.visitanteGridData.find(function (visitanteNaLista) { return novo_visitante_1.visitor.document === visitanteNaLista.document; });
1989
+ if (visitanteBuscando === undefined) {
1990
+ this.visitanteGridData.push(novo_visitante_1.visitor);
1991
+ this.visitors.push(novo_visitante_1);
1992
+ this.visitanteTotalRecords = 1;
1993
+ }
1994
+ }
1995
+ this.visitanteGridLoading = false;
1996
+ };
1997
+ VisitanteComponent.prototype.isCredentialCardsEmpty = function (visitor) {
1998
+ var visitantesEncontrados = this.visitors.find(function (visitorWithCredentials) {
1999
+ return visitorWithCredentials.visitor.document === visitor.document;
2000
+ });
2001
+ if (visitantesEncontrados === undefined) {
2002
+ return false;
2003
+ }
2004
+ return visitantesEncontrados.credentialCards.filter(function (credentialCard) {
2005
+ return Object.keys(credentialCard).length !== 0;
2006
+ }).length > 0
2007
+ ? true
2008
+ : false;
2009
+ };
2010
+ VisitanteComponent.prototype.adicionaMotoristaNoVisitanteGridData = function () {
2011
+ var _this = this;
2012
+ var motoristaVisitante = this.visitors.find(function (visitor) { return _this.motorista.cpf === visitor.visitor.document; });
2013
+ if (motoristaVisitante === undefined) {
2014
+ this.visitanteGridData.push({
2015
+ name: this.motorista.nome,
2016
+ document: this.motorista.cpf,
2017
+ contact: this.getContatoMotorista(this.motorista),
2018
+ visitorSituation: VisitorSituation.CHECK_IN_PENDING,
2019
+ documentType: this.getDocumentType(),
2020
+ driver: true,
2021
+ });
2022
+ }
2023
+ else {
2024
+ this.visitanteGridData.push({
2025
+ id: motoristaVisitante.visitor.id,
2026
+ name: motoristaVisitante.visitor.name,
2027
+ document: motoristaVisitante.visitor.document,
2028
+ contact: this.getContatoMotorista(this.motorista),
2029
+ visitorSituation: this.getVisitorSituation(motoristaVisitante.visitor.visitorSituation),
2030
+ documentType: this.getDocumentType(),
2031
+ driver: true,
2032
+ });
2033
+ }
2034
+ };
2035
+ VisitanteComponent.prototype.criarOuAtualizarVisitante = function (visitor) {
2036
+ var _this = this;
2037
+ this.dialogService
2038
+ .open(VisitanteFormComponent, __assign({ header: this.translate.instant("yms.patio.motorista_adicionar_visitante") }, dialogConfig, this.constroiVisitante(visitor)))
2039
+ .onClose.pipe(operators.takeUntil(this.ngUnsubscribe), operators.filter(function (value) { return !!value; }))
2040
+ .subscribe(function (visitante) { return _this.adicionaVisitanteParaSalvar(visitante); });
2041
+ };
2042
+ VisitanteComponent.prototype.adicionaVisitanteParaSalvar = function (visitante) {
2043
+ this.visitanteGridLoading = true;
2044
+ visitante.documentType = this.getDocumentType();
2045
+ if (visitante.visitorSituation === undefined) {
2046
+ visitante.visitorSituation = VisitorSituation.CHECK_IN_PENDING;
2047
+ }
2048
+ this.addVisitanteNaTabela(visitante);
2049
+ this.visitanteTotalRecords++;
2050
+ this.visitanteGridLoading = false;
2051
+ var novo_visitante = new VisitorCredentialsDto();
2052
+ novo_visitante.visitor = {
2053
+ name: visitante.name,
2054
+ document: visitante.document,
2055
+ contact: visitante.contact,
2056
+ documentType: visitante.documentType,
2057
+ visitorSituation: visitante.visitorSituation,
2058
+ driver: false
2059
+ };
2060
+ this.visitors.push(novo_visitante);
2061
+ this.visitorsChange.emit(this.visitors);
2062
+ };
2063
+ VisitanteComponent.prototype.model = function (visitante) {
2064
+ var _this = this;
2065
+ var entregarCredencial = {
2066
+ label: this.translate.instant("yms.patio.motorista_visitante_entregar_credencial"),
2067
+ command: function () { return _this.entregarCredencial(visitante); },
2068
+ };
2069
+ if (visitante.document === this.motorista.cpf) {
2070
+ return [entregarCredencial];
2071
+ }
2072
+ else {
2073
+ return [
2074
+ {
2075
+ label: this.translate.instant("yms.patio.motorista_editar_visitante"),
2076
+ command: function () { return _this.editarVisitante(visitante); },
2077
+ },
2078
+ {
2079
+ label: this.translate.instant("yms.patio.delete"),
2080
+ command: function () { return _this.deletarVisitante(visitante); },
2081
+ },
2082
+ entregarCredencial,
2083
+ ];
2084
+ }
2085
+ };
2086
+ VisitanteComponent.prototype.addVisitanteNaTabela = function (visitante) {
2087
+ if (visitante.id !== undefined) {
2088
+ this.visitanteGridData = this.visitanteGridData.map(function (visitanteGrid) {
2089
+ if (visitanteGrid.id === visitante.id) {
2090
+ return visitante;
2091
+ }
2092
+ return visitanteGrid;
2093
+ });
2094
+ }
2095
+ else {
2096
+ this.visitanteGridData.push(visitante);
2097
+ }
2098
+ };
2099
+ VisitanteComponent.prototype.entregarCredencial = function (visitante) {
2100
+ var _this = this;
2101
+ this.dialogService
2102
+ .open(CredencialFormComponent, {
2103
+ header: this.translate.instant("yms.patio.motorista_visitante_credencial"),
2104
+ data: {
2105
+ visitante: visitante,
2106
+ },
2107
+ })
2108
+ .onClose.pipe(operators.takeUntil(this.ngUnsubscribe), operators.filter(function (value) { return !!value; }))
2109
+ .subscribe(function (visitorCredentialCard) {
2110
+ return _this.adicionaCredencialParaEntregar(visitorCredentialCard);
2111
+ });
2112
+ };
2113
+ VisitanteComponent.prototype.adicionaCredencialParaEntregar = function (visitorCredentialCard) {
2114
+ var visitor = this.visitors.find(function (visitor) { return visitor.visitor.id === visitorCredentialCard.visitor.id; });
2115
+ if (visitor === undefined) {
2116
+ this.visitors.push({
2117
+ visitor: visitorCredentialCard.visitor,
2118
+ credentialCards: [this.createCredentialCard(visitorCredentialCard)],
2119
+ });
2120
+ }
2121
+ else {
2122
+ visitor.credentialCards = [];
2123
+ visitor.credentialCards.push(this.createCredentialCard(visitorCredentialCard));
2124
+ }
2125
+ };
2126
+ VisitanteComponent.prototype.editarVisitante = function (visitante) {
2127
+ this.criarOuAtualizarVisitante(visitante);
2128
+ };
2129
+ VisitanteComponent.prototype.deletarVisitante = function (visitante) {
2130
+ var _this = this;
2131
+ this.visitanteGridData.forEach(function (value, index) {
2132
+ if (value.document == visitante.document)
2133
+ _this.visitanteGridData.splice(index, 1);
2134
+ });
2135
+ };
2136
+ VisitanteComponent.prototype.getContatoMotorista = function (motorista) {
2137
+ return motorista.telefone === undefined ? "0" : motorista.telefone;
2138
+ };
2139
+ VisitanteComponent.prototype.getCredentialCards = function (visitor) {
2140
+ var _this = this;
2141
+ if (this.visitors.length <= 0) {
2142
+ return [];
2143
+ }
2144
+ return this.visitors
2145
+ .find(function (visitorWithCredentials) {
2146
+ return visitorWithCredentials.visitor.document === visitor.document;
2147
+ })
2148
+ .credentialCards.filter(function (credentialCard) { return Object.keys(credentialCard).length !== 0; })
2149
+ .map(function (credentialCard) {
2150
+ return {
2151
+ cardTechnology: _this.getTecnologiaCrachaTraduzida(credentialCard.cardTechnology),
2152
+ cardNumber: credentialCard.cardNumber,
2153
+ endDate: credentialCard.endDate,
2154
+ };
2155
+ });
2156
+ };
2157
+ VisitanteComponent.prototype.constroiVisitante = function (visitante) {
2158
+ var visitanteData = { data: {} };
2159
+ if (visitante !== undefined && visitante !== null) {
2160
+ visitanteData = {
2161
+ data: {
2162
+ id: visitante.id,
2163
+ name: visitante.name,
2164
+ document: visitante.document,
2165
+ contact: visitante.contact,
2166
+ visitorSituation: this.getVisitorSituation(visitante.visitorSituation),
2167
+ documentType: this.getDocumentType(),
2168
+ },
2169
+ };
2170
+ }
2171
+ return visitanteData;
2172
+ };
2173
+ VisitanteComponent.prototype.createCredentialCard = function (visitorCredentialCard) {
2174
+ return {
2175
+ visitor: visitorCredentialCard.id,
2176
+ cardTechnology: visitorCredentialCard.cardTechnology,
2177
+ cardNumber: visitorCredentialCard.cardNumber,
2178
+ endDate: visitorCredentialCard.endDate,
2179
+ };
2180
+ };
2181
+ VisitanteComponent.prototype.getTecnologiaCrachaTraduzida = function (cardTechnology) {
2182
+ if (cardTechnology === CardTechnology.BARCODE_CARD) {
2183
+ return this.translate.instant("yms.patio.cartao_credencial_codigo_barras");
2184
+ }
2185
+ if (cardTechnology === CardTechnology.RFID_CARD) {
2186
+ return this.translate.instant("yms.patio.cartao_credencial_rfid");
2187
+ }
2188
+ if (cardTechnology === CardTechnology.SMART_CARD) {
2189
+ return this.translate.instant("yms.patio.cartao_credencial_smart");
2190
+ }
2191
+ };
2192
+ VisitanteComponent.prototype.getVisitorSituation = function (visitorSituation) {
2193
+ return visitorSituation === undefined
2194
+ ? VisitorSituation.CHECK_IN_PENDING
2195
+ : visitorSituation;
2196
+ };
2197
+ VisitanteComponent.prototype.constroiCamposTabelaVistante = function () {
2198
+ this.visitanteGridColumns = [
2199
+ {
2200
+ field: "name",
2201
+ header: this.translate.instant("yms.patio.motorista_visitante_nome"),
2202
+ },
2203
+ {
2204
+ field: "document",
2205
+ header: this.translate.instant("yms.patio.motorista_visitante_documento"),
2206
+ },
2207
+ {
2208
+ field: "contact",
2209
+ header: this.translate.instant("yms.patio.motorista_visitante_contato"),
2210
+ },
2211
+ ];
2212
+ };
2213
+ VisitanteComponent.prototype.getDocumentType = function () {
2214
+ return "cpf";
2215
+ };
2216
+ __decorate([
2217
+ core.Input(),
2218
+ __metadata("design:type", Object)
2219
+ ], VisitanteComponent.prototype, "motorista", void 0);
2220
+ __decorate([
2221
+ core.Input(),
2222
+ __metadata("design:type", Array)
2223
+ ], VisitanteComponent.prototype, "visitors", void 0);
2224
+ __decorate([
2225
+ core.Output(),
2226
+ __metadata("design:type", Object)
2227
+ ], VisitanteComponent.prototype, "visitorsChange", void 0);
2228
+ VisitanteComponent = __decorate([
2229
+ core.Component({
2230
+ selector: 'visitante-component',
2231
+ template: "<div style=\"margin-bottom: 15px\">\n <div>\n <p-header>\n {{ \"yms.patio.motorista_titulo_lista_visitante\" | translate}}\n <button\n style=\"margin-left: 50px\"\n type=\"button\"\n pButton\n (click)=\"criarOuAtualizarVisitante(null)\"\n label=\"{{ 'yms.patio.motorista_add_visitante' | translate }}\"\n >\n </button>\n </p-header>\n <div class=\"ui-g\">\n <div class=\"ui-g-12\">\n <p-table\n #visitanteTable\n [value]=\"visitanteGridData\"\n [columns]=\"visitanteGridColumns\"\n dataKey=\"id\"\n [lazy]=\"true\"\n [scrollable]=\"true\"\n [resizableColumns]=\"true\"\n sortMode=\"single\"\n [paginator]=\"true\"\n [totalRecords]=\"visitanteTotalRecords\"\n rows=\"10\"\n [rowsPerPageOptions]=\"[10, 20, 50, 100]\"\n [loading]=\"visitanteGridLoading\"\n >\n <ng-template pTemplate=\"colgroup\" let-columns>\n <colgroup>\n <col *ngFor=\"let col of columns\" [style.width]=\"col.width\" />\n </colgroup>\n </ng-template>\n <ng-template pTemplate=\"header\" let-columns>\n <tr>\n <th id=\"espaco-coluna-plus\" style=\"width: 50px\"></th>\n <th\n id=\"\"\n *ngFor=\"let col of columns\"\n [pSortableColumn]=\"col.field\"\n pResizableColumn\n >\n <div class=\"senior-header\">\n <span class=\"senior-header-title\">{{ col.header }}</span>\n <p-sortIcon [field]=\"col.field\"></p-sortIcon>\n </div>\n </th>\n <th id=\"\" style=\"width: 15%\"></th>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"body\" let-rowData let-columns>\n <tr [pSelectableRow]=\"rowData\">\n <td style=\"width: 50px\">\n <a href=\"#\" [pRowToggler]=\"rowData\" style=\"color: #000\">\n </a>\n </td>\n <td>\n <span>{{ rowData[\"name\"] }}</span>\n </td>\n <td>\n <span>{{ rowData[\"document\"] }}</span>\n </td>\n <td>\n <span>{{ rowData[\"contact\"] }}</span>\n </td>\n <td style=\"width: 15%\">\n <s-button\n priority=\"default\"\n label=\"{{ 'yms.patio.motorista_acao_visitante' | translate }}\"\n [model]=\"model(rowData)\"\n >\n </s-button>\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"rowexpansion\" let-rowData let-columns=\"columns\">\n <tr class=\"bg-white no-hover\">\n <td [attr.colspan]=\"columns.length + 2\">\n <div *ngIf=\"isCredentialCardsEmpty(rowData); else elseBlock\">\n <div\n class=\"container flex-container\"\n *ngFor=\"let credentialCard of getCredentialCards(rowData)\"\n >\n <p-card\n header=\"{{ credentialCard.cardTechnology }}\"\n [style]=\"{ width: '300px', margin: '10px' }\"\n >\n <div>\n N\u00FAmero: <strong>{{ credentialCard.cardNumber }}</strong>\n </div>\n <div>\n Data de validade:\n <strong>{{ credentialCard.endDate | date : \"dd/MM/yyyy hh:mm\" }}</strong>\n </div>\n </p-card>\n </div>\n </div>\n <ng-template #elseBlock\n >N\u00E3o h\u00E1 credenciais para salvar ou entregues</ng-template\n >\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"paginatorright\">\n <span\n [translate]=\"'total_records'\"\n [translateParams]=\"{ value: visitanteTotalRecords }\"\n ></span>\n </ng-template>\n </p-table>\n </div>\n </div>\n</div>\n</div>",
2232
+ styles: [".container{display:inline-flex}.flex-container{flex-wrap:wrap}"]
2233
+ }),
2234
+ __metadata("design:paramtypes", [core$1.TranslateService,
2235
+ api.DialogService,
2236
+ ymsRoutines.IntegrationEventsCallback])
2237
+ ], VisitanteComponent);
2238
+ return VisitanteComponent;
2239
+ }());
2240
+
1246
2241
  var EntityService = /** @class */ (function () {
2242
+ function EntityService(http, messageService, entityUrl, actionsUrl) {
2243
+ this.http = http;
2244
+ this.messageService = messageService;
2245
+ this.entityUrl = entityUrl;
2246
+ this.actionsUrl = actionsUrl;
2247
+ this.http = http;
2248
+ this.messageService = messageService;
2249
+ this.entityUrl = entityUrl;
2250
+ this.actionsUrl = actionsUrl;
2251
+ this.defaultCatch = this.defaultCatch.bind(this);
2252
+ }
2253
+ EntityService.prototype.getListQueryParams = function (listParams) {
2254
+ var _a = listParams.page, page = _a === void 0 ? 0 : _a, _b = listParams.size, size = _b === void 0 ? 10 : _b, _c = listParams.sort, sort = _c === void 0 ? [] : _c, _d = listParams.filterQuery, filterQuery = _d === void 0 ? "" : _d, _e = listParams.displayFields, displayFields = _e === void 0 ? [] : _e;
2255
+ var params = new http.HttpParams();
2256
+ params = params.append("size", String(size));
2257
+ params = params.append("offset", String(page));
2258
+ if (sort && sort.length) {
2259
+ params = params.append("orderby", sort
2260
+ .map(function (s) {
2261
+ var order = "";
2262
+ if (s.order === 1)
2263
+ order = " asc";
2264
+ else if (s.order === -1)
2265
+ order = " desc";
2266
+ return "" + s.field + order;
2267
+ })
2268
+ .join(", "));
2269
+ }
2270
+ if (filterQuery)
2271
+ params = params.append("filter", filterQuery);
2272
+ if (displayFields && displayFields.length)
2273
+ params = params.append("displayfields", displayFields.join());
2274
+ return params;
2275
+ };
2276
+ EntityService.prototype.getBodyParams = function (listParams) {
2277
+ var _a = listParams.page, page = _a === void 0 ? 0 : _a, _b = listParams.size, size = _b === void 0 ? 10 : _b, _c = listParams.sort, sort = _c === void 0 ? [] : _c, _d = listParams.filterQuery, filterQuery = _d === void 0 ? "" : _d, _e = listParams.displayFields, displayFields = _e === void 0 ? [] : _e;
2278
+ var bodyParams = {};
2279
+ bodyParams.size = size;
2280
+ bodyParams.offset = page;
2281
+ if (sort && sort.length) {
2282
+ bodyParams.orderBy = sort
2283
+ .map(function (s) {
2284
+ var order = "";
2285
+ if (s.order === 1)
2286
+ order = " asc";
2287
+ else if (s.order === -1)
2288
+ order = " desc";
2289
+ return "" + s.field + order;
2290
+ })
2291
+ .join(", ");
2292
+ }
2293
+ if (filterQuery)
2294
+ bodyParams.filter = filterQuery;
2295
+ if (displayFields && displayFields.length)
2296
+ bodyParams.displayFields = displayFields.join();
2297
+ return bodyParams;
2298
+ };
2299
+ EntityService.prototype.defaultCatch = function () {
2300
+ var _this = this;
2301
+ return operators.catchError(function (err) {
2302
+ if (err) {
2303
+ var summary = err.status ? String(err.status) : "Error";
2304
+ var detail = (err.error && err.error.message) || err.statusText || err.message || "Error";
2305
+ _this.messageService.add({
2306
+ severity: "error",
2307
+ summary: summary,
2308
+ detail: detail,
2309
+ });
2310
+ }
2311
+ return rxjs.throwError(err);
2312
+ });
2313
+ };
2314
+ EntityService.prototype.getListBodyParams = function (listParams) {
2315
+ var bodyParams = this.getBodyParams(listParams);
2316
+ if (listParams.displayFields && listParams.displayFields.length) {
2317
+ bodyParams.displayFields = listParams.displayFields;
2318
+ }
2319
+ return bodyParams;
2320
+ };
2321
+ EntityService.prototype.list = function (listParams) {
2322
+ return this.http.get(this.entityUrl, { params: this.getListQueryParams(listParams) }).pipe(this.defaultCatch());
2323
+ };
2324
+ EntityService.prototype.get = function (id, useCatch) {
2325
+ if (useCatch === void 0) { useCatch = true; }
2326
+ return this.http.get(this.entityUrl + "/" + id).pipe(useCatch ? this.defaultCatch() : operators.tap());
2327
+ };
2328
+ EntityService.prototype.insert = function (entity) {
2329
+ return this.http.post("" + this.entityUrl, entity).pipe(this.defaultCatch());
2330
+ };
2331
+ EntityService.prototype.update = function (id, entity, useCatch) {
2332
+ if (useCatch === void 0) { useCatch = true; }
2333
+ return this.http.put(this.entityUrl + "/" + id, entity).pipe(useCatch ? this.defaultCatch() : operators.tap());
2334
+ };
2335
+ EntityService.prototype.delete = function (id) {
2336
+ return this.http.delete(this.entityUrl + "/" + id).pipe(this.defaultCatch());
2337
+ };
2338
+ EntityService.prototype.listCustomFilter = function (listParams, action) {
2339
+ return this.http.post(this.actionsUrl + "/" + action, this.getBodyParams(listParams)).pipe(this.defaultCatch());
2340
+ };
2341
+ return EntityService;
2342
+ }());
2343
+
2344
+ var SchedulingService = /** @class */ (function (_super) {
2345
+ __extends(SchedulingService, _super);
2346
+ function SchedulingService(http, messageService) {
2347
+ var _this = _super.call(this, http, messageService, "yms_int/sam/entities/scheduling") || this;
2348
+ _this.http = http;
2349
+ _this.messageService = messageService;
2350
+ _this.domainService = "yms_int/sam";
2351
+ return _this;
2352
+ }
2353
+ SchedulingService.prototype.saveScheduling = function (scheduling) {
2354
+ return this.http
2355
+ .post(this.domainService + "/actions/saveScheduling", scheduling)
2356
+ .pipe(this.defaultCatch());
2357
+ };
2358
+ SchedulingService.prototype.startScheduling = function (schedulingId) {
2359
+ return this.http
2360
+ .post(this.domainService + "/actions/startScheduling", { id: schedulingId })
2361
+ .pipe(this.defaultCatch());
2362
+ };
2363
+ SchedulingService.prototype.getSchedulingByYms = function (id) {
2364
+ return this.http
2365
+ .post(this.domainService + "/queries/getSchedulingByYms", {
2366
+ id: id,
2367
+ })
2368
+ .pipe(this.defaultCatch());
2369
+ };
2370
+ SchedulingService.ngInjectableDef = core.defineInjectable({ factory: function SchedulingService_Factory() { return new SchedulingService(core.inject(http.HttpClient), core.inject(messageservice.MessageService)); }, token: SchedulingService, providedIn: "root" });
2371
+ SchedulingService = __decorate([
2372
+ core.Injectable({ providedIn: 'root' }),
2373
+ __metadata("design:paramtypes", [http.HttpClient, messageservice.MessageService])
2374
+ ], SchedulingService);
2375
+ return SchedulingService;
2376
+ }(EntityService));
2377
+
2378
+ var mergeUnique$1 = function (array, otherArray) {
2379
+ return array.concat(otherArray.filter(function (item) { return !array.includes(item); }));
2380
+ };
2381
+ var numberTypes$1 = [angularComponents.FieldType.Integer, angularComponents.FieldType.Double];
2382
+ var isValidFilter$1 = function (type, value) {
2383
+ var isTypeNumber = numberTypes$1.includes(type);
2384
+ var numberPattern = /^\d+\b$/;
2385
+ var isNumber = value.match(numberPattern);
2386
+ return !(isTypeNumber && !isNumber);
2387
+ };
2388
+
2389
+ var moment$3 = _moment;
2390
+ var Lookup = /** @class */ (function () {
2391
+ function Lookup(searchFields, service, searchGridFields, separator, verificaAtivo) {
2392
+ if (separator === void 0) { separator = ""; }
2393
+ this._lookupDisplayFields = [];
2394
+ this._advancedDisplayFields = [];
2395
+ this._params = [];
2396
+ this._url = {};
2397
+ this._nameService = {};
2398
+ this._useCustomSearch = false;
2399
+ this._responseNamesData = {};
2400
+ this._service = service;
2401
+ this._searchFields = searchFields;
2402
+ this._searchGridFields = searchGridFields || searchFields;
2403
+ this._lookupSeparator = separator;
2404
+ this.unsubscribe$ = new rxjs.Subject();
2405
+ this.verificaAtivo = verificaAtivo;
2406
+ }
2407
+ Object.defineProperty(Lookup.prototype, "searchFields", {
2408
+ get: function () {
2409
+ return this._searchFields;
2410
+ },
2411
+ enumerable: true,
2412
+ configurable: true
2413
+ });
2414
+ Object.defineProperty(Lookup.prototype, "searchGridFields", {
2415
+ get: function () {
2416
+ return this._searchGridFields;
2417
+ },
2418
+ enumerable: true,
2419
+ configurable: true
2420
+ });
2421
+ Object.defineProperty(Lookup.prototype, "searchGridData", {
2422
+ get: function () {
2423
+ return this._searchGridData;
2424
+ },
2425
+ enumerable: true,
2426
+ configurable: true
2427
+ });
2428
+ Object.defineProperty(Lookup.prototype, "lookupSuggestions", {
2429
+ get: function () {
2430
+ return this._lookupSuggestions;
2431
+ },
2432
+ enumerable: true,
2433
+ configurable: true
2434
+ });
2435
+ Object.defineProperty(Lookup.prototype, "searchTotalRecords", {
2436
+ get: function () {
2437
+ return this._searchTotalRecords;
2438
+ },
2439
+ enumerable: true,
2440
+ configurable: true
2441
+ });
2442
+ Object.defineProperty(Lookup.prototype, "lookupDisplayFields", {
2443
+ get: function () {
2444
+ return this._lookupDisplayFields;
2445
+ },
2446
+ enumerable: true,
2447
+ configurable: true
2448
+ });
2449
+ Object.defineProperty(Lookup.prototype, "advancedDisplayFields", {
2450
+ get: function () {
2451
+ return this._advancedDisplayFields;
2452
+ },
2453
+ enumerable: true,
2454
+ configurable: true
2455
+ });
2456
+ Lookup.prototype.setLookupDisplayFields = function (value) {
2457
+ this._lookupDisplayFields = value;
2458
+ return this;
2459
+ };
2460
+ Lookup.prototype.setAdvancedDisplayFields = function (value) {
2461
+ this._advancedDisplayFields = value;
2462
+ return this;
2463
+ };
2464
+ Lookup.prototype.setVariablesCustomSearch = function (value) {
2465
+ if (value === void 0) { value = {}; }
2466
+ this._params = value.params;
2467
+ this._url = value.url;
2468
+ this._nameService = value.nameService;
2469
+ this._customService = value.service;
2470
+ this._responseNamesData = value.responseNamesData;
2471
+ return this;
2472
+ };
2473
+ Lookup.prototype.lookupRequest = function (value, changeFilter) {
2474
+ var _this = this;
2475
+ var sort = this._lookupDisplayFields.map(function (field) { return ({ field: field, order: 1 }); });
2476
+ var filter = this._searchFields
2477
+ .filter(function (_a) {
2478
+ var type = _a.type;
2479
+ return isValidFilter$1(type, value);
2480
+ })
2481
+ .map(function (_a) {
2482
+ var name = _a.name, type = _a.type;
2483
+ if (typeof value == "number")
2484
+ return name + " eq " + value;
2485
+ else if (type == angularComponents.FieldType.Date)
2486
+ return name + " eq '" + moment$3(value).format("YYYY-MM-DD") + "'";
2487
+ else if (type == angularComponents.FieldType.Time)
2488
+ return name + " eq '" + moment$3(value).format("HH:mm:ss") + "'";
2489
+ else if (type == angularComponents.FieldType.DateTime)
2490
+ return name + " eq '" + moment$3(value).format() + "'";
2491
+ else if (type == angularComponents.FieldType.String)
2492
+ return "containing(lower(" + name + "), lower('" + value.replace(/'/g, "\\'") + "'))";
2493
+ else
2494
+ return name + " eq '" + value + "'";
2495
+ })
2496
+ .join(" or ");
2497
+ var displayFields = mergeUnique$1(this._lookupDisplayFields, this._advancedDisplayFields);
2498
+ var filterQuery = this.geradorFiltro(filter, changeFilter);
2499
+ this._service.list({ sort: sort, filterQuery: filterQuery, displayFields: displayFields })
2500
+ .pipe(operators.takeUntil(this.unsubscribe$))
2501
+ .pipe(operators.map(function (list) { return (__assign({}, list, { contents: list.contents.map(function (item) { return (__assign({}, item, { label: _this._lookupDisplayFields
2502
+ .map(function (field) {
2503
+ if (field.indexOf(".") > 0)
2504
+ return _this.getProp(item, field);
2505
+ return item[field];
2506
+ })
2507
+ .join(_this._lookupSeparator) })); }) })); }))
2508
+ .subscribe(function (list) { return _this._lookupSuggestions = list.contents; });
2509
+ };
2510
+ Lookup.prototype.searchRequest = function (event, changeFilter) {
2511
+ var _this = this;
2512
+ var first = event.first, rows = event.rows, multiSortMeta = event.multiSortMeta, filterData = event.filterData;
2513
+ var page = first / rows;
2514
+ var sort = multiSortMeta;
2515
+ var filter = this._searchGridFields
2516
+ .filter(function (_a) {
2517
+ var name = _a.name;
2518
+ return filterData[name] != undefined && filterData[name] != "";
2519
+ })
2520
+ .map(function (_a) {
2521
+ var name = _a.name, type = _a.type;
2522
+ var value = filterData[name];
2523
+ if (typeof value == "number")
2524
+ return name + " eq " + value;
2525
+ else if (type == angularComponents.FieldType.Date)
2526
+ return name + " eq '" + moment$3(value).format("YYYY-MM-DD") + "'";
2527
+ else if (type == angularComponents.FieldType.Time)
2528
+ return name + " eq '" + moment$3(value).format("HH:mm:ss") + "'";
2529
+ else if (type == angularComponents.FieldType.DateTime)
2530
+ return name + " eq '" + moment$3(value).format() + "'";
2531
+ else if (type == angularComponents.FieldType.Enum)
2532
+ return name + " eq '" + value + "'";
2533
+ else if (type == angularComponents.FieldType.String)
2534
+ return "containing(lower(" + name + "), lower('" + value.replace(/'/g, "\\'") + "'))";
2535
+ else if (type == angularComponents.FieldType.Lookup)
2536
+ return name + " eq '" + value.id + "'";
2537
+ else
2538
+ return name + " eq '" + value + "'";
2539
+ })
2540
+ .join(" and ");
2541
+ var displayFields = mergeUnique$1(this._lookupDisplayFields, this._advancedDisplayFields);
2542
+ var filterQuery = this.geradorFiltro(filter, changeFilter);
2543
+ this._service
2544
+ .list({ page: page, sort: sort, filterQuery: filterQuery, displayFields: displayFields })
2545
+ .pipe(operators.takeUntil(this.unsubscribe$))
2546
+ .pipe(operators.map(function (list) { return (__assign({}, list, { contents: list.contents.map(function (item) { return (__assign({}, item, { label: _this._lookupDisplayFields
2547
+ .map(function (field) {
2548
+ if (field.indexOf(".") > 0)
2549
+ return _this.getProp(item, field);
2550
+ return item[field];
2551
+ })
2552
+ .join(_this._lookupSeparator) })); }) })); }))
2553
+ .subscribe(function (list) {
2554
+ _this._searchGridData = list.contents;
2555
+ _this._searchTotalRecords = list.totalElements;
2556
+ });
2557
+ };
2558
+ Lookup.prototype.customLookupRequest = function (value) {
2559
+ var _this = this;
2560
+ this._params.descricao = value;
2561
+ this._customService[this._nameService](this._params, this._url)
2562
+ .pipe(operators.takeUntil(this.unsubscribe$))
2563
+ .pipe(operators.map(function (list) { return (__assign({}, list, { contents: list[_this._responseNamesData.contents].map(function (item) { return (__assign({}, item, { label: _this._lookupDisplayFields
2564
+ .map(function (field) {
2565
+ if (field.indexOf(".") > 0)
2566
+ return _this.getProp(item, field);
2567
+ return item[field];
2568
+ })
2569
+ .join(_this._lookupSeparator) })); }) })); }))
2570
+ .subscribe(function (list) { return _this._lookupSuggestions = list[_this._responseNamesData.contents]; });
2571
+ };
2572
+ Lookup.prototype.customSearchRequest = function (event) {
2573
+ var _this = this;
2574
+ var first = event.first, rows = event.rows, sortField = event.sortField, sortOrder = event.sortOrder, filterData = event.filterData;
2575
+ var filter = {
2576
+ plantaId: this._params.plantaId,
2577
+ page: first / rows,
2578
+ size: rows,
2579
+ sortField: sortField,
2580
+ sortOrder: sortOrder
2581
+ };
2582
+ var setSearchValues = function (e) { return e[0] && e[1] ? filter[e[0]] = e[1] : false; };
2583
+ Object.entries(filterData).filter(setSearchValues);
2584
+ this._customService[this._nameService](filter, this._url)
2585
+ .pipe(operators.takeUntil(this.unsubscribe$))
2586
+ .pipe(operators.map(function (list) { return (__assign({}, list, { contents: list[_this._responseNamesData.contents].map(function (item) { return (__assign({}, item, { label: _this._lookupDisplayFields
2587
+ .map(function (field) {
2588
+ if (field.indexOf(".") > 0)
2589
+ return _this.getProp(item, field);
2590
+ return item[field];
2591
+ })
2592
+ .join(_this._lookupSeparator) })); }) })); }))
2593
+ .subscribe(function (list) {
2594
+ _this._searchGridData = list[_this._responseNamesData.contents];
2595
+ _this._searchTotalRecords = list[_this._responseNamesData.totalElements];
2596
+ });
2597
+ };
2598
+ Lookup.prototype.getProp = function (obj, path) {
2599
+ return path.split(".").reduce(function (result, prop) { return (result[prop] === undefined ? "" : result[prop]); }, obj);
2600
+ };
2601
+ Lookup.prototype.geradorFiltro = function (filter, changeFilter) {
2602
+ var filterQuery = (filter ? "(" + filter + ")" : '');
2603
+ if (this.verificaAtivo) {
2604
+ filterQuery += filter ? "and ativo eq true" : "ativo eq true";
2605
+ }
2606
+ return filterQuery.concat("" + (changeFilter ? changeFilter(filter) : ""));
2607
+ };
2608
+ return Lookup;
2609
+ }());
2610
+
2611
+ var LobbyService = /** @class */ (function (_super) {
2612
+ __extends(LobbyService, _super);
2613
+ function LobbyService(http, messageService) {
2614
+ var _this = _super.call(this, http, messageService, "sam/lobby/entities/lobby") || this;
2615
+ _this.http = http;
2616
+ _this.messageService = messageService;
2617
+ return _this;
2618
+ }
2619
+ LobbyService.ngInjectableDef = core.defineInjectable({ factory: function LobbyService_Factory() { return new LobbyService(core.inject(http.HttpClient), core.inject(messageservice.MessageService)); }, token: LobbyService, providedIn: "root" });
2620
+ LobbyService = __decorate([
2621
+ core.Injectable({ providedIn: 'root' }),
2622
+ __metadata("design:paramtypes", [http.HttpClient, messageservice.MessageService])
2623
+ ], LobbyService);
2624
+ return LobbyService;
2625
+ }(EntityService));
2626
+
2627
+ var SchedulingVisitors = /** @class */ (function () {
2628
+ function SchedulingVisitors() {
2629
+ }
2630
+ return SchedulingVisitors;
2631
+ }());
2632
+
2633
+ var SchedulingDto = /** @class */ (function () {
2634
+ function SchedulingDto() {
2635
+ }
2636
+ return SchedulingDto;
2637
+ }());
2638
+
2639
+ var VisitSituation;
2640
+ (function (VisitSituation) {
2641
+ VisitSituation["PENDING"] = "PENDING";
2642
+ VisitSituation["IN_PROGRESS"] = "IN_PROGRESS";
2643
+ VisitSituation["FINISHED"] = "FINISHED";
2644
+ VisitSituation["NOT_OCCURRED"] = "NOT_OCCURRED";
2645
+ })(VisitSituation || (VisitSituation = {}));
2646
+
2647
+ var SchedulingComponent = /** @class */ (function () {
2648
+ function SchedulingComponent(fb, route, translate, messageService, lobbyService, schedulingService) {
2649
+ this.fb = fb;
2650
+ this.route = route;
2651
+ this.translate = translate;
2652
+ this.messageService = messageService;
2653
+ this.lobbyService = lobbyService;
2654
+ this.schedulingService = schedulingService;
2655
+ this.notSavedData = new core.EventEmitter();
2656
+ this.schedulingVisitors = new SchedulingVisitors();
2657
+ this.isFormModified = false;
2658
+ this.loading = false;
2659
+ this.localeConfig = {};
2660
+ this.ngUnsubscribe = new rxjs.Subject();
2661
+ }
2662
+ SchedulingComponent.prototype.ngOnInit = function () {
2663
+ var _this = this;
2664
+ this.createForm();
2665
+ this.portariaLookup = new Lookup(this.getLobbyFields(), this.lobbyService);
2666
+ this.route.data.pipe(operators.takeUntil(this.ngUnsubscribe)).subscribe(function (data) {
2667
+ _this.localeConfig = data.localeConfig;
2668
+ });
2669
+ var rs = new rxjs.ReplaySubject();
2670
+ rs.subscribe(function (isIntact) { return (_this.isFormModified = !isIntact); });
2671
+ };
2672
+ SchedulingComponent.prototype.ngAfterViewInit = function () {
2673
+ this.saveAndInitButton = document.getElementById('init');
2674
+ };
2675
+ SchedulingComponent.prototype.ngOnDestroy = function () {
2676
+ this.ngUnsubscribe.next();
2677
+ this.ngUnsubscribe.complete();
2678
+ };
2679
+ SchedulingComponent.prototype.ngOnChanges = function () {
2680
+ var _this = this;
2681
+ if (this.agenda.id) {
2682
+ this.loading = true;
2683
+ this.schedulingService
2684
+ .getSchedulingByYms(this.agenda.id)
2685
+ .pipe(operators.takeUntil(this.ngUnsubscribe), operators.finalize(function () { return (_this.loading = false); }))
2686
+ .subscribe(function (res) {
2687
+ if (res.scheduling) {
2688
+ var scheduling = res.scheduling;
2689
+ _this.schedulingVisitors.scheduling = scheduling;
2690
+ _this.schedulingVisitors.visitors = res.visitors;
2691
+ _this.formGroup.controls["motivoVisita"].setValue(scheduling.description);
2692
+ _this.formGroup.controls["dataSaida"].setValue(new Date(scheduling.expectedEndDate));
2693
+ _this.formGroup.controls["horaSaida"].setValue(new Date(scheduling.expectedEndDate));
2694
+ _this.getLobby(scheduling).subscribe(function (lobby) {
2695
+ return _this.formGroup.controls["portaria"].setValue(lobby);
2696
+ });
2697
+ }
2698
+ else {
2699
+ var dataSaida = new Date();
2700
+ dataSaida.setHours(new Date().getHours() + 1);
2701
+ _this.schedulingVisitors.scheduling = new SchedulingDto();
2702
+ _this.schedulingVisitors.visitors = [];
2703
+ _this.schedulingVisitors.scheduling.visitSituation = VisitSituation.PENDING;
2704
+ _this.schedulingVisitors.scheduling.description = _this.agenda.descricao;
2705
+ _this.schedulingVisitors.scheduling.expectedStartDate = new Date();
2706
+ _this.schedulingVisitors.scheduling.expectedEndDate = dataSaida;
2707
+ _this.formGroup.controls["motivoVisita"].setValue(_this.schedulingVisitors.scheduling.description);
2708
+ _this.formGroup.controls["dataSaida"].setValue(_this.schedulingVisitors.scheduling.expectedStartDate);
2709
+ _this.formGroup.controls["horaSaida"].setValue(_this.schedulingVisitors.scheduling.expectedEndDate);
2710
+ }
2711
+ });
2712
+ this.patchActualValue();
2713
+ }
2714
+ };
2715
+ SchedulingComponent.prototype.getLobby = function (scheduling) {
2716
+ return this.lobbyService.get(scheduling.lobbyIdSAM);
2717
+ };
2718
+ SchedulingComponent.prototype.patchActualValue = function () {
2719
+ var _this = this;
2720
+ var timeoutPatch = 500;
2721
+ setTimeout(function () {
2722
+ _this.actualValue = _this.formGroup.value;
2723
+ _this.formGroup.patchValue(_this.actualValue);
2724
+ }, timeoutPatch);
2725
+ };
2726
+ SchedulingComponent.prototype.onSave = function (start) {
2727
+ var _this = this;
2728
+ if (!this.agenda || !this.agenda.id) {
2729
+ this.messageService.add({
2730
+ severity: 'error',
2731
+ summary: 'Agenda não salva',
2732
+ detail: 'Salve a agenda antes de salvar informações do Ronda',
2733
+ });
2734
+ return;
2735
+ }
2736
+ if (this.formGroup.invalid) {
2737
+ this.validateAllFormFields(this.formGroup);
2738
+ return;
2739
+ }
2740
+ var scheduling = this.schedulingVisitors.scheduling;
2741
+ scheduling.idYMS = this.agenda.id;
2742
+ scheduling.description = this.formGroup.controls['motivoVisita'].value;
2743
+ scheduling.expectedStartDate = new Date();
2744
+ var dataSaida = this.formGroup.controls['dataSaida'].value;
2745
+ var horaSaida = this.formGroup.controls['horaSaida'].value;
2746
+ scheduling.expectedEndDate = this.getDate(dataSaida, horaSaida);
2747
+ var portaria = this.formGroup.controls['portaria'].value;
2748
+ if (portaria) {
2749
+ scheduling.lobbyIdSAM = portaria.id;
2750
+ }
2751
+ this.loading = true;
2752
+ this.schedulingService
2753
+ .saveScheduling(this.schedulingVisitors)
2754
+ .pipe(operators.takeUntil(this.ngUnsubscribe), operators.mergeMap(function (res) {
2755
+ if (start)
2756
+ return _this.schedulingService.startScheduling(_this.schedulingVisitors.scheduling.idYMS);
2757
+ _this.loading = false;
2758
+ return rxjs.NEVER;
2759
+ }), operators.finalize(function () { return (_this.loading = false); }))
2760
+ .subscribe(function (success) {
2761
+ if (success && _this.saveAndInitButton) {
2762
+ _this.saveAndInitButton.click();
2763
+ }
2764
+ _this.loading = false;
2765
+ });
2766
+ };
2767
+ SchedulingComponent.prototype.validateAllFormFields = function (formGroup) {
2768
+ var _this = this;
2769
+ Object.keys(formGroup.controls).forEach(function (field) {
2770
+ var control = formGroup.get(field);
2771
+ if (control instanceof forms.FormControl) {
2772
+ control.markAsDirty({ onlySelf: true });
2773
+ }
2774
+ else if (control instanceof forms.FormGroup) {
2775
+ _this.validateAllFormFields(control);
2776
+ }
2777
+ });
2778
+ };
2779
+ SchedulingComponent.prototype.getDate = function (data, hora) {
2780
+ return new Date(data.getFullYear(), data.getMonth(), data.getDate(), hora.getHours(), hora.getMinutes());
2781
+ };
2782
+ SchedulingComponent.prototype.reset = function () {
2783
+ this.formGroup.patchValue(__assign({}, this.actualValue));
2784
+ };
2785
+ SchedulingComponent.prototype.createForm = function () {
2786
+ this.formGroup = this.fb.group({
2787
+ motivoVisita: [undefined, forms.Validators.compose([forms.Validators.required])],
2788
+ portaria: [undefined, forms.Validators.compose([])],
2789
+ dataSaida: [undefined, forms.Validators.compose([forms.Validators.required])],
2790
+ horaSaida: [undefined, forms.Validators.compose([forms.Validators.required])],
2791
+ });
2792
+ };
2793
+ SchedulingComponent.prototype.getLobbyFields = function () {
2794
+ return [
2795
+ new angularComponents.FormField({
2796
+ name: "name",
2797
+ type: angularComponents.FieldType.String,
2798
+ label: this.translate.instant("yms.patio.sam_portaria_descricao"),
2799
+ }),
2800
+ ];
2801
+ };
2802
+ __decorate([
2803
+ core.Input(),
2804
+ __metadata("design:type", Object)
2805
+ ], SchedulingComponent.prototype, "agenda", void 0);
2806
+ __decorate([
2807
+ core.Output(),
2808
+ __metadata("design:type", core.EventEmitter)
2809
+ ], SchedulingComponent.prototype, "notSavedData", void 0);
2810
+ SchedulingComponent = __decorate([
2811
+ core.Component({
2812
+ selector: "scheduling",
2813
+ template: "<visited-info [agenda]=\"agenda\"> </visited-info>\r\n<form [formGroup]=\"formGroup\" *sLoadingState=\"loading\" novalidate>\r\n <div class=\"ui-fluid\">\r\n <div class=\"ui-g\">\r\n <div class=\"ui-g-12 ui-md-6 required\">\r\n <label for=\"motivoVisita\">{{ \"yms.patio.sam_motivo_visita\" | translate }}</label>\r\n <input\r\n type=\"text\"\r\n id=\"motivoVisita\"\r\n name=\"motivoVisita\"\r\n pInputText\r\n formControlName=\"motivoVisita\"\r\n autocomplete=\"off\"\r\n />\r\n <s-control-errors\r\n [control]=\"formGroup.controls['motivoVisita']\"\r\n [errorMessages]=\"{ required: 'error_required' | translate }\"\r\n >\r\n </s-control-errors>\r\n </div>\r\n <div class=\"ui-g-12 ui-md-6\">\r\n <label for=\"portaria\">{{ \"yms.patio.sam_portaria\" | translate }}</label>\r\n <s-lookup\r\n dataKey=\"id\"\r\n id=\"portaria\"\r\n name=\"portaria\"\r\n formControlName=\"portaria\"\r\n lookupDisplayField=\"name\"\r\n [multiple]=\"false\"\r\n (onLookupRequest)=\"portariaLookup.lookupRequest($event)\"\r\n (onSearchRequest)=\"portariaLookup.searchRequest($event)\"\r\n [searchTitle]=\"'yms.patio.sam_portaria' | translate\"\r\n [searchEmptyTitle]=\"'nothing_found' | translate\"\r\n [searchFields]=\"portariaLookup.searchFields\"\r\n [searchGridFields]=\"portariaLookup.searchGridFields\"\r\n [searchGridData]=\"portariaLookup.searchGridData\"\r\n [searchTotalRecords]=\"portariaLookup.searchTotalRecords\"\r\n [searchTotalRecordsLabel]=\"\r\n 'total_records' | translate : { value: portariaLookup.searchTotalRecords }\r\n \"\r\n >\r\n </s-lookup>\r\n <s-control-errors\r\n [control]=\"formGroup.controls['portaria']\"\r\n [errorMessages]=\"{ required: 'error_required' | translate }\"\r\n >\r\n </s-control-errors>\r\n </div>\r\n <div class=\"ui-g-6 ui-md-3 required\">\r\n <label for=\"dataSaida\">{{ \"yms.patio.sam_data_saida\" | translate }}</label>\r\n <p-calendar\r\n id=\"dataSaida\"\r\n name=\"dataSaida\"\r\n formControlName=\"dataSaida\"\r\n inputId=\"dataSaida\"\r\n [showIcon]=\"true\"\r\n [locale]=\"localeConfig.calendar\"\r\n [dateFormat]=\"localeConfig.calendar.dateFormat\"\r\n >\r\n </p-calendar>\r\n <s-control-errors\r\n [control]=\"formGroup.controls['dataSaida']\"\r\n [errorMessages]=\"{ required: 'error_required' | translate }\"\r\n >\r\n </s-control-errors>\r\n </div>\r\n <div class=\"ui-g-6 ui-md-3 required\">\r\n <label for=\"horaSaida\">{{ \"yms.patio.sam_hora_saida\" | translate }}</label>\r\n <p-calendar\r\n id=\"horaSaida\"\r\n name=\"horaSaida\"\r\n formControlName=\"horaSaida\"\r\n [locale]=\"localeConfig.calendar\"\r\n inputId=\"horaSaida\"\r\n [showTime]=\"true\"\r\n [hourFormat]=\"localeConfig.calendar.hourFormat\"\r\n [timeOnly]=\"true\"\r\n >\r\n </p-calendar>\r\n <s-control-errors\r\n [control]=\"formGroup.controls['horaSaida']\"\r\n [errorMessages]=\"{ required: 'error_required' | translate }\"\r\n >\r\n </s-control-errors>\r\n </div>\r\n </div>\r\n </div>\r\n</form>\r\n<div class=\"separator\"></div>\r\n<div *ngIf=\"schedulingVisitors.visitors\">\r\n <visitante-component [motorista]=\"agenda.motorista\" [(visitors)]=\"schedulingVisitors.visitors\"></visitante-component>\r\n</div>\r\n<div class=\"separator\"></div>\r\n<div style=\"margin-top: 10px\">\r\n <s-button priority=\"primary\" [label]=\"'save' | translate\" (onClick)=\"onSave()\"\r\n [disabled]=\"loading\"></s-button>\r\n <s-button *ngIf=\"saveAndInitButton\" priority=\"primary\" [label]=\"'save_and_init' | translate\" (onClick)=\"onSave(true)\"\r\n [disabled]=\"loading\"></s-button>\r\n \r\n</div>\r\n"
2814
+ }),
2815
+ __metadata("design:paramtypes", [forms.FormBuilder,
2816
+ router.ActivatedRoute,
2817
+ core$1.TranslateService,
2818
+ messageservice.MessageService,
2819
+ LobbyService,
2820
+ SchedulingService])
2821
+ ], SchedulingComponent);
2822
+ return SchedulingComponent;
2823
+ }());
2824
+
2825
+ var SamSeniorModule = /** @class */ (function () {
2826
+ function SamSeniorModule(dispatcher) {
2827
+ this.dispatcher = dispatcher;
2828
+ this._dispatcher = dispatcher;
2829
+ this._dispatcher.dispatch(FormSamComponent);
2830
+ }
2831
+ SamSeniorModule = __decorate([
2832
+ core.NgModule({
2833
+ declarations: [FormSamComponent, VisitedInfoComponent, SchedulingComponent, VisitanteComponent, VisitanteFormComponent, CredencialFormComponent],
2834
+ entryComponents: [FormSamComponent, VisitedInfoComponent, SchedulingComponent, VisitanteComponent, VisitanteFormComponent, CredencialFormComponent],
2835
+ exports: [FormSamComponent, VisitedInfoComponent, SchedulingComponent],
2836
+ imports: [ymsRoutines.IntegrationModule,
2837
+ common.CommonModule,
2838
+ core$1.TranslateModule,
2839
+ forms.FormsModule,
2840
+ angularComponents.ButtonModule,
2841
+ primeng.SharedModule,
2842
+ primeng.CardModule,
2843
+ button.ButtonModule,
2844
+ forms.ReactiveFormsModule,
2845
+ shared.SharedModule,
2846
+ angularComponents.CustomFieldsModule,
2847
+ angularComponents.ControlErrorsModule,
2848
+ primeng.DialogModule,
2849
+ angularComponents.EmptyStateModule,
2850
+ angularComponents.DynamicFormModule,
2851
+ angularComponents.TokenListModule,
2852
+ primeng.PanelModule,
2853
+ primeng.InputTextModule,
2854
+ primeng.DropdownModule,
2855
+ angularComponents.ButtonModule,
2856
+ angularComponents.LoadingStateModule,
2857
+ angularComponents.NumberInputModule,
2858
+ primeng.ConfirmDialogModule,
2859
+ angularComponents.LocaleModule,
2860
+ platformComponents.PermissionsModule,
2861
+ dynamicdialog.DynamicDialogModule,
2862
+ table.TableModule,
2863
+ primeng.TabViewModule,
2864
+ angularComponents.LoadingStateModule,
2865
+ primeng.CalendarModule,
2866
+ ],
2867
+ providers: [
2868
+ FieldCustomizationService,
2869
+ FocusService
2870
+ ]
2871
+ }),
2872
+ __metadata("design:paramtypes", [ymsRoutines.IntegrationDispatcher])
2873
+ ], SamSeniorModule);
2874
+ return SamSeniorModule;
2875
+ }());
2876
+
2877
+ var VisitorListService = /** @class */ (function (_super) {
2878
+ __extends(VisitorListService, _super);
2879
+ function VisitorListService(http, messageService) {
2880
+ var _this = _super.call(this, messageService) || this;
2881
+ _this.http = http;
2882
+ _this.messageService = messageService;
2883
+ _this.domainService = "yms_int/sam";
2884
+ return _this;
2885
+ }
2886
+ VisitorListService.prototype.findVisitors = function (agendaIdYMS) {
2887
+ return this.http.post("yms_int/sam/queries/findVisitorsBySchedulingIdYMS", { agendaIdYMS: agendaIdYMS });
2888
+ };
2889
+ VisitorListService.ngInjectableDef = core.defineInjectable({ factory: function VisitorListService_Factory() { return new VisitorListService(core.inject(http.HttpClient), core.inject(messageservice.MessageService)); }, token: VisitorListService, providedIn: "root" });
2890
+ VisitorListService = __decorate([
2891
+ core.Injectable({ providedIn: 'root' }),
2892
+ __metadata("design:paramtypes", [http.HttpClient, messageservice.MessageService])
2893
+ ], VisitorListService);
2894
+ return VisitorListService;
2895
+ }(Service));
2896
+
2897
+ var VisitorListDescritor = /** @class */ (function () {
2898
+ function VisitorListDescritor() {
2899
+ }
2900
+ VisitorListDescritor = __decorate([
2901
+ ymsRoutines.ControleCircuito({
2902
+ header: 'Ronda',
2903
+ name: 'yms.integracao.sam'
2904
+ }),
2905
+ ymsRoutines.ControleOperacao({
2906
+ header: 'Ronda',
2907
+ name: 'yms.integracao.sam'
2908
+ })
2909
+ ], VisitorListDescritor);
2910
+ return VisitorListDescritor;
2911
+ }());
2912
+ var VisitorListComponent = /** @class */ (function (_super) {
2913
+ __extends(VisitorListComponent, _super);
2914
+ function VisitorListComponent(service) {
2915
+ var _this = _super.call(this) || this;
2916
+ _this.service = service;
2917
+ _this.ngUnsubscribe = new rxjs.Subject();
2918
+ _this.visitorService = service;
2919
+ return _this;
2920
+ }
2921
+ VisitorListComponent.prototype.ngOnInit = function () {
2922
+ // nada por enquanto
2923
+ };
2924
+ VisitorListComponent.prototype.ngAfterContentInit = function () {
2925
+ var _this = this;
2926
+ this.visitorService
2927
+ .findVisitors(this.agenda.id)
2928
+ .pipe(operators.takeUntil(this.ngUnsubscribe))
2929
+ .subscribe(function (response) {
2930
+ if (response.visitors.length) {
2931
+ _this.visitors = response.visitors;
2932
+ }
2933
+ });
2934
+ };
2935
+ VisitorListComponent.prototype.credentialResume = function (credentials) {
2936
+ var e_1, _a;
2937
+ var label = "";
2938
+ try {
2939
+ for (var credentials_1 = __values(credentials), credentials_1_1 = credentials_1.next(); !credentials_1_1.done; credentials_1_1 = credentials_1.next()) {
2940
+ var item = credentials_1_1.value;
2941
+ if (item.cardNumber) {
2942
+ label = label + item.cardNumber;
2943
+ }
2944
+ else {
2945
+ label = label + " - ";
2946
+ }
2947
+ }
2948
+ }
2949
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
2950
+ finally {
2951
+ try {
2952
+ if (credentials_1_1 && !credentials_1_1.done && (_a = credentials_1.return)) _a.call(credentials_1);
2953
+ }
2954
+ finally { if (e_1) throw e_1.error; }
2955
+ }
2956
+ return label;
2957
+ };
2958
+ __decorate([
2959
+ core.Input(),
2960
+ __metadata("design:type", Object)
2961
+ ], VisitorListComponent.prototype, "agenda", void 0);
2962
+ VisitorListComponent = __decorate([
2963
+ core.Component({
2964
+ selector: "visitor-list-component",
2965
+ template: "\n<div> \n <p-table [value]=\"visitors\">\n <ng-template pTemplate=\"header\">\n <tr>\n <th id=\"visitor_name\">{{'yms.patio.motorista_visitante_nome' | translate}}</th>\n <th id=\"visitor_docuemnt\">{{'yms.patio.motorista_visitante_documento' | translate}}</th> \n <th id=\"visitor_credential\">{{'yms.patio.motorista_visitante_credenciais' | translate}}</th>\n <th id=\"visitor_contact\">{{'yms.patio.motorista_visitante_contato' | translate}}</th>\n </tr>\n </ng-template>\n <ng-template let-rowData pTemplate=\"body\">\n <tr>\n <td id=\"\">{{rowData.visitor.name}}</td>\n <td id=\"\">{{rowData.visitor.document}}</td>\n <td id=\"\">{{credentialResume(rowData.credentialCards)}} </td>\n <td id=\"\">{{rowData.visitor.contact}}</td>\n </tr>\n </ng-template>\n </p-table>\n</div>"
2966
+ }),
2967
+ __metadata("design:paramtypes", [VisitorListService])
2968
+ ], VisitorListComponent);
2969
+ return VisitorListComponent;
2970
+ }(VisitorListDescritor));
2971
+
2972
+ var VisitorListModule = /** @class */ (function () {
2973
+ function VisitorListModule(dispatcher) {
2974
+ this.dispatcher = dispatcher;
2975
+ this.dispatcher.dispatch(VisitorListComponent);
2976
+ }
2977
+ VisitorListModule = __decorate([
2978
+ core.NgModule({
2979
+ imports: [
2980
+ common.CommonModule,
2981
+ table.TableModule,
2982
+ message.MessageModule,
2983
+ core$1.TranslateModule,
2984
+ angularComponents.LoadingStateModule,
2985
+ ],
2986
+ declarations: [VisitorListComponent],
2987
+ entryComponents: [VisitorListComponent],
2988
+ exports: [VisitorListComponent],
2989
+ providers: [
2990
+ VisitorListService
2991
+ ]
2992
+ }),
2993
+ __metadata("design:paramtypes", [ymsRoutines.IntegrationDispatcher])
2994
+ ], VisitorListModule);
2995
+ return VisitorListModule;
2996
+ }());
2997
+
2998
+ var EntityService$1 = /** @class */ (function () {
1247
2999
  function EntityService(http, messageService, entityUrl, actionsUrl) {
1248
3000
  this.http = http;
1249
3001
  this.messageService = messageService;
@@ -1371,7 +3123,7 @@
1371
3123
  messageservice.MessageService, Object])
1372
3124
  ], AgendaService);
1373
3125
  return AgendaService;
1374
- }(EntityService));
3126
+ }(EntityService$1));
1375
3127
 
1376
3128
  /*{CA:PROJECT_IMPORTS:START}*/
1377
3129
  /*{CA:PROJECT_IMPORTS:END}*/
@@ -1400,7 +3152,7 @@
1400
3152
  messageservice.MessageService, Object])
1401
3153
  ], RecebimentoContratoService);
1402
3154
  return RecebimentoContratoService;
1403
- }(EntityService));
3155
+ }(EntityService$1));
1404
3156
 
1405
3157
  var RecebimentoChegadaVeiculoOverride = /** @class */ (function () {
1406
3158
  function RecebimentoChegadaVeiculoOverride(override, agendaService, recebimentoService) {
@@ -1464,7 +3216,7 @@
1464
3216
  __metadata("design:paramtypes", [http.HttpClient, api.MessageService, Object])
1465
3217
  ], ExpedicaoService);
1466
3218
  return ExpedicaoService;
1467
- }(EntityService));
3219
+ }(EntityService$1));
1468
3220
 
1469
3221
  var ExpedicaoChegadaVeiculoOverride = /** @class */ (function () {
1470
3222
  function ExpedicaoChegadaVeiculoOverride(override, agendaService, expedicaoService) {
@@ -1648,87 +3400,6 @@
1648
3400
  return InfoComponent;
1649
3401
  }(InfoDescritor));
1650
3402
 
1651
- var FieldCustomizationService = /** @class */ (function () {
1652
- function FieldCustomizationService(http, messageService) {
1653
- this.http = http;
1654
- this.messageService = messageService;
1655
- this.http = http;
1656
- this.messageService = messageService;
1657
- this.defaultCatch = this.defaultCatch.bind(this);
1658
- }
1659
- FieldCustomizationService.prototype.commitFiles = function (objects) {
1660
- return this.http.post("platform/field_customization/actions/commitObject", { objects: objects }).pipe(this.defaultCatch());
1661
- };
1662
- FieldCustomizationService.prototype.deleteFiles = function (objects) {
1663
- return this.http.post("platform/field_customization/actions/deleteObjects", objects).pipe(this.defaultCatch());
1664
- };
1665
- FieldCustomizationService.prototype.getFiles = function (formGroup) {
1666
- var _this = this;
1667
- var fieldCustomization = [];
1668
- if (formGroup.value.custom) {
1669
- fieldCustomization = formGroup.value.custom.fieldCustomization || [];
1670
- delete formGroup.value.custom.fieldCustomization;
1671
- }
1672
- var filesToCommit = [];
1673
- var filesToDelete = {};
1674
- fieldCustomization.forEach(function (_a) {
1675
- var domain = _a.domain, service = _a.service, entity = _a.entity, toDelete = _a.toDelete, toInsert = _a.toInsert;
1676
- if (!_this.isEmpty(toInsert)) {
1677
- var files = Object.keys(toInsert).map(function (key) {
1678
- var version = toInsert[key].version;
1679
- var fileName = toInsert[key].name;
1680
- var objectId = toInsert[key].objectId;
1681
- return { version: version, fileName: fileName, objectId: objectId };
1682
- });
1683
- if (!_this.isEmpty(files)) {
1684
- filesToCommit.push.apply(filesToCommit, __spread(files));
1685
- }
1686
- }
1687
- if (!_this.isEmpty(toDelete)) {
1688
- var objects_1 = [];
1689
- Object.keys(toDelete).forEach(function (key) {
1690
- var fields = toDelete[key] || [];
1691
- var files = fields.map(function (file) {
1692
- return {
1693
- field: key,
1694
- objectId: file,
1695
- };
1696
- });
1697
- objects_1.push.apply(objects_1, __spread(files));
1698
- });
1699
- filesToDelete = { domain: domain, service: service, entityName: entity, objects: objects_1 };
1700
- }
1701
- });
1702
- return { filesToCommit: filesToCommit, filesToDelete: filesToDelete };
1703
- };
1704
- FieldCustomizationService.prototype.isEmpty = function (object) {
1705
- if (Array.isArray(object)) {
1706
- return object.length === 0;
1707
- }
1708
- return Object.entries(object).length === 0 && object.constructor === Object;
1709
- };
1710
- FieldCustomizationService.prototype.defaultCatch = function () {
1711
- var _this = this;
1712
- return operators.catchError(function (err) {
1713
- if (err) {
1714
- var summary = err.status ? String(err.status) : "Error";
1715
- var detail = (err.error && err.error.message) || err.statusText || err.message || "Error";
1716
- _this.messageService.add({
1717
- severity: "error",
1718
- summary: summary,
1719
- detail: detail,
1720
- });
1721
- }
1722
- return rxjs.throwError(err);
1723
- });
1724
- };
1725
- FieldCustomizationService = __decorate([
1726
- core.Injectable(),
1727
- __metadata("design:paramtypes", [http.HttpClient, messageservice.MessageService])
1728
- ], FieldCustomizationService);
1729
- return FieldCustomizationService;
1730
- }());
1731
-
1732
3403
  var VerificaNotafiscal = /** @class */ (function () {
1733
3404
  function VerificaNotafiscal(messageService, translate) {
1734
3405
  this.messageService = messageService;
@@ -1792,161 +3463,9 @@
1792
3463
  messageservice.MessageService, Object])
1793
3464
  ], OrdemCompraService);
1794
3465
  return OrdemCompraService;
1795
- }(EntityService));
1796
-
1797
- var numberTypes = [angularComponents.FieldType.Integer, angularComponents.FieldType.Double];
1798
- var numberPattern = /^\d+\b$/;
1799
- var mergeUnique = function (array, otherArray) {
1800
- return array.concat(otherArray.filter(function (item) { return !array.includes(item); }));
1801
- };
1802
- var isValidFilter = function (type, value) {
1803
- var _a = getTypeInformation(type, value), isValidValue = _a.isValidValue, typeExists = _a.typeExists;
1804
- return !(typeExists && !isValidValue);
1805
- };
1806
- var getTypeInformation = function (type, value) {
1807
- switch (type) {
1808
- case angularComponents.FieldType.Time:
1809
- case angularComponents.FieldType.Date:
1810
- case angularComponents.FieldType.DateTime:
1811
- return { isValidValue: false, typeExists: true };
1812
- case angularComponents.FieldType.Integer:
1813
- case angularComponents.FieldType.Double:
1814
- return {
1815
- isValidValue: value.match(numberPattern),
1816
- typeExists: numberTypes.includes(type),
1817
- };
1818
- default:
1819
- return {
1820
- isValidValue: value.match(numberPattern),
1821
- typeExists: numberTypes.includes(type),
1822
- };
1823
- }
1824
- };
1825
- var userCanVisualize = function (formGroup, allPermissions) {
1826
- return (Object.keys(formGroup.controls).filter(function (field) {
1827
- var errors = formGroup.get(field).errors ? formGroup.get(field).errors.required : formGroup.get(field).errors;
1828
- return allPermissions[field] && !allPermissions[field].visualizar && errors;
1829
- }).length === 0);
1830
- };
1831
- var getProp = function (obj, path) {
1832
- return path.split(".").reduce(function (result, prop) { return (result[prop] === undefined ? "" : result[prop]); }, obj);
1833
- };
1834
- var dialogConfig = {
1835
- style: {
1836
- "display": "flex",
1837
- "flex-direction": "column",
1838
- },
1839
- height: "80%",
1840
- styleClass: "ui-g-12 ui-md-4",
1841
- contentStyle: {
1842
- "overflow-y": "auto",
1843
- "height": "auto",
1844
- "max-height": "none",
1845
- "margin-bottom": "0",
1846
- "flex": 1
1847
- },
1848
- };
1849
-
1850
- var moment = _moment;
1851
- function getLookupLabel(data, fields, separator, translation) {
1852
- if (data === void 0) { data = {}; }
1853
- if (fields === void 0) { fields = []; }
1854
- var concatenateLabelsLookup = function (texto) {
1855
- var splitedLabel = texto.split('-');
1856
- var concatenate = function (p, c) {
1857
- if (p === void 0) { p = ' '; }
1858
- if (c === void 0) { c = ' '; }
1859
- if (p.trim() && c.trim())
1860
- return p + " - " + c;
1861
- if (p.trim() && !c.trim())
1862
- return "" + p;
1863
- if (!p.trim() && c.trim())
1864
- return "" + c;
1865
- };
1866
- return splitedLabel.reduce(concatenate);
1867
- };
1868
- return concatenateLabelsLookup(fields.map(function (field) {
1869
- if (field.indexOf(".") > 0)
1870
- return getProp(data, field);
1871
- return data[field];
1872
- }).join(separator))
1873
- || (translation ? 'yms.erp.sem_descricao' : ' - ');
1874
- }
1875
- var onLookupRequest = function (searchFields, lookupDisplayFields, advancedDisplayFields, lookupSeparator, service, value, customFilter) {
1876
- if (customFilter === void 0) { customFilter = ''; }
1877
- var sort = lookupDisplayFields.map(function (field) { return ({ field: field, order: 1 }); });
1878
- var filterQuery = (searchFields)
1879
- .filter(function (_a) {
1880
- var type = _a.type;
1881
- return isValidFilter(type, value);
1882
- })
1883
- .map(function (_a) {
1884
- var name = _a.name, type = _a.type;
1885
- if (typeof value == "number" || type === angularComponents.FieldType.Integer)
1886
- return name + " eq " + value;
1887
- else if (type == angularComponents.FieldType.Date)
1888
- return name + " eq '" + moment(value).format("YYYY-MM-DD") + "'";
1889
- else if (type == angularComponents.FieldType.Time)
1890
- return name + " eq '" + moment(value).format("HH:mm:ss") + "'";
1891
- else if (type == angularComponents.FieldType.DateTime)
1892
- return name + " eq '" + moment(value).format() + "'";
1893
- else if (type == angularComponents.FieldType.String)
1894
- return "containing(lower(" + name + "), lower('" + value.replace(/'/g, "\\'") + "'))";
1895
- else
1896
- return name + " eq '" + value + "'";
1897
- })
1898
- .join(" or ");
1899
- if (customFilter && customFilter.trim()) {
1900
- filterQuery = filterQuery ? "(" + filterQuery + ") and " + customFilter : customFilter;
1901
- }
1902
- var displayFields = mergeUnique(lookupDisplayFields, advancedDisplayFields);
1903
- return service
1904
- .list({ sort: sort, filterQuery: filterQuery, displayFields: displayFields })
1905
- .pipe(operators.map(function (list) { return (__assign({}, list, { contents: list.contents.map(function (item) { return (__assign({}, item, { label: getLookupLabel(item, lookupDisplayFields, lookupSeparator) })); }) })); }));
1906
- };
1907
- var onSearchRequest = function (searchFields, lookupDisplayFields, advancedDisplayFields, lookupSeparator, service, event, customFilter) {
1908
- if (customFilter === void 0) { customFilter = ''; }
1909
- var first = event.first, rows = event.rows, multiSortMeta = event.multiSortMeta, filterData = event.filterData;
1910
- var page = first / rows;
1911
- var sort = multiSortMeta;
1912
- var filterQuery = searchFields
1913
- .filter(function (_a) {
1914
- var name = _a.name;
1915
- return filterData[name] != undefined && filterData[name] != "";
1916
- })
1917
- .map(function (_a) {
1918
- var name = _a.name, type = _a.type;
1919
- var value = filterData[name];
1920
- if (typeof value == "number" || type === angularComponents.FieldType.Integer)
1921
- return name + " eq " + value;
1922
- else if (type == angularComponents.FieldType.Date)
1923
- return name + " eq '" + moment(value).format("YYYY-MM-DD") + "'";
1924
- else if (type == angularComponents.FieldType.Time)
1925
- return name + " eq '" + moment(value).format("HH:mm:ss") + "'";
1926
- else if (type == angularComponents.FieldType.DateTime)
1927
- return name + " eq '" + moment(value).format() + "'";
1928
- else if (type == angularComponents.FieldType.Enum)
1929
- return name + " eq '" + value + "'";
1930
- else if (type == angularComponents.FieldType.Lookup)
1931
- return name + " eq '" + value.id + "'";
1932
- else if (type == angularComponents.FieldType.String && name.indexOf('.') !== -1) {
1933
- return "containing(" + name + ", '" + value.replace(/'/g, "\\'") + "')";
1934
- }
1935
- else if (type == angularComponents.FieldType.String && name.indexOf('.') === -1) {
1936
- return "containing(lower(" + name + "),lower('" + value.replace(/'/g, "\\'") + "'))";
1937
- }
1938
- else
1939
- return name + " eq '" + value + "'";
1940
- })
1941
- .join(" and ");
1942
- filterQuery = customFilter && customFilter.trim() ? filterQuery.concat(filterQuery ? ' and ' : '').concat(customFilter) : filterQuery;
1943
- var displayFields = mergeUnique(lookupDisplayFields, advancedDisplayFields);
1944
- return service
1945
- .list({ page: page, sort: sort, filterQuery: filterQuery, displayFields: displayFields })
1946
- .pipe(operators.map(function (list) { return (__assign({}, list, { contents: list.contents.map(function (item) { return (__assign({}, item, { label: getLookupLabel(item, lookupDisplayFields, lookupSeparator) })); }) })); }));
1947
- };
3466
+ }(EntityService$1));
1948
3467
 
1949
- var moment$1 = _moment;
3468
+ var moment$4 = _moment;
1950
3469
  /*{CA:PROJECT_IMPORTS:END}*/
1951
3470
  var Empresa = /** @class */ (function () {
1952
3471
  function Empresa() {
@@ -1955,8 +3474,8 @@
1955
3474
  /*{CA:CLASS_ATTRIBUTES:END}*/
1956
3475
  Empresa.fromDto = function (empresaDto, originEntity) {
1957
3476
  var model = __assign({}, empresaDto);
1958
- model.createdDate = model.createdDate && moment$1(model.createdDate).toDate();
1959
- model.lastModifiedDate = model.lastModifiedDate && moment$1(model.lastModifiedDate).toDate();
3477
+ model.createdDate = model.createdDate && moment$4(model.createdDate).toDate();
3478
+ model.lastModifiedDate = model.lastModifiedDate && moment$4(model.lastModifiedDate).toDate();
1960
3479
  var lookupSeparator = " - ";
1961
3480
  var displayFields = [
1962
3481
  "codigo",
@@ -1968,8 +3487,8 @@
1968
3487
  };
1969
3488
  Empresa.toDto = function (empresa, originEntity) {
1970
3489
  var dto = __assign({}, empresa);
1971
- dto.createdDate = dto.createdDate && moment$1(dto.createdDate).format();
1972
- dto.lastModifiedDate = dto.lastModifiedDate && moment$1(dto.lastModifiedDate).format();
3490
+ dto.createdDate = dto.createdDate && moment$4(dto.createdDate).format();
3491
+ dto.lastModifiedDate = dto.lastModifiedDate && moment$4(dto.lastModifiedDate).format();
1973
3492
  delete dto.label;
1974
3493
  return dto;
1975
3494
  };
@@ -1978,7 +3497,7 @@
1978
3497
  /*{CA:FILE_CONTENTS:START}*/
1979
3498
  /*{CA:FILE_CONTENTS:END}*/
1980
3499
 
1981
- var moment$2 = _moment;
3500
+ var moment$5 = _moment;
1982
3501
  /*{CA:PROJECT_IMPORTS:START}*/
1983
3502
  /*{CA:PROJECT_IMPORTS:END}*/
1984
3503
  var Pessoa = /** @class */ (function () {
@@ -1988,8 +3507,8 @@
1988
3507
  /*{CA:CLASS_ATTRIBUTES:END}*/
1989
3508
  Pessoa.fromDto = function (pessoaDto, originEntity) {
1990
3509
  var model = __assign({}, pessoaDto);
1991
- model.createdDate = model.createdDate && moment$2(model.createdDate).toDate();
1992
- model.lastModifiedDate = model.lastModifiedDate && moment$2(model.lastModifiedDate).toDate();
3510
+ model.createdDate = model.createdDate && moment$5(model.createdDate).toDate();
3511
+ model.lastModifiedDate = model.lastModifiedDate && moment$5(model.lastModifiedDate).toDate();
1993
3512
  var lookupSeparator = " - ";
1994
3513
  var displayFields = [
1995
3514
  "codigo",
@@ -2001,8 +3520,8 @@
2001
3520
  };
2002
3521
  Pessoa.toDto = function (pessoa, originEntity) {
2003
3522
  var dto = __assign({}, pessoa);
2004
- dto.createdDate = dto.createdDate && moment$2(dto.createdDate).format();
2005
- dto.lastModifiedDate = dto.lastModifiedDate && moment$2(dto.lastModifiedDate).format();
3523
+ dto.createdDate = dto.createdDate && moment$5(dto.createdDate).format();
3524
+ dto.lastModifiedDate = dto.lastModifiedDate && moment$5(dto.lastModifiedDate).format();
2006
3525
  delete dto.label;
2007
3526
  return dto;
2008
3527
  };
@@ -2011,7 +3530,7 @@
2011
3530
  /*{CA:FILE_CONTENTS:START}*/
2012
3531
  /*{CA:FILE_CONTENTS:END}*/
2013
3532
 
2014
- var moment$3 = _moment;
3533
+ var moment$6 = _moment;
2015
3534
  /*{CA:PROJECT_IMPORTS:START}*/
2016
3535
  /*{CA:PROJECT_IMPORTS:END}*/
2017
3536
  var PessoaJuridica = /** @class */ (function () {
@@ -2021,8 +3540,8 @@
2021
3540
  /*{CA:CLASS_ATTRIBUTES:END}*/
2022
3541
  PessoaJuridica.fromDto = function (pessoaJuridicaDto, originEntity) {
2023
3542
  var model = __assign({}, pessoaJuridicaDto);
2024
- model.createdDate = model.createdDate && moment$3(model.createdDate).toDate();
2025
- model.lastModifiedDate = model.lastModifiedDate && moment$3(model.lastModifiedDate).toDate();
3543
+ model.createdDate = model.createdDate && moment$6(model.createdDate).toDate();
3544
+ model.lastModifiedDate = model.lastModifiedDate && moment$6(model.lastModifiedDate).toDate();
2026
3545
  var lookupSeparator = " - ";
2027
3546
  var displayFields = [
2028
3547
  "id",
@@ -2049,8 +3568,8 @@
2049
3568
  };
2050
3569
  PessoaJuridica.toDto = function (pessoaJuridica, originEntity) {
2051
3570
  var dto = __assign({}, pessoaJuridica);
2052
- dto.createdDate = dto.createdDate && moment$3(dto.createdDate).format();
2053
- dto.lastModifiedDate = dto.lastModifiedDate && moment$3(dto.lastModifiedDate).format();
3571
+ dto.createdDate = dto.createdDate && moment$6(dto.createdDate).format();
3572
+ dto.lastModifiedDate = dto.lastModifiedDate && moment$6(dto.lastModifiedDate).format();
2054
3573
  delete dto.label;
2055
3574
  if (originEntity !== "Pessoa" && dto.pessoa)
2056
3575
  dto.pessoa = Pessoa.toDto(dto.pessoa, "PessoaJuridica");
@@ -2061,7 +3580,7 @@
2061
3580
  /*{CA:FILE_CONTENTS:START}*/
2062
3581
  /*{CA:FILE_CONTENTS:END}*/
2063
3582
 
2064
- var moment$4 = _moment;
3583
+ var moment$7 = _moment;
2065
3584
  /*{CA:PROJECT_IMPORTS:START}*/
2066
3585
  /*{CA:PROJECT_IMPORTS:END}*/
2067
3586
  var Pais = /** @class */ (function () {
@@ -2071,8 +3590,8 @@
2071
3590
  /*{CA:CLASS_ATTRIBUTES:END}*/
2072
3591
  Pais.fromDto = function (paisDto, originEntity) {
2073
3592
  var model = __assign({}, paisDto);
2074
- model.createdDate = model.createdDate && moment$4(model.createdDate).toDate();
2075
- model.lastModifiedDate = model.lastModifiedDate && moment$4(model.lastModifiedDate).toDate();
3593
+ model.createdDate = model.createdDate && moment$7(model.createdDate).toDate();
3594
+ model.lastModifiedDate = model.lastModifiedDate && moment$7(model.lastModifiedDate).toDate();
2076
3595
  var lookupSeparator = " - ";
2077
3596
  var displayFields = ["id", "codigo", "descricao", "createdBy", "createdDate", "lastModifiedBy", "lastModifiedDate"];
2078
3597
  model.label = displayFields.map(function (field) { return model[field]; }).join(lookupSeparator);
@@ -2080,8 +3599,8 @@
2080
3599
  };
2081
3600
  Pais.toDto = function (pais, originEntity) {
2082
3601
  var dto = __assign({}, pais);
2083
- dto.createdDate = dto.createdDate && moment$4(dto.createdDate).format();
2084
- dto.lastModifiedDate = dto.lastModifiedDate && moment$4(dto.lastModifiedDate).format();
3602
+ dto.createdDate = dto.createdDate && moment$7(dto.createdDate).format();
3603
+ dto.lastModifiedDate = dto.lastModifiedDate && moment$7(dto.lastModifiedDate).format();
2085
3604
  delete dto.label;
2086
3605
  return dto;
2087
3606
  };
@@ -2090,7 +3609,7 @@
2090
3609
  /*{CA:FILE_CONTENTS:START}*/
2091
3610
  /*{CA:FILE_CONTENTS:END}*/
2092
3611
 
2093
- var moment$5 = _moment;
3612
+ var moment$8 = _moment;
2094
3613
  /*{CA:PROJECT_IMPORTS:START}*/
2095
3614
  /*{CA:PROJECT_IMPORTS:END}*/
2096
3615
  var Estado = /** @class */ (function () {
@@ -2100,8 +3619,8 @@
2100
3619
  /*{CA:CLASS_ATTRIBUTES:END}*/
2101
3620
  Estado.fromDto = function (estadoDto, originEntity) {
2102
3621
  var model = __assign({}, estadoDto);
2103
- model.createdDate = model.createdDate && moment$5(model.createdDate).toDate();
2104
- model.lastModifiedDate = model.lastModifiedDate && moment$5(model.lastModifiedDate).toDate();
3622
+ model.createdDate = model.createdDate && moment$8(model.createdDate).toDate();
3623
+ model.lastModifiedDate = model.lastModifiedDate && moment$8(model.lastModifiedDate).toDate();
2105
3624
  var lookupSeparator = " - ";
2106
3625
  var displayFields = [
2107
3626
  "id",
@@ -2123,8 +3642,8 @@
2123
3642
  };
2124
3643
  Estado.toDto = function (estado, originEntity) {
2125
3644
  var dto = __assign({}, estado);
2126
- dto.createdDate = dto.createdDate && moment$5(dto.createdDate).format();
2127
- dto.lastModifiedDate = dto.lastModifiedDate && moment$5(dto.lastModifiedDate).format();
3645
+ dto.createdDate = dto.createdDate && moment$8(dto.createdDate).format();
3646
+ dto.lastModifiedDate = dto.lastModifiedDate && moment$8(dto.lastModifiedDate).format();
2128
3647
  delete dto.label;
2129
3648
  if (originEntity !== "Pais" && dto.pais)
2130
3649
  dto.pais = Pais.toDto(dto.pais, "Estado");
@@ -2135,7 +3654,7 @@
2135
3654
  /*{CA:FILE_CONTENTS:START}*/
2136
3655
  /*{CA:FILE_CONTENTS:END}*/
2137
3656
 
2138
- var moment$6 = _moment;
3657
+ var moment$9 = _moment;
2139
3658
  /*{CA:PROJECT_IMPORTS:START}*/
2140
3659
  /*{CA:PROJECT_IMPORTS:END}*/
2141
3660
  var Cidade = /** @class */ (function () {
@@ -2145,8 +3664,8 @@
2145
3664
  /*{CA:CLASS_ATTRIBUTES:END}*/
2146
3665
  Cidade.fromDto = function (cidadeDto, originEntity) {
2147
3666
  var model = __assign({}, cidadeDto);
2148
- model.createdDate = model.createdDate && moment$6(model.createdDate).toDate();
2149
- model.lastModifiedDate = model.lastModifiedDate && moment$6(model.lastModifiedDate).toDate();
3667
+ model.createdDate = model.createdDate && moment$9(model.createdDate).toDate();
3668
+ model.lastModifiedDate = model.lastModifiedDate && moment$9(model.lastModifiedDate).toDate();
2150
3669
  var lookupSeparator = " - ";
2151
3670
  var displayFields = [
2152
3671
  "id",
@@ -2167,8 +3686,8 @@
2167
3686
  };
2168
3687
  Cidade.toDto = function (cidade, originEntity) {
2169
3688
  var dto = __assign({}, cidade);
2170
- dto.createdDate = dto.createdDate && moment$6(dto.createdDate).format();
2171
- dto.lastModifiedDate = dto.lastModifiedDate && moment$6(dto.lastModifiedDate).format();
3689
+ dto.createdDate = dto.createdDate && moment$9(dto.createdDate).format();
3690
+ dto.lastModifiedDate = dto.lastModifiedDate && moment$9(dto.lastModifiedDate).format();
2172
3691
  delete dto.label;
2173
3692
  if (originEntity !== "Estado" && dto.estado)
2174
3693
  dto.estado = Estado.toDto(dto.estado, "Cidade");
@@ -2179,14 +3698,14 @@
2179
3698
  /*{CA:FILE_CONTENTS:START}*/
2180
3699
  /*{CA:FILE_CONTENTS:END}*/
2181
3700
 
2182
- var moment$7 = _moment;
3701
+ var moment$a = _moment;
2183
3702
  var PessoaEndereco = /** @class */ (function () {
2184
3703
  function PessoaEndereco() {
2185
3704
  }
2186
3705
  PessoaEndereco.fromDto = function (pessoaEnderecoDto, originEntity) {
2187
3706
  var model = __assign({}, pessoaEnderecoDto);
2188
- model.createdDate = model.createdDate && moment$7(model.createdDate).toDate();
2189
- model.lastModifiedDate = model.lastModifiedDate && moment$7(model.lastModifiedDate).toDate();
3707
+ model.createdDate = model.createdDate && moment$a(model.createdDate).toDate();
3708
+ model.lastModifiedDate = model.lastModifiedDate && moment$a(model.lastModifiedDate).toDate();
2190
3709
  var lookupSeparator = " - ";
2191
3710
  var displayFields = [
2192
3711
  "codigo",
@@ -2202,8 +3721,8 @@
2202
3721
  };
2203
3722
  PessoaEndereco.toDto = function (pessoaEndereco, originEntity) {
2204
3723
  var dto = __assign({}, pessoaEndereco);
2205
- dto.createdDate = dto.createdDate && moment$7(dto.createdDate).format();
2206
- dto.lastModifiedDate = dto.lastModifiedDate && moment$7(dto.lastModifiedDate).format();
3724
+ dto.createdDate = dto.createdDate && moment$a(dto.createdDate).format();
3725
+ dto.lastModifiedDate = dto.lastModifiedDate && moment$a(dto.lastModifiedDate).format();
2207
3726
  delete dto.label;
2208
3727
  if (originEntity !== "Pessoa" && dto.pessoa)
2209
3728
  dto.pessoa = Pessoa.toDto(dto.pessoa, "PessoaEndereco");
@@ -2214,7 +3733,7 @@
2214
3733
  return PessoaEndereco;
2215
3734
  }());
2216
3735
 
2217
- var moment$8 = _moment;
3736
+ var moment$b = _moment;
2218
3737
  /*{CA:PROJECT_IMPORTS:START}*/
2219
3738
  /*{CA:PROJECT_IMPORTS:END}*/
2220
3739
  var Filial = /** @class */ (function () {
@@ -2224,8 +3743,8 @@
2224
3743
  /*{CA:CLASS_ATTRIBUTES:END}*/
2225
3744
  Filial.fromDto = function (filialDto, originEntity) {
2226
3745
  var model = __assign({}, filialDto);
2227
- model.createdDate = model.createdDate && moment$8(model.createdDate).toDate();
2228
- model.lastModifiedDate = model.lastModifiedDate && moment$8(model.lastModifiedDate).toDate();
3746
+ model.createdDate = model.createdDate && moment$b(model.createdDate).toDate();
3747
+ model.lastModifiedDate = model.lastModifiedDate && moment$b(model.lastModifiedDate).toDate();
2229
3748
  var lookupSeparator = " - ";
2230
3749
  var displayFields = [
2231
3750
  "codigo",
@@ -2243,8 +3762,8 @@
2243
3762
  };
2244
3763
  Filial.toDto = function (filial, originEntity) {
2245
3764
  var dto = __assign({}, filial);
2246
- dto.createdDate = dto.createdDate && moment$8(dto.createdDate).format();
2247
- dto.lastModifiedDate = dto.lastModifiedDate && moment$8(dto.lastModifiedDate).format();
3765
+ dto.createdDate = dto.createdDate && moment$b(dto.createdDate).format();
3766
+ dto.lastModifiedDate = dto.lastModifiedDate && moment$b(dto.lastModifiedDate).format();
2248
3767
  delete dto.label;
2249
3768
  if (originEntity !== "Empresa" && dto.empresa)
2250
3769
  dto.empresa = Empresa.toDto(dto.empresa, "Filial");
@@ -2259,14 +3778,14 @@
2259
3778
  /*{CA:FILE_CONTENTS:START}*/
2260
3779
  /*{CA:FILE_CONTENTS:END}*/
2261
3780
 
2262
- var moment$9 = _moment;
3781
+ var moment$c = _moment;
2263
3782
  var OrdemCompra = /** @class */ (function () {
2264
3783
  function OrdemCompra() {
2265
3784
  }
2266
3785
  OrdemCompra.fromDto = function (ordemCompraDto, originEntity) {
2267
3786
  var model = __assign({}, ordemCompraDto);
2268
- model.createdDate = model.createdDate && moment$9(model.createdDate).toDate();
2269
- model.lastModifiedDate = model.lastModifiedDate && moment$9(model.lastModifiedDate).toDate();
3787
+ model.createdDate = model.createdDate && moment$c(model.createdDate).toDate();
3788
+ model.lastModifiedDate = model.lastModifiedDate && moment$c(model.lastModifiedDate).toDate();
2270
3789
  var lookupSeparator = " - ";
2271
3790
  var displayFields = [
2272
3791
  "codigo",
@@ -2282,8 +3801,8 @@
2282
3801
  };
2283
3802
  OrdemCompra.toDto = function (ordemCompra, originEntity) {
2284
3803
  var dto = __assign({}, ordemCompra);
2285
- dto.createdDate = dto.createdDate && moment$9(dto.createdDate).format();
2286
- dto.lastModifiedDate = dto.lastModifiedDate && moment$9(dto.lastModifiedDate).format();
3804
+ dto.createdDate = dto.createdDate && moment$c(dto.createdDate).format();
3805
+ dto.lastModifiedDate = dto.lastModifiedDate && moment$c(dto.lastModifiedDate).format();
2287
3806
  delete dto.label;
2288
3807
  if (originEntity !== "Empresa" && dto.empresa)
2289
3808
  dto.empresa = Empresa.toDto(dto.empresa, "Produto");
@@ -2294,7 +3813,7 @@
2294
3813
  return OrdemCompra;
2295
3814
  }());
2296
3815
 
2297
- var moment$a = _moment;
3816
+ var moment$d = _moment;
2298
3817
  var OrdemCompraFormComponent = /** @class */ (function () {
2299
3818
  function OrdemCompraFormComponent(dialogRef, dialogConfig, ordemCompraService, translate, fb) {
2300
3819
  this.dialogRef = dialogRef;
@@ -2366,7 +3885,7 @@
2366
3885
  if (filial && filial.empresa && filial.empresa.id) {
2367
3886
  filter.empresaId = filial.empresa.id;
2368
3887
  }
2369
- filter.dataEmissao = filter.dataEmissao && moment$a(filter.dataEmissao).format("YYYY-MM-DD");
3888
+ filter.dataEmissao = filter.dataEmissao && moment$d(filter.dataEmissao).format("YYYY-MM-DD");
2370
3889
  var sort = (multiSortMeta || []).length ? { field: multiSortMeta[0].field, order: multiSortMeta[0].order === 1 ? 'Asc' : 'Desc' } : { field: 'numero', order: 'Asc' };
2371
3890
  this.ordemCompraService
2372
3891
  .listOrdensCompra(__assign({}, filter, { pessoaId: (this.fornecedor || { id: undefined }).id, filialId: (filial || { id: undefined }).id, tipoAgendamentoId: this.agenda && this.agenda.tipoAgendamento ? this.agenda.tipoAgendamento.id : null, ordensCompraSelecionados: this.ordensCompra, pagina: {
@@ -2480,40 +3999,6 @@
2480
3999
  return OrdemCompraFormComponent;
2481
4000
  }());
2482
4001
 
2483
- var FocusService = /** @class */ (function () {
2484
- function FocusService() {
2485
- }
2486
- FocusService.prototype.focusFirstInvalidInput = function () {
2487
- var invalidFields = Array.from(document.getElementsByClassName("ng-invalid"));
2488
- var firstField = invalidFields.find(function (f) { return f.nodeName !== "FORM"; });
2489
- if (!firstField)
2490
- return;
2491
- if (firstField.nodeName === "P-CALENDAR") {
2492
- var firstInputId = firstField.getAttribute("ng-reflect-input-id");
2493
- var firstInvalidInput = document.getElementById(firstInputId);
2494
- if (firstInvalidInput)
2495
- firstInvalidInput.focus();
2496
- }
2497
- else if (firstField.nodeName === "S-LOOKUP") {
2498
- var nestedInput = this.getNestedInput(firstField.firstElementChild);
2499
- if (nestedInput)
2500
- nestedInput.focus();
2501
- }
2502
- else
2503
- firstField.focus();
2504
- };
2505
- FocusService.prototype.getNestedInput = function (element) {
2506
- if (element.nodeName === "INPUT") {
2507
- return element;
2508
- }
2509
- return this.getNestedInput(element.firstElementChild);
2510
- };
2511
- FocusService = __decorate([
2512
- core.Injectable()
2513
- ], FocusService);
2514
- return FocusService;
2515
- }());
2516
-
2517
4002
  var NotaValidatorService = /** @class */ (function () {
2518
4003
  function NotaValidatorService(environment, http, messageService) {
2519
4004
  this.http = http;
@@ -2801,7 +4286,7 @@
2801
4286
  messageservice.MessageService, Object])
2802
4287
  ], CidadeService);
2803
4288
  return CidadeService;
2804
- }(EntityService));
4289
+ }(EntityService$1));
2805
4290
  /*{CA:FILE_CONTENTS:START}*/
2806
4291
  /*{CA:FILE_CONTENTS:END}*/
2807
4292
 
@@ -2862,7 +4347,7 @@
2862
4347
  messageservice.MessageService, Object])
2863
4348
  ], ContratoCompraItemService);
2864
4349
  return ContratoCompraItemService;
2865
- }(EntityService));
4350
+ }(EntityService$1));
2866
4351
  /*{CA:FILE_CONTENTS:START}*/
2867
4352
  /*{CA:FILE_CONTENTS:END}*/
2868
4353
 
@@ -2940,7 +4425,7 @@
2940
4425
  messageservice.MessageService, Object])
2941
4426
  ], ContratoCompraService);
2942
4427
  return ContratoCompraService;
2943
- }(EntityService));
4428
+ }(EntityService$1));
2944
4429
 
2945
4430
  /*{CA:PROJECT_IMPORTS:START}*/
2946
4431
  /*{CA:PROJECT_IMPORTS:END}*/
@@ -2996,7 +4481,7 @@
2996
4481
  __metadata("design:paramtypes", [http.HttpClient, messageservice.MessageService, Object])
2997
4482
  ], DerivacaoService);
2998
4483
  return DerivacaoService;
2999
- }(EntityService));
4484
+ }(EntityService$1));
3000
4485
  /*{CA:FILE_CONTENTS:START}*/
3001
4486
  /*{CA:FILE_CONTENTS:END}*/
3002
4487
 
@@ -3055,7 +4540,7 @@
3055
4540
  messageservice.MessageService, Object])
3056
4541
  ], EmpresaService);
3057
4542
  return EmpresaService;
3058
- }(EntityService));
4543
+ }(EntityService$1));
3059
4544
  /*{CA:FILE_CONTENTS:START}*/
3060
4545
  /*{CA:FILE_CONTENTS:END}*/
3061
4546
 
@@ -3114,7 +4599,7 @@
3114
4599
  messageservice.MessageService, Object])
3115
4600
  ], EstadoService);
3116
4601
  return EstadoService;
3117
- }(EntityService));
4602
+ }(EntityService$1));
3118
4603
  /*{CA:FILE_CONTENTS:START}*/
3119
4604
  /*{CA:FILE_CONTENTS:END}*/
3120
4605
 
@@ -3173,7 +4658,7 @@
3173
4658
  messageservice.MessageService, Object])
3174
4659
  ], FamiliaProdutoService);
3175
4660
  return FamiliaProdutoService;
3176
- }(EntityService));
4661
+ }(EntityService$1));
3177
4662
  /*{CA:FILE_CONTENTS:START}*/
3178
4663
  /*{CA:FILE_CONTENTS:END}*/
3179
4664
 
@@ -3232,7 +4717,7 @@
3232
4717
  messageservice.MessageService, Object])
3233
4718
  ], FilialService);
3234
4719
  return FilialService;
3235
- }(EntityService));
4720
+ }(EntityService$1));
3236
4721
  /*{CA:FILE_CONTENTS:START}*/
3237
4722
  /*{CA:FILE_CONTENTS:END}*/
3238
4723
 
@@ -3291,7 +4776,7 @@
3291
4776
  messageservice.MessageService, Object])
3292
4777
  ], PaisService);
3293
4778
  return PaisService;
3294
- }(EntityService));
4779
+ }(EntityService$1));
3295
4780
  /*{CA:FILE_CONTENTS:START}*/
3296
4781
  /*{CA:FILE_CONTENTS:END}*/
3297
4782
 
@@ -3352,7 +4837,7 @@
3352
4837
  messageservice.MessageService, Object])
3353
4838
  ], PedidoVendaItemService);
3354
4839
  return PedidoVendaItemService;
3355
- }(EntityService));
4840
+ }(EntityService$1));
3356
4841
  /*{CA:FILE_CONTENTS:START}*/
3357
4842
  /*{CA:FILE_CONTENTS:END}*/
3358
4843
 
@@ -3432,7 +4917,7 @@
3432
4917
  messageservice.MessageService, Object])
3433
4918
  ], PedidoVendaService);
3434
4919
  return PedidoVendaService;
3435
- }(EntityService));
4920
+ }(EntityService$1));
3436
4921
  /*{CA:FILE_CONTENTS:START}*/
3437
4922
  /*{CA:FILE_CONTENTS:END}*/
3438
4923
 
@@ -3491,7 +4976,7 @@
3491
4976
  messageservice.MessageService, Object])
3492
4977
  ], PessoaEnderecoService);
3493
4978
  return PessoaEnderecoService;
3494
- }(EntityService));
4979
+ }(EntityService$1));
3495
4980
  /*{CA:FILE_CONTENTS:START}*/
3496
4981
  /*{CA:FILE_CONTENTS:END}*/
3497
4982
 
@@ -3550,7 +5035,7 @@
3550
5035
  messageservice.MessageService, Object])
3551
5036
  ], PessoaFisicaService);
3552
5037
  return PessoaFisicaService;
3553
- }(EntityService));
5038
+ }(EntityService$1));
3554
5039
  /*{CA:FILE_CONTENTS:START}*/
3555
5040
  /*{CA:FILE_CONTENTS:END}*/
3556
5041
 
@@ -3609,7 +5094,7 @@
3609
5094
  messageservice.MessageService, Object])
3610
5095
  ], PessoaJuridicaService);
3611
5096
  return PessoaJuridicaService;
3612
- }(EntityService));
5097
+ }(EntityService$1));
3613
5098
  /*{CA:FILE_CONTENTS:START}*/
3614
5099
  /*{CA:FILE_CONTENTS:END}*/
3615
5100
 
@@ -3668,7 +5153,7 @@
3668
5153
  messageservice.MessageService, Object])
3669
5154
  ], PessoaService);
3670
5155
  return PessoaService;
3671
- }(EntityService));
5156
+ }(EntityService$1));
3672
5157
  /*{CA:FILE_CONTENTS:START}*/
3673
5158
  /*{CA:FILE_CONTENTS:END}*/
3674
5159
 
@@ -3734,7 +5219,7 @@
3734
5219
  messageservice.MessageService, Object])
3735
5220
  ], ProdutoService);
3736
5221
  return ProdutoService;
3737
- }(EntityService));
5222
+ }(EntityService$1));
3738
5223
 
3739
5224
  /*{CA:PROJECT_IMPORTS:START}*/
3740
5225
  /*{CA:PROJECT_IMPORTS:END}*/
@@ -3994,7 +5479,7 @@
3994
5479
  messageservice.MessageService, Object])
3995
5480
  ], RoyaltyService);
3996
5481
  return RoyaltyService;
3997
- }(EntityService));
5482
+ }(EntityService$1));
3998
5483
  /*{CA:FILE_CONTENTS:START}*/
3999
5484
  /*{CA:FILE_CONTENTS:END}*/
4000
5485
 
@@ -4053,7 +5538,7 @@
4053
5538
  messageservice.MessageService, Object])
4054
5539
  ], SafraService);
4055
5540
  return SafraService;
4056
- }(EntityService));
5541
+ }(EntityService$1));
4057
5542
  /*{CA:FILE_CONTENTS:START}*/
4058
5543
  /*{CA:FILE_CONTENTS:END}*/
4059
5544
 
@@ -4112,7 +5597,7 @@
4112
5597
  messageservice.MessageService, Object])
4113
5598
  ], TransportadoraService);
4114
5599
  return TransportadoraService;
4115
- }(EntityService));
5600
+ }(EntityService$1));
4116
5601
  /*{CA:FILE_CONTENTS:START}*/
4117
5602
  /*{CA:FILE_CONTENTS:END}*/
4118
5603
 
@@ -4171,7 +5656,7 @@
4171
5656
  messageservice.MessageService, Object])
4172
5657
  ], UnidadeMedidaService);
4173
5658
  return UnidadeMedidaService;
4174
- }(EntityService));
5659
+ }(EntityService$1));
4175
5660
  /*{CA:FILE_CONTENTS:START}*/
4176
5661
  /*{CA:FILE_CONTENTS:END}*/
4177
5662
 
@@ -4250,7 +5735,7 @@
4250
5735
  messageservice.MessageService, Object])
4251
5736
  ], DevolucaoService);
4252
5737
  return DevolucaoService;
4253
- }(EntityService));
5738
+ }(EntityService$1));
4254
5739
 
4255
5740
  var DevolucaoModule = /** @class */ (function () {
4256
5741
  function DevolucaoModule() {
@@ -4365,7 +5850,7 @@
4365
5850
  messageservice.MessageService, Object])
4366
5851
  ], RecebimentoOrdemCompraService);
4367
5852
  return RecebimentoOrdemCompraService;
4368
- }(EntityService));
5853
+ }(EntityService$1));
4369
5854
 
4370
5855
  var RecebimentoOrdemCompraModule = /** @class */ (function () {
4371
5856
  function RecebimentoOrdemCompraModule() {
@@ -4411,7 +5896,7 @@
4411
5896
  api.MessageService, Object])
4412
5897
  ], TransgeniaService);
4413
5898
  return TransgeniaService;
4414
- }(EntityService));
5899
+ }(EntityService$1));
4415
5900
 
4416
5901
  var TransgeniaModule = /** @class */ (function () {
4417
5902
  function TransgeniaModule() {
@@ -4442,7 +5927,7 @@
4442
5927
  api.MessageService, Object])
4443
5928
  ], ProcessoAvulsoService);
4444
5929
  return ProcessoAvulsoService;
4445
- }(EntityService));
5930
+ }(EntityService$1));
4446
5931
 
4447
5932
  var ProcessoAvulsoModule = /** @class */ (function () {
4448
5933
  function ProcessoAvulsoModule() {
@@ -4485,7 +5970,7 @@
4485
5970
  __metadata("design:paramtypes", [http.HttpClient, messageservice.MessageService, Object])
4486
5971
  ], LogIntegracaoService);
4487
5972
  return LogIntegracaoService;
4488
- }(EntityService));
5973
+ }(EntityService$1));
4489
5974
  /*{CA:FILE_CONTENTS:START}*/
4490
5975
  /*{CA:FILE_CONTENTS:END}*/
4491
5976
 
@@ -4616,30 +6101,7 @@
4616
6101
  return DevolucaoChegadaVeiculoOverride;
4617
6102
  }());
4618
6103
 
4619
- var moment$b = _moment;
4620
- var Agenda = /** @class */ (function () {
4621
- function Agenda() {
4622
- }
4623
- Agenda.fromDto = function (agendaDto, originEntity) {
4624
- var model = __assign({}, agendaDto);
4625
- model.createdDate = model.createdDate && moment$b(model.createdDate).toDate();
4626
- model.lastModifiedDate = model.lastModifiedDate && moment$b(model.lastModifiedDate).toDate();
4627
- var lookupSeparator = " - ";
4628
- var displayFields = ["descricao"];
4629
- model.label = getLookupLabel(model, displayFields, lookupSeparator);
4630
- return model;
4631
- };
4632
- Agenda.toDto = function (agenda, originEntity) {
4633
- var dto = __assign({}, agenda);
4634
- dto.createdDate = dto.createdDate && moment$b(dto.createdDate).format();
4635
- dto.lastModifiedDate = dto.lastModifiedDate && moment$b(dto.lastModifiedDate).format();
4636
- delete dto.label;
4637
- return dto;
4638
- };
4639
- return Agenda;
4640
- }());
4641
-
4642
- var moment$c = _moment;
6104
+ var moment$e = _moment;
4643
6105
  /*{CA:PROJECT_IMPORTS:START}*/
4644
6106
  /*{CA:PROJECT_IMPORTS:END}*/
4645
6107
  var UnidadeMedida = /** @class */ (function () {
@@ -4649,8 +6111,8 @@
4649
6111
  /*{CA:CLASS_ATTRIBUTES:END}*/
4650
6112
  UnidadeMedida.fromDto = function (unidadeMedidaDto, originEntity) {
4651
6113
  var model = __assign({}, unidadeMedidaDto);
4652
- model.createdDate = model.createdDate && moment$c(model.createdDate).toDate();
4653
- model.lastModifiedDate = model.lastModifiedDate && moment$c(model.lastModifiedDate).toDate();
6114
+ model.createdDate = model.createdDate && moment$e(model.createdDate).toDate();
6115
+ model.lastModifiedDate = model.lastModifiedDate && moment$e(model.lastModifiedDate).toDate();
4654
6116
  var lookupSeparator = " - ";
4655
6117
  var displayFields = [
4656
6118
  "id",
@@ -4667,8 +6129,8 @@
4667
6129
  };
4668
6130
  UnidadeMedida.toDto = function (unidadeMedida, originEntity) {
4669
6131
  var dto = __assign({}, unidadeMedida);
4670
- dto.createdDate = dto.createdDate && moment$c(dto.createdDate).format();
4671
- dto.lastModifiedDate = dto.lastModifiedDate && moment$c(dto.lastModifiedDate).format();
6132
+ dto.createdDate = dto.createdDate && moment$e(dto.createdDate).format();
6133
+ dto.lastModifiedDate = dto.lastModifiedDate && moment$e(dto.lastModifiedDate).format();
4672
6134
  delete dto.label;
4673
6135
  return dto;
4674
6136
  };
@@ -4677,7 +6139,7 @@
4677
6139
  /*{CA:FILE_CONTENTS:START}*/
4678
6140
  /*{CA:FILE_CONTENTS:END}*/
4679
6141
 
4680
- var moment$d = _moment;
6142
+ var moment$f = _moment;
4681
6143
  /*{CA:PROJECT_IMPORTS:START}*/
4682
6144
  /*{CA:PROJECT_IMPORTS:END}*/
4683
6145
  var Royalty = /** @class */ (function () {
@@ -4687,8 +6149,8 @@
4687
6149
  /*{CA:CLASS_ATTRIBUTES:END}*/
4688
6150
  Royalty.fromDto = function (royaltyDto, originEntity) {
4689
6151
  var model = __assign({}, royaltyDto);
4690
- model.createdDate = model.createdDate && moment$d(model.createdDate).toDate();
4691
- model.lastModifiedDate = model.lastModifiedDate && moment$d(model.lastModifiedDate).toDate();
6152
+ model.createdDate = model.createdDate && moment$f(model.createdDate).toDate();
6153
+ model.lastModifiedDate = model.lastModifiedDate && moment$f(model.lastModifiedDate).toDate();
4692
6154
  var lookupSeparator = " - ";
4693
6155
  var displayFields = ["id", "codigo", "descricao", "createdBy", "createdDate", "lastModifiedBy", "lastModifiedDate"];
4694
6156
  model.label = displayFields.map(function (field) { return model[field]; }).join(lookupSeparator);
@@ -4698,8 +6160,8 @@
4698
6160
  };
4699
6161
  Royalty.toDto = function (royalty, originEntity) {
4700
6162
  var dto = __assign({}, royalty);
4701
- dto.createdDate = dto.createdDate && moment$d(dto.createdDate).format();
4702
- dto.lastModifiedDate = dto.lastModifiedDate && moment$d(dto.lastModifiedDate).format();
6163
+ dto.createdDate = dto.createdDate && moment$f(dto.createdDate).format();
6164
+ dto.lastModifiedDate = dto.lastModifiedDate && moment$f(dto.lastModifiedDate).format();
4703
6165
  delete dto.label;
4704
6166
  if (originEntity !== "Empresa" && dto.empresa)
4705
6167
  dto.empresa = Empresa.toDto(dto.empresa, "Royalty");
@@ -4710,7 +6172,7 @@
4710
6172
  /*{CA:FILE_CONTENTS:START}*/
4711
6173
  /*{CA:FILE_CONTENTS:END}*/
4712
6174
 
4713
- var moment$e = _moment;
6175
+ var moment$g = _moment;
4714
6176
  var FamiliaProduto = /** @class */ (function () {
4715
6177
  function FamiliaProduto() {
4716
6178
  }
@@ -4719,9 +6181,9 @@
4719
6181
  return familiaProdutoDto;
4720
6182
  }
4721
6183
  var model = __assign({}, familiaProdutoDto);
4722
- model.createdDate = model.codigo && moment$e(model.createdDate).toDate();
4723
- model.createdDate = model.createdDate && moment$e(model.createdDate).toDate();
4724
- model.lastModifiedDate = model.lastModifiedDate && moment$e(model.lastModifiedDate).toDate();
6184
+ model.createdDate = model.codigo && moment$g(model.createdDate).toDate();
6185
+ model.createdDate = model.createdDate && moment$g(model.createdDate).toDate();
6186
+ model.lastModifiedDate = model.lastModifiedDate && moment$g(model.lastModifiedDate).toDate();
4725
6187
  var lookupSeparator = " - ";
4726
6188
  var displayFields = ["id", "codigo", "descricao", "situacao", "createdBy", "createdDate", "lastModifiedBy", "lastModifiedDate"];
4727
6189
  model.label = displayFields.map(function (field) { return model[field]; }).join(lookupSeparator);
@@ -4731,8 +6193,8 @@
4731
6193
  };
4732
6194
  FamiliaProduto.toDto = function (familiaProduto, originEntity) {
4733
6195
  var dto = __assign({}, familiaProduto);
4734
- dto.createdDate = dto.createdDate && moment$e(dto.createdDate).format();
4735
- dto.lastModifiedDate = dto.lastModifiedDate && moment$e(dto.lastModifiedDate).format();
6196
+ dto.createdDate = dto.createdDate && moment$g(dto.createdDate).format();
6197
+ dto.lastModifiedDate = dto.lastModifiedDate && moment$g(dto.lastModifiedDate).format();
4736
6198
  delete dto.label;
4737
6199
  if (originEntity !== "Empresa" && dto.empresa)
4738
6200
  dto.empresa = Empresa.toDto(dto.empresa, "FamiliaProduto");
@@ -4741,7 +6203,7 @@
4741
6203
  return FamiliaProduto;
4742
6204
  }());
4743
6205
 
4744
- var moment$f = _moment;
6206
+ var moment$h = _moment;
4745
6207
  var Produto = /** @class */ (function () {
4746
6208
  function Produto() {
4747
6209
  this.produtoMisto = false;
@@ -4749,8 +6211,8 @@
4749
6211
  }
4750
6212
  Produto.fromDto = function (produtoDto, originEntity) {
4751
6213
  var model = __assign({}, produtoDto);
4752
- model.createdDate = model.createdDate && moment$f(model.createdDate).toDate();
4753
- model.lastModifiedDate = model.lastModifiedDate && moment$f(model.lastModifiedDate).toDate();
6214
+ model.createdDate = model.createdDate && moment$h(model.createdDate).toDate();
6215
+ model.lastModifiedDate = model.lastModifiedDate && moment$h(model.lastModifiedDate).toDate();
4754
6216
  var lookupSeparator = " - ";
4755
6217
  var displayFields = [
4756
6218
  "codigo",
@@ -4771,8 +6233,8 @@
4771
6233
  };
4772
6234
  Produto.toDto = function (produto, originEntity) {
4773
6235
  var dto = __assign({}, produto);
4774
- dto.createdDate = dto.createdDate && moment$f(dto.createdDate).format();
4775
- dto.lastModifiedDate = dto.lastModifiedDate && moment$f(dto.lastModifiedDate).format();
6236
+ dto.createdDate = dto.createdDate && moment$h(dto.createdDate).format();
6237
+ dto.lastModifiedDate = dto.lastModifiedDate && moment$h(dto.lastModifiedDate).format();
4776
6238
  delete dto.label;
4777
6239
  if (originEntity !== "Empresa" && dto.empresa)
4778
6240
  dto.empresa = Empresa.toDto(dto.empresa, "Produto");
@@ -4789,7 +6251,7 @@
4789
6251
  return Produto;
4790
6252
  }());
4791
6253
 
4792
- var moment$g = _moment;
6254
+ var moment$i = _moment;
4793
6255
  /*{CA:PROJECT_IMPORTS:START}*/
4794
6256
  /*{CA:PROJECT_IMPORTS:END}*/
4795
6257
  var Derivacao = /** @class */ (function () {
@@ -4799,8 +6261,8 @@
4799
6261
  /*{CA:CLASS_ATTRIBUTES:END}*/
4800
6262
  Derivacao.fromDto = function (derivacaoDto, originEntity) {
4801
6263
  var model = __assign({}, derivacaoDto);
4802
- model.createdDate = model.createdDate && moment$g(model.createdDate).toDate();
4803
- model.lastModifiedDate = model.lastModifiedDate && moment$g(model.lastModifiedDate).toDate();
6264
+ model.createdDate = model.createdDate && moment$i(model.createdDate).toDate();
6265
+ model.lastModifiedDate = model.lastModifiedDate && moment$i(model.lastModifiedDate).toDate();
4804
6266
  var lookupSeparator = " - ";
4805
6267
  var displayFields = ["codigo", "descricao"];
4806
6268
  model.label = getLookupLabel(model, displayFields, lookupSeparator);
@@ -4812,8 +6274,8 @@
4812
6274
  };
4813
6275
  Derivacao.toDto = function (derivacao, originEntity) {
4814
6276
  var dto = __assign({}, derivacao);
4815
- dto.createdDate = dto.createdDate && moment$g(dto.createdDate).format();
4816
- dto.lastModifiedDate = dto.lastModifiedDate && moment$g(dto.lastModifiedDate).format();
6277
+ dto.createdDate = dto.createdDate && moment$i(dto.createdDate).format();
6278
+ dto.lastModifiedDate = dto.lastModifiedDate && moment$i(dto.lastModifiedDate).format();
4817
6279
  delete dto.label;
4818
6280
  if (originEntity !== "Empresa" && dto.empresa)
4819
6281
  dto.empresa = Empresa.toDto(dto.empresa, "Derivacao");
@@ -4826,7 +6288,7 @@
4826
6288
  /*{CA:FILE_CONTENTS:START}*/
4827
6289
  /*{CA:FILE_CONTENTS:END}*/
4828
6290
 
4829
- var moment$h = _moment;
6291
+ var moment$j = _moment;
4830
6292
  /*{CA:PROJECT_IMPORTS:START}*/
4831
6293
  /*{CA:PROJECT_IMPORTS:END}*/
4832
6294
  var Transportadora = /** @class */ (function () {
@@ -4836,8 +6298,8 @@
4836
6298
  /*{CA:CLASS_ATTRIBUTES:END}*/
4837
6299
  Transportadora.fromDto = function (transportadoraDto, originEntity) {
4838
6300
  var model = __assign({}, transportadoraDto);
4839
- model.createdDate = model.createdDate && moment$h(model.createdDate).toDate();
4840
- model.lastModifiedDate = model.lastModifiedDate && moment$h(model.lastModifiedDate).toDate();
6301
+ model.createdDate = model.createdDate && moment$j(model.createdDate).toDate();
6302
+ model.lastModifiedDate = model.lastModifiedDate && moment$j(model.lastModifiedDate).toDate();
4841
6303
  var lookupSeparator = " - ";
4842
6304
  var displayFields = [
4843
6305
  "codigo", "pessoa.nome", "pessoa.cpfCnpj"
@@ -4851,8 +6313,8 @@
4851
6313
  };
4852
6314
  Transportadora.toDto = function (transportadora, originEntity) {
4853
6315
  var dto = __assign({}, transportadora);
4854
- dto.createdDate = dto.createdDate && moment$h(dto.createdDate).format();
4855
- dto.lastModifiedDate = dto.lastModifiedDate && moment$h(dto.lastModifiedDate).format();
6316
+ dto.createdDate = dto.createdDate && moment$j(dto.createdDate).format();
6317
+ dto.lastModifiedDate = dto.lastModifiedDate && moment$j(dto.lastModifiedDate).format();
4856
6318
  delete dto.label;
4857
6319
  if (originEntity !== "Pessoa" && dto.pessoa)
4858
6320
  dto.pessoa = Pessoa.toDto(dto.pessoa, "Transportadora");
@@ -4865,7 +6327,7 @@
4865
6327
  /*{CA:FILE_CONTENTS:START}*/
4866
6328
  /*{CA:FILE_CONTENTS:END}*/
4867
6329
 
4868
- var moment$i = _moment;
6330
+ var moment$k = _moment;
4869
6331
  /*{CA:PROJECT_IMPORTS:START}*/
4870
6332
  /*{CA:PROJECT_IMPORTS:END}*/
4871
6333
  var Devolucao = /** @class */ (function () {
@@ -4875,8 +6337,8 @@
4875
6337
  /*{CA:CLASS_ATTRIBUTES:END}*/
4876
6338
  Devolucao.fromDto = function (devolucaoDto, originEntity) {
4877
6339
  var model = __assign({}, devolucaoDto);
4878
- model.createdDate = model.createdDate && moment$i(model.createdDate).toDate();
4879
- model.lastModifiedDate = model.lastModifiedDate && moment$i(model.lastModifiedDate).toDate();
6340
+ model.createdDate = model.createdDate && moment$k(model.createdDate).toDate();
6341
+ model.lastModifiedDate = model.lastModifiedDate && moment$k(model.lastModifiedDate).toDate();
4880
6342
  var lookupSeparator = " - ";
4881
6343
  var displayFields = [
4882
6344
  ''
@@ -4900,8 +6362,8 @@
4900
6362
  };
4901
6363
  Devolucao.toDto = function (devolucao, originEntity) {
4902
6364
  var dto = __assign({}, devolucao);
4903
- dto.createdDate = dto.createdDate && moment$i(dto.createdDate).format();
4904
- dto.lastModifiedDate = dto.lastModifiedDate && moment$i(dto.lastModifiedDate).format();
6365
+ dto.createdDate = dto.createdDate && moment$k(dto.createdDate).format();
6366
+ dto.lastModifiedDate = dto.lastModifiedDate && moment$k(dto.lastModifiedDate).format();
4905
6367
  delete dto.label;
4906
6368
  if (originEntity !== "Pessoa" && dto.fornecedor)
4907
6369
  dto.fornecedor = Pessoa.toDto(dto.fornecedor, "Devolucao");
@@ -5639,7 +7101,7 @@
5639
7101
 
5640
7102
  /*{CA:PACKAGE_IMPORTS:START}*/
5641
7103
  /*{CA:PACKAGE_IMPORTS:END}*/
5642
- var moment$j = _moment;
7104
+ var moment$l = _moment;
5643
7105
  /*{CA:PROJECT_IMPORTS:START}*/
5644
7106
  /*{CA:PROJECT_IMPORTS:END}*/
5645
7107
  var Expedicao = /** @class */ (function () {
@@ -5649,8 +7111,8 @@
5649
7111
  /*{CA:CLASS_ATTRIBUTES:END}*/
5650
7112
  Expedicao.fromDto = function (expedicaoDto, originEntity) {
5651
7113
  var model = __assign({}, expedicaoDto);
5652
- model.createdDate = model.createdDate && moment$j(model.createdDate).toDate();
5653
- model.lastModifiedDate = model.lastModifiedDate && moment$j(model.lastModifiedDate).toDate();
7114
+ model.createdDate = model.createdDate && moment$l(model.createdDate).toDate();
7115
+ model.lastModifiedDate = model.lastModifiedDate && moment$l(model.lastModifiedDate).toDate();
5654
7116
  var lookupSeparator = " - ";
5655
7117
  var displayFields = [
5656
7118
  "id",
@@ -5689,8 +7151,8 @@
5689
7151
  };
5690
7152
  Expedicao.toDto = function (expedicao, originEntity) {
5691
7153
  var dto = __assign({}, expedicao);
5692
- dto.createdDate = dto.createdDate && moment$j(dto.createdDate).format();
5693
- dto.lastModifiedDate = dto.lastModifiedDate && moment$j(dto.lastModifiedDate).format();
7154
+ dto.createdDate = dto.createdDate && moment$l(dto.createdDate).format();
7155
+ dto.lastModifiedDate = dto.lastModifiedDate && moment$l(dto.lastModifiedDate).format();
5694
7156
  delete dto.label;
5695
7157
  if (originEntity !== "Pessoa" && dto.clienteFaturamento)
5696
7158
  dto.clienteFaturamento = Pessoa.toDto(dto.clienteFaturamento, "Recebimento");
@@ -5707,7 +7169,7 @@
5707
7169
  return Expedicao;
5708
7170
  }());
5709
7171
 
5710
- var moment$k = _moment;
7172
+ var moment$m = _moment;
5711
7173
  var ExpedicaoFormComponent = /** @class */ (function () {
5712
7174
  function ExpedicaoFormComponent(expedicaoService, router, route, messageService, formBuilder, translate, hotkeysService, fieldCustomization, focusService, pessoaService, filialService, transportadoraService, pedidoVendaService, pedidoVendaItemService, agendaService, override, confirmationService, erpProcessService, erpFormConfigService, hasChangeService) {
5713
7175
  this.expedicaoService = expedicaoService;
@@ -6263,11 +7725,11 @@
6263
7725
  if (typeof value == "number")
6264
7726
  return name + " eq " + value;
6265
7727
  else if (type == angularComponents.FieldType.Date)
6266
- return name + " eq '" + moment$k(value).format("YYYY-MM-DD") + "'";
7728
+ return name + " eq '" + moment$m(value).format("YYYY-MM-DD") + "'";
6267
7729
  else if (type == angularComponents.FieldType.Time)
6268
- return name + " eq '" + moment$k(value).format("HH:mm:ss") + "'";
7730
+ return name + " eq '" + moment$m(value).format("HH:mm:ss") + "'";
6269
7731
  else if (type == angularComponents.FieldType.DateTime)
6270
- return name + " eq '" + moment$k(value).format() + "'";
7732
+ return name + " eq '" + moment$m(value).format() + "'";
6271
7733
  else if (type == angularComponents.FieldType.Enum)
6272
7734
  return name + " eq '" + value + "'";
6273
7735
  else if (type == angularComponents.FieldType.String)
@@ -6319,11 +7781,11 @@
6319
7781
  if (typeof value == "number")
6320
7782
  return name + " eq " + value;
6321
7783
  else if (type == angularComponents.FieldType.Date)
6322
- return name + " eq '" + moment$k(value).format("YYYY-MM-DD") + "'";
7784
+ return name + " eq '" + moment$m(value).format("YYYY-MM-DD") + "'";
6323
7785
  else if (type == angularComponents.FieldType.Time)
6324
- return name + " eq '" + moment$k(value).format("HH:mm:ss") + "'";
7786
+ return name + " eq '" + moment$m(value).format("HH:mm:ss") + "'";
6325
7787
  else if (type == angularComponents.FieldType.DateTime)
6326
- return name + " eq '" + moment$k(value).format() + "'";
7788
+ return name + " eq '" + moment$m(value).format() + "'";
6327
7789
  else if (type == angularComponents.FieldType.Enum)
6328
7790
  return name + " eq '" + value + "'";
6329
7791
  else if (type == angularComponents.FieldType.String)
@@ -6450,11 +7912,11 @@
6450
7912
  if (typeof value == "number")
6451
7913
  return name + " eq " + value;
6452
7914
  else if (type == angularComponents.FieldType.Date)
6453
- return name + " eq '" + moment$k(value).format("YYYY-MM-DD") + "'";
7915
+ return name + " eq '" + moment$m(value).format("YYYY-MM-DD") + "'";
6454
7916
  else if (type == angularComponents.FieldType.Time)
6455
- return name + " eq '" + moment$k(value).format("HH:mm:ss") + "'";
7917
+ return name + " eq '" + moment$m(value).format("HH:mm:ss") + "'";
6456
7918
  else if (type == angularComponents.FieldType.DateTime)
6457
- return name + " eq '" + moment$k(value).format() + "'";
7919
+ return name + " eq '" + moment$m(value).format() + "'";
6458
7920
  else if (type == angularComponents.FieldType.String)
6459
7921
  return "containing(lower(" + name + "), lower('" + value.replace(/'/g, "\\'") + "'))";
6460
7922
  else
@@ -6643,11 +8105,11 @@
6643
8105
  if (typeof value == "number")
6644
8106
  return name + " eq " + value;
6645
8107
  else if (type == angularComponents.FieldType.Date)
6646
- return name + " eq '" + moment$k(value).format("YYYY-MM-DD") + "'";
8108
+ return name + " eq '" + moment$m(value).format("YYYY-MM-DD") + "'";
6647
8109
  else if (type == angularComponents.FieldType.Time)
6648
- return name + " eq '" + moment$k(value).format("HH:mm:ss") + "'";
8110
+ return name + " eq '" + moment$m(value).format("HH:mm:ss") + "'";
6649
8111
  else if (type == angularComponents.FieldType.DateTime)
6650
- return name + " eq '" + moment$k(value).format() + "'";
8112
+ return name + " eq '" + moment$m(value).format() + "'";
6651
8113
  else if (type == angularComponents.FieldType.String)
6652
8114
  return "containing(lower(" + name + "), lower('" + value.replace(/'/g, "\\'") + "'))";
6653
8115
  else
@@ -6689,11 +8151,11 @@
6689
8151
  if (typeof value == "number")
6690
8152
  return name + " eq " + value;
6691
8153
  else if (type == angularComponents.FieldType.Date)
6692
- return name + " eq '" + moment$k(value).format("YYYY-MM-DD") + "'";
8154
+ return name + " eq '" + moment$m(value).format("YYYY-MM-DD") + "'";
6693
8155
  else if (type == angularComponents.FieldType.Time)
6694
- return name + " eq '" + moment$k(value).format("HH:mm:ss") + "'";
8156
+ return name + " eq '" + moment$m(value).format("HH:mm:ss") + "'";
6695
8157
  else if (type == angularComponents.FieldType.DateTime)
6696
- return name + " eq '" + moment$k(value).format() + "'";
8158
+ return name + " eq '" + moment$m(value).format() + "'";
6697
8159
  else if (type == angularComponents.FieldType.Enum)
6698
8160
  return name + " eq '" + value + "'";
6699
8161
  else if (type == angularComponents.FieldType.String)
@@ -7805,7 +9267,7 @@
7805
9267
  return ProcessoAvulsoInfoComponent;
7806
9268
  }());
7807
9269
 
7808
- var moment$l = _moment;
9270
+ var moment$n = _moment;
7809
9271
  /*{CA:PROJECT_IMPORTS:START}*/
7810
9272
  /*{CA:PROJECT_IMPORTS:END}*/
7811
9273
  var Safra = /** @class */ (function () {
@@ -7815,10 +9277,10 @@
7815
9277
  /*{CA:CLASS_ATTRIBUTES:END}*/
7816
9278
  Safra.fromDto = function (safraDto, originEntity) {
7817
9279
  var model = __assign({}, safraDto);
7818
- model.competenciaInicial = model.competenciaInicial && moment$l(model.competenciaInicial).toDate();
7819
- model.competenciaFinal = model.competenciaFinal && moment$l(model.competenciaFinal).toDate();
7820
- model.createdDate = model.createdDate && moment$l(model.createdDate).toDate();
7821
- model.lastModifiedDate = model.lastModifiedDate && moment$l(model.lastModifiedDate).toDate();
9280
+ model.competenciaInicial = model.competenciaInicial && moment$n(model.competenciaInicial).toDate();
9281
+ model.competenciaFinal = model.competenciaFinal && moment$n(model.competenciaFinal).toDate();
9282
+ model.createdDate = model.createdDate && moment$n(model.createdDate).toDate();
9283
+ model.lastModifiedDate = model.lastModifiedDate && moment$n(model.lastModifiedDate).toDate();
7822
9284
  var lookupSeparator = " - ";
7823
9285
  var displayFields = [
7824
9286
  "codigo",
@@ -7831,10 +9293,10 @@
7831
9293
  };
7832
9294
  Safra.toDto = function (safra, originEntity) {
7833
9295
  var dto = __assign({}, safra);
7834
- dto.competenciaInicial = dto.competenciaInicial && moment$l(dto.competenciaInicial).format("YYYY-MM-DD");
7835
- dto.competenciaFinal = dto.competenciaFinal && moment$l(dto.competenciaFinal).format("YYYY-MM-DD");
7836
- dto.createdDate = dto.createdDate && moment$l(dto.createdDate).format();
7837
- dto.lastModifiedDate = dto.lastModifiedDate && moment$l(dto.lastModifiedDate).format();
9296
+ dto.competenciaInicial = dto.competenciaInicial && moment$n(dto.competenciaInicial).format("YYYY-MM-DD");
9297
+ dto.competenciaFinal = dto.competenciaFinal && moment$n(dto.competenciaFinal).format("YYYY-MM-DD");
9298
+ dto.createdDate = dto.createdDate && moment$n(dto.createdDate).format();
9299
+ dto.lastModifiedDate = dto.lastModifiedDate && moment$n(dto.lastModifiedDate).format();
7838
9300
  delete dto.label;
7839
9301
  if (originEntity !== "Empresa" && dto.empresa)
7840
9302
  dto.empresa = Empresa.toDto(dto.empresa, "Safra");
@@ -7847,7 +9309,7 @@
7847
9309
 
7848
9310
  /*{CA:PACKAGE_IMPORTS:START}*/
7849
9311
  /*{CA:PACKAGE_IMPORTS:END}*/
7850
- var moment$m = _moment;
9312
+ var moment$o = _moment;
7851
9313
  /*{CA:PROJECT_IMPORTS:START}*/
7852
9314
  /*{CA:PROJECT_IMPORTS:END}*/
7853
9315
  var RecebimentoOrdemCompra = /** @class */ (function () {
@@ -7857,8 +9319,8 @@
7857
9319
  /*{CA:CLASS_ATTRIBUTES:END}*/
7858
9320
  RecebimentoOrdemCompra.fromDto = function (recebimentoOrdemCompraDto, originEntity) {
7859
9321
  var model = __assign({}, recebimentoOrdemCompraDto);
7860
- model.createdDate = model.createdDate && moment$m(model.createdDate).toDate();
7861
- model.lastModifiedDate = model.lastModifiedDate && moment$m(model.lastModifiedDate).toDate();
9322
+ model.createdDate = model.createdDate && moment$o(model.createdDate).toDate();
9323
+ model.lastModifiedDate = model.lastModifiedDate && moment$o(model.lastModifiedDate).toDate();
7862
9324
  var lookupSeparator = " - ";
7863
9325
  var displayFields = [
7864
9326
  ''
@@ -7887,8 +9349,8 @@
7887
9349
  };
7888
9350
  RecebimentoOrdemCompra.toDto = function (recebimentoOrdemCompra, originEntity) {
7889
9351
  var dto = __assign({}, recebimentoOrdemCompra);
7890
- dto.createdDate = dto.createdDate && moment$m(dto.createdDate).format();
7891
- dto.lastModifiedDate = dto.lastModifiedDate && moment$m(dto.lastModifiedDate).format();
9352
+ dto.createdDate = dto.createdDate && moment$o(dto.createdDate).format();
9353
+ dto.lastModifiedDate = dto.lastModifiedDate && moment$o(dto.lastModifiedDate).format();
7892
9354
  delete dto.label;
7893
9355
  if (originEntity !== "Agenda" && dto.agenda)
7894
9356
  dto.agenda = Agenda.toDto(dto.agenda, "RecebimentoOrdemCompra");
@@ -9181,7 +10643,7 @@
9181
10643
  return RecebimentoOrdemCompraInfoComponent;
9182
10644
  }());
9183
10645
 
9184
- var moment$n = _moment;
10646
+ var moment$p = _moment;
9185
10647
  /*{CA:PROJECT_IMPORTS:START}*/
9186
10648
  /*{CA:PROJECT_IMPORTS:END}*/
9187
10649
  var ContratoCompra = /** @class */ (function () {
@@ -9191,11 +10653,11 @@
9191
10653
  /*{CA:CLASS_ATTRIBUTES:END}*/
9192
10654
  ContratoCompra.fromDto = function (contratoCompraDto, originEntity) {
9193
10655
  var model = __assign({}, contratoCompraDto);
9194
- model.dataEmissao = model.dataEmissao && moment$n(model.dataEmissao).toDate();
9195
- model.dataInicioVigencia = model.dataInicioVigencia && moment$n(model.dataInicioVigencia).toDate();
9196
- model.dataFimVigencia = model.dataFimVigencia && moment$n(model.dataFimVigencia).toDate();
9197
- model.createdDate = model.createdDate && moment$n(model.createdDate).toDate();
9198
- model.lastModifiedDate = model.lastModifiedDate && moment$n(model.lastModifiedDate).toDate();
10656
+ model.dataEmissao = model.dataEmissao && moment$p(model.dataEmissao).toDate();
10657
+ model.dataInicioVigencia = model.dataInicioVigencia && moment$p(model.dataInicioVigencia).toDate();
10658
+ model.dataFimVigencia = model.dataFimVigencia && moment$p(model.dataFimVigencia).toDate();
10659
+ model.createdDate = model.createdDate && moment$p(model.createdDate).toDate();
10660
+ model.lastModifiedDate = model.lastModifiedDate && moment$p(model.lastModifiedDate).toDate();
9199
10661
  model.label = "N\u00FAmero: " + model.numero + ", Filial: " + model.filial.codigo;
9200
10662
  if (originEntity !== "Empresa" && model.empresa)
9201
10663
  model.empresa = Empresa.fromDto(model.empresa, "ContratoCompra");
@@ -9211,11 +10673,11 @@
9211
10673
  };
9212
10674
  ContratoCompra.toDto = function (contratoCompra, originEntity) {
9213
10675
  var dto = __assign({}, contratoCompra);
9214
- dto.dataEmissao = dto.dataEmissao && moment$n(dto.dataEmissao).format("YYYY-MM-DD");
9215
- dto.dataInicioVigencia = dto.dataInicioVigencia && moment$n(dto.dataInicioVigencia).format("YYYY-MM-DD");
9216
- dto.dataFimVigencia = dto.dataFimVigencia && moment$n(dto.dataFimVigencia).format("YYYY-MM-DD");
9217
- dto.createdDate = dto.createdDate && moment$n(dto.createdDate).format();
9218
- dto.lastModifiedDate = dto.lastModifiedDate && moment$n(dto.lastModifiedDate).format();
10676
+ dto.dataEmissao = dto.dataEmissao && moment$p(dto.dataEmissao).format("YYYY-MM-DD");
10677
+ dto.dataInicioVigencia = dto.dataInicioVigencia && moment$p(dto.dataInicioVigencia).format("YYYY-MM-DD");
10678
+ dto.dataFimVigencia = dto.dataFimVigencia && moment$p(dto.dataFimVigencia).format("YYYY-MM-DD");
10679
+ dto.createdDate = dto.createdDate && moment$p(dto.createdDate).format();
10680
+ dto.lastModifiedDate = dto.lastModifiedDate && moment$p(dto.lastModifiedDate).format();
9219
10681
  delete dto.label;
9220
10682
  if (originEntity !== "Empresa" && dto.empresa)
9221
10683
  dto.empresa = Empresa.toDto(dto.empresa, "ContratoCompra");
@@ -9236,7 +10698,7 @@
9236
10698
  /*{CA:FILE_CONTENTS:START}*/
9237
10699
  /*{CA:FILE_CONTENTS:END}*/
9238
10700
 
9239
- var moment$o = _moment;
10701
+ var moment$q = _moment;
9240
10702
  /*{CA:PROJECT_IMPORTS:START}*/
9241
10703
  /*{CA:PROJECT_IMPORTS:END}*/
9242
10704
  var ContratoCompraItem = /** @class */ (function () {
@@ -9247,9 +10709,9 @@
9247
10709
  ContratoCompraItem.fromDto = function (contratoCompraItemDto, originEntity) {
9248
10710
  var model = __assign({}, contratoCompraItemDto);
9249
10711
  model.sku = model.sku || {};
9250
- model.dataCompetencia = model.dataCompetencia && moment$o(model.dataCompetencia).toDate();
9251
- model.createdDate = model.createdDate && moment$o(model.createdDate).toDate();
9252
- model.lastModifiedDate = model.lastModifiedDate && moment$o(model.lastModifiedDate).toDate();
10712
+ model.dataCompetencia = model.dataCompetencia && moment$q(model.dataCompetencia).toDate();
10713
+ model.createdDate = model.createdDate && moment$q(model.createdDate).toDate();
10714
+ model.lastModifiedDate = model.lastModifiedDate && moment$q(model.lastModifiedDate).toDate();
9253
10715
  model.label = model.sequencia + " - " + model.sku.descricao + " - " + model.sku.codigo;
9254
10716
  if (originEntity !== "ContratoCompra" && model.contrato)
9255
10717
  model.contrato = ContratoCompra.fromDto(model.contrato, "ContratoCompraItem");
@@ -9259,9 +10721,9 @@
9259
10721
  };
9260
10722
  ContratoCompraItem.toDto = function (contratoCompraItem, originEntity) {
9261
10723
  var dto = __assign({}, contratoCompraItem);
9262
- dto.dataCompetencia = dto.dataCompetencia && moment$o(dto.dataCompetencia).format("YYYY-MM-DD");
9263
- dto.createdDate = dto.createdDate && moment$o(dto.createdDate).format();
9264
- dto.lastModifiedDate = dto.lastModifiedDate && moment$o(dto.lastModifiedDate).format();
10724
+ dto.dataCompetencia = dto.dataCompetencia && moment$q(dto.dataCompetencia).format("YYYY-MM-DD");
10725
+ dto.createdDate = dto.createdDate && moment$q(dto.createdDate).format();
10726
+ dto.lastModifiedDate = dto.lastModifiedDate && moment$q(dto.lastModifiedDate).format();
9265
10727
  delete dto.label;
9266
10728
  if (originEntity !== "ContratoCompra" && dto.contrato)
9267
10729
  dto.contrato = ContratoCompra.toDto(dto.contrato, "ContratoCompraItem");
@@ -9274,7 +10736,7 @@
9274
10736
  /*{CA:FILE_CONTENTS:START}*/
9275
10737
  /*{CA:FILE_CONTENTS:END}*/
9276
10738
 
9277
- var moment$p = _moment;
10739
+ var moment$r = _moment;
9278
10740
  var ContratoFormComponent = /** @class */ (function () {
9279
10741
  function ContratoFormComponent(dialogRef, dialogConfig, contratoCompraService, contratoCompraItemService, translate, fb) {
9280
10742
  this.dialogRef = dialogRef;
@@ -9353,7 +10815,7 @@
9353
10815
  if (filial && filial.empresa && filial.empresa.id) {
9354
10816
  filter.empresaId = filial.empresa.id;
9355
10817
  }
9356
- filter.dataEmissao = filter.dataEmissao && moment$p(filter.dataEmissao).format("YYYY-MM-DD");
10818
+ filter.dataEmissao = filter.dataEmissao && moment$r(filter.dataEmissao).format("YYYY-MM-DD");
9357
10819
  var sort = (multiSortMeta || []).length ? { field: multiSortMeta[0].field, order: multiSortMeta[0].order === 1 ? 'Asc' : 'Desc' } : { field: 'numero', order: 'Asc' };
9358
10820
  this.contratoCompraService
9359
10821
  .listContratosCompra(__assign({}, filter, { pessoaId: (this.fornecedor || { id: undefined }).id, produtoId: (this.produto || { id: undefined }).id, filialId: (filial || { id: undefined }).id, tipoAgendamentoId: this.agenda && this.agenda.tipoAgendamento ? this.agenda.tipoAgendamento.id : null, contratosSelecionados: this.contratos, pagina: {
@@ -9581,14 +11043,14 @@
9581
11043
  return Transgenia;
9582
11044
  }());
9583
11045
 
9584
- var moment$q = _moment;
11046
+ var moment$s = _moment;
9585
11047
  var RecebimentoContrato = /** @class */ (function () {
9586
11048
  function RecebimentoContrato() {
9587
11049
  }
9588
11050
  RecebimentoContrato.fromDto = function (recebimentoDto, originEntity) {
9589
11051
  var model = __assign({}, recebimentoDto);
9590
- model.createdDate = model.createdDate && moment$q(model.createdDate).toDate();
9591
- model.lastModifiedDate = model.lastModifiedDate && moment$q(model.lastModifiedDate).toDate();
11052
+ model.createdDate = model.createdDate && moment$s(model.createdDate).toDate();
11053
+ model.lastModifiedDate = model.lastModifiedDate && moment$s(model.lastModifiedDate).toDate();
9592
11054
  var lookupSeparator = " - ";
9593
11055
  var displayFields = [
9594
11056
  "id",
@@ -9637,8 +11099,8 @@
9637
11099
  };
9638
11100
  RecebimentoContrato.toDto = function (recebimento, originEntity) {
9639
11101
  var dto = __assign({}, recebimento);
9640
- dto.createdDate = dto.createdDate && moment$q(dto.createdDate).format();
9641
- dto.lastModifiedDate = dto.lastModifiedDate && moment$q(dto.lastModifiedDate).format();
11102
+ dto.createdDate = dto.createdDate && moment$s(dto.createdDate).format();
11103
+ dto.lastModifiedDate = dto.lastModifiedDate && moment$s(dto.lastModifiedDate).format();
9642
11104
  delete dto.label;
9643
11105
  if (originEntity !== "Pessoa" && dto.fornecedor)
9644
11106
  dto.fornecedor = Pessoa.toDto(dto.fornecedor, "Recebimento");
@@ -9666,7 +11128,7 @@
9666
11128
  TipoNotaFiscal["PRODUTOR_RURAL"] = "PRODUTOR_RURAL";
9667
11129
  })(TipoNotaFiscal || (TipoNotaFiscal = {}));
9668
11130
 
9669
- var moment$r = _moment;
11131
+ var moment$t = _moment;
9670
11132
  var RecebimentoFormComponent = /** @class */ (function () {
9671
11133
  function RecebimentoFormComponent(recebimentoService, router, route, messageService, confirmationService, formBuilder, translate, hotkeysService, fieldCustomization, focusService, filialService, transportadoraService, pessoaEnderecoService, contratoCompraService, pessoaService, produtoService, derivacaoService, recebimentoChegadaOverride, notaValidatorService, transgeniaService, dialogService, agendaService, erpProcessService, erpFormConfigService, verificaNotaFiscal, hasChangeService, buildFormField) {
9672
11134
  var _this = this;
@@ -10346,11 +11808,11 @@
10346
11808
  if (typeof value == "number")
10347
11809
  return name + " eq " + value;
10348
11810
  else if (type == angularComponents.FieldType.Date)
10349
- return name + " eq '" + moment$r(value).format("YYYY-MM-DD") + "'";
11811
+ return name + " eq '" + moment$t(value).format("YYYY-MM-DD") + "'";
10350
11812
  else if (type == angularComponents.FieldType.Time)
10351
- return name + " eq '" + moment$r(value).format("HH:mm:ss") + "'";
11813
+ return name + " eq '" + moment$t(value).format("HH:mm:ss") + "'";
10352
11814
  else if (type == angularComponents.FieldType.DateTime)
10353
- return name + " eq '" + moment$r(value).format() + "'";
11815
+ return name + " eq '" + moment$t(value).format() + "'";
10354
11816
  else if (type == angularComponents.FieldType.String)
10355
11817
  return "containing(lower(" + name + "), lower('" + value.replace(/'/g, "\\'") + "'))";
10356
11818
  else
@@ -10389,11 +11851,11 @@
10389
11851
  if (typeof value == "number")
10390
11852
  return name + " eq " + value;
10391
11853
  else if (type == angularComponents.FieldType.Date)
10392
- return name + " eq '" + moment$r(value).format("YYYY-MM-DD") + "'";
11854
+ return name + " eq '" + moment$t(value).format("YYYY-MM-DD") + "'";
10393
11855
  else if (type == angularComponents.FieldType.Time)
10394
- return name + " eq '" + moment$r(value).format("HH:mm:ss") + "'";
11856
+ return name + " eq '" + moment$t(value).format("HH:mm:ss") + "'";
10395
11857
  else if (type == angularComponents.FieldType.DateTime)
10396
- return name + " eq '" + moment$r(value).format() + "'";
11858
+ return name + " eq '" + moment$t(value).format() + "'";
10397
11859
  else if (type == angularComponents.FieldType.Enum)
10398
11860
  return name + " eq '" + value + "'";
10399
11861
  else if (type == angularComponents.FieldType.String)
@@ -10435,11 +11897,11 @@
10435
11897
  if (typeof value == "number")
10436
11898
  return name + " eq " + value;
10437
11899
  else if (type == angularComponents.FieldType.Date)
10438
- return name + " eq '" + moment$r(value).format("YYYY-MM-DD") + "'";
11900
+ return name + " eq '" + moment$t(value).format("YYYY-MM-DD") + "'";
10439
11901
  else if (type == angularComponents.FieldType.Time)
10440
- return name + " eq '" + moment$r(value).format("HH:mm:ss") + "'";
11902
+ return name + " eq '" + moment$t(value).format("HH:mm:ss") + "'";
10441
11903
  else if (type == angularComponents.FieldType.DateTime)
10442
- return name + " eq '" + moment$r(value).format() + "'";
11904
+ return name + " eq '" + moment$t(value).format() + "'";
10443
11905
  else if (type == angularComponents.FieldType.String)
10444
11906
  return "containing(lower(" + name + "), lower('" + value.replace(/'/g, "\\'") + "'))";
10445
11907
  else
@@ -10479,11 +11941,11 @@
10479
11941
  if (typeof value == "number")
10480
11942
  return name + " eq " + value;
10481
11943
  else if (type == angularComponents.FieldType.Date)
10482
- return name + " eq '" + moment$r(value).format("YYYY-MM-DD") + "'";
11944
+ return name + " eq '" + moment$t(value).format("YYYY-MM-DD") + "'";
10483
11945
  else if (type == angularComponents.FieldType.Time)
10484
- return name + " eq '" + moment$r(value).format("HH:mm:ss") + "'";
11946
+ return name + " eq '" + moment$t(value).format("HH:mm:ss") + "'";
10485
11947
  else if (type == angularComponents.FieldType.DateTime)
10486
- return name + " eq '" + moment$r(value).format() + "'";
11948
+ return name + " eq '" + moment$t(value).format() + "'";
10487
11949
  else if (type == angularComponents.FieldType.Enum)
10488
11950
  return name + " eq '" + value + "'";
10489
11951
  else if (type == angularComponents.FieldType.String)
@@ -10580,11 +12042,11 @@
10580
12042
  if (typeof value == "number")
10581
12043
  return name + " eq " + value;
10582
12044
  else if (type == angularComponents.FieldType.Date)
10583
- return name + " eq '" + moment$r(value).format("YYYY-MM-DD") + "'";
12045
+ return name + " eq '" + moment$t(value).format("YYYY-MM-DD") + "'";
10584
12046
  else if (type == angularComponents.FieldType.Time)
10585
- return name + " eq '" + moment$r(value).format("HH:mm:ss") + "'";
12047
+ return name + " eq '" + moment$t(value).format("HH:mm:ss") + "'";
10586
12048
  else if (type == angularComponents.FieldType.DateTime)
10587
- return name + " eq '" + moment$r(value).format() + "'";
12049
+ return name + " eq '" + moment$t(value).format() + "'";
10588
12050
  else if (type == angularComponents.FieldType.String)
10589
12051
  return "containing(lower(" + name + "), lower('" + value.replace(/'/g, "\\'") + "'))";
10590
12052
  else
@@ -10622,11 +12084,11 @@
10622
12084
  if (typeof value == "number")
10623
12085
  return name + " eq " + value;
10624
12086
  else if (type == angularComponents.FieldType.Date)
10625
- return name + " eq '" + moment$r(value).format("YYYY-MM-DD") + "'";
12087
+ return name + " eq '" + moment$t(value).format("YYYY-MM-DD") + "'";
10626
12088
  else if (type == angularComponents.FieldType.Time)
10627
- return name + " eq '" + moment$r(value).format("HH:mm:ss") + "'";
12089
+ return name + " eq '" + moment$t(value).format("HH:mm:ss") + "'";
10628
12090
  else if (type == angularComponents.FieldType.DateTime)
10629
- return name + " eq '" + moment$r(value).format() + "'";
12091
+ return name + " eq '" + moment$t(value).format() + "'";
10630
12092
  else if (type == angularComponents.FieldType.Enum)
10631
12093
  return name + " eq '" + value + "'";
10632
12094
  else if (type == angularComponents.FieldType.String)
@@ -10675,11 +12137,11 @@
10675
12137
  if (typeof value == "number")
10676
12138
  return name + " eq " + value;
10677
12139
  else if (type == angularComponents.FieldType.Date)
10678
- return name + " eq '" + moment$r(value).format("YYYY-MM-DD") + "'";
12140
+ return name + " eq '" + moment$t(value).format("YYYY-MM-DD") + "'";
10679
12141
  else if (type == angularComponents.FieldType.Time)
10680
- return name + " eq '" + moment$r(value).format("HH:mm:ss") + "'";
12142
+ return name + " eq '" + moment$t(value).format("HH:mm:ss") + "'";
10681
12143
  else if (type == angularComponents.FieldType.DateTime)
10682
- return name + " eq '" + moment$r(value).format() + "'";
12144
+ return name + " eq '" + moment$t(value).format() + "'";
10683
12145
  else if (type == angularComponents.FieldType.Enum)
10684
12146
  return name + " eq '" + value + "'";
10685
12147
  else if (type == angularComponents.FieldType.String)
@@ -11626,6 +13088,8 @@
11626
13088
  exports.FilialService = FilialService;
11627
13089
  exports.FormComponent = FormComponent;
11628
13090
  exports.FormDescritor = FormDescritor;
13091
+ exports.FormSamComponent = FormSamComponent;
13092
+ exports.FormSamDescritor = FormSamDescritor;
11629
13093
  exports.HasChangeService = HasChangeService;
11630
13094
  exports.InfoComponent = InfoComponent;
11631
13095
  exports.InfoDescritor = InfoDescritor;
@@ -11658,65 +13122,80 @@
11658
13122
  exports.RecebimentoContratoService = RecebimentoContratoService;
11659
13123
  exports.RoyaltyModule = RoyaltyModule;
11660
13124
  exports.RoyaltyService = RoyaltyService;
13125
+ exports.SAM_SENIOR_HEADER = SAM_SENIOR_HEADER;
11661
13126
  exports.SafraModule = SafraModule;
11662
13127
  exports.SafraService = SafraService;
13128
+ exports.SamSeniorModule = SamSeniorModule;
11663
13129
  exports.SnapshotComponent = SnapshotComponent;
11664
13130
  exports.SnapshotDescritor = SnapshotDescritor;
11665
13131
  exports.TransportadoraModule = TransportadoraModule;
11666
13132
  exports.TransportadoraService = TransportadoraService;
11667
13133
  exports.UnidadeMedidaModule = UnidadeMedidaModule;
11668
13134
  exports.UnidadeMedidaService = UnidadeMedidaService;
13135
+ exports.VisitorListComponent = VisitorListComponent;
13136
+ exports.VisitorListModule = VisitorListModule;
13137
+ exports.VisitorListService = VisitorListService;
11669
13138
  exports.VisualizarBalancaComponent = VisualizarBalancaComponent;
11670
13139
  exports.VisualizarBalancaDescritor = VisualizarBalancaDescritor;
11671
13140
  exports.highlightLanguages = highlightLanguages;
11672
13141
  exports.ɵa = Service;
11673
13142
  exports.ɵb = CustomStompConfig;
11674
- exports.ɵba = RecebimentoOrdemCompraService;
11675
- exports.ɵbb = RecebimentoOrdemCompraChegadaVeiculoOverride;
11676
- exports.ɵbc = RecebimentoOrdemCompraInfoComponent;
11677
- exports.ɵbd = DevolucaoInfoComponent;
11678
- exports.ɵbe = ContratoFormComponent;
11679
- exports.ɵbf = OrdemCompraFormComponent;
11680
- exports.ɵbg = ProcessoAvulsoFormComponent;
11681
- exports.ɵbh = ProcessoAvulsoService;
11682
- exports.ɵbi = ProcessoAvulsoChegadaVeiculoOverride;
11683
- exports.ɵbj = ProcessoAvulsoInfoComponent;
11684
- exports.ɵbk = LogIntegracaoDescritor;
11685
- exports.ɵbl = LogIntegracaoComponent;
11686
- exports.ɵbm = LogIntegracaoService;
11687
- exports.ɵbn = DerivacaoModule;
11688
- exports.ɵbo = DevolucaoModule;
11689
- exports.ɵbp = OrdemCompraModule;
11690
- exports.ɵbq = RecebimentoOrdemCompraModule;
11691
- exports.ɵbr = TransgeniaModule;
11692
- exports.ɵbs = ProcessoAvulsoModule;
11693
- exports.ɵbt = LogIntegracaoModule;
11694
- exports.ɵbu = NotaFormModule;
11695
- exports.ɵbv = NotaFormComponent;
13143
+ exports.ɵba = VerificaNotafiscal;
13144
+ exports.ɵbb = BuildFormField;
13145
+ exports.ɵbc = ExpedicaoFormComponent;
13146
+ exports.ɵbd = ExpedicaoInfoComponent;
13147
+ exports.ɵbe = RecebimentoInfoComponent;
13148
+ exports.ɵbf = DevolucaoFormComponent;
13149
+ exports.ɵbg = DevolucaoService;
13150
+ exports.ɵbh = DevolucaoChegadaVeiculoOverride;
13151
+ exports.ɵbi = RecebimentoOrdemCompraFormComponent;
13152
+ exports.ɵbj = OrdemCompraService;
13153
+ exports.ɵbk = RecebimentoOrdemCompraService;
13154
+ exports.ɵbl = RecebimentoOrdemCompraChegadaVeiculoOverride;
13155
+ exports.ɵbm = RecebimentoOrdemCompraInfoComponent;
13156
+ exports.ɵbn = DevolucaoInfoComponent;
13157
+ exports.ɵbo = ContratoFormComponent;
13158
+ exports.ɵbp = OrdemCompraFormComponent;
13159
+ exports.ɵbq = ProcessoAvulsoFormComponent;
13160
+ exports.ɵbr = ProcessoAvulsoService;
13161
+ exports.ɵbs = ProcessoAvulsoChegadaVeiculoOverride;
13162
+ exports.ɵbt = ProcessoAvulsoInfoComponent;
13163
+ exports.ɵbu = LogIntegracaoDescritor;
13164
+ exports.ɵbv = LogIntegracaoComponent;
13165
+ exports.ɵbw = LogIntegracaoService;
13166
+ exports.ɵbx = DerivacaoModule;
13167
+ exports.ɵby = DevolucaoModule;
13168
+ exports.ɵbz = OrdemCompraModule;
11696
13169
  exports.ɵc = ViewImageComponent;
13170
+ exports.ɵca = RecebimentoOrdemCompraModule;
13171
+ exports.ɵcb = TransgeniaModule;
13172
+ exports.ɵcc = ProcessoAvulsoModule;
13173
+ exports.ɵcd = LogIntegracaoModule;
13174
+ exports.ɵce = NotaFormModule;
13175
+ exports.ɵcf = NotaFormComponent;
11697
13176
  exports.ɵd = LogDescritor;
11698
13177
  exports.ɵe = LogsComponent;
11699
13178
  exports.ɵf = PortariasService;
11700
13179
  exports.ɵg = EntradaComponent;
11701
13180
  exports.ɵh = AgendasComponent;
11702
13181
  exports.ɵi = ConfirmacaoComponent;
11703
- exports.ɵj = EntityService;
11704
- exports.ɵk = IntegrationService;
11705
- exports.ɵl = RecebimentoFormComponent;
11706
- exports.ɵm = FocusService;
11707
- exports.ɵn = DerivacaoService;
11708
- exports.ɵo = NotaValidatorService;
11709
- exports.ɵp = TransgeniaService;
11710
- exports.ɵq = VerificaNotafiscal;
11711
- exports.ɵr = BuildFormField;
11712
- exports.ɵs = ExpedicaoFormComponent;
11713
- exports.ɵt = ExpedicaoInfoComponent;
11714
- exports.ɵu = RecebimentoInfoComponent;
11715
- exports.ɵv = DevolucaoFormComponent;
11716
- exports.ɵw = DevolucaoService;
11717
- exports.ɵx = DevolucaoChegadaVeiculoOverride;
11718
- exports.ɵy = RecebimentoOrdemCompraFormComponent;
11719
- exports.ɵz = OrdemCompraService;
13182
+ exports.ɵj = VisitedInfoDescritor;
13183
+ exports.ɵk = VisitedInfoComponent;
13184
+ exports.ɵl = VisitedInfoService;
13185
+ exports.ɵm = SchedulingComponent;
13186
+ exports.ɵn = LobbyService;
13187
+ exports.ɵo = EntityService;
13188
+ exports.ɵp = SchedulingService;
13189
+ exports.ɵq = VisitanteComponent;
13190
+ exports.ɵr = VisitanteFormComponent;
13191
+ exports.ɵs = CredencialFormComponent;
13192
+ exports.ɵt = FocusService;
13193
+ exports.ɵu = EntityService$1;
13194
+ exports.ɵv = IntegrationService;
13195
+ exports.ɵw = RecebimentoFormComponent;
13196
+ exports.ɵx = DerivacaoService;
13197
+ exports.ɵy = NotaValidatorService;
13198
+ exports.ɵz = TransgeniaService;
11720
13199
 
11721
13200
  Object.defineProperty(exports, '__esModule', { value: true });
11722
13201