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

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao-confirmacao-chegada/geracao-confirmacao-chegada.component.html":
/*!****************************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao-confirmacao-chegada/geracao-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.listaConfirmacaChegada\" [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=\"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=\"geracao-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/cotriguacu/portaria/geracao/geracao-filter/geracao-filter.component.html":
/*!**************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao-filter/geracao-filter.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=\"modal fade\" id=\"geracao-filter-dialog\" tabindex=\"-1\" role=\"dialog\" data-backdrop=\"static\">\n    <div class=\"uni-modal-dialog-md-40\">\n        <div class=\"modal-content\">\n            <div class=\"modal-header\">\n                <h5 class=\"modal-title\">{{ 'titles.geracao' | translate }}</h5>\n            </div>\n            <form class=\"form filter-veiculo\" #form=\"ngForm\" (ngSubmit)=\"onSubmit(form)\" autocomplete=\"off\">\n                <app-validacoes></app-validacoes>\n                <div class=\"modal-body\">\n                    <div class=\"row\">\n                        <div class=\"col-lg-6 col-sm-12\">\n                            <div class=\"form-group form-group-sm\">\n                                <label for=\"dataI\" class=\"required\">{{'labels.periodoDe' |\n                                    translate}}</label>\n                                <app-data-h-m-s id=\"dataI\" name=\"periodoDe\" [(ngModel)]=\"service.filtro.dataI\" required\n                                    autofocus (executa)=\"validaData()\">\n                                </app-data-h-m-s>\n                            </div>\n                        </div>\n                        <div class=\"col-lg-6 col-sm-12\">\n                            <div class=\"form-group form-group-sm\">\n                                <label for=\"dataF\" class=\"required\">{{'labels.ate' | translate}}</label>\n                                <app-data-h-m-s id=\"dataF\" name=\"ate\" [(ngModel)]=\"service.filtro.dataF\" required\n                                    (executa)=\"validaData()\">\n                                </app-data-h-m-s>\n                            </div>\n                        </div>\n                    </div>\n                    <div class=\"row\">\n                        <div class=\"col-12\">\n                            <div class=\"form-group form-group-sm\">\n                                <app-pesquisa-material id=\"materialId\" name=\"produto\" label=\"produto\"\n                                    modalTitle=\"pesquisaDeProduto\" [(ngModel)]=\"service.filtro.materialId\"\n                                    (outModel)=\"outMaterial($event)\" [inSelected]=\"service.filtro.material\">\n                                </app-pesquisa-material>\n                            </div>\n                        </div>\n                    </div>\n                    <div class=\"row\">\n                        <div class=\"col-12\">\n                            <div class=\"form-group form-group-sm\">\n                                <app-pesquisa-destinatario id=\"destinatarioTransportadoraId\"\n                                    name=\"destinatarioTransportadoraId\" label=\"transportadora\"\n                                    modalTitle=\"pesquisaDeTransportadora\"\n                                    [(ngModel)]=\"service.filtro.destinatarioTransportadoraId\" tipoDestinatario=\"T\"\n                                    showCgcCpf=\"false\" showInscricao=\"false\"\n                                    [inSelected]=\"service.filtro.transportadora\"\n                                    (outSelected)=\"service.filtro.transportadora = $event\">\n                                </app-pesquisa-destinatario>\n                            </div>\n                        </div>\n                    </div>\n                    <div class=\"row\">\n                        <div class=\"col-12\">\n                            <div class=\"form-group form-group-sm\">\n                                <app-pesquisa-motorista id=\"motoristaId\" name=\"motoristaId\" label=\"motorista\"\n                                    modalTitle=\"pesquisaMotorista\" [(ngModel)]=\"service.filtro.motoristaId\"\n                                    [showCpf]=\"true\" showCursos=\"false\" showDocumentos=\"false\"\n                                    (outSelected)=\"service.filtro.motorista = $event\">\n                                </app-pesquisa-motorista>\n                            </div>\n                        </div>\n                    </div>\n                    <div class=\"row\">\n                        <div class=\"col-lg-4\">\n                            <div class=\"form-group form-group-sm\">\n                                <label for=\"tipoVeiculoId\">{{'labels.tipoVeiculo' | translate\n                                    }}</label>\n                                <app-combo-tipo-veiculo id=\"tipoVeiculoId\" name=\"tipoVeiculo\" flagAtivo=\"S\"\n                                    isFerroviario=\"true\" [(ngModel)]=\"service.filtro.tipoVeiculoId\">\n                                </app-combo-tipo-veiculo>\n                            </div>\n                        </div>\n                        <div class=\"col-lg-4\">\n                            <div class=\"form-group form-group-sm\">\n                                <label for=\"cadastroPlacaId\">{{ 'labels.placa' | translate}}</label>\n                                <input id=\"cadastroPlacaId\" name=\"cadastroPlacaId\" maxlength=\"18\"\n                                    [(ngModel)]=\"service.filtro.cadastroPlacaId\" class=\"form-control form-control-sm\">\n                            </div>\n                        </div>\n                        <div class=\"col-lg-4\">\n                            <div class=\"form-group form-group-sm\">\n                                <label for=\"cliCotrPtrEntradaVeiculoId\">{{ 'labels.registro' | translate}}</label>\n                                <input id=\"cliCotrPtrEntradaVeiculoId\" name=\"cliCotrPtrEntradaVeiculoId\" maxlength=\"11\" mask=\"999999999\"\n                                    [(ngModel)]=\"service.filtro.cliCotrPtrEntradaVeiculoId\" class=\"form-control form-control-sm\">\n                            </div>\n                        </div>\n                    </div>\n                </div>\n                <div class=\"modal-footer\">\n                    <button class=\"btn btn-success mr-1\" type=\"submit\">{{ 'buttons.pesquisar' | translate }}\n                    </button>\n                    <button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">Sair</button>\n                </div>\n            </form>\n        </div>\n    </div>\n</div>");

/***/ }),

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

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("<app-menu-command-bar [botoesComando]=\"constantes.listaForm\" [sisFormularioId]=\"constantes.sisFormularioId\"\r\n    [formAction]=\"actionForm\" [itemData]=\"service.data.cliCotrPtrEntradaVeiculoId\">\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        </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            <form class=\"form\" #f=\"ngForm\" (ngSubmit)=\"onSubmit(f)\">\r\n                <app-validacoes formErrorId=\"msgDados\"></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=\"produto\" name=\"produto\" label=\"produto\"\r\n                                modalTitle=\"pesquisaDeProduto\" [(ngModel)]=\"service.data.materialId\"\r\n                                [inSelected]=\"service.data.material\" [tipoProduto]=\"'A'\" required=\"true\"\r\n                                [disabled]=\"funcoesService.isDetail(actionForm)\" (outModel)=\"trataMaterial($event)\">\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-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=\"true\" [(ngModel)]=\"service.data.destinatarioIdTransportadora\"\r\n                                [inSelected]=\"service.data.transportadora\" tipoDestinatario=\"T\" permiteInativos=\"false\"\r\n                                (outModel)=\"trataTransportadora($event)\"\r\n                                [disabled]=\"funcoesService.isDetail(actionForm)\">\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-4 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"tipoVeiculoId\" class=\"required\">{{'labels.tipoVeiculo' | translate\r\n                                }}</label>\r\n                            <app-combo-tipo-veiculo id=\"tipoVeiculoId\" name=\"tipoVeiculo\" flagAtivo=\"S\" required=\"true\"\r\n                                [disabled]=\"funcoesService.isDetail(actionForm)\" isFerroviario=\"true\"\r\n                                [(ngModel)]=\"service.data.tipoVeiculoId\">\r\n                            </app-combo-tipo-veiculo>\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.placaCavalo\" | translate\r\n                                }}</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\"\r\n                                [maxlength]=\"maxLengthPlaca\" (blur)=\"validation.validaPlaca(0, true);\"\r\n                                [disabled]=\"funcoesService.isDetail(actionForm)\">\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\">{{\r\n                                \"labels.estado\" | translate\r\n                                }}</label>\r\n                            <app-combo-estado id=\"estadoIdCavalo\" name=\"estado\"\r\n                                [(ngModel)]=\"service.data.estadoIdCavalo\" showUf=\"true\" [required]=\"true\"\r\n                                [disabled]=\"funcoesService.isDetail(actionForm)\">\r\n                            </app-combo-estado>\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]=\"service.configs.solicitaNumCartao\" for=\"numCracha\">{{\r\n                                \"labels.numeroDoCartao\" | translate }}</label>\r\n                            <input type=\"text\" id=\"numCracha\" name=\"numeroDoCartao\"\r\n                                class=\"form-control form-control-sm uppercase\"\r\n                                [required]=\"service.configs.solicitaNumCartao\" [(ngModel)]=\"service.data.numCracha\"\r\n                                [disabled]=\"funcoesService.isDetail(actionForm)\"\r\n                                (blur)=\"validation.validaNumCracha(true)\">\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 for=\"cadastroPlacaIdCarreta1\">\r\n                                {{'labels.placaCarreta1' |\r\n                                translate}}</label>\r\n                            <input type=\"text\" id=\"cadastroPlacaIdCarreta1\" name=\"cadastroPlacaIdCarreta1\"\r\n                                class=\"form-control form-control-sm uppercase\"\r\n                                [(ngModel)]=\"service.data.cadastroPlacaIdCarreta1\" [mask]=\"mascaraPlaca\"\r\n                                [maxlength]=\"maxLengthPlaca\" (blur)=\"validation.validaPlaca(1, true);\"\r\n                                [disabled]=\"funcoesService.isDetail(actionForm)\" [required]=\"false\">\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=\"cadastroPlacaIdCarreta2\">\r\n                                {{'labels.placaCarreta2' |\r\n                                translate}}</label>\r\n                            <input type=\"text\" id=\"cadastroPlacaIdCarreta2\" name=\"cadastroPlacaIdCarreta2\"\r\n                                class=\"form-control form-control-sm uppercase\"\r\n                                [(ngModel)]=\"service.data.cadastroPlacaIdCarreta2\"\r\n                                [disabled]=\"funcoesService.isDetail(actionForm)\" [required]=\"false\"\r\n                                [mask]=\"mascaraPlaca\" [maxlength]=\"maxLengthPlaca\"\r\n                                (blur)=\"validation.validaPlaca(2, true);\">\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=\"pesoTara\" class=\"required\">{{'labels.pesoTara' | translate}}</label>\r\n                            <input id=\"pesoTara\" name=\"pesoTara\" [(ngModel)]=\"service.data.pesoTara\"\r\n                                (blur)=\"onTrataPesoTara()\" [disabled]=\"funcoesService.isDetail(actionForm)\"\r\n                                class=\"form-control form-control-sm\" type=\"text\" currencyMask\r\n                                [options]=\"funcoes.optionCurrency(0)\" required>\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]=\"funcoesService.isDetail(actionForm)\">\r\n                            </app-pesquisa-motorista>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"row\" *ngIf=\"exibeCamposExtrasMotorista\">\r\n                    <div class=\"col-lg-1\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"motoristaDDD\">{{\r\n                                'labels.ddd' | translate}}</label>\r\n                            <input id=\"motoristaDDD\" type=\"text\" name=\"motoristaDDD\"\r\n                                class=\"form-control form-control-sm\" [(ngModel)]=\"service.data.motorista.ddd\"\r\n                                [disabled]=\"true\">\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-2\" *ngIf=\"!!service.data.motorista\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"motoristaTelefone\">{{\r\n                                'labels.telefone' | translate}}</label>\r\n                            <input id=\"motoristaTelefone\" type=\"text\" name=\"motoristaTelefone\"\r\n                                class=\"form-control form-control-sm\" [(ngModel)]=\"service.data.motorista.telefone1\"\r\n                                [disabled]=\"true\">\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-2\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"motoristaRg\">{{'labels.rg' | translate }}</label>\r\n                            <input id=\"motoristaRg\" type=\"text\" name=\"motoristaRg\" class=\"form-control form-control-sm\"\r\n                                value=\"{{ service.data?.motorista?.rg}}\" 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=\"motoristaCnh\">{{'labels.cnh' | translate }}</label>\r\n                            <input id=\"motoristaCnh\" type=\"text\" name=\"motoristaCnh\"\r\n                                class=\"form-control form-control-sm\" value=\"{{ service.data?.motorista?.cnh}}\" 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=\"motoristaCnhValidade\">{{'labels.validade' | translate}}</label>\r\n                            <input id=\"motoristaCnhValidade\" type=\"text\" name=\"motoristaCnhValidade\"\r\n                                class=\"form-control form-control-sm\"\r\n                                value=\"{{ service.data?.motorista?.cnhValidade | date:'dd/MM/yyyy'}}\" disabled>\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=\"dtTriagem\" class=\"required\">{{'labels.triagem' | translate}}</label>\r\n                            <app-data-h-m-s id=\"dtTriagem\" name=\"triagem\" [(ngModel)]=\"service.data.dtTriagem\"\r\n                                [disabled]=\"funcoesService.isDetail(actionForm)\" required>\r\n                            </app-data-h-m-s>\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 for=\"chaveCte\">{{'labels.chaveCte' |\r\n                                translate}}</label>\r\n                            <input type=\"text\" maxlength=\"44\" id=\"chaveCte\" name=\"chaveCte\"\r\n                                class=\"form-control form-control-sm\" [(ngModel)]=\"service.data.chaveCTE\"\r\n                                mask=\"0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000\" maxlength=\"54\"\r\n                                [disabled]=\"funcoesService.isDetail(actionForm)\" (blur)=\"checkChaveCTe()\">\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 for=\"numeroCte\">{{'labels.numeroCte' | translate}}</label>\r\n                            <input type=\"text\" id=\"numeroCte\" name=\"numeroCte\" class=\"form-control form-control-sm\"\r\n                                [disabled]=\"funcoesService.isDetail(actionForm)\" [(ngModel)]=\"service.data.numeroCTE\"\r\n                                (blur)=\"checkChaveCTe()\">\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=\"serie\">{{'labels.serie' |\r\n                                translate}}</label>\r\n                            <app-combo-serie-nota id=\"serie\" name=\"serie\"\r\n                                [disabled]=\"funcoesService.isDetail(actionForm)\" [(ngModel)]=\"service.data.serieCTE\"\r\n                                (outSelected)=\"checkChaveCTe()\">\r\n                            </app-combo-serie-nota>\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=\"dataCTE\">{{'labels.emissao' |\r\n                                translate}}</label>\r\n                            <app-data id=\"dataCTE\" name=\"emissao\" [(ngModel)]=\"service.data.dataCTE\"\r\n                                [disabled]=\"funcoesService.isDetail(actionForm)\">\r\n                            </app-data>\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)\">\r\n                                {{ 'buttons.salvar' | translate }}\r\n                            </button>\r\n                            <button class=\"btn btn-default mr-2\" [disabled]=\"funcoesService.isDetail(actionForm)\"\r\n                                (click)=\"cancelar()\" type=\"button\">{{ '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-geracao-item id=\"geracaoItens\" name=\"geracaoItens\" [isDetail]=\"funcoes.isDetail(actionForm)\">\r\n            </app-geracao-item>\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>\r\n<app-geracao-motorista-validade (confirm)=\"validation.validaMotorista($event)\"></app-geracao-motorista-validade>\r\n<app-motiva-motorista (ok)=\"outMotivaMotorista($event)\"></app-motiva-motorista>");

