(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["app-pages-especificos-raizen-movimentos-portaria-portaria-module"],{

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/raizen/movimentos/portaria/portaria-confirmacao-chegada/portaria-confirmacao-chegada.component.html":
/*!*****************************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/raizen/movimentos/portaria/portaria-confirmacao-chegada/portaria-confirmacao-chegada.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 [botoesComando]=\"constantes.listaPortariaChegada\" [sisFormularioId]=\"constantes.sisFormularioId\"\r\n    [itemData]=\"data.webStoPlanejaVeiculoId\">\r\n</app-menu-command-bar>\r\n\r\n<div class=\"section-comand-bar\">\r\n    <ng-container *ngIf=\"showFiltro\">\r\n        <form class=\"form\" #formChegada=\"ngForm\" (ngSubmit)=\"onSubmit()\">\r\n            <div class=\"row\">\r\n                <div class=\"col-lg-2 col-md-4 col-sm-12\">\r\n                    <div class=\"form-group form-group-sm\">\r\n                        <label for=\"dtEmissao\">{{\"labels.dtEmis\" | translate }}</label>\r\n                        <app-data id=\"dtEmissao\" name=\"dtEmissao\" [(ngModel)]=\"filtro.dtEmissao\" class=\"dataHora\">\r\n                        </app-data>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n            <div class=\"row\">\r\n                <div class=\"col-lg-2 col-md-4 col-sm-12\">\r\n                    <div class=\"form-group form-group-sm\">\r\n                        <label for=\"programacao\">{{'labels.programacao' | translate}}</label>\r\n                        <input id=\"programacao\" name=\"programacao\" [(ngModel)]=\"filtro.webStoPlanejaVeiculoId\"\r\n                            class=\"form-control form-control-sm\" type=\"text\">\r\n                    </div>\r\n                </div>\r\n            </div>\r\n            <div class=\"row\">\r\n                <div class=\"col-lg-6 col-md-6 col-sm-12\">\r\n                    <div class=\"form-group form-group-sm\">\r\n                        <app-pesquisa-destinatario id=\"clienteDestinatarioId\" name=\"clienteDestinatarioId\"\r\n                            label=\"cliente\" [(ngModel)]=\"filtro.clienteDestinatarioId\" tipoDestinatario=\"C\"\r\n                            modalTitle=\"pesquisaDeCliente\" showCgcCpf=\"false\" showInscricao=\"false\">\r\n                        </app-pesquisa-destinatario>\r\n                    </div>\r\n                </div>\r\n                <div class=\"col-lg-6 col-md-6 col-sm-12\" *ngIf=\"intOsAtiva\">\r\n                    <div class=\"custom-control custom-checkbox uni-checkbox\">\r\n                        <input id=\"confirmado\" name=\"confirmado\" [ngModel]=\"filtro.confirmado==='S'\"\r\n                            (ngModelChange)=\"filtro.confirmado=$event?'S':'N'\"\r\n                            class=\"custom-control-input checkbox-success\" type=\"checkbox\">\r\n                        <label class=\"custom-control-label\"\r\n                            for=\"confirmado\">{{'labels.apresentarSomenteVeiculosComConfirmacaoDeChegada' |\r\n                            translate}}</label>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n            <div class=\"row\">\r\n                <div class=\"col-lg-6 col-md-6 col-sm-12\">\r\n                    <app-pesquisa-destinatario id=\"transportadoraDestinatarioId\" name=\"transportadoraDestinatarioId\"\r\n                        label=\"transportadora\" [(ngModel)]=\"filtro.transportadoraDestinatarioId\" tipoDestinatario=\"T\"\r\n                        modalTitle=\"pesquisaDeTransportadora\" showCgcCpf=\"false\" showInscricao=\"false\">\r\n                    </app-pesquisa-destinatario>\r\n                </div>\r\n                <div class=\"col-lg-6 col-md-6 col-sm-12\" *ngIf=\"intOsAtiva\">\r\n                    <div class=\"custom-control custom-checkbox uni-checkbox\">\r\n                        <input id=\"semAgenda\" name=\"semAgenda\" [ngModel]=\"filtro.semAgenda==='S'\"\r\n                            (ngModelChange)=\"filtro.semAgenda=$event?'S':'N'\"\r\n                            class=\"custom-control-input checkbox-success\" type=\"checkbox\">\r\n                        <label class=\"custom-control-label\" for=\"semAgenda\">{{'labels.apresentarVeiculosSemAgendamento'\r\n                            | translate}}</label>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n            <div class=\"row\">\r\n                <div class=\"col-lg-2 col-md-4 col-sm-12\">\r\n                    <div class=\"form-group form-group-sm\">\r\n                        <label for=\"placa\">{{'labels.placa' | translate}}</label>\r\n                        <input id=\"placa\" name=\"placa\" [(ngModel)]=\"filtro.cadastroPlacaId\"\r\n                            class=\"form-control form-control-sm\" type=\"text\">\r\n                    </div>\r\n                </div>\r\n            </div>\r\n            <div class=\"row mb-3 bt-2\">\r\n                <div class=\"col-12\">\r\n                    <button class=\"btn btn-success mr-1\" type=\"submit\">{{\r\n                        'buttons.pesquisar' | translate }}\r\n                    </button>\r\n                </div>\r\n            </div>\r\n        </form>\r\n    </ng-container>\r\n    <div *ngIf=\"!showFiltro\">\r\n        <div class=\"row mb-3 bt-2\">\r\n            <div class=\"col-12\">\r\n                <button class=\"btn btn-success mr-1\" (click)=\"onShowFiltro()\">{{ 'buttons.filtrar' | translate }}\r\n                </button>\r\n            </div>\r\n        </div>\r\n        <hr>\r\n        <table id=\"dtChegada\" class=\"table table-striped table-bordered table-hover nowrap table-sm\"></table>\r\n    </div>\r\n</div>\r\n\r\n\r\n<div class=\"modal\" id=\"confirmacao-chegada-dialog\" tabindex=\"-1\" role=\"dialog\" data-backdrop=\"static\">\r\n    <div class=\"uni-modal-dialog-md-60\">\r\n        <div class=\"modal-content\">\r\n            <div class=\"modal-header\">\r\n                <h6 class=\"modal-title\">{{ 'titles.alteracaoDadosVeiculoAgendamento' | translate }}</h6>\r\n            </div>\r\n            <div class=\"modal-body\">\r\n                <div class=\"row\">\r\n                    <div class=\"col-lg-12\">\r\n                        <form class=\"form\" #formPlanej=\"ngForm\" (ngSubmit)=\"onSubmit()\">\r\n                            <div class=\"row\">\r\n                                <div class=\"col-lg-12\">\r\n                                    <div class=\"form-group form-group-sm\">\r\n                                        <app-pesquisa-destinatario id=\"transportadoraPlanejamento\"\r\n                                            name=\"transportadoraPlanejamento\" tipoDestinatario=\"T\" showInscricao=\"false\"\r\n                                            showCgcCpf=\"false\" label=\"transportadora\"\r\n                                            modalTitle=\"pesquisaTransportadora\" permiteInativos=\"false\"\r\n                                            [(ngModel)]=\"filtroAltDadosPlanej.destinatarioIdTransportadora\"\r\n                                            [inSelected]=\"filtroAltDadosPlanej.transportadora\">\r\n                                        </app-pesquisa-destinatario>\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                            <div class=\"row\">\r\n                                <div class=\"col-lg-9\">\r\n                                    <app-pesquisa-motorista id=\"motoristaPlanejamento\" name=\"motoristaPlanejamento\"\r\n                                        label=\"motorista\" modalTitle=\"pesquisaMotorista\" showCpf=\"false\"\r\n                                        [(ngModel)]=\"filtroAltDadosPlanej.motoristaId\" (outMotorista)=\"trataMotorista()\"\r\n                                        [inputMotorista]=\"filtroAltDadosPlanej.motorista\" required=\"true\">\r\n                                    </app-pesquisa-motorista>\r\n                                </div>\r\n                            </div>\r\n                            <div class=\"row\">\r\n                                <div class=\"col-lg-12\">\r\n                                    <div class=\"form-group form-group-sm\">\r\n                                        <app-pesquisa-destinatario id=\"clienteVenda\" name=\"clienteVenda\"\r\n                                            tipoDestinatario=\"C\" showInscricao=\"true\" showCgcCpf=\"false\"\r\n                                            label=\"clienteVenda\" modalTitle=\"pesquisaDeClienteVenda\"\r\n                                            permiteInativos=\"false\"\r\n                                            [(ngModel)]=\"filtroAltDadosPlanej.destinatarioIdClienteVenda\"\r\n                                            [inSelected]=\"filtroAltDadosPlanej.clienteVenda\">\r\n                                        </app-pesquisa-destinatario>\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                            <div class=\"row\">\r\n                                <div class=\"col-lg-6\">\r\n                                    <div class=\"form-group form-group-sm\">\r\n                                        <label for=\"municipio\">{{'labels.municipio' | translate}}</label>\r\n                                        <input id=\"municipio\" name=\"municipio\" maxlength=\"9\"\r\n                                            [(ngModel)]=\"filtroAltDadosPlanej.municipio\" disabled=\"true\"\r\n                                            class=\"form-control form-control-sm\" type=\"text\">\r\n                                    </div>\r\n                                </div>\r\n                                <div class=\"col-lg-6\">\r\n                                    <div class=\"form-group form-group-sm\">\r\n                                        <label for=\"estado\">{{'labels.estado' | translate}}</label>\r\n                                        <input id=\"estado\" name=\"estado\" maxlength=\"9\"\r\n                                            [(ngModel)]=\"filtroAltDadosPlanej.estado\" disabled=\"true\"\r\n                                            class=\"form-control form-control-sm\" type=\"text\">\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                            <div class=\"row\">\r\n                                <div class=\"col-lg-6\">\r\n                                    <div class=\"form-group form-group-sm\">\r\n                                        <label for=\"fantasia\">{{'labels.nomeMotorista' | translate}}</label>\r\n                                        <input id=\"fantasia\" name=\"fantasia\" maxlength=\"9\"\r\n                                            [(ngModel)]=\"filtroAltDadosPlanej.fantasia\" disabled=\"true\"\r\n                                            class=\"form-control form-control-sm\" type=\"text\">\r\n                                    </div>\r\n                                </div>\r\n                                <div class=\"col-lg-6\">\r\n                                    <div class=\"form-group form-group-sm\">\r\n                                        <label for=\"rg\">{{'labels.rg' | translate}}</label>\r\n                                        <input id=\"rg\" name=\"rg\" maxlength=\"9\" [(ngModel)]=\"filtroAltDadosPlanej.rg\"\r\n                                            disabled=\"true\" class=\"form-control form-control-sm\" type=\"text\">\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                            <div class=\"row\">\r\n                                <div class=\"col-lg-6\">\r\n                                    <div class=\"form-group form-group-sm\">\r\n                                        <label for=\"cnh\">{{'labels.cnh' | translate}}</label>\r\n                                        <input id=\"cnh\" name=\"cnh\" maxlength=\"9\" [(ngModel)]=\"filtroAltDadosPlanej.cnh\"\r\n                                            disabled=\"true\" class=\"form-control form-control-sm\" type=\"text\">\r\n                                    </div>\r\n                                </div>\r\n                                <div class=\"col-lg-6\">\r\n                                    <div class=\"form-group form-group-sm\">\r\n                                        <label for=\"cnhValidade\">{{'labels.cnhValidade' | translate}}</label>\r\n                                        <input id=\"cnhValidade\" type=\"text\" name=\"motoristaCnhValidade\"\r\n                                            class=\"form-control form-control-sm\"\r\n                                            value=\"{{filtroAltDadosPlanej.cnhValidade | date:'dd/MM/yyyy'}}\"\r\n                                            disabled=\"true\">\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                            <div class=\"row\">\r\n                                <div class=\"col-lg-6\">\r\n                                    <div class=\"form-group form-group-sm\">\r\n                                        <label for=\"cpf\">{{'labels.cpf' | translate}}</label>\r\n                                        <input id=\"cpf\" name=\"cpf\" maxlength=\"9\"\r\n                                            value=\"{{filtroAltDadosPlanej.cgcCpf | mask: '999.999.999-99'}}\"\r\n                                            disabled=\"true\" class=\"form-control form-control-sm\" type=\"text\">\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                            <div class=\"clearfix\">&nbsp;</div>\r\n                            <div class=\"modal-footer\">\r\n                                <button type=\"submit\" class=\"btn btn-success mr-1\"\r\n                                    (click)=\"confirmaAltDadosPlanejamento()\"\r\n                                    [disabled]=\"formPlanej.invalid || !filtroAltDadosPlanej.entradaVeiculoId ||  filtroAltDadosPlanej.entradaVeiculoId === 0\">\r\n                                    {{ 'buttons.confirmar' | translate }}\r\n                                </button>\r\n                                <button type=\"button\" class=\"btn btn-default mr-1\" data-dismiss=\"modal\">{{\r\n                                    'buttons.cancelar' | translate}}\r\n                                </button>\r\n                            </div>\r\n                        </form>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n</div>");

/***/ }),

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/raizen/movimentos/portaria/portaria-index/portaria-index.component.html":
/*!*************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/raizen/movimentos/portaria/portaria-index/portaria-index.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 [botoesComando]=\"constantes.listaIndex\" [sisFormularioId]=\"constantes.sisFormularioId\"\r\n    [formAction]=\"actionForm\" [itemData]=\"service.data.entradaVeiculoId\">\r\n</app-menu-command-bar>\r\n\r\n<div class=\"col-lg-12 col-12 section-comand-bar\">\r\n    <div class=\"clearfix\">\r\n        <ul class=\"nav nav-tabs\">\r\n            <li class=\"nav-item\">\r\n                <a class=\"nav-link active\" data-toggle=\"tab\" href=\"#tDados\">{{\"labels.dados\" | translate }}</a>\r\n            </li>\r\n            <li class=\"nav-item\">\r\n                <a class=\"nav-link\" data-toggle=\"tab\" href=\"#tItens\">{{\"labels.itens\" | translate }}</a>\r\n            </li>\r\n            <li *ngIf=\"service.showNotas\" class=\"nav-item\">\r\n                <a class=\"nav-link\" data-toggle=\"tab\" href=\"#tNotas\">{{\"labels.notas\" | translate }}</a>\r\n            </li>\r\n        </ul>\r\n    </div>\r\n    <div class=\"tab-content top\">\r\n        <div class=\"tab-pane active\" id=\"tDados\">\r\n            <app-form-legenda></app-form-legenda>\r\n\r\n            <form class=\"form\" #f=\"ngForm\" (ngSubmit)=\"onSubmit(f)\">\r\n                <app-validacoes></app-validacoes>\r\n                <div class=\"row\">\r\n                    <div class=\"col-lg-4 col-md-4 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"tipoOperacao\" class=\"required\">{{ \"labels.operacao\" | translate\r\n                                }}</label>\r\n                            <select class=\"form-control form-control-sm\" id=\"tipoOperacao\" name=\"tipoOperacao\"\r\n                                [(ngModel)]=\"service.data.tipoOperacaoVeiculoId\" required disabled>\r\n                                <option *ngFor=\"let item of tipoOperacaoVeiculos\"\r\n                                    value=\"{{ item.tipoOperacaoVeiculoId }}\">\r\n                                    {{ item.descricao }}</option>\r\n                            </select>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"row\">\r\n                    <div class=\"col-lg-6 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <app-pesquisa-destinatario id=\"destinatarioIdCliente\" name=\"destinatarioIdCliente\"\r\n                                label=\"cliente\" modalTitle=\"pesquisaDeCliente\" required=\"true\" showInscricao=\"false\"\r\n                                showCgcCpf=\"false\" [(ngModel)]=\"service.data.destinatarioIdCliente\"\r\n                                [inSelected]=\"service.data.cliente\" disabled>\r\n                            </app-pesquisa-destinatario>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"row\">\r\n                    <div class=\"col-lg-6 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <app-pesquisa-destinatario id=\"destinatarioIdTransportadora\"\r\n                                name=\"destinatarioIdTransportadora\" label=\"transportadora\"\r\n                                modalTitle=\"pesquisaTransportadora\" required=\"true\" showInscricao=\"false\"\r\n                                showCgcCpf=\"false\" [(ngModel)]=\"service.data.destinatarioIdTransportadora\"\r\n                                [inSelected]=\"service.data.transportadora\" tipoDestinatario=\"T\" permiteInativos=\"false\"\r\n                                disabled>\r\n                            </app-pesquisa-destinatario>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"row\">\r\n                    <div class=\"col-lg-6 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label class=\"required\" for=\"tipoVeiculotipoVeiculoId\">{{'labels.tipoVeiculo' |\r\n                                translate}}</label>\r\n                            <select id=\"tipoVeiculo\" name=\"tipoVeiculo\" class=\"form-control form-control-sm\"\r\n                                [(ngModel)]=\"service.data.tipoVeiculoId\" required=\"true\" (change)=\"trataTipoVeiculo()\"\r\n                                disabled>\r\n                                <option value=\"\">{{ \"labels.selecione\" | translate }}</option>\r\n                                <option *ngFor=\"let t of tiposVeiculos\" value=\"{{ t.tipoVeiculoId }}\">\r\n                                    {{ t.descrTipoVeiculo }}\r\n                                </option>\r\n                            </select>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"row\">\r\n                    <div class=\"col-lg-6 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <app-pesquisa-motorista id=\"motorista\" name=\"motorista\" label=\"motorista\"\r\n                                modalTitle=\"pesquisaMotorista\" [(ngModel)]=\"service.data.motoristaId\"\r\n                                (outMotorista)=\"trataMotorista($event)\" [inputMotorista]=\"service.data.motorista\"\r\n                                required=\"true\" disabled>\r\n                            </app-pesquisa-motorista>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"row\">\r\n                    <div class=\"col-lg-2 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label class=\"required\" for=\"cadastroPlacaIdCavalo\">{{ \"labels.placa\" | translate }}</label>\r\n                            <input type=\"text\" id=\"cadastroPlacaIdCavalo\" name=\"cadastroPlacaIdCavalo\"\r\n                                class=\"form-control form-control-sm uppercase\" required\r\n                                [(ngModel)]=\"service.data.cadastroPlacaIdCavalo\" [mask]=\"mascaraPlaca\" disabled>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-2 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label [class.required]=\"isRequiredPlacaCarreta1\" for=\"cadastroPlacaIdCarreta1\">\r\n                                {{'labels.placaCarreta1' |\r\n                                translate}}</label>\r\n                            <input type=\"text\" [maxlength]=\"maxLengthPlaca\" id=\"cadastroPlacaIdCarreta1\"\r\n                                name=\"cadastroPlacaIdCarreta1\" class=\"form-control form-control-sm uppercase\"\r\n                                [(ngModel)]=\"service.data.cadastroPlacaIdCarreta1\" [mask]=\"mascaraPlaca\"\r\n                                [disabled]=\"isDisabledPlacaCarreta1\" [required]=\"isRequiredPlacaCarreta1\" disabled>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-2 col-md-6 col-sm-12\" *ngIf=\"!this.service.isFerroviario\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label [class.required]=\"isRequiredPlacaCarreta2\" for=\"cadastroPlacaIdCarreta2\">\r\n                                {{'labels.placaCarreta2' |\r\n                                translate}}</label>\r\n                            <input type=\"text\" [maxlength]=\"maxLengthPlaca\" id=\"cadastroPlacaIdCarreta2\"\r\n                                name=\"cadastroPlacaIdCarreta2\" class=\"form-control form-control-sm uppercase\"\r\n                                [(ngModel)]=\"service.data.cadastroPlacaIdCarreta2\" [disabled]=\"isDisabledPlacaCarreta2\"\r\n                                [required]=\"isRequiredPlacaCarreta2\" [mask]=\"mascaraPlaca\" disabled>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-2 col-md-6 col-sm-12\" *ngIf=\"!this.service.isFerroviario\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label [class.required]=\"isRequiredPlacaCarreta3\" for=\"cadastroPlacaIdCarreta3\">\r\n                                {{'labels.placaCarreta3' |\r\n                                translate}}</label>\r\n                            <input type=\"text\" [maxlength]=\"maxLengthPlaca\" id=\"cadastroPlacaIdCarreta3\"\r\n                                name=\"cadastroPlacaIdCarreta3\" class=\"form-control form-control-sm uppercase\"\r\n                                [(ngModel)]=\"service.data.cadastroPlacaIdCarreta3\" [disabled]=\"isDisabledPlacaCarreta3\"\r\n                                [required]=\"isRequiredPlacaCarreta3\" [mask]=\"mascaraPlaca\" disabled>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-2 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"estadoIdCavalo\" [class.required]=\"service.configs.obrigaCadPlaca\">{{\r\n                                \"labels.estado\" | translate\r\n                                }}</label>\r\n                            <select class=\"form-control form-control-sm\" id=\"estadoIdCavalo\" name=\"estadoIdCavalo\"\r\n                                [(ngModel)]=\"service.data.estadoIdCavalo\" [disabled]=\"disabledEstado\"\r\n                                [required]=\"service.configs.obrigaCadPlaca\" disabled>\r\n                                <option value=\"\">{{ 'labels.selecione' | translate }}</option>\r\n                                <option *ngFor=\"let item of estados\" value=\"{{ item.estadoId }}\">{{ item.estadoId\r\n                                    }}</option>\r\n                            </select>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"row\">\r\n                    <div class=\"col-lg-4\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"dtChegada\" class=\"required\">{{'labels.dtChegada' | translate}}</label>\r\n                            <app-data-h-m id=\"dtChegada\" name=\"dtChegada\" [(ngModel)]=\"service.data.dtChegada\"\r\n                                [disabled]=\"disabledDtChegada\" (executa)=\"validaDtChegada()\" required>\r\n                            </app-data-h-m>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"row mt-2\">\r\n                    <div class=\"col-12\">\r\n                        <div class=\"form-group\">\r\n                            <button class=\"btn btn-success mr-2\" type=\"submit\"\r\n                                [disabled]=\"funcoesService.isDetail(actionForm) || service.data.regTmp === 0\">\r\n                                {{ 'buttons.salvar' | translate }}\r\n                            </button>\r\n                            <button class=\"btn btn-danger\" (click)=\"cancelar()\" type=\"button\"\r\n                                [disabled]=\"!(service?.data?.entradaVeiculoId)\"\r\n                                [disabled]=\"funcoesService.isDetail(actionForm)\">{{ 'buttons.cancelar' | translate\r\n                                }}</button>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n            </form>\r\n        </div>\r\n        <div class=\"tab-pane\" id=\"tItens\">\r\n            <app-portaria-item id=\"portariaItens\" name=\"portariaItens\" [isDetail]=\"funcoes.isDetail(actionForm)\"\r\n                (dataResult)=\"outItem($event)\">\r\n            </app-portaria-item>\r\n        </div>\r\n\r\n        <div class=\"tab-pane\" id=\"tNotas\">\r\n            <app-portaria-notas id=\"portariaNotas\" name=\"portariaNotas\">\r\n            </app-portaria-notas>\r\n        </div>\r\n    </div>\r\n</div>\r\n\r\n<app-liberar-acesso-supervisor></app-liberar-acesso-supervisor>\r\n<app-permissoes-rotina [constantes]=\"constantes\"></app-permissoes-rotina>\r\n<app-propriedades></app-propriedades>");

/***/ }),

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/raizen/movimentos/portaria/portaria-item/portaria-item.component.html":
/*!***********************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/raizen/movimentos/portaria/portaria-item/portaria-item.component.html ***!
  \***********************************************************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("<div class=\"row\">\r\n    <div class=\"col-md-12 col-lg-12\">\r\n        <!-- <button title=\"{{ 'buttons.novo' | translate }}\" class=\"btn uni-btn btn-sm\" (click)=\"new()\"\r\n            [disabled]=\"isDetail\" *ngIf=\"showTable\">\r\n            <i class=\"icon-plus\"></i>\r\n        </button> -->\r\n        <button title=\"{{ 'buttons.voltar' | translate }}\" (click)=\"back()\" type=\"button\" class=\"btn uni-btn btn-sm\"\r\n            *ngIf=\"!showTable\">\r\n            <i class=\"icon-arrow-left\"></i>\r\n        </button>\r\n        <button title=\"{{ 'buttons.visualizar' | translate }}\" (click)=\"show()\" class=\"btn uni-btn btn-sm\"\r\n            [disabled]=\"!service.dataItem?.entradaVeiculoItemId\" *ngIf=\"showTable\">\r\n            <i class=\"icon-eye\"></i>\r\n        </button>\r\n        <!-- <button title=\"{{ 'buttons.editar' | translate }}\" class=\"btn uni-btn btn-sm\" (click)=\"edit()\"\r\n            [disabled]=\"isDetail || (!showTable && !detail) || !service.dataItem?.entradaVeiculoItemId\">\r\n            <i class=\"icon-pencil\"></i>\r\n        </button>\r\n        <button title=\"{{ 'buttons.excluir' | translate }}\" class=\"btn uni-btn btn-sm\" (click)=\"remove()\"\r\n            [disabled]=\"isDetail || !service.dataItem?.entradaVeiculoItemId\" *ngIf=\"showTable\">\r\n            <i class=\"icon-close\"></i>\r\n        </button> -->\r\n    </div>\r\n</div>\r\n\r\n<ng-container *ngIf=\"showTable\">\r\n    <div class=\"row\">\r\n        <div class=\"col-md-12 col-lg-12\">\r\n            <table class=\"table table-striped table-hover\">\r\n                <thead>\r\n                    <tr>\r\n                        <th class=\"text-center\">{{ 'labels.item' | translate }}</th>\r\n                        <th class=\"text-center\">{{ 'labels.codigo' | translate }}</th>\r\n                        <th class=\"text-center\">{{ 'labels.cliente' | translate }}</th>\r\n                        <th class=\"text-center\">{{ 'labels.produto' | translate }}</th>\r\n                        <th class=\"text-center\">{{ 'labels.descricao' | translate }}</th>\r\n                        <th class=\"text-center\">{{ 'labels.volume' | translate }}</th>\r\n                    </tr>\r\n                </thead>\r\n                <tbody>\r\n                    <tr *ngFor=\"let c of service.data.entradaVeiculoItems | removeExcluidos; let i = index\"\r\n                        (click)=\"selected(c, i)\"\r\n                        [ngClass]=\"{ 'info': i === _index && service.dataItem.sequencia === c.sequencia }\">\r\n                        <td class=\"text-center\">{{c.entradaVeiculoItemId}}</td>\r\n                        <td class=\"text-center\">{{c.destinatarioIdEmitente}}</td>\r\n                        <td class=\"text-center\">{{c.emitente.fantasia}}</td>\r\n                        <td class=\"text-center\">{{c.materialId}}</td>\r\n                        <td class=\"text-center\">{{c.material.fantasia}}</td>\r\n                        <td class=\"text-center\">{{c.litros}}</td>\r\n                    </tr>\r\n                    <tr *ngIf=\"!hasDados\">\r\n                        <th colspan=\"6\">\r\n                            {{'messages.nenhumRegistroEncontrado' | translate }}\r\n                        </th>\r\n                    </tr>\r\n                </tbody>\r\n            </table>\r\n        </div>\r\n    </div>\r\n</ng-container>\r\n\r\n<ng-container *ngIf=\"!showTable\">\r\n    <form class=\"form\" #formPortariaItem=\"ngForm\" (ngSubmit)=\"onSubmit(formPortariaItem)\">\r\n        <div class=\"row\">\r\n            <div class=\"col-lg-12\">\r\n                <app-validacoes></app-validacoes>\r\n                <div class=\"row\">\r\n                    <div class=\"col-lg-6 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <app-pesquisa-material id=\"materialId\" name=\"materialId\"\r\n                                [(ngModel)]=\"service.dataItem.materialId\" modalTitle=\"pesquisaDeProduto\"\r\n                                [disabled]=\"isDetail || detail\" [inSelected]=\"service.dataItem.material\" required=\"true\"\r\n                                (outModel)=\"trataMaterial($event)\" label=\"produto\">\r\n                            </app-pesquisa-material>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"row\">\r\n                    <div class=\"col-lg-3 col-md-3 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"litros\" class=\"required\">{{'labels.litros' | translate}}</label>\r\n                            <input id=\"litros\" name=\"litros\" [(ngModel)]=\"service.dataItem.litros\"\r\n                                class=\"form-control form-control-sm\" type=\"text\" currencyMask maxlength=\"11\"\r\n                                required=\"true\" [disabled]=\"isDetail || detail\"\r\n                                [options]=\"funcoesService.numberUtils.formatCurrency(0)\">\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"row\">\r\n                    <div class=\"col-lg-6 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <app-pesquisa-destinatario id=\"clienteEmitente\" name=\"clienteEmitente\" tipoDestinatario=\"C\"\r\n                                showInscricao=\"false\" showCgcCpf=\"false\" label=\"cliente\" modalTitle=\"pesquisaDeCliente\"\r\n                                permiteInativos=\"false\" [(ngModel)]=\"service.dataItem.destinatarioIdEmitente\"\r\n                                [inSelected]=\"service.dataItem.emitente\" (outModel)=\"trataCliente($event)\"\r\n                                [disabled]=\"disabledCliente\" required=\"true\">\r\n                            </app-pesquisa-destinatario>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"row\">\r\n                    <div class=\"col-lg-6 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <app-pesquisa-destinatario id=\"clienteVenda\" name=\"clienteVenda\" tipoDestinatario=\"C\"\r\n                                showInscricao=\"false\" showCgcCpf=\"false\" label=\"clienteVenda\"\r\n                                modalTitle=\"pesquisaDeClienteVenda\" permiteInativos=\"false\"\r\n                                [(ngModel)]=\"service.dataItem.destinatarioIdClienteVenda\"\r\n                                [inSelected]=\"service.dataItem.clienteVenda\" (outModel)=\"trataClienteVenda($event)\"\r\n                                [disabled]=\"isDetail || detail\" required=\"true\">\r\n                            </app-pesquisa-destinatario>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"row mt-2\">\r\n                    <div class=\"col-lg-12\">\r\n                        <div class=\"form-group\">\r\n                            <button class=\"btn btn-success\" type=\"submit\" [disabled]=\"isDetail || detail\">\r\n                                {{ 'buttons.salvar' | translate }}\r\n                            </button>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </form>\r\n</ng-container>");

/***/ }),

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/raizen/movimentos/portaria/portaria-notas/portaria-notas.component.html":
/*!*************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/raizen/movimentos/portaria/portaria-notas/portaria-notas.component.html ***!
  \*************************************************************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("<div class=\"row\">\r\n    <div class=\"col-md-12 col-lg-12\">\r\n        <!-- <button title=\"{{ 'buttons.novo' | translate }}\" class=\"btn uni-btn btn-sm\" (click)=\"new()\"\r\n            [disabled]=\"isDetail\" *ngIf=\"showTable\">\r\n            <i class=\"icon-plus\"></i>\r\n        </button> -->\r\n        <button title=\"{{ 'buttons.voltar' | translate }}\" (click)=\"back()\" type=\"button\" class=\"btn uni-btn btn-sm\"\r\n            *ngIf=\"!showTable\">\r\n            <i class=\"icon-arrow-left\"></i>\r\n        </button>\r\n        <button title=\"{{ 'buttons.visualizar' | translate }}\" (click)=\"show()\" class=\"btn uni-btn btn-sm\"\r\n            [disabled]=\"!service.dataNotas?.itemNotaId\" *ngIf=\"showTable\">\r\n            <i class=\"icon-eye\"></i>\r\n        </button>\r\n        <!-- <button title=\"{{ 'buttons.editar' | translate }}\" class=\"btn uni-btn btn-sm\" (click)=\"edit()\"\r\n            [disabled]=\"isDetail || (!showTable && !detail) || !service.dataNotas?.itemNotaId || naoPermiteAlterar\" *ngIf=\"!naoPermiteAlterar\">\r\n            <i class=\"icon-pencil\"></i>\r\n        </button>\r\n        <button title=\"{{ 'buttons.excluir' | translate }}\" class=\"btn uni-btn btn-sm\" (click)=\"remove()\"\r\n            [disabled]=\"isDetail || !service.dataNotas?.itemNotaId\" *ngIf=\"showTable && !naoPermiteAlterar\">\r\n            <i class=\"icon-close\"></i>\r\n        </button> -->\r\n    </div>\r\n</div>\r\n\r\n<ng-container *ngIf=\"showTable\">\r\n    <div class=\"row\">\r\n        <div class=\"col-md-12 col-lg-12\">\r\n            <table class=\"table table-striped table-hover\">\r\n                <thead>\r\n                    <tr>\r\n                        <th class=\"text-center\">{{ 'labels.item' | translate }}</th>\r\n                        <th class=\"text-center\">{{ 'labels.documento' | translate }}</th>\r\n                        <th class=\"text-center\">{{ 'labels.serie' | translate }}</th>\r\n                        <th class=\"text-center\">{{ 'labels.quantidDoc' | translate }}</th>\r\n                        <th class=\"text-center\">{{ 'labels.data' | translate }}</th>\r\n                        <th class=\"text-center\">{{ 'labels.valorUnitario' | translate }}</th>\r\n                        <th class=\"text-center\">{{ 'labels.valorNF' | translate }}</th>\r\n                        <th class=\"text-center\">{{ 'labels.chaveNFE' | translate }}</th>\r\n                    </tr>\r\n                </thead>\r\n                <tbody>\r\n                    <tr *ngFor=\"let c of service.data.entradaVeiculoNotas | removeExcluidos; let i = index\"\r\n                        (click)=\"selected(c, i)\"\r\n                        [ngClass]=\"{ 'info': i === _index && service.dataNotas.sequencia === c.sequencia }\">\r\n                        <td class=\"text-center\">{{c.itemNotaId}}</td>\r\n                        <td class=\"text-center\">{{c.numeroNFE}}</td>\r\n                        <td class=\"text-center\">{{c.serieNFE}}</td>\r\n                        <td class=\"text-center\">{{c.quantidade}}</td>\r\n                        <td class=\"text-center\">{{c.dtEmissaoNFE | date:'dd/MM/yyyy' }}</td>\r\n                        <td class=\"text-center\">{{c.valorUnitario| formatCurrency: 2}}</td>\r\n                        <td class=\"text-center\">{{c.valorItem | formatCurrency: 2}}</td>\r\n                        <td class=\"text-center\">{{c.chaveNFE}}</td>\r\n                    </tr>\r\n                    <tr *ngIf=\"!hasDados\">\r\n                        <th colspan=\"8\">\r\n                            {{'messages.nenhumRegistroEncontrado' | translate }}\r\n                        </th>\r\n                    </tr>\r\n                </tbody>\r\n            </table>\r\n        </div>\r\n    </div>\r\n</ng-container>\r\n\r\n<ng-container *ngIf=\"!showTable\">\r\n    <form class=\"form\" #formPortariaItem=\"ngForm\" (ngSubmit)=\"onSubmit(formPortariaItem)\">\r\n        <div class=\"row\">\r\n            <div class=\"col-lg-12\">\r\n                <app-validacoes></app-validacoes>\r\n                <div class=\"row\">\r\n                    <div class=\"col-md-6\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"chaveNFE\" class=\"required\">\r\n                                {{'labels.chaveNFE' | translate}}\r\n                            </label>\r\n                            <div class=\"input-group\">\r\n                                <input id=\"chaveNFE\" name=\"chaveNFE\" type=\"text\" class=\"form-control form-control-sm\"\r\n                                    [(ngModel)]=\"service.dataNotas.chaveNFE\" required=\"true\"\r\n                                    [disabled]=\"isDetail || detail\"\r\n                                    data-title=\"{{'labels.chaveNFE' | translate}}\" maxlength=\"54\"\r\n                                    mask=\"0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000\">\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n\r\n                <div class=\"row\">\r\n                    <div class=\"col-md-4\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"documento\" class=\"required\">{{'labels.documento' |\r\n                                translate}}</label>\r\n                            <input id=\"documento\" name=\"documento\" [(ngModel)]=\"service.dataNotas.numeroNFE\"\r\n                                [disabled]=\"isDetail || detail || naoPermiteAlterar\"\r\n                                currencyMask [options]=\"funcoesService.optionCurrency(0)\" maxlength=\"11\"\r\n                                class=\"form-control form-control-sm\" required=\"true\" type=\"text\">\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-md-4\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label class=\"required\">\r\n                                {{'labels.serie' | translate}}\r\n                            </label>\r\n                            <app-combo-serie-nota id=\"serie\" name=\"serie\" flagAtivo=\"S\"\r\n                                [disabled]=\"isDetail || detail || naoPermiteAlterar\"\r\n                                [(ngModel)]=\"service.dataNotas.serieNFE\" required=\"true\">\r\n                            </app-combo-serie-nota>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-md-4\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"data\" class=\"required\">{{'labels.data' |\r\n                                translate}}</label>\r\n                            <app-data id=\"data\" name=\"data\" [(ngModel)]=\"service.dataNotas.dtEmissaoNFE\"\r\n                                [disabled]=\"isDetail || detail || naoPermiteAlterar\"\r\n                                data-title=\"{{'labels.data' | translate}}\" required=\"true\">\r\n                            </app-data>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n\r\n                <div class=\"row\">\r\n                    <div class=\"col-md-4\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"quantidDoc\" class=\"required\">{{'labels.quantidDoc' |\r\n                                translate}}</label>\r\n                            <input id=\"quantidDoc\" name=\"quantidDoc\" [(ngModel)]=\"service.dataNotas.quantidade\"\r\n                                [disabled]=\"isDetail || detail || naoPermiteAlterar\"\r\n                                maxlength=\"15\" class=\"form-control form-control-sm\" type=\"text\" required=\"true\"\r\n                                currencyMask [options]=\"funcoesService.optionCurrency(0)\">\r\n                        </div>\r\n                    </div>\r\n\r\n                    <div class=\"col-md-4\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"valorUnitario\" class=\"required\">{{'labels.valorUnitario' |\r\n                                translate}}</label>\r\n                            <input id=\"valorUnitario\" name=\"valorUnitario\" [(ngModel)]=\"service.dataNotas.valorUnitario\"\r\n                                [disabled]=\"isDetail || detail || naoPermiteAlterar\"\r\n                                maxlength=\"25\" class=\"form-control form-control-sm\" type=\"text\" required=\"true\"\r\n                                currencyMask [options]=\"funcoesService.optionCurrency(9)\">\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-md-4\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"valorNF\" class=\"required\">{{'labels.valorNF' | translate}}</label>\r\n                            <input id=\"valorNF\" name=\"valorNF\" [(ngModel)]=\"service.dataNotas.valorItem\" maxlength=\"18\"\r\n                                [disabled]=\"isDetail || detail || naoPermiteAlterar\"\r\n                                class=\"form-control form-control-sm\" type=\"text\" required=\"true\" currencyMask\r\n                                [options]=\"funcoesService.optionCurrency(2)\">\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div *ngIf=\"!naoPermiteAlterar\" class=\"row mt-2\">\r\n                    <div class=\"col-lg-12\">\r\n                        <div class=\"form-group\">\r\n                            <button class=\"btn btn-success\" type=\"submit\" [disabled]=\"isDetail || detail\">\r\n                                {{ 'buttons.salvar' | translate }}\r\n                            </button>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </form>\r\n</ng-container>\r\n");

/***/ }),

