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

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-alterar-dados/requisicao-descarga-alterar-dados.component.html":
/*!****************************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-alterar-dados/requisicao-descarga-alterar-dados.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.listaAlterarDados\" [sisFormularioId]=\"constantes.sisFormularioId\">\n</app-menu-command-bar>\n\n<div class=\"row\">\n    <div class=\"col-md-12 col-lg-12\">\n        <div class=\"section-comand-bar\">\n            <app-form-legenda></app-form-legenda>\n            <div class=\"row\">\n                <div class=\"col-lg-12\">\n                    <app-validacoes></app-validacoes>\n                    <form class=\"form\" #frmRequisicaoDescarga=\"ngForm\" (ngSubmit)=\"onSubmit(frmRequisicaoDescarga)\">\n                        <div class=\"row\">\n                            <div class=\"col-lg-3 col-md-6 col-sm-12\">\n                                <div class=\"form-group form-group-sm\">\n                                    <app-pesquisa-saldo-lote-deposito id=\"deposito\" name=\"deposito\" required=\"true\"\n                                        [label]=\"'deposito'\" [modalTitle]=\"'deposito'\"\n                                        [disabled]=\"service.configCtv.solicitaPlanejEv && !data.tanqueId\"\n                                        [field]=\"'tanqueId'\" [options]=\"saldoDepositoOptions\"\n                                        [(ngModel)]=\"data.tanqueId\">\n                                    </app-pesquisa-saldo-lote-deposito>\n                                </div>\n                            </div>\n                            <div class=\"col-lg-3 col-md-6 col-sm-12\">\n                                <div class=\"form-group form-group-sm\">\n                                    <label for=\"percDescargaComissionada\"\n                                        [class.required]=\"service.configBal.sPerDesComis\">{{\"labels.percDescargaComissionada\"\n                                        | translate\n                                        }}</label>\n                                    <select id=\"percDescargaComissionada\" name=\"percDescargaComissionada\"\n                                        [(ngModel)]=\"data.percDesComis\" class=\"form-control form-control-sm\"\n                                        [required]=\"service.configBal.sPerDesComis\">\n                                        <option value=\"\">{{'labels.selecione'|translate}}</option>\n                                        <option value=\"0\">0</option>\n                                        <option value=\"20\">20</option>\n                                        <option value=\"100\">100</option>\n                                    </select>\n                                </div>\n                            </div>\n                        </div>\n                        <div class=\"row\">\n                            <div class=\"col-lg-6 col-sm-12\">\n                                <div class=\"form-group form-group-sm\">\n                                    <label for=\"tipoOperacao\">\n                                        {{'labels.tipoOperacao' | translate}}\n                                    </label>\n                                    <app-combo-tipo-operacao id=\"tipoOperacao\" name=\"tipoOperacao\"\n                                        [(ngModel)]=\"data.tipoOperacaoId\" flagAtivo=\"S\">\n                                    </app-combo-tipo-operacao>\n                                </div>\n                            </div>\n                        </div>\n                        <div class=\"row\">\n                            <div class=\"col-lg-6 col-sm-12\">\n                                <div class=\"form-group form-group-sm\">\n                                    <label for=\"plataforma\"\n                                        [class.required]=\"service.configWeb.obrigaPlataformaRodo === 'S'\">{{\n                                        'labels.plataforma' | translate}}</label>\n                                    <app-combo-padrao id=\"plataforma\" name=\"plataforma\" tabela=\"Plataforma\"\n                                        [required]=\"service.configWeb.obrigaPlataformaRodo === 'S'\"\n                                        descricao=\"DescrPlataforma\" chave=\"CodPlataforma\" ativos=\"true\"\n                                        [(ngModel)]=\"data.plataformaId\">\n                                    </app-combo-padrao>\n                                </div>\n                            </div>\n                        </div>\n                        <div class=\"row\">\n                            <div class=\"col-lg-6 col-sm-12\">\n                                <div class=\"form-group form-group-sm\">\n                                    <label for=\"localOperacao\">{{\"labels.localOperacao\" | translate\n                                        }}</label>\n                                    <app-combo-padrao name=\"localOperacao\" id=\"localOperacao\" chave=\"CodLocalOper\"\n                                        descricao=\"DescrLocalOper\" ativo=\"true\" tabela=\"LocalOperacao\"\n                                        [(ngModel)]=\"data.codLocalOper\">\n                                    </app-combo-padrao>\n                                </div>\n                            </div>\n                        </div>\n                        <div class=\"row\">\n                            <div class=\"col-lg-6\">\n                                <div class=\"form-group form-group-sm\">\n                                    <app-pesquisa-destinatario id=\"destinatarioIdCliente\" name=\"destinatarioIdCliente\"\n                                        label=\"cliente\" modalTitle=\"pesquisaDeCliente\"\n                                        [(ngModel)]=\"data.destinatarioIdCliente\" tipoDestinatario=\"C\" showCgcCpf=\"true\"\n                                        showInscricao=\"false\" (outModel)=\"trataDest($event)\"\n                                        [inSelected]=\"data.cliente\">\n                                    </app-pesquisa-destinatario>\n                                </div>\n                            </div>\n                        </div>\n                        <div class=\"row\">\n                            <div class=\"col-lg-6\">\n                                <div class=\"form-group form-group-sm\">\n                                    <app-pesquisa-destinatario id=\"destinatarioIdEmitente\" name=\"destinatarioIdEmitente\"\n                                        label=\"emitente\" modalTitle=\"pesquisaDeEmitente\"\n                                        [(ngModel)]=\"data.destinatarioIdEmitente\" tipoDestinatario=\"C\" showCgcCpf=\"true\"\n                                        showInscricao=\"false\" [disabled]=\"true\" [inSelected]=\"data.emitente\">\n                                    </app-pesquisa-destinatario>\n                                </div>\n                            </div>\n                        </div>\n                        <div class=\"row\">\n                            <div class=\"col-lg-6\">\n                                <div class=\"form-group form-group-sm\">\n                                    <app-pesquisa-material id=\"produto\" name=\"produto\" label=\"produto\"\n                                        modalTitle=\"pesquisaDeProduto\" [inSelected]=\"data.material\"\n                                        (outModel)=\"data.material = $event\" [(ngModel)]=\"data.materialId\">\n                                    </app-pesquisa-material>\n                                </div>\n                            </div>\n                        </div>\n                        <div class=\"row\">\n                            <div class=\"col-lg-3 col-md-6\">\n                                <app-pesquisa-lote id=\"lote\" label=\"lote\" name=\"lote\" modalTitle=\"lote\"\n                                    [(ngModel)]=\"data.loteId\" [destinatarioIdCliente]=\"data.destinatarioIdCliente\"\n                                    [materialId]=\"data.materialId\" [loteId]=\"data.loteId\" destinatarioIdEmitente=\"0\"\n                                    destinatarioIdNavio=\"0\" [osgId]=\"0\" stoContratoId=\"\" stoContratoItemId=\"0\"\n                                    clienteOuProdutoObrigatorio=\"false\" [required]=\"true\"\n                                    [disabled]=\"service.configCtv.solicitaPlanejEv && !data.tanqueId\"\n                                    (outLote)=\"trataLote($event)\">\n                                </app-pesquisa-lote>\n                            </div>\n                            <div class=\"col-lg-2 col-md-6\">\n                                <div class=\"form-group\">\n                                    <label for=\"unitario\">{{ 'labels.unitario' | translate }}</label>\n                                    <input id=\"unitario\" type=\"text\" class=\"form-control form-control-sm\"\n                                        name=\"unitario\" [value]=\"data.precoArmazenado | formatCurrency: 9\" readonly>\n                                </div>\n                            </div>\n                            <div class=\"col-lg-2 col-md-6\">\n                                <div class=\"form-group form-group-sm\">\n                                    <label for=\"frete\">{{\"labels.frete\" | translate\n                                        }}</label>\n                                    <select id=\"frete\" name=\"frete\" [(ngModel)]=\"data.tipoFreteId\"\n                                        class=\"form-control form-control-sm\">\n                                        <option value=\"\">{{'labels.selecione'|translate}}</option>\n                                        <option value=\"0\">{{'labels.semFrete'|translate}}</option>\n                                        <option value=\"1\">{{'labels.emitenteCif'|translate}}</option>\n                                        <option value=\"2\">{{'labels.destRemFob'|translate}}</option>\n                                        <option value=\"3\">{{'labels.terceiros'|translate}}</option>\n                                    </select>\n                                </div>\n                            </div>\n                        </div>\n                        <div class=\"row\">\n                            <div class=\"col-md-3\">\n                                <div class=\"form-group form-group-sm\">\n                                    <label for=\"tipoDocTransporte\" class=\"required\">\n                                        {{'labels.tipoDocTransporte' | translate}}</label>\n                                    <app-combo-tipo-documento-transp id=\"tipoDocTransporte\" name=\"tipoDocTransporte\"\n                                        [(ngModel)]=\"data.tipoDocumentoTranspId\"\n                                        [disabled]=\"disabledTipoDocumentoTransp\" required\n                                        (outSelected)=\"trataTipoDocumentoTransp($event)\">\n                                    </app-combo-tipo-documento-transp>\n                                </div>\n                            </div>\n                            <div class=\"col-md-2\">\n                                <div class=\"form-group form-group-sm\">\n                                    <label for=\"docTranspNumero\" [class.required]=\"requiredDadosEntrada\">\n                                        {{'labels.numero' | translate}}\n                                    </label>\n                                    <input id=\"docTranspNumero\" name=\"docTranspNumero\"\n                                        data-title=\"{{'labels.numero' | translate}}\" type=\"text\"\n                                        class=\"form-control form-control-sm\"\n                                        value=\"{{ data.docTranspNumero | mask: data.maskDocTransNumero }}\"\n                                        [disabled]=\"!requiredDadosEntrada\" [required]=\"requiredDadosEntrada\" />\n                                </div>\n                            </div>\n                            <div class=\"col-md-2\">\n                                <div class=\"form-group form-group-sm\">\n                                    <label for=\"docTranspEmissao\" [class.required]=\"requiredDadosEntrada\">\n                                        {{'labels.emissao' | translate}}\n                                    </label>\n                                    <app-data id=\"docTranspEmissao\" name=\"docTranspEmissao\"\n                                        data-title=\"{{'labels.emissao' | translate}}\"\n                                        [(ngModel)]=\"data.docTranspEmissao\" [disabled]=\"!requiredDadosEntrada\"\n                                        [required]=\"requiredDadosEntrada\">\n                                    </app-data>\n                                </div>\n                            </div>\n                        </div>\n                        <div class=\"row\">\n                            <div class=\"col-md-6 col-sm-12\">\n                                <div class=\"form-group form-group-sm\">\n                                    <label for=\"tipoDeTransporte\" class=\"required\">\n                                        {{ 'labels.tipoDeTransporte' | translate }}\n                                    </label>\n                                    <app-combo-tipos-de-transporte id=\"tipoDeTransporte\" name=\"tipoDeTransporte\"\n                                        required=\"true\" ativos=\"true\" ordenarPorDescricao=\"true\"\n                                        [(ngModel)]=\"data.tipoTransp\">\n                                    </app-combo-tipos-de-transporte>\n                                </div>\n                            </div>\n                        </div>\n                        <div class=\"row\">\n                            <div class=\"col-lg-8 col-sm-12\">\n                                <app-pesquisa-motorista id=\"motorista\" name=\"motorista\" label=\"motorista\"\n                                    modalTitle=\"pesquisaMotorista\" [(ngModel)]=\"data.motoristaId\" [showCpf]=\"true\"\n                                    [inputMotorista]=\"data.motorista\" required=\"true\"\n                                    (outMotorista)=\"trataMotorista($event)\">\n                                </app-pesquisa-motorista>\n                            </div>\n                        </div>\n                        <div class=\"row\">\n                            <div class=\"col-lg-3 col-md-6\">\n                                <div class=\"form-group form-group-sm\">\n                                    <label for=\"motoristaCnhCM\">{{'labels.cnh' | translate }}</label>\n                                    <input id=\"motoristaCnhCM\" type=\"text\" name=\"motoristaCnhCM\"\n                                        class=\"form-control form-control-sm\" value=\"{{data.motorista?.cnh}}\" disabled>\n                                </div>\n                            </div>\n                            <div class=\"col-lg-3 col-md-6\">\n                                <div class=\"form-group form-group-sm\">\n                                    <label for=\"motoristaCnhValidadeCM\">{{'labels.validade' | translate }}</label>\n                                    <input id=\"motoristaCnhValidadeCM\" type=\"text\" name=\"motoristaCnhValidadeCM\"\n                                        class=\"form-control form-control-sm\"\n                                        value=\"{{data.motorista?.cnhValidade | date:'dd/MM/yyyy'}}\" disabled>\n                                </div>\n                            </div>\n                            <div class=\"col-lg-3 col-md-6\">\n                                <div class=\"form-group form-group-sm\">\n                                    <label for=\"motoristaRgCM\">{{'labels.rg' | translate }}</label>\n                                    <input id=\"motoristaRgCM\" type=\"text\" name=\"motoristaRgCM\"\n                                        class=\"form-control form-control-sm\" value=\"{{data.motorista?.rg}}\" disabled>\n                                </div>\n                            </div>\n                        </div>\n                        <div class=\"row\">\n                            <div class=\"col-md-8 col-sm-12\">\n                                <div class=\"form-group form-group-sm\">\n                                    <app-pesquisa-destinatario id=\"transportador\" name=\"transportador\"\n                                        label=\"transportador\" [required]=\"requiredTransp\" [disabled]=\"!requiredTransp\"\n                                        modalTitle=\"pesquisaDeTransportadora\"\n                                        [(ngModel)]=\"data.destinatarioIdTransportadora\"\n                                        [inSelected]=\"data.transportadora\" tipoDestinatario=\"T\" showCgcCpf=\"true\"\n                                        showInscricao=\"false\">\n                                    </app-pesquisa-destinatario>\n                                </div>\n                            </div>\n                        </div>\n                        <div class=\"row\">\n                            <div class=\"col-md-2 col-sm-12\">\n                                <div class=\"form-group form-group-sm\">\n                                    <label for=\"placaVeiculo\" [class.required]=\"requiredPlaca\">\n                                        {{'labels.placaVeiculo' | translate}}\n                                    </label>\n                                    <input id=\"placaVeiculo\" name=\"placaVeiculo\"\n                                        class=\"form-control form-control-sm text-uppercase\" type=\"text\" maxlength=\"8\"\n                                        [required]=\"requiredPlaca\" [disabled]=\"!requiredPlaca\"\n                                        [(ngModel)]=\"data.cadastroPlacaIdCavalo\" />\n                                </div>\n                            </div>\n                            <div class=\"col-md-2 col-sm-12\">\n                                <div class=\"form-group form-group-sm\">\n                                    <label for=\"carreta1\">{{'labels.carreta1' | translate}}</label>\n                                    <input id=\"carreta1\" name=\"carreta1\"\n                                        class=\"form-control form-control-sm text-uppercase\" type=\"text\" maxlength=\"8\"\n                                        [(ngModel)]=\"data.cadastroPlacaIdCarreta1\" [disabled]=\"!requiredPlaca\" />\n                                </div>\n                            </div>\n                            <div class=\"col-md-2 col-sm-12\">\n                                <div class=\"form-group form-group-sm\">\n                                    <label for=\"carreta2\">{{'labels.carreta2' | translate}}</label>\n                                    <input id=\"carreta2\" name=\"carreta2\"\n                                        class=\"form-control form-control-sm text-uppercase\" type=\"text\" maxlength=\"8\"\n                                        [(ngModel)]=\"data.cadastroPlacaIdCarreta2\" [disabled]=\"!requiredPlaca\" />\n                                </div>\n                            </div>\n                        </div>\n                        <div class=\"row mb-2\">\n                            <div class=\"col-4\">\n                                <div class=\"form-group\">\n                                    <button class=\"btn btn-success mr-2\" type=\"submit\">\n                                        {{ 'buttons.salvar' | translate }}\n                                    </button>\n                                </div>\n                            </div>\n                        </div>\n                    </form>\n                </div>\n            </div>\n        </div>\n    </div>\n</div>");

/***/ }),

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-alterar-datas/requisicao-descarga-alterar-datas.component.html":
/*!****************************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-alterar-datas/requisicao-descarga-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"] = ("<app-menu-command-bar [botoesComando]=\"constantes.listaAlterarDatas\" [sisFormularioId]=\"constantes.sisFormularioId\">\n</app-menu-command-bar>\n\n<div class=\"row\">\n    <div class=\"col-md-12 col-lg-12\">\n        <div class=\"section-comand-bar\">\n            <div class=\"row\">\n                <div class=\"col-lg-12\">\n                    <app-form-legenda></app-form-legenda>\n                    <form class=\"form\" #frmRequisicaoDescarga=\"ngForm\" (ngSubmit)=\"onSubmit(frmRequisicaoDescarga)\">\n                        <app-validacoes formErrorId=\"msgRDescargaAlteraDatas\"></app-validacoes>\n                        <div class=\"row\">\n                            <div class=\"col-lg-3\">\n                                <div class=\"form-group form-group-sm\">\n                                    <label for=\"dtTriagemAD\">{{'labels.triagem' | translate}}</label>\n                                    <app-data-h-m-s id=\"dtTriagemAD\" name=\"dtTriagemAD\" [(ngModel)]=\"data.dtTriagem\"\n                                        (executa)=\"trataJustAtraso()\">\n                                    </app-data-h-m-s>\n                                </div>\n                            </div>\n                            <div class=\"col-lg-3\">\n                                <div class=\"form-group form-group-sm\">\n                                    <label for=\"dtChegadaAD\" class=\"required\">{{'labels.chegada' | translate}}</label>\n                                    <app-data-h-m-s id=\"dtChegadaAD\" name=\"dtChegadaAD\" [(ngModel)]=\"data.dtChegada\"\n                                        [required]=\"true\"\n                                        (executa)=\"validation.validaDtChegada({dtChegada: $event, dtTriagem: data.dtTriagem}, trataJustAtraso)\">\n                                    </app-data-h-m-s>\n                                </div>\n                            </div>\n                            <div class=\"col-lg-3\">\n                                <div class=\"form-group form-group-sm\">\n                                    <label for=\"dtEntregaNfAD\">{{'labels.entregaNf' | translate}}</label>\n                                    <app-data-h-m-s id=\"dtEntregaNfAD\" name=\"dtEntregaNfAD\"\n                                        [(ngModel)]=\"data.dtEntregaNf\"\n                                        (executa)=\"validation.validaDtEntregaNf({dtEntregaNf: $event})\">\n                                    </app-data-h-m-s>\n                                </div>\n                            </div>\n                        </div>\n                        <div class=\"row\">\n                            <div class=\"col-lg-3\">\n                                <div class=\"form-group form-group-sm\">\n                                    <label for=\"dtAutorizacaoAD\" class=\"required\">{{'labels.entrada' |\n                                        translate}}</label>\n                                    <app-data-h-m-s id=\"dtAutorizacaoAD\" name=\"dtAutorizacaoAD\"\n                                        [(ngModel)]=\"data.dtAutorizacao\" [required]=\"true\"\n                                        (executa)=\"validation.validaDtAutorizacao({dtAutorizacao: $event, dtChegada: data.dtChegada})\">\n                                    </app-data-h-m-s>\n                                </div>\n                            </div>\n                        </div>\n                        <div class=\"row\">\n                            <div class=\"col-lg-3\">\n                                <div class=\"form-group form-group-sm\">\n                                    <label for=\"dtIniOperAD\" class=\"required\">{{'labels.inicioDeOperacao' |\n                                        translate}}</label>\n                                    <app-data-h-m-s id=\"dtIniOperAD\" name=\"dtIniOperAD\" [(ngModel)]=\"data.dtIniOper\"\n                                        [required]=\"true\"\n                                        (executa)=\"validation.validaDtIniOper({dtIniOper: $event, dtAutorizacao: data.dtAutorizacao})\">\n                                    </app-data-h-m-s>\n                                </div>\n                            </div>\n                            <div class=\"col-lg-3\">\n                                <div class=\"form-group form-group-sm\">\n                                    <label for=\"dtFimOperAD\" class=\"required\">{{'labels.fimOper' | translate}}</label>\n                                    <app-data-h-m-s id=\"dtFimOperAD\" name=\"dtFimOperAD\" [(ngModel)]=\"data.dtFimOper\"\n                                        (executa)=\"validation.validaDtFimOper({dtFimOper: $event, dtIniOper: data.dtIniOper})\"\n                                        [required]=\"true\">\n                                    </app-data-h-m-s>\n                                </div>\n                            </div>\n                        </div>\n                        <div class=\"row\">\n                            <div class=\"col-lg-3\">\n                                <div class=\"form-group form-group-sm\">\n                                    <label for=\"dtSaidaAD\">{{'labels.saida' | translate}}</label>\n                                    <app-data-h-m-s id=\"dtSaida\" name=\"dtSaida\" [(ngModel)]=\"data.dtSaida\"\n                                        (executa)=\"validation.validaDtSaida({dtSaida: $event, dtFimOper: data.dtFimOper})\">\n                                    </app-data-h-m-s>\n                                </div>\n                            </div>\n                        </div>\n                        <div class=\"row\">\n                            <div class=\"col-lg-3\">\n                                <div class=\"form-group form-group-sm\">\n                                    <label for=\"dtLibVeiculoAD\">{{'labels.saidaTerminal' | translate}}</label>\n                                    <app-data-h-m-s id=\"dtLibVeiculoAD\" name=\"dtLibVeiculoAD\"\n                                        [(ngModel)]=\"data.dtLibVeiculo\"\n                                        (executa)=\"validation.validaDtLibVeiculo({dtLibVeiculo: $event, dtSaida: data.dtSaida})\">\n                                    </app-data-h-m-s>\n                                </div>\n                            </div>\n                        </div>\n                        <div class=\"row\">\n                            <div class=\"col-lg-3\">\n                                <div class=\"form-group form-group-sm\">\n                                    <label for=\"nrTifAD\">{{'labels.nrTif' | translate}}</label>\n                                    <input id=\"nrTifAD\" name=\"nrTifAD\" [(ngModel)]=\"data.nrTif\"\n                                        class=\"form-control form-control-sm\" type=\"number\"\n                                        data-title=\"{{'labels.nrTif' | translate}}\">\n                                </div>\n                            </div>\n                        </div>\n                        <div class=\"row\">\n                            <div class=\"col-lg-6\">\n                                <div class=\"form-group form-group-sm\">\n                                    <label for=\"observAD\">{{'labels.observacao' | translate}}</label>\n                                    <input id=\"observAD\" name=\"observ\" [(ngModel)]=\"data.observ\"\n                                        class=\"form-control form-control-sm\" type=\"text\" type=\"text\" maxlength=\"50\"\n                                        data-title=\"{{'labels.observacao' | translate}}\">\n                                </div>\n                            </div>\n                        </div>\n                        <div class=\"row\">\n                            <div class=\"col-lg-6 col-md-10 col-sm-12\">\n                                <div class=\"form-group form-group-sm\">\n                                    <app-field-container>\n                                        <label for=\"justificativaQuebra\"\n                                            [class.required]=\"!!oldData.motivoQuebraId\">{{'labels.justificativaQuebra' |\n                                            translate}}</label>\n                                        <app-combo-padrao id=\"justificativaQuebra\" name=\"justificativaQuebra\"\n                                            [(ngModel)]=\"data.motivoQuebraId\" tabela=\"MotivoQuebra\"\n                                            chave=\"CodMotivoQuebra\" descricao=\"DescrMotivoQuebra\" ativos=\"true\"\n                                            [disabled]=\"disabledQuebra\" [required]=\"!!oldData.motivoQuebraId\">\n                                        </app-combo-padrao>\n                                    </app-field-container>\n                                </div>\n                            </div>\n                        </div>\n                        <div class=\"row\">\n                            <div class=\"col-lg-6 col-md-10 col-sm-12\">\n                                <div class=\"form-group form-group-sm\">\n                                    <app-field-container>\n                                        <label for=\"justificativaDeatraso\"\n                                            [class.required]=\"!disabledAtraso\">{{'labels.justificativaDeatraso'\n                                            |\n                                            translate}}</label>\n                                        <app-combo-padrao id=\"justificativaDeatraso\" name=\"justificativaDeatraso\"\n                                            [(ngModel)]=\"data.motivoAtrasoId\" tabela=\"MotivoAtraso\"\n                                            chave=\"CodMotivoAtraso\" descricao=\"DescrMotivoAtraso\" ativos=\"true\"\n                                            [disabled]=\"disabledAtraso\" [required]=\"!disabledAtraso\">\n                                        </app-combo-padrao>\n                                    </app-field-container>\n                                </div>\n                            </div>\n                            <div class=\"col-lg-4\">\n                                <label></label>\n                                <div class=\"col-sm-10\">\n                                    <p class=\"form-control-static\">{{ atraso }}</p>\n                                </div>\n                            </div>\n                        </div>\n                        <div class=\"row\">\n                            <div class=\"col-lg-6 col-md-10 col-sm-12\">\n                                <div class=\"form-group form-group-sm\">\n                                    <app-field-container>\n                                        <label for=\"ternoIdAD\">{{'labels.terno' | translate}}</label>\n                                        <app-combo-terno id=\"ternoIdAD\" name=\"ternoId\" [(ngModel)]=\"data.ternoId\">\n                                        </app-combo-terno>\n                                    </app-field-container>\n                                </div>\n                            </div>\n                        </div>\n                        <div class=\"row mb-2\">\n                            <div class=\"col-4\">\n                                <div class=\"form-group\">\n                                    <button class=\"btn btn-success mr-2\" type=\"submit\">\n                                        {{ 'buttons.salvar' | translate }}\n                                    </button>\n                                </div>\n                            </div>\n                        </div>\n                    </form>\n                </div>\n            </div>\n        </div>\n    </div>\n</div>");

/***/ }),

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

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("<div class=\"modal fade\" id=\"rd-filter-dialog\" tabindex=\"-1\" role=\"dialog\" data-backdrop=\"static\">\n    <div class=\"uni-modal-dialog-md-50\">\n        <div class=\"modal-content\">\n            <div class=\"modal-header\">\n                <h5 class=\"modal-title\">{{ 'titles.pesquisaDeRequisicaoDescarga' | translate }}</h5>\n            </div>\n            <form class=\"form\" #form=\"ngForm\" (ngSubmit)=\"onSubmit(form)\">\n                <div class=\"modal-body\">\n                    <app-validacoes></app-validacoes>\n                    <ng-container *ngIf=\"!!service.filtro\">\n                        <div class=\"row\">\n                            <div class=\"col-md-6 col-lg-6\">\n                                <div class=\"form-group form-group-sm\">\n                                    <label for=\"emissaoDe\" class=\"required\">{{'labels.emissaoDe' |\n                                        translate}}</label>\n                                    <app-data id=\"emissaoDe\" name=\"emissaoDe\" [(ngModel)]=\"service.filtro.dataI\"\n                                        required autofocus></app-data>\n                                </div>\n                            </div>\n                            <div class=\"col-md-6 col-lg-6\">\n                                <div class=\"form-group form-group-sm\">\n                                    <label for=\"ate\" class=\"required\">{{'labels.ate' | translate}}</label>\n                                    <app-data id=\"ate\" name=\"ate\" [(ngModel)]=\"service.filtro.dataF\" required>\n                                    </app-data>\n                                </div>\n                            </div>\n                        </div>\n                        <div class=\"row\">\n                            <div class=\"col-lg-12\">\n                                <div class=\"form-group form-group-sm\">\n                                    <app-pesquisa-destinatario id=\"cliente\" name=\"cliente\" tipoDestinatario=\"C\"\n                                        modalTitle=\"pesquisaDeCliente\" label=\"cliente\"\n                                        [(ngModel)]=\"service.filtro.destinatarioIdCliente\" showInscricao=\"false\"\n                                        showCgcCpf=\"false\">\n                                    </app-pesquisa-destinatario>\n                                </div>\n                            </div>\n                        </div>\n                        <div class=\"row\">\n                            <div class=\"col-lg-12\">\n                                <div class=\"form-group form-group-sm\">\n                                    <app-pesquisa-material id=\"materialId\" name=\"materialId\" label=\"produto\"\n                                        modalTitle=\"pesquisaDeProduto\" [(ngModel)]=\"service.filtro.materialId\">\n                                    </app-pesquisa-material>\n                                </div>\n                            </div>\n                        </div>\n                        <div class=\"row\">\n                            <div class=\"col-lg-12\">\n                                <div class=\"form-group form-group-sm\">\n                                    <label for=\"situacao\" class=\"required\">{{\"labels.situacao\" | translate\n                                        }}</label>\n                                    <app-combo-multi-situacao-requisicao-descarga id=\"situacao\" name=\"situacao\"\n                                        (executa)=\"trataSituacao($event)\" required>\n                                    </app-combo-multi-situacao-requisicao-descarga>\n                                </div>\n                            </div>\n                        </div>\n                        <div class=\"row\">\n                            <div class=\"col-md-3 col-lg-3\">\n                                <div class=\"form-group form-group-sm\">\n                                    <label for=\"requisicaoDescargaId\">{{ 'labels.registro' | translate}}</label>\n                                    <input id=\"requisicaoDescargaId\" name=\"requisicaoDescargaId\"\n                                        [(ngModel)]=\"service.filtro.requisicaoDescargaId\"\n                                        class=\"form-control form-control-sm\">\n                                </div>\n                            </div>\n                            <div class=\"col-md-3 col-lg-3\">\n                                <div class=\"form-group form-group-sm\">\n                                    <label for=\"cadastroPlacaId\">{{ 'labels.placa' | translate}}</label>\n                                    <input id=\"cadastroPlacaId\" name=\"cadastroPlacaId\"\n                                        [(ngModel)]=\"service.filtro.cadastroPlacaId\"\n                                        class=\"form-control form-control-sm\">\n                                </div>\n                            </div>\n                            <div class=\"col-md-6 col-lg-6\">\n                                <div class=\"form-group form-group-sm\">\n                                    <label for=\"localOperacaoId\">{{ 'labels.localOperacao' | translate}}</label>\n                                    <app-combo-local-operacao id=\"localOperacaoId\" name=\"localOperacaoId\"\n                                        [(ngModel)]=\"service.filtro.localOperacaoId\">\n                                    </app-combo-local-operacao>\n                                </div>\n                            </div>\n                        </div>\n                    </ng-container>\n                </div>\n                <div class=\"modal-footer\">\n                    <div class=\"col-lg-12 text-right\">\n                        <button class=\"btn btn-success  mr-2\">\n                            {{ 'buttons.pesquisar' | translate }}\n                        </button>\n                        <button class=\"btn btn-default\" data-dismiss=\"modal\">\n                            {{ 'buttons.sair' | translate }}\n                        </button>\n                    </div>\n                </div>\n            </form>\n        </div>\n    </div>\n</div>");