/***/ }),

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao-index/geracao-index.component.html":
/*!************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao-index/geracao-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]=\"data.cliCotrPtrEntradaVeiculoId\">\r\n</app-menu-command-bar>\r\n\r\n<div class=\"section-comand-bar\">\r\n    <table id=\"dTableGeracao\" class=\"table table-striped table-bordered table-hover nowrap table-sm\"></table>\r\n</div>\r\n\r\n<app-liberar-acesso-supervisor></app-liberar-acesso-supervisor>\r\n<app-propriedades></app-propriedades>\r\n<app-permissoes-rotina [constantes]=\"constantes\"></app-permissoes-rotina>\r\n<app-geracao-filter (filtrar)=\"filtra()\"></app-geracao-filter>\r\n<app-motiva-motorista (ok)=\"outMotivaMotorista($event)\"></app-motiva-motorista>\r\n<app-geracao-print-modal (outConfirma)=\"confirmaImpressao($event)\"></app-geracao-print-modal>");

/***/ }),

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao-item/geracao-item.component.html":
/*!**********************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao-item/geracao-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=\"service.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=\"!service.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?.cliCotrPtrEntradaVeiculoItemId\" *ngIf=\"service.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 || (!service.showTable && !detail) || !service.dataItem?.cliCotrPtrEntradaVeiculoItemId\">\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?.cliCotrPtrEntradaVeiculoItemId\" *ngIf=\"service.showTable\">\r\n            <i class=\"icon-close\"></i>\r\n        </button>\r\n    </div>\r\n</div>\r\n\r\n<ng-container *ngIf=\"service.showTable\">\r\n    <div class=\"row\">\r\n        <div class=\"col-md-12 col-lg-12\">\r\n            <div class=\"table-responsive\" style=\"overflow: auto;\">\r\n                <table id=\"dtItens\" class=\"table table-striped table-bordered table-hover nowrap table-sm\">\r\n                    <thead>\r\n                        <tr>\r\n                            <th class=\"text-left\">{{ 'labels.lote' | translate }}</th>\r\n                            <th class=\"text-left\">{{ 'labels.deposito' | translate }}</th>\r\n                            <th class=\"text-right\">{{ 'labels.documento' | translate }}</th>\r\n                            <th class=\"text-left\">{{ 'labels.dtDocto' | translate }}</th>\r\n                            <th class=\"text-right\">{{ 'labels.quantidDoc' | translate }}</th>\r\n                            <th class=\"text-right\">{{ 'labels.pesoDocto' | translate }}</th>\r\n                            <th class=\"text-right\">{{ 'labels.valorNF' | translate }}</th>\r\n                            <th class=\"text-left\">{{ 'labels.chaveNFE' | 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.cliCotrPtrEntradaVeiculoItemId === c.cliCotrPtrEntradaVeiculoItemId }\">\r\n                            <td class=\"text-left\">{{c.loteId}}</td>\r\n                            <td class=\"text-left\">{{c.tanqueId}}</td>\r\n                            <td class=\"text-right\">{{c.docto}}</td>\r\n                            <td class=\"text-left\">{{c.dtDocumento | date:'dd/MM/yyyy' }}</td>\r\n                            <td class=\"text-right\">{{c.quantidDoc | formatCurrency: 0}}</td>\r\n                            <td class=\"text-right\">{{c.pesoDoc | formatCurrency: 0}}</td>\r\n                            <td class=\"text-right\">{{c.totItem | formatCurrency: 2}}</td>\r\n                            <td class=\"text-left\">{{c.chaveNfe}}</td>\r\n                        </tr>\r\n                        <tr *ngIf=\"!hasDados\">\r\n                            <th colspan=\"10\">\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    </div>\r\n</ng-container>\r\n<ng-container *ngIf=\"!service.showTable\">\r\n    <form class=\"form\" #form=\"ngForm\" (ngSubmit)=\"onSubmit(form)\">\r\n        <div class=\"row\">\r\n            <div class=\"col-lg-12\">\r\n                <app-validacoes formErrorId=\"msgItem\"></app-validacoes>\r\n                <div class=\"row\">\r\n                    <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"modeloNf\" class=\"required\">{{'labels.modeloNf' | translate}}</label>\r\n                            <app-combo-modelo-nota id=\"modeloNf\" name=\"modeloNf\" autofocus\r\n                                [(ngModel)]=\"service.dataItem.modeloNotaId\" flagAtivo=\"S\" [disabled]=\"disabled\"\r\n                                (outSelected)=\"trataModeloNota($event)\"></app-combo-modelo-nota>\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 for=\"chaveDaNFE\" [class.required]=\"!disabledChaveNfe\"\r\n                                class=\"required\">{{'labels.chaveDaNFE' |\r\n                                translate}}</label>\r\n                            <div class=\"input-group\">\r\n                                <input type=\"text\" maxlength=\"44\" id=\"chaveDaNFE\" name=\"chaveDaNFE\"\r\n                                    [required]=\"!disabledChaveNfe\" class=\"form-control form-control-sm\"\r\n                                    [(ngModel)]=\"service.dataItem.chaveNfe\"\r\n                                    mask=\"0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000\" maxlength=\"54\"\r\n                                    [disabled]=\"disabledChaveNfe\" [disabled]=\"!funcoesService.isCreate(actionForm)\"\r\n                                    (blur)=\"onValidaChaveNfe()\">\r\n                                <span class=\"input-group-btn\">\r\n                                    <button type=\"button\" class=\"btn btn-success btn-sm\"\r\n                                        [disabled]=\"disabledChaveNfe || disabledBtnImportarDanfe\"\r\n                                        (click)=\"importarDanfe()\" title=\"Importa DANFE\"> <i class=\"fa fa-search\"></i>\r\n                                    </button>\r\n                                </span>\r\n                                <input type=\"file\" #fileInput accept=\".xml\" style=\"display: none;\"\r\n                                    (change)=\"onXmlSelected($event)\">\r\n                            </div>\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=\"emitente\" tipoDestinatario=\"C\"\r\n                                showInscricao=\"false\" showCgcCpf=\"true\" label=\"emitente\" modalTitle=\"pesquisaDeEmitente\"\r\n                                permiteInativos=\"false\" [(ngModel)]=\"service.dataItem.destinatarioIdEmitente\"\r\n                                [inSelected]=\"service.dataItem.emitente\" (outModel)=\"trataEmitente($event)\"\r\n                                [disabled]=\"disabled\" 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=\"cliente\" name=\"cliente\" tipoDestinatario=\"C\"\r\n                                showInscricao=\"false\" showCgcCpf=\"true\" label=\"cliente\" modalTitle=\"pesquisaDeCliente\"\r\n                                permiteInativos=\"false\" [(ngModel)]=\"service.dataItem.destinatarioIdCliente\"\r\n                                [inSelected]=\"service.dataItem.cliente\" (outModel)=\"trataCliente($event)\"\r\n                                [disabled]=\"disabled\" 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-3 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <app-pesquisa-saldo-lote-deposito id=\"deposito\" name=\"deposito\" required=\"true\"\r\n                                [label]=\"'deposito'\" [modalTitle]=\"'deposito'\" [disabled]=\"disabled || disabledDeposito\"\r\n                                [field]=\"'tanqueId'\" [options]=\"saldoDepositoOptions\" clienteObrigatorio=\"true\"\r\n                                [(ngModel)]=\"service.dataItem.tanqueId\" (focusin)=\"depositoFocusIn()\"\r\n                                (outModel)=\"onSelectedDeposito($event)\">\r\n                            </app-pesquisa-saldo-lote-deposito>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"row\">\r\n                    <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <app-pesquisa-lote id=\"lote\" label=\"lote\" name=\"lote\" modalTitle=\"lote\"\r\n                                [(ngModel)]=\"service.dataItem.loteId\" (focusin)=\"loteFocusIn()\" [disabled]=\"disabled\"\r\n                                [destinatarioIdCliente]=\"service.dataItem.destinatarioIdCliente\"\r\n                                [destinatarioIdEmitente]=\"service.dataItem.destinatarioIdEmitente\"\r\n                                [materialId]=\"service.data.materialId\" [loteId]=\"\" [required]=\"true\"\r\n                                destinatarioIdNavio=\"0\" osgId=\"0\" stoContratoId=\"\" stoContratoItemId=\"0\"\r\n                                clienteObrigatorio=\"true\" clienteOuProdutoObrigatorio=\"false\"\r\n                                (outLote)=\"onSelectedLote($event)\">\r\n                            </app-pesquisa-lote>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"row\">\r\n                    <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"quantidDoc\" class=\"required\">{{ labelQuantidDoc | translate}}</label>\r\n                            <input id=\"quantidDoc\" name=\"quantidDoc\" [(ngModel)]=\"service.dataItem.quantidDoc\"\r\n                                (blur)=\"onTrataQuantidDoc()\" [disabled]=\"disabled\" class=\"form-control form-control-sm\"\r\n                                type=\"text\" currencyMask [options]=\"funcoesService.optionCurrency(0)\" required=\"true\">\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"pesoDocto\" class=\"required\">{{'labels.pesoDocto' | translate}}</label>\r\n                            <input id=\"pesoDocto\" name=\"pesoDocto\" [(ngModel)]=\"service.dataItem.pesoDoc\"\r\n                                (blur)=\"onTrataPesoDoc()\" [disabled]=\"disabled\" class=\"form-control form-control-sm\"\r\n                                type=\"text\" currencyMask [options]=\"funcoesService.optionCurrency(0)\" required>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"data\" class=\"required\">{{ \"labels.dataDocumento\" | translate\r\n                                }}</label>\r\n                            <app-data id=\"data\" name=\"dataDocumento\" [(ngModel)]=\"service.dataItem.dtDocumento\"\r\n                                (executa)=\"onTrataDtDocumento()\" [disabled]=\"disabled\">\r\n                            </app-data>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"row\">\r\n                    <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"docto\" class=\"required\">{{\"labels.documento\" |\r\n                                translate}}</label>\r\n                            <input type=\"text\" id=\"docto\" name=\"documento\" [(ngModel)]=\"service.dataItem.docto\"\r\n                                maxlength=\"9\" (keypress)=\"funcoesService.apenasNumeros($event)\"\r\n                                class=\"form-control form-control-sm text-right\" [disabled]=\"disabled\"\r\n                                (blur)=\"onTrataDocto()\" required />\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"serie\" class=\"required\">{{ \"labels.serie\" |\r\n                                translate\r\n                                }}</label>\r\n                            <app-combo-serie-nota id=\"serie\" name=\"serie\" [(ngModel)]=\"service.dataItem.serieNotaId\"\r\n                                required=\"true\" [disabled]=\"disabled\">\r\n                            </app-combo-serie-nota>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"totItem\" class=\"required\">{{\"labels.valorNF\" |\r\n                                translate}}</label>\r\n                            <input type=\"text\" id=\"totItem\" name=\"valorNF\" [(ngModel)]=\"service.dataItem.totItem\"\r\n                                class=\"form-control form-control-sm valor\" [disabled]=\"disabled\" currencyMask\r\n                                (blur)=\"onValidaValorNF()\" [options]=\"funcoesService.optionCurrency(2)\" />\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"dtEntregaNf\" class=\"required\">{{\"labels.dtEntregaNf\"\r\n                                |\r\n                                translate}}</label>\r\n                            <app-data-h-m id=\"dtEntregaNf\" name=\"dtEntregaNf\" [(ngModel)]=\"service.dataItem.dtEntregaNf\"\r\n                                (executa)=\"onTrataDtEntregaNf()\" [disabled]=\"disabled\">\r\n                            </app-data-h-m>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"row\">\r\n                    <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"cfop\" class=\"required\">{{\"labels.cfop\" |\r\n                                translate}}</label>\r\n                            <app-pesquisa-natureza id=\"cfop\" name=\"cfop\" flagVeiculo=\"S\"\r\n                                [(ngModel)]=\"service.dataItem.naturezaId\" [disabled]=\"disabled\">\r\n                            </app-pesquisa-natureza>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"row\">\r\n                    <div class=\"col-lg-12 col-md-12 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"observacao\">{{\"labels.observacao\" | translate}}</label>\r\n                            <textarea id=\"observacao\" name=\"observacao\" [(ngModel)]=\"service.dataItem.observacao\"\r\n                                class=\"form-control form-control-sm\" type=\"text\" rows=\"3\" [disabled]=\"disabled\"\r\n                                maxlength=\"200\"></textarea>\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]=\"disabled\">\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/cotriguacu/portaria/geracao/geracao-motorista-validade/geracao-motorista-validade.component.html":
/*!**************************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao-motorista-validade/geracao-motorista-validade.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=\"modal fade\" id=\"geracao-motorista-validade-dialog\" tabindex=\"-1\" role=\"dialog\" data-backdrop=\"static\">\r\n    <div class=\"modal-dialog modal-sm\">\r\n        <div class=\"modal-content\">\r\n            <div class=\"modal-header\">\r\n                <h6 class=\"modal-title\">{{ title | translate }}</h6>\r\n            </div>\r\n            <form class=\"form\" #frmEVValida=\"ngForm\">\r\n                <div class=\"modal-body\">\r\n                    <div class=\"row\">\r\n                        <div class=\"col-12\">\r\n                            <label style=\"font-weight:bold\">{{ label | translate}}</label>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"row\">\r\n                        <div class=\"col-12\">\r\n                            <div class=\"form-group\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <app-data id=\"data\" name=\"data\" [formatDateTime]=\"mascara.getFormatData\"\r\n                                        [(ngModel)]=\"dtParaValidar\">\r\n                                    </app-data>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"modal-footer\">\r\n                    <button type=\"submit\" class=\"btn btn-success btn-sm mr-1\" (click)=\"onSubmit(frmEVValida)\">{{ 'buttons.ok' |\r\n                        translate }}</button>\r\n                    <button type=\"button\" class=\"btn btn-default btn-sm\" (click)=\"close()\">{{ 'buttons.cancelar' |\r\n                        translate }}\r\n                    </button>\r\n                </div>\r\n            </form>\r\n        </div>\r\n    </div>\r\n</div>");

/***/ }),

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao-print-modal/geracao-print-modal.component.html":
/*!************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao-print-modal/geracao-print-modal.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=\"modal fade\" id=\"geracaoModalPrint\" tabindex=\"-1\" role=\"dialog\" data-backdrop=\"static\">\r\n  <div class=\"modal-dialog modal-sm\">\r\n    <div class=\"modal-content\">\r\n      <form class=\"form\" #frmPrint=\"ngForm\" (ngSubmit)=\"onSubmit(frmPrint)\">\r\n        <div class=\"modal-header\">\r\n          <h4 class=\"modal-title\">{{ 'titles.imprimir' | translate }}</h4>\r\n          <button type=\"button\" class=\"close\" aria-label=\"Close\" data-dismiss=\"modal\">\r\n            <span aria-hidden=\"true\">&times;</span>\r\n          </button>\r\n        </div>\r\n        <div class=\"modal-body\">\r\n          <div class=\"row\">\r\n            <div class=\"col-md-12\">\r\n              <div class=\"form-group form-group-sm\">\r\n                <label for=\"tipoImpressao\">{{'labels.tipoImpressao' | translate}}</label>\r\n                <select id=\"tipoImpressao\" name=\"tipoImpressao\" class=\"form-control form-control-sm\"\r\n                  [(ngModel)]=\"tipoSelecionado\">\r\n                  <option value=\"\">{{ 'labels.selecione' | translate}}</option>\r\n                  <option *ngFor=\"let tipo of tiposImpressao\" [value]=\"tipo.value\">{{ tipo.label | translate}}</option>\r\n                </select>\r\n              </div>\r\n            </div>\r\n          </div>\r\n        </div>\r\n        <div class=\"modal-footer\">\r\n          <button type=\"submit\" class=\"btn btn-small btn-success\" [disabled]=\"tipoSelecionado == ''\">{{ 'buttons.ok' |\r\n            translate }}</button>\r\n          <button type=\"button\" class=\"btn btn-small btn-default\" data-dismiss=\"modal\">{{ 'buttons.cancelar' | translate\r\n            }}</button>\r\n        </div>\r\n      </form>\r\n    </div>\r\n  </div>\r\n</div>");

/***/ }),

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

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GeracaoConfirmacaoChegadaComponent", function() { return GeracaoConfirmacaoChegadaComponent; });
/* 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 _geracao_confirmacao_chegada_model__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./geracao-confirmacao-chegada.model */ "./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao-confirmacao-chegada/geracao-confirmacao-chegada.model.ts");
/* harmony import */ var app_pages_cadastro_motorista_motorista_service__WEBPACK_IMPORTED_MODULE_12__ = __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_13__ = __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_14__ = __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_15__ = __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_16__ = __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 _geracao_constants__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../geracao.constants */ "./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao.constants.ts");
/* harmony import */ var _geracao_confirmacao_chegada_service__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./geracao-confirmacao-chegada.service */ "./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao-confirmacao-chegada/geracao-confirmacao-chegada.service.ts");
/* harmony import */ var app_pages_cadastro_destinatario_destinatario_model__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! app/pages/cadastro/destinatario/destinatario.model */ "./src/app/pages/cadastro/destinatario/destinatario.model.ts");
/* harmony import */ var app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_20__ = __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 GeracaoConfirmacaoChegadaComponent = /** @class */ (function (_super) {
    __extends(GeracaoConfirmacaoChegadaComponent, _super);
    function GeracaoConfirmacaoChegadaComponent(router, messages, funcoes, configuracao, permissoesUtils, motoristaService, destinatarioService, service, datatables, entradaVeiculoService) {
        var _this = _super.call(this, new _geracao_constants__WEBPACK_IMPORTED_MODULE_17__["GeracaoConstants"], 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 _geracao_confirmacao_chegada_model__WEBPACK_IMPORTED_MODULE_11__["ConfirmacaoChegada"]();
        _this.filtro = new _geracao_confirmacao_chegada_model__WEBPACK_IMPORTED_MODULE_11__["ConfirmacaoChegadaFilter"]();
        _this.filtroAltDadosPlanej = new _geracao_confirmacao_chegada_model__WEBPACK_IMPORTED_MODULE_11__["ConfimacaoChegadaAltDadosPlanejamento"]();
        _this.hasDados = false;
        _this.showFiltro = true;
        _this.intOsAtiva = false;
        _this.constantes = new _geracao_constants__WEBPACK_IMPORTED_MODULE_17__["GeracaoConstants"]();
        _this.parametrosConfig = [
            {
                sistema: 'REL', parametros: [
                    'IntOsAtiva'
                ]
            }
        ];
        _this.target = _this.funcoesService.getTargetLocation();
        _this.pageRoute = "/especificos/cotriguacu/portaria/geracao";
        _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.transitTime = _this.configuracao.lerConfig("PTR", "TransitTime");
        };
        _this.abrirCadMotorista = function () {
            if (!_this.data.motoristaId) {
                _this.funcoesService.openWindow('cadastro/motorista');
            }
            else {
                _this.funcoesService.openWindow("cadastro/motorista/detail/" + _this.data.motoristaId);
            }
        };
        _this.alteracaoDadosPlanejamento = function () { return __awaiter(_this, void 0, void 0, function () {
            var _this = this;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        if (!(this.data.webStoPlanejaVeiculoId > 0)) return [3 /*break*/, 10];
                        this.filtroAltDadosPlanej.destinatarioIdTransportadora = this.funcoesService.isNotUndefinedOrNull(this.data.destinatarioIdTransportadora) ? this.data.destinatarioIdTransportadora : 0;
                        if (!this.funcoesService.isNotUndefinedOrNull(this.filtroAltDadosPlanej.destinatarioIdTransportadora)) return [3 /*break*/, 2];
                        return [4 /*yield*/, this.destinatarioService.getById(+this.filtroAltDadosPlanej.destinatarioIdTransportadora).subscribe(function (r) {
                                _this.filtroAltDadosPlanej.transportadora = r;
                            })];
                    case 1:
                        _a.sent();
                        return [3 /*break*/, 3];
                    case 2:
                        this.filtroAltDadosPlanej.transportadora = new app_pages_cadastro_destinatario_destinatario_model__WEBPACK_IMPORTED_MODULE_19__["Destinatario"]();
                        _a.label = 3;
                    case 3:
                        this.filtroAltDadosPlanej.motoristaId = this.funcoesService.isNotUndefinedOrNull(this.data.motoristaId) ? this.data.motoristaId : 0;
                        if (!this.funcoesService.isNotUndefinedOrNull(this.filtroAltDadosPlanej.motoristaId)) return [3 /*break*/, 5];
                        return [4 /*yield*/, this.motoristaService.getMotoristaId(+this.filtroAltDadosPlanej.motoristaId).subscribe(function (ret) {
                                _this.filtroAltDadosPlanej.motorista = ret;
                                _this.filtroAltDadosPlanej.municipio = _this.funcoesService.isNotUndefinedOrNull(_this.filtroAltDadosPlanej.motorista.municipioId) ? _this.filtroAltDadosPlanej.motorista.municipioId : "";
                                _this.filtroAltDadosPlanej.estado = _this.funcoesService.isNotUndefinedOrNull(_this.filtroAltDadosPlanej.motorista.estadoId) ? _this.filtroAltDadosPlanej.motorista.estadoId : "";
                                _this.filtroAltDadosPlanej.fantasia = _this.funcoesService.isNotUndefinedOrNull(_this.filtroAltDadosPlanej.motorista.nome) ? _this.filtroAltDadosPlanej.motorista.nome : "";
                                _this.filtroAltDadosPlanej.rg = _this.funcoesService.isNotUndefinedOrNull(_this.filtroAltDadosPlanej.motorista.rg) ? _this.filtroAltDadosPlanej.motorista.rg : "";
                                _this.filtroAltDadosPlanej.cnh = _this.funcoesService.isNotUndefinedOrNull(_this.filtroAltDadosPlanej.motorista.cnh) ? _this.filtroAltDadosPlanej.motorista.cnh : "";
                                _this.filtroAltDadosPlanej.cgcCpf = _this.funcoesService.isNotUndefinedOrNull(_this.filtroAltDadosPlanej.motorista.cgcCpf) ? _this.filtroAltDadosPlanej.motorista.cgcCpf : "";
                                _this.filtroAltDadosPlanej.cnhValidade = _this.funcoesService.isNotUndefinedOrNull(_this.filtroAltDadosPlanej.motorista.cnhValidade) ? _this.filtroAltDadosPlanej.motorista.cnhValidade : "";
                                _this.filtroAltDadosPlanej.cnhValidadeAnt = _this.funcoesService.isNotUndefinedOrNull(_this.filtroAltDadosPlanej.motorista.cnhValidade) ? _this.filtroAltDadosPlanej.motorista.cnhValidade : "";
                            })];
                    case 4:
                        _a.sent();
                        return [3 /*break*/, 6];
                    case 5:
                        this.filtroAltDadosPlanej.motorista = new app_pages_cadastro_motorista_motorista_model__WEBPACK_IMPORTED_MODULE_15__["Motorista"]();
                        _a.label = 6;
                    case 6:
                        this.filtroAltDadosPlanej.destinatarioIdClienteVenda = this.funcoesService.isNotUndefinedOrNull(this.data.destinatarioIdCodCliente) ? this.data.destinatarioIdCodCliente : 0;
                        if (!this.funcoesService.isNotUndefinedOrNull(this.filtroAltDadosPlanej.destinatarioIdClienteVenda)) return [3 /*break*/, 8];
                        return [4 /*yield*/, this.destinatarioService.getById(this.filtroAltDadosPlanej.destinatarioIdClienteVenda).subscribe(function (r) {
                                _this.filtroAltDadosPlanej.clienteVenda = r;
                                _this.filtroAltDadosPlanej.municipio = r.municipio.toString();
                                _this.filtroAltDadosPlanej.estado = r.estadoId;
                            })];
                    case 7:
                        _a.sent();
                        return [3 /*break*/, 9];
                    case 8:
                        this.filtroAltDadosPlanej.clienteVenda = new app_pages_cadastro_destinatario_destinatario_model__WEBPACK_IMPORTED_MODULE_19__["Destinatario"]();
                        _a.label = 9;
                    case 9:
                        this.filtroAltDadosPlanej.entradaVeiculoId = this.funcoesService.isNotUndefinedOrNull(this.data.webStoPlanejaVeiculoId) ? this.data.webStoPlanejaVeiculoId : 0;
                        this.filtroAltDadosPlanej.cadastroPlacaIdCavalo = this.funcoesService.isNotUndefinedOrNull(this.data.cadastroPlacaIdCavalo) ? this.data.cadastroPlacaIdCavalo : "";
                        jQuery("#geracao-confirmacao-chegada-dialog").modal("show");
                        _a.label = 10;
                    case 10: return [2 /*return*/];
                }
            });
        }); };
        /* ---------------------- Funções Confirmar Chegada ---------------------- */
        _this.confirmaChegada = function () {
            if (!!_this.transitTime && app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_16__["NumberUtilsStaticService"].toNumber(_this.transitTime) === 0) {
                _this.messages.warning("titles.entradaVeiculo", "messages.operacaoNaoPermitidaByParam", { param: 'TransitTime = 0' });
                return;
            }
            if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_16__["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_16__["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_16__["NumberUtilsStaticService"].isNotPositive(_this.data.destinatarioIdCodCliente)) {
                _this.messages.confirm("titles.entradaVeiculo", "messages.desejaCadastrarCliente", null, function () { return _this.funcoesService.openWindow("cadastro/destinatario"); });
            }
            if (!_this.data.dtSaidaPatio) {
                _this.messages.confirm('titles.entradaVeiculo', "messages.veiculoSemDtSaidaPatioLiberarTransitTimeAssimMesmo", null, function () {
                    _this.executaconfirmaChegada();
                });
            }
            else {
                if (!!_this.transitTime) {
                    if (app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_20__["DateTimeUtilsStaticService"].menorAHoje(app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_20__["DateTimeUtilsStaticService"].addDays(_this.data.dtSaidaPatio, app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_16__["NumberUtilsStaticService"].toNumber(_this.transitTime)))) {
                        _this.messages.confirm('titles.entradaVeiculo', "messages.veiculoExcedeuTransitTimeDesejaLiberarEntrada", null, function () {
                            _this.executaconfirmaChegada();
                        });
                    }
                }
            }
            _this.executaconfirmaChegada();
        };
        router.events.subscribe(function (event) {
            var params = _this.funcoes.formParams.getParams(router, event);
            if (params) {
                _this.actionForm = params.action;
            }
        });
        return _this;
    }
    GeracaoConfirmacaoChegadaComponent.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; } },
            { action: 'alteracaoDadosPlanejamento', func: function () { return _this.alteracaoDadosPlanejamento; } }
        ]);
    };
    GeracaoConfirmacaoChegadaComponent.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) {
                _this.messages.warning("titles.entradaVeiculo", "messages.nenhumRegistroEncontrado");
                return;
            }
            setTimeout(function () {
                _this.datatables.toDataTable({ tableId: "dtChegada", columns: columns, data: data }, function (selected) { return _this.data = selected; }, function (_) { return _this.confirmaChegada(); });
            }, 250);
        });
    };
    GeracaoConfirmacaoChegadaComponent.prototype.onShowFiltro = function () {
        this.data = new _geracao_confirmacao_chegada_model__WEBPACK_IMPORTED_MODULE_11__["ConfirmacaoChegada"]();
        this.showFiltro = !this.showFiltro;
    };
    GeracaoConfirmacaoChegadaComponent.prototype.back = function () {
        this.router.navigate(["" + this.target + this.pageRoute]);
    };
    GeracaoConfirmacaoChegadaComponent.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_16__["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_16__["NumberUtilsStaticService"].isNotPositive(this.filtroAltDadosPlanej.destinatarioIdTransportadora)) {
                            this.messages.warning("titles.entradaVeiculo", "messages.atencaoTransportadoraNaoInformado");
                            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("#geracao-confirmacao-chegada-dialog").modal("hide");
                        return [2 /*return*/];
                }
            });
        });
    };
    GeracaoConfirmacaoChegadaComponent.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_15__["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];
                }
            });
        });
    };
    GeracaoConfirmacaoChegadaComponent.prototype.executaconfirmaChegada = function () {
        var _this = this;
        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.cliCotrPtrEntradaVeiculoId]);
                                return [2 /*return*/];
                            }
                            message = this.messages.validationResult(ret.validationResult)[0];
                            if (message !== "")
                                this.messages.warning("titles.entradaVeiculo", message);
                        }
                        return [2 /*return*/];
                }
            });
        }); });
    };
    GeracaoConfirmacaoChegadaComponent.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_12__["MotoristaService"] },
        { type: app_pages_cadastro_destinatario_destinatario_service__WEBPACK_IMPORTED_MODULE_13__["DestinatarioService"] },
        { type: _geracao_confirmacao_chegada_service__WEBPACK_IMPORTED_MODULE_18__["GeracaoConfirmacaoChegadaService"] },
        { type: app_shared_services_datatables_datatables_service__WEBPACK_IMPORTED_MODULE_9__["DatatablesService"] },
        { type: app_pages_veiculo_entrada_veiculo_entrada_veiculo_service__WEBPACK_IMPORTED_MODULE_14__["EntradaVeiculoService"] }
    ]; };
    GeracaoConfirmacaoChegadaComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
            selector: 'app-geracao-confirmacao-chegada',
            template: __importDefault(__webpack_require__(/*! raw-loader!./geracao-confirmacao-chegada.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao-confirmacao-chegada/geracao-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_12__["MotoristaService"],
            app_pages_cadastro_destinatario_destinatario_service__WEBPACK_IMPORTED_MODULE_13__["DestinatarioService"],
            _geracao_confirmacao_chegada_service__WEBPACK_IMPORTED_MODULE_18__["GeracaoConfirmacaoChegadaService"],
            app_shared_services_datatables_datatables_service__WEBPACK_IMPORTED_MODULE_9__["DatatablesService"],
            app_pages_veiculo_entrada_veiculo_entrada_veiculo_service__WEBPACK_IMPORTED_MODULE_14__["EntradaVeiculoService"]])
    ], GeracaoConfirmacaoChegadaComponent);
    return GeracaoConfirmacaoChegadaComponent;
}(app_shared_components_corporate_base_base_permissoes__WEBPACK_IMPORTED_MODULE_4__["BasePermissoes"]));



/***/ }),

/***/ "./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao-confirmacao-chegada/geracao-confirmacao-chegada.model.ts":
/*!********************************************************************************************************************************!*\
  !*** ./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao-confirmacao-chegada/geracao-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/cotriguacu/portaria/geracao/geracao-confirmacao-chegada/geracao-confirmacao-chegada.service.ts":
/*!**********************************************************************************************************************************!*\
  !*** ./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao-confirmacao-chegada/geracao-confirmacao-chegada.service.ts ***!
  \**********************************************************************************************************************************/
/*! exports provided: GeracaoConfirmacaoChegadaService */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GeracaoConfirmacaoChegadaService", function() { return GeracaoConfirmacaoChegadaService; });
/* 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 GeracaoConfirmacaoChegadaService = /** @class */ (function () {
    function GeracaoConfirmacaoChegadaService(http) {
        this.http = http;
    }
    GeracaoConfirmacaoChegadaService.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));
    };
    GeracaoConfirmacaoChegadaService.prototype.gravaEvConfirmacaoChegada = function (data) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_3__["environment"].specifics_service_url + "/api/v1/cotriguacu/geracao/gravaEvConfirmacaoChegada", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_2__["ErrorHandler"].handleError));
    };
    GeracaoConfirmacaoChegadaService.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));
    };
    GeracaoConfirmacaoChegadaService.ctorParameters = function () { return [
        { type: _angular_common_http__WEBPACK_IMPORTED_MODULE_0__["HttpClient"] }
    ]; };
    GeracaoConfirmacaoChegadaService = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"])({
            providedIn: "root"
        }),
        __metadata("design:paramtypes", [_angular_common_http__WEBPACK_IMPORTED_MODULE_0__["HttpClient"]])
    ], GeracaoConfirmacaoChegadaService);
    return GeracaoConfirmacaoChegadaService;
}());



/***/ }),

/***/ "./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao-filter/geracao-filter.component.ts":
/*!**********************************************************************************************************!*\
  !*** ./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao-filter/geracao-filter.component.ts ***!
  \**********************************************************************************************************/