/***/ "./src/app/pages/especificos/raizen/movimentos/portaria/portaria-confirmacao-chegada/portaria-confirmacao-chegada.component.ts":
/*!*************************************************************************************************************************************!*\
  !*** ./src/app/pages/especificos/raizen/movimentos/portaria/portaria-confirmacao-chegada/portaria-confirmacao-chegada.component.ts ***!
  \*************************************************************************************************************************************/
/*! exports provided: PortariaConfirmacaoChegadaComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PortariaConfirmacaoChegadaComponent", function() { return PortariaConfirmacaoChegadaComponent; });
/* 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 app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! app/shared/services/funcoes/array-utils/array-utils.static.service */ "./src/app/shared/services/funcoes/array-utils/array-utils.static.service.ts");
/* harmony import */ var app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_3__ = __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_components_corporate_base_base_permissoes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! app/shared/components/corporate/base/base.permissoes */ "./src/app/shared/components/corporate/base/base.permissoes.ts");
/* harmony import */ var app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_5__ = __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_funcoes_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! app/shared/services/funcoes/funcoes.service */ "./src/app/shared/services/funcoes/funcoes.service.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 app_shared_services_datatables_datatables_service__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! app/shared/services/datatables/datatables.service */ "./src/app/shared/services/datatables/datatables.service.ts");
/* harmony import */ var app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! app/shared/services/funcoes/string-utils/string-utils.static.service */ "./src/app/shared/services/funcoes/string-utils/string-utils.static.service.ts");
/* harmony import */ var _portaria_confirmacao_chegada_model__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./portaria-confirmacao-chegada.model */ "./src/app/pages/especificos/raizen/movimentos/portaria/portaria-confirmacao-chegada/portaria-confirmacao-chegada.model.ts");
/* harmony import */ var _portaria_confirmacao_chegada_service__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./portaria-confirmacao-chegada.service */ "./src/app/pages/especificos/raizen/movimentos/portaria/portaria-confirmacao-chegada/portaria-confirmacao-chegada.service.ts");
/* harmony import */ var app_pages_cadastro_motorista_motorista_service__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! app/pages/cadastro/motorista/motorista.service */ "./src/app/pages/cadastro/motorista/motorista.service.ts");
/* harmony import */ var app_pages_cadastro_destinatario_destinatario_service__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! app/pages/cadastro/destinatario/destinatario.service */ "./src/app/pages/cadastro/destinatario/destinatario.service.ts");
/* harmony import */ var app_pages_veiculo_entrada_veiculo_entrada_veiculo_service__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! app/pages/veiculo/entrada-veiculo/entrada-veiculo.service */ "./src/app/pages/veiculo/entrada-veiculo/entrada-veiculo.service.ts");
/* harmony import */ var app_pages_cadastro_motorista_motorista_model__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! app/pages/cadastro/motorista/motorista.model */ "./src/app/pages/cadastro/motorista/motorista.model.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 _portaria_constants__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../portaria.constants */ "./src/app/pages/especificos/raizen/movimentos/portaria/portaria.constants.ts");
/* harmony import */ var app_config_enumerables__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! app/config/enumerables */ "./src/app/config/enumerables.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 __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
    function verb(n) { return function (v) { return step([n, v]); }; }
    function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (_) try {
            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
            if (y = 0, t) op = [op[0] & 2, t.value];
            switch (op[0]) {
                case 0: case 1: t = op; break;
                case 4: _.label++; return { value: op[1], done: false };
                case 5: _.label++; y = op[1]; op = [0]; continue;
                case 7: op = _.ops.pop(); _.trys.pop(); continue;
                default:
                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                    if (t[2]) _.ops.pop();
                    _.trys.pop(); continue;
            }
            op = body.call(thisArg, _);
        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
    }
};
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};




