/***/ }),

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-form/requisicao-descarga-form.component.html":
/*!**********************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-form/requisicao-descarga-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\"\n  [formAction]=\"actionForm\" [itemData]=\"data.requisicaoDescargaId\">\n</app-menu-command-bar>\n\n<div class=\"row\">\n  <div class=\"col-md-12 col-lg-12\">\n    <div class=\"section-comand-bar\">\n      <div class=\"clearfix\">\n        <ul class=\"nav nav-tabs\">\n          <li class=\"nav-item\">\n            <a class=\"nav-link active show\" data-toggle=\"tab\" href=\"#ta\">{{\n              \"labels.dados\" | translate\n              }}</a>\n          </li>\n          <li class=\"nav-item\">\n            <a class=\"nav-link\" data-toggle=\"tab\" href=\"#tb\">{{\n              \"labels.itens\" | translate\n              }}</a>\n          </li>\n        </ul>\n      </div>\n      <div class=\"tab-content top\">\n        <div class=\"tab-pane active show\" id=\"ta\">\n          <app-form-legenda></app-form-legenda>\n          <app-validacoes></app-validacoes>\n          <form id=\"frmRequisicaoDescarga\" class=\"form\" #frmRequisicaoDescarga=\"ngForm\"\n            (ngSubmit)=\"onSubmit(frmRequisicaoDescarga)\">\n            <div class=\"row\">\n              <div class=\"col-lg-2\">\n                <div class=\"form-group form-group-sm\">\n                  <label for=\"registro\">{{\n                    \"labels.registro\" | translate\n                    }}</label>\n                  <input id=\"registro\" name=\"registro\" value=\"{{\n                      funcoesService.isCreate(actionForm)\n                        ? 0\n                        : data.requisicaoDescargaId\n                    }}\" class=\"form-control form-control-sm\" type=\"text\" disabled />\n                </div>\n              </div>\n            </div>\n            <div class=\"row\">\n              <div class=\"col-lg-2 col-md-6 col-sm-12\">\n                <div class=\"form-group form-group-sm\">\n                  <label for=\"checklist\">{{\n                    \"labels.checklist\" | translate\n                    }}</label>\n                  <div class=\"input-group\">\n                    <input id=\"checklist\" name=\"checklist\" value=\"{{ data.checkListId }}\"\n                      class=\"form-control form-control-sm\" type=\"text\" disabled />\n                  </div>\n                </div>\n              </div>\n              <div class=\"col-lg-1\">\n                <div class=\"form-group form-group-sm\">\n                  <label for=\"checkListItemId\">{{\n                    \"labels.item\" | translate\n                    }}</label>\n                  <input id=\"checkListItemId\" name=\"checkListItemId\" value=\"{{ data.checkListItemId }}\"\n                    class=\"form-control form-control-sm\" type=\"text\" disabled />\n                </div>\n              </div>\n            </div>\n            <div class=\"row\">\n              <div class=\"col-lg-3\">\n                <div class=\"form-group form-group-sm\">\n                  <label for=\"emissao\" class=\"required\">{{\n                    \"labels.emissao\" | translate\n                    }}</label>\n                  <app-data-h-m id=\"emissao\" name=\"emissao\" [(ngModel)]=\"data.dtRequisicao\"\n                    [disabled]=\"!funcoesService.isCreate(actionForm)\" required>\n                  </app-data-h-m>\n                </div>\n              </div>\n              <div class=\"col-lg-4\" *ngIf=\"service.configBal.codBalCheckList\">\n                <div class=\"form-group form-group-sm\">\n                  <label for=\"balanca\">{{\"labels.balanca\" | translate}}</label>\n                  <app-combo-padrao id=\"balanca\" name=\"balanca\" [(ngModel)]=\"data.balancaId\" tabela=\"Balanca\"\n                    chave=\"CodBalanca\" descricao=\"DescrBalanca\" ativos=\"true\"\n                    [disabled]=\"!funcoesService.isCreate(actionForm)\">\n                  </app-combo-padrao>\n                </div>\n              </div>\n              <div class=\"col-lg-4\" *ngIf=\"!service.configBal.codBalCheckList\"></div>\n              <div class=\"col-lg-2\"></div>\n              <div class=\"col-lg-2\">\n                <div class=\"form-group form-group-sm\">\n                  <label for=\"pesoBru\" class=\"required\">{{\n                    \"labels.pesoBru\" | translate\n                    }}</label>\n                  <app-captura-peso id=\"pesoBru\" name=\"pesoBru\" [(ngModel)]=\"data.pesoBru\" [balancaId]=\"data.balancaId\"\n                    (outSelected)=\"getPeso($event)\" (outBlur)=\"getPeso($event)\" [required]=\"true\"\n                    [disabled]=\"!funcoesService.isCreate(actionForm)\"\n                    [disabledBtn]=\"funcoesService.isDetail(actionForm)\"\n                    [pesagemAutomatica]=\"service.configBal.pesagemAutomatica\">\n                  </app-captura-peso>\n                </div>\n              </div>\n            </div>\n            <div class=\"row\">\n              <div class=\"col-lg-2\">\n                <div class=\"form-group form-group-sm\">\n                  <label for=\"cadastroPlacaIdCavalo\">{{\n                    \"labels.placaCavalo\" | translate\n                    }}</label>\n                  <input id=\"cadastroPlacaIdCavalo\" name=\"cadastroPlacaIdCavalo\" value=\"{{\n                      data.cadastroPlacaIdCavalo | mask: mascaras.getPlaca\n                    }}\" class=\"form-control form-control-sm\" type=\"text\" disabled />\n                </div>\n              </div>\n              <div class=\"col-lg-2\">\n                <div class=\"form-group form-group-sm\">\n                  <label for=\"estadoIdCavalo\">{{\n                    \"labels.estado\" | translate\n                    }}</label>\n                  <input id=\"estadoIdCavalo\" name=\"estadoIdCavalo\"\n                    value=\"{{ data.estadoIdCavalo | mask: mascaras.getPlaca }}\" class=\"form-control form-control-sm\"\n                    type=\"text\" disabled />\n                </div>\n              </div>\n              <div class=\"col-lg-2\">\n                <div class=\"form-group form-group-sm\">\n                  <label for=\"cadastroPlacaIdCarreta1\">{{\n                    \"labels.placaCarreta1\" | translate\n                    }}</label>\n                  <input id=\"cadastroPlacaIdCarreta1\" name=\"cadastroPlacaIdCarreta1\" value=\"{{\n                      data.cadastroPlacaIdCarreta1 | mask: mascaras.getPlaca\n                    }}\" class=\"form-control form-control-sm\" type=\"text\" disabled />\n                </div>\n              </div>\n              <div class=\"col-lg-2\">\n                <div class=\"form-group form-group-sm\">\n                  <label for=\"cadastroPlacaIdCarreta2\">{{\n                    \"labels.placaCarreta2\" | translate\n                    }}</label>\n                  <input id=\"cadastroPlacaIdCarreta2\" name=\"cadastroPlacaIdCarreta2\" value=\"{{\n                      data.cadastroPlacaIdCarreta2 | mask: mascaras.getPlaca\n                    }}\" class=\"form-control form-control-sm\" type=\"text\" disabled />\n                </div>\n              </div>\n              <div class=\"col-lg-1\"></div>\n              <div class=\"col-lg-2\">\n                <div class=\"form-group form-group-sm\">\n                  <label for=\"pesoTara\">{{\n                    \"labels.pesoTara\" | translate\n                    }}</label>\n                  <input id=\"pesoTara\" style=\"background-color: #e9ecef\" name=\"pesoTara\" [(ngModel)]=\"data.pesoTara\"\n                    class=\"form-control form-control-sm\" type=\"text\" disabled currencyMask\n                    [options]=\"funcoesService.optionCurrency(0)\" />\n                </div>\n              </div>\n            </div>\n            <div class=\"row\">\n              <div class=\"col-lg-6 col-md-10 col-sm-12\">\n                <div class=\"form-group form-group-sm\">\n                  <app-input-description [label]=\"'produto'\" [valueID]=\"data?.material?.materialId\"\n                    [valueDescription]=\"data?.material?.fantasia\"></app-input-description>\n                </div>\n              </div>\n              <div class=\"col-lg-3\"></div>\n              <div class=\"col-lg-2\">\n                <div class=\"form-group form-group-sm\">\n                  <label for=\"pesoLiq\">{{\n                    \"labels.pesoLiq\" | translate\n                    }}</label>\n                  <input id=\"pesoLiq\" name=\"pesoLiq\" [(ngModel)]=\"data.pesoLiq\" class=\"form-control form-control-sm\"\n                    type=\"text\" disabled currencyMask [options]=\"funcoesService.optionCurrency(0)\" />\n                </div>\n              </div>\n            </div>\n            <div class=\"row\">\n              <div class=\"col-lg-6 mb-4\">\n                <div class=\"card border-0\" widget=\"\">\n                  <div class=\"row\">\n                    <div class=\"col-lg-12\">\n                      <app-input-description [label]=\"'motorista'\" [valueID]=\"data?.motorista?.motoristaId\"\n                        [valueDescription]=\"data?.motorista?.nome\"></app-input-description>\n                    </div>\n                  </div>\n                  <div class=\"row\">\n                    <div class=\"col-lg-6\">\n                      <div class=\"form-group form-group-sm\">\n                        <label for=\"motoristaCnhRD\">{{\n                          \"labels.cnh\" | translate\n                          }}</label>\n                        <input id=\"motoristaCnhRD\" type=\"text\" name=\"motoristaCnhRD\"\n                          class=\"form-control form-control-sm\" value=\"{{ data?.motorista?.cnh }}\" disabled />\n                      </div>\n                    </div>\n                    <div class=\"col-lg-6\">\n                      <div class=\"form-group form-group-sm\">\n                        <label for=\"motoristaCnhValidade\">{{\n                          \"labels.validade\" | translate\n                          }}</label>\n                        <input id=\"motoristaCnhValidade\" type=\"text\" name=\"motoristaCnhValidade\"\n                          class=\"form-control form-control-sm\" value=\"{{\n                            data?.motorista?.cnhValidade | date: 'dd/MM/yyyy'\n                          }}\" disabled />\n                      </div>\n                    </div>\n                  </div>\n                  <div class=\"row\">\n                    <div class=\"col-lg-12\">\n                      <div class=\"form-group form-group-sm\">\n                        <app-input-description [label]=\"'transportadora'\"\n                          [valueID]=\"data?.transportadora?.destinatarioId\"\n                          [valueDescription]=\"data?.transportadora?.fantasia\">\n                        </app-input-description>\n                      </div>\n                    </div>\n                  </div>\n                  <div class=\"row\">\n                    <div class=\"col-lg-6 col-md-12\">\n                      <div class=\"form-group form-group-sm\">\n                        <app-pesquisa-saldo-lote-deposito id=\"deposito\" name=\"deposito\" required=\"true\"\n                          [label]=\"'deposito'\" [modalTitle]=\"'deposito'\"\n                          [disabled]=\"funcoesService.isDetail(actionForm) || desabilitaNAltDepositoLibVeic\"\n                          [field]=\"'tanqueId'\" [options]=\"saldoDepositoOptions\" [(ngModel)]=\"data.tanqueId\"\n                          (outModel)=\"trataDeposito($event)\">\n                        </app-pesquisa-saldo-lote-deposito>\n                      </div>\n                    </div>\n                    <div class=\"col-lg-6\">\n                      <div class=\"form-group form-group-sm\">\n                        <label for=\"tipoOperacao\" class=\"required\">{{\n                          \"labels.tipoOperacao\" | translate\n                          }}</label>\n                        <app-combo-tipo-operacao id=\"tipoOperacao\" name=\"tipoOperacao\" [(ngModel)]=\"data.tipoOperacaoId\"\n                          [disabled]=\"funcoesService.isDetail(actionForm)\" required>\n                        </app-combo-tipo-operacao>\n                      </div>\n                    </div>\n                  </div>\n                  <div class=\"row\">\n                    <div class=\"col-lg-6\">\n                      <div class=\"form-group form-group-sm\">\n                        <label for=\"pesoOrigem\">{{\n                          \"labels.pesoOrigem\" | translate\n                          }}</label>\n                        <input id=\"pesoOrigem\" name=\"pesoOrigem\" [(ngModel)]=\"data.kilos\"\n                          class=\"form-control form-control-sm\" type=\"text\" disabled currencyMask\n                          [options]=\"funcoesService.optionCurrency(0)\" />\n                      </div>\n                    </div>\n                    <div class=\"col-lg-6\">\n                      <div class=\"form-group form-group-sm\">\n                        <label>{{ \"labels.terno\" | translate }}</label>\n                        <app-combo-terno id=\"ternoId\" name=\"ternoId\" [(ngModel)]=\"data.ternoId\"\n                          [disabled]=\"funcoesService.isDetail(actionForm)\" required=\"false\"></app-combo-terno>\n                      </div>\n                    </div>\n                  </div>\n                  <div class=\"row\">\n                    <div class=\"col-lg-12\">\n                      <div class=\"form-group form-group-sm\">\n                        <label for=\"observ\">{{\n                          \"labels.observacao\" | translate\n                          }}</label>\n                        <input id=\"observ\" name=\"observ\" [(ngModel)]=\"data.observ\" class=\"form-control form-control-sm\"\n                          type=\"text\" disabled />\n                      </div>\n                    </div>\n                  </div>\n                </div>\n              </div>\n              <div class=\"col-lg-5 mb-4\">\n                <div class=\"card border-0 box-shadow\" widget=\"\">\n                  <div class=\"card\" style=\"background-color: #ddd\" *ngIf=\"controle20\">\n                    <div class=\"card-header\">\n                      {{ \"labels.movimentacao20graus\" | translate }}\n                    </div>\n                    <div class=\"card-body\">\n                      <div class=\"row\">\n                        <div class=\"col-lg-6\">\n                          <div class=\"form-group form-group-sm\">\n                            <label for=\"volume\" class=\"required\">{{\n                              \"labels.volume\" | translate\n                              }}</label>\n                            <input type=\"text\" id=\"volume\" name=\"volume\" class=\"form-control form-control-sm\"\n                              [(ngModel)]=\"data.volume\" [disabled]=\"funcoesService.isDetail(actionForm)\"\n                              (blur)=\"calcDados20()\" maxlength=\"15\" currencyMask\n                              [options]=\"funcoesService.optionCurrency()\" required />\n                          </div>\n                        </div>\n                        <div class=\"col-lg-6\">\n                          <div class=\"form-group form-group-sm\">\n                            <label for=\"densidadeCorrigida\">{{\n                              \"labels.densidadeCorrigida\" | translate\n                              }}</label>\n                            <input type=\"text\" id=\"densidadeCorrigida\" name=\"densidadeCorrigida\"\n                              class=\"form-control form-control-sm\" value=\"{{ data.densidadeCorrigida }}\" currencyMask\n                              [options]=\"funcoesService.optionCurrency(5)\" disabled />\n                          </div>\n                        </div>\n                      </div>\n                      <div class=\"row\">\n                        <div class=\"col-lg-6\">\n                          <div class=\"form-group form-group-sm\">\n                            <label for=\"densidadeAmostra\" class=\"required\">{{\n                              \"labels.densidadeAmostra\" | translate\n                              }}</label>\n                            <input type=\"text\" id=\"densidadeAmostra\" name=\"densidadeAmostra\"\n                              class=\"form-control form-control-sm\" [(ngModel)]=\"data.densidadeAmostra\" currencyMask\n                              maxlength=\"8\" [options]=\"funcoesService.optionCurrency(5)\"\n                              [disabled]=\"funcoesService.isDetail(actionForm) || desabilitaNPermiteAltDados20\" required\n                              (blur)=\"calcDados20()\" />\n                          </div>\n                        </div>\n                        <div class=\"col-lg-6\">\n                          <div class=\"form-group form-group-sm\">\n                            <label for=\"fatorCorrecao\">{{\n                              \"labels.fatorCorrecao\" | translate\n                              }}</label>\n                            <input type=\"text\" id=\"fatorCorrecao\" name=\"fatorCorrecao\"\n                              class=\"form-control form-control-sm\" [(ngModel)]=\"data.fatorCorrecao\" currencyMask\n                              [options]=\"funcoesService.optionCurrency(5)\" disabled />\n                          </div>\n                        </div>\n                      </div>\n                      <div class=\"row\">\n                        <div class=\"col-lg-6\">\n                          <div class=\"form-group form-group-sm\">\n                            <label for=\"temperaturaAmostra\" class=\"required\">{{\n                              \"labels.temperaturaAmostra\" | translate\n                              }}</label>\n                            <input type=\"text\" id=\"temperaturaAmostra\" name=\"temperaturaAmostra\"\n                              class=\"form-control form-control-sm\" [(ngModel)]=\"data.temperaturaAmostra\"\n                              [disabled]=\"funcoesService.isDetail(actionForm) || desabilitaNPermiteAltDados20\" required\n                              (blur)=\"calcDados20()\" currencyMask [options]=\"funcoesService.optionCurrency(1)\" />\n                          </div>\n                        </div>\n                        <div class=\"col-lg-6\">\n                          <div class=\"form-group form-group-sm\">\n                            <label for=\"volumeCorrigido\">{{\n                              \"labels.volumeCorrigido\" | translate\n                              }}</label>\n                            <input type=\"text\" id=\"volumeCorrigido\" name=\"volumeCorrigido\"\n                              class=\"form-control form-control-sm\" [(ngModel)]=\"data.volumeCorrigido\" currencyMask\n                              [options]=\"funcoesService.optionCurrency()\" disabled />\n                          </div>\n                        </div>\n                      </div>\n                      <div class=\"row\">\n                        <div class=\"col-lg-6\">\n                          <div class=\"form-group form-group-sm\">\n                            <label for=\"temperaturaCarroTanque\" class=\"required\">{{\n                              \"labels.temperaturaCarroTanque\" | translate\n                              }}</label>\n                            <input type=\"text\" id=\"temperaturaCarroTanque\" name=\"temperaturaCarroTanque\"\n                              class=\"form-control form-control-sm\" [(ngModel)]=\"data.temperaturaCarroTanque\"\n                              [disabled]=\"funcoesService.isDetail(actionForm) ||desabilitaNPermiteAltDados20\"\n                              (blur)=\"calcDados20()\" required currencyMask\n                              [options]=\"funcoesService.optionCurrency(1)\" />\n                          </div>\n                        </div>\n                        <div class=\"col-lg-6\">\n                          <div class=\"form-group form-group-sm\">\n                            <label for=\"pesoCorrigido\">{{\n                              \"labels.pesoCorrigido\" | translate\n                              }}</label>\n                            <input type=\"text\" id=\"pesoCorrigido\" name=\"pesoCorrigido\"\n                              class=\"form-control form-control-sm\" [(ngModel)]=\"data.pesoCorrigido\" currencyMask\n                              [options]=\"funcoesService.optionCurrency()\" disabled />\n                          </div>\n                        </div>\n                      </div>\n                      <div class=\"row\">\n                        <div class=\"col-lg-4\">\n                          <span *ngIf=\"data.sisCampoAdds\">\n                            <div *ngFor=\"let d of data.sisCampoAdds\" [class.col-lg-6]=\"!d.colunas\">\n                              <app-campos-adicionais name=\"{{ d.campo }}\" [sisCampoAdd]=\"d\" [(ngModel)]=\"d.valorCampo\"\n                                [disabled]=\"funcoesService.isDetail(actionForm)\" [required]=\"d.obrigatorio === 'S'\">\n                              </app-campos-adicionais>\n                            </div>\n                          </span>\n                        </div>\n                      </div>\n                    </div>\n                  </div>\n                </div>\n              </div>\n            </div>\n            <div class=\"row\">\n              <div class=\"col-4\">\n                <div class=\"form-group\">\n                  <button class=\"btn btn-success mr-2\" type=\"submit\" [disabled]=\"funcoesService.isDetail(actionForm)\">\n                    {{ \"buttons.salvar\" | translate }}\n                  </button>\n                </div>\n              </div>\n            </div>\n          </form>\n        </div>\n        <div class=\"tab-pane\" id=\"tb\">\n          <app-requisicao-descarga-item *ngIf=\"showComponents\" [requisicaoDescarga]=\"data\"\n            [dados]=\"data.requisicaoDescargaItems\" [item]=\"item\" (selectedItem)=\"selectedItem($event)\"\n            (dataResult)=\"refreshItens($event)\" [disabled]=\"funcoesService.isDetail(actionForm)\">\n          </app-requisicao-descarga-item>\n        </div>\n      </div>\n    </div>\n  </div>\n</div>\n\n<app-liberar-acesso-supervisor></app-liberar-acesso-supervisor>\n<app-corrige-placa-ocr (outExecute)=\"confirmaOcr($event)\"></app-corrige-placa-ocr>");

/***/ }),

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-index/requisicao-descarga-index.component.html":
/*!************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-index/requisicao-descarga-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]=\"requisicaoDescarga.requisicaoDescargaId\">\n</app-menu-command-bar>\n\n<div class=\"box-shadow\" style=\"padding: 10px; background-color: #fff;\" *ngIf=\"isDesmembrado\">\n    <div class=\"row mb-1\">\n        <div class=\"col-lg-12 col-md-12\">\n            <div class=\"card\">\n                <div class=\"card-body\">\n                    <div class=\"row\">\n                        <div class=\"col-lg-4 col-md-12\">\n                            <label>{{ 'labelsFlagDesmembrado' | translate}}</label>\n                        </div>\n                    </div>\n                </div>\n            </div>\n        </div>\n    </div>\n</div>\n\n<div class=\"section-comand-bar\">\n    <table id=\"dtRequisicaoDescarga\" class=\"table table-striped table-bordered table-hover nowrap table-sm\"></table>\n</div>\n<div>\n    <button class=\"btn btn-success mr-2\"  [disabled]=\"validaSegundaPesagem()\"  (click)=\"segundaPesagem()\" type=\"button\">{{ ('labels.segundaPesagem') |\n        translate }}\n    </button>\n    <button class=\"btn btn-success mr-2\" (click)=\"liberacaoEmLote()\" type=\"button\" [disabled]=\"false\">{{\n        'buttons.liberacaoEmLote' | translate }}\n    </button>\n    <button class=\"btn btn-success mr-2\" (click)=\"getPhotoOCR()\" type=\"button\">\n        {{ 'buttons.visualizarFotoOCR' | translate }}\n    </button>\n</div>\n\n<app-pesquisa-check-list [inFiltro]=\"filtroCheckList\" (outSelected)=\"createRequisicao($event)\" [tipoOper]=\"'D'\">\n</app-pesquisa-check-list>\n<app-requisicao-descarga-filter (outFilter)=\"executaFiltrar($event)\"></app-requisicao-descarga-filter>\n<app-requisicao-descarga-report (outConfirma)=\"confirmaImpressao($event)\"></app-requisicao-descarga-report>\n<app-foto-ocr></app-foto-ocr>\n<app-descricao-modal titilo=\"cancelSegundaPesagemD\" (outMotivo)=\"executeCancelPesagem($event)\"></app-descricao-modal>\n<app-propriedades></app-propriedades>\n<app-liberar-acesso-supervisor></app-liberar-acesso-supervisor>\n<app-permissoes-rotina [constantes]=\"constantes\"></app-permissoes-rotina>");

/***/ }),

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

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("<div class=\"uni-botoes\">\r\n    <div class=\"\" *ngIf=\"!showAdd\">\r\n        <button title=\"{{ 'buttons.novo' | translate }}\" class=\"btn btn-sm uni-btn\" (click)=\"create()\"\r\n            [disabled]=\"disabled\">\r\n            <i class=\"icon icon-plus\"></i>\r\n        </button>\r\n        <button title=\"{{ 'buttons.visualizar' | translate }}\" (click)=\"detail()\" class=\"btn uni-btn btn-sm\"\r\n            [disabled]=\"funcoesService.showButtons.detail(actionForm,  dataAux.sequencia)\">\r\n            <i class=\"icon-eye\"></i>\r\n        </button>\r\n        <button title=\"{{ 'buttons.editar' | translate }}\" class=\"btn uni-btn btn-sm\" (click)=\"edit()\"\r\n            [disabled]=\"disabled || funcoesService.showButtons.detail(actionForm,  dataAux.sequencia)\">\r\n            <i class=\"icon-pencil\"></i>\r\n        </button>\r\n        <button title=\"{{ 'buttons.excluir' | translate }}\" class=\"btn uni-btn btn-sm\" (click)=\"remove()\"\r\n            [disabled]=\"disabled || funcoesService.showButtons.detail(actionForm,  dataAux.sequencia)\">\r\n            <i class=\"icon-trash\"></i>\r\n        </button>\r\n    </div>\r\n</div>\r\n\r\n<div *ngIf=\"showAdd\">\r\n    <div class=\"\">\r\n        <div class=\"\">\r\n            <button title=\"{{ 'buttons.editar' | translate }}\" class=\"btn uni-btn btn-sm\" (click)=\"edit()\"\r\n                [disabled]=\"disabled || funcoesService.showButtons.edit(actionForm,  dataAux.sequencia)\">\r\n                <i class=\"icon-pencil\"></i>\r\n            </button>\r\n            <button title=\"{{ 'buttons.voltar' | translate }}\" (click)=\"back()\" type=\"button\"\r\n                class=\"btn uni-btn btn-sm\">\r\n                <i class=\"icon-arrow-left\"></i>\r\n            </button>\r\n        </div>\r\n    </div>\r\n\r\n    <div class=\"clearfix\">&nbsp;</div>\r\n    <form class=\"form\" #formRequisicaoDescargaItem=\"ngForm\" (ngSubmit)=\"onSubmit(formRequisicaoDescargaItem)\">\r\n        <div class=\"row\">\r\n            <div class=\"col-lg-12\">\r\n                <app-validacoes></app-validacoes>\r\n                <div class=\"row\">\r\n                    <div class=\"col-10\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <app-pesquisa-destinatario id=\"clienteItem\" name=\"clienteItem\" tipoDestinatario=\"C\"\r\n                                modalTitle=\"pesquisaDeCliente\" label=\"cliente\" [(ngModel)]=\"data.destinatarioIdCliente\"\r\n                                showInscricao=\"true\" showCgcCpf=\"true\" required=\"true\" [inSelected]=\"data.cliente\"\r\n                                (outModel)=\"trataDest('clienteItem', $event)\"\r\n                                [disabled]=\"funcoesService.isDetail(actionForm)\">\r\n                            </app-pesquisa-destinatario>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"row\">\r\n                    <div class=\"col-10\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <app-pesquisa-destinatario id=\"emitenteItem\" name=\"emitenteItem\" tipoDestinatario=\"C\"\r\n                                modalTitle=\"pesquisaDeEmitente\" label=\"emitente\"\r\n                                [(ngModel)]=\"data.destinatarioIdEmitente\" showInscricao=\"true\" showCgcCpf=\"true\"\r\n                                required=\"true\" [inSelected]=\"data.emitente\"\r\n                                (outModel)=\"trataDest('emitenteItem', $event)\"\r\n                                [disabled]=\"funcoesService.isDetail(actionForm)\">\r\n                            </app-pesquisa-destinatario>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"row\">\r\n                    <div class=\"col-lg-2 col-md-8 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                                [modalTitle]=\"'lotes'\" [disabled]=\"funcoesService.isDetail(actionForm)\"\r\n                                [field]=\"'loteId'\" [options]=\"saldoLoteOptions\" [(ngModel)]=\"data.loteId\"\r\n                                (outModel)=\"trataLote($event)\">\r\n                            </app-pesquisa-saldo-lote-deposito>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-2 col-md-12 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label>{{ \"labels.valorUnitario\" | translate }}</label>\r\n                            <input type=\"text\" id=\"valorUnitario\" name=\"valorUnitario\"\r\n                                value=\"{{data?.lote?.precoArmazenado | formatCurrency:9}}\"\r\n                                class=\"form-control form-control-sm\" disabled />\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-2 col-md-12 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"densidade\">{{ \"labels.densidade\" | translate }}</label>\r\n                            <input type=\"text\" id=\"densidade\" name=\"densidade\"\r\n                                value=\"{{data?.lote?.densidade | formatCurrency:5}}\"\r\n                                class=\"form-control form-control-sm\" disabled />\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"row\">\r\n                    <div class=\"col-lg-2 col-md-12 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"quantidade\" [class.required]=\"isDisabledQuantid\">{{ \"labels.quantidade\" |\r\n                                translate }}</label>\r\n                            <input type=\"text\" id=\"quantidade\" name=\"quantidade\" [(ngModel)]=\"data.quantid\"\r\n                                class=\"form-control form-control-sm\"\r\n                                [disabled]=\"!isDisabledQuantid || funcoesService.isDetail(actionForm)\" currencyMask\r\n                                [options]=\"{ prefix: '', thousands: '.', decimal: ',', precision: 0 }\"\r\n                                [required]=\"isDisabledQuantid\" />\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-2\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"plataforma\"\r\n                                [class.required]=\"service.configWeb.obrigaPlataformaRodo\">{{'labels.plataforma'\r\n                                | translate}}</label>\r\n                            <app-combo-plataforma id=\"plataforma\" [required]=\"service.configWeb.obrigaPlataformaRodo\"\r\n                                name=\"plataforma\" [(ngModel)]=\"data.plataformaId\"\r\n                                [disabled]=\"funcoesService.isDetail(actionForm)\">\r\n                            </app-combo-plataforma>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-2\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"baia\">{{'labels.baia' | translate}}</label>\r\n                            <input id=\"baia\" name=\"baia\" [(ngModel)]=\"data.baia\" maxlength=\"10\"\r\n                                class=\"form-control form-control-sm\" type=\"text\"\r\n                                [disabled]=\"funcoesService.isDetail(actionForm)\">\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-2\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"densidadeDestinO\">{{'labels.densidadeDestino' | translate}}</label>\r\n                            <input type=\"text\" id=\"densidadeDestinO\" name=\"densidadeDestinO\"\r\n                                class=\"form-control form-control-sm\" [(ngModel)]=\"data.densidadeOri\"\r\n                                data-title=\"{{'labels.densidadeDestino' | translate}}\" currencyMask\r\n                                [options]=\"{ prefix: '', thousands: '.', decimal: ',', precision: 0 }\"\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-4\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"tipoDocumentoTransp\" class=\"required\">{{'labels.tipoDocumentoTransp' |\r\n                                translate}}</label>\r\n                            <app-combo-tipo-documento-transp id=\"tipoDocumentoTransp\" name=\"tipoDocumentoTransp\"\r\n                                [(ngModel)]=\"data.tipoDocumentoTranspId\"\r\n                                [disabled]=\"funcoesService.isDetail(actionForm)\" required\r\n                                (outSelected)=\"trataTipoDocumentoTransp($event)\">\r\n                            </app-combo-tipo-documento-transp>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-2\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"docTranspNumero\" [class.required]=\"!disabledDocumentoTransp\">{{'labels.numero' |\r\n                                translate}}</label>\r\n                            <input type=\"text\" id=\"docTranspNumero\" name=\"numero\" class=\"form-control form-control-sm\"\r\n                                [(ngModel)]=\"data.docTranspNumero\" [disabled]=\"disabledDocumentoTransp\"\r\n                                [required]=\"!disabledDocumentoTransp\">\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-2\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"docTranspEmissao\" [class.required]=\"!disabledDocumentoTransp\">{{'labels.emissao'\r\n                                |\r\n                                translate}}</label>\r\n                            <app-data id=\"docTranspEmissao\" name=\"emissao\" [(ngModel)]=\"data.docTranspEmissao\"\r\n                                [disabled]=\"disabledDocumentoTransp\" [required]=\"!disabledDocumentoTransp\">\r\n                            </app-data>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"row\">\r\n                    <div class=\"col-lg-6\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"modeloNf\" class=\"required\">{{'labels.modeloNf' | translate}}</label>\r\n                            <app-combo-modelo-nota id=\"modeloNf\" name=\"modeloNf\" [(ngModel)]=\"data.modeloNotaId\"\r\n                                [disabled]=\"funcoesService.isDetail(actionForm)\" required\r\n                                (outSelected)=\"trataModeloNota($event)\"></app-combo-modelo-nota>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-2\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"tipoFrete\" class=\"required\">{{'labels.tipoFrete' | translate}}</label>\r\n                            <app-combo-tipo-frete id=\"tipoFrete\" name=\"tipoFrete\" [(ngModel)]=\"data.tipoFrete\"\r\n                                [disabled]=\"funcoesService.isDetail(actionForm)\" required>\r\n                            </app-combo-tipo-frete>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"row\">\r\n                    <div class=\"col-lg-6\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <app-chave-nfe id=\"chaveNfe\" name=\"chaveNfe\" [disabled]=\"disabledChaveNfe\"\r\n                                [required]=\"requiredDadosNfe\" [docto]=\"data?.docto\" [serie]=\"data?.serieNotaId\"\r\n                                [emitente]=\"data.emitente\" [(ngModel)]=\"data.chaveNfe\"\r\n                                (validaChaveNfe)=\"validaChaveNfe($event)\"\r\n                                (importaDanfe)=\"importaDanfe($event)\"></app-chave-nfe>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-2\" *ngIf=\"service.configBal.infPesoFob\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"naturezaId\">{{'labels.cfop' | translate}}</label>\r\n                            <app-pesquisa-natureza id=\"naturezaId\" name=\"naturezaId\" [(ngModel)]=\"data.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=\"row\">\r\n                    <div class=\"col-lg-2\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"docto\" [class.required]=\"true\">{{'labels.docto' |\r\n                                translate}}</label>\r\n                            <input type=\"text\" id=\"docto\" name=\"docto\" class=\"form-control form-control-sm\"\r\n                                [(ngModel)]=\"data.docto\" maxlength=\"9\" mask=\"999999999\" [disabled]=\"disabledDoctoESerie\"\r\n                                [required]=\"true\" data-title=\"{{'labels.docto' | translate}}\">\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-2\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label [class.required]=\"true\">{{'labels.serie' | translate}}</label>\r\n                            <app-combo-serie-nota id=\"serie\" name=\"serie\" [(ngModel)]=\"data.serieNotaId\"\r\n                                [disabled]=\"funcoesService.isDetail(actionForm) || disabledDoctoESerie\"\r\n                                [required]=\"true\">\r\n                            </app-combo-serie-nota>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-2\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"emissao\" [class.required]=\"true\">{{'labels.emissao' |\r\n                                translate}}</label>\r\n                            <app-data id=\"emissao\" name=\"emissao\" [(ngModel)]=\"data.dtDocto\"\r\n                                [disabled]=\"funcoesService.isDetail(actionForm) || disabledDoctoESerie\"\r\n                                data-title=\"{{'labels.emissao' | translate}}\" [required]=\"true\">\r\n                            </app-data>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-2\" *ngIf=\"service.configBal.infPesoFob\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"metrolife\">{{'labels.metrolife' | translate}}</label>\r\n                            <input type=\"text\" id=\"metrolife\" name=\"metrolife\" class=\"form-control form-control-sm\"\r\n                                [(ngModel)]=\"data.metrolife\" [disabled]=\"funcoesService.isDetail(actionForm)\">\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=\"quantidDoc\" class=\"required\">{{'labels.quantidDoc' | translate}} {{\r\n                                lbUnidade }}</label>\r\n                            <input type=\"text\" id=\"quantidDoc\" name=\"quantidDoc\" class=\"form-control form-control-sm\"\r\n                                [(ngModel)]=\"data.quantidDoc\" [disabled]=\"disabledQuantidDocEPesoDocEVlNota\" required\r\n                                data-title=\"{{'labels.quantidDoc' | translate}}\" (ngModelChange)=\"calcQuantidDoc()\"\r\n                                currencyMask [options]=\"{ prefix: '', thousands: '.', decimal: ',', precision: 0 }\">\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-2\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"pesoDoc\" class=\"required\">{{'labels.pesoDoc' | translate}}</label>\r\n                            <input type=\"text\" id=\"pesoDoc\" name=\"pesoDoc\" class=\"form-control form-control-sm\"\r\n                                [(ngModel)]=\"data.pesoDoc\" [disabled]=\"disabledQuantidDocEPesoDocEVlNota\" required\r\n                                data-title=\"{{'labels.pesoDoc' | translate}}\" (ngModelChange)=\"calcPesoDoc()\"\r\n                                currencyMask [options]=\"{ prefix: '', thousands: '.', decimal: ',', precision: 0 }\">\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-2\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"vlNota\" class=\"required\">{{'labels.total' | translate}}</label>\r\n                            <input type=\"text\" id=\"vlNota\" name=\"vlNota\" class=\"form-control form-control-sm\"\r\n                                [(ngModel)]=\"data.vlNota\" [disabled]=\"disabledQuantidDocEPesoDocEVlNota\" required\r\n                                data-title=\"{{'labels.total' | translate}}\" currencyMask\r\n                                [options]=\"{ prefix: '', thousands: '.', decimal: ',', precision: 2 }\">\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-2\" *ngIf=\"service.configBal.infPesoFob\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"contrato\">{{'labels.contrato' | translate}}</label>\r\n                            <input type=\"text\" id=\"contrato\" name=\"contrato\" class=\"form-control form-control-sm\"\r\n                                [(ngModel)]=\"data.contrato\" [disabled]=\"funcoesService.isDetail(actionForm)\">\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"row\">\r\n                    <div class=\"col-lg-10\">\r\n                        <div class=\"card border-0\" widget=\"\">\r\n                            <div class=\"row\">\r\n                                <div class=\"col-lg-8\">\r\n                                    <div class=\"form-group form-group-sm\">\r\n                                        <label for=\"lacreAmostra\">{{'labels.lacreAmostra' | translate}}</label>\r\n                                        <input type=\"text\" id=\"lacreAmostra\" name=\"lacreAmostra\"\r\n                                            class=\"form-control form-control-sm\" [(ngModel)]=\"data.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-8\">\r\n                                    <div class=\"form-group form-group-sm\">\r\n                                        <label for=\"observ\">{{'labels.observacao' | translate}}</label>\r\n                                        <input type=\"text\" id=\"observ\" name=\"observ\"\r\n                                            class=\"form-control form-control-sm\" [(ngModel)]=\"data.observ\"\r\n                                            [disabled]=\"funcoesService.isDetail(actionForm)\">\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"form-group\">\r\n                    <button class=\"btn btn-success\" type=\"submit\" [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=\"row\" *ngIf=\"!showAdd\">\r\n    <div class=\"clearfix\">&nbsp;</div>\r\n    <div class=\"col-lg-12\">\r\n        <div class=\"table-overflow\">\r\n            <table class=\"table table-striped table-hover form-control-sm\">\r\n                <thead>\r\n                    <tr>\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                        <th class=\"text-center\">{{ 'labels.quantidade' | translate }}</th>\r\n                    </tr>\r\n                </thead>\r\n                <tbody>\r\n                    <tr *ngFor=\"let c of dados | removeExcluidos\" class=\"clickable\"\r\n                        [ngClass]=\"{ 'info' : c === dataAux }\" (click)=\"(dataAux = c)\">\r\n                        <td class=\"text-center\">{{c.opDescargaId}}</td>\r\n                        <td class=\"text-center\">{{c.cliente?.fantasia}}</td>\r\n                        <td class=\"text-center\">{{c.emitente?.fantasia}}</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                        <td class=\"text-center\">{{c.quantid | formatCurrency: 0}}</td>\r\n                    </tr>\r\n                    <tr *ngIf=\"!dados || dados.length === 0\">\r\n                        <th colspan=\"9\">\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>");

