(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["app-pages-relatorios-laudo-navio-laudo-navio-module"],{

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/relatorios/laudo-navio/laudo-navio-form/laudo-navio-form.component.html":
/*!*************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/relatorios/laudo-navio/laudo-navio-form/laudo-navio-form.component.html ***!
  \*************************************************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("<app-menu-command-bar [sisFormularioId]=\"constantes.sisFormularioId\" [botoesComando]=\"constantes.listaForm\">\n</app-menu-command-bar>\n\n<div class=\"row\">\n    <div class=\"col-lg-12\">\n        <div class=\"section-comand-bar\">\n            <div class=\"\">\n                <app-form-legenda></app-form-legenda>\n                <div class=\"card-body widget-body\">\n                    <form class=\"form\" #f=\"ngForm\" (ngSubmit)=\"onSubmit(f)\">\n                        <app-validacoes></app-validacoes>\n                        <div class=\"row\">\n                            <div class=\"col-lg-12\">\n                                <div class=\"row\">\n                                    <div class=\"col-lg-3 col-md-6 col-sm-12\">\n                                        <div class=\"form-group form-group-sm\">\n                                            <label for=\"regLaudo\" class=\"required\">{{\"labels.laudo\" |\n                                                translate}}</label>\n                                            <input type=\"text\" class=\"form-control form-control-sm col\" id=\"regLaudo\"\n                                                name=\"regLaudo\" [(ngModel)]=\"data.regLaudo\" maxlength=\"9\" required\n                                                mask=\"999999999\" (blur)=\"consultaRegLaudo()\">\n                                        </div>\n                                    </div>\n                                    <div class=\"col-lg-3 col-md-6 col-sm-12\">\n                                        <div class=\"form-group form-group-sm\">\n                                            <label for=\"data\">{{\"labels.data\" | translate }}</label>\n                                            <app-data id=\"data\" name=\"data\" [(ngModel)]=\"data.dtMovimento\"\n                                                [formatDateTime]=\"mascara.getFormatData\" autofocus disabled>\n                                            </app-data>\n                                        </div>\n                                    </div>\n                                </div>\n                                <div class=\"row\">\n                                    <div class=\"col-lg-6 col-md-12 col-sm-12\">\n                                        <div class=\"form-group form-group-sm\">\n                                            <label for=\"codNavio\">{{'labels.navio' | translate}}</label>\n                                            <div class=\"input-group\">\n                                                <input id=\"codNavio\" name=\"codNavio\" [(ngModel)]=\"data.codNavio\"\n                                                    maxlength=\"20\" class=\"form-control form-control-sm col-2\"\n                                                    type=\"text\" disabled=\"true\">\n                                                <input id=\"descNavio\" name=\"descNavio\" disabled=\"true\"\n                                                    [(ngModel)]=\"data.descNavio\" maxlength=\"20\"\n                                                    class=\"form-control form-control-sm col\" type=\"text\">\n                                            </div>\n                                        </div>\n                                    </div>\n                                </div>\n                                <div class=\"row\">\n                                    <div class=\"col-lg-6 col-md-12 col-sm-12\">\n                                        <div class=\"form-group form-group-sm\">\n                                            <label for=\"itens\" class=\"required\">{{ 'labels.item' | translate}}</label>\n                                            <app-combo-multi-sto-laudo-item id=\"itens\" name=\"itens\"\n                                                [stoLaudoId]=\"data.regLaudo\" (outObjeto)=\"trataItens($event)\"\n                                                required=\"true\">\n                                            </app-combo-multi-sto-laudo-item>\n                                        </div>\n                                    </div>\n                                </div>\n                                <div class=\"row\">\n                                    <div class=\"col-lg-6 col-md-12 col-sm-12\">\n                                        <app-pesquisa-destinatario id=\"destinatarioIdCliente\"\n                                            name=\"destinatarioIdCliente\" label=\"cliente\" modalTitle=\"pesquisaDeCliente\"\n                                            [(ngModel)]=\"data.destinatarioIdCliente\" tipoDestinatario=\"C\"\n                                            showCgcCpf=\"false\" showInscricao=\"false\">\n                                        </app-pesquisa-destinatario>\n                                    </div>\n                                </div>\n                                <div class=\"row\">\n                                    <div class=\"col-lg-6 col-md-12 col-sm-12\">\n                                        <div class=\"form-group form-group-sm\">\n                                            <label for=\"tipoDeLaudo\" class=\"required\">{{ 'labels.tipoDeLaudo' |\n                                                translate}}</label>\n                                            <app-combo-padrao id=\"tipoDeLaudo\" name=\"tipoDeLaudo\" tabela=\"TipoLaudoRel\"\n                                                descricao=\"DescrLaudoRel\" chave=\"CodLaudoRel\"\n                                                [(ngModel)]=\"data.tipoLaudoRelId\" required\n                                                (outSelected)=\"onTipoDeLaudoSelecioando($event)\">\n                                            </app-combo-padrao>\n                                        </div>\n                                    </div>\n                                </div>\n                                <div class=\"row\">\n                                    <div class=\"col-lg-6 col-md-12 col-sm-12\">\n                                        <div class=\"form-check mb-2\">\n                                            <input id=\"apresCalc\" class=\"form-check-input\" type=\"checkbox\"\n                                                name=\"apresCalc\" [(ngModel)]=\"data.apresCalc\">\n                                            <label class=\"form-check-label\" for=\"apresCalc\">\n                                                {{'labels.apresCalc' | translate}}\n                                            </label>\n                                        </div>\n                                    </div>\n                                </div>\n                                <div class=\"row\">\n                                    <div class=\"col-lg-6 col-md-12 col-sm-12\">\n                                        <div class=\"form-check mb-2\">\n                                            <input id=\"apresLitros\" class=\"form-check-input\" type=\"checkbox\"\n                                                name=\"apresLitros\" [(ngModel)]=\"data.apresLitros\">\n                                            <label class=\"form-check-label\" for=\"apresLitros\">\n                                                {{'labels.apresLitros' | translate}}\n                                            </label>\n                                        </div>\n                                    </div>\n                                </div>\n                                <div class=\"row\">\n                                    <div class=\"col-lg-6 col-md-12 col-sm-12\">\n                                        <div class=\"form-check mb-2\">\n                                            <input id=\"resumido\" class=\"form-check-input\" type=\"checkbox\"\n                                                name=\"resumido\" [(ngModel)]=\"data.apresResumido\">\n                                            <label class=\"form-check-label\" for=\"resumido\">\n                                                {{'labels.resumido' | translate}}\n                                            </label>\n                                        </div>\n                                    </div>\n                                </div>\n                                <div class=\"row\">\n                                    <div class=\"col-lg-6 col-md-12 col-sm-12\">\n                                        <div class=\"form-check mb-2\">\n                                            <input id=\"apresPeriodoCodesp\" class=\"form-check-input\" type=\"checkbox\"\n                                                name=\"apresPeriodoCodesp\" [(ngModel)]=\"data.apresPeriodoCodesp\">\n                                            <label class=\"form-check-label\" for=\"apresPeriodoCodesp\">\n                                                {{'labels.apresPeriodoCodesp' | translate}}\n                                            </label>\n                                        </div>\n                                    </div>\n                                </div>\n                            </div>\n                        </div>\n                        <div class=\"clearfix\">&nbsp;</div>\n                        <div class=\"form-group\">\n                            <button class=\"btn btn-success mr-2\" type=\"submit\">\n                                {{ 'buttons.gerarRelatorio' | translate }}\n                            </button>\n                            <button class=\"btn btn-success mr-2\" (click)=\"export(f)\" type=\"button\">{{\n                                'buttons.exportarExcel' | translate }}\n                            </button>\n                            <button class=\"btn btn-success mr-2\" (click)=\"sendMail(f)\" type=\"button\">{{\n                                'buttons.enviarEmail' | translate }}\n                            </button>\n                        </div>\n                    </form>\n                </div>\n            </div>\n        </div>\n    </div>\n</div>\n<app-liberar-acesso-supervisor></app-liberar-acesso-supervisor>\n<app-permissoes-rotina [constantes]=\"constantes\"></app-permissoes-rotina>\n<app-email [reportId]=\"constantes.reportId\" [titulo]=\"constantes.reportTitulo.titulo\"\n    [subTitulo]=\"constantes.reportTitulo.subTitulo\" [data]=\"constantes.paramRelatorio\"></app-email>");

/***/ }),