/*! exports provided: GeracaoFilterComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GeracaoFilterComponent", function() { return GeracaoFilterComponent; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _geracao_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../geracao.service */ "./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao.service.ts");
/* harmony import */ var app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_2__ = __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_3__ = __webpack_require__(/*! app/shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_4__ = __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_modal_utils_modal_utils_static_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! app/shared/services/funcoes/modal-utils/modal-utils.static.service */ "./src/app/shared/services/funcoes/modal-utils/modal-utils.static.service.ts");
/* harmony import */ var app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_6__ = __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 __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 GeracaoFilterComponent = /** @class */ (function () {
    function GeracaoFilterComponent(messageService, service, funcoesService) {
        this.messageService = messageService;
        this.service = service;
        this.funcoesService = funcoesService;
        this.filtrar = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
    }
    GeracaoFilterComponent.prototype.ngOnInit = function () {
    };
    GeracaoFilterComponent.prototype.onSubmit = function (form) {
        app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_4__["EventEmitterService"].get('formError').emit(form);
        if (form.invalid) {
            return;
        }
        if (!this.validaData(true)) {
            return;
        }
        this.filtrar.emit(true);
        app_shared_services_funcoes_modal_utils_modal_utils_static_service__WEBPACK_IMPORTED_MODULE_5__["ModalUtilsStaticService"].closeModal('geracao-filter-dialog');
    };
    GeracaoFilterComponent.prototype.outMaterial = function (material) {
        if (!material)
            return;
        this.service.filtro.material = material;
    };
    GeracaoFilterComponent.prototype.validaData = function (all) {
        if (all === void 0) { all = false; }
        if (app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_6__["DateTimeUtilsStaticService"].menorA(this.service.filtro.dataF, this.service.filtro.dataI, ['H', 'M', 'S'])) {
            this.messageService.warning("titles.geracao", "messages.periodoDeMenorQueAte");
            return false;
        }
        if (all) {
            if (!this.service.filtro.dataF || !this.service.filtro.dataI || (this.service.filtro.dataF.toString() === "Invalid Date") || (this.service.filtro.dataI.toString() === "Invalid Date")) {
                this.messageService.warning("titles.geracao", "messages.periodoNaoPreenchidoOuInvalido");
                return false;
            }
        }
        return true;
    };
    GeracaoFilterComponent.ctorParameters = function () { return [
        { type: app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_3__["MessageService"] },
        { type: _geracao_service__WEBPACK_IMPORTED_MODULE_1__["GeracaoService"] },
        { type: app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_2__["FuncoesService"] }
    ]; };
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"])(),
        __metadata("design:type", Object)
    ], GeracaoFilterComponent.prototype, "filtrar", void 0);
    GeracaoFilterComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
            selector: "app-geracao-filter",
            template: __importDefault(__webpack_require__(/*! raw-loader!./geracao-filter.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao-filter/geracao-filter.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_3__["MessageService"],
            _geracao_service__WEBPACK_IMPORTED_MODULE_1__["GeracaoService"],
            app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_2__["FuncoesService"]])
    ], GeracaoFilterComponent);
    return GeracaoFilterComponent;
}());



/***/ }),

/***/ "./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao-form/geracao-form.component.ts":
/*!******************************************************************************************************!*\
  !*** ./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao-form/geracao-form.component.ts ***!
  \******************************************************************************************************/
/*! exports provided: GeracaoFormComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GeracaoFormComponent", function() { return GeracaoFormComponent; });
/* 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_material_material_service__WEBPACK_IMPORTED_MODULE_4__ = __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_5__ = __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_6__ = __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_7__ = __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_8__ = __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_9__ = __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_10__ = __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_11__ = __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_12__ = __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_13__ = __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_14__ = __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_15__ = __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_16__ = __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_17__ = __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_18__ = __webpack_require__(/*! app/shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var _geracao_constants__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../geracao.constants */ "./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao.constants.ts");
/* harmony import */ var _geracao_model__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../geracao.model */ "./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao.model.ts");
/* harmony import */ var _geracao_service__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../geracao.service */ "./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao.service.ts");
/* harmony import */ var app_pages_cadastro_material_material_model__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! app/pages/cadastro/material/material.model */ "./src/app/pages/cadastro/material/material.model.ts");
/* harmony import */ var _geracao_form_validation__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./geracao-form.validation */ "./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao-form/geracao-form.validation.ts");
/* harmony import */ var app_pages_cadastro_destinatario_destinatario_service__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! app/pages/cadastro/destinatario/destinatario.service */ "./src/app/pages/cadastro/destinatario/destinatario.service.ts");
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/* harmony import */ var app_pages_cadastro_cartao_veiculo_cartao_veiculo_service__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! app/pages/cadastro/cartao-veiculo/cartao-veiculo.service */ "./src/app/pages/cadastro/cartao-veiculo/cartao-veiculo.service.ts");
/* harmony import */ var app_pages_veiculo_check_list_check_list_facade__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! app/pages/veiculo/check-list/check-list.facade */ "./src/app/pages/veiculo/check-list/check-list.facade.ts");
/* harmony import */ var _geracao_item_geracao_item_validation__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../geracao-item/geracao-item.validation */ "./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao-item/geracao-item.validation.ts");
/* harmony import */ var app_pages_veiculo_check_list_check_list_item_check_list_item_service__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! app/pages/veiculo/check-list/check-list-item/check-list-item.service */ "./src/app/pages/veiculo/check-list/check-list-item/check-list-item.service.ts");
/* harmony import */ var app_pages_cadastro_tanque_tanque_service__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! app/pages/cadastro/tanque/tanque.service */ "./src/app/pages/cadastro/tanque/tanque.service.ts");
/* harmony import */ var app_pages_cadastro_lote_lote_service__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! app/pages/cadastro/lote/lote.service */ "./src/app/pages/cadastro/lote/lote.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 GeracaoFormComponent = /** @class */ (function (_super) {
    __extends(GeracaoFormComponent, _super);
    function GeracaoFormComponent(router, message, service, configuracao, permissoesUtils, loginService, funcoes, tipoOperacaoVeiculoService, serviceTipoVeiculo, cadastroPlacaService, materialService, motoristaService, destinatarioService, activatedRoute, entradaVeiculoService, cartaoVeiculoService, checkListItemService, checkListFacade, tanqueService, loteService) {
        var _this = _super.call(this, new _geracao_constants__WEBPACK_IMPORTED_MODULE_19__["GeracaoConstants"](), 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.materialService = materialService;
        _this.motoristaService = motoristaService;
        _this.destinatarioService = destinatarioService;
        _this.activatedRoute = activatedRoute;
        _this.entradaVeiculoService = entradaVeiculoService;
        _this.cartaoVeiculoService = cartaoVeiculoService;
        _this.checkListItemService = checkListItemService;
        _this.checkListFacade = checkListFacade;
        _this.tanqueService = tanqueService;
        _this.loteService = loteService;
        _this.constantes = new _geracao_constants__WEBPACK_IMPORTED_MODULE_19__["GeracaoConstants"]();
        _this.mensagens = [];
        _this.mascara = new app_config_enumerables__WEBPACK_IMPORTED_MODULE_2__["Mascaras"]();
        _this.placaCadastrada = false;
        _this.isValidaMotorista = true;
        _this.isShowConfirmaNormasSeguranca = false;
        _this.efetuouBiometria = false;
        _this.target = _this.funcoes.getTargetLocation();
        _this.pageRoute = "/especificos/cotriguacu/portaria/geracao";
        _this.loadConfig = function () {
            _this.service.configs.maskPlaca = _this.configuracao.lerConfig("BAL", "MaskPlaca");
            _this.service.configs.intCta = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_13__["BooleanUtilsStaticService"].toBoolean(_this.configuracao.lerConfig("BAL", "IntCta"));
            _this.service.configs.cWebModCheckList = _this.configuracao.lerConfig("WEB", "CWebModCheckList");
            _this.service.configs.cWebModPev = _this.configuracao.lerConfig("WEB", "CWebModPev");
            _this.service.configs.cWebModCheckIn = _this.configuracao.lerConfig("WEB", "CWebModCheckIn");
            _this.service.configs.impChkGeracao = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_13__["BooleanUtilsStaticService"].toBoolean(_this.configuracao.lerConfig("PTR", "ImpChkGeracao"));
            _this.service.configs.impPevGeracao = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_13__["BooleanUtilsStaticService"].toBoolean(_this.configuracao.lerConfig("PTR", "ImpPevGeracao"));
            _this.service.configs.impCheckinGeracao = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_13__["BooleanUtilsStaticService"].toBoolean(_this.configuracao.lerConfig("PTR", "ImpCheckinGeracao"));
            _this.service.configs.prefixoRelEspecifico = _this.configuracao.lerConfig("WEB", "PrefixoRelEspecifico");
            _this.service.configs.solicitaNumCartao = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_13__["BooleanUtilsStaticService"].toBoolean(_this.configuracao.lerConfig("CTV", "SolicitaNumCartao"));
        };
        router.events.subscribe(function (event) {
            var params = _this.funcoes.formParams.getParams(router, event);
            if (params) {
                _this.actionForm = params.action;
            }
        });
        _this.validation = new _geracao_form_validation__WEBPACK_IMPORTED_MODULE_23__["GeracaoFormValidation"](message, funcoes, configuracao, tipoOperacaoVeiculoService, service, cadastroPlacaService, entradaVeiculoService, cartaoVeiculoService);
        _this.validationItem = new _geracao_item_geracao_item_validation__WEBPACK_IMPORTED_MODULE_28__["GeracaoItemValidation"](message, funcoes, configuracao, service, checkListItemService, tanqueService, loteService);
        return _this;
    }
    GeracaoFormComponent.prototype.ngOnInit = function () {
        var _this = this;
        this.configuracao.getConfig(this.constantes.parametrosConfig, this.loadConfig);
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, this.permissoesUtils.getLibRotina(this.actionForm), 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*/, 3];
                        id = this.activatedRoute.snapshot.paramMap.get("id");
                        if (!id) return [3 /*break*/, 2];
                        _a = this.service;
                        return [4 /*yield*/, this.service._getById(id).toPromise()];
                    case 1:
                        _a.data = _b.sent();
                        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.geracao', m.message); });
                            this.router.navigate(["" + this.target + this.pageRoute]);
                        }
                        else {
                            this.trataDados();
                        }
                        return [3 /*break*/, 3];
                    case 2:
                        this.service.data = new _geracao_model__WEBPACK_IMPORTED_MODULE_20__["Geracao"]();
                        _b.label = 3;
                    case 3: return [2 /*return*/];
                }
            });
        }); }, function () { return _this.permissoesUtils.back(); }, true);
    };
    GeracaoFormComponent.prototype.trataDados = function () {
        var _this = this;
        Object(rxjs__WEBPACK_IMPORTED_MODULE_25__["forkJoin"])([
            this.materialService.getById(this.service.data.materialId)
        ]).subscribe(function (resp) {
            _this.service.data.material = !!resp[0] ? resp[0] : new app_pages_cadastro_material_material_model__WEBPACK_IMPORTED_MODULE_22__["Material"]();
        });
    };
    GeracaoFormComponent.prototype.edit = function () {
        var _this = this;
        if (!this.service.validaSePodeEditar(this.service.data))
            return;
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 2, function () { return __awaiter(_this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                if (this.funcoesService.isPositive(this.service.data.cliCotrPtrEntradaVeiculoId)) {
                    this.router.navigate(["" + this.target + this.pageRoute + "/edit/" + this.service.data.cliCotrPtrEntradaVeiculoId]);
                }
                return [2 /*return*/];
            });
        }); });
    };
    GeracaoFormComponent.prototype.outMotivaMotorista = function (ok) {
        var _this = this;
        if (ok) {
            this.checkListFacade.confirmaAprovacao(this.service.data.codCheckList, function () { return _this.processoConcluidoComSucesso(_this.service.data); });
        }
        else {
            this.message.warning("titles.geracao", "messages.falhaAoMotivarMotorista");
            this.executeExclusao();
        }
    };
    GeracaoFormComponent.prototype.executeExclusao = function () {
        return __awaiter(this, void 0, void 0, function () {
            var ret;
            var _this = this;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.service.executaExclusao(this.service.data).toPromise()];
                    case 1:
                        ret = _a.sent();
                        if (!ret.isValid) {
                            ret.erros.forEach(function (m) { return _this.message.warning('titles.geracao', m.message); });
                            return [2 /*return*/];
                        }
                        return [2 /*return*/];
                }
            });
        });
    };
    Object.defineProperty(GeracaoFormComponent.prototype, "mascaraPlaca", {
        get: function () {
            if (app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_17__["StringUtilsStaticService"].isNotEmpty(this.service.configs.maskPlaca) && !this.service.data.motorista.isEstrangeiro) {
                return this.mascara.mapMascaraCutomizada(this.service.configs.maskPlaca);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GeracaoFormComponent.prototype, "maxLengthPlaca", {
        get: function () {
            return !!this.mascaraPlaca ? this.mascaraPlaca.length : 18;
        },
        enumerable: true,
        configurable: true
    });
    GeracaoFormComponent.prototype.trataMaterial = function (material) {
        if (!material)
            return;
        this.service.data.material = material;
    };
    GeracaoFormComponent.prototype.trataTransportadora = function (transportadora) {
        if (!transportadora)
            return;
        this.service.data.transportadora = transportadora;
    };
    GeracaoFormComponent.prototype.trataMotorista = function (motorista) {
        return __awaiter(this, void 0, void 0, function () {
            var _a, valDocsMotorista;
            return __generator(this, function (_b) {
                switch (_b.label) {
                    case 0:
                        if (!motorista)
                            return [2 /*return*/];
                        _a = this.service.data;
                        return [4 /*yield*/, this.motoristaService.getMotoristaId(motorista.motoristaId).toPromise()];
                    case 1:
                        _a.motorista = _b.sent();
                        return [4 /*yield*/, this.validation.validaDocumentosMotorista()];
                    case 2:
                        valDocsMotorista = _b.sent();
                        if (valDocsMotorista) {
                            app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_11__["EventEmitterService"].get('emiGeracaoMotoristaValidade').emit();
                            this.isValidaMotorista = false;
                        }
                        return [2 /*return*/];
                }
            });
        });
    };
    Object.defineProperty(GeracaoFormComponent.prototype, "exibeCamposExtrasMotorista", {
        get: function () {
            return (!!this.service.data.motorista && !!this.service.data.motoristaId && !!this.service.data.motorista.nome);
        },
        enumerable: true,
        configurable: true
    });
    GeracaoFormComponent.prototype.preSave = function () {
        this.service.data.lastre = app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_17__["StringUtilsStaticService"].isEmpty(this.service.data.lastre) ? 'C' : this.service.data.lastre;
        this.service.data.dtGeracao = !!this.service.data.dtGeracao ? this.service.data.dtGeracao : new Date();
        this.service.data.cadastroPlacaIdCavalo = app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_17__["StringUtilsStaticService"].toUpperOrUndefined(this.service.data.cadastroPlacaIdCavalo);
        this.service.data.cadastroPlacaIdCarreta1 = app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_17__["StringUtilsStaticService"].toUpperOrUndefined(this.service.data.cadastroPlacaIdCarreta1);
        this.service.data.cadastroPlacaIdCarreta2 = app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_17__["StringUtilsStaticService"].toUpperOrUndefined(this.service.data.cadastroPlacaIdCarreta2);
    };
    GeracaoFormComponent.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 () { return __awaiter(_this, void 0, void 0, function () {
                    var validations, _i, _a, item, validationsItens;
                    var _this = this;
                    return __generator(this, function (_b) {
                        switch (_b.label) {
                            case 0:
                                app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_11__["EventEmitterService"].get("msgDados").emit(form);
                                if (form.invalid) {
                                    this.funcoesService.backToTop();
                                    return [2 /*return*/];
                                }
                                return [4 /*yield*/, this.validation.getValidations()];
                            case 1:
                                validations = _b.sent();
                                if (app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_12__["ArrayUtilsStaticService"].any(validations)) {
                                    app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_11__["EventEmitterService"].get("backError").emit(validations.map(function (c) { return c.message; }));
                                    this.funcoesService.backToTop();
                                    return [2 /*return*/];
                                }
                                ;
                                _i = 0, _a = this.service.data.entradaVeiculoItems;
                                _b.label = 2;
                            case 2:
                                if (!(_i < _a.length)) return [3 /*break*/, 5];
                                item = _a[_i];
                                return [4 /*yield*/, this.validationItem.getValidations(item)];
                            case 3:
                                validationsItens = _b.sent();
                                if (app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_12__["ArrayUtilsStaticService"].any(validationsItens)) {
                                    app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_11__["EventEmitterService"].get("backError").emit(validationsItens.map(function (c) { return c.message; }));
                                    this.funcoesService.backToTop();
                                    return [2 /*return*/];
                                }
                                _b.label = 4;
                            case 4:
                                _i++;
                                return [3 /*break*/, 2];
                            case 5:
                                this.preSave();
                                this.service.data.logRotina = "Manut. Portaria Geração";
                                this.service
                                    .save(this.service.data, this.funcoesService.isEdit(this.actionForm))
                                    .subscribe(function (result) { return __awaiter(_this, void 0, void 0, function () {
                                    var valDocsMotorista;
                                    return __generator(this, function (_a) {
                                        switch (_a.label) {
                                            case 0:
                                                if (!!result.validationResult.isValid) return [3 /*break*/, 3];
                                                this.mensagens = this.message.validationResult(result.validationResult);
                                                app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_11__["EventEmitterService"].get("backError").emit(this.mensagens);
                                                this.funcoesService.backToTop();
                                                if (!this.isValidaMotorista) return [3 /*break*/, 2];
                                                return [4 /*yield*/, this.validation.validaDocumentosMotorista()];
                                            case 1:
                                                valDocsMotorista = _a.sent();
                                                if (!!valDocsMotorista) {
                                                    app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_11__["EventEmitterService"].get('emiGeracaoMotoristaValidade').emit();
                                                    this.isValidaMotorista = false;
                                                }
                                                _a.label = 2;
                                            case 2: return [3 /*break*/, 4];
                                            case 3:
                                                this.service.data = result;
                                                this.isValidaMotorista = true;
                                                if (this.service.configs.intCta) {
                                                    this.executeMotivaMotorista(result);
                                                }
                                                else {
                                                    this.processoConcluidoComSucesso(result);
                                                }
                                                _a.label = 4;
                                            case 4: return [2 /*return*/];
                                        }
                                    });
                                }); });
                                return [2 /*return*/];
                        }
                    });
                }); });
                return [2 /*return*/];
            });
        });
    };
    GeracaoFormComponent.prototype.processoConcluidoComSucesso = function (result) {
        this.onBack();
        if (result.regControle > 0) {
            this.message.success("titles.geracao", "messages.geracaoArmazenagemConcluidaComSucesso");
            this._print(result);
        }
        else {
            this.message.saveSuccess("titles.geracao");
        }
    };
    GeracaoFormComponent.prototype._print = function (result) {
        return __awaiter(this, void 0, void 0, function () {
            var error_1;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        _a.trys.push([0, 7, , 8]);
                        if (!this.service.configs.impChkGeracao) return [3 /*break*/, 2];
                        return [4 /*yield*/, this.printCheckList(result)];
                    case 1:
                        _a.sent();
                        _a.label = 2;
                    case 2:
                        if (!this.service.configs.impCheckinGeracao) return [3 /*break*/, 4];
                        return [4 /*yield*/, this.printCheckIn(result)];
                    case 3:
                        _a.sent();
                        _a.label = 4;
                    case 4:
                        if (!this.service.configs.impPevGeracao) return [3 /*break*/, 6];
                        return [4 /*yield*/, this.printPev(result)];
                    case 5:
                        _a.sent();
                        _a.label = 6;
                    case 6: return [3 /*break*/, 8];
                    case 7:
                        error_1 = _a.sent();
                        console.error('Erro ao processar reports:', error_1);
                        return [3 /*break*/, 8];
                    case 8: return [2 /*return*/];
                }
            });
        });
    };
    GeracaoFormComponent.prototype.printCheckList = function (result) {
        return __awaiter(this, void 0, void 0, function () {
            var isCheckListEspecifico;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        if (!this.service.configs.cWebModCheckList) {
                            this.message.warning("titles.geracao", "messages.modCheckListNaoConfigurado");
                            return [2 /*return*/];
                        }
                        if (!result || !result.codCheckList)
                            return [2 /*return*/];
                        isCheckListEspecifico = (this.service.configs.cWebModCheckList.indexOf(this.service.configs.prefixoRelEspecifico) == 0);
                        return [4 /*yield*/, this.funcoesService.reportInvoc.exportReportPdf(isCheckListEspecifico, this.service.configs.cWebModCheckList, this.constantes.reportTitulo, {
                                filialId: this.loginService.getLogin().filialId,
                                codCheckList: result.codCheckList,
                                fileName: "CheckList" + result.codCheckList
                            })];
                    case 1:
                        _a.sent();
                        return [2 /*return*/];
                }
            });
        });
    };
    GeracaoFormComponent.prototype.printCheckIn = function (result) {
        return __awaiter(this, void 0, void 0, function () {
            var isModCheckInEspecifico;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        if (!this.service.configs.cWebModCheckIn) {
                            this.message.warning("titles.geracao", "messages.modCheckInNaoConfigurado");
                            return [2 /*return*/];
                        }
                        if (!result || !result.regControle)
                            return [2 /*return*/];
                        isModCheckInEspecifico = (this.service.configs.cWebModCheckIn.indexOf(this.service.configs.prefixoRelEspecifico) == 0);
                        return [4 /*yield*/, this.funcoesService.reportInvoc.exportReportPdf(isModCheckInEspecifico, this.service.configs.cWebModCheckIn, this.constantes.reportTitulo, {
                                filialId: this.loginService.getLogin().filialId,
                                regControle: result.regControle,
                                fileName: "CheckIn" + result.regControle
                            })];
                    case 1:
                        _a.sent();
                        return [2 /*return*/];
                }
            });
        });
    };
    GeracaoFormComponent.prototype.printPev = function (result) {
        return __awaiter(this, void 0, void 0, function () {
            var isPevEspecifico;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        if (!this.service.configs.cWebModPev) {
                            this.message.warning("titles.geracao", "messages.modPevNaoConfigurado");
                            return [2 /*return*/];
                        }
                        if (!result || !result.regControle)
                            return [2 /*return*/];
                        isPevEspecifico = (this.service.configs.cWebModPev.indexOf(this.service.configs.prefixoRelEspecifico) == 0);
                        return [4 /*yield*/, this.funcoesService.reportInvoc.exportReportPdf(isPevEspecifico, this.service.configs.cWebModPev, this.constantes.reportTitulo, {
                                filialId: this.loginService.getLogin().filialId,
                                entradaVeiculoId: result.regControle,
                                operador: this.loginService.getLogin().usuario,
                                fileName: "PEV" + result.regControle
                            })];
                    case 1:
                        _a.sent();
                        return [2 /*return*/];
                }
            });
        });
    };
    GeracaoFormComponent.prototype.executeMotivaMotorista = function (data) {
        if (data.regControle > 0)
            app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_11__["EventEmitterService"].get('emiMotivaMotorista').emit({ entradaVeiculoId: data.regControle });
    };
    GeracaoFormComponent.prototype.onTrataPesoTara = function () {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                this.validation.onTrataPesoTara();
                return [2 /*return*/];
            });
        });
    };
    GeracaoFormComponent.prototype.cancelar = function (isBack) {
        var _this = this;
        if (isBack === void 0) { isBack = false; }
        if (this.funcoesService.isPositive(this.service.data.regControle) && !isBack) {
            var m = this.message.translate('messages.confirmaCancelamento', { rotina: 'Entrada do Veículo' });
            this.message.confirm('titles.geracao', 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.geracao', m); });
                    }
                    else {
                        _this.onBack();
                    }
                });
            }, false, function () {
                _this.onBack();
            });
        }
        else {
            this.onBack();
        }
    };
    GeracaoFormComponent.prototype.checkChaveCTe = function () {
        return __awaiter(this, void 0, void 0, function () {
            var cteValido;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.validation.validaConhecimento()];
                    case 1:
                        cteValido = _a.sent();
                        if (cteValido) {
                            this.service.data.serieCTE = this.funcoes.getSerieNota(this.service.data.chaveCTE);
                            this.service.data.numeroCTE = +this.funcoes.getNumeroNota(this.service.data.chaveCTE);
                        }
                        else {
                            this.service.data.chaveCTE = "";
                            this.service.data.serieCTE = "";
                            this.service.data.numeroCTE = null;
                        }
                        return [2 /*return*/];
                }
            });
        });
    };
    GeracaoFormComponent.prototype.back = function () {
        this.cancelar(true);
    };
    GeracaoFormComponent.prototype.onBack = function () {
        this.funcoesService.desabilitarFiltro();
        this.router.navigate(["" + this.target + this.pageRoute]);
    };
    GeracaoFormComponent.ctorParameters = function () { return [
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"] },
        { type: app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_18__["MessageService"] },
        { type: _geracao_service__WEBPACK_IMPORTED_MODULE_21__["GeracaoService"] },
        { type: app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_14__["ConfiguracaoFacade"] },
        { type: app_shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_16__["PermissoesUtilsService"] },
        { type: app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_8__["LoginService"] },
        { type: app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_15__["FuncoesService"] },
        { type: app_pages_cadastro_tipo_operacao_veiculo_tipo_operacao_veiculo_service__WEBPACK_IMPORTED_MODULE_6__["TipoOperacaoVeiculoService"] },
        { type: app_pages_cadastro_tipo_veiculo_tipo_veiculo_service__WEBPACK_IMPORTED_MODULE_7__["TipoVeiculoService"] },
        { type: app_pages_cadastro_cadastro_placa_cadastro_placa_service__WEBPACK_IMPORTED_MODULE_3__["CadastroPlacaService"] },
        { type: app_pages_cadastro_material_material_service__WEBPACK_IMPORTED_MODULE_4__["MaterialService"] },
        { type: app_pages_cadastro_motorista_motorista_service__WEBPACK_IMPORTED_MODULE_5__["MotoristaService"] },
        { type: app_pages_cadastro_destinatario_destinatario_service__WEBPACK_IMPORTED_MODULE_24__["DestinatarioService"] },
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_1__["ActivatedRoute"] },
        { type: app_pages_veiculo_entrada_veiculo_entrada_veiculo_service__WEBPACK_IMPORTED_MODULE_9__["EntradaVeiculoService"] },
        { type: app_pages_cadastro_cartao_veiculo_cartao_veiculo_service__WEBPACK_IMPORTED_MODULE_26__["CartaoVeiculoService"] },
        { type: app_pages_veiculo_check_list_check_list_item_check_list_item_service__WEBPACK_IMPORTED_MODULE_29__["CheckListItemService"] },
        { type: app_pages_veiculo_check_list_check_list_facade__WEBPACK_IMPORTED_MODULE_27__["CheckListFacade"] },
        { type: app_pages_cadastro_tanque_tanque_service__WEBPACK_IMPORTED_MODULE_30__["TanqueService"] },
        { type: app_pages_cadastro_lote_lote_service__WEBPACK_IMPORTED_MODULE_31__["LoteService"] }
    ]; };
    GeracaoFormComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
            selector: "app-geracao-form",
            template: __importDefault(__webpack_require__(/*! raw-loader!./geracao-form.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao-form/geracao-form.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_18__["MessageService"],
            _geracao_service__WEBPACK_IMPORTED_MODULE_21__["GeracaoService"],
            app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_14__["ConfiguracaoFacade"],
            app_shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_16__["PermissoesUtilsService"],
            app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_8__["LoginService"],
            app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_15__["FuncoesService"],
            app_pages_cadastro_tipo_operacao_veiculo_tipo_operacao_veiculo_service__WEBPACK_IMPORTED_MODULE_6__["TipoOperacaoVeiculoService"],
            app_pages_cadastro_tipo_veiculo_tipo_veiculo_service__WEBPACK_IMPORTED_MODULE_7__["TipoVeiculoService"],
            app_pages_cadastro_cadastro_placa_cadastro_placa_service__WEBPACK_IMPORTED_MODULE_3__["CadastroPlacaService"],
            app_pages_cadastro_material_material_service__WEBPACK_IMPORTED_MODULE_4__["MaterialService"],
            app_pages_cadastro_motorista_motorista_service__WEBPACK_IMPORTED_MODULE_5__["MotoristaService"],
            app_pages_cadastro_destinatario_destinatario_service__WEBPACK_IMPORTED_MODULE_24__["DestinatarioService"],
            _angular_router__WEBPACK_IMPORTED_MODULE_1__["ActivatedRoute"],
            app_pages_veiculo_entrada_veiculo_entrada_veiculo_service__WEBPACK_IMPORTED_MODULE_9__["EntradaVeiculoService"],
            app_pages_cadastro_cartao_veiculo_cartao_veiculo_service__WEBPACK_IMPORTED_MODULE_26__["CartaoVeiculoService"],
            app_pages_veiculo_check_list_check_list_item_check_list_item_service__WEBPACK_IMPORTED_MODULE_29__["CheckListItemService"],
            app_pages_veiculo_check_list_check_list_facade__WEBPACK_IMPORTED_MODULE_27__["CheckListFacade"],
            app_pages_cadastro_tanque_tanque_service__WEBPACK_IMPORTED_MODULE_30__["TanqueService"],
            app_pages_cadastro_lote_lote_service__WEBPACK_IMPORTED_MODULE_31__["LoteService"]])
    ], GeracaoFormComponent);
    return GeracaoFormComponent;
}(app_shared_components_corporate_base_base_permissoes__WEBPACK_IMPORTED_MODULE_10__["BasePermissoes"]));



/***/ }),