/***/ }),

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-pesagem-anterior/requisicao-descarga-pesagem-anterior.component.html":
/*!**********************************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-pesagem-anterior/requisicao-descarga-pesagem-anterior.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=\"requisicao-descarga-pesagem-anterior-dialog\" tabindex=\"-1\" role=\"dialog\" data-backdrop=\"static\">\r\n    <div class=\"uni-modal-dialog-md-45\">\r\n        <div class=\"modal-content\">\r\n            <div class=\"modal-header\">\r\n                <h6 class=\"modal-title\">{{ 'titles.pesagensTaraAnteriores' | 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-12 col-lg-12\">\r\n                            <table class=\"table table-striped table-bordered table-hover rownowrap table-sm\">\r\n                                <thead>\r\n                                    <tr>                                        \r\n                                        <th class=\"text-center\">{{ \"labels.data\" | translate }}</th>\r\n                                        <th class=\"text-center\">{{ \"labels.produto\" | translate }}</th>\r\n                                        <th class=\"text-center\">{{ \"labels.pBruto\" | translate }}</th>\r\n                                        <th class=\"text-center\">{{ \"labels.pTara\" | translate }}</th>\r\n                                        <th class=\"text-center\">{{ \"labels.pLiquido\" | translate }}</th>\r\n                                    </tr>\r\n                                </thead>\r\n                                <tbody>\r\n                                    <tr *ngFor=\"let c of balPesoTaraDto\" class=\"clickable\">                                        \r\n                                        <td class=\"text-center\">{{ c.dtOper2Pes | date:'dd/MM/yyyy HH:mm' }}</td>\r\n                                        <td class=\"text-center\">{{ c.material }}</td>\r\n                                        <td class=\"text-center\">{{ c.pesoBru | formatCurrency: 0 }}</td>\r\n                                        <td class=\"text-center\">{{ c.pesoTara | formatCurrency: 0 }}</td>\r\n                                        <td class=\"text-center\">{{ c.pesoLiq | formatCurrency: 0 }}</td>\r\n                                    </tr>\r\n                                    <tr *ngIf=\"balPesoTaraDto.length === 0\">\r\n                                        <th colspan=\"5\">\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                <div class=\"modal-footer\">\r\n                    <button class=\"btn btn-success mr-1\" type=\"submit\">{{ 'buttons.ok' | 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/requisicao-descarga/requisicao-descarga-report/requisicao-descarga-report.component.html":
/*!**************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-report/requisicao-descarga-report.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    <div class=\"modal-dialog modal-sm\">\r\n        <div class=\"modal-content\">\r\n            <form class=\"form\" #frmPrint=\"ngForm\" (ngSubmit)=\"onSubmit(frmPrint)\">\r\n                <div class=\"modal-header\">\r\n                    <h4 class=\"modal-title\">{{ 'titles.imprimir' | translate }}</h4>\r\n                    <button type=\"button\" class=\"close\" aria-label=\"Close\" data-dismiss=\"modal\">\r\n                        <span aria-hidden=\"true\">&times;</span>\r\n                    </button>\r\n                </div>\r\n                <div class=\"modal-body\">\r\n                    <div class=\"row\">\r\n                        <div class=\"col-md-12\">\r\n                            <div class=\"form-group form-group-sm\">\r\n                                <label for=\"tipoImpressao\">{{'labels.tipoImpressao' | translate}}</label>\r\n                                <select id=\"tipoImpressao\" name=\"tipoImpressao\" class=\"form-control form-control-sm\"\r\n                                    [(ngModel)]=\"tipoSelecionado\">\r\n                                    <option value=\"\">{{ 'labels.selecione' | translate}}</option>\r\n                                    <option *ngFor=\"let tipo of tiposImpressao\" [value]=\"tipo.value\">{{ tipo.label |\r\n                                        translate}}</option>\r\n                                </select>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"modal-footer\">\r\n                    <button type=\"submit\" class=\"btn btn-small btn-success\" [disabled]=\"tipoSelecionado == ''\">{{\r\n                        'buttons.ok' | translate }}</button>\r\n                    <button type=\"button\" class=\"btn btn-small btn-default\" data-dismiss=\"modal\">{{ 'buttons.cancelar' |\r\n                        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/requisicao-descarga/requisicao-descarga-segunda-pesagem/requisicao-descarga-segunda-pesagem.component.html":
/*!********************************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-segunda-pesagem/requisicao-descarga-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.lista2Pes\" [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-3\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <label for=\"oper\">{{'labels.operador' | translate}}</label>\r\n                                    <input id=\"oper\" name=\"oper\" [(ngModel)]=\"data.oper2Pes\"\r\n                                        class=\"form-control form-control-sm\" type=\"text\"\r\n                                        data-title=\"{{'labels.operador' | translate}}\" autofocus>\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=\"dtIniOper\" class=\"required\">{{'labels.dtIniOper' | translate}}</label>\r\n                                    <app-data-h-m-s id=\"dtIniOper\" name=\"dtIniOper\" required=\"true\" [disabled]=\"false\"\r\n                                        [(ngModel)]=\"data.dtIniOper\">\r\n                                    </app-data-h-m-s>\r\n                                </div>\r\n                            </div>\r\n                            <div class=\"col-lg-3\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <label for=\"dtFimOper\" class=\"required\">{{'labels.dtFimOper' | translate}}</label>\r\n                                    <app-data-h-m-s id=\"dtFimOper\" name=\"dtFimOper\" required=\"true\" [disabled]=\"false\"\r\n                                        [(ngModel)]=\"data.dtFimOper\"\r\n                                        (executa)=\"validation.validaDtFimOper({dtFimOper: $event, dtIniOper: 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-lg-3\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <label>{{'labels.terno' | translate}}</label>\r\n                                    <app-combo-terno id=\"ternoId\" name=\"ternoId\" [(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-3\">\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]=\"service.configCtv.solicitaPlanejEv && !data.tanqueId\"\r\n                                        [field]=\"'tanqueId'\" [options]=\"saldoDepositoOptions\"\r\n                                        [(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-2\">\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\" [(ngModel)]=\"data.pesoBru\"\r\n                                        class=\"form-control form-control-sm\" type=\"text\" disabled currencyMask\r\n                                        [options]=\"funcoes.optionCurrency(0)\">\r\n                                </div>\r\n                            </div>\r\n                            <ng-container *ngIf=\"disabledPesoLiq\">\r\n                                <div class=\"col-lg-2\">\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\" [(ngModel)]=\"data.pesoLiq\"\r\n                                            class=\"form-control form-control-sm\" type=\"text\" disabled currencyMask\r\n                                            [options]=\"funcoes.optionCurrency(0)\">\r\n                                    </div>\r\n                                </div>\r\n                            </ng-container>\r\n                            <ng-container *ngIf=\"!disabledPesoLiq\">\r\n                                <div class=\"col-lg-2\">\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\" [(ngModel)]=\"data.pesoTara\"\r\n                                            class=\"form-control form-control-sm\" type=\"text\" disabled currencyMask\r\n                                            [options]=\"funcoes.optionCurrency(0)\">\r\n                                    </div>\r\n                                </div>\r\n                            </ng-container>\r\n                            <div class=\"col-lg-2\">\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\" [(ngModel)]=\"data.diferenca\"\r\n                                            class=\"form-control form-control-sm\" type=\"text\" readonly currencyMask\r\n                                            [options]=\"funcoes.optionCurrency(0)\">\r\n                                        <label for=\"statusQuebraOuSobra\" class=\"ml-2 text-danger\">{{ statusQuebraOuSobra\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\" *ngIf=\"service.configBal.codBalCheckList\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <label for=\"balanca\" class=\"required\">{{'labels.balanca' | translate}}</label>\r\n                                    <app-combo-padrao id=\"balanca\" name=\"balanca\" [(ngModel)]=\"data.balancaId\" required\r\n                                        tabela=\"Balanca\" chave=\"CodBalanca\" descricao=\"DescrBalanca\">\r\n                                    </app-combo-padrao>\r\n                                </div>\r\n                            </div>\r\n                            <ng-container *ngIf=\"disabledPesoLiq\">\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.balancaId\" (outSelected)=\"getPeso($event)\"\r\n                                            (outBlur)=\"validaPeso($event)\" required\r\n                                            [pesagemAutomatica]=\"service.configBal.pesagemAutomatica\">\r\n                                        </app-captura-peso>\r\n                                    </div>\r\n                                </div>\r\n                            </ng-container>\r\n                            <ng-container *ngIf=\"!disabledPesoLiq\">\r\n                                <div class=\"col-lg-2\">\r\n                                    <div class=\"form-group form-group-sm\">\r\n                                        <label for=\"pesoLiq\" class=\"required\">{{'labels.pesoLiq' | translate}}</label>\r\n                                        <app-captura-peso id=\"pesoLiq\" name=\"pesoLiq\" [(ngModel)]=\"data.pesoLiq\"\r\n                                            [balancaId]=\"data.balancaId\" (outSelected)=\"getPeso($event)\"\r\n                                            (outBlur)=\"validaPeso($event)\" required\r\n                                            [pesagemAutomatica]=\"service.configBal.pesagemAutomatica\">\r\n                                        </app-captura-peso>\r\n                                    </div>\r\n                                </div>\r\n                            </ng-container>\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=\"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.motivoQuebraId\" tabela=\"MotivoQuebra\"\r\n                                            chave=\"CodMotivoQuebra\" descricao=\"DescrMotivoQuebra\" ativos=\"true\"\r\n                                            [disabled]=\"disabledQuebra\" [required]=\"!disabledQuebra\">\r\n                                        </app-combo-padrao>\r\n                                        <span class=\"text-nowrap ml-2\">{{ statusQuebraOuSobraPt }}</span>\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=\"justificativaDeatraso\"\r\n                                        [class.required]=\"!disabledAtraso\">{{'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.motivoAtrasoId\" tabela=\"MotivoAtraso\"\r\n                                            chave=\"CodMotivoAtraso\" descricao=\"DescrMotivoAtraso\" ativos=\"true\"\r\n                                            [disabled]=\"disabledAtraso\" [required]=\"!disabledAtraso\">\r\n                                        </app-combo-padrao>\r\n                                        <span class=\"text-nowrap ml-2\">{{ atraso }}</span>\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-10 col-sm-12\" *ngIf=\"service.configBal.permAfePesoTara\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <button class=\"btn btn-success mr-2\" type=\"button\">{{\r\n                                        'buttons.pesAnt' | translate }}\r\n                                    </button>\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                                        [disabled]=\"funcoes.isDetail(actionForm)\">\r\n                                        {{ 'buttons.salvar' | translate }}\r\n                                    </button>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                    </form>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n\r\n    <app-requisicao-descarga-pesagem-anterior></app-requisicao-descarga-pesagem-anterior>\r\n    <app-corrige-placa-ocr (outExecute)=\"confirmaOcr($event)\"></app-corrige-placa-ocr>");

/***/ }),

/***/ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-alterar-dados/requisicao-descarga-alterar-dados.component.ts":
/*!************************************************************************************************************************************!*\
  !*** ./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-alterar-dados/requisicao-descarga-alterar-dados.component.ts ***!
  \************************************************************************************************************************************/
/*! exports provided: RequisicaoDescargaAlterarDadosComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RequisicaoDescargaAlterarDadosComponent", function() { return RequisicaoDescargaAlterarDadosComponent; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../shared/services/funcoes/configuracao/configuracao.facade */ "./src/app/shared/services/funcoes/configuracao/configuracao.facade.ts");
/* 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_lote_lote_model__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! app/pages/cadastro/lote/lote.model */ "./src/app/pages/cadastro/lote/lote.model.ts");
/* harmony import */ var app_pages_cadastro_material_material_model__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! app/pages/cadastro/material/material.model */ "./src/app/pages/cadastro/material/material.model.ts");
/* harmony import */ var app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! app/shared/services/funcoes/boolean-utils/boolean-utils.static.service */ "./src/app/shared/services/funcoes/boolean-utils/boolean-utils.static.service.ts");
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/* harmony import */ var _requisicao_descarga_permissoes__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../requisicao-descarga.permissoes */ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga.permissoes.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_lote_lote_service__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./../../../../pages/cadastro/lote/lote.service */ "./src/app/pages/cadastro/lote/lote.service.ts");
/* harmony import */ var _pages_cadastro_material_material_service__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./../../../../pages/cadastro/material/material.service */ "./src/app/pages/cadastro/material/material.service.ts");
/* harmony import */ var _pages_login_login_service__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./../../../../pages/login/login.service */ "./src/app/pages/login/login.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_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_16__ = __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_17__ = __webpack_require__(/*! ./../../../../shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var _cadastro_destinatario_destinatario_model__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./../../../cadastro/destinatario/destinatario.model */ "./src/app/pages/cadastro/destinatario/destinatario.model.ts");
/* harmony import */ var _requisicao_descarga_constants__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./../requisicao-descarga.constants */ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga.constants.ts");
/* harmony import */ var _requisicao_descarga_service__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./../requisicao-descarga.service */ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga.service.ts");
/* harmony import */ var _requisicao_descarga_alterar_dados_model__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./requisicao-descarga-alterar-dados.model */ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-alterar-dados/requisicao-descarga-alterar-dados.model.ts");
/* harmony import */ var app_pages_cadastro_motorista_motorista_model__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! app/pages/cadastro/motorista/motorista.model */ "./src/app/pages/cadastro/motorista/motorista.model.ts");
/* harmony import */ var app_pages_cadastro_motorista_motorista_service__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! app/pages/cadastro/motorista/motorista.service */ "./src/app/pages/cadastro/motorista/motorista.service.ts");
/* harmony import */ var app_pages_veiculo_entrada_veiculo_entrada_veiculo_service__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! app/pages/veiculo/entrada-veiculo/entrada-veiculo.service */ "./src/app/pages/veiculo/entrada-veiculo/entrada-veiculo.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 RequisicaoDescargaAlterarDadosComponent = /** @class */ (function (_super) {
    __extends(RequisicaoDescargaAlterarDadosComponent, _super);
    function RequisicaoDescargaAlterarDadosComponent(router, activatedRoute, configuracao, funcoes, message, service, destinatarioService, materialService, loteService, permissoesUtils, loginService, motoristaService, entradaVeiculoService) {
        var _this = _super.call(this, new _requisicao_descarga_constants__WEBPACK_IMPORTED_MODULE_19__["RequisicaoDescargaConstants"](), funcoes) || this;
        _this.router = router;
        _this.activatedRoute = activatedRoute;
        _this.configuracao = configuracao;
        _this.funcoes = funcoes;
        _this.message = message;
        _this.service = service;
        _this.destinatarioService = destinatarioService;
        _this.materialService = materialService;
        _this.loteService = loteService;
        _this.permissoesUtils = permissoesUtils;
        _this.loginService = loginService;
        _this.motoristaService = motoristaService;
        _this.entradaVeiculoService = entradaVeiculoService;
        _this.data = new _requisicao_descarga_alterar_dados_model__WEBPACK_IMPORTED_MODULE_21__["RequisicaoDescargaAlterarDados"]();
        _this.constantes = new _requisicao_descarga_constants__WEBPACK_IMPORTED_MODULE_19__["RequisicaoDescargaConstants"]();
        _this.validacoes = [];
        _this.now = new Date();
        _this.target = _this.funcoes.getTargetLocation();
        _this.errosDocMotorista = [
            { tipoDoc: 'RESTRICAO', isValid: true, message: "", data: undefined, question: true, modal: false },
            { tipoDoc: 'INATIVO', isValid: true, message: "", data: undefined, question: true, modal: false },
        ];
        _this.loadConfig = function () {
            _this.service.configCtv.solicitaPlanejEv = _this.configuracao.boolean("CTV", "SolicitaPlanejEv");
            _this.service.configBal.sPerDesComis = _this.configuracao.boolean("BAL", "SPerDesComis");
            _this.service.configWeb.obrigaPlataformaRodo = _this.configuracao.string("WEB", "ObrigaPlataformaRodo");
        };
        return _this;
    }
    RequisicaoDescargaAlterarDadosComponent.prototype.ngOnInit = function () {
        var _this = this;
        this.configuracao.getConfig(this.constantes.listaParam, this.loadConfig);
        this.permissoesUtils.validRotina(this.constantes.sisFormularioId, 10, function () { return __awaiter(_this, void 0, void 0, function () {
            var id, _a, mensagens;
            var _this = this;
            return __generator(this, function (_b) {
                switch (_b.label) {
                    case 0:
                        id = this.activatedRoute.snapshot.paramMap.get("id");
                        if (!id) {
                            this.message.warning("titles.requisicaoDescarga", "messages.nenhumRegistroEncontrado");
                            return [2 /*return*/];
                        }
                        _a = this;
                        return [4 /*yield*/, this.service.consultaAlteraDados(+id).toPromise()];
                    case 1:
                        _a.data = _b.sent();
                        if (!this.data) {
                            this.message.warning("titles.requisicaoDescarga", "messages.nenhumRegistroEncontrado");
                            return [2 /*return*/];
                        }
                        if (!this.data.validationResult.isValid) {
                            mensagens = this.message.validationResult(this.data.validationResult);
                            mensagens.forEach(function (e) { return _this.message.warning("titles.requisicaoDescarga", e); });
                            this.back();
                        }
                        if (app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_5__["BooleanUtilsStaticService"].toBoolean(this.data.flagIntegracao)) {
                            this.message.warning("titles.requisicaoDescarga", "messages.ticketJaIntegradoAlteracaoNaoPermitida");
                            this.back();
                        }
                        this.data.percDesComis = _shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_16__["StringUtilsStaticService"].isEmpty(this.data.percDesComis) ? "" : this.data.percDesComis;
                        this.data.tipoOperacaoId = this.data.tipoOperacaoId === 0 ? "" : this.data.tipoOperacaoId;
                        Object(rxjs__WEBPACK_IMPORTED_MODULE_6__["forkJoin"])([
                            this.destinatarioService.getById(this.data.destinatarioIdCliente),
                            this.destinatarioService.getById(this.data.destinatarioIdEmitente),
                            this.destinatarioService.getById(this.data.destinatarioIdTransportadora),
                            this.materialService.getById(this.data.materialId),
                            this.motoristaService.getById(this.data.motoristaId)
                        ]).subscribe(function (result) {
                            _this.data.cliente = !!result[0] ? result[0] : new _cadastro_destinatario_destinatario_model__WEBPACK_IMPORTED_MODULE_18__["Destinatario"]();
                            _this.data.emitente = !!result[1] ? result[1] : new _cadastro_destinatario_destinatario_model__WEBPACK_IMPORTED_MODULE_18__["Destinatario"]();
                            _this.data.transportadora = !!result[2] ? result[2] : new _cadastro_destinatario_destinatario_model__WEBPACK_IMPORTED_MODULE_18__["Destinatario"]();
                            _this.data.material = !!result[3] ? result[3] : new app_pages_cadastro_material_material_model__WEBPACK_IMPORTED_MODULE_4__["Material"]();
                            _this.data.motorista = !!result[4] ? result[4] : new app_pages_cadastro_motorista_motorista_model__WEBPACK_IMPORTED_MODULE_22__["Motorista"]();
                        });
                        return [2 /*return*/];
                }
            });
        }); }, function () { });
    };
    RequisicaoDescargaAlterarDadosComponent.prototype.back = function () {
        this.router.navigate([this.target + "/balanca/requisicaoDescarga"]);
    };
    RequisicaoDescargaAlterarDadosComponent.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;
        }
        this.service.alterarDados({
            requisicaoDescargaId: this.data.requisicaoDescargaId,
            tanqueId: this.data.tanqueId,
            tipoOperacaoId: this.data.tipoOperacaoId,
            plataformaId: this.data.plataformaId,
            tipoTransp: this.data.tipoTransp,
            cadastroPlacaIdCavalo: this.data.cadastroPlacaIdCavalo,
            cadastroPlacaIdCarreta1: this.data.cadastroPlacaIdCarreta1,
            cadastroPlacaIdCarreta2: this.data.cadastroPlacaIdCarreta2,
            motoristaId: this.data.motoristaId,
            destinatarioIdTransportadora: this.data.destinatarioIdTransportadora,
            destinatarioIdCliente: this.data.destinatarioIdCliente,
            materialId: this.data.materialId,
            loteId: this.data.loteId,
            tipoFreteId: this.data.tipoFreteId,
            tipoDocumentoTranspId: this.data.tipoDocumentoTranspId,
            docTranspNumero: this.data.docTranspNumero,
            docTranspEmissao: this.data.docTranspEmissao,
            percDesComis: this.data.percDesComis,
            codLocalOper: this.data.codLocalOper
        }).subscribe(function (validationResult) {
            if (!validationResult.isValid) {
                var mensagens = _this.message.validationResult(validationResult);
                _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_12__["EventEmitterService"].get("backError").emit(mensagens);
                _this.funcoes.backToTop();
                return;
            }
            else {
                _this.message.saveSuccess("titles.requisicaoDescarga");
                _this.back();
            }
        });
    };
    RequisicaoDescargaAlterarDadosComponent.prototype.trataMotorista = function (motorista) {
        return __awaiter(this, void 0, void 0, function () {
            var _a;
            return __generator(this, function (_b) {
                switch (_b.label) {
                    case 0:
                        if (!motorista)
                            return [2 /*return*/];
                        _a = this.data;
                        return [4 /*yield*/, this.motoristaService.getMotoristaId(motorista.motoristaId).toPromise()];
                    case 1:
                        _a.motorista = _b.sent();
                        return [2 /*return*/];
                }
            });
        });
    };
    RequisicaoDescargaAlterarDadosComponent.prototype.trataDest = function (destinatario) {
        this.data.cliente = destinatario;
    };
    RequisicaoDescargaAlterarDadosComponent.prototype.trataTipoDocumentoTransp = function (data) {
        this.data.tipoDocumentoTransp = data;
        this.data.flagSolDadosEnt = data.flagSolDadosEnt;
        this.data.maskDocTransNumero = data.mascara;
        if (this.data.tipoDocumentoTranspId > 0) {
            this.data.docTranspNumero = "";
        }
    };
    RequisicaoDescargaAlterarDadosComponent.prototype.trataLote = function (event) {
        this.data.lote = event ? event.lote : new app_pages_cadastro_lote_lote_model__WEBPACK_IMPORTED_MODULE_3__["Lote"]();
        this.data.destinatarioIdEmitente = this.data.lote.destinatarioIdEmitente;
        this.data.precoArmazenado = _shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_14__["NumberUtilsStaticService"].toNumber(this.data.lote.precoArmazenado);
        this.data.tipoDocumentoTranspIdEntrada = this.data.lote.tipoDocumentoTranspIdEntrada;
    };
    Object.defineProperty(RequisicaoDescargaAlterarDadosComponent.prototype, "disabledTipoDocumentoTransp", {
        get: function () {
            return !!this.data.loteId || _shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_14__["NumberUtilsStaticService"].toNumber(this.data.tipoDocumentoTranspIdEntrada) > 0;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(RequisicaoDescargaAlterarDadosComponent.prototype, "requiredDadosEntrada", {
        get: function () {
            return _shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_14__["NumberUtilsStaticService"].toNumber(this.data.tipoDocumentoTranspIdEntrada) > 0 && app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_5__["BooleanUtilsStaticService"].toBoolean(this.data.flagSolDadosEnt);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(RequisicaoDescargaAlterarDadosComponent.prototype, "requiredPlaca", {
        get: function () {
            return app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_5__["BooleanUtilsStaticService"].toBoolean(this.data.obrigaPlaca);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(RequisicaoDescargaAlterarDadosComponent.prototype, "requiredTransp", {
        get: function () {
            return app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_5__["BooleanUtilsStaticService"].toBoolean(this.data.obrigaTransp);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(RequisicaoDescargaAlterarDadosComponent.prototype, "saldoDepositoOptions", {
        get: function () {
            return {
                destinatarioIdCliente: this.data.destinatarioIdCliente,
                materialId: this.data.materialId,
                tanqueId: this.data.tanqueId,
                sitLote: 'A',
                modo: 7,
                tipoSaldo: 7,
                dataMovimento: this.now,
                tipoAgrupa: 'D',
                geraArquivo: 'S'
            };
        },
        enumerable: true,
        configurable: true
    });
    RequisicaoDescargaAlterarDadosComponent.ctorParameters = function () { return [
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_2__["Router"] },
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_2__["ActivatedRoute"] },
        { type: _shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_1__["ConfiguracaoFacade"] },
        { type: _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_13__["FuncoesService"] },
        { type: _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_17__["MessageService"] },
        { type: _requisicao_descarga_service__WEBPACK_IMPORTED_MODULE_20__["RequisicaoDescargaService"] },
        { type: _pages_cadastro_destinatario_destinatario_service__WEBPACK_IMPORTED_MODULE_8__["DestinatarioService"] },
        { type: _pages_cadastro_material_material_service__WEBPACK_IMPORTED_MODULE_10__["MaterialService"] },
        { type: _pages_cadastro_lote_lote_service__WEBPACK_IMPORTED_MODULE_9__["LoteService"] },
        { type: _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_15__["PermissoesUtilsService"] },
        { type: _pages_login_login_service__WEBPACK_IMPORTED_MODULE_11__["LoginService"] },
        { type: app_pages_cadastro_motorista_motorista_service__WEBPACK_IMPORTED_MODULE_23__["MotoristaService"] },
        { type: app_pages_veiculo_entrada_veiculo_entrada_veiculo_service__WEBPACK_IMPORTED_MODULE_24__["EntradaVeiculoService"] }
    ]; };
    RequisicaoDescargaAlterarDadosComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
            selector: "app-requisicao-descarga-alterar-dados",
            template: __importDefault(__webpack_require__(/*! raw-loader!./requisicao-descarga-alterar-dados.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-alterar-dados/requisicao-descarga-alterar-dados.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [_angular_router__WEBPACK_IMPORTED_MODULE_2__["Router"],
            _angular_router__WEBPACK_IMPORTED_MODULE_2__["ActivatedRoute"],
            _shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_1__["ConfiguracaoFacade"],
            _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_13__["FuncoesService"],
            _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_17__["MessageService"],
            _requisicao_descarga_service__WEBPACK_IMPORTED_MODULE_20__["RequisicaoDescargaService"],
            _pages_cadastro_destinatario_destinatario_service__WEBPACK_IMPORTED_MODULE_8__["DestinatarioService"],
            _pages_cadastro_material_material_service__WEBPACK_IMPORTED_MODULE_10__["MaterialService"],
            _pages_cadastro_lote_lote_service__WEBPACK_IMPORTED_MODULE_9__["LoteService"],
            _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_15__["PermissoesUtilsService"],
            _pages_login_login_service__WEBPACK_IMPORTED_MODULE_11__["LoginService"],
            app_pages_cadastro_motorista_motorista_service__WEBPACK_IMPORTED_MODULE_23__["MotoristaService"],
            app_pages_veiculo_entrada_veiculo_entrada_veiculo_service__WEBPACK_IMPORTED_MODULE_24__["EntradaVeiculoService"]])
    ], RequisicaoDescargaAlterarDadosComponent);
    return RequisicaoDescargaAlterarDadosComponent;
}(_requisicao_descarga_permissoes__WEBPACK_IMPORTED_MODULE_7__["RequisicaoDescargaPermissoes"]));



/***/ }),

/***/ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-alterar-dados/requisicao-descarga-alterar-dados.model.ts":
/*!********************************************************************************************************************************!*\
  !*** ./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-alterar-dados/requisicao-descarga-alterar-dados.model.ts ***!
  \********************************************************************************************************************************/
/*! exports provided: RequisicaoDescargaAlterarDados */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RequisicaoDescargaAlterarDados", function() { return RequisicaoDescargaAlterarDados; });
/* harmony import */ var _shared_services_base_base_model__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../../../../shared/services/base/base.model */ "./src/app/shared/services/base/base.model.ts");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};

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



/***/ }),

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

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RequisicaoDescargaAlterarDatasComponent", function() { return RequisicaoDescargaAlterarDatasComponent; });
/* 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 _requisicao_descarga_permissoes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../requisicao-descarga.permissoes */ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga.permissoes.ts");
/* harmony import */ var _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_4__ = __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_5__ = __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_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_6__ = __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_7__ = __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_8__ = __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_object_utils_object_utils_static_service__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./../../../../shared/services/funcoes/object-utils/object-utils.static.service */ "./src/app/shared/services/funcoes/object-utils/object-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 _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./../../../../shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var _requisicao_descarga_constants__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./../requisicao-descarga.constants */ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga.constants.ts");
/* harmony import */ var _requisicao_descarga_service__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./../requisicao-descarga.service */ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga.service.ts");
/* harmony import */ var _requisicao_descarga_alterar_datas_model__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./requisicao-descarga-alterar-datas.model */ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-alterar-datas/requisicao-descarga-alterar-datas.model.ts");
/* harmony import */ var _requisicao_descarga_alterar_datas_validation__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./requisicao-descarga-alterar-datas.validation */ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-alterar-datas/requisicao-descarga-alterar-datas.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 RequisicaoDescargaAlterarDatasComponent = /** @class */ (function (_super) {
    __extends(RequisicaoDescargaAlterarDatasComponent, _super);
    function RequisicaoDescargaAlterarDatasComponent(router, configuracao, activatedRoute, funcoes, message, service, permissoesUtils) {
        var _this = _super.call(this, new _requisicao_descarga_constants__WEBPACK_IMPORTED_MODULE_12__["RequisicaoDescargaConstants"](), funcoes) || this;
        _this.router = router;
        _this.configuracao = configuracao;
        _this.activatedRoute = activatedRoute;
        _this.funcoes = funcoes;
        _this.message = message;
        _this.service = service;
        _this.permissoesUtils = permissoesUtils;
        _this.data = new _requisicao_descarga_alterar_datas_model__WEBPACK_IMPORTED_MODULE_14__["RequisicaoDescargaAlterarDatas"]();
        _this.oldData = new _requisicao_descarga_alterar_datas_model__WEBPACK_IMPORTED_MODULE_14__["RequisicaoDescargaAlterarDatas"]();
        _this.constantes = new _requisicao_descarga_constants__WEBPACK_IMPORTED_MODULE_12__["RequisicaoDescargaConstants"]();
        _this.validacoes = [];
        _this.now = new Date();
        _this.disabledQuebra = true;
        _this.disabledAtraso = true;
        _this.minutos = 0;
        _this.target = _this.funcoes.getTargetLocation();
        _this.loadConfig = function () {
            _this.service.configBal.permissaoDatasOCD = _this.configuracao.boolean("BAL", "PermissaoDatasOCD");
            _this.service.configBal.justAtraso = _this.configuracao.boolean("BAL", "JustAtraso");
            _this.service.configBal.justDescarga = _this.configuracao.boolean("BAL", "JustDescarga");
            _this.posConfig();
        };
        _this.validation = new _requisicao_descarga_alterar_datas_validation__WEBPACK_IMPORTED_MODULE_15__["RequisicaoDescargaAlterarDatasValidation"](message);
        return _this;
    }
    RequisicaoDescargaAlterarDatasComponent.prototype.ngOnInit = function () {
        var _this = this;
        this.permissoesUtils.validRotina(this.constantes.sisFormularioId, 9, function () { return __awaiter(_this, void 0, void 0, function () {
            var id, _a;
            return __generator(this, function (_b) {
                switch (_b.label) {
                    case 0:
                        id = this.activatedRoute.snapshot.paramMap.get("id");
                        if (!id) {
                            this.message.warning("titles.requisicaoDescarga", "messages.nenhumRegistroEncontrado");
                            return [2 /*return*/];
                        }
                        _a = this;
                        return [4 /*yield*/, this.service.consultaAlteraDatas(+id).toPromise()];
                    case 1:
                        _a.data = _b.sent();
                        if (!this.data) {
                            this.message.warning("titles.requisicaoDescarga", "messages.nenhumRegistroEncontrado");
                            return [2 /*return*/];
                        }
                        this.init();
                        return [2 /*return*/];
                }
            });
        }); }, function () { });
    };
    RequisicaoDescargaAlterarDatasComponent.prototype.init = function () {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                this.configuracao.getConfig(this.constantes.listaParam, this.loadConfig);
                if (_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_8__["NumberUtilsStaticService"].toNumber(this.data.situacaoVeiculoId) <= 1015) {
                    this.message.warning("titles.requisicaoDescarga", "messages.requisicaoNaoLiberada");
                    this.back();
                }
                this.oldData = _shared_services_funcoes_object_utils_object_utils_static_service__WEBPACK_IMPORTED_MODULE_9__["ObjectUtilsStaticService"].clone(this.data);
                this.validation.oldData = this.oldData;
                this.data.motivoAtrasoId = !!this.data.motivoAtrasoId ? this.data.motivoAtrasoId : "";
                this.data.motivoQuebraId = !!this.data.motivoQuebraId ? this.data.motivoQuebraId : "";
                this.data.ternoId = !!this.data.ternoId ? this.data.ternoId : "";
                return [2 /*return*/];
            });
        });
    };
    RequisicaoDescargaAlterarDatasComponent.prototype.posConfig = function () {
        this.trataJustAtraso();
        this.trataJustQuebra();
    };
    RequisicaoDescargaAlterarDatasComponent.prototype.onSubmit = function (form) {
        var _this = this;
        _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_4__["EventEmitterService"].get("msgRDescargaAlteraDatas").emit(form);
        if (form.invalid) {
            return;
        }
        var validations = this.validation.getValidations(this.data);
        if (_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_5__["ArrayUtilsStaticService"].any(validations)) {
            _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_4__["EventEmitterService"].get("backError").emit(validations.map(function (c) { return c.message; }));
            return;
        }
        ;
        this.service.alterarDatas({
            requisicaoDescargaId: this.data.requisicaoDescargaId,
            dtChegada: this.data.dtChegada,
            dtAutorizacao: this.data.dtAutorizacao,
            dtIniOper: this.data.dtIniOper,
            dtFimOper: this.data.dtFimOper,
            dtSaida: this.data.dtSaida,
            dtLibVeiculo: this.data.dtLibVeiculo,
            dtTriagem: this.data.dtTriagem,
            dtEntregaNF: this.data.dtEntregaNf,
            nrTif: this.data.nrTif,
            observ: this.data.observ,
            motivoQuebraId: this.data.motivoQuebraId,
            motivoAtrasoId: this.data.motivoAtrasoId,
            ternoId: this.data.ternoId,
        }).subscribe(function (validationResult) {
            if (!validationResult.isValid) {
                var mensagens = _this.message.validationResult(validationResult);
                _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_4__["EventEmitterService"].get("backError").emit(mensagens);
                _this.funcoes.backToTop();
                return;
            }
            else {
                _this.message.saveSuccess("titles.requisicaoDescarga");
                _this.back();
            }
        });
    };
    RequisicaoDescargaAlterarDatasComponent.prototype.back = function () {
        this.router.navigate([this.target + "/balanca/requisicaoDescarga"]);
    };
    Object.defineProperty(RequisicaoDescargaAlterarDatasComponent.prototype, "atraso", {
        get: function () {
            return this.disabledAtraso ? "" : this.minutos + " min";
        },
        enumerable: true,
        configurable: true
    });
    RequisicaoDescargaAlterarDatasComponent.prototype.trataJustQuebra = function () {
        this.disabledQuebra = !this.oldData.motivoQuebraId;
    };
    RequisicaoDescargaAlterarDatasComponent.prototype.trataJustAtraso = function () {
        // this.disabledAtraso = !this.oldData.motivoAtrasoId;
        this.disabledAtraso = !this.service.configBal.justAtraso;
        if (this.service.configBal.justAtraso) {
            var dtInicio = undefined;
            if (!!this.data.dtTriagem)
                dtInicio = this.data.dtTriagem;
            else
                this.minutos = dtInicio = this.data.dtChegada;
            if (this.data.tipoTransp === "F")
                dtInicio = this.data.dtEntregaNf;
            if (!dtInicio || !this.data.dtSaida)
                return;
            var minutos = _shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_6__["DateTimeUtilsStaticService"].getMinutes(dtInicio, this.data.dtSaida);
            this.disabledAtraso = this.data.tempoOperacao > minutos;
            if (!this.disabledAtraso)
                this.minutos = minutos;
        }
    };
    RequisicaoDescargaAlterarDatasComponent.ctorParameters = function () { return [
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"] },
        { type: _shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_2__["ConfiguracaoFacade"] },
        { 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_11__["MessageService"] },
        { type: _requisicao_descarga_service__WEBPACK_IMPORTED_MODULE_13__["RequisicaoDescargaService"] },
        { type: _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_10__["PermissoesUtilsService"] }
    ]; };
    RequisicaoDescargaAlterarDatasComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
            selector: "app-requisicao-descarga-alterar-datas",
            template: __importDefault(__webpack_require__(/*! raw-loader!./requisicao-descarga-alterar-datas.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-alterar-datas/requisicao-descarga-alterar-datas.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [_angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"],
            _shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_2__["ConfiguracaoFacade"],
            _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_11__["MessageService"],
            _requisicao_descarga_service__WEBPACK_IMPORTED_MODULE_13__["RequisicaoDescargaService"],
            _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_10__["PermissoesUtilsService"]])
    ], RequisicaoDescargaAlterarDatasComponent);
    return RequisicaoDescargaAlterarDatasComponent;
}(_requisicao_descarga_permissoes__WEBPACK_IMPORTED_MODULE_3__["RequisicaoDescargaPermissoes"]));



/***/ }),

/***/ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-alterar-datas/requisicao-descarga-alterar-datas.model.ts":
/*!********************************************************************************************************************************!*\
  !*** ./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-alterar-datas/requisicao-descarga-alterar-datas.model.ts ***!
  \********************************************************************************************************************************/
/*! exports provided: RequisicaoDescargaAlterarDatas */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

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



/***/ }),

/***/ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-alterar-datas/requisicao-descarga-alterar-datas.validation.ts":
/*!*************************************************************************************************************************************!*\
  !*** ./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-alterar-datas/requisicao-descarga-alterar-datas.validation.ts ***!
  \*************************************************************************************************************************************/
/*! exports provided: RequisicaoDescargaAlterarDatasValidation */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RequisicaoDescargaAlterarDatasValidation", function() { return RequisicaoDescargaAlterarDatasValidation; });
/* harmony import */ var _shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_0__ = __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");
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};

