@seniorsistemas/yms-integration 1.48.0 → 1.49.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.
@@ -4121,6 +4121,7 @@
4121
4121
  this.dadosColetaService = dadosColetaService;
4122
4122
  this.ngUnsubscribe = new rxjs.Subject();
4123
4123
  this.summary = "yms.int.wms_saved_document_message_title";
4124
+ this.searchSubject = new rxjs.Subject();
4124
4125
  this.currentStrategy = null;
4125
4126
  // State subjects
4126
4127
  this.stateSubject = new rxjs.BehaviorSubject({
@@ -4128,6 +4129,8 @@
4128
4129
  selection: [],
4129
4130
  gridColumns: [],
4130
4131
  documentTotalRecords: 0,
4132
+ searchTerm: "",
4133
+ searchLoading: false,
4131
4134
  loading: false,
4132
4135
  disabled: true,
4133
4136
  showInvoiceSearchModal: false,
@@ -4151,8 +4154,14 @@
4151
4154
  });
4152
4155
  // Inicialização
4153
4156
  DocumentGridFacade.prototype.init = function (agenda, wmsSystem) {
4157
+ var _this = this;
4154
4158
  this.agenda = agenda;
4155
4159
  this.updateState({ wmsSystem: wmsSystem });
4160
+ this.searchSubject
4161
+ .pipe(operators.debounceTime(500), operators.takeUntil(this.ngUnsubscribe))
4162
+ .subscribe(function () {
4163
+ _this.listDocuments(false);
4164
+ });
4156
4165
  this.verifyClienteExterno();
4157
4166
  this.getProcessTypeByScheduling();
4158
4167
  this.listDocuments(false);
@@ -4375,11 +4384,17 @@
4375
4384
  DocumentGridFacade.prototype.notSavedDocuments = function () {
4376
4385
  return this.state.gridData.some(function (document) { return !document.id; });
4377
4386
  };
4387
+ DocumentGridFacade.prototype.onSearchTermChange = function (searchTerm) {
4388
+ this.updateState({ searchTerm: searchTerm, searchLoading: true });
4389
+ this.searchSubject.next(searchTerm);
4390
+ };
4378
4391
  DocumentGridFacade.prototype.listDocuments = function (isDelete) {
4379
4392
  var _this = this;
4393
+ var filterQuery = this.buildFilterQuery(this.state.searchTerm);
4394
+ this.updateState({ searchLoading: true });
4380
4395
  this.documentService
4381
4396
  .list({
4382
- filterQuery: "schedulingId eq '" + this.agenda.id + "'",
4397
+ filterQuery: filterQuery,
4383
4398
  size: 100,
4384
4399
  })
4385
4400
  .subscribe(function (contents) {
@@ -4400,6 +4415,7 @@
4400
4415
  gridData: documentsWithColeta,
4401
4416
  disabled: !hasElementWithoutId,
4402
4417
  loading: false,
4418
+ searchLoading: false,
4403
4419
  selection: [],
4404
4420
  documentTotalRecords: documentTotalRecords,
4405
4421
  });
@@ -4410,12 +4426,22 @@
4410
4426
  gridData: newGridData,
4411
4427
  disabled: !hasElementWithoutId,
4412
4428
  loading: false,
4429
+ searchLoading: false,
4413
4430
  selection: [],
4414
4431
  documentTotalRecords: documentTotalRecords,
4415
4432
  });
4416
4433
  }
4417
4434
  });
4418
4435
  };
