@seniorsistemas/yms-integration 1.3.1 → 1.3.2
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 +463 -537
- 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/seniorsistemas-yms-integration.js +2 -2
- package/esm2015/src/erp-senior/components/nota-form/nota-form.component.js +13 -8
- package/esm2015/src/erp-senior/core/entities/agenda/agenda.service.js +1 -7
- package/esm2015/src/erp-senior/core/entities/contrato-compra/contrato-compra-dto.js +1 -5
- package/esm2015/src/erp-senior/core/entities/contrato-compra/contrato-compra.service.js +1 -9
- package/esm2015/src/erp-senior/core/entities/entity-service.js +1 -11
- package/esm2015/src/erp-senior/core/entities/ordem-compra/ordem-compra-dto.js +1 -5
- package/esm2015/src/erp-senior/core/entities/ordem-compra/ordem-compra.service.js +5 -9
- package/esm2015/src/erp-senior/core/entities/recebimento-contrato/recebimento-dto.js +1 -5
- package/esm2015/src/erp-senior/core/entities/recebimento-ordem-compra/recebimento-ordem-compra-dto.js +1 -5
- package/esm2015/src/erp-senior/core/entities/recebimento-ordem-compra-details/recebimento-ordem-compra-fornecedor.js +1 -1
- package/esm2015/src/erp-senior/erp-senior.module.js +2 -2
- package/esm2015/src/erp-senior/expedicao/form/expedicao-form.component.js +26 -24
- package/esm2015/src/erp-senior/recebimento/contrato-form/contrato-form.component.js +7 -6
- package/esm2015/src/erp-senior/recebimento/form/recebimento-form.component.js +43 -150
- package/esm2015/src/erp-senior/recebimento/info/recebimento-info.component.js +20 -23
- package/esm2015/src/erp-senior/recebimento-ordem-compra/form/recebimento-ordem-compra-form.component.js +113 -114
- package/esm2015/src/erp-senior/recebimento-ordem-compra/info/recebimento-ordem-compra-info.component.js +111 -0
- package/esm2015/src/erp-senior/recebimento-ordem-compra/ordem-compra-form/ordem-compra-form.component.js +81 -32
- package/esm5/seniorsistemas-yms-integration.js +2 -2
- package/esm5/src/erp-senior/components/nota-form/nota-form.component.js +14 -9
- package/esm5/src/erp-senior/core/entities/agenda/agenda.service.js +1 -7
- package/esm5/src/erp-senior/core/entities/contrato-compra/contrato-compra-dto.js +1 -5
- package/esm5/src/erp-senior/core/entities/contrato-compra/contrato-compra.service.js +1 -9
- package/esm5/src/erp-senior/core/entities/entity-service.js +1 -11
- package/esm5/src/erp-senior/core/entities/ordem-compra/ordem-compra-dto.js +1 -5
- package/esm5/src/erp-senior/core/entities/ordem-compra/ordem-compra.service.js +5 -9
- package/esm5/src/erp-senior/core/entities/recebimento-contrato/recebimento-dto.js +1 -5
- package/esm5/src/erp-senior/core/entities/recebimento-ordem-compra/recebimento-ordem-compra-dto.js +1 -5
- package/esm5/src/erp-senior/core/entities/recebimento-ordem-compra-details/recebimento-ordem-compra-fornecedor.js +1 -1
- package/esm5/src/erp-senior/erp-senior.module.js +2 -2
- package/esm5/src/erp-senior/expedicao/form/expedicao-form.component.js +26 -24
- package/esm5/src/erp-senior/recebimento/contrato-form/contrato-form.component.js +7 -6
- package/esm5/src/erp-senior/recebimento/form/recebimento-form.component.js +41 -150
- package/esm5/src/erp-senior/recebimento/info/recebimento-info.component.js +2 -2
- package/esm5/src/erp-senior/recebimento-ordem-compra/form/recebimento-ordem-compra-form.component.js +125 -135
- package/esm5/src/erp-senior/recebimento-ordem-compra/info/recebimento-ordem-compra-info.component.js +45 -0
- package/esm5/src/erp-senior/recebimento-ordem-compra/ordem-compra-form/ordem-compra-form.component.js +88 -32
- package/fesm2015/seniorsistemas-yms-integration.js +484 -551
- package/fesm2015/seniorsistemas-yms-integration.js.map +1 -1
- package/fesm5/seniorsistemas-yms-integration.js +462 -536
- package/fesm5/seniorsistemas-yms-integration.js.map +1 -1
- package/package.json +1 -1
- package/seniorsistemas-yms-integration.d.ts +1 -1
- package/seniorsistemas-yms-integration.metadata.json +1 -1
- package/src/erp-senior/core/entities/ordem-compra/ordem-compra.service.d.ts +14 -0
- package/src/erp-senior/core/entities/recebimento-ordem-compra/recebimento-ordem-compra-dto.d.ts +7 -0
- package/src/erp-senior/core/entities/recebimento-ordem-compra-details/recebimento-ordem-compra-fornecedor.d.ts +2 -2
- package/src/erp-senior/recebimento/contrato-form/contrato-form.component.d.ts +2 -2
- package/src/erp-senior/recebimento/form/recebimento-form.component.d.ts +1 -1
- package/src/erp-senior/recebimento-ordem-compra/form/recebimento-ordem-compra-form.component.d.ts +4 -5
- package/src/erp-senior/recebimento-ordem-compra/info/{info/recebimento-ordem-compra-info.component.d.ts → recebimento-ordem-compra-info.component.d.ts} +2 -2
- package/src/erp-senior/recebimento-ordem-compra/ordem-compra-form/ordem-compra-form.component.d.ts +15 -10
- package/esm2015/src/erp-senior/recebimento-ordem-compra/info/info/recebimento-ordem-compra-info.component.js +0 -103
- package/esm5/src/erp-senior/recebimento-ordem-compra/info/info/recebimento-ordem-compra-info.component.js +0 -43
|
@@ -1165,13 +1165,7 @@
|
|
|
1165
1165
|
return PortariasModule;
|
|
1166
1166
|
}());
|
|
1167
1167
|
|
|
1168
|
-
/*{CA:PACKAGE_IMPORTS:START}*/
|
|
1169
|
-
/*{CA:PACKAGE_IMPORTS:END}*/
|
|
1170
|
-
/*{CA:PROJECT_IMPORTS:START}*/
|
|
1171
|
-
/*{CA:PROJECT_IMPORTS:END}*/
|
|
1172
1168
|
var EntityService = /** @class */ (function () {
|
|
1173
|
-
/*{CA:CLASS_ATTRIBUTES:START}*/
|
|
1174
|
-
/*{CA:CLASS_ATTRIBUTES:END}*/
|
|
1175
1169
|
function EntityService(http, messageService, entityUrl, actionsUrl) {
|
|
1176
1170
|
this.http = http;
|
|
1177
1171
|
this.messageService = messageService;
|
|
@@ -1182,8 +1176,6 @@
|
|
|
1182
1176
|
this.entityUrl = entityUrl;
|
|
1183
1177
|
this.actionsUrl = actionsUrl;
|
|
1184
1178
|
this.defaultCatch = this.defaultCatch.bind(this);
|
|
1185
|
-
/*{CA:CONSTRUCTOR_END:START}*/
|
|
1186
|
-
/*{CA:CONSTRUCTOR_END:END}*/
|
|
1187
1179
|
}
|
|
1188
1180
|
EntityService.prototype.getListQueryParams = function (listParams) {
|
|
1189
1181
|
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;
|
|
@@ -1266,13 +1258,9 @@
|
|
|
1266
1258
|
};
|
|
1267
1259
|
return EntityService;
|
|
1268
1260
|
}());
|
|
1269
|
-
/*{CA:FILE_CONTENTS:START}*/
|
|
1270
|
-
/*{CA:FILE_CONTENTS:END}*/
|
|
1271
1261
|
|
|
1272
1262
|
var ERP_ENVIRONMENT = new core.InjectionToken('integration_environment');
|
|
1273
1263
|
|
|
1274
|
-
/*{CA:PROJECT_IMPORTS:START}*/
|
|
1275
|
-
/*{CA:PROJECT_IMPORTS:END}*/
|
|
1276
1264
|
var AgendaService = /** @class */ (function (_super) {
|
|
1277
1265
|
__extends(AgendaService, _super);
|
|
1278
1266
|
function AgendaService(http, messageService, environment) {
|
|
@@ -1281,8 +1269,6 @@
|
|
|
1281
1269
|
_this.messageService = messageService;
|
|
1282
1270
|
_this._agendaUrl = environment.project.domain + "/patio";
|
|
1283
1271
|
return _this;
|
|
1284
|
-
/*{CA:CONSTRUCTOR_END:START}*/
|
|
1285
|
-
/*{CA:CONSTRUCTOR_END:END}*/
|
|
1286
1272
|
}
|
|
1287
1273
|
AgendaService.prototype.atualizarAgenda = function (agenda) {
|
|
1288
1274
|
return this.http.post(this._agendaUrl + "/actions/atualizarAgenda", { agenda: agenda }).pipe(this.defaultCatch());
|
|
@@ -1305,8 +1291,6 @@
|
|
|
1305
1291
|
], AgendaService);
|
|
1306
1292
|
return AgendaService;
|
|
1307
1293
|
}(EntityService));
|
|
1308
|
-
/*{CA:FILE_CONTENTS:START}*/
|
|
1309
|
-
/*{CA:FILE_CONTENTS:END}*/
|
|
1310
1294
|
|
|
1311
1295
|
/*{CA:PROJECT_IMPORTS:START}*/
|
|
1312
1296
|
/*{CA:PROJECT_IMPORTS:END}*/
|
|
@@ -1675,6 +1659,27 @@
|
|
|
1675
1659
|
/*{CA:FILE_CONTENTS:START}*/
|
|
1676
1660
|
/*{CA:FILE_CONTENTS:END}*/
|
|
1677
1661
|
|
|
1662
|
+
var OrdemCompraService = /** @class */ (function (_super) {
|
|
1663
|
+
__extends(OrdemCompraService, _super);
|
|
1664
|
+
function OrdemCompraService(http, messageService, environment) {
|
|
1665
|
+
var _this = _super.call(this, http, messageService, environment.project.domain + "/" + environment.project.service + "/entities/ordemCompra", environment.project.domain + "/" + environment.project.service + "/actions") || this;
|
|
1666
|
+
_this.http = http;
|
|
1667
|
+
_this.messageService = messageService;
|
|
1668
|
+
_this.environment = environment;
|
|
1669
|
+
return _this;
|
|
1670
|
+
}
|
|
1671
|
+
OrdemCompraService.prototype.listOrdensCompra = function (params) {
|
|
1672
|
+
return this.http.post(this.environment.project.domain + "/" + this.environment.project.service + "/queries/pesquisarOrdensCompra", params).pipe(this.defaultCatch());
|
|
1673
|
+
};
|
|
1674
|
+
OrdemCompraService = __decorate([
|
|
1675
|
+
core.Injectable(),
|
|
1676
|
+
__param(2, core.Inject(ERP_ENVIRONMENT)),
|
|
1677
|
+
__metadata("design:paramtypes", [http.HttpClient,
|
|
1678
|
+
messageservice.MessageService, Object])
|
|
1679
|
+
], OrdemCompraService);
|
|
1680
|
+
return OrdemCompraService;
|
|
1681
|
+
}(EntityService));
|
|
1682
|
+
|
|
1678
1683
|
var numberTypes = [angularComponents.FieldType.Integer, angularComponents.FieldType.Double];
|
|
1679
1684
|
var numberPattern = /^\d+\b$/;
|
|
1680
1685
|
var mergeUnique = function (array, otherArray) {
|
|
@@ -1827,31 +1832,6 @@
|
|
|
1827
1832
|
.pipe(operators.map(function (list) { return (__assign({}, list, { contents: list.contents.map(function (item) { return (__assign({}, item, { label: getLookupLabel(item, lookupDisplayFields, lookupSeparator) })); }) })); }));
|
|
1828
1833
|
};
|
|
1829
1834
|
|
|
1830
|
-
/*{CA:PROJECT_IMPORTS:START}*/
|
|
1831
|
-
/*{CA:PROJECT_IMPORTS:END}*/
|
|
1832
|
-
var OrdemCompraService = /** @class */ (function (_super) {
|
|
1833
|
-
__extends(OrdemCompraService, _super);
|
|
1834
|
-
/*{CA:CLASS_ATTRIBUTES:START}*/
|
|
1835
|
-
/*{CA:CLASS_ATTRIBUTES:END}*/
|
|
1836
|
-
function OrdemCompraService(http, messageService, environment) {
|
|
1837
|
-
var _this = _super.call(this, http, messageService, environment.project.domain + "/" + environment.project.service + "/entities/ordemCompra", environment.project.domain + "/" + environment.project.service + "/actions") || this;
|
|
1838
|
-
_this.http = http;
|
|
1839
|
-
_this.messageService = messageService;
|
|
1840
|
-
return _this;
|
|
1841
|
-
/*{CA:CONSTRUCTOR_END:START}*/
|
|
1842
|
-
/*{CA:CONSTRUCTOR_END:END}*/
|
|
1843
|
-
}
|
|
1844
|
-
OrdemCompraService = __decorate([
|
|
1845
|
-
core.Injectable(),
|
|
1846
|
-
__param(2, core.Inject(ERP_ENVIRONMENT)),
|
|
1847
|
-
__metadata("design:paramtypes", [http.HttpClient,
|
|
1848
|
-
messageservice.MessageService, Object])
|
|
1849
|
-
], OrdemCompraService);
|
|
1850
|
-
return OrdemCompraService;
|
|
1851
|
-
}(EntityService));
|
|
1852
|
-
/*{CA:FILE_CONTENTS:START}*/
|
|
1853
|
-
/*{CA:FILE_CONTENTS:END}*/
|
|
1854
|
-
|
|
1855
1835
|
var moment$1 = _moment;
|
|
1856
1836
|
/*{CA:PROJECT_IMPORTS:END}*/
|
|
1857
1837
|
var Empresa = /** @class */ (function () {
|
|
@@ -2212,6 +2192,7 @@
|
|
|
2212
2192
|
/*{CA:FILE_CONTENTS:START}*/
|
|
2213
2193
|
/*{CA:FILE_CONTENTS:END}*/
|
|
2214
2194
|
|
|
2195
|
+
var moment$a = _moment;
|
|
2215
2196
|
var OrdemCompraFormComponent = /** @class */ (function () {
|
|
2216
2197
|
function OrdemCompraFormComponent(dialogRef, dialogConfig, ordemCompraService, translate, fb) {
|
|
2217
2198
|
this.dialogRef = dialogRef;
|
|
@@ -2223,14 +2204,19 @@
|
|
|
2223
2204
|
this.ordemCompraAdvancedDisplayFields = ["id", "codigo", "empresa.nome", "filial.nome", "pessoa.nome"];
|
|
2224
2205
|
this.ordemCompraLookupSeparator = " - ";
|
|
2225
2206
|
this.ngUnsubscribe = new rxjs.Subject();
|
|
2226
|
-
this.formGroup = this.getGroup();
|
|
2227
2207
|
}
|
|
2228
2208
|
OrdemCompraFormComponent.prototype.ngOnInit = function () {
|
|
2229
2209
|
var data = this.dialogConfig.data;
|
|
2210
|
+
this.agenda = data.agenda;
|
|
2211
|
+
this.filial = data.filial;
|
|
2212
|
+
this.fornecedor = data.fornecedor;
|
|
2213
|
+
this.ordensCompra = data.ordens.map(function (_a) {
|
|
2214
|
+
var ordemCompra = _a.ordemCompra;
|
|
2215
|
+
return !!ordemCompra ? ordemCompra.id : undefined;
|
|
2216
|
+
}).filter(function (val) { return !!val; });
|
|
2217
|
+
this.formGroup = this.getForm();
|
|
2230
2218
|
this.ordemCompraSearchFields = this.getOrdemCompraFields();
|
|
2231
2219
|
this.ordemCompraSearchGridFields = this.getOrdemCompraGridFields();
|
|
2232
|
-
this.fornecedor = data.fornecedor;
|
|
2233
|
-
this.filial = data.filial;
|
|
2234
2220
|
};
|
|
2235
2221
|
OrdemCompraFormComponent.prototype.ngOnDestroy = function () {
|
|
2236
2222
|
this.ngUnsubscribe.next();
|
|
@@ -2238,44 +2224,100 @@
|
|
|
2238
2224
|
};
|
|
2239
2225
|
OrdemCompraFormComponent.prototype.onOrdemCompraLookupRequest = function (value) {
|
|
2240
2226
|
var _this = this;
|
|
2241
|
-
|
|
2242
|
-
|
|
2227
|
+
var sort = this.ordemCompraLookupDisplayFields.map(function (field) { return ({ field: field, order: 'Asc' }); })[0];
|
|
2228
|
+
var filter = {
|
|
2229
|
+
numero: +value.replace(/\D/g, "")
|
|
2230
|
+
};
|
|
2231
|
+
var filial = this.filial;
|
|
2232
|
+
if (filial && filial.empresa && filial.empresa.id) {
|
|
2233
|
+
filter.empresaId = filial.empresa.id;
|
|
2234
|
+
}
|
|
2235
|
+
this.ordemCompraService
|
|
2236
|
+
.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: {
|
|
2237
|
+
limit: 30,
|
|
2238
|
+
offset: 0,
|
|
2239
|
+
listaOrdenacao: [
|
|
2240
|
+
{
|
|
2241
|
+
campo: sort.field,
|
|
2242
|
+
ordenacao: sort.order
|
|
2243
|
+
}
|
|
2244
|
+
]
|
|
2245
|
+
} }))
|
|
2243
2246
|
.subscribe(function (list) {
|
|
2244
|
-
_this.ordemCompraLookupSuggestions = list.contents;
|
|
2247
|
+
_this.ordemCompraLookupSuggestions = list.contents.map(OrdemCompra.fromDto);
|
|
2245
2248
|
});
|
|
2246
2249
|
};
|
|
2247
|
-
OrdemCompraFormComponent.prototype.
|
|
2250
|
+
OrdemCompraFormComponent.prototype.onOrdemCompraSearchRequest = function (event) {
|
|
2248
2251
|
var _this = this;
|
|
2249
|
-
var
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2252
|
+
var first = event.first, rows = event.rows, multiSortMeta = event.multiSortMeta, filterData = event.filterData;
|
|
2253
|
+
var page = first / rows;
|
|
2254
|
+
var filter = this.getOrdemCompraFields()
|
|
2255
|
+
.filter(function (_a) {
|
|
2256
|
+
var name = _a.name;
|
|
2257
|
+
return filterData[name] != undefined && filterData[name] != "";
|
|
2258
|
+
})
|
|
2259
|
+
.reduce(function (a, b) {
|
|
2260
|
+
var _a;
|
|
2261
|
+
return __assign({}, a, (_a = {}, _a[b.name] = filterData[b.name], _a));
|
|
2262
|
+
}, {});
|
|
2263
|
+
var filial = this.filial;
|
|
2264
|
+
if (filial && filial.empresa && filial.empresa.id) {
|
|
2265
|
+
filter.empresaId = filial.empresa.id;
|
|
2266
|
+
}
|
|
2267
|
+
filter.dataEmissao = filter.dataEmissao && moment$a(filter.dataEmissao).format("YYYY-MM-DD");
|
|
2268
|
+
var sort = (multiSortMeta || []).length ? { field: multiSortMeta[0].field, order: multiSortMeta[0].order === 1 ? 'Asc' : 'Desc' } : { field: 'numero', order: 'Asc' };
|
|
2269
|
+
this.ordemCompraService
|
|
2270
|
+
.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: {
|
|
2271
|
+
limit: rows,
|
|
2272
|
+
offset: page,
|
|
2273
|
+
listaOrdenacao: [
|
|
2274
|
+
{
|
|
2275
|
+
campo: sort.field,
|
|
2276
|
+
ordenacao: sort.order
|
|
2277
|
+
}
|
|
2278
|
+
]
|
|
2279
|
+
} }))
|
|
2280
|
+
.subscribe(function (list) {
|
|
2254
2281
|
_this.ordemCompraSearchGridData = list.contents.map(OrdemCompra.fromDto);
|
|
2255
2282
|
_this.ordemCompraSearchTotalRecords = list.totalElements;
|
|
2256
2283
|
});
|
|
2257
2284
|
};
|
|
2285
|
+
OrdemCompraFormComponent.prototype.getRecPagina = function (first, rows, sort) {
|
|
2286
|
+
var page = first / rows;
|
|
2287
|
+
var orderBy = sort && sort.length
|
|
2288
|
+
? sort.map(function (s) { return ({ campo: s.field, ordenacao: s.order === 1 ? 'Asc' : 'Desc' }); })
|
|
2289
|
+
: [];
|
|
2290
|
+
return {
|
|
2291
|
+
offset: page,
|
|
2292
|
+
limit: rows,
|
|
2293
|
+
listaOrdenacao: orderBy
|
|
2294
|
+
};
|
|
2295
|
+
};
|
|
2258
2296
|
OrdemCompraFormComponent.prototype.validateAllFormFields = function (formGroup) {
|
|
2259
2297
|
var _this = this;
|
|
2260
2298
|
Object.keys(formGroup.controls).forEach(function (field) {
|
|
2261
2299
|
var control = formGroup.get(field);
|
|
2262
|
-
if (control instanceof forms.FormControl)
|
|
2300
|
+
if (control instanceof forms.FormControl) {
|
|
2263
2301
|
control.markAsDirty({ onlySelf: true });
|
|
2264
|
-
|
|
2302
|
+
}
|
|
2303
|
+
else if (control instanceof forms.FormGroup) {
|
|
2265
2304
|
_this.validateAllFormFields(control);
|
|
2266
|
-
|
|
2305
|
+
}
|
|
2306
|
+
else if (control instanceof forms.FormArray) {
|
|
2267
2307
|
control.controls.forEach(function (form) { return _this.validateAllFormFields(form); });
|
|
2308
|
+
}
|
|
2268
2309
|
});
|
|
2269
2310
|
};
|
|
2270
2311
|
OrdemCompraFormComponent.prototype.save = function () {
|
|
2271
|
-
if (!this.formGroup.valid)
|
|
2312
|
+
if (!this.formGroup.valid) {
|
|
2272
2313
|
return this.validateAllFormFields(this.formGroup);
|
|
2314
|
+
}
|
|
2273
2315
|
this.close(this.formGroup.get('ordemCompra').value);
|
|
2274
2316
|
};
|
|
2275
2317
|
OrdemCompraFormComponent.prototype.close = function (data) {
|
|
2276
2318
|
this.dialogRef.close(data);
|
|
2277
2319
|
};
|
|
2278
|
-
OrdemCompraFormComponent.prototype.
|
|
2320
|
+
OrdemCompraFormComponent.prototype.getForm = function () {
|
|
2279
2321
|
return this.fb.group({
|
|
2280
2322
|
ordemCompra: [undefined, forms.Validators.required]
|
|
2281
2323
|
});
|
|
@@ -2325,7 +2367,7 @@
|
|
|
2325
2367
|
};
|
|
2326
2368
|
OrdemCompraFormComponent = __decorate([
|
|
2327
2369
|
core.Component({
|
|
2328
|
-
template: "<form [formGroup]=\"formGroup\">\n <div class=\"ui-g ui-fluid\">\n <div class=\"ui-g-12 ui-md-6\">\n <label for=\"ordemCompra\">Ordem Compra</label>\n <s-lookup dataKey=\"id\" name=\"ordemCompra\"\n formControlName=\"ordemCompra\" [searchFields]=\"ordemCompraSearchFields\"\n [searchGridFields]=\"ordemCompraSearchGridFields\"\n [searchGridData]=\"ordemCompraSearchGridData\" [multiple]=\"false\"\n [lookupSuggestions]=\"ordemCompraLookupSuggestions\"\n (onLookupRequest)=\"onOrdemCompraLookupRequest($event)\"\n (onSearchRequest)=\"
|
|
2370
|
+
template: "<form [formGroup]=\"formGroup\">\n <div class=\"ui-g ui-fluid\">\n <div class=\"ui-g-12 ui-md-6\">\n <label for=\"ordemCompra\">Ordem Compra</label>\n <s-lookup dataKey=\"id\" name=\"ordemCompra\"\n formControlName=\"ordemCompra\" [searchFields]=\"ordemCompraSearchFields\"\n [searchGridFields]=\"ordemCompraSearchGridFields\"\n [searchGridData]=\"ordemCompraSearchGridData\" [multiple]=\"false\"\n [lookupSuggestions]=\"ordemCompraLookupSuggestions\"\n (onLookupRequest)=\"onOrdemCompraLookupRequest($event)\"\n (onSearchRequest)=\"onOrdemCompraSearchRequest($event)\"\n lookupDisplayField=\"label\" [searchTotalRecords]=\"ordemCompraSearchTotalRecords\"\n [searchTitle]=\"'yms.erp.recebimento_ordem_compra_search_title' | translate\"\n [searchEmptyTitle]=\"'yms.erp.nothing_found' | translate\"\n [filterLabel]=\"'yms.erp.filter' | translate\" [clearLabel]=\"'yms.erp.clear' | translate\"\n [cancelLabel]=\"'yms.erp.cancel' | translate\" [selectLabel]=\"'yms.erp.select' | translate\"\n [searchTotalRecordsLabel]=\"'yms.erp.total_records' | translate: {value: ordemCompraSearchTotalRecords}\">\n </s-lookup>\n </div>\n </div>\n \n <div style=\"margin-top: 10px;\">\n <div class=\"separator\"></div>\n <s-button style=\"float: right;\" [label]=\"'save' | translate\" priority=\"primary\" (onClick)=\"save()\"></s-button>\n <s-button style=\"float: right;\" [label]=\"'cancel' | translate\" priority=\"link\" (onClick)=\"close()\"></s-button>\n </div>\n</form>"
|
|
2329
2371
|
}),
|
|
2330
2372
|
__metadata("design:paramtypes", [api.DynamicDialogRef,
|
|
2331
2373
|
api.DynamicDialogConfig,
|
|
@@ -2418,16 +2460,17 @@
|
|
|
2418
2460
|
this.loading = false;
|
|
2419
2461
|
this.unsubscribe$ = new rxjs.Subject();
|
|
2420
2462
|
this.validateNotaFiscal = function (response) {
|
|
2421
|
-
if (!response || !response.documentos[0])
|
|
2463
|
+
if (!response || !response.documentos[0]) {
|
|
2422
2464
|
return;
|
|
2465
|
+
}
|
|
2423
2466
|
var value = response.documentos[0];
|
|
2424
2467
|
if (!value.itens || !value.itens.length) {
|
|
2425
2468
|
return;
|
|
2426
2469
|
}
|
|
2427
|
-
if (!!value.itens[0].produto && !!
|
|
2428
|
-
|
|
2470
|
+
/* if (!!value.itens[0].produto && !!this.produto && (value.itens[0].produto.id !== this.produto.id)) {
|
|
2471
|
+
this.addErrorIfProdutoIsDifferent();
|
|
2429
2472
|
return;
|
|
2430
|
-
}
|
|
2473
|
+
} */
|
|
2431
2474
|
if (!_this.fornecedor) {
|
|
2432
2475
|
_this.closeAndReturnNota({ chave: _this.formGroup.get("chaveNotaFiscal").value, serie: value.serie, numero: value.numero }, value.fornecedor, value.origemMercadoria);
|
|
2433
2476
|
return;
|
|
@@ -2461,10 +2504,12 @@
|
|
|
2461
2504
|
this.unsubscribe$.complete();
|
|
2462
2505
|
};
|
|
2463
2506
|
NotaFormComponent.prototype.save = function () {
|
|
2464
|
-
if (!this.formGroup.get("chaveNotaFiscal").value)
|
|
2507
|
+
if (!this.formGroup.get("chaveNotaFiscal").value) {
|
|
2465
2508
|
this.removeErrorChaveNota();
|
|
2466
|
-
|
|
2509
|
+
}
|
|
2510
|
+
if (!this.formGroup.valid) {
|
|
2467
2511
|
return this.validateAllFormFields(this.formGroup);
|
|
2512
|
+
}
|
|
2468
2513
|
this.close(this.formGroup.value);
|
|
2469
2514
|
};
|
|
2470
2515
|
NotaFormComponent.prototype.close = function (data) {
|
|
@@ -2505,10 +2550,12 @@
|
|
|
2505
2550
|
var _this = this;
|
|
2506
2551
|
Object.keys(formGroup.controls).forEach(function (field) {
|
|
2507
2552
|
var control = formGroup.get(field);
|
|
2508
|
-
if (control instanceof forms.FormControl)
|
|
2553
|
+
if (control instanceof forms.FormControl) {
|
|
2509
2554
|
control.markAsDirty({ onlySelf: true });
|
|
2510
|
-
|
|
2555
|
+
}
|
|
2556
|
+
else if (control instanceof forms.FormGroup) {
|
|
2511
2557
|
_this.validateAllFormFields(control);
|
|
2558
|
+
}
|
|
2512
2559
|
});
|
|
2513
2560
|
formGroup.markAsDirty({ onlySelf: true });
|
|
2514
2561
|
};
|
|
@@ -2703,20 +2750,14 @@
|
|
|
2703
2750
|
/*{CA:FILE_CONTENTS:START}*/
|
|
2704
2751
|
/*{CA:FILE_CONTENTS:END}*/
|
|
2705
2752
|
|
|
2706
|
-
/*{CA:PROJECT_IMPORTS:START}*/
|
|
2707
|
-
/*{CA:PROJECT_IMPORTS:END}*/
|
|
2708
2753
|
var ContratoCompraService = /** @class */ (function (_super) {
|
|
2709
2754
|
__extends(ContratoCompraService, _super);
|
|
2710
|
-
/*{CA:CLASS_ATTRIBUTES:START}*/
|
|
2711
|
-
/*{CA:CLASS_ATTRIBUTES:END}*/
|
|
2712
2755
|
function ContratoCompraService(http, messageService, environment) {
|
|
2713
2756
|
var _this = _super.call(this, http, messageService, environment.project.domain + "/" + environment.project.service + "/entities/contratoCompra", environment.project.domain + "/" + environment.project.service + "/actions") || this;
|
|
2714
2757
|
_this.http = http;
|
|
2715
2758
|
_this.messageService = messageService;
|
|
2716
2759
|
_this.environment = environment;
|
|
2717
2760
|
return _this;
|
|
2718
|
-
/*{CA:CONSTRUCTOR_END:START}*/
|
|
2719
|
-
/*{CA:CONSTRUCTOR_END:END}*/
|
|
2720
2761
|
}
|
|
2721
2762
|
ContratoCompraService.prototype.listContratosCompra = function (params) {
|
|
2722
2763
|
return this.http.post(this.environment.project.domain + "/" + this.environment.project.service + "/queries/pesquisarContratosCompra", params).pipe(this.defaultCatch());
|
|
@@ -2750,8 +2791,6 @@
|
|
|
2750
2791
|
], ContratoCompraService);
|
|
2751
2792
|
return ContratoCompraService;
|
|
2752
2793
|
}(EntityService));
|
|
2753
|
-
/*{CA:FILE_CONTENTS:START}*/
|
|
2754
|
-
/*{CA:FILE_CONTENTS:END}*/
|
|
2755
2794
|
|
|
2756
2795
|
/*{CA:PROJECT_IMPORTS:START}*/
|
|
2757
2796
|
/*{CA:PROJECT_IMPORTS:END}*/
|
|
@@ -4245,7 +4284,7 @@
|
|
|
4245
4284
|
return DevolucaoChegadaVeiculoOverride;
|
|
4246
4285
|
}());
|
|
4247
4286
|
|
|
4248
|
-
var moment$
|
|
4287
|
+
var moment$b = _moment;
|
|
4249
4288
|
var Agenda = /** @class */ (function () {
|
|
4250
4289
|
function Agenda() {
|
|
4251
4290
|
}
|
|
@@ -4253,8 +4292,8 @@
|
|
|
4253
4292
|
/*{CA:CLASS_ATTRIBUTES:END}*/
|
|
4254
4293
|
Agenda.fromDto = function (agendaDto, originEntity) {
|
|
4255
4294
|
var model = __assign({}, agendaDto);
|
|
4256
|
-
model.createdDate = model.createdDate && moment$
|
|
4257
|
-
model.lastModifiedDate = model.lastModifiedDate && moment$
|
|
4295
|
+
model.createdDate = model.createdDate && moment$b(model.createdDate).toDate();
|
|
4296
|
+
model.lastModifiedDate = model.lastModifiedDate && moment$b(model.lastModifiedDate).toDate();
|
|
4258
4297
|
var lookupSeparator = " - ";
|
|
4259
4298
|
var displayFields = ["descricao"];
|
|
4260
4299
|
model.label = getLookupLabel(model, displayFields, lookupSeparator);
|
|
@@ -4262,8 +4301,8 @@
|
|
|
4262
4301
|
};
|
|
4263
4302
|
Agenda.toDto = function (agenda, originEntity) {
|
|
4264
4303
|
var dto = __assign({}, agenda);
|
|
4265
|
-
dto.createdDate = dto.createdDate && moment$
|
|
4266
|
-
dto.lastModifiedDate = dto.lastModifiedDate && moment$
|
|
4304
|
+
dto.createdDate = dto.createdDate && moment$b(dto.createdDate).format();
|
|
4305
|
+
dto.lastModifiedDate = dto.lastModifiedDate && moment$b(dto.lastModifiedDate).format();
|
|
4267
4306
|
delete dto.label;
|
|
4268
4307
|
return dto;
|
|
4269
4308
|
};
|
|
@@ -4272,7 +4311,7 @@
|
|
|
4272
4311
|
/*{CA:FILE_CONTENTS:START}*/
|
|
4273
4312
|
/*{CA:FILE_CONTENTS:END}*/
|
|
4274
4313
|
|
|
4275
|
-
var moment$
|
|
4314
|
+
var moment$c = _moment;
|
|
4276
4315
|
/*{CA:PROJECT_IMPORTS:START}*/
|
|
4277
4316
|
/*{CA:PROJECT_IMPORTS:END}*/
|
|
4278
4317
|
var UnidadeMedida = /** @class */ (function () {
|
|
@@ -4282,8 +4321,8 @@
|
|
|
4282
4321
|
/*{CA:CLASS_ATTRIBUTES:END}*/
|
|
4283
4322
|
UnidadeMedida.fromDto = function (unidadeMedidaDto, originEntity) {
|
|
4284
4323
|
var model = __assign({}, unidadeMedidaDto);
|
|
4285
|
-
model.createdDate = model.createdDate && moment$
|
|
4286
|
-
model.lastModifiedDate = model.lastModifiedDate && moment$
|
|
4324
|
+
model.createdDate = model.createdDate && moment$c(model.createdDate).toDate();
|
|
4325
|
+
model.lastModifiedDate = model.lastModifiedDate && moment$c(model.lastModifiedDate).toDate();
|
|
4287
4326
|
var lookupSeparator = " - ";
|
|
4288
4327
|
var displayFields = [
|
|
4289
4328
|
"id",
|
|
@@ -4300,8 +4339,8 @@
|
|
|
4300
4339
|
};
|
|
4301
4340
|
UnidadeMedida.toDto = function (unidadeMedida, originEntity) {
|
|
4302
4341
|
var dto = __assign({}, unidadeMedida);
|
|
4303
|
-
dto.createdDate = dto.createdDate && moment$
|
|
4304
|
-
dto.lastModifiedDate = dto.lastModifiedDate && moment$
|
|
4342
|
+
dto.createdDate = dto.createdDate && moment$c(dto.createdDate).format();
|
|
4343
|
+
dto.lastModifiedDate = dto.lastModifiedDate && moment$c(dto.lastModifiedDate).format();
|
|
4305
4344
|
delete dto.label;
|
|
4306
4345
|
return dto;
|
|
4307
4346
|
};
|
|
@@ -4310,7 +4349,7 @@
|
|
|
4310
4349
|
/*{CA:FILE_CONTENTS:START}*/
|
|
4311
4350
|
/*{CA:FILE_CONTENTS:END}*/
|
|
4312
4351
|
|
|
4313
|
-
var moment$
|
|
4352
|
+
var moment$d = _moment;
|
|
4314
4353
|
/*{CA:PROJECT_IMPORTS:START}*/
|
|
4315
4354
|
/*{CA:PROJECT_IMPORTS:END}*/
|
|
4316
4355
|
var Royalty = /** @class */ (function () {
|
|
@@ -4320,8 +4359,8 @@
|
|
|
4320
4359
|
/*{CA:CLASS_ATTRIBUTES:END}*/
|
|
4321
4360
|
Royalty.fromDto = function (royaltyDto, originEntity) {
|
|
4322
4361
|
var model = __assign({}, royaltyDto);
|
|
4323
|
-
model.createdDate = model.createdDate && moment$
|
|
4324
|
-
model.lastModifiedDate = model.lastModifiedDate && moment$
|
|
4362
|
+
model.createdDate = model.createdDate && moment$d(model.createdDate).toDate();
|
|
4363
|
+
model.lastModifiedDate = model.lastModifiedDate && moment$d(model.lastModifiedDate).toDate();
|
|
4325
4364
|
var lookupSeparator = " - ";
|
|
4326
4365
|
var displayFields = ["id", "codigo", "descricao", "createdBy", "createdDate", "lastModifiedBy", "lastModifiedDate"];
|
|
4327
4366
|
model.label = displayFields.map(function (field) { return model[field]; }).join(lookupSeparator);
|
|
@@ -4331,8 +4370,8 @@
|
|
|
4331
4370
|
};
|
|
4332
4371
|
Royalty.toDto = function (royalty, originEntity) {
|
|
4333
4372
|
var dto = __assign({}, royalty);
|
|
4334
|
-
dto.createdDate = dto.createdDate && moment$
|
|
4335
|
-
dto.lastModifiedDate = dto.lastModifiedDate && moment$
|
|
4373
|
+
dto.createdDate = dto.createdDate && moment$d(dto.createdDate).format();
|
|
4374
|
+
dto.lastModifiedDate = dto.lastModifiedDate && moment$d(dto.lastModifiedDate).format();
|
|
4336
4375
|
delete dto.label;
|
|
4337
4376
|
if (originEntity !== "Empresa" && dto.empresa)
|
|
4338
4377
|
dto.empresa = Empresa.toDto(dto.empresa, "Royalty");
|
|
@@ -4343,7 +4382,7 @@
|
|
|
4343
4382
|
/*{CA:FILE_CONTENTS:START}*/
|
|
4344
4383
|
/*{CA:FILE_CONTENTS:END}*/
|
|
4345
4384
|
|
|
4346
|
-
var moment$
|
|
4385
|
+
var moment$e = _moment;
|
|
4347
4386
|
/*{CA:PROJECT_IMPORTS:START}*/
|
|
4348
4387
|
/*{CA:PROJECT_IMPORTS:END}*/
|
|
4349
4388
|
var FamiliaProduto = /** @class */ (function () {
|
|
@@ -4353,8 +4392,8 @@
|
|
|
4353
4392
|
/*{CA:CLASS_ATTRIBUTES:END}*/
|
|
4354
4393
|
FamiliaProduto.fromDto = function (familiaProdutoDto, originEntity) {
|
|
4355
4394
|
var model = __assign({}, familiaProdutoDto);
|
|
4356
|
-
model.createdDate = model.createdDate && moment$
|
|
4357
|
-
model.lastModifiedDate = model.lastModifiedDate && moment$
|
|
4395
|
+
model.createdDate = model.createdDate && moment$e(model.createdDate).toDate();
|
|
4396
|
+
model.lastModifiedDate = model.lastModifiedDate && moment$e(model.lastModifiedDate).toDate();
|
|
4358
4397
|
var lookupSeparator = " - ";
|
|
4359
4398
|
var displayFields = ["id", "codigo", "descricao", "situacao", "createdBy", "createdDate", "lastModifiedBy", "lastModifiedDate"];
|
|
4360
4399
|
model.label = displayFields.map(function (field) { return model[field]; }).join(lookupSeparator);
|
|
@@ -4364,8 +4403,8 @@
|
|
|
4364
4403
|
};
|
|
4365
4404
|
FamiliaProduto.toDto = function (familiaProduto, originEntity) {
|
|
4366
4405
|
var dto = __assign({}, familiaProduto);
|
|
4367
|
-
dto.createdDate = dto.createdDate && moment$
|
|
4368
|
-
dto.lastModifiedDate = dto.lastModifiedDate && moment$
|
|
4406
|
+
dto.createdDate = dto.createdDate && moment$e(dto.createdDate).format();
|
|
4407
|
+
dto.lastModifiedDate = dto.lastModifiedDate && moment$e(dto.lastModifiedDate).format();
|
|
4369
4408
|
delete dto.label;
|
|
4370
4409
|
if (originEntity !== "Empresa" && dto.empresa)
|
|
4371
4410
|
dto.empresa = Empresa.toDto(dto.empresa, "FamiliaProduto");
|
|
@@ -4376,7 +4415,7 @@
|
|
|
4376
4415
|
/*{CA:FILE_CONTENTS:START}*/
|
|
4377
4416
|
/*{CA:FILE_CONTENTS:END}*/
|
|
4378
4417
|
|
|
4379
|
-
var moment$
|
|
4418
|
+
var moment$f = _moment;
|
|
4380
4419
|
/*{CA:PROJECT_IMPORTS:START}*/
|
|
4381
4420
|
/*{CA:PROJECT_IMPORTS:END}*/
|
|
4382
4421
|
var Produto = /** @class */ (function () {
|
|
@@ -4390,8 +4429,8 @@
|
|
|
4390
4429
|
/*{CA:CLASS_ATTRIBUTES:END}*/
|
|
4391
4430
|
Produto.fromDto = function (produtoDto, originEntity) {
|
|
4392
4431
|
var model = __assign({}, produtoDto);
|
|
4393
|
-
model.createdDate = model.createdDate && moment$
|
|
4394
|
-
model.lastModifiedDate = model.lastModifiedDate && moment$
|
|
4432
|
+
model.createdDate = model.createdDate && moment$f(model.createdDate).toDate();
|
|
4433
|
+
model.lastModifiedDate = model.lastModifiedDate && moment$f(model.lastModifiedDate).toDate();
|
|
4395
4434
|
var lookupSeparator = " - ";
|
|
4396
4435
|
var displayFields = [
|
|
4397
4436
|
"codigo",
|
|
@@ -4412,8 +4451,8 @@
|
|
|
4412
4451
|
};
|
|
4413
4452
|
Produto.toDto = function (produto, originEntity) {
|
|
4414
4453
|
var dto = __assign({}, produto);
|
|
4415
|
-
dto.createdDate = dto.createdDate && moment$
|
|
4416
|
-
dto.lastModifiedDate = dto.lastModifiedDate && moment$
|
|
4454
|
+
dto.createdDate = dto.createdDate && moment$f(dto.createdDate).format();
|
|
4455
|
+
dto.lastModifiedDate = dto.lastModifiedDate && moment$f(dto.lastModifiedDate).format();
|
|
4417
4456
|
delete dto.label;
|
|
4418
4457
|
if (originEntity !== "Empresa" && dto.empresa)
|
|
4419
4458
|
dto.empresa = Empresa.toDto(dto.empresa, "Produto");
|
|
@@ -4432,7 +4471,7 @@
|
|
|
4432
4471
|
/*{CA:FILE_CONTENTS:START}*/
|
|
4433
4472
|
/*{CA:FILE_CONTENTS:END}*/
|
|
4434
4473
|
|
|
4435
|
-
var moment$
|
|
4474
|
+
var moment$g = _moment;
|
|
4436
4475
|
/*{CA:PROJECT_IMPORTS:START}*/
|
|
4437
4476
|
/*{CA:PROJECT_IMPORTS:END}*/
|
|
4438
4477
|
var Derivacao = /** @class */ (function () {
|
|
@@ -4442,8 +4481,8 @@
|
|
|
4442
4481
|
/*{CA:CLASS_ATTRIBUTES:END}*/
|
|
4443
4482
|
Derivacao.fromDto = function (derivacaoDto, originEntity) {
|
|
4444
4483
|
var model = __assign({}, derivacaoDto);
|
|
4445
|
-
model.createdDate = model.createdDate && moment$
|
|
4446
|
-
model.lastModifiedDate = model.lastModifiedDate && moment$
|
|
4484
|
+
model.createdDate = model.createdDate && moment$g(model.createdDate).toDate();
|
|
4485
|
+
model.lastModifiedDate = model.lastModifiedDate && moment$g(model.lastModifiedDate).toDate();
|
|
4447
4486
|
var lookupSeparator = " - ";
|
|
4448
4487
|
var displayFields = ["codigo", "descricao"];
|
|
4449
4488
|
model.label = getLookupLabel(model, displayFields, lookupSeparator);
|
|
@@ -4455,8 +4494,8 @@
|
|
|
4455
4494
|
};
|
|
4456
4495
|
Derivacao.toDto = function (derivacao, originEntity) {
|
|
4457
4496
|
var dto = __assign({}, derivacao);
|
|
4458
|
-
dto.createdDate = dto.createdDate && moment$
|
|
4459
|
-
dto.lastModifiedDate = dto.lastModifiedDate && moment$
|
|
4497
|
+
dto.createdDate = dto.createdDate && moment$g(dto.createdDate).format();
|
|
4498
|
+
dto.lastModifiedDate = dto.lastModifiedDate && moment$g(dto.lastModifiedDate).format();
|
|
4460
4499
|
delete dto.label;
|
|
4461
4500
|
if (originEntity !== "Empresa" && dto.empresa)
|
|
4462
4501
|
dto.empresa = Empresa.toDto(dto.empresa, "Derivacao");
|
|
@@ -4469,7 +4508,7 @@
|
|
|
4469
4508
|
/*{CA:FILE_CONTENTS:START}*/
|
|
4470
4509
|
/*{CA:FILE_CONTENTS:END}*/
|
|
4471
4510
|
|
|
4472
|
-
var moment$
|
|
4511
|
+
var moment$h = _moment;
|
|
4473
4512
|
/*{CA:PROJECT_IMPORTS:START}*/
|
|
4474
4513
|
/*{CA:PROJECT_IMPORTS:END}*/
|
|
4475
4514
|
var Transportadora = /** @class */ (function () {
|
|
@@ -4479,8 +4518,8 @@
|
|
|
4479
4518
|
/*{CA:CLASS_ATTRIBUTES:END}*/
|
|
4480
4519
|
Transportadora.fromDto = function (transportadoraDto, originEntity) {
|
|
4481
4520
|
var model = __assign({}, transportadoraDto);
|
|
4482
|
-
model.createdDate = model.createdDate && moment$
|
|
4483
|
-
model.lastModifiedDate = model.lastModifiedDate && moment$
|
|
4521
|
+
model.createdDate = model.createdDate && moment$h(model.createdDate).toDate();
|
|
4522
|
+
model.lastModifiedDate = model.lastModifiedDate && moment$h(model.lastModifiedDate).toDate();
|
|
4484
4523
|
var lookupSeparator = " - ";
|
|
4485
4524
|
var displayFields = [
|
|
4486
4525
|
"codigo", "pessoa.nome", "pessoa.cpfCnpj"
|
|
@@ -4494,8 +4533,8 @@
|
|
|
4494
4533
|
};
|
|
4495
4534
|
Transportadora.toDto = function (transportadora, originEntity) {
|
|
4496
4535
|
var dto = __assign({}, transportadora);
|
|
4497
|
-
dto.createdDate = dto.createdDate && moment$
|
|
4498
|
-
dto.lastModifiedDate = dto.lastModifiedDate && moment$
|
|
4536
|
+
dto.createdDate = dto.createdDate && moment$h(dto.createdDate).format();
|
|
4537
|
+
dto.lastModifiedDate = dto.lastModifiedDate && moment$h(dto.lastModifiedDate).format();
|
|
4499
4538
|
delete dto.label;
|
|
4500
4539
|
if (originEntity !== "Pessoa" && dto.pessoa)
|
|
4501
4540
|
dto.pessoa = Pessoa.toDto(dto.pessoa, "Transportadora");
|
|
@@ -4508,7 +4547,7 @@
|
|
|
4508
4547
|
/*{CA:FILE_CONTENTS:START}*/
|
|
4509
4548
|
/*{CA:FILE_CONTENTS:END}*/
|
|
4510
4549
|
|
|
4511
|
-
var moment$
|
|
4550
|
+
var moment$i = _moment;
|
|
4512
4551
|
/*{CA:PROJECT_IMPORTS:START}*/
|
|
4513
4552
|
/*{CA:PROJECT_IMPORTS:END}*/
|
|
4514
4553
|
var Devolucao = /** @class */ (function () {
|
|
@@ -4518,8 +4557,8 @@
|
|
|
4518
4557
|
/*{CA:CLASS_ATTRIBUTES:END}*/
|
|
4519
4558
|
Devolucao.fromDto = function (devolucaoDto, originEntity) {
|
|
4520
4559
|
var model = __assign({}, devolucaoDto);
|
|
4521
|
-
model.createdDate = model.createdDate && moment$
|
|
4522
|
-
model.lastModifiedDate = model.lastModifiedDate && moment$
|
|
4560
|
+
model.createdDate = model.createdDate && moment$i(model.createdDate).toDate();
|
|
4561
|
+
model.lastModifiedDate = model.lastModifiedDate && moment$i(model.lastModifiedDate).toDate();
|
|
4523
4562
|
var lookupSeparator = " - ";
|
|
4524
4563
|
var displayFields = [
|
|
4525
4564
|
''
|
|
@@ -4543,8 +4582,8 @@
|
|
|
4543
4582
|
};
|
|
4544
4583
|
Devolucao.toDto = function (devolucao, originEntity) {
|
|
4545
4584
|
var dto = __assign({}, devolucao);
|
|
4546
|
-
dto.createdDate = dto.createdDate && moment$
|
|
4547
|
-
dto.lastModifiedDate = dto.lastModifiedDate && moment$
|
|
4585
|
+
dto.createdDate = dto.createdDate && moment$i(dto.createdDate).format();
|
|
4586
|
+
dto.lastModifiedDate = dto.lastModifiedDate && moment$i(dto.lastModifiedDate).format();
|
|
4548
4587
|
delete dto.label;
|
|
4549
4588
|
if (originEntity !== "Pessoa" && dto.fornecedor)
|
|
4550
4589
|
dto.fornecedor = Pessoa.toDto(dto.fornecedor, "Devolucao");
|
|
@@ -5202,18 +5241,9 @@
|
|
|
5202
5241
|
return DevolucaoInfoComponent;
|
|
5203
5242
|
}());
|
|
5204
5243
|
|
|
5205
|
-
var StatusAgenda;
|
|
5206
|
-
(function (StatusAgenda) {
|
|
5207
|
-
StatusAgenda["AGUARDANDO_CONFIRMACAO"] = "AGUARDANDO_CONFIRMACAO_SOLICITANTE";
|
|
5208
|
-
StatusAgenda["AGENDADO"] = "AGENDADO";
|
|
5209
|
-
StatusAgenda["AGUARDANDO_CONFIRMACAO_SOLICITANTE"] = "AGUARDANDO_CONFIRMACAO";
|
|
5210
|
-
StatusAgenda["REJEITADO_POR_VALIDACAO"] = "REJEITADO_POR_VALIDACAO";
|
|
5211
|
-
StatusAgenda["CANCELADO"] = "CANCELADO";
|
|
5212
|
-
})(StatusAgenda || (StatusAgenda = {}));
|
|
5213
|
-
|
|
5214
5244
|
/*{CA:PACKAGE_IMPORTS:START}*/
|
|
5215
5245
|
/*{CA:PACKAGE_IMPORTS:END}*/
|
|
5216
|
-
var moment$
|
|
5246
|
+
var moment$j = _moment;
|
|
5217
5247
|
/*{CA:PROJECT_IMPORTS:START}*/
|
|
5218
5248
|
/*{CA:PROJECT_IMPORTS:END}*/
|
|
5219
5249
|
var Expedicao = /** @class */ (function () {
|
|
@@ -5223,8 +5253,8 @@
|
|
|
5223
5253
|
/*{CA:CLASS_ATTRIBUTES:END}*/
|
|
5224
5254
|
Expedicao.fromDto = function (expedicaoDto, originEntity) {
|
|
5225
5255
|
var model = __assign({}, expedicaoDto);
|
|
5226
|
-
model.createdDate = model.createdDate && moment$
|
|
5227
|
-
model.lastModifiedDate = model.lastModifiedDate && moment$
|
|
5256
|
+
model.createdDate = model.createdDate && moment$j(model.createdDate).toDate();
|
|
5257
|
+
model.lastModifiedDate = model.lastModifiedDate && moment$j(model.lastModifiedDate).toDate();
|
|
5228
5258
|
var lookupSeparator = " - ";
|
|
5229
5259
|
var displayFields = [
|
|
5230
5260
|
"id",
|
|
@@ -5263,8 +5293,8 @@
|
|
|
5263
5293
|
};
|
|
5264
5294
|
Expedicao.toDto = function (expedicao, originEntity) {
|
|
5265
5295
|
var dto = __assign({}, expedicao);
|
|
5266
|
-
dto.createdDate = dto.createdDate && moment$
|
|
5267
|
-
dto.lastModifiedDate = dto.lastModifiedDate && moment$
|
|
5296
|
+
dto.createdDate = dto.createdDate && moment$j(dto.createdDate).format();
|
|
5297
|
+
dto.lastModifiedDate = dto.lastModifiedDate && moment$j(dto.lastModifiedDate).format();
|
|
5268
5298
|
delete dto.label;
|
|
5269
5299
|
if (originEntity !== "Pessoa" && dto.clienteFaturamento)
|
|
5270
5300
|
dto.clienteFaturamento = Pessoa.toDto(dto.clienteFaturamento, "Recebimento");
|
|
@@ -5281,7 +5311,7 @@
|
|
|
5281
5311
|
return Expedicao;
|
|
5282
5312
|
}());
|
|
5283
5313
|
|
|
5284
|
-
var moment$
|
|
5314
|
+
var moment$k = _moment;
|
|
5285
5315
|
var ExpedicaoFormComponent = /** @class */ (function () {
|
|
5286
5316
|
function ExpedicaoFormComponent(
|
|
5287
5317
|
/*{CA:INJECTIONS:START}*/
|
|
@@ -5612,8 +5642,6 @@
|
|
|
5612
5642
|
/*{CA:ON_CANCEL_END:END}*/
|
|
5613
5643
|
};
|
|
5614
5644
|
ExpedicaoFormComponent.prototype.onSendFile = function (filesToDelete, filesToCommit) {
|
|
5615
|
-
/*{CA:ON_SEND_FILE:START}*/
|
|
5616
|
-
/*{CA:ON_SEND_FILE:END}*/
|
|
5617
5645
|
var observables = [];
|
|
5618
5646
|
if (!this.fieldCustomization.isEmpty(filesToDelete)) {
|
|
5619
5647
|
observables.push(this.fieldCustomization.deleteFiles(filesToDelete));
|
|
@@ -5667,28 +5695,33 @@
|
|
|
5667
5695
|
this.loading = true;
|
|
5668
5696
|
this.setValuesPedidoBiodisel();
|
|
5669
5697
|
var _a = this.fieldCustomization.getFiles(this.formGroup), filesToDelete = _a.filesToDelete, filesToCommit = _a.filesToCommit;
|
|
5670
|
-
this.
|
|
5671
|
-
|
|
5672
|
-
|
|
5673
|
-
.subscribe(function (res) {
|
|
5674
|
-
if (res.tiposModeloValidacao.includes("CUSTOM")) {
|
|
5675
|
-
_this.agenda.status = StatusAgenda.REJEITADO_POR_VALIDACAO;
|
|
5676
|
-
_this.agendaService
|
|
5677
|
-
.atualizarAgenda(_this.agenda)
|
|
5678
|
-
.pipe(operators.takeUntil(_this.ngUnsubscribe))
|
|
5679
|
-
.subscribe(function (_) {
|
|
5680
|
-
_this.atualizaExpedicao(filesToDelete, filesToCommit, function () {
|
|
5681
|
-
_this.router.navigate(["chegada-veiculo"]);
|
|
5682
|
-
});
|
|
5683
|
-
});
|
|
5698
|
+
this.atualizaExpedicao(filesToDelete, filesToCommit, function () {
|
|
5699
|
+
if (start && _this.saveAndInitButton) {
|
|
5700
|
+
_this.saveAndInitButton.click();
|
|
5684
5701
|
}
|
|
5685
|
-
|
|
5686
|
-
|
|
5687
|
-
|
|
5688
|
-
|
|
5702
|
+
});
|
|
5703
|
+
/* this.agendaService
|
|
5704
|
+
.retornaModelosValidacao(this.agenda.tipoAgendamento.id)
|
|
5705
|
+
.pipe(takeUntil(this.ngUnsubscribe))
|
|
5706
|
+
.subscribe((res: any) => {
|
|
5707
|
+
if (res.tiposModeloValidacao.includes("CUSTOM")) {
|
|
5708
|
+
this.agenda.status = StatusAgenda.REJEITADO_POR_VALIDACAO;
|
|
5709
|
+
this.agendaService
|
|
5710
|
+
.atualizarAgenda(this.agenda)
|
|
5711
|
+
.pipe(takeUntil(this.ngUnsubscribe))
|
|
5712
|
+
.subscribe((_) => {
|
|
5713
|
+
this.atualizaExpedicao(filesToDelete, filesToCommit, () => {
|
|
5714
|
+
this.router.navigate(["chegada-veiculo"]);
|
|
5715
|
+
});
|
|
5689
5716
|
});
|
|
5717
|
+
} else {
|
|
5718
|
+
this.atualizaExpedicao(filesToDelete, filesToCommit, () => {
|
|
5719
|
+
if (start && this.saveAndInitButton) {
|
|
5720
|
+
this.saveAndInitButton.click();
|
|
5721
|
+
}
|
|
5722
|
+
});
|
|
5690
5723
|
}
|
|
5691
|
-
|
|
5724
|
+
}); */
|
|
5692
5725
|
};
|
|
5693
5726
|
ExpedicaoFormComponent.prototype.atualizaExpedicao = function (filesToDelete, filesToCommit, onSubscribe) {
|
|
5694
5727
|
var _this = this;
|
|
@@ -5809,11 +5842,11 @@
|
|
|
5809
5842
|
if (typeof value == "number")
|
|
5810
5843
|
return name + " eq " + value;
|
|
5811
5844
|
else if (type == angularComponents.FieldType.Date)
|
|
5812
|
-
return name + " eq '" + moment$
|
|
5845
|
+
return name + " eq '" + moment$k(value).format("YYYY-MM-DD") + "'";
|
|
5813
5846
|
else if (type == angularComponents.FieldType.Time)
|
|
5814
|
-
return name + " eq '" + moment$
|
|
5847
|
+
return name + " eq '" + moment$k(value).format("HH:mm:ss") + "'";
|
|
5815
5848
|
else if (type == angularComponents.FieldType.DateTime)
|
|
5816
|
-
return name + " eq '" + moment$
|
|
5849
|
+
return name + " eq '" + moment$k(value).format() + "'";
|
|
5817
5850
|
else if (type == angularComponents.FieldType.Enum)
|
|
5818
5851
|
return name + " eq '" + value + "'";
|
|
5819
5852
|
else if (type == angularComponents.FieldType.String)
|
|
@@ -5873,11 +5906,11 @@
|
|
|
5873
5906
|
if (typeof value == "number")
|
|
5874
5907
|
return name + " eq " + value;
|
|
5875
5908
|
else if (type == angularComponents.FieldType.Date)
|
|
5876
|
-
return name + " eq '" + moment$
|
|
5909
|
+
return name + " eq '" + moment$k(value).format("YYYY-MM-DD") + "'";
|
|
5877
5910
|
else if (type == angularComponents.FieldType.Time)
|
|
5878
|
-
return name + " eq '" + moment$
|
|
5911
|
+
return name + " eq '" + moment$k(value).format("HH:mm:ss") + "'";
|
|
5879
5912
|
else if (type == angularComponents.FieldType.DateTime)
|
|
5880
|
-
return name + " eq '" + moment$
|
|
5913
|
+
return name + " eq '" + moment$k(value).format() + "'";
|
|
5881
5914
|
else if (type == angularComponents.FieldType.Enum)
|
|
5882
5915
|
return name + " eq '" + value + "'";
|
|
5883
5916
|
else if (type == angularComponents.FieldType.String)
|
|
@@ -6024,11 +6057,11 @@
|
|
|
6024
6057
|
if (typeof value == "number")
|
|
6025
6058
|
return name + " eq " + value;
|
|
6026
6059
|
else if (type == angularComponents.FieldType.Date)
|
|
6027
|
-
return name + " eq '" + moment$
|
|
6060
|
+
return name + " eq '" + moment$k(value).format("YYYY-MM-DD") + "'";
|
|
6028
6061
|
else if (type == angularComponents.FieldType.Time)
|
|
6029
|
-
return name + " eq '" + moment$
|
|
6062
|
+
return name + " eq '" + moment$k(value).format("HH:mm:ss") + "'";
|
|
6030
6063
|
else if (type == angularComponents.FieldType.DateTime)
|
|
6031
|
-
return name + " eq '" + moment$
|
|
6064
|
+
return name + " eq '" + moment$k(value).format() + "'";
|
|
6032
6065
|
else if (type == angularComponents.FieldType.String)
|
|
6033
6066
|
return "containing(lower(" + name + "), lower('" + value.replace(/'/g, "\\'") + "'))";
|
|
6034
6067
|
else
|
|
@@ -6233,11 +6266,11 @@
|
|
|
6233
6266
|
if (typeof value == "number")
|
|
6234
6267
|
return name + " eq " + value;
|
|
6235
6268
|
else if (type == angularComponents.FieldType.Date)
|
|
6236
|
-
return name + " eq '" + moment$
|
|
6269
|
+
return name + " eq '" + moment$k(value).format("YYYY-MM-DD") + "'";
|
|
6237
6270
|
else if (type == angularComponents.FieldType.Time)
|
|
6238
|
-
return name + " eq '" + moment$
|
|
6271
|
+
return name + " eq '" + moment$k(value).format("HH:mm:ss") + "'";
|
|
6239
6272
|
else if (type == angularComponents.FieldType.DateTime)
|
|
6240
|
-
return name + " eq '" + moment$
|
|
6273
|
+
return name + " eq '" + moment$k(value).format() + "'";
|
|
6241
6274
|
else if (type == angularComponents.FieldType.String)
|
|
6242
6275
|
return "containing(lower(" + name + "), lower('" + value.replace(/'/g, "\\'") + "'))";
|
|
6243
6276
|
else
|
|
@@ -6279,11 +6312,11 @@
|
|
|
6279
6312
|
if (typeof value == "number")
|
|
6280
6313
|
return name + " eq " + value;
|
|
6281
6314
|
else if (type == angularComponents.FieldType.Date)
|
|
6282
|
-
return name + " eq '" + moment$
|
|
6315
|
+
return name + " eq '" + moment$k(value).format("YYYY-MM-DD") + "'";
|
|
6283
6316
|
else if (type == angularComponents.FieldType.Time)
|
|
6284
|
-
return name + " eq '" + moment$
|
|
6317
|
+
return name + " eq '" + moment$k(value).format("HH:mm:ss") + "'";
|
|
6285
6318
|
else if (type == angularComponents.FieldType.DateTime)
|
|
6286
|
-
return name + " eq '" + moment$
|
|
6319
|
+
return name + " eq '" + moment$k(value).format() + "'";
|
|
6287
6320
|
else if (type == angularComponents.FieldType.Enum)
|
|
6288
6321
|
return name + " eq '" + value + "'";
|
|
6289
6322
|
else if (type == angularComponents.FieldType.String)
|
|
@@ -6754,7 +6787,7 @@
|
|
|
6754
6787
|
ExpedicaoFormComponent = __decorate([
|
|
6755
6788
|
core.Component({
|
|
6756
6789
|
selector: "expedicao-form",
|
|
6757
|
-
template: "<div *sLoadingState=\"loading\">\n <form [formGroup]=\"formGroup\" novalidate>\n <div class=\"ui-g\">\n <div class=\"ui-g-12 ui-md-12\">\n <label class=\"required-h3\">Pedidos:</label>\n <s-button label=\"Adicionar pedido\" priority=\"default\" (onClick)=\"abrirPedidoVenda()\" [disabled]=\"disableButtonSave || disableOrdersButtons\"></s-button>\n <div class=\"error-required-message\" [hidden]=\"ordersValid\">{{'yms.erp.error_required' | translate}}</div>\n <p-accordion>\n <p-accordionTab *ngFor=\"let pedido of getPedidos(); let i = index\">\n <p-header>\n Pedido: {{ pedido.get('pedidoVenda')?.value?.numero }}\n </p-header>\n \n <div style=\"margin: 10px 0; display: block;\">\n <s-button label=\"Adicionar item do pedido\" priority=\"default\" size=\"small\"\n (onClick)=\"abrirPedidoVendaItem(pedido)\" [disabled]=\"disableButtonSave || disableOrdersButtons\"></s-button>\n <s-button label=\"Excluir pedido\" priority=\"default\" size=\"small\"\n (onClick)=\"excluirPedidoVenda(i)\" [disabled]=\"disableButtonSave || disableOrdersButtons\"></s-button>\n </div>\n \n <s-token-list [tokens]=\"buildTokens(pedido.get('itens')?.value)\" [removableTokens]=\"true\"\n (tokenRemoved)=\"excluirPedidoVendaItem($event.id, pedido)\">\n </s-token-list>\n </p-accordionTab>\n </p-accordion>\n <div style=\"display: inline-block;\" class=\"separator\"></div>\n </div>\n </div>\n <div class=\"ui-fluid\">\n <div class=\"ui-g\">\n <div [attr.data-hidden]=\"true\" class=\"ui-g-12 ui-md-6\">\n <label for=\"id\">{{\"yms.erp.recebimento_id\" | translate}}</label>\n <input #idFormInput type=\"text\" id=\"id\" name=\"id\" pInputText formControlName=\"id\"\n autocomplete=\"off\" />\n </div>\n <div class=\"ui-g-12 ui-md-6 required\">\n <label for=\"filial\">{{\"yms.erp.expedicao_filial\" | translate}}</label>\n <s-lookup dataKey=\"id\" id=\"filial\" name=\"filial\" formControlName=\"filial\"\n [searchFields]=\"filialSearchFields\" [searchGridFields]=\"filialSearchGridFields\"\n [searchGridData]=\"filialSearchGridData\" [multiple]=\"false\"\n [lookupSuggestions]=\"filialLookupSuggestions\" (onLookupRequest)=\"onFilialLookupRequest($event)\"\n (onSearchRequest)=\"onFilialSearchRequest($event)\" lookupDisplayField=\"label\"\n (onSelect)=\"onFilialSelect($event)\"\n [searchTotalRecords]=\"filialSearchTotalRecords\"\n [searchTitle]=\"'yms.erp.filial_search_title' | translate\"\n [searchEmptyTitle]=\"'yms.erp.nothing_found' | translate\"\n [filterLabel]=\"'yms.erp.filter' | translate\" [clearLabel]=\"'yms.erp.clear' | translate\"\n [cancelLabel]=\"'yms.erp.cancel' | translate\" [selectLabel]=\"'yms.erp.select' | translate\"\n [searchTotalRecordsLabel]=\"'yms.erp.total_records' | translate: {value: filialSearchTotalRecords}\">\n </s-lookup>\n <s-control-errors [control]=\"formGroup.controls['filial']\"\n [errorMessages]=\"{ required: 'yms.erp.error_required' | translate }\"></s-control-errors>\n </div>\n <div class=\"ui-g-12 ui-md-6 required\">\n <label for=\"clienteFaturamento\">{{\"yms.erp.expedicao_cliente_faturamento\" | translate}}</label>\n <s-lookup dataKey=\"id\" id=\"clienteFaturamento\" name=\"clienteFaturamento\"\n formControlName=\"clienteFaturamento\" [searchFields]=\"clienteFaturamentoSearchFields\"\n [searchGridFields]=\"clienteFaturamentoSearchGridFields\"\n [searchGridData]=\"clienteFaturamentoSearchGridData\" [multiple]=\"false\"\n [lookupSuggestions]=\"clienteFaturamentoLookupSuggestions\"\n (onLookupRequest)=\"onClienteFaturamentoLookupRequest($event)\"\n (onSearchRequest)=\"onClienteFaturamentoSearchRequest($event)\" lookupDisplayField=\"label\"\n [searchTotalRecords]=\"clienteFaturamentoSearchTotalRecords\"\n [searchTitle]=\"'yms.erp.cliente_faturamento_search_title' | translate\"\n [searchEmptyTitle]=\"'yms.erp.nothing_found' | translate\"\n [filterLabel]=\"'yms.erp.filter' | translate\" [clearLabel]=\"'yms.erp.clear' | translate\"\n [cancelLabel]=\"'yms.erp.cancel' | translate\" [selectLabel]=\"'yms.erp.select' | translate\"\n [searchTotalRecordsLabel]=\"'yms.erp.total_records' | translate: {value: clienteFaturamentoSearchTotalRecords}\">\n </s-lookup>\n <s-control-errors [control]=\"formGroup.controls['clienteFaturamento']\"\n [errorMessages]=\"{ required: 'yms.erp.error_required' | translate }\"></s-control-errors>\n </div>\n <div class=\"ui-g-12 ui-md-6\">\n <label for=\"clienteRemessa\">{{\"yms.erp.expedicao_cliente_remessa\" | translate}}</label>\n <s-lookup dataKey=\"id\" id=\"clienteRemessa\" name=\"clienteRemessa\" formControlName=\"clienteRemessa\"\n [searchFields]=\"clienteRemessaSearchFields\" [searchGridFields]=\"clienteRemessaSearchGridFields\"\n [searchGridData]=\"clienteRemessaSearchGridData\" [multiple]=\"false\"\n [lookupSuggestions]=\"clienteRemessaLookupSuggestions\"\n (onLookupRequest)=\"onClienteRemessaLookupRequest($event)\"\n (onSearchRequest)=\"onClienteRemessaSearchRequest($event)\" lookupDisplayField=\"label\"\n [searchTotalRecords]=\"clienteRemessaSearchTotalRecords\"\n [searchTitle]=\"'yms.erp.cliente_remessa_search_title' | translate\"\n [searchEmptyTitle]=\"'yms.erp.nothing_found' | translate\"\n [filterLabel]=\"'yms.erp.filter' | translate\" [clearLabel]=\"'yms.erp.clear' | translate\"\n [cancelLabel]=\"'yms.erp.cancel' | translate\" [selectLabel]=\"'yms.erp.select' | translate\"\n [searchTotalRecordsLabel]=\"'yms.erp.total_records' | translate: {value: clienteRemessaSearchTotalRecords}\">\n </s-lookup>\n <s-control-errors [control]=\"formGroup.controls['clienteRemessa']\"\n [errorMessages]=\"{ required: 'yms.erp.error_required' | translate }\"></s-control-errors>\n </div>\n <div class=\"ui-g-12 ui-md-6\">\n <label for=\"transportadora\">{{\"yms.erp.expedicao_transportadora\" | translate}}</label>\n <s-lookup dataKey=\"id\" id=\"transportadora\" name=\"transportadora\" formControlName=\"transportadora\"\n [searchFields]=\"transportadoraSearchFields\" [searchGridFields]=\"transportadoraSearchGridFields\"\n [searchGridData]=\"transportadoraSearchGridData\" [multiple]=\"false\"\n [lookupSuggestions]=\"transportadoraLookupSuggestions\"\n (onLookupRequest)=\"onTransportadoraLookupRequest($event)\"\n (onSearchRequest)=\"onTransportadoraSearchRequest($event)\" lookupDisplayField=\"label\"\n [searchTotalRecords]=\"transportadoraSearchTotalRecords\"\n [searchTitle]=\"'yms.erp.transportadora_search_title' | translate\"\n [searchEmptyTitle]=\"'yms.erp.nothing_found' | translate\"\n [filterLabel]=\"'yms.erp.filter' | translate\" [clearLabel]=\"'yms.erp.clear' | translate\"\n [cancelLabel]=\"'yms.erp.cancel' | translate\" [selectLabel]=\"'yms.erp.select' | translate\"\n [searchTotalRecordsLabel]=\"'yms.erp.total_records' | translate: {value: transportadoraSearchTotalRecords}\">\n </s-lookup>\n </div>\n <div class=\"ui-g-12 ui-md-6\">\n <label for=\"numeroAgendamentoCliente\">N\u00FAmero agendamento do cliente</label>\n <input type=\"number\" pInputText formControlName=\"numeroAgendamentoCliente\">\n </div>\n <div class=\"ui-g-12 ui-md-6\">\n <label for=\"numeroPedidoCliente\">N\u00FAmero pedido do cliente</label>\n <input type=\"number\" pInputText formControlName=\"numeroPedidoCliente\">\n </div>\n <div class=\"ui-g-12 ui-md-6\">\n <label for=\"itemPedidoCliente\">Item pedido do cliente</label>\n <input type=\"number\" pInputText formControlName=\"itemPedidoCliente\">\n </div>\n <div class=\"ui-g-12\" style=\"text-align: right;\" *ngIf=\"totalEixosContratados || totalEixosComposicao\">\n <label for=\"totalEixosContratados\" float=\"right\" style=\"display: inline;\">{{totalEixosContratados}} {{'yms.erp.total_eixos_contratados' | translate}} / </label>\n <label for=\"totalEixosComposicao\" float=\"right\" style=\"display: inline;\">{{totalEixosComposicao}} {{'yms.erp.total_eixos_composicao' | translate}}</label>\n </div>\n </div>\n </div>\n </form>\n\n <div style=\"margin: 5px 0 5px 0;\">\n <s-button priority=\"primary\" [label]=\"'save' | translate\" (onClick)=\"onSave()\" [disabled]=\"disableButtonSave\"></s-button>\n <s-button *ngIf=\"saveAndInitButton\" priority=\"primary\" [label]=\"'save_and_init' | translate\" (onClick)=\"onSave(true)\" [disabled]=\"disableButtonSave\"></s-button>\n </div>\n\n <form [formGroup]=\"pedidoVendaForm\" [hidden]=\"true\">\n <s-lookup dataKey=\"id\" id=\"pedidoVenda\" name=\"pedidoVenda\" formControlName=\"pedidoVenda\"\n [searchFields]=\"pedidoVendaSearchFields\" [searchGridFields]=\"pedidoVendaSearchGridFields\"\n [searchGridData]=\"pedidoVendaSearchGridData\" [multiple]=\"false\"\n [lookupSuggestions]=\"pedidoVendaLookupSuggestions\" (onLookupRequest)=\"onPedidoVendaLookupRequest($event)\"\n (onSearchRequest)=\"onPedidoVendaSearchRequest($event)\" lookupDisplayField=\"label\"\n (onSelect)=\"selecionarPedidoVenda($event)\" [searchTotalRecords]=\"pedidoVendaSearchTotalRecords\"\n [searchTitle]=\"'yms.erp.pedido_venda_search_title' | translate\"\n [searchEmptyTitle]=\"'yms.erp.nothing_found' | translate\" [filterLabel]=\"'yms.erp.filter' | translate\"\n [clearLabel]=\"'yms.erp.clear' | translate\" [cancelLabel]=\"'yms.erp.cancel' | translate\"\n [selectLabel]=\"'yms.erp.select' | translate\"\n [searchTotalRecordsLabel]=\"'yms.erp.total_records' | translate: {value: pedidoVendaSearchTotalRecords}\">\n </s-lookup>\n </form>\n\n <p-dialog [(visible)]=\"visibleDialog\" styleClass=\"s-lookup-modal\" [modal]=\"true\">\n <p-header>\n Adicionar item\n </p-header>\n\n <form [formGroup]=\"itemFormGroup\">\n <div class=\"ui-fluid\">\n <div class=\"ui-g\">\n <div class=\"ui-g-12 ui-md-6\">\n <label for=\"item\">Item do pedido</label>\n <s-lookup dataKey=\"id\" id=\"item\" name=\"item\" formControlName=\"item\"\n [searchFields]=\"pedidoVendaItemSearchFields\"\n [searchGridFields]=\"pedidoVendaItemSearchGridFields\"\n [searchGridData]=\"pedidoVendaItemSearchGridData\" [multiple]=\"false\"\n [lookupSuggestions]=\"pedidoVendaItemLookupSuggestions\"\n (onLookupRequest)=\"onPedidoVendaItemLookupRequest($event)\"\n (onSearchRequest)=\"onPedidoVendaItemSearchRequest($event)\" lookupDisplayField=\"label\"\n [searchTotalRecords]=\"pedidoVendaItemSearchTotalRecords\"\n [searchTitle]=\"'yms.erp.expedicao_pedido_venda_itens_search_title' | translate\"\n [searchEmptyTitle]=\"'yms.erp.nothing_found' | translate\"\n [filterLabel]=\"'yms.erp.filter' | translate\" [clearLabel]=\"'yms.erp.clear' | translate\"\n [cancelLabel]=\"'yms.erp.cancel' | translate\" [selectLabel]=\"'yms.erp.select' | translate\"\n [searchTotalRecordsLabel]=\"'yms.erp.total_records' | translate: {value: pedidoVendaItemSearchTotalRecords}\">\n </s-lookup>\n </div>\n <div class=\"ui-g-12 ui-md-6\">\n <label for=\"quantidade\">Quantidade</label>\n <input type=\"number\" pInputText formControlName=\"quantidade\">\n </div>\n </div>\n </div>\n </form>\n\n <p-footer>\n <s-button [label]=\"'select' | translate\" (onClick)=\"selecionarPedidoVendaItem()\"></s-button>\n </p-footer>\n </p-dialog>\n</div>",
|
|
6790
|
+
template: "<div *sLoadingState=\"loading\">\n <form [formGroup]=\"formGroup\" novalidate>\n <div class=\"ui-g\">\n <div class=\"ui-g-12 ui-md-12\">\n <label class=\"required-h3\">Pedidos:</label>\n <s-button label=\"Adicionar pedido\" priority=\"default\" (onClick)=\"abrirPedidoVenda()\" [disabled]=\"disableButtonSave || disableOrdersButtons\"></s-button>\n <div class=\"error-required-message\" [hidden]=\"ordersValid\">{{'yms.erp.error_required' | translate}}</div>\n <p-accordion>\n <p-accordionTab *ngFor=\"let pedido of getPedidos(); let i = index\">\n <p-header>\n Pedido: {{ pedido.get('pedidoVenda')?.value?.numero }}\n </p-header>\n \n <div style=\"margin: 10px 0; display: block;\">\n <s-button label=\"Adicionar item do pedido\" priority=\"default\" size=\"small\"\n (onClick)=\"abrirPedidoVendaItem(pedido)\" [disabled]=\"disableButtonSave || disableOrdersButtons\"></s-button>\n <s-button label=\"Excluir pedido\" priority=\"default\" size=\"small\"\n (onClick)=\"excluirPedidoVenda(i)\" [disabled]=\"disableButtonSave || disableOrdersButtons\"></s-button>\n </div>\n \n <s-token-list [tokens]=\"buildTokens(pedido.get('itens')?.value)\" [removableTokens]=\"true\"\n (tokenRemoved)=\"excluirPedidoVendaItem($event.id, pedido)\">\n </s-token-list>\n </p-accordionTab>\n </p-accordion>\n <div style=\"display: inline-block;\" class=\"separator\"></div>\n </div>\n </div>\n <div class=\"ui-fluid\">\n <div class=\"ui-g\">\n <div [attr.data-hidden]=\"true\" class=\"ui-g-12 ui-md-6\">\n <label for=\"id\">{{\"yms.erp.recebimento_id\" | translate}}</label>\n <input #idFormInput type=\"text\" id=\"id\" name=\"id\" pInputText formControlName=\"id\"\n autocomplete=\"off\" />\n </div>\n <div class=\"ui-g-12 ui-md-6 required\">\n <label for=\"filial\">{{\"yms.erp.expedicao_filial\" | translate}}</label>\n <s-lookup dataKey=\"id\" id=\"filial\" name=\"filial\" formControlName=\"filial\"\n [searchFields]=\"filialSearchFields\" [searchGridFields]=\"filialSearchGridFields\"\n [searchGridData]=\"filialSearchGridData\" [multiple]=\"false\"\n [lookupSuggestions]=\"filialLookupSuggestions\" (onLookupRequest)=\"onFilialLookupRequest($event)\"\n (onSearchRequest)=\"onFilialSearchRequest($event)\" lookupDisplayField=\"label\"\n (onSelect)=\"onFilialSelect($event)\"\n [searchTotalRecords]=\"filialSearchTotalRecords\"\n [searchTitle]=\"'yms.erp.filial_search_title' | translate\"\n [searchEmptyTitle]=\"'yms.erp.nothing_found' | translate\"\n [filterLabel]=\"'yms.erp.filter' | translate\" [clearLabel]=\"'yms.erp.clear' | translate\"\n [cancelLabel]=\"'yms.erp.cancel' | translate\" [selectLabel]=\"'yms.erp.select' | translate\"\n [searchTotalRecordsLabel]=\"'yms.erp.total_records' | translate: {value: filialSearchTotalRecords}\">\n </s-lookup>\n <s-control-errors [control]=\"formGroup.controls['filial']\"\n [errorMessages]=\"{ required: 'yms.erp.error_required' | translate }\"></s-control-errors>\n </div>\n <div class=\"ui-g-12 ui-md-6 required\">\n <label for=\"clienteFaturamento\">{{\"yms.erp.expedicao_cliente_faturamento\" | translate}}</label>\n <s-lookup dataKey=\"id\" id=\"clienteFaturamento\" name=\"clienteFaturamento\"\n formControlName=\"clienteFaturamento\" [searchFields]=\"clienteFaturamentoSearchFields\"\n [searchGridFields]=\"clienteFaturamentoSearchGridFields\"\n [searchGridData]=\"clienteFaturamentoSearchGridData\" [multiple]=\"false\"\n [lookupSuggestions]=\"clienteFaturamentoLookupSuggestions\"\n (onLookupRequest)=\"onClienteFaturamentoLookupRequest($event)\"\n (onSearchRequest)=\"onClienteFaturamentoSearchRequest($event)\" lookupDisplayField=\"label\"\n [searchTotalRecords]=\"clienteFaturamentoSearchTotalRecords\"\n [searchTitle]=\"'yms.erp.cliente_faturamento_search_title' | translate\"\n [searchEmptyTitle]=\"'yms.erp.nothing_found' | translate\"\n [filterLabel]=\"'yms.erp.filter' | translate\" [clearLabel]=\"'yms.erp.clear' | translate\"\n [cancelLabel]=\"'yms.erp.cancel' | translate\" [selectLabel]=\"'yms.erp.select' | translate\"\n [searchTotalRecordsLabel]=\"'yms.erp.total_records' | translate: {value: clienteFaturamentoSearchTotalRecords}\">\n </s-lookup>\n <s-control-errors [control]=\"formGroup.controls['clienteFaturamento']\"\n [errorMessages]=\"{ required: 'yms.erp.error_required' | translate }\"></s-control-errors>\n </div>\n <div class=\"ui-g-12 ui-md-6\">\n <label for=\"clienteRemessa\">{{\"yms.erp.expedicao_cliente_remessa\" | translate}}</label>\n <s-lookup dataKey=\"id\" id=\"clienteRemessa\" name=\"clienteRemessa\" formControlName=\"clienteRemessa\"\n [searchFields]=\"clienteRemessaSearchFields\" [searchGridFields]=\"clienteRemessaSearchGridFields\"\n [searchGridData]=\"clienteRemessaSearchGridData\" [multiple]=\"false\"\n [lookupSuggestions]=\"clienteRemessaLookupSuggestions\"\n (onLookupRequest)=\"onClienteRemessaLookupRequest($event)\"\n (onSearchRequest)=\"onClienteRemessaSearchRequest($event)\" lookupDisplayField=\"label\"\n [searchTotalRecords]=\"clienteRemessaSearchTotalRecords\"\n [searchTitle]=\"'yms.erp.cliente_remessa_search_title' | translate\"\n [searchEmptyTitle]=\"'yms.erp.nothing_found' | translate\"\n [filterLabel]=\"'yms.erp.filter' | translate\" [clearLabel]=\"'yms.erp.clear' | translate\"\n [cancelLabel]=\"'yms.erp.cancel' | translate\" [selectLabel]=\"'yms.erp.select' | translate\"\n [searchTotalRecordsLabel]=\"'yms.erp.total_records' | translate: {value: clienteRemessaSearchTotalRecords}\">\n </s-lookup>\n <s-control-errors [control]=\"formGroup.controls['clienteRemessa']\"\n [errorMessages]=\"{ required: 'yms.erp.error_required' | translate }\"></s-control-errors>\n </div>\n <div class=\"ui-g-12 ui-md-6\">\n <label for=\"transportadora\">{{\"yms.erp.expedicao_transportadora\" | translate}}</label>\n <s-lookup dataKey=\"id\" id=\"transportadora\" name=\"transportadora\" formControlName=\"transportadora\"\n [searchFields]=\"transportadoraSearchFields\" [searchGridFields]=\"transportadoraSearchGridFields\"\n [searchGridData]=\"transportadoraSearchGridData\" [multiple]=\"false\"\n [lookupSuggestions]=\"transportadoraLookupSuggestions\"\n (onLookupRequest)=\"onTransportadoraLookupRequest($event)\"\n (onSearchRequest)=\"onTransportadoraSearchRequest($event)\" lookupDisplayField=\"label\"\n [searchTotalRecords]=\"transportadoraSearchTotalRecords\"\n [searchTitle]=\"'yms.erp.transportadora_search_title' | translate\"\n [searchEmptyTitle]=\"'yms.erp.nothing_found' | translate\"\n [filterLabel]=\"'yms.erp.filter' | translate\" [clearLabel]=\"'yms.erp.clear' | translate\"\n [cancelLabel]=\"'yms.erp.cancel' | translate\" [selectLabel]=\"'yms.erp.select' | translate\"\n [searchTotalRecordsLabel]=\"'yms.erp.total_records' | translate: {value: transportadoraSearchTotalRecords}\">\n </s-lookup>\n </div>\n <div class=\"ui-g-12 ui-md-6\">\n <label for=\"numeroAgendamentoCliente\">N\u00FAmero agendamento do cliente</label>\n <input type=\"text\" pInputText formControlName=\"numeroAgendamentoCliente\" pattern=\"[0-9]+$\">\n </div>\n <div class=\"ui-g-12 ui-md-6\">\n <label for=\"numeroPedidoCliente\">N\u00FAmero pedido do cliente</label>\n <input type=\"text\" pInputText formControlName=\"numeroPedidoCliente\" pattern=\"[0-9]+$\">\n </div>\n <div class=\"ui-g-12 ui-md-6\">\n <label for=\"itemPedidoCliente\">Item pedido do cliente</label>\n <input type=\"text\" pInputText formControlName=\"itemPedidoCliente\" pattern=\"[0-9]+$\">\n </div>\n <div class=\"ui-g-12\" style=\"text-align: right;\" *ngIf=\"totalEixosContratados || totalEixosComposicao\">\n <label for=\"totalEixosContratados\" float=\"right\" style=\"display: inline;\">{{totalEixosContratados}} {{'yms.erp.total_eixos_contratados' | translate}} / </label>\n <label for=\"totalEixosComposicao\" float=\"right\" style=\"display: inline;\">{{totalEixosComposicao}} {{'yms.erp.total_eixos_composicao' | translate}}</label>\n </div>\n </div>\n </div>\n </form>\n\n <div style=\"margin: 5px 0 5px 0;\">\n <s-button priority=\"primary\" [label]=\"'save' | translate\" (onClick)=\"onSave()\" [disabled]=\"disableButtonSave\"></s-button>\n <s-button *ngIf=\"saveAndInitButton\" priority=\"primary\" [label]=\"'save_and_init' | translate\" (onClick)=\"onSave(true)\" [disabled]=\"disableButtonSave\"></s-button>\n </div>\n\n <form [formGroup]=\"pedidoVendaForm\" [hidden]=\"true\">\n <s-lookup dataKey=\"id\" id=\"pedidoVenda\" name=\"pedidoVenda\" formControlName=\"pedidoVenda\"\n [searchFields]=\"pedidoVendaSearchFields\" [searchGridFields]=\"pedidoVendaSearchGridFields\"\n [searchGridData]=\"pedidoVendaSearchGridData\" [multiple]=\"false\"\n [lookupSuggestions]=\"pedidoVendaLookupSuggestions\" (onLookupRequest)=\"onPedidoVendaLookupRequest($event)\"\n (onSearchRequest)=\"onPedidoVendaSearchRequest($event)\" lookupDisplayField=\"label\"\n (onSelect)=\"selecionarPedidoVenda($event)\" [searchTotalRecords]=\"pedidoVendaSearchTotalRecords\"\n [searchTitle]=\"'yms.erp.pedido_venda_search_title' | translate\"\n [searchEmptyTitle]=\"'yms.erp.nothing_found' | translate\" [filterLabel]=\"'yms.erp.filter' | translate\"\n [clearLabel]=\"'yms.erp.clear' | translate\" [cancelLabel]=\"'yms.erp.cancel' | translate\"\n [selectLabel]=\"'yms.erp.select' | translate\"\n [searchTotalRecordsLabel]=\"'yms.erp.total_records' | translate: {value: pedidoVendaSearchTotalRecords}\">\n </s-lookup>\n </form>\n\n <p-dialog [(visible)]=\"visibleDialog\" styleClass=\"s-lookup-modal\" [modal]=\"true\">\n <p-header>\n Adicionar item\n </p-header>\n\n <form [formGroup]=\"itemFormGroup\">\n <div class=\"ui-fluid\">\n <div class=\"ui-g\">\n <div class=\"ui-g-12 ui-md-6\">\n <label for=\"item\">Item do pedido</label>\n <s-lookup dataKey=\"id\" id=\"item\" name=\"item\" formControlName=\"item\"\n [searchFields]=\"pedidoVendaItemSearchFields\"\n [searchGridFields]=\"pedidoVendaItemSearchGridFields\"\n [searchGridData]=\"pedidoVendaItemSearchGridData\" [multiple]=\"false\"\n [lookupSuggestions]=\"pedidoVendaItemLookupSuggestions\"\n (onLookupRequest)=\"onPedidoVendaItemLookupRequest($event)\"\n (onSearchRequest)=\"onPedidoVendaItemSearchRequest($event)\" lookupDisplayField=\"label\"\n [searchTotalRecords]=\"pedidoVendaItemSearchTotalRecords\"\n [searchTitle]=\"'yms.erp.expedicao_pedido_venda_itens_search_title' | translate\"\n [searchEmptyTitle]=\"'yms.erp.nothing_found' | translate\"\n [filterLabel]=\"'yms.erp.filter' | translate\" [clearLabel]=\"'yms.erp.clear' | translate\"\n [cancelLabel]=\"'yms.erp.cancel' | translate\" [selectLabel]=\"'yms.erp.select' | translate\"\n [searchTotalRecordsLabel]=\"'yms.erp.total_records' | translate: {value: pedidoVendaItemSearchTotalRecords}\">\n </s-lookup>\n </div>\n <div class=\"ui-g-12 ui-md-6\">\n <label for=\"quantidade\">Quantidade</label>\n <input type=\"number\" pInputText formControlName=\"quantidade\">\n </div>\n </div>\n </div>\n </form>\n\n <p-footer>\n <s-button [label]=\"'select' | translate\" (onClick)=\"selecionarPedidoVendaItem()\"></s-button>\n </p-footer>\n </p-dialog>\n</div>",
|
|
6758
6791
|
styles: [".required-h3{font-size:1.17rem;font-weight:700}.required-h3::after{content:'*';color:#c13018;font-weight:400;margin-left:5px;font-size:14px}.error-required-message{color:#c13018;margin-top:5px;font-size:12px}.separator{width:100%;margin:5px 0;height:1px;background-color:#ccc}.input-error{color:#c13018}.detail-pane{display:flex;flex-wrap:wrap;justify-content:flex-start}.detail-pane .detail-span{width:50%;padding:10px 0;display:flex;flex-direction:column}.detail-pane .detail-span .title{font-size:14px;opacity:.7;margin-bottom:4px}.detail-pane .detail-span .data{font-size:16px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}"]
|
|
6759
6792
|
}),
|
|
6760
6793
|
__metadata("design:paramtypes", [ExpedicaoService,
|
|
@@ -7303,7 +7336,7 @@
|
|
|
7303
7336
|
return ProcessoAvulsoInfoComponent;
|
|
7304
7337
|
}());
|
|
7305
7338
|
|
|
7306
|
-
var moment$
|
|
7339
|
+
var moment$l = _moment;
|
|
7307
7340
|
/*{CA:PROJECT_IMPORTS:START}*/
|
|
7308
7341
|
/*{CA:PROJECT_IMPORTS:END}*/
|
|
7309
7342
|
var Safra = /** @class */ (function () {
|
|
@@ -7313,10 +7346,10 @@
|
|
|
7313
7346
|
/*{CA:CLASS_ATTRIBUTES:END}*/
|
|
7314
7347
|
Safra.fromDto = function (safraDto, originEntity) {
|
|
7315
7348
|
var model = __assign({}, safraDto);
|
|
7316
|
-
model.competenciaInicial = model.competenciaInicial && moment$
|
|
7317
|
-
model.competenciaFinal = model.competenciaFinal && moment$
|
|
7318
|
-
model.createdDate = model.createdDate && moment$
|
|
7319
|
-
model.lastModifiedDate = model.lastModifiedDate && moment$
|
|
7349
|
+
model.competenciaInicial = model.competenciaInicial && moment$l(model.competenciaInicial).toDate();
|
|
7350
|
+
model.competenciaFinal = model.competenciaFinal && moment$l(model.competenciaFinal).toDate();
|
|
7351
|
+
model.createdDate = model.createdDate && moment$l(model.createdDate).toDate();
|
|
7352
|
+
model.lastModifiedDate = model.lastModifiedDate && moment$l(model.lastModifiedDate).toDate();
|
|
7320
7353
|
var lookupSeparator = " - ";
|
|
7321
7354
|
var displayFields = [
|
|
7322
7355
|
"codigo",
|
|
@@ -7329,11 +7362,11 @@
|
|
|
7329
7362
|
};
|
|
7330
7363
|
Safra.toDto = function (safra, originEntity) {
|
|
7331
7364
|
var dto = __assign({}, safra);
|
|
7332
|
-
dto.competenciaInicial = dto.competenciaInicial && moment$
|
|
7333
|
-
dto.competenciaFinal = dto.competenciaFinal && moment$
|
|
7334
|
-
dto.createdDate = dto.createdDate && moment$
|
|
7335
|
-
dto.lastModifiedDate = dto.lastModifiedDate && moment$
|
|
7336
|
-
delete dto.label;
|
|
7365
|
+
dto.competenciaInicial = dto.competenciaInicial && moment$l(dto.competenciaInicial).format("YYYY-MM-DD");
|
|
7366
|
+
dto.competenciaFinal = dto.competenciaFinal && moment$l(dto.competenciaFinal).format("YYYY-MM-DD");
|
|
7367
|
+
dto.createdDate = dto.createdDate && moment$l(dto.createdDate).format();
|
|
7368
|
+
dto.lastModifiedDate = dto.lastModifiedDate && moment$l(dto.lastModifiedDate).format();
|
|
7369
|
+
delete dto.label;
|
|
7337
7370
|
if (originEntity !== "Empresa" && dto.empresa)
|
|
7338
7371
|
dto.empresa = Empresa.toDto(dto.empresa, "Safra");
|
|
7339
7372
|
return dto;
|
|
@@ -7345,7 +7378,7 @@
|
|
|
7345
7378
|
|
|
7346
7379
|
/*{CA:PACKAGE_IMPORTS:START}*/
|
|
7347
7380
|
/*{CA:PACKAGE_IMPORTS:END}*/
|
|
7348
|
-
var moment$
|
|
7381
|
+
var moment$m = _moment;
|
|
7349
7382
|
/*{CA:PROJECT_IMPORTS:START}*/
|
|
7350
7383
|
/*{CA:PROJECT_IMPORTS:END}*/
|
|
7351
7384
|
var RecebimentoOrdemCompra = /** @class */ (function () {
|
|
@@ -7355,8 +7388,8 @@
|
|
|
7355
7388
|
/*{CA:CLASS_ATTRIBUTES:END}*/
|
|
7356
7389
|
RecebimentoOrdemCompra.fromDto = function (recebimentoOrdemCompraDto, originEntity) {
|
|
7357
7390
|
var model = __assign({}, recebimentoOrdemCompraDto);
|
|
7358
|
-
model.createdDate = model.createdDate && moment$
|
|
7359
|
-
model.lastModifiedDate = model.lastModifiedDate && moment$
|
|
7391
|
+
model.createdDate = model.createdDate && moment$m(model.createdDate).toDate();
|
|
7392
|
+
model.lastModifiedDate = model.lastModifiedDate && moment$m(model.lastModifiedDate).toDate();
|
|
7360
7393
|
var lookupSeparator = " - ";
|
|
7361
7394
|
var displayFields = [
|
|
7362
7395
|
''
|
|
@@ -7385,8 +7418,8 @@
|
|
|
7385
7418
|
};
|
|
7386
7419
|
RecebimentoOrdemCompra.toDto = function (recebimentoOrdemCompra, originEntity) {
|
|
7387
7420
|
var dto = __assign({}, recebimentoOrdemCompra);
|
|
7388
|
-
dto.createdDate = dto.createdDate && moment$
|
|
7389
|
-
dto.lastModifiedDate = dto.lastModifiedDate && moment$
|
|
7421
|
+
dto.createdDate = dto.createdDate && moment$m(dto.createdDate).format();
|
|
7422
|
+
dto.lastModifiedDate = dto.lastModifiedDate && moment$m(dto.lastModifiedDate).format();
|
|
7390
7423
|
delete dto.label;
|
|
7391
7424
|
if (originEntity !== "Agenda" && dto.agenda)
|
|
7392
7425
|
dto.agenda = Agenda.toDto(dto.agenda, "RecebimentoOrdemCompra");
|
|
@@ -7455,6 +7488,15 @@
|
|
|
7455
7488
|
return RecebimentoOrdemCompraChegadaVeiculoOverride;
|
|
7456
7489
|
}());
|
|
7457
7490
|
|
|
7491
|
+
var StatusAgenda;
|
|
7492
|
+
(function (StatusAgenda) {
|
|
7493
|
+
StatusAgenda["AGUARDANDO_CONFIRMACAO"] = "AGUARDANDO_CONFIRMACAO_SOLICITANTE";
|
|
7494
|
+
StatusAgenda["AGENDADO"] = "AGENDADO";
|
|
7495
|
+
StatusAgenda["AGUARDANDO_CONFIRMACAO_SOLICITANTE"] = "AGUARDANDO_CONFIRMACAO";
|
|
7496
|
+
StatusAgenda["REJEITADO_POR_VALIDACAO"] = "REJEITADO_POR_VALIDACAO";
|
|
7497
|
+
StatusAgenda["CANCELADO"] = "CANCELADO";
|
|
7498
|
+
})(StatusAgenda || (StatusAgenda = {}));
|
|
7499
|
+
|
|
7458
7500
|
var RecebimentoOrdemCompraFormComponent = /** @class */ (function () {
|
|
7459
7501
|
function RecebimentoOrdemCompraFormComponent(formBuilder, translate, filialService, pessoaService, produtoService, derivacaoService, transportadoraService, ordemCompraService, recebimentoOrdemCompraService, messageService, route, router, origemMercadoriaService, safraService, override, notaValidatorService, confirmationService, dialogService, agendaService) {
|
|
7460
7502
|
var _this = this;
|
|
@@ -7523,6 +7565,13 @@
|
|
|
7523
7565
|
}
|
|
7524
7566
|
RecebimentoOrdemCompraFormComponent.prototype.ngOnInit = function () {
|
|
7525
7567
|
var _this = this;
|
|
7568
|
+
this.route.params.pipe(operators.takeUntil(this.ngUnsubscribe)).subscribe(function (_a) {
|
|
7569
|
+
var agenda = _a.agenda;
|
|
7570
|
+
if (agenda == 'new') {
|
|
7571
|
+
return _this.configureForm();
|
|
7572
|
+
}
|
|
7573
|
+
_this.getRecebimentoOrdemCompra(agenda);
|
|
7574
|
+
});
|
|
7526
7575
|
this.derivacaoSearchFields = this.getDerivacaoSearchFields();
|
|
7527
7576
|
this.filialSearchFields = this.getFilialSearchFields();
|
|
7528
7577
|
this.filialSearchGridFields = this.getFilialSearchGridFields();
|
|
@@ -7535,41 +7584,18 @@
|
|
|
7535
7584
|
this.transportadoraSearchGridFields = this.getTransportadoraSearchGridFields();
|
|
7536
7585
|
this.ordemCompraSearchFields = this.getOrdemCompraFields();
|
|
7537
7586
|
this.ordemCompraSearchGridFields = this.getOrdemCompraGridFields();
|
|
7538
|
-
this.route.params.pipe(operators.takeUntil(this.ngUnsubscribe)).subscribe(function (_a) {
|
|
7539
|
-
var agenda = _a.agenda;
|
|
7540
|
-
if (agenda == 'new') {
|
|
7541
|
-
return _this.configureForm();
|
|
7542
|
-
}
|
|
7543
|
-
_this.getRecebimentoOrdemCompra(agenda)
|
|
7544
|
-
.pipe(operators.takeUntil(_this.ngUnsubscribe))
|
|
7545
|
-
.subscribe(function (_a) {
|
|
7546
|
-
var contents = _a.contents;
|
|
7547
|
-
if (!contents.length)
|
|
7548
|
-
return _this.configureForm();
|
|
7549
|
-
_this.totalEixosContratados = contents[0].eixos || 0;
|
|
7550
|
-
_this.totalEixosComposicao = contents[0].agenda && contents[0].agenda.veiculo
|
|
7551
|
-
? contents[0].agenda.veiculo.eixos || 0 : 0;
|
|
7552
|
-
var recebimentoOrdemCompra = RecebimentoOrdemCompra.fromDto(contents[0]);
|
|
7553
|
-
_this.formGroup.enable();
|
|
7554
|
-
_this.formGroup.patchValue(__assign({}, recebimentoOrdemCompra));
|
|
7555
|
-
recebimentoOrdemCompra.fornecedores.forEach(function (fornecedor) {
|
|
7556
|
-
//this.addFornecedor(fornecedor);
|
|
7557
|
-
var form = _this.getFornecedorForm(fornecedor);
|
|
7558
|
-
_this.getFornecedores().push(form);
|
|
7559
|
-
fornecedor.ordens.forEach(function (ordemCompra) {
|
|
7560
|
-
var ordemCompraForm = _this.getOrdemCompraForm(ordemCompra);
|
|
7561
|
-
_this.getOrdensCompra(form).push(ordemCompraForm);
|
|
7562
|
-
});
|
|
7563
|
-
});
|
|
7564
|
-
_this.configureForm();
|
|
7565
|
-
});
|
|
7566
|
-
});
|
|
7567
7587
|
if (this.agenda && this.agenda.externalTenant) {
|
|
7568
7588
|
this.setTransportadora(this.agenda.externalTenant.cnpj);
|
|
7569
7589
|
}
|
|
7570
7590
|
this.getEmpresaFilial();
|
|
7571
7591
|
this.totalEixosComposicao = this.agenda && this.agenda.veiculo ? this.agenda.veiculo.eixos || 0 : 0;
|
|
7572
|
-
var statusAgenda = [
|
|
7592
|
+
var statusAgenda = [
|
|
7593
|
+
"AGUARDANDO_CONFIRMACAO_SOLICITANTE",
|
|
7594
|
+
"AGENDADO",
|
|
7595
|
+
"AGUARDANDO_CONFIRMACAO",
|
|
7596
|
+
"EM_EXECUCAO",
|
|
7597
|
+
"REJEITADO_POR_VALIDACAO"
|
|
7598
|
+
];
|
|
7573
7599
|
if (this.agenda && !statusAgenda.includes(this.agenda.status)) {
|
|
7574
7600
|
this.formGroup.disable();
|
|
7575
7601
|
this.disableButtonSave = true;
|
|
@@ -7707,10 +7733,38 @@
|
|
|
7707
7733
|
formGroup.get(formControl).enable();
|
|
7708
7734
|
};
|
|
7709
7735
|
RecebimentoOrdemCompraFormComponent.prototype.getRecebimentoOrdemCompra = function (agendaId) {
|
|
7710
|
-
|
|
7736
|
+
var _this = this;
|
|
7737
|
+
this.loading = true;
|
|
7738
|
+
this.recebimentoOrdemCompraService.list({
|
|
7711
7739
|
filterQuery: "agenda.id eq '" + agendaId + "'",
|
|
7712
7740
|
size: 1,
|
|
7713
7741
|
page: 0
|
|
7742
|
+
})
|
|
7743
|
+
.pipe(operators.takeUntil(this.ngUnsubscribe), operators.finalize(function () { return _this.loading = false; }))
|
|
7744
|
+
.subscribe(function (_a) {
|
|
7745
|
+
var contents = _a.contents;
|
|
7746
|
+
if (!contents.length) {
|
|
7747
|
+
return _this.configureForm();
|
|
7748
|
+
}
|
|
7749
|
+
_this.totalEixosContratados = contents[0].eixos || 0;
|
|
7750
|
+
_this.totalEixosComposicao = contents[0].agenda && contents[0].agenda.veiculo
|
|
7751
|
+
? contents[0].agenda.veiculo.eixos || 0 : 0;
|
|
7752
|
+
var recebimentoOrdemCompra = RecebimentoOrdemCompra.fromDto(contents[0]);
|
|
7753
|
+
_this.formGroup.enable();
|
|
7754
|
+
_this.formGroup.patchValue(recebimentoOrdemCompra);
|
|
7755
|
+
recebimentoOrdemCompra.fornecedores.forEach(function (fornecedor) {
|
|
7756
|
+
var form = _this.getFornecedorForm(fornecedor);
|
|
7757
|
+
_this.getFornecedores().push(form);
|
|
7758
|
+
fornecedor.ordens.forEach(function (ordemCompra) {
|
|
7759
|
+
var ordemCompraForm = _this.getOrdemCompraForm(ordemCompra);
|
|
7760
|
+
_this.getOrdensCompra(form).push(ordemCompraForm);
|
|
7761
|
+
ordemCompra.notas.forEach(function (nota) {
|
|
7762
|
+
var notaForm = _this.getNotaForm(nota);
|
|
7763
|
+
_this.getNotas(ordemCompraForm).push(notaForm);
|
|
7764
|
+
});
|
|
7765
|
+
});
|
|
7766
|
+
});
|
|
7767
|
+
_this.configureForm();
|
|
7714
7768
|
});
|
|
7715
7769
|
};
|
|
7716
7770
|
RecebimentoOrdemCompraFormComponent.prototype.onFilialLookupRequest = function (value) {
|
|
@@ -7832,12 +7886,14 @@
|
|
|
7832
7886
|
_this.ordemCompraSearchTotalRecords = list.totalElements;
|
|
7833
7887
|
});
|
|
7834
7888
|
};
|
|
7835
|
-
RecebimentoOrdemCompraFormComponent.prototype.
|
|
7889
|
+
RecebimentoOrdemCompraFormComponent.prototype.addOrdemCompra = function (fornecedorForm) {
|
|
7836
7890
|
var _this = this;
|
|
7837
7891
|
this.dialogService
|
|
7838
|
-
.open(OrdemCompraFormComponent, __assign({}, dialogConfig, { header: 'Adicionar Ordem Compra', data: {
|
|
7892
|
+
.open(OrdemCompraFormComponent, __assign({}, dialogConfig, { header: 'Adicionar Ordem de Compra', data: {
|
|
7893
|
+
agenda: this.agenda,
|
|
7839
7894
|
filial: this.formGroup.get("filial").value,
|
|
7840
7895
|
fornecedor: fornecedorForm.get("fornecedor").value,
|
|
7896
|
+
ordens: fornecedorForm.get("ordens").value,
|
|
7841
7897
|
} }))
|
|
7842
7898
|
.onClose
|
|
7843
7899
|
.pipe(operators.takeUntil(this.ngUnsubscribe), operators.filter(function (value) { return !!value; }))
|
|
@@ -7929,7 +7985,8 @@
|
|
|
7929
7985
|
if (value) {
|
|
7930
7986
|
var cnpj = value.replace(/\./g, '').replace(/\//g, '').replace(/\-/g, '');
|
|
7931
7987
|
var filterQuery = "pessoa.cpfCnpj eq '" + cnpj + "'";
|
|
7932
|
-
this.transportadoraService
|
|
7988
|
+
this.transportadoraService
|
|
7989
|
+
.list({ filterQuery: filterQuery, page: 0, size: 10 })
|
|
7933
7990
|
.pipe(operators.takeUntil(this.ngUnsubscribe))
|
|
7934
7991
|
.subscribe(function (_a) {
|
|
7935
7992
|
var contents = _a.contents;
|
|
@@ -7942,41 +7999,23 @@
|
|
|
7942
7999
|
};
|
|
7943
8000
|
RecebimentoOrdemCompraFormComponent.prototype.onSave = function (start) {
|
|
7944
8001
|
var _this = this;
|
|
7945
|
-
this.
|
|
7946
|
-
|
|
7947
|
-
|
|
7948
|
-
|
|
7949
|
-
|
|
7950
|
-
|
|
7951
|
-
|
|
7952
|
-
|
|
7953
|
-
|
|
7954
|
-
|
|
7955
|
-
|
|
7956
|
-
|
|
7957
|
-
|
|
7958
|
-
|
|
7959
|
-
|
|
7960
|
-
|
|
7961
|
-
|
|
7962
|
-
_this.agenda.status = "REJEITADO_POR_VALIDACAO";
|
|
7963
|
-
_this.agendaService
|
|
7964
|
-
.atualizarAgenda(_this.agenda)
|
|
7965
|
-
.pipe(operators.takeUntil(_this.ngUnsubscribe))
|
|
7966
|
-
.subscribe(function (_) { return _this.router.navigate(["chegada-veiculo"]); });
|
|
7967
|
-
}
|
|
7968
|
-
else {
|
|
7969
|
-
_this.getSaveObservable()
|
|
7970
|
-
.pipe(operators.takeUntil(_this.ngUnsubscribe), operators.finalize(function () { return (_this.loading = false); }))
|
|
7971
|
-
.subscribe(function (value) {
|
|
7972
|
-
_this.formGroup.get("id").setValue(value.id || null);
|
|
7973
|
-
_this.addMessage("success", "saved_message_title", "saved_message_content");
|
|
7974
|
-
if (start && _this.saveAndInitButton)
|
|
7975
|
-
_this.saveAndInitButton.click();
|
|
7976
|
-
});
|
|
7977
|
-
}
|
|
7978
|
-
});
|
|
7979
|
-
},
|
|
8002
|
+
this.formGroup.get('agenda').setValue(this.agenda);
|
|
8003
|
+
if (this.formGroup.invalid) {
|
|
8004
|
+
return this.validateAllFormFields(this.formGroup);
|
|
8005
|
+
}
|
|
8006
|
+
if (this.formGroup.get("fornecedores").length <= 0) {
|
|
8007
|
+
this.erroFornecedores = true;
|
|
8008
|
+
return;
|
|
8009
|
+
}
|
|
8010
|
+
this.loading = true;
|
|
8011
|
+
return this.getSaveObservable()
|
|
8012
|
+
.pipe(operators.takeUntil(this.ngUnsubscribe), operators.finalize(function () { return _this.loading = false; }))
|
|
8013
|
+
.subscribe(function (value) {
|
|
8014
|
+
_this.formGroup.get("id").setValue(value.id || null);
|
|
8015
|
+
_this.addMessage("success", "saved_message_title", "saved_message_content");
|
|
8016
|
+
if (start && _this.saveAndInitButton) {
|
|
8017
|
+
_this.saveAndInitButton.click();
|
|
8018
|
+
}
|
|
7980
8019
|
});
|
|
7981
8020
|
};
|
|
7982
8021
|
RecebimentoOrdemCompraFormComponent.prototype.isNew = function () {
|
|
@@ -8002,9 +8041,8 @@
|
|
|
8002
8041
|
RecebimentoOrdemCompraFormComponent.prototype.getFornecedorForm = function (data) {
|
|
8003
8042
|
if (data === void 0) { data = {}; }
|
|
8004
8043
|
var formGroup = this.formBuilder.group({
|
|
8005
|
-
id: [undefined],
|
|
8006
8044
|
fornecedor: [data.fornecedor, forms.Validators.required],
|
|
8007
|
-
origemMercadoria: [data.origemMercadoria
|
|
8045
|
+
origemMercadoria: [data.origemMercadoria],
|
|
8008
8046
|
ordens: this.formBuilder.array([]),
|
|
8009
8047
|
});
|
|
8010
8048
|
this.valueChanges(formGroup, "fornecedor", this.onFornecedorChange);
|
|
@@ -8038,7 +8076,10 @@
|
|
|
8038
8076
|
var index = _this.getNotasFromOrdens(fornecedorForm, ordemCompraId).controls.indexOf(notaForm);
|
|
8039
8077
|
_this.getNotasFromOrdens(fornecedorForm, ordemCompraId).removeAt(index);
|
|
8040
8078
|
var nota = notaForm["value"];
|
|
8041
|
-
_this.fornecedorNotasTokens.push({
|
|
8079
|
+
_this.fornecedorNotasTokens.push({
|
|
8080
|
+
id: nota.chaveNotaFiscal,
|
|
8081
|
+
label: nota.numeroNotaFiscal
|
|
8082
|
+
});
|
|
8042
8083
|
_this.fornecedorNotas.push({
|
|
8043
8084
|
chaveNotaFiscal: nota.chaveNotaFiscal,
|
|
8044
8085
|
serieNotaFiscal: nota.serieNotaFiscal,
|
|
@@ -8048,75 +8089,59 @@
|
|
|
8048
8089
|
});
|
|
8049
8090
|
};
|
|
8050
8091
|
RecebimentoOrdemCompraFormComponent.prototype.showButtons = function () {
|
|
8051
|
-
if (!this.agenda)
|
|
8092
|
+
if (!this.agenda) {
|
|
8052
8093
|
return false;
|
|
8053
|
-
|
|
8094
|
+
}
|
|
8095
|
+
return [
|
|
8096
|
+
StatusAgenda.AGENDADO,
|
|
8097
|
+
StatusAgenda.AGUARDANDO_CONFIRMACAO,
|
|
8098
|
+
StatusAgenda.AGUARDANDO_CONFIRMACAO_SOLICITANTE,
|
|
8099
|
+
StatusAgenda.REJEITADO_POR_VALIDACAO
|
|
8100
|
+
].includes(this.agenda.status);
|
|
8054
8101
|
};
|
|
8055
8102
|
RecebimentoOrdemCompraFormComponent.prototype.disableAdicionarNota = function () {
|
|
8056
|
-
if (this.ordemCompraSelecionado === null) {
|
|
8103
|
+
if (this.ordemCompraSelecionado === null || this.ordemCompraSelecionado === undefined) {
|
|
8057
8104
|
return true;
|
|
8058
8105
|
}
|
|
8059
8106
|
return false;
|
|
8060
8107
|
};
|
|
8061
8108
|
RecebimentoOrdemCompraFormComponent.prototype.removerOrdemCompra = function (fornecedorForm, ordemCompraForm) {
|
|
8109
|
+
var _this = this;
|
|
8062
8110
|
this.confirmationService.confirm({
|
|
8063
|
-
header: this.translate.instant("yms.erp.
|
|
8064
|
-
message: this.translate.instant("yms.erp.
|
|
8111
|
+
header: this.translate.instant("yms.erp.remove_ordem_compra_header"),
|
|
8112
|
+
message: this.translate.instant("yms.erp.remove_ordem_compra_message"),
|
|
8065
8113
|
accept: function () {
|
|
8066
|
-
var
|
|
8067
|
-
|
|
8114
|
+
var ordensCompraForm = _this.getOrdensCompra(fornecedorForm);
|
|
8115
|
+
var index = ordensCompraForm.controls.indexOf(ordemCompraForm);
|
|
8116
|
+
ordensCompraForm.removeAt(index);
|
|
8068
8117
|
}
|
|
8069
8118
|
});
|
|
8070
8119
|
};
|
|
8071
8120
|
RecebimentoOrdemCompraFormComponent.prototype.onOrdemCompraSaved = function (ordemCompra, fornecedorForm) {
|
|
8072
|
-
var
|
|
8073
|
-
|
|
8074
|
-
if (ordensCompraForm.length === 0) {
|
|
8075
|
-
var form = this.getOrdemCompraForm(ordemCompra);
|
|
8076
|
-
this.getOrdensCompra(fornecedorForm).push(form);
|
|
8077
|
-
}
|
|
8078
|
-
try {
|
|
8079
|
-
for (var ordensCompraForm_1 = __values(ordensCompraForm), ordensCompraForm_1_1 = ordensCompraForm_1.next(); !ordensCompraForm_1_1.done; ordensCompraForm_1_1 = ordensCompraForm_1.next()) {
|
|
8080
|
-
var ordemCompraForm = ordensCompraForm_1_1.value;
|
|
8081
|
-
if (ordemCompra.codigo === ordemCompraForm["ordemCompra"]["codigo"]) {
|
|
8082
|
-
this.addMessage("error", "Mesmo ordem de compra sendo adicionado", "Não deve ser adiciona a mesma ordem de compra");
|
|
8083
|
-
return;
|
|
8084
|
-
}
|
|
8085
|
-
else {
|
|
8086
|
-
var form = this.getOrdemCompraForm(ordemCompra);
|
|
8087
|
-
this.getOrdensCompra(fornecedorForm).push(form);
|
|
8088
|
-
}
|
|
8089
|
-
}
|
|
8090
|
-
}
|
|
8091
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
8092
|
-
finally {
|
|
8093
|
-
try {
|
|
8094
|
-
if (ordensCompraForm_1_1 && !ordensCompraForm_1_1.done && (_a = ordensCompraForm_1.return)) _a.call(ordensCompraForm_1);
|
|
8095
|
-
}
|
|
8096
|
-
finally { if (e_1) throw e_1.error; }
|
|
8097
|
-
}
|
|
8121
|
+
var ordemCompraForm = this.getOrdemCompraForm({ ordemCompra: ordemCompra });
|
|
8122
|
+
this.getOrdensCompra(fornecedorForm).push(ordemCompraForm);
|
|
8098
8123
|
};
|
|
8099
8124
|
RecebimentoOrdemCompraFormComponent.prototype.getOrdensCompra = function (fornecedorForm) {
|
|
8100
8125
|
return fornecedorForm.get("ordens");
|
|
8101
8126
|
};
|
|
8102
|
-
RecebimentoOrdemCompraFormComponent.prototype.getNotasFromOrdens = function (fornecedorForm,
|
|
8103
|
-
var
|
|
8127
|
+
RecebimentoOrdemCompraFormComponent.prototype.getNotasFromOrdens = function (fornecedorForm, ordemCompraId) {
|
|
8128
|
+
var e_1, _a;
|
|
8104
8129
|
var ordensFormSelecionado = null;
|
|
8105
8130
|
var ordensCompraForm = fornecedorForm["controls"]["ordens"]["controls"];
|
|
8106
8131
|
try {
|
|
8107
|
-
for (var
|
|
8108
|
-
var ordemCompraForm =
|
|
8109
|
-
if (ordemCompraForm["controls"]["ordemCompra"]["value"].id ===
|
|
8132
|
+
for (var ordensCompraForm_1 = __values(ordensCompraForm), ordensCompraForm_1_1 = ordensCompraForm_1.next(); !ordensCompraForm_1_1.done; ordensCompraForm_1_1 = ordensCompraForm_1.next()) {
|
|
8133
|
+
var ordemCompraForm = ordensCompraForm_1_1.value;
|
|
8134
|
+
if (ordemCompraForm["controls"]["ordemCompra"]["value"].id === ordemCompraId) {
|
|
8110
8135
|
ordensFormSelecionado = ordemCompraForm["controls"]["notas"];
|
|
8111
8136
|
}
|
|
8112
8137
|
}
|
|
8113
8138
|
}
|
|
8114
|
-
catch (
|
|
8139
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
8115
8140
|
finally {
|
|
8116
8141
|
try {
|
|
8117
|
-
if (
|
|
8142
|
+
if (ordensCompraForm_1_1 && !ordensCompraForm_1_1.done && (_a = ordensCompraForm_1.return)) _a.call(ordensCompraForm_1);
|
|
8118
8143
|
}
|
|
8119
|
-
finally { if (
|
|
8144
|
+
finally { if (e_1) throw e_1.error; }
|
|
8120
8145
|
}
|
|
8121
8146
|
return ordensFormSelecionado;
|
|
8122
8147
|
};
|
|
@@ -8139,7 +8164,7 @@
|
|
|
8139
8164
|
RecebimentoOrdemCompraFormComponent.prototype.getOrdemCompraForm = function (data) {
|
|
8140
8165
|
if (data === void 0) { data = {}; }
|
|
8141
8166
|
return this.formBuilder.group({
|
|
8142
|
-
ordemCompra: [data, forms.Validators.required],
|
|
8167
|
+
ordemCompra: [data.ordemCompra, forms.Validators.required],
|
|
8143
8168
|
notas: this.formBuilder.array([]),
|
|
8144
8169
|
});
|
|
8145
8170
|
};
|
|
@@ -8148,7 +8173,7 @@
|
|
|
8148
8173
|
return this.formBuilder.group({
|
|
8149
8174
|
chaveNotaFiscal: [data.chaveNotaFiscal],
|
|
8150
8175
|
serieNotaFiscal: [data.serieNotaFiscal],
|
|
8151
|
-
numeroNotaFiscal: [data.numeroNotaFiscal]
|
|
8176
|
+
numeroNotaFiscal: [data.numeroNotaFiscal],
|
|
8152
8177
|
});
|
|
8153
8178
|
};
|
|
8154
8179
|
RecebimentoOrdemCompraFormComponent.prototype.mensagemOrdemCompraNaoSelecionado = function () {
|
|
@@ -8221,50 +8246,57 @@
|
|
|
8221
8246
|
var _this = this;
|
|
8222
8247
|
Object.keys(formGroup.controls).forEach(function (field) {
|
|
8223
8248
|
var control = formGroup.get(field);
|
|
8224
|
-
if (control instanceof forms.FormControl)
|
|
8249
|
+
if (control instanceof forms.FormControl) {
|
|
8225
8250
|
control.markAsDirty({ onlySelf: true });
|
|
8226
|
-
|
|
8251
|
+
}
|
|
8252
|
+
else if (control instanceof forms.FormGroup) {
|
|
8227
8253
|
_this.validateAllFormFields(control);
|
|
8228
|
-
|
|
8254
|
+
}
|
|
8255
|
+
else if (control instanceof forms.FormArray) {
|
|
8229
8256
|
control.controls.forEach(function (form) { return _this.validateAllFormFields(form); });
|
|
8257
|
+
}
|
|
8230
8258
|
});
|
|
8231
8259
|
};
|
|
8232
8260
|
RecebimentoOrdemCompraFormComponent.prototype.adicionarNovaNota = function (response) {
|
|
8233
|
-
var
|
|
8234
|
-
if (!
|
|
8261
|
+
var values = (response.documentos || []).length ? response.documentos[0] : undefined;
|
|
8262
|
+
if (!values) {
|
|
8235
8263
|
return;
|
|
8236
|
-
|
|
8237
|
-
|
|
8264
|
+
}
|
|
8265
|
+
/* const itemProduto = values.itens[0] || { produto: undefined, derivacao: undefined } as any;
|
|
8266
|
+
const produto = Produto.fromDto(itemProduto.produto);
|
|
8267
|
+
|
|
8238
8268
|
if (!this.formGroup.get("produto").value && !!itemProduto.produto) {
|
|
8239
8269
|
this.formGroup.get("produto").setValue(produto);
|
|
8240
8270
|
this.formGroup.get("derivacao").setValue(Derivacao.fromDto(itemProduto.derivacao));
|
|
8241
|
-
}
|
|
8242
|
-
else if (!!itemProduto.produto && !this.validateProduto(produto)) {
|
|
8271
|
+
} else if (!!itemProduto.produto && !this.validateProduto(produto)) {
|
|
8243
8272
|
this.addNotaError();
|
|
8244
8273
|
return;
|
|
8245
|
-
}
|
|
8246
|
-
var fornecedor = Pessoa.fromDto(
|
|
8247
|
-
var origemMercadoria = PessoaEndereco.fromDto(
|
|
8274
|
+
} */
|
|
8275
|
+
var fornecedor = Pessoa.fromDto(values.fornecedor);
|
|
8276
|
+
var origemMercadoria = PessoaEndereco.fromDto(values.origemMercadoria);
|
|
8248
8277
|
var fornecedorForm = this.getFornecedores().controls.find(function (_a) {
|
|
8249
8278
|
var value = _a.value;
|
|
8250
8279
|
return value.fornecedor.id === fornecedor.id;
|
|
8251
8280
|
});
|
|
8252
8281
|
if (!fornecedorForm) {
|
|
8253
8282
|
this.addFornecedor({ fornecedor: fornecedor, origemMercadoria: origemMercadoria });
|
|
8254
|
-
this.addFornecedorNotasToken(
|
|
8283
|
+
this.addFornecedorNotasToken(values);
|
|
8255
8284
|
return;
|
|
8256
8285
|
}
|
|
8257
|
-
this.addFornecedorNotasToken(
|
|
8286
|
+
this.addFornecedorNotasToken(values);
|
|
8258
8287
|
};
|
|
8259
|
-
|
|
8260
|
-
|
|
8288
|
+
/* private validateProduto(produto: Produto) {
|
|
8289
|
+
const { value } = this.formGroup.get("produto");
|
|
8261
8290
|
if (value.id !== produto.id) {
|
|
8262
8291
|
return false;
|
|
8263
8292
|
}
|
|
8264
8293
|
return true;
|
|
8265
|
-
}
|
|
8294
|
+
} */
|
|
8266
8295
|
RecebimentoOrdemCompraFormComponent.prototype.addFornecedorNotasToken = function (value) {
|
|
8267
|
-
this.fornecedorNotasTokens.push({
|
|
8296
|
+
this.fornecedorNotasTokens.push({
|
|
8297
|
+
id: this.chaveNotaFiscal,
|
|
8298
|
+
label: value.numero
|
|
8299
|
+
});
|
|
8268
8300
|
this.fornecedorNotas.push({
|
|
8269
8301
|
chaveNotaFiscal: this.chaveNotaFiscal,
|
|
8270
8302
|
serieNotaFiscal: value.serie,
|
|
@@ -8514,7 +8546,7 @@
|
|
|
8514
8546
|
RecebimentoOrdemCompraFormComponent = __decorate([
|
|
8515
8547
|
core.Component({
|
|
8516
8548
|
selector: 'recebimento-ordem-compra-form',
|
|
8517
|
-
template: "<p-confirmDialog [acceptLabel]=\"'yes' | translate\" acceptIcon=\"\" [rejectLabel]=\"'no' | translate\" rejectIcon=\"\">\n</p-confirmDialog>\n<div *sLoadingState=\"loading\">\n <form [formGroup]=\"formGroup\">\n <div class=\"ui-fluid ui-g\">\n\n <div class=\"ui-g-12\">\n <label for=\"chaveNotaFiscal\">{{'yms.erp.recebimento_chave_nota_fiscal' | translate}}</label>\n <input [class.ng-invalid]=\"erroChaveNota\" pInputText type=\"text\" [(ngModel)]=\"chaveNotaFiscal\" [ngModelOptions]=\"{standalone: true}\" (blur)=\"onBlurChaveNotaFiscal()\">\n <span class=\"input-error\" *ngIf=\"erroChaveNota\">{{'yms.erp.produto_nota_error_detail' | translate}}</span>\n </div>\n\n <div class=\"ui-md-6 ui-g-12 required\">\n <label for=\"filial\">{{'yms.erp.recebimento_ordem_compra_filial' | translate}}</label>\n <s-lookup dataKey=\"id\" id=\"filial\" name=\"filial\" formControlName=\"filial\"\n [searchFields]=\"filialSearchFields\" [searchGridFields]=\"filialSearchGridFields\"\n [searchGridData]=\"filialSearchGridData\" [multiple]=\"false\"\n [lookupSuggestions]=\"filialLookupSuggestions\" (onLookupRequest)=\"onFilialLookupRequest($event)\"\n (onSearchRequest)=\"onFilialSearchRequest($event)\" lookupDisplayField=\"label\"\n [searchTotalRecords]=\"filialSearchTotalRecords\"\n [searchTitle]=\"'yms.erp.filial_search_title' | translate\"\n [searchEmptyTitle]=\"'yms.erp.nothing_found' | translate\"\n [filterLabel]=\"'yms.erp.filter' | translate\" [clearLabel]=\"'yms.erp.clear' | translate\"\n [cancelLabel]=\"'yms.erp.cancel' | translate\" [selectLabel]=\"'yms.erp.select' | translate\"\n [searchTotalRecordsLabel]=\"'yms.erp.total_records' | translate: {value: filialSearchTotalRecords}\">\n </s-lookup>\n <s-control-errors [control]=\"formGroup.controls['filial']\"\n [errorMessages]=\"{ required: 'yms.erp.error_required' | translate }\"></s-control-errors>\n </div>\n\n <div class=\"ui-md-6 ui-g-12\">\n <label for=\"produto\">{{'yms.erp.recebimento_ordem_compra_produto' | translate}}</label>\n <s-lookup dataKey=\"id\" id=\"produto\" name=\"produto\" formControlName=\"produto\"\n [searchFields]=\"produtoSearchFields\" [searchGridFields]=\"produtoSearchFields\"\n [searchGridData]=\"produtoSearchGridData\" [multiple]=\"false\"\n [lookupSuggestions]=\"produtoLookupSuggestions\" (onLookupRequest)=\"onProdutoLookupRequest($event)\"\n (onSearchRequest)=\"onProdutoSearchRequest($event)\" lookupDisplayField=\"label\"\n [searchTotalRecords]=\"produtoSearchTotalRecords\"\n [searchTitle]=\"'yms.erp.produto_search_title' | translate\"\n [searchEmptyTitle]=\"'yms.erp.nothing_found' | translate\"\n [filterLabel]=\"'yms.erp.filter' | translate\" [clearLabel]=\"'yms.erp.clear' | translate\"\n [cancelLabel]=\"'yms.erp.cancel' | translate\" [selectLabel]=\"'yms.erp.select' | translate\"\n [searchTotalRecordsLabel]=\"'yms.erp.total_records' | translate: {value: produtoSearchTotalRecords}\">\n </s-lookup>\n <s-control-errors [control]=\"formGroup.controls['produto']\"\n [errorMessages]=\"{ required: 'yms.erp.error_required' | translate }\"></s-control-errors>\n </div>\n\n <div class=\"ui-md-6 ui-g-12\" [ngClass]=\"{'required': formGroup.get('produto').value}\">\n <label for=\"derivacao\">{{'yms.erp.recebimento_ordem_compra_derivacao' | translate}}</label>\n <s-lookup dataKey=\"id\" id=\"derivacao\" name=\"derivacao\" formControlName=\"derivacao\"\n [searchFields]=\"derivacaoSearchFields\" [searchGridFields]=\"derivacaoSearchFields\"\n [searchGridData]=\"derivacaoSearchGridData\" [multiple]=\"false\"\n [lookupSuggestions]=\"derivacaoLookupSuggestions\"\n (onLookupRequest)=\"onDerivacaoLookupRequest($event)\"\n (onSearchRequest)=\"onDerivacaoSearchRequest($event)\" lookupDisplayField=\"label\"\n [searchTotalRecords]=\"derivacaoSearchTotalRecords\"\n [searchTitle]=\"'yms.erp.derivacao_search_title' | translate\"\n [searchEmptyTitle]=\"'yms.erp.nothing_found' | translate\"\n [filterLabel]=\"'yms.erp.filter' | translate\" [clearLabel]=\"'yms.erp.clear' | translate\"\n [cancelLabel]=\"'yms.erp.cancel' | translate\" [selectLabel]=\"'yms.erp.select' | translate\"\n [searchTotalRecordsLabel]=\"'yms.erp.total_records' | translate: {value: derivacaoSearchTotalRecords}\">\n </s-lookup>\n <s-control-errors [control]=\"formGroup.controls['derivacao']\"\n [errorMessages]=\"{ required: 'yms.erp.error_required' | translate }\"></s-control-errors>\n </div>\n\n <div class=\"ui-md-6 ui-g-12\">\n <label for=\"transportadora\">{{'yms.erp.recebimento_ordem_compra_transportadora' | translate}}</label>\n <s-lookup dataKey=\"id\" id=\"transportadora\" name=\"transportadora\" formControlName=\"transportadora\"\n [searchFields]=\"transportadoraSearchFields\" [searchGridFields]=\"transportadoraSearchFields\"\n [searchGridData]=\"transportadoraSearchGridData\" [multiple]=\"false\"\n [lookupSuggestions]=\"transportadoraLookupSuggestions\"\n (onLookupRequest)=\"onTransportadoraLookupRequest($event)\"\n (onSearchRequest)=\"onTransportadoraSearchRequest($event)\" lookupDisplayField=\"label\"\n [searchTotalRecords]=\"transportadoraSearchTotalRecords\"\n [searchTitle]=\"'yms.erp.transportadora_search_title' | translate\"\n [searchEmptyTitle]=\"'yms.erp.nothing_found' | translate\"\n [filterLabel]=\"'yms.erp.filter' | translate\" [clearLabel]=\"'yms.erp.clear' | translate\"\n [cancelLabel]=\"'yms.erp.cancel' | translate\" [selectLabel]=\"'yms.erp.select' | translate\"\n [searchTotalRecordsLabel]=\"'yms.erp.total_records' | translate: {value: transportadoraSearchTotalRecords}\">\n </s-lookup>\n </div>\n\n <div class=\"ui-md-6 ui-g-12\">\n <label for=\"safra\">{{'yms.erp.recebimento_ordem_compra_safra' | translate}}</label>\n <s-lookup dataKey=\"id\" id=\"safra\" name=\"safra\" formControlName=\"safra\"\n [searchFields]=\"safraSearchFields\" [searchGridFields]=\"safraSearchGridFields\"\n [searchGridData]=\"safraSearchGridData\" [multiple]=\"false\"\n [lookupSuggestions]=\"safraLookupSuggestions\" (onLookupRequest)=\"onSafraLookupRequest($event)\"\n (onSearchRequest)=\"onSafraSearchRequest($event)\" lookupDisplayField=\"label\"\n [searchTotalRecords]=\"safraSearchTotalRecords\"\n [searchTitle]=\"'yms.erp.safra_search_title' | translate\"\n [searchEmptyTitle]=\"'yms.erp.nothing_found' | translate\"\n [filterLabel]=\"'yms.erp.filter' | translate\" [clearLabel]=\"'yms.erp.clear' | translate\"\n [cancelLabel]=\"'yms.erp.cancel' | translate\" [selectLabel]=\"'yms.erp.select' | translate\"\n [searchTotalRecordsLabel]=\"'yms.erp.total_records' | translate: {value:safraSearchTotalRecords}\">\n </s-lookup>\n </div>\n <div class=\"ui-g-12\" style=\"text-align: right;\" *ngIf=\"totalEixosContratados || totalEixosComposicao\">\n <label for=\"totalEixosContratados\" float=\"right\" style=\"display: inline;\">{{totalEixosContratados}}\n {{'yms.erp.total_eixos_contratados' | translate}} / </label>\n <label for=\"totalEixosComposicao\" float=\"right\" style=\"display: inline;\">{{totalEixosComposicao}}\n {{'yms.erp.total_eixos_composicao' | translate}}</label>\n </div>\n\n <div class=\"ui-md-12\">\n <s-button *ngIf=\"showButtons() && !!formGroup.get('filial').value && !createdByErp\" styleClass=\"btn-erp-forms\" iconClass=\"fas fa-plus\" label=\"Adicionar fornecedor\" priority=\"secondary\" (onClick)=\"addFornecedor()\" ></s-button>\n <span style=\"display: block;\" class=\"input-error\" *ngIf=\"erroFornecedores\">{{'Selecione ao menos um fornecedor para continuar' | translate}}</span>\n </div>\n\n <form class=\"ui-g-12\" *ngFor=\"let fornecedorForm of getFornecedores().controls; let i = index;\" [formGroup]=\"fornecedorForm\">\n <p-panel [style]=\"{position: 'relative'}\" styleClass=\"form-group ui-g-12 ui-md-12\" [toggleable]=\"true\">\n\n <p-header>\n Fornecedor {{+i+1}}\n <s-button \n style=\"display: inline-block; position: absolute; right: 50px; top: 10px\" \n *ngIf=\"showButtons() && !createdByErp\"\n iconClass=\"fas fa-trash\"\n label=\"Remover\"\n priority=\"default\"\n [auxiliary]=\"true\"\n (onClick)=\"removeFornecedor(fornecedorForm)\"\n >\n </s-button>\n </p-header>\n <div class=\"ui-md-6 ui-g-12 required\">\n <label for=\"fornecedor\">{{'yms.erp.recebimento_ordem_compra_fornecedor' | translate}}</label>\n <s-lookup dataKey=\"id\" id=\"fornecedor\" name=\"fornecedor\" formControlName=\"fornecedor\"\n [searchFields]=\"fornecedorSearchFields\" [searchGridFields]=\"fornecedorSearchFields\"\n [searchGridData]=\"fornecedorSearchGridData\" [multiple]=\"false\"\n [lookupSuggestions]=\"fornecedorLookupSuggestions\"\n (onLookupRequest)=\"onFornecedorLookupRequest($event)\"\n (onSearchRequest)=\"onFornecedorSearchRequest($event)\" lookupDisplayField=\"label\"\n [searchTotalRecords]=\"fornecedorSearchTotalRecords\"\n [searchTitle]=\"'yms.erp.fornecedor_search_title' | translate\"\n [searchEmptyTitle]=\"'yms.erp.nothing_found' | translate\"\n [filterLabel]=\"'yms.erp.filter' | translate\" [clearLabel]=\"'yms.erp.clear' | translate\"\n [cancelLabel]=\"'yms.erp.cancel' | translate\" [selectLabel]=\"'yms.erp.select' | translate\"\n [searchTotalRecordsLabel]=\"'yms.erp.total_records' | translate: {value: fornecedorSearchTotalRecords}\">\n </s-lookup>\n <s-control-errors [control]=\"fornecedorForm.get('fornecedor')\"\n [errorMessages]=\"{ required: 'yms.erp.error_required' | translate }\"></s-control-errors>\n </div>\n\n <div class=\"ui-md-6 ui-g-12\">\n <label for=\"origem_mercadoria\">{{'yms.erp.recebimento_ordem_compra_mercadoria' | translate}}</label>\n <s-lookup dataKey=\"id\" id=\"origem_mercadoria\" name=\"origem_mercadoria\"\n formControlName=\"origemMercadoria\" [searchFields]=\"origemMercadoriaSearchFields\"\n [searchGridFields]=\"origemMercadoriaSearchFields\"\n [searchGridData]=\"origemMercadoriaSearchGridData\" [multiple]=\"false\"\n [lookupSuggestions]=\"origemMercadoriaLookupSuggestions\"\n (onLookupRequest)=\"onOrigemMercadoriaLookupRequest(fornecedorForm, $event)\"\n (onSearchRequest)=\"onOrigemMercadoriaSearchRequest(fornecedorForm, $event)\" lookupDisplayField=\"label\"\n [searchTotalRecords]=\"origemMercadoriaSearchTotalRecords\"\n [searchTitle]=\"'yms.erp.origem_mercadoria_search_title' | translate\"\n [searchEmptyTitle]=\"'yms.erp.nothing_found' | translate\"\n [filterLabel]=\"'yms.erp.filter' | translate\" [clearLabel]=\"'yms.erp.clear' | translate\"\n [cancelLabel]=\"'yms.erp.cancel' | translate\" [selectLabel]=\"'yms.erp.select' | translate\"\n [searchTotalRecordsLabel]=\"'yms.erp.total_records' | translate: {value: origemMercadoriaSearchTotalRecords}\">\n </s-lookup>\n <s-control-errors [control]=\"fornecedorForm.get('origemMercadoria')\"\n [errorMessages]=\"{ required: 'yms.erp.error_required' | translate }\"></s-control-errors>\n </div>\n\n <div class=\"ui-g-12\">\n <label for=\"fornecedorNotas\">Notas a serem adicionadas</label>\n <s-token-list id=\"fornecedorNotas\" [tokens]=\"fornecedorNotasTokens\" (tokenSelected)=\"addFornecedorNotasTokenEmOrdemCompra(fornecedorForm, $event)\" (tokenRemoved)=\"removeFornecedorNotasTokenDaOrdemCompra($event)\" [removableTokens]=\"true\"></s-token-list>\n </div>\n\n <div class=\"ui-g-12\">\n <s-button label=\"Adicionar nota\" *ngIf=\"showButtons()\" styleClass=\"btn-erp-forms\" priority=\"secondary\" (onClick)=\"addNota(fornecedorForm)\" [disabled]=\"disableAdicionarNota()\"></s-button>\n <s-button label=\"Adicionar ordem de compra\" *ngIf=\"showButtons() && !createdByErp\" styleClass=\"btn-erp-forms\" priority=\"secondary\" (onClick)=\"onAddOrdemCompraSearchRequest(fornecedorForm)\"></s-button>\n </div>\n\n <div class=\"ui-g-12\">\n <h4>Ordens de Compra</h4>\n <p-table [value]=\"getOrdensCompra(fornecedorForm).controls\" [(selection)]=\"ordemCompraSelecionado\">\n <ng-template pTemplate=\"body\" let-rowData>\n <tr [pSelectableRow]=\"rowData\">\n <td style=\"width: 50px\">\n <p-tableRadioButton [value]=\"rowData.get('ordemCompra').value\"></p-tableRadioButton>\n </td>\n <td>\n <p-accordion>\n <p-accordionTab>\n <p-header>\n Ordem {{rowData.get('ordemCompra').value.codigo}}, Filial {{rowData.get('ordemCompra').value.filial?.codigo}}\n\n <span *ngIf=\"showButtons() && !createdByErp\" style=\"margin-left: 10px; float: right;\" class=\"fas fa-trash\" (click)=\"removerOrdemCompra(fornecedorForm, rowData)\"></span>\n </p-header>\n\n <div class=\"detail-pane\">\n <div class=\"detail-span\">\n <span class=\"title\">Notas</span>\n <span class=\"data\">\n <p-accordion>\n <p-accordionTab *ngFor=\"let nota of getNotas(rowData).controls\">\n <p-header>\n {{nota.get('chaveNotaFiscal').value || (nota.get('serieNotaFiscal').value + ' - ' + nota.get('numeroNotaFiscal').value)}}\n\n <span *ngIf=\"showButtons()\" style=\"margin-left: 10px; float: right;\" class=\"fas fa-trash\" (click)=\"removerNota(fornecedorForm, rowData, nota)\"></span>\n </p-header>\n\n <div class=\"detail-pane\">\n <div class=\"detail-span\">\n <span class=\"title\">Serie nota fiscal</span>\n <span class=\"data\">{{nota.value?.serieNotaFiscal}}</span>\n </div>\n <div class=\"detail-span\">\n <span class=\"title\">N\u00FAmero nota fiscal</span>\n <span class=\"data\">{{nota.value?.numeroNotaFiscal}}</span>\n </div>\n </div>\n\n </p-accordionTab> \n </p-accordion>\n </span>\n </div>\n </div>\n </p-accordionTab>\n </p-accordion>\n </td>\n </tr>\n </ng-template>\n </p-table>\n </div>\n </p-panel>\n </form>\n </div>\n </form>\n\n <div style=\"margin: 5px 0 5px 0;\">\n <s-button *ngIf=\"showButtons()\" priority=\"primary\" [label]=\"'save' | translate\" (onClick)=\"onSave()\"\n [disabled]=\"loading || disableButtonSave ||!this.formGroup.dirty\"></s-button>\n <s-button *ngIf=\"saveAndInitButton && showButtons()\" priority=\"primary\" [label]=\"'save_and_init' | translate\"\n (onClick)=\"onSave(true)\" [disabled]=\"loading || disableButtonSave || !this.formGroup.dirty\"></s-button>\n </div>\n</div>",
|
|
8549
|
+
template: "<p-confirmDialog [acceptLabel]=\"'yes' | translate\" acceptIcon=\"\" [rejectLabel]=\"'no' | translate\" rejectIcon=\"\">\n</p-confirmDialog>\n<div *sLoadingState=\"loading\">\n <form [formGroup]=\"formGroup\">\n <div class=\"ui-fluid ui-g\">\n\n <div class=\"ui-g-12\">\n <label for=\"chaveNotaFiscal\">{{'yms.erp.recebimento_chave_nota_fiscal' | translate}}</label>\n <input pInputText type=\"text\" [(ngModel)]=\"chaveNotaFiscal\" [ngModelOptions]=\"{standalone: true}\" (blur)=\"onBlurChaveNotaFiscal()\">\n <!-- <input [class.ng-invalid]=\"erroChaveNota\" pInputText type=\"text\" [(ngModel)]=\"chaveNotaFiscal\" [ngModelOptions]=\"{standalone: true}\" (blur)=\"onBlurChaveNotaFiscal()\"> -->\n <!-- <span class=\"input-error\" *ngIf=\"erroChaveNota\">{{'yms.erp.produto_nota_error_detail' | translate}}</span> -->\n </div>\n\n <div class=\"ui-md-6 ui-g-12 required\">\n <label for=\"filial\">{{'yms.erp.recebimento_ordem_compra_filial' | translate}}</label>\n <s-lookup dataKey=\"id\" id=\"filial\" name=\"filial\" formControlName=\"filial\"\n [searchFields]=\"filialSearchFields\" [searchGridFields]=\"filialSearchGridFields\"\n [searchGridData]=\"filialSearchGridData\" [multiple]=\"false\"\n [lookupSuggestions]=\"filialLookupSuggestions\" (onLookupRequest)=\"onFilialLookupRequest($event)\"\n (onSearchRequest)=\"onFilialSearchRequest($event)\" lookupDisplayField=\"label\"\n [searchTotalRecords]=\"filialSearchTotalRecords\"\n [searchTitle]=\"'yms.erp.filial_search_title' | translate\"\n [searchEmptyTitle]=\"'yms.erp.nothing_found' | translate\"\n [filterLabel]=\"'yms.erp.filter' | translate\" [clearLabel]=\"'yms.erp.clear' | translate\"\n [cancelLabel]=\"'yms.erp.cancel' | translate\" [selectLabel]=\"'yms.erp.select' | translate\"\n [searchTotalRecordsLabel]=\"'yms.erp.total_records' | translate: {value: filialSearchTotalRecords}\">\n </s-lookup>\n <s-control-errors [control]=\"formGroup.controls['filial']\"\n [errorMessages]=\"{ required: 'yms.erp.error_required' | translate }\"></s-control-errors>\n </div>\n\n <div class=\"ui-md-6 ui-g-12\">\n <label for=\"transportadora\">{{'yms.erp.recebimento_ordem_compra_transportadora' | translate}}</label>\n <s-lookup dataKey=\"id\" id=\"transportadora\" name=\"transportadora\" formControlName=\"transportadora\"\n [searchFields]=\"transportadoraSearchFields\" [searchGridFields]=\"transportadoraSearchFields\"\n [searchGridData]=\"transportadoraSearchGridData\" [multiple]=\"false\"\n [lookupSuggestions]=\"transportadoraLookupSuggestions\"\n (onLookupRequest)=\"onTransportadoraLookupRequest($event)\"\n (onSearchRequest)=\"onTransportadoraSearchRequest($event)\" lookupDisplayField=\"label\"\n [searchTotalRecords]=\"transportadoraSearchTotalRecords\"\n [searchTitle]=\"'yms.erp.transportadora_search_title' | translate\"\n [searchEmptyTitle]=\"'yms.erp.nothing_found' | translate\"\n [filterLabel]=\"'yms.erp.filter' | translate\" [clearLabel]=\"'yms.erp.clear' | translate\"\n [cancelLabel]=\"'yms.erp.cancel' | translate\" [selectLabel]=\"'yms.erp.select' | translate\"\n [searchTotalRecordsLabel]=\"'yms.erp.total_records' | translate: {value: transportadoraSearchTotalRecords}\">\n </s-lookup>\n </div>\n\n <div class=\"ui-g-12\" style=\"text-align: right;\" *ngIf=\"totalEixosContratados || totalEixosComposicao\">\n <label for=\"totalEixosContratados\" float=\"right\" style=\"display: inline;\">\n {{totalEixosContratados}} {{'yms.erp.total_eixos_contratados' | translate}} /\n </label>\n <label for=\"totalEixosComposicao\" float=\"right\" style=\"display: inline;\">\n {{totalEixosComposicao}} {{'yms.erp.total_eixos_composicao' | translate}}\n </label>\n </div>\n\n <div class=\"ui-md-12\">\n <s-button *ngIf=\"showButtons() && !!formGroup.get('filial').value && !createdByErp\" styleClass=\"btn-erp-forms\" iconClass=\"fas fa-plus\" label=\"Adicionar fornecedor\" priority=\"secondary\" (onClick)=\"addFornecedor()\"></s-button>\n <span style=\"display: block;\" class=\"input-error\" *ngIf=\"erroFornecedores\">{{'Selecione ao menos um fornecedor para continuar' | translate}}</span>\n </div>\n\n <form class=\"ui-g-12\" *ngFor=\"let fornecedorForm of getFornecedores().controls; let i = index;\" [formGroup]=\"fornecedorForm\">\n <p-panel [style]=\"{position: 'relative'}\" styleClass=\"form-group ui-g-12 ui-md-12\" [toggleable]=\"true\">\n\n <p-header>\n Fornecedor {{+i+1}}\n <s-button \n style=\"display: inline-block; position: absolute; right: 50px; top: 10px\" \n *ngIf=\"showButtons() && !createdByErp\"\n iconClass=\"fas fa-trash\"\n label=\"Remover\"\n priority=\"default\"\n [auxiliary]=\"true\"\n (onClick)=\"removeFornecedor(fornecedorForm)\">\n </s-button>\n </p-header>\n \n <div class=\"ui-md-6 ui-g-12 required\">\n <label for=\"fornecedor\">{{'yms.erp.recebimento_ordem_compra_fornecedor' | translate}}</label>\n <s-lookup dataKey=\"id\" id=\"fornecedor\" name=\"fornecedor\" formControlName=\"fornecedor\"\n [searchFields]=\"fornecedorSearchFields\" [searchGridFields]=\"fornecedorSearchFields\"\n [searchGridData]=\"fornecedorSearchGridData\" [multiple]=\"false\"\n [lookupSuggestions]=\"fornecedorLookupSuggestions\"\n (onLookupRequest)=\"onFornecedorLookupRequest($event)\"\n (onSearchRequest)=\"onFornecedorSearchRequest($event)\" lookupDisplayField=\"label\"\n [searchTotalRecords]=\"fornecedorSearchTotalRecords\"\n [searchTitle]=\"'yms.erp.fornecedor_search_title' | translate\"\n [searchEmptyTitle]=\"'yms.erp.nothing_found' | translate\"\n [filterLabel]=\"'yms.erp.filter' | translate\" [clearLabel]=\"'yms.erp.clear' | translate\"\n [cancelLabel]=\"'yms.erp.cancel' | translate\" [selectLabel]=\"'yms.erp.select' | translate\"\n [searchTotalRecordsLabel]=\"'yms.erp.total_records' | translate: { value: fornecedorSearchTotalRecords }\">\n </s-lookup>\n <s-control-errors\n [control]=\"fornecedorForm.get('fornecedor')\"\n [errorMessages]=\"{ required: 'yms.erp.error_required' | translate }\">\n </s-control-errors>\n </div>\n\n <div class=\"ui-md-6 ui-g-12\">\n <label for=\"origem_mercadoria\">{{'yms.erp.recebimento_ordem_compra_mercadoria' | translate}}</label>\n <s-lookup dataKey=\"id\" id=\"origem_mercadoria\" name=\"origem_mercadoria\" formControlName=\"origemMercadoria\" \n [searchFields]=\"origemMercadoriaSearchFields\" [searchGridFields]=\"origemMercadoriaSearchFields\"\n [searchGridData]=\"origemMercadoriaSearchGridData\" [multiple]=\"false\"\n [lookupSuggestions]=\"origemMercadoriaLookupSuggestions\" lookupDisplayField=\"label\"\n (onLookupRequest)=\"onOrigemMercadoriaLookupRequest(fornecedorForm, $event)\"\n (onSearchRequest)=\"onOrigemMercadoriaSearchRequest(fornecedorForm, $event)\" \n [searchTotalRecords]=\"origemMercadoriaSearchTotalRecords\"\n [searchTitle]=\"'yms.erp.origem_mercadoria_search_title' | translate\"\n [searchEmptyTitle]=\"'yms.erp.nothing_found' | translate\"\n [filterLabel]=\"'yms.erp.filter' | translate\" [clearLabel]=\"'yms.erp.clear' | translate\"\n [cancelLabel]=\"'yms.erp.cancel' | translate\" [selectLabel]=\"'yms.erp.select' | translate\"\n [searchTotalRecordsLabel]=\"'yms.erp.total_records' | translate: { value: origemMercadoriaSearchTotalRecords }\">\n </s-lookup>\n </div>\n\n <div class=\"ui-g-12\">\n <label for=\"fornecedorNotas\">Notas a serem adicionadas</label>\n <s-token-list id=\"fornecedorNotas\" [tokens]=\"fornecedorNotasTokens\" (tokenSelected)=\"addFornecedorNotasTokenEmOrdemCompra(fornecedorForm, $event)\" (tokenRemoved)=\"removeFornecedorNotasTokenDaOrdemCompra($event)\" [removableTokens]=\"true\"></s-token-list>\n </div>\n\n <div class=\"ui-g-12\">\n <s-button label=\"Adicionar nota\" *ngIf=\"showButtons()\" styleClass=\"btn-erp-forms\" priority=\"secondary\" (onClick)=\"addNota(fornecedorForm)\" [disabled]=\"disableAdicionarNota()\"></s-button>\n <s-button label=\"Adicionar ordem de compra\" *ngIf=\"showButtons() && !createdByErp\" styleClass=\"btn-erp-forms\" priority=\"secondary\" (onClick)=\"addOrdemCompra(fornecedorForm)\"></s-button>\n </div>\n\n <div class=\"ui-g-12\">\n <h4>Ordens de Compra</h4>\n <p-table [value]=\"getOrdensCompra(fornecedorForm).controls\" [(selection)]=\"ordemCompraSelecionado\">\n <ng-template pTemplate=\"body\" let-rowData>\n <tr [pSelectableRow]=\"rowData\">\n <td style=\"width: 50px\">\n <p-tableRadioButton [value]=\"rowData.get('ordemCompra').value\"></p-tableRadioButton>\n </td>\n <td>\n <p-accordion>\n <p-accordionTab>\n <p-header>\n Ordem {{rowData.get('ordemCompra').value.codigo}}, Filial {{rowData.get('ordemCompra').value.filial?.codigo}}\n\n <span *ngIf=\"showButtons() && !createdByErp\" style=\"margin-left: 10px; float: right;\" class=\"fas fa-trash\" (click)=\"removerOrdemCompra(fornecedorForm, rowData)\"></span>\n </p-header>\n\n <div class=\"detail-pane\">\n <div class=\"detail-span\">\n <span class=\"title\">Notas</span>\n <span class=\"data\">\n <p-accordion>\n <p-accordionTab *ngFor=\"let nota of getNotas(rowData).controls\">\n <p-header>\n {{nota.get('chaveNotaFiscal').value || (nota.get('serieNotaFiscal').value + ' - ' + nota.get('numeroNotaFiscal').value)}}\n\n <span *ngIf=\"showButtons()\" style=\"margin-left: 10px; float: right;\" class=\"fas fa-trash\" (click)=\"removerNota(fornecedorForm, rowData, nota)\"></span>\n </p-header>\n\n <div class=\"detail-pane\">\n <div class=\"detail-span\">\n <span class=\"title\">Serie nota fiscal</span>\n <span class=\"data\">{{nota.value?.serieNotaFiscal}}</span>\n </div>\n <div class=\"detail-span\">\n <span class=\"title\">N\u00FAmero nota fiscal</span>\n <span class=\"data\">{{nota.value?.numeroNotaFiscal}}</span>\n </div>\n </div>\n\n </p-accordionTab> \n </p-accordion>\n </span>\n </div>\n </div>\n </p-accordionTab>\n </p-accordion>\n </td>\n </tr>\n </ng-template>\n </p-table>\n </div>\n </p-panel>\n </form>\n </div>\n </form>\n\n <div style=\"margin: 5px 0 5px 0;\">\n <s-button *ngIf=\"showButtons()\" priority=\"primary\" [label]=\"'save' | translate\" (onClick)=\"onSave()\"\n [disabled]=\"loading || disableButtonSave ||!this.formGroup.dirty\">\n </s-button>\n <s-button *ngIf=\"saveAndInitButton && showButtons()\" priority=\"primary\" [label]=\"'save_and_init' | translate\"\n (onClick)=\"onSave(true)\" [disabled]=\"loading || disableButtonSave || !this.formGroup.dirty\">\n </s-button>\n </div>\n</div>",
|
|
8518
8550
|
providers: [api.ConfirmationService],
|
|
8519
8551
|
styles: [".required-h3{font-size:1.17rem;font-weight:700}.required-h3::after{content:'*';color:#c13018;font-weight:400;margin-left:5px;font-size:14px}.error-required-message{color:#c13018;margin-top:5px;font-size:12px}.separator{width:100%;margin:5px 0;height:1px;background-color:#ccc}.input-error{color:#c13018}.detail-pane{display:flex;flex-wrap:wrap;justify-content:flex-start}.detail-pane .detail-span{width:50%;padding:10px 0;display:flex;flex-direction:column}.detail-pane .detail-span .title{font-size:14px;opacity:.7;margin-bottom:4px}.detail-pane .detail-span .data{font-size:16px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}"]
|
|
8520
8552
|
}),
|
|
@@ -8549,15 +8581,17 @@
|
|
|
8549
8581
|
}
|
|
8550
8582
|
RecebimentoOrdemCompraInfoComponent.prototype.ngAfterViewInit = function () {
|
|
8551
8583
|
var _this = this;
|
|
8552
|
-
this.recebimentoOrdemCompraService
|
|
8584
|
+
this.recebimentoOrdemCompraService
|
|
8585
|
+
.list({
|
|
8553
8586
|
filterQuery: "agenda.id eq '" + this.agenda.id + "'",
|
|
8554
8587
|
page: 0,
|
|
8555
8588
|
size: 1
|
|
8556
8589
|
})
|
|
8557
8590
|
.pipe(operators.takeUntil(this.unsubscribe$), operators.switchMap(function (_a) {
|
|
8558
8591
|
var contents = _a.contents;
|
|
8559
|
-
if (!contents.length)
|
|
8592
|
+
if (!contents.length) {
|
|
8560
8593
|
return rxjs.throwError("Recebimento Ordem de Compra não encontrado.");
|
|
8594
|
+
}
|
|
8561
8595
|
return rxjs.of(contents[0]);
|
|
8562
8596
|
}), operators.finalize(function () { return _this.loading = false; }))
|
|
8563
8597
|
.subscribe(function (recebimentoOrdemCompra) { return _this.recebimentoOrdemCompra = RecebimentoOrdemCompra.fromDto(recebimentoOrdemCompra); });
|
|
@@ -8569,7 +8603,7 @@
|
|
|
8569
8603
|
RecebimentoOrdemCompraInfoComponent = __decorate([
|
|
8570
8604
|
core.Component({
|
|
8571
8605
|
selector: 'recebimento-ordem-compra-info',
|
|
8572
|
-
template: "\n <div *sLoadingState=\"loading\" style=\"padding: 20px;\">\n <div class=\"detail-pane\" *ngIf=\"agenda\">\n\n <div class=\"detail-span\">\n <span class=\"title\">{{'yms.erp.recebimento_ordem_compra_filial' | translate}}</span>\n <span class=\"data\">{{recebimentoOrdemCompra?.filial?.codigo}} - {{recebimentoOrdemCompra?.filial?.nome}}</span>\n </div
|
|
8606
|
+
template: "\n <div *sLoadingState=\"loading\" style=\"padding: 20px;\">\n <div class=\"detail-pane\" *ngIf=\"agenda\">\n\n <div class=\"detail-span\">\n <span class=\"title\">{{'yms.erp.recebimento_ordem_compra_filial' | translate}}</span>\n <span class=\"data\">{{recebimentoOrdemCompra?.filial?.codigo}} - {{recebimentoOrdemCompra?.filial?.nome}}</span>\n </div>\n\n <div class=\"detail-span\">\n <span class=\"title\">{{'yms.erp.recebimento_ordem_compra_produto' | translate}}</span>\n <span class=\"data\">{{recebimentoOrdemCompra?.produto?.descricao}}</span>\n </div>\n\n <div class=\"detail-span\">\n <span class=\"title\">{{'yms.erp.recebimento_ordem_compra_derivacao' | translate}}</span>\n <span class=\"data\">{{recebimentoOrdemCompra?.derivacao?.descricao}}</span>\n </div>\n\n <div class=\"detail-span\">\n <span class=\"title\">{{'yms.erp.recebimento_ordem_compra_transportadora' | translate}}</span>\n <span class=\"data\">{{recebimentoOrdemCompra?.transportadora?.placaVeiculo}}</span>\n </div>\n\n <div class=\"detail-span\">\n <span class=\"title\">{{'yms.erp.recebimento_ordem_compra_safra' | translate}}</span>\n <span class=\"data\">{{recebimentoOrdemCompra?.safra?.descricao}}</span>\n </div>\n </div>\n <div *ngFor=\"let fornecedor of recebimentoOrdemCompra?.fornecedores\">\n <div class=\"separator\"></div>\n <h3>Fornecedor - {{fornecedor?.fornecedor?.nome}}</h3>\n <div class=\"detail-pane\">\n <div class=\"detail-span\" *ngFor=\"let ordemCompra of fornecedor.ordens\">\n <span class=\"title\">{{'yms.erp.recebimento_ordem_compra_ordemcompra' | translate}}</span>\n <span class=\"data\">{{ ordemCompra.ordemCompra?.codigo }}</span>\n </div>\n </div>\n\n <div>\n <h4>Ordens de Compra</h4>\n <p-accordion>\n <p-accordionTab *ngFor=\"let ordemCompra of fornecedor.ordens\">\n <p-header>\n Ordem de compra {{ ordemCompra?.ordemCompra?.numero }}, Filial {{ ordemCompra?.ordemCompra?.filial?.codigo }}\n </p-header>\n\n <div *ngFor=\"let nota of ordemCompra.notas\">\n <div class=\"detail-pane\">\n <div class=\"detail-span\">\n <span class=\"title\">Chave nota fiscal</span>\n <span class=\"data\">{{ nota?.chaveNotaFiscal }}</span>\n </div>\n <div class=\"detail-span\">\n <span class=\"title\">Serie nota fiscal</span>\n <span class=\"data\">{{ nota?.serieNotaFiscal }}</span>\n </div>\n <div class=\"detail-span\">\n <span class=\"title\">N\u00FAmero nota fiscal</span>\n <span class=\"data\">{{ nota?.numeroNotaFiscal }}</span>\n </div>\n </div>\n <hr />\n </div>\n </p-accordionTab>\n </p-accordion>\n </div>\n </div>\n </div>\n ",
|
|
8573
8607
|
styles: [".detail-pane{display:flex;flex-wrap:wrap;justify-content:flex-start}.detail-pane .detail-span{width:50%;padding:10px 0;display:flex;flex-direction:column}.detail-pane .detail-span .title{font-size:14px;opacity:.7;margin-bottom:4px}.detail-pane .detail-span .data{font-size:16px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}"]
|
|
8574
8608
|
}),
|
|
8575
8609
|
__metadata("design:paramtypes", [RecebimentoOrdemCompraService])
|
|
@@ -8577,44 +8611,6 @@
|
|
|
8577
8611
|
return RecebimentoOrdemCompraInfoComponent;
|
|
8578
8612
|
}());
|
|
8579
8613
|
|
|
8580
|
-
var moment$m = _moment;
|
|
8581
|
-
/*{CA:PROJECT_IMPORTS:START}*/
|
|
8582
|
-
/*{CA:PROJECT_IMPORTS:END}*/
|
|
8583
|
-
var ContratoCompraItem = /** @class */ (function () {
|
|
8584
|
-
function ContratoCompraItem() {
|
|
8585
|
-
}
|
|
8586
|
-
/*{CA:CLASS_ATTRIBUTES:START}*/
|
|
8587
|
-
/*{CA:CLASS_ATTRIBUTES:END}*/
|
|
8588
|
-
ContratoCompraItem.fromDto = function (contratoCompraItemDto, originEntity) {
|
|
8589
|
-
var model = __assign({}, contratoCompraItemDto);
|
|
8590
|
-
model.sku = model.sku || {};
|
|
8591
|
-
model.dataCompetencia = model.dataCompetencia && moment$m(model.dataCompetencia).toDate();
|
|
8592
|
-
model.createdDate = model.createdDate && moment$m(model.createdDate).toDate();
|
|
8593
|
-
model.lastModifiedDate = model.lastModifiedDate && moment$m(model.lastModifiedDate).toDate();
|
|
8594
|
-
model.label = model.sequencia + " - " + model.sku.descricao + " - " + model.sku.codigo;
|
|
8595
|
-
if (originEntity !== "ContratoCompra" && model.contrato)
|
|
8596
|
-
model.contrato = ContratoCompra.fromDto(model.contrato, "ContratoCompraItem");
|
|
8597
|
-
if (originEntity !== "Produto" && model.sku)
|
|
8598
|
-
model.sku = Produto.fromDto(model.sku, "ContratoCompraItem");
|
|
8599
|
-
return model;
|
|
8600
|
-
};
|
|
8601
|
-
ContratoCompraItem.toDto = function (contratoCompraItem, originEntity) {
|
|
8602
|
-
var dto = __assign({}, contratoCompraItem);
|
|
8603
|
-
dto.dataCompetencia = dto.dataCompetencia && moment$m(dto.dataCompetencia).format("YYYY-MM-DD");
|
|
8604
|
-
dto.createdDate = dto.createdDate && moment$m(dto.createdDate).format();
|
|
8605
|
-
dto.lastModifiedDate = dto.lastModifiedDate && moment$m(dto.lastModifiedDate).format();
|
|
8606
|
-
delete dto.label;
|
|
8607
|
-
if (originEntity !== "ContratoCompra" && dto.contrato)
|
|
8608
|
-
dto.contrato = ContratoCompra.toDto(dto.contrato, "ContratoCompraItem");
|
|
8609
|
-
if (originEntity !== "Produto" && dto.sku)
|
|
8610
|
-
dto.sku = Produto.toDto(dto.sku, "ContratoCompraItem");
|
|
8611
|
-
return dto;
|
|
8612
|
-
};
|
|
8613
|
-
return ContratoCompraItem;
|
|
8614
|
-
}());
|
|
8615
|
-
/*{CA:FILE_CONTENTS:START}*/
|
|
8616
|
-
/*{CA:FILE_CONTENTS:END}*/
|
|
8617
|
-
|
|
8618
8614
|
var moment$n = _moment;
|
|
8619
8615
|
/*{CA:PROJECT_IMPORTS:START}*/
|
|
8620
8616
|
/*{CA:PROJECT_IMPORTS:END}*/
|
|
@@ -8671,6 +8667,44 @@
|
|
|
8671
8667
|
/*{CA:FILE_CONTENTS:END}*/
|
|
8672
8668
|
|
|
8673
8669
|
var moment$o = _moment;
|
|
8670
|
+
/*{CA:PROJECT_IMPORTS:START}*/
|
|
8671
|
+
/*{CA:PROJECT_IMPORTS:END}*/
|
|
8672
|
+
var ContratoCompraItem = /** @class */ (function () {
|
|
8673
|
+
function ContratoCompraItem() {
|
|
8674
|
+
}
|
|
8675
|
+
/*{CA:CLASS_ATTRIBUTES:START}*/
|
|
8676
|
+
/*{CA:CLASS_ATTRIBUTES:END}*/
|
|
8677
|
+
ContratoCompraItem.fromDto = function (contratoCompraItemDto, originEntity) {
|
|
8678
|
+
var model = __assign({}, contratoCompraItemDto);
|
|
8679
|
+
model.sku = model.sku || {};
|
|
8680
|
+
model.dataCompetencia = model.dataCompetencia && moment$o(model.dataCompetencia).toDate();
|
|
8681
|
+
model.createdDate = model.createdDate && moment$o(model.createdDate).toDate();
|
|
8682
|
+
model.lastModifiedDate = model.lastModifiedDate && moment$o(model.lastModifiedDate).toDate();
|
|
8683
|
+
model.label = model.sequencia + " - " + model.sku.descricao + " - " + model.sku.codigo;
|
|
8684
|
+
if (originEntity !== "ContratoCompra" && model.contrato)
|
|
8685
|
+
model.contrato = ContratoCompra.fromDto(model.contrato, "ContratoCompraItem");
|
|
8686
|
+
if (originEntity !== "Produto" && model.sku)
|
|
8687
|
+
model.sku = Produto.fromDto(model.sku, "ContratoCompraItem");
|
|
8688
|
+
return model;
|
|
8689
|
+
};
|
|
8690
|
+
ContratoCompraItem.toDto = function (contratoCompraItem, originEntity) {
|
|
8691
|
+
var dto = __assign({}, contratoCompraItem);
|
|
8692
|
+
dto.dataCompetencia = dto.dataCompetencia && moment$o(dto.dataCompetencia).format("YYYY-MM-DD");
|
|
8693
|
+
dto.createdDate = dto.createdDate && moment$o(dto.createdDate).format();
|
|
8694
|
+
dto.lastModifiedDate = dto.lastModifiedDate && moment$o(dto.lastModifiedDate).format();
|
|
8695
|
+
delete dto.label;
|
|
8696
|
+
if (originEntity !== "ContratoCompra" && dto.contrato)
|
|
8697
|
+
dto.contrato = ContratoCompra.toDto(dto.contrato, "ContratoCompraItem");
|
|
8698
|
+
if (originEntity !== "Produto" && dto.sku)
|
|
8699
|
+
dto.sku = Produto.toDto(dto.sku, "ContratoCompraItem");
|
|
8700
|
+
return dto;
|
|
8701
|
+
};
|
|
8702
|
+
return ContratoCompraItem;
|
|
8703
|
+
}());
|
|
8704
|
+
/*{CA:FILE_CONTENTS:START}*/
|
|
8705
|
+
/*{CA:FILE_CONTENTS:END}*/
|
|
8706
|
+
|
|
8707
|
+
var moment$p = _moment;
|
|
8674
8708
|
var ContratoFormComponent = /** @class */ (function () {
|
|
8675
8709
|
function ContratoFormComponent(dialogRef, dialogConfig, contratoCompraService, contratoCompraItemService, translate, fb) {
|
|
8676
8710
|
this.dialogRef = dialogRef;
|
|
@@ -8749,7 +8783,7 @@
|
|
|
8749
8783
|
if (filial && filial.empresa && filial.empresa.id) {
|
|
8750
8784
|
filter.empresaId = filial.empresa.id;
|
|
8751
8785
|
}
|
|
8752
|
-
filter.dataEmissao = filter.dataEmissao && moment$
|
|
8786
|
+
filter.dataEmissao = filter.dataEmissao && moment$p(filter.dataEmissao).format("YYYY-MM-DD");
|
|
8753
8787
|
var sort = (multiSortMeta || []).length ? { field: multiSortMeta[0].field, order: multiSortMeta[0].order === 1 ? 'Asc' : 'Desc' } : { field: 'numero', order: 'Asc' };
|
|
8754
8788
|
this.contratoCompraService
|
|
8755
8789
|
.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: {
|
|
@@ -8826,8 +8860,9 @@
|
|
|
8826
8860
|
};
|
|
8827
8861
|
ContratoFormComponent.prototype.getRecPagina = function (first, rows, sort) {
|
|
8828
8862
|
var page = first / rows;
|
|
8829
|
-
var orderBy = sort && sort.length
|
|
8830
|
-
sort.map(function (s) { return ({ campo: s.field, ordenacao: s.order === 1 ? 'Asc' : 'Desc' }); })
|
|
8863
|
+
var orderBy = sort && sort.length
|
|
8864
|
+
? sort.map(function (s) { return ({ campo: s.field, ordenacao: s.order === 1 ? 'Asc' : 'Desc' }); })
|
|
8865
|
+
: [];
|
|
8831
8866
|
return {
|
|
8832
8867
|
offset: page,
|
|
8833
8868
|
limit: rows,
|
|
@@ -8947,7 +8982,7 @@
|
|
|
8947
8982
|
return ContratoFormComponent;
|
|
8948
8983
|
}());
|
|
8949
8984
|
|
|
8950
|
-
var moment$
|
|
8985
|
+
var moment$q = _moment;
|
|
8951
8986
|
/*{CA:PROJECT_IMPORTS:START}*/
|
|
8952
8987
|
/*{CA:PROJECT_IMPORTS:END}*/
|
|
8953
8988
|
var RecebimentoContrato = /** @class */ (function () {
|
|
@@ -8957,8 +8992,8 @@
|
|
|
8957
8992
|
/*{CA:CLASS_ATTRIBUTES:END}*/
|
|
8958
8993
|
RecebimentoContrato.fromDto = function (recebimentoDto, originEntity) {
|
|
8959
8994
|
var model = __assign({}, recebimentoDto);
|
|
8960
|
-
model.createdDate = model.createdDate && moment$
|
|
8961
|
-
model.lastModifiedDate = model.lastModifiedDate && moment$
|
|
8995
|
+
model.createdDate = model.createdDate && moment$q(model.createdDate).toDate();
|
|
8996
|
+
model.lastModifiedDate = model.lastModifiedDate && moment$q(model.lastModifiedDate).toDate();
|
|
8962
8997
|
var lookupSeparator = " - ";
|
|
8963
8998
|
var displayFields = [
|
|
8964
8999
|
"id",
|
|
@@ -9002,8 +9037,8 @@
|
|
|
9002
9037
|
};
|
|
9003
9038
|
RecebimentoContrato.toDto = function (recebimento, originEntity) {
|
|
9004
9039
|
var dto = __assign({}, recebimento);
|
|
9005
|
-
dto.createdDate = dto.createdDate && moment$
|
|
9006
|
-
dto.lastModifiedDate = dto.lastModifiedDate && moment$
|
|
9040
|
+
dto.createdDate = dto.createdDate && moment$q(dto.createdDate).format();
|
|
9041
|
+
dto.lastModifiedDate = dto.lastModifiedDate && moment$q(dto.lastModifiedDate).format();
|
|
9007
9042
|
delete dto.label;
|
|
9008
9043
|
if (originEntity !== "Pessoa" && dto.fornecedor)
|
|
9009
9044
|
dto.fornecedor = Pessoa.toDto(dto.fornecedor, "Recebimento");
|
|
@@ -9038,12 +9073,9 @@
|
|
|
9038
9073
|
TipoParticipanteTransgenia["NAO_PARTICIPANTE_MONSANTO"] = "NAO_PARTICIPANTE_MONSANTO";
|
|
9039
9074
|
})(TipoParticipanteTransgenia || (TipoParticipanteTransgenia = {}));
|
|
9040
9075
|
|
|
9041
|
-
var moment$
|
|
9076
|
+
var moment$r = _moment;
|
|
9042
9077
|
var RecebimentoFormComponent = /** @class */ (function () {
|
|
9043
|
-
function RecebimentoFormComponent(
|
|
9044
|
-
/*{CA:INJECTIONS:START}*/
|
|
9045
|
-
/*{CA:INJECTIONS:END}*/
|
|
9046
|
-
recebimentoService, router, route, messageService, confirmationService, formBuilder, translate, hotkeysService, fieldCustomization, focusService, filialService, transportadoraService, pessoaEnderecoService, contratoCompraService, pessoaService, produtoService, derivacaoService, recebimentoChegadaOverride, notaValidatorService, transgeniaService, dialogService, agendaService) {
|
|
9078
|
+
function RecebimentoFormComponent(recebimentoService, router, route, messageService, confirmationService, formBuilder, translate, hotkeysService, fieldCustomization, focusService, filialService, transportadoraService, pessoaEnderecoService, contratoCompraService, pessoaService, produtoService, derivacaoService, recebimentoChegadaOverride, notaValidatorService, transgeniaService, dialogService, agendaService) {
|
|
9047
9079
|
var _this = this;
|
|
9048
9080
|
this.recebimentoService = recebimentoService;
|
|
9049
9081
|
this.router = router;
|
|
@@ -9114,8 +9146,9 @@
|
|
|
9114
9146
|
this.contratoSelecionado = null;
|
|
9115
9147
|
this.ngUnsubscribe = new rxjs.Subject();
|
|
9116
9148
|
this.getTipoTransgenia = function () {
|
|
9117
|
-
if (_this.formGroup.get("fornecedores").length <= 0)
|
|
9149
|
+
if (_this.formGroup.get("fornecedores").length <= 0) {
|
|
9118
9150
|
return TipoParticipanteTransgenia.NAO_INFORMADO;
|
|
9151
|
+
}
|
|
9119
9152
|
var fornecedor = _this.formGroup.get("fornecedores").at(0).getRawValue().fornecedor;
|
|
9120
9153
|
return fornecedor ? (fornecedor.tipoParticipante || TipoParticipanteTransgenia.NAO_INFORMADO) : TipoParticipanteTransgenia.NAO_INFORMADO;
|
|
9121
9154
|
};
|
|
@@ -9131,12 +9164,8 @@
|
|
|
9131
9164
|
_this.formGroup.get("produto").enable();
|
|
9132
9165
|
_this.formGroup.get("transgenia").enable();
|
|
9133
9166
|
};
|
|
9134
|
-
/*{CA:COsNSTRUCTOR_END:START}*/
|
|
9135
|
-
/*{CA:CONSTRUCTOR_END:END}*/
|
|
9136
9167
|
}
|
|
9137
9168
|
RecebimentoFormComponent.prototype.ngOnInit = function () {
|
|
9138
|
-
/*{CA:ON_INIT_START:START}*/
|
|
9139
|
-
/*{CA:ON_INIT_START:END}*/
|
|
9140
9169
|
var _this = this;
|
|
9141
9170
|
this.formGroup = this.getFormGroup();
|
|
9142
9171
|
this.itemFormGroup = this.getItemForm();
|
|
@@ -9173,11 +9202,11 @@
|
|
|
9173
9202
|
this.route.data.pipe(operators.takeUntil(this.ngUnsubscribe)).subscribe(function (data) { return _this.onRouteDataChange(data); });
|
|
9174
9203
|
this.route.params.pipe(operators.takeUntil(this.ngUnsubscribe)).subscribe(function (_a) {
|
|
9175
9204
|
var agenda = _a.agenda;
|
|
9176
|
-
if (agenda
|
|
9177
|
-
_this.
|
|
9205
|
+
if (agenda == 'new') {
|
|
9206
|
+
_this.buscarFilial();
|
|
9178
9207
|
}
|
|
9179
9208
|
else {
|
|
9180
|
-
_this.
|
|
9209
|
+
_this.getRecebimento(agenda);
|
|
9181
9210
|
}
|
|
9182
9211
|
});
|
|
9183
9212
|
this.filialSearchFields = this.getFilialSearchFields();
|
|
@@ -9209,8 +9238,6 @@
|
|
|
9209
9238
|
this.createdByErpDisableForm();
|
|
9210
9239
|
};
|
|
9211
9240
|
RecebimentoFormComponent.prototype.ngAfterViewInit = function () {
|
|
9212
|
-
/*{CA:ON_VIEW_INIT_START:START}*/
|
|
9213
|
-
/*{CA:ON_VIEW_INIT_START:END}*/
|
|
9214
9241
|
var inputList = document.getElementsByTagName("input");
|
|
9215
9242
|
var selectedInput = Array.from(inputList).find(function (f) { return !f.disabled; });
|
|
9216
9243
|
if (selectedInput) {
|
|
@@ -9218,17 +9245,11 @@
|
|
|
9218
9245
|
}
|
|
9219
9246
|
this.recebimentoChegadaOverride.initialize();
|
|
9220
9247
|
this.saveAndInitButton = document.getElementById('init');
|
|
9221
|
-
/*{CA:ON_VIEW_INIT_END:START}*/
|
|
9222
|
-
/*{CA:ON_VIEW_INIT_END:END}*/
|
|
9223
9248
|
};
|
|
9224
9249
|
RecebimentoFormComponent.prototype.ngOnDestroy = function () {
|
|
9225
|
-
/*{CA:ON_DESTROY_START:START}*/
|
|
9226
|
-
/*{CA:ON_DESTROY_START:END}*/
|
|
9227
9250
|
this.ngUnsubscribe.next();
|
|
9228
9251
|
this.ngUnsubscribe.complete();
|
|
9229
9252
|
this.recebimentoChegadaOverride.remove();
|
|
9230
|
-
/*{CA:ON_DESTROY_END:START}*/
|
|
9231
|
-
/*{CA:ON_DESTROY_END:END}*/
|
|
9232
9253
|
};
|
|
9233
9254
|
RecebimentoFormComponent.prototype.createdByErpDisableForm = function () {
|
|
9234
9255
|
this.disableOrdersButtons = this.agenda.createdByErp;
|
|
@@ -9247,8 +9268,6 @@
|
|
|
9247
9268
|
this.formGroup.get("fornecedores").controls.forEach(function (form) { return form.get("fornecedor").disable(); });
|
|
9248
9269
|
};
|
|
9249
9270
|
RecebimentoFormComponent.prototype.setHotkeys = function () {
|
|
9250
|
-
/*{CA:SET_HOTKEYS_START:START}*/
|
|
9251
|
-
/*{CA:SET_HOTKEYS_START:END}*/
|
|
9252
9271
|
var _this = this;
|
|
9253
9272
|
this.hotkeysService.add(new angular2Hotkeys.Hotkey("alt+shift+x", function () {
|
|
9254
9273
|
if (_this.permissions.excluir)
|
|
@@ -9264,8 +9283,6 @@
|
|
|
9264
9283
|
_this.onCancel();
|
|
9265
9284
|
return false;
|
|
9266
9285
|
}, ["INPUT", "SELECT", "TEXTAREA"]));
|
|
9267
|
-
/*{CA:SET_HOTKEYS_END:START}*/
|
|
9268
|
-
/*{CA:SET_HOTKEYS_END:END}*/
|
|
9269
9286
|
};
|
|
9270
9287
|
RecebimentoFormComponent.prototype.onBlurChaveNotaFiscal = function () {
|
|
9271
9288
|
var _this = this;
|
|
@@ -9276,7 +9293,7 @@
|
|
|
9276
9293
|
this.mensagemBuscandoNota();
|
|
9277
9294
|
this.notaValidatorService.pesquisarDocumento({
|
|
9278
9295
|
filialId: (this.formGroup.get("filial").value && this.formGroup.get("filial").value.id) || null,
|
|
9279
|
-
chaveDocumento:
|
|
9296
|
+
chaveDocumento: value.trim()
|
|
9280
9297
|
}).pipe(operators.takeUntil(this.ngUnsubscribe), operators.finalize(function () { return _this.loading = false; })).subscribe(function (response) {
|
|
9281
9298
|
_this.adicionarNovaNota(response);
|
|
9282
9299
|
});
|
|
@@ -9286,8 +9303,6 @@
|
|
|
9286
9303
|
return !this.formGroup.value.id;
|
|
9287
9304
|
};
|
|
9288
9305
|
RecebimentoFormComponent.prototype.updateSuggestions = function (value) {
|
|
9289
|
-
/*{CA:ON_UPDATE_SUGGESTIONS_START:START}*/
|
|
9290
|
-
/*{CA:ON_UPDATE_SUGGESTIONS_START:END}*/
|
|
9291
9306
|
if (value.fornecedor) {
|
|
9292
9307
|
value.fornecedor.label = this.getSuggestionValue(["id", "codigo", "nome", "situacao"], "fornecedor", value, this.fornecedorLookupSeparator);
|
|
9293
9308
|
if (value.fornecedor.label.trim() === this.fornecedorLookupSeparator.trim()) {
|
|
@@ -9312,8 +9327,6 @@
|
|
|
9312
9327
|
delete value.derivacao.label;
|
|
9313
9328
|
}
|
|
9314
9329
|
}
|
|
9315
|
-
/*{CA:ON_UPDATE_SUGGESTIONS_END:START}*/
|
|
9316
|
-
/*{CA:ON_UPDATE_SUGGESTIONS_END:END}*/
|
|
9317
9330
|
};
|
|
9318
9331
|
RecebimentoFormComponent.prototype.getSuggestionValue = function (displayFields, ownerEntity, value, separator) {
|
|
9319
9332
|
var _this = this;
|
|
@@ -9322,8 +9335,6 @@
|
|
|
9322
9335
|
.reduce(function (acc, val) { return "" + acc + separator + val; });
|
|
9323
9336
|
};
|
|
9324
9337
|
RecebimentoFormComponent.prototype.onRouteDataChange = function (data) {
|
|
9325
|
-
/*{CA:ON_ROUTE_DATA_CHANGE_START:START}*/
|
|
9326
|
-
/*{CA:ON_ROUTE_DATA_CHANGE_START:END}*/
|
|
9327
9338
|
var _a = data.localeConfig.number, currencySymbol = _a.currencySymbol, thousandsSeparator = _a.thousandsSeparator, decimalSeparator = _a.decimalSeparator;
|
|
9328
9339
|
this.localeConfig = data.localeConfig;
|
|
9329
9340
|
this.currencyLocaleOptions = {
|
|
@@ -9346,19 +9357,11 @@
|
|
|
9346
9357
|
else {
|
|
9347
9358
|
this.formGroup.patchValue(new RecebimentoContrato());
|
|
9348
9359
|
}
|
|
9349
|
-
/*{CA:ON_ROUTE_DATA_CHANGE_END:START}*/
|
|
9350
|
-
/*{CA:ON_ROUTE_DATA_CHANGE_END:END}*/
|
|
9351
9360
|
};
|
|
9352
9361
|
RecebimentoFormComponent.prototype.onCancel = function () {
|
|
9353
|
-
/*{CA:ON_CANCEL_START:START}*/
|
|
9354
|
-
/*{CA:ON_CANCEL_START:END}*/
|
|
9355
9362
|
this.goBack();
|
|
9356
|
-
/*{CA:ON_CANCEL_END:START}*/
|
|
9357
|
-
/*{CA:ON_CANCEL_END:END}*/
|
|
9358
9363
|
};
|
|
9359
9364
|
RecebimentoFormComponent.prototype.onSendFile = function (filesToDelete, filesToCommit) {
|
|
9360
|
-
/*{CA:ON_SEND_FILE:START}*/
|
|
9361
|
-
/*{CA:ON_SEND_FILE:END}*/
|
|
9362
9365
|
var observables = [];
|
|
9363
9366
|
if (!this.fieldCustomization.isEmpty(filesToDelete)) {
|
|
9364
9367
|
observables.push(this.fieldCustomization.deleteFiles(filesToDelete));
|
|
@@ -9375,44 +9378,26 @@
|
|
|
9375
9378
|
};
|
|
9376
9379
|
RecebimentoFormComponent.prototype.onSave = function (start) {
|
|
9377
9380
|
var _this = this;
|
|
9378
|
-
this.
|
|
9379
|
-
|
|
9380
|
-
|
|
9381
|
-
|
|
9382
|
-
|
|
9383
|
-
|
|
9384
|
-
|
|
9385
|
-
|
|
9386
|
-
|
|
9387
|
-
|
|
9388
|
-
|
|
9389
|
-
|
|
9390
|
-
|
|
9391
|
-
|
|
9392
|
-
|
|
9393
|
-
|
|
9394
|
-
|
|
9395
|
-
_this.agendaService
|
|
9396
|
-
.atualizarAgenda(_this.agenda)
|
|
9397
|
-
.pipe(operators.takeUntil(_this.ngUnsubscribe))
|
|
9398
|
-
.subscribe(function (_) { return _this.router.navigate(["chegada-veiculo"]); });
|
|
9399
|
-
}
|
|
9400
|
-
});
|
|
9401
|
-
_this.loading = true;
|
|
9402
|
-
return _this.getSaveObservable()
|
|
9403
|
-
.pipe(operators.takeUntil(_this.ngUnsubscribe), operators.finalize(function () { return (_this.loading = false); }))
|
|
9404
|
-
.subscribe(function (value) {
|
|
9405
|
-
_this.formGroup.get("id").setValue(value.id || null);
|
|
9406
|
-
_this.addMessage("success", "saved_message_title", "saved_message_content");
|
|
9407
|
-
if (start && _this.saveAndInitButton)
|
|
9408
|
-
_this.saveAndInitButton.click();
|
|
9409
|
-
});
|
|
9410
|
-
},
|
|
9381
|
+
this.formGroup.get("agenda").setValue(this.agenda);
|
|
9382
|
+
if (this.formGroup.get("fornecedores").length <= 0) {
|
|
9383
|
+
this.erroFornecedores = true;
|
|
9384
|
+
return;
|
|
9385
|
+
}
|
|
9386
|
+
if (this.formGroup.invalid) {
|
|
9387
|
+
return this.validateAllFormFields(this.formGroup);
|
|
9388
|
+
}
|
|
9389
|
+
this.loading = true;
|
|
9390
|
+
return this.getSaveObservable()
|
|
9391
|
+
.pipe(operators.takeUntil(this.ngUnsubscribe), operators.finalize(function () { return _this.loading = false; }))
|
|
9392
|
+
.subscribe(function (value) {
|
|
9393
|
+
_this.formGroup.get("id").setValue(value.id || null);
|
|
9394
|
+
_this.addMessage("success", "saved_message_title", "saved_message_content");
|
|
9395
|
+
if (start && _this.saveAndInitButton) {
|
|
9396
|
+
_this.saveAndInitButton.click();
|
|
9397
|
+
}
|
|
9411
9398
|
});
|
|
9412
9399
|
};
|
|
9413
9400
|
RecebimentoFormComponent.prototype.onDelete = function () {
|
|
9414
|
-
/*{CA:ON_DELETE_START:START}*/
|
|
9415
|
-
/*{CA:ON_DELETE_START:END}*/
|
|
9416
9401
|
var _this = this;
|
|
9417
9402
|
this.confirmationService.confirm({
|
|
9418
9403
|
message: this.translate.instant("yms.erp.delete_confirmation_message"),
|
|
@@ -9423,8 +9408,6 @@
|
|
|
9423
9408
|
.subscribe();
|
|
9424
9409
|
},
|
|
9425
9410
|
});
|
|
9426
|
-
/*{CA:ON_DELETE_END:START}*/
|
|
9427
|
-
/*{CA:ON_DELETE_END:END}*/
|
|
9428
9411
|
};
|
|
9429
9412
|
RecebimentoFormComponent.prototype.setTransportadora = function (value) {
|
|
9430
9413
|
var _this = this;
|
|
@@ -9495,8 +9478,6 @@
|
|
|
9495
9478
|
};
|
|
9496
9479
|
RecebimentoFormComponent.prototype.onFilialLookupRequest = function (value) {
|
|
9497
9480
|
var _this = this;
|
|
9498
|
-
/*{CA:ON_FORNECEDOR_LOOKUP_REQUEST_START:START}*/
|
|
9499
|
-
/*{CA:ON_FORNECEDOR_LOOKUP_REQUEST_START:END}*/
|
|
9500
9481
|
var filterInput = this.getFilialSearchFields()
|
|
9501
9482
|
.filter(function (_a) {
|
|
9502
9483
|
var type = _a.type;
|
|
@@ -9513,15 +9494,9 @@
|
|
|
9513
9494
|
this.filialService
|
|
9514
9495
|
.listFiliais(filterInput)
|
|
9515
9496
|
.pipe(operators.takeUntil(this.ngUnsubscribe))
|
|
9516
|
-
.subscribe(function (list) {
|
|
9517
|
-
return _this.filialLookupSuggestions = list.filiais.map(function (filial) { return Filial.fromDto(filial); });
|
|
9518
|
-
});
|
|
9519
|
-
/*{CA:ON_FORNECEDOR_LOOKUP_REQUEST_END:START}*/
|
|
9520
|
-
/*{CA:ON_FORNECEDOR_LOOKUP_REQUEST_END:END}*/
|
|
9497
|
+
.subscribe(function (list) { return _this.filialLookupSuggestions = list.filiais.map(Filial.fromDto); });
|
|
9521
9498
|
};
|
|
9522
9499
|
RecebimentoFormComponent.prototype.onFilialSearchRequest = function (event) {
|
|
9523
|
-
/*{CA:ON_FORNECEDOR_SEARCH_REQUEST_START:START}*/
|
|
9524
|
-
/*{CA:ON_FORNECEDOR_SEARCH_REQUEST_START:END}*/
|
|
9525
9500
|
var _this = this;
|
|
9526
9501
|
var first = event.first, rows = event.rows, multiSortMeta = event.multiSortMeta, filterData = event.filterData;
|
|
9527
9502
|
var page = first / rows;
|
|
@@ -9548,13 +9523,9 @@
|
|
|
9548
9523
|
_this.filialSearchGridData = list.filiais.map(Filial.fromDto);
|
|
9549
9524
|
_this.filialSearchTotalRecords = list.qtdTotalRegistros;
|
|
9550
9525
|
});
|
|
9551
|
-
/*{CA:ON_FORNECEDOR_SEARCH_REQUEST_END:START}*/
|
|
9552
|
-
/*{CA:ON_FORNECEDOR_SEARCH_REQUEST_END:END}*/
|
|
9553
9526
|
};
|
|
9554
9527
|
RecebimentoFormComponent.prototype.onFornecedorLookupRequest = function (value) {
|
|
9555
9528
|
var _this = this;
|
|
9556
|
-
/*{CA:ON_FORNECEDOR_LOOKUP_REQUEST_START:START}*/
|
|
9557
|
-
/*{CA:ON_FORNECEDOR_LOOKUP_REQUEST_START:END}*/
|
|
9558
9529
|
var sort = this.fornecedorLookupDisplayFields.map(function (field) { return ({ field: field, order: 1 }); });
|
|
9559
9530
|
var filterQuery = this.getFornecedorSearchFields()
|
|
9560
9531
|
.filter(function (_a) {
|
|
@@ -9566,11 +9537,11 @@
|
|
|
9566
9537
|
if (typeof value == "number")
|
|
9567
9538
|
return name + " eq " + value;
|
|
9568
9539
|
else if (type == angularComponents.FieldType.Date)
|
|
9569
|
-
return name + " eq '" + moment$
|
|
9540
|
+
return name + " eq '" + moment$r(value).format("YYYY-MM-DD") + "'";
|
|
9570
9541
|
else if (type == angularComponents.FieldType.Time)
|
|
9571
|
-
return name + " eq '" + moment$
|
|
9542
|
+
return name + " eq '" + moment$r(value).format("HH:mm:ss") + "'";
|
|
9572
9543
|
else if (type == angularComponents.FieldType.DateTime)
|
|
9573
|
-
return name + " eq '" + moment$
|
|
9544
|
+
return name + " eq '" + moment$r(value).format() + "'";
|
|
9574
9545
|
else if (type == angularComponents.FieldType.String)
|
|
9575
9546
|
return "containing(lower(" + name + "), lower('" + value.replace(/'/g, "\\'") + "'))";
|
|
9576
9547
|
else
|
|
@@ -9592,12 +9563,8 @@
|
|
|
9592
9563
|
.subscribe(function (list) {
|
|
9593
9564
|
_this.fornecedorLookupSuggestions = list.contents;
|
|
9594
9565
|
});
|
|
9595
|
-
/*{CA:ON_FORNECEDOR_LOOKUP_REQUEST_END:START}*/
|
|
9596
|
-
/*{CA:ON_FORNECEDOR_LOOKUP_REQUEST_END:END}*/
|
|
9597
9566
|
};
|
|
9598
9567
|
RecebimentoFormComponent.prototype.onFornecedorSearchRequest = function (event) {
|
|
9599
|
-
/*{CA:ON_FORNECEDOR_SEARCH_REQUEST_START:START}*/
|
|
9600
|
-
/*{CA:ON_FORNECEDOR_SEARCH_REQUEST_START:END}*/
|
|
9601
9568
|
var _this = this;
|
|
9602
9569
|
var first = event.first, rows = event.rows, multiSortMeta = event.multiSortMeta, filterData = event.filterData;
|
|
9603
9570
|
var page = first / rows;
|
|
@@ -9613,11 +9580,11 @@
|
|
|
9613
9580
|
if (typeof value == "number")
|
|
9614
9581
|
return name + " eq " + value;
|
|
9615
9582
|
else if (type == angularComponents.FieldType.Date)
|
|
9616
|
-
return name + " eq '" + moment$
|
|
9583
|
+
return name + " eq '" + moment$r(value).format("YYYY-MM-DD") + "'";
|
|
9617
9584
|
else if (type == angularComponents.FieldType.Time)
|
|
9618
|
-
return name + " eq '" + moment$
|
|
9585
|
+
return name + " eq '" + moment$r(value).format("HH:mm:ss") + "'";
|
|
9619
9586
|
else if (type == angularComponents.FieldType.DateTime)
|
|
9620
|
-
return name + " eq '" + moment$
|
|
9587
|
+
return name + " eq '" + moment$r(value).format() + "'";
|
|
9621
9588
|
else if (type == angularComponents.FieldType.Enum)
|
|
9622
9589
|
return name + " eq '" + value + "'";
|
|
9623
9590
|
else if (type == angularComponents.FieldType.String)
|
|
@@ -9642,8 +9609,6 @@
|
|
|
9642
9609
|
_this.fornecedorSearchGridData = list.contents;
|
|
9643
9610
|
_this.fornecedorSearchTotalRecords = list.totalElements;
|
|
9644
9611
|
});
|
|
9645
|
-
/*{CA:ON_FORNECEDOR_SEARCH_REQUEST_END:START}*/
|
|
9646
|
-
/*{CA:ON_FORNECEDOR_SEARCH_REQUEST_END:END}*/
|
|
9647
9612
|
};
|
|
9648
9613
|
RecebimentoFormComponent.prototype.onOrigemMercadoriaLookupRequest = function (value, fornecedorForm) {
|
|
9649
9614
|
var _this = this;
|
|
@@ -9658,11 +9623,11 @@
|
|
|
9658
9623
|
if (typeof value == "number")
|
|
9659
9624
|
return name + " eq " + value;
|
|
9660
9625
|
else if (type == angularComponents.FieldType.Date)
|
|
9661
|
-
return name + " eq '" + moment$
|
|
9626
|
+
return name + " eq '" + moment$r(value).format("YYYY-MM-DD") + "'";
|
|
9662
9627
|
else if (type == angularComponents.FieldType.Time)
|
|
9663
|
-
return name + " eq '" + moment$
|
|
9628
|
+
return name + " eq '" + moment$r(value).format("HH:mm:ss") + "'";
|
|
9664
9629
|
else if (type == angularComponents.FieldType.DateTime)
|
|
9665
|
-
return name + " eq '" + moment$
|
|
9630
|
+
return name + " eq '" + moment$r(value).format() + "'";
|
|
9666
9631
|
else if (type == angularComponents.FieldType.String)
|
|
9667
9632
|
return "containing(lower(" + name + "), lower('" + value.replace(/'/g, "\\'") + "'))";
|
|
9668
9633
|
else
|
|
@@ -9701,11 +9666,11 @@
|
|
|
9701
9666
|
if (typeof value == "number")
|
|
9702
9667
|
return name + " eq " + value;
|
|
9703
9668
|
else if (type == angularComponents.FieldType.Date)
|
|
9704
|
-
return name + " eq '" + moment$
|
|
9669
|
+
return name + " eq '" + moment$r(value).format("YYYY-MM-DD") + "'";
|
|
9705
9670
|
else if (type == angularComponents.FieldType.Time)
|
|
9706
|
-
return name + " eq '" + moment$
|
|
9671
|
+
return name + " eq '" + moment$r(value).format("HH:mm:ss") + "'";
|
|
9707
9672
|
else if (type == angularComponents.FieldType.DateTime)
|
|
9708
|
-
return name + " eq '" + moment$
|
|
9673
|
+
return name + " eq '" + moment$r(value).format() + "'";
|
|
9709
9674
|
else if (type == angularComponents.FieldType.Enum)
|
|
9710
9675
|
return name + " eq '" + value + "'";
|
|
9711
9676
|
else if (type == angularComponents.FieldType.String)
|
|
@@ -9733,8 +9698,9 @@
|
|
|
9733
9698
|
};
|
|
9734
9699
|
RecebimentoFormComponent.prototype.getRecPagina = function (first, rows, sort) {
|
|
9735
9700
|
var page = first / rows;
|
|
9736
|
-
var orderBy = sort && sort.length
|
|
9737
|
-
sort.map(function (s) { return ({ campo: s.field, ordenacao: s.order === 1 ? 'Asc' : 'Desc' }); })
|
|
9701
|
+
var orderBy = sort && sort.length
|
|
9702
|
+
? sort.map(function (s) { return ({ campo: s.field, ordenacao: s.order === 1 ? 'Asc' : 'Desc' }); })
|
|
9703
|
+
: [];
|
|
9738
9704
|
return {
|
|
9739
9705
|
offset: page,
|
|
9740
9706
|
limit: rows,
|
|
@@ -9756,8 +9722,6 @@
|
|
|
9756
9722
|
.subscribe(function (list) {
|
|
9757
9723
|
_this.produtoLookupSuggestions = (list.produtos || []).map(function (produto) { return Produto.fromDto(produto); });
|
|
9758
9724
|
});
|
|
9759
|
-
/*{CA:ON_PRODUTO_LOOKUP_REQUEST_END:START}*/
|
|
9760
|
-
/*{CA:ON_PRODUTO_LOOKUP_REQUEST_END:END}*/
|
|
9761
9725
|
};
|
|
9762
9726
|
RecebimentoFormComponent.prototype.onProdutoSearchRequest = function (event) {
|
|
9763
9727
|
var _this = this;
|
|
@@ -9788,13 +9752,9 @@
|
|
|
9788
9752
|
_this.produtoSearchTotalRecords = res.qtdTotalRegistros;
|
|
9789
9753
|
_this.produtoSearchGridData = res.produtos.map(Produto.fromDto);
|
|
9790
9754
|
});
|
|
9791
|
-
/*{CA:ON_PRODUTO_SEARCH_REQUEST_END:START}*/
|
|
9792
|
-
/*{CA:ON_PRODUTO_SEARCH_REQUEST_END:END}*/
|
|
9793
9755
|
};
|
|
9794
9756
|
RecebimentoFormComponent.prototype.onDerivacaoLookupRequest = function (value) {
|
|
9795
9757
|
var _this = this;
|
|
9796
|
-
/*{CA:ON_DERIVACAO_LOOKUP_REQUEST_START:START}*/
|
|
9797
|
-
/*{CA:ON_DERIVACAO_LOOKUP_REQUEST_START:END}*/
|
|
9798
9758
|
var sort = this.derivacaoLookupDisplayFields.map(function (field) { return ({ field: field, order: 1 }); });
|
|
9799
9759
|
var filterQuery = this.getDerivacaoSearchFields()
|
|
9800
9760
|
.filter(function (_a) {
|
|
@@ -9806,11 +9766,11 @@
|
|
|
9806
9766
|
if (typeof value == "number")
|
|
9807
9767
|
return name + " eq " + value;
|
|
9808
9768
|
else if (type == angularComponents.FieldType.Date)
|
|
9809
|
-
return name + " eq '" + moment$
|
|
9769
|
+
return name + " eq '" + moment$r(value).format("YYYY-MM-DD") + "'";
|
|
9810
9770
|
else if (type == angularComponents.FieldType.Time)
|
|
9811
|
-
return name + " eq '" + moment$
|
|
9771
|
+
return name + " eq '" + moment$r(value).format("HH:mm:ss") + "'";
|
|
9812
9772
|
else if (type == angularComponents.FieldType.DateTime)
|
|
9813
|
-
return name + " eq '" + moment$
|
|
9773
|
+
return name + " eq '" + moment$r(value).format() + "'";
|
|
9814
9774
|
else if (type == angularComponents.FieldType.String)
|
|
9815
9775
|
return "containing(lower(" + name + "), lower('" + value.replace(/'/g, "\\'") + "'))";
|
|
9816
9776
|
else
|
|
@@ -9831,12 +9791,8 @@
|
|
|
9831
9791
|
.subscribe(function (list) {
|
|
9832
9792
|
_this.derivacaoLookupSuggestions = list.contents;
|
|
9833
9793
|
});
|
|
9834
|
-
/*{CA:ON_DERIVACAO_LOOKUP_REQUEST_END:START}*/
|
|
9835
|
-
/*{CA:ON_DERIVACAO_LOOKUP_REQUEST_END:END}*/
|
|
9836
9794
|
};
|
|
9837
9795
|
RecebimentoFormComponent.prototype.onDerivacaoSearchRequest = function (event) {
|
|
9838
|
-
/*{CA:ON_DERIVACAO_SEARCH_REQUEST_START:START}*/
|
|
9839
|
-
/*{CA:ON_DERIVACAO_SEARCH_REQUEST_START:END}*/
|
|
9840
9796
|
var _this = this;
|
|
9841
9797
|
var first = event.first, rows = event.rows, multiSortMeta = event.multiSortMeta, filterData = event.filterData;
|
|
9842
9798
|
var page = first / rows;
|
|
@@ -9852,11 +9808,11 @@
|
|
|
9852
9808
|
if (typeof value == "number")
|
|
9853
9809
|
return name + " eq " + value;
|
|
9854
9810
|
else if (type == angularComponents.FieldType.Date)
|
|
9855
|
-
return name + " eq '" + moment$
|
|
9811
|
+
return name + " eq '" + moment$r(value).format("YYYY-MM-DD") + "'";
|
|
9856
9812
|
else if (type == angularComponents.FieldType.Time)
|
|
9857
|
-
return name + " eq '" + moment$
|
|
9813
|
+
return name + " eq '" + moment$r(value).format("HH:mm:ss") + "'";
|
|
9858
9814
|
else if (type == angularComponents.FieldType.DateTime)
|
|
9859
|
-
return name + " eq '" + moment$
|
|
9815
|
+
return name + " eq '" + moment$r(value).format() + "'";
|
|
9860
9816
|
else if (type == angularComponents.FieldType.Enum)
|
|
9861
9817
|
return name + " eq '" + value + "'";
|
|
9862
9818
|
else if (type == angularComponents.FieldType.String)
|
|
@@ -9880,24 +9836,16 @@
|
|
|
9880
9836
|
_this.derivacaoSearchGridData = list.contents;
|
|
9881
9837
|
_this.derivacaoSearchTotalRecords = list.totalElements;
|
|
9882
9838
|
});
|
|
9883
|
-
/*{CA:ON_DERIVACAO_SEARCH_REQUEST_END:START}*/
|
|
9884
|
-
/*{CA:ON_DERIVACAO_SEARCH_REQUEST_END:END}*/
|
|
9885
9839
|
};
|
|
9886
9840
|
RecebimentoFormComponent.prototype.onTransportadoraLookupRequest = function (value) {
|
|
9887
9841
|
var _this = this;
|
|
9888
|
-
/*{CA:ON_TRANSPORTADORA_LOOKUP_REQUEST_START:START}*/
|
|
9889
|
-
/*{CA:ON_TRANSPORTADORA_LOOKUP_REQUEST_START:END}*/
|
|
9890
9842
|
onLookupRequest(this.transportadoraSearchFields, this.transportadoraLookupDisplayFields, this.transportadoraAdvancedDisplayFields, this.transportadoraLookupSeparator, this.transportadoraService, value)
|
|
9891
9843
|
.pipe(operators.takeUntil(this.ngUnsubscribe))
|
|
9892
9844
|
.subscribe(function (list) {
|
|
9893
9845
|
_this.transportadoraLookupSuggestions = list.contents;
|
|
9894
9846
|
});
|
|
9895
|
-
/*{CA:ON_TRANSPORTADORA_LOOKUP_REQUEST_END:START}*/
|
|
9896
|
-
/*{CA:ON_TRANSPORTADORA_LOOKUP_REQUEST_END:END}*/
|
|
9897
9847
|
};
|
|
9898
9848
|
RecebimentoFormComponent.prototype.onTransportadoraSearchRequest = function (event) {
|
|
9899
|
-
/*{CA:ON_TRANSPORTADORA_SEARCH_REQUEST_START:START}*/
|
|
9900
|
-
/*{CA:ON_TRANSPORTADORA_SEARCH_REQUEST_START:END}*/
|
|
9901
9849
|
var _this = this;
|
|
9902
9850
|
var first = event.first, rows = event.rows, multiSortMeta = event.multiSortMeta, filterData = event.filterData;
|
|
9903
9851
|
var page = first / rows;
|
|
@@ -9913,11 +9861,11 @@
|
|
|
9913
9861
|
if (typeof value == "number")
|
|
9914
9862
|
return name + " eq " + value;
|
|
9915
9863
|
else if (type == angularComponents.FieldType.Date)
|
|
9916
|
-
return name + " eq '" + moment$
|
|
9864
|
+
return name + " eq '" + moment$r(value).format("YYYY-MM-DD") + "'";
|
|
9917
9865
|
else if (type == angularComponents.FieldType.Time)
|
|
9918
|
-
return name + " eq '" + moment$
|
|
9866
|
+
return name + " eq '" + moment$r(value).format("HH:mm:ss") + "'";
|
|
9919
9867
|
else if (type == angularComponents.FieldType.DateTime)
|
|
9920
|
-
return name + " eq '" + moment$
|
|
9868
|
+
return name + " eq '" + moment$r(value).format() + "'";
|
|
9921
9869
|
else if (type == angularComponents.FieldType.Enum)
|
|
9922
9870
|
return name + " eq '" + value + "'";
|
|
9923
9871
|
else if (type == angularComponents.FieldType.String)
|
|
@@ -9932,8 +9880,9 @@
|
|
|
9932
9880
|
.pipe(operators.takeUntil(this.ngUnsubscribe))
|
|
9933
9881
|
.pipe(operators.map(function (list) { return (__assign({}, list, { contents: list.contents.map(function (item) { return (__assign({}, item, { label: _this.transportadoraLookupDisplayFields
|
|
9934
9882
|
.map(function (field) {
|
|
9935
|
-
if (field.indexOf(".") > 0)
|
|
9883
|
+
if (field.indexOf(".") > 0) {
|
|
9936
9884
|
return _this.getProp(item, field);
|
|
9885
|
+
}
|
|
9937
9886
|
return item[field];
|
|
9938
9887
|
})
|
|
9939
9888
|
.join(_this.transportadoraLookupSeparator) })); }) })); }))
|
|
@@ -9941,8 +9890,6 @@
|
|
|
9941
9890
|
_this.transportadoraSearchGridData = list.contents;
|
|
9942
9891
|
_this.transportadoraSearchTotalRecords = list.totalElements;
|
|
9943
9892
|
});
|
|
9944
|
-
/*{CA:ON_TRANSPORTADORA_SEARCH_REQUEST_END:START}*/
|
|
9945
|
-
/*{CA:ON_TRANSPORTADORA_SEARCH_REQUEST_END:END}*/
|
|
9946
9893
|
};
|
|
9947
9894
|
RecebimentoFormComponent.prototype.onTransgeniaLookupRequest = function (value) {
|
|
9948
9895
|
var _this = this;
|
|
@@ -9989,7 +9936,7 @@
|
|
|
9989
9936
|
filial: this.formGroup.get("filial").value,
|
|
9990
9937
|
produto: this.formGroup.get("produto").value,
|
|
9991
9938
|
fornecedor: fornecedorForm.get("fornecedor").value,
|
|
9992
|
-
contratos: fornecedorForm.get("contratos").value
|
|
9939
|
+
contratos: fornecedorForm.get("contratos").value,
|
|
9993
9940
|
} }))
|
|
9994
9941
|
.onClose
|
|
9995
9942
|
.pipe(operators.takeUntil(this.ngUnsubscribe), operators.filter(function (value) { return !!value; }))
|
|
@@ -10050,7 +9997,12 @@
|
|
|
10050
9997
|
RecebimentoFormComponent.prototype.showButtons = function () {
|
|
10051
9998
|
if (!this.agenda)
|
|
10052
9999
|
return false;
|
|
10053
|
-
return [
|
|
10000
|
+
return [
|
|
10001
|
+
StatusAgenda.AGENDADO,
|
|
10002
|
+
StatusAgenda.AGUARDANDO_CONFIRMACAO,
|
|
10003
|
+
StatusAgenda.AGUARDANDO_CONFIRMACAO_SOLICITANTE,
|
|
10004
|
+
StatusAgenda.REJEITADO_POR_VALIDACAO
|
|
10005
|
+
].includes(this.agenda.status);
|
|
10054
10006
|
};
|
|
10055
10007
|
RecebimentoFormComponent.prototype.disableAdicionarNota = function () {
|
|
10056
10008
|
if (this.contratoSelecionado === null) {
|
|
@@ -10106,8 +10058,6 @@
|
|
|
10106
10058
|
lastModifiedDate: [{ value: undefined, disabled: true }, forms.Validators.compose([])],
|
|
10107
10059
|
custom: [],
|
|
10108
10060
|
});
|
|
10109
|
-
/*{CA:GET_FORM_CONTROLS:START}*/
|
|
10110
|
-
/*{CA:GET_FORM_CONTROLS:END}*/
|
|
10111
10061
|
};
|
|
10112
10062
|
RecebimentoFormComponent.prototype.getFornecedorByContrato = function (contrato, fornecedorForm) {
|
|
10113
10063
|
this.pessoaService.list({ size: 1, page: 0, filterQuery: "id eq '" + contrato.pessoa.id + "'" })
|
|
@@ -10145,9 +10095,9 @@
|
|
|
10145
10095
|
if (!fornecedorForm.get("fornecedor").value) {
|
|
10146
10096
|
this.getFornecedorByContrato(contrato.contrato, fornecedorForm);
|
|
10147
10097
|
}
|
|
10148
|
-
var
|
|
10149
|
-
(contrato.itens || []).forEach(function (item) { return
|
|
10150
|
-
this.getContratos(fornecedorForm).push(
|
|
10098
|
+
var contratoForm = this.getContratoForm(contrato);
|
|
10099
|
+
(contrato.itens || []).forEach(function (item) { return contratoForm.get("itens").push(_this.getItemForm(item)); });
|
|
10100
|
+
this.getContratos(fornecedorForm).push(contratoForm);
|
|
10151
10101
|
};
|
|
10152
10102
|
RecebimentoFormComponent.prototype.mensagemContratoNaoSelecionado = function () {
|
|
10153
10103
|
this.addMessage("error", "Contrato não selecionado", "Nenhum contrato foi selecionado!");
|
|
@@ -10333,8 +10283,6 @@
|
|
|
10333
10283
|
type: angularComponents.FieldType.String,
|
|
10334
10284
|
}),
|
|
10335
10285
|
];
|
|
10336
|
-
/*{CA:GET_FORNECEDOR_SEARCH_FIELDS:START}*/
|
|
10337
|
-
/*{CA:GET_FORNECEDOR_SEARCH_FIELDS:END}*/
|
|
10338
10286
|
};
|
|
10339
10287
|
RecebimentoFormComponent.prototype.getFornecedorSearchGridFields = function () {
|
|
10340
10288
|
return [
|
|
@@ -10354,8 +10302,6 @@
|
|
|
10354
10302
|
type: angularComponents.FieldType.String,
|
|
10355
10303
|
}),
|
|
10356
10304
|
];
|
|
10357
|
-
/*{CA:GET_FORNECEDOR_SEARCH_GRID_FIELDS:START}*/
|
|
10358
|
-
/*{CA:GET_FORNECEDOR_SEARCH_GRID_FIELDS:END}*/
|
|
10359
10305
|
};
|
|
10360
10306
|
RecebimentoFormComponent.prototype.getOrigemMercadoriaFields = function () {
|
|
10361
10307
|
return [
|
|
@@ -10433,8 +10379,6 @@
|
|
|
10433
10379
|
type: angularComponents.FieldType.String,
|
|
10434
10380
|
})
|
|
10435
10381
|
];
|
|
10436
|
-
/*{CA:GET_PRODUTO_SEARCH_FIELDS:START}*/
|
|
10437
|
-
/*{CA:GET_PRODUTO_SEARCH_FIELDS:END}*/
|
|
10438
10382
|
};
|
|
10439
10383
|
RecebimentoFormComponent.prototype.getProdutoSearchGridFields = function () {
|
|
10440
10384
|
return [
|
|
@@ -10454,8 +10398,6 @@
|
|
|
10454
10398
|
type: angularComponents.FieldType.String,
|
|
10455
10399
|
}),
|
|
10456
10400
|
];
|
|
10457
|
-
/*{CA:GET_PRODUTO_SEARCH_GRID_FIELDS:START}*/
|
|
10458
|
-
/*{CA:GET_PRODUTO_SEARCH_GRID_FIELDS:END}*/
|
|
10459
10401
|
};
|
|
10460
10402
|
RecebimentoFormComponent.prototype.getAgendaSearchFields = function () {
|
|
10461
10403
|
return [
|
|
@@ -10465,8 +10407,6 @@
|
|
|
10465
10407
|
type: angularComponents.FieldType.String,
|
|
10466
10408
|
}),
|
|
10467
10409
|
];
|
|
10468
|
-
/*{CA:GET_AGENDA_SEARCH_FIELDS:START}*/
|
|
10469
|
-
/*{CA:GET_AGENDA_SEARCH_FIELDS:END}*/
|
|
10470
10410
|
};
|
|
10471
10411
|
RecebimentoFormComponent.prototype.getAgendaSearchGridFields = function () {
|
|
10472
10412
|
return [
|
|
@@ -10476,8 +10416,6 @@
|
|
|
10476
10416
|
type: angularComponents.FieldType.String,
|
|
10477
10417
|
}),
|
|
10478
10418
|
];
|
|
10479
|
-
/*{CA:GET_AGENDA_SEARCH_GRID_FIELDS:START}*/
|
|
10480
|
-
/*{CA:GET_AGENDA_SEARCH_GRID_FIELDS:END}*/
|
|
10481
10419
|
};
|
|
10482
10420
|
RecebimentoFormComponent.prototype.getDerivacaoSearchFields = function () {
|
|
10483
10421
|
return [
|
|
@@ -10492,8 +10430,6 @@
|
|
|
10492
10430
|
type: angularComponents.FieldType.String,
|
|
10493
10431
|
}),
|
|
10494
10432
|
];
|
|
10495
|
-
/*{CA:GET_DERIVACAO_SEARCH_FIELDS:START}*/
|
|
10496
|
-
/*{CA:GET_DERIVACAO_SEARCH_FIELDS:END}*/
|
|
10497
10433
|
};
|
|
10498
10434
|
RecebimentoFormComponent.prototype.getDerivacaoSearchGridFields = function () {
|
|
10499
10435
|
return [
|
|
@@ -10508,8 +10444,6 @@
|
|
|
10508
10444
|
type: angularComponents.FieldType.String,
|
|
10509
10445
|
}),
|
|
10510
10446
|
];
|
|
10511
|
-
/*{CA:GET_DERIVACAO_SEARCH_GRID_FIELDS:START}*/
|
|
10512
|
-
/*{CA:GET_DERIVACAO_SEARCH_GRID_FIELDS:END}*/
|
|
10513
10447
|
};
|
|
10514
10448
|
RecebimentoFormComponent.prototype.getTransportadoraSearchFields = function () {
|
|
10515
10449
|
return [
|
|
@@ -10593,8 +10527,6 @@
|
|
|
10593
10527
|
control.controls.forEach(function (form) { return _this.validateAllFormFields(form); });
|
|
10594
10528
|
});
|
|
10595
10529
|
this.focusService.focusFirstInvalidInput();
|
|
10596
|
-
/*{CA:FOCUS_FIRST_INVALID:START}*/
|
|
10597
|
-
/*{CA:FOCUS_FIRST_INVALID:END}*/
|
|
10598
10530
|
};
|
|
10599
10531
|
RecebimentoFormComponent.prototype.getSaveObservable = function () {
|
|
10600
10532
|
var value = this.formGroup.getRawValue();
|
|
@@ -10617,16 +10549,10 @@
|
|
|
10617
10549
|
}));
|
|
10618
10550
|
};
|
|
10619
10551
|
RecebimentoFormComponent.prototype.validateVisualization = function () {
|
|
10620
|
-
/*{CA:VALIDATE_VISUALIZATION_START:START}*/
|
|
10621
|
-
/*{CA:VALIDATE_VISUALIZATION_START:END}*/
|
|
10622
10552
|
if (!userCanVisualize(this.formGroup, this.allPermissions)) {
|
|
10623
10553
|
this.addMessage("error", "yms.erp.cannot_visualize_form_summary", "yms.erp.cannot_visualize_form_detail");
|
|
10624
10554
|
}
|
|
10625
|
-
/*{CA:VALIDATE_VISUALIZATION_END:START}*/
|
|
10626
|
-
/*{CA:VALIDATE_VISUALIZATION_END:END}*/
|
|
10627
10555
|
};
|
|
10628
|
-
/*{CA:CLASS_METHODS:START}*/
|
|
10629
|
-
/*{CA:CLASS_METHODS:END}*/
|
|
10630
10556
|
RecebimentoFormComponent.prototype.addMessage = function (severity, summary, detail) {
|
|
10631
10557
|
this.messageService.add({
|
|
10632
10558
|
severity: severity,
|
|
@@ -10802,7 +10728,7 @@
|
|
|
10802
10728
|
RecebimentoInfoComponent = __decorate([
|
|
10803
10729
|
core.Component({
|
|
10804
10730
|
selector: "recebimento-info",
|
|
10805
|
-
template: "\n <div *sLoadingState=\"loading\" style=\"padding: 20px;\">\n <div class=\"detail-pane\" *ngIf=\"agenda\">\n <div class=\"detail-span\">\n <span class=\"title\"
|
|
10731
|
+
template: "\n <div *sLoadingState=\"loading\" style=\"padding: 20px;\">\n <div class=\"detail-pane\" *ngIf=\"agenda\">\n <div class=\"detail-span\">\n <span class=\"title\">\n {{ \"yms.erp.recebimento_filial\" | translate }}\n </span>\n <span class=\"data\">\n {{ recebimento?.filial?.codigo }} - {{ recebimento?.filial?.nome }}\n </span>\n </div>\n <div class=\"detail-span\">\n <span class=\"title\">\n {{ \"yms.erp.recebimento_produto\" | translate }}\n </span>\n <span class=\"data\">{{ recebimento?.produto?.descricao }}</span>\n </div>\n <div class=\"detail-span\">\n <span class=\"title\">\n {{ \"yms.erp.recebimento_derivacao\" | translate }}\n </span>\n <span class=\"data\">{{ recebimento?.derivacao?.descricao }}</span>\n </div>\n </div>\n <div *ngFor=\"let fornecedor of recebimento?.fornecedores\">\n <div class=\"separator\"></div>\n <h3>Fornecedor - {{ fornecedor?.fornecedor?.nome }}</h3>\n <div class=\"detail-pane\">\n <div class=\"detail-span\">\n <span class=\"title\">\n {{ \"yms.erp.recebimento_origem_mercadoria\" | translate }}\n </span>\n <span class=\"data\">\n {{ fornecedor?.origemMercadoria?.codigo }} - {{ fornecedor?.origemMercadoria?.cep }}\n </span>\n </div>\n </div>\n\n <!-- <div>\n <h4>Notas</h4>\n <p-accordion>\n <p-accordionTab\n *ngFor=\"let nota of fornecedor.notas\"\n [header]=\"\n nota.chaveNotaFiscal ||\n nota.numeroNotaFiscal + ' - ' + nota.serieNotaFiscal\n \"\n >\n <div class=\"detail-pane\">\n <div class=\"detail-span\">\n <span class=\"title\">Serie nota fiscal</span>\n <span class=\"data\">{{ nota?.serieNotaFiscal }}</span>\n </div>\n <div class=\"detail-span\">\n <span class=\"title\">N\u00FAmero nota fiscal</span>\n <span class=\"data\">{{ nota?.numeroNotaFiscal }}</span>\n </div>\n </div>\n </p-accordionTab>\n </p-accordion>\n </div> -->\n\n <div>\n <h4>Contratos</h4>\n <p-accordion>\n <p-accordionTab *ngFor=\"let contrato of fornecedor.contratos\">\n <p-header>\n Contrato {{ contrato?.contrato?.numero }}, Filial {{ contrato?.contrato?.filial?.codigo }}\n </p-header>\n\n <div class=\"detail-pane\" *ngFor=\"let item of contrato?.itens\">\n <div class=\"detail-span\">\n <span class=\"title\">Sequ\u00EAncia</span>\n <span class=\"data\">{{ item?.item?.sequencia }}</span>\n </div>\n </div>\n\n <div *ngFor=\"let nota of contrato.notas\">\n <div class=\"detail-pane\">\n <div class=\"detail-span\">\n <span class=\"title\">Chave nota fiscal</span>\n <span class=\"data\">{{ nota?.chaveNotaFiscal }}</span>\n </div>\n <div class=\"detail-span\">\n <span class=\"title\">Serie nota fiscal</span>\n <span class=\"data\">{{ nota?.serieNotaFiscal }}</span>\n </div>\n <div class=\"detail-span\">\n <span class=\"title\">N\u00FAmero nota fiscal</span>\n <span class=\"data\">{{ nota?.numeroNotaFiscal }}</span>\n </div>\n </div>\n <hr />\n </div>\n </p-accordionTab>\n </p-accordion>\n </div>\n </div>\n </div>\n ",
|
|
10806
10732
|
styles: [".detail-pane{display:flex;flex-wrap:wrap;justify-content:flex-start}.detail-pane .detail-span{width:50%;padding:10px 0;display:flex;flex-direction:column}.detail-pane .detail-span .title{font-size:14px;opacity:.7;margin-bottom:4px}.detail-pane .detail-span .data{font-size:16px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}"]
|
|
10807
10733
|
}),
|
|
10808
10734
|
__metadata("design:paramtypes", [RecebimentoContratoService])
|