var PortariaConfirmacaoChegadaComponent = /** @class */ (function (_super) {
    __extends(PortariaConfirmacaoChegadaComponent, _super);
    function PortariaConfirmacaoChegadaComponent(router, messages, funcoes, configuracao, permissoesUtils, motoristaService, destinatarioService, service, datatables, entradaVeiculoService) {
        var _this = _super.call(this, new _portaria_constants__WEBPACK_IMPORTED_MODULE_18__["PortariaConstants"], funcoes) || this;
        _this.router = router;
        _this.messages = messages;
        _this.funcoes = funcoes;
        _this.configuracao = configuracao;
        _this.permissoesUtils = permissoesUtils;
        _this.motoristaService = motoristaService;
        _this.destinatarioService = destinatarioService;
        _this.service = service;
        _this.datatables = datatables;
        _this.entradaVeiculoService = entradaVeiculoService;
        _this.data = new _portaria_confirmacao_chegada_model__WEBPACK_IMPORTED_MODULE_11__["ConfirmacaoChegada"]();
        _this.filtro = new _portaria_confirmacao_chegada_model__WEBPACK_IMPORTED_MODULE_11__["ConfirmacaoChegadaFilter"]();
        _this.filtroAltDadosPlanej = new _portaria_confirmacao_chegada_model__WEBPACK_IMPORTED_MODULE_11__["ConfimacaoChegadaAltDadosPlanejamento"]();
        _this.hasDados = false;
        _this.showFiltro = true;
        _this.intOsAtiva = false;
        _this.constantes = new _portaria_constants__WEBPACK_IMPORTED_MODULE_18__["PortariaConstants"]();
        _this.mascara = new app_config_enumerables__WEBPACK_IMPORTED_MODULE_19__["Mascaras"]();
        _this.parametrosConfig = [
            {
                sistema: 'REL', parametros: [
                    'IntOsAtiva'
                ]
            }
        ];
        _this.target = _this.funcoesService.getTargetLocation();
        _this.pageRoute = "/especificos/raizen/movimentos/portaria";
        _this.loadConfig = function () {
            _this.intOsAtiva = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_3__["BooleanUtilsStaticService"].toBoolean(_this.configuracao.lerConfig("REL", "IntOsAtiva"));
        };
        _this.abrirCadMotorista = function () {
            if (!_this.data.motoristaId) {
                _this.funcoesService.openWindow('cadastro/motorista');
            }
            else {
                _this.funcoesService.openWindow("cadastro/motorista/detail/" + _this.data.motoristaId);
            }
        };
        /* ---------------------- Funções Confirmar Chegada ---------------------- */
        _this.confirmaChegada = function () {
            if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_17__["NumberUtilsStaticService"].isNotPositive(_this.data.destinatarioIdTransportadora) && app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_10__["StringUtilsStaticService"].isEmpty(_this.data.cnpjTransp)) {
                _this.messages.confirm("titles.entradaVeiculo", "messages.desejaCadastrarTransportadora", null, function () { return _this.funcoesService.openWindow("cadastro/destinatario"); });
            }
            if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_17__["NumberUtilsStaticService"].isNotPositive(_this.data.motoristaId)) {
                _this.messages.confirm("titles.entradaVeiculo", "messages.desejaCadastrarMotorista", null, function () { return _this.funcoesService.openWindow("cadastro/motorista"); });
            }
            if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_17__["NumberUtilsStaticService"].isNotPositive(_this.data.destinatarioIdCodCliente)) {
                _this.messages.confirm("titles.entradaVeiculo", "messages.desejaCadastrarCliente", null, function () { return _this.funcoesService.openWindow("cadastro/destinatario"); });
            }
            _this.messages.confirm("titles.entradaVeiculo", "messages.confirmaChegada", null, function () { return __awaiter(_this, void 0, void 0, function () {
                var ret, message;
                return __generator(this, function (_a) {
                    switch (_a.label) {
                        case 0: return [4 /*yield*/, this.service.gravaEvConfirmacaoChegada({
                                "regTmp": 0,
                                "regPlaneja": +this.data.webStoPlanejaVeiculoId,
                                "tipoPlaneja": this.data.tipoPlaneja
                            }).toPromise()];
                        case 1:
                            ret = _a.sent();
                            if (ret) {
                                if (ret.validationResult.isValid) {
                                    this.router.navigate(["" + this.target + this.pageRoute + "/create/" + ret.entradaVeiculoId]);
                                    return [2 /*return*/];
                                }
                                message = this.messages.validationResult(ret.validationResult)[0];
                                if (message !== "")
                                    this.messages.warning("titles.entradaVeiculo", message);
                            }
                            return [2 /*return*/];
                    }
                });
            }); });
        };
        router.events.subscribe(function (event) {
            var params = _this.funcoes.formParams.getParams(router, event);
            if (params) {
                _this.actionForm = params.action;
            }
        });
        return _this;
    }
    PortariaConfirmacaoChegadaComponent.prototype.ngOnInit = function () {
        var _this = this;
        this.configuracao.getConfig(this.parametrosConfig, this.loadConfig);
        this.showFiltro = true;
        _super.prototype.addFuncoes.call(this, [
            { action: 'confirmaChegada', func: function () { return _this.confirmaChegada; } },
            { action: 'abrirCadMotorista', func: function () { return _this.abrirCadMotorista; } }
        ]);
    };
    PortariaConfirmacaoChegadaComponent.prototype.onSubmit = function () {
        var _this = this;
        this.service.get(this.filtro).subscribe(function (data) {
            var columns = [
                _this.datatables.getDataString("tipoPlaneja", "tipo"),
                _this.datatables.getDataString("tipoMov", "operacao"),
                _this.datatables.getDataString("modal", "modal"),
                _this.datatables.getDataString("webStoPlanejaVeiculoId", "agendamento"),
                _this.datatables.getDataString("ordemOrigem", "programacao"),
                _this.datatables.getDataString("sequencia", "sequencia"),
                _this.datatables.getDataDateTime("dtEmissao", "dataEmissao", "DD/MM/YYYY HH:mm"),
                _this.datatables.getDataDateTime("dtEmissao", "previsaoChegada", "DD/MM/YYYY HH:mm"),
                _this.datatables.getDataString("cnpjTransp", "cnpjTransportadora"),
                _this.datatables.getDataString("nomeTransp", "nomeTransportadora"),
                _this.datatables.getDataString("cadastroPlacaIdCavalo", "placaCavalo"),
                _this.datatables.getDataString("cadastroPlacaIdCarreta1", "placaCarreta1"),
                _this.datatables.getDataString("cadastroPlacaIdCarreta2", "placaCarreta2"),
                _this.datatables.getDataString("cpfMotorista", "cpfMotorista"),
                _this.datatables.getDataString("nomeMotorista", "nomeMotorista")
            ];
            _this.showFiltro = !app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_2__["ArrayUtilsStaticService"].any(data);
            if (_this.showFiltro)
                return;
            setTimeout(function () {
                _this.datatables.toDataTable({ tableId: "dtChegada", columns: columns, data: data }, function (selected) { return _this.data = selected; }, function (_) { return _this.confirmaChegada(); });
            }, 250);
        });
    };
    PortariaConfirmacaoChegadaComponent.prototype.onShowFiltro = function () {
        this.data = new _portaria_confirmacao_chegada_model__WEBPACK_IMPORTED_MODULE_11__["ConfirmacaoChegada"]();
        this.showFiltro = !this.showFiltro;
    };
    PortariaConfirmacaoChegadaComponent.prototype.back = function () {
        this.router.navigate(["" + this.target + this.pageRoute]);
    };
    PortariaConfirmacaoChegadaComponent.prototype.confirmaAltDadosPlanejamento = function () {
        return __awaiter(this, void 0, void 0, function () {
            var ret3, message, ret4, message;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_17__["NumberUtilsStaticService"].isNotPositive(this.filtroAltDadosPlanej.motoristaId)) {
                            this.messages.warning("titles.entradaVeiculo", "messages.motoristaNaoInformado");
                            return [2 /*return*/];
                        }
                        if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_17__["NumberUtilsStaticService"].isNotPositive(this.filtroAltDadosPlanej.destinatarioIdTransportadora)) {
                            this.messages.warning("titles.entradaVeiculo", "messages.transportadoraNaoInformado");
                            return [2 /*return*/];
                        }
                        return [4 /*yield*/, this.entradaVeiculoService.getVerifSeExisteRestricaoMotoristaPlaca({
                                "regControle": +this.filtroAltDadosPlanej.entradaVeiculoId,
                                "motorista": +this.filtroAltDadosPlanej.motoristaId,
                                "tipoVerif": "M",
                                "placa": this.filtroAltDadosPlanej.cadastroPlacaIdCavalo
                            }).toPromise()];
                    case 1:
                        ret3 = _a.sent();
                        if (!!ret3 && !ret3.isValid) {
                            message = ret3.erros[0];
                            if (!!message) {
                                this.messages.warning("titles.entradaVeiculo", message);
                                return [2 /*return*/];
                            }
                        }
                        return [4 /*yield*/, this.service.alteraPlanejamentoConfirmacaoChegadaEV({
                                "regControle": +this.filtroAltDadosPlanej.entradaVeiculoId,
                                "placa": this.filtroAltDadosPlanej.cadastroPlacaIdCavalo,
                                "RegPlaneja": +this.filtroAltDadosPlanej.regPlaneja,
                                "Motorista": +this.filtroAltDadosPlanej.motoristaId,
                                "Transportadora": +this.filtroAltDadosPlanej.destinatarioIdTransportadora,
                                "CodDest": +this.filtroAltDadosPlanej.destinatarioIdClienteVenda,
                                "CgcCpf": this.filtroAltDadosPlanej.cgcCpf,
                                "Fantasia": this.filtroAltDadosPlanej.fantasia,
                                "Municipio": this.filtroAltDadosPlanej.municipio,
                                "Estado": this.filtroAltDadosPlanej.estado,
                                "Operador": "",
                                "RegLog": 0,
                                "GravaValidade": (this.filtroAltDadosPlanej.motorista.cnhValidade !== this.filtroAltDadosPlanej.cnhValidadeAnt ? "S" : "N"),
                                "CNHValidade": this.filtroAltDadosPlanej.cnhValidade
                            }).toPromise()];
                    case 2:
                        ret4 = _a.sent();
                        if (!!ret4 && !ret4.isValid) {
                            message = ret4.erros[0];
                            if (!!message) {
                                this.messages.warning("titles.entradaVeiculo", message);
                                return [2 /*return*/];
                            }
                        }
                        else {
                            this.messages.saveSuccess("titles.entradaVeiculo");
                        }
                        jQuery("#ev-chegada-dialog").modal("hide");
                        return [2 /*return*/];
                }
            });
        });
    };
    PortariaConfirmacaoChegadaComponent.prototype.trataMotorista = function () {
        return __awaiter(this, void 0, void 0, function () {
            var motorista, ret, message;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.motoristaService.getMotoristaId(+this.filtroAltDadosPlanej.motoristaId).toPromise()];
                    case 1:
                        motorista = _a.sent();
                        if (motorista) {
                            this.filtroAltDadosPlanej.motorista = motorista;
                            this.filtroAltDadosPlanej.cnhValidade = this.filtroAltDadosPlanej.motorista.cnhValidade;
                            this.filtroAltDadosPlanej.fantasia = this.filtroAltDadosPlanej.motorista.nome;
                            this.filtroAltDadosPlanej.rg = this.filtroAltDadosPlanej.motorista.rg;
                            this.filtroAltDadosPlanej.cnh = this.filtroAltDadosPlanej.motorista.cnh;
                            this.filtroAltDadosPlanej.cnhValidade = this.filtroAltDadosPlanej.motorista.cnhValidade;
                            this.filtroAltDadosPlanej.cgcCpf = this.filtroAltDadosPlanej.motorista.cgcCpf;
                        }
                        else {
                            this.filtroAltDadosPlanej.motorista = new app_pages_cadastro_motorista_motorista_model__WEBPACK_IMPORTED_MODULE_16__["Motorista"]();
                        }
                        return [4 /*yield*/, this.entradaVeiculoService.validaVencimentoCnhMotorista(+this.filtroAltDadosPlanej.motoristaId)];
                    case 2:
                        ret = _a.sent();
                        if (ret) {
                            if (!ret.isValid) {
                                message = this.messages.validationResult(ret)[0];
                                if (message !== "")
                                    this.messages.warning("titles.entradaVeiculo", message);
                            }
                        }
                        return [2 /*return*/, ret.isValid];
                }
            });
        });
    };
    PortariaConfirmacaoChegadaComponent.ctorParameters = function () { return [
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"] },
        { type: app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_8__["MessageService"] },
        { type: app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_6__["FuncoesService"] },
        { type: app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_5__["ConfiguracaoFacade"] },
        { type: app_shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_7__["PermissoesUtilsService"] },
        { type: app_pages_cadastro_motorista_motorista_service__WEBPACK_IMPORTED_MODULE_13__["MotoristaService"] },
        { type: app_pages_cadastro_destinatario_destinatario_service__WEBPACK_IMPORTED_MODULE_14__["DestinatarioService"] },
        { type: _portaria_confirmacao_chegada_service__WEBPACK_IMPORTED_MODULE_12__["PortariaConfirmacaoCheagadaService"] },
        { type: app_shared_services_datatables_datatables_service__WEBPACK_IMPORTED_MODULE_9__["DatatablesService"] },
        { type: app_pages_veiculo_entrada_veiculo_entrada_veiculo_service__WEBPACK_IMPORTED_MODULE_15__["EntradaVeiculoService"] }
    ]; };
    PortariaConfirmacaoChegadaComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
            selector: 'app-portaria-confirmacao-chegada',
            template: __importDefault(__webpack_require__(/*! raw-loader!./portaria-confirmacao-chegada.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/raizen/movimentos/portaria/portaria-confirmacao-chegada/portaria-confirmacao-chegada.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None,
            providers: [app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_5__["ConfiguracaoFacade"]]
        }),
        __metadata("design:paramtypes", [_angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"],
            app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_8__["MessageService"],
            app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_6__["FuncoesService"],
            app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_5__["ConfiguracaoFacade"],
            app_shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_7__["PermissoesUtilsService"],
            app_pages_cadastro_motorista_motorista_service__WEBPACK_IMPORTED_MODULE_13__["MotoristaService"],
            app_pages_cadastro_destinatario_destinatario_service__WEBPACK_IMPORTED_MODULE_14__["DestinatarioService"],
            _portaria_confirmacao_chegada_service__WEBPACK_IMPORTED_MODULE_12__["PortariaConfirmacaoCheagadaService"],
            app_shared_services_datatables_datatables_service__WEBPACK_IMPORTED_MODULE_9__["DatatablesService"],
            app_pages_veiculo_entrada_veiculo_entrada_veiculo_service__WEBPACK_IMPORTED_MODULE_15__["EntradaVeiculoService"]])
    ], PortariaConfirmacaoChegadaComponent);
    return PortariaConfirmacaoChegadaComponent;
}(app_shared_components_corporate_base_base_permissoes__WEBPACK_IMPORTED_MODULE_4__["BasePermissoes"]));



/***/ }),

