@seniorsistemas/yms-integration 1.21.0 → 1.22.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.
- package/bundles/seniorsistemas-yms-integration.umd.js +56 -24
- package/bundles/seniorsistemas-yms-integration.umd.js.map +1 -1
- package/bundles/seniorsistemas-yms-integration.umd.min.js +1 -1
- package/bundles/seniorsistemas-yms-integration.umd.min.js.map +1 -1
- package/esm2015/src/wms/components/document-grid/document-grid.component.js +48 -21
- package/esm2015/src/wms/components/document-grid/insert-key/insert-key.component.js +3 -3
- package/esm2015/src/wms/components/document-grid/register-document/register-document.component.js +11 -6
- package/esm5/src/wms/components/document-grid/document-grid.component.js +49 -21
- package/esm5/src/wms/components/document-grid/insert-key/insert-key.component.js +3 -3
- package/esm5/src/wms/components/document-grid/register-document/register-document.component.js +11 -6
- package/fesm2015/seniorsistemas-yms-integration.js +56 -25
- package/fesm2015/seniorsistemas-yms-integration.js.map +1 -1
- package/fesm5/seniorsistemas-yms-integration.js +57 -25
- package/fesm5/seniorsistemas-yms-integration.js.map +1 -1
- package/package.json +1 -1
- package/seniorsistemas-yms-integration.metadata.json +1 -1
- package/src/wms/components/document-grid/document-grid.component.d.ts +7 -5
- package/src/wms/components/document-grid/register-document/register-document.component.d.ts +1 -1
|
@@ -3128,13 +3128,15 @@
|
|
|
3128
3128
|
}(EntityService));
|
|
3129
3129
|
|
|
3130
3130
|
var DocumentGridComponent = /** @class */ (function () {
|
|
3131
|
-
function DocumentGridComponent(translate, documentService, messageService) {
|
|
3131
|
+
function DocumentGridComponent(translate, documentService, messageService, confirmationService) {
|
|
3132
3132
|
this.translate = translate;
|
|
3133
3133
|
this.documentService = documentService;
|
|
3134
3134
|
this.messageService = messageService;
|
|
3135
|
+
this.confirmationService = confirmationService;
|
|
3135
3136
|
this.viewDocument = new core.EventEmitter();
|
|
3136
3137
|
this.gridData = [];
|
|
3137
3138
|
this.ngUnsubscribe = new rxjs.Subject();
|
|
3139
|
+
this.selection = [];
|
|
3138
3140
|
}
|
|
3139
3141
|
DocumentGridComponent.prototype.ngOnInit = function () {
|
|
3140
3142
|
this.gridColumns = this.getGridColumns();
|
|
@@ -3150,6 +3152,7 @@
|
|
|
3150
3152
|
{
|
|
3151
3153
|
label: this.translate.instant("yms.int.wms_add_document_invoice_key"),
|
|
3152
3154
|
command: function () {
|
|
3155
|
+
_this.selection = [];
|
|
3153
3156
|
_this.visibleInvoiceKey = true;
|
|
3154
3157
|
},
|
|
3155
3158
|
icon: "fa fa-search"
|
|
@@ -3157,6 +3160,7 @@
|
|
|
3157
3160
|
{
|
|
3158
3161
|
label: this.translate.instant("yms.int.wms_add_document_register"),
|
|
3159
3162
|
command: function () {
|
|
3163
|
+
_this.selection = [];
|
|
3160
3164
|
_this.edit = true;
|
|
3161
3165
|
_this.visibleDocumentRegister = true;
|
|
3162
3166
|
},
|
|
@@ -3167,8 +3171,8 @@
|
|
|
3167
3171
|
DocumentGridComponent.prototype.getProp = function (obj, path) {
|
|
3168
3172
|
return path.split(".").reduce(function (result, prop) { return (result[prop] === undefined ? "" : result[prop]); }, obj);
|
|
3169
3173
|
};
|
|
3170
|
-
DocumentGridComponent.prototype.view = function (
|
|
3171
|
-
this.viewDocument.emit(selection);
|
|
3174
|
+
DocumentGridComponent.prototype.view = function () {
|
|
3175
|
+
this.viewDocument.emit(this.selection[0]);
|
|
3172
3176
|
this.visibleDocumentRegister = true;
|
|
3173
3177
|
this.edit = false;
|
|
3174
3178
|
};
|
|
@@ -3188,17 +3192,38 @@
|
|
|
3188
3192
|
});
|
|
3189
3193
|
}
|
|
3190
3194
|
};
|
|
3191
|
-
DocumentGridComponent.prototype.onDelete = function (
|
|
3195
|
+
DocumentGridComponent.prototype.onDelete = function () {
|
|
3192
3196
|
var _this = this;
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3197
|
+
this.confirmationService.confirm({
|
|
3198
|
+
message: this.translate.instant("delete_confirmation_message"),
|
|
3199
|
+
header: this.translate.instant("delete_confirmation_title"),
|
|
3200
|
+
accept: function () {
|
|
3201
|
+
_this.removeDocumentIfIdUndfined();
|
|
3202
|
+
if (_this.selection.length < 1) {
|
|
3203
|
+
return rxjs.empty();
|
|
3204
|
+
}
|
|
3205
|
+
return rxjs.forkJoin(_this.selection.map(function (document) { return _this.documentService.delete(document.id); }))
|
|
3206
|
+
.pipe(operators.takeUntil(_this.ngUnsubscribe))
|
|
3207
|
+
.subscribe(function () {
|
|
3208
|
+
_this.messageService.add({
|
|
3209
|
+
severity: "success",
|
|
3210
|
+
summary: _this.translate.instant("deleted_message_title"),
|
|
3211
|
+
detail: _this.translate.instant("deleted_message_content"),
|
|
3212
|
+
});
|
|
3213
|
+
_this.gridData = [];
|
|
3214
|
+
_this.listDocuments();
|
|
3215
|
+
});
|
|
3216
|
+
}
|
|
3217
|
+
});
|
|
3218
|
+
};
|
|
3219
|
+
DocumentGridComponent.prototype.removeDocumentIfIdUndfined = function () {
|
|
3220
|
+
var _this = this;
|
|
3221
|
+
this.selection.forEach(function (value, index) {
|
|
3222
|
+
if (!value.id) {
|
|
3223
|
+
_this.gridData.splice(index, 1);
|
|
3224
|
+
_this.selection.splice(index, 1);
|
|
3225
|
+
}
|
|
3226
|
+
});
|
|
3202
3227
|
};
|
|
3203
3228
|
DocumentGridComponent.prototype.listDocuments = function () {
|
|
3204
3229
|
var _this = this;
|
|
@@ -3206,14 +3231,15 @@
|
|
|
3206
3231
|
filterQuery: "schedulingId eq '" + this.agenda.id + "'"
|
|
3207
3232
|
})
|
|
3208
3233
|
.subscribe(function (contents) {
|
|
3234
|
+
_this.gridData = [];
|
|
3209
3235
|
if (contents.totalElements > 0) {
|
|
3210
3236
|
_this.gridData = contents.contents;
|
|
3211
3237
|
_this.documentTotalRecords = contents.totalElements;
|
|
3212
3238
|
}
|
|
3213
3239
|
else {
|
|
3214
|
-
_this.disabled = true;
|
|
3215
3240
|
_this.documentTotalRecords = _this.gridData.length;
|
|
3216
3241
|
}
|
|
3242
|
+
_this.disabled = true;
|
|
3217
3243
|
_this.loading = false;
|
|
3218
3244
|
});
|
|
3219
3245
|
};
|
|
@@ -3279,12 +3305,13 @@
|
|
|
3279
3305
|
DocumentGridComponent = __decorate([
|
|
3280
3306
|
core.Component({
|
|
3281
3307
|
selector: 'document-grid',
|
|
3282
|
-
template: "<p-panel>\n <p-header>\n <div class=\"buttons\">\n <div>\n <s-button\n label=\"{{'yms.int.wms_add_document' | translate}}\"\n priority=\"primary\"\n [model]=\"getActions()\"\n [auxiliary]=\"false\">\n </s-button>\n <s-button\n label=\"{{'yms.wms_view_button' | translate}}\"\n priority=\"secondary\"\n [auxiliary]=\"false\"\n [disabled]=\"!selection
|
|
3283
|
-
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}"]
|
|
3308
|
+
template: "<p-panel>\n <p-header>\n <div class=\"buttons\">\n <div>\n <s-button\n label=\"{{'yms.int.wms_add_document' | translate}}\"\n priority=\"primary\"\n [model]=\"getActions()\"\n [auxiliary]=\"false\">\n </s-button>\n <s-button\n label=\"{{'yms.wms_view_button' | translate}}\"\n priority=\"secondary\"\n [auxiliary]=\"false\"\n [disabled]=\"!selection || selection.length !== 1\"\n (onClick)=\"view()\">\n </s-button>\n <s-button\n label=\"{{'yms.wms_delete_button' | translate}}\"\n priority=\"secondary\"\n [disabled]=\"!selection || !selection.length\"\n (click)=\"onDelete()\">\n </s-button>\n </div>\n <s-button\n id=\"refresh-button\"\n priority=\"default\"\n iconClass=\"fa fa-refresh\"\n (onClick)=\"listDocuments()\"\n >\n </s-button>\n </div>\n </p-header>\n <div class=\"ui-g\">\n <div class=\"ui-g-12\" *ngIf=\"gridData && gridData.length; else emptyList\">\n <p-table #documentTable [value]=\"gridData\"\n [columns]=\"gridColumns\" dataKey=\"id\" [lazy]=\"true\" [scrollable]=\"true\" [resizableColumns]=\"true\"\n sortMode=\"multiple\" [paginator]=\"true\" [totalRecords]=\"documentTotalRecords\" rows=\"10\"\n [rowsPerPageOptions]=\"[10, 20, 50, 100]\" [(selection)]=\"selection\"\n [loading]=\"loading\">\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=\"checkbox\" class=\"table-checkbox\">\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\n </th>\n <th id=\"col\" *ngFor=\"let col of columns\" [pSortableColumn]=\"col.field\" pResizableColumn>\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 </tr>\n </ng-template>\n <ng-template pTemplate=\"body\" let-rowData let-columns let-expanded=\"expanded\">\n <tr [pSelectableRow]=\"rowData\">\n <td class=\"table-checkbox\">\n <p-tableCheckbox [value]=\"rowData\"></p-tableCheckbox>\n </td>\n <td (click)=\"selection = [rowData]\">\n <span>{{ rowData[\"logistcUnitName\"] }}</span>\n </td>\n <td (click)=\"selection = [rowData]\">\n <span>{{ rowData[\"logistcUnitDocument\"] }}</span>\n </td>\n <td (click)=\"selection = [rowData]\">\n <span>{{ rowData[\"invoiceKey\"] }}</span>\n </td>\n <td (click)=\"selection = [rowData]\">\n <span>{{ rowData[\"invoiceNumber\"] }}</span>\n </td>\n <td (click)=\"selection = [rowData]\">\n <span>{{ rowData[\"invoiceSerialNumber\"] }}</span>\n </td>\n <td (click)=\"selection = [rowData]\">\n <span>{{ rowData[\"ownerName\"] }}</span>\n </td>\n <td (click)=\"selection = [rowData]\">\n <span>{{ rowData[\"ownerDocument\"] }}</span>\n </td>\n <td (click)=\"selection = [rowData]\">\n <span>{{ rowData[\"orderReceivingCode\"] }}</span>\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"paginatorright\">\n <span [translate]=\"'total_records'\" [translateParams]=\"{ value: documentTotalRecords }\"></span>\n </ng-template>\n </p-table> \n </div>\n </div>\n <register-document\n [edit]=\"edit\"\n [viewDocument]=\"selection\"\n (document)=\"onChangeDocument($event)\"\n [(visible)]=\"visibleDocumentRegister\"\n [agenda]=\"agenda\">\n </register-document>\n <insert-key (document)=\"onChangeDocument($event)\" [(visible)]=\"visibleInvoiceKey\"></insert-key>\n</p-panel>\n<div class=\"button-save\">\n <s-button \n priority=\"primary\" [label]=\"'save' | translate\" [disabled]=\"disabled || !this.gridData\" (click)=\"save()\">\n </s-button>\n</div>\n\n\n<ng-template #emptyList>\n <div class=\"center\">\n <s-empty-state\n iconClass=\"fa fa-exclamation-triangle\" [title]=\"'detail_empty_state_title' | translate\"\n [description]=\"'detail_empty_state_description' | translate\">\n </s-empty-state>\n </div>\n</ng-template>\n",
|
|
3309
|
+
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}"]
|
|
3284
3310
|
}),
|
|
3285
3311
|
__metadata("design:paramtypes", [core$1.TranslateService,
|
|
3286
3312
|
DocumentService,
|
|
3287
|
-
api.MessageService
|
|
3313
|
+
api.MessageService,
|
|
3314
|
+
api.ConfirmationService])
|
|
3288
3315
|
], DocumentGridComponent);
|
|
3289
3316
|
return DocumentGridComponent;
|
|
3290
3317
|
}());
|
|
@@ -3467,15 +3494,20 @@
|
|
|
3467
3494
|
RegisterDocumentComponent.prototype.visibilityConfig = function () {
|
|
3468
3495
|
if (!this.edit && this.visible) {
|
|
3469
3496
|
this.formGroup.disable();
|
|
3470
|
-
this.setValuesFormGroup(this.viewDocument);
|
|
3497
|
+
this.setValuesFormGroup(this.viewDocument[0]);
|
|
3471
3498
|
this.setValueForPartner();
|
|
3472
3499
|
this.hideSaveButton = true;
|
|
3473
3500
|
return this.visible;
|
|
3474
3501
|
}
|
|
3475
|
-
|
|
3502
|
+
if (this.formGroup !== undefined) {
|
|
3503
|
+
this.formGroup.enable();
|
|
3504
|
+
this.setValueForPartner();
|
|
3505
|
+
this.hideSaveButton = false;
|
|
3506
|
+
}
|
|
3476
3507
|
};
|
|
3477
3508
|
RegisterDocumentComponent.prototype.close = function () {
|
|
3478
3509
|
this.visibleChange.emit(false);
|
|
3510
|
+
this.formGroup.reset();
|
|
3479
3511
|
};
|
|
3480
3512
|
RegisterDocumentComponent.prototype.setValuesFormGroup = function (document) {
|
|
3481
3513
|
this.formGroup.get('invoiceKey').setValue(document.invoiceKey);
|
|
@@ -3525,13 +3557,13 @@
|
|
|
3525
3557
|
RegisterDocumentComponent.prototype.successMessage = function () {
|
|
3526
3558
|
this.messageService.add({
|
|
3527
3559
|
severity: "success",
|
|
3528
|
-
summary: this.translateService.instant("saved_message_title"),
|
|
3529
|
-
detail: this.translateService.instant("
|
|
3560
|
+
summary: this.translateService.instant("yms.saved_message_title"),
|
|
3561
|
+
detail: this.translateService.instant("yms.int.wms_success_message_description"),
|
|
3530
3562
|
});
|
|
3531
3563
|
};
|
|
3532
3564
|
__decorate([
|
|
3533
3565
|
core.Input(),
|
|
3534
|
-
__metadata("design:type",
|
|
3566
|
+
__metadata("design:type", Array)
|
|
3535
3567
|
], RegisterDocumentComponent.prototype, "viewDocument", void 0);
|
|
3536
3568
|
__decorate([
|
|
3537
3569
|
core.Input(),
|
|
@@ -3628,7 +3660,7 @@
|
|
|
3628
3660
|
return;
|
|
3629
3661
|
}
|
|
3630
3662
|
_this.document.emit(content.contents[0]);
|
|
3631
|
-
_this.message("success", "yms.int.wms_insert_key_success_message_header", "yms.int.
|
|
3663
|
+
_this.message("success", "yms.int.wms_insert_key_success_message_header", "yms.int.wms_success_message_description");
|
|
3632
3664
|
_this.formGroup.reset();
|
|
3633
3665
|
});
|
|
3634
3666
|
};
|
|
@@ -3657,7 +3689,7 @@
|
|
|
3657
3689
|
InsertKeyComponent = __decorate([
|
|
3658
3690
|
core.Component({
|
|
3659
3691
|
selector: "insert-key",
|
|
3660
|
-
template: "<form [formGroup]=\"formGroup\">\n <p-dialog [(visible)]=\"visible\" (visibleChange)=\"cancel()\">\n <p-header>{{'yms.
|
|
3692
|
+
template: "<form [formGroup]=\"formGroup\">\n <p-dialog [(visible)]=\"visible\" [modal]=\"true\" (visibleChange)=\"cancel()\">\n <p-header>{{'yms.int.wms_insert_key_header' | translate}}</p-header>\n <div class=\"flex py-2 justify-content-center spacing-bottom\">\n <label for=\"key\">{{'yms.int.wms_insert_key_label' | translate}}</label>\n <input id=\"key\" class=\"size-input\" pInputText type=\"text\" formControlName=\"key\">\n </div>\n <div class=\"separator\"></div>\n <div class=\"spacing-top\">\n <s-button pButton label=\"{{'save' | translate}}\" (click)=\"add()\"></s-button>\n <s-button\n type=\"button\"\n class=\"ui-button-link\"\n pButton label=\"{{'cancel' | translate}}\"\n (click)=\"cancel()\">\n </s-button>\n </div>\n </p-dialog>\n</form>",
|
|
3661
3693
|
styles: [".spacing-top{margin-top:10px}.spacing-bottom{margin-bottom:10px}.separator{width:100%;margin:5px 0;height:1px;background-color:#ccc}.size-input{width:550px}"]
|
|
3662
3694
|
}),
|
|
3663
3695
|
__metadata("design:paramtypes", [forms.FormBuilder,
|