/***/ "./src/app/pages/relatorios/laudo-navio/laudo-navio-form/laudo-navio-form.component.ts":
/*!*********************************************************************************************!*\
  !*** ./src/app/pages/relatorios/laudo-navio/laudo-navio-form/laudo-navio-form.component.ts ***!
  \*********************************************************************************************/
/*! exports provided: LaudoNavioFormComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LaudoNavioFormComponent", function() { return LaudoNavioFormComponent; });
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/fesm5/router.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../shared/services/funcoes/funcoes.service */ "./src/app/shared/services/funcoes/funcoes.service.ts");
/* harmony import */ var _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../shared/services/event-emitter/event-emitter.service */ "./src/app/shared/services/event-emitter/event-emitter.service.ts");
/* harmony import */ var _shared_components_corporate_base_base_permissoes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../shared/components/corporate/base/base.permissoes */ "./src/app/shared/components/corporate/base/base.permissoes.ts");
/* harmony import */ var app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! app/pages/login/login.service */ "./src/app/pages/login/login.service.ts");
/* harmony import */ var app_config_enumerables__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! app/config/enumerables */ "./src/app/config/enumerables.ts");
/* harmony import */ var app_shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! app/shared/services/funcoes/permissoes-utils/permissoes-utils.service */ "./src/app/shared/services/funcoes/permissoes-utils/permissoes-utils.service.ts");
/* harmony import */ var app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! app/shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var _laudo_navio_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../laudo-navio.constants */ "./src/app/pages/relatorios/laudo-navio/laudo-navio.constants.ts");
/* harmony import */ var _laudo_navio_model__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../laudo-navio.model */ "./src/app/pages/relatorios/laudo-navio/laudo-navio.model.ts");
/* harmony import */ var _operacao_sto_laudo_sto_laudo_model__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../operacao/sto-laudo/sto-laudo.model */ "./src/app/pages/operacao/sto-laudo/sto-laudo.model.ts");
/* harmony import */ var app_pages_operacao_sto_laudo_sto_laudo_service__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! app/pages/operacao/sto-laudo/sto-laudo.service */ "./src/app/pages/operacao/sto-laudo/sto-laudo.service.ts");
/* harmony import */ var _shared_components_report_report_service__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../../shared/components/report/report.service */ "./src/app/shared/components/report/report.service.ts");
/* harmony import */ var _shared_services_funcoes_excel_excel_service__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../../shared/services/funcoes/excel/excel.service */ "./src/app/shared/services/funcoes/excel/excel.service.ts");
/* harmony import */ var app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! app/shared/services/funcoes/configuracao/configuracao.facade */ "./src/app/shared/services/funcoes/configuracao/configuracao.facade.ts");
/* harmony import */ var app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! app/shared/services/funcoes/boolean-utils/boolean-utils.static.service */ "./src/app/shared/services/funcoes/boolean-utils/boolean-utils.static.service.ts");
/* harmony import */ var app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! app/shared/services/funcoes/number-utils/number-utils.static.service */ "./src/app/shared/services/funcoes/number-utils/number-utils.static.service.ts");
/* harmony import */ var app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! app/shared/services/funcoes/string-utils/string-utils.static.service */ "./src/app/shared/services/funcoes/string-utils/string-utils.static.service.ts");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (undefined && undefined.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};



