var RequisicaoDescargaAlterarDatasValidation = /** @class */ (function () {
    function RequisicaoDescargaAlterarDatasValidation(message) {
        this.message = message;
        this.rs = [];
    }
    RequisicaoDescargaAlterarDatasValidation.prototype.getValidations = function (data) {
        this.rs = [];
        if (data.dtTriagem && data.dtChegada)
            this.test(this.dtChegadaDeveSerMaiorDtTriagem({ dtChegada: data.dtChegada, dtTriagem: data.dtTriagem }));
        if (data.dtEntregaNf)
            this.test(this.dtEntregaNfDeveSerMenorDataAtual({ dtEntregaNf: data.dtEntregaNf }));
        if (data.dtAutorizacao && data.dtChegada)
            this.test(this.dtAutorizacaoNaoPodeSerMenorDtChegada({ dtAutorizacao: data.dtAutorizacao, dtChegada: data.dtChegada }));
        if (data.dtIniOper && data.dtAutorizacao)
            this.test(this.dtIniOperNaoPodeSerMenorDtAutorizacao({ dtIniOper: data.dtIniOper, dtAutorizacao: data.dtAutorizacao }));
        if (data.dtFimOper && data.dtIniOper)
            this.test(this.dtFimOperNaoPodeSerMenorDtIniOper({ dtFimOper: data.dtFimOper, dtIniOper: data.dtIniOper }));
        if (data.dtSaida && data.dtFimOper)
            this.test(this.dtSaidaDeveSerMaiorDtFimOper({ dtSaida: data.dtSaida, dtFimOper: data.dtFimOper }));
        if (data.dtLibVeiculo && data.dtSaida)
            this.test(this.dtLibVeiculoDeveSerMaiorDtSaida({ dtLibVeiculo: data.dtLibVeiculo, dtSaida: data.dtSaida }));
        return this.rs.filter(function (v) { return v["isValid"] === false; });
    };
    RequisicaoDescargaAlterarDatasValidation.prototype.test = function (f) {
        if (!!f)
            this.rs.push(f);
    };
    RequisicaoDescargaAlterarDatasValidation.prototype.validaDtChegada = function (params, callBack) {
        if (!this.oldData || !params || !params.dtTriagem || !params.dtChegada)
            return;
        var r = this.dtChegadaDeveSerMaiorDtTriagem(params, true);
        if (callBack && (!!r && r.isValid)) {
            callBack();
        }
    };
    RequisicaoDescargaAlterarDatasValidation.prototype.validaDtEntregaNf = function (params, callBack) {
        if (!params || !params.dtEntregaNf)
            return;
        var r = this.dtEntregaNfDeveSerMenorDataAtual(params, true);
        if (callBack && (!!r && r.isValid)) {
            callBack();
        }
    };
    RequisicaoDescargaAlterarDatasValidation.prototype.validaDtAutorizacao = function (params, callBack) {
        if (!this.oldData || !params || !params.dtAutorizacao || !params.dtChegada)
            return;
        var r = this.dtAutorizacaoNaoPodeSerMenorDtChegada(params, true);
        if (callBack && (!!r && r.isValid)) {
            callBack();
        }
    };
    RequisicaoDescargaAlterarDatasValidation.prototype.validaDtIniOper = function (params, callBack) {
        if (!this.oldData || !params || !params.dtIniOper || !params.dtAutorizacao)
            return;
        var r = this.dtIniOperNaoPodeSerMenorDtAutorizacao(params, true);
        if (callBack && (!!r && r.isValid)) {
            callBack();
        }
    };
    RequisicaoDescargaAlterarDatasValidation.prototype.validaDtFimOper = function (params, callBack) {
        if (!this.oldData || !params || !params.dtIniOper || !params.dtFimOper)
            return;
        var r = this.dtFimOperNaoPodeSerMenorDtIniOper(params, true);
        if (callBack && (!!r && r.isValid)) {
            callBack();
        }
    };
    RequisicaoDescargaAlterarDatasValidation.prototype.validaDtSaida = function (params, callBack) {
        if (!this.oldData || !params || !params.dtSaida || !params.dtFimOper)
            return;
        var r = this.dtSaidaDeveSerMaiorDtFimOper(params, true);
        if (callBack && (!!r && r.isValid)) {
            callBack();
        }
    };
    RequisicaoDescargaAlterarDatasValidation.prototype.validaDtLibVeiculo = function (params, callBack) {
        if (!this.oldData || !params || !params.dtLibVeiculo || !params.dtSaida)
            return;
        var r = this.dtLibVeiculoDeveSerMaiorDtSaida(params, true);
        if (callBack && (!!r && r.isValid)) {
            callBack();
        }
    };
    RequisicaoDescargaAlterarDatasValidation.prototype.dtChegadaDeveSerMaiorDtTriagem = function (params, showError) {
        if (showError === void 0) { showError = false; }
        var r = { "isValid": true, "message": "" };
        if (params.dtChegada === this.oldData.dtChegada && params.dtTriagem === this.oldData.dtTriagem)
            return;
        if (_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["DateTimeUtilsStaticService"].maiorOuIgualA(params.dtChegada, params.dtTriagem, ['H', 'M', 'S']))
            return r;
        r.isValid = false;
        r.message = "messages.dtChegadaDeveSerMaiorDtTriagem";
        if (!r.isValid && showError) {
            this.message.warning("titles.requisicaoDescarga", r.message);
        }
        return r;
    };
    RequisicaoDescargaAlterarDatasValidation.prototype.dtEntregaNfDeveSerMenorDataAtual = function (params, showError) {
        if (showError === void 0) { showError = false; }
        var r = { "isValid": true, "message": "" };
        if (params.dtEntregaNf === this.oldData.dtEntregaNf)
            return;
        if (_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["DateTimeUtilsStaticService"].menorOuIgualAHoje(params.dtEntregaNf, ['H', 'M', 'S']))
            return r;
        r.isValid = false;
        r.message = "messages.dtEntregaNfDeveSerMenorDataAtual";
        if (!r.isValid && showError) {
            this.message.warning("titles.requisicaoDescarga", r.message);
        }
        return r;
    };
    RequisicaoDescargaAlterarDatasValidation.prototype.dtAutorizacaoNaoPodeSerMenorDtChegada = function (params, showError) {
        if (showError === void 0) { showError = false; }
        var r = { "isValid": true, "message": "" };
        if (params.dtAutorizacao === this.oldData.dtAutorizacao && params.dtChegada === this.oldData.dtChegada)
            return;
        if (_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["DateTimeUtilsStaticService"].maiorOuIgualA(params.dtAutorizacao, params.dtChegada, ['H', 'M', 'S']))
            return r;
        r.isValid = false;
        r.message = "messages.dtAutorizacaoNaoPodeSerMenorDtChegada";
        if (!r.isValid && showError) {
            this.message.warning("titles.requisicaoDescarga", r.message);
        }
        return r;
    };
    RequisicaoDescargaAlterarDatasValidation.prototype.dtAutorizacaoNaoPodeSerMenorDtDocto = function (params, showError) {
        if (showError === void 0) { showError = false; }
        var r = { "isValid": true, "message": "" };
        if (params.dtAutorizacao === this.oldData.dtAutorizacao && params.dtDocto === this.oldData.dtDocto)
            return;
        if (_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["DateTimeUtilsStaticService"].maiorOuIgualA(params.dtAutorizacao, params.dtDocto))
            return r;
        r.isValid = false;
        r.message = "messages.dtAutorizacaoNaoPodeSerMenordtDocto";
        if (!r.isValid && showError) {
            this.message.warning("titles.requisicaoDescarga", r.message);
        }
        return r;
    };
    RequisicaoDescargaAlterarDatasValidation.prototype.dtIniOperNaoPodeSerMenorDtAutorizacao = function (params, showError) {
        if (showError === void 0) { showError = false; }
        var r = { "isValid": true, "message": "" };
        if (params.dtIniOper === this.oldData.dtIniOper && params.dtAutorizacao === this.oldData.dtAutorizacao)
            return;
        if (_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["DateTimeUtilsStaticService"].maiorOuIgualA(params.dtIniOper, params.dtAutorizacao, ['H', 'M', 'S']))
            return r;
        r.isValid = false;
        r.message = "messages.dtIniOperNaoPodeSerMenorDtAutorizacao";
        if (!r.isValid && showError) {
            this.message.warning("titles.requisicaoDescarga", r.message);
        }
        return r;
    };
    RequisicaoDescargaAlterarDatasValidation.prototype.dtFimOperNaoPodeSerMenorDtIniOper = function (params, showError) {
        if (showError === void 0) { showError = false; }
        var r = { "isValid": true, "message": "" };
        if (params.dtFimOper === this.oldData.dtFimOper && params.dtIniOper === this.oldData.dtIniOper)
            return;
        if (_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["DateTimeUtilsStaticService"].maiorOuIgualA(params.dtFimOper, params.dtIniOper, ['H', 'M', 'S']))
            return r;
        r.isValid = false;
        r.message = "messages.dtFimOperDeveSerMaiorDtIniOper";
        if (!r.isValid && showError) {
            this.message.warning("titles.requisicaoDescarga", r.message);
        }
        return r;
    };
    RequisicaoDescargaAlterarDatasValidation.prototype.dtSaidaDeveSerMaiorDtFimOper = function (params, showError) {
        if (showError === void 0) { showError = false; }
        var r = { "isValid": true, "message": "" };
        if (params.dtSaida === this.oldData.dtSaida && params.dtFimOper === this.oldData.dtFimOper)
            return;
        if (_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["DateTimeUtilsStaticService"].maiorOuIgualA(params.dtSaida, params.dtFimOper, ['H', 'M', 'S']))
            return r;
        r.isValid = false;
        r.message = "messages.dtSaidaNaoPodeSerMenorDtFimOper";
        if (!r.isValid && showError) {
            this.message.warning("titles.requisicaoDescarga", r.message);
        }
        return r;
    };
    RequisicaoDescargaAlterarDatasValidation.prototype.dtLibVeiculoDeveSerMaiorDtSaida = function (params, showError) {
        if (showError === void 0) { showError = false; }
        var r = { "isValid": true, "message": "" };
        if (params.dtLibVeiculo === this.oldData.dtLibVeiculo && params.dtSaida === this.oldData.dtSaida)
            return;
        if (_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["DateTimeUtilsStaticService"].maiorOuIgualA(params.dtLibVeiculo, params.dtSaida, ['H', 'M', 'S']))
            return r;
        r.isValid = false;
        r.message = "messages.dtLibVeiculoDeveSerMaiorDtSaida";
        if (!r.isValid && showError) {
            this.message.warning("titles.requisicaoDescarga", r.message);
        }
        return r;
    };
    return RequisicaoDescargaAlterarDatasValidation;
}());



/***/ }),

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

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RequisicaoDescargaFilterComponent", function() { return RequisicaoDescargaFilterComponent; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../../../../shared/services/event-emitter/event-emitter.service */ "./src/app/shared/services/event-emitter/event-emitter.service.ts");
/* harmony import */ var _requisicao_descarga_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../requisicao-descarga.service */ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga.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 RequisicaoDescargaFilterComponent = /** @class */ (function () {
    function RequisicaoDescargaFilterComponent(service) {
        this.service = service;
        this.outFilter = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
    }
    RequisicaoDescargaFilterComponent.prototype.onSubmit = function (form) {
        _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_1__["EventEmitterService"].get("formError").emit(null);
        if (form.invalid) {
            return;
        }
        jQuery("#rd-filter-dialog").modal("hide");
        this.outFilter.emit(true);
    };
    RequisicaoDescargaFilterComponent.prototype.trataSituacao = function (situacoes) {
        this.service.filtro.sitReg = situacoes;
    };
    RequisicaoDescargaFilterComponent.ctorParameters = function () { return [
        { type: _requisicao_descarga_service__WEBPACK_IMPORTED_MODULE_2__["RequisicaoDescargaService"] }
    ]; };
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"])(),
        __metadata("design:type", Object)
    ], RequisicaoDescargaFilterComponent.prototype, "outFilter", void 0);
    RequisicaoDescargaFilterComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
            selector: "app-requisicao-descarga-filter",
            template: __importDefault(__webpack_require__(/*! raw-loader!./requisicao-descarga-filter.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-filter/requisicao-descarga-filter.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [_requisicao_descarga_service__WEBPACK_IMPORTED_MODULE_2__["RequisicaoDescargaService"]])
    ], RequisicaoDescargaFilterComponent);
    return RequisicaoDescargaFilterComponent;
}());



/***/ }),

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

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RequisicaoDescargaFormComponent", function() { return RequisicaoDescargaFormComponent; });
/* harmony import */ var _shared_components_commons_corrige_placa_ocr_corrige_placa_ocr_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../../../../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 _shared_components_commons_corrige_placa_ocr_corrige_placa_ocr_model__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../../../../shared/components/commons/corrige-placa-ocr/corrige-placa-ocr.model */ "./src/app/shared/components/commons/corrige-placa-ocr/corrige-placa-ocr.model.ts");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/fesm5/router.js");
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/* 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 _config_enumerables__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../../../../config/enumerables */ "./src/app/config/enumerables.ts");
/* harmony import */ var _shared_components_pesquisa_pesquisa_check_list_pesquisa_check_list_component__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./../../../../shared/components/pesquisa/pesquisa-check-list/pesquisa-check-list.component */ "./src/app/shared/components/pesquisa/pesquisa-check-list/pesquisa-check-list.component.ts");
/* harmony import */ var _shared_components_pesquisa_pesquisa_check_list_pesquisa_check_list_model__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./../../../../shared/components/pesquisa/pesquisa-check-list/pesquisa-check-list.model */ "./src/app/shared/components/pesquisa/pesquisa-check-list/pesquisa-check-list.model.ts");
/* harmony import */ var _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_9__ = __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_10__ = __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_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./../../../../shared/services/funcoes/boolean-utils/boolean-utils.static.service */ "./src/app/shared/services/funcoes/boolean-utils/boolean-utils.static.service.ts");
/* harmony import */ var _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_12__ = __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_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_object_utils_object_utils_static_service__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./../../../../shared/services/funcoes/object-utils/object-utils.static.service */ "./src/app/shared/services/funcoes/object-utils/object-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 _cadastro_densidade_tanque_densidade_tanque_model__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./../../../cadastro/densidade-tanque/densidade-tanque.model */ "./src/app/pages/cadastro/densidade-tanque/densidade-tanque.model.ts");
/* harmony import */ var _cadastro_densidade_tanque_densidade_tanque_service__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./../../../cadastro/densidade-tanque/densidade-tanque.service */ "./src/app/pages/cadastro/densidade-tanque/densidade-tanque.service.ts");
/* harmony import */ var _cadastro_destinatario_destinatario_model__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./../../../cadastro/destinatario/destinatario.model */ "./src/app/pages/cadastro/destinatario/destinatario.model.ts");
/* harmony import */ var _cadastro_destinatario_destinatario_service__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./../../../cadastro/destinatario/destinatario.service */ "./src/app/pages/cadastro/destinatario/destinatario.service.ts");
/* harmony import */ var _cadastro_material_material_model__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./../../../cadastro/material/material.model */ "./src/app/pages/cadastro/material/material.model.ts");
/* harmony import */ var _cadastro_material_material_service__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./../../../cadastro/material/material.service */ "./src/app/pages/cadastro/material/material.service.ts");
/* harmony import */ var _cadastro_motorista_motorista_model__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./../../../cadastro/motorista/motorista.model */ "./src/app/pages/cadastro/motorista/motorista.model.ts");
/* harmony import */ var _cadastro_motorista_motorista_service__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./../../../cadastro/motorista/motorista.service */ "./src/app/pages/cadastro/motorista/motorista.service.ts");
/* harmony import */ var _cadastro_tanque_tanque_model__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./../../../cadastro/tanque/tanque.model */ "./src/app/pages/cadastro/tanque/tanque.model.ts");
/* harmony import */ var _cadastro_tanque_tanque_service__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./../../../cadastro/tanque/tanque.service */ "./src/app/pages/cadastro/tanque/tanque.service.ts");
/* harmony import */ var _login_login_service__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./../../../login/login.service */ "./src/app/pages/login/login.service.ts");
/* harmony import */ var _requisicao_descarga_item_requisicao_descarga_item_model__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./../requisicao-descarga-item/requisicao-descarga-item.model */ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-item/requisicao-descarga-item.model.ts");
/* harmony import */ var _requisicao_descarga_constants__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./../requisicao-descarga.constants */ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga.constants.ts");
/* harmony import */ var _requisicao_descarga_model__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./../requisicao-descarga.model */ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga.model.ts");
/* harmony import */ var _requisicao_descarga_permissoes__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./../requisicao-descarga.permissoes */ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga.permissoes.ts");
/* harmony import */ var _requisicao_descarga_service__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./../requisicao-descarga.service */ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga.service.ts");
/* harmony import */ var _requisicao_descarga_form_validation__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./requisicao-descarga-form.validation */ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-form/requisicao-descarga-form.validation.ts");
/* harmony import */ var app_pages_cadastro_lote_lote_service__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! app/pages/cadastro/lote/lote.service */ "./src/app/pages/cadastro/lote/lote.service.ts");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (undefined && undefined.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
    function verb(n) { return function (v) { return step([n, v]); }; }
    function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (_) try {
            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
            if (y = 0, t) op = [op[0] & 2, t.value];
            switch (op[0]) {
                case 0: case 1: t = op; break;
                case 4: _.label++; return { value: op[1], done: false };
                case 5: _.label++; y = op[1]; op = [0]; continue;
                case 7: op = _.ops.pop(); _.trys.pop(); continue;
                default:
                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                    if (t[2]) _.ops.pop();
                    _.trys.pop(); continue;
            }
            op = body.call(thisArg, _);
        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
    }
};
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};



































