(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["app-pages-especificos-cotriguacu-movimentos-entrada-veiculo-operacional-entrada-veiculo-operacional-module"],{

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/cotriguacu/movimentos/entrada-veiculo-operacional/entrada-veiculo-operacional-filter/entrada-veiculo-operacional-filter.component.html":
/*!****************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/cotriguacu/movimentos/entrada-veiculo-operacional/entrada-veiculo-operacional-filter/entrada-veiculo-operacional-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\" id=\"entrada-veiculo-operacional-filter-dialog\" tabindex=\"-1\" role=\"dialog\" data-backdrop=\"static\">\r\n    <div class=\"uni-modal-dialog-md-40\">\r\n        <div class=\"modal-content\">\r\n            <div class=\"modal-header\">\r\n                <h6 class=\"modal-title\">{{title}}</h6>\r\n            </div>\r\n            <form class=\"form\" #form=\"ngForm\" (ngSubmit)=\"onSubmit(form)\" *ngIf=\"!!service.filter\">\r\n                <app-validacoes></app-validacoes>\r\n                <div class=\"modal-body\">\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=\"periodoDe\" class=\"required\">\r\n                                    {{\"labels.periodoDe\" | translate }}\r\n                                </label>\r\n                                <app-data id=\"periodoDe\" name=\"periodoDe\" required=\"true\" [disabled]=\"false\"\r\n                                    [(ngModel)]=\"service.filter.dataI\"\r\n                                    (executa)=\"validaDatas()\">\r\n                                </app-data>\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=\"ate\" class=\"required\">\r\n                                    {{\"labels.ate\" | translate}}\r\n                                </label>\r\n                                <app-data id=\"ate\" name=\"ate\" required=\"true\" [disabled]=\"false\"\r\n                                    [(ngModel)]=\"service.filter.dataF\"\r\n                                    (executa)=\"validaDatas()\">\r\n                                </app-data>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"row\">\r\n                        <div class=\"col-lg-6 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)]=\"service.filter.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\">\r\n                        <div class=\"col-md-12 col-sm-12\">\r\n                            <div class=\"form-group form-group-sm\">\r\n                                <app-pesquisa-destinatario id=\"cliente\" name=\"cliente\" label=\"cliente\"\r\n                                    modalTitle=\"pesquisaDeCliente\" [(ngModel)]=\"service.filter.destinatarioIdCliente\"\r\n                                    [inSelected]=\"service.filter.cliente\" tipoDestinatario=\"C\" showCgcCpf=\"false\"\r\n                                    showInscricao=\"false\" (outModel)=\"trataCliente($event)\">\r\n                                </app-pesquisa-destinatario>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"modal-footer\">\r\n                    <button class=\"btn btn-success mr-1\" type=\"submit\">{{ 'buttons.pesquisar' | translate }}\r\n                    </button>\r\n                    <button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">{{ 'buttons.sair' | 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/movimentos/entrada-veiculo-operacional/entrada-veiculo-operacional-form/entrada-veiculo-operacional-form.component.html":
/*!************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/cotriguacu/movimentos/entrada-veiculo-operacional/entrada-veiculo-operacional-form/entrada-veiculo-operacional-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\" [formAction]=\"actionForm\"\r\n    [itemData]=\"service.data.entradaVeiculoId\" [sisFormularioId]=\"constantes.sisFormularioId\">\r\n</app-menu-command-bar>\r\n\r\n<div class=\"row\">\r\n    <div class=\"col-lg-12\">\r\n        <div class=\"section-comand-bar\">\r\n            <app-form-legenda></app-form-legenda>\r\n            <div class=\"card-body widget-body\">\r\n                <form class=\"form\" #f=\"ngForm\" (ngSubmit)=\"onSubmit(f)\">\r\n                    <app-validacoes></app-validacoes>\r\n                    <div class=\"row\">\r\n                        <div class=\"col-lg-6 col-md-8 col-sm-12\">\r\n                            <div class=\"form-group form-group-sm\">\r\n                                <app-input-description label=\"cliente\" [valueID]=\"service.data?.destinatarioIdCliente\"\r\n                                    [valueDescription]=\"service.data?.cliente\">\r\n                                </app-input-description>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"row\">\r\n                        <div class=\"col-lg-6 col-md-8 col-sm-12\">\r\n                            <div class=\"form-group form-group-sm\">\r\n                                <app-input-description label=\"material\" [valueID]=\"service.data?.materialId\"\r\n                                    [valueDescription]=\"service.data?.produto\">\r\n                                </app-input-description>\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=\"placaDoCavalo\">\r\n                                    {{'labels.placaDoCavalo' | translate}}\r\n                                </label>\r\n                                <input id=\"placaDoCavalo\" name=\"placaDoCavalo\"\r\n                                    class=\"form-control form-control-sm text-uppercase\" type=\"text\" maxlength=\"8\"\r\n                                    disabled [(ngModel)]=\"service.data.cadastroPlacaIdCavalo\" />\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"row\">\r\n                        <div class=\"col-lg-9 col-sm-12\">\r\n                            <app-pesquisa-motorista id=\"motorista\" name=\"motorista\" label=\"motorista\"\r\n                                modalTitle=\"pesquisaMotorista\" [(ngModel)]=\"service.data.motoristaId\" [showCpf]=\"true\"\r\n                                [inputMotorista]=\"service.data.motorista\" required=\"true\"\r\n                                (outMotorista)=\"service.trataMotorista($event)\">\r\n                            </app-pesquisa-motorista>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"row\">\r\n                        <div class=\"col-lg-3 col-md-6\">\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}}\"\r\n                                    disabled>\r\n                            </div>\r\n                        </div>\r\n                        <div class=\"col-lg-3 col-md-6\">\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 class=\"col-lg-3 col-md-6\">\r\n                            <div class=\"form-group form-group-sm\">\r\n                                <label for=\"motoristaRgCM\">{{'labels.rg' | translate }}</label>\r\n                                <input id=\"motoristaRgCM\" type=\"text\" name=\"motoristaRgCM\"\r\n                                    class=\"form-control form-control-sm\" value=\"{{service.data.motorista?.rg}}\"\r\n                                    disabled>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"row\">\r\n                        <div class=\"col-lg-3 col-md-6\">\r\n                            <div class=\"form-group form-group-sm\">\r\n                                <label for=\"numeroDoCartao\" class=\"required\">{{'labels.numeroDoCartao' |\r\n                                    translate}}</label>\r\n                                <input id=\"numeroDoCartao\" type=\"text\" name=\"numeroDoCartao\" maxlength=\"10\"\r\n                                    class=\"form-control form-control-sm\" [(ngModel)]=\"service.data.numCracha\" required\r\n                                    data-title=\"{{ 'labels.numeroDoCartao' | translate }}\" (blur)=\"verifNumCracha()\">\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"clearfix\">&nbsp;</div>\r\n                    <div class=\"row\">\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                            </div>\r\n                        </div>\r\n                    </div>\r\n                </form>\r\n            </div>\r\n        </div>\r\n    </div>\r\n</div>\r\n\r\n<app-permissoes-rotina [constantes]=\"constantes\"></app-permissoes-rotina>\r\n<app-liberar-acesso-supervisor></app-liberar-acesso-supervisor>\r\n<app-entrada-veiculo-operacional-motorista-validade (confirm)=\"service.validaMotorista($event)\">\r\n</app-entrada-veiculo-operacional-motorista-validade>");

/***/ }),

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/cotriguacu/movimentos/entrada-veiculo-operacional/entrada-veiculo-operacional-index/entrada-veiculo-operacional-index.component.html":
/*!**************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/cotriguacu/movimentos/entrada-veiculo-operacional/entrada-veiculo-operacional-index/entrada-veiculo-operacional-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\"\n    [formAction]=\"actionForm\" [itemData]=\"data.entradaVeiculoId\">\n</app-menu-command-bar>\n\n<div class=\"section-comand-bar\">\n    <table id=\"dtEntradaVeiculoOperacional\" class=\"table table-striped table-bordered table-hover nowrap table-sm\">\n    </table>\n</div>\n\n<app-propriedades></app-propriedades>\n<app-liberar-acesso-supervisor></app-liberar-acesso-supervisor>\n<app-permissoes-rotina [constantes]=\"constantes\"></app-permissoes-rotina>\n<app-entrada-veiculo-operacional-filter (filtrar)=\"executarFiltro($event)\">\n</app-entrada-veiculo-operacional-filter>");

/***/ }),

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/cotriguacu/movimentos/entrada-veiculo-operacional/entrada-veiculo-operacional-motorista-validade/entrada-veiculo-operacional-motorista-validade.component.html":
/*!****************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/cotriguacu/movimentos/entrada-veiculo-operacional/entrada-veiculo-operacional-motorista-validade/entrada-veiculo-operacional-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=\"entrada-veiculo-operacional-motorista-validade-dialog\" tabindex=\"-1\" role=\"dialog\"\r\n    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)\">{{\r\n                        '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>");

/***/ }),