var LaudoNavioFormComponent = /** @class */ (function (_super) {
    __extends(LaudoNavioFormComponent, _super);
    function LaudoNavioFormComponent(activatedRoute, loginService, configuracao, messageService, stoLaudoService, excelService, reportService, permissoesUtils, funcoes) {
        var _this = _super.call(this, new _laudo_navio_constants__WEBPACK_IMPORTED_MODULE_9__["LaudoNavioConstants"](), funcoes) || this;
        _this.activatedRoute = activatedRoute;
        _this.loginService = loginService;
        _this.configuracao = configuracao;
        _this.messageService = messageService;
        _this.stoLaudoService = stoLaudoService;
        _this.excelService = excelService;
        _this.reportService = reportService;
        _this.permissoesUtils = permissoesUtils;
        _this.funcoes = funcoes;
        _this.mensagens = [];
        _this.constantes = new _laudo_navio_constants__WEBPACK_IMPORTED_MODULE_9__["LaudoNavioConstants"]();
        _this.target = _this.funcoesService.getTargetLocation();
        _this.data = new _laudo_navio_model__WEBPACK_IMPORTED_MODULE_10__["LaudoNavio"]();
        _this.mascara = new app_config_enumerables__WEBPACK_IMPORTED_MODULE_6__["Mascaras"]();
        _this.dados = new _operacao_sto_laudo_sto_laudo_model__WEBPACK_IMPORTED_MODULE_11__["StoLaudo"]();
        _this.selectedItensId = [];
        _this.tipoLaudoDescricao = "";
        _this.loadConfig = function () {
            if (_this.configuracao.isLoadConfig()) {
                _this.data.filialId = _this.loginService.getLogin().filialId;
                _this.data.cWebModRelLaudo = _this.configuracao.string("WEB", "CWebModRelLaudo");
                _this.data.apresKilosVacuo = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_16__["BooleanUtilsStaticService"].toBoolean(_this.configuracao.lerConfig("OPE", "KilosVacuo"));
                _this.constantes.reportId = _this.data.cWebModRelLaudo;
                _this.data.prefixoRelEspecifico = _this.configuracao.string("WEB", "PrefixoRelEspecifico");
            }
        };
        _this.export = function (form) {
            if (!_this.printParams(form))
                return;
            var sisFormularioId = _this.constantes.sisFormularioId;
            switch (_this.data.cWebModRelLaudo) {
                case 'REL0190': //Ageo
                    sisFormularioId = 250131;
                    break;
                case 'ROC0054': //Rocha
                    sisFormularioId = 375077;
                    break;
                case 'REL0163': //Cargill
                    sisFormularioId = 65735;
                    break;
                case 'STS0008': //Santos Brasil
                    sisFormularioId = 375066;
                    break;
                case 'VOP0060': //Vopak
                    sisFormularioId = 375077;
                    break;
                case 'PON0016': //Ponta do Felix
                    sisFormularioId = 250009;
                    break;
                default: // Padrão
                    sisFormularioId = 250130;
                    break;
            }
            // Valida se a chamada é para um report especifico
            if (_this.data.cWebModRelLaudo.indexOf(_this.data.prefixoRelEspecifico) == 0) {
                _this.reportService.exportEspecificos(sisFormularioId, _this.constantes.paramRelatorio).subscribe(function (resp) {
                    if (sisFormularioId === 250009) { //Ponta do Felix
                        resp = _this.trataExcelPonta(resp);
                    }
                    if (resp.length > 1) {
                        var sheetData = resp.map(function (obj) {
                            var _a = Object.entries(obj)[0], bandaName = _a[0], bandaData = _a[1];
                            return {
                                name: bandaName,
                                data: bandaData //conteúdo/dados
                            };
                        });
                        // Cria os parâmetros, headers e dados dinamicamente
                        var dataArray = sheetData.map(function (s) { return s.data; });
                        var paramsArray = sheetData.map(function (s) { return ({
                            excelFileName: _this.messageService.getTranslates("titles", "laudoNavio"),
                            sheetName: _this.messageService.getTranslates("labels", s.name),
                            celulas: {
                                "row": {
                                    rowNumber: 1,
                                    backGroundColor: 'C0C0C0',
                                    bold: false
                                }
                            }
                        }); });
                        var headerDictionaryArray = sheetData.map(function () { return ({}); });
                        _this.excelService.exportAsExcelFileCustomMultipleSheets(dataArray, paramsArray, headerDictionaryArray);
                    }
                    else {
                        var headerDictionary = {};
                        var options = {
                            headerJsonKeys: true,
                            headerDictionary: headerDictionary
                        };
                        _this.excelService.exportAsExcelFile(resp, _this.messageService.getTranslates("titles", "laudoNavio"), options);
                    }
                });
            }
            else {
                _this.reportService.export(sisFormularioId, _this.constantes.paramRelatorio).subscribe(function (resp) {
                    if (resp.length > 1) {
                        var sheetData = resp.map(function (obj) {
                            var _a = Object.entries(obj)[0], bandaName = _a[0], bandaData = _a[1];
                            return {
                                name: bandaName,
                                data: bandaData //conteúdo/dados
                            };
                        });
                        // Cria os parâmetros, headers e dados dinamicamente
                        var dataArray = sheetData.map(function (s) { return s.data; });
                        var paramsArray = sheetData.map(function (s) { return ({
                            excelFileName: _this.messageService.getTranslates("titles", "laudoNavio"),
                            sheetName: _this.messageService.getTranslates("titles", s.name),
                            celulas: {
                                "row": {
                                    rowNumber: 1,
                                    backGroundColor: 'C0C0C0',
                                    bold: false
                                }
                            }
                        }); });
                        var headerDictionaryArray = sheetData.map(function () { return ({}); });
                        _this.excelService.exportAsExcelFileCustomMultipleSheets(dataArray, paramsArray, headerDictionaryArray);
                    }
                    else {
                        var headerDictionary = {};
                        var options = {
                            headerJsonKeys: true,
                            headerDictionary: headerDictionary
                        };
                        resp.forEach(function (r) {
                            delete r.banda;
                        });
                        _this.excelService.exportAsExcelFile(resp, _this.messageService.getTranslates("titles", "laudoNavio"), options);
                        var paramsCalculos = {
                            excelFileName: _this.messageService.getTranslates("titles", "laudoNavio"),
                            sheetName: _this.messageService.getTranslates("titles", "calculos"),
                        };
                    }
                });
            }
        };
        return _this;
    }
    LaudoNavioFormComponent.prototype.ngOnInit = function () {
        var _this = this;
        var id = this.activatedRoute.snapshot.paramMap.get("stoLaudoId");
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 1, function () {
            _this.configuracao.getConfig({
                codRotina: _this.constantes.sisFormularioId,
                configs: _this.constantes.configuracoes
            }, _this.loadConfig);
            if (id) {
                if (!_this.data)
                    _this.data = new _laudo_navio_model__WEBPACK_IMPORTED_MODULE_10__["LaudoNavio"]();
                _this.data.regLaudo = +id;
                _this.consultaRegLaudo();
            }
        }, function () { return _this.permissoesUtils.back(); }, true);
    };
    LaudoNavioFormComponent.prototype.onSubmit = function (form) {
        if (!this.printParams(form))
            return;
        // Valida se a chamada é para um report especifico
        if (!!this.data.prefixoRelEspecifico && this.data.cWebModRelLaudo.indexOf(this.data.prefixoRelEspecifico) == 0) {
            this.print(null, true);
        }
        else {
            this.print();
        }
    };
    LaudoNavioFormComponent.prototype.onCancelar = function () {
        this.data = new _laudo_navio_model__WEBPACK_IMPORTED_MODULE_10__["LaudoNavio"]();
    };
    LaudoNavioFormComponent.prototype.permissoes = function () {
        var _this = this;
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 2, function () {
            _super.prototype.permissoes.call(_this, _this.constantes);
        });
    };
    LaudoNavioFormComponent.prototype.consultaRegLaudo = function () {
        var _this = this;
        if (this.funcoesService.isNotUndefinedOrNull(this.data.regLaudo) && this.data.regLaudo > 0) {
            this.stoLaudoService.getById(this.data.regLaudo).subscribe(function (resp) {
                if (resp !== null) {
                    _this.data.codNavio = resp["navio"].destinatarioId;
                    _this.data.descNavio = resp["navio"].fantasia;
                    _this.data.dtMovimento = resp.dtMovimento;
                }
                else {
                    _this.messageService.warning("titles.laudoNavio", "messages.laudoNaoEncontrado");
                }
            });
        }
    };
    LaudoNavioFormComponent.prototype.trataItens = function (selectedItems) {
        this.data.itens = selectedItems;
    };
    LaudoNavioFormComponent.prototype.printParams = function (form) {
        _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_3__["EventEmitterService"].get("formError").emit(form);
        if (form.invalid) {
            return false;
        }
        if (this.data.regLaudo === 0) {
            this.messageService.warning("titles.laudoNavio", "messages.necessarioInformarRegLaudo");
            return false;
        }
        else if (this.data.itens === "") {
            this.messageService.warning("titles.laudoNavio", "messages.necessarioSelecionarItem");
            return false;
        }
        else if (this.funcoesService.isUndefinedOrNull(this.data.cWebModRelLaudo)) {
            this.messageService.warning("titles.laudoNavio", "messages.modRelNaoConfigurado");
            return false;
        }
        this.constantes.reportTitulo.titulo = this.tipoLaudoDescricao;
        this.constantes.paramRelatorio = {
            filialId: this.loginService.getLogin().filialId,
            regLaudo: app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_17__["NumberUtilsStaticService"].toNumber(this.data.regLaudo),
            tipoLaudoRelId: app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_17__["NumberUtilsStaticService"].toNumber(this.data.tipoLaudoRelId),
            colaboradorId: this.loginService.getLogin().colaboradorId,
            destinatarioIdCliente: app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_17__["NumberUtilsStaticService"].toNumber(this.data.destinatarioIdCliente),
            apresLitros: app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_16__["BooleanUtilsStaticService"].toBoolean(this.data.apresLitros),
            apresCalc: app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_16__["BooleanUtilsStaticService"].toBoolean(this.data.apresCalc),
            itens: app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_18__["StringUtilsStaticService"].toString(this.data.itens),
            banda: "",
            apresKilosVacuo: app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_16__["BooleanUtilsStaticService"].toBoolean(this.data.apresKilosVacuo),
            apresPeriodoCodesp: app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_16__["BooleanUtilsStaticService"].toBoolean(this.data.apresPeriodoCodesp),
            apresResumido: app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_16__["BooleanUtilsStaticService"].toBoolean(this.data.apresResumido),
        };
        return true;
    };
    LaudoNavioFormComponent.prototype.sendMail = function (form) {
        if (!this.printParams(form))
            return;
        _super.prototype.sendMail.call(this, this.constantes);
    };
    LaudoNavioFormComponent.prototype.trataExcelPonta = function (resp) {
        // Propriedades a serem exibidas e na ordem de exibição desejada
        var incluirPropsPorBanda = {
            dados: ['navio', 'fantasiaNavio', 'nrCre', 'data', 'clientes', 'descrGrupo', 'material', 'descrMater', 'nrControle', 'procedencia', 'carimboCod', 'pier', 'observacoes'],
            resumoCalculos: ['observ', 'fantasia', 'numeroOsg', 'lote', 'numDi', 'kilosManif', 'kilosRecebe', 'kilosBordo', 'kilosPtDif', 'kilosDifBordo', 'kilosPtDifBordo', 'descrTipoOperacao'],
            ocorrencias: ['dtInicio', 'dtFim', 'observacoes'],
            resumoPorDeposito: ['deposito', 'fantasia', 'lote', 'kilos'],
            horarioDeOperacao: ['observ', 'dtInicio', 'dtFim', 'observacoes'],
            veicOperac: ['autorizacao', 'placaCavalo', 'placaCarreta1', 'nomeMotorista', 'nomeTransp', 'pesoDoc', 'pesoBru', 'pesoTara', 'pesoLiq', 'quantidAut', 'quantidDif', 'quantidEmb', 'quantidAvaria', 'deposito']
        };
        // Filtrar e ordenar cada item de acordo com incluirPropsPorBanda
        var ordem = Object.keys(incluirPropsPorBanda);
        var ordenaEFiltraItens = function (items, props) {
            return items.map(function (item) {
                var novoItem = {};
                props.forEach(function (prop) {
                    if (item[prop] !== undefined) {
                        novoItem[prop] = item[prop];
                    }
                });
                return novoItem;
            });
        };
        // Se a banda retornada pelo BackEnd não estiver mapeada em incluirPropsPorBanda, ela é ignorada(evita gerar abas na planilha do Excel sem conteúdo)
        return resp
            .filter(function (bandaObj) { return ordem.includes(Object.keys(bandaObj)[0]); })
            .sort(function (a, b) {
            var nomeA = Object.keys(a)[0];
            var nomeB = Object.keys(b)[0];
            return ordem.indexOf(nomeA) - ordem.indexOf(nomeB);
        })
            .map(function (bandaObj) {
            var _a;
            var _b = Object.entries(bandaObj)[0], bandaName = _b[0], items = _b[1];
            var props = incluirPropsPorBanda[bandaName];
            return _a = {}, _a[bandaName] = ordenaEFiltraItens(items, props), _a;
        });
    };
    LaudoNavioFormComponent.prototype.onTipoDeLaudoSelecioando = function (tipoLaudo) {
        this.tipoLaudoDescricao = tipoLaudo ? tipoLaudo.valor : "";
    };
    LaudoNavioFormComponent.ctorParameters = function () { return [
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_0__["ActivatedRoute"] },
        { type: app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_5__["LoginService"] },
        { type: app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_15__["ConfiguracaoFacade"] },
        { type: app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_8__["MessageService"] },
        { type: app_pages_operacao_sto_laudo_sto_laudo_service__WEBPACK_IMPORTED_MODULE_12__["StoLaudoService"] },
        { type: _shared_services_funcoes_excel_excel_service__WEBPACK_IMPORTED_MODULE_14__["ExcelService"] },
        { type: _shared_components_report_report_service__WEBPACK_IMPORTED_MODULE_13__["ReportService"] },
        { type: app_shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_7__["PermissoesUtilsService"] },
        { type: _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_2__["FuncoesService"] }
    ]; };
    LaudoNavioFormComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"])({
            selector: "app-laudo-navio",
            template: __importDefault(__webpack_require__(/*! raw-loader!./laudo-navio-form.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/relatorios/laudo-navio/laudo-navio-form/laudo-navio-form.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [_angular_router__WEBPACK_IMPORTED_MODULE_0__["ActivatedRoute"],
            app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_5__["LoginService"],
            app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_15__["ConfiguracaoFacade"],
            app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_8__["MessageService"],
            app_pages_operacao_sto_laudo_sto_laudo_service__WEBPACK_IMPORTED_MODULE_12__["StoLaudoService"],
            _shared_services_funcoes_excel_excel_service__WEBPACK_IMPORTED_MODULE_14__["ExcelService"],
            _shared_components_report_report_service__WEBPACK_IMPORTED_MODULE_13__["ReportService"],
            app_shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_7__["PermissoesUtilsService"],
            _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_2__["FuncoesService"]])
    ], LaudoNavioFormComponent);
    return LaudoNavioFormComponent;
}(_shared_components_corporate_base_base_permissoes__WEBPACK_IMPORTED_MODULE_4__["BasePermissoes"]));



/***/ }),