/***/ "./src/app/pages/especificos/raizen/movimentos/portaria/portaria-confirmacao-chegada/portaria-confirmacao-chegada.model.ts":
/*!*********************************************************************************************************************************!*\
  !*** ./src/app/pages/especificos/raizen/movimentos/portaria/portaria-confirmacao-chegada/portaria-confirmacao-chegada.model.ts ***!
  \*********************************************************************************************************************************/
/*! exports provided: ConfirmacaoChegadaFilter, ConfirmacaoChegada, ConfimacaoChegadaAltDadosPlanejamento */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ConfirmacaoChegadaFilter", function() { return ConfirmacaoChegadaFilter; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ConfirmacaoChegada", function() { return ConfirmacaoChegada; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ConfimacaoChegadaAltDadosPlanejamento", function() { return ConfimacaoChegadaAltDadosPlanejamento; });
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};
var ConfirmacaoChegadaFilter = /** @class */ (function () {
    function ConfirmacaoChegadaFilter() {
        this.confirmado = 'N';
        this.semAgenda = 'N';
        this.motivoCancelamento = "";
    }
    return ConfirmacaoChegadaFilter;
}());

var ConfirmacaoChegada = /** @class */ (function () {
    function ConfirmacaoChegada() {
    }
    return ConfirmacaoChegada;
}());

var ConfimacaoChegadaAltDadosPlanejamento = /** @class */ (function () {
    function ConfimacaoChegadaAltDadosPlanejamento() {
        this.regPlaneja = 0;
        this.motoristaId = 0;
        this.destinatarioIdTransportadora = 0;
        this.destinatarioIdClienteVenda = 0;
        this.municipio = "";
        this.estado = "";
        this.fantasia = "";
        this.rg = "";
        this.cnh = "";
        this.cnhValidade = "";
        this.cnhValidadeAnt = "";
        this.cgcCpf = "";
        this.operador = "";
        this.regLog = "";
        this.gravaValidade = "";
        this.entradaVeiculoId = 0;
        this.cadastroPlacaIdCavalo = "";
    }
    return ConfimacaoChegadaAltDadosPlanejamento;
}());



/***/ }),

/***/ "./src/app/pages/especificos/raizen/movimentos/portaria/portaria-confirmacao-chegada/portaria-confirmacao-chegada.service.ts":
/*!***********************************************************************************************************************************!*\
  !*** ./src/app/pages/especificos/raizen/movimentos/portaria/portaria-confirmacao-chegada/portaria-confirmacao-chegada.service.ts ***!
  \***********************************************************************************************************************************/
/*! exports provided: PortariaConfirmacaoCheagadaService */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PortariaConfirmacaoCheagadaService", function() { return PortariaConfirmacaoCheagadaService; });
/* harmony import */ var _angular_common_http__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/common/http */ "./node_modules/@angular/common/fesm5/http.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var app_app_error_handler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! app/app.error-handler */ "./src/app/app.error-handler.ts");
/* harmony import */ var environments_environment__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! environments/environment */ "./src/environments/environment.ts");
/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm5/operators/index.js");
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 PortariaConfirmacaoCheagadaService = /** @class */ (function () {
    function PortariaConfirmacaoCheagadaService(http) {
        this.http = http;
    }
    PortariaConfirmacaoCheagadaService.prototype.get = function (filtro) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_3__["environment"].service_url + "/api/v1/veiculos/entradaVeiculo/getEntradaVeiculoAgConfirmacaoChegada", filtro)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_2__["ErrorHandler"].handleError));
    };
    PortariaConfirmacaoCheagadaService.prototype.gravaEvConfirmacaoChegada = function (data) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_3__["environment"].service_url + "/api/v1/veiculos/entradaVeiculo/gravaEvConfirmacaoChegada", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_2__["ErrorHandler"].handleError));
    };
    PortariaConfirmacaoCheagadaService.prototype.alteraPlanejamentoConfirmacaoChegadaEV = function (data) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_3__["environment"].service_url + "/api/v1/veiculos/entradaVeiculo/alteraPlanejamentoConfirmacaoChegadaEV", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_2__["ErrorHandler"].handleError));
    };
    PortariaConfirmacaoCheagadaService.ctorParameters = function () { return [
        { type: _angular_common_http__WEBPACK_IMPORTED_MODULE_0__["HttpClient"] }
    ]; };
    PortariaConfirmacaoCheagadaService = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"])({
            providedIn: "root"
        }),
        __metadata("design:paramtypes", [_angular_common_http__WEBPACK_IMPORTED_MODULE_0__["HttpClient"]])
    ], PortariaConfirmacaoCheagadaService);
    return PortariaConfirmacaoCheagadaService;
}());



/***/ }),

/***/ "./src/app/pages/especificos/raizen/movimentos/portaria/portaria-index/portaria-index.component.ts":
/*!*********************************************************************************************************!*\
  !*** ./src/app/pages/especificos/raizen/movimentos/portaria/portaria-index/portaria-index.component.ts ***!
  \*********************************************************************************************************/