/***/ "./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao-form/geracao-form.validation.ts":
/*!*******************************************************************************************************!*\
  !*** ./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao-form/geracao-form.validation.ts ***!
  \*******************************************************************************************************/
/*! exports provided: GeracaoFormValidation */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GeracaoFormValidation", function() { return GeracaoFormValidation; });
/* harmony import */ var app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_0__ = __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_1__ = __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_funcoes_object_utils_object_utils_static_service__WEBPACK_IMPORTED_MODULE_2__ = __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_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_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_4__ = __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 rxjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/* 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_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_7__ = __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 __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 GeracaoFormValidation = /** @class */ (function () {
    function GeracaoFormValidation(message, funcoes, configuracao, tipoOperacaoVeiculoService, service, cadastroPlacaService, entradaVeiculoService, cartaoVeiculoService) {
        this.message = message;
        this.funcoes = funcoes;
        this.configuracao = configuracao;
        this.tipoOperacaoVeiculoService = tipoOperacaoVeiculoService;
        this.service = service;
        this.cadastroPlacaService = cadastroPlacaService;
        this.entradaVeiculoService = entradaVeiculoService;
        this.cartaoVeiculoService = cartaoVeiculoService;
        this.rs = [];
    }
    GeracaoFormValidation.prototype.getValidations = function () {
        return __awaiter(this, void 0, void 0, function () {
            var validaNumCracha;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        this.rs = [];
                        this.test(this.validaPesoTara());
                        return [4 /*yield*/, this.validaNumCracha()];
                    case 1:
                        validaNumCracha = _a.sent();
                        return [4 /*yield*/, this.test(validaNumCracha)];
                    case 2:
                        _a.sent();
                        this.test(this.validaChaveCte());
                        this.test(this.validaDtTriagem());
                        this.test(this.validaSeExisteItens());
                        return [2 /*return*/, this.rs.filter(function (v) { return v["isValid"] === false; })];
                }
            });
        });
    };
    GeracaoFormValidation.prototype.test = function (f) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                if (!!f)
                    this.rs.push(f);
                return [2 /*return*/];
            });
        });
    };
    GeracaoFormValidation.prototype.onTrataPesoTara = function () {
        return this.validaPesoTara(true)['isValid'];
    };
    GeracaoFormValidation.prototype.validaDtTriagem = function (showError) {
        if (showError === void 0) { showError = false; }
        var r = { "isValid": true, "message": "" };
        var dtTriagem = this.funcoes.isBoolean(this.configuracao.lerConfig("CTV", "DtTriagem"));
        if (dtTriagem && app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_7__["DateTimeUtilsStaticService"].maiorAHoje(this.service.data.dtTriagem)) {
            r.isValid = false;
            r.message = this.message.translate("messages.dtTriagemNaoPodeSerMaiorDataAtual");
        }
        if (!r.isValid && showError) {
            this.message.warning("titles.geracao", r.message);
        }
        return r;
    };
    GeracaoFormValidation.prototype.validaPesoTara = function (showError) {
        if (showError === void 0) { showError = false; }
        var r = { "isValid": true, "message": "" };
        if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["NumberUtilsStaticService"].isNotPositive(this.service.data.pesoTara)) {
            r.isValid = false;
            r.message = this.message.translate("messages.campoObrigatorio", { name: this.message.translate("labels.pesoTara") });
        }
        if (!r.isValid && showError) {
            this.message.warning("titles.geracao", r.message);
        }
        return r;
    };
    GeracaoFormValidation.prototype.validaDocumentosMotorista = function () {
        return __awaiter(this, void 0, void 0, function () {
            var cnh$, restricao$, veiculoAberto$, resp;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        cnh$ = this.entradaVeiculoService.validaVencimentoCnhMotorista(+this.service.data.motoristaId);
                        restricao$ = this.entradaVeiculoService.getVerifSeExisteRestricaoMotoristaPlaca({
                            "regControle": this.service.data.regControle,
                            "motorista": this.service.data.motoristaId,
                            "tipoVerif": 'M',
                            "placa": this.service.data.cadastroPlacaIdCavalo
                        });
                        veiculoAberto$ = this.entradaVeiculoService.getVerifSeMotoristaTemEVEmAberto({
                            "regControle": this.service.data.regControle,
                            "motorista": this.service.data.motoristaId
                        });
                        return [4 /*yield*/, Object(rxjs__WEBPACK_IMPORTED_MODULE_5__["forkJoin"])([cnh$, restricao$, veiculoAberto$]).toPromise()];
                    case 1:
                        resp = _a.sent();
                        this.service.errosDocMotorista[0].isValid = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_3__["BooleanUtilsStaticService"].toBoolean(resp[0].isValid);
                        this.service.errosDocMotorista[0].message = app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_4__["ArrayUtilsStaticService"].any(resp[0].erros) ? this.message.validationResult(resp[0])[0] : "";
                        this.service.errosDocMotorista[0].data = undefined;
                        this.service.errosDocMotorista[0].question = resp[0].message === 'PERGUNTAR';
                        this.service.errosDocMotorista[1].isValid = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_3__["BooleanUtilsStaticService"].toBoolean(resp[1].isValid);
                        this.service.errosDocMotorista[1].message = app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_4__["ArrayUtilsStaticService"].any(resp[1].erros) ? this.message.validationResult(resp[1])[0] : "";
                        this.service.errosDocMotorista[1].data = undefined;
                        this.service.errosDocMotorista[2].isValid = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_3__["BooleanUtilsStaticService"].toBoolean(resp[2].isValid);
                        this.service.errosDocMotorista[2].message = app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_4__["ArrayUtilsStaticService"].any(resp[2].erros) ? this.message.validationResult(resp[2])[0] : "";
                        this.service.errosDocMotorista[2].data = undefined;
                        return [2 /*return*/, true];
                }
            });
        });
    };
    GeracaoFormValidation.prototype.validaMotorista = function (event) {
        if (!!event) {
            switch (event.tipoDoc) {
                case 'CNH':
                    this.service.data.motorista.cnhValidade = event.data;
                    this.service.data.dtValidade = event.data;
                    this.service.data.gravaValidade = 'S';
                    break;
                case 'MOPP':
                    this.service.data.motorista.dtMopp = event.data;
                    break;
                case 'NR20':
                    this.service.data.motorista.dtCursoNr20 = event.data;
                    break;
                case 'NR35':
                    this.service.data.motorista.dtCursoNr35 = event.data;
                    break;
                case 'DOCDIG':
                case 'RESTRICAO':
                case 'VEICULOABERTO':
                case 'INATIVO':
                default:
                    break;
            }
            app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_6__["EventEmitterService"].get('emiGeracaoMotoristaValidade').emit();
        }
    };
    GeracaoFormValidation.prototype.validaNumCracha = function (showError) {
        if (showError === void 0) { showError = false; }
        return __awaiter(this, void 0, void 0, function () {
            var r, solicitaNumCartao, result, cartaoVeiculo;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        r = { "isValid": true, "message": "" };
                        solicitaNumCartao = this.funcoes.isBoolean(this.configuracao.lerConfig("CTV", "SolicitaNumCartao"));
                        if (!(solicitaNumCartao && app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_1__["StringUtilsStaticService"].isNotEmpty(this.service.data.numCracha) && this.service.data.numCracha !== '9999')) return [3 /*break*/, 2];
                        return [4 /*yield*/, this.entradaVeiculoService.getVerificaSeCrachaEstaSendoUsado({
                                "regControle": +this.service.data.regControle,
                                "numCracha": this.service.data.numCracha,
                                "numCracha2": "",
                                "cartao": 1,
                                "codLocalOper": 0
                            }).toPromise()];
                    case 1:
                        result = _a.sent();
                        r.isValid = !!result.validationResult ? result.validationResult.isValid : true;
                        r.message = result.message;
                        _a.label = 2;
                    case 2:
                        if (!r.isValid) return [3 /*break*/, 4];
                        if (app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_1__["StringUtilsStaticService"].isEmpty(this.service.data.numCracha))
                            return [2 /*return*/];
                        return [4 /*yield*/, this.cartaoVeiculoService.getById(this.service.data.numCracha).toPromise()];
                    case 3:
                        cartaoVeiculo = _a.sent();
                        if (app_shared_services_funcoes_object_utils_object_utils_static_service__WEBPACK_IMPORTED_MODULE_2__["ObjectUtilsStaticService"].defined(cartaoVeiculo)) {
                            if (cartaoVeiculo.idCartao < '10' || cartaoVeiculo.idCartao === 'ERROCARTAO') {
                                r.isValid = false;
                                r.message = this.message.translate("messages.verificarIdCartao", { numCracha: this.service.data.numCracha });
                            }
                        }
                        else {
                            r.isValid = false;
                            r.message = this.message.translate("messages.cartaoNaoCadastrado");
                        }
                        _a.label = 4;
                    case 4:
                        if (!r.isValid && showError) {
                            this.message.warning("titles.geracao", r.message);
                            this.service.data.numCracha = "";
                        }
                        return [2 /*return*/, r];
                }
            });
        });
    };
    GeracaoFormValidation.prototype.validaConhecimento = function () {
        return __awaiter(this, void 0, void 0, function () {
            var validation;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.validaChaveCte(true)];
                    case 1:
                        validation = _a.sent();
                        return [2 /*return*/, validation.isValid];
                }
            });
        });
    };
    GeracaoFormValidation.prototype.validaChaveCte = function (showError) {
        if (showError === void 0) { showError = false; }
        if (!this.service.data.chaveCTE)
            return;
        this.service.data.numeroCTE = app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["NumberUtilsStaticService"].isPositive(this.service.data.numeroCTE) ? this.service.data.numeroCTE : 0;
        this.service.data.serieCTE = !!this.service.data.serieCTE ? this.service.data.serieCTE : "";
        var r = { "isValid": true, "message": "" };
        if (!this.funcoes.validaChaveNFe(this.service.data.chaveCTE, null, this.service.data.numeroCTE, this.service.data.serieCTE)) {
            r.isValid = false;
            r.message = "messages.chaveCteInvalida";
        }
        else {
            if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["NumberUtilsStaticService"].toNumber(this.service.data.transportadora.cgcCpf) !== parseInt(this.service.data.chaveCTE.substring(6, 20), 0)) {
                r.isValid = false;
                r.message = "messages.chaveCteNaoPertenceEstaTransportadora";
            }
        }
        if (!r.isValid && showError) {
            this.message.warning("titles.geracao", r.message);
        }
        return r;
    };
    GeracaoFormValidation.prototype.validaSeExisteItens = function (showError) {
        if (showError === void 0) { showError = false; }
        var r = { "isValid": true, "message": "" };
        if (!this.service.data.entradaVeiculoItems || this.service.data.entradaVeiculoItems.length === 0) {
            r.isValid = false;
            r.message = this.message.translate("messages.nenhumItemCadastrado");
        }
        else {
            var validItems = this.service.data.entradaVeiculoItems.filter(function (item) { return item.sitReg !== 'E'; });
            if (validItems.length === 0) {
                r.isValid = false;
                r.message = this.message.translate("messages.nenhumItemCadastrado");
            }
        }
        if (!r.isValid && showError) {
            this.message.warning("titles.geracao", r.message);
        }
        return r;
    };
    GeracaoFormValidation.prototype.validaPlaca = function (ordem, showError) {
        if (showError === void 0) { showError = false; }
        return __awaiter(this, void 0, void 0, function () {
            var placas, rs, obrigaCadPlaca, placa;
            var _this = this;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        placas = [
                            app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_1__["StringUtilsStaticService"].removeCaracteres(this.service.data.cadastroPlacaIdCavalo),
                            app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_1__["StringUtilsStaticService"].removeCaracteres(this.service.data.cadastroPlacaIdCarreta1),
                            app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_1__["StringUtilsStaticService"].removeCaracteres(this.service.data.cadastroPlacaIdCarreta2)
                        ];
                        rs = [];
                        if (!app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_1__["StringUtilsStaticService"].isEmpty(placas[ordem])) return [3 /*break*/, 1];
                        return [2 /*return*/, rs];
                    case 1:
                        obrigaCadPlaca = this.funcoes.isBoolean(this.configuracao.lerConfig("CTV", "ObrigaCadPlaca"));
                        if (!obrigaCadPlaca) return [3 /*break*/, 3];
                        return [4 /*yield*/, this.cadastroPlacaService.getById(placas[ordem]).toPromise()];
                    case 2:
                        placa = _a.sent();
                        if (!app_shared_services_funcoes_object_utils_object_utils_static_service__WEBPACK_IMPORTED_MODULE_2__["ObjectUtilsStaticService"].defined(placa) || placa.tipoPlaca === 'I') {
                            this.message.warning("titles.geracao", this.message.translate("messages.placaNaoCadastrada", { placa: placas[ordem] }));
                            this.limparPlaca(ordem);
                        }
                        else {
                            this.entradaVeiculoService.validaPlaca(app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["NumberUtilsStaticService"].toNumber(this.service.data.regControle), this.service.data.tipoTransp, placas[+ordem], +ordem, app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["NumberUtilsStaticService"].toNumber(this.service.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.geracao", messages[0]);
                                            }
                                            this.limparPlaca(ordem);
                                            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_0__["NumberUtilsStaticService"].toNumber(this.service.data.regControle),
                                                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.geracao", e); });
                                                    }
                                                }
                                            }
                                            messages.forEach(function (e) { return rs.push({ "isValid": isValid, "message": ret_1.msg }); });
                                            if (ret_1.outContinua === "N" && showError) {
                                                this.message.warning("titles.geracao", ret_1.msg);
                                                return [2 /*return*/];
                                            }
                                            if (ret_1.outContinua === "P") {
                                                this.message.confirm('titles.geracao', ret_1.msg, null, function () { }, false, function () {
                                                    _this.limparPlaca(ordem);
                                                });
                                            }
                                            _a.label = 3;
                                        case 3: return [2 /*return*/];
                                    }
                                });
                            }); });
                        }
                        _a.label = 3;
                    case 3: return [2 /*return*/];
                }
            });
        });
    };
    GeracaoFormValidation.prototype.limparPlaca = function (ordem) {
        if (ordem === 0)
            this.service.data.cadastroPlacaIdCavalo = "";
        if (ordem === 1)
            this.service.data.cadastroPlacaIdCarreta1 = "";
        if (ordem === 2)
            this.service.data.cadastroPlacaIdCarreta2 = "";
    };
    return GeracaoFormValidation;
}());