/***/ "./src/app/pages/relatorios/laudo-navio/laudo-navio.constants.ts":
/*!***********************************************************************!*\
  !*** ./src/app/pages/relatorios/laudo-navio/laudo-navio.constants.ts ***!
  \***********************************************************************/
/*! exports provided: LaudoNavioConstants */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LaudoNavioConstants", function() { return LaudoNavioConstants; });
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};
var LaudoNavioConstants = /** @class */ (function () {
    function LaudoNavioConstants() {
        this.sisFormularioId = 250131;
        this.permissoes = [
            { sisFormularioId: this.sisFormularioId, libRotina: 1, acao: "labels.consulta" },
            { sisFormularioId: this.sisFormularioId, libRotina: 2, acao: "labels.permissoes" }
        ];
        this.configuracoes = [];
        this.sisSistemaId = "REL";
        this.nomeForm = "titles.laudoNavio";
        this.reportId = "REL0163";
        this.reportTitulo = { "titulo": "Laudo Navio", "subTitulo": "" };
        this.listaForm = [
            { title: 'Permissao', action: 'permissoes', icon: "icon-unlock", exibeButton: true, eximeMenu: true, menuName: 'Arquivo' }
        ];
        this.configuracoes = [
            {
                sistema: "WEB",
                parametros: [
                    "CWebModRelLaudo",
                    "PrefixoRelEspecifico"
                ]
            },
            { 'sistema': 'OPE', 'parametros': ["KilosVacuo"] },
        ];
    }
    return LaudoNavioConstants;
}());