/*! exports provided: PortariaIndexComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PortariaIndexComponent", function() { return PortariaIndexComponent; });
/* 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 app_config_enumerables__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! app/config/enumerables */ "./src/app/config/enumerables.ts");
/* harmony import */ var app_pages_cadastro_cadastro_placa_cadastro_placa_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! app/pages/cadastro/cadastro-placa/cadastro-placa.service */ "./src/app/pages/cadastro/cadastro-placa/cadastro-placa.service.ts");
/* harmony import */ var app_pages_cadastro_destinatario_destinatario_model__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! app/pages/cadastro/destinatario/destinatario.model */ "./src/app/pages/cadastro/destinatario/destinatario.model.ts");
/* harmony import */ var app_pages_cadastro_estados_estados_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! app/pages/cadastro/estados/estados.service */ "./src/app/pages/cadastro/estados/estados.service.ts");
/* harmony import */ var app_pages_cadastro_material_material_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! app/pages/cadastro/material/material.service */ "./src/app/pages/cadastro/material/material.service.ts");
/* harmony import */ var app_pages_cadastro_motorista_motorista_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! app/pages/cadastro/motorista/motorista.service */ "./src/app/pages/cadastro/motorista/motorista.service.ts");
/* harmony import */ var app_pages_cadastro_tipo_operacao_veiculo_tipo_operacao_veiculo_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! app/pages/cadastro/tipo-operacao-veiculo/tipo-operacao-veiculo.service */ "./src/app/pages/cadastro/tipo-operacao-veiculo/tipo-operacao-veiculo.service.ts");
/* harmony import */ var app_pages_cadastro_tipo_veiculo_tipo_veiculo_service__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! app/pages/cadastro/tipo-veiculo/tipo-veiculo.service */ "./src/app/pages/cadastro/tipo-veiculo/tipo-veiculo.service.ts");
/* harmony import */ var app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! app/pages/login/login.service */ "./src/app/pages/login/login.service.ts");
/* harmony import */ var app_pages_veiculo_entrada_veiculo_entrada_veiculo_service__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! app/pages/veiculo/entrada-veiculo/entrada-veiculo.service */ "./src/app/pages/veiculo/entrada-veiculo/entrada-veiculo.service.ts");
/* harmony import */ var app_shared_components_corporate_base_base_permissoes__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! app/shared/components/corporate/base/base.permissoes */ "./src/app/shared/components/corporate/base/base.permissoes.ts");
/* harmony import */ var app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! app/shared/services/event-emitter/event-emitter.service */ "./src/app/shared/services/event-emitter/event-emitter.service.ts");
/* harmony import */ var app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! app/shared/services/funcoes/array-utils/array-utils.static.service */ "./src/app/shared/services/funcoes/array-utils/array-utils.static.service.ts");
/* harmony import */ var app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_15__ = __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_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_16__ = __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_funcoes_service__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! app/shared/services/funcoes/funcoes.service */ "./src/app/shared/services/funcoes/funcoes.service.ts");
/* harmony import */ var app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_18__ = __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_object_utils_object_utils_static_service__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! app/shared/services/funcoes/object-utils/object-utils.static.service */ "./src/app/shared/services/funcoes/object-utils/object-utils.static.service.ts");
/* harmony import */ var app_shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_20__ = __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_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! app/shared/services/funcoes/string-utils/string-utils.static.service */ "./src/app/shared/services/funcoes/string-utils/string-utils.static.service.ts");
/* harmony import */ var app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! app/shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var _portaria_constants__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../portaria.constants */ "./src/app/pages/especificos/raizen/movimentos/portaria/portaria.constants.ts");
/* harmony import */ var _portaria_model__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../portaria.model */ "./src/app/pages/especificos/raizen/movimentos/portaria/portaria.model.ts");
/* harmony import */ var _portaria_service__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../portaria.service */ "./src/app/pages/especificos/raizen/movimentos/portaria/portaria.service.ts");
/* harmony import */ var app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! app/shared/services/funcoes/date-time-utils/date-time-utils.static.service */ "./src/app/shared/services/funcoes/date-time-utils/date-time-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 __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
    function verb(n) { return function (v) { return step([n, v]); }; }
    function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (_) try {
            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
            if (y = 0, t) op = [op[0] & 2, t.value];
            switch (op[0]) {
                case 0: case 1: t = op; break;
                case 4: _.label++; return { value: op[1], done: false };
                case 5: _.label++; y = op[1]; op = [0]; continue;
                case 7: op = _.ops.pop(); _.trys.pop(); continue;
                default:
                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                    if (t[2]) _.ops.pop();
                    _.trys.pop(); continue;
            }
            op = body.call(thisArg, _);
        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
    }
};
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};



























var PortariaIndexComponent = /** @class */ (function (_super) {
    __extends(PortariaIndexComponent, _super);
    function PortariaIndexComponent(router, message, service, configuracao, permissoesUtils, loginService, funcoes, tipoOperacaoVeiculoService, serviceTipoVeiculo, cadastroPlacaService, estadosService, materialService, motoristaService, activatedRoute, entradaVeiculoService) {
        var _this = _super.call(this, new _portaria_constants__WEBPACK_IMPORTED_MODULE_23__["PortariaConstants"](), funcoes) || this;
        _this.router = router;
        _this.message = message;
        _this.service = service;
        _this.configuracao = configuracao;
        _this.permissoesUtils = permissoesUtils;
        _this.loginService = loginService;
        _this.funcoes = funcoes;
        _this.tipoOperacaoVeiculoService = tipoOperacaoVeiculoService;
        _this.serviceTipoVeiculo = serviceTipoVeiculo;
        _this.cadastroPlacaService = cadastroPlacaService;
        _this.estadosService = estadosService;
        _this.materialService = materialService;
        _this.motoristaService = motoristaService;
        _this.activatedRoute = activatedRoute;
        _this.entradaVeiculoService = entradaVeiculoService;
        _this.constantes = new _portaria_constants__WEBPACK_IMPORTED_MODULE_23__["PortariaConstants"]();
        _this.mensagens = [];
        _this.mascara = new app_config_enumerables__WEBPACK_IMPORTED_MODULE_2__["Mascaras"]();
        _this.placaCadastrada = false;
        _this.isValidaMotorista = true;
        _this.isShowConfirmaNormasSeguranca = false;
        _this.isRequiredPlacaCarreta1 = false;
        _this.isDisabledPlacaCarreta1 = true;
        _this.isShowPlacaCarreta2 = false;
        _this.isRequiredPlacaCarreta2 = false;
        _this.isDisabledPlacaCarreta2 = true;
        _this.isShowPlacaCarreta3 = false;
        _this.isRequiredPlacaCarreta3 = false;
        _this.isDisabledPlacaCarreta3 = true;
        _this.copiaDataNotas = new _portaria_model__WEBPACK_IMPORTED_MODULE_24__["PortariaNotas"]();
        _this.target = _this.funcoes.getTargetLocation();
        _this.pageRoute = "/especificos/raizen/movimentos/portaria";
        _this.loadConfig = function () {
            _this.service.configs.obrigaMoppMot = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_15__["BooleanUtilsStaticService"].toBoolean(_this.configuracao.lerConfig("CTV", "ObrigaMoppMot"));
            _this.service.configs.obrigaCursoMot = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_15__["BooleanUtilsStaticService"].toBoolean(_this.configuracao.lerConfig("CTV", "ObrigaCursoMot"));
            _this.service.configs.maskPlaca = _this.configuracao.lerConfig("BAL", "MaskPlaca");
            _this.service.configs.maskTrem = _this.configuracao.lerConfig("BAL", "MaskTrem");
            _this.service.configs.tipoVeiculoConfCheg = _this.configuracao.lerConfig("REL", "TipoVeiculoConfCheg");
            _this.service.configs.codPatioConfCheg = _this.configuracao.lerConfig("REL", "CodPatioConfCheg");
            _this.service.configs.altDtChegada = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_15__["BooleanUtilsStaticService"].toBoolean(_this.configuracao.lerConfig("CTV", "altDtChegada"));
            _this.service.configs.diasRetroChegada = _this.configuracao.number("CTV", "diasRetroChegada");
        };
        _this.confirmacaoChegada = function () {
            _this.permissoesUtils.verificaRotina(_this.constantes.sisFormularioId, 11, function () { return __awaiter(_this, void 0, void 0, function () {
                return __generator(this, function (_a) {
                    this.router.navigate([this.target + "/especificos/raizen/movimentos/portaria/chegada"]);
                    return [2 /*return*/];
                });
            }); });
        };
        router.events.subscribe(function (event) {
            var params = _this.funcoes.formParams.getParams(router, event);
            if (params) {
                _this.actionForm = params.action;
            }
        });
        return _this;
    }
    PortariaIndexComponent.prototype.ngOnInit = function () {
        var _this = this;
        this.configuracao.getConfig(this.constantes.parametrosConfig, this.loadConfig);
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 1, function () { return __awaiter(_this, void 0, void 0, function () {
            var id, _a;
            var _this = this;
            return __generator(this, function (_b) {
                switch (_b.label) {
                    case 0:
                        if (!!this.loginService.isTokenExpired()) return [3 /*break*/, 7];
                        return [4 /*yield*/, this.getEstados()];
                    case 1:
                        _b.sent();
                        return [4 /*yield*/, this.getTipoOperacaoVeiculo()];
                    case 2:
                        _b.sent();
                        return [4 /*yield*/, this.getTipoVeiculo()];
                    case 3:
                        _b.sent();
                        this.trataTipoVeiculo();
                        id = this.activatedRoute.snapshot.paramMap.get("id");
                        if (!id) return [3 /*break*/, 5];
                        _a = this.service;
                        return [4 /*yield*/, this.service.getTmpById(id).toPromise()];
                    case 4:
                        _a.data = _b.sent();
                        this.service.copiaDataNotas = this.funcoesService.cloneArray(this.service.data.entradaVeiculoNotas);
                        if (!this.service.data || (this.service.data.validationResult && !this.service.data.validationResult.isValid)) {
                            this.service.data.validationResult.erros.forEach(function (m) { return _this.message.warning('titles.portaria', m.message); });
                            this.router.navigate(["" + this.target + this.pageRoute]);
                        }
                        return [3 /*break*/, 6];
                    case 5:
                        this.service.data = new _portaria_model__WEBPACK_IMPORTED_MODULE_24__["Portaria"]();
                        _b.label = 6;
                    case 6:
                        this.preCreate();
                        _b.label = 7;
                    case 7: return [2 /*return*/];
                }
            });
        }); }, function () { return _this.permissoesUtils.back(); }, true);
        _super.prototype.addFuncoes.call(this, [
            { action: 'confirmacaoChegada', func: function () { return _this.confirmacaoChegada; } }
        ]);
    };
    PortariaIndexComponent.prototype.preCreate = function () {
        this.service.data.tipoVeiculoId = !this.service.data.tipoVeiculoId ? app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_18__["NumberUtilsStaticService"].toNumber(this.service.configs.tipoVeiculoConfCheg) : this.service.data.tipoVeiculoId;
    };
    PortariaIndexComponent.prototype.properties = function () {
        var _this = this;
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 6, function () {
            _super.prototype.properties.call(_this, _this.service.data);
        });
    };
    PortariaIndexComponent.prototype.permissoes = function () {
        var _this = this;
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 7, function () {
            _super.prototype.permissoes.call(_this, _this.constantes);
        });
    };
    PortariaIndexComponent.prototype.getEstados = function () {
        return __awaiter(this, void 0, void 0, function () {
            var es;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        this.estados = [];
                        return [4 /*yield*/, this.estadosService.get().toPromise()];
                    case 1:
                        es = _a.sent();
                        if (app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_14__["ArrayUtilsStaticService"].any(es)) {
                            this.estados = es.filter(function (val) { return val.sitReg != "E"; });
                        }
                        ;
                        return [2 /*return*/];
                }
            });
        });
    };
    PortariaIndexComponent.prototype.getTipoOperacaoVeiculo = function () {
        return __awaiter(this, void 0, void 0, function () {
            var _a;
            return __generator(this, function (_b) {
                switch (_b.label) {
                    case 0:
                        _a = this;
                        return [4 /*yield*/, this.tipoOperacaoVeiculoService.get().toPromise()];
                    case 1:
                        _a.tipoOperacaoVeiculos = _b.sent();
                        if (app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_14__["ArrayUtilsStaticService"].any(this.tipoOperacaoVeiculos)) {
                            this.tipoOperacaoVeiculos = this.tipoOperacaoVeiculos.filter(function (val) { return val.flagAtivo === "S" && val.sitReg !== 'E'; });
                            ;
                        }
                        return [2 /*return*/];
                }
            });
        });
    };
    PortariaIndexComponent.prototype.getTipoVeiculo = function () {
        return __awaiter(this, void 0, void 0, function () {
            var _a;
            return __generator(this, function (_b) {
                switch (_b.label) {
                    case 0:
                        _a = this;
                        return [4 /*yield*/, this.serviceTipoVeiculo.get(false, false).toPromise()];
                    case 1:
                        _a.tiposVeiculosT = _b.sent();
                        if (app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_14__["ArrayUtilsStaticService"].any(this.tiposVeiculos)) {
                            this.tiposVeiculosT = this.tiposVeiculosT.filter(function (val) { return val.flagAtivo === "S" && val.sitReg !== 'E'; });
                            this.tiposVeiculosT.forEach(function (item) {
                                if (app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_21__["StringUtilsStaticService"].isNotEmpty(item.descrTipoVeiculoCompleta) && item.descrTipoVeiculo !== item.descrTipoVeiculoCompleta)
                                    item.descrTipoVeiculo = item.descrTipoVeiculo + " - " + item.descrTipoVeiculoCompleta;
                                return item;
                            });
                        }
                        else {
                            this.tiposVeiculosT = [];
                        }
                        return [2 /*return*/];
                }
            });
        });
    };
    Object.defineProperty(PortariaIndexComponent.prototype, "tiposVeiculos", {
        get: function () {
            if (!app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_14__["ArrayUtilsStaticService"].any(this.tiposVeiculosT))
                return [];
            if (this.service.isFerroviario) {
                return this.tiposVeiculosT.filter(function (f) { return f.flagVagao === "S"; });
            }
            return this.tiposVeiculosT.filter(function (f) { return f.flagVagao !== "S"; });
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(PortariaIndexComponent.prototype, "mascaraPlaca", {
        get: function () {
            if (this.service.isFerroviario) {
                return this.mascara.mapMascaraCutomizada(this.service.configs.maskTrem);
            }
            else {
                return this.mascara.mapMascaraCutomizada(this.service.configs.maskPlaca);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(PortariaIndexComponent.prototype, "maxLengthPlaca", {
        get: function () {
            return !!this.mascaraPlaca ? this.mascaraPlaca.length : 18;
        },
        enumerable: true,
        configurable: true
    });
    PortariaIndexComponent.prototype.trataVeiculo = function () {
        return __awaiter(this, void 0, void 0, function () {
            var placa;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.cadastroPlacaService.getById(this.service.data.cadastroPlacaIdCavalo).toPromise()];
                    case 1:
                        placa = _a.sent();
                        this.placaCadastrada = !!placa;
                        if (!!placa) {
                            this.service.data.estadoIdCavalo = placa.estadoId;
                        }
                        return [2 /*return*/];
                }
            });
        });
    };
    PortariaIndexComponent.prototype.trataCliente = function (cliente) {
        this.service.data.cliente = !!cliente ? cliente : new app_pages_cadastro_destinatario_destinatario_model__WEBPACK_IMPORTED_MODULE_4__["Destinatario"]();
        if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_18__["NumberUtilsStaticService"].isNotPositive(this.service.data.destinatarioIdCliente)) {
            this.service.data.cliente = app_shared_services_funcoes_object_utils_object_utils_static_service__WEBPACK_IMPORTED_MODULE_19__["ObjectUtilsStaticService"].clone(cliente);
            this.service.data.destinatarioIdCliente = this.service.data.destinatarioIdCliente;
        }
    };
    PortariaIndexComponent.prototype.trataMotorista = function (motorista) {
        return __awaiter(this, void 0, void 0, function () {
            var trocouMotorista;
            return __generator(this, function (_a) {
                trocouMotorista = true;
                try {
                    trocouMotorista = motorista.motoristaId !== this.service.data.motorista.motoristaId;
                }
                catch (error) {
                    trocouMotorista = true;
                }
                return [2 /*return*/];
            });
        });
    };
    Object.defineProperty(PortariaIndexComponent.prototype, "disabledEstado", {
        get: function () {
            var result = this.funcoes.isDetail(this.actionForm);
            if (result)
                return true;
            if (this.service.configs.obrigaCadPlaca)
                return true;
            if (this.placaCadastrada)
                return true;
            return result;
        },
        enumerable: true,
        configurable: true
    });
    PortariaIndexComponent.prototype.outItem = function (event) { };
    PortariaIndexComponent.prototype.trataTipoVeiculo = function () {
        var _this = this;
        if (!!this.service.data.tipoVeiculoId) {
            var tv = this.tiposVeiculosT.find(function (c) { return c.tipoVeiculoId === app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_18__["NumberUtilsStaticService"].toNumber(_this.service.data.tipoVeiculoId); });
            if (!!tv) {
                this.service.data.tipoVeiculo = tv;
                if (this.funcoes.isCreate(this.actionForm)) {
                    this.service.data.flagAutoDescarregavel = tv.automatico;
                }
                this.isRequiredPlacaCarreta1 = false;
                this.isRequiredPlacaCarreta2 = false;
                this.isRequiredPlacaCarreta3 = false;
                this.isDisabledPlacaCarreta1 = true;
                this.isDisabledPlacaCarreta2 = true;
                this.isDisabledPlacaCarreta3 = true;
                if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_18__["NumberUtilsStaticService"].toNumber(tv.qtdePlacas) > 1) {
                    this.isRequiredPlacaCarreta1 = true;
                    this.isDisabledPlacaCarreta1 = false;
                }
                if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_18__["NumberUtilsStaticService"].toNumber(tv.qtdePlacas) > 2) {
                    this.isRequiredPlacaCarreta2 = true;
                    this.isDisabledPlacaCarreta2 = false;
                }
                if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_18__["NumberUtilsStaticService"].toNumber(tv.qtdePlacas) > 3) {
                    this.isRequiredPlacaCarreta3 = true;
                    this.isDisabledPlacaCarreta3 = false;
                }
                if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_18__["NumberUtilsStaticService"].toNumber(tv.qtdePlacas) === 0) {
                    this.isDisabledPlacaCarreta1 = true;
                    this.isDisabledPlacaCarreta2 = true;
                    this.isDisabledPlacaCarreta3 = true;
                }
                if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_18__["NumberUtilsStaticService"].toNumber(tv.qtdePlacas) === 1) {
                    this.service.data.cadastroPlacaIdCarreta1 = "";
                    this.service.data.cadastroPlacaIdCarreta2 = "";
                    this.service.data.cadastroPlacaIdCarreta3 = "";
                }
                else if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_18__["NumberUtilsStaticService"].toNumber(tv.qtdePlacas) === 2) {
                    this.service.data.cadastroPlacaIdCarreta2 = "";
                    this.service.data.cadastroPlacaIdCarreta3 = "";
                }
                else if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_18__["NumberUtilsStaticService"].toNumber(tv.qtdePlacas) === 3) {
                    this.service.data.cadastroPlacaIdCarreta3 = "";
                }
            }
        }
    };
    PortariaIndexComponent.prototype.validaNormaSeguranca = function () {
        return __awaiter(this, void 0, void 0, function () {
            var valid;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        this.isShowConfirmaNormasSeguranca = false;
                        if (!this.entradaVeiculoService.configs.obrNormasSeg) return [3 /*break*/, 2];
                        if (!(app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_18__["NumberUtilsStaticService"].toNumber(this.service.data.motoristaId) > 0)) return [3 /*break*/, 2];
                        return [4 /*yield*/, this.entradaVeiculoService.validaObrNormas(+this.service.data.motoristaId).toPromise()];
                    case 1:
                        valid = _a.sent();
                        if (!!valid)
                            this.isShowConfirmaNormasSeguranca = !valid.isValid;
                        _a.label = 2;
                    case 2: return [2 /*return*/];
                }
            });
        });
    };
    PortariaIndexComponent.prototype.preSave = function () {
        if (!!this.service.data.motorista) {
            this.service.data.grValidade = app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_14__["ArrayUtilsStaticService"].any(this.entradaVeiculoService.errosDocMotorista) ? "S" : "N";
        }
        this.service.data.cadastroPlacaIdCavalo = app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_21__["StringUtilsStaticService"].toUpperOrUndefined(this.service.data.cadastroPlacaIdCavalo);
        this.service.data.cadastroPlacaIdCarreta1 = app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_21__["StringUtilsStaticService"].toUpperOrUndefined(this.service.data.cadastroPlacaIdCarreta1);
        this.service.data.cadastroPlacaIdCarreta2 = app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_21__["StringUtilsStaticService"].toUpperOrUndefined(this.service.data.cadastroPlacaIdCarreta2);
        this.service.data.cadastroPlacaIdCarreta3 = app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_21__["StringUtilsStaticService"].toUpperOrUndefined(this.service.data.cadastroPlacaIdCarreta3);
    };
    PortariaIndexComponent.prototype.onSubmit = function (form) {
        return __awaiter(this, void 0, void 0, function () {
            var _this = this;
            return __generator(this, function (_a) {
                this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 2, function () {
                    app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_13__["EventEmitterService"].get("formError").emit(form);
                    if (form.invalid) {
                        _this.funcoesService.backToTop();
                        return;
                    }
                    _this.preSave();
                    _this.service
                        .geraArmazenagem(_this.service.data)
                        .subscribe(function (result) { return __awaiter(_this, void 0, void 0, function () {
                        return __generator(this, function (_a) {
                            if (!result.isValid) {
                                this.mensagens = this.message.validationResult(result);
                                app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_13__["EventEmitterService"].get("backError").emit(this.mensagens);
                            }
                            else {
                                if (result.message) {
                                    this.message.info('titles.portaria', result.message);
                                }
                                else {
                                    this.message.saveSuccess("titles.portaria");
                                }
                                this.service.data = new _portaria_model__WEBPACK_IMPORTED_MODULE_24__["Portaria"]();
                                this.router.navigate(["" + this.target + this.pageRoute]);
                            }
                            return [2 /*return*/];
                        });
                    }); });
                });
                return [2 /*return*/];
            });
        });
    };
    PortariaIndexComponent.prototype.cancelar = function () {
        var _this = this;
        var m = this.message.translate('messages.confirmaCancelamento', { rotina: 'Entrada do Veículo' });
        this.message.confirm('titles.portaria', m, null, function () {
            _this.service.cancelar(_this.service.data).subscribe(function (result) {
                if (!result.isValid) {
                    var mensagens = _this.message.validationResult(result);
                    mensagens.forEach(function (m) { return _this.message.danger('titles.portaria', m); });
                }
                else {
                    _this.service.data = new _portaria_model__WEBPACK_IMPORTED_MODULE_24__["Portaria"]();
                    _this.router.navigate(["" + _this.target + _this.pageRoute]);
                }
            });
        });
    };
    PortariaIndexComponent.prototype.validaDtChegada = function () {
        this.dtChegadaNaoPodeSerMaiorDataAtual(true);
    };
    PortariaIndexComponent.prototype.dtChegadaNaoPodeSerMaiorDataAtual = function (showError) {
        if (showError === void 0) { showError = false; }
        var r = { "isValid": true, "message": "" };
        if (!this.service.data.dtChegada || !this.service.configs.altDtChegada)
            return r;
        var maiorAHoje = app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_26__["DateTimeUtilsStaticService"].maiorAHoje(this.service.data.dtChegada, ['H', 'M']);
        // * * * Comentado, pois, caso decidam usar futuramente a validação para não 
        // permitir dtChegada inferior à quantidade de dias informadas no parâmetro diasRetroChegada já está no jeito* * *
        // const menorA = DateTimeUtilsStaticService.menorA(this.service.data.dtChegada, DateTimeUtilsStaticService.addDays(new Date(), (this.service.configs.diasRetroChegada * -1)), ['H', 'M']);
        // if (maiorAHoje || menorA) {
        if (maiorAHoje) {
            r.isValid = false;
            r.message = "messages.dtChegadaNaoPodeSerMaiorQueDataAtual";
            if (!r.isValid && showError) {
                this.message.warning("titles.portaria", r.message);
            }
            this.service.data.dtChegada = new Date();
        }
        return r;
    };
    Object.defineProperty(PortariaIndexComponent.prototype, "disabledDtChegada", {
        get: function () {
            if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_18__["NumberUtilsStaticService"].isNotPositive(this.service.data.regTmp))
                return true;
            if (this.service.data.operInc === 'API')
                return true;
            return false;
        },
        enumerable: true,
        configurable: true
    });
    PortariaIndexComponent.ctorParameters = function () { return [
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"] },
        { type: app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_22__["MessageService"] },
        { type: _portaria_service__WEBPACK_IMPORTED_MODULE_25__["PortariaService"] },
        { type: app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_16__["ConfiguracaoFacade"] },
        { type: app_shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_20__["PermissoesUtilsService"] },
        { type: app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_10__["LoginService"] },
        { type: app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_17__["FuncoesService"] },
        { type: app_pages_cadastro_tipo_operacao_veiculo_tipo_operacao_veiculo_service__WEBPACK_IMPORTED_MODULE_8__["TipoOperacaoVeiculoService"] },
        { type: app_pages_cadastro_tipo_veiculo_tipo_veiculo_service__WEBPACK_IMPORTED_MODULE_9__["TipoVeiculoService"] },
        { type: app_pages_cadastro_cadastro_placa_cadastro_placa_service__WEBPACK_IMPORTED_MODULE_3__["CadastroPlacaService"] },
        { type: app_pages_cadastro_estados_estados_service__WEBPACK_IMPORTED_MODULE_5__["EstadosService"] },
        { type: app_pages_cadastro_material_material_service__WEBPACK_IMPORTED_MODULE_6__["MaterialService"] },
        { type: app_pages_cadastro_motorista_motorista_service__WEBPACK_IMPORTED_MODULE_7__["MotoristaService"] },
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_1__["ActivatedRoute"] },
        { type: app_pages_veiculo_entrada_veiculo_entrada_veiculo_service__WEBPACK_IMPORTED_MODULE_11__["EntradaVeiculoService"] }
    ]; };
    PortariaIndexComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
            selector: "app-portaria-index",
            template: __importDefault(__webpack_require__(/*! raw-loader!./portaria-index.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/raizen/movimentos/portaria/portaria-index/portaria-index.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [_angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"],
            app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_22__["MessageService"],
            _portaria_service__WEBPACK_IMPORTED_MODULE_25__["PortariaService"],
            app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_16__["ConfiguracaoFacade"],
            app_shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_20__["PermissoesUtilsService"],
            app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_10__["LoginService"],
            app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_17__["FuncoesService"],
            app_pages_cadastro_tipo_operacao_veiculo_tipo_operacao_veiculo_service__WEBPACK_IMPORTED_MODULE_8__["TipoOperacaoVeiculoService"],
            app_pages_cadastro_tipo_veiculo_tipo_veiculo_service__WEBPACK_IMPORTED_MODULE_9__["TipoVeiculoService"],
            app_pages_cadastro_cadastro_placa_cadastro_placa_service__WEBPACK_IMPORTED_MODULE_3__["CadastroPlacaService"],
            app_pages_cadastro_estados_estados_service__WEBPACK_IMPORTED_MODULE_5__["EstadosService"],
            app_pages_cadastro_material_material_service__WEBPACK_IMPORTED_MODULE_6__["MaterialService"],
            app_pages_cadastro_motorista_motorista_service__WEBPACK_IMPORTED_MODULE_7__["MotoristaService"],
            _angular_router__WEBPACK_IMPORTED_MODULE_1__["ActivatedRoute"],
            app_pages_veiculo_entrada_veiculo_entrada_veiculo_service__WEBPACK_IMPORTED_MODULE_11__["EntradaVeiculoService"]])
    ], PortariaIndexComponent);
    return PortariaIndexComponent;
}(app_shared_components_corporate_base_base_permissoes__WEBPACK_IMPORTED_MODULE_12__["BasePermissoes"]));



/***/ }),