var RequisicaoDescargaFormComponent = /** @class */ (function (_super) {
    __extends(RequisicaoDescargaFormComponent, _super);
    function RequisicaoDescargaFormComponent(router, message, activatedRoute, service, loginService, permissoesUtils, configuracao, funcoesService, materialService, motoristaService, destinatarioService, tanqueService, loteService, densidadeTanqueService) {
        var _this = _super.call(this, new _requisicao_descarga_constants__WEBPACK_IMPORTED_MODULE_29__["RequisicaoDescargaConstants"](), funcoesService) || this;
        _this.router = router;
        _this.message = message;
        _this.activatedRoute = activatedRoute;
        _this.service = service;
        _this.loginService = loginService;
        _this.permissoesUtils = permissoesUtils;
        _this.configuracao = configuracao;
        _this.funcoesService = funcoesService;
        _this.materialService = materialService;
        _this.motoristaService = motoristaService;
        _this.destinatarioService = destinatarioService;
        _this.tanqueService = tanqueService;
        _this.loteService = loteService;
        _this.densidadeTanqueService = densidadeTanqueService;
        _this.data = new _requisicao_descarga_model__WEBPACK_IMPORTED_MODULE_30__["RequisicaoDescarga"]();
        _this.mensagens = [];
        _this.constantes = new _requisicao_descarga_constants__WEBPACK_IMPORTED_MODULE_29__["RequisicaoDescargaConstants"]();
        _this.mascaras = new _config_enumerables__WEBPACK_IMPORTED_MODULE_6__["Mascaras"]();
        _this.isOutrasDescarga = false;
        _this.filtroTipoDetransporte = 'R';
        _this.target = _this.funcoesService.getTargetLocation();
        _this.mascara = new _config_enumerables__WEBPACK_IMPORTED_MODULE_6__["Mascaras"]();
        _this.filtroCheckList = new _shared_components_pesquisa_pesquisa_check_list_pesquisa_check_list_model__WEBPACK_IMPORTED_MODULE_8__["SelecionaCheckListFiltro"];
        _this.desabilitaNAltDepositoLibVeic = false;
        _this.desabilitaNPermiteAltDados20 = false;
        _this.disabledCamposCheckList = false;
        _this.loadConfig = function () {
            _this.service.configBal.pesagemAutomatica = _this.configuracao.boolean("BAL", "PesagemAutomatica");
            _this.service.configCtv.observPortal = _this.configuracao.boolean("CTV", "ObservPortal");
            _this.service.configBal.codBalCheckList = _this.configuracao.boolean("BAL", "CodBalCheckList");
            _this.service.configBal.balCodig = _this.configuracao.string("BAL", "BalCodig" + _this.configuracao.macAddress);
            _this.service.configUni.obrChaveNFeEnt = _shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_11__["BooleanUtilsStaticService"].toBoolean(_this.configuracao.lerConfig("UNI", "ObrChaveNFeEnt"));
            _this.service.configCtv.importaDANFE = _shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_11__["BooleanUtilsStaticService"].toBoolean(_this.configuracao.lerConfig("CTV", "ImportaDANFE"));
            _this.service.configBal.calculaTotalNF = _shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_11__["BooleanUtilsStaticService"].toBoolean(_this.configuracao.lerConfig("BAL", "CalculaTotalNF"));
            _this.service.configBal.infPesoFob = _shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_11__["BooleanUtilsStaticService"].toBoolean(_this.configuracao.lerConfig("BAL", "InfPesoFob"));
            _this.service.configBal.naoPermiteAlterarChkLst = _shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_11__["BooleanUtilsStaticService"].toBoolean(_this.configuracao.lerConfig("BAL", "NaoPermiteAlterarChkLst"));
            _this.service.configCtv.itemNoCheckList = _shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_11__["BooleanUtilsStaticService"].toBoolean(_this.configuracao.lerConfig("CTV", "itemNoCheckList"));
            _this.service.configCtv.naoPermiteAlterarChkLst = _shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_11__["BooleanUtilsStaticService"].toBoolean(_this.configuracao.lerConfig("CTV", "naoPermiteAlterarChkLst"));
            _this.service.configWeb.obrigaPlataformaRodo = _this.configuracao.boolean("WEB", "ObrigaPlataformaRodo");
            _this.service.configUni.solMotCancEVePesagem = _this.configuracao.boolean("UNI", "SolMotCancEVePesagem");
            _this.service.configUni.validaMobile2Pes = _this.configuracao.boolean("UNI", "validaMobile2Pes");
            _this.service.configCtv.nAltDepositoLibVeic = _this.configuracao.boolean("CTV", "NAltDepositoLibVeic");
            _this.service.configWeb.cWebModTicketD = _this.configuracao.lerConfig("WEB", "CWebModTicketD");
            _this.service.configWeb.cWebModRequisicaoD = _this.configuracao.lerConfig("WEB", "CWebModRequisicaoD");
            _this.service.configWeb.prefixoRelEspecifico = _this.configuracao.lerConfig("WEB", "PrefixoRelEspecifico");
            _this.service.configWeb.obrigaPlataformaRodo = _this.configuracao.lerConfig("WEB", "ObrigaPlataformaRodo");
            _this.service.configCtr.dtSeguro = _this.configuracao.string("CTR", "DtSeguro");
            _this.service.configBal.ocrPesagem = _this.configuracao.boolean("BAL", "ocrPesagem");
            _this.posConfig();
        };
        router.events.subscribe(function (event) {
            var params = _this.funcoesService.formParams.getParams(router, event);
            if (params) {
                _this.actionForm = params.action;
                _this.tipoRequisicao = params.tipoRequisicao;
            }
        });
        _this.validation = new _requisicao_descarga_form_validation__WEBPACK_IMPORTED_MODULE_33__["RequisicaoDescargaFormValidation"](_this.message, _this.configuracao, _this.funcoesService, _this.service);
        return _this;
    }
    RequisicaoDescargaFormComponent.prototype.ngOnInit = function () {
        var _this = this;
        this.item = new _requisicao_descarga_item_requisicao_descarga_item_model__WEBPACK_IMPORTED_MODULE_28__["RequisicaoDescargaItem"]();
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, this.permissoesUtils.getLibRotina(this.actionForm), function () { return __awaiter(_this, void 0, void 0, function () {
            var id, resp, odata, params, resp;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        id = this.activatedRoute.snapshot.paramMap.get("id");
                        if (!id) return [3 /*break*/, 2];
                        this.sitRotina = "A";
                        return [4 /*yield*/, this.service.getById(id).toPromise()];
                    case 1:
                        resp = _a.sent();
                        this.trataData(resp);
                        this.showComponents = true;
                        return [3 /*break*/, 4];
                    case 2:
                        this.sitRotina = "I";
                        this.confirmMudancaRota = true;
                        odata = this.activatedRoute.snapshot.paramMap.get("data");
                        if (!odata) return [3 /*break*/, 4];
                        params = this.funcoesService.b64ToObj(odata);
                        this.loteId = params.lote;
                        return [4 /*yield*/, this.service.corpWebBalRequisicaoDescargaTmpGrava({
                                requisicaoDescargaId: 0,
                                sitRotina: this.sitRotina,
                                checkListId: params.codChecklist
                            }).toPromise()];
                    case 3:
                        resp = _a.sent();
                        this.trataData(resp);
                        this.showComponents = true;
                        _a.label = 4;
                    case 4:
                        this.getConfig();
                        return [2 /*return*/];
                }
            });
        }); }, function () {
            _this.permissoesUtils.back();
        });
    };
    RequisicaoDescargaFormComponent.prototype.getConfig = function () {
        var _this = this;
        this.constantes.listaParam.map(function (c) {
            if (c.sistema === 'BAL') {
                c.parametros.push("BalCodig" + _this.configuracao.macAddress);
            }
        });
        this.configuracao.getConfig(this.constantes.listaParam, this.loadConfig);
    };
    RequisicaoDescargaFormComponent.prototype.posConfig = function () {
        this.data.balancaId = !!this.service.configBal.balCodig ? this.service.configBal.balCodig : "";
    };
    RequisicaoDescargaFormComponent.prototype.podeAlterar = function () {
        return __awaiter(this, void 0, void 0, function () {
            var validationResult, mensagens;
            var _this = this;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.service.verificaAlteracao({ requisicaoDescargaId: this.data.requisicaoDescargaId }).toPromise()];
                    case 1:
                        validationResult = _a.sent();
                        if (!validationResult.isValid) {
                            mensagens = this.message.validationResult(validationResult);
                            mensagens.forEach(function (m) { return _this.message.warning("titles.requisicaoDescarga", m); });
                            return [2 /*return*/, false];
                        }
                        return [2 /*return*/];
                }
            });
        });
    };
    RequisicaoDescargaFormComponent.prototype.trataData = function (data) {
        return __awaiter(this, void 0, void 0, function () {
            var results;
            var _this = this;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        if (!data)
                            return [2 /*return*/];
                        this.data = _shared_services_funcoes_object_utils_object_utils_static_service__WEBPACK_IMPORTED_MODULE_14__["ObjectUtilsStaticService"].clone(data);
                        this.data.requisicaoDescargaItems.map(function (s, idx) { return s.sequencia = idx + 1; });
                        if (this.funcoesService.isEdit(this.actionForm)) {
                            if (!this.podeAlterar())
                                return [2 /*return*/];
                            if (!!this.data.materialId) {
                                this.materialService.getById(this.data.materialId).subscribe(function (resp) {
                                    _this.data.material = resp;
                                });
                            }
                            if (["A", "P"].includes(this.data.sitReg)) {
                                this.message.confirm("titles.requisicaoDescarga", "messages.registroComPesagemDesejaAlterar", null, function () { return __awaiter(_this, void 0, void 0, function () {
                                    return __generator(this, function (_a) {
                                        this.geraTmp();
                                        return [2 /*return*/];
                                    });
                                }); }, false, function () { return _this.back(); });
                            }
                            else {
                                this.geraTmp();
                            }
                        }
                        if (!this.funcoesService.isCreate(this.actionForm)) return [3 /*break*/, 2];
                        this.regTmp = data.retRegTmp;
                        this.mensagens = this.message.validationResult(data.validationResult);
                        if (!data.validationResult.isValid) {
                            this.message.warning("titles.requisicaoDescarga", this.mensagens[0]);
                            this.back();
                            return [2 /*return*/];
                        }
                        return [4 /*yield*/, Object(rxjs__WEBPACK_IMPORTED_MODULE_4__["forkJoin"])([
                                this.materialService.getById(data.material),
                                this.motoristaService.getById(_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_13__["NumberUtilsStaticService"].toNumber(data.motorista)),
                                this.destinatarioService.getById(_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_13__["NumberUtilsStaticService"].toNumber(data.transportadora)),
                                this.tanqueService.getById(btoa(data.deposito))
                            ]).toPromise()];
                    case 1:
                        results = _a.sent();
                        this.loteService.getByLoteId(this.loteId).subscribe(function (resp) {
                            _this.osgId = resp.osgId;
                        });
                        this.data.material = new _cadastro_material_material_model__WEBPACK_IMPORTED_MODULE_21__["Material"]();
                        this.data.motorista = new _cadastro_motorista_motorista_model__WEBPACK_IMPORTED_MODULE_23__["Motorista"]();
                        this.data.transportadora = new _cadastro_destinatario_destinatario_model__WEBPACK_IMPORTED_MODULE_19__["Destinatario"]();
                        this.data.tanque = new _cadastro_tanque_tanque_model__WEBPACK_IMPORTED_MODULE_25__["Tanque"]();
                        if (_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_10__["ArrayUtilsStaticService"].any(results)) {
                            this.data.material = !!results[0] ? results[0] : new _cadastro_material_material_model__WEBPACK_IMPORTED_MODULE_21__["Material"]();
                            this.data.motorista = !!results[1] ? results[1] : new _cadastro_motorista_motorista_model__WEBPACK_IMPORTED_MODULE_23__["Motorista"]();
                            this.data.transportadora = !!results[2] ? results[2] : new _cadastro_destinatario_destinatario_model__WEBPACK_IMPORTED_MODULE_19__["Destinatario"]();
                            this.data.tanque = !!results[3] ? results[3] : new _cadastro_tanque_tanque_model__WEBPACK_IMPORTED_MODULE_25__["Tanque"]();
                            if (this.data.tanque) {
                                this.data.densidadeAmostra = this.data.tanque.densidadeAmostra;
                                this.data.temperaturaAmostra = this.data.tanque.temperaturaAmostra;
                                this.data.temperaturaCarroTanque = this.data.tanque.temperaturaTanque;
                                this.calcDados20();
                            }
                        }
                        this.data.materialId = data.material;
                        this.data.motoristaId = data.motorista;
                        this.data.destinatarioIdTransportadora = data.transportadora;
                        this.data.tanqueId = data.deposito;
                        this.data.tiposDeTransporteId = 'R';
                        this.data.requisicaoDescargaId = data.regRequisicao;
                        this.data.checkListId = data.codCheckList;
                        this.data.checkListItemId = data.itemCheckList;
                        this.data.dtRequisicao = new Date(data.dtRequisicao);
                        this.data.cadastroPlacaIdCavalo = data.placaCavalo;
                        this.data.estadoIdCavalo = data.estado;
                        this.data.cadastroPlacaIdCarreta1 = data.placaCarreta1;
                        this.data.cadastroPlacaIdCarreta2 = data.placaCarreta2;
                        this.data.ternoId = !!data.regTerno ? data.regTerno : "";
                        this.data.tipoOperacaoId = data.tipoOperacao;
                        this.data.kilos = data.kilos;
                        this.data.observ = data.observ;
                        this.data.pesoBru = data.pesoBru;
                        this.data.pesoTara = data.pesoTara;
                        this.data.pesoLiq = data.pesoLiq;
                        this.data.balancaId = data.codBalanca;
                        _a.label = 2;
                    case 2: return [2 /*return*/];
                }
            });
        });
    };
    RequisicaoDescargaFormComponent.prototype.geraTmp = function () {
        return __awaiter(this, void 0, void 0, function () {
            var result;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.service.corpWebBalRequisicaoDescargaTmpGrava({
                            requisicaoDescargaId: this.data.requisicaoDescargaId,
                            sitRotina: this.sitRotina,
                            checkListId: this.data.checkListId
                        }).toPromise()];
                    case 1:
                        result = _a.sent();
                        this.regTmp = result.retRegTmp;
                        this.data.regTmp = result.retRegTmp;
                        this.mensagens = this.message.validationResult(result.validationResult);
                        if (result && !result.validationResult.isValid) {
                            this.message.warning("titles.requisicaoDescarga", this.mensagens[0]);
                            this.back();
                            return [2 /*return*/];
                        }
                        return [2 /*return*/];
                }
            });
        });
    };
    Object.defineProperty(RequisicaoDescargaFormComponent.prototype, "controle20", {
        get: function () {
            if (!this.data.material)
                return false;
            return _shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_11__["BooleanUtilsStaticService"].toBoolean(this.data.material.controle20);
        },
        enumerable: true,
        configurable: true
    });
    RequisicaoDescargaFormComponent.prototype.trataDeposito = function (selected) {
        if (selected) {
            this.data.tanque = selected;
            this.data.densidadeAmostra = selected.densidadeAmostra;
            this.data.temperaturaAmostra = selected.temperaturaAmostra;
            this.data.temperaturaCarroTanque = selected.temperaturaTanque;
        }
    };
    Object.defineProperty(RequisicaoDescargaFormComponent.prototype, "saldoDepositoOptions", {
        get: function () {
            return {
                destinatarioIdCliente: this.data.destinatarioIdCliente,
                materialId: this.data.materialId,
                // tanqueId: this.data.tanqueId,
                sitLote: 'A',
                modo: 7,
                tipoSaldo: 7,
                dataMovimento: this.data.dtRequisicao,
                tipoAgrupa: 'D',
                geraArquivo: 'S',
                osgId: this.osgId
            };
        },
        enumerable: true,
        configurable: true
    });
    RequisicaoDescargaFormComponent.prototype.selectedItem = function (event) {
        this.item = event;
    };
    RequisicaoDescargaFormComponent.prototype.verificaAlteracao = function (obj) {
        var _this = this;
        var promise = new Promise(function (resolve, reject) {
            _this.service.verificaAlteracao(obj).subscribe(function (result) {
                resolve(result);
                reject(result);
            });
        });
        return promise;
    };
    RequisicaoDescargaFormComponent.prototype.trataMotorista = function (motorista) {
        this.data.motorista = motorista;
    };
    RequisicaoDescargaFormComponent.prototype.opnModal = function () {
        _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_9__["EventEmitterService"].get("formError").emit(null);
        this.filtroCheckList.checkListId = 0;
        this.filtroCheckList.itemCheckListId = 0;
        this.filtroCheckList.destinatarioIdCliente = 0;
        this.filtroCheckList.destinatarioIdTransportadora = 0;
        this.filtroCheckList.materialId = "";
        this.filtroCheckList.sitChecklist = "A";
        this.filtroCheckList.tipoOper = "D";
        this.filtroCheckList.pesagemTerceiros = "N";
        this.filtroCheckList.tipoTransporteId = "";
        this.filtroCheckList.descargaDireta = "N";
        this.filtroCheckList.codSitVeiculo = 1013;
        this.filtroCheckList.motoristaId = 0;
        this.filtroCheckList.placa = "";
        this.childPesquisaChecklistComponent.objectSelect(true);
        jQuery("#pesquisa-check-list-dialog").modal("show");
        this.disabledCamposCheckList = false;
    };
    RequisicaoDescargaFormComponent.prototype.getById = function (id) {
        var _this = this;
        this.service.getById(id).subscribe(function (resp) {
            _this.data = resp;
            if (_this.funcoesService.isUndefinedOrNull(_this.data)) {
                _this.message.warning("titles.requisicaoDescarga", "messages.idInformadoNaoExiste");
                _this.back();
            }
        });
    };
    RequisicaoDescargaFormComponent.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.configBal.ocrPesagem && !!this.data.balancaId)) return [3 /*break*/, 2];
                        dadosOcr = new _shared_components_commons_corrige_placa_ocr_corrige_placa_ocr_model__WEBPACK_IMPORTED_MODULE_1__["CorrigePlacaOcr"](_shared_components_commons_corrige_placa_ocr_corrige_placa_ocr_model__WEBPACK_IMPORTED_MODULE_1__["CorrigePlacaOcr"].Entrada, _shared_components_commons_corrige_placa_ocr_corrige_placa_ocr_model__WEBPACK_IMPORTED_MODULE_1__["CorrigePlacaOcr"].Rodo, this.data.cadastroPlacaIdCavalo, this.data.cadastroPlacaIdCarreta1, this.data.cadastroPlacaIdCarreta2);
                        dadosOcr.tipoBusca = _shared_components_commons_corrige_placa_ocr_corrige_placa_ocr_model__WEBPACK_IMPORTED_MODULE_1__["CorrigePlacaOcr"].RequisicaoDeDescarga;
                        dadosOcr.idCorporate = this.data.requisicaoDescargaId;
                        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];
                }
            });
        });
    };
    RequisicaoDescargaFormComponent.prototype.onSubmit = function (form, create) {
        if (create === void 0) { create = false; }
        _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_9__["EventEmitterService"].get("formError").emit(form);
        if (form.invalid) {
            this.funcoesService.backToTop();
            return;
        }
        // Valida regras de negócio
        var validations = this.validation.getValidations(this.data);
        if (validations && validations.length > 0) {
            this.mensagens = this.message.validationsForm(validations);
            _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_9__["EventEmitterService"].get("backError").emit(this.mensagens);
            this.funcoesService.backToTop();
            return;
        }
        if (this.sitRotina === "A") {
            this.data.regTmp = this.regTmp;
        }
        else {
            this.data.regTmp = this.regTmp;
            this.data.requisicaoDescargaId = 0;
        }
        if (this.service.configBal.ocrPesagem && !!this.data.balancaId) {
            this.preparaOcr();
        }
        this.confirma(create);
    };
    RequisicaoDescargaFormComponent.prototype.confirma = function (create) {
        var _this = this;
        if (create === void 0) { create = false; }
        // Salva requisicao de descarga
        this.service
            .save(this.data, this.data.requisicaoDescargaId > 0)
            .subscribe(function (result) {
            _this.mensagens = _this.message.validationResult(result.validationResult);
            if (!result.validationResult.isValid) {
                _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_9__["EventEmitterService"].get("backError").emit(_this.mensagens);
                _this.funcoesService.backToTop();
            }
            else {
                _this.message.saveSuccess("titles.requisicaoDescarga");
                if (create) {
                    _this.data = new _requisicao_descarga_model__WEBPACK_IMPORTED_MODULE_30__["RequisicaoDescarga"]();
                    _this.router.navigate([_this.target + "/balanca/descarga/create"]);
                }
                else {
                    _this.confirmMudancaRota = false;
                    _this.back();
                }
            }
        });
    };
    RequisicaoDescargaFormComponent.prototype.confirmaOcr = function (dadosPlaca) {
        this.data.placaDig1 = this.data.cadastroPlacaIdCavalo;
        this.data.placaDig2 = this.data.cadastroPlacaIdCarreta1;
        this.data.placaDig3 = this.data.cadastroPlacaIdCarreta2;
        this.data.cadastroPlacaIdCavalo = dadosPlaca.placas[0];
        this.data.cadastroPlacaIdCarreta1 = dadosPlaca.placas[1];
        this.data.cadastroPlacaIdCarreta2 = dadosPlaca.placas[2];
        this.data.placaOcr1 = dadosPlaca.placas[3];
        this.data.placaOcr1 = dadosPlaca.placas[4];
        this.data.placaOcr1 = dadosPlaca.placas[5];
        this.data.justificativaOcr1 = dadosPlaca.justificativas[0];
        this.data.justificativaOcr2 = dadosPlaca.justificativas[1];
        this.data.justificativaOcr3 = dadosPlaca.justificativas[2];
        this.data.ocrRtsSessao = dadosPlaca.sessao;
        this.data.ocrRtsGate = dadosPlaca.gate;
        this.confirma();
    };
    RequisicaoDescargaFormComponent.prototype.edit = function () {
        this.router.navigate([this.target + "/balanca/requisicaoDescarga", "edit", this.data.requisicaoDescargaId]);
    };
    RequisicaoDescargaFormComponent.prototype.saveAndCreate = function (form) {
        this.onSubmit(form, true);
    };
    RequisicaoDescargaFormComponent.prototype.back = function () {
        this.funcoesService.desabilitarFiltro();
        this.confirmMudancaRota = false;
        this.router.navigate([this.target + "/balanca/requisicaoDescarga"]);
    };
    RequisicaoDescargaFormComponent.prototype.refreshItens = function (itens) {
        var _this = this;
        this.data.requisicaoDescargaItems = itens;
        this.data.kilos = 0;
        this.data.requisicaoDescargaItems.forEach(function (e) {
            _this.data.kilos = +_this.data.kilos + +e.pesoDoc;
        });
    };
    RequisicaoDescargaFormComponent.prototype.getPeso = function (resp) {
        this.data.flagManual = resp.manual ? "S" : "N";
        if (_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_13__["NumberUtilsStaticService"].isNotPositive(resp.peso))
            this.data.pesoBru = undefined;
    };
    RequisicaoDescargaFormComponent.prototype.trataTanque = function (data) {
        this.data.tanque = data;
    };
    RequisicaoDescargaFormComponent.prototype.disabledPesoBru = function () {
        if (this.isOutrasDescarga) {
            return true;
        }
        var isDisabled = this.funcoesService.isDetail(this.actionForm);
        if (!isDisabled) {
            isDisabled = this.data.requisicaoDescargaId > 0 && this.data.pesoBru > 0;
        }
        if (!isDisabled) {
            isDisabled = this.service.configBal.pesagemAutomatica;
        }
        return isDisabled;
    };
    RequisicaoDescargaFormComponent.prototype.disabledBtnPesoBru = function () {
        if (this.isOutrasDescarga) {
            return true;
        }
        var isDisabled = this.funcoesService.isDetail(this.actionForm);
        if (!isDisabled) {
            isDisabled = this.data.requisicaoDescargaId > 0 && this.data.pesoBru > 0;
        }
        return isDisabled;
    };
    RequisicaoDescargaFormComponent.prototype.concluido = function () {
        var idDisabled = !this.funcoesService.isDetail(this.actionForm);
        if (!idDisabled) {
            if (this.funcoesService.isNotUndefinedOrNull(this.data["checkList"])) {
                if (this.funcoesService.isNotUndefinedOrNull(this.data["checkList"]["entradaVeiculo"])) {
                    return this.data.checkList.entradaVeiculo.situacaoVeiculoId !== 1090;
                }
            }
        }
        return idDisabled;
    };
    RequisicaoDescargaFormComponent.prototype.ag2Pesagem = function () {
        var idDisabled = !this.funcoesService.isDetail(this.actionForm);
        if (!idDisabled) {
            if (this.funcoesService.isNotUndefinedOrNull(this.data["checkList"])) {
                if (this.funcoesService.isNotUndefinedOrNull(this.data["checkList"]["entradaVeiculo"])) {
                    return this.data.checkList.entradaVeiculo.situacaoVeiculoId !== 1015;
                }
            }
        }
        return idDisabled;
    };
    RequisicaoDescargaFormComponent.prototype.disabledEdit = function () {
        var idDisabled = false;
        if (this.funcoesService.isNotUndefinedOrNull(this.data["checkList"])) {
            if (this.funcoesService.isNotUndefinedOrNull(this.data["checkList"]["entradaVeiculo"])) {
                return this.data.checkList.entradaVeiculo.situacaoVeiculoId !== 1013;
            }
        }
        return idDisabled;
    };
    RequisicaoDescargaFormComponent.prototype.calcDados20 = function () {
        var _this = this;
        if (!this.controle20)
            return;
        var filtroCalculo = new _cadastro_densidade_tanque_densidade_tanque_model__WEBPACK_IMPORTED_MODULE_17__["CalculoDensidadeFilter"]();
        filtroCalculo.materialId = this.data.materialId;
        filtroCalculo.densidadeAmostra = this.data.densidadeAmostra;
        filtroCalculo.temperaturaAmostra = this.data.temperaturaAmostra;
        filtroCalculo.temperaturaCarroTanque = this.data.temperaturaCarroTanque;
        filtroCalculo.volume = this.data.volume;
        filtroCalculo.mostraErro = 'S';
        this.densidadeTanqueService.calculaDados20(filtroCalculo).subscribe(function (resp) {
            if (_this.funcoesService.isNotUndefinedOrNull(resp.msgErro)) {
                _this.message.error("titles.densidadeTanque", resp.msgErro);
            }
            _this.data.densidadeCorrigida = resp.densidadeCorrigida;
            _this.data.fatorCorrecao = resp.fatorCorrecao;
            _this.data.volumeCorrigido = resp.volumeCorrigido;
            _this.data.pesoCorrigido = resp.pesoCorrigido;
        });
    };
    RequisicaoDescargaFormComponent.prototype.cancelarTmp = function () {
        this.back();
    };
    RequisicaoDescargaFormComponent.ctorParameters = function () { return [
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_3__["Router"] },
        { type: _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_16__["MessageService"] },
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_3__["ActivatedRoute"] },
        { type: _requisicao_descarga_service__WEBPACK_IMPORTED_MODULE_32__["RequisicaoDescargaService"] },
        { type: _login_login_service__WEBPACK_IMPORTED_MODULE_27__["LoginService"] },
        { type: _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_15__["PermissoesUtilsService"] },
        { type: _shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_5__["ConfiguracaoFacade"] },
        { type: _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_12__["FuncoesService"] },
        { type: _cadastro_material_material_service__WEBPACK_IMPORTED_MODULE_22__["MaterialService"] },
        { type: _cadastro_motorista_motorista_service__WEBPACK_IMPORTED_MODULE_24__["MotoristaService"] },
        { type: _cadastro_destinatario_destinatario_service__WEBPACK_IMPORTED_MODULE_20__["DestinatarioService"] },
        { type: _cadastro_tanque_tanque_service__WEBPACK_IMPORTED_MODULE_26__["TanqueService"] },
        { type: app_pages_cadastro_lote_lote_service__WEBPACK_IMPORTED_MODULE_34__["LoteService"] },
        { type: _cadastro_densidade_tanque_densidade_tanque_service__WEBPACK_IMPORTED_MODULE_18__["DensidadeTanqueService"] }
    ]; };
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_2__["ViewChild"])(_shared_components_pesquisa_pesquisa_check_list_pesquisa_check_list_component__WEBPACK_IMPORTED_MODULE_7__["PesquisaChecklistComponent"], { static: false }),
        __metadata("design:type", _shared_components_pesquisa_pesquisa_check_list_pesquisa_check_list_component__WEBPACK_IMPORTED_MODULE_7__["PesquisaChecklistComponent"])
    ], RequisicaoDescargaFormComponent.prototype, "childPesquisaChecklistComponent", void 0);
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_2__["ViewChild"])(_shared_components_commons_corrige_placa_ocr_corrige_placa_ocr_component__WEBPACK_IMPORTED_MODULE_0__["CorrigePlacaOcrComponent"], { static: false }),
        __metadata("design:type", _shared_components_commons_corrige_placa_ocr_corrige_placa_ocr_component__WEBPACK_IMPORTED_MODULE_0__["CorrigePlacaOcrComponent"])
    ], RequisicaoDescargaFormComponent.prototype, "corrigePlacaOcr", void 0);
    RequisicaoDescargaFormComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_2__["Component"])({
            selector: "app-requisicao-descarga-form",
            template: __importDefault(__webpack_require__(/*! raw-loader!./requisicao-descarga-form.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-form/requisicao-descarga-form.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_2__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [_angular_router__WEBPACK_IMPORTED_MODULE_3__["Router"],
            _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_16__["MessageService"],
            _angular_router__WEBPACK_IMPORTED_MODULE_3__["ActivatedRoute"],
            _requisicao_descarga_service__WEBPACK_IMPORTED_MODULE_32__["RequisicaoDescargaService"],
            _login_login_service__WEBPACK_IMPORTED_MODULE_27__["LoginService"],
            _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_15__["PermissoesUtilsService"],
            _shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_5__["ConfiguracaoFacade"],
            _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_12__["FuncoesService"],
            _cadastro_material_material_service__WEBPACK_IMPORTED_MODULE_22__["MaterialService"],
            _cadastro_motorista_motorista_service__WEBPACK_IMPORTED_MODULE_24__["MotoristaService"],
            _cadastro_destinatario_destinatario_service__WEBPACK_IMPORTED_MODULE_20__["DestinatarioService"],
            _cadastro_tanque_tanque_service__WEBPACK_IMPORTED_MODULE_26__["TanqueService"],
            app_pages_cadastro_lote_lote_service__WEBPACK_IMPORTED_MODULE_34__["LoteService"],
            _cadastro_densidade_tanque_densidade_tanque_service__WEBPACK_IMPORTED_MODULE_18__["DensidadeTanqueService"]])
    ], RequisicaoDescargaFormComponent);
    return RequisicaoDescargaFormComponent;
}(_requisicao_descarga_permissoes__WEBPACK_IMPORTED_MODULE_31__["RequisicaoDescargaPermissoes"]));



/***/ }),

/***/ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-form/requisicao-descarga-form.validation.ts":
/*!*******************************************************************************************************************!*\
  !*** ./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-form/requisicao-descarga-form.validation.ts ***!
  \*******************************************************************************************************************/
/*! exports provided: RequisicaoDescargaFormValidation */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RequisicaoDescargaFormValidation", function() { return RequisicaoDescargaFormValidation; });
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};
var RequisicaoDescargaFormValidation = /** @class */ (function () {
    function RequisicaoDescargaFormValidation(message, configuracao, funcoes, service) {
        this.message = message;
        this.configuracao = configuracao;
        this.funcoes = funcoes;
        this.service = service;
    }
    RequisicaoDescargaFormValidation.prototype.getValidations = function (data) {
        var r = [];
        r.push(this.dtRequisicaoNaoPodeSerMaiorDataAtual({ "dtRequisicao": data.dtRequisicao }));
        r.push(this.dtRequisicaoNaoPodeSerMenorDataSeguro({ "dtRequisicao": data.dtRequisicao }));
        r.push(this.existemItensCadastrados({ "requisicaoDescargaItems": data.requisicaoDescargaItems }));
        return r.filter(function (v) { return v["isValid"] === false; });
    };
    RequisicaoDescargaFormValidation.prototype.existemItensCadastrados = function (params, showError) {
        if (showError === void 0) { showError = false; }
        var s = [];
        if (this.funcoes.isUndefinedOrNull(params.requisicaoDescargaItems) || params.requisicaoDescargaItems.length > 0) {
            s = params.requisicaoDescargaItems.filter(function (v) { return v["sitReg"] !== "E"; });
        }
        var r = { "isValid": true, "message": "" };
        if (this.funcoes.isUndefinedOrNull(params.requisicaoDescargaItems) || s.length === 0) {
            r.isValid = false;
            r.message = "messages.naoExistemItensCadastrados";
        }
        if (!r.isValid && showError) {
            this.message.warning("titles.requisicaoDescarga", r.message);
        }
        return r;
    };
    RequisicaoDescargaFormValidation.prototype.validaDtRequisicao = function (params) {
        this.dtRequisicaoNaoPodeSerMaiorDataAtual(params, true);
        this.dtRequisicaoNaoPodeSerMenorDataSeguro(params, true);
    };
    RequisicaoDescargaFormValidation.prototype.dtRequisicaoNaoPodeSerMaiorDataAtual = function (params, showError) {
        if (showError === void 0) { showError = false; }
        var r = { "isValid": true, "message": "" };
        if (params.dtRequisicao > (new Date)) {
            r.isValid = false;
            r.message = "messages.dtRequisicaoDeveSerMenorDataAtual";
        }
        if (!r.isValid && showError) {
            this.message.warning("titles.requisicaoDescarga", r.message);
        }
        return r;
    };
    RequisicaoDescargaFormValidation.prototype.dtRequisicaoNaoPodeSerMenorDataSeguro = function (params, showError) {
        if (showError === void 0) { showError = false; }
        var r = { "isValid": true, "message": "" };
        if (params.dtRequisicao < this.funcoes.dateTimeUtils.convertDateSqlToDate(this.service.configCtr.dtSeguro)) {
            r.isValid = false;
            r.message = "messages.dtRequisicaoDeveSerMaiorDataSeguro";
        }
        if (!r.isValid && showError) {
            this.message.warning("titles.requisicaoDescarga", r.message);
        }
        return r;
    };
    return RequisicaoDescargaFormValidation;
}());



/***/ }),

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

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RequisicaoDescargaIndexComponent", function() { return RequisicaoDescargaIndexComponent; });
/* 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 _requisicao_descarga_filter_requisicao_descarga_filter_model__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../requisicao-descarga-filter/requisicao-descarga-filter.model */ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-filter/requisicao-descarga-filter.model.ts");
/* harmony import */ var _requisicao_descarga_model__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../requisicao-descarga.model */ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga.model.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_components_pesquisa_pesquisa_check_list_pesquisa_check_list_model__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../../../../shared/components/pesquisa/pesquisa-check-list/pesquisa-check-list.model */ "./src/app/shared/components/pesquisa/pesquisa-check-list/pesquisa-check-list.model.ts");
/* harmony import */ var _shared_services_datatables_datatables_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./../../../../shared/services/datatables/datatables.service */ "./src/app/shared/services/datatables/datatables.service.ts");
/* harmony import */ var _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_8__ = __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_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./../../../../shared/services/funcoes/boolean-utils/boolean-utils.static.service */ "./src/app/shared/services/funcoes/boolean-utils/boolean-utils.static.service.ts");
/* harmony import */ var _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_10__ = __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_11__ = __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_object_utils_object_utils_static_service__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./../../../../shared/services/funcoes/object-utils/object-utils.static.service */ "./src/app/shared/services/funcoes/object-utils/object-utils.static.service.ts");
/* harmony import */ var _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_13__ = __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_14__ = __webpack_require__(/*! ./../../../../shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var _login_login_service__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./../../../login/login.service */ "./src/app/pages/login/login.service.ts");
/* harmony import */ var _veiculo_entrada_veiculo_entrada_veiculo_service__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./../../../veiculo/entrada-veiculo/entrada-veiculo.service */ "./src/app/pages/veiculo/entrada-veiculo/entrada-veiculo.service.ts");
/* harmony import */ var _requisicao_descarga_constants__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./../requisicao-descarga.constants */ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga.constants.ts");
/* harmony import */ var _requisicao_descarga_service__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./../requisicao-descarga.service */ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga.service.ts");
/* harmony import */ var _requisicao_descarga_index_model__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./requisicao-descarga-index.model */ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-index/requisicao-descarga-index.model.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 RequisicaoDescargaIndexComponent = /** @class */ (function (_super) {
    __extends(RequisicaoDescargaIndexComponent, _super);
    function RequisicaoDescargaIndexComponent(router, service, configuracao, datatables, message, permissoesUtils, funcoes, loginService, entradaVeiculoService) {
        var _this = _super.call(this, new _requisicao_descarga_constants__WEBPACK_IMPORTED_MODULE_17__["RequisicaoDescargaConstants"](), funcoes) || this;
        _this.router = router;
        _this.service = service;
        _this.configuracao = configuracao;
        _this.datatables = datatables;
        _this.message = message;
        _this.permissoesUtils = permissoesUtils;
        _this.funcoes = funcoes;
        _this.loginService = loginService;
        _this.entradaVeiculoService = entradaVeiculoService;
        _this.requisicaoDescarga = new _requisicao_descarga_index_model__WEBPACK_IMPORTED_MODULE_19__["RequisicaoDescargaIndex"]();
        _this.filtroReport = new _requisicao_descarga_model__WEBPACK_IMPORTED_MODULE_4__["RequisicaoDescargaFilterReport"]();
        _this.constantes = new _requisicao_descarga_constants__WEBPACK_IMPORTED_MODULE_17__["RequisicaoDescargaConstants"]();
        _this.target = _this.funcoesService.getTargetLocation();
        _this.loadConfig = function () {
            if (!_this.configuracao.isLoadConfig())
                return;
            _this.service.configUni.solMotCancEVePesagem = _this.configuracao.boolean("UNI", "SolMotCancEVePesagem");
            _this.service.configUni.validaMobile2Pes = _this.configuracao.boolean("UNI", "validaMobile2Pes");
            _this.service.configUni.nAltDepositoLibVeic = _this.configuracao.boolean("CTV", "NAltDepositoLibVeic");
            _this.service.configWeb.cWebModTicketD = _this.configuracao.lerConfig("WEB", "CWebModTicketD");
            _this.service.configWeb.cWebModRequisicaoD = _this.configuracao.lerConfig("WEB", "CWebModRequisicaoD");
            _this.service.configWeb.prefixoRelEspecifico = _this.configuracao.lerConfig("WEB", "PrefixoRelEspecifico");
            _this.service.configWeb.obrigaPlataformaRodo = _this.configuracao.lerConfig("WEB", "ObrigaPlataformaRodo");
        };
        _this.alterarDatas = function () {
            _this.permissoesUtils.validRotina(_this.constantes.sisFormularioId, 9, function () { return _this.router.navigate([_this.target + "/balanca/requisicaoDescarga", "alterarDatas", _this.requisicaoDescarga.requisicaoDescargaId]); }, function () { });
        };
        _this.alterarDados = function () {
            _this.permissoesUtils.validRotina(_this.constantes.sisFormularioId, 10, function () { _this.router.navigate([_this.target + "/balanca/requisicaoDescarga", "alterarDados", _this.requisicaoDescarga.requisicaoDescargaId]); }, function () { });
        };
        _this.cancelPesagem = function () {
            if (!_this.itemSelecionado())
                return;
            _this.permissoesUtils.verificaRotina(_this.constantes.sisFormularioId, 7, function () { return __awaiter(_this, void 0, void 0, function () {
                var _this = this;
                return __generator(this, function (_a) {
                    this.message.confirm("titles.requisicaoDescarga", "messages.confirmaCancelamentoPesagem", null, function () { return __awaiter(_this, void 0, void 0, function () {
                        var validationResult, mensagens;
                        var _this = this;
                        return __generator(this, function (_a) {
                            switch (_a.label) {
                                case 0: return [4 /*yield*/, this.service.podeCancelar({ requisicaoDescargaId: this.requisicaoDescarga.requisicaoDescargaId }).toPromise()];
                                case 1:
                                    validationResult = _a.sent();
                                    if (!validationResult.isValid) {
                                        mensagens = this.message.validationResult(validationResult);
                                        mensagens.forEach(function (m) { return _this.message.warning("titles.requisicaoDescarga", m); });
                                        return [2 /*return*/];
                                    }
                                    if (this.service.configUni.solMotCancEVePesagem) {
                                        jQuery("#descricao-motivo-dialog").modal("show");
                                    }
                                    else {
                                        this.executeCancelPesagem();
                                        this.refresh();
                                    }
                                    return [2 /*return*/];
                            }
                        });
                    }); });
                    return [2 /*return*/];
                });
            }); });
        };
        router.events.subscribe(function (event) {
            var params = _this.funcoes.formParams.getParams(router, event);
            if (params)
                _this.actionForm = params.action;
        });
        return _this;
    }
    RequisicaoDescargaIndexComponent.prototype.ngOnInit = function () {
        var _this = this;
        this.init();
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 4, function () { return __awaiter(_this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                if (!this.loginService.isTokenExpired()) {
                    if (this.funcoes.abrirFiltro) {
                        this.service.filtro = new _requisicao_descarga_filter_requisicao_descarga_filter_model__WEBPACK_IMPORTED_MODULE_3__["RequisicaoDescargaFilter"]();
                        this.funcoes.openModal("rd-filter-dialog");
                    }
                    else {
                        this.refresh();
                    }
                }
                return [2 /*return*/];
            });
        }); }, function () { return _this.permissoesUtils.back(); });
    };
    RequisicaoDescargaIndexComponent.prototype.init = function () {
        var _this = this;
        this.configuracao.getConfig(this.constantes.listaParam, this.loadConfig);
        this.filtroCheckList = new _shared_components_pesquisa_pesquisa_check_list_pesquisa_check_list_model__WEBPACK_IMPORTED_MODULE_6__["SelecionaCheckListFiltro"]();
        this.filtroCheckList.tipoOper = 'D';
        this.filtroCheckList.tipoTransporteId = 'R';
        this.filtroCheckList.descargaDireta = 'N';
        this.filtroCheckList.pesagemTerceiros = 'N';
        this.filtroCheckList.codSitVeiculo = 1013;
        _super.prototype.addFuncoes.call(this, [
            { action: 'cancelPesagem', func: function () { return _this.cancelPesagem; } },
            { action: 'alterarDatas', func: function () { return _this.alterarDatas; } },
            { action: 'alterarDados', func: function () { return _this.alterarDados; } },
        ]);
    };
    RequisicaoDescargaIndexComponent.prototype.executaFiltrar = function (event) {
        if (event)
            this.refresh();
    };
    RequisicaoDescargaIndexComponent.prototype.filtrar = function () {
        jQuery("#rd-filter-dialog").modal("show");
    };
    RequisicaoDescargaIndexComponent.prototype.refresh = function () {
        return __awaiter(this, void 0, void 0, function () {
            var _a, columns;
            var _this = this;
            return __generator(this, function (_b) {
                switch (_b.label) {
                    case 0:
                        _a = this;
                        return [4 /*yield*/, this.service._get(this.service.filtro).toPromise()];
                    case 1:
                        _a.dados = _b.sent();
                        columns = [
                            this.datatables.getDataString("requisicaoDescargaId", "registro"),
                            this.datatables.getDataString("cadastroPlacaIdCavalo", "placaCavalo"),
                            this.datatables.getDataDateTime("dtRequisicao", "emissao", "DD/MM/YYYY HH:mm:ss", "15%"),
                            this.datatables.getDataString("fantasiaMaterial", "produto"),
                            this.datatables.getDataString("fantasiaTransportadora", "transportadora"),
                            this.datatables.getDataDateTime("dtTriagem", "dtTriagem", "DD/MM/YYYY HH:mm:ss", "15%"),
                            this.datatables.getDataString("situacao", "situacao"),
                        ];
                        this.datatables.toDataTable({ tableId: "dtRequisicaoDescarga", columns: columns, data: this.dados }, function (aData) {
                            _this.requisicaoDescarga = aData;
                        });
                        return [2 /*return*/];
                }
            });
        });
    };
    RequisicaoDescargaIndexComponent.prototype.outConsulta = function (event) {
        if (event) {
            this.refresh();
        }
    };
    Object.defineProperty(RequisicaoDescargaIndexComponent.prototype, "isDesmembrado", {
        get: function () {
            if (!this.requisicaoDescarga)
                return false;
            return _shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_9__["BooleanUtilsStaticService"].toBoolean(this.requisicaoDescarga.flagDesmembrado);
        },
        enumerable: true,
        configurable: true
    });
    RequisicaoDescargaIndexComponent.prototype.print = function () {
        if (this.funcoes.isPositive(this.requisicaoDescarga.requisicaoDescargaId)) {
            this.filtroReport.requisicaoDescargaId = this.requisicaoDescarga.requisicaoDescargaId;
            jQuery("#modalPrint").modal("show");
        }
        else {
            this.message.warning("titles.requisicaoDescarga", "messages.selecioneUmRegistro");
            return;
        }
    };
    RequisicaoDescargaIndexComponent.prototype.create = function () {
        jQuery("#pesquisa-check-list-dialog").modal("show");
    };
    RequisicaoDescargaIndexComponent.prototype.createRequisicao = function (data) {
        return __awaiter(this, void 0, void 0, function () {
            var validationResult, mensagens;
            var _this = this;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.service.verifyRequisicaoDescargaWithCheckListId({ checkListId: data.codChecklist }).toPromise()];
                    case 1:
                        validationResult = _a.sent();
                        if (!validationResult.isValid) {
                            mensagens = this.message.validationResult(validationResult);
                            mensagens.forEach(function (m) { return _this.message.warning("titles.requisicaoDescarga", m, { requisicao: validationResult.message }); });
                            return [2 /*return*/];
                        }
                        this.router.navigate([this.target + "/balanca/requisicaoDescarga/create/", _shared_services_funcoes_object_utils_object_utils_static_service__WEBPACK_IMPORTED_MODULE_12__["ObjectUtilsStaticService"].objToB64({
                                codChecklist: data.codChecklist,
                                item: data.item,
                                regControle: data.regControle,
                                lote: data.lote
                            })]);
                        return [2 /*return*/];
                }
            });
        });
    };
    RequisicaoDescargaIndexComponent.prototype.itemSelecionado = function () {
        if (_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_11__["NumberUtilsStaticService"].isNotPositive(this.requisicaoDescarga.requisicaoDescargaId)) {
            this.message.warning("titles.requisicaoDescarga", "messages.selecioneUmRegistro");
            return false;
        }
        return true;
    };
    RequisicaoDescargaIndexComponent.prototype.edit = function () {
        return __awaiter(this, void 0, void 0, function () {
            var validationResult, mensagens;
            var _this = this;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        if (!this.itemSelecionado())
                            return [2 /*return*/];
                        return [4 /*yield*/, this.service.verificaAlteracao({ requisicaoDescargaId: this.requisicaoDescarga.requisicaoDescargaId }).toPromise()];
                    case 1:
                        validationResult = _a.sent();
                        if (!validationResult.isValid) {
                            mensagens = this.message.validationResult(validationResult);
                            mensagens.forEach(function (m) { return _this.message.warning("titles.requisicaoDescarga", m); });
                            return [2 /*return*/];
                        }
                        this.router.navigate([this.target + "/balanca/requisicaoDescarga", "edit", this.requisicaoDescarga.requisicaoDescargaId]);
                        return [2 /*return*/];
                }
            });
        });
    };
    RequisicaoDescargaIndexComponent.prototype.detail = function () {
        if (!this.itemSelecionado())
            return;
        this.router.navigate([this.target + "/balanca/requisicaoDescarga", "detail", this.requisicaoDescarga.requisicaoDescargaId]);
    };
    RequisicaoDescargaIndexComponent.prototype.remove = function () {
        var _this = this;
        if (!this.itemSelecionado())
            return;
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 3, function () {
            _this.message.removeConfirm(function () {
                _this.service.corpWebBalRequisicaoDescargaExclui({ requisicaoDescargaId: _this.requisicaoDescarga.requisicaoDescargaId, }).subscribe(function (validationResult) {
                    if (!validationResult.isValid) {
                        var mensagens = _this.message.validationResult(validationResult);
                        mensagens.forEach(function (m) { return _this.message.warning("titles.requisicaoDescarga", m); });
                    }
                    else {
                        _this.datatables.remove("dtRequisicaoDescarga");
                    }
                });
            });
        });
    };
    RequisicaoDescargaIndexComponent.prototype.getPhotoOCR = function () {
        if (!this.itemSelecionado())
            return;
        _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_8__["EventEmitterService"].get('emiFotoOcr').emit({
            registro: this.requisicaoDescarga.requisicaoDescargaId,
            tipo: 'R'
        });
    };
    RequisicaoDescargaIndexComponent.prototype.permissoes = function () {
        var _this = this;
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 15, function () {
            _super.prototype.permissoes.call(_this, _this.constantes);
        });
    };
    RequisicaoDescargaIndexComponent.prototype.properties = function () {
        var _this = this;
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 5, function () {
            _super.prototype.properties.call(_this, _this.requisicaoDescarga);
        });
    };
    RequisicaoDescargaIndexComponent.prototype.liberacaoEmLote = function () {
        this.funcoes.openWindow('controle/liberacaoLote');
    };
    RequisicaoDescargaIndexComponent.prototype.segundaPesagem = function () {
        return __awaiter(this, void 0, void 0, function () {
            var validaMobile;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        if (!this.itemSelecionado())
                            return [2 /*return*/];
                        if (!this.service.configUni.validaMobile2Pes) return [3 /*break*/, 2];
                        return [4 /*yield*/, this.validaMobile()];
                    case 1:
                        validaMobile = _a.sent();
                        if (!validaMobile)
                            return [2 /*return*/];
                        _a.label = 2;
                    case 2:
                        this.router.navigate([this.target + "/balanca/requisicaoDescarga", "segundaPesagem", this.requisicaoDescarga.requisicaoDescargaId]);
                        return [2 /*return*/];
                }
            });
        });
    };
    RequisicaoDescargaIndexComponent.prototype.validaSegundaPesagem = function () {
        return this.requisicaoDescarga.sitReg === 'C';
    };
    RequisicaoDescargaIndexComponent.prototype.executeCancelPesagem = function (motivo) {
        if (motivo === void 0) { motivo = ""; }
        return __awaiter(this, void 0, void 0, function () {
            var validationResult, mensagens;
            var _this = this;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.service.cancelaPesagem({ requisicaoDescargaId: this.requisicaoDescarga.requisicaoDescargaId, motivo: motivo }).toPromise()];
                    case 1:
                        validationResult = _a.sent();
                        if (this.funcoes.isNotUndefinedOrNull(validationResult)) {
                            if (!validationResult.isValid) {
                                mensagens = this.message.validationResult(validationResult);
                                mensagens.forEach(function (m) { return _this.message.warning("titles.requisicaoDescarga", m); });
                                return [2 /*return*/];
                            }
                            else
                                this.refresh();
                        }
                        return [2 /*return*/];
                }
            });
        });
    };
    RequisicaoDescargaIndexComponent.prototype.outMotivo = function (motivo) {
        if (!!motivo) {
            this.message.warning("titles.requisicaoDescarga", "messages.informeMotivoCancelamento");
            return;
        }
        this.executeCancelPesagem();
    };
    RequisicaoDescargaIndexComponent.prototype.validaMobile = function () {
        return __awaiter(this, void 0, void 0, function () {
            var validation, mensagens;
            var _this = this;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.service.stoVrfValidacaoMobile({ tipo: 'RD', autorizacao: this.requisicaoDescarga.requisicaoDescargaId }).toPromise()];
                    case 1:
                        validation = _a.sent();
                        if (!validation.isValid) {
                            mensagens = this.message.validationResult(validation);
                            mensagens.forEach(function (m) { return _this.message.warning("titles.requisicaoDescarga", m); });
                            return [2 /*return*/, false];
                        }
                        return [2 /*return*/, true];
                }
            });
        });
    };
    RequisicaoDescargaIndexComponent.prototype.confirmaImpressao = function (tipoImpressao) {
        switch (tipoImpressao) {
            case "autorizacao":
                this.printAutorizacao();
                break;
            case "ticket":
                this.printTicket();
                break;
            case "boletimOcorrencia":
                this.printBoletim();
                break;
            default:
                break;
        }
    };
    RequisicaoDescargaIndexComponent.prototype.printAutorizacao = function () {
        // NAO PODE INCLUIR CHAMADAS ESPECIFICAS
        if (this.funcoes.getValue(this.requisicaoDescarga.requisicaoDescargaId, "I") > 0) {
            var modRel = this.service.configWeb.cWebModRequisicaoD;
            if (!modRel) {
                this.message.warning("titles.requisicaoDescarga", "messages.modRelNaoConfigurado");
                return;
            }
            var reportTitulo = { titulo: 'Requisição de Descarga', 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.configWeb.prefixoRelEspecifico) && modRel.indexOf(this.service.configWeb.prefixoRelEspecifico) == 0) {
                this.funcoes.reportInvoc.invocaRelatorioEspecificos(modRel, reportTitulo, {
                    filialId: parseFloat(this.loginService.getLogin().filialId),
                    autorizacao: this.requisicaoDescarga.requisicaoDescargaId,
                    tipoOCD: 'R',
                });
            }
            else {
                this.funcoes.reportInvoc.invocaRelatorio(modRel, reportTitulo, {
                    filialId: parseFloat(this.loginService.getLogin().filialId),
                    autorizacao: this.requisicaoDescarga.requisicaoDescargaId,
                    tipoOCD: 'R',
                });
            }
        }
        else {
            this.message.warning("titles.requisicaoDescarga", "messages.selecioneUmRegistro");
        }
    };
    RequisicaoDescargaIndexComponent.prototype.printTicket = function () {
        // NAO PODE INCLUIR CHAMADAS ESPECIFICAS
        if (this.funcoes.getValue(this.requisicaoDescarga.requisicaoDescargaId, "I") > 0) {
            var modRel = this.service.configWeb.cWebModTicketD;
            if (!modRel) {
                this.message.warning("titles.requisicaoDescarga", "messages.modRelNaoConfigurado");
                return;
            }
            var reportTitulo = { titulo: 'Ticket de Descarga', 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.configWeb.prefixoRelEspecifico) && modRel.indexOf(this.service.configWeb.prefixoRelEspecifico) == 0) {
                this.funcoes.reportInvoc.invocaRelatorioEspecificos(modRel, reportTitulo, {
                    filialId: this.loginService.getLogin().filialId,
                    autorizacao: this.requisicaoDescarga.requisicaoDescargaId,
                    tipoOCD: "R"
                });
            }
            else {
                this.funcoes.reportInvoc.invocaRelatorio(modRel, reportTitulo, {
                    filialId: this.loginService.getLogin().filialId,
                    autorizacao: this.requisicaoDescarga.requisicaoDescargaId,
                    tipoOCD: "R"
                });
            }
        }
        else {
            this.message.warning("titles.requisicaoDescarga", "messages.selecioneUmRegistro");
        }
    };
    RequisicaoDescargaIndexComponent.prototype.printBoletim = function () {
        if (this.funcoes.getValue(this.requisicaoDescarga.requisicaoDescargaId, "I") > 0) {
            var modRel = 'BAL0011';
            if (!modRel) {
                this.message.warning("titles.requisicaoDescarga", "messages.modRelNaoConfigurado");
                return;
            }
            var reportTitulo = { titulo: 'Boletim Ocorrência', subTitulo: '' };
            this.funcoes.reportInvoc.invocaRelatorio(modRel, reportTitulo, {
                filialId: this.loginService.getLogin().filialId,
                autorizacao: this.requisicaoDescarga.requisicaoDescargaId,
                tipo: 2
            });
        }
        else {
            this.message.warning("titles.boletimOcorrencia", "messages.selecioneUmRegistro");
        }
    };
    RequisicaoDescargaIndexComponent.ctorParameters = function () { return [
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"] },
        { type: _requisicao_descarga_service__WEBPACK_IMPORTED_MODULE_18__["RequisicaoDescargaService"] },
        { type: _shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_2__["ConfiguracaoFacade"] },
        { type: _shared_services_datatables_datatables_service__WEBPACK_IMPORTED_MODULE_7__["DatatablesService"] },
        { type: _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_14__["MessageService"] },
        { type: _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_13__["PermissoesUtilsService"] },
        { type: _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_10__["FuncoesService"] },
        { type: _login_login_service__WEBPACK_IMPORTED_MODULE_15__["LoginService"] },
        { type: _veiculo_entrada_veiculo_entrada_veiculo_service__WEBPACK_IMPORTED_MODULE_16__["EntradaVeiculoService"] }
    ]; };
    RequisicaoDescargaIndexComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
            selector: "app-requisicao-descarga-index",
            template: __importDefault(__webpack_require__(/*! raw-loader!./requisicao-descarga-index.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-index/requisicao-descarga-index.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [_angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"],
            _requisicao_descarga_service__WEBPACK_IMPORTED_MODULE_18__["RequisicaoDescargaService"],
            _shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_2__["ConfiguracaoFacade"],
            _shared_services_datatables_datatables_service__WEBPACK_IMPORTED_MODULE_7__["DatatablesService"],
            _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_14__["MessageService"],
            _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_13__["PermissoesUtilsService"],
            _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_10__["FuncoesService"],
            _login_login_service__WEBPACK_IMPORTED_MODULE_15__["LoginService"],
            _veiculo_entrada_veiculo_entrada_veiculo_service__WEBPACK_IMPORTED_MODULE_16__["EntradaVeiculoService"]])
    ], RequisicaoDescargaIndexComponent);
    return RequisicaoDescargaIndexComponent;
}(_shared_components_corporate_base_base_permissoes__WEBPACK_IMPORTED_MODULE_5__["BasePermissoes"]));



/***/ }),