/***/ "./src/app/pages/especificos/cotriguacu/movimentos/entrada-veiculo-operacional/entrada-veiculo-operacional-filter/entrada-veiculo-operacional-filter.component.ts":
/*!************************************************************************************************************************************************************************!*\
  !*** ./src/app/pages/especificos/cotriguacu/movimentos/entrada-veiculo-operacional/entrada-veiculo-operacional-filter/entrada-veiculo-operacional-filter.component.ts ***!
  \************************************************************************************************************************************************************************/
/*! exports provided: EntradaVeiculoOperacionalFilterComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EntradaVeiculoOperacionalFilterComponent", function() { return EntradaVeiculoOperacionalFilterComponent; });
/* 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_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_1__ = __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_message_message_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! app/shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var _entrada_veiculo_operacional_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../entrada-veiculo-operacional.constants */ "./src/app/pages/especificos/cotriguacu/movimentos/entrada-veiculo-operacional/entrada-veiculo-operacional.constants.ts");
/* harmony import */ var _entrada_veiculo_operacional_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../entrada-veiculo-operacional.service */ "./src/app/pages/especificos/cotriguacu/movimentos/entrada-veiculo-operacional/entrada-veiculo-operacional.service.ts");
/* harmony import */ var app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_5__ = __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 EntradaVeiculoOperacionalFilterComponent = /** @class */ (function () {
    function EntradaVeiculoOperacionalFilterComponent(service, message) {
        this.service = service;
        this.message = message;
        this.constantes = new _entrada_veiculo_operacional_constants__WEBPACK_IMPORTED_MODULE_3__["EntradaVeiculoOperacionalConstants"]();
        this.filtrar = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
    }
    EntradaVeiculoOperacionalFilterComponent.prototype.ngOnInit = function () {
    };
    Object.defineProperty(EntradaVeiculoOperacionalFilterComponent.prototype, "title", {
        get: function () {
            return this.message.translate("titles.entradaVeiculoOperacional");
        },
        enumerable: true,
        configurable: true
    });
    EntradaVeiculoOperacionalFilterComponent.prototype.onSubmit = function (form) {
        app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_1__["EventEmitterService"].get("formError").emit(form);
        if (form.invalid)
            return;
        this.filtrar.emit(this.service.filter);
        jQuery("#entrada-veiculo-operacional-filter-dialog").modal("hide");
    };
    EntradaVeiculoOperacionalFilterComponent.prototype.trataCliente = function (cliente) {
        if (!cliente)
            return;
        this.service.filter.cliente = cliente;
    };
    EntradaVeiculoOperacionalFilterComponent.prototype.validaDatas = function () {
        if (app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_5__["DateTimeUtilsStaticService"].menorA(this.service.filter.dataF, this.service.filter.dataI, ['H', 'M'])) {
            this.message.warning("titles.entradaVeiculoOperacional", "messages.dataInicioNaoPodeSerMaiorDataFim");
        }
    };
    EntradaVeiculoOperacionalFilterComponent.ctorParameters = function () { return [
        { type: _entrada_veiculo_operacional_service__WEBPACK_IMPORTED_MODULE_4__["EntradaVeiculoOperacionalService"] },
        { type: app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_2__["MessageService"] }
    ]; };
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"])(),
        __metadata("design:type", Object)
    ], EntradaVeiculoOperacionalFilterComponent.prototype, "filtrar", void 0);
    EntradaVeiculoOperacionalFilterComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
            selector: "app-entrada-veiculo-operacional-filter",
            template: __importDefault(__webpack_require__(/*! raw-loader!./entrada-veiculo-operacional-filter.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/cotriguacu/movimentos/entrada-veiculo-operacional/entrada-veiculo-operacional-filter/entrada-veiculo-operacional-filter.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [_entrada_veiculo_operacional_service__WEBPACK_IMPORTED_MODULE_4__["EntradaVeiculoOperacionalService"],
            app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_2__["MessageService"]])
    ], EntradaVeiculoOperacionalFilterComponent);
    return EntradaVeiculoOperacionalFilterComponent;
}());



/***/ }),

/***/ "./src/app/pages/especificos/cotriguacu/movimentos/entrada-veiculo-operacional/entrada-veiculo-operacional-form/entrada-veiculo-operacional-form.component.ts":
/*!********************************************************************************************************************************************************************!*\
  !*** ./src/app/pages/especificos/cotriguacu/movimentos/entrada-veiculo-operacional/entrada-veiculo-operacional-form/entrada-veiculo-operacional-form.component.ts ***!
  \********************************************************************************************************************************************************************/