/***/ "./src/app/pages/especificos/raizen/movimentos/portaria/portaria-item/portaria-item.component.ts":
/*!*******************************************************************************************************!*\
  !*** ./src/app/pages/especificos/raizen/movimentos/portaria/portaria-item/portaria-item.component.ts ***!
  \*******************************************************************************************************/
/*! exports provided: PortariaItemComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PortariaItemComponent", function() { return PortariaItemComponent; });
/* 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 app_pages_cadastro_destinatario_destinatario_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! app/pages/cadastro/destinatario/destinatario.service */ "./src/app/pages/cadastro/destinatario/destinatario.service.ts");
/* harmony import */ var app_pages_cadastro_material_material_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! app/pages/cadastro/material/material.service */ "./src/app/pages/cadastro/material/material.service.ts");
/* harmony import */ var app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! app/pages/login/login.service */ "./src/app/pages/login/login.service.ts");
/* harmony import */ var app_pages_veiculo_entrada_veiculo_entrada_veiculo_model__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! app/pages/veiculo/entrada-veiculo/entrada-veiculo.model */ "./src/app/pages/veiculo/entrada-veiculo/entrada-veiculo.model.ts");
/* harmony import */ var app_pages_veiculo_entrada_veiculo_entrada_veiculo_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! app/pages/veiculo/entrada-veiculo/entrada-veiculo.service */ "./src/app/pages/veiculo/entrada-veiculo/entrada-veiculo.service.ts");
/* harmony import */ var app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! app/shared/services/event-emitter/event-emitter.service */ "./src/app/shared/services/event-emitter/event-emitter.service.ts");
/* harmony import */ var app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! app/shared/services/funcoes/array-utils/array-utils.static.service */ "./src/app/shared/services/funcoes/array-utils/array-utils.static.service.ts");
/* harmony import */ var app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! app/shared/services/funcoes/funcoes.service */ "./src/app/shared/services/funcoes/funcoes.service.ts");
/* harmony import */ var app_shared_services_funcoes_object_utils_object_utils_static_service__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! app/shared/services/funcoes/object-utils/object-utils.static.service */ "./src/app/shared/services/funcoes/object-utils/object-utils.static.service.ts");
/* harmony import */ var app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! app/shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var _portaria_service__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./../portaria.service */ "./src/app/pages/especificos/raizen/movimentos/portaria/portaria.service.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 __metadata = (undefined && undefined.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
    function verb(n) { return function (v) { return step([n, v]); }; }
    function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (_) try {
            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
            if (y = 0, t) op = [op[0] & 2, t.value];
            switch (op[0]) {
                case 0: case 1: t = op; break;
                case 4: _.label++; return { value: op[1], done: false };
                case 5: _.label++; y = op[1]; op = [0]; continue;
                case 7: op = _.ops.pop(); _.trys.pop(); continue;
                default:
                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                    if (t[2]) _.ops.pop();
                    _.trys.pop(); continue;
            }
            op = body.call(thisArg, _);
        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
    }
};
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};