/***/ }),

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

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GeracaoIndexComponent", function() { return GeracaoIndexComponent; });
/* 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 _geracao_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../geracao.constants */ "./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao.constants.ts");
/* harmony import */ var _geracao_model__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../geracao.model */ "./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao.model.ts");
/* harmony import */ var _geracao_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../geracao.service */ "./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao.service.ts");
/* harmony import */ var app_shared_components_corporate_base_base_permissoes__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! app/shared/components/corporate/base/base.permissoes */ "./src/app/shared/components/corporate/base/base.permissoes.ts");
/* harmony import */ var app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! app/shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_7__ = __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_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_8__ = __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_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_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_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! app/shared/services/funcoes/funcoes.service */ "./src/app/shared/services/funcoes/funcoes.service.ts");
/* harmony import */ var app_pages_cadastro_situacao_veiculo_situacao_veiculo_service__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! app/pages/cadastro/situacao-veiculo/situacao-veiculo.service */ "./src/app/pages/cadastro/situacao-veiculo/situacao-veiculo.service.ts");
/* harmony import */ var app_shared_services_funcoes_modal_utils_modal_utils_static_service__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! app/shared/services/funcoes/modal-utils/modal-utils.static.service */ "./src/app/shared/services/funcoes/modal-utils/modal-utils.static.service.ts");
/* harmony import */ var app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_14__ = __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_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_15__ = __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_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! app/shared/services/event-emitter/event-emitter.service */ "./src/app/shared/services/event-emitter/event-emitter.service.ts");
/* harmony import */ var app_pages_veiculo_check_list_check_list_facade__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! app/pages/veiculo/check-list/check-list.facade */ "./src/app/pages/veiculo/check-list/check-list.facade.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 GeracaoIndexComponent = /** @class */ (function (_super) {
    __extends(GeracaoIndexComponent, _super);
    function GeracaoIndexComponent(router, message, service, configuracao, permissoesUtils, datatables, loginService, funcoes, serviceSituacao, checkListFacade) {
        var _this = _super.call(this, new _geracao_constants__WEBPACK_IMPORTED_MODULE_2__["GeracaoConstants"](), funcoes) || this;
        _this.router = router;
        _this.message = message;
        _this.service = service;
        _this.configuracao = configuracao;
        _this.permissoesUtils = permissoesUtils;
        _this.datatables = datatables;
        _this.loginService = loginService;
        _this.funcoes = funcoes;
        _this.serviceSituacao = serviceSituacao;
        _this.checkListFacade = checkListFacade;
        _this.data = new _geracao_model__WEBPACK_IMPORTED_MODULE_3__["Geracao"]();
        _this.constantes = new _geracao_constants__WEBPACK_IMPORTED_MODULE_2__["GeracaoConstants"]();
        _this.mensagens = [];
        _this.target = _this.funcoes.getTargetLocation();
        _this.pageRoute = "/especificos/cotriguacu/portaria/geracao";
        _this.loadConfig = function () {
            _this.service.configs.cWebModCheckList = _this.configuracao.lerConfig("WEB", "CWebModCheckList");
            _this.service.configs.cWebModPev = _this.configuracao.lerConfig("WEB", "CWebModPev");
            _this.service.configs.cWebModCheckIn = _this.configuracao.lerConfig("WEB", "CWebModCheckIn");
            _this.service.configs.prefixoRelEspecifico = _this.configuracao.lerConfig("WEB", "PrefixoRelEspecifico");
        };
        _this.confirmacaoChegada = function () {
            _this.permissoesUtils.verificaRotina(_this.constantes.sisFormularioId, 8, function () { return __awaiter(_this, void 0, void 0, function () {
                return __generator(this, function (_a) {
                    this.router.navigate(["" + this.target + this.pageRoute + "/chegada"]);
                    return [2 /*return*/];
                });
            }); });
        };
        _this.reenviarMotivacao = function () {
            _this.permissoesUtils.verificaRotina(_this.constantes.sisFormularioId, 9, function () {
                if (_this.data.cliCotrPtrEntradaVeiculoId > 0)
                    app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_16__["EventEmitterService"].get('emiMotivaMotorista').emit({ entradaVeiculoId: _this.data.regControle });
                else
                    _this.refresh();
            });
        };
        return _this;
    }
    GeracaoIndexComponent.prototype.ngOnInit = function () {
        var _this = this;
        this.configuracao.getConfig(this.constantes.parametrosConfig, this.loadConfig);
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 4, function () { return __awaiter(_this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        if (!!this.loginService.isTokenExpired()) return [3 /*break*/, 3];
                        if (!this.funcoesService.abrirFiltro) return [3 /*break*/, 1];
                        this.service.filtro = new _geracao_model__WEBPACK_IMPORTED_MODULE_3__["GeracaoFilter"]();
                        this.filtrar();
                        return [3 /*break*/, 3];
                    case 1: return [4 /*yield*/, this.refresh()];
                    case 2:
                        _a.sent();
                        _a.label = 3;
                    case 3: return [2 /*return*/];
                }
            });
        }); }, function () { return _this.permissoesUtils.back(); }, true);
        _super.prototype.addFuncoes.call(this, [
            { action: 'confirmacaoChegada', func: function () { return _this.confirmacaoChegada; } },
            { action: 'reenviarMotivacao', func: function () { return _this.reenviarMotivacao; } },
        ]);
    };
    GeracaoIndexComponent.prototype.refresh = function () {
        return __awaiter(this, void 0, void 0, function () {
            var _this = this;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        this.data = new _geracao_model__WEBPACK_IMPORTED_MODULE_3__["Geracao"]();
                        this.trataBotoes();
                        return [4 /*yield*/, this.service.getByFiltro(this.service.filtro).subscribe(function (data) {
                                var columns = [
                                    _this.datatables.getDataStringAlignRight("cliCotrPtrEntradaVeiculoId", "registro"),
                                    _this.datatables.getDataDateTime("dtGeracao", "dtGeracao", "DD/MM/YYYY HH:mm:ss", "15%"),
                                    _this.datatables.getDataString("materialFantasia", "produto"),
                                    _this.datatables.getDataString("nomeMotorista", "motorista"),
                                    _this.datatables.getDataString("transportadoraFantasia", "transportadora"),
                                    _this.datatables.getDataString("descrTipoVeiculo", "tipoVeiculo"),
                                    _this.datatables.getDataString("placaCavalo", "placaCavalo"),
                                    _this.datatables.getDataDateTime("dtTriagem", "dtTriagem", "DD/MM/YYYY HH:mm:ss", "15%"),
                                ];
                                _this.datatables.toDataTable({ tableId: "dTableGeracao", columns: columns, data: data, columnOrder: 1, orientationOrder: app_shared_services_datatables_datatables_service__WEBPACK_IMPORTED_MODULE_9__["EOrientationOrder"].DESC }, function (aData) {
                                    _this.data = aData;
                                    _this.trataBotoes();
                                });
                            })];
                    case 1:
                        _a.sent();
                        return [2 /*return*/];
                }
            });
        });
    };
    GeracaoIndexComponent.prototype.create = function () {
        var _this = this;
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 1, function () {
            _this.router.navigate(["" + _this.target + _this.pageRoute + "/create"]);
        });
    };
    GeracaoIndexComponent.prototype.properties = function () {
        var _this = this;
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 6, function () {
            _super.prototype.properties.call(_this, _this.data);
        });
    };
    GeracaoIndexComponent.prototype.permissoes = function () {
        var _this = this;
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 7, function () {
            _super.prototype.permissoes.call(_this, _this.constantes);
        });
    };
    GeracaoIndexComponent.prototype.filtrar = function () {
        app_shared_services_funcoes_modal_utils_modal_utils_static_service__WEBPACK_IMPORTED_MODULE_13__["ModalUtilsStaticService"].openModal("geracao-filter-dialog");
    };
    GeracaoIndexComponent.prototype.filtra = function () {
        this.refresh();
    };
    GeracaoIndexComponent.prototype.detail = function () {
        this.router.navigate(["" + this.target + this.pageRoute + "/detail/" + this.data.cliCotrPtrEntradaVeiculoId]);
    };
    GeracaoIndexComponent.prototype.edit = function () {
        var _this = this;
        if (!this.service.validaSePodeEditar(this.data))
            return;
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 2, function () { return __awaiter(_this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                if (this.funcoesService.isPositive(this.data.cliCotrPtrEntradaVeiculoId)) {
                    this.router.navigate(["" + this.target + this.pageRoute + "/edit/" + this.data.cliCotrPtrEntradaVeiculoId]);
                }
                return [2 /*return*/];
            });
        }); });
    };
    GeracaoIndexComponent.prototype.print = function () {
        if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_15__["NumberUtilsStaticService"].isPositive(this.data.cliCotrPtrEntradaVeiculoId)) {
            this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 5, function () { return app_shared_services_funcoes_modal_utils_modal_utils_static_service__WEBPACK_IMPORTED_MODULE_13__["ModalUtilsStaticService"].openModal("geracaoModalPrint"); });
        }
        else {
            this.message.warning("titles.geracao", "messages.selecioneUmRegistro");
        }
    };
    GeracaoIndexComponent.prototype.confirmaImpressao = function (tipoImpressao) {
        switch (tipoImpressao) {
            case "dadosIndex":
                this.printDadosIndex();
                break;
            case "checkList":
                this.printCheckList();
                break;
            case "checkIn":
                this.printCheckIn();
                break;
            case "pev":
                this.printPev();
                break;
            default:
                break;
        }
    };
    GeracaoIndexComponent.prototype.printCheckList = function () {
        if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_15__["NumberUtilsStaticService"].isPositive(this.data.codCheckList)) {
            if (!this.service.configs.cWebModCheckList) {
                this.message.warning("titles.geracao", "messages.modCheckListNaoConfigurado");
                return;
            }
            var isCheckListEspecifico = (this.service.configs.cWebModCheckList.indexOf(this.service.configs.prefixoRelEspecifico) == 0);
            if (isCheckListEspecifico) {
                this.funcoes.reportInvoc.invocaRelatorioEspecificos(this.service.configs.cWebModCheckList, this.constantes.reportTitulo, {
                    filialId: this.loginService.getLogin().filialId,
                    codCheckList: this.data.codCheckList
                });
            }
            else {
                this.funcoes.reportInvoc.invocaRelatorio(this.service.configs.cWebModCheckList, this.constantes.reportTitulo, {
                    filialId: this.loginService.getLogin().filialId,
                    codCheckList: this.data.codCheckList
                });
            }
        }
        else {
            this.message.warning("titles.geracao", "messages.checkListNaoLocalizada");
        }
    };
    GeracaoIndexComponent.prototype.printCheckIn = function () {
        if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_15__["NumberUtilsStaticService"].isPositive(this.data.regControle)) {
            if (!this.service.configs.cWebModCheckIn) {
                this.message.warning("titles.geracao", "messages.modCheckInNaoConfigurado");
                return;
            }
            var isModCheckInEspecifico = (this.service.configs.cWebModCheckIn.indexOf(this.service.configs.prefixoRelEspecifico) == 0);
            if (isModCheckInEspecifico) {
                this.funcoes.reportInvoc.invocaRelatorioEspecificos(this.service.configs.cWebModCheckIn, this.constantes.reportTitulo, {
                    filialId: this.loginService.getLogin().filialId,
                    regControle: this.data.regControle
                });
            }
            else {
                this.funcoes.reportInvoc.invocaRelatorio(this.service.configs.cWebModCheckIn, this.constantes.reportTitulo, {
                    filialId: this.loginService.getLogin().filialId,
                    regControle: this.data.regControle
                });
            }
        }
        else {
            this.message.warning("titles.geracao", "messages.registroNaoLocalizado");
        }
    };
    GeracaoIndexComponent.prototype.printPev = function () {
        if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_15__["NumberUtilsStaticService"].isPositive(this.data.regControle)) {
            if (!this.service.configs.cWebModPev) {
                this.message.warning("titles.geracao", "messages.modPevNaoConfigurado");
                return;
            }
            var isPevEspecifico = (this.service.configs.cWebModPev.indexOf(this.service.configs.prefixoRelEspecifico) == 0);
            if (isPevEspecifico) {
                this.funcoes.reportInvoc.invocaRelatorioEspecificos(this.service.configs.cWebModPev, this.constantes.reportTitulo, {
                    filialId: this.loginService.getLogin().filialId,
                    entradaVeiculoId: this.data.regControle,
                    operador: this.loginService.getLogin().usuario
                });
            }
            else {
                this.funcoes.reportInvoc.invocaRelatorio(this.service.configs.cWebModPev, this.constantes.reportTitulo, {
                    filialId: this.loginService.getLogin().filialId,
                    entradaVeiculoId: this.data.regControle,
                    operador: this.loginService.getLogin().usuario
                });
            }
        }
        else {
            this.message.warning("titles.geracao", "messages.registroNaoLocalizado");
        }
    };
    GeracaoIndexComponent.prototype.printDadosIndex = function () {
        if (!this.printParams())
            return;
        _super.prototype.print.call(this, null, true);
    };
    GeracaoIndexComponent.prototype.printParams = function () {
        this.constantes.paramRelatorio = {
            filialId: this.loginService.getLogin().filialId,
            dataI: this.service.filtro.dataI,
            dataF: this.service.filtro.dataF,
            materialId: app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_14__["StringUtilsStaticService"].toString(this.service.filtro.materialId),
            destinatarioTransportadoraId: app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_15__["NumberUtilsStaticService"].toNumber(this.service.filtro.destinatarioTransportadoraId),
            motoristaId: app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_15__["NumberUtilsStaticService"].toNumber(this.service.filtro.motoristaId),
            cadastroPlacaId: app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_14__["StringUtilsStaticService"].toString(this.service.filtro.cadastroPlacaId),
            cliCotrPtrEntradaVeiculoId: app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_15__["NumberUtilsStaticService"].toNumber(this.service.filtro.cliCotrPtrEntradaVeiculoId),
            tipoVeiculoId: app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_15__["NumberUtilsStaticService"].toNumber(this.service.filtro.tipoVeiculoId)
        };
        return true;
    };
    GeracaoIndexComponent.prototype.trataBotoes = function () {
        this.buttonDisabled('listaIndex', 'reenviarMotivacao', !(this.data.cliCotrPtrEntradaVeiculoId > 0));
    };
    GeracaoIndexComponent.prototype.outMotivaMotorista = function (ok) {
        var _this = this;
        if (ok)
            this.checkListFacade.confirmaAprovacao(this.data.codCheckList, function () { return _this.refresh(); });
    };
    GeracaoIndexComponent.ctorParameters = function () { return [
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"] },
        { type: app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_6__["MessageService"] },
        { type: _geracao_service__WEBPACK_IMPORTED_MODULE_4__["GeracaoService"] },
        { type: app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_7__["ConfiguracaoFacade"] },
        { type: app_shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_8__["PermissoesUtilsService"] },
        { type: app_shared_services_datatables_datatables_service__WEBPACK_IMPORTED_MODULE_9__["DatatablesService"] },
        { type: app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_10__["LoginService"] },
        { type: app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_11__["FuncoesService"] },
        { type: app_pages_cadastro_situacao_veiculo_situacao_veiculo_service__WEBPACK_IMPORTED_MODULE_12__["SituacaoVeiculoService"] },
        { type: app_pages_veiculo_check_list_check_list_facade__WEBPACK_IMPORTED_MODULE_17__["CheckListFacade"] }
    ]; };
    GeracaoIndexComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
            selector: "app-geracao-index",
            template: __importDefault(__webpack_require__(/*! raw-loader!./geracao-index.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao-index/geracao-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_6__["MessageService"],
            _geracao_service__WEBPACK_IMPORTED_MODULE_4__["GeracaoService"],
            app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_7__["ConfiguracaoFacade"],
            app_shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_8__["PermissoesUtilsService"],
            app_shared_services_datatables_datatables_service__WEBPACK_IMPORTED_MODULE_9__["DatatablesService"],
            app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_10__["LoginService"],
            app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_11__["FuncoesService"],
            app_pages_cadastro_situacao_veiculo_situacao_veiculo_service__WEBPACK_IMPORTED_MODULE_12__["SituacaoVeiculoService"],
            app_pages_veiculo_check_list_check_list_facade__WEBPACK_IMPORTED_MODULE_17__["CheckListFacade"]])
    ], GeracaoIndexComponent);
    return GeracaoIndexComponent;
}(app_shared_components_corporate_base_base_permissoes__WEBPACK_IMPORTED_MODULE_5__["BasePermissoes"]));



/***/ }),

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

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GeracaoItemComponent", function() { return GeracaoItemComponent; });
/* harmony import */ var _shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../../../../../../shared/services/funcoes/number-utils/number-utils.static.service */ "./src/app/shared/services/funcoes/number-utils/number-utils.static.service.ts");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/fesm5/router.js");
/* harmony import */ var app_pages_cadastro_destinatario_destinatario_model__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! app/pages/cadastro/destinatario/destinatario.model */ "./src/app/pages/cadastro/destinatario/destinatario.model.ts");
/* harmony import */ var app_pages_cadastro_destinatario_destinatario_service__WEBPACK_IMPORTED_MODULE_4__ = __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_5__ = __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_6__ = __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_7__ = __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_8__ = __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_9__ = __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_10__ = __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_11__ = __webpack_require__(/*! app/shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var _geracao_service__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./../geracao.service */ "./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao.service.ts");
/* harmony import */ var _geracao_model__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../geracao.model */ "./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao.model.ts");
/* harmony import */ var _geracao_item_validation__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./geracao-item.validation */ "./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao-item/geracao-item.validation.ts");
/* harmony import */ var app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! app/shared/services/funcoes/configuracao/configuracao.facade */ "./src/app/shared/services/funcoes/configuracao/configuracao.facade.ts");
/* harmony import */ var _geracao_constants__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../geracao.constants */ "./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao.constants.ts");
/* harmony import */ var app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_17__ = __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_pages_cadastro_lote_lote_model__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! app/pages/cadastro/lote/lote.model */ "./src/app/pages/cadastro/lote/lote.model.ts");
/* harmony import */ var app_pages_veiculo_check_list_check_list_item_check_list_item_service__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! app/pages/veiculo/check-list/check-list-item/check-list-item.service */ "./src/app/pages/veiculo/check-list/check-list-item/check-list-item.service.ts");
/* harmony import */ var app_pages_cadastro_tipo_documento_transp_tipo_documento_transp_service__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! app/pages/cadastro/tipo-documento-transp/tipo-documento-transp.service */ "./src/app/pages/cadastro/tipo-documento-transp/tipo-documento-transp.service.ts");
/* harmony import */ var app_pages_cadastro_tanque_tanque_model__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! app/pages/cadastro/tanque/tanque.model */ "./src/app/pages/cadastro/tanque/tanque.model.ts");
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/* harmony import */ var app_pages_cadastro_lote_lote_service__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! app/pages/cadastro/lote/lote.service */ "./src/app/pages/cadastro/lote/lote.service.ts");
/* harmony import */ var app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_24__ = __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");
/* harmony import */ var app_pages_cadastro_material_fornecedor_material_fornecedor_service__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! app/pages/cadastro/material-fornecedor/material-fornecedor.service */ "./src/app/pages/cadastro/material-fornecedor/material-fornecedor.service.ts");
/* harmony import */ var app_shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_26__ = __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_pages_cadastro_tanque_tanque_service__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! app/pages/cadastro/tanque/tanque.service */ "./src/app/pages/cadastro/tanque/tanque.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 GeracaoItemComponent = /** @class */ (function () {
    function GeracaoItemComponent(router, materialService, message, service, funcoesService, configuracao, destinatarioService, loginService, activatedRoute, entradaVeiculoService, checkListItemService, tipoDocumentoTranspService, loteService, materialFornecedorService, permissoesUtils, tanqueService) {
        var _this = this;
        this.router = router;
        this.materialService = materialService;
        this.message = message;
        this.service = service;
        this.funcoesService = funcoesService;
        this.configuracao = configuracao;
        this.destinatarioService = destinatarioService;
        this.loginService = loginService;
        this.activatedRoute = activatedRoute;
        this.entradaVeiculoService = entradaVeiculoService;
        this.checkListItemService = checkListItemService;
        this.tipoDocumentoTranspService = tipoDocumentoTranspService;
        this.loteService = loteService;
        this.materialFornecedorService = materialFornecedorService;
        this.permissoesUtils = permissoesUtils;
        this.tanqueService = tanqueService;
        this.detail = false;
        this.constantes = new _geracao_constants__WEBPACK_IMPORTED_MODULE_16__["GeracaoConstants"]();
        this.mensagens = [];
        this.xmlImportado = false;
        this.loadConfig = function () {
            _this.service.configs.depositoADefinir = _this.configuracao.lerConfig("BAL", "DepositoADefinir");
            _this.service.configs.calculaTotalNF = _this.configuracao.boolean("BAL", "CalculaTotalNF");
            _this.service.configs.tQIsotanque = _this.configuracao.lerConfig("STO", "TQIsotanque");
        };
        this.validation = new _geracao_item_validation__WEBPACK_IMPORTED_MODULE_14__["GeracaoItemValidation"](message, funcoesService, configuracao, service, checkListItemService, tanqueService, loteService);
    }
    GeracaoItemComponent.prototype.ngOnInit = function () {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                this.configuracao.getConfig(this.constantes.parametrosConfig, this.loadConfig);
                this.service.showTable = true;
                return [2 /*return*/];
            });
        });
    };
    GeracaoItemComponent.prototype.selected = function (val, index) {
        this._index = index;
        this.service.dataItem = val;
        this.trataDadosItem(this.service.dataItem);
    };
    GeracaoItemComponent.prototype.trataDadosItem = function (item) {
        var _this = this;
        if (app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_17__["StringUtilsStaticService"].isNotEmpty(item.loteId)) {
            this.loteService.getByLoteId(item.loteId).subscribe(function (resp) {
                if (!!resp) {
                    _this.service.dataItem.lote = resp;
                }
                else {
                    _this.service.dataItem.lote = new app_pages_cadastro_lote_lote_model__WEBPACK_IMPORTED_MODULE_18__["Lote"]();
                }
            });
        }
        else {
            this.service.dataItem.lote = new app_pages_cadastro_lote_lote_model__WEBPACK_IMPORTED_MODULE_18__["Lote"]();
        }
    };
    Object.defineProperty(GeracaoItemComponent.prototype, "hasDados", {
        get: function () {
            if (!app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_9__["ArrayUtilsStaticService"].any(this.service.data.entradaVeiculoItems))
                return;
            return !!this.service.data.entradaVeiculoItems.filter(function (r) { return r.sitReg !== 'E'; });
        },
        enumerable: true,
        configurable: true
    });
    GeracaoItemComponent.prototype.new = function () {
        if (!app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_9__["ArrayUtilsStaticService"].any(this.service.data.entradaVeiculoItems))
            this.service.data.entradaVeiculoItems = [];
        if (!this.service.validaSePodeEditar(this.service.data))
            return;
        this.detail = false;
        this.service.showTable = false;
        this.service.dataItem = new _geracao_model__WEBPACK_IMPORTED_MODULE_13__["EntradaVeiculoItem"]();
        this.preCreate();
    };
    GeracaoItemComponent.prototype.edit = function () {
        if (!this.service.validaSePodeEditar(this.service.data))
            return;
        this.detail = false;
        this.service.showTable = false;
    };
    GeracaoItemComponent.prototype.back = function () {
        this.service.showTable = true;
        this.service.dataItem = new _geracao_model__WEBPACK_IMPORTED_MODULE_13__["EntradaVeiculoItem"]();
        this._index = -1;
    };
    GeracaoItemComponent.prototype.show = function () {
        this.detail = true;
        this.service.showTable = false;
    };
    Object.defineProperty(GeracaoItemComponent.prototype, "disabled", {
        get: function () {
            return this.isDetail || this.detail;
        },
        enumerable: true,
        configurable: true
    });
    GeracaoItemComponent.prototype.trataModeloNota = function (data) {
        this.service.dataItem.modeloNota = data;
        if (this.service.dataItem.modeloNotaId !== "55") {
            this.service.dataItem.chaveNfe = undefined;
        }
        if (!!this.service.dataItem.loteId && this.service.dataItem.modeloNotaId !== this.service.dataItem.lote.modeloNotaId) {
            this.service.dataItem.loteId = "";
            this.service.dataItem.lote = new app_pages_cadastro_lote_lote_model__WEBPACK_IMPORTED_MODULE_18__["Lote"]();
        }
    };
    Object.defineProperty(GeracaoItemComponent.prototype, "disabledChaveNfe", {
        get: function () {
            if (this.disabled)
                return true;
            if (this.service.dataItem.modeloNotaId !== "55")
                return true;
            return false;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GeracaoItemComponent.prototype, "disabledBtnImportarDanfe", {
        get: function () {
            return app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_17__["StringUtilsStaticService"].isNotEmpty(this.service.dataItem.chaveNfe);
        },
        enumerable: true,
        configurable: true
    });
    GeracaoItemComponent.prototype.remove = function () {
        var _this = this;
        if (!this.service.validaSePodeEditar(this.service.data))
            return;
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 3, function () { return __awaiter(_this, void 0, void 0, function () {
            var _this = this;
            return __generator(this, function (_a) {
                this.message.removeConfirm(function () {
                    _this.service.data.entradaVeiculoItems.forEach(function (val, idx) {
                        if (!!val.cliCotrPtrEntradaVeiculoId && val.cliCotrPtrEntradaVeiculoId === _this.service.dataItem.cliCotrPtrEntradaVeiculoId) {
                            _this.service.dataItem.sitReg = 'E';
                        }
                        else if (!val.cliCotrPtrEntradaVeiculoId && val.sequencia === _this.service.dataItem.sequencia) {
                            _this.service.data.entradaVeiculoItems.splice(idx, 1);
                        }
                    });
                    _this.service.dataItem = new _geracao_model__WEBPACK_IMPORTED_MODULE_13__["EntradaVeiculoItem"]();
                    _this._index = -1;
                });
                return [2 /*return*/];
            });
        }); });
    };
    GeracaoItemComponent.prototype.preCreate = function () {
        return __awaiter(this, void 0, void 0, function () {
            var _this = this;
            return __generator(this, function (_a) {
                if (!!this.service.configs.depositoADefinir) {
                    this.service.dataItem.tanqueId = this.service.configs.depositoADefinir;
                }
                this.tipoDocumentoTranspService.get().subscribe(function (resp) {
                    if (resp && resp.length > 0) {
                        var documentosValidos = resp.filter(function (r) { return r.sitReg !== 'E' && r.siglaTipoDocto === 'NF'; });
                        if (documentosValidos.length > 0) {
                            _this.service.dataItem.codTipoDocto = documentosValidos[0].tipoDocumentoTranspId;
                        }
                    }
                });
                return [2 /*return*/];
            });
        });
    };
    Object.defineProperty(GeracaoItemComponent.prototype, "disabledDeposito", {
        get: function () {
            return app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_17__["StringUtilsStaticService"].isNotEmpty(this.service.configs.depositoADefinir);
        },
        enumerable: true,
        configurable: true
    });
    GeracaoItemComponent.prototype.onValidaChaveNfe = function () {
        return __awaiter(this, void 0, void 0, function () {
            var chaveNfeValida, cpfEmitente, _a;
            return __generator(this, function (_b) {
                switch (_b.label) {
                    case 0:
                        if (!this.funcoesService.isNotUndefinedOrNull(this.service.dataItem)) return [3 /*break*/, 3];
                        chaveNfeValida = this.validation.onValidaChaveNfe(this.service.dataItem);
                        if (!chaveNfeValida) return [3 /*break*/, 2];
                        cpfEmitente = this.service.dataItem.chaveNfe.substring(6, 20);
                        _a = this.service.dataItem;
                        return [4 /*yield*/, this.destinatarioService.getByCnpj(cpfEmitente).toPromise()];
                    case 1:
                        _a.emitente = _b.sent();
                        this.service.dataItem.destinatarioIdEmitente = this.service.dataItem.emitente.destinatarioId;
                        return [3 /*break*/, 3];
                    case 2:
                        this.service.dataItem.chaveNfe = "";
                        this.service.dataItem.docto = null;
                        this.service.dataItem.serieNotaId = "";
                        this.service.dataItem.emitente = new app_pages_cadastro_destinatario_destinatario_model__WEBPACK_IMPORTED_MODULE_3__["Destinatario"]();
                        this.service.dataItem.destinatarioIdEmitente = 0;
                        _b.label = 3;
                    case 3: return [2 /*return*/];
                }
            });
        });
    };
    GeracaoItemComponent.prototype.importarDanfe = function () {
        this.fileInput.nativeElement.click();
    };
    GeracaoItemComponent.prototype.onXmlSelected = function (event) {
        var _this = this;
        if (app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_9__["ArrayUtilsStaticService"].any(this.service.data.entradaVeiculoItems)) {
            this.message.confirm('titles.geracao', 'messages.notaJaInformadaAnteriormenteDesejaAtualizar', null, function () {
                _this.limparDadosAbas();
                _this.executaLoadXml(event);
            }, false, function () {
                // Resetar o valor do input
                event.target.value = '';
            });
        }
        else {
            this.executaLoadXml(event);
        }
    };
    GeracaoItemComponent.prototype.executaLoadXml = function (event) {
        var _this = this;
        var file = event.target.files[0];
        if (file) {
            var reader = new FileReader();
            reader.onload = function (e) {
                var parser = new DOMParser();
                var xmlDoc = parser.parseFromString(e.target.result, "application/xml");
                var cnpjCliente = _this.getValueTagFromXml(xmlDoc, 'dest > CNPJ');
                var cnpjEmitente = _this.getValueTagFromXml(xmlDoc, 'emit > CNPJ');
                var cnpjTransportadora = _this.getValueTagFromXml(xmlDoc, 'transp > transporta > CNPJ');
                var placaCavalo = _this.getValueTagFromXml(xmlDoc, 'transp > veicTransp > placa');
                var placaCarreta1 = _this.getValueTagFromXml(xmlDoc, 'transp > veicTransp > reboque');
                var modFrete = _this.getValueTagFromXml(xmlDoc, 'transp > modFrete');
                var codMatFornecedorCProd = _this.getValueTagFromXml(xmlDoc, 'det > prod > cProd');
                var codMatFornecedorXProd = _this.getValueTagFromXml(xmlDoc, 'det > prod > xProd');
                // Criar um objeto para armazenar todas as informações
                var object = {
                    cnpjCliente: cnpjCliente,
                    cnpjEmitente: cnpjEmitente,
                    cnpjTransportadora: cnpjTransportadora,
                    placaCavalo: placaCavalo,
                    placaCarreta1: placaCarreta1,
                    modFrete: modFrete,
                    codMatFornecedorCProd: codMatFornecedorCProd,
                    codMatFornecedorXProd: codMatFornecedorXProd
                };
                var tags = ['nNF', 'chNFe', 'mod', 'serie', 'dhEmi', 'pesoL'];
                tags.forEach(function (tag) {
                    var element = xmlDoc.getElementsByTagName(tag)[0];
                    object[tag] = element ? element.textContent : null;
                });
                // Mapeamento para renomear tags/propriedades
                var mapProp = {
                    nNF: 'docto',
                    chNFe: 'chaveNfe',
                    mod: 'modeloNotaId',
                    serie: 'serieNotaId',
                    dhEmi: 'dtDocumento',
                    pesoL: 'pesoDoc'
                };
                // Renomear as propriedades com base no mapeamento
                for (var _i = 0, _a = Object.entries(mapProp); _i < _a.length; _i++) {
                    var _b = _a[_i], antigo = _b[0], novo = _b[1];
                    if (object[antigo] !== undefined) {
                        object[novo] = object[antigo];
                        delete object[antigo];
                    }
                }
                _this.adicionarItens(xmlDoc, object);
            };
            reader.readAsText(file);
            // Resetar o valor do input
            event.target.value = '';
        }
    };
    GeracaoItemComponent.prototype.limparDadosAbas = function () {
        this.service.data = new _geracao_model__WEBPACK_IMPORTED_MODULE_13__["Geracao"]();
        this.service.data.entradaVeiculoItems = [];
    };
    GeracaoItemComponent.prototype.getValueTagFromXml = function (xmlDoc, tagName) {
        var element = xmlDoc.querySelector(tagName);
        return element ? element.textContent : null;
    };
    GeracaoItemComponent.prototype.adicionarItens = function (xmlDoc, tagsValue) {
        //Preencher com todas as propriedades necessárias da aba itens
        var itemTags = {
            cliCotrPtrEntradaVeiculoItemId: 0,
            destinatarioIdCliente: 0,
            destinatarioIdEmitente: 0,
            loteId: '',
            tanqueId: '',
            docto: 0,
            chaveNfe: '',
            modeloNotaId: '',
            serieNotaId: '',
            dtDocumento: null,
            dtEntregaNf: null,
            quantidDoc: 'qCom',
            pesoDoc: '',
            totItem: 'vProd',
            naturezaId: 'CFOP',
            codMatFornecedorCProd: '',
            codMatFornecedorXProd: '',
        };
        var itensElements = xmlDoc.getElementsByTagName('det');
        var _loop_1 = function (i) {
            var itemElement = itensElements[i];
            // Extraindo do XML valores das tags dos itens e associando às propriedades
            var itemValues = Object.keys(itemTags).reduce(function (acc, propName) {
                var tag = itemTags[propName];
                var element = itemElement.getElementsByTagName(tag)[0];
                var value = element ? element.textContent : '';
                if ((propName === 'totItem' || propName === 'quantidDoc') && value) {
                    value = parseFloat(value);
                }
                acc[propName] = value;
                return acc;
            }, {});
            if (!app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_9__["ArrayUtilsStaticService"].any(this_1.service.data.entradaVeiculoItems))
                this_1.service.data.entradaVeiculoItems = [];
            // Adicionar o item à lista(até aqui somente as propriedades: quantidDoc, totItem e naturezaId possuem valor) 
            this_1.service.data.entradaVeiculoItems.push(itemValues);
        };
        var this_1 = this;
        for (var i = 0; i < itensElements.length; i++) {
            _loop_1(i);
        }
        //Atualiza os valores do restante das propridedades.
        this.tratarCamposAbaDados(tagsValue);
        this.tratarCamposAbaItens(tagsValue);
    };
    GeracaoItemComponent.prototype.tratarCamposAbaDados = function (objectValues) {
        return __awaiter(this, void 0, void 0, function () {
            var transportadora, emitente, filter, matFornecedores, matFornecedor, _a;
            return __generator(this, function (_b) {
                switch (_b.label) {
                    case 0:
                        this.service.data.cadastroPlacaIdCavalo = objectValues.placaCavalo;
                        this.service.data.cadastroPlacaIdCarreta1 = objectValues.placaCarreta1;
                        if (!app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_17__["StringUtilsStaticService"].isNotEmpty(objectValues.cnpjTransportadora)) return [3 /*break*/, 2];
                        return [4 /*yield*/, this.destinatarioService.getByCnpj(objectValues.cnpjTransportadora).toPromise()];
                    case 1:
                        transportadora = _b.sent();
                        this.service.data.transportadora = !!transportadora ? transportadora : new app_pages_cadastro_destinatario_destinatario_model__WEBPACK_IMPORTED_MODULE_3__["Destinatario"]();
                        this.service.data.destinatarioIdTransportadora = !!this.service.data.transportadora.destinatarioId ? this.service.data.transportadora.destinatarioId : 0;
                        _b.label = 2;
                    case 2:
                        if (!app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_17__["StringUtilsStaticService"].isNotEmpty(objectValues.cnpjEmitente)) return [3 /*break*/, 6];
                        return [4 /*yield*/, this.destinatarioService.getByCnpj(objectValues.cnpjEmitente).toPromise()];
                    case 3:
                        emitente = _b.sent();
                        if (!(!!emitente && !!emitente.destinatarioId)) return [3 /*break*/, 6];
                        filter = {
                            destinatarioId: emitente.destinatarioId,
                            fornecedor: new app_pages_cadastro_destinatario_destinatario_model__WEBPACK_IMPORTED_MODULE_3__["Destinatario"]()
                        };
                        return [4 /*yield*/, this.materialFornecedorService.getByDestinatarioId(filter).toPromise()];
                    case 4:
                        matFornecedores = _b.sent();
                        matFornecedor = matFornecedores.find(function (mf) {
                            return mf.codMatFornecedor === objectValues.codMatFornecedorCProd ||
                                mf.codMatFornecedor === objectValues.codMatFornecedorXProd;
                        });
                        if (!!matFornecedor) {
                            this.service.data.materialId = matFornecedor.materialId;
                        }
                        else {
                            this.service.data.materialId = "";
                        }
                        if (!!!this.service.data.materialId) return [3 /*break*/, 6];
                        _a = this.service.data;
                        return [4 /*yield*/, this.materialService.getById(this.service.data.materialId).toPromise()];
                    case 5:
                        _a.material = _b.sent();
                        _b.label = 6;
                    case 6: return [2 /*return*/];
                }
            });
        });
    };
    GeracaoItemComponent.prototype.tratarCamposAbaItens = function (tagsValue) {
        return __awaiter(this, void 0, void 0, function () {
            var objectItem, cliCotrPtrEntradaVeiculoItemId, i, results;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        objectItem = {
                            tipoFrete: app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_17__["StringUtilsStaticService"].toString(tagsValue.modFrete),
                            docto: _shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["NumberUtilsStaticService"].toNumber(tagsValue.docto),
                            chaveNfe: app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_17__["StringUtilsStaticService"].toString(tagsValue.chaveNfe),
                            modeloNotaId: app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_17__["StringUtilsStaticService"].toString(tagsValue.modeloNotaId),
                            serieNotaId: app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_17__["StringUtilsStaticService"].toString(tagsValue.serieNotaId),
                            dtDocumento: app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_24__["DateTimeUtilsStaticService"].convertDateSqlToDate(tagsValue.dtDocumento),
                            dtEntregaNf: app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_24__["DateTimeUtilsStaticService"].convertDateSqlToDate(tagsValue.dtDocumento),
                            pesoDoc: _shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["NumberUtilsStaticService"].toNumber(tagsValue.pesoDoc)
                        };
                        this.service.data.entradaVeiculoItems.forEach(function (item) {
                            // Percorrer as propriedades de valoresFixos
                            Object.keys(objectItem).forEach(function (key) {
                                // Verificar se a propriedade existe no item
                                if (item.hasOwnProperty(key)) {
                                    // Atribuir o valor de valoresFixos à propriedade correspondente do item
                                    item[key] = objectItem[key];
                                }
                            });
                        });
                        cliCotrPtrEntradaVeiculoItemId = 1;
                        i = 0;
                        _a.label = 1;
                    case 1:
                        if (!(i < this.service.data.entradaVeiculoItems.length)) return [3 /*break*/, 4];
                        this.service.data.entradaVeiculoItems[i].cliCotrPtrEntradaVeiculoItemId = cliCotrPtrEntradaVeiculoItemId;
                        cliCotrPtrEntradaVeiculoItemId++;
                        return [4 /*yield*/, Object(rxjs__WEBPACK_IMPORTED_MODULE_22__["forkJoin"])([
                                this.destinatarioService.getByCnpj(tagsValue.cnpjEmitente),
                                this.destinatarioService.getByCnpj(tagsValue.cnpjCliente)
                            ]).toPromise()];
                    case 2:
                        results = _a.sent();
                        if (app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_9__["ArrayUtilsStaticService"].any(results)) {
                            this.service.data.entradaVeiculoItems[i].emitente = !!results[0] ? results[0] : new app_pages_cadastro_destinatario_destinatario_model__WEBPACK_IMPORTED_MODULE_3__["Destinatario"]();
                            this.service.data.entradaVeiculoItems[i].cliente = !!results[1] ? results[1] : new app_pages_cadastro_destinatario_destinatario_model__WEBPACK_IMPORTED_MODULE_3__["Destinatario"]();
                        }
                        _a.label = 3;
                    case 3:
                        i++;
                        return [3 /*break*/, 1];
                    case 4:
                        this.message.success("titles.geracao", "messages.registroAtualizado");
                        this.service.showTable = true;
                        this.xmlImportado = true;
                        return [2 /*return*/];
                }
            });
        });
    };
    GeracaoItemComponent.prototype.trataEmitente = function (emitente) {
        if (!emitente)
            return;
        this.service.dataItem.emitente = emitente;
    };
    GeracaoItemComponent.prototype.trataCliente = function (cliente) {
        if (!cliente)
            return;
        this.service.dataItem.cliente = cliente;
    };
    GeracaoItemComponent.prototype.trataMaterial = function (material) {
        if (!material)
            return;
        this.service.dataItem.material = material;
    };
    GeracaoItemComponent.prototype.onSelectedDeposito = function (e) {
        this.service.dataItem.tanque = e;
        var validation = this.validation.onValidaDeposito(this.service.dataItem);
        if (!validation) {
            this.limparDeposito();
            return;
        }
    };
    GeracaoItemComponent.prototype.limparDeposito = function () {
        this.service.dataItem.tanqueId = '';
        this.service.dataItem.tanque = new app_pages_cadastro_tanque_tanque_model__WEBPACK_IMPORTED_MODULE_21__["Tanque"]();
    };
    GeracaoItemComponent.prototype.onTrataQuantidDoc = function () {
        var valida = this.validation.onTrataQuantidDoc(this.service.dataItem);
        if (!valida)
            return;
        var validation = this.validation.onCalculaTotalNf(this.service.dataItem, 'quantidDoc');
        if (validation) {
            if (this.service.dataItem.lote.unidadeId === "KG") {
                this.service.dataItem.pesoDoc = this.service.dataItem.quantidDoc;
            }
        }
    };
    GeracaoItemComponent.prototype.onTrataDtEntregaNf = function () {
        this.validation.onTrataDtEntregaNf(this.service.dataItem);
    };
    GeracaoItemComponent.prototype.onTrataDtDocumento = function () {
        this.validation.onTrataDtDocumento(this.service.dataItem);
    };
    GeracaoItemComponent.prototype.onTrataPesoDoc = function () {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                this.validation.onTrataPesoDoc(this.service.dataItem);
                return [2 /*return*/];
            });
        });
    };
    GeracaoItemComponent.prototype.onTrataDocto = function () {
        this.validation.onTrataDocto(this.service.dataItem);
    };
    GeracaoItemComponent.prototype.onValidaValorNF = function () {
        var validation = this.validation.onValidaValorNF(this.service.dataItem);
        if (validation) {
            this.validation.onCalculaTotalNf(this.service.dataItem, 'valorNF');
        }
    };
    GeracaoItemComponent.prototype.onSelectedLote = function (event) {
        if (!event || !event.lote.loteId)
            return;
        this.service.dataItem.lote = event.lote;
        var validation = this.validation.onCalculaTotalNf(this.service.dataItem, 'lote');
        if (validation) {
            this.trataSerieModNota();
        }
        else {
            this.service.dataItem.loteId = "";
            return;
        }
    };
    GeracaoItemComponent.prototype.trataSerieModNota = function () {
        if (!this.service.dataItem.serieNotaId) {
            this.service.dataItem.serieNotaId = this.service.dataItem.lote.serieNotaId;
        }
        this.service.dataItem.modeloNotaId = this.service.dataItem.lote.modeloNotaId;
    };
    GeracaoItemComponent.prototype.depositoFocusIn = function () {
        if (!this.service.data.materialId) {
            var message = this.message.translate("messages.campoObrigatorioPorAba", { name: this.message.translate("labels.produto"), aba: this.message.translate("labels.dados") });
            this.message.warning("titles.geracao", message);
            jQuery("a.nav-link[href='#tDados']").trigger("click");
            this.funcoesService.backToTop();
            return;
        }
    };
    GeracaoItemComponent.prototype.loteFocusIn = function () {
        if (!this.service.data.materialId) {
            var message = this.message.translate("messages.campoObrigatorioPorAba", { name: this.message.translate("labels.produto"), aba: this.message.translate("labels.dados") });
            this.message.warning("titles.geracao", message);
            jQuery("a.nav-link[href='#tDados']").trigger("click");
            this.funcoesService.backToTop();
            return;
        }
    };
    Object.defineProperty(GeracaoItemComponent.prototype, "labelQuantidDoc", {
        get: function () {
            if (!this.service.dataItem.lote)
                return "Quantid. Docto";
            if (app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_17__["StringUtilsStaticService"].isNotEmpty(this.service.dataItem.lote.unidadeId))
                return "Quantid. Docto (" + this.service.dataItem.lote.unidadeId + ")";
            return "Quantid. Docto";
        },
        enumerable: true,
        configurable: true
    });
    GeracaoItemComponent.prototype.onSubmit = function (form) {
        return __awaiter(this, void 0, void 0, function () {
            var validations, i;
            var _this = this;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_8__["EventEmitterService"].get("msgItem").emit(form);
                        if (form.invalid) {
                            this.funcoesService.backToTop();
                            return [2 /*return*/];
                        }
                        return [4 /*yield*/, this.validation.getValidations(this.service.dataItem)];
                    case 1:
                        validations = _a.sent();
                        if (app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_9__["ArrayUtilsStaticService"].any(validations)) {
                            app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_8__["EventEmitterService"].get("backError").emit(validations.map(function (c) { return c.message; }));
                            this.funcoesService.backToTop();
                            return [2 /*return*/];
                        }
                        ;
                        this.preSave();
                        if (!app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_9__["ArrayUtilsStaticService"].any(this.service.data.entradaVeiculoItems))
                            this.service.data.entradaVeiculoItems = [];
                        if (this.service.dataItem.cliCotrPtrEntradaVeiculoItemId || this.service.dataItem.sequencia > 0) {
                            i = this.service.data.entradaVeiculoItems.findIndex(function (x) { return x.sequencia === _this.service.dataItem.cliCotrPtrEntradaVeiculoItemId; });
                            this.service.data.entradaVeiculoItems[i] = this.service.dataItem;
                        }
                        else {
                            this.service.dataItem.sequencia = this.service.data.entradaVeiculoItems.length + 1;
                            this.service.dataItem.cliCotrPtrEntradaVeiculoItemId = this.service.data.entradaVeiculoItems.length + 1;
                            this.service.data.entradaVeiculoItems.push(this.service.dataItem);
                        }
                        this.back();
                        return [2 /*return*/];
                }
            });
        });
    };
    GeracaoItemComponent.prototype.preSave = function () {
        if (!this.service.dataItem.dtEntregaNf) {
            this.service.dataItem.dtEntregaNf = this.service.dataItem.dtDocumento;
        }
    };
    Object.defineProperty(GeracaoItemComponent.prototype, "saldoDepositoOptions", {
        get: function () {
            return {
                destinatarioIdCliente: this.service.dataItem.destinatarioIdCliente,
                materialId: this.service.data.materialId,
                sitLote: "A",
                modo: 7,
                tipoSaldo: 7,
                dataMovimento: new Date(),
                tipoAgrupa: 'D',
                geraArquivo: 'S',
                planejTanque: false
            };
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(GeracaoItemComponent.prototype, "saldoLoteOptions", {
        get: function () {
            return {
                destinatarioIdCliente: this.service.dataItem.destinatarioIdCliente,
                destinatarioIdEmitente: this.service.dataItem.destinatarioIdEmitente,
                materialId: this.service.data.materialId,
                sitLote: "A",
                modo: 7,
                tipoSaldo: 7,
                dataMovimento: new Date(),
                tipoAgrupa: 'L',
                geraArquivo: 'S',
                planejTanque: false
            };
        },
        enumerable: true,
        configurable: true
    });
    GeracaoItemComponent.ctorParameters = function () { return [
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_2__["Router"] },
        { type: app_pages_cadastro_material_material_service__WEBPACK_IMPORTED_MODULE_5__["MaterialService"] },
        { type: app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_11__["MessageService"] },
        { type: _geracao_service__WEBPACK_IMPORTED_MODULE_12__["GeracaoService"] },
        { type: app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_10__["FuncoesService"] },
        { type: app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_15__["ConfiguracaoFacade"] },
        { type: app_pages_cadastro_destinatario_destinatario_service__WEBPACK_IMPORTED_MODULE_4__["DestinatarioService"] },
        { type: app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_6__["LoginService"] },
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_2__["ActivatedRoute"] },
        { type: app_pages_veiculo_entrada_veiculo_entrada_veiculo_service__WEBPACK_IMPORTED_MODULE_7__["EntradaVeiculoService"] },
        { type: app_pages_veiculo_check_list_check_list_item_check_list_item_service__WEBPACK_IMPORTED_MODULE_19__["CheckListItemService"] },
        { type: app_pages_cadastro_tipo_documento_transp_tipo_documento_transp_service__WEBPACK_IMPORTED_MODULE_20__["TipoDocumentoTranspService"] },
        { type: app_pages_cadastro_lote_lote_service__WEBPACK_IMPORTED_MODULE_23__["LoteService"] },
        { type: app_pages_cadastro_material_fornecedor_material_fornecedor_service__WEBPACK_IMPORTED_MODULE_25__["MaterialFornecedorService"] },
        { type: app_shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_26__["PermissoesUtilsService"] },
        { type: app_pages_cadastro_tanque_tanque_service__WEBPACK_IMPORTED_MODULE_27__["TanqueService"] }
    ]; };
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewChild"])('fileInput', { static: false }),
        __metadata("design:type", Object)
    ], GeracaoItemComponent.prototype, "fileInput", void 0);
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])(),
        __metadata("design:type", Object)
    ], GeracaoItemComponent.prototype, "isDetail", void 0);
    GeracaoItemComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"])({
            selector: "app-geracao-item",
            template: __importDefault(__webpack_require__(/*! raw-loader!./geracao-item.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao-item/geracao-item.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [_angular_router__WEBPACK_IMPORTED_MODULE_2__["Router"],
            app_pages_cadastro_material_material_service__WEBPACK_IMPORTED_MODULE_5__["MaterialService"],
            app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_11__["MessageService"],
            _geracao_service__WEBPACK_IMPORTED_MODULE_12__["GeracaoService"],
            app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_10__["FuncoesService"],
            app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_15__["ConfiguracaoFacade"],
            app_pages_cadastro_destinatario_destinatario_service__WEBPACK_IMPORTED_MODULE_4__["DestinatarioService"],
            app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_6__["LoginService"],
            _angular_router__WEBPACK_IMPORTED_MODULE_2__["ActivatedRoute"],
            app_pages_veiculo_entrada_veiculo_entrada_veiculo_service__WEBPACK_IMPORTED_MODULE_7__["EntradaVeiculoService"],
            app_pages_veiculo_check_list_check_list_item_check_list_item_service__WEBPACK_IMPORTED_MODULE_19__["CheckListItemService"],
            app_pages_cadastro_tipo_documento_transp_tipo_documento_transp_service__WEBPACK_IMPORTED_MODULE_20__["TipoDocumentoTranspService"],
            app_pages_cadastro_lote_lote_service__WEBPACK_IMPORTED_MODULE_23__["LoteService"],
            app_pages_cadastro_material_fornecedor_material_fornecedor_service__WEBPACK_IMPORTED_MODULE_25__["MaterialFornecedorService"],
            app_shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_26__["PermissoesUtilsService"],
            app_pages_cadastro_tanque_tanque_service__WEBPACK_IMPORTED_MODULE_27__["TanqueService"]])
    ], GeracaoItemComponent);
    return GeracaoItemComponent;
}());



/***/ }),