/*! exports provided: EntradaVeiculoOperacionalFormComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EntradaVeiculoOperacionalFormComponent", function() { return EntradaVeiculoOperacionalFormComponent; });
/* harmony import */ var _veiculo_entrada_veiculo_entrada_veiculo_service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../../../../../veiculo/entrada-veiculo/entrada-veiculo.service */ "./src/app/pages/veiculo/entrada-veiculo/entrada-veiculo.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_config_enumerables__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! app/config/enumerables */ "./src/app/config/enumerables.ts");
/* harmony import */ var app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! app/pages/login/login.service */ "./src/app/pages/login/login.service.ts");
/* harmony import */ var app_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_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_funcoes_service__WEBPACK_IMPORTED_MODULE_7__ = __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_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_message_message_service__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! app/shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var _entrada_veiculo_operacional_constants__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../entrada-veiculo-operacional.constants */ "./src/app/pages/especificos/cotriguacu/movimentos/entrada-veiculo-operacional/entrada-veiculo-operacional.constants.ts");
/* harmony import */ var _entrada_veiculo_operacional_service__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../entrada-veiculo-operacional.service */ "./src/app/pages/especificos/cotriguacu/movimentos/entrada-veiculo-operacional/entrada-veiculo-operacional.service.ts");
/* harmony import */ var app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_12__ = __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_13__ = __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_motorista_motorista_service__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! app/pages/cadastro/motorista/motorista.service */ "./src/app/pages/cadastro/motorista/motorista.service.ts");
/* harmony import */ var app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! app/shared/services/funcoes/configuracao/configuracao.facade */ "./src/app/shared/services/funcoes/configuracao/configuracao.facade.ts");
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 EntradaVeiculoOperacionalFormComponent = /** @class */ (function (_super) {
    __extends(EntradaVeiculoOperacionalFormComponent, _super);
    function EntradaVeiculoOperacionalFormComponent(router, message, activatedRoute, service, funcoes, permissoesUtils, loginService, motoristaService, entradaVeiculoService, configuracao) {
        var _this = _super.call(this, new _entrada_veiculo_operacional_constants__WEBPACK_IMPORTED_MODULE_10__["EntradaVeiculoOperacionalConstants"](), funcoes) || this;
        _this.router = router;
        _this.message = message;
        _this.activatedRoute = activatedRoute;
        _this.service = service;
        _this.funcoes = funcoes;
        _this.permissoesUtils = permissoesUtils;
        _this.loginService = loginService;
        _this.motoristaService = motoristaService;
        _this.entradaVeiculoService = entradaVeiculoService;
        _this.configuracao = configuracao;
        _this.mensagens = [];
        _this.constantes = new _entrada_veiculo_operacional_constants__WEBPACK_IMPORTED_MODULE_10__["EntradaVeiculoOperacionalConstants"]();
        _this.mascara = new app_config_enumerables__WEBPACK_IMPORTED_MODULE_3__["Mascaras"]();
        _this.pageRoute = "/especificos/cotriguacu/movimentos/entradaVeiculoOperacional";
        _this.target = _this.funcoes.getTargetLocation();
        _this.callPosCarregamento = function () {
            if (!_this.configuracao.isLoadConfig())
                return;
            _this.service.configs.utilCartaoOutroVeic = _this.configuracao.boolean("CTV", "utilCartaoOutroVeic");
        };
        router.events.subscribe(function (event) {
            var params = _this.funcoes.formParams.getParams(router, event);
            if (params) {
                _this.actionForm = params.action;
            }
        });
        return _this;
    }
    EntradaVeiculoOperacionalFormComponent.prototype.ngOnInit = function () {
        var _this = this;
        this.permissoesUtils.validRotina(this.constantes.sisFormularioId, 1, function () {
            var obj = _this.activatedRoute.snapshot.paramMap.get("object");
            _this.configuracao.getConfig(_this.constantes.parametrosConfig, _this.callPosCarregamento);
            _this.urlObject = JSON.parse(atob(obj));
            if (!_this.urlObject) {
                _this.message.warning("titles.entradaVeiculoOperacional", "messages.nenhumRegistroEncontrado");
                _this.back();
            }
            _this.init(_this.urlObject);
        }, function () { });
    };
    EntradaVeiculoOperacionalFormComponent.prototype.init = function (entradaVeiculoOperacional) {
        var _this = this;
        this.service.data.entradaVeiculoId = app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_12__["NumberUtilsStaticService"].toNumber(entradaVeiculoOperacional.entradaVeiculoId);
        this.service.data.destinatarioIdCliente = app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_12__["NumberUtilsStaticService"].toNumber(entradaVeiculoOperacional.destinatarioIdCliente);
        this.service.data.cliente = app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_13__["StringUtilsStaticService"].toString(entradaVeiculoOperacional.cliente);
        this.service.data.materialId = app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_13__["StringUtilsStaticService"].toString(entradaVeiculoOperacional.materialId);
        this.service.data.produto = app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_13__["StringUtilsStaticService"].toString(entradaVeiculoOperacional.produto);
        this.service.data.cadastroPlacaIdCavalo = app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_13__["StringUtilsStaticService"].toString(entradaVeiculoOperacional.cadastroPlacaIdCavalo);
        this.service.data.motoristaId = app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_12__["NumberUtilsStaticService"].toNumber(entradaVeiculoOperacional.motoristaId);
        if (!!this.service.data.motoristaId) {
            this.motoristaService.getById(this.service.data.motoristaId).subscribe(function (resp) {
                _this.service.data.motorista = resp;
            });
        }
        this.service.data.numCracha = app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_13__["StringUtilsStaticService"].toString(entradaVeiculoOperacional.numCracha);
    };
    EntradaVeiculoOperacionalFormComponent.prototype.onSubmit = function (form, create) {
        if (create === void 0) { create = false; }
        return __awaiter(this, void 0, void 0, function () {
            var validationResult, mensagens;
            var _this = this;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_6__["EventEmitterService"].get("formError").emit(null);
                        if (form.invalid) {
                            app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_6__["EventEmitterService"].get("formError").emit(form);
                            this.funcoesService.backToTop();
                            return [2 /*return*/];
                        }
                        return [4 /*yield*/, this.service._save(this.service.data).toPromise()];
                    case 1:
                        validationResult = _a.sent();
                        if (!validationResult.isValid) {
                            mensagens = this.message.validationResult(validationResult);
                            mensagens.forEach(function (m) { return _this.message.warning("titles.entradaVeiculoOperacional", m); });
                            return [2 /*return*/];
                        }
                        else {
                            this.message.saveSuccess("titles.entradaVeiculo", "messages.entradaDoVeiculoCadastradaComSucesso");
                            this.back();
                        }
                        return [2 /*return*/];
                }
            });
        });
    };
    EntradaVeiculoOperacionalFormComponent.prototype.saveAndCreate = function (form) {
        this.onSubmit(form, true);
    };
    EntradaVeiculoOperacionalFormComponent.prototype.back = function () {
        this.router.navigate(["" + this.target + this.pageRoute]);
    };
    EntradaVeiculoOperacionalFormComponent.prototype.verifNumCracha = function () {
        return __awaiter(this, void 0, void 0, function () {
            var result, errorCartaoEmUso, r;
            var _this = this;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        if (app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_13__["StringUtilsStaticService"].isEmpty(this.service.data.numCracha))
                            return [2 /*return*/];
                        return [4 /*yield*/, this.entradaVeiculoService.getVerificaSeCrachaEstaSendoUsado({
                                "regControle": +this.service.data.entradaVeiculoId,
                                "numCracha": this.service.data.numCracha,
                                "numCracha2": "",
                                "cartao": 1,
                                "codLocalOper": 0
                            }).toPromise()];
                    case 1:
                        result = _a.sent();
                        errorCartaoEmUso = "Cartão já em uso por outro veículo";
                        r = { "isValid": true, "message": "" };
                        r.isValid = !!result.validationResult ? result.validationResult.isValid : true;
                        r.message = result.message;
                        if (r.message === errorCartaoEmUso && this.service.configs.utilCartaoOutroVeic) {
                            this.message.confirm("titles.entradaVeiculoOperacional", "messages.desejaAtualizarVeiculo", "", function () { return __awaiter(_this, void 0, void 0, function () {
                                return __generator(this, function (_a) {
                                    this.entradaVeiculoService.gravaNumCrachaEntradaVeiculo({
                                        "entradaVeiculoId": +this.service.data.entradaVeiculoId,
                                        "numCracha": this.service.data.numCracha,
                                        "operador": this.loginService.getLogin().usuario
                                    }).subscribe();
                                    return [2 /*return*/];
                                });
                            }); });
                        }
                        else {
                            if (!!r.message)
                                this.message.warning("titles.entradaVeiculoOperacional", r.message);
                        }
                        return [2 /*return*/];
                }
            });
        });
    };
    EntradaVeiculoOperacionalFormComponent.ctorParameters = function () { return [
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_2__["Router"] },
        { type: app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_9__["MessageService"] },
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_2__["ActivatedRoute"] },
        { type: _entrada_veiculo_operacional_service__WEBPACK_IMPORTED_MODULE_11__["EntradaVeiculoOperacionalService"] },
        { type: app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_7__["FuncoesService"] },
        { type: app_shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_8__["PermissoesUtilsService"] },
        { type: app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_4__["LoginService"] },
        { type: app_pages_cadastro_motorista_motorista_service__WEBPACK_IMPORTED_MODULE_14__["MotoristaService"] },
        { type: _veiculo_entrada_veiculo_entrada_veiculo_service__WEBPACK_IMPORTED_MODULE_0__["EntradaVeiculoService"] },
        { type: app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_15__["ConfiguracaoFacade"] }
    ]; };
    EntradaVeiculoOperacionalFormComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"])({
            selector: "app-entrada-veiculo-operacional-form",
            template: __importDefault(__webpack_require__(/*! raw-loader!./entrada-veiculo-operacional-form.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/cotriguacu/movimentos/entrada-veiculo-operacional/entrada-veiculo-operacional-form/entrada-veiculo-operacional-form.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_message_message_service__WEBPACK_IMPORTED_MODULE_9__["MessageService"],
            _angular_router__WEBPACK_IMPORTED_MODULE_2__["ActivatedRoute"],
            _entrada_veiculo_operacional_service__WEBPACK_IMPORTED_MODULE_11__["EntradaVeiculoOperacionalService"],
            app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_7__["FuncoesService"],
            app_shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_8__["PermissoesUtilsService"],
            app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_4__["LoginService"],
            app_pages_cadastro_motorista_motorista_service__WEBPACK_IMPORTED_MODULE_14__["MotoristaService"],
            _veiculo_entrada_veiculo_entrada_veiculo_service__WEBPACK_IMPORTED_MODULE_0__["EntradaVeiculoService"],
            app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_15__["ConfiguracaoFacade"]])
    ], EntradaVeiculoOperacionalFormComponent);
    return EntradaVeiculoOperacionalFormComponent;
}(app_shared_components_corporate_base_base_permissoes__WEBPACK_IMPORTED_MODULE_5__["BasePermissoes"]));



/***/ }),