4436
+ DocumentGridFacade.prototype.buildFilterQuery = function (searchTerm) {
4437
+ var schedulingFilter = "schedulingId eq '" + this.agenda.id + "'";
4438
+ var term = (searchTerm || "").trim();
4439
+ if (!term) {
4440
+ return schedulingFilter;
4441
+ }
4442
+ var escapedTerm = term.replace(/'/g, "''");
4443
+ return schedulingFilter + " and (containing(key,'" + escapedTerm + "') or containing(invoiceNumber,'" + escapedTerm + "') or containing(partnerDocument,'" + escapedTerm + "'))";
4444
+ };
4419
4445
  DocumentGridFacade.prototype.fetchNumeroColetaForDocuments = function (documents) {
4420
4446
  var _this = this;
4421
4447
  // Busca o número da coleta para a agenda
@@ -4616,6 +4642,9 @@
4616
4642
  DocumentGridComponent.prototype.onSearch = function () {
4617
4643
  this.facade.openInvoiceKeyModal();
4618
4644
  };
4645
+ DocumentGridComponent.prototype.onSearchTermChange = function (searchTerm) {
4646
+ this.facade.onSearchTermChange(searchTerm);
4647
+ };
4619
4648
  __decorate([
4620
4649
  core.Input(),
4621
4650
  __metadata("design:type", Object)
@@ -4663,8 +4692,8 @@
4663
4692
  DocumentGridComponent = __decorate([
4664
4693
  core.Component({
4665
4694
  selector: "document-grid",
4666
- template: "<ng-container *ngIf=\"state$ | async as state\">\n <div\n *ngIf=\"state.processType === 'RECEBIMENTO_WMS' || state.processType === 'EXPEDICAO_WMS'; else processNotConfigured\"\n >\n <p-panel>\n <p-header>\n <div class=\"buttons\">\n <div>\n <s-button\n *ngIf=\"!isExpedicaoWms(state.processType)\"\n label=\"{{ 'yms.int.wms_add_document' | translate }}\"\n priority=\"primary\"\n [model]=\"getActions()\"\n [auxiliary]=\"false\"\n [disabled]=\"!state.enableButtonIsClienteExterno\"\n >\n </s-button>\n <s-button\n *ngIf=\"isExpedicaoWms(state.processType)\"\n label=\"{{ 'yms.int.wms_search' | translate }}\"\n priority=\"primary\"\n iconClass=\"fa fa-search\"\n [auxiliary]=\"false\"\n [disabled]=\"!state.enableButtonIsClienteExterno\"\n (onClick)=\"onSearch()\"\n >\n </s-button>\n <s-button\n label=\"{{ 'yms.wms_view_button' | translate }}\"\n priority=\"secondary\"\n [auxiliary]=\"false\"\n [disabled]=\"!state.selection || state.selection.length !== 1\"\n (onClick)=\"onView()\"\n >\n </s-button>\n <s-button\n *ngIf=\"!isExpedicaoWms(state.processType)\"\n label=\"{{ 'yms.wms_delete_button' | translate }}\"\n priority=\"secondary\"\n [disabled]=\"\n !state.selection ||\n !state.selection.length ||\n !state.enableButtonIsClienteExterno\n \"\n (onClick)=\"onDelete()\"\n >\n </s-button>\n </div>\n <s-button\n id=\"refresh-button\"\n priority=\"default\"\n iconClass=\"fa fa-refresh\"\n (onClick)=\"onRefresh()\"\n [disabled]=\"notSavedDocuments()\"\n >\n </s-button>\n </div>\n </p-header>\n <div class=\"ui-g\">\n <div\n class=\"ui-g-12\"\n *ngIf=\"state.gridData && state.gridData.length; else emptyList\"\n >\n <p-table\n #documentTable\n [value]=\"state.gridData\"\n [columns]=\"state.gridColumns\"\n dataKey=\"key\"\n [scrollable]=\"true\"\n [resizableColumns]=\"true\"\n [autoLayout]=\"true\"\n [paginator]=\"true\"\n [totalRecords]=\"state.documentTotalRecords\"\n rows=\"10\"\n [rowsPerPageOptions]=\"[10, 20, 50, 100]\"\n [(selection)]=\"state.selection\"\n [loading]=\"state.loading\"\n >\n <ng-template pTemplate=\"header\" let-columns>\n <tr>\n <th id=\"checkbox\" class=\"table-checkbox\">\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\n </th>\n <th id=\"col\" *ngFor=\"let col of columns\" pResizableColumn>\n <div class=\"senior-header\">\n <span class=\"senior-header-title\">{{ col.header }}</span>\n </div>\n </th>\n </tr>\n </ng-template>\n <ng-template\n pTemplate=\"body\"\n let-rowData\n let-columns\n let-expanded=\"expanded\"\n >\n <tr [pSelectableRow]=\"rowData\">\n <td class=\"table-checkbox\">\n <p-tableCheckbox [value]=\"rowData\"></p-tableCheckbox>\n </td>\n <td\n *ngFor=\"let col of state.gridColumns\"\n (click)=\"onRowSelect(rowData)\"\n (keypress)=\"onRowSelect(rowData)\"\n [title]=\"rowData[col.field]\"\n >\n <span *ngIf=\"!col.type || col.type === 'text'\">\n {{ rowData[col.field] }}\n </span>\n\n <span\n *ngIf=\"\n col.type === 'formatted' && col.pipe === 'cpfCnpjFormat'\n \"\n >\n {{ rowData[col.field] | cpfCnpjFormat }}\n </span>\n\n <p-dropdown\n *ngIf=\"\n col.type === 'dropdown' &&\n col.field === 'invoiceCondition' &&\n !isExpedicaoWms(state.processType)\n \"\n inputId=\"invoiceCondition\"\n name=\"invoiceCondition\"\n [autoWidth]=\"false\"\n [options]=\"\n getFilteredInvoiceConditions(rowData?.invoiceCondition)\n \"\n appendTo=\"body\"\n [(ngModel)]=\"rowData.invoiceCondition\"\n (onChange)=\"onInvoiceConditionChange()\"\n >\n </p-dropdown>\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"paginatorright\">\n <span\n [translate]=\"'yms.main.total_records'\"\n [translateParams]=\"{ value: state.documentTotalRecords }\"\n >\n </span>\n </ng-template>\n </p-table>\n </div>\n </div>\n <register-document\n [wmsSystem]=\"state.wmsSystem\"\n [processType]=\"state.processType\"\n [edit]=\"state.edit\"\n [viewDocument]=\"state.selection\"\n [(visible)]=\"state.showAddInvoiceModal\"\n [agenda]=\"agenda\"\n [isClienteExterno]=\"state.isClienteExterno\"\n (document)=\"onDocumentChange($event)\"\n >\n </register-document>\n <insert-key\n [wmsSystem]=\"state.wmsSystem\"\n [agenda]=\"agenda\"\n [(visible)]=\"state.showInvoiceSearchModal\"\n >\n </insert-key>\n </p-panel>\n </div>\n <div class=\"button-save\">\n <s-button\n priority=\"primary\"\n [label]=\"'save' | translate\"\n [disabled]=\"\n state.disabled || !state.gridData || !state.enableButtonIsClienteExterno\n \"\n (onClick)=\"onSave()\"\n >\n </s-button>\n </div>\n</ng-container>\n\n<ng-template #emptyList>\n <div class=\"center\">\n <s-empty-state\n iconClass=\"fa fa-exclamation-triangle\"\n [title]=\"'detail_empty_state_title' | translate\"\n [description]=\"'detail_empty_state_description' | translate\"\n >\n </s-empty-state>\n </div>\n</ng-template>\n\n<ng-template #processNotConfigured>\n <div class=\"center\">\n <s-empty-state\n iconClass=\"fa fa-exclamation-triangle\"\n [title]=\"\n 'yms.int.wms_there_no_process_type_configured_for_this_type_scheduling'\n | translate\n \"\n >\n </s-empty-state>\n </div>\n</ng-template>\n",
4667
- styles: [".buttons{display:flex;justify-content:space-between}.center{flex-direction:column;text-align:center}.ui-g{display:block}.button-save{margin:5px 0}#refresh-button{color:#fff}.table-checkbox{width:50px;min-width:50px;max-width:50px}.invoice-condition .p-dropdown{position:relative;z-index:1000}::ng-deep p-table .ui-table{table-layout:auto!important}::ng-deep p-table td:nth-child(1),::ng-deep p-table th:nth-child(1){min-width:50px;max-width:50px;width:50px}::ng-deep p-table td:nth-child(3),::ng-deep p-table td:nth-child(4),::ng-deep p-table td:nth-child(5),::ng-deep p-table th:nth-child(3),::ng-deep p-table th:nth-child(4),::ng-deep p-table th:nth-child(5){min-width:100px}::ng-deep p-table td:nth-child(7),::ng-deep p-table td:nth-child(9),::ng-deep p-table th:nth-child(7),::ng-deep p-table th:nth-child(9){min-width:140px}::ng-deep p-table td:nth-child(10),::ng-deep p-table td:nth-child(2),::ng-deep p-table td:nth-child(6),::ng-deep p-table td:nth-child(8),::ng-deep p-table th:nth-child(10),::ng-deep p-table th:nth-child(2),::ng-deep p-table th:nth-child(6),::ng-deep p-table th:nth-child(8){min-width:180px}::ng-deep p-table td span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}::ng-deep p-table .ui-resizable-column{border-right:1px solid #c8c8c8}::ng-deep p-table .ui-column-resizer{display:block;position:absolute;top:0;right:0;margin:0;width:.5rem;height:100%;padding:0;cursor:col-resize;border:1px solid transparent}::ng-deep p-table .ui-column-resizer:hover{border-color:#007ad9}"]
4695
+ template: "<ng-container *ngIf=\"state$ | async as state\">\n <div\n *ngIf=\"state.processType === 'RECEBIMENTO_WMS' || state.processType === 'EXPEDICAO_WMS'; else processNotConfigured\"\n >\n <p-panel>\n <p-header>\n <div class=\"buttons\">\n <div>\n <s-button\n *ngIf=\"!isExpedicaoWms(state.processType)\"\n label=\"{{ 'yms.int.wms_add_document' | translate }}\"\n priority=\"primary\"\n [model]=\"getActions()\"\n [auxiliary]=\"false\"\n [disabled]=\"!state.enableButtonIsClienteExterno\"\n >\n </s-button>\n <s-button\n *ngIf=\"isExpedicaoWms(state.processType)\"\n label=\"{{ 'yms.int.wms_search' | translate }}\"\n priority=\"primary\"\n iconClass=\"fa fa-search\"\n [auxiliary]=\"false\"\n [disabled]=\"!state.enableButtonIsClienteExterno\"\n (onClick)=\"onSearch()\"\n >\n </s-button>\n <s-button\n label=\"{{ 'yms.wms_view_button' | translate }}\"\n priority=\"secondary\"\n [auxiliary]=\"false\"\n [disabled]=\"!state.selection || state.selection.length !== 1\"\n (onClick)=\"onView()\"\n >\n </s-button>\n <s-button\n *ngIf=\"!isExpedicaoWms(state.processType)\"\n label=\"{{ 'yms.wms_delete_button' | translate }}\"\n priority=\"secondary\"\n [disabled]=\"\n !state.selection ||\n !state.selection.length ||\n !state.enableButtonIsClienteExterno\n \"\n (onClick)=\"onDelete()\"\n >\n </s-button>\n </div>\n <div class=\"document-search\">\n <input\n pInputText\n type=\"text\"\n [ngModel]=\"state.searchTerm\"\n (ngModelChange)=\"onSearchTermChange($event)\"\n [placeholder]=\"'yms.int.wms_search' | translate\"\n />\n <i *ngIf=\"state.searchLoading\" class=\"fa fa-circle-notch fa-spin document-search-spinner\"></i>\n </div>\n <s-button\n id=\"refresh-button\"\n priority=\"default\"\n iconClass=\"fa fa-refresh\"\n (onClick)=\"onRefresh()\"\n [disabled]=\"notSavedDocuments()\"\n >\n </s-button>\n </div>\n </p-header>\n <div class=\"ui-g\">\n <div\n class=\"ui-g-12\"\n *ngIf=\"state.gridData && state.gridData.length; else emptyList\"\n >\n <p-table\n #documentTable\n [value]=\"state.gridData\"\n [columns]=\"state.gridColumns\"\n dataKey=\"key\"\n [scrollable]=\"true\"\n [resizableColumns]=\"true\"\n [autoLayout]=\"true\"\n [paginator]=\"true\"\n [totalRecords]=\"state.documentTotalRecords\"\n rows=\"10\"\n [rowsPerPageOptions]=\"[10, 20, 50, 100]\"\n [(selection)]=\"state.selection\"\n [loading]=\"state.loading\"\n >\n <ng-template pTemplate=\"header\" let-columns>\n <tr>\n <th id=\"checkbox\" class=\"table-checkbox\">\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\n </th>\n <th id=\"col\" *ngFor=\"let col of columns\" pResizableColumn>\n <div class=\"senior-header\">\n <span class=\"senior-header-title\">{{ col.header }}</span>\n </div>\n </th>\n </tr>\n </ng-template>\n <ng-template\n pTemplate=\"body\"\n let-rowData\n let-columns\n let-expanded=\"expanded\"\n >\n <tr [pSelectableRow]=\"rowData\">\n <td class=\"table-checkbox\">\n <p-tableCheckbox [value]=\"rowData\"></p-tableCheckbox>\n </td>\n <td\n *ngFor=\"let col of state.gridColumns\"\n (click)=\"onRowSelect(rowData)\"\n (keypress)=\"onRowSelect(rowData)\"\n [title]=\"rowData[col.field]\"\n >\n <span *ngIf=\"!col.type || col.type === 'text'\">\n {{ rowData[col.field] }}\n </span>\n\n <span\n *ngIf=\"\n col.type === 'formatted' && col.pipe === 'cpfCnpjFormat'\n \"\n >\n {{ rowData[col.field] | cpfCnpjFormat }}\n </span>\n\n <p-dropdown\n *ngIf=\"\n col.type === 'dropdown' &&\n col.field === 'invoiceCondition' &&\n !isExpedicaoWms(state.processType)\n \"\n inputId=\"invoiceCondition\"\n name=\"invoiceCondition\"\n [autoWidth]=\"false\"\n [options]=\"\n getFilteredInvoiceConditions(rowData?.invoiceCondition)\n \"\n appendTo=\"body\"\n [(ngModel)]=\"rowData.invoiceCondition\"\n (onChange)=\"onInvoiceConditionChange()\"\n >\n </p-dropdown>\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"paginatorright\">\n <span\n [translate]=\"'yms.main.total_records'\"\n [translateParams]=\"{ value: state.documentTotalRecords }\"\n >\n </span>\n </ng-template>\n </p-table>\n </div>\n </div>\n <register-document\n [wmsSystem]=\"state.wmsSystem\"\n [processType]=\"state.processType\"\n [edit]=\"state.edit\"\n [viewDocument]=\"state.selection\"\n [(visible)]=\"state.showAddInvoiceModal\"\n [agenda]=\"agenda\"\n [isClienteExterno]=\"state.isClienteExterno\"\n (document)=\"onDocumentChange($event)\"\n >\n </register-document>\n <insert-key\n [wmsSystem]=\"state.wmsSystem\"\n [agenda]=\"agenda\"\n [(visible)]=\"state.showInvoiceSearchModal\"\n >\n </insert-key>\n </p-panel>\n </div>\n <div class=\"button-save\">\n <s-button\n priority=\"primary\"\n [label]=\"'save' | translate\"\n [disabled]=\"\n state.disabled || !state.gridData || !state.enableButtonIsClienteExterno\n \"\n (onClick)=\"onSave()\"\n >\n </s-button>\n </div>\n</ng-container>\n\n<ng-template #emptyList>\n <div class=\"center\">\n <s-empty-state\n iconClass=\"fa fa-exclamation-triangle\"\n [title]=\"'detail_empty_state_title' | translate\"\n [description]=\"'detail_empty_state_description' | translate\"\n >\n </s-empty-state>\n </div>\n</ng-template>\n\n<ng-template #processNotConfigured>\n <div class=\"center\">\n <s-empty-state\n iconClass=\"fa fa-exclamation-triangle\"\n [title]=\"\n 'yms.int.wms_there_no_process_type_configured_for_this_type_scheduling'\n | translate\n \"\n >\n </s-empty-state>\n </div>\n</ng-template>\n",
4696
+ styles: [".buttons{display:flex;justify-content:space-between;align-items:center;gap:12px}.document-search{flex:1;max-width:420px;position:relative}.document-search input{display:block;width:100%;padding-right:32px}.document-search-spinner{position:absolute;right:10px;top:0;bottom:0;margin:auto 0;width:1em;height:1em;line-height:1;color:#007ad9;pointer-events:none}.center{flex-direction:column;text-align:center}.ui-g{display:block}.button-save{margin:5px 0}#refresh-button{color:#fff}@media (max-width:1200px){.buttons{flex-wrap:wrap}.document-search{order:3;flex-basis:100%;max-width:100%}}.table-checkbox{width:50px;min-width:50px;max-width:50px}.invoice-condition .p-dropdown{position:relative;z-index:1000}::ng-deep p-table .ui-table{table-layout:auto!important}::ng-deep p-table td:nth-child(1),::ng-deep p-table th:nth-child(1){min-width:50px;max-width:50px;width:50px}::ng-deep p-table td:nth-child(3),::ng-deep p-table td:nth-child(4),::ng-deep p-table td:nth-child(5),::ng-deep p-table th:nth-child(3),::ng-deep p-table th:nth-child(4),::ng-deep p-table th:nth-child(5){min-width:100px}::ng-deep p-table td:nth-child(7),::ng-deep p-table td:nth-child(9),::ng-deep p-table th:nth-child(7),::ng-deep p-table th:nth-child(9){min-width:140px}::ng-deep p-table td:nth-child(10),::ng-deep p-table td:nth-child(2),::ng-deep p-table td:nth-child(6),::ng-deep p-table td:nth-child(8),::ng-deep p-table th:nth-child(10),::ng-deep p-table th:nth-child(2),::ng-deep p-table th:nth-child(6),::ng-deep p-table th:nth-child(8){min-width:180px}::ng-deep p-table td span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}::ng-deep p-table .ui-resizable-column{border-right:1px solid #c8c8c8}::ng-deep p-table .ui-column-resizer{display:block;position:absolute;top:0;right:0;margin:0;width:.5rem;height:100%;padding:0;cursor:col-resize;border:1px solid transparent}::ng-deep p-table .ui-column-resizer:hover{border-color:#007ad9}"]
4668
4697
  }),
4669
4698
  __metadata("design:paramtypes", [DocumentGridFacade,
4670
4699
  api.ConfirmationService,
@@ -5263,6 +5292,7 @@
5263
5292
  primeng.DropdownModule,
5264
5293
  forms.FormsModule,
5265
5294
  primeng.ConfirmDialogModule,
5295
+ inputtext.InputTextModule,
5266
5296
  CpfCnpjFormatModule,
5267
5297
  ],
5268
5298
  })
@@ -5330,6 +5360,10 @@
5330
5360
  ymsRoutines.ControleCircuito({
5331
5361
  header: INFORMACAOES_ADICIONAIS_HEADER$1,
5332
5362
  name: 'yms.integracao.wms'
5363
+ }),
5364
+ ymsRoutines.CircuitoFinalizado({
5365
+ header: INFORMACAOES_ADICIONAIS_HEADER$1,
5366
+ name: 'yms.integracao.wms'
5333
5367
  })
5334
5368
  ], DocumentListDescritor);
5335
5369
  return DocumentListDescritor;
@@ -5345,6 +5379,7 @@
5345
5379
  _this.documents = [];
5346
5380
  _this.amendedDocuments = [];
5347
5381
  _this.labels = [];
5382
+ _this.gridTotalRecords = 0;
5348
5383
  _this.selected = [];
5349
5384
  _this.gridLoading = true;
5350
5385
  _this.ngUnsubscribe = new rxjs.Subject();