/***/ "./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao-item/geracao-item.validation.ts":
/*!*******************************************************************************************************!*\
  !*** ./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao-item/geracao-item.validation.ts ***!
  \*******************************************************************************************************/
/*! exports provided: GeracaoItemValidation */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GeracaoItemValidation", function() { return GeracaoItemValidation; });
/* harmony import */ var app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_0__ = __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_1__ = __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_funcoes_object_utils_object_utils_static_service__WEBPACK_IMPORTED_MODULE_2__ = __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_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_3__ = __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 __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 GeracaoItemValidation = /** @class */ (function () {
    function GeracaoItemValidation(message, funcoes, configuracao, service, checkListItemService, tanqueService, loteService) {
        this.message = message;
        this.funcoes = funcoes;
        this.configuracao = configuracao;
        this.service = service;
        this.checkListItemService = checkListItemService;
        this.tanqueService = tanqueService;
        this.loteService = loteService;
        this.mensagens = [];
        this.rs = [];
    }
    GeracaoItemValidation.prototype.getValidations = function (item) {
        return __awaiter(this, void 0, void 0, function () {
            var _a, validaPesoDoc, validaDocumento, validacalculaTotalNf, validaSeDepositoExiste;
            return __generator(this, function (_b) {
                switch (_b.label) {
                    case 0:
                        this.rs = [];
                        _a = item;
                        return [4 /*yield*/, this.loteService._getById(item.loteId).toPromise()];
                    case 1:
                        _a.lote = _b.sent();
                        this.service.dataItem = item;
                        this.test(this.validaModeloNotaId(item));
                        this.test(this.validaChaveNfe(item));
                        this.test(this.validaEmitente(item));
                        this.test(this.validaCliente(item));
                        this.test(this.validaDeposito(item));
                        this.test(this.validaLote(item));
                        this.test(this.validaQuantidDoc(item));
                        return [4 /*yield*/, this.validaPesoDoc(item)];
                    case 2:
                        validaPesoDoc = _b.sent();
                        return [4 /*yield*/, this.test(validaPesoDoc)];
                    case 3:
                        _b.sent();
                        this.test(this.validaDtDocumento(item));
                        this.test(this.validaDtEntregaNf(item));
                        return [4 /*yield*/, this.validaDocto(item)];
                    case 4:
                        validaDocumento = _b.sent();
                        return [4 /*yield*/, this.test(validaDocumento)];
                    case 5:
                        _b.sent();
                        return [4 /*yield*/, this.calculaTotalNf(item)];
                    case 6:
                        validacalculaTotalNf = _b.sent();
                        return [4 /*yield*/, this.test(validacalculaTotalNf)];
                    case 7:
                        _b.sent();
                        this.test(this.validaValorNF(item));
                        this.test(this.validaCfop(item));
                        return [4 /*yield*/, this.validaSeDepositoExiste(item)];
                    case 8:
                        validaSeDepositoExiste = _b.sent();
                        return [4 /*yield*/, this.test(validaSeDepositoExiste)];
                    case 9:
                        _b.sent();
                        return [2 /*return*/, this.rs.filter(function (v) { return v["isValid"] === false; })];
                }
            });
        });
    };
    GeracaoItemValidation.prototype.test = function (f) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                if (!!f)
                    this.rs.push(f);
                return [2 /*return*/];
            });
        });
    };
    GeracaoItemValidation.prototype.validaModeloNotaId = function (item, showError) {
        if (showError === void 0) { showError = false; }
        var r = { "isValid": true, "message": "" };
        if (app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_1__["StringUtilsStaticService"].isEmpty(item.modeloNotaId)) {
            r.isValid = false;
            r.message = this.message.translate("messages.campoObrigatorio", { name: this.message.translate("labels.modeloNf") });
        }
        if (!r.isValid && showError) {
            this.message.warning("titles.geracao", r.message);
        }
        return r;
    };
    GeracaoItemValidation.prototype.validaLote = function (item, showError) {
        if (showError === void 0) { showError = false; }
        var r = { "isValid": true, "message": "" };
        if (app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_1__["StringUtilsStaticService"].isEmpty(item.loteId)) {
            r.isValid = false;
            r.message = this.message.translate("messages.campoObrigatorio", { name: this.message.translate("labels.lote") });
        }
        if (!r.isValid && showError) {
            this.message.warning("titles.geracao", r.message);
        }
        return r;
    };
    GeracaoItemValidation.prototype.validaEmitente = function (item, showError) {
        if (showError === void 0) { showError = false; }
        var r = { "isValid": true, "message": "" };
        if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["NumberUtilsStaticService"].isNotPositive(item.destinatarioIdEmitente)) {
            r.isValid = false;
            r.message = this.message.translate("messages.campoObrigatorio", { name: this.message.translate("labels.emitente") });
        }
        if (!r.isValid && showError) {
            this.message.warning("titles.geracao", r.message);
        }
        return r;
    };
    GeracaoItemValidation.prototype.validaCliente = function (item, showError) {
        if (showError === void 0) { showError = false; }
        var r = { "isValid": true, "message": "" };
        if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["NumberUtilsStaticService"].isNotPositive(item.destinatarioIdCliente)) {
            r.isValid = false;
            r.message = this.message.translate("messages.campoObrigatorio", { name: this.message.translate("labels.cliente") });
        }
        if (!r.isValid && showError) {
            this.message.warning("titles.geracao", r.message);
        }
        return r;
    };
    GeracaoItemValidation.prototype.onValidaDeposito = function (item) {
        return this.validaDeposito(item, true)['isValid'];
    };
    GeracaoItemValidation.prototype.validaDeposito = function (item, showError) {
        if (showError === void 0) { showError = false; }
        var r = { "isValid": true, "message": "" };
        var tQIsotanque = this.configuracao.lerConfig("STO", "TQIsotanque");
        if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["NumberUtilsStaticService"].toNumber(this.service.data.tipoVeiculoId) === 11 && tQIsotanque === item.tanqueId) {
            r.isValid = false;
            r.message = this.message.translate("messages.paraTipoVeiculoIsotanqueObrigatorioODeposito", { deposito: tQIsotanque });
        }
        if (!r.isValid && showError) {
            this.message.warning("titles.geracao", r.message);
        }
        return r;
    };
    GeracaoItemValidation.prototype.onValidaChaveNfe = function (item) {
        return this.validaChaveNfe(item, true)['isValid'];
    };
    GeracaoItemValidation.prototype.validaChaveNfe = function (item, showError) {
        if (showError === void 0) { showError = false; }
        var r = { "isValid": true, "message": "" };
        if (!item.chaveNfe)
            return;
        item.docto = app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["NumberUtilsStaticService"].isPositive(item.docto) ? item.docto : +this.funcoes.getNumeroNota(item.chaveNfe);
        item.serieNotaId = app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_1__["StringUtilsStaticService"].isNotEmpty(item.serieNotaId) ? item.serieNotaId : this.funcoes.getSerieNota(item.chaveNfe);
        item.emitente = app_shared_services_funcoes_object_utils_object_utils_static_service__WEBPACK_IMPORTED_MODULE_2__["ObjectUtilsStaticService"].defined(item.emitente) && app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["NumberUtilsStaticService"].isPositive(item.emitente.destinatarioId) ? item.emitente : null;
        if (item.modeloNotaId === '55' && app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_1__["StringUtilsStaticService"].isEmpty(item.chaveNfe)) {
            r.isValid = false;
            r.message = this.message.translate("messages.campoObrigatorio", { name: this.message.translate("labels.chaveDaNFE") });
        }
        else if (!this.funcoes.validaChaveNFe(item.chaveNfe, item.emitente, item.docto, item.serieNotaId)) {
            r.isValid = false;
            r.message = "messages.chaveNfeInvalida";
        }
        if (!r.isValid && showError) {
            this.message.warning("titles.geracao", r.message);
        }
        return r;
    };
    GeracaoItemValidation.prototype.onValidaValorNF = function (item) {
        return this.validaValorNF(item, true)['isValid'];
    };
    GeracaoItemValidation.prototype.validaValorNF = function (item, showError) {
        if (showError === void 0) { showError = false; }
        var r = { "isValid": true, "message": "" };
        if (!item.totItem) {
            r.isValid = false;
            r.message = this.message.translate("messages.campoObrigatorio", { name: this.message.translate("labels.valorNF") });
        }
        if (!r.isValid && showError) {
            this.message.warning("titles.geracao", r.message);
        }
        return r;
    };
    GeracaoItemValidation.prototype.onCalculaTotalNf = function (item, origem) {
        return __awaiter(this, void 0, void 0, function () {
            var validation;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.calculaTotalNf(item, true, origem)];
                    case 1:
                        validation = _a.sent();
                        return [2 /*return*/, validation.isValid];
                }
            });
        });
    };
    GeracaoItemValidation.prototype.calculaTotalNf = function (item, showError, origem) {
        if (showError === void 0) { showError = false; }
        if (origem === void 0) { origem = 'valorNF'; }
        return __awaiter(this, void 0, void 0, function () {
            var r, calculaTotalNF, shouldCalculate;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        r = { isValid: true, message: "" };
                        calculaTotalNF = this.funcoes.isBoolean(this.configuracao.lerConfig("BAL", "CalculaTotalNF"));
                        if (calculaTotalNF) {
                            if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["NumberUtilsStaticService"].toNumber(item.lote.precoArmazenado) && app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["NumberUtilsStaticService"].toNumber(item.quantidDoc)) {
                                item.totItem = app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["NumberUtilsStaticService"].round(item.quantidDoc * item.lote.precoArmazenado, 2);
                                this.service.dataItem.totItem = item.totItem;
                            }
                        }
                        shouldCalculate = item.totItem > 0 && (this.service.configs.calculaTotalNF || calculaTotalNF);
                        if (!(!item.loteId && (this.service.configs.calculaTotalNF || calculaTotalNF))) return [3 /*break*/, 1];
                        r.isValid = false;
                        r.message = "messages.valorNfOuLoteIncorreto";
                        return [3 /*break*/, 5];
                    case 1:
                        if (!(origem === 'quantidDoc' && shouldCalculate)) return [3 /*break*/, 2];
                        this.validaTotalDaNota(r, item);
                        return [3 /*break*/, 5];
                    case 2:
                        if (!(origem === 'lote')) return [3 /*break*/, 4];
                        if (shouldCalculate) {
                            this.validaTotalDaNota(r, item);
                        }
                        return [4 /*yield*/, this.validateCapacidadeTanque(r, item)];
                    case 3:
                        _a.sent();
                        return [3 /*break*/, 5];
                    case 4:
                        if (origem === 'valorNF') {
                            this.validaTotalDaNota(r, item);
                        }
                        _a.label = 5;
                    case 5:
                        if (!r.isValid && showError) {
                            this.message.warning("titles.geracao", r.message);
                        }
                        return [2 /*return*/, r];
                }
            });
        });
    };
    GeracaoItemValidation.prototype.validateCapacidadeTanque = function (r, item) {
        return __awaiter(this, void 0, void 0, function () {
            var object, ret;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        object = {
                            materialId: this.service.data.materialId,
                            tanqueId: item.tanqueId,
                            pesoDoc: item.pesoDoc,
                            continua: "",
                            msg: ""
                        };
                        return [4 /*yield*/, this.checkListItemService.verificarCapacidadeTanque(object).toPromise()];
                    case 1:
                        ret = _a.sent();
                        if (this.funcoes.isNotUndefinedOrNull(ret.validationResult)) {
                            this.mensagens = this.message.validationResult(ret.validationResult);
                            if (ret && !ret.validationResult.isValid) {
                                r.isValid = false;
                                r.message = this.mensagens[0];
                            }
                            else if (ret.outContinua !== "S") {
                                r.isValid = false;
                                r.message = ret.msg;
                            }
                        }
                        return [2 /*return*/];
                }
            });
        });
    };
    GeracaoItemValidation.prototype.validaTotalDaNota = function (r, item) {
        if (!app_shared_services_funcoes_object_utils_object_utils_static_service__WEBPACK_IMPORTED_MODULE_2__["ObjectUtilsStaticService"].defined(item.lote))
            return;
        var totalDaNota = this.funcoes.numberUtils.round(item.quantidDoc * app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["NumberUtilsStaticService"].toNumber(item.lote.precoArmazenado), 2);
        if (Math.abs(totalDaNota - item.totItem) > 1) {
            r.isValid = false;
            r.message = "messages.valorNfOuLoteIncorreto";
        }
    };
    GeracaoItemValidation.prototype.onTrataQuantidDoc = function (item) {
        return this.validaQuantidDoc(item, true)['isValid'];
    };
    GeracaoItemValidation.prototype.validaQuantidDoc = function (item, showError) {
        if (showError === void 0) { showError = false; }
        var r = { "isValid": true, "message": "" };
        if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["NumberUtilsStaticService"].isNotPositive(item.quantidDoc)) {
            r.isValid = false;
            r.message = this.message.translate("messages.campoObrigatorio", { name: this.message.translate("labels.quantidDoc") });
        }
        if (!r.isValid && showError) {
            this.message.warning("titles.geracao", r.message);
        }
        return r;
    };
    GeracaoItemValidation.prototype.onTrataDtEntregaNf = function (item) {
        return this.validaDtEntregaNf(item, true)['isValid'];
    };
    GeracaoItemValidation.prototype.validaDtEntregaNf = function (item, showError) {
        if (showError === void 0) { showError = false; }
        var r = { "isValid": true, "message": "" };
        if (!item.dtEntregaNf) {
            r.isValid = false;
            r.message = this.message.translate("messages.campoObrigatorio", { name: this.message.translate("labels.dtEntregaNf") });
        }
        else if (app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_3__["DateTimeUtilsStaticService"].maiorAHoje(item.dtEntregaNf)) {
            r.isValid = false;
            r.message = "messages.dtEntregaNfNaoPodeSerMaiorDataAtual";
        }
        if (!r.isValid && showError) {
            this.message.warning("titles.geracao", r.message);
        }
        return r;
    };
    GeracaoItemValidation.prototype.onTrataDtDocumento = function (item) {
        return this.validaDtDocumento(item, true)['isValid'];
    };
    GeracaoItemValidation.prototype.validaDtDocumento = function (item, showError) {
        if (showError === void 0) { showError = false; }
        var r = { "isValid": true, "message": "" };
        if (!item.dtDocumento) {
            r.isValid = false;
            r.message = this.message.translate("messages.campoObrigatorio", { name: this.message.translate("labels.dataDocumento") });
        }
        else if (app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_3__["DateTimeUtilsStaticService"].maiorAHoje(item.dtDocumento)) {
            r.isValid = false;
            r.message = "messages.dtDocumentoNaoPodeSerMaiorDataAtual";
        }
        if (!r.isValid && showError) {
            this.message.warning("titles.geracao", r.message);
        }
        return r;
    };
    GeracaoItemValidation.prototype.onTrataDocto = function (item) {
        return __awaiter(this, void 0, void 0, function () {
            var validation;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.validaDocto(item, true)];
                    case 1:
                        validation = _a.sent();
                        return [2 /*return*/, validation.isValid];
                }
            });
        });
    };
    GeracaoItemValidation.prototype.validaDocto = function (item, showError) {
        if (showError === void 0) { showError = false; }
        return __awaiter(this, void 0, void 0, function () {
            var r, isExistGrid, verifSeDoctoJaExiste;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        r = { "isValid": true, "message": "" };
                        if (!app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["NumberUtilsStaticService"].isNotPositive(item.docto)) return [3 /*break*/, 1];
                        r.isValid = false;
                        r.message = this.message.translate("messages.campoObrigatorio", { name: this.message.translate("labels.documento") });
                        return [3 /*break*/, 3];
                    case 1:
                        isExistGrid = this.service.data.entradaVeiculoItems.filter(function (t) { return t.destinatarioIdCliente === item.destinatarioIdCliente &&
                            t.destinatarioIdEmitente === item.destinatarioIdEmitente &&
                            t.docto === item.docto &&
                            t.serieNotaId === item.serieNotaId &&
                            t.cliCotrPtrEntradaVeiculoItemId !== item.cliCotrPtrEntradaVeiculoItemId &&
                            t.sitReg !== "E"; });
                        return [4 /*yield*/, this.service.verificaSeDocumentoJaExiste(item).toPromise()];
                    case 2:
                        verifSeDoctoJaExiste = _a.sent();
                        if (verifSeDoctoJaExiste || isExistGrid.length > 0) {
                            r.isValid = false;
                            r.message = "messages.jaExisteDoctoSerieCadastradoParaMesmoClienteEmitente";
                        }
                        _a.label = 3;
                    case 3:
                        if (!r.isValid && showError) {
                            this.message.warning("titles.geracao", r.message);
                        }
                        return [2 /*return*/, r];
                }
            });
        });
    };
    GeracaoItemValidation.prototype.onTrataPesoDoc = function (item) {
        return __awaiter(this, void 0, void 0, function () {
            var validation;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.validaPesoDoc(item, true)];
                    case 1:
                        validation = _a.sent();
                        return [2 /*return*/, validation.isValid];
                }
            });
        });
    };
    GeracaoItemValidation.prototype.validaPesoDoc = function (item, showError) {
        if (showError === void 0) { showError = false; }
        return __awaiter(this, void 0, void 0, function () {
            var r;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        r = { "isValid": true, "message": "" };
                        if (!app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["NumberUtilsStaticService"].isNotPositive(item.pesoDoc)) return [3 /*break*/, 1];
                        r.isValid = false;
                        r.message = this.message.translate("messages.campoObrigatorio", { name: this.message.translate("labels.pesoDocto") });
                        return [3 /*break*/, 4];
                    case 1:
                        if (!(app_shared_services_funcoes_object_utils_object_utils_static_service__WEBPACK_IMPORTED_MODULE_2__["ObjectUtilsStaticService"].defined(item.lote) && app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_1__["StringUtilsStaticService"].toString(item.lote.unidadeId) === "KG" && item.pesoDoc < item.quantidDoc)) return [3 /*break*/, 2];
                        r.isValid = false;
                        r.message = "messages.pesoDocumentoNaoDevSerMenorQuantidDocto";
                        return [3 /*break*/, 4];
                    case 2: return [4 /*yield*/, this.validateCapacidadeTanque(r, item)];
                    case 3:
                        _a.sent();
                        _a.label = 4;
                    case 4:
                        if (!r.isValid && showError) {
                            this.message.warning("titles.geracao", r.message);
                        }
                        return [2 /*return*/, r];
                }
            });
        });
    };
    GeracaoItemValidation.prototype.validaCfop = function (item, showError) {
        if (showError === void 0) { showError = false; }
        var r = { "isValid": true, "message": "" };
        if (app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_1__["StringUtilsStaticService"].isEmpty(item.naturezaId)) {
            r.isValid = false;
            r.message = this.message.translate("messages.campoObrigatorio", { name: this.message.translate("labels.cfop") });
        }
        if (!r.isValid && showError) {
            this.message.warning("titles.geracao", r.message);
        }
        return r;
    };
    GeracaoItemValidation.prototype.validaSeDepositoExiste = function (item, showError) {
        if (showError === void 0) { showError = false; }
        return __awaiter(this, void 0, void 0, function () {
            var r, deposito;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        r = { "isValid": true, "message": "" };
                        return [4 /*yield*/, this.tanqueService.getById(btoa(item.tanqueId)).toPromise()];
                    case 1:
                        deposito = _a.sent();
                        if (!deposito || !deposito.tanqueId) {
                            r.isValid = false;
                            r.message = this.message.translate("messages.depositoNaoCadastrado", { deposito: item.tanqueId });
                        }
                        if (!r.isValid && showError) {
                            this.message.warning("titles.geracao", r.message);
                        }
                        return [2 /*return*/, r];
                }
            });
        });
    };
    return GeracaoItemValidation;
}());