/***/ "./src/app/pages/especificos/cotriguacu/movimentos/entrada-veiculo-operacional/entrada-veiculo-operacional-index/entrada-veiculo-operacional-index.component.ts":
/*!**********************************************************************************************************************************************************************!*\
  !*** ./src/app/pages/especificos/cotriguacu/movimentos/entrada-veiculo-operacional/entrada-veiculo-operacional-index/entrada-veiculo-operacional-index.component.ts ***!
  \**********************************************************************************************************************************************************************/
/*! exports provided: EntradaVeiculoOperacionalIndexComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EntradaVeiculoOperacionalIndexComponent", function() { return EntradaVeiculoOperacionalIndexComponent; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/fesm5/router.js");
/* harmony import */ var app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! app/pages/login/login.service */ "./src/app/pages/login/login.service.ts");
/* harmony import */ var app_shared_components_corporate_base_base_permissoes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! app/shared/components/corporate/base/base.permissoes */ "./src/app/shared/components/corporate/base/base.permissoes.ts");
/* harmony import */ var app_shared_services_datatables_datatables_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! app/shared/services/datatables/datatables.service */ "./src/app/shared/services/datatables/datatables.service.ts");
/* harmony import */ var app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_5__ = __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_6__ = __webpack_require__(/*! app/shared/services/funcoes/funcoes.service */ "./src/app/shared/services/funcoes/funcoes.service.ts");
/* harmony import */ var app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_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_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_message_message_service__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! app/shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var _entrada_veiculo_operacional_model__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../entrada-veiculo-operacional.model */ "./src/app/pages/especificos/cotriguacu/movimentos/entrada-veiculo-operacional/entrada-veiculo-operacional.model.ts");
/* harmony import */ var _entrada_veiculo_operacional_constants__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../entrada-veiculo-operacional.constants */ "./src/app/pages/especificos/cotriguacu/movimentos/entrada-veiculo-operacional/entrada-veiculo-operacional.constants.ts");
/* harmony import */ var _entrada_veiculo_operacional_service__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../entrada-veiculo-operacional.service */ "./src/app/pages/especificos/cotriguacu/movimentos/entrada-veiculo-operacional/entrada-veiculo-operacional.service.ts");
/* harmony import */ var app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! app/shared/services/funcoes/string-utils/string-utils.static.service */ "./src/app/shared/services/funcoes/string-utils/string-utils.static.service.ts");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (undefined && undefined.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __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 EntradaVeiculoOperacionalIndexComponent = /** @class */ (function (_super) {
    __extends(EntradaVeiculoOperacionalIndexComponent, _super);
    function EntradaVeiculoOperacionalIndexComponent(router, service, datatables, permissoesUtils, message, loginService, funcoes) {
        var _this = _super.call(this, new _entrada_veiculo_operacional_constants__WEBPACK_IMPORTED_MODULE_11__["EntradaVeiculoOperacionalConstants"](), funcoes) || this;
        _this.router = router;
        _this.service = service;
        _this.datatables = datatables;
        _this.permissoesUtils = permissoesUtils;
        _this.message = message;
        _this.loginService = loginService;
        _this.funcoes = funcoes;
        _this.data = new _entrada_veiculo_operacional_model__WEBPACK_IMPORTED_MODULE_10__["EntradaVeiculoOperacional"]();
        _this.constantes = new _entrada_veiculo_operacional_constants__WEBPACK_IMPORTED_MODULE_11__["EntradaVeiculoOperacionalConstants"]();
        _this.pageRoute = "/especificos/cotriguacu/movimentos/entradaVeiculoOperacional";
        _this.target = _this.funcoesService.getTargetLocation();
        router.events.subscribe(function (event) {
            var params = _this.funcoesService.formParams.getParams(router, event);
            if (params) {
                _this.actionForm = params.action;
            }
        });
        return _this;
    }
    EntradaVeiculoOperacionalIndexComponent.prototype.ngOnInit = function () {
        var _this = this;
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 3, 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.service.filter) return [3 /*break*/, 2];
                        return [4 /*yield*/, this.refresh()];
                    case 1:
                        _a.sent();
                        _a.label = 2;
                    case 2:
                        if (!app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_5__["ArrayUtilsStaticService"].any(this.dados))
                            this.filtrar();
                        _a.label = 3;
                    case 3: return [2 /*return*/];
                }
            });
        }); }, function () {
            _this.permissoesUtils.back();
        }, true);
    };
    EntradaVeiculoOperacionalIndexComponent.prototype.refresh = function () {
        return __awaiter(this, void 0, void 0, function () {
            var _a, columns;
            var _this = this;
            return __generator(this, function (_b) {
                switch (_b.label) {
                    case 0:
                        if (!this.service.filter)
                            return [2 /*return*/];
                        _a = this;
                        return [4 /*yield*/, this.service.getByFiltro(this.service.filter).toPromise()];
                    case 1:
                        _a.dados = _b.sent();
                        columns = [
                            this.datatables.getDataString("entradaVeiculoId", "codigo", "10%"),
                            this.datatables.getDataString("cadastroPlacaIdCavalo", "placa"),
                            this.datatables.getDataString("motorista", "motorista"),
                            this.datatables.getDataString("cliente", "cliente"),
                            this.datatables.getDataString("produto", "produto"),
                        ];
                        this.datatables.datatable("dtEntradaVeiculoOperacional", columns, this.dados, function (aData) {
                            _this.data = aData;
                        }, 0, "asc");
                        return [2 /*return*/];
                }
            });
        });
    };
    EntradaVeiculoOperacionalIndexComponent.prototype.filtrar = function () {
        jQuery("#entrada-veiculo-operacional-filter-dialog").modal("show");
    };
    EntradaVeiculoOperacionalIndexComponent.prototype.executarFiltro = function (event) {
        this.service.filter = event;
        this.refresh();
    };
    EntradaVeiculoOperacionalIndexComponent.prototype.permissoes = function () {
        var _this = this;
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 4, function () {
            _super.prototype.permissoes.call(_this, _this.constantes);
        });
    };
    EntradaVeiculoOperacionalIndexComponent.prototype.itemSelecionado = function () {
        if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_7__["NumberUtilsStaticService"].isNotPositive(this.data.entradaVeiculoId)) {
            this.message.warning("titles.entradaVeiculoOperacional", "messages.selecioneUmRegistro");
            return false;
        }
        return true;
    };
    EntradaVeiculoOperacionalIndexComponent.prototype.create = function () {
        var _this = this;
        if (!this.itemSelecionado())
            return;
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 1, function () { return __awaiter(_this, void 0, void 0, function () {
            var object;
            return __generator(this, function (_a) {
                object = btoa(JSON.stringify({
                    entradaVeiculoId: this.data.entradaVeiculoId,
                    cadastroPlacaIdCavalo: this.data.cadastroPlacaIdCavalo,
                    motoristaId: this.data.motoristaId,
                    destinatarioIdCliente: this.data.destinatarioIdCliente,
                    cliente: this.data.cliente,
                    materialId: this.data.materialId,
                    produto: this.data.produto,
                    numCracha: this.data.numCracha
                }));
                this.router.navigate(["" + this.target + this.pageRoute + "/create/" + object]);
                return [2 /*return*/];
            });
        }); });
    };
    EntradaVeiculoOperacionalIndexComponent.prototype.remove = function () {
        var _this = this;
        if (!this.itemSelecionado())
            return;
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 2, function () { return __awaiter(_this, void 0, void 0, function () {
            var validationResult, mensagens;
            var _this = this;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.service.podeRemover({ entradaVeiculoId: this.data.entradaVeiculoId }).toPromise()];
                    case 1:
                        validationResult = _a.sent();
                        if (!validationResult.isValid) {
                            mensagens = this.message.validationResult(validationResult);
                            mensagens.forEach(function (m) { return _this.message.warning("titles.entradaVeiculoOperacional", m); });
                            return [2 /*return*/];
                        }
                        else {
                            this.executeRemove();
                        }
                        return [2 /*return*/];
                }
            });
        }); });
    };
    EntradaVeiculoOperacionalIndexComponent.prototype.executeRemove = function () {
        return __awaiter(this, void 0, void 0, function () {
            var _this = this;
            return __generator(this, function (_a) {
                this.service._remove({ entradaVeiculoId: this.data.entradaVeiculoId }).subscribe(function (validationResult) {
                    if (!validationResult.isValid) {
                        var mensagens = _this.message.validationResult(validationResult);
                        mensagens.forEach(function (m) { return _this.message.warning("titles.entradaVeiculoOperacional", m); });
                        return;
                    }
                    else {
                        _this.message.saveSuccess("titles.entradaVeiculo", "messages.entradaDoVeiculoExcluidaComSucesso");
                        _this.refresh();
                    }
                });
                return [2 /*return*/];
            });
        });
    };
    EntradaVeiculoOperacionalIndexComponent.prototype.print = function () {
        var _this = this;
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 5, function () {
            _this.constantes.paramRelatorio = {
                filialId: _this.loginService.getLogin().filialId,
                dataI: _this.service.filter.dataI,
                dataF: _this.service.filter.dataF,
                cadastroPlacaId: app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_13__["StringUtilsStaticService"].toString(_this.service.filter.cadastroPlacaId),
                destinatarioIdCliente: app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_7__["NumberUtilsStaticService"].toNumber(_this.service.filter.destinatarioIdCliente)
            };
            _super.prototype.print.call(_this, null, true);
        });
    };
    EntradaVeiculoOperacionalIndexComponent.ctorParameters = function () { return [
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"] },
        { type: _entrada_veiculo_operacional_service__WEBPACK_IMPORTED_MODULE_12__["EntradaVeiculoOperacionalService"] },
        { type: app_shared_services_datatables_datatables_service__WEBPACK_IMPORTED_MODULE_4__["DatatablesService"] },
        { type: app_shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_8__["PermissoesUtilsService"] },
        { type: app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_9__["MessageService"] },
        { type: app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_2__["LoginService"] },
        { type: app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_6__["FuncoesService"] }
    ]; };
    EntradaVeiculoOperacionalIndexComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
            selector: "app-entrada-veiculo-operacional-index",
            template: __importDefault(__webpack_require__(/*! raw-loader!./entrada-veiculo-operacional-index.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/cotriguacu/movimentos/entrada-veiculo-operacional/entrada-veiculo-operacional-index/entrada-veiculo-operacional-index.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [_angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"],
            _entrada_veiculo_operacional_service__WEBPACK_IMPORTED_MODULE_12__["EntradaVeiculoOperacionalService"],
            app_shared_services_datatables_datatables_service__WEBPACK_IMPORTED_MODULE_4__["DatatablesService"],
            app_shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_8__["PermissoesUtilsService"],
            app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_9__["MessageService"],
            app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_2__["LoginService"],
            app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_6__["FuncoesService"]])
    ], EntradaVeiculoOperacionalIndexComponent);
    return EntradaVeiculoOperacionalIndexComponent;
}(app_shared_components_corporate_base_base_permissoes__WEBPACK_IMPORTED_MODULE_3__["BasePermissoes"]));



/***/ }),