/***/ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-index/requisicao-descarga-index.model.ts":
/*!****************************************************************************************************************!*\
  !*** ./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-index/requisicao-descarga-index.model.ts ***!
  \****************************************************************************************************************/
/*! exports provided: RequisicaoDescargaIndex */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RequisicaoDescargaIndex", function() { return RequisicaoDescargaIndex; });
/* harmony import */ var _shared_services_base_base_model__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../../../../shared/services/base/base.model */ "./src/app/shared/services/base/base.model.ts");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};

var RequisicaoDescargaIndex = /** @class */ (function (_super) {
    __extends(RequisicaoDescargaIndex, _super);
    function RequisicaoDescargaIndex() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    return RequisicaoDescargaIndex;
}(_shared_services_base_base_model__WEBPACK_IMPORTED_MODULE_0__["BaseModel"]));



/***/ }),

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

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RequisicaoDescargaItemComponent", function() { return RequisicaoDescargaItemComponent; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var app_pages_cadastro_tanque_tanque_model__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! app/pages/cadastro/tanque/tanque.model */ "./src/app/pages/cadastro/tanque/tanque.model.ts");
/* harmony import */ var app_pages_cadastro_tipo_documento_transp_tipo_documento_transp_model__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! app/pages/cadastro/tipo-documento-transp/tipo-documento-transp.model */ "./src/app/pages/cadastro/tipo-documento-transp/tipo-documento-transp.model.ts");
/* harmony import */ var app_pages_cadastro_tipo_documento_transp_tipo_documento_transp_service__WEBPACK_IMPORTED_MODULE_3__ = __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_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! app/shared/services/funcoes/boolean-utils/boolean-utils.static.service */ "./src/app/shared/services/funcoes/boolean-utils/boolean-utils.static.service.ts");
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/* harmony import */ var _shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../../shared/services/funcoes/configuracao/configuracao.facade */ "./src/app/shared/services/funcoes/configuracao/configuracao.facade.ts");
/* harmony import */ var _config_enumerables__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./../../../../config/enumerables */ "./src/app/config/enumerables.ts");
/* harmony import */ var _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_8__ = __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_9__ = __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_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 _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./../../../../shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var _cadastro_lote_lote_model__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./../../../cadastro/lote/lote.model */ "./src/app/pages/cadastro/lote/lote.model.ts");
/* harmony import */ var _cadastro_lote_lote_service__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./../../../cadastro/lote/lote.service */ "./src/app/pages/cadastro/lote/lote.service.ts");
/* harmony import */ var _cadastro_tanque_tanque_service__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./../../../cadastro/tanque/tanque.service */ "./src/app/pages/cadastro/tanque/tanque.service.ts");
/* harmony import */ var _login_login_service__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./../../../login/login.service */ "./src/app/pages/login/login.service.ts");
/* harmony import */ var _requisicao_descarga_constants__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./../requisicao-descarga.constants */ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga.constants.ts");
/* harmony import */ var _requisicao_descarga_model__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./../requisicao-descarga.model */ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga.model.ts");
/* harmony import */ var _requisicao_descarga_service__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./../requisicao-descarga.service */ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga.service.ts");
/* harmony import */ var _requisicao_descarga_item_model__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./requisicao-descarga-item.model */ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-item/requisicao-descarga-item.model.ts");
/* harmony import */ var _requisicao_descarga_item_validation__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./requisicao-descarga-item.validation */ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-item/requisicao-descarga-item.validation.ts");
/* harmony import */ var app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! app/shared/services/funcoes/number-utils/number-utils.static.service */ "./src/app/shared/services/funcoes/number-utils/number-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 RequisicaoDescargaItemComponent = /** @class */ (function () {
    function RequisicaoDescargaItemComponent(funcoesService, messageService, loteService, loginService, service, permissoesUtils, configuracao, tanqueService, tipoDocumentoTranspService) {
        var _this = this;
        this.funcoesService = funcoesService;
        this.messageService = messageService;
        this.loteService = loteService;
        this.loginService = loginService;
        this.service = service;
        this.permissoesUtils = permissoesUtils;
        this.configuracao = configuracao;
        this.tanqueService = tanqueService;
        this.tipoDocumentoTranspService = tipoDocumentoTranspService;
        this.dataResult = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
        this.selectedItem = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
        this.data = new _requisicao_descarga_item_model__WEBPACK_IMPORTED_MODULE_19__["RequisicaoDescargaItem"]();
        this.dataAux = new _requisicao_descarga_item_model__WEBPACK_IMPORTED_MODULE_19__["RequisicaoDescargaItem"]();
        this.constants = new _requisicao_descarga_constants__WEBPACK_IMPORTED_MODULE_16__["RequisicaoDescargaConstants"]();
        this.showAdd = false;
        this.actionForm = 0;
        this.hasDados = false;
        this.localOperacaoId = 0;
        this.mensagens = [];
        this.lbUnidade = "";
        this.isDisabledQuantid = false;
        this.obrigaPlataformaRodo = false;
        this.dataItemValida = new _requisicao_descarga_item_model__WEBPACK_IMPORTED_MODULE_19__["RequisicaoDesgargaItemValida"]();
        this.constantes = new _requisicao_descarga_constants__WEBPACK_IMPORTED_MODULE_16__["RequisicaoDescargaConstants"]();
        this.loadConfig = function () {
            if (_this.configuracao.isLoadConfig()) {
                _this.service.configWeb.obrigaPlataformaRodo = _this.configuracao.boolean("WEB", "ObrigaPlataformaRodo");
            }
            _this.obrigaPlataformaRodo = _this.service.configWeb.obrigaPlataformaRodo;
        };
    }
    RequisicaoDescargaItemComponent.prototype.ngOnInit = function () {
        this.configuracao.getConfig(this.constantes.listaParam, this.loadConfig);
        this._index = 0;
        this.validation = new _requisicao_descarga_item_validation__WEBPACK_IMPORTED_MODULE_20__["RequisicaoDescargaItemValidation"](this.messageService, this.configuracao, this.funcoesService);
    };
    RequisicaoDescargaItemComponent.prototype.create = function () {
        this.showAdd = true;
        this.actionForm = _config_enumerables__WEBPACK_IMPORTED_MODULE_7__["ActionForm"].create;
        this.data = new _requisicao_descarga_item_model__WEBPACK_IMPORTED_MODULE_19__["RequisicaoDescargaItem"]();
    };
    RequisicaoDescargaItemComponent.prototype.edit = function () {
        this.showAdd = true;
        this.actionForm = _config_enumerables__WEBPACK_IMPORTED_MODULE_7__["ActionForm"].edit;
        this.data = this.dataAux;
        this.trataData();
    };
    RequisicaoDescargaItemComponent.prototype.detail = function () {
        this.showAdd = true;
        this.actionForm = _config_enumerables__WEBPACK_IMPORTED_MODULE_7__["ActionForm"].detail;
        this.data = this.dataAux;
        this.trataData();
    };
    RequisicaoDescargaItemComponent.prototype.trataData = function () {
        var _this = this;
        this.data.lote = new _cadastro_lote_lote_model__WEBPACK_IMPORTED_MODULE_12__["Lote"]();
        this.requisicaoDescarga.tanque = new app_pages_cadastro_tanque_tanque_model__WEBPACK_IMPORTED_MODULE_1__["Tanque"]();
        this.data.tipoDocumentoTransp = new app_pages_cadastro_tipo_documento_transp_tipo_documento_transp_model__WEBPACK_IMPORTED_MODULE_2__["TipoDocumentoTransp"]();
        Object(rxjs__WEBPACK_IMPORTED_MODULE_5__["forkJoin"])([
            this.loteService.getByLoteId(this.data.loteId),
            this.tanqueService.getById(btoa(this.requisicaoDescarga.tanqueId)),
            this.tipoDocumentoTranspService.getById(this.data.tipoDocumentoTranspId),
        ]).subscribe(function (resp) {
            if (resp[0])
                !!resp[0] ? _this.data.lote = resp[0] : new _cadastro_lote_lote_model__WEBPACK_IMPORTED_MODULE_12__["Lote"]();
            if (resp[1])
                !!resp[1] ? _this.requisicaoDescarga.tanque = resp[1] : new app_pages_cadastro_tanque_tanque_model__WEBPACK_IMPORTED_MODULE_1__["Tanque"]();
            if (resp[2])
                !!resp[2] ? _this.data.tipoDocumentoTransp = resp[2] : new app_pages_cadastro_tipo_documento_transp_tipo_documento_transp_model__WEBPACK_IMPORTED_MODULE_2__["TipoDocumentoTransp"]();
            _this.isDisabledQuantid = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_4__["BooleanUtilsStaticService"].toBoolean(_this.requisicaoDescarga.tanque.movQuantid);
            _this.recalcularNota();
        });
    };
    RequisicaoDescargaItemComponent.prototype.back = function () {
        this.showAdd = false;
        this.actionForm = _config_enumerables__WEBPACK_IMPORTED_MODULE_7__["ActionForm"].index;
    };
    RequisicaoDescargaItemComponent.prototype.remove = function () {
        var _this = this;
        this.data = this.dataAux;
        this.permissoesUtils.verificaRotina(this.constants.sisFormularioId, 3, function () {
            _this.messageService.removeConfirm(function () {
                var obj = {
                    requisicaoDescargaId: _this.requisicaoDescarga.requisicaoDescargaId,
                    regTmp: _this.requisicaoDescarga.regTmp,
                    item: _this.data.requisicaoDescargaItemId,
                };
                if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_21__["NumberUtilsStaticService"].isPositive(_this.data.requisicaoDescargaItemId)) {
                    _this.service.corpWebBalRequisicaoDescargaItemExclui(obj).subscribe(function (validationResult) {
                        if (!validationResult.isValid) {
                            _this.mensagens = _this.messageService.validationResult(validationResult);
                            _this.mensagens.forEach(function (m) { return _this.messageService.warning("titles.requisicaoDescarga", m); });
                            return;
                        }
                        _this.removeItem();
                    });
                }
                else {
                    _this.removeItem();
                }
            });
        });
    };
    RequisicaoDescargaItemComponent.prototype.removeItem = function () {
        var _this = this;
        var i = this.dados.findIndex(function (x) { return x.sequencia === _this.data.sequencia; });
        this.data["sitReg"] = "E";
        this.dados[i] = this.data;
        this.dados.splice(i, 1);
    };
    RequisicaoDescargaItemComponent.prototype.onSubmit = function (form) {
        return __awaiter(this, void 0, void 0, function () {
            var result, validaItem, i;
            var _this = this;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_8__["EventEmitterService"].get("formError").emit(form);
                        if (form.invalid) {
                            this.funcoesService.backToTop();
                            return [2 /*return*/];
                        }
                        if (!!this.data.chaveNfe) {
                            if (!!(this.data)) {
                                if (this.funcoesService.stringUtils.isEmpty(this.data.docto)) {
                                    this.data.docto = +this.funcoesService.getNumeroNota(this.data.chaveNfe);
                                }
                                if (this.funcoesService.stringUtils.isEmpty(this.data.serieNotaId)) {
                                    this.data.serieNotaId = this.funcoesService.getSerieNota(this.data.chaveNfe);
                                }
                                result = this.funcoesService.validaChaveNFe(this.data.chaveNfe, this.data.emitente, this.data.docto, this.data.serieNotaId);
                                if (!result) {
                                    this.messageService.warning("titles.validacao", "messages.chaveNfeInvalida");
                                    return [2 /*return*/];
                                }
                            }
                        }
                        // Valida regras de negócio
                        this.dataItemValida.requisicao = this.requisicaoDescarga;
                        this.dataItemValida.item = this.data;
                        return [4 /*yield*/, this.service.validaItem(this.dataItemValida).toPromise()];
                    case 1:
                        validaItem = _a.sent();
                        this.mensagens = this.messageService.validationResult(validaItem.validationResult);
                        if (!validaItem.validationResult.isValid) {
                            _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_8__["EventEmitterService"].get("backError").emit(this.mensagens);
                            this.funcoesService.backToTop();
                            return [2 /*return*/];
                        }
                        if (this.data.sequencia && this.data.sequencia > 0) {
                            i = this.dados.findIndex(function (x) { return x.sequencia === _this.data.sequencia; });
                            this.dados[i] = this.data;
                        }
                        else {
                            this.data.sequencia = this.dados.length + 1;
                            this.dados.push(this.data);
                        }
                        this.data = new _requisicao_descarga_item_model__WEBPACK_IMPORTED_MODULE_19__["RequisicaoDescargaItem"]();
                        this.dataResult.emit(this.dados);
                        this.back();
                        return [2 /*return*/];
                }
            });
        });
    };
    RequisicaoDescargaItemComponent.prototype.trataDest = function (tipo, data) {
        switch (tipo) {
            case "clienteItem":
                this.data.cliente = data;
                break;
            case "emitenteItem":
                this.data.emitente = data;
                break;
        }
    };
    RequisicaoDescargaItemComponent.prototype.trataLote = function (event) {
        return __awaiter(this, void 0, void 0, function () {
            var ret;
            var _this = this;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        if (!this.funcoesService.stringUtils.isNotEmpty(event.lote)) return [3 /*break*/, 2];
                        this.data.lote = event.lote;
                        return [4 /*yield*/, this.service.corpWebStoContratoBloqueado({ osgId: this.data.lote.osgId }).toPromise()];
                    case 1:
                        ret = _a.sent();
                        if (this.funcoesService.isNotUndefinedOrNull(ret.validationResult)) {
                            this.mensagens = this.messageService.validationResult(ret.validationResult);
                            if (ret && !ret.validationResult.isValid) {
                                this.messageService.warning("titles.requisicaoDescarga", this.mensagens[0]);
                                return [2 /*return*/];
                            }
                        }
                        this.continua = ret.continua;
                        if (this.continua !== "S") {
                            this.messageService.warning("titles.requisicaoDescarga", ret.msg);
                            return [2 /*return*/];
                        }
                        this.data.serieNotaId = event.lote.serieNotaId;
                        this.data.lote.osgId = event.lote.osgId;
                        this.data.tipoDocumentoTranspId = event.lote.tipoDocumentoTranspIdEntrada;
                        this.tanqueService.getById(btoa(this.requisicaoDescarga.tanqueId)).subscribe(function (resp) {
                            if (resp.movQuantid === "S") {
                                _this.isDisabledQuantid = true;
                            }
                        });
                        this.trataData();
                        this.recalcularNota();
                        _a.label = 2;
                    case 2: return [2 /*return*/];
                }
            });
        });
    };
    Object.defineProperty(RequisicaoDescargaItemComponent.prototype, "saldoLoteOptions", {
        get: function () {
            return {
                destinatarioIdCliente: this.data.destinatarioIdCliente,
                destinatarioIdEmitente: this.data.destinatarioIdEmitente,
                materialId: this.requisicaoDescarga.materialId,
                sitLote: 'A',
                modo: 7,
                tipoSaldo: 7,
                dataMovimento: this.requisicaoDescarga.dtRequisicao,
                tipoAgrupa: 'L',
                geraArquivo: 'N'
            };
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(RequisicaoDescargaItemComponent.prototype, "disabledDocumentoTransp", {
        get: function () {
            if (this.funcoesService.isDetail(this.actionForm))
                return true;
            if (!!this.data.tipoDocumentoTransp && !app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_4__["BooleanUtilsStaticService"].toBoolean(this.data.tipoDocumentoTransp.flagSolDadosEnt))
                return true;
            return false;
        },
        enumerable: true,
        configurable: true
    });
    RequisicaoDescargaItemComponent.prototype.trataTipoDocumentoTransp = function (data) {
        this.data.tipoDocumentoTransp = data;
    };
    RequisicaoDescargaItemComponent.prototype.trataModeloNota = function (data) {
        this.data.modeloNota = data;
        if (this.data.modeloNotaId !== "55")
            this.data.chaveNfe = undefined;
    };
    Object.defineProperty(RequisicaoDescargaItemComponent.prototype, "disabledChaveNfe", {
        get: function () {
            if (this.funcoesService.isDetail(this.actionForm))
                return true;
            if (this.data.modeloNotaId !== "55")
                return true;
            return false;
        },
        enumerable: true,
        configurable: true
    });
    RequisicaoDescargaItemComponent.prototype.validaChaveNfe = function () {
        if (this.funcoesService.isNotUndefinedOrNull(this.data) && this.funcoesService.isNotUndefinedOrNull(this.data.chaveNfe)) {
            if (this.funcoesService.stringUtils.isEmpty(this.data.docto)) {
                this.data.docto = +this.funcoesService.getNumeroNota(this.data.chaveNfe);
            }
            if (this.funcoesService.stringUtils.isEmpty(this.data.serieNotaId)) {
                this.data.serieNotaId = this.funcoesService.getSerieNota(this.data.chaveNfe);
            }
            var result = this.funcoesService.validaChaveNFe(this.data.chaveNfe, this.data.emitente, this.data.docto, this.data.serieNotaId);
            if (!result) {
                this.messageService.warning("titles.validacao", "messages.chaveNfeInvalida");
            }
        }
    };
    Object.defineProperty(RequisicaoDescargaItemComponent.prototype, "requiredDadosNfe", {
        get: function () {
            return this.data.modeloNotaId === "55" && this.service.configUni.obrChaveNFeEnt;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(RequisicaoDescargaItemComponent.prototype, "disabledDoctoESerie", {
        get: function () {
            if (this.funcoesService.isDetail(this.actionForm))
                return true;
            if (!!this.data.tipoDocumentoTransp && app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_4__["BooleanUtilsStaticService"].toBoolean(this.data.tipoDocumentoTransp.flagSolDadosEnt))
                return true;
            if (app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_4__["BooleanUtilsStaticService"].toBoolean(this.data.nfeAuto))
                return true;
            if (this.service.configCtv.importaDANFE && this.data.lote.importaDanfe && app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_4__["BooleanUtilsStaticService"].toBoolean(this.data.modeloNotaId === "55"))
                return true;
            return false;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(RequisicaoDescargaItemComponent.prototype, "disabledQuantidDocEPesoDocEVlNota", {
        get: function () {
            if (this.funcoesService.isDetail(this.actionForm))
                return true;
            if (app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_4__["BooleanUtilsStaticService"].toBoolean(this.data.nfeAuto))
                return true;
            if (this.service.configCtv.importaDANFE && this.data.lote.importaDanfe && app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_4__["BooleanUtilsStaticService"].toBoolean(this.data.modeloNotaId === "55"))
                return true;
            return false;
        },
        enumerable: true,
        configurable: true
    });
    RequisicaoDescargaItemComponent.prototype.calcQuantidDoc = function () {
        if (this.data.lote) {
            if (this.data.lote.unidadeId === "KG") {
                this.data.pesoDoc = this.data.quantidDoc;
            }
            else if (this.data.lote.unidadeId === "LT" && this.data.lote.densidade > 0) {
                this.data.pesoDoc = this.data.quantidDoc * this.data.lote.densidade;
            }
            else if (this.data.lote.unidadeId === "CC" && this.data.lote.densidade > 0) {
                this.data.pesoDoc = this.data.quantidDoc / this.data.lote.densidade;
            }
            this.data.pesoDoc = this.funcoesService.numberUtils.round(this.data.pesoDoc, 0);
            this.calcVlNota();
        }
    };
    RequisicaoDescargaItemComponent.prototype.calcPesoDoc = function () {
        if (!!this.data.lote) {
            if (this.data.lote.unidadeId === "KG") {
                this.data.quantidDoc = this.data.pesoDoc;
            }
            else if (this.data.lote.unidadeId === "LT" && this.data.lote.densidade > 0) {
                this.data.quantidDoc = this.data.pesoDoc / this.data.lote.densidade;
            }
            else if (this.data.lote.unidadeId === "CC" && this.data.lote.densidade > 0) {
                this.data.quantidDoc = this.data.pesoDoc * this.data.lote.densidade;
            }
            this.data.quantidDoc = this.funcoesService.numberUtils.round(this.data.quantidDoc, 0);
            this.calcVlNota();
        }
    };
    RequisicaoDescargaItemComponent.prototype.calcVlNota = function () {
        if (this.service.configBal.calculaTotalNF) {
            if (this.data.lote.precoArmazenado > 0 && this.data.quantidDoc > 0) {
                this.data.vlNota = this.funcoesService.numberUtils.round(this.data.quantidDoc * this.data.lote.precoArmazenado, 2);
            }
        }
    };
    RequisicaoDescargaItemComponent.prototype.importaDanfe = function (e) {
        if (!!e) {
            if (!e.validationResult.isValid) {
                this.mensagens = this.messageService.validationResult(e.validationResult);
                _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_8__["EventEmitterService"].get("backError").emit(this.mensagens);
                this.funcoesService.backToTop();
                return;
            }
            this.data.nfeAuto = 'S';
            this.data.serieNotaId = e.serie;
            this.data.docto = e.numero;
            this.data.dtDocto = e.dtEmissao;
            this.data.quantidDoc = e.qtde;
        }
    };
    RequisicaoDescargaItemComponent.prototype.recalcularNota = function () {
        if (!this.data || !this.data.lote)
            return;
        if (this.data.quantidDoc > 0 && (!this.data.pesoDoc || this.data.pesoDoc <= 0)) {
            this.calcQuantidDoc();
            return;
        }
        if (this.data.pesoDoc > 0 && (!this.data.quantidDoc || this.data.quantidDoc <= 0)) {
            this.calcPesoDoc();
            return;
        }
        this.calcVlNota();
    };
    RequisicaoDescargaItemComponent.ctorParameters = function () { return [
        { type: _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_9__["FuncoesService"] },
        { type: _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_11__["MessageService"] },
        { type: _cadastro_lote_lote_service__WEBPACK_IMPORTED_MODULE_13__["LoteService"] },
        { type: _login_login_service__WEBPACK_IMPORTED_MODULE_15__["LoginService"] },
        { type: _requisicao_descarga_service__WEBPACK_IMPORTED_MODULE_18__["RequisicaoDescargaService"] },
        { type: _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_10__["PermissoesUtilsService"] },
        { type: _shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_6__["ConfiguracaoFacade"] },
        { type: _cadastro_tanque_tanque_service__WEBPACK_IMPORTED_MODULE_14__["TanqueService"] },
        { type: app_pages_cadastro_tipo_documento_transp_tipo_documento_transp_service__WEBPACK_IMPORTED_MODULE_3__["TipoDocumentoTranspService"] }
    ]; };
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"])(),
        __metadata("design:type", _requisicao_descarga_model__WEBPACK_IMPORTED_MODULE_17__["RequisicaoDescarga"])
    ], RequisicaoDescargaItemComponent.prototype, "requisicaoDescarga", void 0);
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"])(),
        __metadata("design:type", Array)
    ], RequisicaoDescargaItemComponent.prototype, "dados", void 0);
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"])(),
        __metadata("design:type", Object)
    ], RequisicaoDescargaItemComponent.prototype, "disabled", void 0);
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"])(),
        __metadata("design:type", Object)
    ], RequisicaoDescargaItemComponent.prototype, "disabledOutrasDescarga", void 0);
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"])(),
        __metadata("design:type", Object)
    ], RequisicaoDescargaItemComponent.prototype, "dataResult", void 0);
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"])(),
        __metadata("design:type", _requisicao_descarga_item_model__WEBPACK_IMPORTED_MODULE_19__["RequisicaoDescargaItem"])
    ], RequisicaoDescargaItemComponent.prototype, "item", void 0);
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"])(),
        __metadata("design:type", Object)
    ], RequisicaoDescargaItemComponent.prototype, "selectedItem", void 0);
    RequisicaoDescargaItemComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
            selector: "app-requisicao-descarga-item",
            template: __importDefault(__webpack_require__(/*! raw-loader!./requisicao-descarga-item.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-item/requisicao-descarga-item.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_9__["FuncoesService"],
            _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_11__["MessageService"],
            _cadastro_lote_lote_service__WEBPACK_IMPORTED_MODULE_13__["LoteService"],
            _login_login_service__WEBPACK_IMPORTED_MODULE_15__["LoginService"],
            _requisicao_descarga_service__WEBPACK_IMPORTED_MODULE_18__["RequisicaoDescargaService"],
            _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_10__["PermissoesUtilsService"],
            _shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_6__["ConfiguracaoFacade"],
            _cadastro_tanque_tanque_service__WEBPACK_IMPORTED_MODULE_14__["TanqueService"],
            app_pages_cadastro_tipo_documento_transp_tipo_documento_transp_service__WEBPACK_IMPORTED_MODULE_3__["TipoDocumentoTranspService"]])
    ], RequisicaoDescargaItemComponent);
    return RequisicaoDescargaItemComponent;
}());



/***/ }),