/***/ }),

/***/ "./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao-motorista-validade/geracao-motorista-validade.component.ts":
/*!**********************************************************************************************************************************!*\
  !*** ./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao-motorista-validade/geracao-motorista-validade.component.ts ***!
  \**********************************************************************************************************************************/
/*! exports provided: GeracaoMotoristaValidadeComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GeracaoMotoristaValidadeComponent", function() { return GeracaoMotoristaValidadeComponent; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var app_config_enumerables__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! app/config/enumerables */ "./src/app/config/enumerables.ts");
/* harmony import */ var app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_2__ = __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_funcoes_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! app/shared/services/funcoes/funcoes.service */ "./src/app/shared/services/funcoes/funcoes.service.ts");
/* harmony import */ var _geracao_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../geracao.service */ "./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao.service.ts");
/* harmony import */ var app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! app/shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var app_pages_cadastro_motorista_motorista_model__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! app/pages/cadastro/motorista/motorista.model */ "./src/app/pages/cadastro/motorista/motorista.model.ts");
/* harmony import */ var app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_7__ = __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 __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 GeracaoMotoristaValidadeComponent = /** @class */ (function () {
    function GeracaoMotoristaValidadeComponent(funcoes, service, messages) {
        var _this = this;
        this.funcoes = funcoes;
        this.service = service;
        this.messages = messages;
        this.confirm = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
        this.mascara = new app_config_enumerables__WEBPACK_IMPORTED_MODULE_1__["Mascaras"]();
        this.title = '';
        this.label = '';
        this.questionMessage = '';
        this.sub = app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_2__["EventEmitterService"].get('emiGeracaoMotoristaValidade').subscribe(function (req) {
            if (!_this.service.data || !_this.service.data.motorista)
                return;
            _this.valDocMotorista = _this.service.errosDocMotorista.find(function (c) { return !c.isValid; });
            if (_this.valDocMotorista) {
                switch (_this.valDocMotorista.tipoDoc) {
                    case 'CNH':
                        _this.title = 'titles.validadeCnh';
                        _this.label = 'labels.validadeVencidaCnh';
                        _this.questionMessage = _this.valDocMotorista.message;
                        _this.dtParaValidar = _this.service.data.motorista.cnhValidade;
                        break;
                    case 'RESTRICAO':
                        _this.questionMessage = _this.valDocMotorista.message;
                        break;
                    case 'VEICULOABERTO':
                        _this.questionMessage = _this.valDocMotorista.message;
                        break;
                    case 'INATIVO':
                        _this.questionMessage = _this.valDocMotorista.message;
                        break;
                    default:
                        _this.confirm.emit(undefined);
                }
                if (!_this.valDocMotorista.question) {
                    if (_this.valDocMotorista.message.indexOf('messages') < 0)
                        _this.valDocMotorista.message = "messages." + _this.valDocMotorista.message;
                    _this.messages.warning("titles.entradaVeiculo", _this.valDocMotorista.message);
                    jQuery("#geracao-motorista-validade-dialog").modal("show");
                }
                else {
                    _this.messages.confirm("titles.entradaVeiculo", _this.questionMessage, "", function () { return __awaiter(_this, void 0, void 0, function () {
                        return __generator(this, function (_a) {
                            switch (_a.label) {
                                case 0:
                                    if (!this.valDocMotorista.modal) return [3 /*break*/, 2];
                                    return [4 /*yield*/, jQuery("#geracao-motorista-validade-dialog").modal("show")];
                                case 1:
                                    _a.sent();
                                    return [3 /*break*/, 3];
                                case 2:
                                    this.setValid();
                                    _a.label = 3;
                                case 3: return [2 /*return*/];
                            }
                        });
                    }); }, false, function () {
                        _this.service.data.motoristaId = undefined;
                        _this.service.data.motorista = new app_pages_cadastro_motorista_motorista_model__WEBPACK_IMPORTED_MODULE_6__["Motorista"]();
                        _this.confirm.emit(undefined);
                    });
                }
            }
            else
                _this.confirm.emit(undefined);
        });
    }
    GeracaoMotoristaValidadeComponent.prototype.ngOnDestroy = function () {
        this.sub.unsubscribe();
    };
    GeracaoMotoristaValidadeComponent.prototype.onSubmit = function (form) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                if (form.invalid) {
                    this.messages.warning("titles.entradaVeiculo", "messages.campoObrigatorio", { name: 'data' });
                }
                else if (app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_7__["DateTimeUtilsStaticService"].menorAHoje(this.dtParaValidar)) {
                    this.messages.warning("titles.entradaVeiculo", "messages.dtValidadeNaoPodeSerMenor");
                }
                else {
                    jQuery("#geracao-motorista-validade-dialog").modal("hide");
                    this.setValid();
                    this.confirm.emit(this.valDocMotorista);
                }
                return [2 /*return*/];
            });
        });
    };
    GeracaoMotoristaValidadeComponent.prototype.close = function () {
        jQuery("#geracao-motorista-validade-dialog").modal("hide");
        this.service.data.motoristaId = undefined;
        this.service.data.motorista = new app_pages_cadastro_motorista_motorista_model__WEBPACK_IMPORTED_MODULE_6__["Motorista"]();
        this.confirm.emit(undefined);
    };
    GeracaoMotoristaValidadeComponent.prototype.setValid = function () {
        var _this = this;
        this.valDocMotorista.data = this.dtParaValidar;
        this.valDocMotorista.isValid = true;
        this.service.errosDocMotorista.map(function (r) {
            if (_this.valDocMotorista.tipoDoc === r.tipoDoc) {
                r.data = _this.dtParaValidar;
                r.isValid = true;
                return r;
            }
        });
    };
    GeracaoMotoristaValidadeComponent.ctorParameters = function () { return [
        { type: app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_3__["FuncoesService"] },
        { type: _geracao_service__WEBPACK_IMPORTED_MODULE_4__["GeracaoService"] },
        { type: app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_5__["MessageService"] }
    ]; };
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"])(),
        __metadata("design:type", Object)
    ], GeracaoMotoristaValidadeComponent.prototype, "confirm", void 0);
    GeracaoMotoristaValidadeComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
            selector: 'app-geracao-motorista-validade',
            template: __importDefault(__webpack_require__(/*! raw-loader!./geracao-motorista-validade.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao-motorista-validade/geracao-motorista-validade.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_3__["FuncoesService"],
            _geracao_service__WEBPACK_IMPORTED_MODULE_4__["GeracaoService"],
            app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_5__["MessageService"]])
    ], GeracaoMotoristaValidadeComponent);
    return GeracaoMotoristaValidadeComponent;
}());



/***/ }),