/***/ "./src/app/pages/especificos/cotriguacu/movimentos/entrada-veiculo-operacional/entrada-veiculo-operacional-motorista-validade/entrada-veiculo-operacional-motorista-validade.component.ts":
/*!************************************************************************************************************************************************************************************************!*\
  !*** ./src/app/pages/especificos/cotriguacu/movimentos/entrada-veiculo-operacional/entrada-veiculo-operacional-motorista-validade/entrada-veiculo-operacional-motorista-validade.component.ts ***!
  \************************************************************************************************************************************************************************************************/
/*! exports provided: EntradaVeiculoOperacionalMotoristaValidadeComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EntradaVeiculoOperacionalMotoristaValidadeComponent", function() { return EntradaVeiculoOperacionalMotoristaValidadeComponent; });
/* 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_pages_cadastro_motorista_motorista_model__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! app/pages/cadastro/motorista/motorista.model */ "./src/app/pages/cadastro/motorista/motorista.model.ts");
/* 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_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_4__ = __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_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_5__ = __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_6__ = __webpack_require__(/*! app/shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var sweetalert2__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! sweetalert2 */ "./node_modules/sweetalert2/dist/sweetalert2.all.js");
/* harmony import */ var sweetalert2__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(sweetalert2__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var _entrada_veiculo_operacional_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../entrada-veiculo-operacional.service */ "./src/app/pages/especificos/cotriguacu/movimentos/entrada-veiculo-operacional/entrada-veiculo-operacional.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 EntradaVeiculoOperacionalMotoristaValidadeComponent = /** @class */ (function () {
    function EntradaVeiculoOperacionalMotoristaValidadeComponent(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_3__["EventEmitterService"].get('emiEntradaVeiculoOperacionalMotoristaValidade').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 '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.entradaVeiculoOperacional", _this.valDocMotorista.message);
                    jQuery("#entrada-veiculo-operacional-motorista-validade-dialog").modal("show");
                }
                else {
                    if (_this.valDocMotorista.modal) {
                        _this.messages.confirm("titles.entradaVeiculoOperacional", _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("#entrada-veiculo-operacional-motorista-validade-dialog").modal("show")];
                                    case 1:
                                        _a.sent();
                                        _a.label = 2;
                                    case 2: return [2 /*return*/];
                                }
                            });
                        }); }, false, function () {
                            _this.service.data.motoristaId = undefined;
                            _this.service.data.motorista = new app_pages_cadastro_motorista_motorista_model__WEBPACK_IMPORTED_MODULE_2__["Motorista"]();
                            _this.confirm.emit(undefined);
                        });
                    }
                    else {
                        var title = void 0;
                        var buttonCancel = void 0;
                        title = _this.messages.getTranslates("titles", "entradaVeiculoOperacional");
                        buttonCancel = _this.messages.getTranslates("buttons", "ok");
                        sweetalert2__WEBPACK_IMPORTED_MODULE_7___default.a.fire({
                            title: title,
                            text: _this.valDocMotorista.message,
                            type: "warning",
                            showCancelButton: false,
                            confirmButtonColor: "#3085d6",
                            cancelButtonColor: "#d33",
                            confirmButtonText: buttonCancel,
                            cancelButtonText: ""
                        }).then(function (result) {
                            if (result.value) {
                                _this.service.data.motoristaId = undefined;
                                _this.service.data.motorista = new app_pages_cadastro_motorista_motorista_model__WEBPACK_IMPORTED_MODULE_2__["Motorista"]();
                                _this.confirm.emit(undefined);
                            }
                        });
                    }
                }
            }
            else
                _this.confirm.emit(undefined);
        });
    }
    EntradaVeiculoOperacionalMotoristaValidadeComponent.prototype.ngOnDestroy = function () {
        this.sub.unsubscribe();
    };
    EntradaVeiculoOperacionalMotoristaValidadeComponent.prototype.onSubmit = function (form) {
        return __awaiter(this, void 0, void 0, function () {
            var _this = this;
            return __generator(this, function (_a) {
                if (form.invalid) {
                    this.messages.warning("titles.entradaVeiculoOperacional", "messages.campoObrigatorio", { name: 'data' });
                }
                else if (app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_4__["DateTimeUtilsStaticService"].menorAHoje(this.dtParaValidar)) {
                    this.messages.warning("titles.entradaVeiculoOperacional", "messages.dtValidadeNaoPodeSerMenor");
                }
                else {
                    jQuery("#entrada-veiculo-operacional-motorista-validade-dialog").modal("hide");
                    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;
                        }
                    });
                    this.confirm.emit(this.valDocMotorista);
                }
                return [2 /*return*/];
            });
        });
    };
    EntradaVeiculoOperacionalMotoristaValidadeComponent.prototype.close = function () {
        jQuery("#entrada-veiculo-operacional-motorista-validade-dialog").modal("hide");
        this.service.data.motoristaId = undefined;
        this.service.data.motorista = new app_pages_cadastro_motorista_motorista_model__WEBPACK_IMPORTED_MODULE_2__["Motorista"]();
        this.confirm.emit(undefined);
    };
    EntradaVeiculoOperacionalMotoristaValidadeComponent.ctorParameters = function () { return [
        { type: app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_5__["FuncoesService"] },
        { type: _entrada_veiculo_operacional_service__WEBPACK_IMPORTED_MODULE_8__["EntradaVeiculoOperacionalService"] },
        { type: app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_6__["MessageService"] }
    ]; };
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"])(),
        __metadata("design:type", Object)
    ], EntradaVeiculoOperacionalMotoristaValidadeComponent.prototype, "confirm", void 0);
    EntradaVeiculoOperacionalMotoristaValidadeComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
            selector: 'app-entrada-veiculo-operacional-motorista-validade',
            template: __importDefault(__webpack_require__(/*! raw-loader!./entrada-veiculo-operacional-motorista-validade.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/cotriguacu/movimentos/entrada-veiculo-operacional/entrada-veiculo-operacional-motorista-validade/entrada-veiculo-operacional-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_5__["FuncoesService"],
            _entrada_veiculo_operacional_service__WEBPACK_IMPORTED_MODULE_8__["EntradaVeiculoOperacionalService"],
            app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_6__["MessageService"]])
    ], EntradaVeiculoOperacionalMotoristaValidadeComponent);
    return EntradaVeiculoOperacionalMotoristaValidadeComponent;
}());



/***/ }),