/***/ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-item/requisicao-descarga-item.model.ts":
/*!**************************************************************************************************************!*\
  !*** ./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-item/requisicao-descarga-item.model.ts ***!
  \**************************************************************************************************************/
/*! exports provided: RequisicaoDescargaItem, RequisicaoDesgargaItemValida */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RequisicaoDescargaItem", function() { return RequisicaoDescargaItem; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RequisicaoDesgargaItemValida", function() { return RequisicaoDesgargaItemValida; });
/* harmony import */ var _requisicao_descarga_model__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../requisicao-descarga.model */ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga.model.ts");
/* harmony import */ var _shared_services_base_base_model__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../../../../shared/services/base/base.model */ "./src/app/shared/services/base/base.model.ts");
/* harmony import */ var _cadastro_lote_lote_model__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../../../cadastro/lote/lote.model */ "./src/app/pages/cadastro/lote/lote.model.ts");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};



var RequisicaoDescargaItem = /** @class */ (function (_super) {
    __extends(RequisicaoDescargaItem, _super);
    function RequisicaoDescargaItem(requisicaoDescargaId) {
        if (requisicaoDescargaId === void 0) { requisicaoDescargaId = 0; }
        var _this = _super.call(this) || this;
        _this.lote = new _cadastro_lote_lote_model__WEBPACK_IMPORTED_MODULE_2__["Lote"]();
        _this.requisicaoDescargaId = requisicaoDescargaId;
        return _this;
    }
    return RequisicaoDescargaItem;
}(_shared_services_base_base_model__WEBPACK_IMPORTED_MODULE_1__["BaseModel"]));

var RequisicaoDesgargaItemValida = /** @class */ (function (_super) {
    __extends(RequisicaoDesgargaItemValida, _super);
    function RequisicaoDesgargaItemValida() {
        var _this = _super.call(this) || this;
        _this.requisicao = new _requisicao_descarga_model__WEBPACK_IMPORTED_MODULE_0__["RequisicaoDescarga"]();
        _this.item = new RequisicaoDescargaItem();
        return _this;
    }
    return RequisicaoDesgargaItemValida;
}(_shared_services_base_base_model__WEBPACK_IMPORTED_MODULE_1__["BaseModel"]));



/***/ }),

/***/ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-item/requisicao-descarga-item.validation.ts":
/*!*******************************************************************************************************************!*\
  !*** ./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-item/requisicao-descarga-item.validation.ts ***!
  \*******************************************************************************************************************/
/*! exports provided: RequisicaoDescargaItemValidation */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RequisicaoDescargaItemValidation", function() { return RequisicaoDescargaItemValidation; });
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! moment */ "./node_modules/moment/moment.js");
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_0__);
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};

var RequisicaoDescargaItemValidation = /** @class */ (function () {
    function RequisicaoDescargaItemValidation(message, configuracao, funcoes) {
        this.message = message;
        this.configuracao = configuracao;
        this.funcoes = funcoes;
    }
    RequisicaoDescargaItemValidation.prototype.getValidations = function (requisicaoDescarga, data) {
        var r = [];
        r.push(this.dtDoctoNaoPodeSerMaiorDtRequisicao({ "dtRequisicao": requisicaoDescarga.dtRequisicao, "dtDocto": data.dtDocto }));
        r.push(this.dtDoctoNPodeMaior180diasDtAtual({ "dtDocto": data.dtDocto }));
        r.push(this.vlNotaNaoPermitido({ "vlNota": data.vlNota, "quantidDoc": data.quantidDoc, "lote": data.lote }));
        return r.filter(function (v) { return v["isValid"] === false; });
    };
    RequisicaoDescargaItemValidation.prototype.validaChaveNfe = function (params, showError) {
        if (showError === void 0) { showError = false; }
        var r = { "isValid": true, "message": "" };
        if (params.modNotaId === "55") {
            if (this.funcoes.validaChaveNFe(params.chaveNfe, params.emitente, params.docto, params.serieNotaId)) {
                r.isValid = false;
                r.message = "messages.chaveNfeInvalida";
            }
        }
        if (!r.isValid && showError) {
            this.message.warning("titles.requisicaoDescarga", r.message);
        }
        return r;
    };
    RequisicaoDescargaItemValidation.prototype.dtDoctoNaoPodeSerMaiorDtRequisicao = function (params, showError) {
        if (showError === void 0) { showError = false; }
        var r = { "isValid": true, "message": "" };
        if (new Date(params.dtRequisicao).toDateString() > params.dtDocto) {
            r.isValid = false;
            r.message = "messages.dtDoctoNaoPodeSerMaiorDtRequisicao";
        }
        if (!r.isValid && showError) {
            this.message.warning("titles.requisicaoDescarga", r.message);
        }
        return r;
    };
    RequisicaoDescargaItemValidation.prototype.dtDoctoNPodeMaior180diasDtAtual = function (params, showError) {
        if (showError === void 0) { showError = false; }
        var r = { "isValid": true, "message": "" };
        if (params.dtEmissao > (moment__WEBPACK_IMPORTED_MODULE_0__().add(-180, "days").toDate())) {
            r.isValid = false;
            r.message = "messages.dtEmissaoNPodeMaior180diasDtAtual";
        }
        if (!r.isValid && showError) {
            this.message.warning("titles.requisicaoDescarga", r.message);
        }
        return r;
    };
    RequisicaoDescargaItemValidation.prototype.vlNotaNaoPermitido = function (params, showError) {
        if (showError === void 0) { showError = false; }
        var r = { "isValid": true, "message": "" };
        var vlNotaCalc = this.funcoes.numberUtils.round(params.quantidDoc * params.lote.precoArmazenado, 2);
        if ((params.vlNota - vlNotaCalc) > 1) {
            r.isValid = false;
            r.message = "messages.vlNotaNaoPermitido";
        }
        if (!r.isValid && showError) {
            this.message.warning("titles.requisicaoDescarga", r.message);
        }
        return r;
    };
    return RequisicaoDescargaItemValidation;
}());



/***/ }),

/***/ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-pesagem-anterior/requisicao-descarga-pesagem-anterior.component.ts":
/*!******************************************************************************************************************************************!*\
  !*** ./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-pesagem-anterior/requisicao-descarga-pesagem-anterior.component.ts ***!
  \******************************************************************************************************************************************/
/*! exports provided: RequisicaoDescargaPesagemAnteriorComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RequisicaoDescargaPesagemAnteriorComponent", function() { return RequisicaoDescargaPesagemAnteriorComponent; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _config_enumerables__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../../../../config/enumerables */ "./src/app/config/enumerables.ts");
/* harmony import */ var _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../../../../shared/services/funcoes/funcoes.service */ "./src/app/shared/services/funcoes/funcoes.service.ts");
/* harmony import */ var _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../../../../shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var _login_login_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../../../login/login.service */ "./src/app/pages/login/login.service.ts");
/* harmony import */ var _requisicao_descarga_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../requisicao-descarga.service */ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga.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 RequisicaoDescargaPesagemAnteriorComponent = /** @class */ (function () {
    function RequisicaoDescargaPesagemAnteriorComponent(funcoesService, messageService, service, loginService) {
        this.funcoesService = funcoesService;
        this.messageService = messageService;
        this.service = service;
        this.loginService = loginService;
        this.mascara = new _config_enumerables__WEBPACK_IMPORTED_MODULE_1__["Mascaras"]();
        this.mensagens = [];
        this._refresh = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
    }
    RequisicaoDescargaPesagemAnteriorComponent.prototype.ngOnInit = function () {
        this.balPesoTaraDto = [];
    };
    RequisicaoDescargaPesagemAnteriorComponent.prototype.onSubmit = function (form) {
        jQuery("#requisicao-descarga-pesagem-anterior-dialog").modal("hide");
    };
    RequisicaoDescargaPesagemAnteriorComponent.prototype.objectSelect = function (current) {
        var _this = this;
        this.data = current;
        this.service.balPesoTara({ requisicaoDescargaId: this.data.requisicaoDescargaId }).subscribe(function (resp) {
            if (resp) {
                _this.balPesoTaraDto = resp;
            }
        });
    };
    RequisicaoDescargaPesagemAnteriorComponent.ctorParameters = function () { return [
        { type: _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_2__["FuncoesService"] },
        { type: _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_3__["MessageService"] },
        { type: _requisicao_descarga_service__WEBPACK_IMPORTED_MODULE_5__["RequisicaoDescargaService"] },
        { type: _login_login_service__WEBPACK_IMPORTED_MODULE_4__["LoginService"] }
    ]; };
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"])(),
        __metadata("design:type", Object)
    ], RequisicaoDescargaPesagemAnteriorComponent.prototype, "_refresh", void 0);
    RequisicaoDescargaPesagemAnteriorComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
            selector: "app-requisicao-descarga-pesagem-anterior",
            template: __importDefault(__webpack_require__(/*! raw-loader!./requisicao-descarga-pesagem-anterior.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-pesagem-anterior/requisicao-descarga-pesagem-anterior.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_2__["FuncoesService"],
            _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_3__["MessageService"],
            _requisicao_descarga_service__WEBPACK_IMPORTED_MODULE_5__["RequisicaoDescargaService"],
            _login_login_service__WEBPACK_IMPORTED_MODULE_4__["LoginService"]])
    ], RequisicaoDescargaPesagemAnteriorComponent);
    return RequisicaoDescargaPesagemAnteriorComponent;
}());



/***/ }),

/***/ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-report/requisicao-descarga-report.component.ts":
/*!**********************************************************************************************************************!*\
  !*** ./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-report/requisicao-descarga-report.component.ts ***!
  \**********************************************************************************************************************/
/*! exports provided: RequisicaoDescargaReportComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RequisicaoDescargaReportComponent", function() { return RequisicaoDescargaReportComponent; });
/* 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");
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 RequisicaoDescargaReportComponent = /** @class */ (function () {
    function RequisicaoDescargaReportComponent() {
        this.outConfirma = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
    }
    RequisicaoDescargaReportComponent.prototype.ngOnInit = function () {
        this.tipoSelecionado = "";
        this.initListaTiposImpressao();
    };
    RequisicaoDescargaReportComponent.prototype.initListaTiposImpressao = function () {
        this.tiposImpressao = [
            { value: "autorizacao", label: "labels.autorizacao" },
            { value: "ticket", label: "labels.ticket" },
            { value: "boletimOcorrencia", label: "labels.boletimOcorrencia" }
        ];
    };
    RequisicaoDescargaReportComponent.prototype.onSubmit = function (form) {
        app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_1__["EventEmitterService"].get("formError").emit(form);
        if (form.invalid) {
            return;
        }
        this.outConfirma.emit(this.tipoSelecionado);
        this.tipoSelecionado = "";
        jQuery("#modalPrint").modal("hide");
    };
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"])(),
        __metadata("design:type", Object)
    ], RequisicaoDescargaReportComponent.prototype, "outConfirma", void 0);
    RequisicaoDescargaReportComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
            selector: "app-requisicao-descarga-report",
            template: __importDefault(__webpack_require__(/*! raw-loader!./requisicao-descarga-report.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-report/requisicao-descarga-report.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [])
    ], RequisicaoDescargaReportComponent);
    return RequisicaoDescargaReportComponent;
}());



/***/ }),

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

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RequisicaoDescargaSegundaPesagemComponent", function() { return RequisicaoDescargaSegundaPesagemComponent; });
/* harmony import */ var _shared_components_commons_corrige_placa_ocr_corrige_placa_ocr_model__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../../../../shared/components/commons/corrige-placa-ocr/corrige-placa-ocr.model */ "./src/app/shared/components/commons/corrige-placa-ocr/corrige-placa-ocr.model.ts");
/* harmony import */ var _shared_components_commons_corrige_placa_ocr_corrige_placa_ocr_component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../../../../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 _angular_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/fesm5/router.js");
/* harmony import */ var _shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../shared/services/funcoes/configuracao/configuracao.facade */ "./src/app/shared/services/funcoes/configuracao/configuracao.facade.ts");
/* harmony import */ var _requisicao_descarga_pesagem_anterior_requisicao_descarga_pesagem_anterior_component__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../requisicao-descarga-pesagem-anterior/requisicao-descarga-pesagem-anterior.component */ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-pesagem-anterior/requisicao-descarga-pesagem-anterior.component.ts");
/* harmony import */ var _requisicao_descarga_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../requisicao-descarga.constants */ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga.constants.ts");
/* harmony import */ var _requisicao_descarga_permissoes__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../requisicao-descarga.permissoes */ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga.permissoes.ts");
/* harmony import */ var _requisicao_descarga_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../requisicao-descarga.service */ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga.service.ts");
/* harmony import */ var _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_9__ = __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_10__ = __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_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./../../../../shared/services/funcoes/boolean-utils/boolean-utils.static.service */ "./src/app/shared/services/funcoes/boolean-utils/boolean-utils.static.service.ts");
/* harmony import */ var _shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_12__ = __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_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_object_utils_object_utils_static_service__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./../../../../shared/services/funcoes/object-utils/object-utils.static.service */ "./src/app/shared/services/funcoes/object-utils/object-utils.static.service.ts");
/* harmony import */ var _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_16__ = __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_17__ = __webpack_require__(/*! ./../../../../shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var _login_login_service__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./../../../login/login.service */ "./src/app/pages/login/login.service.ts");
/* harmony import */ var _requisicao_descarga_segunda_pesagem_model__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./requisicao-descarga-segunda-pesagem.model */ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-segunda-pesagem/requisicao-descarga-segunda-pesagem.model.ts");
/* harmony import */ var _requisicao_descarga_segunda_pesagem_validation__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./requisicao-descarga-segunda-pesagem.validation */ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-segunda-pesagem/requisicao-descarga-segunda-pesagem.validation.ts");
/* harmony import */ var app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! app/shared/services/funcoes/string-utils/string-utils.static.service */ "./src/app/shared/services/funcoes/string-utils/string-utils.static.service.ts");
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 RequisicaoDescargaSegundaPesagemComponent = /** @class */ (function (_super) {
    __extends(RequisicaoDescargaSegundaPesagemComponent, _super);
    function RequisicaoDescargaSegundaPesagemComponent(router, activatedRoute, funcoes, message, configuracao, service, loginService, permissoesUtils) {
        var _this = _super.call(this, new _requisicao_descarga_constants__WEBPACK_IMPORTED_MODULE_6__["RequisicaoDescargaConstants"](), funcoes) || this;
        _this.router = router;
        _this.activatedRoute = activatedRoute;
        _this.funcoes = funcoes;
        _this.message = message;
        _this.configuracao = configuracao;
        _this.service = service;
        _this.loginService = loginService;
        _this.permissoesUtils = permissoesUtils;
        _this.data = new _requisicao_descarga_segunda_pesagem_model__WEBPACK_IMPORTED_MODULE_19__["RequisicaoDescargaSegundaPesagem"]();
        _this.oldData = new _requisicao_descarga_segunda_pesagem_model__WEBPACK_IMPORTED_MODULE_19__["RequisicaoDescargaSegundaPesagem"]();
        _this.constantes = new _requisicao_descarga_constants__WEBPACK_IMPORTED_MODULE_6__["RequisicaoDescargaConstants"]();
        _this.now = new Date();
        _this.minutos = 0;
        _this.disabledQuebra = true;
        _this.disabledAtraso = true;
        _this.statusDiferenca = "";
        _this.statusQuebraOuSobra = "";
        _this.statusQuebraOuSobraPt = "";
        _this.statusAtraso = "";
        _this.requisicaoDescargaId = 0;
        _this.target = _this.funcoes.getTargetLocation();
        _this.loadConfig = function () {
            _this.service.configBal.validaMobile2Pes = _this.configuracao.boolean("BAL", "ValidaMobile2Pes");
            _this.service.configBal.justAtraso = _this.configuracao.boolean("BAL", "JustAtraso");
            _this.service.configCtv.checkListPesa = _this.configuracao.boolean("CTV", "CheckListPesa");
            _this.service.configBal.permAfePesoTara = _this.configuracao.boolean("BAL", "PermAfePesoTara");
            _this.service.configBal.tolTara = _this.configuracao.number("BAL", "TolTara");
            _this.service.configBal.justDescarga = _this.configuracao.boolean("BAL", "JustDescarga");
            _this.service.configBal.ptJustDescargaR = _this.configuracao.number("BAL", "PtJustDescargaR");
            _this.service.configBal.ptJustDescargaF = _this.configuracao.number("BAL", "PtJustDescargaF");
            _this.service.configBal.justDescargaSb = _this.configuracao.boolean("BAL", "JustDescargaSb");
            _this.service.configBal.ptJustDescargaRSb = _this.configuracao.number("BAL", "PtJustDescargaRSb");
            _this.service.configBal.ptJustDescargaFSb = _this.configuracao.number("BAL", "PtJustDescargaFSb");
            _this.service.configBal.pesagemAutomatica = _this.configuracao.boolean("BAL", "PesagemAutomatica");
            _this.service.configBal.impTickAposLib = _this.configuracao.boolean("BAL", "ImpTickAposLib");
            _this.service.configWeb.cWebModRequisicaoD = _this.configuracao.lerConfig("WEB", "CWebModRequisicaoD");
            _this.service.configWeb.cWebModTicketD = _this.configuracao.lerConfig("WEB", "CWebModTicketD");
            _this.service.configBal.boletimOcorrencia = _this.configuracao.boolean("BAL", "BoletimOcorrencia");
            _this.service.configBal.pesoMaxRodBO = _this.configuracao.number("BAL", "PesoMaxRodBO");
            _this.service.configWeb.cWebModBOReqDescarga = _this.configuracao.lerConfig("WEB", "CWebModBOReqDescarga");
            _this.service.configBal.obrigaDepLib = _this.configuracao.boolean("BAL", "ObrigaDepLib");
            _this.service.configBal.codBalCheckList = _this.configuracao.boolean("BAL", "CodBalCheckList");
            _this.service.configBal.sPerDesComis = _this.configuracao.boolean("BAL", "SPerDesComis");
            _this.service.configBal.dtOperIgualPes = _this.configuracao.boolean("BAL", "DtOperIgualPes");
            _this.service.configBal.validaPesagem = _this.configuracao.boolean("BAL", "ValidaPesagem");
            _this.service.configBal.ocrPesagem = _this.configuracao.boolean("BAL", "OcrPesagem");
            _this.service.configWeb.prefixoRelEspecifico = _this.configuracao.lerConfig("WEB", "PrefixoRelEspecifico");
            _this.service.configBal.bl2Codig = _this.configuracao.string("BAL", "Bl2Codig" + _this.configuracao.macAddress);
            _this.posConfig();
        };
        _this.validation = new _requisicao_descarga_segunda_pesagem_validation__WEBPACK_IMPORTED_MODULE_20__["RequisicaoDescargaSegundaPesagemValidation"](message);
        router.events.subscribe(function (event) {
            var params = _this.funcoes.formParams.getParams(router, event);
            if (params) {
                _this.actionForm = params.action;
            }
        });
        return _this;
    }
    RequisicaoDescargaSegundaPesagemComponent.prototype.ngOnInit = function () {
        var _this = this;
        this.permissoesUtils.validRotina(this.constantes.sisFormularioId, 9, function () { return __awaiter(_this, void 0, void 0, function () {
            var id, _a;
            return __generator(this, function (_b) {
                switch (_b.label) {
                    case 0:
                        this.getConfig();
                        id = this.activatedRoute.snapshot.paramMap.get("id");
                        this.requisicaoDescargaId = +id;
                        if (!id) {
                            this.message.warning("titles.requisicaoDescarga", "message.nenhumRegistroEncontrado");
                            return [2 /*return*/];
                        }
                        _a = this;
                        return [4 /*yield*/, this.service.consultaASegundaPesagem(+id).toPromise()];
                    case 1:
                        _a.data = _b.sent();
                        if (!this.data) {
                            this.message.warning("titles.requisicaoDescarga", "message.nenhumRegistroEncontrado");
                            return [2 /*return*/];
                        }
                        this.init();
                        return [2 /*return*/];
                }
            });
        }); }, function () { });
    };
    RequisicaoDescargaSegundaPesagemComponent.prototype.init = function () {
        this.getConfig();
        this.data.percDescargaComissionada = "";
        this.data.ternoId = "";
        this.data.balancaId = "";
        this.data.motivoAtrasoId = "";
        this.data.motivoQuebraId = "";
        this.data.motivoPTaraId = "";
        this.data.dtFimOper = this.now;
        this.oldData = _shared_services_funcoes_object_utils_object_utils_static_service__WEBPACK_IMPORTED_MODULE_15__["ObjectUtilsStaticService"].clone(this.data);
        this.validation.oldData = this.oldData;
        this.preparaOcr();
    };
    RequisicaoDescargaSegundaPesagemComponent.prototype.getConfig = function () {
        var _this = this;
        this.constantes.listaParam.map(function (c) {
            if (c.sistema === 'BAL') {
                c.parametros.push("Bl2Codig" + _this.configuracao.macAddress);
            }
        });
        this.configuracao.getConfig(this.constantes.listaParam, this.loadConfig);
    };
    RequisicaoDescargaSegundaPesagemComponent.prototype.posConfig = function () {
        this.data.tanqueId = this.service.configBal.obrigaDepLib ? "" : this.data.tanqueId;
        this.data.flagManual = this.service.configBal.pesagemAutomatica ? "S" : "N";
        this.data.dtIniOper = this.service.configBal.dtOperIgualPes ? this.data.dtIniOper : this.now;
        this.data.balancaId = !!this.service.configBal.bl2Codig ? this.service.configBal.bl2Codig : "";
        this.trataJustAtraso();
        this.trataJustQuebra();
    };
    Object.defineProperty(RequisicaoDescargaSegundaPesagemComponent.prototype, "disabledPesoLiq", {
        get: function () {
            return !this.service.configCtv.checkListPesa || _shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_11__["BooleanUtilsStaticService"].toBoolean(this.data.flagPesa);
        },
        enumerable: true,
        configurable: true
    });
    RequisicaoDescargaSegundaPesagemComponent.prototype.calcPesoLiq = function () {
        if (this.disabledPesoLiq)
            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);
        else
            this.data.pesoTara = _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.pesoLiq);
        this.trataJustQuebra();
    };
    RequisicaoDescargaSegundaPesagemComponent.prototype.trataJustQuebra = function () {
        var _this = this;
        this.disabledQuebra = !this.data.motivoQuebraId;
        this.statusQuebraOuSobra = "";
        this.statusQuebraOuSobraPt = "";
        var peso = 0;
        if (!this.disabledPesoLiq)
            peso = this.data.pesoTara;
        else
            peso = this.data.pesoLiq;
        if (_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_14__["NumberUtilsStaticService"].toNumber(peso) === 0)
            return;
        var diferenca = peso - this.data.kilos;
        var ptDif = ((peso / this.data.kilos) - 1) * 100;
        var temQuebra = this.validaQuebra(peso);
        var temSobra = this.validaSobra(peso);
        var temQuebraOuSobra = temQuebra || temSobra;
        this.disabledQuebra = !temQuebraOuSobra;
        this.data.diferenca = diferenca;
        this.statusQuebraOuSobraPt = _shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_14__["NumberUtilsStaticService"].getCurrency(ptDif, 2) + " %";
        if (peso > this.data.kilos)
            this.statusQuebraOuSobra = "Sobra";
        else if (peso < this.data.kilos)
            this.statusQuebraOuSobra = "Quebra";
        else
            this.statusQuebraOuSobra = "";
        if (temQuebraOuSobra) {
            this.message.confirm("titles.segundaPesagem", this.message.translate("messages.diferencaMaiorQuePermitido", {
                ptDif: _shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_14__["NumberUtilsStaticService"].getCurrency(ptDif, 2)
            }), null, function () {
            }, false, function () {
                _this.data.pesoLiq = 0;
                _this.data.pesoTara = 0;
                _this.data.diferenca = 0;
                _this.statusQuebraOuSobraPt = "";
                _this.statusQuebraOuSobra = "";
                _this.data.motivoQuebraId = "";
                _this.disabledQuebra = true;
            });
        }
    };
    RequisicaoDescargaSegundaPesagemComponent.prototype.validaSobra = function (peso) {
        var diferenca = peso - this.data.kilos;
        if (diferenca <= 0)
            return false;
        var pesoDifMax = 0;
        if (this.data.tipoTransp === 'R')
            pesoDifMax = this.service.configBal.ptJustDescargaRSb;
        else
            pesoDifMax = this.service.configBal.ptJustDescargaFSb;
        if (this.service.configBal.justDescargaSb) {
            var ptDif = 0;
            if (_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_14__["NumberUtilsStaticService"].isNotPositive(this.data.kilos))
                ptDif = 100;
            else
                ptDif = _shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_14__["NumberUtilsStaticService"].round(Math.abs((1 - (peso / this.data.kilos)) * 100), 5);
            return ptDif > pesoDifMax;
        }
        return false;
    };
    RequisicaoDescargaSegundaPesagemComponent.prototype.validaQuebra = function (peso) {
        var diferenca = peso - this.data.kilos;
        if (diferenca >= 0)
            return false;
        var pesoDifMax = 0;
        if (this.data.tipoTransp === 'R')
            pesoDifMax = this.service.configBal.ptJustDescargaR;
        else
            pesoDifMax = this.service.configBal.ptJustDescargaF;
        if (this.service.configBal.justDescarga) {
            var ptDif = 0;
            if (_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_14__["NumberUtilsStaticService"].isNotPositive(this.data.kilos))
                ptDif = 100;
            else
                ptDif = _shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_14__["NumberUtilsStaticService"].round(Math.abs((1 - (peso / this.data.kilos)) * 100), 5);
            return ptDif > pesoDifMax;
        }
        return false;
    };
    RequisicaoDescargaSegundaPesagemComponent.prototype.trataJustAtraso = function () {
        this.disabledAtraso = !this.data.motivoAtrasoId;
        if (this.service.configBal.justAtraso) {
            var dtInicio = undefined;
            if (!!this.data.dtTriagem)
                dtInicio = this.data.dtTriagem;
            else
                dtInicio = this.data.dtChegada;
            if (!dtInicio || !this.data.dtChegada)
                return;
            var minutos = _shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_12__["DateTimeUtilsStaticService"].getMinutes(dtInicio, this.now);
            this.disabledAtraso = this.data.tempoOperacao > minutos;
            if (!this.disabledAtraso)
                this.minutos = minutos;
        }
    };
    Object.defineProperty(RequisicaoDescargaSegundaPesagemComponent.prototype, "atraso", {
        get: function () {
            if (_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_14__["NumberUtilsStaticService"].isNotPositive(this.minutos))
                return "";
            return this.minutos + " min";
        },
        enumerable: true,
        configurable: true
    });
    RequisicaoDescargaSegundaPesagemComponent.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.configBal.ocrPesagem && !!this.data.balancaId)) return [3 /*break*/, 2];
                        dadosOcr = new _shared_components_commons_corrige_placa_ocr_corrige_placa_ocr_model__WEBPACK_IMPORTED_MODULE_0__["CorrigePlacaOcr"](_shared_components_commons_corrige_placa_ocr_corrige_placa_ocr_model__WEBPACK_IMPORTED_MODULE_0__["CorrigePlacaOcr"].Saida, _shared_components_commons_corrige_placa_ocr_corrige_placa_ocr_model__WEBPACK_IMPORTED_MODULE_0__["CorrigePlacaOcr"].Rodo, this.data.cadastroPlacaIdCavalo, this.data.cadastroPlacaIdCarreta1, this.data.cadastroPlacaIdCarreta2);
                        dadosOcr.tipoBusca = _shared_components_commons_corrige_placa_ocr_corrige_placa_ocr_model__WEBPACK_IMPORTED_MODULE_0__["CorrigePlacaOcr"].RequisicaoDeDescarga;
                        dadosOcr.idCorporate = this.requisicaoDescargaId;
                        dadosOcr.codRotina = this.constantes.sisFormularioId2Pes;
                        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];
                }
            });
        });
    };
    RequisicaoDescargaSegundaPesagemComponent.prototype.onSubmit = function (form) {
        _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_9__["EventEmitterService"].get("formError").emit(form);
        if (form.invalid) {
            return;
        }
        var validations = this.validation.getValidations(this.data);
        if (_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_10__["ArrayUtilsStaticService"].any(validations)) {
            _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_9__["EventEmitterService"].get("backError").emit(validations.map(function (c) { return c.message; }));
            return;
        }
        ;
        if (this.service.configBal.ocrPesagem && !!this.data.balancaId) {
            this.preparaOcr();
        }
        else
            this.confirma();
    };
    RequisicaoDescargaSegundaPesagemComponent.prototype.confirmaOcr = function (dadosPlaca) {
        this.data.placaDig1 = this.data.cadastroPlacaIdCavalo;
        this.data.placaDig2 = this.data.cadastroPlacaIdCarreta1;
        this.data.placaDig3 = this.data.cadastroPlacaIdCarreta2;
        this.data.cadastroPlacaIdCavalo = dadosPlaca.placas[0];
        this.data.cadastroPlacaIdCarreta1 = dadosPlaca.placas[1];
        this.data.cadastroPlacaIdCarreta2 = dadosPlaca.placas[2];
        this.data.placaOcr1 = dadosPlaca.placas[3];
        this.data.placaOcr1 = dadosPlaca.placas[4];
        this.data.placaOcr1 = dadosPlaca.placas[5];
        this.data.justificativaOcr1 = dadosPlaca.justificativas[0];
        this.data.justificativaOcr2 = dadosPlaca.justificativas[1];
        this.data.justificativaOcr3 = dadosPlaca.justificativas[2];
        this.data.ocrRtsSessao = dadosPlaca.sessao;
        this.data.ocrRtsGate = dadosPlaca.gate;
        this.confirma();
    };
    RequisicaoDescargaSegundaPesagemComponent.prototype.confirma = function () {
        var _this = this;
        if (this.service.configBal.validaPesagem && _shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_11__["BooleanUtilsStaticService"].toBoolean(this.data.flagManual)) {
            this.message.confirm("titles.segundaPesagem", "messages.confirmaPesagemManual", null, function () { return _this.efetuaPesagem(); });
        }
        else {
            this.efetuaPesagem();
        }
    };
    RequisicaoDescargaSegundaPesagemComponent.prototype.efetuaPesagem = function () {
        return __awaiter(this, void 0, void 0, function () {
            var result, mensagens;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.service.segundaPesagem(this.data).toPromise()];
                    case 1:
                        result = _a.sent();
                        if (!result.validationResult.isValid) {
                            mensagens = this.message.validationResult(result.validationResult);
                            _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_9__["EventEmitterService"].get("backError").emit(mensagens);
                            this.funcoes.backToTop();
                        }
                        if (!!result && result.validationResult.isValid) {
                            this.message.saveSuccess("titles.requisicaoDescarga");
                            if (this.service.configBal.boletimOcorrencia && (this.service.configBal.pesoMaxRodBO > 0) && (this.data.diferenca > this.service.configBal.pesoMaxRodBO)) {
                                this.printBoletimOcorrencia();
                            }
                            else if (!this.service.configBal.impTickAposLib) {
                                this.printAutorizacao();
                            }
                            else if (this.service.configBal.impTickAposLib) {
                                this.printTicket();
                            }
                        }
                        return [2 /*return*/];
                }
            });
        });
    };
    RequisicaoDescargaSegundaPesagemComponent.prototype.printAutorizacao = function () {
        var modRel = this.service.configWeb.cWebModRequisicaoD;
        if (!modRel) {
            this.message.warning("titles.requisicaoDescarga", "messages.modRelNaoConfigurado");
        }
        else {
            var reportTitulo = { titulo: 'Requisição de Carga', subTitulo: '' };
            // Valida se a chamada é para um report especifico
            if (app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_21__["StringUtilsStaticService"].isNotEmpty(this.service.configWeb.prefixoRelEspecifico) && modRel.indexOf(this.service.configWeb.prefixoRelEspecifico) == 0) {
                this.funcoes.reportInvoc.invocaRelatorioEspecificos(modRel, reportTitulo, {
                    filialId: this.loginService.getLogin().filialId,
                    autorizacao: this.requisicaoDescargaId
                });
            }
            else {
                this.funcoes.reportInvoc.invocaRelatorio(modRel, reportTitulo, {
                    filialId: this.loginService.getLogin().filialId,
                    autorizacao: this.requisicaoDescargaId
                });
            }
        }
        this.back();
    };
    RequisicaoDescargaSegundaPesagemComponent.prototype.printTicket = function () {
        var modRel = this.service.configWeb.cWebModTicketD;
        if (!modRel) {
            this.message.warning("titles.requisicaoDescarga", "messages.modRelNaoConfigurado");
            this.back();
        }
        else {
            var reportTitulo = { titulo: 'Ticket de Descarga', subTitulo: '' };
            var params = {
                filialId: this.loginService.getLogin().filialId,
                tipoOCD: "R",
                autorizacao: this.requisicaoDescargaId
            };
            if (app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_21__["StringUtilsStaticService"].isNotEmpty(this.service.configWeb.prefixoRelEspecifico) && modRel.indexOf(this.service.configWeb.prefixoRelEspecifico) === 0) {
                this.funcoes.reportInvoc.invocaRelatorioEspecificos(modRel, reportTitulo, params);
            }
            else {
                this.funcoes.reportInvoc.invocaRelatorio(modRel, reportTitulo, params);
            }
        }
        this.back();
    };
    RequisicaoDescargaSegundaPesagemComponent.prototype.printBoletimOcorrencia = function () {
        var modRel = this.service.configWeb.cWebModBOReqDescarga;
        if (!modRel) {
            this.message.warning("titles.requisicaoDescarga", "messages.modRelNaoConfigurado");
        }
        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_21__["StringUtilsStaticService"].isNotEmpty(this.service.configWeb.prefixoRelEspecifico) && modRel.indexOf(this.service.configWeb.prefixoRelEspecifico) == 0) {
                this.funcoes.reportInvoc.invocaRelatorioEspecificos(modRel, reportTitulo, {
                    autorizacao: this.data.opDescargaId,
                    tipo: 2
                });
            }
            else {
                this.funcoes.reportInvoc.invocaRelatorio(modRel, reportTitulo, {
                    autorizacao: this.data.opDescargaId,
                    tipo: 2
                });
            }
        }
        this.back();
    };
    RequisicaoDescargaSegundaPesagemComponent.prototype.back = function () {
        this.router.navigate([this.target + "/balanca/requisicaoDescarga"]);
    };
    RequisicaoDescargaSegundaPesagemComponent.prototype.getPeso = function (data) {
        this.data.flagManual = data.manual ? "S" : "N";
        this.calcPesoLiq();
    };
    RequisicaoDescargaSegundaPesagemComponent.prototype.validaPeso = function (data) {
        this.data.flagManual = data.manual ? "S" : "N";
        this.calcPesoLiq();
    };
    Object.defineProperty(RequisicaoDescargaSegundaPesagemComponent.prototype, "saldoDepositoOptions", {
        get: function () {
            return {
                destinatarioIdCliente: this.data.destinatarioIdCliente,
                materialId: this.data.materialId,
                tanqueId: this.data.tanqueId,
                sitLote: 'A',
                modo: 7,
                tipoSaldo: 7,
                dataMovimento: this.now,
                tipoAgrupa: 'D',
                geraArquivo: 'S'
            };
        },
        enumerable: true,
        configurable: true
    });
    RequisicaoDescargaSegundaPesagemComponent.ctorParameters = function () { return [
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_3__["Router"] },
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_3__["ActivatedRoute"] },
        { type: _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_13__["FuncoesService"] },
        { type: _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_17__["MessageService"] },
        { type: _shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_4__["ConfiguracaoFacade"] },
        { type: _requisicao_descarga_service__WEBPACK_IMPORTED_MODULE_8__["RequisicaoDescargaService"] },
        { type: _login_login_service__WEBPACK_IMPORTED_MODULE_18__["LoginService"] },
        { type: _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_16__["PermissoesUtilsService"] }
    ]; };
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_2__["ViewChild"])(_requisicao_descarga_pesagem_anterior_requisicao_descarga_pesagem_anterior_component__WEBPACK_IMPORTED_MODULE_5__["RequisicaoDescargaPesagemAnteriorComponent"], { static: false }),
        __metadata("design:type", _requisicao_descarga_pesagem_anterior_requisicao_descarga_pesagem_anterior_component__WEBPACK_IMPORTED_MODULE_5__["RequisicaoDescargaPesagemAnteriorComponent"])
    ], RequisicaoDescargaSegundaPesagemComponent.prototype, "childRequisicaoDescargaPesagemAnteriorComponent", void 0);
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_2__["ViewChild"])(_shared_components_commons_corrige_placa_ocr_corrige_placa_ocr_component__WEBPACK_IMPORTED_MODULE_1__["CorrigePlacaOcrComponent"], { static: false }),
        __metadata("design:type", _shared_components_commons_corrige_placa_ocr_corrige_placa_ocr_component__WEBPACK_IMPORTED_MODULE_1__["CorrigePlacaOcrComponent"])
    ], RequisicaoDescargaSegundaPesagemComponent.prototype, "corrigePlacaOcr", void 0);
    RequisicaoDescargaSegundaPesagemComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_2__["Component"])({
            selector: "app-requisicao-descarga-segunda-pesagem",
            template: __importDefault(__webpack_require__(/*! raw-loader!./requisicao-descarga-segunda-pesagem.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-segunda-pesagem/requisicao-descarga-segunda-pesagem.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_2__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [_angular_router__WEBPACK_IMPORTED_MODULE_3__["Router"],
            _angular_router__WEBPACK_IMPORTED_MODULE_3__["ActivatedRoute"],
            _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_13__["FuncoesService"],
            _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_17__["MessageService"],
            _shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_4__["ConfiguracaoFacade"],
            _requisicao_descarga_service__WEBPACK_IMPORTED_MODULE_8__["RequisicaoDescargaService"],
            _login_login_service__WEBPACK_IMPORTED_MODULE_18__["LoginService"],
            _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_16__["PermissoesUtilsService"]])
    ], RequisicaoDescargaSegundaPesagemComponent);
    return RequisicaoDescargaSegundaPesagemComponent;
}(_requisicao_descarga_permissoes__WEBPACK_IMPORTED_MODULE_7__["RequisicaoDescargaPermissoes"]));



/***/ }),

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

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RequisicaoDescargaSegundaPesagem", function() { return RequisicaoDescargaSegundaPesagem; });
/* harmony import */ var _shared_services_base_base_model__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../../../../shared/services/base/base.model */ "./src/app/shared/services/base/base.model.ts");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};