/***/ }),

/***/ "./src/app/pages/relatorios/laudo-navio/laudo-navio.model.ts":
/*!*******************************************************************!*\
  !*** ./src/app/pages/relatorios/laudo-navio/laudo-navio.model.ts ***!
  \*******************************************************************/
/*! exports provided: LaudoNavio */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LaudoNavio", function() { return LaudoNavio; });
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};
var LaudoNavio = /** @class */ (function () {
    function LaudoNavio() {
        this.filialId = 0;
        this.regLaudo = 0;
        this.tipoLaudoRelId = "";
        this.colaboradorId = 0;
        this.codNavio = "";
        this.destinatarioIdCliente = 0;
        this.apresCalc = false;
        this.apresLitros = true;
        this.itens = "";
        this.apresKilosVacuo = false;
        this.apresPeriodoCodesp = false;
    }
    return LaudoNavio;
}());



/***/ }),

/***/ "./src/app/pages/relatorios/laudo-navio/laudo-navio.module.ts":
/*!********************************************************************!*\
  !*** ./src/app/pages/relatorios/laudo-navio/laudo-navio.module.ts ***!
  \********************************************************************/
/*! exports provided: LaudoNavioModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LaudoNavioModule", function() { return LaudoNavioModule; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _shared_shared_module__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../shared/shared.module */ "./src/app/shared/shared.module.ts");
/* harmony import */ var _laudo_navio_routing_module__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./laudo-navio.routing.module */ "./src/app/pages/relatorios/laudo-navio/laudo-navio.routing.module.ts");
/* harmony import */ var _laudo_navio_form_laudo_navio_form_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./laudo-navio-form/laudo-navio-form.component */ "./src/app/pages/relatorios/laudo-navio/laudo-navio-form/laudo-navio-form.component.ts");
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};