/***/ "./src/app/pages/especificos/cotriguacu/movimentos/entrada-veiculo-operacional/entrada-veiculo-operacional.constants.ts":
/*!******************************************************************************************************************************!*\
  !*** ./src/app/pages/especificos/cotriguacu/movimentos/entrada-veiculo-operacional/entrada-veiculo-operacional.constants.ts ***!
  \******************************************************************************************************************************/
/*! exports provided: EntradaVeiculoOperacionalConstants */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EntradaVeiculoOperacionalConstants", function() { return EntradaVeiculoOperacionalConstants; });
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};
var EntradaVeiculoOperacionalConstants = /** @class */ (function () {
    function EntradaVeiculoOperacionalConstants() {
        this.sisFormularioId = 65356;
        this.permissoes = [
            { sisFormularioId: this.sisFormularioId, libRotina: 1, acao: "labels.inclusao" },
            { sisFormularioId: this.sisFormularioId, libRotina: 2, acao: "labels.exclusao" },
            { sisFormularioId: this.sisFormularioId, libRotina: 3, acao: "labels.consulta" },
            { sisFormularioId: this.sisFormularioId, libRotina: 4, acao: "labels.permissoes" },
            { sisFormularioId: this.sisFormularioId, libRotina: 5, acao: "labels.impressao" },
        ];
        this.sisSistemaId = "CTV";
        this.nomeForm = "titles.entradaVeiculoOperacional";
        this.reportId = "COT0020";
        this.reportTitulo = { "titulo": "Entrada de Veículo Operacional", "subTitulo": "" };
        this.listaIndex = [
            { title: 'Novo', action: 'create', icon: "icon-plus", exibeButton: true, eximeMenu: true, menuName: 'Arquivo' },
            { title: 'Excluir', action: 'remove', icon: "icon-close", exibeButton: true, eximeMenu: true, menuName: 'Arquivo' },
            { title: 'Atualizar', action: 'refresh', icon: "icon-reload", exibeButton: true, eximeMenu: true, menuName: 'Arquivo' },
            { title: 'Pesquisar', action: 'filtrar', icon: "icon-search", exibeButton: true, eximeMenu: true, menuName: 'Movimento' },
            { title: 'Permissao', action: 'permissoes', icon: "icon-unlock", exibeButton: true, eximeMenu: true, menuName: 'Movimento' },
            { title: 'Imprimir', action: 'print', icon: "icon-printer", exibeButton: true, eximeMenu: true, menuName: 'Arquivo' },
        ];
        this.listaForm = [
            { title: 'Voltar', action: 'back', icon: "icon-arrow-left", exibeButton: true, eximeMenu: true, menuName: 'Arquivo' },
        ];
        this.parametrosConfig = [
            {
                sistema: 'CTV', parametros: [
                    'UtilCartaoOutroVeic',
                ]
            }
        ];
    }
    return EntradaVeiculoOperacionalConstants;
}());



/***/ }),

/***/ "./src/app/pages/especificos/cotriguacu/movimentos/entrada-veiculo-operacional/entrada-veiculo-operacional.model.ts":
/*!**************************************************************************************************************************!*\
  !*** ./src/app/pages/especificos/cotriguacu/movimentos/entrada-veiculo-operacional/entrada-veiculo-operacional.model.ts ***!
  \**************************************************************************************************************************/
/*! exports provided: EntradaVeiculoOperacional, EntradaVeiculoOperacionalFilterVo, EntradaVeiculoOperacionalDto */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EntradaVeiculoOperacional", function() { return EntradaVeiculoOperacional; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EntradaVeiculoOperacionalFilterVo", function() { return EntradaVeiculoOperacionalFilterVo; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EntradaVeiculoOperacionalDto", function() { return EntradaVeiculoOperacionalDto; });
/* harmony import */ var app_shared_services_base_base_model__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! app/shared/services/base/base.model */ "./src/app/shared/services/base/base.model.ts");
/* harmony import */ var app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_1__ = __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 EntradaVeiculoOperacional = /** @class */ (function (_super) {
    __extends(EntradaVeiculoOperacional, _super);
    function EntradaVeiculoOperacional() {
        var _this = _super.call(this) || this;
        _this.entradaVeiculoId = 0;
        return _this;
    }
    return EntradaVeiculoOperacional;
}(app_shared_services_base_base_model__WEBPACK_IMPORTED_MODULE_0__["BaseModel"]));

