@senior-gestao-empresarial/erpx-components 1.15.13 → 1.16.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/senior-gestao-empresarial-erpx-components.umd.js +83 -36
- package/bundles/senior-gestao-empresarial-erpx-components.umd.js.map +1 -1
- package/bundles/senior-gestao-empresarial-erpx-components.umd.min.js +1 -1
- package/bundles/senior-gestao-empresarial-erpx-components.umd.min.js.map +1 -1
- package/components/lote-serie/erp-lote-serie.component.d.ts +9 -2
- package/components/lote-serie/erp-lote-serie.service.d.ts +102 -12
- package/esm2015/components/lote-serie/erp-lote-serie.component.js +59 -18
- package/esm2015/components/lote-serie/erp-lote-serie.service.js +29 -25
- package/esm5/components/lote-serie/erp-lote-serie.component.js +61 -18
- package/esm5/components/lote-serie/erp-lote-serie.service.js +29 -25
- package/fesm2015/senior-gestao-empresarial-erpx-components.js +81 -36
- package/fesm2015/senior-gestao-empresarial-erpx-components.js.map +1 -1
- package/fesm5/senior-gestao-empresarial-erpx-components.js +83 -36
- package/fesm5/senior-gestao-empresarial-erpx-components.js.map +1 -1
- package/package.json +1 -1
- package/senior-gestao-empresarial-erpx-components.metadata.json +1 -1
|
@@ -3824,17 +3824,17 @@
|
|
|
3824
3824
|
function ErpLoteSeriesService(http, messageService) {
|
|
3825
3825
|
this.http = http;
|
|
3826
3826
|
this.messageService = messageService;
|
|
3827
|
-
this.foundationEntitiesUrl =
|
|
3828
|
-
this.supEntitiesUrl =
|
|
3829
|
-
this.queryUrl =
|
|
3827
|
+
this.foundationEntitiesUrl = "erpx_sup/foundation/entities";
|
|
3828
|
+
this.supEntitiesUrl = "erpx_sup/estoque/entities";
|
|
3829
|
+
this.queryUrl = "erpx_sup/estoque/queries";
|
|
3830
3830
|
}
|
|
3831
3831
|
ErpLoteSeriesService.prototype.getProductFamily = function (productID) {
|
|
3832
|
-
return this.http.get(this.foundationEntitiesUrl + "/e075der/" + productID)
|
|
3833
|
-
.pipe(this.defaultCatch());
|
|
3832
|
+
return this.http.get(this.foundationEntitiesUrl + "/e075der/" + productID).pipe(this.defaultCatch());
|
|
3834
3833
|
};
|
|
3835
3834
|
ErpLoteSeriesService.prototype.getProductFamilySupplyInfo = function (familyID) {
|
|
3836
3835
|
var filter = "id eq '" + familyID + "'";
|
|
3837
|
-
return this.http
|
|
3836
|
+
return this.http
|
|
3837
|
+
.get(this.foundationEntitiesUrl + "/e012famSupGer", { params: { filter: filter, displayfields: "ctrVld" } })
|
|
3838
3838
|
.pipe(this.defaultCatch());
|
|
3839
3839
|
};
|
|
3840
3840
|
ErpLoteSeriesService.prototype.listBatch = function (params) {
|
|
@@ -3856,10 +3856,10 @@
|
|
|
3856
3856
|
var _this = this;
|
|
3857
3857
|
return operators.catchError(function (err) {
|
|
3858
3858
|
if (err) {
|
|
3859
|
-
var summary = err.status ? String(err.status) :
|
|
3860
|
-
var detail = (err.error && err.error.message) || err.statusText || err.message ||
|
|
3859
|
+
var summary = err.status ? String(err.status) : "Error";
|
|
3860
|
+
var detail = (err.error && err.error.message) || err.statusText || err.message || "Error";
|
|
3861
3861
|
_this.messageService.add({
|
|
3862
|
-
severity:
|
|
3862
|
+
severity: "error",
|
|
3863
3863
|
summary: summary,
|
|
3864
3864
|
detail: detail,
|
|
3865
3865
|
});
|
|
@@ -3868,26 +3868,26 @@
|
|
|
3868
3868
|
});
|
|
3869
3869
|
};
|
|
3870
3870
|
ErpLoteSeriesService.prototype.getListQueryParams = function (listParams) {
|
|
3871
|
-
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 ?
|
|
3871
|
+
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;
|
|
3872
3872
|
var params = new http.HttpParams();
|
|
3873
|
-
params = params.append(
|
|
3874
|
-
params = params.append(
|
|
3873
|
+
params = params.append("size", String(size));
|
|
3874
|
+
params = params.append("offset", String(page));
|
|
3875
3875
|
if (sort && sort.length) {
|
|
3876
|
-
params = params.append(
|
|
3876
|
+
params = params.append("orderby", sort
|
|
3877
3877
|
.map(function (s) {
|
|
3878
|
-
var order =
|
|
3878
|
+
var order = "";
|
|
3879
3879
|
if (s.order === 1)
|
|
3880
|
-
order =
|
|
3880
|
+
order = " asc";
|
|
3881
3881
|
else if (s.order === -1)
|
|
3882
|
-
order =
|
|
3882
|
+
order = " desc";
|
|
3883
3883
|
return "" + s.field + order;
|
|
3884
3884
|
})
|
|
3885
|
-
.join(
|
|
3885
|
+
.join(", "));
|
|
3886
3886
|
}
|
|
3887
3887
|
if (filterQuery)
|
|
3888
|
-
params = params.append(
|
|
3888
|
+
params = params.append("filter", filterQuery);
|
|
3889
3889
|
if (displayFields && displayFields.length) {
|
|
3890
|
-
params = params.append(
|
|
3890
|
+
params = params.append("displayfields", displayFields.join());
|
|
3891
3891
|
}
|
|
3892
3892
|
return params;
|
|
3893
3893
|
};
|
|
@@ -3895,6 +3895,10 @@
|
|
|
3895
3895
|
var url = "platform/frontend_updater/queries/getFrontend";
|
|
3896
3896
|
return this.http.post(url, getUrlInput).pipe(this.defaultCatch());
|
|
3897
3897
|
};
|
|
3898
|
+
ErpLoteSeriesService.prototype.obterNecessidades = function (obterNecessidadesInput) {
|
|
3899
|
+
var url = "erpx_sup/demandas/queries/obterNecessidades";
|
|
3900
|
+
return this.http.post(url, obterNecessidadesInput).pipe(this.defaultCatch());
|
|
3901
|
+
};
|
|
3898
3902
|
ErpLoteSeriesService.ctorParameters = function () { return [
|
|
3899
3903
|
{ type: http.HttpClient },
|
|
3900
3904
|
{ type: api.MessageService }
|
|
@@ -3958,6 +3962,14 @@
|
|
|
3958
3962
|
}
|
|
3959
3963
|
}
|
|
3960
3964
|
});
|
|
3965
|
+
this.formGroupBatchOrSeries.controls.serie.valueChanges.subscribe(function (value) {
|
|
3966
|
+
if (value) {
|
|
3967
|
+
if (_this.validateInvalidChars && /\t|\r|\n/g.exec(value)) {
|
|
3968
|
+
_this.formGroupBatchOrSeries.controls.serie.setErrors({ 'existsInvalidChar': true });
|
|
3969
|
+
return;
|
|
3970
|
+
}
|
|
3971
|
+
}
|
|
3972
|
+
});
|
|
3961
3973
|
};
|
|
3962
3974
|
ErpLoteSerieComponent.prototype.validaDados = function () {
|
|
3963
3975
|
var _this = this;
|
|
@@ -4675,7 +4687,12 @@
|
|
|
4675
4687
|
if (this.validateInvalidChars) {
|
|
4676
4688
|
var newValue = value.trim();
|
|
4677
4689
|
if (value !== newValue) {
|
|
4678
|
-
this.
|
|
4690
|
+
if (this.loteSerieParams.tipoControleProduto == exports.EnumTipoControleProduto.Serie) {
|
|
4691
|
+
this.formGroupBatchOrSeries.controls.serie.patchValue(newValue);
|
|
4692
|
+
}
|
|
4693
|
+
else {
|
|
4694
|
+
this.formGroupBatchOrSeries.controls.lote.patchValue(newValue);
|
|
4695
|
+
}
|
|
4679
4696
|
}
|
|
4680
4697
|
}
|
|
4681
4698
|
this.getDatas(value.toUpperCase());
|
|
@@ -5075,26 +5092,56 @@
|
|
|
5075
5092
|
var ret = this.translate.instant("" + this.prefix + text, { value: value });
|
|
5076
5093
|
return shortcut ? ret + " " + shortcut : ret;
|
|
5077
5094
|
};
|
|
5078
|
-
ErpLoteSerieComponent.prototype.
|
|
5095
|
+
ErpLoteSerieComponent.prototype.onDistributeSeries = function () {
|
|
5096
|
+
var _this = this;
|
|
5079
5097
|
var _a, _b;
|
|
5080
|
-
var getUrlInput = {
|
|
5081
|
-
identifiers: [
|
|
5082
|
-
{
|
|
5083
|
-
domainName: 'erpx_sup',
|
|
5084
|
-
serviceName: 'demandas',
|
|
5085
|
-
appName: 'erpx-sup-demandas',
|
|
5086
|
-
route: "demandas?companyId=" + this.loteSerieParams.invoiceInformation.company.id + "&branchId=" + this.loteSerieParams.invoiceInformation.branch.id + "&documentNumber=" + ((_b = (_a = this.loteSerieParams) === null || _a === void 0 ? void 0 : _a.orderInformation) === null || _b === void 0 ? void 0 : _b.number) + "&documentType=" + EnumTipoDocumentoParametros.PedidoVenda
|
|
5087
|
-
}
|
|
5088
|
-
]
|
|
5089
|
-
};
|
|
5090
5098
|
this.batchSeriesService
|
|
5091
|
-
.
|
|
5099
|
+
.obterNecessidades({
|
|
5100
|
+
e070empId: this.loteSerieParams.invoiceInformation.company.id,
|
|
5101
|
+
e070filId: this.loteSerieParams.invoiceInformation.branch.id,
|
|
5102
|
+
itensId: [
|
|
5103
|
+
this.loteSerieParams.invoiceInformation.items[0].product.id
|
|
5104
|
+
],
|
|
5105
|
+
tipo: EnumTipoDocumentoParametros.PedidoVenda,
|
|
5106
|
+
documentoId: null,
|
|
5107
|
+
numeroDocumentoPai: [
|
|
5108
|
+
(_b = (_a = this.loteSerieParams) === null || _a === void 0 ? void 0 : _a.orderInformation) === null || _b === void 0 ? void 0 : _b.number.toString()
|
|
5109
|
+
],
|
|
5110
|
+
dataInicial: null,
|
|
5111
|
+
dataFinal: null,
|
|
5112
|
+
situacao: null,
|
|
5113
|
+
codigoDemanda: null,
|
|
5114
|
+
somenteUrgentes: false,
|
|
5115
|
+
pageRequest: {
|
|
5116
|
+
offset: 0,
|
|
5117
|
+
size: 10
|
|
5118
|
+
}
|
|
5119
|
+
})
|
|
5092
5120
|
.pipe(operators.first())
|
|
5093
|
-
.subscribe(function (
|
|
5094
|
-
|
|
5121
|
+
.subscribe(function (_a) {
|
|
5122
|
+
var necessidades = _a.necessidades;
|
|
5123
|
+
var _b, _c;
|
|
5124
|
+
var itemId = (_c = (_b = _this.loteSerieParams) === null || _b === void 0 ? void 0 : _b.orderInformation) === null || _c === void 0 ? void 0 : _c.items[0].id;
|
|
5125
|
+
var atendimento = necessidades.find(function (necessidade) { var _a; return ((_a = necessidade.documento) === null || _a === void 0 ? void 0 : _a.idExterno) === itemId; });
|
|
5126
|
+
var getUrlInput = {
|
|
5127
|
+
identifiers: [
|
|
5128
|
+
{
|
|
5129
|
+
domainName: 'erpx_sup',
|
|
5130
|
+
serviceName: 'demandas',
|
|
5131
|
+
appName: 'erpx-sup-demandas',
|
|
5132
|
+
route: "demandas/atendimentos/" + atendimento.id + "?isSeriesDistributionVisible=true"
|
|
5133
|
+
}
|
|
5134
|
+
]
|
|
5135
|
+
};
|
|
5136
|
+
_this.batchSeriesService
|
|
5137
|
+
.getUrl(getUrlInput)
|
|
5138
|
+
.pipe(operators.first())
|
|
5139
|
+
.subscribe(function (getUrlOutput) {
|
|
5140
|
+
window.open("" + getUrlOutput.frontends[0].embeddedURL, '_blank');
|
|
5141
|
+
});
|
|
5095
5142
|
});
|
|
5096
5143
|
};
|
|
5097
|
-
ErpLoteSerieComponent.prototype.
|
|
5144
|
+
ErpLoteSerieComponent.prototype.isDistributeSeriesButtonVisible = function () {
|
|
5098
5145
|
var _a, _b;
|
|
5099
5146
|
return ((_b = (_a = this.loteSerieParams) === null || _a === void 0 ? void 0 : _a.invoiceInformation) === null || _b === void 0 ? void 0 : _b.origin) === exports.EnumInvoiceOrigin.V2;
|
|
5100
5147
|
};
|
|
@@ -5122,7 +5169,7 @@
|
|
|
5122
5169
|
ErpLoteSerieComponent = __decorate([
|
|
5123
5170
|
core.Component({
|
|
5124
5171
|
selector: 'erp-lote-serie',
|
|
5125
|
-
template: "\n<form [formGroup]=\"formGroupBatchOrSeries\" autocomplete=\"off\">\n <div class=\"sds-section-title\" *ngIf=\"showHeader\">{{titleLoteOrSerie}}</div>\n <div>\n <s-dynamic-form [fields]=\"batchOrSeriesFields\" [form]=\"formGroupBatchOrSeries\"\n [errorMessages]=\"{\n required: translateHtml('error_required'),\n maxlength: translateHtml('error_max_length',maxLength),\n max: translateHtml('error_max_length'),\n minDataValidade: translateHtml('minDataValidade'),\n existsInvalidChar: translateHtml('exists_invalid_char')\n }\">\n </s-dynamic-form>\n </div>\n\n <br>\n <div class=\"ui-fluid\">\n <div class=\"ui-g\">\n <s-button id=\"add-button\" type=\"submit\" [disabled]=\"blockedFields\"\n [label]=\"translateHtml('add')\" (click)=\"addBatchOrSeries()\">\n </s-button>\n <s-button\n *ngIf=\"
|
|
5172
|
+
template: "\n<form [formGroup]=\"formGroupBatchOrSeries\" autocomplete=\"off\">\n <div class=\"sds-section-title\" *ngIf=\"showHeader\">{{titleLoteOrSerie}}</div>\n <div>\n <s-dynamic-form [fields]=\"batchOrSeriesFields\" [form]=\"formGroupBatchOrSeries\"\n [errorMessages]=\"{\n required: translateHtml('error_required'),\n maxlength: translateHtml('error_max_length',maxLength),\n max: translateHtml('error_max_length'),\n minDataValidade: translateHtml('minDataValidade'),\n existsInvalidChar: translateHtml('exists_invalid_char')\n }\">\n </s-dynamic-form>\n </div>\n\n <br>\n <div class=\"ui-fluid\">\n <div class=\"ui-g\">\n <s-button id=\"add-button\" type=\"submit\" [disabled]=\"blockedFields\"\n [label]=\"translateHtml('add')\" (click)=\"addBatchOrSeries()\">\n </s-button>\n <s-button\n *ngIf=\"isDistributeSeriesButtonVisible()\"\n [label]=\"translateHtml('distribute_series')\" (click)=\"onDistributeSeries()\">\n </s-button>\n </div>\n </div>\n\n</form>\n\n<div class=\"sds-section-title\">Totais</div>\n\n<div class=\"ui-g custom-stats\">\n <div class=\"ui-sm-12 ui-md-4\">\n <s-stats-card [animateNumbers]=\"true\" color=\"#0C9348\" [lightMode]=\"true\" [lightVersion]=\"true\"\n iconClass=\"far fa-dollar-sign\"\n [label]=\"translateHtml('totalizador_1_title')\"\n [value]=\"qtdAdistribuir | localizedNumber:locale.number.scale | async\">\n </s-stats-card>\n </div>\n <div class=\"ui-sm-12 ui-md-4 \">\n <s-stats-card [animateNumbers]=\"true\" color=\"#428BCA\" [lightMode]=\"true\" [lightVersion]=\"true\"\n iconClass=\"far fa-dollar-sign\"\n [label]=\"translateHtml('totalizador_2_title')\"\n [value]=\"qtdDistribuida | localizedNumber:locale.number.scale | async\">\n </s-stats-card>\n </div>\n <div class=\"ui-sm-12 ui-md-4\">\n <s-stats-card [animateNumbers]=\"true\" color=\"#C13018\" [lightMode]=\"true\" [lightVersion]=\"true\"\n iconClass=\"far fa-dollar-sign\"\n [label]=\"translateHtml('totalizador_3_title')\"\n [value]=\"qtdRestante | localizedNumber:locale.number.scale | async\">\n </s-stats-card>\n </div>\n</div>\n\n<div class=\"sds-section-title\">{{titleGridLoteOrSerie}}</div>\n\n<s-empty-state id=\"my-empty-state\" *ngIf=\"!gridData.length\" iconClass=\"far fa-dollar-sign\"\n [title]=\"translateHtml('no_distributions_yet')\"\n [description]=\"translateHtml('no_distributions_description')\">\n</s-empty-state>\n\n<div class=\"ui-g\">\n <div class=\"ui-g-12\">\n<p-table *ngIf=\"gridData.length\" [value]=\"gridData\" [columns]=\"gridColumns\" dataKey=\"id\"\n [scrollable]=\"true\"[resizableColumns]=\"true\">\n <ng-template pTemplate=\"header\" let-columns>\n <tr>\n <th *ngFor=\"let col of columns\" style=\"width: 170px\" 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\n <ng-template pTemplate=\"body\" let-rowData let-columns>\n <tr>\n <td style=\"width: 170px\">\n <span>{{ rowData.codigo }}</span>\n </td>\n <td *ngIf=\"!isSerie\" style=\"width: 170px\">\n <span>{{rowData.quantidade | localizedNumber:locale.number.scale | async}}</span>\n </td>\n <td style=\"width: 170px\">\n <span>{{rowData.dataFabricacao | localizedDate:\"L\" | async }}</span>\n </td>\n <td style=\"width: 170px\">\n <span>{{rowData.dataValidade | localizedDate:\"L\" | async }}</span>\n </td>\n <td style=\"width: 170px\">\n <div class=\"ui-fluid\">\n <div class=\"ui-g\">\n <!-- <s-button id=\"add-button\" type=\"submit\"\n [label]=\"translateHtml('add')\" (click)=\"addBatchOrSeries()\">\n </s-button> -->\n <s-button id=\"delete-button\" priority=\"default\" [auxiliary]=\"true\" [disabled]=\"blockedFields\"\n [title]=\"translateHtml('deleted_message_title',null,'(Alt + Shift + X)')\"\n [label]=\"translateHtml('deleted_message_title')\" (click)=\"removeBatchOrSeries(rowData)\">\n </s-button>\n </div>\n </div>\n </td>\n </tr>\n </ng-template>\n</p-table>\n</div>\n</div>\n"
|
|
5126
5173
|
})
|
|
5127
5174
|
], ErpLoteSerieComponent);
|
|
5128
5175
|
return ErpLoteSerieComponent;
|