var LaudoNavioModule = /** @class */ (function () {
    function LaudoNavioModule() {
    }
    LaudoNavioModule = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"])({
            imports: [_shared_shared_module__WEBPACK_IMPORTED_MODULE_1__["SharedModule"], _laudo_navio_routing_module__WEBPACK_IMPORTED_MODULE_2__["LaudoNavioRoutingModule"]],
            declarations: [_laudo_navio_form_laudo_navio_form_component__WEBPACK_IMPORTED_MODULE_3__["LaudoNavioFormComponent"]]
        })
    ], LaudoNavioModule);
    return LaudoNavioModule;
}());



/***/ }),

/***/ "./src/app/pages/relatorios/laudo-navio/laudo-navio.routing.module.ts":
/*!****************************************************************************!*\
  !*** ./src/app/pages/relatorios/laudo-navio/laudo-navio.routing.module.ts ***!
  \****************************************************************************/
/*! exports provided: LaudoNavioRoutingModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LaudoNavioRoutingModule", function() { return LaudoNavioRoutingModule; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/fesm5/router.js");
/* harmony import */ var _config_enumerables__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../config/enumerables */ "./src/app/config/enumerables.ts");
/* harmony import */ var _laudo_navio_form_laudo_navio_form_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./laudo-navio-form/laudo-navio-form.component */ "./src/app/pages/relatorios/laudo-navio/laudo-navio-form/laudo-navio-form.component.ts");
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};