var EntradaVeiculoOperacionalFilterVo = /** @class */ (function () {
    function EntradaVeiculoOperacionalFilterVo() {
        this.dataI = app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_1__["DateTimeUtilsStaticService"].addDays(new Date(), -10);
        this.dataF = app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_1__["DateTimeUtilsStaticService"].getFinalDay();
        this.cadastroPlacaId = "";
        this.destinatarioIdCliente = 0;
    }
    return EntradaVeiculoOperacionalFilterVo;
}());

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



/***/ }),

/***/ "./src/app/pages/especificos/cotriguacu/movimentos/entrada-veiculo-operacional/entrada-veiculo-operacional.module.ts":
/*!***************************************************************************************************************************!*\
  !*** ./src/app/pages/especificos/cotriguacu/movimentos/entrada-veiculo-operacional/entrada-veiculo-operacional.module.ts ***!
  \***************************************************************************************************************************/
/*! exports provided: EntradaVeiculoOperacionalModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EntradaVeiculoOperacionalModule", function() { return EntradaVeiculoOperacionalModule; });
/* 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 _entrada_veiculo_operacional_filter_entrada_veiculo_operacional_filter_component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./entrada-veiculo-operacional-filter/entrada-veiculo-operacional-filter.component */ "./src/app/pages/especificos/cotriguacu/movimentos/entrada-veiculo-operacional/entrada-veiculo-operacional-filter/entrada-veiculo-operacional-filter.component.ts");
/* harmony import */ var _entrada_veiculo_operacional_form_entrada_veiculo_operacional_form_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./entrada-veiculo-operacional-form/entrada-veiculo-operacional-form.component */ "./src/app/pages/especificos/cotriguacu/movimentos/entrada-veiculo-operacional/entrada-veiculo-operacional-form/entrada-veiculo-operacional-form.component.ts");
/* harmony import */ var _entrada_veiculo_operacional_index_entrada_veiculo_operacional_index_component__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./entrada-veiculo-operacional-index/entrada-veiculo-operacional-index.component */ "./src/app/pages/especificos/cotriguacu/movimentos/entrada-veiculo-operacional/entrada-veiculo-operacional-index/entrada-veiculo-operacional-index.component.ts");
/* harmony import */ var _entrada_veiculo_operacional_routing_module__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./entrada-veiculo-operacional.routing.module */ "./src/app/pages/especificos/cotriguacu/movimentos/entrada-veiculo-operacional/entrada-veiculo-operacional.routing.module.ts");
/* harmony import */ var _entrada_veiculo_operacional_motorista_validade_entrada_veiculo_operacional_motorista_validade_component__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./entrada-veiculo-operacional-motorista-validade/entrada-veiculo-operacional-motorista-validade.component */ "./src/app/pages/especificos/cotriguacu/movimentos/entrada-veiculo-operacional/entrada-veiculo-operacional-motorista-validade/entrada-veiculo-operacional-motorista-validade.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 EntradaVeiculoOperacionalModule = /** @class */ (function () {
    function EntradaVeiculoOperacionalModule() {
    }
    EntradaVeiculoOperacionalModule = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"])({
            imports: [app_shared_shared_module__WEBPACK_IMPORTED_MODULE_1__["SharedModule"], _entrada_veiculo_operacional_routing_module__WEBPACK_IMPORTED_MODULE_5__["EntradaVeiculoOperacionalRoutingModule"]],
            declarations: [
                _entrada_veiculo_operacional_index_entrada_veiculo_operacional_index_component__WEBPACK_IMPORTED_MODULE_4__["EntradaVeiculoOperacionalIndexComponent"],
                _entrada_veiculo_operacional_filter_entrada_veiculo_operacional_filter_component__WEBPACK_IMPORTED_MODULE_2__["EntradaVeiculoOperacionalFilterComponent"],
                _entrada_veiculo_operacional_form_entrada_veiculo_operacional_form_component__WEBPACK_IMPORTED_MODULE_3__["EntradaVeiculoOperacionalFormComponent"],
                _entrada_veiculo_operacional_motorista_validade_entrada_veiculo_operacional_motorista_validade_component__WEBPACK_IMPORTED_MODULE_6__["EntradaVeiculoOperacionalMotoristaValidadeComponent"]
            ]
        })
    ], EntradaVeiculoOperacionalModule);
    return EntradaVeiculoOperacionalModule;
}());



/***/ }),

/***/ "./src/app/pages/especificos/cotriguacu/movimentos/entrada-veiculo-operacional/entrada-veiculo-operacional.routing.module.ts":
/*!***********************************************************************************************************************************!*\
  !*** ./src/app/pages/especificos/cotriguacu/movimentos/entrada-veiculo-operacional/entrada-veiculo-operacional.routing.module.ts ***!
  \***********************************************************************************************************************************/
/*! exports provided: EntradaVeiculoOperacionalRoutingModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EntradaVeiculoOperacionalRoutingModule", function() { return EntradaVeiculoOperacionalRoutingModule; });
/* 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 _entrada_veiculo_operacional_index_entrada_veiculo_operacional_index_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./entrada-veiculo-operacional-index/entrada-veiculo-operacional-index.component */ "./src/app/pages/especificos/cotriguacu/movimentos/entrada-veiculo-operacional/entrada-veiculo-operacional-index/entrada-veiculo-operacional-index.component.ts");
/* harmony import */ var _entrada_veiculo_operacional_form_entrada_veiculo_operacional_form_component__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./entrada-veiculo-operacional-form/entrada-veiculo-operacional-form.component */ "./src/app/pages/especificos/cotriguacu/movimentos/entrada-veiculo-operacional/entrada-veiculo-operacional-form/entrada-veiculo-operacional-form.component.ts");
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};





var MRoutes = [
    {
        path: "",
        component: _entrada_veiculo_operacional_index_entrada_veiculo_operacional_index_component__WEBPACK_IMPORTED_MODULE_3__["EntradaVeiculoOperacionalIndexComponent"],
        data: { breadcrumb: "entradaVeiculoOperacional", formParams: { action: app_config_enumerables__WEBPACK_IMPORTED_MODULE_2__["ActionForm"].index } }
    },
    {
        path: "create/:object",
        component: _entrada_veiculo_operacional_form_entrada_veiculo_operacional_form_component__WEBPACK_IMPORTED_MODULE_4__["EntradaVeiculoOperacionalFormComponent"],
        data: {
            breadcrumb: "entradaVeiculoOperacional",
            formParams: { action: app_config_enumerables__WEBPACK_IMPORTED_MODULE_2__["ActionForm"].create }
        }
    }
];
var EntradaVeiculoOperacionalRoutingModule = /** @class */ (function () {
    function EntradaVeiculoOperacionalRoutingModule() {
    }
    EntradaVeiculoOperacionalRoutingModule = __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"]]
        })
    ], EntradaVeiculoOperacionalRoutingModule);
    return EntradaVeiculoOperacionalRoutingModule;
}());



/***/ }),

/***/ "./src/app/pages/especificos/cotriguacu/movimentos/entrada-veiculo-operacional/entrada-veiculo-operacional.service.ts":
/*!****************************************************************************************************************************!*\
  !*** ./src/app/pages/especificos/cotriguacu/movimentos/entrada-veiculo-operacional/entrada-veiculo-operacional.service.ts ***!
  \****************************************************************************************************************************/