var RequisicaoDescargaSegundaPesagem = /** @class */ (function (_super) {
    __extends(RequisicaoDescargaSegundaPesagem, _super);
    function RequisicaoDescargaSegundaPesagem() {
        var _this = _super.call(this) || this;
        _this.percDescargaComissionada = "";
        _this.ternoId = "";
        _this.balancaId = "";
        _this.motivoAtrasoId = "";
        _this.motivoQuebraId = "";
        _this.motivoPTaraId = "";
        _this.dtFimOper = new Date();
        return _this;
    }
    return RequisicaoDescargaSegundaPesagem;
}(_shared_services_base_base_model__WEBPACK_IMPORTED_MODULE_0__["BaseModel"]));



/***/ }),

/***/ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-segunda-pesagem/requisicao-descarga-segunda-pesagem.validation.ts":
/*!*****************************************************************************************************************************************!*\
  !*** ./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-segunda-pesagem/requisicao-descarga-segunda-pesagem.validation.ts ***!
  \*****************************************************************************************************************************************/
/*! exports provided: RequisicaoDescargaSegundaPesagemValidation */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RequisicaoDescargaSegundaPesagemValidation", function() { return RequisicaoDescargaSegundaPesagemValidation; });
/* harmony import */ var app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_0__ = __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 __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};

var RequisicaoDescargaSegundaPesagemValidation = /** @class */ (function () {
    function RequisicaoDescargaSegundaPesagemValidation(message) {
        this.message = message;
        this.rs = [];
    }
    RequisicaoDescargaSegundaPesagemValidation.prototype.getValidations = function (data) {
        this.rs = [];
        if (data.dtFimOper)
            this.test(this.dtFimOperDeveSerMenorDataAtual({ "dtFimOper": data.dtFimOper }));
        if (data.dtIniOper && data.dtFimOper)
            this.test(this.dtFimOperDeveSerMaiorDtIniOper({ "dtFimOper": data.dtFimOper, "dtIniOper": data.dtIniOper }));
        return this.rs.filter(function (v) { return v["isValid"] === false; });
    };
    RequisicaoDescargaSegundaPesagemValidation.prototype.test = function (f) {
        if (!!f)
            this.rs.push(f);
    };
    RequisicaoDescargaSegundaPesagemValidation.prototype.validaDtFimOper = function (params, callBack) {
        if (!this.oldData || !params || !params.dtIniOper || !params.dtFimOper)
            return;
        var r1 = this.dtFimOperDeveSerMenorDataAtual(params, true);
        var r2 = this.dtFimOperDeveSerMaiorDtIniOper(params, true);
        if (callBack && (!!r1 && r1.isValid) && (!!r2 && r2.isValid)) {
            callBack();
            return;
        }
    };
    RequisicaoDescargaSegundaPesagemValidation.prototype.dtFimOperDeveSerMenorDataAtual = function (params, showError) {
        if (showError === void 0) { showError = false; }
        var r = { "isValid": true, "message": "" };
        if (params.dtFimOper === this.oldData.dtFimOper)
            return;
        if (app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["DateTimeUtilsStaticService"].menorOuIgualAHoje(params.dtFimOper, ['H', 'M', 'S']))
            return r;
        r.isValid = false;
        r.message = "messages.dtFimOperDeveSerMenorDataAtual";
        if (!r.isValid && showError) {
            this.message.warning("titles.requisicaoDescarga", r.message);
        }
        return r;
    };
    RequisicaoDescargaSegundaPesagemValidation.prototype.dtFimOperDeveSerMaiorDtIniOper = function (params, showError) {
        if (showError === void 0) { showError = false; }
        var r = { "isValid": true, "message": "" };
        if (params.dtFimOper === this.oldData.dtFimOper && params.dtIniOper === this.oldData.dtIniOper)
            return;
        if (app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["DateTimeUtilsStaticService"].maiorOuIgualA(params.dtFimOper, params.dtIniOper, ['H', 'M', 'S']))
            return r;
        r.isValid = false;
        r.message = "messages.dtFimOperDeveSerMaiorDtIniOper";
        if (!r.isValid && showError) {
            this.message.warning("titles.requisicaoDescarga", r.message);
        }
        return r;
    };
    return RequisicaoDescargaSegundaPesagemValidation;
}());



/***/ }),

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

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RequisicaoDescargaConstants", function() { return RequisicaoDescargaConstants; });
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};
var RequisicaoDescargaConstants = /** @class */ (function () {
    function RequisicaoDescargaConstants() {
        this.sisFormularioId = 95157;
        this.sisFormularioId2Pes = 95163;
        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.propriedades" },
            { sisFormularioId: this.sisFormularioId, libRotina: 6, acao: "labels.pesagem" },
            { sisFormularioId: this.sisFormularioId, libRotina: 7, acao: "labels.cancelarPesagem" },
            { sisFormularioId: this.sisFormularioId, libRotina: 8, acao: "labels.alterarProcesso" },
            { sisFormularioId: this.sisFormularioId, libRotina: 9, acao: "labels.alterarHorarios" },
            { sisFormularioId: this.sisFormularioId, libRotina: 10, acao: "labels.alterarDados" },
            { sisFormularioId: this.sisFormularioId, libRotina: 11, acao: "labels.mov20Manual" },
            { sisFormularioId: this.sisFormularioId, libRotina: 12, acao: "labels.todosCampos" },
            { sisFormularioId: this.sisFormularioId, libRotina: 13, acao: "labels.inicioOperacao" },
            { sisFormularioId: this.sisFormularioId, libRotina: 14, acao: "labels.fimOperacao" },
            { sisFormularioId: this.sisFormularioId, libRotina: 15, acao: "labels.permissoes" }
        ];
        this.sisSistemaId = "BAL";
        this.nomeForm = "titles.requisicaoDescarga";
        this.reportId = "CAD0151";
        this.reportTitulo = { "titulo": "", "subTitulo": "" };
        this.listaParam = [
            {
                'sistema': 'BAL', 'parametros': [
                    "PesagemAutomatica",
                    "CalculaTotalNF",
                    "InfPesoFob",
                    "JustAtraso",
                    "ValidaMobile2Pes",
                    "PermAfePesoTara",
                    "TolTara",
                    "JustDescarga",
                    "PtJustDescargaR",
                    "PtJustDescargaF",
                    "JustDescargaSb",
                    "PtJustDescargaRSb",
                    "PtJustDescargaFSb",
                    "ImpTickAposLib",
                    "BoletimOcorrencia",
                    "PesoMaxRodBO",
                    "PermissaoDatasOCD",
                    "SPerDesComis",
                    "ObrigaDepLib",
                    "CodBalCheckList",
                    "DtOperIgualPes",
                    "OcrPesagem"
                ]
            },
            { 'sistema': 'CTV', 'parametros': ["ObservPortal", "ImportaDANFE", "CheckListPesa", "SolicitaPlanejEv", "NAltDepositoLibVeic"] },
            { 'sistema': 'UNI', 'parametros': ["ObrChaveNFeEnt", "solMotCancEVePesagem"] },
            { 'sistema': 'WEB', 'parametros': ["CWebModRequisicaoD", "CWebModTicketD", "PrefixoRelEspecifico", "ObrigaPlataformaRodo"] },
            { 'sistema': 'CTR', 'parametros': ["DtSeguro"] }
        ];
        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: false, 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: 'CancelPesagem', action: 'cancelPesagem', icon: "fa fa-ban", exibeButton: true, eximeMenu: true, menuName: 'Movimento' },
            { title: 'AlterarDatas', action: 'alterarDatas', icon: "icon-calendar", exibeButton: true, eximeMenu: true, menuName: 'Arquivo' },
            { title: 'AlterarDados', action: 'alterarDados', icon: "icon-server", exibeButton: true, eximeMenu: true, menuName: 'Arquivo' },
        ];
        this.listaForm = [
            { title: 'Editar', action: 'edit', icon: "icon-pencil", exibeButton: true, eximeMenu: true, menuName: 'Arquivo' },
            { title: 'Voltar', action: 'back', icon: "icon-arrow-left", exibeButton: true, eximeMenu: true, menuName: 'Arquivo' },
        ];
        this.listaAlterarDados = [
            { title: 'Voltar', action: 'back', icon: "icon-arrow-left", exibeButton: true, eximeMenu: true, menuName: 'Arquivo' },
        ];
        this.listaAlterarDatas = [
            { title: 'Voltar', action: 'back', icon: "icon-arrow-left", exibeButton: true, eximeMenu: true, menuName: 'Arquivo' },
        ];
        this.lista2Pes = [
            { title: 'Voltar', action: 'back', icon: "icon-arrow-left", exibeButton: true, eximeMenu: true, menuName: 'Arquivo' },
        ];
    }
    return RequisicaoDescargaConstants;
}());



/***/ }),

/***/ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga.deactivate.guard.ts":
/*!*******************************************************************************************!*\
  !*** ./src/app/pages/balanca/requisicao-descarga/requisicao-descarga.deactivate.guard.ts ***!
  \*******************************************************************************************/
/*! exports provided: RequisicaoDescargaFormCandeactivateGuard */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

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

var RequisicaoDescargaFormCandeactivateGuard = /** @class */ (function () {
    function RequisicaoDescargaFormCandeactivateGuard() {
    }
    RequisicaoDescargaFormCandeactivateGuard.prototype.canDeactivate = function (component, currentRoute, currentState, nextState) {
        return component.podeMudarRota();
    };
    RequisicaoDescargaFormCandeactivateGuard = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Injectable"])()
    ], RequisicaoDescargaFormCandeactivateGuard);
    return RequisicaoDescargaFormCandeactivateGuard;
}());



/***/ }),

/***/ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga.model.ts":
/*!********************************************************************************!*\
  !*** ./src/app/pages/balanca/requisicao-descarga/requisicao-descarga.model.ts ***!
  \********************************************************************************/
/*! exports provided: RequisicaoDescarga, RequisicaoDescargaFilterReport, BalPesoTaraDto, RequisicaoDescargaPesaDto */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RequisicaoDescarga", function() { return RequisicaoDescarga; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RequisicaoDescargaFilterReport", function() { return RequisicaoDescargaFilterReport; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BalPesoTaraDto", function() { return BalPesoTaraDto; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RequisicaoDescargaPesaDto", function() { return RequisicaoDescargaPesaDto; });
/* harmony import */ var _shared_services_base_base_model__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../../../shared/services/base/base.model */ "./src/app/shared/services/base/base.model.ts");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};

var RequisicaoDescarga = /** @class */ (function (_super) {
    __extends(RequisicaoDescarga, _super);
    function RequisicaoDescarga() {
        var _this = _super.call(this) || this;
        _this.dtRequisicao = new Date();
        _this.requisicaoDescargaItems = [];
        return _this;
    }
    return RequisicaoDescarga;
}(_shared_services_base_base_model__WEBPACK_IMPORTED_MODULE_0__["BaseModel"]));

var RequisicaoDescargaFilterReport = /** @class */ (function () {
    function RequisicaoDescargaFilterReport() {
        this.requisicaoDescargaId = 0;
        this.tipoRel = "0";
    }
    return RequisicaoDescargaFilterReport;
}());

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

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



/***/ }),

/***/ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga.module.ts":
/*!*********************************************************************************!*\
  !*** ./src/app/pages/balanca/requisicao-descarga/requisicao-descarga.module.ts ***!
  \*********************************************************************************/
/*! exports provided: RequisicaoDescargaModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RequisicaoDescargaModule", function() { return RequisicaoDescargaModule; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _shared_shared_module__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../shared/shared.module */ "./src/app/shared/shared.module.ts");
/* harmony import */ var _requisicao_descarga_alterar_dados_requisicao_descarga_alterar_dados_component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./requisicao-descarga-alterar-dados/requisicao-descarga-alterar-dados.component */ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-alterar-dados/requisicao-descarga-alterar-dados.component.ts");
/* harmony import */ var _requisicao_descarga_alterar_datas_requisicao_descarga_alterar_datas_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./requisicao-descarga-alterar-datas/requisicao-descarga-alterar-datas.component */ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-alterar-datas/requisicao-descarga-alterar-datas.component.ts");
/* harmony import */ var _requisicao_descarga_filter_requisicao_descarga_filter_component__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./requisicao-descarga-filter/requisicao-descarga-filter.component */ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-filter/requisicao-descarga-filter.component.ts");
/* harmony import */ var _requisicao_descarga_form_requisicao_descarga_form_component__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./requisicao-descarga-form/requisicao-descarga-form.component */ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-form/requisicao-descarga-form.component.ts");
/* harmony import */ var _requisicao_descarga_index_requisicao_descarga_index_component__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./requisicao-descarga-index/requisicao-descarga-index.component */ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-index/requisicao-descarga-index.component.ts");
/* harmony import */ var _requisicao_descarga_item_requisicao_descarga_item_component__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./requisicao-descarga-item/requisicao-descarga-item.component */ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-item/requisicao-descarga-item.component.ts");
/* harmony import */ var _requisicao_descarga_pesagem_anterior_requisicao_descarga_pesagem_anterior_component__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./requisicao-descarga-pesagem-anterior/requisicao-descarga-pesagem-anterior.component */ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-pesagem-anterior/requisicao-descarga-pesagem-anterior.component.ts");
/* harmony import */ var _requisicao_descarga_report_requisicao_descarga_report_component__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./requisicao-descarga-report/requisicao-descarga-report.component */ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-report/requisicao-descarga-report.component.ts");
/* harmony import */ var _requisicao_descarga_segunda_pesagem_requisicao_descarga_segunda_pesagem_component__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./requisicao-descarga-segunda-pesagem/requisicao-descarga-segunda-pesagem.component */ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-segunda-pesagem/requisicao-descarga-segunda-pesagem.component.ts");
/* harmony import */ var _requisicao_descarga_deactivate_guard__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./requisicao-descarga.deactivate.guard */ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga.deactivate.guard.ts");
/* harmony import */ var _requisicao_descarga_routing_module__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./requisicao-descarga.routing.module */ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga.routing.module.ts");
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};













var RequisicaoDescargaModule = /** @class */ (function () {
    function RequisicaoDescargaModule() {
    }
    RequisicaoDescargaModule = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"])({
            imports: [
                _shared_shared_module__WEBPACK_IMPORTED_MODULE_1__["SharedModule"],
                _requisicao_descarga_routing_module__WEBPACK_IMPORTED_MODULE_12__["RequisicaoDescargaRoutingModule"]
            ],
            declarations: [
                _requisicao_descarga_index_requisicao_descarga_index_component__WEBPACK_IMPORTED_MODULE_6__["RequisicaoDescargaIndexComponent"],
                _requisicao_descarga_form_requisicao_descarga_form_component__WEBPACK_IMPORTED_MODULE_5__["RequisicaoDescargaFormComponent"],
                _requisicao_descarga_filter_requisicao_descarga_filter_component__WEBPACK_IMPORTED_MODULE_4__["RequisicaoDescargaFilterComponent"],
                _requisicao_descarga_item_requisicao_descarga_item_component__WEBPACK_IMPORTED_MODULE_7__["RequisicaoDescargaItemComponent"],
                _requisicao_descarga_segunda_pesagem_requisicao_descarga_segunda_pesagem_component__WEBPACK_IMPORTED_MODULE_10__["RequisicaoDescargaSegundaPesagemComponent"],
                _requisicao_descarga_alterar_dados_requisicao_descarga_alterar_dados_component__WEBPACK_IMPORTED_MODULE_2__["RequisicaoDescargaAlterarDadosComponent"],
                _requisicao_descarga_alterar_datas_requisicao_descarga_alterar_datas_component__WEBPACK_IMPORTED_MODULE_3__["RequisicaoDescargaAlterarDatasComponent"],
                _requisicao_descarga_report_requisicao_descarga_report_component__WEBPACK_IMPORTED_MODULE_9__["RequisicaoDescargaReportComponent"],
                _requisicao_descarga_pesagem_anterior_requisicao_descarga_pesagem_anterior_component__WEBPACK_IMPORTED_MODULE_8__["RequisicaoDescargaPesagemAnteriorComponent"],
            ],
            exports: [
                _requisicao_descarga_index_requisicao_descarga_index_component__WEBPACK_IMPORTED_MODULE_6__["RequisicaoDescargaIndexComponent"],
                _requisicao_descarga_form_requisicao_descarga_form_component__WEBPACK_IMPORTED_MODULE_5__["RequisicaoDescargaFormComponent"],
                _requisicao_descarga_filter_requisicao_descarga_filter_component__WEBPACK_IMPORTED_MODULE_4__["RequisicaoDescargaFilterComponent"],
                _requisicao_descarga_item_requisicao_descarga_item_component__WEBPACK_IMPORTED_MODULE_7__["RequisicaoDescargaItemComponent"],
                _requisicao_descarga_segunda_pesagem_requisicao_descarga_segunda_pesagem_component__WEBPACK_IMPORTED_MODULE_10__["RequisicaoDescargaSegundaPesagemComponent"],
                _requisicao_descarga_alterar_dados_requisicao_descarga_alterar_dados_component__WEBPACK_IMPORTED_MODULE_2__["RequisicaoDescargaAlterarDadosComponent"],
                _requisicao_descarga_alterar_datas_requisicao_descarga_alterar_datas_component__WEBPACK_IMPORTED_MODULE_3__["RequisicaoDescargaAlterarDatasComponent"],
                _requisicao_descarga_report_requisicao_descarga_report_component__WEBPACK_IMPORTED_MODULE_9__["RequisicaoDescargaReportComponent"],
                _requisicao_descarga_pesagem_anterior_requisicao_descarga_pesagem_anterior_component__WEBPACK_IMPORTED_MODULE_8__["RequisicaoDescargaPesagemAnteriorComponent"],
            ],
            providers: [_requisicao_descarga_deactivate_guard__WEBPACK_IMPORTED_MODULE_11__["RequisicaoDescargaFormCandeactivateGuard"]]
        })
    ], RequisicaoDescargaModule);
    return RequisicaoDescargaModule;
}());



/***/ }),

/***/ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga.permissoes.ts":
/*!*************************************************************************************!*\
  !*** ./src/app/pages/balanca/requisicao-descarga/requisicao-descarga.permissoes.ts ***!
  \*************************************************************************************/
/*! exports provided: RequisicaoDescargaPermissoes */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RequisicaoDescargaPermissoes", function() { return RequisicaoDescargaPermissoes; });
/* harmony import */ var _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../../../shared/services/event-emitter/event-emitter.service */ "./src/app/shared/services/event-emitter/event-emitter.service.ts");
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};

var RequisicaoDescargaPermissoes = /** @class */ (function () {
    function RequisicaoDescargaPermissoes(constantes, funcoesService) {
        var _this = this;
        this.constantes = constantes;
        this.funcoesService = funcoesService;
        this.confirmMudancaRota = false;
        this.sub = _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_0__["EventEmitterService"].get("acaoCallBack").subscribe(function (result) {
            switch (result) {
                case "create": {
                    _this.create();
                    break;
                }
                case "edit": {
                    _this.edit();
                    break;
                }
                case "print": {
                    _this.print();
                    break;
                }
                case "refresh": {
                    _this.refresh();
                    break;
                }
                case "properties": {
                    _this.properties();
                    break;
                }
                case "permissoes": {
                    _this.permissoes();
                    break;
                }
                case "remove": {
                    _this.remove();
                    break;
                }
                case "alterarDatas": {
                    _this.alterarDatas();
                    break;
                }
                case "alterarDados": {
                    _this.alterarDados();
                    break;
                }
                case "cancelaPesagem": {
                    _this.cancelaPesagem();
                    break;
                }
                case "filtrar": {
                    _this.filtrar();
                    break;
                }
                case "back": {
                    _this.back();
                    break;
                }
                case "detail": {
                    _this.detail();
                    break;
                }
                default: {
                    break;
                }
            }
        });
    }
    // Dispara modal de propriedades
    RequisicaoDescargaPermissoes.prototype.properties = function () {
        jQuery("#propriedades-dialog").modal("show");
    };
    // Dispara modal de permissoes
    RequisicaoDescargaPermissoes.prototype.permissoes = function (param) {
        if (param === void 0) { param = {}; }
        if (param === undefined) {
            alert("Selecione um registro");
            return;
        }
        jQuery("#permissoes-rotina-dialog").modal("show");
        _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_0__["EventEmitterService"].get("formPermissoes").emit(param);
    };
    // dispara a chamada de relatorios
    RequisicaoDescargaPermissoes.prototype.print = function () {
        this.funcoesService.reportInvoc.invocaRelatorio(this.constantes.reportId, {}, {});
    };
    RequisicaoDescargaPermissoes.prototype.remove = function () {
        throw new Error("Method not implemented.");
    };
    ;
    RequisicaoDescargaPermissoes.prototype.detail = function () {
        throw new Error("Method not implemented.");
    };
    ;
    RequisicaoDescargaPermissoes.prototype.cancelaPesagem = function () {
        throw new Error("Method not implemented.");
    };
    ;
    RequisicaoDescargaPermissoes.prototype.create = function () {
        throw new Error("Method not implemented.");
    };
    ;
    RequisicaoDescargaPermissoes.prototype.edit = function () {
        throw new Error("Method not implemented.");
    };
    ;
    RequisicaoDescargaPermissoes.prototype.alterarDatas = function () {
        throw new Error("Method not implemented.");
    };
    ;
    RequisicaoDescargaPermissoes.prototype.refresh = function () {
        throw new Error("Method not implemented.");
    };
    RequisicaoDescargaPermissoes.prototype.alterarDados = function () {
        throw new Error("Method not implemented.");
    };
    ;
    RequisicaoDescargaPermissoes.prototype.filtrar = function () {
        throw new Error("Method not implemented.");
    };
    ;
    RequisicaoDescargaPermissoes.prototype.back = function () {
        throw new Error("Method not implemented.");
    };
    ;
    RequisicaoDescargaPermissoes.prototype.ngOnDestroy = function () {
        this.sub.unsubscribe();
    };
    RequisicaoDescargaPermissoes.prototype.podeMudarRota = function () {
        if (!this.confirmMudancaRota)
            return true;
        return confirm('Tem certeza que deseja sair dessa página?');
    };
    return RequisicaoDescargaPermissoes;
}());



/***/ }),

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

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RequisicaoDescargaRoutingModule", function() { return RequisicaoDescargaRoutingModule; });
/* 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 _requisicao_descarga_alterar_dados_requisicao_descarga_alterar_dados_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./requisicao-descarga-alterar-dados/requisicao-descarga-alterar-dados.component */ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-alterar-dados/requisicao-descarga-alterar-dados.component.ts");
/* harmony import */ var _requisicao_descarga_alterar_datas_requisicao_descarga_alterar_datas_component__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./requisicao-descarga-alterar-datas/requisicao-descarga-alterar-datas.component */ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-alterar-datas/requisicao-descarga-alterar-datas.component.ts");
/* harmony import */ var _requisicao_descarga_form_requisicao_descarga_form_component__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./requisicao-descarga-form/requisicao-descarga-form.component */ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-form/requisicao-descarga-form.component.ts");
/* harmony import */ var _requisicao_descarga_index_requisicao_descarga_index_component__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./requisicao-descarga-index/requisicao-descarga-index.component */ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-index/requisicao-descarga-index.component.ts");
/* harmony import */ var _requisicao_descarga_segunda_pesagem_requisicao_descarga_segunda_pesagem_component__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./requisicao-descarga-segunda-pesagem/requisicao-descarga-segunda-pesagem.component */ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga-segunda-pesagem/requisicao-descarga-segunda-pesagem.component.ts");
/* harmony import */ var _requisicao_descarga_deactivate_guard__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./requisicao-descarga.deactivate.guard */ "./src/app/pages/balanca/requisicao-descarga/requisicao-descarga.deactivate.guard.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: _requisicao_descarga_index_requisicao_descarga_index_component__WEBPACK_IMPORTED_MODULE_6__["RequisicaoDescargaIndexComponent"],
        data: {
            breadcrumb: "RequisicaoDescarga",
            formParams: { action: app_config_enumerables__WEBPACK_IMPORTED_MODULE_2__["ActionForm"].index }
        }
    },
    {
        path: "create",
        component: _requisicao_descarga_form_requisicao_descarga_form_component__WEBPACK_IMPORTED_MODULE_5__["RequisicaoDescargaFormComponent"],
        data: {
            breadcrumb: "RequisicaoDescarga",
            formParams: { action: app_config_enumerables__WEBPACK_IMPORTED_MODULE_2__["ActionForm"].create }
        },
        canDeactivate: [_requisicao_descarga_deactivate_guard__WEBPACK_IMPORTED_MODULE_8__["RequisicaoDescargaFormCandeactivateGuard"]]
    },
    {
        path: "create/:data",
        component: _requisicao_descarga_form_requisicao_descarga_form_component__WEBPACK_IMPORTED_MODULE_5__["RequisicaoDescargaFormComponent"],
        data: {
            breadcrumb: "RequisicaoDescarga",
            formParams: { action: app_config_enumerables__WEBPACK_IMPORTED_MODULE_2__["ActionForm"].create }
        },
        canDeactivate: [_requisicao_descarga_deactivate_guard__WEBPACK_IMPORTED_MODULE_8__["RequisicaoDescargaFormCandeactivateGuard"]]
    },
    {
        path: "edit/:id",
        component: _requisicao_descarga_form_requisicao_descarga_form_component__WEBPACK_IMPORTED_MODULE_5__["RequisicaoDescargaFormComponent"],
        data: {
            breadcrumb: "RequisicaoDescarga",
            formParams: { action: app_config_enumerables__WEBPACK_IMPORTED_MODULE_2__["ActionForm"].edit }
        },
        canDeactivate: [_requisicao_descarga_deactivate_guard__WEBPACK_IMPORTED_MODULE_8__["RequisicaoDescargaFormCandeactivateGuard"]]
    },
    {
        path: "detail/:id",
        component: _requisicao_descarga_form_requisicao_descarga_form_component__WEBPACK_IMPORTED_MODULE_5__["RequisicaoDescargaFormComponent"],
        data: {
            breadcrumb: "RequisicaoDescarga",
            formParams: { action: app_config_enumerables__WEBPACK_IMPORTED_MODULE_2__["ActionForm"].detail }
        }
    },
    {
        path: "segundaPesagem/:id",
        component: _requisicao_descarga_segunda_pesagem_requisicao_descarga_segunda_pesagem_component__WEBPACK_IMPORTED_MODULE_7__["RequisicaoDescargaSegundaPesagemComponent"],
        data: {
            breadcrumb: "RequisicaoDescarga",
            breadcrumbSub: "segundaPesagem",
            formParams: { action: app_config_enumerables__WEBPACK_IMPORTED_MODULE_2__["ActionForm"].edit }
        }
    },
    {
        path: "alterarDados/:id",
        component: _requisicao_descarga_alterar_dados_requisicao_descarga_alterar_dados_component__WEBPACK_IMPORTED_MODULE_3__["RequisicaoDescargaAlterarDadosComponent"],
        data: {
            breadcrumb: "RequisicaoDescarga",
            breadcrumbSub: "AlterarDados",
            formParams: { action: app_config_enumerables__WEBPACK_IMPORTED_MODULE_2__["ActionForm"].edit }
        }
    },
    {
        path: "alterarDatas/:id",
        component: _requisicao_descarga_alterar_datas_requisicao_descarga_alterar_datas_component__WEBPACK_IMPORTED_MODULE_4__["RequisicaoDescargaAlterarDatasComponent"],
        data: {
            breadcrumb: "RequisicaoDescarga",
            breadcrumbSub: "AlterarDatas",
            formParams: { action: app_config_enumerables__WEBPACK_IMPORTED_MODULE_2__["ActionForm"].edit }
        }
    }
];
var RequisicaoDescargaRoutingModule = /** @class */ (function () {
    function RequisicaoDescargaRoutingModule() {
    }
    RequisicaoDescargaRoutingModule = __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"]]
        })
    ], RequisicaoDescargaRoutingModule);
    return RequisicaoDescargaRoutingModule;
}());



/***/ })

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