var MRoutes = [
    {
        path: "",
        component: _laudo_navio_form_laudo_navio_form_component__WEBPACK_IMPORTED_MODULE_3__["LaudoNavioFormComponent"],
        data: { breadcrumb: "laudoNavio", formParams: { action: _config_enumerables__WEBPACK_IMPORTED_MODULE_2__["ActionForm"].index } }
    },
    {
        path: ":stoLaudoId",
        component: _laudo_navio_form_laudo_navio_form_component__WEBPACK_IMPORTED_MODULE_3__["LaudoNavioFormComponent"],
        data: { breadcrumb: "laudoNavio", formParams: { action: _config_enumerables__WEBPACK_IMPORTED_MODULE_2__["ActionForm"].index } }
    },
];
var LaudoNavioRoutingModule = /** @class */ (function () {
    function LaudoNavioRoutingModule() {
    }
    LaudoNavioRoutingModule = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"])({
            imports: [_angular_router__WEBPACK_IMPORTED_MODULE_1__["RouterModule"].forChild(MRoutes)],
            exports: [_angular_router__WEBPACK_IMPORTED_MODULE_1__["RouterModule"]],
        })
    ], LaudoNavioRoutingModule);
    return LaudoNavioRoutingModule;
}());



/***/ })

}]);
//# sourceMappingURL=app-pages-relatorios-laudo-navio-laudo-navio-module.js.map