var PortariaItemComponent = /** @class */ (function () {
    function PortariaItemComponent(router, materialService, message, service, funcoesService, destinatarioService, loginService, activatedRoute, entradaVeiculoService) {
        var _this = this;
        this.router = router;
        this.materialService = materialService;
        this.message = message;
        this.service = service;
        this.funcoesService = funcoesService;
        this.destinatarioService = destinatarioService;
        this.loginService = loginService;
        this.activatedRoute = activatedRoute;
        this.entradaVeiculoService = entradaVeiculoService;
        this.dataResult = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
        this.detail = false;
        router.events.subscribe(function (event) {
            var params = _this.funcoesService.formParams.getParams(router, event);
            if (params) {
                _this.actionForm = params.action;
            }
        });
    }
    PortariaItemComponent.prototype.ngOnInit = function () {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                this.showTable = true;
                return [2 /*return*/];
            });
        });
    };
    PortariaItemComponent.prototype.selected = function (val, index) {
        this._index = index;
        this.service.dataItem = val;
    };
    Object.defineProperty(PortariaItemComponent.prototype, "hasDados", {
        get: function () {
            if (!app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_8__["ArrayUtilsStaticService"].any(this.service.data.entradaVeiculoItems))
                return;
            return !!this.service.data.entradaVeiculoItems.filter(function (r) { return r.sitReg !== 'E'; });
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(PortariaItemComponent.prototype, "isCreate", {
        get: function () {
            return !this.service.dataItem.entradaVeiculoItemId;
        },
        enumerable: true,
        configurable: true
    });
    PortariaItemComponent.prototype.new = function () {
        this.detail = false;
        this.showTable = false;
        this.service.dataItem = new app_pages_veiculo_entrada_veiculo_entrada_veiculo_model__WEBPACK_IMPORTED_MODULE_5__["EntradaVeiculoItem"]();
        this.dataResult.emit(false);
        this.trataData();
    };
    PortariaItemComponent.prototype.edit = function () {
        this.detail = false;
        this.showTable = false;
        this.dataResult.emit(false);
    };
    PortariaItemComponent.prototype.back = function () {
        this.showTable = true;
        this.service.dataItem = new app_pages_veiculo_entrada_veiculo_entrada_veiculo_model__WEBPACK_IMPORTED_MODULE_5__["EntradaVeiculoItem"]();
        this.dataResult.emit(true);
        this._index = -1;
    };
    PortariaItemComponent.prototype.show = function () {
        this.detail = true;
        this.showTable = false;
        this.dataResult.emit(false);
    };
    PortariaItemComponent.prototype.remove = function () {
        var _this = this;
        this.dataResult.emit(false);
        this.message.removeConfirm(function () {
            _this.service.data.entradaVeiculoItems.forEach(function (val, idx) {
                if (!!val.entradaVeiculoId && val.entradaVeiculoId === _this.service.dataItem.entradaVeiculoId && val.entradaVeiculoId === _this.service.dataItem.entradaVeiculoId) {
                    _this.service.dataItem.sitReg = 'E';
                }
                else if (!val.entradaVeiculoId && val.sequencia === _this.service.dataItem.sequencia) {
                    _this.service.data.entradaVeiculoItems.splice(idx, 1);
                }
            });
            _this.service.dataItem = new app_pages_veiculo_entrada_veiculo_entrada_veiculo_model__WEBPACK_IMPORTED_MODULE_5__["EntradaVeiculoItem"]();
            _this._index = -1;
        });
        this.dataResult.emit(true);
    };
    PortariaItemComponent.prototype.trataData = function () {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                if (this.isCreate) {
                    if (!!this.service.data) {
                        this.service.dataItem.cliente = app_shared_services_funcoes_object_utils_object_utils_static_service__WEBPACK_IMPORTED_MODULE_10__["ObjectUtilsStaticService"].clone(this.service.data.cliente);
                    }
                }
                return [2 /*return*/];
            });
        });
    };
    PortariaItemComponent.prototype.trataCliente = function (cliente) {
        if (!cliente)
            return;
        this.service.dataItem.emitente = cliente;
    };
    PortariaItemComponent.prototype.trataClienteVenda = function (cliente) {
        if (!cliente)
            return;
        this.service.dataItem.clienteVenda = cliente;
    };
    PortariaItemComponent.prototype.trataMaterial = function (material) {
        var _this = this;
        if (!material)
            return;
        this.materialService.getById(material.materialId).subscribe(function (resp) {
            _this.service.dataItem.material = resp;
        });
    };
    Object.defineProperty(PortariaItemComponent.prototype, "disabledCliente", {
        get: function () {
            if (this.isDetail || this.detail)
                return true;
            if (!this.isCreate) {
                if (!this.service.configs.altCliItemEV)
                    return true;
            }
            return false;
        },
        enumerable: true,
        configurable: true
    });
    PortariaItemComponent.prototype.onSubmit = function (form) {
        var _this = this;
        app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_7__["EventEmitterService"].get("formError").emit(form);
        if (form.invalid) {
            this.funcoesService.backToTop();
            return;
        }
        if (!app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_8__["ArrayUtilsStaticService"].any(this.service.data.entradaVeiculoItems))
            this.service.data.entradaVeiculoItems = [];
        this.service.dataItem.fantasiaCliente = this.service.dataItem.emitente.fantasia;
        this.service.dataItem.fantasiaMaterial = this.service.dataItem.material.fantasia;
        if (this.service.dataItem.entradaVeiculoItemId || this.service.dataItem.sequencia > 0) {
            var i = this.service.data.entradaVeiculoItems.findIndex(function (x) { return x.sequencia === _this.service.dataItem.entradaVeiculoItemId; });
            this.service.data.entradaVeiculoItems[i] = this.service.dataItem;
        }
        else {
            this.service.dataItem.sequencia = this.service.data.entradaVeiculoItems.length + 1;
            this.service.dataItem.entradaVeiculoItemId = this.service.data.entradaVeiculoItems.length + 1;
            this.service.data.entradaVeiculoItems.push(this.service.dataItem);
        }
        this.dataResult.emit(this.service.data.entradaVeiculoItems);
        this.back();
    };
    PortariaItemComponent.ctorParameters = function () { return [
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"] },
        { type: app_pages_cadastro_material_material_service__WEBPACK_IMPORTED_MODULE_3__["MaterialService"] },
        { type: app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_11__["MessageService"] },
        { type: _portaria_service__WEBPACK_IMPORTED_MODULE_12__["PortariaService"] },
        { type: app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_9__["FuncoesService"] },
        { type: app_pages_cadastro_destinatario_destinatario_service__WEBPACK_IMPORTED_MODULE_2__["DestinatarioService"] },
        { type: app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_4__["LoginService"] },
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_1__["ActivatedRoute"] },
        { type: app_pages_veiculo_entrada_veiculo_entrada_veiculo_service__WEBPACK_IMPORTED_MODULE_6__["EntradaVeiculoService"] }
    ]; };
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"])(),
        __metadata("design:type", Object)
    ], PortariaItemComponent.prototype, "isDetail", void 0);
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"])(),
        __metadata("design:type", Object)
    ], PortariaItemComponent.prototype, "dataResult", void 0);
    PortariaItemComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
            selector: "app-portaria-item",
            template: __importDefault(__webpack_require__(/*! raw-loader!./portaria-item.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/raizen/movimentos/portaria/portaria-item/portaria-item.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [_angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"],
            app_pages_cadastro_material_material_service__WEBPACK_IMPORTED_MODULE_3__["MaterialService"],
            app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_11__["MessageService"],
            _portaria_service__WEBPACK_IMPORTED_MODULE_12__["PortariaService"],
            app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_9__["FuncoesService"],
            app_pages_cadastro_destinatario_destinatario_service__WEBPACK_IMPORTED_MODULE_2__["DestinatarioService"],
            app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_4__["LoginService"],
            _angular_router__WEBPACK_IMPORTED_MODULE_1__["ActivatedRoute"],
            app_pages_veiculo_entrada_veiculo_entrada_veiculo_service__WEBPACK_IMPORTED_MODULE_6__["EntradaVeiculoService"]])
    ], PortariaItemComponent);
    return PortariaItemComponent;
}());



/***/ }),

/***/ "./src/app/pages/especificos/raizen/movimentos/portaria/portaria-notas/portaria-notas.component.ts":
/*!*********************************************************************************************************!*\
  !*** ./src/app/pages/especificos/raizen/movimentos/portaria/portaria-notas/portaria-notas.component.ts ***!
  \*********************************************************************************************************/
/*! exports provided: PortariaNotasComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PortariaNotasComponent", function() { return PortariaNotasComponent; });
/* 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 app_pages_cadastro_destinatario_destinatario_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! app/pages/cadastro/destinatario/destinatario.service */ "./src/app/pages/cadastro/destinatario/destinatario.service.ts");
/* harmony import */ var app_pages_cadastro_material_material_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! app/pages/cadastro/material/material.service */ "./src/app/pages/cadastro/material/material.service.ts");
/* harmony import */ var app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! app/pages/login/login.service */ "./src/app/pages/login/login.service.ts");
/* harmony import */ var app_pages_veiculo_entrada_veiculo_entrada_veiculo_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! app/pages/veiculo/entrada-veiculo/entrada-veiculo.service */ "./src/app/pages/veiculo/entrada-veiculo/entrada-veiculo.service.ts");
/* harmony import */ var app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! app/shared/services/event-emitter/event-emitter.service */ "./src/app/shared/services/event-emitter/event-emitter.service.ts");
/* harmony import */ var app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! app/shared/services/funcoes/array-utils/array-utils.static.service */ "./src/app/shared/services/funcoes/array-utils/array-utils.static.service.ts");
/* harmony import */ var app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! app/shared/services/funcoes/funcoes.service */ "./src/app/shared/services/funcoes/funcoes.service.ts");
/* harmony import */ var app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! app/shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var _portaria_model__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./../portaria.model */ "./src/app/pages/especificos/raizen/movimentos/portaria/portaria.model.ts");
/* harmony import */ var _portaria_service__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./../portaria.service */ "./src/app/pages/especificos/raizen/movimentos/portaria/portaria.service.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 __metadata = (undefined && undefined.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
    function verb(n) { return function (v) { return step([n, v]); }; }
    function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (_) try {
            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
            if (y = 0, t) op = [op[0] & 2, t.value];
            switch (op[0]) {
                case 0: case 1: t = op; break;
                case 4: _.label++; return { value: op[1], done: false };
                case 5: _.label++; y = op[1]; op = [0]; continue;
                case 7: op = _.ops.pop(); _.trys.pop(); continue;
                default:
                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                    if (t[2]) _.ops.pop();
                    _.trys.pop(); continue;
            }
            op = body.call(thisArg, _);
        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
    }
};
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};












var PortariaNotasComponent = /** @class */ (function () {
    function PortariaNotasComponent(router, materialService, message, service, funcoesService, destinatarioService, loginService, activatedRoute, entradaVeiculoService) {
        var _this = this;
        this.router = router;
        this.materialService = materialService;
        this.message = message;
        this.service = service;
        this.funcoesService = funcoesService;
        this.destinatarioService = destinatarioService;
        this.loginService = loginService;
        this.activatedRoute = activatedRoute;
        this.entradaVeiculoService = entradaVeiculoService;
        this.dataResult = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
        this.detail = false;
        router.events.subscribe(function (event) {
            var params = _this.funcoesService.formParams.getParams(router, event);
            if (params) {
                _this.actionForm = params.action;
            }
        });
    }
    PortariaNotasComponent.prototype.ngOnInit = function () {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                this.showTable = true;
                return [2 /*return*/];
            });
        });
    };
    PortariaNotasComponent.prototype.selected = function (val, index) {
        this._index = index;
        this.service.dataNotas = val;
        this.valorAnterior = this.funcoesService.cloneObject(this.service.copiaDataNotas[index]);
    };
    Object.defineProperty(PortariaNotasComponent.prototype, "hasDados", {
        get: function () {
            if (!app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_7__["ArrayUtilsStaticService"].any(this.service.data.entradaVeiculoNotas))
                return;
            return !!this.service.data.entradaVeiculoNotas.filter(function (r) { return r.sitReg !== 'E'; });
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(PortariaNotasComponent.prototype, "isCreate", {
        get: function () {
            return !this.service.dataNotas.itemNotaId;
        },
        enumerable: true,
        configurable: true
    });
    PortariaNotasComponent.prototype.new = function () {
        this.detail = false;
        this.showTable = false;
        this.service.dataNotas = new _portaria_model__WEBPACK_IMPORTED_MODULE_10__["PortariaNotas"]();
        this.dataResult.emit(false);
    };
    PortariaNotasComponent.prototype.edit = function () {
        this.detail = false;
        this.showTable = false;
        this.dataResult.emit(false);
    };
    PortariaNotasComponent.prototype.back = function () {
        this.showTable = true;
        this.service.dataNotas = new _portaria_model__WEBPACK_IMPORTED_MODULE_10__["PortariaNotas"]();
        this.dataResult.emit(true);
        this._index = -1;
    };
    PortariaNotasComponent.prototype.show = function () {
        this.detail = true;
        this.showTable = false;
        this.dataResult.emit(false);
    };
    PortariaNotasComponent.prototype.remove = function () {
        var _this = this;
        this.dataResult.emit(false);
        this.message.removeConfirm(function () {
            _this.service.data.entradaVeiculoNotas.forEach(function (val, idx) {
                if (!!val.itemNotaId && val.itemNotaId === _this.service.dataNotas.itemNotaId && val.itemNotaId === _this.service.dataNotas.itemNotaId) {
                    _this.service.dataNotas.sitReg = 'E';
                }
                else if (!val.itemNotaId && val.sequencia === _this.service.dataNotas.sequencia) {
                    _this.service.data.entradaVeiculoNotas.splice(idx, 1);
                }
            });
            _this.service.dataNotas = new _portaria_model__WEBPACK_IMPORTED_MODULE_10__["PortariaNotas"]();
            _this._index = -1;
        });
        this.dataResult.emit(true);
    };
    PortariaNotasComponent.prototype.onSubmit = function (form) {
        var _this = this;
        app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_6__["EventEmitterService"].get("formError").emit(form);
        if (form.invalid) {
            this.funcoesService.backToTop();
            return;
        }
        if (this.service.dataNotas.itemNotaId || this.service.dataNotas.sequencia > 0) {
            var i = this.service.data.entradaVeiculoNotas.findIndex(function (x) { return x.sequencia === _this.service.dataNotas.itemNotaId; });
            this.service.data.entradaVeiculoNotas[i] = this.service.dataNotas;
        }
        else {
            this.service.dataNotas.sequencia = this.service.data.entradaVeiculoNotas.length + 1;
            this.service.dataNotas.itemNotaId = this.service.data.entradaVeiculoNotas.length + 1;
            this.service.data.entradaVeiculoNotas.push(this.service.dataNotas);
        }
        this.dataResult.emit(this.service.data.entradaVeiculoNotas);
        this.back();
    };
    Object.defineProperty(PortariaNotasComponent.prototype, "naoPermiteAlterar", {
        get: function () {
            if (!this.valorAnterior)
                return false;
            return (!!this.valorAnterior.numeroNFE && !!this.valorAnterior.serieNFE && !!this.valorAnterior.quantidade && !!this.valorAnterior.dtEmissaoNFE && !!this.valorAnterior.valorUnitario && !!this.valorAnterior.valorItem && !!this.valorAnterior.chaveNFE);
        },
        enumerable: true,
        configurable: true
    });
    PortariaNotasComponent.ctorParameters = function () { return [
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"] },
        { type: app_pages_cadastro_material_material_service__WEBPACK_IMPORTED_MODULE_3__["MaterialService"] },
        { type: app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_9__["MessageService"] },
        { type: _portaria_service__WEBPACK_IMPORTED_MODULE_11__["PortariaService"] },
        { type: app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_8__["FuncoesService"] },
        { type: app_pages_cadastro_destinatario_destinatario_service__WEBPACK_IMPORTED_MODULE_2__["DestinatarioService"] },
        { type: app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_4__["LoginService"] },
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_1__["ActivatedRoute"] },
        { type: app_pages_veiculo_entrada_veiculo_entrada_veiculo_service__WEBPACK_IMPORTED_MODULE_5__["EntradaVeiculoService"] }
    ]; };
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"])(),
        __metadata("design:type", Object)
    ], PortariaNotasComponent.prototype, "isDetail", void 0);
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"])(),
        __metadata("design:type", Object)
    ], PortariaNotasComponent.prototype, "dataResult", void 0);
    PortariaNotasComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
            selector: "app-portaria-notas",
            template: __importDefault(__webpack_require__(/*! raw-loader!./portaria-notas.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/raizen/movimentos/portaria/portaria-notas/portaria-notas.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [_angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"],
            app_pages_cadastro_material_material_service__WEBPACK_IMPORTED_MODULE_3__["MaterialService"],
            app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_9__["MessageService"],
            _portaria_service__WEBPACK_IMPORTED_MODULE_11__["PortariaService"],
            app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_8__["FuncoesService"],
            app_pages_cadastro_destinatario_destinatario_service__WEBPACK_IMPORTED_MODULE_2__["DestinatarioService"],
            app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_4__["LoginService"],
            _angular_router__WEBPACK_IMPORTED_MODULE_1__["ActivatedRoute"],
            app_pages_veiculo_entrada_veiculo_entrada_veiculo_service__WEBPACK_IMPORTED_MODULE_5__["EntradaVeiculoService"]])
    ], PortariaNotasComponent);
    return PortariaNotasComponent;
}());



/***/ }),

/***/ "./src/app/pages/especificos/raizen/movimentos/portaria/portaria.constants.ts":
/*!************************************************************************************!*\
  !*** ./src/app/pages/especificos/raizen/movimentos/portaria/portaria.constants.ts ***!
  \************************************************************************************/
/*! exports provided: PortariaConstants */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PortariaConstants", function() { return PortariaConstants; });
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};
var PortariaConstants = /** @class */ (function () {
    function PortariaConstants() {
        this.sisFormularioId = 65654;
        this.permissoes = [
            { sisFormularioId: this.sisFormularioId, libRotina: 1, acao: "labels.consulta" },
            { sisFormularioId: this.sisFormularioId, libRotina: 2, acao: "labels.geracao" },
        ];
        this.sisSistemaId = "CAD";
        this.nomeForm = "titles.Portaria";
        this.reportTitulo = { "titulo": "Portaria", "subTitulo": "" };
        this.listaIndex = [
            { title: 'Permissao', action: 'permissoes', icon: "icon-unlock", exibeButton: true, eximeMenu: true, menuName: 'Movimento' },
            { title: 'confirmacaoChegada', action: "confirmacaoChegada", icon: "icon-truck", exibeButton: true, eximeMenu: true, menuName: 'Movimento', disabled: false },
        ];
        this.listaPortariaChegada = [
            { title: 'Voltar', action: 'back', icon: "icon-arrow-left", exibeButton: true, eximeMenu: true, menuName: 'Arquivo' },
            { title: 'confirmacao', action: 'confirmaChegada', icon: "icon-check", exibeButton: true, eximeMenu: true, menuName: 'Movimento' },
            { title: 'AbrirCadMotorista', action: 'abrirCadMotorista', icon: "icon-user", exibeButton: true, eximeMenu: true, disabled: false, menuName: 'Movimento' }
        ];
        this.parametrosConfig = [
            {
                sistema: 'CTV', parametros: [
                    'ObrigaMoppMot',
                    'ObrigaCursoMot',
                    'AltDtChegada',
                    'DiasRetroChegada'
                ]
            },
            {
                sistema: 'BAL', parametros: [
                    'MaskPlaca',
                    'MaskTrem'
                ]
            },
            {
                sistema: 'REL', parametros: [
                    'TipoVeiculoConfCheg',
                    'CodPatioConfCheg'
                ]
            }
        ];
    }
    return PortariaConstants;
}());