/*! exports provided: EntradaVeiculoOperacionalService */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EntradaVeiculoOperacionalService", function() { return EntradaVeiculoOperacionalService; });
/* 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 environments_environment__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! environments/environment */ "./src/environments/environment.ts");
/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm5/operators/index.js");
/* harmony import */ var app_app_error_handler__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! app/app.error-handler */ "./src/app/app.error-handler.ts");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var app_shared_services_base_specifics_base_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! app/shared/services/base/specifics.base.service */ "./src/app/shared/services/base/specifics.base.service.ts");
/* harmony import */ var app_pages_cadastro_motorista_motorista_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! app/pages/cadastro/motorista/motorista.service */ "./src/app/pages/cadastro/motorista/motorista.service.ts");
/* harmony import */ var app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! app/shared/services/event-emitter/event-emitter.service */ "./src/app/shared/services/event-emitter/event-emitter.service.ts");
/* harmony import */ var app_pages_veiculo_entrada_veiculo_entrada_veiculo_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! app/pages/veiculo/entrada-veiculo/entrada-veiculo.service */ "./src/app/pages/veiculo/entrada-veiculo/entrada-veiculo.service.ts");
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/* harmony import */ var app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_10__ = __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_11__ = __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_message_message_service__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! app/shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var _entrada_veiculo_operacional_model__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./entrada-veiculo-operacional.model */ "./src/app/pages/especificos/cotriguacu/movimentos/entrada-veiculo-operacional/entrada-veiculo-operacional.model.ts");
/* harmony import */ var _entrada_veiculo_operacional_constants__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./entrada-veiculo-operacional.constants */ "./src/app/pages/especificos/cotriguacu/movimentos/entrada-veiculo-operacional/entrada-veiculo-operacional.constants.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 EntradaVeiculoOperacionalService = /** @class */ (function (_super) {
    __extends(EntradaVeiculoOperacionalService, _super);
    function EntradaVeiculoOperacionalService(http, message, motoristaService, entradaVeiculoService) {
        var _this = _super.call(this, http, "cotriguacu/entradaVeiculoOperacional") || this;
        _this.http = http;
        _this.message = message;
        _this.motoristaService = motoristaService;
        _this.entradaVeiculoService = entradaVeiculoService;
        _this.data = new _entrada_veiculo_operacional_model__WEBPACK_IMPORTED_MODULE_13__["EntradaVeiculoOperacional"]();
        _this.filter = new _entrada_veiculo_operacional_model__WEBPACK_IMPORTED_MODULE_13__["EntradaVeiculoOperacionalFilterVo"]();
        _this.constantes = new _entrada_veiculo_operacional_constants__WEBPACK_IMPORTED_MODULE_14__["EntradaVeiculoOperacionalConstants"]();
        _this.configs = {
            utilCartaoOutroVeic: false
        };
        _this.errosDocMotorista = [
            { tipoDoc: 'RESTRICAO', isValid: true, message: "", data: undefined, question: true, modal: false },
            { tipoDoc: 'INATIVO', isValid: true, message: "", data: undefined, question: true, modal: false },
        ];
        return _this;
    }
    EntradaVeiculoOperacionalService.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.data;
                        return [4 /*yield*/, this.motoristaService.getMotoristaId(motorista.motoristaId).toPromise()];
                    case 1:
                        _a.motorista = _b.sent();
                        return [4 /*yield*/, this.validaDocumentosMotorista()];
                    case 2:
                        valDocsMotorista = _b.sent();
                        if (!!valDocsMotorista) {
                            app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_7__["EventEmitterService"].get('emiEntradaVeiculoOperacionalMotoristaValidade').emit();
                        }
                        return [2 /*return*/];
                }
            });
        });
    };
    EntradaVeiculoOperacionalService.prototype.validaDocumentosMotorista = function () {
        return __awaiter(this, void 0, void 0, function () {
            var restricao$, resp, idxINATIVO;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        restricao$ = this.entradaVeiculoService.getVerifSeExisteRestricaoMotoristaPlaca({
                            "regControle": 0,
                            "motorista": this.data.motoristaId,
                            "tipoVerif": 'M',
                            "placa": this.data.cadastroPlacaIdCavalo
                        });
                        return [4 /*yield*/, Object(rxjs__WEBPACK_IMPORTED_MODULE_9__["forkJoin"])([restricao$]).toPromise()];
                    case 1:
                        resp = _a.sent();
                        this.errosDocMotorista[0].isValid = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_10__["BooleanUtilsStaticService"].toBoolean(resp[0].isValid);
                        this.errosDocMotorista[0].message = app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_11__["ArrayUtilsStaticService"].any(resp[0].erros) ? this.message.validationResult(resp[0])[0] : "";
                        this.errosDocMotorista[0].data = undefined;
                        idxINATIVO = this.errosDocMotorista.findIndex(function (c) { return c.tipoDoc === 'INATIVO'; });
                        this.errosDocMotorista[idxINATIVO].isValid = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_10__["BooleanUtilsStaticService"].toBoolean(this.data.motorista.flagAtivo);
                        this.errosDocMotorista[idxINATIVO].message = "messages.motoristaInativoContinua";
                        this.errosDocMotorista[idxINATIVO].data = undefined;
                        return [2 /*return*/, true];
                }
            });
        });
    };
    EntradaVeiculoOperacionalService.prototype.validaMotorista = function (event) {
        if (!!event) {
            switch (event.tipoDoc) {
                case 'CNH':
                    this.data.motorista.cnhValidade = event.data;
                    break;
                case 'RESTRICAO':
                case 'INATIVO':
                default:
                    break;
            }
            app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_7__["EventEmitterService"].get('emiEntradaVeiculoOperacionalMotoristaValidade').emit();
        }
    };
    EntradaVeiculoOperacionalService.prototype.getByFiltro = function (data) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_1__["environment"].specifics_service_url + "/api/v1/cotriguacu/entradaVeiculoOperacional/filter", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_3__["ErrorHandler"].handleError));
    };
    EntradaVeiculoOperacionalService.prototype._save = function (data) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_1__["environment"].specifics_service_url + "/api/v1/cotriguacu/entradaVeiculoOperacional", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_3__["ErrorHandler"].handleError));
    };
    EntradaVeiculoOperacionalService.prototype.podeRemover = function (filter) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_1__["environment"].specifics_service_url + "/api/v1/cotriguacu/entradaVeiculoOperacional/podeRemover", filter)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_3__["ErrorHandler"].handleError));
    };
    EntradaVeiculoOperacionalService.prototype._remove = function (data) {
        return this.http
            .put(environments_environment__WEBPACK_IMPORTED_MODULE_1__["environment"].specifics_service_url + "/api/v1/cotriguacu/entradaVeiculoOperacional/remove", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_3__["ErrorHandler"].handleError));
    };
    EntradaVeiculoOperacionalService.ctorParameters = function () { return [
        { type: _angular_common_http__WEBPACK_IMPORTED_MODULE_0__["HttpClient"] },
        { type: app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_12__["MessageService"] },
        { type: app_pages_cadastro_motorista_motorista_service__WEBPACK_IMPORTED_MODULE_6__["MotoristaService"] },
        { type: app_pages_veiculo_entrada_veiculo_entrada_veiculo_service__WEBPACK_IMPORTED_MODULE_8__["EntradaVeiculoService"] }
    ]; };
    EntradaVeiculoOperacionalService = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_4__["Injectable"])({
            providedIn: 'root'
        }),
        __metadata("design:paramtypes", [_angular_common_http__WEBPACK_IMPORTED_MODULE_0__["HttpClient"],
            app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_12__["MessageService"],
            app_pages_cadastro_motorista_motorista_service__WEBPACK_IMPORTED_MODULE_6__["MotoristaService"],
            app_pages_veiculo_entrada_veiculo_entrada_veiculo_service__WEBPACK_IMPORTED_MODULE_8__["EntradaVeiculoService"]])
    ], EntradaVeiculoOperacionalService);
    return EntradaVeiculoOperacionalService;
}(app_shared_services_base_specifics_base_service__WEBPACK_IMPORTED_MODULE_5__["SpecificsBaseService"]));



/***/ })

}]);
//# sourceMappingURL=app-pages-especificos-cotriguacu-movimentos-entrada-veiculo-operacional-entrada-veiculo-operacional-module.js.map