(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["app-pages-balanca-descargas-ferroviarias-descargas-ferroviarias-module"],{

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-afericao-balanca/descargas-ferroviarias-afericao-balanca.component.html":
/*!*******************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-afericao-balanca/descargas-ferroviarias-afericao-balanca.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.listaPes\" [sisFormularioId]=\"constantes.sisFormularioId\">\r\n</app-menu-command-bar>\r\n\r\n<div class=\"row\">\r\n    <div class=\"col-md-12 col-lg-12\">\r\n        <div class=\"section-comand-bar\">\r\n            <div class=\"row\">\r\n                <div class=\"col-lg-12\">\r\n                    <app-form-legenda></app-form-legenda>\r\n                    <form class=\"form\" #f=\"ngForm\">\r\n                        <app-validacoes></app-validacoes>\r\n                        <div class=\"row\">\r\n                            <div class=\"col-lg-4 col-md-12 col-sm-12\">\r\n                                <app-card-container>\r\n                                    <div class=\"row mt-2\">\r\n                                        <div class=\"col-sm-6\">\r\n                                            <div class=\"form-group form-group-sm\">\r\n                                                <div class=\"custom-control custom-radio\">\r\n                                                    <input class=\"custom-control-input radio-success\" id=\"afericao1\"\r\n                                                        name=\"afericao\" type=\"radio\" [(ngModel)]=\"data.afericao\"\r\n                                                        [value]=\"1\" required>\r\n                                                    <label class=\"custom-control-label\" for=\"afericao1\">\r\n                                                        {{ 'labels.afericao1' | translate }}\r\n                                                    </label>\r\n                                                </div>\r\n                                            </div>\r\n                                        </div>\r\n                                        <div class=\"col-sm-6\">\r\n                                            <div class=\"form-group form-group-sm\">\r\n                                                <div class=\"custom-control custom-radio\">\r\n                                                    <input class=\"custom-control-input radio-success\" id=\"afericao2\"\r\n                                                        name=\"afericao\" type=\"radio\" [(ngModel)]=\"data.afericao\"\r\n                                                        [value]=\"2\">\r\n                                                    <label class=\"custom-control-label\" for=\"afericao2\">\r\n                                                        {{ 'labels.afericao2' | translate }}\r\n                                                    </label>\r\n                                                </div>\r\n                                            </div>\r\n                                        </div>\r\n                                    </div>\r\n                                </app-card-container>\r\n                            </div>\r\n                        </div>\r\n                        <div class=\"row\">\r\n                            <div class=\"col-lg-3\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <label for=\"linhaPesagem\" class=\"required\">{{'labels.linhaPesagem' |\r\n                                        translate}}</label>\r\n                                    <select id=\"linhaPesagem\" name=\"linhaPesagem\" class=\"form-control form-control-sm\"\r\n                                        data-title=\"{{ 'labels.linhaPesagem' | translate }}\" required=\"true\"\r\n                                        [disabled]=\"comboLinhasPesagem.length === 1\"\r\n                                        [(ngModel)]=\"data.balancaFerroviariaId\" (ngModelChange)=\"getBalancas()\">\r\n                                        <option value=\"0\">{{ \"labels.selecione\" | translate }}</option>\r\n                                        <option *ngFor=\"let l of comboLinhasPesagem\" [value]=\"l.balancaFerroviariaId\">\r\n                                            {{ l.descrBalanca }}\r\n                                        </option>\r\n                                    </select>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class=\"row\">\r\n                            <div class=\"col-lg-3\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <label for=\"balanca\" [class.required]=\"service.configs.pesagemAutomatica || service.configs.selBalFerro || balancaFerroviariaRequired\">\r\n                                        {{ 'labels.balanca' | translate }}\r\n                                    </label>\r\n                                    <select id=\"balanca\" name=\"balanca\" class=\"form-control form-control-sm\"\r\n                                        data-title=\"{{ 'labels.balanca' | translate }}\" required\r\n                                        [disabled]=\"service.configs.pesagemAutomatica || service.configs.selBalFerro || balancaFerroviariaRequired\"\r\n                                        [(ngModel)]=\"data.balancaId\" (ngModelChange)=\"isPesoDisabled()\">\r\n                                        <option value=\"0\">{{ \"labels.selecione\" | translate }}</option>\r\n                                        <option *ngFor=\"let l of comboBalancas\" [value]=\"l.balancaId\">\r\n                                            {{ l.descrBalanca }}\r\n                                        </option>\r\n                                    </select>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class=\"row\">\r\n                            <div class=\"col-lg-2\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <label for=\"peso\" class=\"required\">{{ \"labels.peso\" | translate }}</label>\r\n                                    <app-captura-peso id=\"peso\" name=\"peso\" [(ngModel)]=\"data.peso\"\r\n                                        [balancaId]=\"data.balancaId\" (outSelected)=\"getPeso($event)\"\r\n                                        (outBlur)=\"getPeso($event)\" [required]=\"true\"\r\n                                        [disabledInput]=\"service.configs.pesagemAutomatica || disablePeso\"\r\n                                        [disabledBtn]=\"disablePeso\"\r\n                                        [pesagemAutomatica]=\"service.configs.pesagemAutomatica\">\r\n                                    </app-captura-peso>\r\n                                </div>\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                                    <button class=\"btn btn-success mr-2\" type=\"button\" (click)=\"back()\">{{ 'buttons.ok'\r\n                                        | translate }}</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</div>");

/***/ }),

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-alterar-datas/descargas-ferroviarias-alterar-datas.component.html":
/*!*************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-alterar-datas/descargas-ferroviarias-alterar-datas.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=\"descargas-alterar-datas-dialog\" tabindex=\"-1\" role=\"dialog\" data-backdrop=\"static\">\r\n    <div class=\"modal-dialog modal-md\">\r\n        <div class=\"modal-content\">\r\n            <div class=\"modal-header\">\r\n                <h6 class=\"modal-title\">{{ 'titles.alteracaoDeDatas' | translate }}</h6>\r\n            </div>\r\n            <form class=\"form\" #form=\"ngForm\" (ngSubmit)=\"onSubmit(form)\">\r\n                <app-validacoes></app-validacoes>\r\n                <div class=\"modal-body\">\r\n                    <div class=\"row\">\r\n                        <div class=\"col-md-5 col-sm-12\">\r\n                            <div class=\"form-group form-group-sm\">\r\n                                <label for=\"encoste\">{{'labels.encoste' | translate}}</label>\r\n                                <app-data-h-m-s id=\"encoste\" name=\"encoste\" [(ngModel)]=\"data.dtTriagem\"\r\n                                    (executa)=\"trataJustAtraso()\">\r\n                                </app-data-h-m-s>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"row\">\r\n                        <div class=\"col-md-5 col-sm-12\">\r\n                            <div class=\"form-group form-group-sm\">\r\n                                <label for=\"entregaNf\">{{'labels.entregaNf' | translate}}</label>\r\n                                <app-data-h-m-s id=\"entregaNf\" name=\"entregaNf\" [(ngModel)]=\"data.dtEntregaNF\"\r\n                                    (executa)=\"trataJustAtraso()\">\r\n                                </app-data-h-m-s>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"row\">\r\n                        <div class=\"col-md-5 col-sm-12\">\r\n                            <div class=\"form-group form-group-sm\">\r\n                                <label for=\"primeiraPesagem\" class=\"required\">{{'labels.1Pesagem' | translate}}</label>\r\n                                <app-data-h-m-s id=\"primeiraPesagem\" name=\"primeiraPesagem\" [required]=\"true\"\r\n                                    [(ngModel)]=\"data.dtOper1Pes\">\r\n                                </app-data-h-m-s>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"row\">\r\n                        <div class=\"col-md-5 col-sm-12\">\r\n                            <div class=\"form-group form-group-sm\">\r\n                                <label for=\"inicioOperacao\" class=\"required\">{{\"labels.inicioDeOperacao\" |\r\n                                    translate}}</label>\r\n                                <app-data-h-m-s id=\"inicioOperacao\" name=\"inicioOperacao\" [required]=\"true\"\r\n                                    [(ngModel)]=\"data.dtIniOper\">\r\n                                </app-data-h-m-s>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"row\">\r\n                        <div class=\"col-md-5 col-sm-12\">\r\n                            <div class=\"form-group form-group-sm\">\r\n                                <label for=\"fimOperacao\" class=\"required\">{{\"labels.fimDeOperacao\" | translate}}</label>\r\n                                <app-data-h-m-s id=\"fimOperacao\" name=\"fimOperacao\" [required]=\"true\"\r\n                                    [(ngModel)]=\"data.dtFimOper\" (executa)=\"validarDatasInicioFimOperacao()\">\r\n                                </app-data-h-m-s>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"row\">\r\n                        <div class=\"col-md-5 col-sm-12\">\r\n                            <div class=\"form-group form-group-sm\">\r\n                                <label for=\"saida\" class=\"required\">{{\"labels.dtSaida\" | translate}}</label>\r\n                                <app-data-h-m-s id=\"saida\" name=\"saida\" [required]=\"true\" [(ngModel)]=\"data.dtSaida\"\r\n                                    (executa)=\"validarDataSaida()\">\r\n                                </app-data-h-m-s>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"row\">\r\n                        <div class=\"col-md-5 col-sm-12\">\r\n                            <div class=\"form-group form-group-sm\">\r\n                                <label for=\"segundaPesagem\">{{'labels.2Pesagem' | translate}}</label>\r\n                                <app-data-h-m-s id=\"segundaPesagem\" name=\"segundaPesagem\" [(ngModel)]=\"data.dtOper2Pes\"\r\n                                    (executa)=\"trataJustAtraso()\">\r\n                                </app-data-h-m-s>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"row\">\r\n                        <div class=\"col-lg-8 col-md-10 col-sm-12\">\r\n                            <div class=\"form-group form-group-sm\">\r\n                                <app-field-container>\r\n                                    <label for=\"justificativaQuebra\">{{'labels.justificativaQuebra' |\r\n                                        translate}}</label>\r\n                                    <app-combo-padrao id=\"justificativaQuebra\" name=\"justificativaQuebra\"\r\n                                        [(ngModel)]=\"data.motivoQuebraId\" tabela=\"MotivoQuebra\" chave=\"CodMotivoQuebra\"\r\n                                        descricao=\"DescrMotivoQuebra\" ativos=\"true\" [disabled]=\"disabledQuebra\">\r\n                                    </app-combo-padrao>\r\n                                </app-field-container>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"row\">\r\n                        <div class=\"col-lg-8 col-md-10 col-sm-12\">\r\n                            <div class=\"form-group form-group-sm\">\r\n                                <app-field-container>\r\n                                    <label for=\"justificativaAtraso\">{{'labels.justificativaAtraso' |\r\n                                        translate}}</label>\r\n                                    <app-combo-padrao id=\"justificativaAtraso\" name=\"justificativaAtraso\"\r\n                                        [(ngModel)]=\"data.motivoAtrasoId\" tabela=\"MotivoAtraso\" chave=\"CodMotivoAtraso\"\r\n                                        descricao=\"DescrMotivoAtraso\" ativos=\"true\" [disabled]=\"disabledAtraso\">\r\n                                    </app-combo-padrao>\r\n                                </app-field-container>\r\n                            </div>\r\n                        </div>\r\n                        <div class=\"col-lg-4\">\r\n                            <label></label>\r\n                            <div class=\"col-sm-10\">\r\n                                <p class=\"form-control-static\">{{ labelAtraso }}</p>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"row\">\r\n                        <div class=\"col-lg-8 col-md-10 col-sm-12\">\r\n                            <div class=\"form-group form-group-sm\">\r\n                                <app-field-container>\r\n                                    <label for=\"ternoId\">{{'labels.terno' | translate}}</label>\r\n                                    <app-combo-terno id=\"ternoId\" name=\"ternoId\" [(ngModel)]=\"data.ternoId\">\r\n                                    </app-combo-terno>\r\n                                </app-field-container>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"row\">\r\n                        <div class=\"col-lg-8 col-md-10 col-sm-12\">\r\n                            <div class=\"form-group form-group-sm\">\r\n                                <label for=\"plataforma\"\r\n                                    [class.required]=\"service.configs.obrigPlataformaVagao === 'S'\">{{'labels.plataforma'\r\n                                    | translate}}</label>\r\n                                <app-combo-plataforma id=\"plataforma\" name=\"plataforma\"\r\n                                    [required]=\"service.configs.obrigPlataformaVagao === 'S'\"\r\n                                    [(ngModel)]=\"data.plataformaId\">\r\n                                </app-combo-plataforma>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"row\">\r\n                        <div class=\"col-lg-8 col-md-10 col-sm-12\">\r\n                            <div class=\"form-group form-group-sm\">\r\n                                <label for=\"localOperacao\">{{\"labels.localOperacao\" | translate\r\n                                    }}</label>\r\n                                <app-combo-padrao name=\"localOperacao\" id=\"localOperacao\" chave=\"CodLocalOper\"\r\n                                    descricao=\"DescrLocalOper\" ativo=\"true\" tabela=\"LocalOperacao\"\r\n                                    [(ngModel)]=\"data.codLocalOper\">\r\n                                </app-combo-padrao>\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.ok' | translate }}</button>\r\n                    <button class=\"btn btn-default\" type=\"button\" data-dismiss=\"modal\">{{ 'buttons.cancelar' | 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/balanca/descargas-ferroviarias/descargas-ferroviarias-analise-origem/descargas-ferroviarias-analise-origem.component.html":
/*!***************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-analise-origem/descargas-ferroviarias-analise-origem.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.listaPes\" [sisFormularioId]=\"constantes.sisFormularioId\">\r\n</app-menu-command-bar>\r\n\r\n<div class=\"row\">\r\n    <div class=\"col-md-12 col-lg-12\">\r\n        <div class=\"section-comand-bar\">\r\n            <div class=\"row\">\r\n                <div class=\"col-lg-12\">\r\n                    <app-form-legenda></app-form-legenda>\r\n                    <form class=\"form\" #f=\"ngForm\" (ngSubmit)=\"onSubmit(f)\">\r\n                        <app-validacoes></app-validacoes>\r\n                        <div class=\"row\">\r\n                            <div *ngFor=\"let cpd of dados.analisesOrigem; let i = index\" class=\"col-md-8\">\r\n                              <app-descargas-ferroviarias-campos-dinamicos name=\"cpd{{i}}\"\r\n                                [campoDinamico]=\"cpd\"\r\n                                [(ngModel)]=\"cpd.tipoValLimite < 3 ? cpd.valor : cpd.caractTipicaReferId\"\r\n                                [required]=\"true\"\r\n                                [exibeLegenda]=\"true\">\r\n                              </app-descargas-ferroviarias-campos-dinamicos>\r\n                            </div>\r\n                        </div>\r\n                        <div class=\"row\">\r\n                            <div class=\"col-md-6 col-sm-12\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <label for=\"observacao\">{{'labels.observacao' | translate}}</label>\r\n                                    <input id=\"observacao\" name=\"observacao\"\r\n                                        class=\"form-control form-control-sm\"\r\n                                        type=\"text\"\r\n                                        [(ngModel)]=\"dados.observacao\"\r\n                                        maxlength=\"200\">\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        \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                                        {{ '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</div>");

/***/ }),

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-campos-dinamicos/descargas-ferroviarias-campos-dinamicos.component.html":
/*!*******************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-campos-dinamicos/descargas-ferroviarias-campos-dinamicos.component.html ***!
  \*******************************************************************************************************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("<label for=\"{{campoDinamico.caractTipicaId}}\" [style.color]=\"campoDinamico.valido === 'N' ? 'red' : 'black'\">\n    {{ campoDinamico.descrCaract | translate }}</label>\n<div *ngIf=\"complementoCampos.caractTipica.tipoValLimite<3\">\n    <input id=\"{{campoDinamico.caractTipicaId}}\" name=\"{{campoDinamico.caractTipicaId}}\" [(ngModel)]=\"internalValue\"\n        class=\"form-control form-control-sm\" [disabled]=\"disabled\" required>\n    <small *ngIf=\"complementoCampos.valorReferenciaInicio != null && complementoCampos.valorReferenciaFim == null && exibeLegenda == true\" class=\"text-danger\">\n        Referência: mínima de {{complementoCampos.valorReferenciaInicio}}\n    </small>\n    <small *ngIf=\"complementoCampos.valorReferenciaInicio != null && complementoCampos.valorReferenciaFim != null && exibeLegenda == true\" class=\"text-danger\">\n        Referência: de {{complementoCampos.valorReferenciaInicio}} a {{complementoCampos.valorReferenciaFim}}\n    </small>\n    <small *ngIf=\"complementoCampos.valorReferenciaInicio == null && complementoCampos.valorReferenciaFim != null && exibeLegenda == true\" class=\"text-danger\">\n        Referência: máximo de {{complementoCampos.valorReferenciaFim}}\n    </small>\n</div>\n<div *ngIf=\"complementoCampos.caractTipica.tipoValLimite>=3\">\n    <select name=\"{{complementoCampos.caractTipica.caractTipicaId}}\" [(ngModel)]=\"internalValue\" class=\"form-control form-control-sm\"\n    [disabled]=\"disabled\" required>\n        <option [ngValue]=\"caractTipicaRef.caractTipicaReferId\" *ngFor=\"let caractTipicaRef of caractTipicaRefer\">{{ caractTipicaRef.descrRefer| translate }}</option>\n    </select>\n    <small *ngIf=\"complementoCampos.caractTipicaReferId != null && exibeLegenda == true\" class=\"text-danger\">\n        Referência: {{complementoCampos.caractTipicaRefer.descrRefer}}\n    </small>\n</div>");

/***/ }),

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-confirmacao-chegada/descargas-ferroviarias-confirmacao-chegada.component.html":
/*!*************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-confirmacao-chegada/descargas-ferroviarias-confirmacao-chegada.component.html ***!
  \*************************************************************************************************************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("<div class=\"modal\" id=\"descargas-confirmacao-chegada-dialog\" tabindex=\"-1\" role=\"dialog\" data-backdrop=\"static\">\r\n    <div class=\"modal-dialog modal-lg\">\r\n        <div class=\"modal-content\">\r\n            <div class=\"modal-header\">\r\n                <h6 class=\"modal-title\">{{ 'titles.confirmacaoChegada' | translate }}</h6>\r\n            </div>\r\n            <div class=\"modal-body\">\r\n                <ng-container *ngIf=\"showFiltro\">\r\n                    <form class=\"form\" #formChegada=\"ngForm\" (ngSubmit)=\"onSubmit()\">\r\n                        <div class=\"row\">\r\n                            <div class=\"col-md-6 col-sm-12\">\r\n                                <div class=\"row\">\r\n                                    <div class=\"col-sm-12\">\r\n                                        <div class=\"form-group form-group-sm\">\r\n                                            <app-pesquisa-destinatario id=\"destinatarioIdCliente\" name=\"destinatarioIdCliente\"\r\n                                                label=\"cliente\" [(ngModel)]=\"filtro.destinatarioIdCliente\" tipoDestinatario=\"C\"\r\n                                                modalTitle=\"pesquisaDeCliente\" showCgcCpf=\"false\" showInscricao=\"false\">\r\n                                            </app-pesquisa-destinatario>\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                                <div class=\"row\">\r\n                                    <div class=\"col-sm-12\">\r\n                                        <app-pesquisa-destinatario id=\"destinatarioIdTransportadora\" name=\"destinatarioIdTransportadora\"\r\n                                            label=\"transportadora\" [(ngModel)]=\"filtro.destinatarioIdTransportadora\"\r\n                                            tipoDestinatario=\"T\" modalTitle=\"pesquisaDeTransportadora\"\r\n                                            showCgcCpf=\"false\" showInscricao=\"false\">\r\n                                        </app-pesquisa-destinatario>\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                            <div class=\"col-md-6 col-sm-12\">\r\n                                <div class=\"row\">\r\n                                    <div class=\"col-sm-12\" *ngIf=\"service.configs.intOsAtiva\">\r\n                                        <div class=\"custom-control custom-checkbox uni-checkbox\">\r\n                                            <input id=\"confirmado\" name=\"confirmado\" [ngModel]=\"filtro.confirmado === 'S'\"\r\n                                                (ngModelChange)=\"filtro.confirmado=$event ? 'S' : 'N'\"\r\n                                                class=\"custom-control-input checkbox-success\" type=\"checkbox\">\r\n                                            <label class=\"custom-control-label\" for=\"confirmado\">\r\n                                                {{ 'labels.apresentarSomenteVagoesComConfirmacaoDeChegada' | translate }}\r\n                                            </label>\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                                <div class=\"row\">\r\n                                    <div class=\"col-sm-12\" *ngIf=\"service.configs.intOsAtiva\">\r\n                                        <div class=\"custom-control custom-checkbox uni-checkbox\">\r\n                                            <input id=\"semAgenda\" name=\"semAgenda\" [ngModel]=\"filtro.semAgenda === 'S'\"\r\n                                                (ngModelChange)=\"filtro.semAgenda=$event ? 'S' : 'N'\"\r\n                                                class=\"custom-control-input checkbox-success\" type=\"checkbox\">\r\n                                            <label class=\"custom-control-label\" for=\"semAgenda\">\r\n                                                {{ 'labels.apresentarVagoesSemAgendamento' | translate }}\r\n                                            </label>\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class=\"row\">\r\n                            <div class=\"col-lg-3 col-md-3 col-sm-12\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <label for=\"numeroDoVagao\">{{'labels.numeroDoVagao' | translate}}</label>\r\n                                    <input id=\"numeroDoVagao\" name=\"numeroDoVagao\" [(ngModel)]=\"filtro.cadastroPlacaId\"\r\n                                        class=\"form-control form-control-sm\" type=\"text\">\r\n                                </div>\r\n                            </div>\r\n                            <div class=\"col-lg-3 col-md-3 col-sm-12\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <label for=\"programacao\">{{'labels.programacao' | translate}}</label>\r\n                                    <input id=\"programacao\" name=\"programacao\" [(ngModel)]=\"filtro.webStoPlanejaVeiculoId\"\r\n                                        class=\"form-control form-control-sm\" type=\"text\">\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class=\"row mb-3 bt-2\">\r\n                            <div class=\"col-12\">\r\n                                <button class=\"btn btn-success mr-1\" type=\"submit\">{{ 'buttons.pesquisar' | translate }}</button>\r\n                            </div>\r\n                        </div>\r\n                    </form>\r\n                </ng-container>\r\n                <div *ngIf=\"!showFiltro\">\r\n                    <div class=\"row mb-3 bt-2\">\r\n                        <div class=\"col-12\">\r\n                            <button class=\"btn btn-success mr-1\" (click)=\"onShowFiltro()\">{{ 'buttons.filtrar' | translate }}</button>\r\n                        </div>\r\n                    </div>\r\n                    <hr>\r\n                    <table id=\"dtChegada\" class=\"table table-striped table-bordered table-hover nowrap table-sm\"></table>\r\n                </div>\r\n            </div>\r\n            <div class=\"modal-footer\">\r\n                <button class=\"btn btn-success mr-1\" type=\"button\" (click)=\"confirmarChegada()\">{{ 'buttons.confirmar' | translate }}</button>\r\n                <button class=\"btn btn-default\" type=\"button\" data-dismiss=\"modal\">{{ 'buttons.cancelar' | translate }}</button>\r\n            </div>\r\n        </div>\r\n    </div>\r\n</div>");

/***/ }),

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-dados-pesagem/descargas-ferroviarias-dados-pesagem.component.html":
/*!*************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-dados-pesagem/descargas-ferroviarias-dados-pesagem.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=\"descargas-dados-pesagem-dialog\" tabindex=\"-1\" role=\"dialog\" data-backdrop=\"static\">\r\n    <div class=\"modal-dialog modal-md\">\r\n        <div class=\"modal-content\">\r\n            <div class=\"modal-header\">\r\n                <h6 class=\"modal-title\">{{ 'titles.dadosDaPesagem' | translate }}</h6>\r\n            </div>\r\n            <form class=\"form\" #form=\"ngForm\">\r\n                <app-validacoes></app-validacoes>\r\n                <div class=\"modal-body\">\r\n                    <div class=\"row\">\r\n                        <div class=\"col-md-12\">\r\n                            <div class=\"form-group form-group-sm\">\r\n                                <app-input-description name=\"terno\" label=\"terno\"\r\n                                    [showId]=\"false\"\r\n                                    [valueDescription]=\"data.descrTerno\">\r\n                                </app-input-description>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"row\">\r\n                        <div class=\"col-md-6\">\r\n                            <fieldset>\r\n                                <legend>{{ \"labels.1Pesagem\" | translate }}</legend>\r\n                                <div class=\"row\">\r\n                                    <div class=\"col-md-12\">\r\n                                        <div class=\"form-group form-group-sm\">\r\n                                            <app-input-description name=\"oper1Pes\" label=\"operador\"\r\n                                                [showId]=\"false\"\r\n                                                [valueDescription]=\"data.oper1Pes\">\r\n                                            </app-input-description>\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                                <div class=\"row\">\r\n                                    <div class=\"col-md-12\">\r\n                                        <div class=\"form-group form-group-sm\">\r\n                                            <label for=\"dtOper1Pes\">{{'labels.data' | translate}}</label>\r\n                                            <app-data-h-m-s id=\"dtOper1Pes\" name=\"dtOper1Pes\"\r\n                                                [(ngModel)]=\"data.dtOper1Pes\"\r\n                                                disabled=\"true\">\r\n                                            </app-data-h-m-s>\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                                <div class=\"row\">\r\n                                    <div class=\"col-md-12\">\r\n                                        <div class=\"form-group form-group-sm\">\r\n                                            <app-input-description name=\"descrBalanca1\" label=\"balanca\"\r\n                                                [showId]=\"false\"\r\n                                                [valueDescription]=\"data.descrBalanca1\">\r\n                                            </app-input-description>\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                            </fieldset>\r\n                        </div>\r\n                        <div class=\"col-md-6\">\r\n                            <fieldset>\r\n                                <legend>{{ \"labels.2Pesagem\" | translate }}</legend>\r\n                                <div class=\"row\">\r\n                                    <div class=\"col-md-12\">\r\n                                        <div class=\"form-group form-group-sm\">\r\n                                            <app-input-description name=\"oper2Pes\" label=\"operador\"\r\n                                                [showId]=\"false\"\r\n                                                [valueDescription]=\"data.oper2Pes\">\r\n                                            </app-input-description>\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                                <div class=\"row\">\r\n                                    <div class=\"col-md-12\">\r\n                                        <div class=\"form-group form-group-sm\">\r\n                                            <label for=\"dtOper2Pes\">{{'labels.data' | translate}}</label>\r\n                                            <app-data-h-m-s id=\"dtOper2Pes\" name=\"dtOper2Pes\"\r\n                                                [(ngModel)]=\"data.dtOper2Pes\"\r\n                                                disabled=\"true\">\r\n                                            </app-data-h-m-s>\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                                <div class=\"row\">\r\n                                    <div class=\"col-md-12\">\r\n                                        <div class=\"form-group form-group-sm\">\r\n                                            <app-input-description name=\"descrBalanca2\" label=\"balanca\"\r\n                                                [showId]=\"false\"\r\n                                                [valueDescription]=\"data.descrBalanca2\">\r\n                                            </app-input-description>\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                            </fieldset>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"modal-footer\">\r\n                    <button class=\"btn btn-success mr-1\" data-dismiss=\"modal\">{{ 'buttons.ok' | translate }}</button>\r\n                    <button class=\"btn btn-success\" type=\"button\" (click)=\"visualizarFotosOCR()\">{{ 'buttons.visualizarFotoOCR' | translate }}</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/balanca/descargas-ferroviarias/descargas-ferroviarias-filter/descargas-ferroviarias-filter.component.html":
/*!***********************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-filter/descargas-ferroviarias-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=\"descargas-ferroviarias-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=\"emissaoDe\" class=\"required\">\r\n                                    {{\"labels.emissaoDe\" | translate }}\r\n                                </label>\r\n                                <app-data id=\"emissaoDe\" name=\"emissaoDe\" required=\"true\"\r\n                                    [(ngModel)]=\"service.filter.dataI\">\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\"\r\n                                    [(ngModel)]=\"service.filter.dataF\">\r\n                                </app-data>\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\"\r\n                                    (outModel)=\"trataCliente($event)\">\r\n                                </app-pesquisa-destinatario>\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-material id=\"produto\" name=\"produto\" label=\"produto\"\r\n                                    modalTitle=\"pesquisaDeProduto\" [(ngModel)]=\"service.filter.materialId\"\r\n                                    [inSelected]=\"service.filter.material\" (outModel)=\"trataMaterial($event)\">\r\n                                </app-pesquisa-material>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n\r\n                    <label class=\"required\" for=\"situacao\">\r\n                        {{'labels.situacao' | translate}}\r\n                    </label>\r\n                    <app-card-container>\r\n                        <div class=\"custom-control custom-checkbox\">\r\n                            <input id=\"aguardandoPrimeiraPesagem\" name=\"aguardandoPrimeiraPesagem\"\r\n                                [ngModel]=\"service.filter.aguardandoPrimeiraPesagem === 'S'\"\r\n                                (ngModelChange)=\"service.filter.aguardandoPrimeiraPesagem = $event ? 'S' : 'N'\"\r\n                                class=\"custom-control-input checkbox-success\" type=\"checkbox\"\r\n                                (change)=\"changeSelecaoSituacao($event, 'A')\">\r\n                            <label class=\"custom-control-label\" for=\"aguardandoPrimeiraPesagem\">\r\n                                {{'labels.aguardandoPrimeiraPesagem' | translate}}\r\n                            </label>\r\n                        </div>\r\n\r\n                        <div class=\"custom-control custom-checkbox\">\r\n                            <input id=\"aguardandoSegundaPesagem\" name=\"aguardandoSegundaPesagem\"\r\n                                [ngModel]=\"service.filter.aguardandoSegundaPesagem === 'S'\"\r\n                                (ngModelChange)=\"service.filter.aguardandoSegundaPesagem = $event ? 'S' : 'N'\"\r\n                                class=\"custom-control-input checkbox-success\" type=\"checkbox\"\r\n                                (change)=\"changeSelecaoSituacao($event, 'P')\">\r\n                            <label class=\"custom-control-label\" for=\"aguardandoSegundaPesagem\">\r\n                                {{'labels.aguardandoSegundaPesagem' | translate}}\r\n                            </label>\r\n                        </div>\r\n\r\n                        <div class=\"custom-control custom-checkbox\">\r\n                            <input id=\"aguardandoRetorno\" name=\"aguardandoRetorno\"\r\n                                [ngModel]=\"service.filter.aguardandoRetorno === 'S'\"\r\n                                (ngModelChange)=\"service.filter.aguardandoRetorno = $event ? 'S' : 'N'\"\r\n                                class=\"custom-control-input checkbox-success\" type=\"checkbox\"\r\n                                (change)=\"changeSelecaoSituacao($event, 'R')\">\r\n                            <label class=\"custom-control-label\" for=\"aguardandoRetorno\">\r\n                                {{'labels.aguardandoRetorno' | translate}}\r\n                            </label>\r\n                        </div>\r\n\r\n                        <div class=\"custom-control custom-checkbox\">\r\n                            <input id=\"aguardandoAnalise\" name=\"aguardandoAnalise\"\r\n                                [ngModel]=\"service.filter.aguardandoAnalise === 'S'\"\r\n                                (ngModelChange)=\"service.filter.aguardandoAnalise = $event ? 'S' : 'N'\"\r\n                                class=\"custom-control-input checkbox-success\" type=\"checkbox\"\r\n                                (change)=\"changeSelecaoSituacao($event, 'S')\">\r\n                            <label class=\"custom-control-label\" for=\"aguardandoAnalise\">\r\n                                {{'labels.aguardandoAnalise' | translate}}\r\n                            </label>\r\n                        </div>\r\n\r\n                        <div class=\"custom-control custom-checkbox\">\r\n                            <input id=\"operacaoConcluida\" name=\"operacaoConcluida\"\r\n                                [ngModel]=\"service.filter.operacaoConcluida === 'S'\"\r\n                                (ngModelChange)=\"service.filter.operacaoConcluida = $event ? 'S' : 'N'\"\r\n                                class=\"custom-control-input checkbox-success\" type=\"checkbox\"\r\n                                (change)=\"changeSelecaoSituacao($event, 'C')\">\r\n                            <label class=\"custom-control-label\" for=\"operacaoConcluida\">\r\n                                {{'labels.operacaoConcluida' | translate}}\r\n                            </label>\r\n                        </div>\r\n\r\n                        <div class=\"custom-control custom-checkbox\">\r\n                            <input id=\"operacaoCancelada\" name=\"operacaoCancelada\"\r\n                                [ngModel]=\"service.filter.operacaoCancelada === 'S'\"\r\n                                (ngModelChange)=\"service.filter.operacaoCancelada = $event ? 'S' : 'N'\"\r\n                                class=\"custom-control-input checkbox-success\" type=\"checkbox\"\r\n                                (change)=\"changeSelecaoSituacao($event, 'E')\">\r\n                            <label class=\"custom-control-label\" for=\"operacaoCancelada\">\r\n                                {{'labels.operCancelada' | translate}}\r\n                            </label>\r\n                        </div>\r\n                    </app-card-container>\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=\"registro\">{{'labels.registro' | translate}}</label>\r\n                                <input id=\"registro\" name=\"registro\" [(ngModel)]=\"service.filter.opDescargaTremId\"\r\n                                    class=\"form-control form-control-sm\" type=\"text\">\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"row\">\r\n                        <div class=\"col-lg-4 col-md-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\" maxlength=\"18\">\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/balanca/descargas-ferroviarias/descargas-ferroviarias-form/descargas-ferroviarias-form.component.html":
/*!*******************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-form/descargas-ferroviarias-form.component.html ***!
  \*******************************************************************************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("<app-menu-command-bar [botoesComando]=\"constantes.listaForm\" [sisFormularioId]=\"constantes.sisFormularioId\"\r\n    [formAction]=\"actionForm\" [itemData]=\"service.data.opDescargaTremId\">\r\n</app-menu-command-bar>\r\n\r\n<div class=\"col-lg-12 col-12 section-comand-bar\">\r\n    <div class=\"clearfix\">\r\n        <ul class=\"nav nav-tabs\">\r\n            <li class=\"nav-item\">\r\n                <a class=\"nav-link active\" data-toggle=\"tab\" href=\"#tDados\">{{\"labels.dados\" | translate }}</a>\r\n            </li>\r\n            <li class=\"nav-item\">\r\n                <a class=\"nav-link\" data-toggle=\"tab\" href=\"#tItem\">{{\"labels.item\" |\r\n                    translate }}</a>\r\n            </li>\r\n        </ul>\r\n    </div>\r\n    <div class=\"tab-content top\">\r\n        <div class=\"tab-pane active\" id=\"tDados\">\r\n            <app-form-legenda></app-form-legenda>\r\n            <form class=\"form\" #f=\"ngForm\" (ngSubmit)=\"onSubmit(f)\">\r\n                <app-validacoes></app-validacoes>\r\n                <div class=\"row\">\r\n                    <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"registro\">{{'labels.registro' | translate}}</label>\r\n                            <input id=\"registro\" name=\"registro\" [(ngModel)]=\"service.data.opDescargaTremId\"\r\n                                class=\"form-control form-control-sm\" type=\"text\" currencyMask\r\n                                [options]=\"funcoes.optionCurrency(0)\" disabled>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-3 col-md-6 col-sm-12\" *ngIf=\"!!service.data.situacao\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"situacao\">{{'labels.situacao' | translate}}</label>\r\n                            <input id=\"situacao\" name=\"situacao\" [(ngModel)]=\"service.data.situacao\"\r\n                                class=\"form-control form-control-sm\" type=\"text\" 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 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"numeroVagao\" class=\"required\">{{'labels.numeroVagao' | translate}}</label>\r\n                            <input id=\"numeroVagao\" name=\"numeroVagao\" class=\"form-control form-control-sm\" type=\"text\"\r\n                                required [disabled]=\"funcoesService.isDetail(actionForm)\" uppercase\r\n                                [(ngModel)]=\"service.data.cadastroPlacaId\" (blur)=\"validation.validarPlaca()\"\r\n                                maxlength=\"10\">\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"cadastramento\" class=\"required\">{{'labels.cadastramento' | translate}}</label>\r\n                            <app-data-h-m-s id=\"cadastramento\" name=\"cadastramento\" required\r\n                                [disabled]=\"funcoesService.isDetail(actionForm) || !service.configs.altDtChegada\"\r\n                                [(ngModel)]=\"service.data.dtAutorizacao\"\r\n                                (executa)=\"validation.validarDtAutorizacao($event)\">\r\n                            </app-data-h-m-s>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"row\">\r\n                    <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"encoste\" [class.required]=\"service.data.pesoBru > 0\">\r\n                                {{'labels.encoste' | translate}}\r\n                            </label>\r\n                            <app-data-h-m id=\"encoste\" name=\"encoste\" [(ngModel)]=\"service.data.dtTriagem\"\r\n                                [required]=\"service.data.pesoBru > 0\" [disabled]=\"funcoesService.isDetail(actionForm)\"\r\n                                (executa)=\"validation.validarDtTriagem($event)\">\r\n                            </app-data-h-m>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"entregaNf\" class=\"required\">{{'labels.entregaNf' | translate}}</label>\r\n                            <app-data-h-m id=\"entregaNf\" name=\"entregaNf\" [(ngModel)]=\"service.data.dtEntregaNF\"\r\n                                [required]=\"true\" [disabled]=\"funcoesService.isDetail(actionForm)\"\r\n                                (executa)=\"validation.validarDtEntregaNF($event)\">\r\n                            </app-data-h-m>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                    </div>\r\n                    <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"pesoBru\">{{'labels.pesoBru' | translate}}</label>\r\n                            <input id=\"pesoBru\" name=\"pesoBru\" class=\"form-control form-control-sm\"\r\n                                style=\"background-color: yellow;\" type=\"text\" currencyMask disabled\r\n                                [(ngModel)]=\"service.data.pesoBru\" [options]=\"funcoes.optionCurrency(0)\">\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"row\">\r\n                    <div class=\"col-lg-8 col-md-8 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                                [(ngModel)]=\"service.data.destinatarioIdCliente\" [inSelected]=\"service.data?.cliente\"\r\n                                (outSelected)=\"service.data.cliente = $event\" tipoDestinatario=\"C\" showCgcCpf=\"true\"\r\n                                showInscricao=\"false\" required=\"true\" [disabled]=\"funcoesService.isDetail(actionForm)\"\r\n                                (outModel)=\"trataCliente($event)\">\r\n                            </app-pesquisa-destinatario>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-1 col-md-1 col-sm-12\">\r\n                    </div>\r\n                    <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"pesoTara\">{{'labels.pesoTara' | translate}}</label>\r\n                            <input id=\"pesoTara\" name=\"pesoTara\" class=\"form-control form-control-sm\"\r\n                                style=\"background-color: yellow;\" type=\"text\" currencyMask disabled\r\n                                [(ngModel)]=\"service.data.pesoTara\" [options]=\"funcoes.optionCurrency(0)\">\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"row\">\r\n                    <div class=\"col-lg-8 col-md-8 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <app-pesquisa-destinatario id=\"emitente\" name=\"emitente\" label=\"emitente\"\r\n                                [(ngModel)]=\"service.data.destinatarioIdEmitente\" [inSelected]=\"service.data?.emitente\"\r\n                                (outSelected)=\"service.data.emitente = $event\" tipoDestinatario=\"C\" showCgcCpf=\"true\"\r\n                                showInscricao=\"false\" required=\"true\" [disabled]=\"funcoesService.isDetail(actionForm)\">\r\n                            </app-pesquisa-destinatario>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-1 col-md-1 col-sm-12\">\r\n                    </div>\r\n                    <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"pesoLiq\">{{'labels.pesoLiq' | translate}}</label>\r\n                            <input id=\"pesoLiq\" name=\"pesoLiq\" class=\"form-control form-control-sm\"\r\n                                style=\"background-color: yellow;\" type=\"text\" currencyMask disabled\r\n                                [(ngModel)]=\"service.data.pesoLiq\" [options]=\"funcoes.optionCurrency(0)\">\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"row\">\r\n                    <div class=\"col-lg-6 col-md-6 col-sm-12\">\r\n                        <div class=\"row\">\r\n                            <div class=\"col-12\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <app-pesquisa-material id=\"materialId\" name=\"materialId\" label=\"produto\"\r\n                                        modalTitle=\"pesquisaDeProduto\" [(ngModel)]=\"service.data.materialId\"\r\n                                        [inSelected]=\"service.data?.material\"\r\n                                        (outModel)=\"service.data.material = $event\" required=\"true\"\r\n                                        [disabled]=\"!funcoesService.isCreate(actionForm)\">\r\n                                    </app-pesquisa-material>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class=\"row\">\r\n                            <div class=\"col-12\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <app-pesquisa-destinatario id=\"transportadora\" name=\"transportadora\"\r\n                                        label=\"transportadora\" [(ngModel)]=\"service.data.destinatarioIdTransportadora\"\r\n                                        [inSelected]=\"service.data?.transportadora\"\r\n                                        (outSelected)=\"service.data.transportadora = $event\" tipoDestinatario=\"T\"\r\n                                        showCgcCpf=\"false\" showInscricao=\"false\" required=\"true\"\r\n                                        [disabled]=\"funcoesService.isDetail(actionForm)\">\r\n                                    </app-pesquisa-destinatario>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class=\"row\">\r\n                            <div class=\"col-md-6 col-sm-12\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <app-pesquisa-saldo-lote-deposito id=\"deposito\" name=\"deposito\" required=\"true\"\r\n                                        [label]=\"'deposito'\" [modalTitle]=\"'deposito'\"\r\n                                        [disabled]=\"funcoesService.isDetail(actionForm) || disableTanque\"\r\n                                        [field]=\"'tanqueId'\" [options]=\"saldoDepositoOptions\"\r\n                                        [(ngModel)]=\"service.data.tanqueId\">\r\n                                    </app-pesquisa-saldo-lote-deposito>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-2 col-md-6 col-sm-12\">\r\n                    </div>\r\n                    <div class=\"col-lg-4 col-md-6 col-sm-12\">\r\n                        <fieldset>\r\n                            <legend>{{ \"labels.pesoOrigem\" | translate }}</legend>\r\n                            <div class=\"form-group form-group-sm\">\r\n                                <label for=\"pesoLiqOrigem\" class=\"required\">{{'labels.pesoLiquido' | translate}}</label>\r\n                                <input id=\"pesoLiqOrigem\" name=\"pesoLiqOrigem\" class=\"form-control form-control-sm\"\r\n                                    type=\"text\" currencyMask [(ngModel)]=\"service.data.kilos\"\r\n                                    [options]=\"funcoes.optionCurrency(0)\"\r\n                                    [disabled]=\"funcoesService.isDetail(actionForm)\" maxlength=\"19\" required>\r\n                            </div>\r\n                            <div class=\"form-group form-group-sm\">\r\n                                <label for=\"pesoBruOrigem\" class=\"required\">{{'labels.pesoBruto' | translate}}</label>\r\n                                <input id=\"pesoBruOrigem\" name=\"pesoBruOrigem\" class=\"form-control form-control-sm\"\r\n                                    type=\"text\" currencyMask [(ngModel)]=\"service.data.pesoBruOrigem\"\r\n                                    [options]=\"funcoes.optionCurrency(0)\"\r\n                                    [disabled]=\"funcoesService.isDetail(actionForm)\" maxlength=\"19\" required>\r\n                            </div>\r\n                        </fieldset>\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=\"tipoOperacao\" class=\"required\">{{'labels.tipoOperacao' | translate}}</label>\r\n                            <app-combo-tipo-operacao id=\"tipoOperacao\" name=\"tipoOperacao\"\r\n                                [(ngModel)]=\"service.data.tipoOperacaoId\" ativos=\"true\" flagAtivo=\"S\"\r\n                                ordenarPorDescricao=\"true\" required=\"true\"\r\n                                [disabled]=\"funcoesService.isDetail(actionForm)\">\r\n                            </app-combo-tipo-operacao>\r\n                        </div>\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"terno\">{{'labels.regTerno' | translate}}</label>\r\n                            <app-combo-terno id=\"terno\" name=\"terno\" required=\"false\" ativos=\"true\"\r\n                                ordenarPorDescricao=\"true\" [(ngModel)]=\"service.data.ternoId\"\r\n                                [disabled]=\"funcoesService.isDetail(actionForm)\">\r\n                            </app-combo-terno>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                    </div>\r\n                    <div *ngIf=\"service.configs.solCTEDescFer\" class=\"col-lg-6 col-md-6 col-sm-12\">\r\n                        <fieldset>\r\n                            <legend>{{ \"labels.dcl\" | translate }}</legend>\r\n                            <div class=\"row\">\r\n                                <div class=\"col-lg-4 col-md-6 col-sm-12\">\r\n                                    <div class=\"form-group form-group-sm\">\r\n                                        <label for=\"numero\">{{'labels.numero' | translate}}</label>\r\n                                        <input id=\"numero\" name=\"numero\" class=\"form-control form-control-sm\"\r\n                                            type=\"text\" currencyMask [(ngModel)]=\"service.data.numeroCTE\"\r\n                                            [options]=\"funcoes.optionCurrency(0)\"\r\n                                            [disabled]=\"funcoesService.isDetail(actionForm)\">\r\n                                    </div>\r\n                                </div>\r\n                                <div class=\"col-lg-4 col-md-6 col-sm-12\">\r\n                                    <div class=\"form-group form-group-sm\">\r\n                                        <label for=\"serie\">{{ 'labels.serie' | translate}}</label>\r\n                                        <app-combo-serie-nota id=\"serie\" name=\"serie\"\r\n                                            [flagAtivo]=\"'S'\" [(ngModel)]=\"service.data.serieCTE\"\r\n                                            [disabled]=\"funcoesService.isDetail(actionForm)\">\r\n                                        </app-combo-serie-nota>\r\n                                    </div>\r\n                                </div>\r\n                                <div class=\"col-lg-4 col-md-6 col-sm-12\">\r\n                                    <div class=\"form-group form-group-sm\">\r\n                                        <label for=\"emissao\">{{\"labels.emissao\" | translate }}</label>\r\n                                        <app-data id=\"emissao\" name=\"emissao\" [(ngModel)]=\"service.data.dataCTE\"\r\n                                            class=\"dataHora\" [formatDateTime]=\"mascara.getFormatData\"\r\n                                            [disabled]=\"funcoesService.isDetail(actionForm)\">\r\n                                        </app-data>\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                        </fieldset>\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 class=\"required\" for=\"localTransbordo\">{{ 'labels.localTransbordo' | translate}}</label>\r\n                            <app-combo-padrao id=\"localTransbordo\" name=\"localTransbordo\" tabela=\"LocalTransbordo\"\r\n                                descricao=\"DescrLocalTransb\" chave=\"CodLocalTransb\" ativos=\"true\"\r\n                                [(ngModel)]=\"service.data.localTransbordoId\" required=\"true\"\r\n                                [disabled]=\"funcoesService.isDetail(actionForm)\">\r\n                            </app-combo-padrao>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"row\" *ngIf=\"service.configs.solConclLaudoSegPesF\">\r\n                    <div class=\"col-lg-4 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"situacaoLaudo\">{{'labels.situacaoLote' |\r\n                                translate}}</label>\r\n                            <select id=\"situacaoLaudo\" name=\"situacaoLaudo\" class=\"form-control form-control-sm\"\r\n                                [(ngModel)]=\"service.data.situacaoLaudo\"\r\n                                [disabled]=\"funcoesService.isDetail(actionForm)\">\r\n                                <option value=\"null\">{{ 'labels.selecione' | translate }}</option>\r\n                                <option value=\"0\">{{ 'labels.devido' | translate }}</option>\r\n                                <option value=\"1\">{{ 'labels.indevido' | translate }}</option>\r\n                            </select>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"row\">\r\n                    <div class=\"col-sm-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 class=\"tab-pane\" id=\"tItem\">\r\n            <app-descargas-ferroviarias-item id=\"descargasFerroviariasItems\" name=\"descargasFerroviariasItems\"\r\n                [disabled]=\"funcoesService.isDetail(actionForm)\">\r\n            </app-descargas-ferroviarias-item>\r\n        </div>\r\n    </div>\r\n</div>\r\n\r\n<app-descargas-ferroviarias-confirmacao-chegada></app-descargas-ferroviarias-confirmacao-chegada>\r\n<app-foto-ocr></app-foto-ocr>");

/***/ }),

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-index/descargas-ferroviarias-index.component.html":
/*!*********************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-index/descargas-ferroviarias-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.opDescargaTremId\">\n</app-menu-command-bar>\n\n<div class=\"section-comand-bar\">\n    <table id=\"dtDescargasFerroviarias\" 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-descargas-ferroviarias-filter (filtrar)=\"executarFiltro($event)\"></app-descargas-ferroviarias-filter>\n<app-descargas-ferroviarias-print-modal (outConfirma)=\"confirmaImpressao($event)\"></app-descargas-ferroviarias-print-modal>\n<app-descargas-ferroviarias-motivo (outMotivo)=\"executarExclusao($event)\"></app-descargas-ferroviarias-motivo>\n<app-descargas-ferroviarias-motivo-pesagem (outMotivo)=\"executarCancelarPesagem($event)\"></app-descargas-ferroviarias-motivo-pesagem>\n<app-descargas-ferroviarias-alterar-datas (executar)=\"refresh()\"></app-descargas-ferroviarias-alterar-datas>\n<app-descargas-ferroviarias-dados-pesagem (executarBtnFotoOCR)=\"visualizarFotoOCR()\"></app-descargas-ferroviarias-dados-pesagem>\n<app-descargas-ferroviarias-informar-encoste></app-descargas-ferroviarias-informar-encoste>\n<app-foto-ocr></app-foto-ocr>\n<app-descargas-ferroviarias-pesagem-para-retorno (executar)=\"refresh()\"></app-descargas-ferroviarias-pesagem-para-retorno>\n<app-descargas-ferroviarias-liberar-retorno (executar)=\"refresh()\"></app-descargas-ferroviarias-liberar-retorno>");

/***/ }),

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-informar-encoste/descargas-ferroviarias-informar-encoste.component.html":
/*!*******************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-informar-encoste/descargas-ferroviarias-informar-encoste.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=\"descargas-informar-encoste\" tabindex=\"-1\" role=\"dialog\"\n    data-backdrop=\"static\">\n    <div class=\"uni-modal-dialog-md-60\">\n        <div class=\"modal-content\">\n            <div class=\"modal-header\">\n                <h6 class=\"modal-title\">{{ 'titles.informarEncoste' | translate }}</h6>\n            </div>\n            <form class=\"form\" #form=\"ngForm\" (ngSubmit)=\"onSubmit(form)\">\n                <div class=\"modal-body\">\n                    <app-validacoes></app-validacoes>\n                    <div class=\"row\">\n                        <div class=\"col-lg-8 col-md-8 col-sm-12\">\n                            <div class=\"form-group form-group-sm\">\n                                <app-pesquisa-material id=\"produto\" name=\"produto\" label=\"produto\"\n                                    modalTitle=\"pesquisaDeProduto\" [(ngModel)]=\"materialId\" [inSelected]=\"material\"\n                                    (outSelected)=\"material = $event\">\n                                </app-pesquisa-material>\n                            </div>\n                        </div>\n                        <div class=\"col-lg-2\">\n                            <div class=\"cleafix\">&nbsp;</div>\n                            <button class=\"btn btn-success\" (click)=\"pesquisar()\" type=\"button\">\n                                {{ 'buttons.pesquisar' | translate }}\n                            </button>\n                        </div>\n                    </div>\n\n                    <div class=\"row\">\n                        <div class=\"col-lg-3 col-md-3 col-sm-12\">\n                            <div class=\"form-group form-group-sm\">\n                                <label for=\"dtHoraEncoste\" class=\"required\">\n                                    {{ 'labels.dtHoraEncoste' | translate }}\n                                </label>\n                                <app-data-h-m id=\"dtHoraEncoste\" name=\"dtHoraEncoste\" required=\"true\"\n                                    [(ngModel)]=\"dtEncoste\">\n                                </app-data-h-m>\n                            </div>\n                        </div>\n                        <div class=\"col-lg-6 col-md-6 col-sm-12 mt-4\">\n                            <button type=\"button\" class=\"btn btn-success mr-2\" (click)=\"marcarTodos()\">\n                                {{ 'buttons.selecionaTodos' | translate }}\n                            </button>\n                            <button type=\"button\" class=\"btn btn-success\" (click)=\"desmarcarTodos()\">\n                                {{ 'buttons.desmarcarTodos' | translate }}\n                            </button>\n                        </div>\n                    </div>\n\n                    <div class=\"table-responsive mt-1\" style=\"overflow: auto; max-height: 300px;\">\n                        <table id=\"dtInformarEncoste\"\n                            class=\"table table-striped table-bordered table-hover nowrap table-sm\">\n                            <thead>\n                                <tr>\n                                    <th class=\"text-center\">{{ 'labels.sel' | translate}}</th>\n                                    <th style=\"text-align: right\">{{ 'labels.registro' | translate }}</th>\n                                    <th>{{ 'labels.vagao' | translate }}</th>\n                                    <th>{{ 'labels.data' | translate }}</th>\n                                    <th>{{ 'labels.cliente' | translate }}</th>\n                                    <th>{{ 'labels.produto' | translate }}</th>\n                                </tr>\n                            </thead>\n                            <tbody>\n                                <tr *ngFor=\"let t of data; index as i\" (dblclick)=\"_dbClick(t, i)\">\n                                    <td class=\"text-center\">\n                                        <label class=\"chk\">\n                                            <input type=\"checkbox\" id=\"selecionado\" name=\"selecionado\" value=\"checked\"\n                                                (ngModelChange)=\"t.selecionado = $event ? 'S' : 'N'\"\n                                                [ngModel]=\"t.selecionado ==='S'\"\n                                                style=\"margin-left:auto; margin-right:auto;\" disabled>\n                                            <span [ngClass]=\"{'red':t.selecionado == 'S' ? true : false}\"></span>\n                                        </label>\n                                    </td>\n                                    <td style=\"white-space: nowrap; text-align: right\">{{ t.opDescargaTremId }}</td>\n                                    <td style=\"white-space: nowrap;\">{{ t.cadastroPlacaId }}</td>\n                                    <td style=\"white-space: nowrap;\">{{ t.dtAutorizacao | date: 'dd/MM/yyyy HH:mm' }}</td>\n                                    <td style=\"white-space: nowrap;\">{{ t.clienteFantasia }}</td>\n                                    <td style=\"white-space: nowrap;\">{{ t.produtoFantasia }}</td>\n                                </tr>\n                                <tr *ngIf=\"!hasDados\">\n                                    <th colspan=\"6\" style=\"text-align: center\">\n                                        {{ \"messages.nenhumRegistroEncontrado\" | translate }}\n                                    </th>\n                                </tr>\n                            </tbody>\n                        </table>\n                    </div>\n                </div>\n                <div class=\"modal-footer\">\n                    <button class=\"btn btn-success mr-1\" [disabled]=\"!hasDados\" type=\"submit\">\n                        {{ 'buttons.salvar' | translate }}\n                    </button>\n                    <button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">{{ 'buttons.sair' | translate }}</button>\n                </div>\n            </form>\n        </div>\n    </div>\n</div>");

/***/ }),

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

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("<div *ngIf=\"!showAdd\">\r\n    <div class=\"container-buttons\">\r\n        <div class=\"btn-group\">\r\n            <app-menu-button title=\"{{ 'buttons.novo' | translate }}\" [icon]=\"'icon-plus'\" (click)=\"create()\"\r\n                [disabled]=\"disabled\">\r\n            </app-menu-button>\r\n            <app-menu-button title=\"{{ 'buttons.visualizar' | translate }}\" [icon]=\"'icon-eye'\" (click)=\"detail()\"\r\n                [disabled]=\"funcoesService.showButtons.detail(actionForm, service.descargasFerroviariasNota?.opDescargaTremItemId)\">\r\n            </app-menu-button>\r\n            <app-menu-button title=\"{{ 'buttons.editar' | translate }}\" [icon]=\"'icon-pencil'\" (click)=\"edit()\"\r\n                [disabled]=\"disabled || funcoesService.showButtons.edit(actionForm, service.descargasFerroviariasNota?.opDescargaTremItemId)\">\r\n            </app-menu-button>\r\n            <app-menu-button title=\"{{ 'buttons.excluir' | translate }}\" [icon]=\"'icon-close'\" (click)=\"remove()\"\r\n                [disabled]=\"disabled || funcoesService.showButtons.remove(actionForm, service.descargasFerroviariasNota?.opDescargaTremItemId)\">\r\n            </app-menu-button>\r\n        </div>\r\n    </div>\r\n\r\n    <div class=\"row\">\r\n        <div class=\"col-md-12 col-lg-12\">\r\n            <table class=\"table table-striped table-hover\">\r\n                <thead>\r\n                    <tr>\r\n                        <th style=\"display: none\">{{ 'labels.registro' | translate }}</th>\r\n                        <th class=\"text-center\">{{ 'labels.autorizacao' | translate }}</th>\r\n                        <th class=\"text-center\">{{ 'labels.cliente' | translate }}</th>\r\n                        <th class=\"text-center\">{{ 'labels.emitente' | translate }}</th>\r\n                        <th class=\"text-center\">{{ 'labels.lote' | translate }}</th>\r\n                        <th class=\"text-center\">{{ 'labels.docto' | translate }}</th>\r\n                        <th class=\"text-center\">{{ 'labels.serie' | translate }}</th>\r\n                        <th class=\"text-center\">{{ 'labels.emissao' | translate }}</th>\r\n                        <th class=\"text-center\">{{ 'labels.peso' | translate }}</th>\r\n                    </tr>\r\n                </thead>\r\n                <tbody>\r\n                    <tr *ngFor=\"let c of service.data.opDescargaTremNotas | removeExcluidos; let i = index\"\r\n                        (click)=\"selected(c, i)\"\r\n                        [ngClass]=\"{ 'info': i === _index && service.descargasFerroviariasNota.opDescargaTremItemId === c.opDescargaTremItemId }\">\r\n                        <td style=\"display: none\">{{c.opDescargaTremItemId}}</td>\r\n                        <td class=\"text-center\">{{c.opDescargaId | formatCurrency: 0}}</td>\r\n                        <td class=\"text-center\">{{c.clienteFantasia}}</td>\r\n                        <td class=\"text-center\">{{c.emitenteFantasia}}</td>\r\n                        <td class=\"text-center\">{{c.loteId}}</td>\r\n                        <td class=\"text-center\">{{c.docto}}</td>\r\n                        <td class=\"text-center\">{{c.serieNotaId}}</td>\r\n                        <td class=\"text-center\">{{c.dtDocto | date:'dd/MM/yyyy'}}</td>\r\n                        <td class=\"text-center\">{{c.pesoDoc | formatCurrency: 0}}</td>\r\n                    </tr>\r\n                    <tr *ngIf=\"!hasDados\">\r\n                        <th colspan=\"8\">\r\n                            {{'messages.nenhumRegistroEncontrado' | translate }}\r\n                        </th>\r\n                    </tr>\r\n                </tbody>\r\n            </table>\r\n        </div>\r\n    </div>\r\n</div>\r\n\r\n<div *ngIf=\"showAdd\">\r\n    <div class=\"row\">\r\n        <div class=\"col-lg-6 container-buttons\">\r\n            <div class=\"btn-group\">\r\n                <app-menu-button title=\"{{ 'buttons.editar' | translate }}\" [icon]=\"'fa fa-edit'\" (click)=\"edit()\"\r\n                    [disabled]=\"disabled || funcoesService.showButtons.edit(actionForm, service.descargasFerroviariasNota.opDescargaTremItemId)\">\r\n                </app-menu-button>\r\n                <app-menu-button title=\"{{ 'buttons.voltar' | translate }}\" [icon]=\"'fa fa-arrow-left'\"\r\n                    (click)=\"back()\"></app-menu-button>\r\n            </div>\r\n        </div>\r\n        <div class=\"col-lg-6\">\r\n            <app-form-legenda></app-form-legenda>\r\n        </div>\r\n    </div>\r\n\r\n    <div class=\"clearfix\">&nbsp;</div>\r\n\r\n    <form class=\"form\" #f=\"ngForm\" (ngSubmit)=\"onSubmit(f)\">\r\n        <div class=\"row\">\r\n            <div class=\"col-12\">\r\n                <div class=\"card\">\r\n                    <div class=\"card-body widget-body\">\r\n                        <app-validacoes></app-validacoes>\r\n                        <div class=\"row\">\r\n                            <div class=\"col-lg-8 col-md-8 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                                        [(ngModel)]=\"service.descargasFerroviariasNota.destinatarioIdCliente\"\r\n                                        [inSelected]=\"service.descargasFerroviariasNota.cliente\" tipoDestinatario=\"C\"\r\n                                        showCgcCpf=\"true\" showInscricao=\"false\" required=\"true\"\r\n                                        [disabled]=\"funcoesService.isDetail(actionForm)\"\r\n                                        (executa)=\"service.descargasFerroviariasNota.destinatarioIdEmitente = $event\">\r\n                                    </app-pesquisa-destinatario>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class=\"row\">\r\n                            <div class=\"col-lg-8 col-md-8 col-sm-12\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <app-pesquisa-destinatario id=\"emitente\" name=\"emitente\" label=\"emitente\"\r\n                                        [(ngModel)]=\"service.descargasFerroviariasNota.destinatarioIdEmitente\"\r\n                                        [inSelected]=\"service.descargasFerroviariasNota.emitente\" tipoDestinatario=\"C\"\r\n                                        showCgcCpf=\"true\" showInscricao=\"false\" required=\"true\"\r\n                                        [disabled]=\"funcoesService.isDetail(actionForm)\"\r\n                                        (executa)=\"onDestinatatioIdEmitenteChange()\">\r\n                                    </app-pesquisa-destinatario>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class=\"row\">\r\n                            <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <app-pesquisa-saldo-lote-deposito id=\"lote\" name=\"lote\" required=\"true\"\r\n                                        [label]=\"'lote'\" [modalTitle]=\"'lote'\"\r\n                                        [disabled]=\"funcoesService.isDetail(actionForm)\" [field]=\"'loteId'\"\r\n                                        [options]=\"saldoLoteOptions\"\r\n                                        [(ngModel)]=\"service.descargasFerroviariasNota.loteId\"\r\n                                        (outModel)=\"onLoteSelecionado($event)\">\r\n                                    </app-pesquisa-saldo-lote-deposito>\r\n                                </div>\r\n                            </div>\r\n                            <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <label for=\"valorUnitario\">{{'labels.valorUnitario' | translate}}</label>\r\n                                    <input id=\"valorUnitario\" name=\"valorUnitario\" class=\"form-control form-control-sm\"\r\n                                        type=\"text\" currencyMask\r\n                                        [(ngModel)]=\"service.descargasFerroviariasNota.lote == null ? 0 : service.descargasFerroviariasNota.lote.precoArmazenado\"\r\n                                        [options]=\"funcoesService.optionCurrency(9)\" disabled>\r\n                                </div>\r\n                            </div>\r\n                            <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <label for=\"densidadeLote\">{{'labels.densidadeLote' | translate}}</label>\r\n                                    <input id=\"densidadeLote\" name=\"densidadeLote\" class=\"form-control form-control-sm\"\r\n                                        type=\"text\" currencyMask\r\n                                        [(ngModel)]=\"service.descargasFerroviariasNota.lote == null ? 0 : service.descargasFerroviariasNota.lote.densidade\"\r\n                                        [options]=\"funcoesService.optionCurrency(9)\" 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 col-sm-12\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <label for=\"quantid\"\r\n                                        [class.required]=\"obrEtiquetaMaterial === 'S' || movQuantidTanque === 'S' || (this.service.descargasFerroviariasNota != null && this.service.descargasFerroviariasNota.unidadeId === 'UN')\">\r\n                                        {{ movQuantidTanque === 'S' ? 'labels.qtdeDepositos' : 'labels.quantid' |\r\n                                        translate}}\r\n                                    </label>\r\n                                    <input id=\"quantid\" name=\"quantid\" class=\"form-control form-control-sm\" type=\"text\"\r\n                                        currencyMask [(ngModel)]=\"service.descargasFerroviariasNota.quantid\"\r\n                                        [options]=\"funcoesService.optionCurrency(0)\" maxlenght=\"15\"\r\n                                        [required]=\"obrEtiquetaMaterial === 'S' || movQuantidTanque === 'S' || (service.descargasFerroviariasNota.lote != null && this.service.descargasFerroviariasNota.lote.unidadeId === 'UN')\"\r\n                                        [disabled]=\"funcoesService.isDetail(actionForm) || obrEtiquetaMaterial !== 'S' || movQuantidTanque !== 'S' || (this.service.descargasFerroviariasNota.lote != null && this.service.descargasFerroviariasNota.lote.unidadeId !== 'UN')\">\r\n                                </div>\r\n                            </div>\r\n                            <div class=\"col-lg-3 col-md-6 col-sm-12\" *ngIf=\"!service.configs.solConclLaudoSegPesF\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <label for=\"situacaoLote\">{{'labels.situacaoLote' | translate}}</label>\r\n                                    <select id=\"situacaoLote\" name=\"situacaoLote\" class=\"form-control form-control-sm\"\r\n                                        [(ngModel)]=\"service.descargasFerroviariasNota.sitLaudo\"\r\n                                        [disabled]=\"funcoesService.isDetail(actionForm)\">\r\n                                        <option value=\"\">{{ 'labels.selecione' | translate}}</option>\r\n                                        <option value=\"0\">{{ 'labels.devido' | translate}}</option>\r\n                                        <option value=\"1\">{{ 'labels.indevido' | translate}}</option>\r\n                                    </select>\r\n                                </div>\r\n                            </div>\r\n                            <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <label for=\"numeroLaudo\">{{'labels.numeroLaudo' | translate}}</label>\r\n                                    <input id=\"numeroLaudo\" name=\"numeroLaudo\" class=\"form-control form-control-sm\"\r\n                                        type=\"text\" [(ngModel)]=\"service.descargasFerroviariasNota.numLaudo\"\r\n                                        [disabled]=\"funcoesService.isDetail(actionForm)\" maxlenght=\"6\">\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class=\"row\">\r\n                            <div class=\"col-lg-5 col-md-6 col-sm-12\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <label for=\"tipoDocTransporte\" class=\"required\">{{'labels.tipoDocTransporte' |\r\n                                        translate}}</label>\r\n                                    <app-combo-tipo-documento-transp id=\"tipoDocTransporte\" name=\"tipoDocTransporte\"\r\n                                        [(ngModel)]=\"service.descargasFerroviariasNota.tipoDocumentoTranspId\"\r\n                                        [disabled]=\"funcoesService.isDetail(actionForm) || desabilitarCodTipoDoc\"\r\n                                        [required]=\"true\" (ngModelChange)=\"onTipoDocTransporteChange()\">\r\n                                    </app-combo-tipo-documento-transp>\r\n                                </div>\r\n                            </div>\r\n                            <div class=\"col-lg-4 col-md-6 col-sm-12\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <label for=\"numero\" [class.required]=\"flagSolDadosEnt === 'S'\">\r\n                                        {{'labels.numero' | translate}}\r\n                                    </label>\r\n                                    <input id=\"numero\" name=\"numero\" class=\"form-control form-control-sm\" type=\"text\"\r\n                                        [mask]=\"funcoesService.isDetail(actionForm) ? '' : mascaraDocto\"\r\n                                        [(ngModel)]=\"service.descargasFerroviariasNota.docTranspNumero\"\r\n                                        [required]=\"flagSolDadosEnt === 'S'\"\r\n                                        [disabled]=\"funcoesService.isDetail(actionForm) || flagSolDadosEnt === 'N'\">\r\n                                </div>\r\n                            </div>\r\n                            <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <label for=\"emissao\" [class.required]=\"flagSolDadosEnt === 'S'\">\r\n                                        {{'labels.emissao' | translate}}\r\n                                    </label>\r\n                                    <app-data id=\"emissao\" name=\"emissao\"\r\n                                        [(ngModel)]=\"service.descargasFerroviariasNota.docTranspEmissao\"\r\n                                        class=\"dataHora\" [formatDateTime]=\"mascara.getFormatData\"\r\n                                        [required]=\"flagSolDadosEnt === 'S'\"\r\n                                        [disabled]=\"funcoesService.isDetail(actionForm) || flagSolDadosEnt === 'N'\">\r\n                                    </app-data>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class=\"row\">\r\n                            <div class=\"col-lg-8 col-md-8 col-sm-12\">\r\n                                <div class=\"row\">\r\n                                    <div class=\"col-lg-9 col-md-9 col-sm-12\">\r\n                                        <div class=\"form-group form-group-sm\">\r\n                                            <label for=\"modeloNf\" class=\"required\">{{'labels.modeloNf' |\r\n                                                translate}}</label>\r\n                                            <app-combo-modelo-nota id=\"modeloNf\" name=\"modeloNf\"\r\n                                                [(ngModel)]=\"service.descargasFerroviariasNota.modeloNotaId\"\r\n                                                flagAtivo=\"S\" required=\"true\"\r\n                                                [disabled]=\"funcoesService.isDetail(actionForm)\"\r\n                                                (ngModelChange)=\"onModeloNotaIdChange()\">\r\n                                            </app-combo-modelo-nota>\r\n                                        </div>\r\n                                        <div class=\"form-group form-group-sm\">\r\n                                            <label for=\"chaveNFE\"\r\n                                                [class.required]=\"!disabledChaveNf() && service.configs.obrChaveNFeEnt\">{{'labels.chaveNFE'\r\n                                                | translate}}</label>\r\n                                            <div class=\"input-group\">\r\n                                                <input id=\"chaveNFE\" name=\"chaveNFE\"\r\n                                                    class=\"form-control form-control-sm\" type=\"text\"\r\n                                                    mask=\"0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000\"\r\n                                                    [(ngModel)]=\"service.descargasFerroviariasNota.chaveNfe\"\r\n                                                    [disabled]=\"disabledChaveNf()\" (blur)=\"numeroDocNfe()\"\r\n                                                    [required]=\"!disabledChaveNf() && service.configs.obrChaveNFeEnt\"\r\n                                                    (blur)=\"validation.validaChaveNfe({'data': service.descargasFerroviariasNota.chaveNfe})\"\r\n                                                    [dropSpecialCharacters]=\"true\" />\r\n                                                <span class=\"input-group-btn\">\r\n                                                    <button type=\"button\" class=\"btn btn-success btn-sm\"\r\n                                                        [disabled]=\"disabledChaveNf()\"\r\n                                                        (click)=\"importarDanfe(service.descargasFerroviariasNota.chaveNfe)\"\r\n                                                        title=\"Importa DANFE\"> <i class=\"fa fa-search\"></i>\r\n                                                    </button>\r\n                                                </span>\r\n                                            </div>\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                                <div class=\"row\">\r\n                                    <div class=\"col-lg-4 col-md-4 col-sm-12\">\r\n                                        <div class=\"form-group form-group-sm\">\r\n                                            <label for=\"numDocumento\" class=\"required\">{{'labels.numDocumento' |\r\n                                                translate}}</label>\r\n                                            <input id=\"numDocumento\" name=\"numDocumento\"\r\n                                                class=\"form-control form-control-sm text-right\" type=\"text\" required\r\n                                                [(ngModel)]=\"service.descargasFerroviariasNota.docto\" mask=\"9999999999\"\r\n                                                [disabled]=\"funcoesService.isDetail(actionForm) || disableDocto\"\r\n                                                (blur)=\"onDoctoChange()\">\r\n                                        </div>\r\n                                    </div>\r\n                                    <div class=\"col-lg-3 col-md-3 col-sm-12\">\r\n                                        <div class=\"form-group form-group-sm\">\r\n                                            <label for=\"serie\" class=\"required\">{{ 'labels.serie' | translate}}</label>\r\n                                            <app-combo-serie-nota id=\"serie\" name=\"serie\" [required]=\"true\"\r\n                                                [flagAtivo]=\"'S'\"\r\n                                                [(ngModel)]=\"service.descargasFerroviariasNota.serieNotaId\"\r\n                                                [disabled]=\"funcoesService.isDetail(actionForm) || disableDocto\"\r\n                                                (executa)=\"onDoctoChange()\">\r\n                                            </app-combo-serie-nota>\r\n                                        </div>\r\n                                    </div>\r\n                                    <div class=\"col-lg-3 col-md-3 col-sm-12\">\r\n                                        <div class=\"form-group form-group-sm\">\r\n                                            <label for=\"dtEmissao\" class=\"required\">{{'labels.emissao' |\r\n                                                translate}}</label>\r\n                                            <app-data id=\"dtEmissao\" name=\"dtEmissao\" required\r\n                                                [(ngModel)]=\"service.descargasFerroviariasNota.dtDocto\" class=\"dataHora\"\r\n                                                [formatDateTime]=\"mascara.getFormatData\"\r\n                                                [disabled]=\"funcoesService.isDetail(actionForm) || disableDocto\"\r\n                                                (executa)=\"validation.validarDataDocumento()\">\r\n                                            </app-data>\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                                <div class=\"row\">\r\n                                    <div class=\"col-lg-4 col-md-4 col-sm-12\">\r\n                                        <div class=\"form-group form-group-sm\">\r\n                                            <label for=\"quantidDoc\"\r\n                                                [class.required]=\"isNotaImportada || disableRequired\">\r\n                                                {{'labels.quantidDoc' | translate}}\r\n                                                {{this.service.descargasFerroviariasNota.lote == null ? \"\" : \"(\" +\r\n                                                this.service.descargasFerroviariasNota.lote.unidadeId + \")\"}}\r\n                                            </label>\r\n                                            <input id=\"quantidDoc\" name=\"quantidDoc\"\r\n                                                class=\"form-control form-control-sm\" type=\"text\" currencyMask\r\n                                                [required]=\"isNotaImportada || disableRequired\"\r\n                                                [(ngModel)]=\"service.descargasFerroviariasNota.quantidDoc\"\r\n                                                [options]=\"funcoesService.optionCurrency(0)\"\r\n                                                [disabled]=\"funcoesService.isDetail(actionForm)\"\r\n                                                (blur)=\"onQuantidDocChange()\">\r\n                                        </div>\r\n                                    </div>\r\n                                    <div class=\"col-lg-3 col-md-3 col-sm-12\">\r\n                                        <div class=\"form-group form-group-sm\">\r\n                                            <label for=\"total\" class=\"required\">{{ 'labels.total' | translate}}</label>\r\n                                            <input id=\"total\" name=\"total\" class=\"form-control form-control-sm\"\r\n                                                type=\"text\" currencyMask\r\n                                                [(ngModel)]=\"service.descargasFerroviariasNota.vlNota\"\r\n                                                [options]=\"funcoesService.optionCurrency(2)\"\r\n                                                [disabled]=\"funcoesService.isDetail(actionForm)\"\r\n                                                (blur)=\"validation.validarVlNota()\">\r\n                                        </div>\r\n                                    </div>\r\n                                    <div class=\"col-lg-3 col-md-3 col-sm-12\">\r\n                                        <div class=\"form-group form-group-sm\">\r\n                                            <label for=\"pesoDocto\" class=\"required\">{{'labels.pesoDocto' |\r\n                                                translate}}</label>\r\n                                            <input id=\"pesoDocto\" name=\"pesoDocto\" class=\"form-control form-control-sm\"\r\n                                                type=\"text\" required currencyMask\r\n                                                [(ngModel)]=\"service.descargasFerroviariasNota.pesoDoc\"\r\n                                                [options]=\"funcoesService.optionCurrency(0)\"\r\n                                                [disabled]=\"funcoesService.isDetail(actionForm)\"\r\n                                                (blur)=\"onPesoDocChange()\">\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                                <div class=\"row\">\r\n                                    <div class=\"col-lg-4 col-md-4 col-sm-12\">\r\n                                        <div class=\"form-group form-group-sm\">\r\n                                            <label for=\"pesoRateio\" class=\"required\">{{'labels.pesoRateio' |\r\n                                                translate}}</label>\r\n                                            <input id=\"pesoRateio\" name=\"pesoRateio\"\r\n                                                class=\"form-control form-control-sm\" type=\"text\" currencyMask\r\n                                                [(ngModel)]=\"service.descargasFerroviariasNota.pesoRateio\" required\r\n                                                [options]=\"funcoesService.optionCurrency(0)\"\r\n                                                [disabled]=\"funcoesService.isDetail(actionForm)\"\r\n                                                (blur)=\"validation.validarIntegracaoNFCompra()\">\r\n                                        </div>\r\n                                    </div>\r\n                                    <div class=\"col-lg-3 col-md-3 col-sm-12\">\r\n                                        <div class=\"form-group form-group-sm\">\r\n                                            <label for=\"frete\">{{'labels.frete' | translate}}</label>\r\n                                            <select id=\"frete\" name=\"frete\" class=\"form-control form-control-sm\"\r\n                                                [(ngModel)]=\"service.descargasFerroviariasNota.tipoFrete\"\r\n                                                [disabled]=\"funcoesService.isDetail(actionForm)\">\r\n                                                <option value=\"\">{{ 'labels.selecione' | translate}}</option>\r\n                                                <option value=\"0\">{{ 'labels.semFrete' | translate}}</option>\r\n                                                <option value=\"1\">{{ 'labels.emitenteCif' | translate}}</option>\r\n                                                <option value=\"2\">{{ 'labels.destRemFob' | translate}}</option>\r\n                                                <option value=\"3\">{{ 'labels.terceiros' | translate}}</option>\r\n                                            </select>\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                                <div class=\"row\">\r\n                                    <div class=\"col-lg-4 col-md-4 col-sm-12\">\r\n                                        <div class=\"form-group form-group-sm\">\r\n                                            <label for=\"notaOrigem\">{{'labels.notaOrigem' |\r\n                                                translate}}</label>\r\n                                            <input id=\"notaOrigem\" name=\"notaOrigem\"\r\n                                                class=\"form-control form-control-sm\" type=\"text\" currencyMask\r\n                                                [(ngModel)]=\"service.descargasFerroviariasNota.notaOrigem\"\r\n                                                [options]=\"funcoesService.optionCurrency(0)\"\r\n                                                [disabled]=\"funcoesService.isDetail(actionForm)\">\r\n                                        </div>\r\n                                    </div>\r\n                                    <div class=\"col-lg-3 col-md-3 col-sm-12 mt-4\" *ngIf=\"isNotaComplementar\">\r\n                                        <div class=\"form-group form-group-sm\">\r\n                                            <input id=\"notaComplementar\" name=\"notaComplementar\"\r\n                                                class=\"custom-control-input\">\r\n                                            <label for=\"notaComplementar\" style=\"color: red;\">\r\n                                                {{ 'labels.notaComplementar' | translate }}\r\n                                            </label>\r\n                                        </div>\r\n                                    </div>\r\n                                    <div class=\"col-lg-4 col-md-4 col-md-12 mt-4\"\r\n                                        *ngIf=\"service.descargasFerroviariasNota.flagIntegra === 'S'\">\r\n                                        <div class=\"custom-control custom-checkbox\">\r\n                                            <input id=\"integraNfCompra\" name=\"integraNfCompra\"\r\n                                                [ngModel]=\"service.descargasFerroviariasNota.flagIntegra === 'S'\"\r\n                                                class=\"custom-control-input checkbox-success\" type=\"checkbox\" disabled>\r\n                                            <label class=\"custom-control-label\" for=\"integraNfCompra\">\r\n                                                {{ 'labels.integraNfCompra' | translate }}\r\n                                            </label>\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                                <div class=\"row\">\r\n                                    <div class=\"col-lg-12 col-md-12 col-sm-12\">\r\n                                        <div class=\"form-group form-group-sm\">\r\n                                            <label for=\"lacresAmostra\">{{'labels.lacresAmostra' | translate}}</label>\r\n                                            <input id=\"lacresAmostra\" name=\"lacresAmostra\"\r\n                                                class=\"form-control form-control-sm\" type=\"text\"\r\n                                                [(ngModel)]=\"service.descargasFerroviariasNota.lacreAmostra\"\r\n                                                [disabled]=\"funcoesService.isDetail(actionForm)\">\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                                <div class=\"row\">\r\n                                    <div class=\"col-lg-12 col-md-12 col-sm-12\">\r\n                                        <div class=\"form-group form-group-sm\">\r\n                                            <label for=\"observacoes\">{{'labels.observacoes' | translate}}</label>\r\n                                            <input id=\"observacoes\" name=\"observacoes\"\r\n                                                class=\"form-control form-control-sm\" type=\"text\"\r\n                                                [(ngModel)]=\"service.descargasFerroviariasNota.observ\"\r\n                                                [disabled]=\"funcoesService.isDetail(actionForm)\">\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                            <div class=\"col-lg-4 col-md-6 col-sm-12\" *ngIf=\"service.configs.infPesoFob\">\r\n                                <fieldset>\r\n                                    <legend>{{ \"labels.pesoFOB\" | translate }}</legend>\r\n                                    <div class=\"form-group form-group-sm\">\r\n                                        <label for=\"pesoBruFob\">{{'labels.pesoBru' | translate}}</label>\r\n                                        <input id=\"pesoBruFob\" name=\"pesoBruFob\" class=\"form-control form-control-sm\"\r\n                                            type=\"text\" currencyMask\r\n                                            [(ngModel)]=\"service.descargasFerroviariasNota.pesoBruFob\"\r\n                                            [options]=\"funcoesService.optionCurrency(0)\"\r\n                                            [disabled]=\"funcoesService.isDetail(actionForm)\">\r\n                                    </div>\r\n                                    <div class=\"form-group form-group-sm\">\r\n                                        <label for=\"pesoTaraFob\">{{'labels.pesoTara' | translate}}</label>\r\n                                        <input id=\"pesoTaraFob\" name=\"pesoTaraFob\" class=\"form-control form-control-sm\"\r\n                                            type=\"text\" currencyMask \r\n                                            [(ngModel)]=\"service.descargasFerroviariasNota.pesoTaraFob\"\r\n                                            [options]=\"funcoesService.optionCurrency(0)\"\r\n                                            [disabled]=\"funcoesService.isDetail(actionForm)\">\r\n                                    </div>\r\n                                    <div class=\"form-group form-group-sm\">\r\n                                        <label for=\"pesoLiqFob\"\r\n                                            [class.required]=\"service.configs.infPesoFob\">{{'labels.pesoLiq' |\r\n                                            translate}}</label>\r\n                                        <input id=\"pesoLiqFob\" name=\"pesoLiqFob\" class=\"form-control form-control-sm\"\r\n                                            type=\"text\" currencyMask [required]=\"service.configs.infPesoFob\"\r\n                                            [(ngModel)]=\"service.descargasFerroviariasNota.pesoLiqFob\"\r\n                                            [options]=\"funcoesService.optionCurrency(0)\"\r\n                                            [disabled]=\"funcoesService.isDetail(actionForm)\">\r\n                                    </div>\r\n                                    <div class=\"row\">\r\n                                        <div class=\"col-lg-6 col-md-6 col-sm-12\">\r\n                                            <div class=\"form-group form-group-sm\">\r\n                                                <label for=\"cfop\"\r\n                                                    [class.required]=\"service.configs.infPesoFob\">{{'labels.cfop' |\r\n                                                    translate}}</label>\r\n                                                <app-pesquisa-natureza id=\"cfop\" name=\"cfop\" flagVeiculo=\"S\"\r\n                                                    [required]=\"service.configs.infPesoFob\"\r\n                                                    [(ngModel)]=\"service.descargasFerroviariasNota.naturezaId\"\r\n                                                    [disabled]=\"funcoesService.isDetail(actionForm)\">\r\n                                                </app-pesquisa-natureza>\r\n                                            </div>\r\n                                        </div>\r\n                                    </div>\r\n                                    <div class=\"form-group form-group-sm\">\r\n                                        <label for=\"metrofile\">{{'labels.metrofile' | translate}}</label>\r\n                                        <input id=\"metrofile\" name=\"metrofile\" class=\"form-control form-control-sm\"\r\n                                            type=\"text\" [(ngModel)]=\"service.descargasFerroviariasNota.metrofile\"\r\n                                            [disabled]=\"funcoesService.isDetail(actionForm)\">\r\n                                    </div>\r\n                                    <div class=\"form-group form-group-sm\">\r\n                                        <label for=\"contrato\">{{'labels.contrato' | translate}}</label>\r\n                                        <input id=\"contrato\" name=\"contrato\" class=\"form-control form-control-sm\"\r\n                                            type=\"text\" [(ngModel)]=\"service.descargasFerroviariasNota.contrato\"\r\n                                            [disabled]=\"funcoesService.isDetail(actionForm)\">\r\n                                    </div>\r\n                                </fieldset>\r\n                            </div>\r\n                        </div>\r\n\r\n                        <div class=\"row\">\r\n                            <div class=\"col-sm-12\">\r\n                                <div class=\"form-group\">\r\n                                    <button class=\"btn btn-success mr-2\" type=\"submit\"\r\n                                        [disabled]=\"funcoesService.isDetail(actionForm)\">\r\n                                        {{ 'buttons.salvar' | translate }}\r\n                                    </button>\r\n                                    <button class=\"btn btn-default\" type=\"button\"\r\n                                        [disabled]=\"funcoesService.isDetail(actionForm)\" (click)=\"back()\">\r\n                                        {{ 'buttons.cancelar' | translate }}\r\n                                    </button>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </form>\r\n</div>");

/***/ }),

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-laudo/descargas-ferroviarias-laudo.component.html":
/*!*********************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-laudo/descargas-ferroviarias-laudo.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=\"descfer-primeira-pesagem-dialog\" tabindex=\"-1\" role=\"dialog\" data-backdrop=\"static\">\r\n    <div class=\"modal-dialog\">\r\n        <div class=\"modal-content\">\r\n            <div class=\"modal-header\">\r\n                <h6 class=\"modal-title\">{{'titles.descargasFerroviarias' | translate}} ( {{'labels.diferencaPeso' |\r\n                    translate}} )</h6>\r\n            </div>\r\n            <form class=\"form\" #formDescFer=\"ngForm\">\r\n                <div class=\"modal-body\">\r\n                    <app-validacoes formErrorId=\"formErrorFer\"></app-validacoes>\r\n                    <div class=\"row\">\r\n                        <div class=\"col-12\">\r\n                            <label><strong>{{'labels.atencao' | translate}}</strong></label>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"row\">\r\n                        <div class=\"col-12\">\r\n                            <label *ngIf=\"laudoPorDifPeso?.modo === 1\">{{'labels.diferencaDePesoBrutoSuperiorA' |\r\n                                translate}}:\r\n                                <strong>{{laudoPorDifPeso?.confDif}}\r\n                                    Kg</strong></label>\r\n                            <label *ngIf=\"laudoPorDifPeso?.modo === 2\">{{'labels.diferencaDePesoBrutoSuperiorA' |\r\n                                translate}}:\r\n                                <strong>{{laudoPorDifPeso?.confDif}}\r\n                                    %</strong></label>\r\n                            <label *ngIf=\"laudoPorDifPeso?.modo === 3\">{{'labels.diferencaDePesoBrutoSuperiorA' |\r\n                                translate}}:\r\n                                <strong>{{laudoPorDifPeso?.confDif}}\r\n                                    Kg</strong></label>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"row\">\r\n                        <div class=\"col-12\">\r\n                            <label *ngIf=\"laudoPorDifPeso?.modo === 1\">{{'labels.diferenca' | translate}}:\r\n                                <strong>{{laudoPorDifPeso?.diferenca}}\r\n                                    Kg</strong></label>\r\n                            <label *ngIf=\"laudoPorDifPeso?.modo === 2\">{{'labels.diferenca' | translate}}:\r\n                                <strong>{{laudoPorDifPeso?.diferenca}}\r\n                                    Kg</strong></label>\r\n                            <label *ngIf=\"laudoPorDifPeso?.modo === 3\">{{'labels.sobraDeKg' | translate }}:\r\n                                <strong>{{laudoPorDifPeso?.diferenca}}\r\n                                    Kg</strong></label>\r\n                        </div>\r\n                    </div>\r\n                    <ng-container *ngIf=\"service.configs.flagObrigaAprov\">\r\n                        <app-card-container>\r\n                            <div class=\"row\">\r\n                                <div class=\"col-12\">\r\n                                    <label>{{'labels.sigaOsSeguintesProcedimentos' | translate}}</label>\r\n                                    <ul style=\"list-style: none\">\r\n                                        <li *ngFor=\"let p of laudoPorDifPeso?.procedimento\">{{p}}</li>\r\n                                    </ul>\r\n                                </div>\r\n                            </div>\r\n                            <div class=\"row\">\r\n                                <div class=\"col-6\">\r\n                                    <div class=\"form-group form-group-sm\">\r\n                                        <label for=\"responsavel\" class=\"required\">\r\n                                            {{\"labels.responsavel\" | translate }}\r\n                                        </label>\r\n                                        <input id=\"responsavel\" name=\"responsavel\" class=\"form-control form-control-sm\"\r\n                                            required [(ngModel)]=\"laudoPorDifPeso.responsavel\">\r\n                                    </div>\r\n                                </div>\r\n                                <div class=\"col-6\">\r\n                                    <div class=\"form-group form-group-sm\">\r\n                                        <label for=\"dataHora\" class=\"required\">\r\n                                            {{\"labels.dataHora\" | translate }}\r\n                                        </label>\r\n                                        <app-data-h-m id=\"dataHora\" name=\"dataHora\" required=\"true\"\r\n                                            [(ngModel)]=\"laudoPorDifPeso.dataHora\">\r\n                                        </app-data-h-m>\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                        </app-card-container>\r\n                    </ng-container>\r\n                </div>\r\n                <div class=\"modal-footer\">\r\n                    <button class=\"btn btn-success mr-1\" type=\"button\" (click)=\"confirmaLaudoDifPeso(formDescFer)\">{{\r\n                        'buttons.ok'\r\n                        | translate }}\r\n                    </button>\r\n                    <button type=\"button\" class=\"btn btn-default\" (click)=\"cancelaLaudoDifPeso()\">{{\r\n                        'buttons.cancelar' | 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/balanca/descargas-ferroviarias/descargas-ferroviarias-liberar-retorno/descargas-ferroviarias-liberar-retorno.component.html":
/*!*****************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-liberar-retorno/descargas-ferroviarias-liberar-retorno.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=\"descargas-liberar-retorno-dialog\" tabindex=\"-1\" role=\"dialog\" data-backdrop=\"static\">\r\n    <div class=\"modal-dialog modal-md\">\r\n        <div class=\"modal-content\">\r\n            <div class=\"modal-header\">\r\n                <h6 class=\"modal-title\">{{ 'titles.liberacaoDeRetorno' | translate }}</h6>\r\n            </div>\r\n            <form class=\"form\" #form=\"ngForm\" (ngSubmit)=\"onSubmit(form)\">\r\n                <app-validacoes></app-validacoes>\r\n                <div class=\"modal-body\">\r\n                    <div class=\"row\">\r\n                        <div class=\"col-lg-6 col-md-6 col-sm-12\">\r\n                            <div class=\"form-group form-group-sm\">\r\n                                <label for=\"pesoBru\">{{'labels.pesoBru' | translate}}</label>\r\n                                <input id=\"pesoBru\" name=\"pesoBru\" class=\"form-control form-control-sm\" type=\"text\"\r\n                                    disabled currencyMask [(ngModel)]=\"data.pesoBru\"\r\n                                    [options]=\"funcoesService.optionCurrency(0)\">\r\n                            </div>\r\n                        </div>\r\n                        <div class=\"col-lg-6 col-md-6 col-sm-12\">\r\n                            <div class=\"form-group form-group-sm\">\r\n                                <label for=\"diferenca\">{{'labels.diferenca' | translate}}</label>\r\n                                <div class=\"input-group\">\r\n                                    <input id=\"diferenca\" name=\"diferenca\" class=\"form-control form-control-sm\"\r\n                                        type=\"text\" disabled currencyMask [(ngModel)]=\"data.diferenca\"\r\n                                        [options]=\"funcoesService.optionCurrency(0)\">\r\n                                    <label class=\"mt-1 ml-3 text-danger\" *ngIf=\"!!labelStatus\">{{ labelStatus\r\n                                        }}</label>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"row\">\r\n                        <div class=\"col-lg-6 col-md-6 col-sm-12\">\r\n                            <div class=\"form-group form-group-sm\">\r\n                                <label for=\"pesoLiq\">{{'labels.pesoLiq' | translate}}</label>\r\n                                <input id=\"pesoLiq\" name=\"pesoLiq\" class=\"form-control form-control-sm\" type=\"text\"\r\n                                    disabled currencyMask [(ngModel)]=\"data.pesoLiq\"\r\n                                    [options]=\"funcoesService.optionCurrency(0)\">\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"row\">\r\n                        <div class=\"col-lg-6 col-md-6 col-sm-12\">\r\n                            <div class=\"form-group form-group-sm\">\r\n                                <label for=\"pesoTara\">{{'labels.pesoTara' | translate}}</label>\r\n                                <input id=\"pesoTara\" name=\"pesoTara\" class=\"form-control form-control-sm\"\r\n                                    style=\"background-color: yellow;\" type=\"text\" currencyMask disabled\r\n                                    [(ngModel)]=\"data.pesoTara\" [options]=\"funcoesService.optionCurrency(0)\">\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"row\">\r\n                        <div class=\"col-lg-12 col-md-12 col-sm-12\">\r\n                            <div class=\"form-group form-group-sm\">\r\n                                <label for=\"justificativaQuebra\"\r\n                                    [class.required]=\"!disabledQuebra\">{{'labels.justificativaQuebra' |\r\n                                    translate}}</label>\r\n                                <div class=\"input-group\">\r\n                                    <app-combo-padrao id=\"justificativaQuebra\" name=\"justificativaQuebra\"\r\n                                        [(ngModel)]=\"data.codMotivoQuebra\" tabela=\"MotivoQuebra\" chave=\"CodMotivoQuebra\"\r\n                                        descricao=\"DescrMotivoQuebra\" ativos=\"true\" [disabled]=\"disabledQuebra\"\r\n                                        [required]=\"!disabledQuebra\">\r\n                                    </app-combo-padrao>\r\n                                    <label class=\"mt-1 ml-3\" *ngIf=\"!!labelQuebra\">{{ labelQuebra }}</label>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"row\">\r\n                        <div class=\"col-lg-12 col-md-12 col-sm-12\">\r\n                            <div class=\"form-group form-group-sm\">\r\n                                <label for=\"justificativaDeatraso\"\r\n                                    [class.required]=\"requiredAtraso\">{{'labels.justificativaDeatraso' |\r\n                                    translate}}</label>\r\n                                <div class=\"input-group\">\r\n                                    <app-combo-padrao id=\"justificativaDeatraso\" name=\"justificativaDeatraso\"\r\n                                        [(ngModel)]=\"data.codMotivoAtraso\" tabela=\"MotivoAtraso\" chave=\"CodMotivoAtraso\"\r\n                                        descricao=\"DescrMotivoAtraso\" ativos=\"true\" [disabled]=\"!requiredAtraso\"\r\n                                        [required]=\"requiredAtraso\">\r\n                                    </app-combo-padrao>\r\n                                    <label class=\"mt-1 ml-3\" *ngIf=\"!!labeAtraso\">{{ labeAtraso }}</label>\r\n                                </div>\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.ok' | translate }}</button>\r\n                    <button class=\"btn btn-default\" type=\"button\" data-dismiss=\"modal\">{{ 'buttons.cancelar' |\r\n                        translate\r\n                        }}</button>\r\n                </div>\r\n            </form>\r\n        </div>\r\n    </div>\r\n</div>");

/***/ }),

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-motivo-pesagem/descargas-ferroviarias-motivo-pesagem.component.html":
/*!***************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-motivo-pesagem/descargas-ferroviarias-motivo-pesagem.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=\"descargas-motivo-pesagem-dialog\" tabindex=\"-1\" role=\"dialog\" data-backdrop=\"static\">\r\n    <div class=\"uni-modal-dialog-md-30\">\r\n        <div class=\"modal-content\">\r\n            <div class=\"modal-header\">\r\n                <h6 class=\"modal-title\">{{ 'titles.motivoCancelamento' | translate }}</h6>\r\n            </div>\r\n            <form class=\"form\" #form=\"ngForm\" (ngSubmit)=\"onSubmit(form)\">\r\n                <app-validacoes></app-validacoes>\r\n                <div class=\"modal-body\">\r\n                    <div class=\"row\">\r\n                        <div class=\"col-lg-12 col-md-12 col-sm-12\">\r\n                            <div class=\"form-group form-group-sm\">\r\n                                <label for=\"motivoExclusao\" class=\"required\">{{'labels.motivoExclusao' | translate}}</label>\r\n                                <input id=\"motivoExclusao\" name=\"motivoExclusao\"\r\n                                    class=\"form-control form-control-sm\"\r\n                                    type=\"text\"\r\n                                    [(ngModel)]=\"motivo\"\r\n                                    minlength=\"15\"\r\n                                    maxlength=\"250\"\r\n                                    required>\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.ok' | translate }}</button>\r\n                    <button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">cancelar</button>\r\n                </div>\r\n            </form>\r\n        </div>\r\n    </div>\r\n</div>\r\n");

/***/ }),

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-motivo/descargas-ferroviarias-motivo.component.html":
/*!***********************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-motivo/descargas-ferroviarias-motivo.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=\"descargas-ferroviarias-motivo-dialog\" tabindex=\"-1\" role=\"dialog\" data-backdrop=\"static\">\r\n    <div class=\"uni-modal-dialog-md-30\">\r\n        <div class=\"modal-content\">\r\n            <div class=\"modal-header\">\r\n                <h6 class=\"modal-title\">{{ 'titles.motivoDaExclusaoDeDescargaFerroviaria' | translate }}</h6>\r\n            </div>\r\n            <form class=\"form\" #form=\"ngForm\" (ngSubmit)=\"onSubmit(form)\">\r\n                <app-validacoes></app-validacoes>\r\n                <div class=\"modal-body\">\r\n                    <div class=\"row\">\r\n                        <div class=\"col-lg-12 col-md-12 col-sm-12\">\r\n                            <div class=\"form-group form-group-sm\">\r\n                                <label for=\"motivo\" class=\"required\">{{'labels.motivo' | translate}}</label>\r\n                                <input id=\"motivo\" name=\"motivo\"\r\n                                    class=\"form-control form-control-sm\"\r\n                                    type=\"text\"\r\n                                    [(ngModel)]=\"motivo\"\r\n                                    maxlength=\"250\"\r\n                                    required>\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.ok' | translate }}</button>\r\n                    <button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">cancelar</button>\r\n                </div>\r\n            </form>\r\n        </div>\r\n    </div>\r\n</div>\r\n");

/***/ }),

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-pesagem-para-retorno/descargas-ferroviarias-pesagem-para-retorno.component.html":
/*!***************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-pesagem-para-retorno/descargas-ferroviarias-pesagem-para-retorno.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=\"descargas-pesagem-para-retorno-dialog\" tabindex=\"-1\" role=\"dialog\" data-backdrop=\"static\">\r\n    <div class=\"modal-dialog modal-md\">\r\n        <div class=\"modal-content\">\r\n            <div class=\"modal-header\">\r\n                <h6 class=\"modal-title\">{{ 'titles.fechamentoParaRetorno' | translate }}</h6>\r\n            </div>\r\n            <form class=\"form\" #form=\"ngForm\" (ngSubmit)=\"onSubmit(form)\">\r\n                <app-validacoes></app-validacoes>\r\n                <div class=\"modal-body\">\r\n                    <div class=\"row\">\r\n                        <div class=\"col-lg-6 col-md-6 col-sm-12\">\r\n                            <div class=\"form-group form-group-sm\">\r\n                                <label [class.required]=\"service.configs.obrTernoDesc\">{{'labels.regTerno' |\r\n                                    translate}}</label>\r\n                                <app-combo-terno id=\"terno\" name=\"terno\" [(ngModel)]=\"data.ternoId\"\r\n                                    [required]=\"service.configs.obrTernoDesc\" [disabled]=\"false\"></app-combo-terno>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"row\">\r\n                        <div class=\"col-lg-12 col-md-12 col-sm-12\">\r\n                            <div class=\"form-group form-group-sm\">\r\n                                <label for=\"linhaPesagem\" class=\"required\">{{'labels.linhaPesagem' |\r\n                                    translate}}</label>\r\n                                <select id=\"linhaPesagem\" name=\"linhaPesagem\" class=\"form-control form-control-sm\"\r\n                                    data-title=\"{{ 'labels.linhaPesagem' | translate }}\" required=\"true\"\r\n                                    [disabled]=\"comboLinhasPesagem.length === 1\" [(ngModel)]=\"data.balancaFerroviariaId\"\r\n                                    (ngModelChange)=\"getBalancas()\">\r\n                                    <option value=\"\">{{ \"labels.selecione\" | translate }}</option>\r\n                                    <option *ngFor=\"let l of comboLinhasPesagem\" [value]=\"l.balancaFerroviariaId\">\r\n                                        {{ l.descrBalanca }}\r\n                                    </option>\r\n                                </select>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"row\">\r\n                        <div class=\"col-lg-12 col-md-12 col-sm-12\">\r\n                            <div class=\"form-group form-group-sm\">\r\n                                <label for=\"balanca\" [class.required]=\"requiredBalanca\">\r\n                                    {{ 'labels.balanca' | translate }}\r\n                                </label>\r\n                                <select id=\"balanca\" name=\"balanca\" class=\"form-control form-control-sm\"\r\n                                    data-title=\"{{ 'labels.balanca' | translate }}\" [required]=\"requiredBalanca\"\r\n                                    [disabled]=\"!enabledBalanca\" [(ngModel)]=\"data.balancaId\">\r\n                                    <option value=\"\">{{ \"labels.selecione\" | translate }}</option>\r\n                                    <option *ngFor=\"let l of comboBalancas\" [value]=\"l.balancaId\">\r\n                                        {{ l.descrBalanca }}\r\n                                    </option>\r\n                                </select>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"row\">\r\n                        <div class=\"col-lg-6 col-md-6 col-sm-12\">\r\n                            <div class=\"form-group form-group-sm\">\r\n                                <label for=\"pesoBru\">{{'labels.pesoBru' | translate}}</label>\r\n                                <input id=\"pesoBru\" name=\"pesoBru\" class=\"form-control form-control-sm\" type=\"text\"\r\n                                    disabled currencyMask [(ngModel)]=\"data.pesoBru\"\r\n                                    [options]=\"funcoesService.optionCurrency(0)\">\r\n                            </div>\r\n                        </div>\r\n                        <div class=\"col-lg-6 col-md-6 col-sm-12\">\r\n                            <div class=\"form-group form-group-sm\">\r\n                                <label for=\"diferenca\">{{'labels.diferenca' | translate}}</label>\r\n                                <div class=\"input-group\">\r\n                                    <input id=\"diferenca\" name=\"diferenca\" class=\"form-control form-control-sm\"\r\n                                        type=\"text\" disabled currencyMask [(ngModel)]=\"data.diferenca\"\r\n                                        [options]=\"funcoesService.optionCurrency(0)\">\r\n                                    <label class=\"mt-1 ml-3 text-danger\" *ngIf=\"!!labelStatus\">{{ labelStatus\r\n                                        }}</label>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"row\">\r\n                        <div class=\"col-lg-6 col-md-6 col-sm-12\">\r\n                            <div class=\"form-group form-group-sm\">\r\n                                <label for=\"pesoLiq\">{{'labels.pesoLiq' | translate}}</label>\r\n                                <input id=\"pesoLiq\" name=\"pesoLiq\" class=\"form-control form-control-sm\" type=\"text\"\r\n                                    disabled currencyMask [(ngModel)]=\"data.pesoLiq\"\r\n                                    [options]=\"funcoesService.optionCurrency(0)\">\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"row\">\r\n                        <div class=\"col-lg-6 col-md-6 col-sm-12\">\r\n                            <div class=\"form-group form-group-sm\">\r\n                                <label for=\"pesoTara\" class=\"required\">{{ \"labels.pesoTara\" | translate }}</label>\r\n                                <app-captura-peso id=\"pesoTara\" name=\"pesoTara\" [(ngModel)]=\"data.pesoTara\"\r\n                                    [balancaId]=\"data.balancaId\" (outSelected)=\"calcPeso($event)\"\r\n                                    (outBlur)=\"calcPeso($event)\" [required]=\"true\" [backgroundColor]=\"'yellow'\"\r\n                                    [disabledInput]=\"service.configs.pesagemAutomatica\" [disabledBtn]=\"disabledBtnPeso\"\r\n                                    [pesagemAutomatica]=\"service.configs.pesagemAutomatica\">\r\n                                </app-captura-peso>\r\n                            </div>\r\n                        </div>\r\n                        <div class=\"col-lg-6 col-md-6 col-sm-12 mt-4\">\r\n                            <div class=\"custom-control custom-checkbox\">\r\n                                <input id=\"devolucaoTotal\" name=\"devolucaoTotal\" [ngModel]=\"data.devolucaoTotal === 'S'\"\r\n                                    (ngModelChange)=\"data.devolucaoTotal=$event?'S':'N'\"\r\n                                    class=\"custom-control-input checkbox-success\" type=\"checkbox\"\r\n                                    [disabled]=\"disabledDevolucaoTotal\">\r\n                                <label class=\"custom-control-label\" for=\"devolucaoTotal\">{{'labels.devolucaoTotal' |\r\n                                    translate}}</label>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"row\">\r\n                        <div class=\"col-lg-12 col-md-12 col-sm-12\">\r\n                            <div class=\"form-group\">\r\n                                <label for=\"justificativa\"\r\n                                    [class.required]=\"justificativaRequired\">{{'labels.justificativa' |\r\n                                    translate}}</label>\r\n                                <input id=\"justificativa\" name=\"justificativa\" class=\"form-control form-control-sm\"\r\n                                    type=\"text\" [(ngModel)]=\"data.justificativa\" maxlength=\"70\"\r\n                                    [required]=\"justificativaRequired\">\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.ok' | translate }}</button>\r\n                    <button class=\"btn btn-default\" type=\"button\" data-dismiss=\"modal\">{{ 'buttons.cancelar' |\r\n                        translate\r\n                        }}</button>\r\n                </div>\r\n            </form>\r\n        </div>\r\n    </div>\r\n</div>");

/***/ }),

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-primeira-pesagem/descargas-ferroviarias-primeira-pesagem.component.html":
/*!*******************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-primeira-pesagem/descargas-ferroviarias-primeira-pesagem.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.listaPes\" [sisFormularioId]=\"constantes.sisFormularioId\">\r\n</app-menu-command-bar>\r\n\r\n<div class=\"section-comand-bar\">\r\n    <div class=\"row\">\r\n        <div class=\"col-lg-12\">\r\n            <app-form-legenda></app-form-legenda>\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-3 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"linhaPesagem\" class=\"required\">{{'labels.linhaPesagem' |\r\n                                translate}}</label>\r\n                            <select id=\"linhaPesagem\" name=\"linhaPesagem\" class=\"form-control form-control-sm\"\r\n                                data-title=\"{{ 'labels.linhaPesagem' | translate }}\" required\r\n                                [disabled]=\"comboLinhasPesagem.length === 1\" [(ngModel)]=\"data.balancaFerroviariaId\"\r\n                                (ngModelChange)=\"getBalancas()\">\r\n                                <option value=\"\">{{ \"labels.selecione\" | translate }}</option>\r\n                                <option *ngFor=\"let l of comboLinhasPesagem\" [value]=\"l.balancaFerroviariaId\">\r\n                                    {{ l.descrBalanca }}\r\n                                </option>\r\n                            </select>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"row\">\r\n                    <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"balanca\" [class.required]=\"requiredBalanca\">\r\n                                {{ 'labels.balanca' | translate }}\r\n                            </label>\r\n                            <select id=\"balanca\" name=\"balanca\" class=\"form-control form-control-sm\"\r\n                                data-title=\"{{ 'labels.balanca' | translate }}\" [required]=\"requiredBalanca\"\r\n                                [disabled]=\"!service.configs.selBalFerro\" [(ngModel)]=\"data.balancaId\">\r\n                                <option value=\"\">{{ \"labels.selecione\" | translate }}</option>\r\n                                <option *ngFor=\"let l of comboBalancas\" [value]=\"l.balancaId\">\r\n                                    {{ l.descrBalanca }}\r\n                                </option>\r\n                            </select>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"row\">\r\n                    <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"pesoBru\" class=\"required\">{{ \"labels.pesoBru\" | translate }}</label>\r\n                            <app-captura-peso id=\"pesoBru\" name=\"pesoBru\" [(ngModel)]=\"data.pesoBru\"\r\n                                [balancaId]=\"data.balancaId\" (outSelected)=\"getPeso($event)\" (outBlur)=\"getPeso($event)\"\r\n                                [required]=\"true\" [disabledInput]=\"service.configs.pesagemAutomatica\"\r\n                                [disabledBtn]=\"disabledBtnPeso\" [pesagemAutomatica]=\"service.configs.pesagemAutomatica\">\r\n                            </app-captura-peso>\r\n                        </div>\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                            <button class=\"btn btn-success mr-2\" type=\"submit\">{{ '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\r\n<app-descargas-ferroviarias-laudo (outConfirmaLaudoDifPeso)=\"confirmaLaudoDifPeso()\"\r\n    (outCancelaLaudoDifPeso)=\"cancelaLaudoDifPeso()\"></app-descargas-ferroviarias-laudo>\r\n<app-corrige-placa-ocr (outExecute)=\"confirmaOcr($event)\"></app-corrige-placa-ocr>");

/***/ }),

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-print-modal/descargas-ferroviarias-print-modal.component.html":
/*!*********************************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-print-modal/descargas-ferroviarias-print-modal.component.html ***!
  \*********************************************************************************************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("<div class=\"modal fade\" id=\"modalPrint\" tabindex=\"-1\" role=\"dialog\" data-backdrop=\"static\">\r\n\t<div class=\"modal-dialog modal-sm\">\r\n\t\t<div class=\"modal-content\">\r\n\t\t\t<form class=\"form\" #frmPrint=\"ngForm\" (ngSubmit)=\"onSubmit(frmPrint)\">\r\n\t\t\t\t<div class=\"modal-header\">\r\n\t\t\t\t\t<h4 class=\"modal-title\">{{ 'titles.imprimir' | translate }}</h4>\r\n\t\t\t\t\t<button type=\"button\" class=\"close\" aria-label=\"Close\" data-dismiss=\"modal\">\r\n\t\t\t\t\t\t<span aria-hidden=\"true\">&times;</span>\r\n\t\t\t\t\t</button>\r\n\t\t\t\t</div>\r\n\t\t\t\t<div class=\"modal-body\">\r\n\t\t\t\t\t<div class=\"row\">\r\n\t\t\t\t\t\t<div class=\"col-md-12\">\r\n\t\t\t\t\t\t\t<div class=\"form-group form-group-sm\">\r\n\t\t\t\t\t\t\t\t<label for=\"tipoImpressao\">{{'labels.tipoImpressao' | translate}}</label>\r\n\t\t\t\t\t\t\t\t<select id=\"tipoImpressao\" name=\"tipoImpressao\" class=\"form-control form-control-sm\"\r\n\t\t\t\t\t\t\t\t\t[(ngModel)]=\"tipoSelecionado\">\r\n\t\t\t\t\t\t\t\t\t<option *ngFor=\"let tipo of tiposImpressao\" [value]=\"tipo.value\">\r\n\t\t\t\t\t\t\t\t\t\t{{ tipo.label | translate }}\r\n\t\t\t\t\t\t\t\t\t</option>\r\n\t\t\t\t\t\t\t\t</select>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\t\t\t\t<div class=\"modal-footer\">\r\n\t\t\t\t\t<button type=\"submit\" class=\"btn btn-small btn-success\" [disabled]=\"tipoSelecionado == ''\">\r\n\t\t\t\t\t\t{{ 'buttons.ok' | translate }}\r\n\t\t\t\t\t</button>\r\n\t\t\t\t\t<button type=\"button\" class=\"btn btn-small btn-default\" data-dismiss=\"modal\">\r\n\t\t\t\t\t\t{{ 'buttons.cancelar' | translate }}\r\n\t\t\t\t\t</button>\r\n\t\t\t\t</div>\r\n\t\t\t</form>\r\n\t\t</div>\r\n\t</div>\r\n</div>");

/***/ }),

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-segunda-pesagem/descargas-ferroviarias-segunda-pesagem.component.html":
/*!*****************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-segunda-pesagem/descargas-ferroviarias-segunda-pesagem.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.listaPes\" [sisFormularioId]=\"constantes.sisFormularioId\">\r\n</app-menu-command-bar>\r\n\r\n<div class=\"row\">\r\n    <div class=\"col-md-12 col-lg-12\">\r\n        <div class=\"section-comand-bar\">\r\n            <div class=\"row\">\r\n                <div class=\"col-lg-12\">\r\n                    <app-form-legenda></app-form-legenda>\r\n                    <form class=\"form\" #f=\"ngForm\" (ngSubmit)=\"onSubmit(f)\">\r\n                        <app-validacoes></app-validacoes>\r\n                        <div class=\"row\">\r\n                            <div class=\"col-lg-4 col-md-6 col-sm-12\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <label for=\"oper\" [class.required]=\"service.configs.obrigaHrOperacao\">\r\n                                        {{'labels.operador' | translate}}\r\n                                    </label>\r\n                                    <input id=\"oper\" name=\"oper\" class=\"form-control form-control-sm\" type=\"text\"\r\n                                        data-title=\"{{'labels.operador' | translate}}\" autofocus\r\n                                        [required]=\"service.configs.obrigaHrOperacao\" [(ngModel)]=\"data.nomeOperPes\">\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class=\"row\">\r\n                            <div class=\"col-lg-4 col-md-6 col-sm-12\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <app-pesquisa-saldo-lote-deposito id=\"deposito\" name=\"deposito\" required=\"true\"\r\n                                        [label]=\"'deposito'\" [modalTitle]=\"'deposito'\" [field]=\"'tanqueId'\"\r\n                                        [options]=\"saldoDepositoOptions\" [(ngModel)]=\"data.tanqueId\">\r\n                                    </app-pesquisa-saldo-lote-deposito>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class=\"row\">\r\n                            <div class=\"col-lg-4 col-md-6 col-sm-12\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <label for=\"ternoId\" [class.required]=\"service.configs.obrTernoDesc\">\r\n                                        {{ 'labels.terno' | translate }}\r\n                                    </label>\r\n                                    <app-combo-terno id=\"ternoId\" name=\"ternoId\"\r\n                                        [required]=\"service.configs.obrTernoDesc\" [ativos]=\"true\"\r\n                                        [ordenarPorDescricao]=\"true\" [(ngModel)]=\"data.ternoId\">\r\n                                    </app-combo-terno>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class=\"row\">\r\n                            <div class=\"col-lg-4 col-md-6 col-sm-12\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <label for=\"linhaPesagem\" class=\"required\">{{'labels.linhaPesagem' |\r\n                                        translate}}</label>\r\n                                    <select id=\"linhaPesagem\" name=\"linhaPesagem\" class=\"form-control form-control-sm\"\r\n                                        data-title=\"{{ 'labels.linhaPesagem' | translate }}\" required=\"true\"\r\n                                        [disabled]=\"comboLinhasPesagem.length === 1\"\r\n                                        [(ngModel)]=\"data.balancaFerroviariaId\" (ngModelChange)=\"getBalancas()\">\r\n                                        <option value=\"0\">{{ \"labels.selecione\" | translate }}</option>\r\n                                        <option *ngFor=\"let l of comboLinhasPesagem\" [value]=\"l.balancaFerroviariaId\">\r\n                                            {{ l.descrBalanca }}\r\n                                        </option>\r\n                                    </select>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class=\"row\">\r\n                            <div class=\"col-lg-4 col-md-6 col-sm-12\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <label for=\"plataforma\" [class.required]=\"service.configs.obrigPlataformaVagao === 'S'\">{{'labels.plataforma' | translate}}</label>\r\n                                    <app-combo-plataforma id=\"plataforma\" name=\"plataforma\"\r\n                                        [required]=\"service.configs.obrigPlataformaVagao === 'S'\"\r\n                                        [(ngModel)]=\"data.plataformaId\"\r\n                                        [disabled]=\"funcoesService.isDetail(actionForm)\">\r\n                                    </app-combo-plataforma>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class=\"row\">\r\n                            <div class=\"col-lg-4 col-md-6 col-sm-12\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <label for=\"balanca\" [class.required]=\"requiredBalanca\">\r\n                                        {{ 'labels.balanca' | translate }}\r\n                                    </label>\r\n                                    <select id=\"balanca\" name=\"balanca\" class=\"form-control form-control-sm\"\r\n                                        data-title=\"{{ 'labels.balanca' | translate }}\" [required]=\"requiredBalanca\"\r\n                                        [disabled]=\"!service.configs.selBalFerro\" [(ngModel)]=\"data.balancaIdL\">\r\n                                        <option value=\"0\">{{ \"labels.selecione\" | translate }}</option>\r\n                                        <option *ngFor=\"let l of comboBalancas\" [value]=\"l.balancaId\">\r\n                                            {{ l.descrBalanca }}\r\n                                        </option>\r\n                                    </select>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class=\"row\">\r\n                            <div class=\"col-lg-2 col-md-3 col-sm-12\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <label for=\"pesoBru\" class=\"required\">{{'labels.pesoBru' | translate}}</label>\r\n                                    <input id=\"pesoBru\" name=\"pesoBru\" class=\"form-control form-control-sm\" type=\"text\"\r\n                                        disabled currencyMask required [(ngModel)]=\"data.pesoBru\"\r\n                                        [options]=\"funcoes.optionCurrency(0)\">\r\n                                </div>\r\n                            </div>\r\n                            <div class=\"col-lg-2 col-md-3 col-sm-12\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <label for=\"diferenca\">{{'labels.diferenca' | translate}}</label>\r\n                                    <div class=\"input-group\">\r\n                                        <input id=\"diferenca\" name=\"diferenca\" class=\"form-control form-control-sm\"\r\n                                            type=\"text\" disabled currencyMask [(ngModel)]=\"data.diferenca\"\r\n                                            [options]=\"funcoes.optionCurrency(0)\">\r\n                                        <label class=\"mt-1 ml-3 text-danger\" *ngIf=\"!!labelStatus\">{{ labelStatus\r\n                                            }}</label>\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class=\"row\">\r\n                            <div class=\"col-lg-2 col-md-3 col-sm-12\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <label for=\"pesoLiq\" class=\"required\">{{'labels.pesoLiq' | translate}}</label>\r\n                                    <input id=\"pesoLiq\" name=\"pesoLiq\" class=\"form-control form-control-sm\" type=\"text\"\r\n                                        disabled currencyMask required [(ngModel)]=\"data.pesoLiq\"\r\n                                        [options]=\"funcoes.optionCurrency(0)\">\r\n                                </div>\r\n                            </div>\r\n                            <div class=\"col-lg-2 col-md-3 col-sm-12\" *ngIf=\"service.configs.solConclLaudoSegPesF\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <fieldset style=\"padding: 2px 10px\">\r\n                                        <legend>{{'labels.conclusaoLaudo' | translate}}</legend>\r\n                                        <div class=\"d-flex\">\r\n                                            <div class=\"custom-control custom-radio\">\r\n                                                <input class=\"custom-control-input radio-success\" id=\"situacaoLaudo-d\"\r\n                                                    name=\"conclusaoLaudo\" [(ngModel)]=\"data.situacaoLaudo\" type=\"radio\"\r\n                                                    value=\"0\">\r\n                                                <label class=\"custom-control-label\" for=\"situacaoLaudo-d\">{{\r\n                                                    'labels.devido' |\r\n                                                    translate }}\r\n                                                </label>\r\n                                            </div>\r\n                                            <div class=\"custom-control custom-radio ml-3\">\r\n                                                <input class=\"custom-control-input radio-success\" id=\"situacaoLaudo-i\"\r\n                                                    name=\"conclusaoLaudo\" [(ngModel)]=\"data.situacaoLaudo\" type=\"radio\"\r\n                                                    value=\"1\">\r\n                                                <label class=\"custom-control-label\" for=\"situacaoLaudo-i\">{{\r\n                                                    'labels.indevido'\r\n                                                    | translate }}\r\n                                                </label>\r\n                                            </div>\r\n                                        </div>\r\n                                    </fieldset>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class=\"row\">\r\n                            <div class=\"col-lg-2\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <label for=\"pesoTara\" class=\"required\">{{ \"labels.pesoTara\" | translate }}</label>\r\n                                    <app-captura-peso id=\"pesoTara\" name=\"pesoTara\" [(ngModel)]=\"data.pesoTara\"\r\n                                        [balancaId]=\"data.balancaIdL\" (outSelected)=\"getPesoTara($event)\"\r\n                                        (outBlur)=\"getPesoTara($event)\" [required]=\"true\"\r\n                                        [disabledInput]=\"service.configs.pesagemAutomatica\"\r\n                                        [disabledBtn]=\"disabledBtnPeso\"\r\n                                        [pesagemAutomatica]=\"service.configs.pesagemAutomatica\">\r\n                                    </app-captura-peso>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class=\"row\">\r\n                            <div class=\"col-lg-4 col-md-6 col-sm-12\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <label for=\"justificativaQuebra\"\r\n                                        [class.required]=\"justQuebraRequired || justSobraRequired\">\r\n                                        {{ 'labels.justificativaQuebra' | translate }}\r\n                                    </label>\r\n                                    <div class=\"input-group\">\r\n                                        <app-combo-padrao id=\"justificativaQuebra\" name=\"justificativaQuebra\"\r\n                                            tabela=\"MotivoQuebra\" chave=\"CodMotivoQuebra\" descricao=\"DescrMotivoQuebra\"\r\n                                            ativos=\"true\" [(ngModel)]=\"data.motivoQuebraId\"\r\n                                            [disabled]=\"!justQuebraRequired && !justSobraRequired\"\r\n                                            [required]=\"justQuebraRequired || justSobraRequired\">\r\n                                        </app-combo-padrao>\r\n                                        <label class=\"mt-1 ml-3\" *ngIf=\"!!labelQuebra\">{{ labelQuebra }}</label>\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class=\"row\">\r\n                            <div class=\"col-lg-4 col-md-6 col-sm-12\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <label for=\"justificativaDeatraso\" [class.required]=\"justTrasoRequired\">\r\n                                        {{ 'labels.justificativaDeatraso' | translate }}\r\n                                    </label>\r\n                                    <div class=\"input-group\">\r\n                                        <app-combo-padrao id=\"justificativaDeatraso\" name=\"justificativaDeatraso\"\r\n                                            tabela=\"MotivoAtraso\" chave=\"CodMotivoAtraso\" descricao=\"DescrMotivoAtraso\"\r\n                                            ativos=\"true\" [(ngModel)]=\"data.motivoAtrasoId\"\r\n                                            [disabled]=\"!justTrasoRequired\" [required]=\"justTrasoRequired\">\r\n                                        </app-combo-padrao>\r\n                                        <label class=\"mt-1 ml-3\" *ngIf=\"!!labelAtraso\">{{ labelAtraso }}</label>\r\n                                    </div>\r\n                                </div>\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                                    <button class=\"btn btn-success mr-2\" type=\"submit\">\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</div>");

/***/ }),

/***/ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-afericao-balanca/descargas-ferroviarias-afericao-balanca.component.ts":
/*!***************************************************************************************************************************************************!*\
  !*** ./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-afericao-balanca/descargas-ferroviarias-afericao-balanca.component.ts ***!
  \***************************************************************************************************************************************************/
/*! exports provided: DescargasFerroviariasAfericaoBalancaComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DescargasFerroviariasAfericaoBalancaComponent", function() { return DescargasFerroviariasAfericaoBalancaComponent; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/fesm5/router.js");
/* harmony import */ var app_pages_cadastro_balanca_ferroviaria_balanca_ferroviaria_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! app/pages/cadastro/balanca-ferroviaria/balanca-ferroviaria.service */ "./src/app/pages/cadastro/balanca-ferroviaria/balanca-ferroviaria.service.ts");
/* harmony import */ var app_pages_cadastro_balanca_balanca_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! app/pages/cadastro/balanca/balanca.service */ "./src/app/pages/cadastro/balanca/balanca.service.ts");
/* harmony import */ var app_shared_components_corporate_base_base_permissoes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! app/shared/components/corporate/base/base.permissoes */ "./src/app/shared/components/corporate/base/base.permissoes.ts");
/* harmony import */ var _shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../../shared/services/funcoes/configuracao/configuracao.facade */ "./src/app/shared/services/funcoes/configuracao/configuracao.facade.ts");
/* harmony import */ var _descargas_ferroviarias_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../descargas-ferroviarias.constants */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.constants.ts");
/* harmony import */ var _descargas_ferroviarias_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../descargas-ferroviarias.service */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.service.ts");
/* harmony import */ var _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./../../../../shared/services/funcoes/funcoes.service */ "./src/app/shared/services/funcoes/funcoes.service.ts");
/* harmony import */ var _shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./../../../../shared/services/funcoes/number-utils/number-utils.static.service */ "./src/app/shared/services/funcoes/number-utils/number-utils.static.service.ts");
/* harmony import */ var _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./../../../../shared/services/funcoes/permissoes-utils/permissoes-utils.service */ "./src/app/shared/services/funcoes/permissoes-utils/permissoes-utils.service.ts");
/* harmony import */ var _descargas_ferroviarias_afericao_balanca_model__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./descargas-ferroviarias-afericao-balanca.model */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-afericao-balanca/descargas-ferroviarias-afericao-balanca.model.ts");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (undefined && undefined.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
    function verb(n) { return function (v) { return step([n, v]); }; }
    function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (_) try {
            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
            if (y = 0, t) op = [op[0] & 2, t.value];
            switch (op[0]) {
                case 0: case 1: t = op; break;
                case 4: _.label++; return { value: op[1], done: false };
                case 5: _.label++; y = op[1]; op = [0]; continue;
                case 7: op = _.ops.pop(); _.trys.pop(); continue;
                default:
                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                    if (t[2]) _.ops.pop();
                    _.trys.pop(); continue;
            }
            op = body.call(thisArg, _);
        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
    }
};
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};












var DescargasFerroviariasAfericaoBalancaComponent = /** @class */ (function (_super) {
    __extends(DescargasFerroviariasAfericaoBalancaComponent, _super);
    function DescargasFerroviariasAfericaoBalancaComponent(configuracao, balancaFerroviariaService, balancaService, router, activatedRoute, funcoes, service, permissoesUtils) {
        var _this = _super.call(this, new _descargas_ferroviarias_constants__WEBPACK_IMPORTED_MODULE_6__["DescargasFerroviariasConstants"](), funcoes) || this;
        _this.configuracao = configuracao;
        _this.balancaFerroviariaService = balancaFerroviariaService;
        _this.balancaService = balancaService;
        _this.router = router;
        _this.activatedRoute = activatedRoute;
        _this.funcoes = funcoes;
        _this.service = service;
        _this.permissoesUtils = permissoesUtils;
        _this.data = new _descargas_ferroviarias_afericao_balanca_model__WEBPACK_IMPORTED_MODULE_11__["DescargasFerroviariasAfericaoBalanca"]();
        _this.constantes = new _descargas_ferroviarias_constants__WEBPACK_IMPORTED_MODULE_6__["DescargasFerroviariasConstants"]();
        _this.mensagens = [];
        _this.comboLinhasPesagem = [];
        _this.comboBalancas = [];
        _this.disablePeso = true;
        _this.balancaFerroviariaRequired = false;
        _this.pageRoute = "/balanca/descargasFerroviarias";
        _this.target = _this.funcoes.getTargetLocation();
        _this.loadConfig = function () { return __awaiter(_this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                if (this.configuracao.isLoadConfig()) {
                    this.service.configs.blFerr = this.configuracao.string("BAL", "BlFerr" + this.configuracao.macAddress);
                    this.service.configs.pesagemAutomatica = this.configuracao.boolean("BAL", "PesagemAutomatica");
                    this.service.configs.selBalFerro = this.configuracao.boolean("BAL", "SelBalFerro");
                    this.service.configs.bloqueiaAut = this.configuracao.boolean("BAL", "BloqueiaAut");
                    console.log(this.service.configs.selBalFerro);
                    this.getLinhasPesagem();
                }
                return [2 /*return*/];
            });
        }); };
        router.events.subscribe(function (event) {
            var params = _this.funcoes.formParams.getParams(router, event);
            if (params) {
                _this.actionForm = params.action;
            }
        });
        return _this;
    }
    DescargasFerroviariasAfericaoBalancaComponent.prototype.ngOnInit = function () {
        var _this = this;
        this.permissoesUtils.validRotina(this.constantes.sisFormularioId, 16, function () { return __awaiter(_this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                this.getConfig();
                return [2 /*return*/];
            });
        }); }, function () {
            _this.permissoesUtils.back();
        });
    };
    DescargasFerroviariasAfericaoBalancaComponent.prototype.getConfig = function () {
        var _this = this;
        this.constantes.listaParam.map(function (c) {
            if (c.sistema === 'BAL') {
                c.parametros.push("BlFerr" + _this.configuracao.macAddress);
            }
        });
        this.configuracao.getConfig({ codRotina: this.constantes.sisFormularioId, configs: this.constantes.listaParam }, this.loadConfig);
    };
    DescargasFerroviariasAfericaoBalancaComponent.prototype.getLinhasPesagem = function () {
        var _this = this;
        this.balancaFerroviariaService.getLinhasPesagem(this.service.configs.blFerr).subscribe(function (resp) {
            _this.comboLinhasPesagem = resp;
            if (_this.comboLinhasPesagem.length === 1) {
                _this.data.balancaFerroviariaId = _this.comboLinhasPesagem[0].balancaFerroviariaId;
            }
            if (_this.comboLinhasPesagem.length === 1) {
                _this.balancaFerroviariaRequired = true;
            }
            else {
                _this.balancaFerroviariaRequired = false;
            }
            _this.isPesoDisabled();
        });
    };
    DescargasFerroviariasAfericaoBalancaComponent.prototype.getBalancas = function () {
        var _this = this;
        this.balancaService.getBalancasFerroviarias(this.data.balancaFerroviariaId.toString()).subscribe(function (resp) {
            _this.comboBalancas = resp;
            _this.isPesoDisabled();
        });
    };
    DescargasFerroviariasAfericaoBalancaComponent.prototype.getPeso = function (resp) {
        if (_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_9__["NumberUtilsStaticService"].isNotPositive(resp.peso)) {
            this.data.peso = undefined;
            return;
        }
        this.data.peso = resp.peso;
    };
    DescargasFerroviariasAfericaoBalancaComponent.prototype.back = function () {
        this.funcoesService.desabilitarFiltro();
        this.router.navigate(["" + this.target + this.pageRoute]);
    };
    DescargasFerroviariasAfericaoBalancaComponent.prototype.isPesoDisabled = function () {
        this.disablePeso = _shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_9__["NumberUtilsStaticService"].isNotPositive(this.data.balancaFerroviariaId) || _shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_9__["NumberUtilsStaticService"].isNotPositive(this.data.balancaId);
    };
    DescargasFerroviariasAfericaoBalancaComponent.ctorParameters = function () { return [
        { type: _shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_5__["ConfiguracaoFacade"] },
        { type: app_pages_cadastro_balanca_ferroviaria_balanca_ferroviaria_service__WEBPACK_IMPORTED_MODULE_2__["BalancaFerroviariaService"] },
        { type: app_pages_cadastro_balanca_balanca_service__WEBPACK_IMPORTED_MODULE_3__["BalancaService"] },
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"] },
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_1__["ActivatedRoute"] },
        { type: _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_8__["FuncoesService"] },
        { type: _descargas_ferroviarias_service__WEBPACK_IMPORTED_MODULE_7__["DescargasFerroviariasService"] },
        { type: _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_10__["PermissoesUtilsService"] }
    ]; };
    DescargasFerroviariasAfericaoBalancaComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
            selector: "app-descargas-ferroviarias-afericao-balanca",
            template: __importDefault(__webpack_require__(/*! raw-loader!./descargas-ferroviarias-afericao-balanca.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-afericao-balanca/descargas-ferroviarias-afericao-balanca.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_5__["ConfiguracaoFacade"],
            app_pages_cadastro_balanca_ferroviaria_balanca_ferroviaria_service__WEBPACK_IMPORTED_MODULE_2__["BalancaFerroviariaService"],
            app_pages_cadastro_balanca_balanca_service__WEBPACK_IMPORTED_MODULE_3__["BalancaService"],
            _angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"],
            _angular_router__WEBPACK_IMPORTED_MODULE_1__["ActivatedRoute"],
            _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_8__["FuncoesService"],
            _descargas_ferroviarias_service__WEBPACK_IMPORTED_MODULE_7__["DescargasFerroviariasService"],
            _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_10__["PermissoesUtilsService"]])
    ], DescargasFerroviariasAfericaoBalancaComponent);
    return DescargasFerroviariasAfericaoBalancaComponent;
}(app_shared_components_corporate_base_base_permissoes__WEBPACK_IMPORTED_MODULE_4__["BasePermissoes"]));



/***/ }),

/***/ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-afericao-balanca/descargas-ferroviarias-afericao-balanca.model.ts":
/*!***********************************************************************************************************************************************!*\
  !*** ./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-afericao-balanca/descargas-ferroviarias-afericao-balanca.model.ts ***!
  \***********************************************************************************************************************************************/
/*! exports provided: DescargasFerroviariasAfericaoBalanca */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DescargasFerroviariasAfericaoBalanca", function() { return DescargasFerroviariasAfericaoBalanca; });
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};
var DescargasFerroviariasAfericaoBalanca = /** @class */ (function () {
    function DescargasFerroviariasAfericaoBalanca() {
        this.balancaFerroviariaId = 0;
        this.balancaId = 0;
        this.afericao = 1;
    }
    return DescargasFerroviariasAfericaoBalanca;
}());



/***/ }),

/***/ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-alterar-datas/descargas-ferroviarias-alterar-datas.component.ts":
/*!*********************************************************************************************************************************************!*\
  !*** ./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-alterar-datas/descargas-ferroviarias-alterar-datas.component.ts ***!
  \*********************************************************************************************************************************************/
/*! exports provided: DescargasFerroviariasAlterarDatasComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DescargasFerroviariasAlterarDatasComponent", function() { return DescargasFerroviariasAlterarDatasComponent; });
/* 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_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_1__ = __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_2__ = __webpack_require__(/*! app/shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_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_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_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");
/* harmony import */ var _descargas_ferroviarias_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../descargas-ferroviarias.service */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.service.ts");
/* harmony import */ var _descargas_ferroviarias_model__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../descargas-ferroviarias.model */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.model.ts");
/* harmony import */ var app_pages_cadastro_tipo_veiculo_tipo_veiculo_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! app/pages/cadastro/tipo-veiculo/tipo-veiculo.service */ "./src/app/pages/cadastro/tipo-veiculo/tipo-veiculo.service.ts");
/* harmony import */ var app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_9__ = __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_pages_veiculo_entrada_veiculo_entrada_veiculo_service__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! app/pages/veiculo/entrada-veiculo/entrada-veiculo.service */ "./src/app/pages/veiculo/entrada-veiculo/entrada-veiculo.service.ts");
/* harmony import */ var app_pages_veiculo_entrada_veiculo_entrada_veiculo_model__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! app/pages/veiculo/entrada-veiculo/entrada-veiculo.model */ "./src/app/pages/veiculo/entrada-veiculo/entrada-veiculo.model.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 DescargasFerroviariasAlterarDatasComponent = /** @class */ (function () {
    function DescargasFerroviariasAlterarDatasComponent(tipoVeiculoService, messageService, funcoesService, service, loginService, entradaVeiculoService) {
        this.tipoVeiculoService = tipoVeiculoService;
        this.messageService = messageService;
        this.funcoesService = funcoesService;
        this.service = service;
        this.loginService = loginService;
        this.entradaVeiculoService = entradaVeiculoService;
        this.data = new _descargas_ferroviarias_model__WEBPACK_IMPORTED_MODULE_7__["DescargasFerroviarias"]();
        this.entradaVeiculo = new app_pages_veiculo_entrada_veiculo_entrada_veiculo_model__WEBPACK_IMPORTED_MODULE_11__["EntradaVeiculo"]();
        this.disabledQuebra = true;
        this.disabledAtraso = true;
        this.labelAtraso = "";
        this.mensagens = [];
        this.executar = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
    }
    DescargasFerroviariasAlterarDatasComponent.prototype.objectSelect = function (opDescargaTremId) {
        var _this = this;
        this.service.getById(opDescargaTremId).subscribe(function (resp) {
            _this.data = resp;
            _this.trataJustQuebra();
            _this.trataJustAtraso();
            if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_9__["NumberUtilsStaticService"].isPositive(_this.data.entradaVeiculoId)) {
                _this.entradaVeiculoService.getById(_this.data.entradaVeiculoId).subscribe(function (result) {
                    _this.entradaVeiculo = result;
                    _this.data.codLocalOper = _this.entradaVeiculo.localOperacaoId;
                });
            }
        });
    };
    DescargasFerroviariasAlterarDatasComponent.prototype.onSubmit = function (form) {
        return __awaiter(this, void 0, void 0, function () {
            var _this = this;
            return __generator(this, function (_a) {
                app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_3__["EventEmitterService"].get("formError").emit(form);
                if (form.invalid) {
                    this.funcoesService.backToTop();
                    return [2 /*return*/];
                }
                if (!this.validarDatasInicioFimOperacao())
                    return [2 /*return*/];
                if (!this.validarDataSaida())
                    return [2 /*return*/];
                this.service.alterarDatas(this.data).subscribe(function (resp) {
                    if (!resp.isValid) {
                        var mensagens = _this.messageService.validationResult(resp);
                        mensagens.forEach(function (m) { return _this.messageService.warning("titles.descargasFerroviarias", m); });
                        return;
                    }
                    else {
                        jQuery("#descargas-alterar-datas-dialog").modal("hide");
                        _this.messageService.saveSuccess("titles.descargasFerroviarias");
                        _this.executar.emit();
                    }
                });
                return [2 /*return*/];
            });
        });
    };
    DescargasFerroviariasAlterarDatasComponent.prototype.trataJustQuebra = function () {
        this.disabledQuebra = this.service.configs.justDescarga || !(this.data.motivoQuebraId > 0);
    };
    DescargasFerroviariasAlterarDatasComponent.prototype.trataJustAtraso = function () {
        var _this = this;
        this.labelAtraso = "";
        if (!this.service.configs.justAtraso || !(this.data.motivoAtrasoId > 0)) {
            this.disabledAtraso = true;
            return;
        }
        if (!this.data.dtEntregaNF && !this.data.dtTriagem) {
            this.disabledAtraso = false;
            return;
        }
        if (!!this.data.dtEntregaNF) {
            if (!app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_5__["DateTimeUtilsStaticService"].isDate(this.data.dtTriagem) || app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_5__["DateTimeUtilsStaticService"].maiorA(this.data.dtEntregaNF, this.data.dtTriagem, ['H', 'M', 'S']))
                this.data.dtTriagem = this.data.dtEntregaNF;
            var difEntregaNF2Pes_1 = app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_5__["DateTimeUtilsStaticService"].getMinutes(this.data.dtEntregaNF, this.data.dtOper2Pes);
            this.tipoVeiculoService.getById(5).subscribe(function (tipoVeiculo) {
                if (tipoVeiculo != null && (difEntregaNF2Pes_1 > 0 && tipoVeiculo.tempoOperacao > 0)) {
                    _this.disabledAtraso = false;
                    _this.labelAtraso = difEntregaNF2Pes_1 + " min.";
                }
                else {
                    _this.disabledAtraso = true;
                    _this.labelAtraso = "";
                }
            });
        }
        else {
            this.disabledAtraso = false;
        }
    };
    DescargasFerroviariasAlterarDatasComponent.prototype.validarDatasInicioFimOperacao = function () {
        if (app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_5__["DateTimeUtilsStaticService"].maiorA(this.data.dtIniOper, this.data.dtFimOper, ['H', 'M', 'S'])) {
            this.messageService.warning("titles.descargasFerroviarias", "messages.finalDeOperacaoNaoPodeSerInferiorAoInicioOperacao");
            return false;
        }
        return true;
    };
    DescargasFerroviariasAlterarDatasComponent.prototype.validarDataSaida = function () {
        if (app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_5__["DateTimeUtilsStaticService"].menorA(this.data.dtSaida, this.data.dtOper1Pes, ['H', 'M', 'S'])) {
            this.messageService.warning("titles.descargasFerroviarias", "messages.saidaNaoPodeSerInferiorADtOper1Pes");
            return false;
        }
        return true;
    };
    DescargasFerroviariasAlterarDatasComponent.ctorParameters = function () { return [
        { type: app_pages_cadastro_tipo_veiculo_tipo_veiculo_service__WEBPACK_IMPORTED_MODULE_8__["TipoVeiculoService"] },
        { type: app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_2__["MessageService"] },
        { type: app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_1__["FuncoesService"] },
        { type: _descargas_ferroviarias_service__WEBPACK_IMPORTED_MODULE_6__["DescargasFerroviariasService"] },
        { type: app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_4__["LoginService"] },
        { type: app_pages_veiculo_entrada_veiculo_entrada_veiculo_service__WEBPACK_IMPORTED_MODULE_10__["EntradaVeiculoService"] }
    ]; };
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"])(),
        __metadata("design:type", Object)
    ], DescargasFerroviariasAlterarDatasComponent.prototype, "executar", void 0);
    DescargasFerroviariasAlterarDatasComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
            selector: "app-descargas-ferroviarias-alterar-datas",
            template: __importDefault(__webpack_require__(/*! raw-loader!./descargas-ferroviarias-alterar-datas.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-alterar-datas/descargas-ferroviarias-alterar-datas.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [app_pages_cadastro_tipo_veiculo_tipo_veiculo_service__WEBPACK_IMPORTED_MODULE_8__["TipoVeiculoService"],
            app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_2__["MessageService"],
            app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_1__["FuncoesService"],
            _descargas_ferroviarias_service__WEBPACK_IMPORTED_MODULE_6__["DescargasFerroviariasService"],
            app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_4__["LoginService"],
            app_pages_veiculo_entrada_veiculo_entrada_veiculo_service__WEBPACK_IMPORTED_MODULE_10__["EntradaVeiculoService"]])
    ], DescargasFerroviariasAlterarDatasComponent);
    return DescargasFerroviariasAlterarDatasComponent;
}());



/***/ }),

/***/ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-analise-origem/descargas-ferroviarias-analise-origem.component.ts":
/*!***********************************************************************************************************************************************!*\
  !*** ./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-analise-origem/descargas-ferroviarias-analise-origem.component.ts ***!
  \***********************************************************************************************************************************************/
/*! exports provided: DescargasFerroviariasAnaliseOrigemComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DescargasFerroviariasAnaliseOrigemComponent", function() { return DescargasFerroviariasAnaliseOrigemComponent; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/fesm5/router.js");
/* harmony import */ var app_shared_components_corporate_base_base_permissoes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! app/shared/components/corporate/base/base.permissoes */ "./src/app/shared/components/corporate/base/base.permissoes.ts");
/* harmony import */ var app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_3__ = __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 _descargas_ferroviarias_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../descargas-ferroviarias.constants */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.constants.ts");
/* harmony import */ var _descargas_ferroviarias_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../descargas-ferroviarias.service */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.service.ts");
/* harmony import */ var _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../../../../shared/services/event-emitter/event-emitter.service */ "./src/app/shared/services/event-emitter/event-emitter.service.ts");
/* harmony import */ var _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./../../../../shared/services/funcoes/funcoes.service */ "./src/app/shared/services/funcoes/funcoes.service.ts");
/* harmony import */ var _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./../../../../shared/services/funcoes/permissoes-utils/permissoes-utils.service */ "./src/app/shared/services/funcoes/permissoes-utils/permissoes-utils.service.ts");
/* harmony import */ var _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./../../../../shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var _descargas_ferroviarias_analise_origem_model__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./descargas-ferroviarias-analise-origem.model */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-analise-origem/descargas-ferroviarias-analise-origem.model.ts");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (undefined && undefined.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
    function verb(n) { return function (v) { return step([n, v]); }; }
    function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (_) try {
            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
            if (y = 0, t) op = [op[0] & 2, t.value];
            switch (op[0]) {
                case 0: case 1: t = op; break;
                case 4: _.label++; return { value: op[1], done: false };
                case 5: _.label++; y = op[1]; op = [0]; continue;
                case 7: op = _.ops.pop(); _.trys.pop(); continue;
                default:
                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                    if (t[2]) _.ops.pop();
                    _.trys.pop(); continue;
            }
            op = body.call(thisArg, _);
        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
    }
};
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};











var DescargasFerroviariasAnaliseOrigemComponent = /** @class */ (function (_super) {
    __extends(DescargasFerroviariasAnaliseOrigemComponent, _super);
    function DescargasFerroviariasAnaliseOrigemComponent(router, activatedRoute, funcoes, messageService, service, permissoesUtils) {
        var _this = _super.call(this, new _descargas_ferroviarias_constants__WEBPACK_IMPORTED_MODULE_4__["DescargasFerroviariasConstants"](), funcoes) || this;
        _this.router = router;
        _this.activatedRoute = activatedRoute;
        _this.funcoes = funcoes;
        _this.messageService = messageService;
        _this.service = service;
        _this.permissoesUtils = permissoesUtils;
        _this.dados = new _descargas_ferroviarias_analise_origem_model__WEBPACK_IMPORTED_MODULE_10__["DescargasFerroviariasAnaliseOrigemGrava"]();
        _this.constantes = new _descargas_ferroviarias_constants__WEBPACK_IMPORTED_MODULE_4__["DescargasFerroviariasConstants"]();
        _this.mensagens = [];
        _this.pageRoute = "/balanca/descargasFerroviarias";
        _this.target = _this.funcoes.getTargetLocation();
        router.events.subscribe(function (event) {
            var params = _this.funcoes.formParams.getParams(router, event);
            if (params) {
                _this.actionForm = params.action;
            }
        });
        return _this;
    }
    DescargasFerroviariasAnaliseOrigemComponent.prototype.ngOnInit = function () {
        var _this = this;
        this.permissoesUtils.validRotina(this.constantes.sisFormularioId, 12, function () { return __awaiter(_this, void 0, void 0, function () {
            var obj, object;
            return __generator(this, function (_a) {
                obj = this.activatedRoute.snapshot.paramMap.get("object");
                if (!obj) {
                    this.messageService.warning("titles.descargasFerroviarias", "message.nenhumRegistroEncontrado");
                    return [2 /*return*/];
                }
                object = JSON.parse(atob(obj));
                this.inicializarDados(object.opDescargaTremId, object.materialId);
                return [2 /*return*/];
            });
        }); }, function () {
            _this.permissoesUtils.back();
        });
    };
    DescargasFerroviariasAnaliseOrigemComponent.prototype.inicializarDados = function (opDescargaTremId, materialId) {
        var _this = this;
        this.service.getAnalisesOrigem(opDescargaTremId, materialId).subscribe(function (resp) {
            _this.dados.analisesOrigem = resp;
            _this.dados.opDescargaTremId = opDescargaTremId;
            if (!!resp && resp.length > 0) {
                _this.dados.observacao = resp.map(function (r) { return r.observacao; }).find(function (r) { return app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_3__["StringUtilsStaticService"].isNotEmpty(r); });
            }
        });
    };
    DescargasFerroviariasAnaliseOrigemComponent.prototype.onSubmit = function (form) {
        var _this = this;
        _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_6__["EventEmitterService"].get("formError").emit(form);
        if (form.invalid) {
            return;
        }
        this.service.gravarAnaliseOrigem(this.dados).subscribe(function (resp) {
            if (!resp.isValid) {
                _this.mensagens = _this.messageService.validationResult(resp);
                _this.messageService.warning("titles.descargasFerroviarias", _this.mensagens[0]);
            }
            else {
                _this.messageService.saveSuccess("titles.descargasFerroviarias");
                _this.back();
            }
        });
    };
    DescargasFerroviariasAnaliseOrigemComponent.prototype.back = function () {
        this.funcoesService.desabilitarFiltro();
        this.router.navigate(["" + this.target + this.pageRoute]);
    };
    DescargasFerroviariasAnaliseOrigemComponent.ctorParameters = function () { return [
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"] },
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_1__["ActivatedRoute"] },
        { type: _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_7__["FuncoesService"] },
        { type: _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_9__["MessageService"] },
        { type: _descargas_ferroviarias_service__WEBPACK_IMPORTED_MODULE_5__["DescargasFerroviariasService"] },
        { type: _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_8__["PermissoesUtilsService"] }
    ]; };
    DescargasFerroviariasAnaliseOrigemComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
            selector: "app-descargas-ferroviarias-analise-origem",
            template: __importDefault(__webpack_require__(/*! raw-loader!./descargas-ferroviarias-analise-origem.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-analise-origem/descargas-ferroviarias-analise-origem.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [_angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"],
            _angular_router__WEBPACK_IMPORTED_MODULE_1__["ActivatedRoute"],
            _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_7__["FuncoesService"],
            _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_9__["MessageService"],
            _descargas_ferroviarias_service__WEBPACK_IMPORTED_MODULE_5__["DescargasFerroviariasService"],
            _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_8__["PermissoesUtilsService"]])
    ], DescargasFerroviariasAnaliseOrigemComponent);
    return DescargasFerroviariasAnaliseOrigemComponent;
}(app_shared_components_corporate_base_base_permissoes__WEBPACK_IMPORTED_MODULE_2__["BasePermissoes"]));



/***/ }),

/***/ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-analise-origem/descargas-ferroviarias-analise-origem.model.ts":
/*!*******************************************************************************************************************************************!*\
  !*** ./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-analise-origem/descargas-ferroviarias-analise-origem.model.ts ***!
  \*******************************************************************************************************************************************/
/*! exports provided: DescargasFerroviariasAnaliseOrigem, DescargasFerroviariasAnaliseOrigemGrava */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DescargasFerroviariasAnaliseOrigem", function() { return DescargasFerroviariasAnaliseOrigem; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DescargasFerroviariasAnaliseOrigemGrava", function() { return DescargasFerroviariasAnaliseOrigemGrava; });
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};
var DescargasFerroviariasAnaliseOrigem = /** @class */ (function () {
    function DescargasFerroviariasAnaliseOrigem() {
    }
    return DescargasFerroviariasAnaliseOrigem;
}());

var DescargasFerroviariasAnaliseOrigemGrava = /** @class */ (function () {
    function DescargasFerroviariasAnaliseOrigemGrava() {
        this.analisesOrigem = [];
    }
    return DescargasFerroviariasAnaliseOrigemGrava;
}());



/***/ }),

/***/ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-campos-dinamicos/descargas-ferroviarias-campos-dinamicos.component.ts":
/*!***************************************************************************************************************************************************!*\
  !*** ./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-campos-dinamicos/descargas-ferroviarias-campos-dinamicos.component.ts ***!
  \***************************************************************************************************************************************************/
/*! exports provided: DescargasFerroviariasCamposDinamicosComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DescargasFerroviariasCamposDinamicosComponent", function() { return DescargasFerroviariasCamposDinamicosComponent; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/forms */ "./node_modules/@angular/forms/fesm5/forms.js");
/* harmony import */ var _cadastro_material_caract_material_caract_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../../../cadastro/material-caract/material-caract.service */ "./src/app/pages/cadastro/material-caract/material-caract.service.ts");
/* harmony import */ var _cadastro_material_caract_material_caract_model__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../../../cadastro/material-caract/material-caract.model */ "./src/app/pages/cadastro/material-caract/material-caract.model.ts");
/* harmony import */ var app_pages_cadastro_caract_tipica_refer_caract_tipica_refer_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! app/pages/cadastro/caract-tipica-refer/caract-tipica-refer.service */ "./src/app/pages/cadastro/caract-tipica-refer/caract-tipica-refer.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 DescargasFerroviariasCamposDinamicosComponent = /** @class */ (function () {
    function DescargasFerroviariasCamposDinamicosComponent(caractTipicaReferService, materialCaractService) {
        this.caractTipicaReferService = caractTipicaReferService;
        this.materialCaractService = materialCaractService;
        this.complementoCampos = new _cadastro_material_caract_material_caract_model__WEBPACK_IMPORTED_MODULE_3__["MaterialCaract"]();
        this.touched = false;
        this.onChange = function (_) {
            /*Empty*/
        };
        this.onTouched = function () {
            /*Empty*/
        };
    }
    DescargasFerroviariasCamposDinamicosComponent_1 = DescargasFerroviariasCamposDinamicosComponent;
    Object.defineProperty(DescargasFerroviariasCamposDinamicosComponent.prototype, "internalValue", {
        get: function () {
            return this._internalValue;
        },
        set: function (val) {
            if (val === undefined || val === null || val === "") {
                this._internalValue = "";
                this.onChange(undefined); // Value is rubbish, so don't send back to model propper
                return;
            }
            this._internalValue = val;
            this.onChange(this._internalValue); // Value is good!
        },
        enumerable: true,
        configurable: true
    });
    //////////////////////////////////
    // OnChanges interface
    //////////////////////////////////
    DescargasFerroviariasCamposDinamicosComponent.prototype.ngOnInit = function () {
        var _this = this;
        this.caractTipicaReferService
            .getByCaractTipicaId(this.campoDinamico.caractTipicaId)
            .subscribe(function (data) {
            _this.caractTipicaRefer = data;
            // buscando caracteristicas adicionais do material
            _this.materialCaractService
                .GetComplementoMaterial(_this.campoDinamico.materialId, _this.campoDinamico.caractTipicaId)
                .subscribe(function (compMat) {
                _this.complementoCampos = compMat;
            });
        });
    };
    //////////////////////////////////
    // ControlValueAccessor interface
    //////////////////////////////////
    DescargasFerroviariasCamposDinamicosComponent.prototype.writeValue = function (value) {
        if (value === undefined || value === null) {
            this.internalValue = "";
            return;
        }
        this.internalValue = value;
    };
    DescargasFerroviariasCamposDinamicosComponent.prototype.registerOnChange = function (fn) {
        this.onChange = fn;
    };
    DescargasFerroviariasCamposDinamicosComponent.prototype.registerOnTouched = function (fn) {
        var self = this;
        this.onTouched = function (arg) {
            self.touched = true;
            fn(arg);
        };
    };
    var DescargasFerroviariasCamposDinamicosComponent_1;
    DescargasFerroviariasCamposDinamicosComponent.ctorParameters = function () { return [
        { type: app_pages_cadastro_caract_tipica_refer_caract_tipica_refer_service__WEBPACK_IMPORTED_MODULE_4__["CaractTipicaReferService"] },
        { type: _cadastro_material_caract_material_caract_service__WEBPACK_IMPORTED_MODULE_2__["MaterialCaractService"] }
    ]; };
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"])(),
        __metadata("design:type", Object)
    ], DescargasFerroviariasCamposDinamicosComponent.prototype, "campoDinamico", void 0);
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"])(),
        __metadata("design:type", Object)
    ], DescargasFerroviariasCamposDinamicosComponent.prototype, "disabled", void 0);
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"])(),
        __metadata("design:type", Object)
    ], DescargasFerroviariasCamposDinamicosComponent.prototype, "exibeLegenda", void 0);
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"])(),
        __metadata("design:type", Object)
    ], DescargasFerroviariasCamposDinamicosComponent.prototype, "_internalValue", void 0);
    DescargasFerroviariasCamposDinamicosComponent = DescargasFerroviariasCamposDinamicosComponent_1 = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
            selector: "app-descargas-ferroviarias-campos-dinamicos",
            template: __importDefault(__webpack_require__(/*! raw-loader!./descargas-ferroviarias-campos-dinamicos.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-campos-dinamicos/descargas-ferroviarias-campos-dinamicos.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None,
            providers: [
                {
                    provide: _angular_forms__WEBPACK_IMPORTED_MODULE_1__["NG_VALUE_ACCESSOR"],
                    useExisting: Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["forwardRef"])(function () { return DescargasFerroviariasCamposDinamicosComponent_1; }),
                    multi: true
                }
            ]
        }),
        __metadata("design:paramtypes", [app_pages_cadastro_caract_tipica_refer_caract_tipica_refer_service__WEBPACK_IMPORTED_MODULE_4__["CaractTipicaReferService"],
            _cadastro_material_caract_material_caract_service__WEBPACK_IMPORTED_MODULE_2__["MaterialCaractService"]])
    ], DescargasFerroviariasCamposDinamicosComponent);
    return DescargasFerroviariasCamposDinamicosComponent;
}());



/***/ }),

/***/ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-confirmacao-chegada/descargas-ferroviarias-confirmacao-chegada.component.ts":
/*!*********************************************************************************************************************************************************!*\
  !*** ./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-confirmacao-chegada/descargas-ferroviarias-confirmacao-chegada.component.ts ***!
  \*********************************************************************************************************************************************************/
/*! exports provided: DescargasFerroviariasConfirmacaoChegadaComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DescargasFerroviariasConfirmacaoChegadaComponent", function() { return DescargasFerroviariasConfirmacaoChegadaComponent; });
/* 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_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_1__ = __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_pages_cadastro_destinatario_destinatario_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! app/pages/cadastro/destinatario/destinatario.service */ "./src/app/pages/cadastro/destinatario/destinatario.service.ts");
/* harmony import */ var app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! app/shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var app_shared_services_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_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! app/shared/services/funcoes/number-utils/number-utils.static.service */ "./src/app/shared/services/funcoes/number-utils/number-utils.static.service.ts");
/* harmony import */ var app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! app/shared/services/funcoes/string-utils/string-utils.static.service */ "./src/app/shared/services/funcoes/string-utils/string-utils.static.service.ts");
/* harmony import */ var _descargas_ferroviarias_confirmacao_chegada_model__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./descargas-ferroviarias-confirmacao-chegada.model */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-confirmacao-chegada/descargas-ferroviarias-confirmacao-chegada.model.ts");
/* harmony import */ var _descargas_ferroviarias_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../descargas-ferroviarias.service */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.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_funcoes_service__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! app/shared/services/funcoes/funcoes.service */ "./src/app/shared/services/funcoes/funcoes.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 DescargasFerroviariasConfirmacaoChegadaComponent = /** @class */ (function () {
    function DescargasFerroviariasConfirmacaoChegadaComponent(messageService, datatables, funcoesService, destinatarioService, service) {
        var _this = this;
        this.messageService = messageService;
        this.datatables = datatables;
        this.funcoesService = funcoesService;
        this.destinatarioService = destinatarioService;
        this.service = service;
        this.data = new _descargas_ferroviarias_confirmacao_chegada_model__WEBPACK_IMPORTED_MODULE_7__["DescargasFerroviariasConfirmacaoChegada"]();
        this.filtro = new _descargas_ferroviarias_confirmacao_chegada_model__WEBPACK_IMPORTED_MODULE_7__["DescargasFerroviariasConfirmacaoChegadaFilter"]();
        this.showFiltro = true;
        this.mensagens = [];
        this.confirmarChegada = function () {
            if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_5__["NumberUtilsStaticService"].isNotPositive(_this.data.regPlaneja)) {
                _this.messageService.warning("titles.descargasFerroviarias", "messages.selecioneUmRegistro");
                return;
            }
            if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_5__["NumberUtilsStaticService"].isNotPositive(_this.data.transportadora) && app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_6__["StringUtilsStaticService"].isEmpty(_this.data.cnpjTransp)) {
                _this.abrirCadastroTransportadora();
                return;
            }
            if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_5__["NumberUtilsStaticService"].isNotPositive(_this.data.codCliente) && app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_6__["StringUtilsStaticService"].isEmpty(_this.data.destVendCnpj)) {
                _this.abrirCadastroCliente();
                return;
            }
            Object(rxjs__WEBPACK_IMPORTED_MODULE_9__["forkJoin"])([_this.getTransportadora(), _this.getCliente()]).subscribe(function (resp) {
                if (resp) {
                    //Transportadora
                    if (resp[0]) {
                        _this.data.transportadora = resp[0].destinatarioId;
                        _this.data.cnpjTransp = resp[0].cgcCpf;
                        _this.data.nomeTransp = resp[0].razaoSocial;
                        //Cliente
                        if (resp[1]) {
                            _this.data.codCliente = resp[1].destinatarioId;
                            _this.data.destVendCnpj = resp[1].cgcCpf;
                            _this.data.destVendDescr = resp[1].razaoSocial;
                            _this.gravarConfirmacaoChegada();
                        }
                        else {
                            _this.abrirCadastroCliente();
                        }
                    }
                    else {
                        _this.abrirCadastroTransportadora();
                    }
                }
            });
        };
    }
    DescargasFerroviariasConfirmacaoChegadaComponent.prototype.ngOnInit = function () {
        this.showFiltro = true;
    };
    DescargasFerroviariasConfirmacaoChegadaComponent.prototype.onSubmit = function () {
        var _this = this;
        this.service.getChegadas(this.filtro).subscribe(function (data) {
            var columns = [
                _this.datatables.getDataString("tipoMov", "tipo"),
                _this.datatables.getDataString("tipoPlaneja", "operacao"),
                _this.datatables.getDataString("modal", "modal"),
                _this.datatables.getDataString("regPlaneja", "programacao"),
                _this.datatables.getDataString("requisicao", "requisicao"),
                _this.datatables.getDataString("sequencia", "sequencia"),
                _this.datatables.getDataDateTime("dtEmissao", "data", "DD/MM/YYYY"),
                _this.datatables.getDataString("cnpjTransp", "cnpjTransportadora"),
                _this.datatables.getDataString("nomeTransp", "transportadora"),
                _this.datatables.getDataString("placaCavalo", "numeroVagao")
            ];
            _this.showFiltro = !app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_1__["ArrayUtilsStaticService"].any(data);
            if (_this.showFiltro)
                return;
            setTimeout(function () {
                _this.datatables.toDataTable({ tableId: "dtChegada", columns: columns, data: data }, function (selected) { return _this.data = Object.assign({}, selected); });
            }, 250);
        });
    };
    DescargasFerroviariasConfirmacaoChegadaComponent.prototype.onShowFiltro = function () {
        this.data = new _descargas_ferroviarias_confirmacao_chegada_model__WEBPACK_IMPORTED_MODULE_7__["DescargasFerroviariasConfirmacaoChegada"]();
        this.showFiltro = !this.showFiltro;
    };
    DescargasFerroviariasConfirmacaoChegadaComponent.prototype.abrirCadastroTransportadora = function () {
        var _this = this;
        this.messageService.confirm("titles.descargasFerroviarias", "messages.desejaCadastrarTransportadora", null, function () { return _this.funcoesService.openWindow("cadastro/destinatario"); });
    };
    DescargasFerroviariasConfirmacaoChegadaComponent.prototype.abrirCadastroCliente = function () {
        var _this = this;
        this.messageService.confirm("titles.descargasFerroviarias", "messages.desejaCadastrarCliente", null, function () { return _this.funcoesService.openWindow("cadastro/destinatario"); });
    };
    DescargasFerroviariasConfirmacaoChegadaComponent.prototype.getTransportadora = function () {
        if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_5__["NumberUtilsStaticService"].isNotPositive(this.data.transportadora) && !app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_6__["StringUtilsStaticService"].isEmpty(this.data.cnpjTransp)) {
            return this.destinatarioService.getByCnpj(this.data.cnpjTransp);
        }
        else {
            return this.destinatarioService.getById(this.data.transportadora);
        }
    };
    DescargasFerroviariasConfirmacaoChegadaComponent.prototype.getCliente = function () {
        if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_5__["NumberUtilsStaticService"].isNotPositive(this.data.codCliente) && !app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_6__["StringUtilsStaticService"].isEmpty(this.data.destVendCnpj)) {
            return this.destinatarioService.getByCnpj(this.data.destVendCnpj);
        }
        else {
            return this.destinatarioService.getById(this.data.codCliente);
        }
    };
    DescargasFerroviariasConfirmacaoChegadaComponent.prototype.gravarConfirmacaoChegada = function () {
        var _this = this;
        this.messageService.confirm("titles.descargasFerroviarias", "messages.confirmaChegadaVagao", null, function () {
            _this.data.regTmp = _this.service.data.regTmp;
            _this.service.gravarConfirmacaoChegada(_this.data).subscribe(function (result) {
                if (!result.isValid) {
                    _this.mensagens = _this.messageService.validationResult(result);
                    _this.messageService.warning("titles.descargasFerroviarias", _this.mensagens[0]);
                }
                else {
                    _this.data = new _descargas_ferroviarias_confirmacao_chegada_model__WEBPACK_IMPORTED_MODULE_7__["DescargasFerroviariasConfirmacaoChegada"]();
                    _this.filtro = new _descargas_ferroviarias_confirmacao_chegada_model__WEBPACK_IMPORTED_MODULE_7__["DescargasFerroviariasConfirmacaoChegadaFilter"]();
                    _this.showFiltro = true;
                    jQuery("#descargas-confirmacao-chegada-dialog").modal("hide");
                    _this.messageService.saveSuccess("titles.descargasFerroviarias");
                }
            });
        });
    };
    DescargasFerroviariasConfirmacaoChegadaComponent.ctorParameters = function () { return [
        { type: app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_3__["MessageService"] },
        { type: app_shared_services_datatables_datatables_service__WEBPACK_IMPORTED_MODULE_4__["DatatablesService"] },
        { type: app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_10__["FuncoesService"] },
        { type: app_pages_cadastro_destinatario_destinatario_service__WEBPACK_IMPORTED_MODULE_2__["DestinatarioService"] },
        { type: _descargas_ferroviarias_service__WEBPACK_IMPORTED_MODULE_8__["DescargasFerroviariasService"] }
    ]; };
    DescargasFerroviariasConfirmacaoChegadaComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
            selector: 'app-descargas-ferroviarias-confirmacao-chegada',
            template: __importDefault(__webpack_require__(/*! raw-loader!./descargas-ferroviarias-confirmacao-chegada.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-confirmacao-chegada/descargas-ferroviarias-confirmacao-chegada.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_3__["MessageService"],
            app_shared_services_datatables_datatables_service__WEBPACK_IMPORTED_MODULE_4__["DatatablesService"],
            app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_10__["FuncoesService"],
            app_pages_cadastro_destinatario_destinatario_service__WEBPACK_IMPORTED_MODULE_2__["DestinatarioService"],
            _descargas_ferroviarias_service__WEBPACK_IMPORTED_MODULE_8__["DescargasFerroviariasService"]])
    ], DescargasFerroviariasConfirmacaoChegadaComponent);
    return DescargasFerroviariasConfirmacaoChegadaComponent;
}());



/***/ }),

/***/ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-confirmacao-chegada/descargas-ferroviarias-confirmacao-chegada.model.ts":
/*!*****************************************************************************************************************************************************!*\
  !*** ./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-confirmacao-chegada/descargas-ferroviarias-confirmacao-chegada.model.ts ***!
  \*****************************************************************************************************************************************************/
/*! exports provided: DescargasFerroviariasConfirmacaoChegadaFilter, DescargasFerroviariasConfirmacaoChegada */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

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

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



/***/ }),

/***/ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-dados-pesagem/descargas-ferroviarias-dados-pesagem.component.ts":
/*!*********************************************************************************************************************************************!*\
  !*** ./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-dados-pesagem/descargas-ferroviarias-dados-pesagem.component.ts ***!
  \*********************************************************************************************************************************************/
/*! exports provided: DescargasFerroviariasDadosPesagemComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DescargasFerroviariasDadosPesagemComponent", function() { return DescargasFerroviariasDadosPesagemComponent; });
/* 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_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! app/shared/services/funcoes/funcoes.service */ "./src/app/shared/services/funcoes/funcoes.service.ts");
/* 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 _descargas_ferroviarias_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../descargas-ferroviarias.service */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.service.ts");
/* harmony import */ var _descargas_ferroviarias_dados_pesagem_model__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./descargas-ferroviarias-dados-pesagem.model */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-dados-pesagem/descargas-ferroviarias-dados-pesagem.model.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 DescargasFerroviariasDadosPesagemComponent = /** @class */ (function () {
    function DescargasFerroviariasDadosPesagemComponent(funcoesService, service, loginService) {
        this.funcoesService = funcoesService;
        this.service = service;
        this.loginService = loginService;
        this.data = new _descargas_ferroviarias_dados_pesagem_model__WEBPACK_IMPORTED_MODULE_4__["DescargasFerroviariasDadosPesagem"]();
        this.mensagens = [];
        this.executarBtnFotoOCR = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
    }
    DescargasFerroviariasDadosPesagemComponent.prototype.objectSelect = function (opDescargaTremId) {
        var _this = this;
        this.service.getDadosPesagem(opDescargaTremId).subscribe(function (resp) {
            _this.data = resp;
        });
    };
    DescargasFerroviariasDadosPesagemComponent.prototype.visualizarFotosOCR = function () {
        jQuery("#descargas-dados-pesagem-dialog").modal("hide");
        this.executarBtnFotoOCR.emit();
    };
    DescargasFerroviariasDadosPesagemComponent.ctorParameters = function () { return [
        { type: app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_1__["FuncoesService"] },
        { type: _descargas_ferroviarias_service__WEBPACK_IMPORTED_MODULE_3__["DescargasFerroviariasService"] },
        { type: app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_2__["LoginService"] }
    ]; };
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"])(),
        __metadata("design:type", Object)
    ], DescargasFerroviariasDadosPesagemComponent.prototype, "executarBtnFotoOCR", void 0);
    DescargasFerroviariasDadosPesagemComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
            selector: "app-descargas-ferroviarias-dados-pesagem",
            template: __importDefault(__webpack_require__(/*! raw-loader!./descargas-ferroviarias-dados-pesagem.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-dados-pesagem/descargas-ferroviarias-dados-pesagem.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_1__["FuncoesService"],
            _descargas_ferroviarias_service__WEBPACK_IMPORTED_MODULE_3__["DescargasFerroviariasService"],
            app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_2__["LoginService"]])
    ], DescargasFerroviariasDadosPesagemComponent);
    return DescargasFerroviariasDadosPesagemComponent;
}());



/***/ }),

/***/ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-dados-pesagem/descargas-ferroviarias-dados-pesagem.model.ts":
/*!*****************************************************************************************************************************************!*\
  !*** ./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-dados-pesagem/descargas-ferroviarias-dados-pesagem.model.ts ***!
  \*****************************************************************************************************************************************/
/*! exports provided: DescargasFerroviariasDadosPesagem */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DescargasFerroviariasDadosPesagem", function() { return DescargasFerroviariasDadosPesagem; });
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};
var DescargasFerroviariasDadosPesagem = /** @class */ (function () {
    function DescargasFerroviariasDadosPesagem() {
    }
    return DescargasFerroviariasDadosPesagem;
}());



/***/ }),

/***/ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-filter/descargas-ferroviarias-filter.component.ts":
/*!*******************************************************************************************************************************!*\
  !*** ./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-filter/descargas-ferroviarias-filter.component.ts ***!
  \*******************************************************************************************************************************/
/*! exports provided: DescargasFerroviariasFilterComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DescargasFerroviariasFilterComponent", function() { return DescargasFerroviariasFilterComponent; });
/* 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_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! app/shared/services/funcoes/funcoes.service */ "./src/app/shared/services/funcoes/funcoes.service.ts");
/* harmony import */ var app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! app/shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var _descargas_ferroviarias_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../descargas-ferroviarias.constants */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.constants.ts");
/* harmony import */ var _descargas_ferroviarias_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../descargas-ferroviarias.service */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.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 DescargasFerroviariasFilterComponent = /** @class */ (function () {
    function DescargasFerroviariasFilterComponent(service, message, funcoesService) {
        this.service = service;
        this.message = message;
        this.funcoesService = funcoesService;
        this.constantes = new _descargas_ferroviarias_constants__WEBPACK_IMPORTED_MODULE_4__["DescargasFerroviariasConstants"]();
        this.filtrar = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
    }
    DescargasFerroviariasFilterComponent.prototype.ngOnInit = function () {
    };
    Object.defineProperty(DescargasFerroviariasFilterComponent.prototype, "title", {
        get: function () {
            return this.message.translate("titles.descargasFerroviarias");
        },
        enumerable: true,
        configurable: true
    });
    DescargasFerroviariasFilterComponent.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;
        if (this.service.filter.situacoes.length < 1) {
            this.message.warning("titles.descargasFerroviarias", "messages.campoObrigatorio", { name: this.message.translate('labels.situacao') });
            return;
        }
        this.filtrar.emit(this.service.filter);
        jQuery("#descargas-ferroviarias-filter-dialog").modal("hide");
    };
    DescargasFerroviariasFilterComponent.prototype.trataCliente = function (cliente) {
        if (!cliente)
            return;
        this.service.filter.cliente = cliente;
    };
    DescargasFerroviariasFilterComponent.prototype.trataMaterial = function (material) {
        if (!material)
            return;
        this.service.filter.material = material;
    };
    DescargasFerroviariasFilterComponent.prototype.changeSelecaoSituacao = function (event, valor) {
        if (event.target.checked) {
            this.service.filter.situacoes.push(valor);
        }
        else {
            this.service.filter.situacoes = this.service.filter.situacoes.filter(function (b) { return b !== valor; });
        }
    };
    DescargasFerroviariasFilterComponent.ctorParameters = function () { return [
        { type: _descargas_ferroviarias_service__WEBPACK_IMPORTED_MODULE_5__["DescargasFerroviariasService"] },
        { type: app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_3__["MessageService"] },
        { type: app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_2__["FuncoesService"] }
    ]; };
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"])(),
        __metadata("design:type", Object)
    ], DescargasFerroviariasFilterComponent.prototype, "filtrar", void 0);
    DescargasFerroviariasFilterComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
            selector: "app-descargas-ferroviarias-filter",
            template: __importDefault(__webpack_require__(/*! raw-loader!./descargas-ferroviarias-filter.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-filter/descargas-ferroviarias-filter.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [_descargas_ferroviarias_service__WEBPACK_IMPORTED_MODULE_5__["DescargasFerroviariasService"],
            app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_3__["MessageService"],
            app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_2__["FuncoesService"]])
    ], DescargasFerroviariasFilterComponent);
    return DescargasFerroviariasFilterComponent;
}());



/***/ }),

/***/ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-form/descargas-ferroviarias-form.component.scss":
/*!*****************************************************************************************************************************!*\
  !*** ./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-form/descargas-ferroviarias-form.component.scss ***!
  \*****************************************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("fieldset {\n  border: 1px solid #dfdbdb;\n  padding: 10px;\n  /* controla a distancia entre os elementos e a borda */\n  width: 100%;\n}\n\nlegend {\n  display: inline;\n  width: auto;\n  border: 0;\n  padding: 0px 10px 0px 10px;\n  margin: 0px;\n  font-weight: 600;\n  font-size: 13px;\n}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9hcHAvcGFnZXMvYmFsYW5jYS9kZXNjYXJnYXMtZmVycm92aWFyaWFzL2Rlc2Nhcmdhcy1mZXJyb3ZpYXJpYXMtZm9ybS9DOlxcQ29ycG9yYXRlXFxDb3Jwb3JhdGVXZWJEZXNlbnZcXF91bmlzb2x1dGlvbi9zcmNcXGFwcFxccGFnZXNcXGJhbGFuY2FcXGRlc2Nhcmdhcy1mZXJyb3ZpYXJpYXNcXGRlc2Nhcmdhcy1mZXJyb3ZpYXJpYXMtZm9ybVxcZGVzY2FyZ2FzLWZlcnJvdmlhcmlhcy1mb3JtLmNvbXBvbmVudC5zY3NzIiwic3JjL2FwcC9wYWdlcy9iYWxhbmNhL2Rlc2Nhcmdhcy1mZXJyb3ZpYXJpYXMvZGVzY2FyZ2FzLWZlcnJvdmlhcmlhcy1mb3JtL2Rlc2Nhcmdhcy1mZXJyb3ZpYXJpYXMtZm9ybS5jb21wb25lbnQuc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtFQUNFLHlCQUFBO0VBQ0EsYUFBQTtFQUFnQixzREFBQTtFQUNoQixXQUFBO0FDRUY7O0FEQ0E7RUFDRSxlQUFBO0VBQ0EsV0FBQTtFQUNBLFNBQUE7RUFDQSwwQkFBQTtFQUNBLFdBQUE7RUFDQSxnQkFBQTtFQUNBLGVBQUE7QUNFRiIsImZpbGUiOiJzcmMvYXBwL3BhZ2VzL2JhbGFuY2EvZGVzY2FyZ2FzLWZlcnJvdmlhcmlhcy9kZXNjYXJnYXMtZmVycm92aWFyaWFzLWZvcm0vZGVzY2FyZ2FzLWZlcnJvdmlhcmlhcy1mb3JtLmNvbXBvbmVudC5zY3NzIiwic291cmNlc0NvbnRlbnQiOlsiZmllbGRzZXQge1xyXG4gIGJvcmRlcjogMXB4IHNvbGlkICNkZmRiZGI7XHJcbiAgcGFkZGluZzogMTBweDsgIC8qIGNvbnRyb2xhIGEgZGlzdGFuY2lhIGVudHJlIG9zIGVsZW1lbnRvcyBlIGEgYm9yZGEgKi9cclxuICB3aWR0aDogMTAwJTsgIFxyXG59XHJcblxyXG5sZWdlbmQge1xyXG4gIGRpc3BsYXk6IGlubGluZTtcclxuICB3aWR0aDogYXV0bztcclxuICBib3JkZXI6IDA7XHJcbiAgcGFkZGluZzogMHB4IDEwcHggMHB4IDEwcHg7XHJcbiAgbWFyZ2luOiAwcHg7XHJcbiAgZm9udC13ZWlnaHQ6IDYwMDtcclxuICBmb250LXNpemU6IDEzcHg7XHJcbn1cclxuIiwiZmllbGRzZXQge1xuICBib3JkZXI6IDFweCBzb2xpZCAjZGZkYmRiO1xuICBwYWRkaW5nOiAxMHB4O1xuICAvKiBjb250cm9sYSBhIGRpc3RhbmNpYSBlbnRyZSBvcyBlbGVtZW50b3MgZSBhIGJvcmRhICovXG4gIHdpZHRoOiAxMDAlO1xufVxuXG5sZWdlbmQge1xuICBkaXNwbGF5OiBpbmxpbmU7XG4gIHdpZHRoOiBhdXRvO1xuICBib3JkZXI6IDA7XG4gIHBhZGRpbmc6IDBweCAxMHB4IDBweCAxMHB4O1xuICBtYXJnaW46IDBweDtcbiAgZm9udC13ZWlnaHQ6IDYwMDtcbiAgZm9udC1zaXplOiAxM3B4O1xufSJdfQ== */");

/***/ }),

/***/ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-form/descargas-ferroviarias-form.component.ts":
/*!***************************************************************************************************************************!*\
  !*** ./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-form/descargas-ferroviarias-form.component.ts ***!
  \***************************************************************************************************************************/
/*! exports provided: DescargasFerroviariasFormComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DescargasFerroviariasFormComponent", function() { return DescargasFerroviariasFormComponent; });
/* 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 rxjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/* harmony import */ var _descargas_ferroviarias_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../descargas-ferroviarias.constants */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.constants.ts");
/* harmony import */ var _descargas_ferroviarias_model__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../descargas-ferroviarias.model */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.model.ts");
/* harmony import */ var _descargas_ferroviarias_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../descargas-ferroviarias.service */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.service.ts");
/* harmony import */ var _pages_cadastro_destinatario_destinatario_model__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./../../../../pages/cadastro/destinatario/destinatario.model */ "./src/app/pages/cadastro/destinatario/destinatario.model.ts");
/* harmony import */ var _pages_cadastro_destinatario_destinatario_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./../../../../pages/cadastro/destinatario/destinatario.service */ "./src/app/pages/cadastro/destinatario/destinatario.service.ts");
/* harmony import */ var _pages_cadastro_local_de_transbordo_local_de_transbordo_service__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./../../../../pages/cadastro/local-de-transbordo/local-de-transbordo.service */ "./src/app/pages/cadastro/local-de-transbordo/local-de-transbordo.service.ts");
/* harmony import */ var _pages_cadastro_material_material_model__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./../../../../pages/cadastro/material/material.model */ "./src/app/pages/cadastro/material/material.model.ts");
/* harmony import */ var _pages_cadastro_material_material_service__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./../../../../pages/cadastro/material/material.service */ "./src/app/pages/cadastro/material/material.service.ts");
/* harmony import */ var _pages_cadastro_terno_terno_service__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./../../../../pages/cadastro/terno/terno.service */ "./src/app/pages/cadastro/terno/terno.service.ts");
/* harmony import */ var _pages_login_login_service__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./../../../../pages/login/login.service */ "./src/app/pages/login/login.service.ts");
/* harmony import */ var _shared_components_corporate_base_base_permissoes__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./../../../../shared/components/corporate/base/base.permissoes */ "./src/app/shared/components/corporate/base/base.permissoes.ts");
/* harmony import */ var _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./../../../../shared/services/event-emitter/event-emitter.service */ "./src/app/shared/services/event-emitter/event-emitter.service.ts");
/* harmony import */ var _shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./../../../../shared/services/funcoes/array-utils/array-utils.static.service */ "./src/app/shared/services/funcoes/array-utils/array-utils.static.service.ts");
/* harmony import */ var _shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./../../../../shared/services/funcoes/configuracao/configuracao.facade */ "./src/app/shared/services/funcoes/configuracao/configuracao.facade.ts");
/* harmony import */ var _shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./../../../../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 _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./../../../../shared/services/funcoes/funcoes.service */ "./src/app/shared/services/funcoes/funcoes.service.ts");
/* harmony import */ var _shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./../../../../shared/services/funcoes/number-utils/number-utils.static.service */ "./src/app/shared/services/funcoes/number-utils/number-utils.static.service.ts");
/* harmony import */ var _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./../../../../shared/services/funcoes/permissoes-utils/permissoes-utils.service */ "./src/app/shared/services/funcoes/permissoes-utils/permissoes-utils.service.ts");
/* harmony import */ var _shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./../../../../shared/services/funcoes/string-utils/string-utils.static.service */ "./src/app/shared/services/funcoes/string-utils/string-utils.static.service.ts");
/* harmony import */ var _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./../../../../shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var _descargas_ferroviarias_validation__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../descargas-ferroviarias.validation */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.validation.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 DescargasFerroviariasFormComponent = /** @class */ (function (_super) {
    __extends(DescargasFerroviariasFormComponent, _super);
    function DescargasFerroviariasFormComponent(router, messageService, activatedRoute, configuracao, destinatarioService, materialService, funcoes, permissoesUtils, service, loginService, ternoService, localTransbordoService, validation) {
        var _this = _super.call(this, new _descargas_ferroviarias_constants__WEBPACK_IMPORTED_MODULE_4__["DescargasFerroviariasConstants"](), funcoes) || this;
        _this.router = router;
        _this.messageService = messageService;
        _this.activatedRoute = activatedRoute;
        _this.configuracao = configuracao;
        _this.destinatarioService = destinatarioService;
        _this.materialService = materialService;
        _this.funcoes = funcoes;
        _this.permissoesUtils = permissoesUtils;
        _this.service = service;
        _this.loginService = loginService;
        _this.ternoService = ternoService;
        _this.localTransbordoService = localTransbordoService;
        _this.validation = validation;
        _this.constantes = new _descargas_ferroviarias_constants__WEBPACK_IMPORTED_MODULE_4__["DescargasFerroviariasConstants"]();
        _this.mascara = new app_config_enumerables__WEBPACK_IMPORTED_MODULE_2__["Mascaras"]();
        _this.filtroTmp = new _descargas_ferroviarias_model__WEBPACK_IMPORTED_MODULE_5__["DescargasFerroviariasGerarTmpVo"]();
        _this.disableTanque = false;
        _this.pageRoute = "/balanca/descargasFerroviarias";
        _this.target = _this.funcoes.getTargetLocation();
        _this.loadConfig = function () { return __awaiter(_this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                if (this.configuracao.isLoadConfig()) {
                    this.service.configs.depositoADefinir = this.configuracao.string("BAL", "DepositoADefinir");
                    this.service.configs.solCTEDescFer = this.configuracao.boolean("BAL", "SolCTEDescFer");
                    this.service.configs.calculaTotalNF = this.configuracao.boolean("BAL", "CalculaTotalNF");
                    this.service.configs.infPesoFob = this.configuracao.boolean("BAL", "InfPesoFob");
                    this.service.configs.difMaxNFDtAtual = this.configuracao.number("BAL", "DifMaxNFDtAtual");
                    this.service.configs.ptNfCompraDif = this.configuracao.number("BAL", "PtNfCompraDif");
                    this.service.configs.obrChaveNFeEnt = this.configuracao.boolean("UNI", "ObrChaveNFeEnt");
                    this.service.configs.ocrFerTipo = this.configuracao.number("CTV", "OcrFerTipo");
                    this.service.configs.intOsAtiva = this.configuracao.boolean("REL", "IntOsAtiva");
                    this.service.configs.altDtChegada = this.configuracao.boolean("CTV", "AltDtChegada");
                    this.service.configs.solConclLaudoSegPesF = this.configuracao.boolean("BAL", "SolConclLaudoSegPesF");
                    this.service.configs.dtSeguro = _shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_18__["DateTimeUtilsStaticService"].convertDateSqlToDate(this.configuracao.string("CTR", "DtSeguro"));
                }
                return [2 /*return*/];
            });
        }); };
        _this.confirmacaoChegada = function () {
            _this.permissoesUtils.verificaRotina(_this.constantes.sisFormularioId, 11, function () {
                jQuery("#descargas-confirmacao-chegada-dialog").modal("show");
            });
        };
        _this.visualizarFotoOCR = function () {
            _this.permissoesUtils.verificaRotina(_this.constantes.sisFormularioId, 10, function () { return __awaiter(_this, void 0, void 0, function () {
                var registro, tipo;
                return __generator(this, function (_a) {
                    if (!this.service.data.opDescargaTremId)
                        return [2 /*return*/];
                    if (this.service.descargasFerroviariasNota == null || this.service.descargasFerroviariasNota.opDescargaTremItemId <= 0) {
                        this.messageService.warning(this.service.title, "messages.precisaEscolherItem");
                        return [2 /*return*/, false];
                    }
                    if (this.service.configs.ocrFerTipo <= 0) {
                        this.messageService.warning(this.service.title, "messages.ocrFerTipoNaoConfiguradoVerifique");
                        return [2 /*return*/, false];
                    }
                    switch (this.service.configs.ocrFerTipo) {
                        case 3:
                        case 4:
                            registro = this.service.data.entradaVeiculoId;
                            tipo = 'E';
                            break;
                        case 1:
                        case 2:
                            registro = this.service.descargasFerroviariasNota.opDescargaId;
                            tipo = 'D';
                            break;
                        default:
                            break;
                    }
                    _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_15__["EventEmitterService"].get('emiFotoOcr').emit({
                        registro: registro,
                        tipo: tipo
                    });
                    return [2 /*return*/];
                });
            }); });
        };
        router.events.subscribe(function (event) {
            var params = _this.funcoes.formParams.getParams(router, event);
            if (params) {
                _this.actionForm = params.action;
            }
        });
        return _this;
    }
    DescargasFerroviariasFormComponent.prototype.ngOnInit = function () {
        var _this = this;
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, this.permissoesUtils.getLibRotina(this.actionForm), function () { return __awaiter(_this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                this.configuracao.getConfig(this.constantes.listaParam, this.loadConfig);
                this.service.opDescargaTremId = _shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_20__["NumberUtilsStaticService"].toNumber(this.activatedRoute.snapshot.paramMap.get("id"));
                if (this.funcoes.isEdit(this.actionForm)) {
                    if (!this.podeAlterar())
                        return [2 /*return*/];
                }
                if (this.service.opDescargaTremId > 0) {
                    this.gerarDadosTmp(this.service.opDescargaTremId);
                }
                else {
                    this.gerarDadosTmp();
                }
                return [2 /*return*/];
            });
        }); }, function () {
            _this.permissoesUtils.back();
        });
        _super.prototype.addFuncoes.call(this, [
            { action: 'confirmacaoChegada', func: function () { return _this.confirmacaoChegada; } },
            { action: 'visualizarFotoOCR', func: function () { return _this.visualizarFotoOCR; } }
        ]);
    };
    DescargasFerroviariasFormComponent.prototype.gerarDadosTmp = function (opDescargaTremId) {
        var _this = this;
        if (opDescargaTremId === void 0) { opDescargaTremId = 0; }
        this.filtroTmp.codRotina = this.constantes.sisFormularioId;
        this.filtroTmp.sitRotina = this.actionForm == app_config_enumerables__WEBPACK_IMPORTED_MODULE_2__["ActionForm"].create ? "I" : "A";
        this.filtroTmp.opDescargaTremId = opDescargaTremId;
        this.service.gerarDadosTmp(this.filtroTmp).subscribe(function (result) {
            _this.service.data = result;
            _this.getValorDeposito();
            _this.getSituacao();
            _this.habilitarBtnFotoOCR();
            _this.habilitarBtnConfirmacaoChegada();
            Object(rxjs__WEBPACK_IMPORTED_MODULE_3__["forkJoin"])([
                _this.destinatarioService.getById(_this.service.data.destinatarioIdCliente),
                _this.destinatarioService.getById(_this.service.data.destinatarioIdEmitente),
                _this.destinatarioService.getById(_this.service.data.destinatarioIdTransportadora),
                _this.materialService.getById(_this.service.data.materialId),
                _this.service.getNotasTmp()
            ]).subscribe(function (resp) {
                _this.service.data.cliente = !!resp[0] ? resp[0] : new _pages_cadastro_destinatario_destinatario_model__WEBPACK_IMPORTED_MODULE_7__["Destinatario"]();
                _this.service.data.emitente = !!resp[1] ? resp[1] : new _pages_cadastro_destinatario_destinatario_model__WEBPACK_IMPORTED_MODULE_7__["Destinatario"]();
                _this.service.data.transportadora = !!resp[2] ? resp[2] : new _pages_cadastro_destinatario_destinatario_model__WEBPACK_IMPORTED_MODULE_7__["Destinatario"]();
                _this.service.data.material = !!resp[3] ? resp[3] : new _pages_cadastro_material_material_model__WEBPACK_IMPORTED_MODULE_10__["Material"]();
                _this.service.data.opDescargaTremNotas = !!resp[4] ? resp[4] : [];
            });
        });
    };
    DescargasFerroviariasFormComponent.prototype.podeAlterar = function () {
        return __awaiter(this, void 0, void 0, function () {
            var data, podeAlterar;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.service.getById(this.service.opDescargaTremId).toPromise()];
                    case 1:
                        data = _a.sent();
                        if (!!!data) return [3 /*break*/, 3];
                        return [4 /*yield*/, this.validation.validarRegistroPodeSerAlterado(data)];
                    case 2:
                        podeAlterar = _a.sent();
                        if (!podeAlterar) {
                            this.router.navigate(["" + this.target + this.pageRoute + "/detail/" + this.service.opDescargaTremId]);
                            return [2 /*return*/, false];
                        }
                        _a.label = 3;
                    case 3: return [2 /*return*/, true];
                }
            });
        });
    };
    DescargasFerroviariasFormComponent.prototype.edit = function () {
        return __awaiter(this, void 0, void 0, function () {
            var podeAlterar;
            var _this = this;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.podeAlterar()];
                    case 1:
                        podeAlterar = _a.sent();
                        if (podeAlterar) {
                            if (this.service.configs.perEditFerroviario && this.service.data.sitReg !== "A") {
                                this.messageService.confirm(this.service.title, "messages.registroComPesagemDesejaAlterar", null, function () { return _this.router.navigate(["" + _this.target + _this.pageRoute + "/edit/" + _this.service.opDescargaTremId]); });
                            }
                            else {
                                this.router.navigate(["" + this.target + this.pageRoute + "/edit/" + this.service.opDescargaTremId]);
                            }
                        }
                        return [2 /*return*/];
                }
            });
        });
    };
    DescargasFerroviariasFormComponent.prototype.onSubmit = function (form) {
        var _this = this;
        if (!this.validation.preSave(form)) {
            return;
        }
        this.service.data.codRotina = this.constantes.sisFormularioId;
        this.service.data.logRotina = 'Manut. Desc. Ferroviária';
        this.service.save(this.service.data, this.funcoesService.isEdit(this.actionForm)).subscribe(function (resp) {
            if (!resp.validationResult.isValid) {
                _this.validation.showMessagesResult(resp.validationResult, true);
            }
            else {
                _this.back();
            }
        });
    };
    DescargasFerroviariasFormComponent.prototype.getValorDeposito = function () {
        if (_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_22__["StringUtilsStaticService"].isNotEmpty(this.service.configs.depositoADefinir)
            && this.service.configs.depositoADefinir !== "0"
            && this.actionForm === app_config_enumerables__WEBPACK_IMPORTED_MODULE_2__["ActionForm"].create) {
            this.service.data.tanqueId = this.service.configs.depositoADefinir;
            this.disableTanque = true;
        }
        else {
            this.disableTanque = false;
        }
    };
    DescargasFerroviariasFormComponent.prototype.getSituacao = function () {
        switch (this.service.data.sitReg) {
            case "A":
                this.service.data.situacao = 'Aguardando 1a. Pesagem';
                break;
            case "P":
                this.service.data.situacao = 'Aguardando 2a. Pesagem';
                break;
            case "R":
                this.service.data.situacao = 'Aguardando Retorno';
                break;
            case "S":
                this.service.data.situacao = 'Aguardando Análise';
                break;
            case "C":
                this.service.data.situacao = 'Operação Concluída';
                break;
            case "E":
                this.service.data.situacao = 'Operação Cancelada';
                break;
            default:
                break;
        }
    };
    DescargasFerroviariasFormComponent.prototype.back = function () {
        this.funcoesService.desabilitarFiltro();
        this.confirmMudancaRota = false;
        this.service.cancelarAlteracao().subscribe(function (_) { });
        this.router.navigate(["" + this.target + this.pageRoute]);
    };
    DescargasFerroviariasFormComponent.prototype.habilitarBtnFotoOCR = function () {
        this.buttonDisabled('listaForm', 'visualizarFotoOCR', (this.service.data.opDescargaTremId && !!this.service.data.opDescargaTremNotas && _shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_16__["ArrayUtilsStaticService"].any(this.service.data.opDescargaTremNotas.filter(function (r) { return r.sitReg !== 'E'; }))));
    };
    DescargasFerroviariasFormComponent.prototype.habilitarBtnConfirmacaoChegada = function () {
        this.buttonDisabled('listaForm', 'confirmacaoChegada', this.actionForm !== app_config_enumerables__WEBPACK_IMPORTED_MODULE_2__["ActionForm"].create);
    };
    DescargasFerroviariasFormComponent.prototype.trataCliente = function (c) {
        if (!!c && !!this.service.data.destinatarioIdCliente && !this.service.data.destinatarioIdEmitente) {
            this.service.data.destinatarioIdEmitente = c.destinatarioId;
            this.service.data.emitente = c;
        }
    };
    Object.defineProperty(DescargasFerroviariasFormComponent.prototype, "saldoDepositoOptions", {
        get: function () {
            return {
                destinatarioIdCliente: this.service.data.destinatarioIdCliente,
                materialId: this.service.data.materialId,
                sitLote: 'A',
                modo: 7,
                tipoSaldo: 7,
                dataMovimento: this.service.data.dtAutorizacao,
                localOperacaoId: 0,
                tipoAgrupa: 'D',
                geraArquivo: 'S'
            };
        },
        enumerable: true,
        configurable: true
    });
    DescargasFerroviariasFormComponent.ctorParameters = function () { return [
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"] },
        { type: _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_23__["MessageService"] },
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_1__["ActivatedRoute"] },
        { type: _shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_17__["ConfiguracaoFacade"] },
        { type: _pages_cadastro_destinatario_destinatario_service__WEBPACK_IMPORTED_MODULE_8__["DestinatarioService"] },
        { type: _pages_cadastro_material_material_service__WEBPACK_IMPORTED_MODULE_11__["MaterialService"] },
        { type: _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_19__["FuncoesService"] },
        { type: _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_21__["PermissoesUtilsService"] },
        { type: _descargas_ferroviarias_service__WEBPACK_IMPORTED_MODULE_6__["DescargasFerroviariasService"] },
        { type: _pages_login_login_service__WEBPACK_IMPORTED_MODULE_13__["LoginService"] },
        { type: _pages_cadastro_terno_terno_service__WEBPACK_IMPORTED_MODULE_12__["TernoService"] },
        { type: _pages_cadastro_local_de_transbordo_local_de_transbordo_service__WEBPACK_IMPORTED_MODULE_9__["LocalTransbordoService"] },
        { type: _descargas_ferroviarias_validation__WEBPACK_IMPORTED_MODULE_24__["DescargasFerroviariasValidation"] }
    ]; };
    DescargasFerroviariasFormComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
            selector: "app-descargas-ferroviarias-form",
            template: __importDefault(__webpack_require__(/*! raw-loader!./descargas-ferroviarias-form.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-form/descargas-ferroviarias-form.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None,
            styles: [__importDefault(__webpack_require__(/*! ./descargas-ferroviarias-form.component.scss */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-form/descargas-ferroviarias-form.component.scss")).default]
        }),
        __metadata("design:paramtypes", [_angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"],
            _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_23__["MessageService"],
            _angular_router__WEBPACK_IMPORTED_MODULE_1__["ActivatedRoute"],
            _shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_17__["ConfiguracaoFacade"],
            _pages_cadastro_destinatario_destinatario_service__WEBPACK_IMPORTED_MODULE_8__["DestinatarioService"],
            _pages_cadastro_material_material_service__WEBPACK_IMPORTED_MODULE_11__["MaterialService"],
            _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_19__["FuncoesService"],
            _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_21__["PermissoesUtilsService"],
            _descargas_ferroviarias_service__WEBPACK_IMPORTED_MODULE_6__["DescargasFerroviariasService"],
            _pages_login_login_service__WEBPACK_IMPORTED_MODULE_13__["LoginService"],
            _pages_cadastro_terno_terno_service__WEBPACK_IMPORTED_MODULE_12__["TernoService"],
            _pages_cadastro_local_de_transbordo_local_de_transbordo_service__WEBPACK_IMPORTED_MODULE_9__["LocalTransbordoService"],
            _descargas_ferroviarias_validation__WEBPACK_IMPORTED_MODULE_24__["DescargasFerroviariasValidation"]])
    ], DescargasFerroviariasFormComponent);
    return DescargasFerroviariasFormComponent;
}(_shared_components_corporate_base_base_permissoes__WEBPACK_IMPORTED_MODULE_14__["BasePermissoes"]));



/***/ }),

/***/ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-index/descargas-ferroviarias-index.component.ts":
/*!*****************************************************************************************************************************!*\
  !*** ./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-index/descargas-ferroviarias-index.component.ts ***!
  \*****************************************************************************************************************************/
/*! exports provided: DescargasFerroviariasIndexComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DescargasFerroviariasIndexComponent", function() { return DescargasFerroviariasIndexComponent; });
/* harmony import */ var _shared_services_funcoes_modal_utils_modal_utils_static_service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../../../../shared/services/funcoes/modal-utils/modal-utils.static.service */ "./src/app/shared/services/funcoes/modal-utils/modal-utils.static.service.ts");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/fesm5/router.js");
/* harmony import */ var app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_3__ = __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_4__ = __webpack_require__(/*! app/shared/components/corporate/base/base.permissoes */ "./src/app/shared/components/corporate/base/base.permissoes.ts");
/* harmony import */ var app_shared_services_datatables_datatables_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! app/shared/services/datatables/datatables.service */ "./src/app/shared/services/datatables/datatables.service.ts");
/* harmony import */ var app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! app/shared/services/event-emitter/event-emitter.service */ "./src/app/shared/services/event-emitter/event-emitter.service.ts");
/* harmony import */ var app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! app/shared/services/funcoes/configuracao/configuracao.facade */ "./src/app/shared/services/funcoes/configuracao/configuracao.facade.ts");
/* harmony import */ var app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_8__ = __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_9__ = __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_10__ = __webpack_require__(/*! app/shared/services/funcoes/number-utils/number-utils.static.service */ "./src/app/shared/services/funcoes/number-utils/number-utils.static.service.ts");
/* harmony import */ var app_shared_services_funcoes_object_utils_object_utils_static_service__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! app/shared/services/funcoes/object-utils/object-utils.static.service */ "./src/app/shared/services/funcoes/object-utils/object-utils.static.service.ts");
/* harmony import */ var app_shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! app/shared/services/funcoes/permissoes-utils/permissoes-utils.service */ "./src/app/shared/services/funcoes/permissoes-utils/permissoes-utils.service.ts");
/* harmony import */ var app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_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_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! app/shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var _descargas_ferroviarias_alterar_datas_descargas_ferroviarias_alterar_datas_component__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../descargas-ferroviarias-alterar-datas/descargas-ferroviarias-alterar-datas.component */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-alterar-datas/descargas-ferroviarias-alterar-datas.component.ts");
/* harmony import */ var _descargas_ferroviarias_dados_pesagem_descargas_ferroviarias_dados_pesagem_component__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../descargas-ferroviarias-dados-pesagem/descargas-ferroviarias-dados-pesagem.component */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-dados-pesagem/descargas-ferroviarias-dados-pesagem.component.ts");
/* harmony import */ var _descargas_ferroviarias_constants__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../descargas-ferroviarias.constants */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.constants.ts");
/* harmony import */ var _descargas_ferroviarias_model__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../descargas-ferroviarias.model */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.model.ts");
/* harmony import */ var _descargas_ferroviarias_service__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../descargas-ferroviarias.service */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.service.ts");
/* harmony import */ var _descargas_ferroviarias_validation__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../descargas-ferroviarias.validation */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.validation.ts");
/* harmony import */ var _descargas_ferroviarias_pesagem_para_retorno_descargas_ferroviarias_pesagem_para_retorno_component__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../descargas-ferroviarias-pesagem-para-retorno/descargas-ferroviarias-pesagem-para-retorno.component */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-pesagem-para-retorno/descargas-ferroviarias-pesagem-para-retorno.component.ts");
/* harmony import */ var _descargas_ferroviarias_liberar_retorno_descargas_ferroviarias_liberar_retorno_component__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../descargas-ferroviarias-liberar-retorno/descargas-ferroviarias-liberar-retorno.component */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-liberar-retorno/descargas-ferroviarias-liberar-retorno.component.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 DescargasFerroviariasIndexComponent = /** @class */ (function (_super) {
    __extends(DescargasFerroviariasIndexComponent, _super);
    function DescargasFerroviariasIndexComponent(router, configuracao, messageService, service, validation, datatables, permissoesUtils, loginService, funcoes) {
        var _this = _super.call(this, new _descargas_ferroviarias_constants__WEBPACK_IMPORTED_MODULE_17__["DescargasFerroviariasConstants"](), funcoes) || this;
        _this.router = router;
        _this.configuracao = configuracao;
        _this.messageService = messageService;
        _this.service = service;
        _this.validation = validation;
        _this.datatables = datatables;
        _this.permissoesUtils = permissoesUtils;
        _this.loginService = loginService;
        _this.funcoes = funcoes;
        _this.data = new _descargas_ferroviarias_model__WEBPACK_IMPORTED_MODULE_18__["DescargasFerroviarias"]();
        _this.mensagens = [];
        _this.constantes = new _descargas_ferroviarias_constants__WEBPACK_IMPORTED_MODULE_17__["DescargasFerroviariasConstants"]();
        _this.pageRoute = "/balanca/descargasFerroviarias";
        _this.target = _this.funcoesService.getTargetLocation();
        _this.loadConfig = function () { return __awaiter(_this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                if (this.configuracao.isLoadConfig()) {
                    this.service.configs.pesAntAn = this.configuracao.boolean("BAL", "PesAntAn" + this.configuracao.macAddress);
                    this.service.configs.ocrPsFer = this.configuracao.boolean("BAL", "OcrPsFer" + this.configuracao.macAddress);
                    this.service.configs.perEditFerroviario = this.configuracao.boolean("BAL", "PerEditFerroviario");
                    this.service.configs.justDescarga = this.configuracao.boolean("BAL", "JustDescarga");
                    this.service.configs.justAtraso = this.configuracao.boolean("BAL", "JustAtraso");
                    this.service.configs.solMotCancEVePesagem = this.configuracao.boolean("UNI", "SolMotCancEVePesagem");
                    this.service.configs.cWebModRequisicaoF = this.configuracao.string("WEB", "CWebModRequisicaoF");
                    this.service.configs.cWebModTicketF = this.configuracao.string("WEB", "CWebModTicketF");
                    this.service.configs.cWebModOCDF = this.configuracao.string("WEB", "CWebModOCDF");
                    this.service.configs.efetuaAnaliseOrigem = this.configuracao.boolean("CTV", "EfetuaAnaliseOrigem");
                    this.service.configs.ocrFerTipo = this.configuracao.number("CTV", "OcrFerTipo");
                    this.service.configs.dtSeguro = app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_8__["DateTimeUtilsStaticService"].convertDateSqlToDate(this.configuracao.string("CTR", "DtSeguro"));
                    this.service.configs.prefixoRelEspecifico = this.configuracao.string("WEB", "PrefixoRelEspecifico");
                    this.service.configs.solAferDescFer = this.configuracao.boolean("BAL", "SolAferDescFer");
                    this.service.configs.obrigPlataformaVagao = this.configuracao.string("WEB", "ObrigPlataformaVagao");
                    this.buttonVisible('listaIndex', 'afericaoBalanca', this.service.configs.solAferDescFer);
                    this.buttonVisible('listaIndex', 'analiseProdutoOrigem', this.service.configs.efetuaAnaliseOrigem);
                }
                return [2 /*return*/];
            });
        }); };
        _this._print = function () {
            if (!_this.itemSelecionado())
                return;
            _this.permissoesUtils.verificaRotina(_this.constantes.sisFormularioId, 5, function () {
                jQuery("#modalPrint").modal("show");
            });
        };
        _this.alterarDatas = function () {
            if (!_this.itemSelecionado())
                return;
            _this.permissoesUtils.verificaRotina(_this.constantes.sisFormularioId, 8, function () {
                if (_this.data.pesoTara > 0) {
                    _this.childDescargasFerroviariasAlterarDatasComponent.objectSelect(_this.data.opDescargaTremId);
                    jQuery("#descargas-alterar-datas-dialog").modal("show");
                }
                else {
                    _this.messageService.warning(_this.service.title, "messages.permitidoAlterarHorariosAposSegundaPesagem");
                }
            });
        };
        _this.dadosPesagem = function () {
            _this.permissoesUtils.verificaRotina(_this.constantes.sisFormularioId, 9, function () {
                _this.childDescargasFerroviariasDadosPesagemComponent.objectSelect(_this.data.opDescargaTremId);
                jQuery("#descargas-dados-pesagem-dialog").modal("show");
            });
        };
        _this.visualizarFotoOCR = function () {
            _this.permissoesUtils.verificaRotina(_this.constantes.sisFormularioId, 10, function () { return __awaiter(_this, void 0, void 0, function () {
                return __generator(this, function (_a) {
                    if (!this.data.opDescargaTremId)
                        return [2 /*return*/];
                    app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_6__["EventEmitterService"].get('emiFotoOcr').emit({
                        registro: this.data.opDescargaTremId,
                        tipo: 'F'
                    });
                    return [2 /*return*/];
                });
            }); });
        };
        _this.analiseProdutoOrigem = function () {
            if (!_this.itemSelecionado())
                return;
            if (app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_13__["StringUtilsStaticService"].isEmpty(_this.data.materialId)) {
                _this.messageService.warning(_this.service.title, "messages.nenhumRegistroFoiSelecionado");
                return;
            }
            _this.permissoesUtils.verificaRotina(_this.constantes.sisFormularioId, 12, function () {
                _this.service.validarUsoFichaTecnica(_this.data.opDescargaTremId, _this.data.materialId).subscribe(function (resp) {
                    if (!resp.isValid) {
                        _this.mensagens = _this.messageService.validationResult(resp);
                        _this.messageService.warning(_this.service.title, _this.mensagens[0]);
                    }
                    else {
                        var object = app_shared_services_funcoes_object_utils_object_utils_static_service__WEBPACK_IMPORTED_MODULE_11__["ObjectUtilsStaticService"].objToB64({
                            opDescargaTremId: _this.data.opDescargaTremId,
                            materialId: _this.data.materialId
                        });
                        _this.router.navigate(["" + _this.target + _this.pageRoute + "/analiseProdutoOrigem/" + object]);
                    }
                });
            });
        };
        _this.informarEncoste = function () {
            if (!_this.itemSelecionado())
                return;
            _this.permissoesUtils.verificaRotina(_this.constantes.sisFormularioId, 13, function () { return __awaiter(_this, void 0, void 0, function () {
                return __generator(this, function (_a) {
                    jQuery("#descargas-informar-encoste").modal("show");
                    return [2 /*return*/];
                });
            }); });
        };
        _this.primeiraPesagem = function () {
            if (!_this.itemSelecionado())
                return;
            _this.service.validarPodeEfetuarPrimeiraPesagem(_this.data.opDescargaTremId).subscribe(function (resp) {
                if (!resp.isValid) {
                    _this.mensagens = _this.messageService.validationResult(resp);
                    _this.messageService.warning(_this.service.title, _this.mensagens[0]);
                }
                else {
                    var object = app_shared_services_funcoes_object_utils_object_utils_static_service__WEBPACK_IMPORTED_MODULE_11__["ObjectUtilsStaticService"].objToB64({
                        opDescargaTremId: _this.data.opDescargaTremId,
                        cadastroPlacaId: _this.data.cadastroPlacaId
                    });
                    _this.router.navigate(["" + _this.target + _this.pageRoute + "/primeiraPesagem/" + object]);
                }
            });
        };
        _this.segundaPesagem = function () {
            if (!_this.itemSelecionado())
                return;
            if (!app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_8__["DateTimeUtilsStaticService"].isDate(_this.data.dtTriagem)) {
                _this.messageService.warning(_this.service.title, "messages.dtEncosteNaoInformada");
                return;
            }
            _this.router.navigate(["" + _this.target + _this.pageRoute + "/segundaPesagem/" + _this.data.opDescargaTremId]);
        };
        _this.cancelarPesagem = function () {
            if (!_this.itemSelecionado())
                return;
            _this.permissoesUtils.verificaRotina(_this.constantes.sisFormularioId, 15, function () { return __awaiter(_this, void 0, void 0, function () {
                var _this = this;
                return __generator(this, function (_a) {
                    if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_10__["NumberUtilsStaticService"].isNotPositive(this.data.pesoBru) && app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_10__["NumberUtilsStaticService"].isNotPositive(this.data.pesoTara)) {
                        this.messageService.warning(this.service.title, "messages.registroSemPesagem");
                        return [2 /*return*/];
                    }
                    if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_10__["NumberUtilsStaticService"].isPositive(this.data.pesoTara)
                        && app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_8__["DateTimeUtilsStaticService"].menorOuIgualA(this.data.dtOper2Pes, this.service.configs.dtSeguro)
                        && this.data.flagIntegracao === "I") {
                        this.messageService.warning(this.service.title, "messages.ticketJaIntegradoCancelamentotNaoPermitida");
                        return [2 /*return*/];
                    }
                    this.messageService.confirm(this.service.title, "messages.confirmaCancelamentoDaPesagem", null, function () {
                        if (_this.service.configs.solMotCancEVePesagem) {
                            jQuery("#descargas-motivo-pesagem-dialog").modal("show");
                        }
                        else {
                            _this.executarCancelarPesagem();
                        }
                    }, false);
                    return [2 /*return*/];
                });
            }); });
        };
        _this.liberacaoLote = function () {
            if (!_this.itemSelecionado())
                return;
            _this.permissoesUtils.verificaRotina(_this.constantes.sisFormularioId, 17, function () { return __awaiter(_this, void 0, void 0, function () {
                return __generator(this, function (_a) {
                    this.funcoesService.openWindow('controle/liberacaoLote');
                    return [2 /*return*/];
                });
            }); });
        };
        _this.afericaoBalanca = function () {
            if (!_this.itemSelecionado())
                return;
            _this.permissoesUtils.verificaRotina(_this.constantes.sisFormularioId, 16, function () { return __awaiter(_this, void 0, void 0, function () {
                return __generator(this, function (_a) {
                    this.router.navigate(["" + this.target + this.pageRoute + "/afericaoBalanca"]);
                    return [2 /*return*/];
                });
            }); });
        };
        _this.pesagemParaRetorno = function () {
            if (!_this.itemSelecionado())
                return;
            _this.permissoesUtils.verificaRotina(_this.constantes.sisFormularioId, 18, function () { return __awaiter(_this, void 0, void 0, function () {
                return __generator(this, function (_a) {
                    this.childDescargasFerroviariasPesagemRetornoComponent.objectSelect(this.data.opDescargaTremId);
                    _shared_services_funcoes_modal_utils_modal_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["ModalUtilsStaticService"].openModal("descargas-pesagem-para-retorno-dialog");
                    return [2 /*return*/];
                });
            }); });
        };
        _this.liberarRetorno = function () {
            if (!_this.itemSelecionado())
                return;
            _this.permissoesUtils.verificaRotina(_this.constantes.sisFormularioId, 19, function () { return __awaiter(_this, void 0, void 0, function () {
                return __generator(this, function (_a) {
                    if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_10__["NumberUtilsStaticService"].isNotPositive(this.data.pesoLiq)) {
                        this.messageService.warning(this.service.title, "messages.pesoLiquidoIncorretoRevisePesagem");
                        return [2 /*return*/];
                    }
                    this.childDescargasFerroviariasLiberarRetornoComponent.objectSelect(this.data.opDescargaTremId);
                    _shared_services_funcoes_modal_utils_modal_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["ModalUtilsStaticService"].openModal("descargas-liberar-retorno-dialog");
                    return [2 /*return*/];
                });
            }); });
        };
        router.events.subscribe(function (event) {
            var params = _this.funcoesService.formParams.getParams(router, event);
            if (params) {
                _this.actionForm = params.action;
            }
        });
        return _this;
    }
    DescargasFerroviariasIndexComponent.prototype.ngOnInit = function () {
        var _this = this;
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 4, function () { return __awaiter(_this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        if (!!this.loginService.isTokenExpired()) return [3 /*break*/, 3];
                        this.getConfig();
                        if (!this.funcoesService.abrirFiltro) return [3 /*break*/, 1];
                        this.service.filter = new _descargas_ferroviarias_model__WEBPACK_IMPORTED_MODULE_18__["DescargasFerroviariasFiltroVo"]();
                        this.funcoesService.openModal("descargas-ferroviarias-filter-dialog");
                        return [3 /*break*/, 3];
                    case 1: return [4 /*yield*/, this.refresh()];
                    case 2:
                        _a.sent();
                        _a.label = 3;
                    case 3: return [2 /*return*/];
                }
            });
        }); }, function () {
            _this.permissoesUtils.back();
        }, true);
        _super.prototype.addFuncoes.call(this, [
            { action: '_print', func: function () { return _this._print; } },
            { action: 'alterarDatas', func: function () { return _this.alterarDatas; } },
            { action: 'dadosPesagem', func: function () { return _this.dadosPesagem; } },
            { action: 'analiseProdutoOrigem', func: function () { return _this.analiseProdutoOrigem; } },
            { action: 'informarEncoste', func: function () { return _this.informarEncoste; } },
            { action: 'primeiraPesagem', func: function () { return _this.primeiraPesagem; } },
            { action: 'segundaPesagem', func: function () { return _this.segundaPesagem; } },
            { action: 'cancelarPesagem', func: function () { return _this.cancelarPesagem; } },
            { action: 'liberacaoLote', func: function () { return _this.liberacaoLote; } },
            { action: 'afericaoBalanca', func: function () { return _this.afericaoBalanca; } },
            { action: 'pesagemParaRetorno', func: function () { return _this.pesagemParaRetorno; } },
            { action: 'liberarRetorno', func: function () { return _this.liberarRetorno; } }
        ]);
    };
    DescargasFerroviariasIndexComponent.prototype.getConfig = function () {
        var _this = this;
        this.constantes.listaParam.map(function (c) {
            if (c.sistema === 'BAL') {
                c.parametros.push("PesAntAn" + _this.configuracao.macAddress);
                c.parametros.push("OcrPsFer" + _this.configuracao.macAddress);
            }
        });
        this.configuracao.getConfig({ codRotina: this.constantes.sisFormularioId, configs: this.constantes.listaParam }, this.loadConfig);
    };
    DescargasFerroviariasIndexComponent.prototype.habilitarDesabilitarBotoesMenu = function () {
        this.buttonDisabled('listaIndex', 'analiseProdutoOrigem', app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_10__["NumberUtilsStaticService"].isNotPositive(this.data.opDescargaTremId));
        this.buttonDisabled('listaIndex', 'primeiraPesagem', !["A", "R"].includes(this.data.sitReg));
        this.buttonDisabled('listaIndex', 'segundaPesagem', this.data.sitReg !== "P");
        this.buttonDisabled('listaIndex', 'cancelarPesagem', ["A", "E"].includes(this.data.sitReg));
        this.buttonDisabled('listaIndex', 'afericaoBalanca', !["A", "P"].includes(this.data.sitReg));
        this.buttonDisabled('listaIndex', 'pesagemParaRetorno', this.data.sitReg !== "P");
        this.buttonDisabled('listaIndex', 'liberarRetorno', this.data.sitReg !== "R");
    };
    DescargasFerroviariasIndexComponent.prototype.refresh = function () {
        return __awaiter(this, void 0, void 0, function () {
            var _this = this;
            return __generator(this, function (_a) {
                if (!this.service.filter)
                    return [2 /*return*/];
                this.data = new _descargas_ferroviarias_model__WEBPACK_IMPORTED_MODULE_18__["DescargasFerroviarias"]();
                this.service.getByFiltro(this.service.filter).subscribe(function (data) {
                    var columns = [
                        _this.datatables.getDataString("opDescargaTremId", "registro", "10%"),
                        _this.datatables.getDataString("cadastroPlacaId", "placa"),
                        _this.datatables.getDataDateTime("dtAutorizacao", "data", "DD/MM/YYYY HH:mm", "15%"),
                        _this.datatables.getDataString("clienteFantasia", "cliente"),
                        _this.datatables.getDataString("materialFantasia", "produto"),
                        _this.datatables.getDataDateTime("dtTriagem", "encoste", "DD/MM/YYYY HH:mm", "15%"),
                        _this.datatables.getDataString("situacao", "situacao")
                    ];
                    _this.datatables.toDataTable({ tableId: "dtDescargasFerroviarias", columns: columns, data: data, orientationOrder: app_shared_services_datatables_datatables_service__WEBPACK_IMPORTED_MODULE_5__["EOrientationOrder"].ASC }, function (aData) {
                        _this.data = aData;
                        _this.habilitarDesabilitarBotoesMenu();
                    });
                });
                return [2 /*return*/];
            });
        });
    };
    DescargasFerroviariasIndexComponent.prototype.filtrar = function () {
        jQuery("#descargas-ferroviarias-filter-dialog").modal("show");
    };
    DescargasFerroviariasIndexComponent.prototype.executarFiltro = function (event) {
        this.service.filter = event;
        this.refresh();
    };
    DescargasFerroviariasIndexComponent.prototype.create = function () {
        this.router.navigate(["" + this.target + this.pageRoute + "/create"]);
    };
    DescargasFerroviariasIndexComponent.prototype.edit = function () {
        return __awaiter(this, void 0, void 0, function () {
            var isValid;
            var _this = this;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        if (!this.itemSelecionado())
                            return [2 /*return*/];
                        return [4 /*yield*/, this.validation.validarRegistroPodeSerAlterado(this.data)];
                    case 1:
                        isValid = _a.sent();
                        if (isValid) {
                            if (this.service.configs.perEditFerroviario && this.data.sitReg !== "A") {
                                this.messageService.confirm(this.service.title, "messages.registroComPesagemDesejaAlterar", null, function () { return _this.router.navigate(["" + _this.target + _this.pageRoute + "/edit/" + _this.data.opDescargaTremId]); });
                            }
                            else {
                                this.router.navigate(["" + this.target + this.pageRoute + "/edit/" + this.data.opDescargaTremId]);
                            }
                        }
                        return [2 /*return*/];
                }
            });
        });
    };
    DescargasFerroviariasIndexComponent.prototype.detail = function () {
        if (!this.itemSelecionado())
            return;
        this.router.navigate(["" + this.target + this.pageRoute + "/detail/" + this.data.opDescargaTremId]);
    };
    DescargasFerroviariasIndexComponent.prototype.remove = function () {
        var _this = this;
        if (!this.itemSelecionado())
            return;
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 3, function () {
            if (_this.data.sitReg !== "A") {
                _this.messageService.confirm(_this.service.title, "messages.registroComPesagemDesejaExcluir", null, function () { return _this.removerDescarga(); });
            }
            else {
                _this.removerDescarga();
            }
        });
    };
    DescargasFerroviariasIndexComponent.prototype.removerDescarga = function () {
        var _this = this;
        this.service.validarRegistroPodeSerRemovido(this.data.opDescargaTremId).subscribe(function (result) {
            if (!result.isValid) {
                _this.mensagens = _this.messageService.validationResult(result);
                _this.messageService.warning(_this.service.title, _this.mensagens[0]);
            }
            else {
                if (_this.service.configs.solMotCancEVePesagem) {
                    jQuery("#descargas-ferroviarias-motivo-dialog").modal("show");
                }
                else {
                    _this.executarExclusao();
                }
            }
        });
    };
    DescargasFerroviariasIndexComponent.prototype.executarExclusao = function (motivo) {
        var _this = this;
        if (motivo === void 0) { motivo = ""; }
        this.messageService.removeConfirm(function () {
            _this.service.removerDescarga(_this.data.opDescargaTremId, motivo).subscribe(function (resp) {
                if (!resp.isValid) {
                    _this.mensagens = _this.messageService.validationResult(resp);
                    _this.messageService.warning(_this.service.title, _this.mensagens[0]);
                }
                else {
                    _this.datatables.remove("dtDescargasFerroviarias");
                    _this.data = new _descargas_ferroviarias_model__WEBPACK_IMPORTED_MODULE_18__["DescargasFerroviarias"]();
                }
            });
        });
    };
    DescargasFerroviariasIndexComponent.prototype.properties = function () {
        var _this = this;
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 6, function () {
            _super.prototype.properties.call(_this, _this.data);
        });
    };
    DescargasFerroviariasIndexComponent.prototype.permissoes = function () {
        var _this = this;
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 7, function () {
            _super.prototype.permissoes.call(_this, _this.constantes);
        });
    };
    DescargasFerroviariasIndexComponent.prototype.itemSelecionado = function () {
        if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_10__["NumberUtilsStaticService"].isNotPositive(this.data.opDescargaTremId)) {
            this.messageService.warning(this.service.title, "messages.selecioneUmRegistro");
            return false;
        }
        return true;
    };
    DescargasFerroviariasIndexComponent.prototype.confirmaImpressao = function (tipoImpressao) {
        switch (tipoImpressao) {
            case "listagem":
                this.printListagem();
                break;
            case "requisicao":
                this.printRequisicao();
                break;
            case "ticket":
                this.printTicket();
                break;
            case "boletimOcorrencia":
                this.printBoletimOcorrencia();
                break;
            default:
                break;
        }
    };
    DescargasFerroviariasIndexComponent.prototype.printListagem = function () {
        var teste = [];
        this.funcoesService.reportInvoc.invocaRelatorio(this.constantes.reportId, this.constantes.reportTitulo, {
            filialId: this.funcoesService.getValue(this.loginService.getLogin().filialId, "I"),
            opDescargaTremId: this.funcoesService.getValue(this.service.filter.opDescargaTremId, "I"),
            cadastroPlacaId: this.funcoesService.getValue(this.service.filter.cadastroPlacaId, "S"),
            destinatarioIdCliente: this.funcoesService.getValue(this.service.filter.destinatarioIdCliente, "I"),
            materialId: this.funcoesService.getValue(this.service.filter.materialId, "S"),
            situacoes: this.funcoesService.getValue(this.service.filter.situacoes.join(','), "S"),
            dataI: this.funcoesService.getValue(this.service.filter.dataI, "DI"),
            dataF: this.funcoesService.getValue(this.service.filter.dataF, "DF")
        });
    };
    DescargasFerroviariasIndexComponent.prototype.printRequisicao = function () {
        var modRel = this.service.configs.cWebModRequisicaoF;
        if (!modRel)
            this.messageService.warning(this.service.title, "messages.modRequisicaoNaoConfigurado");
        else {
            var reportTitulo = { titulo: '', subTitulo: '' };
            // Valida se a chamada é para um report especifico
            if (app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_13__["StringUtilsStaticService"].isNotEmpty(this.service.configs.prefixoRelEspecifico) && modRel.indexOf(this.service.configs.prefixoRelEspecifico) == 0) {
                this.funcoesService.reportInvoc.invocaRelatorioEspecificos(modRel, reportTitulo, {
                    filialId: this.loginService.getLogin().filialId,
                    autorizacao: this.funcoesService.getValue(this.data.opDescargaTremId, "I")
                });
            }
            else {
                this.funcoesService.reportInvoc.invocaRelatorio(modRel, reportTitulo, {
                    filialId: this.loginService.getLogin().filialId,
                    autorizacao: this.funcoesService.getValue(this.data.opDescargaTremId, "I")
                });
            }
        }
    };
    DescargasFerroviariasIndexComponent.prototype.printTicket = function () {
        var modRel = this.service.configs.cWebModTicketF;
        if (!modRel)
            this.messageService.warning(this.service.title, "messages.modTicketNaoConfigurado");
        else {
            var reportTitulo = { titulo: '', subTitulo: '' };
            // Valida se a chamada é para um report especifico
            if (app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_13__["StringUtilsStaticService"].isNotEmpty(this.service.configs.prefixoRelEspecifico) && modRel.indexOf(this.service.configs.prefixoRelEspecifico) == 0) {
                this.funcoesService.reportInvoc.invocaRelatorioEspecificos(modRel, reportTitulo, {
                    filialId: this.loginService.getLogin().filialId,
                    autorizacao: this.funcoesService.getValue(this.data.opDescargaTremId, "I"),
                    tipoOCD: "F"
                });
            }
            else {
                this.funcoesService.reportInvoc.invocaRelatorio(modRel, reportTitulo, {
                    filialId: this.loginService.getLogin().filialId,
                    autorizacao: this.funcoesService.getValue(this.data.opDescargaTremId, "I"),
                    tipoOCD: "F"
                });
            }
        }
    };
    DescargasFerroviariasIndexComponent.prototype.printBoletimOcorrencia = function () {
        var modRel = this.service.configs.cWebModOCDF;
        if (!modRel)
            this.messageService.warning(this.service.title, "messages.modBoletimOcorrenciaNaoConfigurado");
        else {
            var reportTitulo = { titulo: '', subTitulo: '' };
            // Valida se a chamada é para um report especifico
            if (app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_13__["StringUtilsStaticService"].isNotEmpty(this.service.configs.prefixoRelEspecifico) && modRel.indexOf(this.service.configs.prefixoRelEspecifico) == 0) {
                this.funcoesService.reportInvoc.invocaRelatorioEspecificos(modRel, reportTitulo, {
                    filialId: this.loginService.getLogin().filialId,
                    autorizacao: this.funcoesService.getValue(this.data.opDescargaTremId, "I")
                });
            }
            else {
                this.funcoesService.reportInvoc.invocaRelatorio(modRel, reportTitulo, {
                    filialId: this.loginService.getLogin().filialId,
                    autorizacao: this.funcoesService.getValue(this.data.opDescargaTremId, "I")
                });
            }
        }
    };
    DescargasFerroviariasIndexComponent.prototype.executarCancelarPesagem = function (motivo) {
        var _this = this;
        if (motivo === void 0) { motivo = ""; }
        this.service.cancelarPesagem(this.data.opDescargaTremId, motivo).subscribe(function (resp) {
            if (!resp.isValid) {
                _this.mensagens = _this.messageService.validationResult(resp);
                _this.messageService.warning(_this.service.title, _this.mensagens[0]);
            }
            else {
                _this.data = new _descargas_ferroviarias_model__WEBPACK_IMPORTED_MODULE_18__["DescargasFerroviarias"]();
                _this.messageService.success(_this.service.title, "messages.cancelamentoRealizadoComSucesso");
                _this.refresh();
            }
        });
    };
    DescargasFerroviariasIndexComponent.ctorParameters = function () { return [
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_2__["Router"] },
        { type: app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_7__["ConfiguracaoFacade"] },
        { type: app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_14__["MessageService"] },
        { type: _descargas_ferroviarias_service__WEBPACK_IMPORTED_MODULE_19__["DescargasFerroviariasService"] },
        { type: _descargas_ferroviarias_validation__WEBPACK_IMPORTED_MODULE_20__["DescargasFerroviariasValidation"] },
        { type: app_shared_services_datatables_datatables_service__WEBPACK_IMPORTED_MODULE_5__["DatatablesService"] },
        { type: app_shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_12__["PermissoesUtilsService"] },
        { type: app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_3__["LoginService"] },
        { type: app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_9__["FuncoesService"] }
    ]; };
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewChild"])(_descargas_ferroviarias_alterar_datas_descargas_ferroviarias_alterar_datas_component__WEBPACK_IMPORTED_MODULE_15__["DescargasFerroviariasAlterarDatasComponent"], { static: false }),
        __metadata("design:type", _descargas_ferroviarias_dados_pesagem_descargas_ferroviarias_dados_pesagem_component__WEBPACK_IMPORTED_MODULE_16__["DescargasFerroviariasDadosPesagemComponent"])
    ], DescargasFerroviariasIndexComponent.prototype, "childDescargasFerroviariasAlterarDatasComponent", void 0);
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewChild"])(_descargas_ferroviarias_dados_pesagem_descargas_ferroviarias_dados_pesagem_component__WEBPACK_IMPORTED_MODULE_16__["DescargasFerroviariasDadosPesagemComponent"], { static: false }),
        __metadata("design:type", _descargas_ferroviarias_dados_pesagem_descargas_ferroviarias_dados_pesagem_component__WEBPACK_IMPORTED_MODULE_16__["DescargasFerroviariasDadosPesagemComponent"])
    ], DescargasFerroviariasIndexComponent.prototype, "childDescargasFerroviariasDadosPesagemComponent", void 0);
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewChild"])(_descargas_ferroviarias_pesagem_para_retorno_descargas_ferroviarias_pesagem_para_retorno_component__WEBPACK_IMPORTED_MODULE_21__["DescargasFerroviariasPesagemParaRetornoComponent"], { static: false }),
        __metadata("design:type", _descargas_ferroviarias_pesagem_para_retorno_descargas_ferroviarias_pesagem_para_retorno_component__WEBPACK_IMPORTED_MODULE_21__["DescargasFerroviariasPesagemParaRetornoComponent"])
    ], DescargasFerroviariasIndexComponent.prototype, "childDescargasFerroviariasPesagemRetornoComponent", void 0);
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewChild"])(_descargas_ferroviarias_liberar_retorno_descargas_ferroviarias_liberar_retorno_component__WEBPACK_IMPORTED_MODULE_22__["DescargasFerroviariasLiberarRetornoComponent"], { static: false }),
        __metadata("design:type", _descargas_ferroviarias_liberar_retorno_descargas_ferroviarias_liberar_retorno_component__WEBPACK_IMPORTED_MODULE_22__["DescargasFerroviariasLiberarRetornoComponent"])
    ], DescargasFerroviariasIndexComponent.prototype, "childDescargasFerroviariasLiberarRetornoComponent", void 0);
    DescargasFerroviariasIndexComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"])({
            selector: "app-descargas-ferroviarias-index",
            template: __importDefault(__webpack_require__(/*! raw-loader!./descargas-ferroviarias-index.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-index/descargas-ferroviarias-index.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [_angular_router__WEBPACK_IMPORTED_MODULE_2__["Router"],
            app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_7__["ConfiguracaoFacade"],
            app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_14__["MessageService"],
            _descargas_ferroviarias_service__WEBPACK_IMPORTED_MODULE_19__["DescargasFerroviariasService"],
            _descargas_ferroviarias_validation__WEBPACK_IMPORTED_MODULE_20__["DescargasFerroviariasValidation"],
            app_shared_services_datatables_datatables_service__WEBPACK_IMPORTED_MODULE_5__["DatatablesService"],
            app_shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_12__["PermissoesUtilsService"],
            app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_3__["LoginService"],
            app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_9__["FuncoesService"]])
    ], DescargasFerroviariasIndexComponent);
    return DescargasFerroviariasIndexComponent;
}(app_shared_components_corporate_base_base_permissoes__WEBPACK_IMPORTED_MODULE_4__["BasePermissoes"]));



/***/ }),

/***/ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-informar-encoste/descargas-ferroviarias-informar-encoste.component.scss":
/*!*****************************************************************************************************************************************************!*\
  !*** ./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-informar-encoste/descargas-ferroviarias-informar-encoste.component.scss ***!
  \*****************************************************************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = (".chk input {\n  display: none;\n}\n\n.chk span {\n  width: 12px;\n  height: 12px;\n  display: block;\n  background-color: #fff;\n  border: 1px solid #DDD;\n  border-radius: 100%;\n}\n\nspan.red {\n  background-color: #c03;\n}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9hcHAvcGFnZXMvYmFsYW5jYS9kZXNjYXJnYXMtZmVycm92aWFyaWFzL2Rlc2Nhcmdhcy1mZXJyb3ZpYXJpYXMtaW5mb3JtYXItZW5jb3N0ZS9DOlxcQ29ycG9yYXRlXFxDb3Jwb3JhdGVXZWJEZXNlbnZcXF91bmlzb2x1dGlvbi9zcmNcXGFwcFxccGFnZXNcXGJhbGFuY2FcXGRlc2Nhcmdhcy1mZXJyb3ZpYXJpYXNcXGRlc2Nhcmdhcy1mZXJyb3ZpYXJpYXMtaW5mb3JtYXItZW5jb3N0ZVxcZGVzY2FyZ2FzLWZlcnJvdmlhcmlhcy1pbmZvcm1hci1lbmNvc3RlLmNvbXBvbmVudC5zY3NzIiwic3JjL2FwcC9wYWdlcy9iYWxhbmNhL2Rlc2Nhcmdhcy1mZXJyb3ZpYXJpYXMvZGVzY2FyZ2FzLWZlcnJvdmlhcmlhcy1pbmZvcm1hci1lbmNvc3RlL2Rlc2Nhcmdhcy1mZXJyb3ZpYXJpYXMtaW5mb3JtYXItZW5jb3N0ZS5jb21wb25lbnQuc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtFQUNJLGFBQUE7QUNDSjs7QURFQTtFQUNJLFdBQUE7RUFDQSxZQUFBO0VBQ0EsY0FBQTtFQUNBLHNCQUFBO0VBQ0Esc0JBQUE7RUFDQSxtQkFBQTtBQ0NKOztBREVBO0VBQ0ksc0JBQUE7QUNDSiIsImZpbGUiOiJzcmMvYXBwL3BhZ2VzL2JhbGFuY2EvZGVzY2FyZ2FzLWZlcnJvdmlhcmlhcy9kZXNjYXJnYXMtZmVycm92aWFyaWFzLWluZm9ybWFyLWVuY29zdGUvZGVzY2FyZ2FzLWZlcnJvdmlhcmlhcy1pbmZvcm1hci1lbmNvc3RlLmNvbXBvbmVudC5zY3NzIiwic291cmNlc0NvbnRlbnQiOlsiLmNoayBpbnB1dCB7XHJcbiAgICBkaXNwbGF5OiBub25lO1xyXG59XHJcblxyXG4uY2hrIHNwYW4ge1xyXG4gICAgd2lkdGg6IDEycHg7XHJcbiAgICBoZWlnaHQ6IDEycHg7XHJcbiAgICBkaXNwbGF5OiBibG9jaztcclxuICAgIGJhY2tncm91bmQtY29sb3I6ICNmZmY7XHJcbiAgICBib3JkZXI6IDFweCBzb2xpZCAjREREO1xyXG4gICAgYm9yZGVyLXJhZGl1czogMTAwJTtcclxuICB9XHJcblxyXG5zcGFuLnJlZCB7XHJcbiAgICBiYWNrZ3JvdW5kLWNvbG9yOiAjYzAzO1xyXG59XHJcblxyXG5cclxuIiwiLmNoayBpbnB1dCB7XG4gIGRpc3BsYXk6IG5vbmU7XG59XG5cbi5jaGsgc3BhbiB7XG4gIHdpZHRoOiAxMnB4O1xuICBoZWlnaHQ6IDEycHg7XG4gIGRpc3BsYXk6IGJsb2NrO1xuICBiYWNrZ3JvdW5kLWNvbG9yOiAjZmZmO1xuICBib3JkZXI6IDFweCBzb2xpZCAjREREO1xuICBib3JkZXItcmFkaXVzOiAxMDAlO1xufVxuXG5zcGFuLnJlZCB7XG4gIGJhY2tncm91bmQtY29sb3I6ICNjMDM7XG59Il19 */");

/***/ }),

/***/ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-informar-encoste/descargas-ferroviarias-informar-encoste.component.ts":
/*!***************************************************************************************************************************************************!*\
  !*** ./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-informar-encoste/descargas-ferroviarias-informar-encoste.component.ts ***!
  \***************************************************************************************************************************************************/
/*! exports provided: DescargasFerroviariasInformarEncosteComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DescargasFerroviariasInformarEncosteComponent", function() { return DescargasFerroviariasInformarEncosteComponent; });
/* harmony import */ var app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! app/pages/login/login.service */ "./src/app/pages/login/login.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 _descargas_ferroviarias_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../descargas-ferroviarias.constants */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.constants.ts");
/* harmony import */ var _descargas_ferroviarias_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../descargas-ferroviarias.service */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.service.ts");
/* harmony import */ var _shared_components_corporate_base_base_permissoes__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../../shared/components/corporate/base/base.permissoes */ "./src/app/shared/components/corporate/base/base.permissoes.ts");
/* harmony import */ var _shared_services_datatables_datatables_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../../shared/services/datatables/datatables.service */ "./src/app/shared/services/datatables/datatables.service.ts");
/* harmony import */ var _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../../shared/services/funcoes/funcoes.service */ "./src/app/shared/services/funcoes/funcoes.service.ts");
/* harmony import */ var _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../../shared/services/funcoes/permissoes-utils/permissoes-utils.service */ "./src/app/shared/services/funcoes/permissoes-utils/permissoes-utils.service.ts");
/* harmony import */ var _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../../shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var app_shared_services_funcoes_email_email_service__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! app/shared/services/funcoes/email/email.service */ "./src/app/shared/services/funcoes/email/email.service.ts");
/* harmony import */ var app_pages_cadastro_material_material_model__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! app/pages/cadastro/material/material.model */ "./src/app/pages/cadastro/material/material.model.ts");
/* harmony import */ var app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_12__ = __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_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! app/shared/services/event-emitter/event-emitter.service */ "./src/app/shared/services/event-emitter/event-emitter.service.ts");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (undefined && undefined.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};














var DescargasFerroviariasInformarEncosteComponent = /** @class */ (function (_super) {
    __extends(DescargasFerroviariasInformarEncosteComponent, _super);
    function DescargasFerroviariasInformarEncosteComponent(router, descargasFerroviariasService, activatedRoute, datatablesService, messageService, emailService, funcoesService, permissoesUtils, loginService) {
        var _this = _super.call(this, new _descargas_ferroviarias_constants__WEBPACK_IMPORTED_MODULE_3__["DescargasFerroviariasConstants"](), funcoesService) || this;
        _this.router = router;
        _this.descargasFerroviariasService = descargasFerroviariasService;
        _this.activatedRoute = activatedRoute;
        _this.datatablesService = datatablesService;
        _this.messageService = messageService;
        _this.emailService = emailService;
        _this.funcoesService = funcoesService;
        _this.permissoesUtils = permissoesUtils;
        _this.loginService = loginService;
        _this.hasDados = false;
        _this.data = [];
        _this.selecionadosEnvio = [];
        _this.constantes = new _descargas_ferroviarias_constants__WEBPACK_IMPORTED_MODULE_3__["DescargasFerroviariasConstants"]();
        _this.mensagens = [];
        _this.materialId = "";
        _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;
    }
    DescargasFerroviariasInformarEncosteComponent.prototype.ngOnInit = function () {
    };
    DescargasFerroviariasInformarEncosteComponent.prototype.pesquisar = function () {
        app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_13__["EventEmitterService"].get("formError").emit();
        this.refresh();
    };
    DescargasFerroviariasInformarEncosteComponent.prototype.validaDtEncoste = function () {
        if (app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_12__["DateTimeUtilsStaticService"].maiorA(this.dtEncoste, new Date(), ['H', 'M'])) {
            this.messageService.warning("titles.descargasFerroviarias", "messages.dtHoraEncosteNaoPodeSerMaiorQueDtHoraAtual");
            return false;
        }
        if (!this.dtEncoste) {
            this.messageService.warning("titles.descargasFerroviarias", "messages.dtEncosteObrigatoria");
            return false;
        }
        return true;
    };
    DescargasFerroviariasInformarEncosteComponent.prototype.refresh = function () {
        var _this = this;
        this.selecionadosEnvio = [];
        var obj = {
            materialId: this.materialId
        };
        this.descargasFerroviariasService
            .getDadosInformarEncosteByFiltro(obj)
            .subscribe(function (resp) {
            _this.data = resp;
            _this.hasDados = resp && resp.length > 0;
        });
    };
    DescargasFerroviariasInformarEncosteComponent.prototype.marcarTodos = function () {
        var _this = this;
        if (!this.hasDados) {
            this.messageService.warning("titles.descargasFerroviarias", "messages.tabelaVazia");
            return;
        }
        this.data.forEach(function (e) { return _this.onMarcarTodos(e); });
    };
    DescargasFerroviariasInformarEncosteComponent.prototype.desmarcarTodos = function () {
        var _this = this;
        if (!this.hasDados) {
            this.messageService.warning("titles.descargasFerroviarias", "messages.tabelaVazia");
            return;
        }
        this.data.forEach(function (e) { return _this.onDesmarcarTodos(e); });
    };
    DescargasFerroviariasInformarEncosteComponent.prototype._dbClick = function (obj) {
        this.onMarcarDesmarcar(obj);
    };
    DescargasFerroviariasInformarEncosteComponent.prototype.onMarcarDesmarcar = function (obj) {
        obj.selecionado = obj.selecionado === 'S' ? 'N' : 'S';
    };
    DescargasFerroviariasInformarEncosteComponent.prototype.onMarcarTodos = function (obj) {
        obj.selecionado = 'S';
    };
    DescargasFerroviariasInformarEncosteComponent.prototype.onDesmarcarTodos = function (obj) {
        obj.selecionado = 'N';
    };
    DescargasFerroviariasInformarEncosteComponent.prototype.onSubmit = function (form) {
        var _this = this;
        app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_13__["EventEmitterService"].get("formError").emit(form);
        if (form.invalid) {
            return;
        }
        if (!this.validaDtEncoste()) {
            return;
        }
        if (!this.hasDados) {
            this.messageService.warning("titles.descargasFerroviarias", "messages.tabelaVazia");
            return;
        }
        this.selecionadosEnvio = this.data.filter(function (d) { return d.selecionado === "S"; });
        if (this.selecionadosEnvio.length === 0) {
            this.messageService.warning("titles.descargasFerroviarias", "messages.nenhumRegistroFoiSelecionado");
            return;
        }
        this.descargasFerroviariasService.gravarDtEncoste(this.selecionadosEnvio, this.dtEncoste)
            .subscribe(function (result) {
            if (!result.isValid) {
                _this.mensagens = _this.messageService.validationResult(result);
                app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_13__["EventEmitterService"].get("backError").emit(_this.mensagens);
                _this.refresh();
            }
            else {
                _this.messageService.saveSuccess("titles.descargasFerroviarias");
                jQuery("#descargas-informar-encoste").modal("hide");
                _this.data = [];
                _this.selecionadosEnvio = [];
                _this.materialId = "";
                _this.material = new app_pages_cadastro_material_material_model__WEBPACK_IMPORTED_MODULE_11__["Material"]();
                _this.dtEncoste = null;
            }
        });
    };
    DescargasFerroviariasInformarEncosteComponent.ctorParameters = function () { return [
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_2__["Router"] },
        { type: _descargas_ferroviarias_service__WEBPACK_IMPORTED_MODULE_4__["DescargasFerroviariasService"] },
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_2__["ActivatedRoute"] },
        { type: _shared_services_datatables_datatables_service__WEBPACK_IMPORTED_MODULE_6__["DatatablesService"] },
        { type: _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_9__["MessageService"] },
        { type: app_shared_services_funcoes_email_email_service__WEBPACK_IMPORTED_MODULE_10__["EmailService"] },
        { type: _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_7__["FuncoesService"] },
        { type: _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_8__["PermissoesUtilsService"] },
        { type: app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_0__["LoginService"] }
    ]; };
    DescargasFerroviariasInformarEncosteComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"])({
            selector: "app-descargas-ferroviarias-informar-encoste",
            template: __importDefault(__webpack_require__(/*! raw-loader!./descargas-ferroviarias-informar-encoste.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-informar-encoste/descargas-ferroviarias-informar-encoste.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None,
            styles: [__importDefault(__webpack_require__(/*! ./descargas-ferroviarias-informar-encoste.component.scss */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-informar-encoste/descargas-ferroviarias-informar-encoste.component.scss")).default]
        }),
        __metadata("design:paramtypes", [_angular_router__WEBPACK_IMPORTED_MODULE_2__["Router"],
            _descargas_ferroviarias_service__WEBPACK_IMPORTED_MODULE_4__["DescargasFerroviariasService"],
            _angular_router__WEBPACK_IMPORTED_MODULE_2__["ActivatedRoute"],
            _shared_services_datatables_datatables_service__WEBPACK_IMPORTED_MODULE_6__["DatatablesService"],
            _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_9__["MessageService"],
            app_shared_services_funcoes_email_email_service__WEBPACK_IMPORTED_MODULE_10__["EmailService"],
            _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_7__["FuncoesService"],
            _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_8__["PermissoesUtilsService"],
            app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_0__["LoginService"]])
    ], DescargasFerroviariasInformarEncosteComponent);
    return DescargasFerroviariasInformarEncosteComponent;
}(_shared_components_corporate_base_base_permissoes__WEBPACK_IMPORTED_MODULE_5__["BasePermissoes"]));



/***/ }),

/***/ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-item/descargas-ferroviarias-item.component.ts":
/*!***************************************************************************************************************************!*\
  !*** ./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-item/descargas-ferroviarias-item.component.ts ***!
  \***************************************************************************************************************************/
/*! exports provided: DescargasFerroviariasItemComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DescargasFerroviariasItemComponent", function() { return DescargasFerroviariasItemComponent; });
/* 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_destinatario_destinatario_model__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! app/pages/cadastro/destinatario/destinatario.model */ "./src/app/pages/cadastro/destinatario/destinatario.model.ts");
/* harmony import */ var app_pages_cadastro_destinatario_destinatario_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! app/pages/cadastro/destinatario/destinatario.service */ "./src/app/pages/cadastro/destinatario/destinatario.service.ts");
/* harmony import */ var app_pages_cadastro_lote_lote_model__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! app/pages/cadastro/lote/lote.model */ "./src/app/pages/cadastro/lote/lote.model.ts");
/* harmony import */ var app_pages_cadastro_lote_lote_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! app/pages/cadastro/lote/lote.service */ "./src/app/pages/cadastro/lote/lote.service.ts");
/* harmony import */ var app_pages_cadastro_material_material_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! app/pages/cadastro/material/material.service */ "./src/app/pages/cadastro/material/material.service.ts");
/* harmony import */ var app_pages_cadastro_tanque_tanque_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! app/pages/cadastro/tanque/tanque.service */ "./src/app/pages/cadastro/tanque/tanque.service.ts");
/* harmony import */ var app_pages_cadastro_tipo_documento_transp_tipo_documento_transp_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! app/pages/cadastro/tipo-documento-transp/tipo-documento-transp.service */ "./src/app/pages/cadastro/tipo-documento-transp/tipo-documento-transp.service.ts");
/* harmony import */ var app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! app/pages/login/login.service */ "./src/app/pages/login/login.service.ts");
/* harmony import */ var app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_10__ = __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_11__ = __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_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_message_message_service__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! app/shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/* harmony import */ var _descargas_ferroviarias_model__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../descargas-ferroviarias.model */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.model.ts");
/* harmony import */ var _descargas_ferroviarias_service__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../descargas-ferroviarias.service */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.service.ts");
/* harmony import */ var _descargas_ferroviarias_validation__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../descargas-ferroviarias.validation */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.validation.ts");
/* harmony import */ var util__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! util */ "./node_modules/util/util.js");
/* harmony import */ var util__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(util__WEBPACK_IMPORTED_MODULE_18__);
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 DescargasFerroviariasItemComponent = /** @class */ (function () {
    function DescargasFerroviariasItemComponent(materialService, tanqueService, messageService, service, validation, funcoesService, loginService, loteService, destinatarioService, tipoDocumentoTranspService) {
        this.materialService = materialService;
        this.tanqueService = tanqueService;
        this.messageService = messageService;
        this.service = service;
        this.validation = validation;
        this.funcoesService = funcoesService;
        this.loginService = loginService;
        this.loteService = loteService;
        this.destinatarioService = destinatarioService;
        this.tipoDocumentoTranspService = tipoDocumentoTranspService;
        this.dataResult = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
        this.btnFotoOCR = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
        this.showAdd = false;
        this.actionForm = app_config_enumerables__WEBPACK_IMPORTED_MODULE_1__["ActionForm"].index;
        this.isNotaComplementar = false;
        this.mascara = new app_config_enumerables__WEBPACK_IMPORTED_MODULE_1__["Mascaras"]();
        this.obrEtiquetaMaterial = "";
        this.movQuantidTanque = "";
        this.desabilitarCodTipoDoc = false;
        this.flagSolDadosEnt = "";
        this.mascaraDocto = null;
        this.disableRequired = false;
    }
    DescargasFerroviariasItemComponent.prototype.create = function () {
        if (!this.validation.validaTicketIntegrado())
            return;
        this.showAdd = true;
        this.actionForm = app_config_enumerables__WEBPACK_IMPORTED_MODULE_1__["ActionForm"].create;
        this.service.descargasFerroviariasNota = new _descargas_ferroviarias_model__WEBPACK_IMPORTED_MODULE_15__["DescargasFerroviariasNota"]();
        this.service.descargasFerroviariasNota.opDescargaTremId = this.service.data.opDescargaTremId;
        this.service.descargasFerroviariasNota.destinatarioIdCliente = this.service.data.destinatarioIdCliente;
        this.service.descargasFerroviariasNota.destinatarioIdEmitente = this.service.data.destinatarioIdEmitente;
        this.getDados();
    };
    DescargasFerroviariasItemComponent.prototype.edit = function () {
        if (!this.podeEditar())
            return;
        this.showAdd = true;
        this.actionForm = app_config_enumerables__WEBPACK_IMPORTED_MODULE_1__["ActionForm"].edit;
        this.onDoctoChange();
        this.getDados();
    };
    DescargasFerroviariasItemComponent.prototype.detail = function () {
        this.showAdd = true;
        this.actionForm = app_config_enumerables__WEBPACK_IMPORTED_MODULE_1__["ActionForm"].detail;
        this.onDoctoChange();
        this.getDados();
    };
    DescargasFerroviariasItemComponent.prototype.back = function (refresh) {
        if (refresh === void 0) { refresh = false; }
        this.showAdd = false;
        this.actionForm = app_config_enumerables__WEBPACK_IMPORTED_MODULE_1__["ActionForm"].index;
        this.btnFotoOCR.emit(true);
        if (refresh) {
            this.refreshNotas();
        }
    };
    DescargasFerroviariasItemComponent.prototype.refreshNotas = function () {
        var _this = this;
        this.service.getNotasTmp().subscribe(function (resp) {
            _this.service.data.opDescargaTremNotas = resp;
        });
    };
    DescargasFerroviariasItemComponent.prototype.onSubmit = function (form) {
        var _this = this;
        if (!this.validation.preSave(form, true)) {
            return;
        }
        this.service.descargasFerroviariasNota.logRotina = 'Manut. Desc. Ferroviária';
        this.service.descargasFerroviariasNota.cadastroPlacaId = this.service.data.cadastroPlacaId;
        this.service.descargasFerroviariasNota.regTmpOpDescargaTremId = this.service.data.regTmp;
        this.service.descargasFerroviariasNota.opDescargaValidaTremId = this.service.data.opDescargaTremId;
        if (this.isNotaComplementar) {
            this.service.descargasFerroviariasNota.isNotaComplementar = this.isNotaComplementar;
        }
        this.service.gravarTmpOpDescargaTremNota(this.service.descargasFerroviariasNota).subscribe(function (resp) {
            if (!resp.validationResult.isValid) {
                var mensagens = _this.messageService.validationResult(resp.validationResult);
                app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_10__["EventEmitterService"].get("backError").emit(mensagens);
                _this.funcoesService.backToTop();
                return false;
            }
            else {
                _this.service.descargasFerroviariasNota = new _descargas_ferroviarias_model__WEBPACK_IMPORTED_MODULE_15__["DescargasFerroviariasNota"]();
                _this.back(true);
            }
        });
    };
    DescargasFerroviariasItemComponent.prototype.remove = function () {
        var _this = this;
        if (!!(this.service.descargasFerroviariasNota.opDescargaTremItemId)) {
            this.messageService.removeConfirm(function () {
                _this.service.removerTmpOpDescargaTremNota().subscribe(function (resp) {
                    if (!resp.isValid) {
                        var mensagens = _this.messageService.validationResult(resp);
                        _this.messageService.warning(_this.service.title, mensagens[0]);
                    }
                    else {
                        _this.refreshNotas();
                        _this.btnFotoOCR.emit(true);
                        _this.service.descargasFerroviariasNota = new _descargas_ferroviarias_model__WEBPACK_IMPORTED_MODULE_15__["DescargasFerroviariasNota"]();
                    }
                });
            });
        }
    };
    DescargasFerroviariasItemComponent.prototype.selected = function (val, index) {
        this._index = index;
        this.service.descargasFerroviariasNota = Object.assign({}, val);
    };
    DescargasFerroviariasItemComponent.prototype.getDados = function () {
        var _this = this;
        Object(rxjs__WEBPACK_IMPORTED_MODULE_14__["forkJoin"])([
            this.loteService.getByLoteId(this.service.descargasFerroviariasNota.loteId),
            this.destinatarioService.getById(this.service.descargasFerroviariasNota.destinatarioIdCliente),
            this.destinatarioService.getById(this.service.descargasFerroviariasNota.destinatarioIdEmitente),
            this.service.getNotasTmp()
        ]).subscribe(function (resp) {
            _this.service.descargasFerroviariasNota.lote = !!resp[0] ? resp[0] : new app_pages_cadastro_lote_lote_model__WEBPACK_IMPORTED_MODULE_4__["Lote"]();
            _this.service.descargasFerroviariasNota.cliente = !!resp[1] ? resp[1] : new app_pages_cadastro_destinatario_destinatario_model__WEBPACK_IMPORTED_MODULE_2__["Destinatario"]();
            _this.service.descargasFerroviariasNota.emitente = !!resp[2] ? resp[2] : new app_pages_cadastro_destinatario_destinatario_model__WEBPACK_IMPORTED_MODULE_2__["Destinatario"]();
        });
        this.ajustarUnidade();
        this.ajustarTipoTransporte();
    };
    DescargasFerroviariasItemComponent.prototype.ajustarUnidade = function () {
        var _this = this;
        Object(rxjs__WEBPACK_IMPORTED_MODULE_14__["forkJoin"])([
            this.materialService.getById(this.service.data.materialId),
            this.tanqueService.getById(btoa(this.service.data.tanqueId))
        ]).subscribe(function (resp) {
            var material = resp[0] && resp[0].sitReg !== 'E' ? resp[0] : null;
            var tanque = resp[1] && resp[1].sitReg !== 'E' ? resp[1] : null;
            _this.obrEtiquetaMaterial = material ? material.obrEtiqueta : "";
            _this.movQuantidTanque = tanque ? tanque.movQuantid : "";
        });
    };
    DescargasFerroviariasItemComponent.prototype.ajustarTipoTransporte = function () {
        this.service.descargasFerroviariasNota.tipoDocumentoTranspId = (this.service.descargasFerroviariasNota.loteId !== "" && (!!this.service.descargasFerroviariasNota.lote && this.service.descargasFerroviariasNota.lote.tipoDocumentoTranspIdEntrada > 0))
            ? this.service.descargasFerroviariasNota.lote.tipoDocumentoTranspIdEntrada
            : this.service.descargasFerroviariasNota.tipoDocumentoTranspId;
        this.desabilitarCodTipoDoc = (this.service.descargasFerroviariasNota.loteId !== "" || (!this.service.descargasFerroviariasNota.lote || this.service.descargasFerroviariasNota.lote.tipoDocumentoTranspIdEntrada === 0));
        this.onTipoDocTransporteChange();
    };
    DescargasFerroviariasItemComponent.prototype.onTipoDocTransporteChange = function () {
        var _this = this;
        this.tipoDocumentoTranspService.getById(this.service.descargasFerroviariasNota.tipoDocumentoTranspId).subscribe(function (resp) {
            _this.flagSolDadosEnt = resp ? resp.flagSolDadosEnt : "";
            _this.mascaraDocto = resp ? resp.mascara : null;
        });
    };
    DescargasFerroviariasItemComponent.prototype.onLoteSelecionado = function (event) {
        this.service.descargasFerroviariasNota.lote = !!event ? event.lote : new app_pages_cadastro_lote_lote_model__WEBPACK_IMPORTED_MODULE_4__["Lote"]();
        this.ajustarUnidade();
        this.ajustarTipoTransporte();
        this.service.descargasFerroviariasNota.modeloNotaId = this.service.descargasFerroviariasNota.lote == null ? "" : this.service.descargasFerroviariasNota.lote.modeloNotaId;
        switch (this.service.descargasFerroviariasNota.lote == null ? "" : this.service.descargasFerroviariasNota.lote.unidadeId) {
            case "KG":
                this.service.descargasFerroviariasNota.pesoDoc = this.service.descargasFerroviariasNota.quantidDoc;
                break;
            case "LT":
                this.service.descargasFerroviariasNota.pesoDoc = Math.round(this.service.descargasFerroviariasNota.quantidDoc * this.service.descargasFerroviariasNota.lote.densidade);
                break;
            default:
                break;
        }
        if (this.service.configs.calculaTotalNF)
            this.service.descargasFerroviariasNota.vlNota = Math.round(this.service.descargasFerroviariasNota.quantidDoc * (this.service.descargasFerroviariasNota.lote == null ? 1 : this.service.descargasFerroviariasNota.lote.precoArmazenado));
    };
    DescargasFerroviariasItemComponent.prototype.onModeloNotaIdChange = function () {
        if (this.service.descargasFerroviariasNota.modeloNotaId !== '55') {
            this.service.descargasFerroviariasNota.nfeAuto = 'N';
        }
    };
    DescargasFerroviariasItemComponent.prototype.onQuantidDocChange = function () {
        this.ajustarUnidade();
        switch (this.service.descargasFerroviariasNota.lote == null ? "" : this.service.descargasFerroviariasNota.lote.unidadeId) {
            case "KG":
                this.service.descargasFerroviariasNota.pesoDoc = this.service.descargasFerroviariasNota.quantidDoc;
                break;
            case "LT":
                this.service.descargasFerroviariasNota.quantidDoc = Math.round(this.service.descargasFerroviariasNota.quantidDoc * this.service.descargasFerroviariasNota.lote.densidade);
                break;
            default:
                break;
        }
        if (this.service.configs.calculaTotalNF)
            this.service.descargasFerroviariasNota.vlNota = Math.round(this.service.descargasFerroviariasNota.quantidDoc * (this.service.descargasFerroviariasNota.lote == null ? 1 : this.service.descargasFerroviariasNota.lote.precoArmazenado));
    };
    DescargasFerroviariasItemComponent.prototype.onPesoDocChange = function () {
        switch (this.service.descargasFerroviariasNota.lote == null ? "" : this.service.descargasFerroviariasNota.lote.unidadeId) {
            case "LT":
                this.service.descargasFerroviariasNota.quantidDoc = Math.round(this.service.descargasFerroviariasNota.pesoDoc / (this.service.descargasFerroviariasNota.lote == null ? 0 : this.service.descargasFerroviariasNota.lote.densidade));
                break;
            case "CC":
                this.service.descargasFerroviariasNota.quantidDoc = Math.round(this.service.descargasFerroviariasNota.pesoDoc * (this.service.descargasFerroviariasNota.lote == null ? 1 : this.service.descargasFerroviariasNota.lote.densidade));
                break;
            case "KG":
                this.service.descargasFerroviariasNota.quantidDoc = this.service.descargasFerroviariasNota.pesoDoc;
                break;
            default:
                break;
        }
        if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_12__["NumberUtilsStaticService"].isNotPositive(this.service.descargasFerroviariasNota.pesoRateio))
            this.service.descargasFerroviariasNota.pesoRateio = this.service.descargasFerroviariasNota.pesoDoc;
        if (this.service.configs.calculaTotalNF)
            this.service.descargasFerroviariasNota.vlNota = Math.round(this.service.descargasFerroviariasNota.quantidDoc * (this.service.descargasFerroviariasNota.lote == null ? 1 : this.service.descargasFerroviariasNota.lote.precoArmazenado));
    };
    DescargasFerroviariasItemComponent.prototype.disabledChaveNf = function () {
        if (this.funcoesService.isDetail(this.actionForm) || this.funcoesService.isUndefinedOrNull(this.service.descargasFerroviariasNota.modeloNotaId)) {
            return true;
        }
        return this.service.descargasFerroviariasNota.modeloNotaId !== '55';
    };
    DescargasFerroviariasItemComponent.prototype.importarDanfe = function (chave) {
        var _this = this;
        if (this.funcoesService.isUndefinedOrNull(chave) || chave === '') {
            this.messageService.info('labels.chaveNFE', 'messages.chaveNfeDeveSerInformada');
            return;
        }
        this.funcoesService.nfeHelper.importaDanfe({ chave: chave }).subscribe(function (result) {
            if (!result.validationResult.isValid) {
                var mensagens = _this.messageService.validationResult(result.validationResult);
                app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_10__["EventEmitterService"].get("backError").emit(mensagens);
                _this.funcoesService.backToTop();
                return;
            }
            _this.service.descargasFerroviariasNota.nfeAuto = 'S';
            _this.service.descargasFerroviariasNota.serieNotaId = result.serie;
            _this.service.descargasFerroviariasNota.pesoDoc = result.peso;
            _this.service.descargasFerroviariasNota.docto = result.numero;
            _this.service.descargasFerroviariasNota.dtDocto = result.dtEmissao;
            _this.service.descargasFerroviariasNota.quantidDoc = result.qtde;
            _this.service.descargasFerroviariasNota.naturezaId = result.cfop;
            _this.service.descargasFerroviariasNota.vlNota = result.vlNota;
        });
    };
    DescargasFerroviariasItemComponent.prototype.onDestinatatioIdEmitenteChange = function () {
        var _this = this;
        this.service.filtroValidacaoNota.opDescargaTremId = this.service.descargasFerroviariasNota.opDescargaTremId;
        this.service.filtroValidacaoNota.regTmp = this.service.data.regTmp;
        this.service.filtroValidacaoNota.destinatarioIdEmitente = this.service.descargasFerroviariasNota.destinatarioIdEmitente;
        this.service.filtroValidacaoNota.docto = this.service.descargasFerroviariasNota.docto;
        this.service.filtroValidacaoNota.serieNotaId = this.service.descargasFerroviariasNota.serieNotaId;
        this.service.validarENotaComplementar(this.service.filtroValidacaoNota).subscribe(function (resp) {
            if (resp != null) {
                if (resp.retornoId > 2) {
                    _this.messageService.warning(_this.service.title, "messages.existeNotaComplementarVinculadaAlteracaoNaoPermitida");
                    _this.service.descargasFerroviariasNota.destinatarioIdEmitente = _this.service.filtroValidacaoNota.destinatarioIdEmitenteAnterior;
                }
                _this.isNotaComplementar = resp.retornoId === 1;
            }
            else {
                _this.isNotaComplementar = false;
            }
        });
    };
    DescargasFerroviariasItemComponent.prototype.numeroDocNfe = function () {
        if (this.funcoesService.isEdit(this.actionForm)) {
            var num = this.service.descargasFerroviariasNota.chaveNfe.substring(25, 34);
            this.service.filtroValidacaoNota.docto = app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_12__["NumberUtilsStaticService"].toNumber(num);
            this.service.descargasFerroviariasNota.docto = app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_12__["NumberUtilsStaticService"].toNumber(num);
        }
    };
    DescargasFerroviariasItemComponent.prototype.onDoctoChange = function () {
        var _this = this;
        this.service.filtroValidacaoNota.opDescargaTremId = this.service.data.opDescargaTremId;
        this.service.filtroValidacaoNota.regTmp = this.service.data.regTmp;
        this.service.filtroValidacaoNota.destinatarioIdEmitente = this.service.descargasFerroviariasNota.destinatarioIdEmitente;
        this.service.filtroValidacaoNota.docto = this.service.descargasFerroviariasNota.docto;
        this.service.filtroValidacaoNota.serieNotaId = this.service.descargasFerroviariasNota.serieNotaId;
        this.service.filtroValidacaoNota.opDescargaTremItemId = this.service.descargasFerroviariasNota.opDescargaTremItemId;
        this.service.validarDocto(this.service.filtroValidacaoNota).subscribe(function (resp) {
            if (resp != null) {
                if (resp.retornoId > 1) {
                    if (!Object(util__WEBPACK_IMPORTED_MODULE_18__["isNullOrUndefined"])(_this.service.filtroValidacaoNota.doctoAnterior)) {
                        _this.service.descargasFerroviariasNota.docto = _this.service.filtroValidacaoNota.doctoAnterior;
                    }
                    var mensagens = _this.messageService.validationResult(resp.validationResult);
                    _this.messageService.warning(_this.service.title, mensagens);
                }
                _this.isNotaComplementar = resp.retornoId === 1;
                _this.disableRequired = false;
            }
            else {
                _this.isNotaComplementar = false;
                _this.disableRequired = true;
            }
        });
    };
    DescargasFerroviariasItemComponent.prototype.podeEditar = function () {
        if (!this.validation.validaTicketIntegrado())
            return false;
        return true;
    };
    Object.defineProperty(DescargasFerroviariasItemComponent.prototype, "saldoLoteOptions", {
        get: function () {
            return {
                destinatarioIdCliente: this.service.descargasFerroviariasNota.destinatarioIdCliente,
                destinatarioIdEmitente: this.service.descargasFerroviariasNota.destinatarioIdEmitente,
                materialId: this.service.data.materialId,
                sitLote: 'A',
                modo: 7,
                tipoSaldo: 7,
                dataMovimento: new Date(),
                tipoAgrupa: 'L',
                geraArquivo: 'N',
                loteId: this.service.descargasFerroviariasNota.loteId
            };
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DescargasFerroviariasItemComponent.prototype, "disableDocto", {
        get: function () {
            return (this.service.descargasFerroviariasNota.modeloNotaId === '55'
                && this.service.descargasFerroviariasNota.nfeAuto === 'S');
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DescargasFerroviariasItemComponent.prototype, "isNotaImportada", {
        get: function () {
            return (this.service.descargasFerroviariasNota.nfeAuto === 'S');
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DescargasFerroviariasItemComponent.prototype, "hasDados", {
        get: function () {
            return this.service.data.opDescargaTremNotas &&
                this.service.data.opDescargaTremNotas.length > 0 &&
                this.service.data.opDescargaTremNotas.filter(function (v) {
                    if (v["sitReg"] !== "E") {
                        return true;
                    }
                    return false;
                }).length > 0;
        },
        enumerable: true,
        configurable: true
    });
    DescargasFerroviariasItemComponent.ctorParameters = function () { return [
        { type: app_pages_cadastro_material_material_service__WEBPACK_IMPORTED_MODULE_6__["MaterialService"] },
        { type: app_pages_cadastro_tanque_tanque_service__WEBPACK_IMPORTED_MODULE_7__["TanqueService"] },
        { type: app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_13__["MessageService"] },
        { type: _descargas_ferroviarias_service__WEBPACK_IMPORTED_MODULE_16__["DescargasFerroviariasService"] },
        { type: _descargas_ferroviarias_validation__WEBPACK_IMPORTED_MODULE_17__["DescargasFerroviariasValidation"] },
        { type: app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_11__["FuncoesService"] },
        { type: app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_9__["LoginService"] },
        { type: app_pages_cadastro_lote_lote_service__WEBPACK_IMPORTED_MODULE_5__["LoteService"] },
        { type: app_pages_cadastro_destinatario_destinatario_service__WEBPACK_IMPORTED_MODULE_3__["DestinatarioService"] },
        { type: app_pages_cadastro_tipo_documento_transp_tipo_documento_transp_service__WEBPACK_IMPORTED_MODULE_8__["TipoDocumentoTranspService"] }
    ]; };
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"])(),
        __metadata("design:type", Object)
    ], DescargasFerroviariasItemComponent.prototype, "disabled", void 0);
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"])(),
        __metadata("design:type", Object)
    ], DescargasFerroviariasItemComponent.prototype, "dataResult", void 0);
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"])(),
        __metadata("design:type", Object)
    ], DescargasFerroviariasItemComponent.prototype, "btnFotoOCR", void 0);
    DescargasFerroviariasItemComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
            selector: "app-descargas-ferroviarias-item",
            template: __importDefault(__webpack_require__(/*! raw-loader!./descargas-ferroviarias-item.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-item/descargas-ferroviarias-item.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [app_pages_cadastro_material_material_service__WEBPACK_IMPORTED_MODULE_6__["MaterialService"],
            app_pages_cadastro_tanque_tanque_service__WEBPACK_IMPORTED_MODULE_7__["TanqueService"],
            app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_13__["MessageService"],
            _descargas_ferroviarias_service__WEBPACK_IMPORTED_MODULE_16__["DescargasFerroviariasService"],
            _descargas_ferroviarias_validation__WEBPACK_IMPORTED_MODULE_17__["DescargasFerroviariasValidation"],
            app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_11__["FuncoesService"],
            app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_9__["LoginService"],
            app_pages_cadastro_lote_lote_service__WEBPACK_IMPORTED_MODULE_5__["LoteService"],
            app_pages_cadastro_destinatario_destinatario_service__WEBPACK_IMPORTED_MODULE_3__["DestinatarioService"],
            app_pages_cadastro_tipo_documento_transp_tipo_documento_transp_service__WEBPACK_IMPORTED_MODULE_8__["TipoDocumentoTranspService"]])
    ], DescargasFerroviariasItemComponent);
    return DescargasFerroviariasItemComponent;
}());



/***/ }),

/***/ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-laudo/descargas-ferroviarias-laudo.component.ts":
/*!*****************************************************************************************************************************!*\
  !*** ./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-laudo/descargas-ferroviarias-laudo.component.ts ***!
  \*****************************************************************************************************************************/
/*! exports provided: DescargasFerroviariasLaudoComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DescargasFerroviariasLaudoComponent", function() { return DescargasFerroviariasLaudoComponent; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _descargas_ferroviarias_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../descargas-ferroviarias.service */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.service.ts");
/* harmony import */ var _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../../../../shared/services/event-emitter/event-emitter.service */ "./src/app/shared/services/event-emitter/event-emitter.service.ts");
/* harmony import */ var _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../../../../shared/services/funcoes/funcoes.service */ "./src/app/shared/services/funcoes/funcoes.service.ts");
/* harmony import */ var _shared_services_funcoes_modal_utils_modal_utils_static_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../../../../shared/services/funcoes/modal-utils/modal-utils.static.service */ "./src/app/shared/services/funcoes/modal-utils/modal-utils.static.service.ts");
/* harmony import */ var _descargas_ferroviarias_validation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../descargas-ferroviarias.validation */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.validation.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 DescargasFerroviariasLaudoComponent = /** @class */ (function () {
    function DescargasFerroviariasLaudoComponent(funcoes, service, validation) {
        this.funcoes = funcoes;
        this.service = service;
        this.validation = validation;
        this.outConfirmaLaudoDifPeso = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
        this.outCancelaLaudoDifPeso = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
    }
    DescargasFerroviariasLaudoComponent.prototype.open = function (modo, confDif, diferenca, procedimento) {
        if (procedimento === void 0) { procedimento = [' - Laudo']; }
        _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_2__["EventEmitterService"].get("formErrorFer").emit(null);
        this.laudoPorDifPeso = { modo: modo, confDif: confDif, diferenca: diferenca, procedimento: procedimento };
        _shared_services_funcoes_modal_utils_modal_utils_static_service__WEBPACK_IMPORTED_MODULE_4__["ModalUtilsStaticService"].openModal('descfer-primeira-pesagem-dialog');
    };
    DescargasFerroviariasLaudoComponent.prototype.confirmaLaudoDifPeso = function (form) {
        var _this = this;
        _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_2__["EventEmitterService"].get("formErrorFer").emit(form);
        if (form.invalid) {
            this.funcoes.backToTop();
            return false;
        }
        if (this.service.configs.flagObrigaAprov) {
            this.service.gravarLaudoPes(this.service.data.opDescargaTremId, this.laudoPorDifPeso.responsavel, this.laudoPorDifPeso.dataHora).subscribe(function (resp) {
                if (!resp && !resp.isValid) {
                    _this.validation.showMessagesResult(resp);
                }
                else {
                    _shared_services_funcoes_modal_utils_modal_utils_static_service__WEBPACK_IMPORTED_MODULE_4__["ModalUtilsStaticService"].closeModal('descfer-primeira-pesagem-dialog');
                    _this.outConfirmaLaudoDifPeso.emit();
                }
            });
        }
        else {
            _shared_services_funcoes_modal_utils_modal_utils_static_service__WEBPACK_IMPORTED_MODULE_4__["ModalUtilsStaticService"].closeModal('descfer-primeira-pesagem-dialog');
            this.outConfirmaLaudoDifPeso.emit();
        }
    };
    DescargasFerroviariasLaudoComponent.prototype.cancelaLaudoDifPeso = function () {
        _shared_services_funcoes_modal_utils_modal_utils_static_service__WEBPACK_IMPORTED_MODULE_4__["ModalUtilsStaticService"].closeModal('descfer-primeira-pesagem-dialog');
        this.outCancelaLaudoDifPeso.emit();
    };
    DescargasFerroviariasLaudoComponent.ctorParameters = function () { return [
        { type: _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_3__["FuncoesService"] },
        { type: _descargas_ferroviarias_service__WEBPACK_IMPORTED_MODULE_1__["DescargasFerroviariasService"] },
        { type: _descargas_ferroviarias_validation__WEBPACK_IMPORTED_MODULE_5__["DescargasFerroviariasValidation"] }
    ]; };
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"])(),
        __metadata("design:type", Object)
    ], DescargasFerroviariasLaudoComponent.prototype, "outConfirmaLaudoDifPeso", void 0);
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"])(),
        __metadata("design:type", Object)
    ], DescargasFerroviariasLaudoComponent.prototype, "outCancelaLaudoDifPeso", void 0);
    DescargasFerroviariasLaudoComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
            selector: "app-descargas-ferroviarias-laudo",
            template: __importDefault(__webpack_require__(/*! raw-loader!./descargas-ferroviarias-laudo.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-laudo/descargas-ferroviarias-laudo.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_3__["FuncoesService"],
            _descargas_ferroviarias_service__WEBPACK_IMPORTED_MODULE_1__["DescargasFerroviariasService"],
            _descargas_ferroviarias_validation__WEBPACK_IMPORTED_MODULE_5__["DescargasFerroviariasValidation"]])
    ], DescargasFerroviariasLaudoComponent);
    return DescargasFerroviariasLaudoComponent;
}());



/***/ }),

/***/ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-liberar-retorno/descargas-ferroviarias-liberar-retorno.component.ts":
/*!*************************************************************************************************************************************************!*\
  !*** ./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-liberar-retorno/descargas-ferroviarias-liberar-retorno.component.ts ***!
  \*************************************************************************************************************************************************/
/*! exports provided: DescargasFerroviariasLiberarRetornoComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DescargasFerroviariasLiberarRetornoComponent", function() { return DescargasFerroviariasLiberarRetornoComponent; });
/* 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_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! app/shared/services/funcoes/funcoes.service */ "./src/app/shared/services/funcoes/funcoes.service.ts");
/* 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 _descargas_ferroviarias_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../descargas-ferroviarias.service */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.service.ts");
/* harmony import */ var _descargas_ferroviarias_liberar_retorno_model__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./descargas-ferroviarias-liberar-retorno.model */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-liberar-retorno/descargas-ferroviarias-liberar-retorno.model.ts");
/* harmony import */ var app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! app/shared/services/event-emitter/event-emitter.service */ "./src/app/shared/services/event-emitter/event-emitter.service.ts");
/* harmony import */ var _descargas_ferroviarias_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../descargas-ferroviarias.constants */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.constants.ts");
/* harmony import */ var app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! app/shared/services/funcoes/configuracao/configuracao.facade */ "./src/app/shared/services/funcoes/configuracao/configuracao.facade.ts");
/* harmony import */ var app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_8__ = __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 _descargas_ferroviarias_model__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../descargas-ferroviarias.model */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.model.ts");
/* harmony import */ var app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! app/shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var app_shared_services_funcoes_modal_utils_modal_utils_static_service__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! app/shared/services/funcoes/modal-utils/modal-utils.static.service */ "./src/app/shared/services/funcoes/modal-utils/modal-utils.static.service.ts");
/* harmony import */ var _descargas_ferroviarias_validation__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../descargas-ferroviarias.validation */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.validation.ts");
/* harmony import */ var app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_13__ = __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_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! app/shared/services/funcoes/string-utils/string-utils.static.service */ "./src/app/shared/services/funcoes/string-utils/string-utils.static.service.ts");
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 DescargasFerroviariasLiberarRetornoComponent = /** @class */ (function () {
    function DescargasFerroviariasLiberarRetornoComponent(configuracao, funcoesService, service, loginService, messageService, validation) {
        var _this = this;
        this.configuracao = configuracao;
        this.funcoesService = funcoesService;
        this.service = service;
        this.loginService = loginService;
        this.messageService = messageService;
        this.validation = validation;
        this.executar = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
        this.data = new _descargas_ferroviarias_liberar_retorno_model__WEBPACK_IMPORTED_MODULE_4__["DescargasFerroviariasLiberarRetorno"]();
        this.descargaFerro = new _descargas_ferroviarias_model__WEBPACK_IMPORTED_MODULE_9__["DescargasFerroviarias"]();
        this.constantes = new _descargas_ferroviarias_constants__WEBPACK_IMPORTED_MODULE_6__["DescargasFerroviariasConstants"]();
        this.mensagens = [];
        this.disabledQuebra = true;
        this.labelQuebra = "";
        this.labelStatus = "";
        this.now = new Date();
        this.minutos = 0;
        this.loadConfig = function () { return __awaiter(_this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                if (this.configuracao.isLoadConfig()) {
                    this.service.configs.boletimOcorrencia = this.configuracao.boolean("BAL", "BoletimOcorrencia");
                    this.service.configs.pesoMaxFerBO = this.configuracao.number("BAL", "PesoMaxFerBO");
                    this.service.configs.cWebModOCDF = this.configuracao.string("WEB", "CWebModOCDF");
                }
                return [2 /*return*/];
            });
        }); };
    }
    DescargasFerroviariasLiberarRetornoComponent.prototype.ngOnInit = function () {
        this.configuracao.getConfig({ codRotina: this.constantes.sisFormularioId, configs: this.constantes.listaParam }, this.loadConfig);
    };
    DescargasFerroviariasLiberarRetornoComponent.prototype.objectSelect = function (opDescargaTremId) {
        var _this = this;
        app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_5__["EventEmitterService"].get("formError").emit();
        this.labelQuebra = "";
        this.labelStatus = "";
        this.service.getDadosLiberarRetorno(opDescargaTremId).subscribe(function (resp) {
            if (!!resp) {
                _this.data = resp;
                _this.getDadosDescargaFerro(opDescargaTremId);
            }
        });
    };
    DescargasFerroviariasLiberarRetornoComponent.prototype.getDadosDescargaFerro = function (opDescargaTremId) {
        var _this = this;
        this.service.getById(opDescargaTremId).subscribe(function (resp) {
            if (!!resp) {
                _this.descargaFerro = resp;
                _this.trataJustQuebra();
                _this.trataJustAtraso();
            }
            else {
                _this.messageService.warning(_this.service.title, "messages.naoFoiPossivelCarregarDadosDescargaFerroviaria");
                return;
            }
        });
    };
    DescargasFerroviariasLiberarRetornoComponent.prototype.onSubmit = function (form) {
        return __awaiter(this, void 0, void 0, function () {
            var _this = this;
            return __generator(this, function (_a) {
                app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_5__["EventEmitterService"].get("formError").emit(form);
                if (form.invalid) {
                    this.funcoesService.backToTop();
                    return [2 /*return*/];
                }
                if (!this.validarDados())
                    return [2 /*return*/];
                this.service.gravarLiberarRetorno(this.data).subscribe(function (resp) {
                    if (!resp.isValid) {
                        _this.mensagens = _this.messageService.validationResult(resp);
                        _this.messageService.warning(_this.service.title, _this.mensagens[0]);
                    }
                    else {
                        _this.messageService.saveSuccess("titles.descargasFerroviarias");
                        app_shared_services_funcoes_modal_utils_modal_utils_static_service__WEBPACK_IMPORTED_MODULE_11__["ModalUtilsStaticService"].closeModal("descargas-liberar-retorno-dialog");
                        _this.executar.emit();
                        if (_this.service.configs.boletimOcorrencia && (_this.service.configs.pesoMaxFerBO > 0) && (_this.data.diferenca > _this.service.configs.pesoMaxFerBO)) {
                            _this.printBoletimOcorrencia();
                        }
                    }
                });
                return [2 /*return*/];
            });
        });
    };
    DescargasFerroviariasLiberarRetornoComponent.prototype.printBoletimOcorrencia = function () {
        var modRel = this.service.configs.cWebModOCDF;
        if (!modRel)
            this.messageService.warning("titles.descargasFerroviarias", "messages.modBoletimOcorrenciaNaoConfigurado");
        else {
            var reportTitulo = { titulo: '', subTitulo: '' };
            // Valida se a chamada é para um report especifico
            if (app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_14__["StringUtilsStaticService"].isNotEmpty(this.service.configs.prefixoRelEspecifico) && modRel.indexOf(this.service.configs.prefixoRelEspecifico) == 0) {
                this.funcoesService.reportInvoc.invocaRelatorioEspecificos(modRel, reportTitulo, {
                    filialId: this.loginService.getLogin().filialId,
                    autorizacao: this.funcoesService.getValue(this.data.opDescargaTremId, "I")
                });
            }
            else {
                this.funcoesService.reportInvoc.invocaRelatorio(modRel, reportTitulo, {
                    filialId: this.loginService.getLogin().filialId,
                    autorizacao: this.funcoesService.getValue(this.data.opDescargaTremId, "I")
                });
            }
        }
    };
    DescargasFerroviariasLiberarRetornoComponent.prototype.validarDados = function () {
        if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_8__["NumberUtilsStaticService"].isNotPositive(this.data.pesoTara)) {
            this.messageService.warning("titles.descargasFerroviarias", this.messageService.translate("messages.campoObrigatorio", { name: this.messageService.translate("labels.pesoTara") }));
            return false;
        }
        return true;
    };
    DescargasFerroviariasLiberarRetornoComponent.prototype.trataJustQuebra = function () {
        return __awaiter(this, void 0, void 0, function () {
            var kilos, pesoLiq, diferenca, ptDif, exigeJustifQuebra;
            return __generator(this, function (_a) {
                kilos = app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_8__["NumberUtilsStaticService"].toNumber(this.descargaFerro.kilos);
                pesoLiq = app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_8__["NumberUtilsStaticService"].toNumber(this.data.pesoLiq);
                diferenca = Math.abs(kilos - pesoLiq);
                this.data.diferenca = diferenca;
                ptDif = Math.abs((1 - (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_8__["NumberUtilsStaticService"].toNumber(pesoLiq) / kilos)) * 100);
                this.labelQuebra = app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_8__["NumberUtilsStaticService"].getCurrency(ptDif, 2) + " %";
                if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_8__["NumberUtilsStaticService"].toNumber(pesoLiq) > kilos)
                    this.labelStatus = "Sobra";
                else if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_8__["NumberUtilsStaticService"].toNumber(pesoLiq) < kilos)
                    this.labelStatus = "Quebra";
                else
                    this.labelStatus = "";
                exigeJustifQuebra = this.validaQuebra() || this.validaSobra();
                this.disabledQuebra = !exigeJustifQuebra;
                return [2 /*return*/];
            });
        });
    };
    DescargasFerroviariasLiberarRetornoComponent.prototype.validaQuebra = function () {
        var pesoLiq = app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_8__["NumberUtilsStaticService"].toNumber(this.data.pesoLiq);
        var kilos = app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_8__["NumberUtilsStaticService"].toNumber(this.descargaFerro.kilos);
        var diferenca = pesoLiq - kilos;
        if (diferenca >= 0)
            return false;
        if (this.service.configs.justDescarga) {
            var ptDif = 0;
            if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_8__["NumberUtilsStaticService"].isNotPositive(kilos))
                ptDif = 100;
            else
                ptDif = app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_8__["NumberUtilsStaticService"].round(Math.abs((1 - (pesoLiq / kilos)) * 100), 5);
            return ptDif > this.service.configs.ptJustDescargaF;
        }
        return false;
    };
    DescargasFerroviariasLiberarRetornoComponent.prototype.validaSobra = function () {
        var pesoLiq = app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_8__["NumberUtilsStaticService"].toNumber(this.data.pesoLiq);
        var kilos = app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_8__["NumberUtilsStaticService"].toNumber(this.descargaFerro.kilos);
        var diferenca = pesoLiq - kilos;
        if (diferenca <= 0)
            return false;
        if (this.service.configs.justDescargaSb) {
            var ptDif = 0;
            if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_8__["NumberUtilsStaticService"].isNotPositive(kilos))
                ptDif = 100;
            else
                ptDif = app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_8__["NumberUtilsStaticService"].round(Math.abs((1 - (pesoLiq / kilos)) * 100), 5);
            return ptDif > this.service.configs.ptJustDescargaFSb;
        }
        return false;
    };
    DescargasFerroviariasLiberarRetornoComponent.prototype.trataJustAtraso = function () {
        var dtInicio = undefined;
        if (!!this.data.dtTriagem)
            dtInicio = this.data.dtTriagem;
        else
            dtInicio = this.descargaFerro.dtChegada;
        if (!dtInicio || !this.descargaFerro.dtChegada)
            return;
        var minutos = app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_13__["DateTimeUtilsStaticService"].getMinutes(dtInicio, this.now);
        this.minutos = minutos;
    };
    Object.defineProperty(DescargasFerroviariasLiberarRetornoComponent.prototype, "labeAtraso", {
        get: function () {
            if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_8__["NumberUtilsStaticService"].isNotPositive(this.minutos))
                return "";
            return this.minutos + " min";
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DescargasFerroviariasLiberarRetornoComponent.prototype, "requiredAtraso", {
        get: function () {
            return this.service.configs.justDescarga && this.service.configs.justDescargaSb && app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_8__["NumberUtilsStaticService"].isPositive(this.data.pesoTara);
        },
        enumerable: true,
        configurable: true
    });
    DescargasFerroviariasLiberarRetornoComponent.ctorParameters = function () { return [
        { type: app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_7__["ConfiguracaoFacade"] },
        { type: app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_1__["FuncoesService"] },
        { type: _descargas_ferroviarias_service__WEBPACK_IMPORTED_MODULE_3__["DescargasFerroviariasService"] },
        { type: app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_2__["LoginService"] },
        { type: app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_10__["MessageService"] },
        { type: _descargas_ferroviarias_validation__WEBPACK_IMPORTED_MODULE_12__["DescargasFerroviariasValidation"] }
    ]; };
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"])(),
        __metadata("design:type", Object)
    ], DescargasFerroviariasLiberarRetornoComponent.prototype, "executar", void 0);
    DescargasFerroviariasLiberarRetornoComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
            selector: "app-descargas-ferroviarias-liberar-retorno",
            template: __importDefault(__webpack_require__(/*! raw-loader!./descargas-ferroviarias-liberar-retorno.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-liberar-retorno/descargas-ferroviarias-liberar-retorno.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_7__["ConfiguracaoFacade"],
            app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_1__["FuncoesService"],
            _descargas_ferroviarias_service__WEBPACK_IMPORTED_MODULE_3__["DescargasFerroviariasService"],
            app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_2__["LoginService"],
            app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_10__["MessageService"],
            _descargas_ferroviarias_validation__WEBPACK_IMPORTED_MODULE_12__["DescargasFerroviariasValidation"]])
    ], DescargasFerroviariasLiberarRetornoComponent);
    return DescargasFerroviariasLiberarRetornoComponent;
}());



/***/ }),

/***/ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-liberar-retorno/descargas-ferroviarias-liberar-retorno.model.ts":
/*!*********************************************************************************************************************************************!*\
  !*** ./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-liberar-retorno/descargas-ferroviarias-liberar-retorno.model.ts ***!
  \*********************************************************************************************************************************************/
/*! exports provided: DescargasFerroviariasLiberarRetorno */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DescargasFerroviariasLiberarRetorno", function() { return DescargasFerroviariasLiberarRetorno; });
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};
var DescargasFerroviariasLiberarRetorno = /** @class */ (function () {
    function DescargasFerroviariasLiberarRetorno() {
        this.codMotivoQuebra = 0;
        this.codMotivoAtraso = 0;
    }
    return DescargasFerroviariasLiberarRetorno;
}());



/***/ }),

/***/ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-motivo-pesagem/descargas-ferroviarias-motivo-pesagem.component.ts":
/*!***********************************************************************************************************************************************!*\
  !*** ./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-motivo-pesagem/descargas-ferroviarias-motivo-pesagem.component.ts ***!
  \***********************************************************************************************************************************************/
/*! exports provided: DescargasFerroviariasMotivoPesagemComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DescargasFerroviariasMotivoPesagemComponent", function() { return DescargasFerroviariasMotivoPesagemComponent; });
/* 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_message_message_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! app/shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var _descargas_ferroviarias_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../descargas-ferroviarias.service */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.service.ts");
/* harmony import */ var app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_3__ = __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 __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 DescargasFerroviariasMotivoPesagemComponent = /** @class */ (function () {
    function DescargasFerroviariasMotivoPesagemComponent(messageService, service) {
        this.messageService = messageService;
        this.service = service;
        this.motivo = "";
        this.outMotivo = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
    }
    DescargasFerroviariasMotivoPesagemComponent.prototype.ngOnInit = function () {
        this.motivo = "";
    };
    DescargasFerroviariasMotivoPesagemComponent.prototype.onSubmit = function (form) {
        if (app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_3__["StringUtilsStaticService"].isEmpty(this.motivo)) {
            this.messageService.warning("titles.descargasFerroviarias", "messages.informeMotivoExclusao");
            return;
        }
        if (this.motivo.length < 15) {
            this.messageService.warning("titles.descargasFerroviarias", "messages.minimoCaracteresMotivo");
            return;
        }
        this.outMotivo.emit(this.motivo);
        jQuery("#descargas-motivo-pesagem-dialog").modal("hide");
    };
    DescargasFerroviariasMotivoPesagemComponent.ctorParameters = function () { return [
        { type: app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_1__["MessageService"] },
        { type: _descargas_ferroviarias_service__WEBPACK_IMPORTED_MODULE_2__["DescargasFerroviariasService"] }
    ]; };
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"])(),
        __metadata("design:type", Object)
    ], DescargasFerroviariasMotivoPesagemComponent.prototype, "outMotivo", void 0);
    DescargasFerroviariasMotivoPesagemComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
            selector: "app-descargas-ferroviarias-motivo-pesagem",
            template: __importDefault(__webpack_require__(/*! raw-loader!./descargas-ferroviarias-motivo-pesagem.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-motivo-pesagem/descargas-ferroviarias-motivo-pesagem.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_1__["MessageService"],
            _descargas_ferroviarias_service__WEBPACK_IMPORTED_MODULE_2__["DescargasFerroviariasService"]])
    ], DescargasFerroviariasMotivoPesagemComponent);
    return DescargasFerroviariasMotivoPesagemComponent;
}());



/***/ }),

/***/ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-motivo/descargas-ferroviarias-motivo.component.ts":
/*!*******************************************************************************************************************************!*\
  !*** ./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-motivo/descargas-ferroviarias-motivo.component.ts ***!
  \*******************************************************************************************************************************/
/*! exports provided: DescargasFerroviariasMotivoComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DescargasFerroviariasMotivoComponent", function() { return DescargasFerroviariasMotivoComponent; });
/* 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_message_message_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! app/shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var _descargas_ferroviarias_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../descargas-ferroviarias.service */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.service.ts");
/* harmony import */ var app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_3__ = __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 __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 DescargasFerroviariasMotivoComponent = /** @class */ (function () {
    function DescargasFerroviariasMotivoComponent(messageService, service) {
        this.messageService = messageService;
        this.service = service;
        this.motivo = "";
        this.outMotivo = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
    }
    DescargasFerroviariasMotivoComponent.prototype.ngOnInit = function () {
        this.motivo = "";
    };
    DescargasFerroviariasMotivoComponent.prototype.onSubmit = function (form) {
        if (app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_3__["StringUtilsStaticService"].isEmpty(this.motivo)) {
            this.messageService.warning("titles.descargasFerroviarias", "messages.informeMotivoExclusao");
            return;
        }
        if (this.motivo.length < 15) {
            this.messageService.warning("titles.descargasFerroviarias", "messages.motivoDeveTerPeloMenos15Caracteres");
            return;
        }
        this.outMotivo.emit(this.motivo);
        jQuery("#descargas-ferroviarias-motivo-dialog").modal("hide");
    };
    DescargasFerroviariasMotivoComponent.ctorParameters = function () { return [
        { type: app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_1__["MessageService"] },
        { type: _descargas_ferroviarias_service__WEBPACK_IMPORTED_MODULE_2__["DescargasFerroviariasService"] }
    ]; };
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"])(),
        __metadata("design:type", Object)
    ], DescargasFerroviariasMotivoComponent.prototype, "outMotivo", void 0);
    DescargasFerroviariasMotivoComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
            selector: "app-descargas-ferroviarias-motivo",
            template: __importDefault(__webpack_require__(/*! raw-loader!./descargas-ferroviarias-motivo.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-motivo/descargas-ferroviarias-motivo.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_1__["MessageService"],
            _descargas_ferroviarias_service__WEBPACK_IMPORTED_MODULE_2__["DescargasFerroviariasService"]])
    ], DescargasFerroviariasMotivoComponent);
    return DescargasFerroviariasMotivoComponent;
}());



/***/ }),

/***/ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-pesagem-para-retorno/descargas-ferroviarias-pesagem-para-retorno.component.ts":
/*!***********************************************************************************************************************************************************!*\
  !*** ./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-pesagem-para-retorno/descargas-ferroviarias-pesagem-para-retorno.component.ts ***!
  \***********************************************************************************************************************************************************/
/*! exports provided: DescargasFerroviariasPesagemParaRetornoComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DescargasFerroviariasPesagemParaRetornoComponent", function() { return DescargasFerroviariasPesagemParaRetornoComponent; });
/* 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_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! app/shared/services/funcoes/funcoes.service */ "./src/app/shared/services/funcoes/funcoes.service.ts");
/* 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 _descargas_ferroviarias_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../descargas-ferroviarias.service */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.service.ts");
/* harmony import */ var _descargas_ferroviarias_pesagem_para_retorno_model__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./descargas-ferroviarias-pesagem-para-retorno.model */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-pesagem-para-retorno/descargas-ferroviarias-pesagem-para-retorno.model.ts");
/* harmony import */ var app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! app/shared/services/event-emitter/event-emitter.service */ "./src/app/shared/services/event-emitter/event-emitter.service.ts");
/* harmony import */ var _descargas_ferroviarias_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../descargas-ferroviarias.constants */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.constants.ts");
/* harmony import */ var app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! app/shared/services/funcoes/configuracao/configuracao.facade */ "./src/app/shared/services/funcoes/configuracao/configuracao.facade.ts");
/* harmony import */ var app_pages_cadastro_balanca_ferroviaria_balanca_ferroviaria_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! app/pages/cadastro/balanca-ferroviaria/balanca-ferroviaria.service */ "./src/app/pages/cadastro/balanca-ferroviaria/balanca-ferroviaria.service.ts");
/* harmony import */ var app_pages_cadastro_balanca_balanca_service__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! app/pages/cadastro/balanca/balanca.service */ "./src/app/pages/cadastro/balanca/balanca.service.ts");
/* harmony import */ var app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_10__ = __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 _descargas_ferroviarias_model__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../descargas-ferroviarias.model */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.model.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 app_shared_services_funcoes_modal_utils_modal_utils_static_service__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! app/shared/services/funcoes/modal-utils/modal-utils.static.service */ "./src/app/shared/services/funcoes/modal-utils/modal-utils.static.service.ts");
/* harmony import */ var _descargas_ferroviarias_validation__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../descargas-ferroviarias.validation */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.validation.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 DescargasFerroviariasPesagemParaRetornoComponent = /** @class */ (function () {
    function DescargasFerroviariasPesagemParaRetornoComponent(configuracao, funcoesService, service, loginService, balancaFerroviariaService, balancaService, messageService, validation) {
        var _this = this;
        this.configuracao = configuracao;
        this.funcoesService = funcoesService;
        this.service = service;
        this.loginService = loginService;
        this.balancaFerroviariaService = balancaFerroviariaService;
        this.balancaService = balancaService;
        this.messageService = messageService;
        this.validation = validation;
        this.executar = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
        this.data = new _descargas_ferroviarias_pesagem_para_retorno_model__WEBPACK_IMPORTED_MODULE_4__["DescargasFerroviariasPesagemParaRetorno"]();
        this.descargaFerro = new _descargas_ferroviarias_model__WEBPACK_IMPORTED_MODULE_11__["DescargasFerroviarias"]();
        this.constantes = new _descargas_ferroviarias_constants__WEBPACK_IMPORTED_MODULE_6__["DescargasFerroviariasConstants"]();
        this.mensagens = [];
        this.comboLinhasPesagem = [];
        this.comboBalancas = [];
        this.disabledDevolucaoTotal = false;
        this.disabledQuebra = true;
        this.labelQuebra = "";
        this.labelStatus = "";
        this.loadConfig = function () { return __awaiter(_this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                if (this.configuracao.isLoadConfig()) {
                    this.service.configs.blFerr = this.configuracao.string("BAL", "BlFerr" + this.configuracao.macAddress);
                    this.service.configs.obrTernoDesc = this.configuracao.boolean("BAL", "ObrTernoDesc");
                    this.service.configs.selBalFerro = this.configuracao.boolean("BAL", "SelBalFerro");
                    this.service.configs.pesagemAutomatica = this.configuracao.boolean("BAL", "PesagemAutomatica");
                    this.service.configs.retVagaoTolerancia = this.configuracao.number("BAL", "RetVagaoTolerancia");
                    this.service.configs.retVagaoDevolucTotal = this.configuracao.boolean("BAL", "RetVagaoDevolucTotal");
                    this.service.configs.bloqLinha2Pes = this.configuracao.boolean("BAL", "BloqLinha2Pes");
                    this.service.configs.justDescarga = this.configuracao.boolean("BAL", "JustDescarga");
                    this.service.configs.justDescargaSb = this.configuracao.boolean("BAL", "JustDescargaSb");
                    this.service.configs.ptJustDescargaF = this.configuracao.number("BAL", "PtJustDescargaF");
                    this.service.configs.ptJustDescargaFSb = this.configuracao.number("BAL", "PtJustDescargaFSb");
                    this.service.configs.selBalComplF = this.configuracao.boolean("BAL", "SelBalComplF");
                    this.service.configs.retVagaoSolJustifica = this.configuracao.boolean("BAL", "RetVagaoSolJustifica");
                    this.service.configs.validaPesagem = this.configuracao.boolean("BAL", "ValidaPesagem");
                }
                return [2 /*return*/];
            });
        }); };
    }
    DescargasFerroviariasPesagemParaRetornoComponent.prototype.ngOnInit = function () {
        this.getConfig();
    };
    DescargasFerroviariasPesagemParaRetornoComponent.prototype.objectSelect = function (opDescargaTremId) {
        var _this = this;
        app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_5__["EventEmitterService"].get("formError").emit();
        this.labelQuebra = "";
        this.labelStatus = "";
        this.service.getById(opDescargaTremId).subscribe(function (resp) {
            if (!!resp) {
                _this.descargaFerro = resp;
                _this.initCampos(_this.descargaFerro);
            }
        });
    };
    DescargasFerroviariasPesagemParaRetornoComponent.prototype.initCampos = function (descargaFerro) {
        this.data = new _descargas_ferroviarias_pesagem_para_retorno_model__WEBPACK_IMPORTED_MODULE_4__["DescargasFerroviariasPesagemParaRetorno"]();
        this.data.opDescargaTremId = descargaFerro.opDescargaTremId;
        this.data.ternoId = descargaFerro.ternoId;
        this.data.pesoBru = descargaFerro.pesoBru;
        this.getLinhasPesagem();
    };
    DescargasFerroviariasPesagemParaRetornoComponent.prototype.getConfig = function () {
        var _this = this;
        this.constantes.listaParam.map(function (c) {
            if (c.sistema === 'BAL') {
                c.parametros.push("BlFerr" + _this.configuracao.macAddress);
            }
        });
        this.configuracao.getConfig({ codRotina: this.constantes.sisFormularioId, configs: this.constantes.listaParam }, this.loadConfig);
    };
    DescargasFerroviariasPesagemParaRetornoComponent.prototype.getLinhasPesagem = function () {
        return __awaiter(this, void 0, void 0, function () {
            var _a;
            return __generator(this, function (_b) {
                switch (_b.label) {
                    case 0:
                        _a = this;
                        return [4 /*yield*/, this.balancaFerroviariaService.getLinhasPesagem(this.service.configs.blFerr).toPromise()];
                    case 1:
                        _a.comboLinhasPesagem = _b.sent();
                        if (this.comboLinhasPesagem.length === 1) {
                            this.data.balancaFerroviariaId = this.comboLinhasPesagem[0].balancaFerroviariaId;
                            this.getBalancas();
                        }
                        return [2 /*return*/];
                }
            });
        });
    };
    DescargasFerroviariasPesagemParaRetornoComponent.prototype.getBalancas = function () {
        var _this = this;
        this.balancaService.getBalancasFerroviarias(this.data.balancaFerroviariaId.toString()).subscribe(function (resp) {
            _this.comboBalancas = resp;
        });
    };
    DescargasFerroviariasPesagemParaRetornoComponent.prototype.onSubmit = function (form) {
        return __awaiter(this, void 0, void 0, function () {
            var _this = this;
            return __generator(this, function (_a) {
                app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_5__["EventEmitterService"].get("formError").emit(form);
                if (form.invalid) {
                    this.funcoesService.backToTop();
                    return [2 /*return*/];
                }
                if (!this.validarDados())
                    return [2 /*return*/];
                if (this.service.configs.validaPesagem && this.service.configs.pesagemAutomatica) {
                    this.messageService.confirm("titles.descargasFerroviarias", "messages.confirmaPesagemManual", null, function () {
                        _this.gravarPesagemParaRetorno();
                    }, false);
                }
                else {
                    this.gravarPesagemParaRetorno();
                }
                return [2 /*return*/];
            });
        });
    };
    DescargasFerroviariasPesagemParaRetornoComponent.prototype.gravarPesagemParaRetorno = function () {
        var _this = this;
        this.service.gravarPesagemParaRetorno(this.data).subscribe(function (resp) {
            if (!resp.isValid) {
                _this.mensagens = _this.messageService.validationResult(resp);
                _this.messageService.warning(_this.service.title, _this.mensagens[0]);
            }
            else {
                _this.messageService.saveSuccess(_this.service.title);
                app_shared_services_funcoes_modal_utils_modal_utils_static_service__WEBPACK_IMPORTED_MODULE_13__["ModalUtilsStaticService"].closeModal("descargas-pesagem-para-retorno-dialog");
                _this.executar.emit();
            }
        });
    };
    DescargasFerroviariasPesagemParaRetornoComponent.prototype.validarDados = function () {
        if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_10__["NumberUtilsStaticService"].isNotPositive(this.data.pesoTara)) {
            this.messageService.warning("titles.descargasFerroviarias", this.messageService.translate("messages.campoObrigatorio", { name: this.messageService.translate("labels.pesoTara") }));
            return false;
        }
        return true;
    };
    DescargasFerroviariasPesagemParaRetornoComponent.prototype.calcPeso = function (resp) {
        if (this.service.configs.pesagemAutomatica) {
            if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_10__["NumberUtilsStaticService"].isNotPositive(resp.peso)) {
                this.data.pesoTara = undefined;
                return;
            }
            this.data.pesoTara = resp.peso;
        }
        this.trataJustQuebra();
    };
    DescargasFerroviariasPesagemParaRetornoComponent.prototype.trataJustQuebra = function () {
        return __awaiter(this, void 0, void 0, function () {
            var kilos, pesoBru, pesoTara, tPesoLiq, diferenca, ptDif;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        kilos = app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_10__["NumberUtilsStaticService"].toNumber(this.descargaFerro.kilos);
                        pesoBru = app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_10__["NumberUtilsStaticService"].toNumber(this.data.pesoBru);
                        pesoTara = app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_10__["NumberUtilsStaticService"].toNumber(this.data.pesoTara);
                        return [4 /*yield*/, this.service.getPesoLiqOpeDescTremPeso(this.descargaFerro.opDescargaTremId)];
                    case 1:
                        tPesoLiq = _a.sent();
                        this.data.pesoLiq = (pesoBru - pesoTara + app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_10__["NumberUtilsStaticService"].toNumber(tPesoLiq));
                        diferenca = Math.abs(kilos - this.data.pesoLiq);
                        this.data.diferenca = diferenca;
                        ptDif = ((app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_10__["NumberUtilsStaticService"].toNumber(this.data.pesoLiq) / kilos) - 1) * 100;
                        this.labelQuebra = app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_10__["NumberUtilsStaticService"].getCurrency(ptDif, 2) + " %";
                        if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_10__["NumberUtilsStaticService"].toNumber(this.data.pesoLiq) > kilos)
                            this.labelStatus = "Sobra";
                        else if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_10__["NumberUtilsStaticService"].toNumber(this.data.pesoLiq) < kilos)
                            this.labelStatus = "Quebra";
                        else
                            this.labelStatus = "";
                        if ((this.data.diferenca > 0 && this.data.diferenca > this.service.configs.retVagaoTolerancia) && this.service.configs.retVagaoDevolucTotal) {
                            this.data.devolucaoTotal = "S";
                            this.disabledDevolucaoTotal = true;
                        }
                        else {
                            this.disabledDevolucaoTotal = false;
                        }
                        return [2 /*return*/];
                }
            });
        });
    };
    Object.defineProperty(DescargasFerroviariasPesagemParaRetornoComponent.prototype, "disabledBtnPeso", {
        get: function () {
            return app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_10__["NumberUtilsStaticService"].isNotPositive(this.data.balancaFerroviariaId);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DescargasFerroviariasPesagemParaRetornoComponent.prototype, "enabledBalanca", {
        get: function () {
            return ((!this.service.configs.pesagemAutomatica || this.service.configs.selBalFerro) && !this.service.configs.bloqLinha2Pes);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DescargasFerroviariasPesagemParaRetornoComponent.prototype, "requiredBalanca", {
        get: function () {
            return this.enabledBalanca;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DescargasFerroviariasPesagemParaRetornoComponent.prototype, "justificativaRequired", {
        get: function () {
            return this.service.configs.retVagaoSolJustifica;
        },
        enumerable: true,
        configurable: true
    });
    DescargasFerroviariasPesagemParaRetornoComponent.ctorParameters = function () { return [
        { type: app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_7__["ConfiguracaoFacade"] },
        { type: app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_1__["FuncoesService"] },
        { type: _descargas_ferroviarias_service__WEBPACK_IMPORTED_MODULE_3__["DescargasFerroviariasService"] },
        { type: app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_2__["LoginService"] },
        { type: app_pages_cadastro_balanca_ferroviaria_balanca_ferroviaria_service__WEBPACK_IMPORTED_MODULE_8__["BalancaFerroviariaService"] },
        { type: app_pages_cadastro_balanca_balanca_service__WEBPACK_IMPORTED_MODULE_9__["BalancaService"] },
        { type: app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_12__["MessageService"] },
        { type: _descargas_ferroviarias_validation__WEBPACK_IMPORTED_MODULE_14__["DescargasFerroviariasValidation"] }
    ]; };
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"])(),
        __metadata("design:type", Object)
    ], DescargasFerroviariasPesagemParaRetornoComponent.prototype, "executar", void 0);
    DescargasFerroviariasPesagemParaRetornoComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
            selector: "app-descargas-ferroviarias-pesagem-para-retorno",
            template: __importDefault(__webpack_require__(/*! raw-loader!./descargas-ferroviarias-pesagem-para-retorno.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-pesagem-para-retorno/descargas-ferroviarias-pesagem-para-retorno.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_7__["ConfiguracaoFacade"],
            app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_1__["FuncoesService"],
            _descargas_ferroviarias_service__WEBPACK_IMPORTED_MODULE_3__["DescargasFerroviariasService"],
            app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_2__["LoginService"],
            app_pages_cadastro_balanca_ferroviaria_balanca_ferroviaria_service__WEBPACK_IMPORTED_MODULE_8__["BalancaFerroviariaService"],
            app_pages_cadastro_balanca_balanca_service__WEBPACK_IMPORTED_MODULE_9__["BalancaService"],
            app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_12__["MessageService"],
            _descargas_ferroviarias_validation__WEBPACK_IMPORTED_MODULE_14__["DescargasFerroviariasValidation"]])
    ], DescargasFerroviariasPesagemParaRetornoComponent);
    return DescargasFerroviariasPesagemParaRetornoComponent;
}());



/***/ }),

/***/ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-pesagem-para-retorno/descargas-ferroviarias-pesagem-para-retorno.model.ts":
/*!*******************************************************************************************************************************************************!*\
  !*** ./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-pesagem-para-retorno/descargas-ferroviarias-pesagem-para-retorno.model.ts ***!
  \*******************************************************************************************************************************************************/
/*! exports provided: DescargasFerroviariasPesagemParaRetorno */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DescargasFerroviariasPesagemParaRetorno", function() { return DescargasFerroviariasPesagemParaRetorno; });
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};
var DescargasFerroviariasPesagemParaRetorno = /** @class */ (function () {
    function DescargasFerroviariasPesagemParaRetorno() {
        this.balancaFerroviariaId = "";
        this.balancaId = "";
        this.pesoBru = 0;
        this.pesoTara = 0;
        this.devolucaoTotal = "N";
        this.justificativa = "";
    }
    return DescargasFerroviariasPesagemParaRetorno;
}());



/***/ }),

/***/ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-primeira-pesagem/descargas-ferroviarias-primeira-pesagem.component.ts":
/*!***************************************************************************************************************************************************!*\
  !*** ./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-primeira-pesagem/descargas-ferroviarias-primeira-pesagem.component.ts ***!
  \***************************************************************************************************************************************************/
/*! exports provided: DescargasFerroviariasPrimeiraPesagemComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DescargasFerroviariasPrimeiraPesagemComponent", function() { return DescargasFerroviariasPrimeiraPesagemComponent; });
/* 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 _shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../shared/services/funcoes/configuracao/configuracao.facade */ "./src/app/shared/services/funcoes/configuracao/configuracao.facade.ts");
/* harmony import */ var _descargas_ferroviarias_laudo_descargas_ferroviarias_laudo_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../descargas-ferroviarias-laudo/descargas-ferroviarias-laudo.component */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-laudo/descargas-ferroviarias-laudo.component.ts");
/* harmony import */ var _descargas_ferroviarias_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../descargas-ferroviarias.constants */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.constants.ts");
/* harmony import */ var _descargas_ferroviarias_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../descargas-ferroviarias.service */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.service.ts");
/* harmony import */ var _descargas_ferroviarias_validation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../descargas-ferroviarias.validation */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.validation.ts");
/* harmony import */ var _pages_cadastro_balanca_ferroviaria_balanca_ferroviaria_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./../../../../pages/cadastro/balanca-ferroviaria/balanca-ferroviaria.service */ "./src/app/pages/cadastro/balanca-ferroviaria/balanca-ferroviaria.service.ts");
/* harmony import */ var _pages_cadastro_balanca_balanca_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./../../../../pages/cadastro/balanca/balanca.service */ "./src/app/pages/cadastro/balanca/balanca.service.ts");
/* harmony import */ var _shared_components_corporate_base_base_permissoes__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./../../../../shared/components/corporate/base/base.permissoes */ "./src/app/shared/components/corporate/base/base.permissoes.ts");
/* harmony import */ var _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./../../../../shared/services/event-emitter/event-emitter.service */ "./src/app/shared/services/event-emitter/event-emitter.service.ts");
/* harmony import */ var _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./../../../../shared/services/funcoes/funcoes.service */ "./src/app/shared/services/funcoes/funcoes.service.ts");
/* harmony import */ var _shared_services_funcoes_modal_utils_modal_utils_static_service__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./../../../../shared/services/funcoes/modal-utils/modal-utils.static.service */ "./src/app/shared/services/funcoes/modal-utils/modal-utils.static.service.ts");
/* harmony import */ var _shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./../../../../shared/services/funcoes/number-utils/number-utils.static.service */ "./src/app/shared/services/funcoes/number-utils/number-utils.static.service.ts");
/* harmony import */ var _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./../../../../shared/services/funcoes/permissoes-utils/permissoes-utils.service */ "./src/app/shared/services/funcoes/permissoes-utils/permissoes-utils.service.ts");
/* harmony import */ var _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./../../../../shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var _login_login_service__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./../../../login/login.service */ "./src/app/pages/login/login.service.ts");
/* harmony import */ var _descargas_ferroviarias_primeira_pesagem_model__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./descargas-ferroviarias-primeira-pesagem.model */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-primeira-pesagem/descargas-ferroviarias-primeira-pesagem.model.ts");
/* harmony import */ var app_shared_components_commons_corrige_placa_ocr_corrige_placa_ocr_component__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! app/shared/components/commons/corrige-placa-ocr/corrige-placa-ocr.component */ "./src/app/shared/components/commons/corrige-placa-ocr/corrige-placa-ocr.component.ts");
/* harmony import */ var app_shared_components_commons_corrige_placa_ocr_corrige_placa_ocr_model__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! app/shared/components/commons/corrige-placa-ocr/corrige-placa-ocr.model */ "./src/app/shared/components/commons/corrige-placa-ocr/corrige-placa-ocr.model.ts");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (undefined && undefined.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
    function verb(n) { return function (v) { return step([n, v]); }; }
    function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (_) try {
            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
            if (y = 0, t) op = [op[0] & 2, t.value];
            switch (op[0]) {
                case 0: case 1: t = op; break;
                case 4: _.label++; return { value: op[1], done: false };
                case 5: _.label++; y = op[1]; op = [0]; continue;
                case 7: op = _.ops.pop(); _.trys.pop(); continue;
                default:
                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                    if (t[2]) _.ops.pop();
                    _.trys.pop(); continue;
            }
            op = body.call(thisArg, _);
        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
    }
};
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};




















var DescargasFerroviariasPrimeiraPesagemComponent = /** @class */ (function (_super) {
    __extends(DescargasFerroviariasPrimeiraPesagemComponent, _super);
    function DescargasFerroviariasPrimeiraPesagemComponent(configuracao, validation, balancaFerroviariaService, balancaService, router, activatedRoute, funcoes, messageService, loginService, service, permissoesUtils) {
        var _this = _super.call(this, new _descargas_ferroviarias_constants__WEBPACK_IMPORTED_MODULE_4__["DescargasFerroviariasConstants"](), funcoes) || this;
        _this.configuracao = configuracao;
        _this.validation = validation;
        _this.balancaFerroviariaService = balancaFerroviariaService;
        _this.balancaService = balancaService;
        _this.router = router;
        _this.activatedRoute = activatedRoute;
        _this.funcoes = funcoes;
        _this.messageService = messageService;
        _this.loginService = loginService;
        _this.service = service;
        _this.permissoesUtils = permissoesUtils;
        _this.data = new _descargas_ferroviarias_primeira_pesagem_model__WEBPACK_IMPORTED_MODULE_17__["DescargasFerroviariasPrimeiraPesagem"]();
        _this.constantes = new _descargas_ferroviarias_constants__WEBPACK_IMPORTED_MODULE_4__["DescargasFerroviariasConstants"]();
        _this.mensagens = [];
        _this.comboLinhasPesagem = [];
        _this.comboBalancas = [];
        _this.pageRoute = "/balanca/descargasFerroviarias";
        _this.target = _this.funcoes.getTargetLocation();
        _this.loadConfig = function () { return __awaiter(_this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                if (this.configuracao.isLoadConfig()) {
                    this.service.configs.blFerr = this.configuracao.string("BAL", "BlFerr");
                    this.service.configs.ocrPsFer = this.configuracao.boolean("BAL", "OcrPsFer");
                    this.service.configs.pesagemAutomatica = this.configuracao.boolean("BAL", "PesagemAutomatica");
                    this.service.configs.selBalFerro = this.configuracao.boolean("BAL", "SelBalFerro");
                    this.service.configs.bloqueiaAut = this.configuracao.boolean("BAL", "BloqueiaAut");
                    this.service.configs.flagObrigaAprov = this.configuracao.boolean("BAL", "FlagObrigaAprov");
                    this.service.configs.kgDifSobra = this.configuracao.number("BAL", "KgDifSobra");
                    this.service.configs.ptDifPesoOrigem = this.configuracao.number("BAL", "PtDifPesoOrigem");
                    this.service.configs.kgDifPesoOrigem = this.configuracao.number("BAL", "KgDifPesoOrigem");
                    this.getLinhasPesagem();
                }
                return [2 /*return*/];
            });
        }); };
        router.events.subscribe(function (event) {
            var params = _this.funcoes.formParams.getParams(router, event);
            if (params) {
                _this.actionForm = params.action;
            }
        });
        return _this;
    }
    DescargasFerroviariasPrimeiraPesagemComponent.prototype.ngOnInit = function () {
        var _this = this;
        this.permissoesUtils.validRotina(this.constantes.sisFormularioId, 14, function () { return __awaiter(_this, void 0, void 0, function () {
            var obj, object;
            var _this = this;
            return __generator(this, function (_a) {
                obj = this.activatedRoute.snapshot.paramMap.get("object");
                if (!obj) {
                    this.messageService.warning(this.service.title, "message.nenhumRegistroEncontrado");
                    return [2 /*return*/];
                }
                this.getConfig();
                object = JSON.parse(atob(obj));
                this.data = new _descargas_ferroviarias_primeira_pesagem_model__WEBPACK_IMPORTED_MODULE_17__["DescargasFerroviariasPrimeiraPesagem"]();
                this.data.opDescargaTremId = object.opDescargaTremId;
                this.data.cadastroPlacaId = object.cadastroPlacaId;
                this.service.getById(object.opDescargaTremId).subscribe(function (r) {
                    _this.service.data = r;
                });
                return [2 /*return*/];
            });
        }); }, function () {
            _this.permissoesUtils.back();
        });
    };
    DescargasFerroviariasPrimeiraPesagemComponent.prototype.preparaOcr = function () {
        return __awaiter(this, void 0, void 0, function () {
            var dadosOcr, valid;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        if (!(this.service.configs.ocrPsFer && !!this.data.balancaId)) return [3 /*break*/, 2];
                        dadosOcr = new app_shared_components_commons_corrige_placa_ocr_corrige_placa_ocr_model__WEBPACK_IMPORTED_MODULE_19__["CorrigePlacaOcr"](app_shared_components_commons_corrige_placa_ocr_corrige_placa_ocr_model__WEBPACK_IMPORTED_MODULE_19__["CorrigePlacaOcr"].Entrada, app_shared_components_commons_corrige_placa_ocr_corrige_placa_ocr_model__WEBPACK_IMPORTED_MODULE_19__["CorrigePlacaOcr"].Ferro, this.data.cadastroPlacaId);
                        dadosOcr.tipoBusca = app_shared_components_commons_corrige_placa_ocr_corrige_placa_ocr_model__WEBPACK_IMPORTED_MODULE_19__["CorrigePlacaOcr"].DescargaFerroviaria;
                        dadosOcr.idCorporate = this.data.opDescargaTremId;
                        dadosOcr.codRotina = this.constantes.sisFormularioId;
                        dadosOcr.codBalanca = this.data.balancaId;
                        return [4 /*yield*/, this.corrigePlacaOcr.open(dadosOcr)];
                    case 1:
                        valid = _a.sent();
                        if (valid) {
                            return [2 /*return*/, true];
                        }
                        _a.label = 2;
                    case 2: return [2 /*return*/, false];
                }
            });
        });
    };
    DescargasFerroviariasPrimeiraPesagemComponent.prototype.getConfig = function () {
        var _this = this;
        this.constantes.listaParam.map(function (c) {
            if (c.sistema === 'BAL') {
                c.parametros.push("BlFerr" + _this.configuracao.macAddress);
                c.parametros.push("OcrPsFer" + _this.configuracao.macAddress);
            }
        });
        this.configuracao.getConfig({ codRotina: this.constantes.sisFormularioId, configs: this.constantes.listaParam }, this.loadConfig);
    };
    DescargasFerroviariasPrimeiraPesagemComponent.prototype.getLinhasPesagem = function () {
        var _this = this;
        this.balancaFerroviariaService.getLinhasPesagem(this.service.configs.blFerr).subscribe(function (resp) {
            _this.comboLinhasPesagem = resp;
            if (_this.comboLinhasPesagem.length === 1) {
                _this.data.balancaFerroviariaId = _this.comboLinhasPesagem[0].balancaFerroviariaId;
                _this.getBalancas();
            }
        });
    };
    DescargasFerroviariasPrimeiraPesagemComponent.prototype.getBalancas = function () {
        var _this = this;
        this.balancaService.getBalancasFerroviarias(this.data.balancaFerroviariaId.toString()).subscribe(function (resp) {
            _this.comboBalancas = resp;
        });
    };
    DescargasFerroviariasPrimeiraPesagemComponent.prototype.getPeso = function (resp) {
        if (this.service.configs.pesagemAutomatica) {
            if (_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_13__["NumberUtilsStaticService"].isNotPositive(resp.peso)) {
                this.data.pesoBru = undefined;
                return;
            }
            this.data.pesoBru = resp.peso;
        }
        this.data.flagManual = this.service.configs.bloqueiaAut ? "S" : "N";
    };
    DescargasFerroviariasPrimeiraPesagemComponent.prototype.onSubmit = function (form) {
        return __awaiter(this, void 0, void 0, function () {
            var hasOcr;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_10__["EventEmitterService"].get("formError").emit(form);
                        if (form.invalid) {
                            return [2 /*return*/];
                        }
                        if (!this.validarDados())
                            return [2 /*return*/];
                        if (!this.validaLaudoPorDifPeso())
                            return [2 /*return*/];
                        return [4 /*yield*/, this.preparaOcr()];
                    case 1:
                        hasOcr = _a.sent();
                        if (hasOcr)
                            return [2 /*return*/];
                        this.confirma();
                        return [2 /*return*/];
                }
            });
        });
    };
    DescargasFerroviariasPrimeiraPesagemComponent.prototype.validaLaudoPorDifPeso = function () {
        var ptDifPesoDest = 0;
        var difKilosDest = 0;
        var diferenca = 0;
        var difSobra = 0;
        var ptDifPesoOrigem = 0;
        var kgDifPesoOrigem = 0;
        var kgDifSobra = 0;
        if (!!this.service.data && !!this.service.data.transportadora) {
            ptDifPesoDest = this.service.data.transportadora.ptDifPesoDest;
            difKilosDest = this.service.data.transportadora.difKilosDest;
            ptDifPesoOrigem = this.service.configs.ptDifPesoOrigem;
            kgDifPesoOrigem = this.service.configs.kgDifPesoOrigem;
            kgDifSobra = this.service.configs.kgDifSobra;
            if (ptDifPesoDest > 0)
                ptDifPesoOrigem = ptDifPesoDest;
            if (difKilosDest > 0)
                kgDifPesoOrigem = difKilosDest;
            if (!(this.service.data.pesoBruOrigem > 0))
                return true;
            if (ptDifPesoOrigem === 0 && kgDifPesoOrigem === 0)
                return true;
            diferenca = this.data.pesoBru - this.service.data.pesoBruOrigem;
            if (kgDifSobra > 0 && diferenca > 0) {
                difSobra = diferenca;
                diferenca = 0;
            }
            else {
                difSobra = 0;
                diferenca = Math.abs(diferenca);
            }
            if (kgDifPesoOrigem > 0 && diferenca > kgDifPesoOrigem) {
                this.laudo.open(1, kgDifPesoOrigem, diferenca);
                return false;
            }
            else if (kgDifSobra > 0 && difSobra > kgDifSobra) {
                this.laudo.open(3, kgDifSobra, diferenca);
                return false;
            }
            else {
                if (ptDifPesoOrigem > 0) {
                    if (((diferenca / this.service.data.pesoBruOrigem) * 100) > ptDifPesoOrigem) {
                        this.laudo.open(2, ptDifPesoOrigem, diferenca, [
                            ' - Avisar o manobrista para interditar o vagão',
                            ' - Avisar ao supervisor Operacional',
                            ' - Avisar ao cliente quando necessário',
                            ' - Acionar a Ferrovia para vistoria e emissão do laudo'
                        ]);
                        return false;
                    }
                }
            }
        }
        return true;
    };
    DescargasFerroviariasPrimeiraPesagemComponent.prototype.confirma = function () {
        var _this = this;
        this.service.gravarPrimeiraPesagem(this.data).subscribe(function (resp) {
            if (!resp.validationResult.isValid) {
                _this.validation.showMessagesResult(resp.validationResult);
            }
            else {
                _this.back();
            }
        });
    };
    DescargasFerroviariasPrimeiraPesagemComponent.prototype.confirmaOcr = function (dadosPlaca) {
        this.data.placaDig1 = this.data.cadastroPlacaId;
        this.data.cadastroPlacaId = dadosPlaca.placas[0];
        this.data.placaOcr1 = dadosPlaca.placas[3];
        this.data.justificativaOcr = dadosPlaca.justificativas[0];
        this.data.ocrRtsSessao = dadosPlaca.sessao;
        this.data.ocrRtsGate = dadosPlaca.gate;
        this.confirma();
    };
    DescargasFerroviariasPrimeiraPesagemComponent.prototype.cancelaLaudoDifPeso = function () {
        _shared_services_funcoes_modal_utils_modal_utils_static_service__WEBPACK_IMPORTED_MODULE_12__["ModalUtilsStaticService"].closeModal('descfer-primeira-pesagem-dialog');
        var mensagens = [];
        if (_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_13__["NumberUtilsStaticService"].toNumber(this.service.data.pesoBru) < 1000)
            mensagens.push("messages.pesoInvalido");
        mensagens.push("messages.necessarioVerificarDiferencaPesoBruto");
        _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_10__["EventEmitterService"].get("backError").emit(mensagens);
    };
    DescargasFerroviariasPrimeiraPesagemComponent.prototype.confirmaLaudoDifPeso = function () {
        return __awaiter(this, void 0, void 0, function () {
            var hasOcr;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.preparaOcr()];
                    case 1:
                        hasOcr = _a.sent();
                        if (hasOcr)
                            return [2 /*return*/];
                        this.confirma();
                        return [2 /*return*/];
                }
            });
        });
    };
    DescargasFerroviariasPrimeiraPesagemComponent.prototype.validarDados = function () {
        var _this = this;
        if (_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_13__["NumberUtilsStaticService"].isNotPositive(this.data.balancaFerroviariaId)) {
            this.messageService.warning(this.service.title, "messages.linhaPesagemFerroviariaNaoSelecionada");
            return false;
        }
        if (!this.disabledBalanca) {
            if (_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_13__["NumberUtilsStaticService"].isNotPositive(this.data.balancaId)) {
                this.messageService.warning(this.service.title, "messages.balancaFerroviariaNaoSelecionada");
                return false;
            }
            var balancaSelecionada = this.comboBalancas.find(function (b) { return b.balancaId === _this.data.balancaId; });
            if (this.service.configs.bloqueiaAut && (balancaSelecionada && balancaSelecionada.flagAutoPes === "S")) {
                this.messageService.warning(this.service.title, "messages.balancaNaAutomacaoPesagemNaoPermitida");
                this.data.pesoBru = undefined;
                return false;
            }
        }
        return true;
    };
    DescargasFerroviariasPrimeiraPesagemComponent.prototype.back = function () {
        this.funcoesService.desabilitarFiltro();
        this.router.navigate(["" + this.target + this.pageRoute]);
    };
    Object.defineProperty(DescargasFerroviariasPrimeiraPesagemComponent.prototype, "disabledBtnPeso", {
        get: function () {
            return _shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_13__["NumberUtilsStaticService"].isNotPositive(this.data.balancaFerroviariaId);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DescargasFerroviariasPrimeiraPesagemComponent.prototype, "disabledBalanca", {
        get: function () {
            return !this.service.configs.pesagemAutomatica || !this.service.configs.selBalFerro;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DescargasFerroviariasPrimeiraPesagemComponent.prototype, "requiredBalanca", {
        get: function () {
            return !this.disabledBalanca;
        },
        enumerable: true,
        configurable: true
    });
    DescargasFerroviariasPrimeiraPesagemComponent.ctorParameters = function () { return [
        { type: _shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_2__["ConfiguracaoFacade"] },
        { type: _descargas_ferroviarias_validation__WEBPACK_IMPORTED_MODULE_6__["DescargasFerroviariasValidation"] },
        { type: _pages_cadastro_balanca_ferroviaria_balanca_ferroviaria_service__WEBPACK_IMPORTED_MODULE_7__["BalancaFerroviariaService"] },
        { type: _pages_cadastro_balanca_balanca_service__WEBPACK_IMPORTED_MODULE_8__["BalancaService"] },
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"] },
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_1__["ActivatedRoute"] },
        { type: _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_11__["FuncoesService"] },
        { type: _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_15__["MessageService"] },
        { type: _login_login_service__WEBPACK_IMPORTED_MODULE_16__["LoginService"] },
        { type: _descargas_ferroviarias_service__WEBPACK_IMPORTED_MODULE_5__["DescargasFerroviariasService"] },
        { type: _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_14__["PermissoesUtilsService"] }
    ]; };
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewChild"])(_descargas_ferroviarias_laudo_descargas_ferroviarias_laudo_component__WEBPACK_IMPORTED_MODULE_3__["DescargasFerroviariasLaudoComponent"], { static: false }),
        __metadata("design:type", _descargas_ferroviarias_laudo_descargas_ferroviarias_laudo_component__WEBPACK_IMPORTED_MODULE_3__["DescargasFerroviariasLaudoComponent"])
    ], DescargasFerroviariasPrimeiraPesagemComponent.prototype, "laudo", void 0);
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewChild"])(app_shared_components_commons_corrige_placa_ocr_corrige_placa_ocr_component__WEBPACK_IMPORTED_MODULE_18__["CorrigePlacaOcrComponent"], { static: false }),
        __metadata("design:type", app_shared_components_commons_corrige_placa_ocr_corrige_placa_ocr_component__WEBPACK_IMPORTED_MODULE_18__["CorrigePlacaOcrComponent"])
    ], DescargasFerroviariasPrimeiraPesagemComponent.prototype, "corrigePlacaOcr", void 0);
    DescargasFerroviariasPrimeiraPesagemComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
            selector: "app-descargas-ferroviarias-primeira-pesagem",
            template: __importDefault(__webpack_require__(/*! raw-loader!./descargas-ferroviarias-primeira-pesagem.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-primeira-pesagem/descargas-ferroviarias-primeira-pesagem.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_2__["ConfiguracaoFacade"],
            _descargas_ferroviarias_validation__WEBPACK_IMPORTED_MODULE_6__["DescargasFerroviariasValidation"],
            _pages_cadastro_balanca_ferroviaria_balanca_ferroviaria_service__WEBPACK_IMPORTED_MODULE_7__["BalancaFerroviariaService"],
            _pages_cadastro_balanca_balanca_service__WEBPACK_IMPORTED_MODULE_8__["BalancaService"],
            _angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"],
            _angular_router__WEBPACK_IMPORTED_MODULE_1__["ActivatedRoute"],
            _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_11__["FuncoesService"],
            _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_15__["MessageService"],
            _login_login_service__WEBPACK_IMPORTED_MODULE_16__["LoginService"],
            _descargas_ferroviarias_service__WEBPACK_IMPORTED_MODULE_5__["DescargasFerroviariasService"],
            _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_14__["PermissoesUtilsService"]])
    ], DescargasFerroviariasPrimeiraPesagemComponent);
    return DescargasFerroviariasPrimeiraPesagemComponent;
}(_shared_components_corporate_base_base_permissoes__WEBPACK_IMPORTED_MODULE_9__["BasePermissoes"]));



/***/ }),

/***/ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-primeira-pesagem/descargas-ferroviarias-primeira-pesagem.model.ts":
/*!***********************************************************************************************************************************************!*\
  !*** ./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-primeira-pesagem/descargas-ferroviarias-primeira-pesagem.model.ts ***!
  \***********************************************************************************************************************************************/
/*! exports provided: DescargasFerroviariasPrimeiraPesagem */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DescargasFerroviariasPrimeiraPesagem", function() { return DescargasFerroviariasPrimeiraPesagem; });
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};
var DescargasFerroviariasPrimeiraPesagem = /** @class */ (function () {
    function DescargasFerroviariasPrimeiraPesagem() {
        this.balancaFerroviariaId = "";
        this.balancaId = "";
    }
    return DescargasFerroviariasPrimeiraPesagem;
}());



/***/ }),

/***/ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-print-modal/descargas-ferroviarias-print-modal.component.ts":
/*!*****************************************************************************************************************************************!*\
  !*** ./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-print-modal/descargas-ferroviarias-print-modal.component.ts ***!
  \*****************************************************************************************************************************************/
/*! exports provided: DescargasFerroviariasPrintModalComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DescargasFerroviariasPrintModalComponent", function() { return DescargasFerroviariasPrintModalComponent; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/fesm5/router.js");
/* harmony import */ var app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! app/shared/services/event-emitter/event-emitter.service */ "./src/app/shared/services/event-emitter/event-emitter.service.ts");
/* harmony import */ var app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! app/shared/services/funcoes/funcoes.service */ "./src/app/shared/services/funcoes/funcoes.service.ts");
/* harmony import */ var _descargas_ferroviarias_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../descargas-ferroviarias.service */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.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 DescargasFerroviariasPrintModalComponent = /** @class */ (function () {
    function DescargasFerroviariasPrintModalComponent(router, funcoes, service) {
        this.router = router;
        this.funcoes = funcoes;
        this.service = service;
        this.outConfirma = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
    }
    DescargasFerroviariasPrintModalComponent.prototype.ngOnInit = function () {
        var _this = this;
        this.router.events.subscribe(function (event) {
            var params = _this.funcoes.formParams.getParams(_this.router, event);
        });
        this.tipoSelecionado = "";
        this.initListaTiposImpressao();
    };
    DescargasFerroviariasPrintModalComponent.prototype.initListaTiposImpressao = function () {
        this.tiposImpressao = [
            { value: "", label: "labels.selecione" },
            { value: "listagem", label: "labels.impressaoDeListagem" },
            { value: "requisicao", label: "labels.impressaoDeRequisicao" },
            { value: "ticket", label: "labels.impressaoDeTicket" },
            { value: "boletimOcorrencia", label: "labels.impressaoDeBoletimOcorrencia" }
        ];
    };
    DescargasFerroviariasPrintModalComponent.prototype.onSubmit = function (form) {
        if (form.invalid) {
            app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_2__["EventEmitterService"].get("formError").emit(form);
            return;
        }
        this.outConfirma.emit(this.tipoSelecionado);
        this.tipoSelecionado = "";
        jQuery("#modalPrint").modal("hide");
    };
    DescargasFerroviariasPrintModalComponent.ctorParameters = function () { return [
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"] },
        { type: app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_3__["FuncoesService"] },
        { type: _descargas_ferroviarias_service__WEBPACK_IMPORTED_MODULE_4__["DescargasFerroviariasService"] }
    ]; };
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"])(),
        __metadata("design:type", Object)
    ], DescargasFerroviariasPrintModalComponent.prototype, "outConfirma", void 0);
    DescargasFerroviariasPrintModalComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
            selector: "app-descargas-ferroviarias-print-modal",
            template: __importDefault(__webpack_require__(/*! raw-loader!./descargas-ferroviarias-print-modal.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-print-modal/descargas-ferroviarias-print-modal.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [_angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"],
            app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_3__["FuncoesService"],
            _descargas_ferroviarias_service__WEBPACK_IMPORTED_MODULE_4__["DescargasFerroviariasService"]])
    ], DescargasFerroviariasPrintModalComponent);
    return DescargasFerroviariasPrintModalComponent;
}());



/***/ }),

/***/ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-segunda-pesagem/descargas-ferroviarias-segunda-pesagem.component.ts":
/*!*************************************************************************************************************************************************!*\
  !*** ./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-segunda-pesagem/descargas-ferroviarias-segunda-pesagem.component.ts ***!
  \*************************************************************************************************************************************************/
/*! exports provided: DescargasFerroviariasSegundaPesagemComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DescargasFerroviariasSegundaPesagemComponent", function() { return DescargasFerroviariasSegundaPesagemComponent; });
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/fesm5/router.js");
/* harmony import */ var app_pages_cadastro_balanca_ferroviaria_balanca_ferroviaria_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! app/pages/cadastro/balanca-ferroviaria/balanca-ferroviaria.service */ "./src/app/pages/cadastro/balanca-ferroviaria/balanca-ferroviaria.service.ts");
/* harmony import */ var app_pages_cadastro_balanca_balanca_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! app/pages/cadastro/balanca/balanca.service */ "./src/app/pages/cadastro/balanca/balanca.service.ts");
/* harmony import */ var app_pages_cadastro_tipo_veiculo_tipo_veiculo_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! app/pages/cadastro/tipo-veiculo/tipo-veiculo.service */ "./src/app/pages/cadastro/tipo-veiculo/tipo-veiculo.service.ts");
/* harmony import */ var app_shared_components_corporate_base_base_permissoes__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! app/shared/components/corporate/base/base.permissoes */ "./src/app/shared/components/corporate/base/base.permissoes.ts");
/* harmony import */ var app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! app/shared/services/funcoes/date-time-utils/date-time-utils.static.service */ "./src/app/shared/services/funcoes/date-time-utils/date-time-utils.static.service.ts");
/* harmony import */ var _shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../../shared/services/funcoes/configuracao/configuracao.facade */ "./src/app/shared/services/funcoes/configuracao/configuracao.facade.ts");
/* harmony import */ var _descargas_ferroviarias_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../descargas-ferroviarias.constants */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.constants.ts");
/* harmony import */ var _descargas_ferroviarias_model__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../descargas-ferroviarias.model */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.model.ts");
/* harmony import */ var _descargas_ferroviarias_service__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../descargas-ferroviarias.service */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.service.ts");
/* harmony import */ var _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./../../../../shared/services/event-emitter/event-emitter.service */ "./src/app/shared/services/event-emitter/event-emitter.service.ts");
/* harmony import */ var _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./../../../../shared/services/funcoes/funcoes.service */ "./src/app/shared/services/funcoes/funcoes.service.ts");
/* harmony import */ var _shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./../../../../shared/services/funcoes/number-utils/number-utils.static.service */ "./src/app/shared/services/funcoes/number-utils/number-utils.static.service.ts");
/* harmony import */ var _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./../../../../shared/services/funcoes/permissoes-utils/permissoes-utils.service */ "./src/app/shared/services/funcoes/permissoes-utils/permissoes-utils.service.ts");
/* harmony import */ var _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./../../../../shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var _login_login_service__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./../../../login/login.service */ "./src/app/pages/login/login.service.ts");
/* harmony import */ var _descargas_ferroviarias_segunda_pesagem_model__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./descargas-ferroviarias-segunda-pesagem.model */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-segunda-pesagem/descargas-ferroviarias-segunda-pesagem.model.ts");
/* harmony import */ var _descargas_ferroviarias_validation__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../descargas-ferroviarias.validation */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.validation.ts");
/* harmony import */ var app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_20__ = __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 DescargasFerroviariasSegundaPesagemComponent = /** @class */ (function (_super) {
    __extends(DescargasFerroviariasSegundaPesagemComponent, _super);
    function DescargasFerroviariasSegundaPesagemComponent(configuracao, balancaFerrofiaService, validation, service, balancaService, router, activatedRoute, funcoes, messageService, loginService, tipoVeiculoService, permissoesUtils) {
        var _this = _super.call(this, new _descargas_ferroviarias_constants__WEBPACK_IMPORTED_MODULE_9__["DescargasFerroviariasConstants"](), funcoes) || this;
        _this.configuracao = configuracao;
        _this.balancaFerrofiaService = balancaFerrofiaService;
        _this.validation = validation;
        _this.service = service;
        _this.balancaService = balancaService;
        _this.router = router;
        _this.activatedRoute = activatedRoute;
        _this.funcoes = funcoes;
        _this.messageService = messageService;
        _this.loginService = loginService;
        _this.tipoVeiculoService = tipoVeiculoService;
        _this.permissoesUtils = permissoesUtils;
        _this.data = new _descargas_ferroviarias_segunda_pesagem_model__WEBPACK_IMPORTED_MODULE_18__["DescargasFerroviariasSegundaPesagem"]();
        _this.descarga = new _descargas_ferroviarias_model__WEBPACK_IMPORTED_MODULE_10__["DescargasFerroviarias"]();
        _this.constantes = new _descargas_ferroviarias_constants__WEBPACK_IMPORTED_MODULE_9__["DescargasFerroviariasConstants"]();
        _this.mensagens = [];
        _this.comboLinhasPesagem = [];
        _this.comboBalancas = [];
        _this.tmpOperTipoVeiculo = 0;
        _this.pageRoute = "/balanca/descargasFerroviarias";
        _this.target = _this.funcoes.getTargetLocation();
        _this.loadConfig = function () { return __awaiter(_this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                if (this.configuracao.isLoadConfig()) {
                    this.service.configs.blFerr = this.configuracao.string("BAL", "BlFerr" + this.configuracao.macAddress);
                    this.service.configs.pesagemAutomatica = this.configuracao.boolean("BAL", "PesagemAutomatica");
                    this.service.configs.selBalFerro = this.configuracao.boolean("BAL", "SelBalFerro");
                    this.service.configs.bloqueiaAut = this.configuracao.boolean("BAL", "BloqueiaAut");
                    this.service.configs.obrigaHrOperacao = this.configuracao.boolean("BAL", "ObrigaHrOperacao");
                    this.service.configs.obrTernoDesc = this.configuracao.boolean("BAL", "ObrTernoDesc");
                    this.service.configs.justDescarga = this.configuracao.boolean("BAL", "JustDescarga");
                    this.service.configs.justDescargaSb = this.configuracao.boolean("BAL", "JustDescargaSb");
                    this.service.configs.ptJustDescargaF = this.configuracao.number("BAL", "PtJustDescargaF");
                    this.service.configs.ptJustDescargaFSb = this.configuracao.number("BAL", "PtJustDescargaFSb");
                    this.service.configs.validaPesagem = this.configuracao.boolean("BAL", "ValidaPesagem");
                    this.service.configs.boletimOcorrencia = this.configuracao.boolean("BAL", "BoletimOcorrencia");
                    this.service.configs.pesoMaxFerBO = this.configuracao.number("BAL", "PesoMaxFerBO");
                    this.service.configs.justAtraso = this.configuracao.boolean("BAL", "JustAtraso");
                    this.service.configs.cWebModOCDF = this.configuracao.string("WEB", "CWebModOCDF");
                    this.service.configs.cWebModTicketF = this.configuracao.string("WEB", "CWebModTicketF");
                    this.service.configs.depositoADefinir = this.configuracao.string("BAL", "DepositoADefinir");
                    this.service.configs.solConclLaudoSegPesF = this.configuracao.boolean("BAL", "SolConclLaudoSegPesF");
                    this.service.configs.prefixoRelEspecifico = this.configuracao.string("WEB", "PrefixoRelEspecifico");
                    this.service.configs.obrigPlataformaVagao = this.configuracao.string("WEB", "ObrigPlataformaVagao");
                    this.getLinhasPesagem();
                }
                return [2 /*return*/];
            });
        }); };
        router.events.subscribe(function (event) {
            var params = _this.funcoes.formParams.getParams(router, event);
            if (params) {
                _this.actionForm = params.action;
            }
        });
        return _this;
    }
    DescargasFerroviariasSegundaPesagemComponent.prototype.ngOnInit = function () {
        var _this = this;
        this.permissoesUtils.validRotina(this.constantes.sisFormularioId, 14, function () { return __awaiter(_this, void 0, void 0, function () {
            var id;
            return __generator(this, function (_a) {
                id = this.activatedRoute.snapshot.paramMap.get("id");
                if (!id) {
                    this.messageService.warning("titles.descargasFerroviarias", "message.nenhumRegistroEncontrado");
                    return [2 /*return*/];
                }
                this.getConfig();
                this.descarga.opDescargaTremId = +id;
                this.data = new _descargas_ferroviarias_segunda_pesagem_model__WEBPACK_IMPORTED_MODULE_18__["DescargasFerroviariasSegundaPesagem"]();
                this.inicializarDados();
                return [2 /*return*/];
            });
        }); }, function () {
            _this.permissoesUtils.back();
        });
    };
    DescargasFerroviariasSegundaPesagemComponent.prototype.getConfig = function () {
        var _this = this;
        this.constantes.listaParam.map(function (c) {
            if (c.sistema === 'BAL') {
                c.parametros.push("BlFerr" + _this.configuracao.macAddress);
            }
        });
        this.configuracao.getConfig({ codRotina: this.constantes.sisFormularioId, configs: this.constantes.listaParam }, this.loadConfig);
    };
    DescargasFerroviariasSegundaPesagemComponent.prototype.inicializarDados = function () {
        var _this = this;
        Object(rxjs__WEBPACK_IMPORTED_MODULE_0__["forkJoin"])([this.service.getById(this.descarga.opDescargaTremId), this.tipoVeiculoService.getById(5)]).subscribe(function (resp) {
            _this.descarga = resp[0];
            _this.data.opDescargaTremId = _this.descarga.opDescargaTremId;
            _this.data.tanqueId = _this.descarga.tanqueId;
            _this.data.pesoBru = _this.descarga.pesoBru;
            _this.getBalancas();
            if (!!resp[1])
                _this.tmpOperTipoVeiculo = resp[1].tempoOperacao;
        });
    };
    DescargasFerroviariasSegundaPesagemComponent.prototype.getLinhasPesagem = function () {
        var _this = this;
        this.balancaFerrofiaService.getLinhasPesagem(this.service.configs.blFerr).subscribe(function (resp) {
            _this.comboLinhasPesagem = resp;
            if (_this.comboLinhasPesagem.length === 1) {
                _this.data.balancaFerroviariaId = resp[0].balancaFerroviariaId;
            }
        });
    };
    DescargasFerroviariasSegundaPesagemComponent.prototype.getBalancas = function () {
        var _this = this;
        this.balancaService.getBalancasFerroviarias(this.data.balancaFerroviariaId.toString()).subscribe(function (resp) {
            _this.comboBalancas = resp;
        });
    };
    DescargasFerroviariasSegundaPesagemComponent.prototype.getPesoTara = function (resp) {
        if (this.service.configs.pesagemAutomatica) {
            if (_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_14__["NumberUtilsStaticService"].isNotPositive(resp.peso)) {
                this.data.pesoTara = undefined;
                return;
            }
            this.data.pesoTara = resp.peso;
        }
        this.data.pesoLiq = _shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_14__["NumberUtilsStaticService"].toNumber(this.data.pesoBru) - _shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_14__["NumberUtilsStaticService"].toNumber(this.data.pesoTara);
        this.data.diferenca = this.data.pesoLiq - _shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_14__["NumberUtilsStaticService"].toNumber(this.descarga.kilos);
    };
    DescargasFerroviariasSegundaPesagemComponent.prototype.onSubmit = function (form) {
        var _this = this;
        _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_12__["EventEmitterService"].get("formError").emit(form);
        if (form.invalid) {
            this.funcoes.backToTop();
            return;
        }
        if (!this.validarDados())
            return;
        if (this.service.configs.validaPesagem && this.service.configs.pesagemAutomatica) {
            this.messageService.confirm("titles.descargasFerroviarias", "messages.confirmaPesagemManual", null, function () {
                _this.gravarPesagem();
            }, false);
        }
        else {
            this.gravarPesagem();
        }
    };
    DescargasFerroviariasSegundaPesagemComponent.prototype.gravarPesagem = function () {
        var _this = this;
        this.data.kilos = this.descarga.kilos;
        this.service.gravarSegundaPesagem(this.data).subscribe(function (resp) {
            if (resp) {
                if (!resp.validationResult.isValid) {
                    _this.validation.showMessagesResult(resp.validationResult);
                    _this.funcoes.backToTop();
                }
                else {
                    _this.messageService.saveSuccess("titles.descargasFerroviarias");
                    if (_this.service.configs.boletimOcorrencia && (_this.service.configs.pesoMaxFerBO > 0) && (_this.data.diferenca > _this.service.configs.pesoMaxFerBO)) {
                        _this.printBoletimOcorrencia();
                    }
                    else {
                        _this.printTicket();
                    }
                }
            }
        });
    };
    DescargasFerroviariasSegundaPesagemComponent.prototype.printTicket = function () {
        var modRel = this.service.configs.cWebModTicketF;
        if (!modRel)
            this.messageService.warning("titles.descargasFerroviarias", "messages.modTicketNaoConfigurado");
        else {
            var reportTitulo = { titulo: '', subTitulo: '' };
            // Valida se a chamada é para um report especifico
            if (app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_20__["StringUtilsStaticService"].isNotEmpty(this.service.configs.prefixoRelEspecifico) && modRel.indexOf(this.service.configs.prefixoRelEspecifico) == 0) {
                this.funcoesService.reportInvoc.invocaRelatorioEspecificos(modRel, reportTitulo, {
                    filialId: this.loginService.getLogin().filialId,
                    autorizacao: this.funcoesService.getValue(this.data.opDescargaTremId, "I"),
                    tipoOCD: this.funcoesService.getValue(this.service.configs.cWebModTicketF === 'ROC0060' ? 'D' : '')
                });
            }
            else {
                this.funcoes.reportInvoc.invocaRelatorio(modRel, reportTitulo, {
                    filialId: this.loginService.getLogin().filialId,
                    autorizacao: this.funcoesService.getValue(this.data.opDescargaTremId, "I")
                });
            }
        }
        this.back();
    };
    DescargasFerroviariasSegundaPesagemComponent.prototype.printBoletimOcorrencia = function () {
        var modRel = this.service.configs.cWebModOCDF;
        if (!modRel)
            this.messageService.warning("titles.descargasFerroviarias", "messages.modBoletimOcorrenciaNaoConfigurado");
        else {
            var reportTitulo = { titulo: '', subTitulo: '' };
            // Valida se a chamada é para um report especifico
            if (app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_20__["StringUtilsStaticService"].isNotEmpty(this.service.configs.prefixoRelEspecifico) && modRel.indexOf(this.service.configs.prefixoRelEspecifico) == 0) {
                this.funcoesService.reportInvoc.invocaRelatorioEspecificos(modRel, reportTitulo, {
                    filialId: this.loginService.getLogin().filialId,
                    autorizacao: this.funcoesService.getValue(this.data.opDescargaTremId, "I"),
                });
            }
            else {
                this.funcoes.reportInvoc.invocaRelatorio(modRel, reportTitulo, {
                    filialId: this.loginService.getLogin().filialId,
                    autorizacao: this.funcoesService.getValue(this.data.opDescargaTremId, "I")
                });
            }
        }
        this.back();
    };
    DescargasFerroviariasSegundaPesagemComponent.prototype.validarDados = function () {
        var _this = this;
        if (this.data.tanqueId.trim() === this.service.configs.depositoADefinir) {
            this.messageService.warning("titles.descargasFerroviarias", "messages.depositoNaoPodeSerIgualADefinir");
            return false;
        }
        if (_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_14__["NumberUtilsStaticService"].isNotPositive(this.data.balancaFerroviariaId)) {
            this.messageService.warning("titles.descargasFerroviarias", "messages.linhaPesagemFerroviariaNaoSelecionada");
            return false;
        }
        if (this.requiredBalanca && _shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_14__["NumberUtilsStaticService"].isNotPositive(this.data.balancaIdL)) {
            this.messageService.warning("titles.descargasFerroviarias", "messages.balancaFerroviariaNaoSelecionada");
            return false;
        }
        if (_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_14__["NumberUtilsStaticService"].isNotPositive(this.data.pesoBru)) {
            this.messageService.warning("titles.descargasFerroviarias", "messages.pesoBruDeveSerMaiorZero");
            return false;
        }
        if (this.data.pesoTara > this.data.pesoBru) {
            this.messageService.warning("titles.descargasFerroviarias", "messages.pesoTaraDeveSerMenorPesoBruto");
            return false;
        }
        if (!this.data.situacaoLaudo && this.service.configs.solConclLaudoSegPesF) {
            this.messageService.warning("titles.descargasFerroviarias", "messages.campoObrigatorio", { name: 'Conclusão do Laudo' });
            return false;
        }
        var balancaSelecionada = this.comboBalancas.find(function (b) { return b.balancaId === _this.data.balancaIdL; });
        if (this.service.configs.bloqueiaAut && (balancaSelecionada && balancaSelecionada.flagAutoPes === "S")) {
            this.messageService.warning("titles.descargasFerroviarias", "messages.balancaNaAutomacaoPesagemNaoPermitida");
            this.data.pesoTara = undefined;
            return false;
        }
        return true;
    };
    DescargasFerroviariasSegundaPesagemComponent.prototype.back = function () {
        this.funcoesService.desabilitarFiltro();
        this.router.navigate(["" + this.target + this.pageRoute]);
    };
    Object.defineProperty(DescargasFerroviariasSegundaPesagemComponent.prototype, "saldoDepositoOptions", {
        get: function () {
            return {
                destinatarioIdCliente: this.service.data.destinatarioIdCliente,
                materialId: this.service.data.materialId,
                sitLote: 'A',
                modo: 7,
                tipoSaldo: 7,
                dataMovimento: this.service.data.dtAutorizacao,
                localOperacaoId: 0,
                tipoAgrupa: 'D',
                geraArquivo: 'S'
            };
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DescargasFerroviariasSegundaPesagemComponent.prototype, "disabledBtnPeso", {
        get: function () {
            return _shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_14__["NumberUtilsStaticService"].isNotPositive(this.data.balancaFerroviariaId);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DescargasFerroviariasSegundaPesagemComponent.prototype, "disabledBalanca", {
        get: function () {
            return !this.service.configs.pesagemAutomatica || !this.service.configs.selBalFerro;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DescargasFerroviariasSegundaPesagemComponent.prototype, "requiredBalanca", {
        get: function () {
            return !this.disabledBalanca;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DescargasFerroviariasSegundaPesagemComponent.prototype, "justQuebraRequired", {
        get: function () {
            var pesoLiq = _shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_14__["NumberUtilsStaticService"].toNumber(this.data.pesoLiq);
            var kilos = (!this.descarga.kilos ? 0 : this.descarga.kilos);
            var ptDiferenca = 0;
            if (!this.data.diferenca)
                return false;
            var diferenca = (pesoLiq - kilos);
            if (diferenca >= 0)
                return false;
            if (this.service.configs.justDescarga) {
                if (kilos === 0)
                    ptDiferenca = 100;
                else
                    ptDiferenca = _shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_14__["NumberUtilsStaticService"].round(Math.abs((1 - (pesoLiq / kilos)) * 100), 5);
                return ptDiferenca > this.service.configs.ptJustDescargaF;
            }
            return false;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DescargasFerroviariasSegundaPesagemComponent.prototype, "justSobraRequired", {
        get: function () {
            var pesoLiq = _shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_14__["NumberUtilsStaticService"].toNumber(this.data.pesoLiq);
            var kilos = _shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_14__["NumberUtilsStaticService"].toNumber(this.descarga.kilos);
            var ptDiferenca = 0;
            if (!this.data.diferenca)
                return false;
            var diferenca = (pesoLiq - kilos);
            if (diferenca <= 0)
                return false;
            if (this.service.configs.justDescargaSb) {
                if (kilos === 0)
                    ptDiferenca = 100;
                else
                    ptDiferenca = _shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_14__["NumberUtilsStaticService"].round(Math.abs((1 - (pesoLiq / kilos)) * 100), 5);
                return ptDiferenca > this.service.configs.ptJustDescargaFSb;
            }
            return false;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DescargasFerroviariasSegundaPesagemComponent.prototype, "labelQuebra", {
        get: function () {
            if (!this.justQuebraRequired && !this.justSobraRequired)
                return "";
            var pesoLiq = _shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_14__["NumberUtilsStaticService"].toNumber(this.data.pesoLiq);
            var kilos = _shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_14__["NumberUtilsStaticService"].toNumber(this.descarga.kilos);
            var ptDif = _shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_14__["NumberUtilsStaticService"].round((1 - (pesoLiq / kilos)) * 100, 2);
            return ptDif !== 0 ? (ptDif.toString() + "%") : "";
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DescargasFerroviariasSegundaPesagemComponent.prototype, "labelStatus", {
        get: function () {
            if (!this.justQuebraRequired && !this.justSobraRequired)
                return "";
            if (this.justSobraRequired)
                return 'Sobra';
            else if (this.justQuebraRequired)
                return 'Quebra';
            return '';
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DescargasFerroviariasSegundaPesagemComponent.prototype, "justTrasoRequired", {
        get: function () {
            if (this.service.configs.justAtraso) {
                var data = this.descarga.dtTriagem;
                if (app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_7__["DateTimeUtilsStaticService"].maiorA(this.descarga.dtEntregaNF, data))
                    data = this.descarga.dtEntregaNF;
                return app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_7__["DateTimeUtilsStaticService"].getMinutes(data, new Date()) > this.tmpOperTipoVeiculo;
            }
            return false;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DescargasFerroviariasSegundaPesagemComponent.prototype, "labelAtraso", {
        get: function () {
            if (!this.justTrasoRequired)
                return "";
            var data = this.descarga.dtTriagem;
            if (app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_7__["DateTimeUtilsStaticService"].maiorA(this.descarga.dtEntregaNF, data))
                data = this.descarga.dtEntregaNF;
            var difData = app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_7__["DateTimeUtilsStaticService"].getMinutes(data, new Date());
            return difData + " min.";
        },
        enumerable: true,
        configurable: true
    });
    DescargasFerroviariasSegundaPesagemComponent.ctorParameters = function () { return [
        { type: _shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_8__["ConfiguracaoFacade"] },
        { type: app_pages_cadastro_balanca_ferroviaria_balanca_ferroviaria_service__WEBPACK_IMPORTED_MODULE_3__["BalancaFerroviariaService"] },
        { type: _descargas_ferroviarias_validation__WEBPACK_IMPORTED_MODULE_19__["DescargasFerroviariasValidation"] },
        { type: _descargas_ferroviarias_service__WEBPACK_IMPORTED_MODULE_11__["DescargasFerroviariasService"] },
        { type: app_pages_cadastro_balanca_balanca_service__WEBPACK_IMPORTED_MODULE_4__["BalancaService"] },
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_2__["Router"] },
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_2__["ActivatedRoute"] },
        { type: _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_13__["FuncoesService"] },
        { type: _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_16__["MessageService"] },
        { type: _login_login_service__WEBPACK_IMPORTED_MODULE_17__["LoginService"] },
        { type: app_pages_cadastro_tipo_veiculo_tipo_veiculo_service__WEBPACK_IMPORTED_MODULE_5__["TipoVeiculoService"] },
        { type: _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_15__["PermissoesUtilsService"] }
    ]; };
    DescargasFerroviariasSegundaPesagemComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"])({
            selector: "app-descargas-ferroviarias-segunda-pesagem",
            template: __importDefault(__webpack_require__(/*! raw-loader!./descargas-ferroviarias-segunda-pesagem.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-segunda-pesagem/descargas-ferroviarias-segunda-pesagem.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_8__["ConfiguracaoFacade"],
            app_pages_cadastro_balanca_ferroviaria_balanca_ferroviaria_service__WEBPACK_IMPORTED_MODULE_3__["BalancaFerroviariaService"],
            _descargas_ferroviarias_validation__WEBPACK_IMPORTED_MODULE_19__["DescargasFerroviariasValidation"],
            _descargas_ferroviarias_service__WEBPACK_IMPORTED_MODULE_11__["DescargasFerroviariasService"],
            app_pages_cadastro_balanca_balanca_service__WEBPACK_IMPORTED_MODULE_4__["BalancaService"],
            _angular_router__WEBPACK_IMPORTED_MODULE_2__["Router"],
            _angular_router__WEBPACK_IMPORTED_MODULE_2__["ActivatedRoute"],
            _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_13__["FuncoesService"],
            _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_16__["MessageService"],
            _login_login_service__WEBPACK_IMPORTED_MODULE_17__["LoginService"],
            app_pages_cadastro_tipo_veiculo_tipo_veiculo_service__WEBPACK_IMPORTED_MODULE_5__["TipoVeiculoService"],
            _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_15__["PermissoesUtilsService"]])
    ], DescargasFerroviariasSegundaPesagemComponent);
    return DescargasFerroviariasSegundaPesagemComponent;
}(app_shared_components_corporate_base_base_permissoes__WEBPACK_IMPORTED_MODULE_6__["BasePermissoes"]));



/***/ }),

/***/ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-segunda-pesagem/descargas-ferroviarias-segunda-pesagem.model.ts":
/*!*********************************************************************************************************************************************!*\
  !*** ./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-segunda-pesagem/descargas-ferroviarias-segunda-pesagem.model.ts ***!
  \*********************************************************************************************************************************************/
/*! exports provided: DescargasFerroviariasSegundaPesagem */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DescargasFerroviariasSegundaPesagem", function() { return DescargasFerroviariasSegundaPesagem; });
/* harmony import */ var app_pages_cadastro_tanque_tanque_model__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! app/pages/cadastro/tanque/tanque.model */ "./src/app/pages/cadastro/tanque/tanque.model.ts");
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};

var DescargasFerroviariasSegundaPesagem = /** @class */ (function () {
    function DescargasFerroviariasSegundaPesagem() {
        this.tanque = new app_pages_cadastro_tanque_tanque_model__WEBPACK_IMPORTED_MODULE_0__["Tanque"]();
        this.balancaFerroviariaId = 0;
        this.balancaIdL = 0;
        this.plataformaId = "";
    }
    return DescargasFerroviariasSegundaPesagem;
}());



/***/ }),

/***/ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.constants.ts":
/*!******************************************************************************************!*\
  !*** ./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.constants.ts ***!
  \******************************************************************************************/
/*! exports provided: DescargasFerroviariasConstants */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DescargasFerroviariasConstants", function() { return DescargasFerroviariasConstants; });
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};
var DescargasFerroviariasConstants = /** @class */ (function () {
    function DescargasFerroviariasConstants() {
        this.sisFormularioId = 95099;
        this.permissoes = [
            { sisFormularioId: this.sisFormularioId, libRotina: 1, acao: "labels.inclusao" },
            { sisFormularioId: this.sisFormularioId, libRotina: 2, acao: "labels.alteracao" },
            { sisFormularioId: this.sisFormularioId, libRotina: 3, acao: "labels.exclusao" },
            { sisFormularioId: this.sisFormularioId, libRotina: 4, acao: "labels.consulta" },
            { sisFormularioId: this.sisFormularioId, libRotina: 5, acao: "labels.impressao" },
            { sisFormularioId: this.sisFormularioId, libRotina: 6, acao: "labels.propriedades" },
            { sisFormularioId: this.sisFormularioId, libRotina: 7, acao: "labels.permissoes" },
            { sisFormularioId: this.sisFormularioId, libRotina: 8, acao: "labels.alterarHorariosOutrosDados" },
            { sisFormularioId: this.sisFormularioId, libRotina: 9, acao: "labels.dadosDaPesagem" },
            { sisFormularioId: this.sisFormularioId, libRotina: 10, acao: "labels.visualizarFotoOCR" },
            { sisFormularioId: this.sisFormularioId, libRotina: 11, acao: "labels.confirmacaoChegada" },
            { sisFormularioId: this.sisFormularioId, libRotina: 12, acao: "labels.analiseProdutoOrigem" },
            { sisFormularioId: this.sisFormularioId, libRotina: 13, acao: "labels.informarEncoste" },
            { sisFormularioId: this.sisFormularioId, libRotina: 14, acao: "labels.pesagem" },
            { sisFormularioId: this.sisFormularioId, libRotina: 15, acao: "labels.cancelarPesagem" },
            { sisFormularioId: this.sisFormularioId, libRotina: 16, acao: "labels.afericaoBalanca" },
            { sisFormularioId: this.sisFormularioId, libRotina: 17, acao: "labels.liberacaoEmLote" },
            { sisFormularioId: this.sisFormularioId, libRotina: 18, acao: "labels.pesagemParaRetorno" },
            { sisFormularioId: this.sisFormularioId, libRotina: 19, acao: "labels.liberarRetorno" }
        ];
        this.sisSistemaId = "BAL";
        this.nomeForm = "titles.descargasFerroviarias";
        this.reportId = "BAL0013";
        this.reportTitulo = { "titulo": "Descargas Ferroviárias", "subTitulo": "" };
        this.listaIndex = [
            { title: 'Novo', action: 'create', icon: "icon-plus", exibeButton: true, eximeMenu: true, menuName: 'Arquivo' },
            { title: 'Visualizar', action: 'detail', icon: "icon-eye", exibeButton: true, eximeMenu: true, menuName: 'Arquivo' },
            { title: 'Editar', action: 'edit', icon: "icon-pencil", exibeButton: true, eximeMenu: true, menuName: 'Arquivo' },
            { title: '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: 'Imprimir', action: '_print', icon: "icon-printer", exibeButton: true, eximeMenu: true, menuName: 'Arquivo' },
            { title: 'Pesquisar', action: 'filtrar', icon: "icon-search", exibeButton: true, eximeMenu: true, menuName: 'Movimento' },
            { title: 'Propriedade', action: 'properties', icon: "icon-menu", exibeButton: true, eximeMenu: true, menuName: 'Movimento' },
            { title: 'Permissao', action: 'permissoes', icon: "icon-unlock", exibeButton: true, eximeMenu: true, menuName: 'Movimento' },
            { title: 'AlterarHorariosOutrosDados', action: 'alterarDatas', icon: "fa fa-clock-o", exibeButton: true, eximeMenu: true, menuName: 'Movimento' },
            { title: 'DadosDaPesagem', action: 'dadosPesagem', icon: "fa fa-file-text-o", exibeButton: true, eximeMenu: true, menuName: 'Movimento' },
            { title: 'AnaliseProdutoOrigem', action: 'analiseProdutoOrigem', icon: "fa fa-flask", exibeButton: true, eximeMenu: true, menuName: 'Movimento' },
            { title: 'informarEncoste', action: 'informarEncoste', icon: "fa fa-calendar", exibeButton: true, eximeMenu: true, menuName: 'Movimento' },
            { title: 'PrimeiraPesagem', action: 'primeiraPesagem', icon: "fa fa-dot-circle-o", exibeButton: true, eximeMenu: true, menuName: 'Movimento' },
            { title: 'SegundaPesagem', action: 'segundaPesagem', icon: "fa fa-bullseye", exibeButton: true, eximeMenu: true, menuName: 'Movimento' },
            { title: 'CancelPesagem', action: 'cancelarPesagem', icon: "fa fa-ban", exibeButton: false, eximeMenu: true, menuName: 'Movimento' },
            { title: 'LiberacaoLote', action: 'liberacaoLote', icon: "fa fa-database", exibeButton: true, eximeMenu: true, menuName: 'Movimento' },
            { title: 'AfericaoBalanca', action: 'afericaoBalanca', icon: "fa fa-balance-scale", exibeButton: true, eximeMenu: true, menuName: 'Movimento' },
            { title: 'PesagemParaRetorno', action: 'pesagemParaRetorno', icon: "fa fa-outdent", exibeButton: true, eximeMenu: true, menuName: 'Movimento' },
            { title: 'LiberarRetorno', action: 'liberarRetorno', icon: "fa fa-sign-in", exibeButton: true, eximeMenu: true, menuName: 'Movimento' }
        ];
        this.listaForm = [
            { title: 'Editar', action: 'edit', icon: "icon-pencil", exibeButton: true, eximeMenu: true, menuName: 'Arquivo' },
            { title: 'Voltar', action: 'back', icon: "icon-arrow-left", exibeButton: true, eximeMenu: true, menuName: 'Arquivo' },
            { title: 'ConfirmacaoChegada', action: 'confirmacaoChegada', icon: "fa fa-train", exibeButton: true, eximeMenu: true, menuName: 'Movimento' },
            { title: 'visualizarFotoOCR', action: 'visualizarFotoOCR', icon: "fa fa-camera", exibeButton: true, eximeMenu: true, menuName: 'Movimento', disabled: true }
        ];
        this.listaPes = [
            { title: 'Voltar', action: 'back', icon: "icon-arrow-left", exibeButton: true, eximeMenu: true, menuName: 'Arquivo' },
        ];
        this.listaParam = [
            {
                sistema: 'BAL',
                parametros: [
                    'DepositoADefinir',
                    'SolCTEDescFer',
                    'PerEditFerroviario',
                    'CalculaTotalNF',
                    'DifMaxNFDtAtual',
                    'PtNfCompraDif',
                    'InfPesoFob',
                    'JustDescarga',
                    'JustAtraso',
                    'BlFerr',
                    'PesagemAutomatica',
                    'SelBalFerro',
                    'BloqueiaAut',
                    'ObrigaHrOperacao',
                    'ObrTernoDesc',
                    'JustDescargaSb',
                    'PtJustDescargaF',
                    'PtJustDescargaFSb',
                    'ValidaPesagem',
                    'BoletimOcorrencia',
                    'PesoMaxFerBO',
                    'FlagObrigaAprov',
                    'KgDifSobra',
                    'PtDifPesoOrigem',
                    'KgDifPesoOrigem',
                    'SolConclLaudoSegPesF',
                    'SolAferDescFer',
                    'RetVagaoTolerancia',
                    'RetVagaoDevolucTotal',
                    'BloqLinha2Pes',
                    'SelBalComplF',
                    'RetVagaoSolJustifica',
                    'OcrPsFer'
                ]
            },
            { sistema: 'CTR', parametros: ['DtSeguro'] },
            { sistema: 'CTV', parametros: ['OcrFerTipo', 'EfetuaAnaliseOrigem', 'AltDtChegada'] },
            { sistema: 'UNI', parametros: ['ObrChaveNFeEnt', 'SolMotCancEVePesagem'] },
            { sistema: 'REL', parametros: ['IntOsAtiva'] },
            { sistema: 'WEB', parametros: ['CWebModRequisicaoF', 'CWebModTicketF', 'CWebModOCDF', 'prefixoRelEspecifico', 'obrigPlataformaVagao'] }
        ];
    }
    return DescargasFerroviariasConstants;
}());



/***/ }),

/***/ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.model.ts":
/*!**************************************************************************************!*\
  !*** ./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.model.ts ***!
  \**************************************************************************************/
/*! exports provided: DescargasFerroviarias, DescargasFerroviariasFiltroVo, DescargasFerroviariasGerarTmpVo, DescargasFerroviariasIndex, DescargasFerroviariasNota, DescargasFerroviariasNotaValidaComplementar, DescargasFerroviariasNotaValidaComplementarResult, DescargasFerroviariasLaudoDifPeso */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DescargasFerroviarias", function() { return DescargasFerroviarias; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DescargasFerroviariasFiltroVo", function() { return DescargasFerroviariasFiltroVo; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DescargasFerroviariasGerarTmpVo", function() { return DescargasFerroviariasGerarTmpVo; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DescargasFerroviariasIndex", function() { return DescargasFerroviariasIndex; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DescargasFerroviariasNota", function() { return DescargasFerroviariasNota; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DescargasFerroviariasNotaValidaComplementar", function() { return DescargasFerroviariasNotaValidaComplementar; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DescargasFerroviariasNotaValidaComplementarResult", function() { return DescargasFerroviariasNotaValidaComplementarResult; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DescargasFerroviariasLaudoDifPeso", function() { return DescargasFerroviariasLaudoDifPeso; });
/* harmony import */ var app_pages_cadastro_destinatario_destinatario_model__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! app/pages/cadastro/destinatario/destinatario.model */ "./src/app/pages/cadastro/destinatario/destinatario.model.ts");
/* harmony import */ var app_pages_cadastro_material_material_model__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! app/pages/cadastro/material/material.model */ "./src/app/pages/cadastro/material/material.model.ts");
/* harmony import */ var app_shared_services_base_base_model__WEBPACK_IMPORTED_MODULE_2__ = __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_3__ = __webpack_require__(/*! app/shared/services/funcoes/date-time-utils/date-time-utils.static.service */ "./src/app/shared/services/funcoes/date-time-utils/date-time-utils.static.service.ts");
var __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 DescargasFerroviarias = /** @class */ (function (_super) {
    __extends(DescargasFerroviarias, _super);
    function DescargasFerroviarias() {
        var _this = _super.call(this) || this;
        _this.dtAutorizacao = new Date();
        _this.cliente = new app_pages_cadastro_destinatario_destinatario_model__WEBPACK_IMPORTED_MODULE_0__["Destinatario"]();
        _this.emitente = new app_pages_cadastro_destinatario_destinatario_model__WEBPACK_IMPORTED_MODULE_0__["Destinatario"]();
        _this.transportadora = new app_pages_cadastro_destinatario_destinatario_model__WEBPACK_IMPORTED_MODULE_0__["Destinatario"]();
        _this.material = new app_pages_cadastro_material_material_model__WEBPACK_IMPORTED_MODULE_1__["Material"]();
        _this.localTransbordo = [];
        _this.opDescargaTremNotas = [];
        return _this;
    }
    return DescargasFerroviarias;
}(app_shared_services_base_base_model__WEBPACK_IMPORTED_MODULE_2__["BaseModel"]));

var DescargasFerroviariasFiltroVo = /** @class */ (function () {
    function DescargasFerroviariasFiltroVo() {
        var currentDate = new Date();
        this.dataI = app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_3__["DateTimeUtilsStaticService"].addDays(currentDate, -30);
        this.dataF = new Date();
        this.destinatarioIdCliente = 0;
        this.materialId = "";
        this.situacoes = ["A", "P", "R", "S"];
        this.opDescargaTremId = 0;
        this.cadastroPlacaId = "";
        this.aguardandoPrimeiraPesagem = "S";
        this.aguardandoSegundaPesagem = "S";
        this.aguardandoRetorno = "S";
        this.aguardandoAnalise = "S";
        this.operacaoCancelada = "";
        this.operacaoConcluida = "";
    }
    return DescargasFerroviariasFiltroVo;
}());

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

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

var DescargasFerroviariasNota = /** @class */ (function (_super) {
    __extends(DescargasFerroviariasNota, _super);
    function DescargasFerroviariasNota() {
        var _this = _super.call(this) || this;
        _this.tipoFrete = "";
        _this.sitLaudo = "";
        return _this;
    }
    return DescargasFerroviariasNota;
}(app_shared_services_base_base_model__WEBPACK_IMPORTED_MODULE_2__["BaseModel"]));

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

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

var DescargasFerroviariasLaudoDifPeso = /** @class */ (function () {
    function DescargasFerroviariasLaudoDifPeso(modo, confDif, diferenca, procedimento) {
        if (procedimento === void 0) { procedimento = [' - Laudo']; }
        this.modo = modo;
        this.confDif = confDif;
        this.diferenca = diferenca;
        this.procedimento = procedimento;
    }
    return DescargasFerroviariasLaudoDifPeso;
}());



/***/ }),

/***/ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.module.ts":
/*!***************************************************************************************!*\
  !*** ./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.module.ts ***!
  \***************************************************************************************/
/*! exports provided: DescargasFerroviariasModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DescargasFerroviariasModule", function() { return DescargasFerroviariasModule; });
/* 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 _descargas_ferroviarias_afericao_balanca_descargas_ferroviarias_afericao_balanca_component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./descargas-ferroviarias-afericao-balanca/descargas-ferroviarias-afericao-balanca.component */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-afericao-balanca/descargas-ferroviarias-afericao-balanca.component.ts");
/* harmony import */ var _descargas_ferroviarias_alterar_datas_descargas_ferroviarias_alterar_datas_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./descargas-ferroviarias-alterar-datas/descargas-ferroviarias-alterar-datas.component */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-alterar-datas/descargas-ferroviarias-alterar-datas.component.ts");
/* harmony import */ var _descargas_ferroviarias_analise_origem_descargas_ferroviarias_analise_origem_component__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./descargas-ferroviarias-analise-origem/descargas-ferroviarias-analise-origem.component */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-analise-origem/descargas-ferroviarias-analise-origem.component.ts");
/* harmony import */ var _descargas_ferroviarias_campos_dinamicos_descargas_ferroviarias_campos_dinamicos_component__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./descargas-ferroviarias-campos-dinamicos/descargas-ferroviarias-campos-dinamicos.component */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-campos-dinamicos/descargas-ferroviarias-campos-dinamicos.component.ts");
/* harmony import */ var _descargas_ferroviarias_confirmacao_chegada_descargas_ferroviarias_confirmacao_chegada_component__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./descargas-ferroviarias-confirmacao-chegada/descargas-ferroviarias-confirmacao-chegada.component */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-confirmacao-chegada/descargas-ferroviarias-confirmacao-chegada.component.ts");
/* harmony import */ var _descargas_ferroviarias_dados_pesagem_descargas_ferroviarias_dados_pesagem_component__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./descargas-ferroviarias-dados-pesagem/descargas-ferroviarias-dados-pesagem.component */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-dados-pesagem/descargas-ferroviarias-dados-pesagem.component.ts");
/* harmony import */ var _descargas_ferroviarias_filter_descargas_ferroviarias_filter_component__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./descargas-ferroviarias-filter/descargas-ferroviarias-filter.component */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-filter/descargas-ferroviarias-filter.component.ts");
/* harmony import */ var _descargas_ferroviarias_form_descargas_ferroviarias_form_component__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./descargas-ferroviarias-form/descargas-ferroviarias-form.component */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-form/descargas-ferroviarias-form.component.ts");
/* harmony import */ var _descargas_ferroviarias_index_descargas_ferroviarias_index_component__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./descargas-ferroviarias-index/descargas-ferroviarias-index.component */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-index/descargas-ferroviarias-index.component.ts");
/* harmony import */ var _descargas_ferroviarias_informar_encoste_descargas_ferroviarias_informar_encoste_component__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./descargas-ferroviarias-informar-encoste/descargas-ferroviarias-informar-encoste.component */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-informar-encoste/descargas-ferroviarias-informar-encoste.component.ts");
/* harmony import */ var _descargas_ferroviarias_item_descargas_ferroviarias_item_component__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./descargas-ferroviarias-item/descargas-ferroviarias-item.component */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-item/descargas-ferroviarias-item.component.ts");
/* harmony import */ var _descargas_ferroviarias_motivo_pesagem_descargas_ferroviarias_motivo_pesagem_component__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./descargas-ferroviarias-motivo-pesagem/descargas-ferroviarias-motivo-pesagem.component */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-motivo-pesagem/descargas-ferroviarias-motivo-pesagem.component.ts");
/* harmony import */ var _descargas_ferroviarias_motivo_descargas_ferroviarias_motivo_component__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./descargas-ferroviarias-motivo/descargas-ferroviarias-motivo.component */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-motivo/descargas-ferroviarias-motivo.component.ts");
/* harmony import */ var _descargas_ferroviarias_primeira_pesagem_descargas_ferroviarias_primeira_pesagem_component__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./descargas-ferroviarias-primeira-pesagem/descargas-ferroviarias-primeira-pesagem.component */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-primeira-pesagem/descargas-ferroviarias-primeira-pesagem.component.ts");
/* harmony import */ var _descargas_ferroviarias_print_modal_descargas_ferroviarias_print_modal_component__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./descargas-ferroviarias-print-modal/descargas-ferroviarias-print-modal.component */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-print-modal/descargas-ferroviarias-print-modal.component.ts");
/* harmony import */ var _descargas_ferroviarias_segunda_pesagem_descargas_ferroviarias_segunda_pesagem_component__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./descargas-ferroviarias-segunda-pesagem/descargas-ferroviarias-segunda-pesagem.component */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-segunda-pesagem/descargas-ferroviarias-segunda-pesagem.component.ts");
/* harmony import */ var _descargas_ferroviarias_routing_module__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./descargas-ferroviarias.routing.module */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.routing.module.ts");
/* harmony import */ var _descargas_ferroviarias_laudo_descargas_ferroviarias_laudo_component__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./descargas-ferroviarias-laudo/descargas-ferroviarias-laudo.component */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-laudo/descargas-ferroviarias-laudo.component.ts");
/* harmony import */ var _descargas_ferroviarias_pesagem_para_retorno_descargas_ferroviarias_pesagem_para_retorno_component__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./descargas-ferroviarias-pesagem-para-retorno/descargas-ferroviarias-pesagem-para-retorno.component */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-pesagem-para-retorno/descargas-ferroviarias-pesagem-para-retorno.component.ts");
/* harmony import */ var _descargas_ferroviarias_liberar_retorno_descargas_ferroviarias_liberar_retorno_component__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./descargas-ferroviarias-liberar-retorno/descargas-ferroviarias-liberar-retorno.component */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-liberar-retorno/descargas-ferroviarias-liberar-retorno.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 DescargasFerroviariasModule = /** @class */ (function () {
    function DescargasFerroviariasModule() {
    }
    DescargasFerroviariasModule = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"])({
            imports: [app_shared_shared_module__WEBPACK_IMPORTED_MODULE_1__["SharedModule"], _descargas_ferroviarias_routing_module__WEBPACK_IMPORTED_MODULE_18__["DescargasFerroviariasRoutingModule"]],
            declarations: [
                _descargas_ferroviarias_index_descargas_ferroviarias_index_component__WEBPACK_IMPORTED_MODULE_10__["DescargasFerroviariasIndexComponent"],
                _descargas_ferroviarias_filter_descargas_ferroviarias_filter_component__WEBPACK_IMPORTED_MODULE_8__["DescargasFerroviariasFilterComponent"],
                _descargas_ferroviarias_form_descargas_ferroviarias_form_component__WEBPACK_IMPORTED_MODULE_9__["DescargasFerroviariasFormComponent"],
                _descargas_ferroviarias_item_descargas_ferroviarias_item_component__WEBPACK_IMPORTED_MODULE_12__["DescargasFerroviariasItemComponent"],
                _descargas_ferroviarias_afericao_balanca_descargas_ferroviarias_afericao_balanca_component__WEBPACK_IMPORTED_MODULE_2__["DescargasFerroviariasAfericaoBalancaComponent"],
                _descargas_ferroviarias_alterar_datas_descargas_ferroviarias_alterar_datas_component__WEBPACK_IMPORTED_MODULE_3__["DescargasFerroviariasAlterarDatasComponent"],
                _descargas_ferroviarias_confirmacao_chegada_descargas_ferroviarias_confirmacao_chegada_component__WEBPACK_IMPORTED_MODULE_6__["DescargasFerroviariasConfirmacaoChegadaComponent"],
                _descargas_ferroviarias_dados_pesagem_descargas_ferroviarias_dados_pesagem_component__WEBPACK_IMPORTED_MODULE_7__["DescargasFerroviariasDadosPesagemComponent"],
                _descargas_ferroviarias_informar_encoste_descargas_ferroviarias_informar_encoste_component__WEBPACK_IMPORTED_MODULE_11__["DescargasFerroviariasInformarEncosteComponent"],
                _descargas_ferroviarias_motivo_descargas_ferroviarias_motivo_component__WEBPACK_IMPORTED_MODULE_14__["DescargasFerroviariasMotivoComponent"],
                _descargas_ferroviarias_motivo_pesagem_descargas_ferroviarias_motivo_pesagem_component__WEBPACK_IMPORTED_MODULE_13__["DescargasFerroviariasMotivoPesagemComponent"],
                _descargas_ferroviarias_primeira_pesagem_descargas_ferroviarias_primeira_pesagem_component__WEBPACK_IMPORTED_MODULE_15__["DescargasFerroviariasPrimeiraPesagemComponent"],
                _descargas_ferroviarias_print_modal_descargas_ferroviarias_print_modal_component__WEBPACK_IMPORTED_MODULE_16__["DescargasFerroviariasPrintModalComponent"],
                _descargas_ferroviarias_segunda_pesagem_descargas_ferroviarias_segunda_pesagem_component__WEBPACK_IMPORTED_MODULE_17__["DescargasFerroviariasSegundaPesagemComponent"],
                _descargas_ferroviarias_analise_origem_descargas_ferroviarias_analise_origem_component__WEBPACK_IMPORTED_MODULE_4__["DescargasFerroviariasAnaliseOrigemComponent"],
                _descargas_ferroviarias_campos_dinamicos_descargas_ferroviarias_campos_dinamicos_component__WEBPACK_IMPORTED_MODULE_5__["DescargasFerroviariasCamposDinamicosComponent"],
                _descargas_ferroviarias_laudo_descargas_ferroviarias_laudo_component__WEBPACK_IMPORTED_MODULE_19__["DescargasFerroviariasLaudoComponent"],
                _descargas_ferroviarias_pesagem_para_retorno_descargas_ferroviarias_pesagem_para_retorno_component__WEBPACK_IMPORTED_MODULE_20__["DescargasFerroviariasPesagemParaRetornoComponent"],
                _descargas_ferroviarias_liberar_retorno_descargas_ferroviarias_liberar_retorno_component__WEBPACK_IMPORTED_MODULE_21__["DescargasFerroviariasLiberarRetornoComponent"]
            ]
        })
    ], DescargasFerroviariasModule);
    return DescargasFerroviariasModule;
}());



/***/ }),

/***/ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.routing.module.ts":
/*!***********************************************************************************************!*\
  !*** ./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.routing.module.ts ***!
  \***********************************************************************************************/
/*! exports provided: DescargasFerroviariasRoutingModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DescargasFerroviariasRoutingModule", function() { return DescargasFerroviariasRoutingModule; });
/* 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 _descargas_ferroviarias_afericao_balanca_descargas_ferroviarias_afericao_balanca_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./descargas-ferroviarias-afericao-balanca/descargas-ferroviarias-afericao-balanca.component */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-afericao-balanca/descargas-ferroviarias-afericao-balanca.component.ts");
/* harmony import */ var _descargas_ferroviarias_analise_origem_descargas_ferroviarias_analise_origem_component__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./descargas-ferroviarias-analise-origem/descargas-ferroviarias-analise-origem.component */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-analise-origem/descargas-ferroviarias-analise-origem.component.ts");
/* harmony import */ var _descargas_ferroviarias_form_descargas_ferroviarias_form_component__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./descargas-ferroviarias-form/descargas-ferroviarias-form.component */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-form/descargas-ferroviarias-form.component.ts");
/* harmony import */ var _descargas_ferroviarias_index_descargas_ferroviarias_index_component__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./descargas-ferroviarias-index/descargas-ferroviarias-index.component */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-index/descargas-ferroviarias-index.component.ts");
/* harmony import */ var _descargas_ferroviarias_primeira_pesagem_descargas_ferroviarias_primeira_pesagem_component__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./descargas-ferroviarias-primeira-pesagem/descargas-ferroviarias-primeira-pesagem.component */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-primeira-pesagem/descargas-ferroviarias-primeira-pesagem.component.ts");
/* harmony import */ var _descargas_ferroviarias_segunda_pesagem_descargas_ferroviarias_segunda_pesagem_component__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./descargas-ferroviarias-segunda-pesagem/descargas-ferroviarias-segunda-pesagem.component */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias-segunda-pesagem/descargas-ferroviarias-segunda-pesagem.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: _descargas_ferroviarias_index_descargas_ferroviarias_index_component__WEBPACK_IMPORTED_MODULE_6__["DescargasFerroviariasIndexComponent"],
        data: { breadcrumb: "descargasFerroviarias", formParams: { action: app_config_enumerables__WEBPACK_IMPORTED_MODULE_2__["ActionForm"].index } }
    },
    {
        path: "create",
        component: _descargas_ferroviarias_form_descargas_ferroviarias_form_component__WEBPACK_IMPORTED_MODULE_5__["DescargasFerroviariasFormComponent"],
        data: {
            breadcrumb: "descargasFerroviarias",
            formParams: { action: app_config_enumerables__WEBPACK_IMPORTED_MODULE_2__["ActionForm"].create }
        }
    },
    {
        path: "edit/:id",
        component: _descargas_ferroviarias_form_descargas_ferroviarias_form_component__WEBPACK_IMPORTED_MODULE_5__["DescargasFerroviariasFormComponent"],
        data: {
            breadcrumb: "descargasFerroviarias",
            formParams: { action: app_config_enumerables__WEBPACK_IMPORTED_MODULE_2__["ActionForm"].edit }
        }
    },
    {
        path: "detail/:id",
        component: _descargas_ferroviarias_form_descargas_ferroviarias_form_component__WEBPACK_IMPORTED_MODULE_5__["DescargasFerroviariasFormComponent"],
        data: {
            breadcrumb: "descargasFerroviarias",
            formParams: { action: app_config_enumerables__WEBPACK_IMPORTED_MODULE_2__["ActionForm"].detail }
        }
    },
    {
        path: "primeiraPesagem/:object",
        component: _descargas_ferroviarias_primeira_pesagem_descargas_ferroviarias_primeira_pesagem_component__WEBPACK_IMPORTED_MODULE_7__["DescargasFerroviariasPrimeiraPesagemComponent"],
        data: {
            breadcrumb: "primeiraPesagem",
            formParams: { action: app_config_enumerables__WEBPACK_IMPORTED_MODULE_2__["ActionForm"].create }
        }
    },
    {
        path: "segundaPesagem/:id",
        component: _descargas_ferroviarias_segunda_pesagem_descargas_ferroviarias_segunda_pesagem_component__WEBPACK_IMPORTED_MODULE_8__["DescargasFerroviariasSegundaPesagemComponent"],
        data: {
            breadcrumb: "segundaPesagem",
            formParams: { action: app_config_enumerables__WEBPACK_IMPORTED_MODULE_2__["ActionForm"].create }
        }
    },
    {
        path: "analiseProdutoOrigem/:object",
        component: _descargas_ferroviarias_analise_origem_descargas_ferroviarias_analise_origem_component__WEBPACK_IMPORTED_MODULE_4__["DescargasFerroviariasAnaliseOrigemComponent"],
        data: {
            breadcrumb: "analiseProdutoOrigem",
            formParams: { action: app_config_enumerables__WEBPACK_IMPORTED_MODULE_2__["ActionForm"].create }
        }
    },
    {
        path: "afericaoBalanca",
        component: _descargas_ferroviarias_afericao_balanca_descargas_ferroviarias_afericao_balanca_component__WEBPACK_IMPORTED_MODULE_3__["DescargasFerroviariasAfericaoBalancaComponent"],
        data: {
            breadcrumb: "afericaoBalanca",
            formParams: { action: app_config_enumerables__WEBPACK_IMPORTED_MODULE_2__["ActionForm"].create }
        }
    },
];
var DescargasFerroviariasRoutingModule = /** @class */ (function () {
    function DescargasFerroviariasRoutingModule() {
    }
    DescargasFerroviariasRoutingModule = __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"]]
        })
    ], DescargasFerroviariasRoutingModule);
    return DescargasFerroviariasRoutingModule;
}());



/***/ }),

/***/ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.service.ts":
/*!****************************************************************************************!*\
  !*** ./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.service.ts ***!
  \****************************************************************************************/
/*! exports provided: DescargasFerroviariasService */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DescargasFerroviariasService", function() { return DescargasFerroviariasService; });
/* harmony import */ var _angular_common_http__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/common/http */ "./node_modules/@angular/common/fesm5/http.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var app_app_error_handler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! app/app.error-handler */ "./src/app/app.error-handler.ts");
/* harmony import */ var app_shared_services_base_base_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! app/shared/services/base/base.service */ "./src/app/shared/services/base/base.service.ts");
/* harmony import */ var app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! app/shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var environments_environment__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! environments/environment */ "./src/environments/environment.ts");
/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm5/operators/index.js");
/* harmony import */ var _descargas_ferroviarias_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./descargas-ferroviarias.constants */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.constants.ts");
/* harmony import */ var _descargas_ferroviarias_model__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./descargas-ferroviarias.model */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.model.ts");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (undefined && undefined.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};









var DescargasFerroviariasService = /** @class */ (function (_super) {
    __extends(DescargasFerroviariasService, _super);
    function DescargasFerroviariasService(http, message) {
        var _this = _super.call(this, http, "balanca/opDescargaTrem") || this;
        _this.http = http;
        _this.message = message;
        _this.data = new _descargas_ferroviarias_model__WEBPACK_IMPORTED_MODULE_8__["DescargasFerroviarias"]();
        _this.filter = new _descargas_ferroviarias_model__WEBPACK_IMPORTED_MODULE_8__["DescargasFerroviariasFiltroVo"]();
        _this.filtroValidacaoNota = new _descargas_ferroviarias_model__WEBPACK_IMPORTED_MODULE_8__["DescargasFerroviariasNotaValidaComplementar"]();
        _this.constantes = new _descargas_ferroviarias_constants__WEBPACK_IMPORTED_MODULE_7__["DescargasFerroviariasConstants"]();
        _this.title = "titles.descargasFerroviarias";
        _this.configs = {
            pesAntAn: false,
            depositoADefinir: "",
            dtSeguro: null,
            solCTEDescFer: false,
            perEditFerroviario: false,
            calculaTotalNF: false,
            obrChaveNFeEnt: false,
            infPesoFob: false,
            difMaxNFDtAtual: 0,
            ptNfCompraDif: 0,
            solMotCancEVePesagem: false,
            cWebModRequisicaoF: "",
            cWebModTicketF: "",
            cWebModOCDF: "",
            justDescarga: false,
            justAtraso: false,
            ocrFerTipo: 0,
            intOsAtiva: false,
            efetuaAnaliseOrigem: false,
            blFerr: "",
            pesagemAutomatica: false,
            selBalFerro: false,
            bloqueiaAut: false,
            obrigaHrOperacao: false,
            obrTernoDesc: false,
            justDescargaSb: false,
            ptJustDescargaF: 0,
            ptJustDescargaFSb: 0,
            validaPesagem: false,
            boletimOcorrencia: false,
            pesoMaxFerBO: 0,
            prefixoRelEspecifico: "",
            flagObrigaAprov: false,
            kgDifSobra: 0,
            ptDifPesoOrigem: 0,
            kgDifPesoOrigem: 0,
            altDtChegada: false,
            solConclLaudoSegPesF: false,
            solAferDescFer: false,
            retVagaoTolerancia: 0,
            retVagaoDevolucTotal: false,
            bloqLinha2Pes: false,
            selBalComplF: false,
            retVagaoSolJustifica: false,
            obrigPlataformaVagao: "",
            ocrPsFer: false
        };
        return _this;
    }
    DescargasFerroviariasService.prototype.getByFiltro = function (data) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_5__["environment"].service_url + "/api/v1/balanca/opDescargaTrem/getByFiltro", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_6__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_2__["ErrorHandler"].handleError));
    };
    DescargasFerroviariasService.prototype.gerarDadosTmp = function (data) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_5__["environment"].service_url + "/api/v1/balanca/opDescargaTrem/gerarDadosTmp", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_6__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_2__["ErrorHandler"].handleError));
    };
    DescargasFerroviariasService.prototype.validarPlaca = function (opDescargaTremId, cadastroPlacaId) {
        return this.http
            .get(environments_environment__WEBPACK_IMPORTED_MODULE_5__["environment"].service_url + "/api/v1/balanca/opDescargaTrem/validarPlaca/" + opDescargaTremId + "/" + cadastroPlacaId)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_6__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_2__["ErrorHandler"].handleError));
    };
    DescargasFerroviariasService.prototype.validarRegistroPodeSerRemovido = function (opDescargaTremId) {
        return this.http
            .get(environments_environment__WEBPACK_IMPORTED_MODULE_5__["environment"].service_url + "/api/v1/balanca/opDescargaTrem/validarRegistroPodeSerRemovido/" + opDescargaTremId)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_6__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_2__["ErrorHandler"].handleError));
    };
    DescargasFerroviariasService.prototype.removerDescarga = function (opDescargaTremId, motivo) {
        return this.http
            .put(environments_environment__WEBPACK_IMPORTED_MODULE_5__["environment"].service_url + "/api/v1/balanca/opDescargaTrem/remove", {
            opDescargaTremId: opDescargaTremId,
            motivo: motivo
        })
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_6__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_2__["ErrorHandler"].handleError));
    };
    DescargasFerroviariasService.prototype.alterarDatas = function (data) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_5__["environment"].service_url + "/api/v1/balanca/opDescargaTrem/alterarDatas", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_6__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_2__["ErrorHandler"].handleError));
    };
    // Métodos que manipulam OpDescargaTremNota
    DescargasFerroviariasService.prototype.getNotasTmp = function () {
        return this.http
            .get(environments_environment__WEBPACK_IMPORTED_MODULE_5__["environment"].service_url + "/api/v1/balanca/opDescargaTremNota/" + this.data.regTmp)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_6__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_2__["ErrorHandler"].handleError));
    };
    DescargasFerroviariasService.prototype.getNotas = function (opDescargaTremId) {
        return this.http
            .get(environments_environment__WEBPACK_IMPORTED_MODULE_5__["environment"].service_url + "/api/v1/balanca/opDescargaTremNota/getNotas/" + opDescargaTremId)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_6__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_2__["ErrorHandler"].handleError));
    };
    DescargasFerroviariasService.prototype.validarENotaComplementar = function (data) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_5__["environment"].service_url + "/api/v1/balanca/opDescargaTremNota/validarENotaComplementar", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_6__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_2__["ErrorHandler"].handleError));
    };
    DescargasFerroviariasService.prototype.validarDocto = function (data) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_5__["environment"].service_url + "/api/v1/balanca/opDescargaTremNota/validarDocto", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_6__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_2__["ErrorHandler"].handleError));
    };
    DescargasFerroviariasService.prototype.getPesoRateioTotal = function (opDescargaTremId, destinatarioIdEmitente, docto) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_5__["environment"].service_url + "/api/v1/balanca/opDescargaTremNota/getPesoRateioTotal", { opDescargaTremId: opDescargaTremId, destinatarioIdEmitente: destinatarioIdEmitente, docto: docto })
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_6__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_2__["ErrorHandler"].handleError));
    };
    DescargasFerroviariasService.prototype.cancelarAlteracao = function () {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_5__["environment"].service_url + "/api/v1/balanca/opDescargaTrem/cancelarAlteracao", {
            regTmp: this.data.regTmp,
            codRotina: this.constantes.sisFormularioId
        })
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_6__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_2__["ErrorHandler"].handleError));
    };
    DescargasFerroviariasService.prototype.gravarTmpOpDescargaTremNota = function (data) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_5__["environment"].service_url + "/api/v1/balanca/opDescargaTremNota/gravarTmpOpDescargaTremNota", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_6__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_2__["ErrorHandler"].handleError));
    };
    DescargasFerroviariasService.prototype.removerTmpOpDescargaTremNota = function () {
        return this.http
            .put(environments_environment__WEBPACK_IMPORTED_MODULE_5__["environment"].service_url + "/api/v1/balanca/opDescargaTremNota/removerTmpOpDescargaTremNota", {
            opDescargaTremId: this.data.opDescargaTremId,
            regTmp: this.data.regTmp,
            opDescargaTremItemId: this.descargasFerroviariasNota.opDescargaTremItemId
        })
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_6__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_2__["ErrorHandler"].handleError));
    };
    DescargasFerroviariasService.prototype.getDadosPesagem = function (opDescargaTremId) {
        return this.http
            .get(environments_environment__WEBPACK_IMPORTED_MODULE_5__["environment"].service_url + "/api/v1/balanca/opDescargaTrem/getDadosPesagem/" + opDescargaTremId)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_6__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_2__["ErrorHandler"].handleError));
    };
    DescargasFerroviariasService.prototype.getChegadas = function (data) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_5__["environment"].service_url + "/api/v1/balanca/opDescargaTrem/getChegadas", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_6__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_2__["ErrorHandler"].handleError));
    };
    DescargasFerroviariasService.prototype.gravarConfirmacaoChegada = function (data) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_5__["environment"].service_url + "/api/v1/balanca/opDescargaTrem/gravarConfirmacaoChegada", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_6__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_2__["ErrorHandler"].handleError));
    };
    DescargasFerroviariasService.prototype.validarUsoFichaTecnica = function (opDescargaTremId, materialId) {
        return this.http
            .get(environments_environment__WEBPACK_IMPORTED_MODULE_5__["environment"].service_url + "/api/v1/balanca/opDescargaTrem/validarUsoFichaTecnica/" + opDescargaTremId + "/" + materialId)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_6__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_2__["ErrorHandler"].handleError));
    };
    DescargasFerroviariasService.prototype.getAnalisesOrigem = function (opDescargaTremId, materialId) {
        return this.http
            .get(environments_environment__WEBPACK_IMPORTED_MODULE_5__["environment"].service_url + "/api/v1/balanca/opDescargaTrem/getAnalisesOrigem/" + opDescargaTremId + "/" + materialId)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_6__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_2__["ErrorHandler"].handleError));
    };
    DescargasFerroviariasService.prototype.gravarAnaliseOrigem = function (data) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_5__["environment"].service_url + "/api/v1/balanca/opDescargaTrem/gravarAnaliseOrigem", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_6__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_2__["ErrorHandler"].handleError));
    };
    DescargasFerroviariasService.prototype.getDadosInformarEncosteByFiltro = function (filter) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_5__["environment"].service_url + "/api/v1/balanca/opDescargaTrem/getDadosInformarEncosteByFiltro", filter)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_6__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_2__["ErrorHandler"].handleError));
    };
    DescargasFerroviariasService.prototype.gravarDtEncoste = function (dadosEncoste, dtEncoste) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_5__["environment"].service_url + "/api/v1/balanca/opDescargaTrem/gravarDtEncoste", { dadosEncoste: dadosEncoste, dtEncoste: dtEncoste })
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_6__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_2__["ErrorHandler"].handleError));
    };
    DescargasFerroviariasService.prototype.validarPodeEfetuarPrimeiraPesagem = function (opDescargaTremId) {
        return this.http
            .get(environments_environment__WEBPACK_IMPORTED_MODULE_5__["environment"].service_url + "/api/v1/balanca/opDescargaTrem/validarPodeEfetuarPrimeiraPesagem/" + opDescargaTremId)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_6__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_2__["ErrorHandler"].handleError));
    };
    DescargasFerroviariasService.prototype.gravarPrimeiraPesagem = function (data) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_5__["environment"].service_url + "/api/v1/balanca/opDescargaTrem/gravarPrimeiraPesagem", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_6__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_2__["ErrorHandler"].handleError));
    };
    DescargasFerroviariasService.prototype.gravarSegundaPesagem = function (data) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_5__["environment"].service_url + "/api/v1/balanca/opDescargaTrem/gravarSegundaPesagem", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_6__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_2__["ErrorHandler"].handleError));
    };
    DescargasFerroviariasService.prototype.gravarLaudoPes = function (regMovimento, libDifPesoResponsavel, dtLibDifPeso) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_5__["environment"].service_url + "/api/v1/balanca/opDescargaTrem/gravarLaudoPes", { regMovimento: regMovimento, libDifPesoResponsavel: libDifPesoResponsavel, dtLibDifPeso: dtLibDifPeso })
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_6__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_2__["ErrorHandler"].handleError));
    };
    DescargasFerroviariasService.prototype.cancelarPesagem = function (opDescargaTremId, motivo) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_5__["environment"].service_url + "/api/v1/balanca/opDescargaTrem/cancelarPesagem", {
            opDescargaTremId: opDescargaTremId,
            motivo: motivo
        })
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_6__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_2__["ErrorHandler"].handleError));
    };
    DescargasFerroviariasService.prototype.ticketIntegrado = function (opDescargaTremId) {
        return this.http
            .get(environments_environment__WEBPACK_IMPORTED_MODULE_5__["environment"].service_url + "/api/v1/balanca/opDescargaTrem/ticketIntegrado/" + opDescargaTremId)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_6__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_2__["ErrorHandler"].handleError))
            .toPromise();
    };
    DescargasFerroviariasService.prototype.descargaLiberada = function (opDescargaTremId) {
        return this.http
            .get(environments_environment__WEBPACK_IMPORTED_MODULE_5__["environment"].service_url + "/api/v1/balanca/opDescargaTrem/descargaLiberada/" + opDescargaTremId)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_6__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_2__["ErrorHandler"].handleError))
            .toPromise();
    };
    DescargasFerroviariasService.prototype.getPesoLiqOpeDescTremPeso = function (opDescargaTremId) {
        return this.http
            .get(environments_environment__WEBPACK_IMPORTED_MODULE_5__["environment"].service_url + "/api/v1/balanca/opDescargaTrem/getPesoLiqOpeDescTremPeso/" + opDescargaTremId)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_6__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_2__["ErrorHandler"].handleError))
            .toPromise();
    };
    DescargasFerroviariasService.prototype.gravarPesagemParaRetorno = function (data) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_5__["environment"].service_url + "/api/v1/balanca/opDescargaTrem/gravarPesagemParaRetorno", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_6__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_2__["ErrorHandler"].handleError));
    };
    DescargasFerroviariasService.prototype.getDadosLiberarRetorno = function (opDescargaTremId) {
        return this.http
            .get(environments_environment__WEBPACK_IMPORTED_MODULE_5__["environment"].service_url + "/api/v1/balanca/opDescargaTrem/getDadosLiberarRetorno/" + opDescargaTremId)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_6__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_2__["ErrorHandler"].handleError));
    };
    DescargasFerroviariasService.prototype.gravarLiberarRetorno = function (data) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_5__["environment"].service_url + "/api/v1/balanca/opDescargaTrem/gravarLiberarRetorno", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_6__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_2__["ErrorHandler"].handleError));
    };
    DescargasFerroviariasService.ctorParameters = function () { return [
        { type: _angular_common_http__WEBPACK_IMPORTED_MODULE_0__["HttpClient"] },
        { type: app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_4__["MessageService"] }
    ]; };
    DescargasFerroviariasService = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"])({
            providedIn: 'root'
        }),
        __metadata("design:paramtypes", [_angular_common_http__WEBPACK_IMPORTED_MODULE_0__["HttpClient"],
            app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_4__["MessageService"]])
    ], DescargasFerroviariasService);
    return DescargasFerroviariasService;
}(app_shared_services_base_base_service__WEBPACK_IMPORTED_MODULE_3__["BaseService"]));



/***/ }),

/***/ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.validation.ts":
/*!*******************************************************************************************!*\
  !*** ./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.validation.ts ***!
  \*******************************************************************************************/
/*! exports provided: DescargasFerroviariasValidation */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DescargasFerroviariasValidation", function() { return DescargasFerroviariasValidation; });
/* 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_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! app/shared/services/funcoes/array-utils/array-utils.static.service */ "./src/app/shared/services/funcoes/array-utils/array-utils.static.service.ts");
/* harmony import */ var app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_3__ = __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 _shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../../../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 _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../../../shared/services/funcoes/funcoes.service */ "./src/app/shared/services/funcoes/funcoes.service.ts");
/* harmony import */ var _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../../../shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var _descargas_ferroviarias_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./descargas-ferroviarias.service */ "./src/app/pages/balanca/descargas-ferroviarias/descargas-ferroviarias.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 DescargasFerroviariasValidation = /** @class */ (function () {
    function DescargasFerroviariasValidation(service, message, funcoes) {
        this.service = service;
        this.message = message;
        this.funcoes = funcoes;
    }
    DescargasFerroviariasValidation.prototype.showMessagesResult = function (validationResult, isMessage) {
        var _this = this;
        if (isMessage === void 0) { isMessage = false; }
        var mensagens = this.message.validationResult(validationResult);
        if (isMessage) {
            app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_1__["EventEmitterService"].get("backError").emit(mensagens);
            return;
        }
        mensagens.forEach(function (m) { return _this.message.warning(_this.service.title, m); });
    };
    DescargasFerroviariasValidation.prototype.validaTicketIntegrado = function () {
        if (this.service.data.flagIntegracao === "I") {
            this.message.warning(this.service.title, "messages.tiketJaIntegrado");
            return false;
        }
        return true;
    };
    DescargasFerroviariasValidation.prototype.validarRegistroPodeSerAlterado = function (data) {
        return __awaiter(this, void 0, void 0, function () {
            var valido;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.service.descargaLiberada(data.opDescargaTremId)];
                    case 1:
                        valido = _a.sent();
                        if (!valido.isValid) {
                            this.showMessagesResult(valido);
                            return [2 /*return*/, false];
                        }
                        if (!this.service.configs.perEditFerroviario &&
                            ['A', 'R', 'S'].includes(data.sitReg) &&
                            this.service.configs.pesAntAn &&
                            app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_3__["NumberUtilsStaticService"].isNotPositive(data.pesoBru)) {
                            this.message.warning(this.service.title, 'messages.registroComPesagemAlteracaoNaoPermitida');
                            return [2 /*return*/, false];
                        }
                        if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_3__["NumberUtilsStaticService"].isPositive(data.pesoTara) && !this.validarDtSeguro(data.dtOper2Pes)) {
                            return [2 /*return*/, false];
                        }
                        return [2 /*return*/, true];
                }
            });
        });
    };
    DescargasFerroviariasValidation.prototype.validarPlaca = function () {
        var _this = this;
        if (!!this.service.data.cadastroPlacaId) {
            this.service.validarPlaca(this.service.opDescargaTremId, this.service.data.cadastroPlacaId).subscribe(function (result) {
                if (!result.isValid) {
                    _this.service.data.cadastroPlacaId = "";
                    _this.funcoes.focus("numeroVagao");
                    _this.showMessagesResult(result);
                }
            });
        }
    };
    DescargasFerroviariasValidation.prototype.validarDtAutorizacao = function (dtAutorizacao) {
        if (_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_4__["DateTimeUtilsStaticService"].menorA(dtAutorizacao, this.service.configs.dtSeguro)) {
            this.message.warning(this.service.title, "messages.dataNaoPodeSerMenorQueDataDoSeguro");
            return false;
        }
        return true;
    };
    DescargasFerroviariasValidation.prototype.validarDtTriagem = function (dtTriagem) {
        if ((dtTriagem === null || dtTriagem === undefined) && this.service.data.pesoBru > 0) {
            this.message.warning(this.service.title, "messages.dataEncosteEmBranco");
            return false;
        }
        if (_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_4__["DateTimeUtilsStaticService"].maiorAHoje(dtTriagem)) {
            this.message.warning(this.service.title, "messages.encosteNaoPodeSerMaiorDtAtual");
            return false;
        }
        var data = new Date();
        data.setDate(-60);
        if (_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_4__["DateTimeUtilsStaticService"].menorA(dtTriagem, data)) {
            this.message.warning(this.service.title, "messages.dtEncosteInvalida");
        }
        return true;
    };
    DescargasFerroviariasValidation.prototype.validarDtEntregaNF = function (dtEntrega) {
        if (dtEntrega === null || dtEntrega === undefined) {
            this.message.warning(this.service.title, "messages.dtEntregaEmBranco");
            return false;
        }
        if (_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_4__["DateTimeUtilsStaticService"].maiorAHoje(dtEntrega)) {
            this.message.warning(this.service.title, "messages.dtEntregaNfNaoPodeSerMaiorDataAtual");
            return false;
        }
        return true;
    };
    DescargasFerroviariasValidation.prototype.validarDtSeguro = function (dtOper2Pes) {
        if (dtOper2Pes === null || dtOper2Pes === undefined) {
            this.message.warning(this.service.title, "messages.dtEntregaEmBranco");
            return false;
        }
        if (_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_4__["DateTimeUtilsStaticService"].maiorA(this.service.configs.dtSeguro, dtOper2Pes)) {
            this.message.warning(this.service.title, "messages.dtEntregaNfNaoPodeSerMaiorDataAtual");
            return false;
        }
        return true;
    };
    DescargasFerroviariasValidation.prototype.validarDataDocumento = function () {
        if (_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_4__["DateTimeUtilsStaticService"].maiorAHoje(this.service.descargasFerroviariasNota.dtDocto)) {
            this.message.warning(this.service.title, "messages.dtDocumentoNaoPodeSerMaiorDataAtual");
            return;
        }
        var difDias = _shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_4__["DateTimeUtilsStaticService"].difDays(this.service.descargasFerroviariasNota.dtDocto);
        if (difDias > this.service.configs.difMaxNFDtAtual) {
            this.message.warning(this.service.title, this.message.translate("messages.dtDocumentoDeveSerMenorDias", { qtdeDias: this.service.configs.difMaxNFDtAtual }));
            return;
        }
    };
    DescargasFerroviariasValidation.prototype.validarVlNota = function () {
        var calcTotItem = app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_3__["NumberUtilsStaticService"].round((this.service.descargasFerroviariasNota.quantidDoc * (this.service.descargasFerroviariasNota.lote == null ? 1 : this.service.descargasFerroviariasNota.lote.precoArmazenado)), 2);
        if ((this.service.descargasFerroviariasNota.vlNota - calcTotItem) > 1) {
            this.message.warning(this.service.title, "messages.totItemNPodeMaiorCalcTotItem");
            this.service.descargasFerroviariasNota.vlNota = 0;
        }
    };
    DescargasFerroviariasValidation.prototype.calcularDiferencaPerc = function (pesoRateio, pesoDoc) {
        var diferenca = (pesoRateio - pesoDoc) * -1;
        return (diferenca * 100) / pesoDoc;
    };
    DescargasFerroviariasValidation.prototype.validarIntegracaoNFCompra = function () {
        var _this = this;
        var diferencaPerc = this.calcularDiferencaPerc(this.service.descargasFerroviariasNota.pesoRateio, this.service.descargasFerroviariasNota.pesoDoc);
        if (diferencaPerc > 0 && diferencaPerc > this.service.configs.ptNfCompraDif) {
            this.service.getPesoRateioTotal(this.service.opDescargaTremId, this.service.descargasFerroviariasNota.destinatarioIdEmitente, this.service.descargasFerroviariasNota.docto).subscribe(function (pesoRateioTotal) {
                if (pesoRateioTotal != null && pesoRateioTotal > 0) {
                    diferencaPerc = _this.calcularDiferencaPerc((pesoRateioTotal + _this.service.descargasFerroviariasNota.pesoRateio), _this.service.descargasFerroviariasNota.pesoDoc);
                    _this.service.descargasFerroviariasNota.flagIntegra = (diferencaPerc > 0 && diferencaPerc > _this.service.configs.ptNfCompraDif) ? "N" : "S";
                }
                else {
                    _this.service.descargasFerroviariasNota.flagIntegra = "S";
                }
            });
        }
        else {
            this.service.descargasFerroviariasNota.flagIntegra = "S";
        }
    };
    DescargasFerroviariasValidation.prototype.validaChaveNfe = function (params, showError) {
        if (showError === void 0) { showError = false; }
        var r = { "isValid": true, "message": "" };
        if (params.data.chaveNfe === "") {
            return r;
        }
        if ((!this.funcoes.validaChaveNFe(params.data.chaveNfe, params.data.emitente, params.data.docto, params.data.serieNotaId))) {
            r.isValid = false;
            r.message = "messages.chaveNfeInvalida";
        }
        if (!r.isValid && showError) {
            this.message.warning(this.service.title, r.message);
        }
        return r;
    };
    DescargasFerroviariasValidation.prototype.preSave = function (form, item) {
        if (item === void 0) { item = false; }
        app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_1__["EventEmitterService"].get("formError").emit(form);
        if (form.invalid) {
            this.funcoes.backToTop();
            return false;
        }
        var mensagens = [];
        if (!item) {
            if (!app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_2__["ArrayUtilsStaticService"].any(this.service.data.opDescargaTremNotas)) {
                mensagens.push("messages.nenhumItemCadastrado");
            }
            else {
                var pesoRateio = this.service.data.opDescargaTremNotas.filter(function (c) { return c.sitReg !== 'E'; }).reduce(function (a, b) { return a + b.pesoRateio; }, 0);
                if (pesoRateio != this.service.data.kilos) {
                    mensagens.push("messages.totalPesoRateioDiferentePesoOrigem");
                }
            }
        }
        else {
            if (!!this.service.descargasFerroviariasNota) {
                if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_3__["NumberUtilsStaticService"].isNotPositive(this.service.descargasFerroviariasNota.quantidDoc)) {
                    var name_1 = this.message.getTranslates("labels", "quantidDoc");
                    var m = this.message.translate("messages.campoObrigatorio", { name: name_1 });
                    mensagens.push(m);
                }
                if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_3__["NumberUtilsStaticService"].isNotPositive(this.service.descargasFerroviariasNota.vlNota)) {
                    var name_2 = this.message.getTranslates("labels", "total");
                    var m = this.message.translate("messages.campoObrigatorio", { name: name_2 });
                    mensagens.push(m);
                }
                if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_3__["NumberUtilsStaticService"].isNotPositive(this.service.descargasFerroviariasNota.pesoDoc)) {
                    var name_3 = this.message.getTranslates("labels", "pesoDoc");
                    var m = this.message.translate("messages.campoObrigatorio", { name: name_3 });
                    mensagens.push(m);
                }
                if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_3__["NumberUtilsStaticService"].isNotPositive(this.service.descargasFerroviariasNota.pesoRateio)) {
                    var name_4 = this.message.getTranslates("labels", "pesoRateio");
                    var m = this.message.translate("messages.campoObrigatorio", { name: name_4 });
                    mensagens.push(m);
                }
            }
        }
        if (app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_2__["ArrayUtilsStaticService"].any(mensagens)) {
            app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_1__["EventEmitterService"].get("backError").emit(mensagens);
            this.funcoes.backToTop();
            return false;
        }
        return true;
    };
    DescargasFerroviariasValidation.ctorParameters = function () { return [
        { type: _descargas_ferroviarias_service__WEBPACK_IMPORTED_MODULE_7__["DescargasFerroviariasService"] },
        { type: _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_6__["MessageService"] },
        { type: _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_5__["FuncoesService"] }
    ]; };
    DescargasFerroviariasValidation = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"])({
            providedIn: 'root'
        }),
        __metadata("design:paramtypes", [_descargas_ferroviarias_service__WEBPACK_IMPORTED_MODULE_7__["DescargasFerroviariasService"],
            _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_6__["MessageService"],
            _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_5__["FuncoesService"]])
    ], DescargasFerroviariasValidation);
    return DescargasFerroviariasValidation;
}());



/***/ }),

/***/ "./src/app/shared/services/funcoes/email/email.service.ts":
/*!****************************************************************!*\
  !*** ./src/app/shared/services/funcoes/email/email.service.ts ***!
  \****************************************************************/
/*! exports provided: EmailService */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EmailService", function() { return EmailService; });
/* harmony import */ var _base_base_service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../base/base.service */ "./src/app/shared/services/base/base.service.ts");
/* harmony import */ var _angular_common_http__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/common/http */ "./node_modules/@angular/common/fesm5/http.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _environments_environment__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../../environments/environment */ "./src/environments/environment.ts");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (undefined && undefined.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};




var EmailService = /** @class */ (function (_super) {
    __extends(EmailService, _super);
    function EmailService(http) {
        var _this = _super.call(this, http, "controlle/enviarEmail") || this;
        _this.http = http;
        return _this;
    }
    EmailService.prototype.enviarEmail = function (data) {
        return this.http.post(_environments_environment__WEBPACK_IMPORTED_MODULE_3__["environment"].service_url + "/api/v1/controlle/enviarEmail/", data);
    };
    EmailService.prototype.IsValidEmailAddress = function (email) {
        var exclude = email.search("/[^@.-w]|^[_@.-]|[._-]{2}|[@.]{2}|(@)[^@]*1/");
        var check = email.search("/@[w-]+./");
        var checkend = email.search("/.[a-zA-Z]{2,3}$/");
        if ((exclude !== -1)
            || (check === -1)
            || (checkend === -1)) {
            return false;
        }
        else {
            return true;
        }
    };
    EmailService.prototype.IsValidEmailAddressed = function (emails) {
        var regex = /^((?!\.)[\w-_.]*[^.])(@\w+)(\.\w+(\.\w+)?[^.\W])$/gm;
        var emailList = emails.split(";");
        var isAllValid = true;
        emailList.forEach(function (e) {
            if (!regex.test(e) && isAllValid) {
                isAllValid = false;
            }
        });
        return isAllValid;
    };
    EmailService.ctorParameters = function () { return [
        { type: _angular_common_http__WEBPACK_IMPORTED_MODULE_1__["HttpClient"] }
    ]; };
    EmailService = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_2__["Injectable"])({
            providedIn: 'root'
        }),
        __metadata("design:paramtypes", [_angular_common_http__WEBPACK_IMPORTED_MODULE_1__["HttpClient"]])
    ], EmailService);
    return EmailService;
}(_base_base_service__WEBPACK_IMPORTED_MODULE_0__["BaseService"]));



/***/ })

}]);
//# sourceMappingURL=app-pages-balanca-descargas-ferroviarias-descargas-ferroviarias-module.js.map