/***/ }),

/***/ "./src/app/pages/especificos/raizen/movimentos/portaria/portaria.model.ts":
/*!********************************************************************************!*\
  !*** ./src/app/pages/especificos/raizen/movimentos/portaria/portaria.model.ts ***!
  \********************************************************************************/
/*! exports provided: Portaria, PortariaNotas */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Portaria", function() { return Portaria; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PortariaNotas", function() { return PortariaNotas; });
/* harmony import */ var app_shared_services_base_base_model__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! app/shared/services/base/base.model */ "./src/app/shared/services/base/base.model.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 __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};

var Portaria = /** @class */ (function (_super) {
    __extends(Portaria, _super);
    function Portaria() {
        var _this = _super.call(this) || this;
        _this.tipoOperacaoVeiculoId = 0;
        _this.entradaVeiculoId = 0;
        _this.tipoTransp = "R";
        _this.estadoIdCavalo = "";
        _this.regTmp = 0;
        return _this;
    }
    return Portaria;
}(app_shared_services_base_base_model__WEBPACK_IMPORTED_MODULE_0__["BaseModel"]));

var PortariaNotas = /** @class */ (function (_super) {
    __extends(PortariaNotas, _super);
    function PortariaNotas() {
        return _super.call(this) || this;
    }
    return PortariaNotas;
}(app_shared_services_base_base_model__WEBPACK_IMPORTED_MODULE_0__["BaseModel"]));



/***/ }),

/***/ "./src/app/pages/especificos/raizen/movimentos/portaria/portaria.module.ts":
/*!*********************************************************************************!*\
  !*** ./src/app/pages/especificos/raizen/movimentos/portaria/portaria.module.ts ***!
  \*********************************************************************************/
/*! exports provided: PortariaModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PortariaModule", function() { return PortariaModule; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var app_shared_shared_module__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! app/shared/shared.module */ "./src/app/shared/shared.module.ts");
/* harmony import */ var _portaria_confirmacao_chegada_portaria_confirmacao_chegada_component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./portaria-confirmacao-chegada/portaria-confirmacao-chegada.component */ "./src/app/pages/especificos/raizen/movimentos/portaria/portaria-confirmacao-chegada/portaria-confirmacao-chegada.component.ts");
/* harmony import */ var _portaria_index_portaria_index_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./portaria-index/portaria-index.component */ "./src/app/pages/especificos/raizen/movimentos/portaria/portaria-index/portaria-index.component.ts");
/* harmony import */ var _portaria_item_portaria_item_component__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./portaria-item/portaria-item.component */ "./src/app/pages/especificos/raizen/movimentos/portaria/portaria-item/portaria-item.component.ts");
/* harmony import */ var _portaria_notas_portaria_notas_component__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./portaria-notas/portaria-notas.component */ "./src/app/pages/especificos/raizen/movimentos/portaria/portaria-notas/portaria-notas.component.ts");
/* harmony import */ var _portaria_routing_module__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./portaria.routing.module */ "./src/app/pages/especificos/raizen/movimentos/portaria/portaria.routing.module.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 PortariaModule = /** @class */ (function () {
    function PortariaModule() {
    }
    PortariaModule = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"])({
            imports: [app_shared_shared_module__WEBPACK_IMPORTED_MODULE_1__["SharedModule"], _portaria_routing_module__WEBPACK_IMPORTED_MODULE_6__["PortariaRoutingModule"]],
            declarations: [
                _portaria_index_portaria_index_component__WEBPACK_IMPORTED_MODULE_3__["PortariaIndexComponent"],
                _portaria_item_portaria_item_component__WEBPACK_IMPORTED_MODULE_4__["PortariaItemComponent"],
                _portaria_notas_portaria_notas_component__WEBPACK_IMPORTED_MODULE_5__["PortariaNotasComponent"],
                _portaria_confirmacao_chegada_portaria_confirmacao_chegada_component__WEBPACK_IMPORTED_MODULE_2__["PortariaConfirmacaoChegadaComponent"]
            ]
        })
    ], PortariaModule);
    return PortariaModule;
}());



/***/ }),

/***/ "./src/app/pages/especificos/raizen/movimentos/portaria/portaria.routing.module.ts":
/*!*****************************************************************************************!*\
  !*** ./src/app/pages/especificos/raizen/movimentos/portaria/portaria.routing.module.ts ***!
  \*****************************************************************************************/
/*! exports provided: PortariaRoutingModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PortariaRoutingModule", function() { return PortariaRoutingModule; });
/* 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 _portaria_confirmacao_chegada_portaria_confirmacao_chegada_component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./portaria-confirmacao-chegada/portaria-confirmacao-chegada.component */ "./src/app/pages/especificos/raizen/movimentos/portaria/portaria-confirmacao-chegada/portaria-confirmacao-chegada.component.ts");
/* harmony import */ var _portaria_index_portaria_index_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./portaria-index/portaria-index.component */ "./src/app/pages/especificos/raizen/movimentos/portaria/portaria-index/portaria-index.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: _portaria_index_portaria_index_component__WEBPACK_IMPORTED_MODULE_3__["PortariaIndexComponent"],
        data: {
            breadcrumb: "Portaria"
        }
    },
    {
        path: "create/:id",
        component: _portaria_index_portaria_index_component__WEBPACK_IMPORTED_MODULE_3__["PortariaIndexComponent"],
        data: {
            breadcrumb: "Portaria"
        }
    },
    {
        path: "chegada",
        component: _portaria_confirmacao_chegada_portaria_confirmacao_chegada_component__WEBPACK_IMPORTED_MODULE_2__["PortariaConfirmacaoChegadaComponent"],
        data: {
            breadcrumb: "ConfirmacaoChegada"
        }
    },
];
var PortariaRoutingModule = /** @class */ (function () {
    function PortariaRoutingModule() {
    }
    PortariaRoutingModule = __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"]]
        })
    ], PortariaRoutingModule);
    return PortariaRoutingModule;
}());



/***/ }),

/***/ "./src/app/pages/especificos/raizen/movimentos/portaria/portaria.service.ts":
/*!**********************************************************************************!*\
  !*** ./src/app/pages/especificos/raizen/movimentos/portaria/portaria.service.ts ***!
  \**********************************************************************************/
/*! exports provided: PortariaService */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PortariaService", function() { return PortariaService; });
/* harmony import */ var _angular_common_http__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/common/http */ "./node_modules/@angular/common/fesm5/http.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var app_config_enumerables__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! app/config/enumerables */ "./src/app/config/enumerables.ts");
/* harmony import */ var app_pages_veiculo_entrada_veiculo_entrada_veiculo_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! app/pages/veiculo/entrada-veiculo/entrada-veiculo.service */ "./src/app/pages/veiculo/entrada-veiculo/entrada-veiculo.service.ts");
/* harmony import */ var app_shared_services_base_specifics_base_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! app/shared/services/base/specifics.base.service */ "./src/app/shared/services/base/specifics.base.service.ts");
/* harmony import */ var app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_5__ = __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_6__ = __webpack_require__(/*! app/shared/services/funcoes/string-utils/string-utils.static.service */ "./src/app/shared/services/funcoes/string-utils/string-utils.static.service.ts");
/* harmony import */ var app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! app/shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var environments_environment__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! environments/environment */ "./src/environments/environment.ts");
/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm5/operators/index.js");
/* harmony import */ var app_app_error_handler__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! app/app.error-handler */ "./src/app/app.error-handler.ts");
/* harmony import */ var _portaria_model__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./portaria.model */ "./src/app/pages/especificos/raizen/movimentos/portaria/portaria.model.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 __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
    function verb(n) { return function (v) { return step([n, v]); }; }
    function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (_) try {
            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
            if (y = 0, t) op = [op[0] & 2, t.value];
            switch (op[0]) {
                case 0: case 1: t = op; break;
                case 4: _.label++; return { value: op[1], done: false };
                case 5: _.label++; y = op[1]; op = [0]; continue;
                case 7: op = _.ops.pop(); _.trys.pop(); continue;
                default:
                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                    if (t[2]) _.ops.pop();
                    _.trys.pop(); continue;
            }
            op = body.call(thisArg, _);
        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
    }
};
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};












var PortariaService = /** @class */ (function (_super) {
    __extends(PortariaService, _super);
    function PortariaService(http, entradaVeiculoService, message) {
        var _this = _super.call(this, http, "raizen/portaria") || this;
        _this.entradaVeiculoService = entradaVeiculoService;
        _this.message = message;
        _this.data = new _portaria_model__WEBPACK_IMPORTED_MODULE_11__["Portaria"]();
        _this.copiaDataNotas = new _portaria_model__WEBPACK_IMPORTED_MODULE_11__["PortariaNotas"]();
        _this.configs = {
            maskPlaca: undefined,
            maskTrem: undefined,
            tipoVeiculoConfCheg: null,
            codPatioConfCheg: null,
            altDtChegada: false,
            diasRetroChegada: 0
        };
        return _this;
    }
    Object.defineProperty(PortariaService.prototype, "isFerroviario", {
        get: function () {
            return this.operacao === app_config_enumerables__WEBPACK_IMPORTED_MODULE_2__["TipoOperacaoEnum"].vagao || this.data.tipoTransp === "F";
        },
        enumerable: true,
        configurable: true
    });
    PortariaService.prototype.validaPlaca = function (ordem, showError) {
        var _this = this;
        if (showError === void 0) { showError = false; }
        var placas = [
            app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_6__["StringUtilsStaticService"].removeCaracteres(this.data.cadastroPlacaIdCavalo),
            app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_6__["StringUtilsStaticService"].removeCaracteres(this.data.cadastroPlacaIdCarreta1),
            app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_6__["StringUtilsStaticService"].removeCaracteres(this.data.cadastroPlacaIdCarreta2),
            app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_6__["StringUtilsStaticService"].removeCaracteres(this.data.cadastroPlacaIdCarreta3)
        ];
        var rs = [];
        if (app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_6__["StringUtilsStaticService"].isEmpty(placas[ordem])) {
            return rs;
        }
        else {
            this.entradaVeiculoService.validaPlaca(app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_5__["NumberUtilsStaticService"].toNumber(this.data.entradaVeiculoId), this.data.tipoTransp, placas[+ordem], +ordem, app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_5__["NumberUtilsStaticService"].toNumber(this.data.motoristaId)).subscribe(function (resp) { return __awaiter(_this, void 0, void 0, function () {
                var isValid, messages, ret_1, messages_1;
                var _this = this;
                return __generator(this, function (_a) {
                    switch (_a.label) {
                        case 0:
                            isValid = resp.isValid;
                            messages = this.message.validationResult(resp);
                            if (!!isValid) return [3 /*break*/, 1];
                            messages.forEach(function (e) { return rs.push({ "isValid": isValid, "message": messages[0] }); });
                            if (showError) {
                                this.message.warning("titles.portaria", messages[0]);
                            }
                            if (+ordem === 0)
                                this.data.cadastroPlacaIdCavalo = this.data.cadastroPlacaIdCavaloOld;
                            if (+ordem === 1)
                                this.data.cadastroPlacaIdCarreta1 = this.data.cadastroPlacaIdCarreta1Old;
                            if (+ordem === 2)
                                this.data.cadastroPlacaIdCarreta2 = this.data.cadastroPlacaIdCarreta2Old;
                            if (+ordem === 3)
                                this.data.cadastroPlacaIdCarreta3 = this.data.cadastroPlacaIdCarreta3Old;
                            return [3 /*break*/, 3];
                        case 1: return [4 /*yield*/, this.entradaVeiculoService.verificaSePlacaTemEVAberta({
                                regControle: app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_5__["NumberUtilsStaticService"].toNumber(this.data.entradaVeiculoId),
                                placa1: +ordem === 0 ? placas[0] : "",
                                placa2: +ordem === 1 ? placas[1] : "",
                                placa3: +ordem === 2 ? placas[2] : "",
                                placa4: +ordem === 3 ? placas[3] : "",
                                continua: "",
                                msg: ""
                            }).toPromise()];
                        case 2:
                            ret_1 = _a.sent();
                            if (!!resp.validationResult) {
                                messages_1 = this.message.validationResult(resp);
                                if (!isValid) {
                                    messages_1.forEach(function (e) { return rs.push({ "isValid": false, "message": e }); });
                                    if (showError) {
                                        messages_1.forEach(function (e) { return _this.message.warning("titles.portaria", e); });
                                    }
                                }
                            }
                            messages.forEach(function (e) { return rs.push({ "isValid": isValid, "message": ret_1.msg }); });
                            if (ret_1.outContinua === "N" && showError) {
                                this.message.warning("titles.portaria", ret_1.msg);
                                return [2 /*return*/];
                            }
                            if (ret_1.outContinua === "P") {
                                this.message.confirm('titles.portaria', ret_1.msg, null, function () { }, false, function () {
                                    _this.data.cadastroPlacaIdCavalo = +ordem === 0 ? "" : _this.data.cadastroPlacaIdCavaloOld;
                                    _this.data.cadastroPlacaIdCarreta1 = +ordem === 1 ? "" : _this.data.cadastroPlacaIdCarreta1Old;
                                    _this.data.cadastroPlacaIdCarreta2 = +ordem === 2 ? "" : _this.data.cadastroPlacaIdCarreta2Old;
                                    _this.data.cadastroPlacaIdCarreta3 = +ordem === 3 ? "" : _this.data.cadastroPlacaIdCarreta3Old;
                                });
                            }
                            _a.label = 3;
                        case 3: return [2 /*return*/];
                    }
                });
            }); });
        }
    };
    PortariaService.prototype.geraArmazenagem = function (filter) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_8__["environment"].specifics_service_url + "/api/v1/raizen/portaria/geraArmazenagem", filter)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_9__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_10__["ErrorHandler"].handleError));
    };
    PortariaService.prototype.cancelar = function (filter) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_8__["environment"].specifics_service_url + "/api/v1/raizen/portaria/cancelar", filter)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_9__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_10__["ErrorHandler"].handleError));
    };
    PortariaService.prototype.getTmpById = function (id) {
        return this.http
            .get(environments_environment__WEBPACK_IMPORTED_MODULE_8__["environment"].service_url + "/api/v1/veiculos/entradaVeiculo/tmp/" + id)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_9__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_10__["ErrorHandler"].handleError));
    };
    Object.defineProperty(PortariaService.prototype, "showNotas", {
        get: function () {
            if (!this.data.tipoOperacaoVeiculoId)
                return false;
            return (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_5__["NumberUtilsStaticService"].toNumber(this.data.tipoOperacaoVeiculoId) === 1);
        },
        enumerable: true,
        configurable: true
    });
    PortariaService.ctorParameters = function () { return [
        { type: _angular_common_http__WEBPACK_IMPORTED_MODULE_0__["HttpClient"] },
        { type: app_pages_veiculo_entrada_veiculo_entrada_veiculo_service__WEBPACK_IMPORTED_MODULE_3__["EntradaVeiculoService"] },
        { type: app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_7__["MessageService"] }
    ]; };
    PortariaService = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"])({
            providedIn: "root"
        }),
        __metadata("design:paramtypes", [_angular_common_http__WEBPACK_IMPORTED_MODULE_0__["HttpClient"],
            app_pages_veiculo_entrada_veiculo_entrada_veiculo_service__WEBPACK_IMPORTED_MODULE_3__["EntradaVeiculoService"],
            app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_7__["MessageService"]])
    ], PortariaService);
    return PortariaService;
}(app_shared_services_base_specifics_base_service__WEBPACK_IMPORTED_MODULE_4__["SpecificsBaseService"]));



/***/ })

}]);
//# sourceMappingURL=app-pages-especificos-raizen-movimentos-portaria-portaria-module.js.map