/***/ "./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao-print-modal/geracao-print-modal.component.ts":
/*!********************************************************************************************************************!*\
  !*** ./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao-print-modal/geracao-print-modal.component.ts ***!
  \********************************************************************************************************************/
/*! exports provided: GeracaoPrintModalComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GeracaoPrintModalComponent", function() { return GeracaoPrintModalComponent; });
/* harmony import */ var _shared_services_funcoes_modal_utils_modal_utils_static_service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../../../../../../shared/services/funcoes/modal-utils/modal-utils.static.service */ "./src/app/shared/services/funcoes/modal-utils/modal-utils.static.service.ts");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/fesm5/router.js");
/* harmony import */ var app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_3__ = __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_funcoes_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! app/shared/services/funcoes/funcoes.service */ "./src/app/shared/services/funcoes/funcoes.service.ts");
/* harmony import */ var _geracao_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../geracao.service */ "./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao.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 __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};






var GeracaoPrintModalComponent = /** @class */ (function () {
    function GeracaoPrintModalComponent(router, funcoes, service) {
        this.router = router;
        this.funcoes = funcoes;
        this.service = service;
        this.outConfirma = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["EventEmitter"]();
    }
    GeracaoPrintModalComponent.prototype.ngOnInit = function () {
        this.tipoSelecionado = "";
        this.initListaTiposImpressao();
    };
    GeracaoPrintModalComponent.prototype.initListaTiposImpressao = function () {
        this.tiposImpressao = [
            { value: "dadosIndex", label: "labels.impressaoDeListagem" },
            { value: "checkList", label: "labels.checklist" },
            { value: "checkIn", label: "labels.itemCheckIn" },
            { value: "pev", label: "labels.pev" }
        ];
    };
    GeracaoPrintModalComponent.prototype.onSubmit = function (form) {
        app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_3__["EventEmitterService"].get("formError").emit(form);
        if (form.invalid) {
            return;
        }
        this.outConfirma.emit(this.tipoSelecionado);
        this.tipoSelecionado = "";
        _shared_services_funcoes_modal_utils_modal_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["ModalUtilsStaticService"].closeModal("geracaoModalPrint");
    };
    GeracaoPrintModalComponent.ctorParameters = function () { return [
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_2__["Router"] },
        { type: app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_4__["FuncoesService"] },
        { type: _geracao_service__WEBPACK_IMPORTED_MODULE_5__["GeracaoService"] }
    ]; };
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Output"])(),
        __metadata("design:type", Object)
    ], GeracaoPrintModalComponent.prototype, "outConfirma", void 0);
    GeracaoPrintModalComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"])({
            selector: "app-geracao-print-modal",
            template: __importDefault(__webpack_require__(/*! raw-loader!./geracao-print-modal.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao-print-modal/geracao-print-modal.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [_angular_router__WEBPACK_IMPORTED_MODULE_2__["Router"],
            app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_4__["FuncoesService"],
            _geracao_service__WEBPACK_IMPORTED_MODULE_5__["GeracaoService"]])
    ], GeracaoPrintModalComponent);
    return GeracaoPrintModalComponent;
}());



/***/ }),

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

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GeracaoConstants", function() { return GeracaoConstants; });
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};
var GeracaoConstants = /** @class */ (function () {
    function GeracaoConstants() {
        this.sisFormularioId = 375032;
        this.permissoes = [
            { sisFormularioId: this.sisFormularioId, libRotina: 1, acao: "labels.inclusao" },
            { sisFormularioId: this.sisFormularioId, libRotina: 2, acao: "labels.alteracao" },
            { sisFormularioId: this.sisFormularioId, libRotina: 3, acao: "labels.exclusao" },
            { sisFormularioId: this.sisFormularioId, libRotina: 4, acao: "labels.consulta" },
            { sisFormularioId: this.sisFormularioId, libRotina: 5, acao: "labels.impressao" },
            { sisFormularioId: this.sisFormularioId, libRotina: 6, acao: "labels.propriedades" },
            { sisFormularioId: this.sisFormularioId, libRotina: 7, acao: "labels.permissoes" },
            { sisFormularioId: this.sisFormularioId, libRotina: 8, acao: "labels.confirmacaoChegada" },
            { sisFormularioId: this.sisFormularioId, libRotina: 9, acao: 'labels.reenviarMotivacao' }
        ];
        this.sisSistemaId = "CAD";
        this.nomeForm = "titles.geracao";
        this.reportId = "COT0028";
        this.reportTitulo = { "titulo": "Geração", "subTitulo": "" };
        this.listaIndex = [
            { title: 'Novo', action: 'create', icon: "icon-plus", exibeButton: true, eximeMenu: true, menuName: 'Arquivo' },
            { title: 'Visualizar', action: 'detail', icon: "icon-eye", exibeButton: true, eximeMenu: true, menuName: 'Arquivo' },
            { title: 'Editar', action: 'edit', icon: "icon-pencil", exibeButton: true, eximeMenu: true, menuName: 'Arquivo' },
            { title: 'Atualizar', action: 'refresh', icon: "icon-reload", exibeButton: true, eximeMenu: true, menuName: 'Arquivo' },
            { title: 'Imprimir', action: 'print', icon: "icon-printer", exibeButton: true, eximeMenu: true, menuName: 'Arquivo' },
            { title: 'Pesquisar', action: 'filtrar', icon: "icon-search", exibeButton: true, eximeMenu: true, menuName: 'Movimento' },
            { title: 'Propriedade', action: 'properties', icon: "icon-menu", exibeButton: true, eximeMenu: true, menuName: 'Movimento' },
            { 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 },
            { title: 'ReenviarMotivacao', action: 'reenviarMotivacao', icon: "fa fa-repeat", exibeButton: true, eximeMenu: true, disabled: true, menuName: 'Movimento', depItem: true }
        ];
        this.listaForm = [
            { title: 'Editar', action: 'edit', icon: "icon-pencil", exibeButton: true, eximeMenu: true, menuName: 'Arquivo' },
            { title: 'Voltar', action: 'back', icon: "icon-arrow-left", exibeButton: true, eximeMenu: true, menuName: 'Arquivo' }
        ];
        this.listaConfirmacaChegada = [
            { 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' },
            { title: 'alteraDadosPlanejamento', action: 'alteracaoDadosPlanejamento', icon: "icon-pencil", exibeButton: true, eximeMenu: true, menuName: 'Movimento' }
        ];
        this.parametrosConfig = [
            {
                sistema: 'CTV', parametros: [
                    'ObrigaCadPlaca',
                    'SolicitaNumCartao',
                    'DtTriagem'
                ]
            },
            {
                sistema: 'BAL', parametros: [
                    'MaskPlaca',
                    'IntCta',
                    'DepositoADefinir',
                    'CalculaTotalNF'
                ]
            },
            {
                sistema: 'STO', parametros: [
                    'TQIsotanque'
                ]
            },
            {
                sistema: 'PTR', parametros: [
                    'ImpChkGeracao',
                    'ImpPevGeracao',
                    'ImpCheckinGeracao',
                    'TransitTime'
                ]
            },
            {
                sistema: 'WEB', parametros: [
                    'CWebModCheckList',
                    'CWebModPev',
                    'CWebModCheckIn',
                    'PrefixoRelEspecifico'
                ]
            },
        ];
    }
    return GeracaoConstants;
}());



/***/ }),

/***/ "./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao.model.ts":
/*!********************************************************************************!*\
  !*** ./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao.model.ts ***!
  \********************************************************************************/
/*! exports provided: Geracao, EntradaVeiculoItem, GeracaoFilter, GeracaoIndexDto */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Geracao", function() { return Geracao; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EntradaVeiculoItem", function() { return EntradaVeiculoItem; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GeracaoFilter", function() { return GeracaoFilter; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GeracaoIndexDto", function() { return GeracaoIndexDto; });
/* harmony import */ var _cadastro_motorista_motorista_model__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../../../../cadastro/motorista/motorista.model */ "./src/app/pages/cadastro/motorista/motorista.model.ts");
/* harmony import */ var app_pages_cadastro_destinatario_destinatario_model__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! app/pages/cadastro/destinatario/destinatario.model */ "./src/app/pages/cadastro/destinatario/destinatario.model.ts");
/* harmony import */ var app_pages_cadastro_lote_lote_model__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! app/pages/cadastro/lote/lote.model */ "./src/app/pages/cadastro/lote/lote.model.ts");
/* harmony import */ var app_pages_cadastro_material_material_model__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! app/pages/cadastro/material/material.model */ "./src/app/pages/cadastro/material/material.model.ts");
/* harmony import */ var app_pages_cadastro_modelo_nota_modelo_nota_model__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! app/pages/cadastro/modelo-nota/modelo-nota.model */ "./src/app/pages/cadastro/modelo-nota/modelo-nota.model.ts");
/* harmony import */ var app_pages_cadastro_tanque_tanque_model__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! app/pages/cadastro/tanque/tanque.model */ "./src/app/pages/cadastro/tanque/tanque.model.ts");
/* harmony import */ var app_shared_services_base_base_model__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! app/shared/services/base/base.model */ "./src/app/shared/services/base/base.model.ts");
/* harmony import */ var app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_7__ = __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 __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};








var Geracao = /** @class */ (function (_super) {
    __extends(Geracao, _super);
    function Geracao() {
        var _this = _super.call(this) || this;
        _this.materialId = "";
        _this.motoristaId = 0;
        _this.cliCotrPtrEntradaVeiculoId = 0;
        _this.tipoTransp = "";
        _this.estadoIdCavalo = "";
        _this.dtTriagem = new Date();
        _this.tipoVeiculoId = '';
        _this.gravaValidade = "N";
        _this.dtValidade = null;
        _this.dataCTE = null;
        _this.lastre = "";
        _this.dtGeracao = new Date();
        _this.material = new app_pages_cadastro_material_material_model__WEBPACK_IMPORTED_MODULE_3__["Material"]();
        _this.transportadora = new app_pages_cadastro_destinatario_destinatario_model__WEBPACK_IMPORTED_MODULE_1__["Destinatario"]();
        _this.motorista = new _cadastro_motorista_motorista_model__WEBPACK_IMPORTED_MODULE_0__["Motorista"]();
        return _this;
    }
    return Geracao;
}(app_shared_services_base_base_model__WEBPACK_IMPORTED_MODULE_6__["BaseModel"]));

var EntradaVeiculoItem = /** @class */ (function (_super) {
    __extends(EntradaVeiculoItem, _super);
    function EntradaVeiculoItem() {
        var _this = _super.call(this) || this;
        _this.cliCotrPtrEntradaVeiculoId = 0;
        _this.cliCotrPtrEntradaVeiculoItemId = 0;
        _this.destinatarioIdCliente = 0;
        _this.destinatarioIdEmitente = 0;
        _this.loteId = '';
        _this.tanqueId = '';
        _this.docto = null;
        _this.modeloNotaId = '';
        _this.chaveNfe = '';
        _this.serieNotaId = '';
        _this.dtDocumento = null;
        _this.quantidDoc = 0;
        _this.pesoDoc = 0;
        _this.totItem = 0;
        _this.dtEntregaNf = new Date();
        _this.codTipoDocto = null;
        _this.docTranspNumero = '';
        _this.docTranspEmissao = null;
        _this.observacao = '';
        _this.tipoFrete = null;
        _this.naturezaId = '';
        _this.cliente = new app_pages_cadastro_destinatario_destinatario_model__WEBPACK_IMPORTED_MODULE_1__["Destinatario"]();
        _this.emitente = new app_pages_cadastro_destinatario_destinatario_model__WEBPACK_IMPORTED_MODULE_1__["Destinatario"]();
        _this.material = new app_pages_cadastro_material_material_model__WEBPACK_IMPORTED_MODULE_3__["Material"]();
        _this.tanque = new app_pages_cadastro_tanque_tanque_model__WEBPACK_IMPORTED_MODULE_5__["Tanque"]();
        _this.lote = new app_pages_cadastro_lote_lote_model__WEBPACK_IMPORTED_MODULE_2__["Lote"]();
        _this.modeloNota = new app_pages_cadastro_modelo_nota_modelo_nota_model__WEBPACK_IMPORTED_MODULE_4__["ModeloNota"]();
        return _this;
    }
    return EntradaVeiculoItem;
}(app_shared_services_base_base_model__WEBPACK_IMPORTED_MODULE_6__["BaseModel"]));

var GeracaoFilter = /** @class */ (function () {
    function GeracaoFilter() {
        this.dataI = app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_7__["DateTimeUtilsStaticService"].getFirstDayOfMonth();
        this.dataF = app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_7__["DateTimeUtilsStaticService"].getFinalDay();
        this.materialId = "";
        this.destinatarioTransportadoraId = 0;
        this.motoristaId = 0;
        this.cliCotrPtrEntradaVeiculoId = 0;
        this.cadastroPlacaId = "";
        this.tipoVeiculoId = "";
        this.material = new app_pages_cadastro_material_material_model__WEBPACK_IMPORTED_MODULE_3__["Material"]();
        this.motorista = new _cadastro_motorista_motorista_model__WEBPACK_IMPORTED_MODULE_0__["Motorista"]();
        this.transportadora = new app_pages_cadastro_destinatario_destinatario_model__WEBPACK_IMPORTED_MODULE_1__["Destinatario"]();
    }
    return GeracaoFilter;
}());

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



/***/ }),

/***/ "./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao.module.ts":
/*!*********************************************************************************!*\
  !*** ./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao.module.ts ***!
  \*********************************************************************************/
/*! exports provided: GeracaoModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GeracaoModule", function() { return GeracaoModule; });
/* 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 _geracao_confirmacao_chegada_geracao_confirmacao_chegada_component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./geracao-confirmacao-chegada/geracao-confirmacao-chegada.component */ "./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao-confirmacao-chegada/geracao-confirmacao-chegada.component.ts");
/* harmony import */ var _geracao_form_geracao_form_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./geracao-form/geracao-form.component */ "./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao-form/geracao-form.component.ts");
/* harmony import */ var _geracao_item_geracao_item_component__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./geracao-item/geracao-item.component */ "./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao-item/geracao-item.component.ts");
/* harmony import */ var _geracao_routing_module__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./geracao.routing.module */ "./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao.routing.module.ts");
/* harmony import */ var _geracao_motorista_validade_geracao_motorista_validade_component__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./geracao-motorista-validade/geracao-motorista-validade.component */ "./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao-motorista-validade/geracao-motorista-validade.component.ts");
/* harmony import */ var _geracao_filter_geracao_filter_component__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./geracao-filter/geracao-filter.component */ "./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao-filter/geracao-filter.component.ts");
/* harmony import */ var _geracao_index_geracao_index_component__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./geracao-index/geracao-index.component */ "./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao-index/geracao-index.component.ts");
/* harmony import */ var _geracao_print_modal_geracao_print_modal_component__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./geracao-print-modal/geracao-print-modal.component */ "./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao-print-modal/geracao-print-modal.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 GeracaoModule = /** @class */ (function () {
    function GeracaoModule() {
    }
    GeracaoModule = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"])({
            imports: [app_shared_shared_module__WEBPACK_IMPORTED_MODULE_1__["SharedModule"], _geracao_routing_module__WEBPACK_IMPORTED_MODULE_5__["GeracaoRoutingModule"]],
            declarations: [
                _geracao_form_geracao_form_component__WEBPACK_IMPORTED_MODULE_3__["GeracaoFormComponent"],
                _geracao_item_geracao_item_component__WEBPACK_IMPORTED_MODULE_4__["GeracaoItemComponent"],
                _geracao_confirmacao_chegada_geracao_confirmacao_chegada_component__WEBPACK_IMPORTED_MODULE_2__["GeracaoConfirmacaoChegadaComponent"],
                _geracao_motorista_validade_geracao_motorista_validade_component__WEBPACK_IMPORTED_MODULE_6__["GeracaoMotoristaValidadeComponent"],
                _geracao_filter_geracao_filter_component__WEBPACK_IMPORTED_MODULE_7__["GeracaoFilterComponent"],
                _geracao_index_geracao_index_component__WEBPACK_IMPORTED_MODULE_8__["GeracaoIndexComponent"],
                _geracao_print_modal_geracao_print_modal_component__WEBPACK_IMPORTED_MODULE_9__["GeracaoPrintModalComponent"]
            ]
        })
    ], GeracaoModule);
    return GeracaoModule;
}());



/***/ }),

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

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GeracaoRoutingModule", function() { return GeracaoRoutingModule; });
/* 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 _geracao_confirmacao_chegada_geracao_confirmacao_chegada_component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./geracao-confirmacao-chegada/geracao-confirmacao-chegada.component */ "./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao-confirmacao-chegada/geracao-confirmacao-chegada.component.ts");
/* harmony import */ var _geracao_form_geracao_form_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./geracao-form/geracao-form.component */ "./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao-form/geracao-form.component.ts");
/* harmony import */ var app_config_enumerables__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! app/config/enumerables */ "./src/app/config/enumerables.ts");
/* harmony import */ var _geracao_index_geracao_index_component__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./geracao-index/geracao-index.component */ "./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao-index/geracao-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: _geracao_index_geracao_index_component__WEBPACK_IMPORTED_MODULE_5__["GeracaoIndexComponent"],
        data: {
            breadcrumb: "geracao",
            formParams: { action: app_config_enumerables__WEBPACK_IMPORTED_MODULE_4__["ActionForm"].index }
        }
    },
    {
        path: "create",
        component: _geracao_form_geracao_form_component__WEBPACK_IMPORTED_MODULE_3__["GeracaoFormComponent"],
        data: {
            breadcrumb: "geracao",
            formParams: { action: app_config_enumerables__WEBPACK_IMPORTED_MODULE_4__["ActionForm"].create }
        }
    },
    {
        path: "create/:id",
        component: _geracao_form_geracao_form_component__WEBPACK_IMPORTED_MODULE_3__["GeracaoFormComponent"],
        data: {
            breadcrumb: "geracao",
            formParams: { action: app_config_enumerables__WEBPACK_IMPORTED_MODULE_4__["ActionForm"].create }
        }
    },
    {
        path: "chegada",
        component: _geracao_confirmacao_chegada_geracao_confirmacao_chegada_component__WEBPACK_IMPORTED_MODULE_2__["GeracaoConfirmacaoChegadaComponent"],
        data: {
            breadcrumb: "confirmacaoChegada"
        }
    },
    {
        path: "edit/:id",
        component: _geracao_form_geracao_form_component__WEBPACK_IMPORTED_MODULE_3__["GeracaoFormComponent"],
        data: {
            breadcrumb: "geracao",
            formParams: { action: app_config_enumerables__WEBPACK_IMPORTED_MODULE_4__["ActionForm"].edit }
        }
    },
    {
        path: "detail/:id",
        component: _geracao_form_geracao_form_component__WEBPACK_IMPORTED_MODULE_3__["GeracaoFormComponent"],
        data: {
            breadcrumb: "geracao",
            formParams: { action: app_config_enumerables__WEBPACK_IMPORTED_MODULE_4__["ActionForm"].detail }
        }
    }
];
var GeracaoRoutingModule = /** @class */ (function () {
    function GeracaoRoutingModule() {
    }
    GeracaoRoutingModule = __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"]]
        })
    ], GeracaoRoutingModule);
    return GeracaoRoutingModule;
}());



/***/ }),

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

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GeracaoService", function() { return GeracaoService; });
/* 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_shared_services_base_specifics_base_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! app/shared/services/base/specifics.base.service */ "./src/app/shared/services/base/specifics.base.service.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");
/* harmony import */ var app_app_error_handler__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! app/app.error-handler */ "./src/app/app.error-handler.ts");
/* harmony import */ var _geracao_model__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./geracao.model */ "./src/app/pages/especificos/cotriguacu/portaria/geracao/geracao.model.ts");
/* harmony import */ var app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_7__ = __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_message_message_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! app/shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (undefined && undefined.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};









var GeracaoService = /** @class */ (function (_super) {
    __extends(GeracaoService, _super);
    function GeracaoService(http, messageService) {
        var _this = _super.call(this, http, "cotriguacu/geracao") || this;
        _this.messageService = messageService;
        _this.data = new _geracao_model__WEBPACK_IMPORTED_MODULE_6__["Geracao"]();
        _this.filtro = new _geracao_model__WEBPACK_IMPORTED_MODULE_6__["GeracaoFilter"]();
        _this.errosDocMotorista = [
            { tipoDoc: 'CNH', isValid: true, message: "", data: undefined, question: false, modal: true },
            { tipoDoc: 'RESTRICAO', isValid: true, message: "", data: undefined, question: true, modal: false },
            { tipoDoc: 'VEICULOABERTO', isValid: true, message: "", data: undefined, question: true, modal: false }
        ];
        _this.configs = {
            maskPlaca: undefined,
            intCta: false,
            depositoADefinir: null,
            calculaTotalNF: false,
            tQIsotanque: '',
            impChkGeracao: false,
            impPevGeracao: false,
            impCheckinGeracao: false,
            cWebModCheckList: '',
            cWebModPev: '',
            cWebModCheckIn: '',
            prefixoRelEspecifico: '',
            solicitaNumCartao: false,
            transitTime: false
        };
        return _this;
    }
    GeracaoService.prototype.validaSePodeEditar = function (data) {
        if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_7__["NumberUtilsStaticService"].isPositive(data.regControle)) {
            this.messageService.warning("titles.geracao", "messages.lancamentoJaRealizadoAlteracaoNaoPermitida");
            return false;
        }
        return true;
    };
    GeracaoService.prototype.executaExclusao = function (filter) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_3__["environment"].specifics_service_url + "/api/v1/cotriguacu/geracao/executaExclusao", filter)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_5__["ErrorHandler"].handleError));
    };
    GeracaoService.prototype._getById = function (id) {
        return this.http
            .get(environments_environment__WEBPACK_IMPORTED_MODULE_3__["environment"].specifics_service_url + "/api/v1/cotriguacu/geracao/" + id)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_5__["ErrorHandler"].handleError));
    };
    GeracaoService.prototype.verificaSeDocumentoJaExiste = function (data) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_3__["environment"].specifics_service_url + "/api/v1/cotriguacu/geracao/verificaSeDocumentoJaExiste", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_5__["ErrorHandler"].handleError));
    };
    GeracaoService.prototype.cancelar = function (data) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_3__["environment"].specifics_service_url + "/api/v1/cotriguacu/geracao/cancelar", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_5__["ErrorHandler"].handleError));
    };
    GeracaoService.prototype.getByFiltro = function (filter) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_3__["environment"].specifics_service_url + "/api/v1/cotriguacu/geracao/getByFiltro", filter)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_5__["ErrorHandler"].handleError));
    };
    GeracaoService.ctorParameters = function () { return [
        { type: _angular_common_http__WEBPACK_IMPORTED_MODULE_0__["HttpClient"] },
        { type: app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_8__["MessageService"] }
    ]; };
    GeracaoService = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"])({
            providedIn: "root"
        }),
        __metadata("design:paramtypes", [_angular_common_http__WEBPACK_IMPORTED_MODULE_0__["HttpClient"],
            app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_8__["MessageService"]])
    ], GeracaoService);
    return GeracaoService;
}(app_shared_services_base_specifics_base_service__WEBPACK_IMPORTED_MODULE_2__["SpecificsBaseService"]));



/***/ })

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