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

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-alterar-dados-itens/requisicao-descarga-alterar-dados-itens.component.html":
/*!******************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-alterar-dados-itens/requisicao-descarga-alterar-dados-itens.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.listaAlterarDadosItens\"\n    [sisFormularioId]=\"constantes.sisFormularioId\">\n</app-menu-command-bar>\n\n<div class=\"row\">\n    <div class=\"col-lg-12\">\n        <div class=\"section-comand-bar\">\n            <div class=\"uni-botoes\">\n                <div class=\"\" *ngIf=\"!showAdd\">\n                    <button title=\"{{ 'buttons.visualizar' | translate }}\" (click)=\"detail()\" class=\"btn uni-btn btn-sm\"\n                        [disabled]=\"funcoesService.showButtons.detail(actionForm,  data.requisicaoDescargaItemId)\">\n                        <i class=\"icon-eye\"></i>\n                    </button>\n                    <button title=\"{{ 'buttons.editar' | translate }}\" class=\"btn uni-btn btn-sm\" (click)=\"edit()\"\n                        [disabled]=\"funcoesService.showButtons.edit(actionForm,  data.requisicaoDescargaItemId)\">\n                        <i class=\"icon-pencil\"></i>\n                    </button>\n                </div>\n            </div>\n            <div *ngIf=\"showAdd\">\n                <div class=\"\">\n                    <button title=\"{{ 'buttons.editar' | translate }}\" (click)=\"edit()\" type=\"button\"\n                        class=\"btn uni-btn btn-sm\"\n                        [disabled]=\"funcoesService.showButtons.edit(actionForm,  data.requisicaoDescargaItemId)\">\n                        <i class=\"icon-pencil\"></i>\n                    </button>\n                    <button title=\"{{ 'buttons.voltar' | translate }}\" (click)=\"backItens()\" type=\"button\"\n                        class=\"btn uni-btn btn-sm\">\n                        <i class=\"icon-arrow-left\"></i>\n                    </button>\n                </div>\n                <div class=\"clearfix\">&nbsp;</div>\n                <form class=\"form\" #f=\"ngForm\" (ngSubmit)=\"onSubmit(f)\">\n                    <div class=\"row\">\n                        <div class=\"col-lg-12\">\n                            <app-validacoes></app-validacoes>\n                            <div class=\"row\">\n                                <div class=\"col-lg-3\">\n                                    <div class=\"form-group form-group-sm\">\n                                        <label for=\"plataforma\">{{'labels.plataforma' | translate}}</label>\n                                        <app-combo-plataforma id=\"plataformaId\" name=\"plataforma\"\n                                            [(ngModel)]=\"data.plataformaId\"\n                                            [disabled]=\"funcoesService.isDetail(actionForm)\">\n                                        </app-combo-plataforma>\n                                    </div>\n                                </div>\n                                <div class=\"col-lg-3\">\n                                    <div class=\"form-group form-group-sm\">\n                                        <label for=\"tipoDocumentoTransp\" class=\"required\">{{'labels.tipoDocumentoTransp'\n                                            |\n                                            translate}}</label>\n                                        <app-combo-tipo-documento-transp id=\"tipoDocumentoTransp\"\n                                            name=\"tipoDocumentoTransp\" [(ngModel)]=\"data.tipoDocumentoTranspId\"\n                                            [disabled]=\"funcoesService.isDetail(actionForm)\" required\n                                            (outSelected)=\"trataTipoDocumentoTransp($event)\">\n                                        </app-combo-tipo-documento-transp>\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=\"modeloNf\" class=\"required\">{{'labels.modeloNf' | translate}}</label>\n                                        <app-combo-modelo-nota id=\"modeloNf\" name=\"modeloNf\"\n                                            [(ngModel)]=\"data.modeloNotaId\"\n                                            [disabled]=\"funcoesService.isDetail(actionForm)\" required\n                                            (outSelected)=\"trataModeloNota($event)\"></app-combo-modelo-nota>\n                                    </div>\n                                </div>\n                                <div class=\"col-lg-2\" *ngIf=\"constantes.configBal.infPesoFob\">\n                                    <div class=\"form-group form-group-sm\">\n                                        <label for=\"naturezaId\">{{'labels.cfop' |\n                                            translate}}</label>\n                                        <app-pesquisa-natureza id=\"naturezaId\" name=\"naturezaId\"\n                                            [(ngModel)]=\"data.naturezaId\" (outSelected)=\"validaCFOP($event)\"\n                                            [disabled]=\"funcoesService.isDetail(actionForm)\">\n                                        </app-pesquisa-natureza>\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=\"chaveNfe\" class=\"required\">{{'labels.chaveNFE' |\n                                            translate}}</label>\n                                        <div class=\"input-group\">\n                                            <input type=\"text\" id=\"chaveNfe\" name=\"chaveNfe\"\n                                                class=\"form-control form-control-sm\" [(ngModel)]=\"data.chaveNFE\"\n                                                [disabled]=\"funcoesService.isDetail(actionForm)\" [required]=\"true\"\n                                                data-title=\"{{'labels.chaveNFE' | translate}}\" maxlength=\"54\"\n                                                mask=\"0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000\"\n                                                (blur)=\"validaChaveNfe()\">\n                                            <span class=\"input-group-btn\">\n                                                <button type=\"button\" class=\"btn btn-success btn-sm\"\n                                                    [disabled]=\"funcoesService.isDetail(actionForm)\"\n                                                    data-toggle=\"modal\">\n                                                    <i class=\"fa fa-search\"></i>\n                                                </button>\n                                            </span>\n                                        </div>\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=\"numeroDoc\">{{'labels.numeroDoc'\n                                            |\n                                            translate}}</label>\n                                        <input type=\"text\" id=\"numeroDoc\" name=\"numeroDoc\"\n                                            class=\"form-control form-control-sm\" [(ngModel)]=\"data.docto\" maxlength=\"9\"\n                                            mask=\"999999999\"\n                                            [disabled]=\"funcoesService.isDetail(actionForm) || !requiredDadosEntrada\"\n                                            (blur)=\"trataNumeroDoc()\" data-title=\"{{'labels.docto' | translate}}\">\n                                    </div>\n                                </div>\n                                <div class=\"col-lg-2\">\n                                    <div class=\"form-group form-group-sm\">\n                                        <label for=\"serie\">{{'labels.serie' | translate}}</label>\n                                        <app-combo-serie-nota id=\"serie\" name=\"serie\" [(ngModel)]=\"data.serieNotaId\"\n                                            [disabled]=\"funcoesService.isDetail(actionForm) || !requiredDadosEntrada\">\n                                        </app-combo-serie-nota>\n                                    </div>\n                                </div>\n                                <div class=\"col-lg-2\" [class.required]=\"requiredDadosEntrada\">\n                                    <div class=\"form-group form-group-sm\">\n                                        <label for=\"docTranspEmissao\">{{'labels.emissao'\n                                            |\n                                            translate}}</label>\n                                        <app-data id=\"docTranspEmissao\" name=\"docTranspEmissao\"\n                                            [required]=\"requiredDadosEntrada\" [(ngModel)]=\"data.docTranspEmissao\"\n                                            class=\"dataHora\" (executa)=\"validaDtDocto()\"\n                                            [disabled]=\"funcoesService.isDetail(actionForm) || !requiredDadosEntrada\">\n                                        </app-data>\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=\"quantidDoc\">{{ labelQuantidDoc | translate}} </label>\n                                        <input type=\"text\" id=\"quantidDoc\" name=\"quantidDoc\"\n                                            class=\"form-control form-control-sm\" [(ngModel)]=\"data.quantidDoc\"\n                                            [disabled]=\"funcoesService.isDetail(actionForm)\" (blur)=\"calcQuantidDoc()\"\n                                            currencyMask [options]=\"funcoesService.optionCurrency(0)\">\n                                    </div>\n                                </div>\n                                <div class=\"col-lg-2\">\n                                    <div class=\"form-group form-group-sm\">\n                                        <label for=\"pesoDoc\">{{'labels.pesoDoc' | translate}}</label>\n                                        <input type=\"text\" id=\"pesoDoc\" name=\"pesoDoc\"\n                                            class=\"form-control form-control-sm\" [(ngModel)]=\"data.pesoDoc\"\n                                            [disabled]=\"funcoesService.isDetail(actionForm)\"\n                                            data-title=\"{{'labels.pesoDoc' | translate}}\" (blur)=\"calcPesoDoc()\"\n                                            currencyMask [options]=\"funcoesService.optionCurrency(0)\">\n                                    </div>\n                                </div>\n                                <div class=\"col-lg-2\">\n                                    <div class=\"form-group form-group-sm\">\n                                        <label for=\"vlNota\">{{'labels.total' | translate}}</label>\n                                        <input type=\"text\" id=\"vlNota\" name=\"vlNota\"\n                                            class=\"form-control form-control-sm\" [(ngModel)]=\"data.vlNota\"\n                                            [disabled]=\"funcoesService.isDetail(actionForm)\"\n                                            data-title=\"{{'labels.total' | translate}}\" (blur)=\"validaVlNota()\"\n                                            currencyMask [options]=\"funcoesService.optionCurrency(2)\">\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=\"observ\">{{'labels.observacao' | translate}}</label>\n                                        <input type=\"text\" id=\"observ\" name=\"observ\"\n                                            class=\"form-control form-control-sm\" [(ngModel)]=\"data.observ\"\n                                            [disabled]=\"funcoesService.isDetail(actionForm)\" uppercase maxlength=\"70\">\n                                    </div>\n                                </div>\n                            </div>\n                            <div class=\"row\">\n                                <div class=\"col-lg-2 col-md-8 col-sm-12\">\n                                    <div class=\"form-group form-group-sm\">\n                                        <app-pesquisa-saldo-lote-deposito id=\"lote\" name=\"lote\" required=\"true\"\n                                            [modalTitle]=\"'lotes'\" [disabled]=\"funcoesService.isDetail(actionForm)\"\n                                            [field]=\"'loteId'\" [options]=\"saldoLoteOptions\" [(ngModel)]=\"data.loteId\"\n                                            (outModel)=\"trataLote($event)\">\n                                        </app-pesquisa-saldo-lote-deposito>\n                                    </div>\n                                </div>\n                                <div class=\"col-lg-2\">\n                                    <div class=\"form-group form-group-sm\">\n                                        <label for=\"docTranspNumero\">{{'labels.numero' |\n                                            translate}}</label>\n                                        <input type=\"text\" id=\"docTranspNumero\" name=\"numero\"\n                                            class=\"form-control form-control-sm\"\n                                            value=\"{{ data.docTranspNumero | mask: data.maskDocTransNumero }}\"\n                                            [disabled]=\"funcoesService.isDetail(actionForm)\">\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=\"baia\">{{'labels.baia' | translate}}</label>\n                                        <input id=\"baia\" name=\"baia\" [(ngModel)]=\"data.baia\" maxlength=\"10\"\n                                            class=\"form-control form-control-sm\" type=\"text\"\n                                            [disabled]=\"funcoesService.isDetail(actionForm)\">\n                                    </div>\n                                </div>\n                                <div class=\"col-lg-2\" *ngIf=\"constantes.configBal.infPesoFob\">\n                                    <div class=\"form-group form-group-sm\">\n                                        <label for=\"metrofile\">{{\"labels.metrofile\" | translate}}</label>\n                                        <input type=\"text\" id=\"metrofile\" name=\"metrofile\" [(ngModel)]=\"data.metrofile\"\n                                            class=\"form-control form-control-sm\"\n                                            [disabled]=\"funcoesService.isDetail(actionForm)\" maxlength=\"15\" />\n                                    </div>\n                                </div>\n                                <div class=\"col-lg-2\" *ngIf=\"constantes.configBal.infPesoFob\">\n                                    <div class=\"form-group form-group-sm\">\n                                        <label for=\"contrato\">{{'labels.contrato' | translate}}</label>\n                                        <input type=\"text\" id=\"contrato\" name=\"contrato\"\n                                            class=\"form-control form-control-sm\" [(ngModel)]=\"data.contrato\"\n                                            mask=\"0-00-0000-00000000\" [disabled]=\"funcoesService.isDetail(actionForm)\"\n                                            maxlength=\"18\">\n                                    </div>\n                                </div>\n                            </div>\n                            <div class=\"form-group\">\n                                <button class=\"btn btn-success mr-2\" type=\"submit\"\n                                    [disabled]=\"funcoesService.isDetail(actionForm)\">{{\n                                    'buttons.salvar' | translate }}\n                                </button>\n                                <button class=\"btn btn-default\" type=\"button\"\n                                    [disabled]=\"funcoesService.isDetail(actionForm)\" (click)=\"cancelar(data)\">\n                                    {{ 'buttons.cancelar' | translate }}\n                                </button>\n                            </div>\n                        </div>\n                    </div>\n                </form>\n            </div>\n            <div class=\"row\" *ngIf=\"!showAdd\">\n                <div class=\"col-lg-12\">\n                    <div class=\"table-overflow\">\n                        <table class=\"table table-striped table-bordered table-hover rownowrap form-control-sm\">\n                            <thead>\n                                <tr>\n                                    <th class=\"text-right\">{{ 'labels.requisicao' | translate }}</th>\n                                    <th class=\"text-left\">{{ 'labels.item' | translate }}</th>\n                                    <th class=\"text-left\">{{ 'labels.lote' | translate }}</th>\n                                    <th class=\"text-left\">{{ 'labels.cliente' | translate }}</th>\n                                    <th class=\"text-left\">{{ 'labels.emitente' | translate }}</th>\n                                </tr>\n                            </thead>\n                            <tbody>\n                                <tr *ngFor=\"let c of dados | removeExcluidos; let i = index\" (click)=\"selected(c, i)\"\n                                    class=\"clickable\" [ngClass]=\"{ 'info' : i === currentIndex }\">\n                                    <td width=\"10%\" class=\"text-right\">{{c.requisicaoDescargaId}}</td>\n                                    <td class=\"text-left\">{{c.requisicaoDescargaItemId}}</td>\n                                    <td class=\"text-left\">{{c.loteId}}</td>\n                                    <td class=\"text-left\">{{c.fantasiaCliente}}</td>\n                                    <td class=\"text-left\">{{c.fantasiaEmitente}}</td>\n                                </tr>\n                                <tr *ngIf=\"!dados || dados.length === 0\">\n                                    <th colspan=\"9\">\n                                        {{'messages.nenhumRegistroEncontrado' | translate }}\n                                    </th>\n                                </tr>\n                            </tbody>\n                        </table>\n                    </div>\n                </div>\n            </div>\n            <div *ngIf=\"!showAdd\" class=\"col-lg-8 col-md-8 col-sm-12\">\n                <button class=\"btn btn-success mr-2\" [disabled]=\"!dados || dados.length === 0 || naoAlterou\"\n                    (click)=\"gravar()\" type=\"button\">\n                    {{ 'buttons.gravar' | translate }}\n                </button>\n                <button class=\"btn btn-danger mr-2\" [disabled]=\"!dados || dados.length === 0 || naoAlterou\"\n                    (click)=\"cancelarGeral()\" type=\"button\">\n                    {{ 'buttons.cancelar' | translate }}\n                </button>\n            </div>\n        </div>\n    </div>\n</div>");

/***/ }),

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-alterar-dados/requisicao-descarga-alterar-dados.component.html":
/*!******************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/pontafelix/movimentos/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            <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></app-validacoes>\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]=\"constantes.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]=\"constantes.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]=\"constantes.configBal.sPerDesComis\">\n                                        <option value=\"\">{{'labels.selecione'|translate}}</option>\n                                        <option value=\"0\">0</option>\n                                        <option value=\"10\">10</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\" class=\"required\">\n                                        {{'labels.tipoOperacao' | translate}}\n                                    </label>\n                                    <app-combo-tipo-operacao id=\"tipoOperacao\" name=\"tipoOperacao\" required\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-md-6 col-sm-12\">\n                                <div class=\"form-group form-group-sm\">\n                                    <label for=\"plataforma\">{{ 'labels.plataforma' |\n                                        translate}}</label>\n                                    <app-combo-padrao id=\"plataforma\" name=\"plataforma\" tabela=\"Plataforma\"\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\">\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)\" [inSelected]=\"data.cliente\"\n                                        required=\"true\">\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)=\"trataMaterial($event)\" [(ngModel)]=\"data.materialId\"\n                                        required=\"true\">\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-saldo-lote-deposito id=\"lote\" name=\"lote\" required=\"true\" [label]=\"'lote'\"\n                                    [modalTitle]=\"'lotes'\" [(ngModel)]=\"data.loteId\"\n                                    [disabled]=\"constantes.configCtv.solicitaPlanejEv && !data.tanqueId\"\n                                    [field]=\"'loteId'\" [options]=\"saldoLoteOptions\" (outModel)=\"trataLote($event)\">\n                                </app-pesquisa-saldo-lote-deposito>\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: 5\" 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\" (outSelected)=\"trataTipoTransp($event)\">\n                                    </app-combo-tipos-de-transporte>\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]=\"tipoTransporte\"\n                                        showCgcCpf=\"true\" 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\" *ngIf=\"constantes.configCtv.habCampoShipment\">\n                            <div class=\"col-lg-3\">\n                                <div class=\"form-group form-group-sm\">\n                                    <label for=\"shipment\">{{'labels.shipment' | translate}}</label>\n                                    <input id=\"shipment\" name=\"shipment\" [(ngModel)]=\"data.shipment\" maxlength=\"12\"\n                                        class=\"form-control form-control-sm\" type=\"text\" [disabled]=\"!enableShipment\"\n                                        currencyMask [options]=\"funcoesService.optionCurrency(0)\">\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                                    <button class=\"btn btn-default\" (click)=\"back()\" type=\"button\" [disabled]=\"false\">{{\n                                        'buttons.cancelar' | 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/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-alterar-datas/requisicao-descarga-alterar-datas.component.html":
/*!******************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/pontafelix/movimentos/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\" [class.required]=\"permissaoDatasOCD\">{{'labels.triagem' |\n                                        translate}}</label>\n                                    <app-data-h-m-s id=\"dtTriagemAD\" name=\"dtTriagemAD\" [(ngModel)]=\"data.dtTriagem\"\n                                        [required]=\"permissaoDatasOCD\" (executa)=\"trataJustAtraso(true)\">\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\" [disabled]=\"permissaoDatasOCD && !permissao.todosCampos\"\n                                        (executa)=\"trataDtChegada($event)\">\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                                        [disabled]=\"permissaoDatasOCD && !permissao.todosCampos\"\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                                        [disabled]=\"permissaoDatasOCD && (!permissao.todosCampos || !permissao.inicioOperacao)\"\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                                        [disabled]=\"permissaoDatasOCD && (!permissao.todosCampos || !permissao.fimOperacao)\">\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\" class=\"required\">{{'labels.saida' | translate}}</label>\n                                    <app-data-h-m-s id=\"dtSaida\" name=\"dtSaida\" [(ngModel)]=\"data.dtSaida\"\n                                        [disabled]=\"permissaoDatasOCD && !permissao.todosCampos\" [required]=\"true\"\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' |\n                                        translate}}</label>\n                                    <app-data-h-m-s id=\"dtLibVeiculoAD\" name=\"dtLibVeiculoAD\"\n                                        [(ngModel)]=\"data.dtLibVeiculo\"\n                                        [disabled]=\"permissaoDatasOCD && !permissao.todosCampos\"\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=\"text\"\n                                        [disabled]=\"permissaoDatasOCD && !permissao.todosCampos\" appNumbersPositive\n                                        (keypress)=\"funcoes.apenasNumeros($event)\"\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                                        [disabled]=\"permissaoDatasOCD && !permissao.todosCampos\"\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]=\"!disabledQuebra\">{{'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\">\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\">\n                                        </app-combo-padrao>\n                                    </app-field-container>\n                                </div>\n                            </div>\n                            <div class=\"col-lg-4 pl-0\">\n                                <label></label>\n                                <div class=\"col-sm-10 pl-0\">\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/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-filter/requisicao-descarga-filter.component.html":
/*!****************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/pontafelix/movimentos/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-40\">\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                                        (executa)=\"validaDatas()\" 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\"\n                                        (executa)=\"validaDatas()\" 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/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-form/requisicao-descarga-form.component.html":
/*!************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/pontafelix/movimentos/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.cliPontaRequisicaoDescargaId\">\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\" (click)=\"abaClicada('D')\" href=\"#ta\">{{\n              \"labels.dados\" | translate\n              }}</a>\n          </li>\n          <li class=\"nav-item\">\n            <a class=\"nav-link\" data-toggle=\"tab\" (click)=\"abaClicada('I')\" 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          <form id=\"frmRequisicaoDescarga\" class=\"form\" #frmRequisicaoDescarga=\"ngForm\"\n            (ngSubmit)=\"onSubmit(frmRequisicaoDescarga)\">\n            <app-validacoes></app-validacoes>\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\" class=\"form-control form-control-sm text-right\"\n                    [(ngModel)]=\"funcoesService.isCreate(actionForm) ? 0 : data.cliPontaRequisicaoDescargaId\"\n                    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\" [(ngModel)]=\"data.checkListId\"\n                      class=\"form-control form-control-sm text-right\" 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\" [(ngModel)]=\"data.checkListItemId\"\n                    class=\"form-control form-control-sm text-right\" type=\"text\" disabled />\n                </div>\n              </div>\n              <div class=\"col-lg-3\" *ngIf=\"constantes.configCtv.habCampoShipment\">\n                <div class=\"form-group form-group-sm\">\n                  <label for=\"shipment\">{{'labels.shipment' | translate}}</label>\n                  <input id=\"shipment\" name=\"shipment\" [(ngModel)]=\"data.shipment\" maxlength=\"12\"\n                    class=\"form-control form-control-sm\" type=\"text\"\n                    [disabled]=\"!enableShipment || funcoesService.isDetail(actionForm)\" currencyMask\n                    [options]=\"funcoesService.optionCurrency(0)\">\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-s id=\"emissao\" name=\"emissao\" [(ngModel)]=\"data.dtRequisicao\"\n                    (executa)=\"validaDtRequisicao()\" [disabled]=\"funcoesService.isDetail(actionForm)\" required>\n                  </app-data-h-m-s>\n                </div>\n              </div>\n              <div class=\"col-lg-3\">\n                <div class=\"form-group form-group-sm\" *ngIf=\"balancaRequired\">\n                  <label for=\"balanca\" [class.required]=\"balancaRequired\">{{\"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.isDetail(actionForm)\" [required]=\"balancaRequired\"\n                    (outSelected)=\"trataBalanca($event)\">\n                  </app-combo-padrao>\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=\"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                    [disabledInput]=\"constantes.configBal.pesagemAutomatica || funcoesService.isDetail(actionForm)\"\n                    [disabled]=\"funcoesService.isDetail(actionForm)\" [disabledBtn]=\"funcoesService.isDetail(actionForm)\"\n                    [backgroundColor]=\"'yellow'\" [pesagemAutomatica]=\"btnPesagemVisivel\">\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=\"placaCavalo\">{{\n                    \"labels.placaCavalo\" | translate\n                    }}</label>\n                  <input id=\"placaCavalo\" name=\"placaCavalo\" value=\"{{\n                      data.placaCavalo | 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                  <app-combo-estado id=\"estadoIdCavalo\" name=\"estadoIdCavalo\" [(ngModel)]=\"data.estadoIdCavalo\"\n                    disabled>\n                  </app-combo-estado>\n                </div>\n              </div>\n              <div class=\"col-lg-2\">\n                <div class=\"form-group form-group-sm\">\n                  <label for=\"placaCarreta1\">{{\n                    \"labels.placaCarreta1\" | translate\n                    }}</label>\n                  <input id=\"placaCarreta1\" name=\"placaCarreta1\" value=\"{{\n                      data.placaCarreta1 | 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=\"placaCarreta2\">{{\n                    \"labels.placaCarreta2\" | translate\n                    }}</label>\n                  <input id=\"placaCarreta2\" name=\"placaCarreta2\" value=\"{{\n                      data.placaCarreta2 | 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: yellow;\" name=\"pesoTara\" [(ngModel)]=\"data.pesoTara\"\n                    class=\"form-control form-control-sm\" type=\"text\" currencyMask\n                    [options]=\"funcoesService.optionCurrency(0)\" disabled />\n                </div>\n              </div>\n            </div>\n            <div class=\"row\">\n              <div class=\"col-lg-6\">\n                <app-pesquisa-motorista id=\"motorista\" name=\"motorista\" label=\"motorista\" modalTitle=\"pesquisaMotorista\"\n                  [(ngModel)]=\"data.motoristaId\" [showCpf]=\"true\" [inputMotorista]=\"data.motorista\" required=\"true\"\n                  (outMotorista)=\"trataMotorista($event)\" [disabled]=\"true\"\n                  [disabledButtonDocMoto]=\"!habilitaBtnDocMoto\" (outButtonDocMoto)=\"trataButtonDocMoto($event)\"\n                  [showButtonDocMoto]=\"constantes.configBal.obrVisualizarDocMoto\">\n                </app-pesquisa-motorista>\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\" style=\"background-color: yellow;\" [(ngModel)]=\"data.pesoLiq\"\n                    class=\"form-control form-control-sm\" type=\"text\" currencyMask\n                    [options]=\"funcoesService.optionCurrency(0)\" disabled />\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-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\">\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\" currencyMask\n                          [options]=\"funcoesService.optionCurrency(0)\" disabled />\n                      </div>\n                    </div>\n                    <div class=\"col-lg-6\">\n                      <div class=\"form-group form-group-sm\">\n                        <label for=\"terno\" class=\"required\">{{ \"labels.terno\" | translate }}</label>\n                        <app-combo-terno id=\"terno\" name=\"terno\" [(ngModel)]=\"data.ternoId\"\n                          [disabled]=\"funcoesService.isDetail(actionForm)\" required=\"true\"></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>\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                  <button class=\"btn btn-danger\" (click)=\"limparTmp(true)\" type=\"button\" [disabled]=\"!(data?.regTmp)\"\n                    [disabled]=\"funcoesService.isDetail(actionForm)\">{{ 'buttons.cancelar' | 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.requisicaoDescargaItens\" [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-foto-ocr></app-foto-ocr>\n<app-requisicao-descarga-print-etiquetas-modal\n  (outConfirma)=\"retPrintEtiquetas()\"></app-requisicao-descarga-print-etiquetas-modal>");

/***/ }),

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-index/requisicao-descarga-index.component.html":
/*!**************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/pontafelix/movimentos/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]=\"data.cliPontaRequisicaoDescargaId\">\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 class=\"text-danger\">{{ 'labels.veiculoDesmembrado' | 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]=\"disabledBtn2Pesagem\" (click)=\"segundaPesagem()\"\n        type=\"button\">{{('labels.' + labelBtnSegundaPesagem) |\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</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=\"{{titleDescricaoMotivoModal}}\" (outMotivo)=\"executeExclusaoOuCancelPesagem($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>\n<app-requisicao-descarga-pesagem-veiculo-desmembrado (outConfirma)=\"retPesagemVeiculoDesmembrado($event)\"></app-requisicao-descarga-pesagem-veiculo-desmembrado>");

/***/ }),

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-item/requisicao-descarga-item.component.html":
/*!************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/pontafelix/movimentos/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        <app-menu-button title=\"{{ 'buttons.novo' | translate }}\" [icon]=\"'icon-plus'\" (click)=\"create()\"\r\n            [disabled]=\"disabled\">\r\n        </app-menu-button>\r\n        <button title=\"{{ 'buttons.visualizar' | translate }}\" (click)=\"detail()\" class=\"btn uni-btn btn-sm\"\r\n            [disabled]=\"funcoesService.showButtons.detail(actionForm,  dataAux.cliPontaRequisicaoDescargaItemId)\">\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.cliPontaRequisicaoDescargaItemId)\">\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.cliPontaRequisicaoDescargaItemId)\">\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        <button title=\"{{ 'buttons.editar' | translate }}\" (click)=\"edit()\" type=\"button\" class=\"btn uni-btn btn-sm\"\r\n            [disabled]=\"disabled || funcoesService.showButtons.edit(actionForm,  dataAux.cliPontaRequisicaoDescargaItemId)\">\r\n            <i class=\"icon-pencil\"></i>\r\n        </button>\r\n        <button title=\"{{ 'buttons.voltar' | translate }}\" (click)=\"back()\" type=\"button\" class=\"btn uni-btn btn-sm\">\r\n            <i class=\"icon-arrow-left\"></i>\r\n        </button>\r\n    </div>\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-lg-8\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <app-pesquisa-destinatario id=\"clienteItem\" name=\"cliente\" tipoDestinatario=\"C\"\r\n                                modalTitle=\"pesquisaDeCliente\" label=\"cliente\" [(ngModel)]=\"data.destinatarioIdCliente\"\r\n                                showInscricao=\"false\" 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-lg-8\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <app-pesquisa-destinatario id=\"emitenteItem\" name=\"emitente\" tipoDestinatario=\"C\"\r\n                                modalTitle=\"pesquisaDeEmitente\" label=\"emitente\"\r\n                                [(ngModel)]=\"data.destinatarioIdEmitente\" showInscricao=\"false\" 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-6\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <app-input-description [label]=\"'produto'\" [valueID]=\"data.materialId\"\r\n                                [valueDescription]=\"data?.material?.descrMater\">\r\n                            </app-input-description>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"row\">\r\n                    <div class=\"col-md-2 col-lg-2\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <app-pesquisa-saldo-lote-deposito id=\"deposito\" name=\"deposito\" required=\"true\"\r\n                                [label]=\"'deposito'\" [modalTitle]=\"'deposito'\" [disabled]=\"disableDeposito\"\r\n                                [field]=\"'tanqueId'\" [options]=\"saldoDepositoOptions\" [(ngModel)]=\"data.tanqueId\"\r\n                                (outModel)=\"trataDeposito($event)\">\r\n                            </app-pesquisa-saldo-lote-deposito>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"row\">\r\n                    <div class=\"col-lg-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                                [(ngModel)]=\"data.lote.precoArmazenado\" currencyMask\r\n                                [options]=\"funcoesService.optionCurrency(8)\" class=\"form-control form-control-sm\"\r\n                                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=\"densidadeLote\">{{ \"labels.densidadeLote\" | translate }}</label>\r\n                            <input type=\"text\" id=\"densidadeLote\" name=\"densidadeLote\" [(ngModel)]=\"data.lote.densidade\"\r\n                                currencyMask [options]=\"funcoesService.optionCurrency(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]=\"isEnabledQuantid\"> {{ getLabelQuantid |\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]=\"!isEnabledQuantid || funcoesService.isDetail(actionForm)\" currencyMask\r\n                                [options]=\"funcoesService.optionCurrency(0)\" [required]=\"isEnabledQuantid\" />\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=\"plataformaId\">{{'labels.plataforma' | translate}}</label>\r\n                            <app-combo-plataforma id=\"plataformaId\" name=\"plataformaId\" [(ngModel)]=\"data.plataformaId\"\r\n                                [disabled]=\"funcoesService.isDetail(actionForm)\" required=\"false\">\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>\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) || disabledtipoDocumentoTransp\" 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]=\"!disableDocTranspNumero\">{{'labels.numero' |\r\n                                translate}}</label>\r\n                            <input type=\"text\" id=\"docTranspNumero\" name=\"numero\" class=\"form-control form-control-sm\"\r\n                                value=\"{{ data.docTranspNumero | mask: data.maskDocTransNumero }}\"\r\n                                [disabled]=\"disableDocTranspNumero\" [required]=\"!disableDocTranspNumero\">\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>\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=\"chaveNfe\"\r\n                                [class.required]=\"requiredDadosNfe || obrigaImportacaoDeDanfe\">{{'labels.chaveNFE' |\r\n                                translate}}</label>\r\n                            <div class=\"input-group\">\r\n                                <input type=\"text\" id=\"chaveNfe\" name=\"chaveNfe\" class=\"form-control form-control-sm\"\r\n                                    [(ngModel)]=\"data.chaveNFE\" [disabled]=\"disabledChaveNfe\"\r\n                                    [required]=\"requiredDadosNfe || obrigaImportacaoDeDanfe\"\r\n                                    data-title=\"{{'labels.chaveNFE' | translate}}\" maxlength=\"54\"\r\n                                    mask=\"0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000\"\r\n                                    (blur)=\"validaChaveNfe()\">\r\n                                <span class=\"input-group-btn\">\r\n                                    <button type=\"button\" class=\"btn btn-success btn-sm\" [disabled]=\"disabledChaveNfe\"\r\n                                        (click)=\"importarDanfe(data.chaveNFE)\" title=\"Importa DANFE\">\r\n                                        <i class=\"fa fa-search\"></i>\r\n                                    </button>\r\n                                </span>\r\n                            </div>\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\">{{'labels.emissao'\r\n                                |\r\n                                translate}}</label>\r\n                            <app-data id=\"docTranspEmissao\" name=\"docTranspEmissao\" [(ngModel)]=\"data.docTranspEmissao\"\r\n                                class=\"dataHora\" [formatDateTime]=\"mascara.getFormatData\" (executa)=\"trataDtDocto()\"\r\n                                [disabled]=\"funcoesService.isDetail(actionForm)\">\r\n                            </app-data>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"row\">\r\n                    <div class=\"col-lg-2\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"numeroDoc\" [class.required]=\"requiredDadosNfe\">{{'labels.numeroDoc' |\r\n                                translate}}</label>\r\n                            <input type=\"text\" id=\"numeroDoc\" name=\"numeroDoc\" class=\"form-control form-control-sm\"\r\n                                [(ngModel)]=\"data.docto\" maxlength=\"9\" mask=\"999999999\"\r\n                                [disabled]=\"disabledQuantidDocEPesoDocEVlNota|| disabledDoctoESerie\"\r\n                                (blur)=\"trataNumeroDoc()\" [required]=\"requiredDadosNfe\"\r\n                                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]=\"requiredDadosNfe\">{{'labels.serie' | translate}}</label>\r\n                            <app-combo-serie-nota id=\"serie\" name=\"serie\" [(ngModel)]=\"data.serieNotaId\"\r\n                                [disabled]=\"disabledQuantidDocEPesoDocEVlNota|| disabledDoctoESerie\"\r\n                                [required]=\"requiredDadosNfe\">\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]=\"requiredDadosNfe\">{{'labels.emissao' |\r\n                                translate}}</label>\r\n                            <app-data id=\"emissao\" name=\"emissao\" [(ngModel)]=\"data.dtDocto\"\r\n                                [disabled]=\"disabledQuantidDocEPesoDocEVlNota || disabledDoctoESerie\" class=\"dataHora\"\r\n                                [formatDateTime]=\"mascara.getFormatData\" data-title=\"{{'labels.emissao' | translate}}\"\r\n                                [required]=\"requiredDadosNfe\">\r\n                            </app-data>\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\">{{'labels.tipoFrete' | translate}}</label>\r\n                            <app-combo-tipo-frete id=\"tipoFrete\" name=\"tipoFrete\" [(ngModel)]=\"data.tipoFrete\"\r\n                                [disabled]=\"funcoesService.isDetail(actionForm)\">\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-2\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"quantidDoc\" class=\"required\">{{ getLabelQuantidDoc | translate}} </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}}\" (blur)=\"calcQuantidDoc()\" currencyMask\r\n                                [options]=\"funcoesService.optionCurrency(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}}\" (blur)=\"calcPesoDoc()\" currencyMask\r\n                                [options]=\"funcoesService.optionCurrency(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}}\" (blur)=\"validaVlNota()\" currencyMask\r\n                                [options]=\"funcoesService.optionCurrency(2)\">\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-2\" *ngIf=\"constants.configBal.infPesoFob\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"naturezaId\" [class.required]=\"constants.configBal.infPesoFob\">{{'labels.cfop' |\r\n                                translate}}</label>\r\n                            <app-pesquisa-natureza id=\"naturezaId\" name=\"naturezaId\"\r\n                                [required]=\"constants.configBal.infPesoFob\" [(ngModel)]=\"data.naturezaId\"\r\n                                (outSelected)=\"validaCFOP($event)\" [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-6\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <app-lacre id=\"lacreAmostra\" name=\"lacreAmostra\" label=\"lacreAmostra\"\r\n                                [(ngModel)]=\"data.lacreAmostra\" [disabled]=\"funcoesService.isDetail(actionForm)\"\r\n                                [params]=\"paramsLacre\">\r\n                            </app-lacre>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-2\" *ngIf=\"constants.configBal.infPesoFob\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"metrofile\">{{\"labels.metrofile\" | translate}}</label>\r\n                            <input type=\"text\" id=\"metrofile\" name=\"metrofile\" [(ngModel)]=\"data.metrofile\"\r\n                                class=\"form-control form-control-sm\" [disabled]=\"funcoesService.isDetail(actionForm)\"\r\n                                maxlength=\"15\" />\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=\"observ\">{{'labels.observacao' | translate}}</label>\r\n                            <input type=\"text\" id=\"observ\" name=\"observ\" class=\"form-control form-control-sm\"\r\n                                [(ngModel)]=\"data.observ\" [disabled]=\"funcoesService.isDetail(actionForm)\" uppercase\r\n                                maxlength=\"70\">\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-2\" *ngIf=\"constants.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\" mask=\"0-00-0000-00000000\"\r\n                                [disabled]=\"funcoesService.isDetail(actionForm)\" maxlength=\"18\">\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-bordered table-hover rownowrap table-sm\">\r\n                <thead>\r\n                    <tr>\r\n                        <th class=\"text-right\">{{ '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-right\">{{ 'labels.peso' | translate }}</th>\r\n                        <th class=\"text-right\">{{ '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)=\"selected(c)\">\r\n                        <td class=\"text-right\">{{c.autorizacao}}</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-right\">{{c.pesoDoc | formatCurrency: 0}}</td>\r\n                        <td class=\"text-right\">{{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/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-pesagem-anterior/requisicao-descarga-pesagem-anterior.component.html":
/*!************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/pontafelix/movimentos/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/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-pesagem-veiculo-desmembrado/requisicao-descarga-pesagem-veiculo-desmembrado.component.html":
/*!**********************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-pesagem-veiculo-desmembrado/requisicao-descarga-pesagem-veiculo-desmembrado.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-veiculo-desmembrado-dialog\" tabindex=\"-1\" role=\"dialog\"\r\n    data-backdrop=\"static\">\r\n    <div class=\"uni-modal-dialog-md-30\">\r\n        <div class=\"modal-content\">\r\n            <div class=\"modal-header\">\r\n                <h6 class=\"modal-title\">{{ 'titles.pesagemVeiculoDesmembrado' | translate }}</h6>\r\n            </div>\r\n            <form class=\"form\" #form=\"ngForm\" (ngSubmit)=\"onSubmit(form)\">\r\n                <app-validacoes></app-validacoes>\r\n                <div class=\"modal-body\">\r\n                    <div class=\"row\">\r\n                        <div class=\"col-lg-6 col-md-6 col-sm-12\">\r\n                            <div class=\"form-group form-group-sm\">\r\n                                <label for=\"placaCavalo\">{{'labels.placaCavalo' | translate}}</label>\r\n                                <input id=\"placaCavalo\" name=\"placaCavalo\" [(ngModel)]=\"data.placa\"\r\n                                    class=\"form-control form-control-sm\" type=\"text\" maxlength=\"18\" disabled>\r\n                            </div>\r\n                        </div>\r\n                        <div class=\"col-lg-6 col-md-6 col-sm-12\">\r\n                            <div class=\"form-group form-group-sm\">\r\n                                <label for=\"carreta\">{{'labels.carreta' | translate}}</label>\r\n                                <input id=\"carreta\" name=\"carreta\" [(ngModel)]=\"data.placaCarreta\"\r\n                                    class=\"form-control form-control-sm\" type=\"text\" maxlength=\"18\" disabled>\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=\"pesoBruto\">{{\r\n                                    \"labels.pesoBruto\" | translate\r\n                                    }}</label>\r\n                                <input id=\"pesoBruto\" name=\"pesoBruto\" [(ngModel)]=\"data.pesoBruto\"\r\n                                    class=\"form-control form-control-sm\" type=\"text\" currencyMask\r\n                                    [options]=\"funcoesService.optionCurrency(0)\" disabled />\r\n                            </div>\r\n                        </div>\r\n                        <div class=\"col-lg-6 col-md-6 col-sm-12\">\r\n                            <div class=\"form-group form-group-sm\">\r\n                                <label for=\"pesoLiquido\">{{\r\n                                    \"labels.pesoLiquido\" | translate\r\n                                    }}</label>\r\n                                <input id=\"pesoLiquido\" name=\"pesoLiquido\" [(ngModel)]=\"data.pesoLiquido\"\r\n                                    class=\"form-control form-control-sm\" type=\"text\" currencyMask\r\n                                    [options]=\"funcoesService.optionCurrency(0)\" disabled />\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"row\">\r\n                        <div class=\"col-lg-6 col-md-6 col-sm-12\">\r\n                            <div class=\"form-group form-group-sm\">\r\n                                <label for=\"pesoTara\" class=\"required\">{{\r\n                                    \"labels.pesoTara\" | translate\r\n                                    }}</label>\r\n                                <app-captura-peso id=\"pesoTara\" name=\"pesoTara\" [(ngModel)]=\"data.pesoTara\"\r\n                                    [balancaId]=\"data.balancaId\" (outSelected)=\"getPeso($event)\"\r\n                                    (outBlur)=\"getPeso($event)\" [required]=\"true\"\r\n                                    [disabledInput]=\"constantes.configBal.pesagemAutomatica\"\r\n                                    [disabledBtn]=\"!btnPesagemVisivel\" [backgroundColor]=\"'yellow'\"\r\n                                    [pesagemAutomatica]=\"btnPesagemVisivel\">\r\n                                </app-captura-peso>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"modal-footer\">\r\n                    <button class=\"btn btn-success mr-2\" type=\"submit\">{{ 'buttons.ok' | translate }}\r\n                    </button>\r\n                    <button class=\"btn btn-default mr-2\" (click)=\"cancelar()\" type=\"button\">\r\n                        {{ 'buttons.cancelar' | translate }}\r\n                    </button>\r\n                </div>\r\n            </form>\r\n        </div>\r\n    </div>\r\n</div>");

/***/ }),

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

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("<div class=\"modal\" id=\"requisicao-descarga-print-etiquetas-modal-dialog\" tabindex=\"-1\" role=\"dialog\"\r\n    data-backdrop=\"static\">\r\n    <div class=\"uni-modal-dialog-md-30\">\r\n        <div class=\"modal-content\">\r\n            <div class=\"modal-header\">\r\n                <h6 class=\"modal-title\">{{ 'titles.impressaoDeEtiquetas' | translate }}</h6>\r\n            </div>\r\n            <form class=\"form\" #form=\"ngForm\" (ngSubmit)=\"onSubmit(form)\">\r\n                <app-validacoes></app-validacoes>\r\n                <div class=\"modal-body\">\r\n                    <div class=\"row\">\r\n                        <div class=\"col-lg-6 col-sm-12\">\r\n                            <div class=\"form-group form-group-sm\">\r\n                                <label for=\"etiquetaDe\" class=\"required\">{{ 'labels.etiquetaDe' | translate }}</label>\r\n                                <input id=\"etiquetaDe\" name=\"etiquetaDe\" [(ngModel)]=\"filtro.etiquetaInicialId\"\r\n                                    class=\"form-control form-control-sm text-right\" type=\"text\" maxlength=\"5\"\r\n                                    (blur)=\"validaNumEtiquetas()\" (keypress)=\"funcoesService.apenasNumeros($event)\" />\r\n                            </div>\r\n                        </div>\r\n                        <div class=\"col-lg-6 col-sm-12\">\r\n                            <div class=\"form-group form-group-sm\">\r\n                                <label for=\"ate\" class=\"required\">{{ 'labels.ate' | translate }}</label>\r\n                                <input id=\"ate\" name=\"ate\" [(ngModel)]=\"filtro.etiquetaFinalId\"\r\n                                    class=\"form-control form-control-sm text-right\" type=\"text\" maxlength=\"5\"\r\n                                    (blur)=\"validaNumEtiquetas()\" (keypress)=\"funcoesService.apenasNumeros($event)\" />\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"modal-footer\">\r\n                    <button class=\"btn btn-success mr-2\" type=\"submit\">{{ 'buttons.imprimir' | translate }}\r\n                    </button>\r\n                    <button class=\"btn btn-default mr-2\" (click)=\"cancelar()\" type=\"button\">\r\n                        {{ 'buttons.cancelar' | translate }}\r\n                    </button>\r\n                </div>\r\n            </form>\r\n        </div>\r\n    </div>\r\n</div>");

/***/ }),

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-report/requisicao-descarga-report.component.html":
/*!****************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/pontafelix/movimentos/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/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-segunda-pesagem/requisicao-descarga-segunda-pesagem.component.html":
/*!**********************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/pontafelix/movimentos/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\" [class.required]=\"operadorObrigatorio\">{{'labels.operador' |\r\n                                        translate}}</label>\r\n                                    <input id=\"oper\" name=\"oper\" [(ngModel)]=\"data.oper2Pes\"\r\n                                        class=\"form-control form-control-sm\" type=\"text\" (blur)=\"checarIntegracoes()\"\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\" [disabled]=\"false\"\r\n                                        [(ngModel)]=\"data.dtIniOper\" (executa)=\"trataJustAtraso()\">\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\" [disabled]=\"false\"\r\n                                        [(ngModel)]=\"data.dtFimOper\" (executa)=\"trataDtFimOper($event)\">\r\n                                    </app-data-h-m-s>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class=\"row\">\r\n                            <div class=\"col-lg-3\" *ngIf=\"constantes.configBal.codBalCheckList\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <label for=\"balancaId\"\r\n                                        [class.required]=\"constantes.configBal.codBalCheckList\">{{'labels.balanca' |\r\n                                        translate}}</label>\r\n                                    <app-combo-padrao id=\"balancaId\" name=\"balanca\" [(ngModel)]=\"data.balancaId\"\r\n                                        tabela=\"Balanca\" chave=\"CodBalanca\" descricao=\"DescrBalanca\"\r\n                                        (outSelected)=\"trataBalanca($event)\">\r\n                                    </app-combo-padrao>\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=\"terno\"\r\n                                        [class.required]=\"constantes.configBal.obrTernoDesc\">{{'labels.terno' |\r\n                                        translate}}</label>\r\n                                    <app-combo-terno id=\"ternoId\" name=\"terno\" [(ngModel)]=\"data.ternoId\">\r\n                                    </app-combo-terno>\r\n                                </div>\r\n                            </div>\r\n                            <div class=\"col-lg-3 col-md-6 col-sm-12\" *ngIf=\"constantes.configBal.sPerDesComis\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <label for=\"percDescargaComissionada\"\r\n                                        [class.required]=\"constantes.configBal.sPerDesComis\">{{\"labels.percDescargaComissionada\"\r\n                                        |\r\n                                        translate }}</label>\r\n                                    <select id=\"percDescargaComissionada\" name=\"percDescargaComissionada\"\r\n                                        [(ngModel)]=\"data.percDescargaComissionada\"\r\n                                        class=\"form-control form-control-sm\">\r\n                                        <option value=\"\">{{'labels.selecione'|translate}}</option>\r\n                                        <option value=\"0\">0</option>\r\n                                        <option value=\"20\">20</option>\r\n                                        <option value=\"100\">100</option>\r\n                                    </select>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class=\"row\">\r\n                            <div class=\"col-lg-2\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <label for=\"pesoBru\" class=\"required\">{{'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\" style=\"background-color: yellow;\" name=\"pesoTara\"\r\n                                            [(ngModel)]=\"data.pesoTara\" class=\"form-control form-control-sm\" type=\"text\"\r\n                                            disabled currencyMask [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                                    <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                                </div>\r\n                            </div>\r\n                            <div class=\"col-lg-2 pl-0\">\r\n                                <label></label>\r\n                                <div class=\"col-sm-10 pl-0\">\r\n                                    <p class=\"form-control-static text-danger\"> <strong>{{ statusQuebraOuSobra }}\r\n                                        </strong></p>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class=\"row\">\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)\" [backgroundColor]=\"'yellow'\"\r\n                                            [pesagemAutomatica]=\"constantes.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]=\"constantes.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-3 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                                    <app-combo-padrao id=\"justificativaQuebra\" name=\"justificativaQuebra\"\r\n                                        [(ngModel)]=\"data.motivoQuebraId\" tabela=\"MotivoQuebra\" chave=\"CodMotivoQuebra\"\r\n                                        descricao=\"DescrMotivoQuebra\" ativos=\"true\" [disabled]=\"disabledQuebra\">\r\n                                    </app-combo-padrao>\r\n                                </div>\r\n                            </div>\r\n                            <div class=\"col-lg-4 pl-0\">\r\n                                <label></label>\r\n                                <div class=\"col-sm-10 pl-0\">\r\n                                    <p class=\"form-control-static\">{{ statusQuebraOuSobraPt }}</p>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class=\"row\">\r\n                            <div class=\"col-lg-6 col-md-3 col-sm-12\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <label for=\"justificativaDeatraso\"\r\n                                        [class.required]=\"justifAtrasoRequired\">{{'labels.justificativaDeatraso' |\r\n                                        translate}}</label>\r\n                                    <app-combo-padrao id=\"justificativaDeatraso\" name=\"justificativaDeatraso\"\r\n                                        [(ngModel)]=\"data.motivoAtrasoId\" tabela=\"MotivoAtraso\" chave=\"CodMotivoAtraso\"\r\n                                        descricao=\"DescrMotivoAtraso\" ativos=\"true\" [disabled]=\"!justifAtrasoRequired\">\r\n                                    </app-combo-padrao>\r\n                                </div>\r\n                            </div>\r\n                            <div class=\"col-lg-4 pl-0\">\r\n                                <label></label>\r\n                                <div class=\"col-sm-10 pl-0\">\r\n                                    <p class=\"form-control-static\">{{ atraso }}</p>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class=\"row\" *ngIf=\"constantes.configBal.permAfePesoTara\">\r\n                            <div class=\"col-lg-6 col-md-10 col-sm-12\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <label for=\"justificativaPTara\">{{'labels.justificativaPTara' |\r\n                                        translate}}</label>\r\n                                </div>\r\n                                <app-combo-padrao id=\"justificativaPTara\" name=\"justificativaPTara\"\r\n                                    [(ngModel)]=\"data.motivoPTaraId\" tabela=\"CliBungeMotivoPesoTara\"\r\n                                    chave=\"CodMotivoPTaraId\" descricao=\"DescrMotivoPTara\" ativos=\"true\"\r\n                                    [disabled]=\"!habilitaJustificativaPTara\">\r\n                                </app-combo-padrao>\r\n                            </div>\r\n                            <div class=\"col-lg-4 pl-0\">\r\n                                <label></label>\r\n                                <div class=\"col-sm-10 pl-0\">\r\n                                    <p class=\"form-control-static\">{{ lblTara }}</p>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class=\"row\" *ngIf=\"constantes.configBal.permAfePesoTara\">\r\n                            <div class=\"col-lg-6 col-md-12 col-sm-12\">\r\n                                <div class=\"form-group\">\r\n                                    <label for=\"descJusPTara\">{{'labels.descJusPTara' | translate}}</label>\r\n                                    <textarea id=\"descJusPTara\" name=\"descJusPTara\" [(ngModel)]=\"data.descJusPTara\"\r\n                                        maxlength=\"100\" class=\"form-control form-control-sm\" rows=\"2\"\r\n                                        [disabled]=\"!habilitaJustificativaPTara\"></textarea>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class=\"row mt-2\">\r\n                            <div class=\"col-12\">\r\n                                <div class=\"form-group\">\r\n                                    <button class=\"btn btn-success mr-2\" type=\"submit\"\r\n                                        [disabled]=\"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>");

/***/ }),

/***/ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-alterar-dados-itens/requisicao-descarga-alterar-dados-itens.component.ts":
/*!**************************************************************************************************************************************************************************!*\
  !*** ./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-alterar-dados-itens/requisicao-descarga-alterar-dados-itens.component.ts ***!
  \**************************************************************************************************************************************************************************/
/*! exports provided: RequisicaoDescargaAlterarDadosItensComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RequisicaoDescargaAlterarDadosItensComponent", function() { return RequisicaoDescargaAlterarDadosItensComponent; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/fesm5/router.js");
/* harmony import */ var app_pages_cadastro_lote_lote_model__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! app/pages/cadastro/lote/lote.model */ "./src/app/pages/cadastro/lote/lote.model.ts");
/* harmony import */ var app_pages_cadastro_material_material_model__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! app/pages/cadastro/material/material.model */ "./src/app/pages/cadastro/material/material.model.ts");
/* harmony import */ var app_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 _requisicao_descarga_permissoes__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../requisicao-descarga.permissoes */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga.permissoes.ts");
/* harmony import */ var _requisicao_descarga_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./../requisicao-descarga.constants */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga.constants.ts");
/* harmony import */ var _requisicao_descarga_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./../requisicao-descarga.service */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga.service.ts");
/* harmony import */ var _requisicao_descarga_alterar_dados_itens_model__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./requisicao-descarga-alterar-dados-itens.model */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-alterar-dados-itens/requisicao-descarga-alterar-dados-itens.model.ts");
/* harmony import */ var app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! app/shared/services/funcoes/configuracao/configuracao.facade */ "./src/app/shared/services/funcoes/configuracao/configuracao.facade.ts");
/* harmony import */ var app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! app/shared/services/funcoes/funcoes.service */ "./src/app/shared/services/funcoes/funcoes.service.ts");
/* harmony import */ var app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! app/shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var app_pages_cadastro_destinatario_destinatario_service__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! app/pages/cadastro/destinatario/destinatario.service */ "./src/app/pages/cadastro/destinatario/destinatario.service.ts");
/* harmony import */ var app_pages_cadastro_material_material_service__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! app/pages/cadastro/material/material.service */ "./src/app/pages/cadastro/material/material.service.ts");
/* harmony import */ var app_pages_cadastro_lote_lote_service__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! app/pages/cadastro/lote/lote.service */ "./src/app/pages/cadastro/lote/lote.service.ts");
/* harmony import */ var app_shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! app/shared/services/funcoes/permissoes-utils/permissoes-utils.service */ "./src/app/shared/services/funcoes/permissoes-utils/permissoes-utils.service.ts");
/* harmony import */ var app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! app/pages/login/login.service */ "./src/app/pages/login/login.service.ts");
/* harmony import */ var app_pages_cadastro_destinatario_destinatario_model__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! app/pages/cadastro/destinatario/destinatario.model */ "./src/app/pages/cadastro/destinatario/destinatario.model.ts");
/* harmony import */ var app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! app/shared/services/event-emitter/event-emitter.service */ "./src/app/shared/services/event-emitter/event-emitter.service.ts");
/* harmony import */ var app_pages_cadastro_tipo_documento_transp_tipo_documento_transp_model__WEBPACK_IMPORTED_MODULE_20__ = __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_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");
/* harmony import */ var app_pages_cadastro_tipo_documento_transp_tipo_documento_transp_service__WEBPACK_IMPORTED_MODULE_22__ = __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_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! app/shared/services/funcoes/array-utils/array-utils.static.service */ "./src/app/shared/services/funcoes/array-utils/array-utils.static.service.ts");
/* harmony import */ var app_config_enumerables__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! app/config/enumerables */ "./src/app/config/enumerables.ts");
/* harmony import */ var app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! app/shared/services/funcoes/date-time-utils/date-time-utils.static.service */ "./src/app/shared/services/funcoes/date-time-utils/date-time-utils.static.service.ts");
/* harmony import */ var app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! app/shared/services/funcoes/string-utils/string-utils.static.service */ "./src/app/shared/services/funcoes/string-utils/string-utils.static.service.ts");
/* harmony import */ var app_shared_services_funcoes_object_utils_object_utils_static_service__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! app/shared/services/funcoes/object-utils/object-utils.static.service */ "./src/app/shared/services/funcoes/object-utils/object-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 __assign = (undefined && undefined.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
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 RequisicaoDescargaAlterarDadosItensComponent = /** @class */ (function (_super) {
    __extends(RequisicaoDescargaAlterarDadosItensComponent, _super);
    function RequisicaoDescargaAlterarDadosItensComponent(router, activatedRoute, configuracao, funcoes, message, service, destinatarioService, materialService, loteService, permissoesUtils, loginService, tipoDocumentoTranspService) {
        var _this = _super.call(this, new _requisicao_descarga_constants__WEBPACK_IMPORTED_MODULE_7__["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.tipoDocumentoTranspService = tipoDocumentoTranspService;
        _this.data = new _requisicao_descarga_alterar_dados_itens_model__WEBPACK_IMPORTED_MODULE_9__["RequisicaoDescargaAlterarDadosItens"]();
        _this.constantes = new _requisicao_descarga_constants__WEBPACK_IMPORTED_MODULE_7__["RequisicaoDescargaConstants"]();
        _this.now = new Date();
        _this.mensagens = [];
        _this.showAdd = false;
        _this.requiredDadosEntrada = false;
        _this.target = _this.funcoes.getTargetLocation();
        _this.pageRoute = "/especificos/pontafelix/movimentos/requisicaoDescarga";
        _this.refresh = function () { return __awaiter(_this, void 0, void 0, function () {
            var _a;
            return __generator(this, function (_b) {
                switch (_b.label) {
                    case 0:
                        _a = this;
                        return [4 /*yield*/, this.service.consultaAlteraDadosItens(this.data.requisicaoDescargaId).toPromise()];
                    case 1:
                        _a.dados = _b.sent();
                        if (!app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_23__["ArrayUtilsStaticService"].any(this.dados)) {
                            this.message.warning("titles.requisicaoDescarga", "messages.todosOsItensJaForamBaixados");
                            this.back(false);
                            return [2 /*return*/];
                        }
                        else {
                            this.tratarDados();
                        }
                        return [2 /*return*/];
                }
            });
        }); };
        _this.loadConfig = function () {
            if (_this.configuracao.isLoadConfig()) {
                _this.constantes.configBal.infPesoFob = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_4__["BooleanUtilsStaticService"].toBoolean(_this.configuracao.lerConfig("BAL", "InfPesoFob"));
                _this.constantes.configBal.difMaxNFDtAtual = _this.configuracao.number('BAL', 'DifMaxNFDtAtual');
                _this.constantes.configBal.calculaTotalNF = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_4__["BooleanUtilsStaticService"].toBoolean(_this.configuracao.lerConfig("BAL", "CalculaTotalNF"));
            }
        };
        router.events.subscribe(function (event) {
            var params = _this.funcoesService.formParams.getParams(router, event);
            if (params) {
                _this.actionForm = params.action;
            }
        });
        return _this;
    }
    RequisicaoDescargaAlterarDadosItensComponent.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 () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        this.data.requisicaoDescargaId = this.funcoesService.getValue(this.activatedRoute.snapshot.paramMap.get("id"), "I");
                        if (this.funcoesService.isUndefinedOrNull(this.data.requisicaoDescargaId)) {
                            this.message.warning("titles.requisicaoDescarga", "messages.nenhumRegistroEncontrado");
                            return [2 /*return*/];
                        }
                        return [4 /*yield*/, this.refresh()];
                    case 1:
                        _a.sent();
                        return [2 /*return*/];
                }
            });
        }); }, function () {
            _this.permissoesUtils.back();
        });
    };
    RequisicaoDescargaAlterarDadosItensComponent.prototype.tratarDados = function () {
        return __awaiter(this, void 0, void 0, function () {
            var _this = this;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, Promise.all(this.dados.map(function (element) { return __awaiter(_this, void 0, void 0, function () {
                            var results;
                            return __generator(this, function (_a) {
                                switch (_a.label) {
                                    case 0: return [4 /*yield*/, Object(rxjs__WEBPACK_IMPORTED_MODULE_5__["forkJoin"])([
                                            this.destinatarioService.getById(element.destinatarioIdCliente),
                                            this.destinatarioService.getById(element.destinatarioIdEmitente),
                                            this.materialService.getById(element.materialId),
                                            this.loteService.getByLoteId(element.loteId),
                                            this.tipoDocumentoTranspService.getById(element.tipoDocumentoTranspId)
                                        ]).toPromise()];
                                    case 1:
                                        results = _a.sent();
                                        if (app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_23__["ArrayUtilsStaticService"].any(results)) {
                                            element.cliente = !!results[0] ? results[0] : new app_pages_cadastro_destinatario_destinatario_model__WEBPACK_IMPORTED_MODULE_18__["Destinatario"]();
                                            element.emitente = !!results[1] ? results[1] : new app_pages_cadastro_destinatario_destinatario_model__WEBPACK_IMPORTED_MODULE_18__["Destinatario"]();
                                            element.material = !!results[2] ? results[2] : new app_pages_cadastro_material_material_model__WEBPACK_IMPORTED_MODULE_3__["Material"]();
                                            element.lote = !!results[3] ? results[3] : new app_pages_cadastro_lote_lote_model__WEBPACK_IMPORTED_MODULE_2__["Lote"]();
                                            element.tipoDocumentoTransp = !!results[4] ? results[4] : new app_pages_cadastro_tipo_documento_transp_tipo_documento_transp_model__WEBPACK_IMPORTED_MODULE_20__["TipoDocumentoTransp"]();
                                        }
                                        ;
                                        return [2 /*return*/];
                                }
                            });
                        }); }))];
                    case 1:
                        _a.sent();
                        this.dadosOld = app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_23__["ArrayUtilsStaticService"].clone(this.dados);
                        return [2 /*return*/];
                }
            });
        });
    };
    RequisicaoDescargaAlterarDadosItensComponent.prototype.back = function (backToIndex) {
        if (backToIndex === void 0) { backToIndex = true; }
        if (backToIndex) {
            this.funcoes.desabilitarFiltro();
            this.router.navigate(["" + this.target + this.pageRoute]);
        }
        else {
            this.router.navigate(["" + this.target + this.pageRoute + "/detail/" + this.data.requisicaoDescargaId]);
        }
    };
    RequisicaoDescargaAlterarDadosItensComponent.prototype.edit = function () {
        this.showAdd = true;
        this.actionForm = app_config_enumerables__WEBPACK_IMPORTED_MODULE_24__["ActionForm"].edit;
    };
    RequisicaoDescargaAlterarDadosItensComponent.prototype.detail = function () {
        this.showAdd = true;
        this.actionForm = app_config_enumerables__WEBPACK_IMPORTED_MODULE_24__["ActionForm"].detail;
    };
    RequisicaoDescargaAlterarDadosItensComponent.prototype.backItens = function () {
        this.showAdd = false;
        this.actionForm = app_config_enumerables__WEBPACK_IMPORTED_MODULE_24__["ActionForm"].index;
    };
    RequisicaoDescargaAlterarDadosItensComponent.prototype.selected = function (item, index) {
        this.currentIndex = index;
        this.data = item;
    };
    RequisicaoDescargaAlterarDadosItensComponent.prototype.onSubmit = function (form) {
        var _this = this;
        app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_19__["EventEmitterService"].get("formError").emit(form);
        if (form.invalid) {
            this.funcoes.backToTop();
            return;
        }
        var idxItem = this.dados.findIndex(function (c) { return c.requisicaoDescargaItemId == _this.data.requisicaoDescargaItemId; });
        if (idxItem >= 0) {
            this.dados[idxItem] = this.data;
        }
        this.backItens();
    };
    RequisicaoDescargaAlterarDadosItensComponent.prototype.trataDest = function (destinatario) {
        this.data.cliente = destinatario;
        this.data.loteId = "";
    };
    RequisicaoDescargaAlterarDadosItensComponent.prototype.trataMaterial = function (material) {
        this.data.material = material;
        this.data.loteId = "";
    };
    RequisicaoDescargaAlterarDadosItensComponent.prototype.validaCFOP = function (cfop) {
    };
    RequisicaoDescargaAlterarDadosItensComponent.prototype.trataModeloNota = function (data) {
        this.data.modeloNota = data;
        if (this.data.modeloNotaId !== "55") {
            this.data.chaveNFE = undefined;
        }
    };
    RequisicaoDescargaAlterarDadosItensComponent.prototype.validaChaveNfe = function () {
        if (this.funcoesService.isNotUndefinedOrNull(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);
            }
            var result = this.funcoesService.validaChaveNFe(this.data.chaveNFE, this.data.emitente, this.data.docto, this.data.serieNotaId);
            if (!result) {
                this.message.warning("titles.validacao", "messages.chaveNfeInvalida");
            }
        }
    };
    RequisicaoDescargaAlterarDadosItensComponent.prototype.validaDtDocto = function () {
        var dtEmissaoMinina = app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_25__["DateTimeUtilsStaticService"].addDays(new Date(), this.constantes.configBal.difMaxNFDtAtual * (-1));
        if (app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_25__["DateTimeUtilsStaticService"].maiorAHoje(this.data.dtDocto)) {
            this.message.warning("titles.requisicaoDescarga", "messages.dataEmissaoNaoPodeSerMaiorQueDataAtual");
            return false;
        }
        else if (app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_25__["DateTimeUtilsStaticService"].maiorA(this.data.dtRequisicao, this.data.dtDocto)) {
            this.message.warning("titles.requisicaoDescarga", "messages.dtDoctoNaoPodeSerMaiorDtRequisicao", { qtdeDias: this.constantes.configBal.difMaxNFDtAtual });
            return false;
        }
        else if (app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_25__["DateTimeUtilsStaticService"].menorA(this.data.dtDocto, dtEmissaoMinina, ['H', 'M'])) {
            this.message.warning("titles.requisicaoDescarga", "messages.dtEmissaoDeveSerMenorQue", { qtdeDias: this.constantes.configBal.difMaxNFDtAtual });
            return false;
        }
        return true;
    };
    RequisicaoDescargaAlterarDadosItensComponent.prototype.trataNumeroDoc = 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:
                        if (!!this.constantes.configBal.vrfNfExisteDesc) return [3 /*break*/, 2];
                        if (!app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_21__["NumberUtilsStaticService"].isPositive(this.data.docto)) return [3 /*break*/, 2];
                        return [4 /*yield*/, this.service.verificaSeNotaJaCadastrada({
                                docto: this.data.docto,
                                destinatarioIdEmitente: this.data.destinatarioIdEmitente,
                                cliPontaRequisicaoDescargaId: this.data.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*/];
                        }
                        _a.label = 2;
                    case 2: return [2 /*return*/];
                }
            });
        });
    };
    RequisicaoDescargaAlterarDadosItensComponent.prototype.calcQuantidDoc = function () {
        this.trataVlNota();
    };
    RequisicaoDescargaAlterarDadosItensComponent.prototype.trataVlNota = function () {
        if (this.constantes.configBal.calculaTotalNF) {
            this.data.vlNota = app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_21__["NumberUtilsStaticService"].round(this.data.quantidDoc * this.data.precoArmazenado, 2);
        }
    };
    RequisicaoDescargaAlterarDadosItensComponent.prototype.calcPesoDoc = function () {
        this.trataVlNota();
    };
    RequisicaoDescargaAlterarDadosItensComponent.prototype.validaVlNota = function () {
        if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_21__["NumberUtilsStaticService"].isPositive(this.data.vlNota)) {
            var total = app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_21__["NumberUtilsStaticService"].round(this.data.quantidDoc * this.data.precoArmazenado, 2);
            if (Math.abs(total - this.data.vlNota) > 1) {
                this.message.warning("titles.requisicaoDescarga", "messages.valorNfOuLoteIncorreto");
                this.data.vlNota = 0;
                return;
            }
        }
    };
    RequisicaoDescargaAlterarDadosItensComponent.prototype.trataTipoDocumentoTransp = function (data) {
        this.data.tipoDocumentoTransp = data;
        this.ajustarTipoTransporte();
    };
    RequisicaoDescargaAlterarDadosItensComponent.prototype.trataLote = function (event) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                if (this.funcoesService.stringUtils.isNotEmpty(event.lote)) {
                    this.data.lote = event.lote;
                    this.ajustarTipoTransporte();
                    this.trataVlNota();
                }
                return [2 /*return*/];
            });
        });
    };
    Object.defineProperty(RequisicaoDescargaAlterarDadosItensComponent.prototype, "labelQuantidDoc", {
        get: function () {
            if (app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_26__["StringUtilsStaticService"].isNotEmpty(this.data.lote.unidadeId))
                return "Quantid. Docto (" + this.data.lote.unidadeId + ")";
            return "Quantid. Docto";
        },
        enumerable: true,
        configurable: true
    });
    RequisicaoDescargaAlterarDadosItensComponent.prototype.ajustarTipoTransporte = function () {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                if (app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_4__["BooleanUtilsStaticService"].toBoolean(this.data.tipoDocumentoTransp.flagSolDadosEnt)) {
                    this.requiredDadosEntrada = true;
                    this.data.maskDocTransNumero = this.data.tipoDocumentoTransp.mascara;
                }
                else {
                    this.requiredDadosEntrada = false;
                    this.data.maskDocTransNumero = "";
                    this.data.docTranspNumero = "";
                    this.data.docTranspEmissao = null;
                }
                return [2 /*return*/];
            });
        });
    };
    Object.defineProperty(RequisicaoDescargaAlterarDadosItensComponent.prototype, "disabledTipoDocumentoTransp", {
        get: function () {
            return !!this.data.loteId || app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_21__["NumberUtilsStaticService"].toNumber(this.data.tipoDocumentoTranspId) > 0;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(RequisicaoDescargaAlterarDadosItensComponent.prototype, "enableShipment", {
        get: function () {
            return this.constantes.configBal.permiteAltShipment;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(RequisicaoDescargaAlterarDadosItensComponent.prototype, "naoAlterou", {
        get: function () {
            return app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_23__["ArrayUtilsStaticService"].equal(this.dados, this.dadosOld);
        },
        enumerable: true,
        configurable: true
    });
    RequisicaoDescargaAlterarDadosItensComponent.prototype.cancelar = function (item) {
        return __awaiter(this, void 0, void 0, function () {
            var idxItem;
            return __generator(this, function (_a) {
                idxItem = this.dadosOld.findIndex(function (c) { return c.requisicaoDescargaItemId == item.requisicaoDescargaItemId; });
                if (idxItem >= 0) {
                    this.dados[idxItem] = __assign({}, this.dadosOld[idxItem]);
                    this.data = new _requisicao_descarga_alterar_dados_itens_model__WEBPACK_IMPORTED_MODULE_9__["RequisicaoDescargaAlterarDadosItens"]();
                }
                this.backItens();
                return [2 /*return*/];
            });
        });
    };
    RequisicaoDescargaAlterarDadosItensComponent.prototype.gravar = function () {
        var _this = this;
        this.message.confirm("titles.requisicaoDescarga", "messages.confirmaAlteracaoDosItens", null, function () {
            if (!_this.validaDtDocto()) {
                return;
            }
            var itensAlterados = _this.compararArrays(_this.dados, _this.dadosOld);
            _this.service.alterarDadosItens(itensAlterados).subscribe(function (result) {
                if (!result.isValid) {
                    _this.mensagens = _this.message.validationResult(result);
                    _this.message.warning("titles.descargaFerroviariaComboio", _this.mensagens[0]);
                    return;
                }
                else {
                    _this.message.saveSuccess("titles.requisicaoDescarga");
                    _this.refresh();
                }
            });
        });
    };
    RequisicaoDescargaAlterarDadosItensComponent.prototype.compararArrays = function (dados, dadosOld) {
        var itemAlterado = [];
        dados.forEach(function (newObj) {
            var objOld = dadosOld.find(function (item) { return item.requisicaoDescargaItemId === newObj.requisicaoDescargaItemId; });
            if (!objOld || !app_shared_services_funcoes_object_utils_object_utils_static_service__WEBPACK_IMPORTED_MODULE_27__["ObjectUtilsStaticService"].equal(newObj, objOld)) {
                itemAlterado.push(newObj);
            }
        });
        return itemAlterado;
    };
    RequisicaoDescargaAlterarDadosItensComponent.prototype.cancelarGeral = function () {
        this.refresh();
    };
    Object.defineProperty(RequisicaoDescargaAlterarDadosItensComponent.prototype, "saldoLoteOptions", {
        get: function () {
            return {
                destinatarioIdCliente: this.data.destinatarioIdCliente,
                destinatarioIdEmitente: this.data.destinatarioIdEmitente,
                materialId: this.data.materialId,
                tanqueId: this.data.tanqueId,
                loteId: this.data.loteId,
                sitLote: 'A',
                modo: 7,
                tipoSaldo: 7,
                dataMovimento: this.now,
                localOperacaoId: this.data.localOperacaoId,
                tipoAgrupa: 'L',
                geraArquivo: 'N'
            };
        },
        enumerable: true,
        configurable: true
    });
    RequisicaoDescargaAlterarDadosItensComponent.ctorParameters = function () { return [
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"] },
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_1__["ActivatedRoute"] },
        { type: app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_10__["ConfiguracaoFacade"] },
        { type: app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_11__["FuncoesService"] },
        { type: app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_12__["MessageService"] },
        { type: _requisicao_descarga_service__WEBPACK_IMPORTED_MODULE_8__["RequisicaoDescargaService"] },
        { type: app_pages_cadastro_destinatario_destinatario_service__WEBPACK_IMPORTED_MODULE_13__["DestinatarioService"] },
        { type: app_pages_cadastro_material_material_service__WEBPACK_IMPORTED_MODULE_14__["MaterialService"] },
        { type: app_pages_cadastro_lote_lote_service__WEBPACK_IMPORTED_MODULE_15__["LoteService"] },
        { type: app_shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_16__["PermissoesUtilsService"] },
        { type: app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_17__["LoginService"] },
        { type: app_pages_cadastro_tipo_documento_transp_tipo_documento_transp_service__WEBPACK_IMPORTED_MODULE_22__["TipoDocumentoTranspService"] }
    ]; };
    RequisicaoDescargaAlterarDadosItensComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
            selector: "app-requisicao-descarga-alterar-dados-itens",
            template: __importDefault(__webpack_require__(/*! raw-loader!./requisicao-descarga-alterar-dados-itens.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-alterar-dados-itens/requisicao-descarga-alterar-dados-itens.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [_angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"],
            _angular_router__WEBPACK_IMPORTED_MODULE_1__["ActivatedRoute"],
            app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_10__["ConfiguracaoFacade"],
            app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_11__["FuncoesService"],
            app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_12__["MessageService"],
            _requisicao_descarga_service__WEBPACK_IMPORTED_MODULE_8__["RequisicaoDescargaService"],
            app_pages_cadastro_destinatario_destinatario_service__WEBPACK_IMPORTED_MODULE_13__["DestinatarioService"],
            app_pages_cadastro_material_material_service__WEBPACK_IMPORTED_MODULE_14__["MaterialService"],
            app_pages_cadastro_lote_lote_service__WEBPACK_IMPORTED_MODULE_15__["LoteService"],
            app_shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_16__["PermissoesUtilsService"],
            app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_17__["LoginService"],
            app_pages_cadastro_tipo_documento_transp_tipo_documento_transp_service__WEBPACK_IMPORTED_MODULE_22__["TipoDocumentoTranspService"]])
    ], RequisicaoDescargaAlterarDadosItensComponent);
    return RequisicaoDescargaAlterarDadosItensComponent;
}(_requisicao_descarga_permissoes__WEBPACK_IMPORTED_MODULE_6__["RequisicaoDescargaPermissoes"]));



/***/ }),

/***/ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-alterar-dados-itens/requisicao-descarga-alterar-dados-itens.model.ts":
/*!**********************************************************************************************************************************************************************!*\
  !*** ./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-alterar-dados-itens/requisicao-descarga-alterar-dados-itens.model.ts ***!
  \**********************************************************************************************************************************************************************/
/*! exports provided: RequisicaoDescargaAlterarDadosItens */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

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

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



/***/ }),

/***/ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-alterar-dados/requisicao-descarga-alterar-dados.component.ts":
/*!**************************************************************************************************************************************************************!*\
  !*** ./src/app/pages/especificos/pontafelix/movimentos/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 _angular_router__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/fesm5/router.js");
/* harmony import */ var app_pages_cadastro_lote_lote_model__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! app/pages/cadastro/lote/lote.model */ "./src/app/pages/cadastro/lote/lote.model.ts");
/* harmony import */ var app_pages_cadastro_material_material_model__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! app/pages/cadastro/material/material.model */ "./src/app/pages/cadastro/material/material.model.ts");
/* harmony import */ var app_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 _requisicao_descarga_permissoes__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../requisicao-descarga.permissoes */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga.permissoes.ts");
/* harmony import */ var _requisicao_descarga_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./../requisicao-descarga.constants */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga.constants.ts");
/* harmony import */ var _requisicao_descarga_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./../requisicao-descarga.service */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga.service.ts");
/* harmony import */ var _requisicao_descarga_alterar_dados_model__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./requisicao-descarga-alterar-dados.model */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-alterar-dados/requisicao-descarga-alterar-dados.model.ts");
/* harmony import */ var app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! app/shared/services/funcoes/configuracao/configuracao.facade */ "./src/app/shared/services/funcoes/configuracao/configuracao.facade.ts");
/* harmony import */ var app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! app/shared/services/funcoes/funcoes.service */ "./src/app/shared/services/funcoes/funcoes.service.ts");
/* harmony import */ var app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! app/shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var app_pages_cadastro_destinatario_destinatario_service__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! app/pages/cadastro/destinatario/destinatario.service */ "./src/app/pages/cadastro/destinatario/destinatario.service.ts");
/* harmony import */ var app_pages_cadastro_material_material_service__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! app/pages/cadastro/material/material.service */ "./src/app/pages/cadastro/material/material.service.ts");
/* harmony import */ var app_pages_cadastro_lote_lote_service__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! app/pages/cadastro/lote/lote.service */ "./src/app/pages/cadastro/lote/lote.service.ts");
/* harmony import */ var app_shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! app/shared/services/funcoes/permissoes-utils/permissoes-utils.service */ "./src/app/shared/services/funcoes/permissoes-utils/permissoes-utils.service.ts");
/* harmony import */ var app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! app/pages/login/login.service */ "./src/app/pages/login/login.service.ts");
/* harmony import */ var app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! app/shared/services/funcoes/string-utils/string-utils.static.service */ "./src/app/shared/services/funcoes/string-utils/string-utils.static.service.ts");
/* harmony import */ var app_pages_cadastro_destinatario_destinatario_model__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! app/pages/cadastro/destinatario/destinatario.model */ "./src/app/pages/cadastro/destinatario/destinatario.model.ts");
/* harmony import */ var app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! app/shared/services/event-emitter/event-emitter.service */ "./src/app/shared/services/event-emitter/event-emitter.service.ts");
/* harmony import */ var app_shared_services_funcoes_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");
/* harmony import */ var app_pages_cadastro_tipo_documento_transp_tipo_documento_transp_service__WEBPACK_IMPORTED_MODULE_22__ = __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_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! app/shared/services/funcoes/array-utils/array-utils.static.service */ "./src/app/shared/services/funcoes/array-utils/array-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 RequisicaoDescargaAlterarDadosComponent = /** @class */ (function (_super) {
    __extends(RequisicaoDescargaAlterarDadosComponent, _super);
    function RequisicaoDescargaAlterarDadosComponent(router, activatedRoute, configuracao, funcoes, message, service, destinatarioService, materialService, loteService, permissoesUtils, loginService, tipoDocumentoTranspService) {
        var _this = _super.call(this, new _requisicao_descarga_constants__WEBPACK_IMPORTED_MODULE_7__["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.tipoDocumentoTranspService = tipoDocumentoTranspService;
        _this.data = new _requisicao_descarga_alterar_dados_model__WEBPACK_IMPORTED_MODULE_9__["RequisicaoDescargaAlterarDados"]();
        _this.constantes = new _requisicao_descarga_constants__WEBPACK_IMPORTED_MODULE_7__["RequisicaoDescargaConstants"]();
        _this.validacoes = [];
        _this.now = new Date();
        _this.mensagens = [];
        _this.requiredDadosEntrada = false;
        _this.tipoTransporte = "T";
        _this.origem = 'index';
        _this.target = _this.funcoes.getTargetLocation();
        _this.pageRoute = "/especificos/pontafelix/movimentos/requisicaoDescarga";
        _this.loadConfig = function () {
            if (_this.configuracao.isLoadConfig()) {
                _this.constantes.configCtv.solicitaPlanejEv = _this.configuracao.boolean("CTV", "SolicitaPlanejEv");
                _this.constantes.configCtv.habCampoShipment = _this.configuracao.boolean("CTV", "HabCampoShipment");
                _this.constantes.configBal.sPerDesComis = _this.configuracao.boolean("BAL", "SPerDesComis");
                _this.constantes.configBal.planejTanque = _this.configuracao.boolean("BAL", "PlanejTanque");
                _this.constantes.configBal.permiteAltShipment = _this.configuracao.boolean("BAL", "PermiteAltShipment");
            }
        };
        return _this;
    }
    RequisicaoDescargaAlterarDadosComponent.prototype.ngOnInit = function () {
        var _this = this;
        this.configuracao.getConfig(this.constantes.listaParam, this.loadConfig);
        this.permissoesUtils.validRotina(this.constantes.sisFormularioId, 9, 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");
                        this.origem = this.activatedRoute.snapshot.paramMap.get("origem");
                        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();
                        }
                        this.data.percDesComis = app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_18__["StringUtilsStaticService"].isEmpty(this.data.percDesComis) ? "" : this.data.percDesComis;
                        this.data.tipoOperacaoId = this.data.tipoOperacaoId === 0 ? "" : this.data.tipoOperacaoId;
                        this.trataData();
                        return [2 /*return*/];
                }
            });
        }); }, function () { });
    };
    RequisicaoDescargaAlterarDadosComponent.prototype.trataData = function () {
        return __awaiter(this, void 0, void 0, function () {
            var results;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, Object(rxjs__WEBPACK_IMPORTED_MODULE_5__["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.loteService.getByLoteId(this.data.loteId)
                        ]).toPromise()];
                    case 1:
                        results = _a.sent();
                        if (app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_23__["ArrayUtilsStaticService"].any(results)) {
                            this.data.cliente = !!results[0] ? results[0] : new app_pages_cadastro_destinatario_destinatario_model__WEBPACK_IMPORTED_MODULE_19__["Destinatario"]();
                            this.data.emitente = !!results[1] ? results[1] : new app_pages_cadastro_destinatario_destinatario_model__WEBPACK_IMPORTED_MODULE_19__["Destinatario"]();
                            this.data.transportadora = !!results[2] ? results[2] : new app_pages_cadastro_destinatario_destinatario_model__WEBPACK_IMPORTED_MODULE_19__["Destinatario"]();
                            this.data.material = !!results[3] ? results[3] : new app_pages_cadastro_material_material_model__WEBPACK_IMPORTED_MODULE_3__["Material"]();
                            this.data.lote = !!results[4] ? results[4] : new app_pages_cadastro_lote_lote_model__WEBPACK_IMPORTED_MODULE_2__["Lote"]();
                        }
                        ;
                        this.ajustarTipoTransporte();
                        return [2 /*return*/];
                }
            });
        });
    };
    RequisicaoDescargaAlterarDadosComponent.prototype.back = function () {
        if (this.origem === 'form') {
            this.router.navigate(["" + this.target + this.pageRoute + "/detail/" + this.data.requisicaoDescargaId]);
        }
        else {
            this.funcoes.desabilitarFiltro();
            this.router.navigate(["" + this.target + this.pageRoute]);
        }
    };
    RequisicaoDescargaAlterarDadosComponent.prototype.onSubmit = function (form) {
        var _this = this;
        app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_20__["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,
            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
        }).subscribe(function (validationResult) {
            if (!validationResult.isValid) {
                var mensagens = _this.message.validationResult(validationResult);
                app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_20__["EventEmitterService"].get("backError").emit(mensagens);
                _this.funcoes.backToTop();
                return;
            }
            else {
                _this.message.saveSuccess("titles.requisicaoDescarga");
                _this.back();
            }
        });
    };
    RequisicaoDescargaAlterarDadosComponent.prototype.trataDest = function (destinatario) {
        this.data.cliente = destinatario;
        this.data.loteId = "";
    };
    RequisicaoDescargaAlterarDadosComponent.prototype.trataMaterial = function (material) {
        this.data.material = material;
        this.data.loteId = "";
    };
    RequisicaoDescargaAlterarDadosComponent.prototype.trataTipoDocumentoTransp = function (data) {
        this.data.tipoDocumentoTransp = data;
        this.data.flagSolDadosEnt = data.flagSolDadosEnt;
        this.ajustarTipoTransporte();
    };
    RequisicaoDescargaAlterarDadosComponent.prototype.trataLote = function (event) {
        return __awaiter(this, void 0, void 0, function () {
            var ret;
            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();
                        this.continua = ret.continua;
                        if (this.continua !== "S") {
                            this.message.warning("titles.requisicaoDescarga", ret.msg);
                            return [2 /*return*/];
                        }
                        this.ajustarTipoTransporte();
                        _a.label = 2;
                    case 2: return [2 /*return*/];
                }
            });
        });
    };
    RequisicaoDescargaAlterarDadosComponent.prototype.ajustarTipoTransporte = function () {
        return __awaiter(this, void 0, void 0, function () {
            var tipoDocumentoTransp;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        if (!!this.data.loteId && app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_21__["NumberUtilsStaticService"].isPositive(this.data.lote.tipoDocumentoTranspIdEntrada)) {
                            this.data.tipoDocumentoTranspId = this.data.lote.tipoDocumentoTranspIdEntrada;
                        }
                        if (!(app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_21__["NumberUtilsStaticService"].toNumber(this.data.lote.tipoDocumentoTranspIdEntrada) > 0 && app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_4__["BooleanUtilsStaticService"].toBoolean(this.data.flagSolDadosEnt))) return [3 /*break*/, 2];
                        this.requiredDadosEntrada = true;
                        return [4 /*yield*/, this.tipoDocumentoTranspService.getById(this.data.tipoDocumentoTranspId).toPromise()];
                    case 1:
                        tipoDocumentoTransp = _a.sent();
                        this.data.maskDocTransNumero = tipoDocumentoTransp.mascara;
                        return [3 /*break*/, 3];
                    case 2:
                        this.requiredDadosEntrada = false;
                        this.data.maskDocTransNumero = "";
                        this.data.docTranspNumero = "";
                        this.data.docTranspEmissao = null;
                        _a.label = 3;
                    case 3: return [2 /*return*/];
                }
            });
        });
    };
    Object.defineProperty(RequisicaoDescargaAlterarDadosComponent.prototype, "disabledTipoDocumentoTransp", {
        get: function () {
            return !!this.data.loteId || app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_21__["NumberUtilsStaticService"].toNumber(this.data.tipoDocumentoTranspId) > 0;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(RequisicaoDescargaAlterarDadosComponent.prototype, "enableShipment", {
        get: function () {
            return this.constantes.configBal.permiteAltShipment;
        },
        enumerable: true,
        configurable: true
    });
    RequisicaoDescargaAlterarDadosComponent.prototype.trataTipoTransp = function (tipoTransp) {
        if (this.funcoesService.isNotUndefinedOrNull(tipoTransp)) {
            this.data.obrigaTransp = tipoTransp.obrigaTransp;
            this.data.obrigaPlaca = tipoTransp.obrigaPlaca;
            this.limpaCampos();
            if (!!tipoTransp.tiposDeTransporteId) {
                if (['L', 'M'].includes(tipoTransp.tiposDeTransporteId)) {
                    this.tipoTransporte = "N";
                }
                else {
                    this.tipoTransporte = "T";
                }
            }
        }
    };
    RequisicaoDescargaAlterarDadosComponent.prototype.limpaCampos = function () {
        this.data.destinatarioIdTransportadora = 0;
        this.data.transportadora = new app_pages_cadastro_destinatario_destinatario_model__WEBPACK_IMPORTED_MODULE_19__["Destinatario"]();
        this.data.cadastroPlacaIdCavalo = "";
        this.data.cadastroPlacaIdCarreta1 = "";
        this.data.cadastroPlacaIdCarreta2 = "";
    };
    Object.defineProperty(RequisicaoDescargaAlterarDadosComponent.prototype, "requiredPlaca", {
        get: function () {
            return app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_4__["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_4__["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,
                sitLote: 'A',
                modo: 7,
                tipoSaldo: 7,
                dataMovimento: this.now,
                localOperacaoId: this.data.localOperacaoId,
                tipoAgrupa: 'D',
                geraArquivo: 'S',
                planejTanque: this.constantes.configBal.planejTanque
            };
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(RequisicaoDescargaAlterarDadosComponent.prototype, "saldoLoteOptions", {
        get: function () {
            return {
                destinatarioIdCliente: this.data.destinatarioIdCliente,
                materialId: this.data.materialId,
                sitLote: 'A',
                modo: 7,
                tipoSaldo: 7,
                dataMovimento: this.now,
                tipoAgrupa: 'L',
                geraArquivo: 'N'
            };
        },
        enumerable: true,
        configurable: true
    });
    RequisicaoDescargaAlterarDadosComponent.ctorParameters = function () { return [
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"] },
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_1__["ActivatedRoute"] },
        { type: app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_10__["ConfiguracaoFacade"] },
        { type: app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_11__["FuncoesService"] },
        { type: app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_12__["MessageService"] },
        { type: _requisicao_descarga_service__WEBPACK_IMPORTED_MODULE_8__["RequisicaoDescargaService"] },
        { type: app_pages_cadastro_destinatario_destinatario_service__WEBPACK_IMPORTED_MODULE_13__["DestinatarioService"] },
        { type: app_pages_cadastro_material_material_service__WEBPACK_IMPORTED_MODULE_14__["MaterialService"] },
        { type: app_pages_cadastro_lote_lote_service__WEBPACK_IMPORTED_MODULE_15__["LoteService"] },
        { type: app_shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_16__["PermissoesUtilsService"] },
        { type: app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_17__["LoginService"] },
        { type: app_pages_cadastro_tipo_documento_transp_tipo_documento_transp_service__WEBPACK_IMPORTED_MODULE_22__["TipoDocumentoTranspService"] }
    ]; };
    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/especificos/pontafelix/movimentos/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_1__["Router"],
            _angular_router__WEBPACK_IMPORTED_MODULE_1__["ActivatedRoute"],
            app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_10__["ConfiguracaoFacade"],
            app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_11__["FuncoesService"],
            app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_12__["MessageService"],
            _requisicao_descarga_service__WEBPACK_IMPORTED_MODULE_8__["RequisicaoDescargaService"],
            app_pages_cadastro_destinatario_destinatario_service__WEBPACK_IMPORTED_MODULE_13__["DestinatarioService"],
            app_pages_cadastro_material_material_service__WEBPACK_IMPORTED_MODULE_14__["MaterialService"],
            app_pages_cadastro_lote_lote_service__WEBPACK_IMPORTED_MODULE_15__["LoteService"],
            app_shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_16__["PermissoesUtilsService"],
            app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_17__["LoginService"],
            app_pages_cadastro_tipo_documento_transp_tipo_documento_transp_service__WEBPACK_IMPORTED_MODULE_22__["TipoDocumentoTranspService"]])
    ], RequisicaoDescargaAlterarDadosComponent);
    return RequisicaoDescargaAlterarDadosComponent;
}(_requisicao_descarga_permissoes__WEBPACK_IMPORTED_MODULE_6__["RequisicaoDescargaPermissoes"]));



/***/ }),

/***/ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-alterar-dados/requisicao-descarga-alterar-dados.model.ts":
/*!**********************************************************************************************************************************************************!*\
  !*** ./src/app/pages/especificos/pontafelix/movimentos/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 app_shared_services_base_base_model__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! app/shared/services/base/base.model */ "./src/app/shared/services/base/base.model.ts");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};

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



/***/ }),

/***/ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-alterar-datas/requisicao-descarga-alterar-datas.component.ts":
/*!**************************************************************************************************************************************************************!*\
  !*** ./src/app/pages/especificos/pontafelix/movimentos/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 _shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../../../../../../shared/services/funcoes/number-utils/number-utils.static.service */ "./src/app/shared/services/funcoes/number-utils/number-utils.static.service.ts");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/fesm5/router.js");
/* harmony import */ var _requisicao_descarga_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../requisicao-descarga.constants */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga.constants.ts");
/* harmony import */ var _requisicao_descarga_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../requisicao-descarga.service */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga.service.ts");
/* harmony import */ var _requisicao_descarga_alterar_datas_model__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./requisicao-descarga-alterar-datas.model */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-alterar-datas/requisicao-descarga-alterar-datas.model.ts");
/* harmony import */ var _requisicao_descarga_alterar_datas_validation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./requisicao-descarga-alterar-datas.validation */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-alterar-datas/requisicao-descarga-alterar-datas.validation.ts");
/* harmony import */ var app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! app/shared/services/funcoes/configuracao/configuracao.facade */ "./src/app/shared/services/funcoes/configuracao/configuracao.facade.ts");
/* harmony import */ var app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! app/shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! app/shared/services/funcoes/funcoes.service */ "./src/app/shared/services/funcoes/funcoes.service.ts");
/* harmony import */ var app_shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! app/shared/services/funcoes/permissoes-utils/permissoes-utils.service */ "./src/app/shared/services/funcoes/permissoes-utils/permissoes-utils.service.ts");
/* harmony import */ var app_shared_services_funcoes_object_utils_object_utils_static_service__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! app/shared/services/funcoes/object-utils/object-utils.static.service */ "./src/app/shared/services/funcoes/object-utils/object-utils.static.service.ts");
/* harmony import */ var app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! app/shared/services/event-emitter/event-emitter.service */ "./src/app/shared/services/event-emitter/event-emitter.service.ts");
/* harmony import */ var app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! app/shared/services/funcoes/array-utils/array-utils.static.service */ "./src/app/shared/services/funcoes/array-utils/array-utils.static.service.ts");
/* harmony import */ var app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! app/shared/services/funcoes/date-time-utils/date-time-utils.static.service */ "./src/app/shared/services/funcoes/date-time-utils/date-time-utils.static.service.ts");
/* harmony import */ var _requisicao_descarga_permissoes__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../requisicao-descarga.permissoes */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga.permissoes.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_3__["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_5__["RequisicaoDescargaAlterarDatas"]();
        _this.oldData = new _requisicao_descarga_alterar_datas_model__WEBPACK_IMPORTED_MODULE_5__["RequisicaoDescargaAlterarDatas"]();
        _this.constantes = new _requisicao_descarga_constants__WEBPACK_IMPORTED_MODULE_3__["RequisicaoDescargaConstants"]();
        _this.validacoes = [];
        _this.now = new Date();
        _this.disabledAtraso = true;
        _this.minutos = 0;
        _this.permissao = {
            todosCampos: false,
            inicioOperacao: false,
            fimOperacao: false,
        };
        _this.target = _this.funcoes.getTargetLocation();
        _this.pageRoute = "/especificos/pontafelix/movimentos/requisicaoDescarga";
        _this.loadConfig = function () {
            if (_this.configuracao.isLoadConfig()) {
                _this.constantes.configBal.permissaoDatasOCD = _this.configuracao.boolean("BAL", "PermissaoDatasOCD");
                _this.constantes.configBal.justAtraso = _this.configuracao.boolean("BAL", "JustAtraso");
                _this.constantes.configBal.justDescarga = _this.configuracao.boolean("BAL", "JustDescarga");
                _this.posConfig();
            }
        };
        _this.validation = new _requisicao_descarga_alterar_datas_validation__WEBPACK_IMPORTED_MODULE_6__["RequisicaoDescargaAlterarDatasValidation"](message, configuracao, service);
        return _this;
    }
    RequisicaoDescargaAlterarDatasComponent.prototype.ngOnInit = function () {
        var _this = this;
        this.permissoesUtils.validRotina(this.constantes.sisFormularioId, 8, 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);
                this.oldData = app_shared_services_funcoes_object_utils_object_utils_static_service__WEBPACK_IMPORTED_MODULE_11__["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 () {
        var _this = this;
        this.trataJustAtraso();
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 11, function () { return _this.permissao.todosCampos = true; }, function () { return _this.permissao.todosCampos = false; });
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 12, function () { return _this.permissao.inicioOperacao = true; }, function () { return _this.permissao.inicioOperacao = false; });
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 13, function () { return _this.permissao.fimOperacao = true; }, function () { return _this.permissao.fimOperacao = false; });
    };
    Object.defineProperty(RequisicaoDescargaAlterarDatasComponent.prototype, "permissaoDatasOCD", {
        get: function () {
            return this.constantes.configBal.permissaoDatasOCD;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(RequisicaoDescargaAlterarDatasComponent.prototype, "disabledQuebra", {
        get: function () {
            return !this.constantes.configBal.justDescarga;
        },
        enumerable: true,
        configurable: true
    });
    RequisicaoDescargaAlterarDatasComponent.prototype.onSubmit = function (form) {
        var _this = this;
        app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_12__["EventEmitterService"].get("msgRDescargaAlteraDatas").emit(form);
        if (form.invalid) {
            this.funcoes.backToTop();
            return;
        }
        var validations = this.validation.getValidations(this.data, this.disabledQuebra, this.disabledAtraso);
        if (app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_13__["ArrayUtilsStaticService"].any(validations)) {
            app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_12__["EventEmitterService"].get("backError").emit(validations.map(function (c) { return c.message; }));
            this.funcoes.backToTop();
            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);
                app_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();
            }
        });
    };
    RequisicaoDescargaAlterarDatasComponent.prototype.back = function () {
        this.funcoesService.desabilitarFiltro();
        this.router.navigate(["" + this.target + this.pageRoute]);
    };
    Object.defineProperty(RequisicaoDescargaAlterarDatasComponent.prototype, "atraso", {
        get: function () {
            return this.disabledAtraso ? "" : this.minutos + " min";
        },
        enumerable: true,
        configurable: true
    });
    RequisicaoDescargaAlterarDatasComponent.prototype.trataDtChegada = function (event) {
        this.validation.validaDtChegada({ dtChegada: event, dtTriagem: this.data.dtTriagem });
        this.trataJustAtraso();
    };
    RequisicaoDescargaAlterarDatasComponent.prototype.trataJustAtraso = function (showError) {
        if (showError === void 0) { showError = false; }
        if (this.constantes.configBal.permissaoDatasOCD) {
            this.validation.validaDtTriagem(this.data.dtTriagem, showError);
        }
        this.disabledAtraso = !this.oldData.motivoAtrasoId;
        if (this.constantes.configBal.justAtraso) {
            var dtInicio = undefined;
            if (!!this.data.dtTriagem)
                dtInicio = this.data.dtTriagem;
            else
                dtInicio = this.data.dtChegada;
            if (this.data.tipoTransp === "F" && app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_14__["DateTimeUtilsStaticService"].maiorA(this.data.dtEntregaNf, dtInicio, ['H', 'M', 'S']))
                dtInicio = this.data.dtEntregaNf;
            if (!dtInicio || !this.data.dtSaida)
                return;
            var minutos = app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_14__["DateTimeUtilsStaticService"].getMinutes(dtInicio, this.data.dtSaida);
            this.disabledAtraso = (!_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["NumberUtilsStaticService"].isPositive(this.data.tempoOperacao) && (minutos > this.data.tempoOperacao));
            this.minutos = minutos;
            if (this.disabledAtraso) {
                this.data.motivoAtrasoId = "";
            }
        }
        else {
            this.disabledAtraso = true;
            this.data.motivoAtrasoId = "";
        }
    };
    RequisicaoDescargaAlterarDatasComponent.ctorParameters = function () { return [
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_2__["Router"] },
        { type: app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_7__["ConfiguracaoFacade"] },
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_2__["ActivatedRoute"] },
        { type: app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_9__["FuncoesService"] },
        { type: app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_8__["MessageService"] },
        { type: _requisicao_descarga_service__WEBPACK_IMPORTED_MODULE_4__["RequisicaoDescargaService"] },
        { type: app_shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_10__["PermissoesUtilsService"] }
    ]; };
    RequisicaoDescargaAlterarDatasComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["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/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-alterar-datas/requisicao-descarga-alterar-datas.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [_angular_router__WEBPACK_IMPORTED_MODULE_2__["Router"],
            app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_7__["ConfiguracaoFacade"],
            _angular_router__WEBPACK_IMPORTED_MODULE_2__["ActivatedRoute"],
            app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_9__["FuncoesService"],
            app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_8__["MessageService"],
            _requisicao_descarga_service__WEBPACK_IMPORTED_MODULE_4__["RequisicaoDescargaService"],
            app_shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_10__["PermissoesUtilsService"]])
    ], RequisicaoDescargaAlterarDatasComponent);
    return RequisicaoDescargaAlterarDatasComponent;
}(_requisicao_descarga_permissoes__WEBPACK_IMPORTED_MODULE_15__["RequisicaoDescargaPermissoes"]));



/***/ }),

/***/ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-alterar-datas/requisicao-descarga-alterar-datas.model.ts":
/*!**********************************************************************************************************************************************************!*\
  !*** ./src/app/pages/especificos/pontafelix/movimentos/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/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-alterar-datas/requisicao-descarga-alterar-datas.validation.ts":
/*!***************************************************************************************************************************************************************!*\
  !*** ./src/app/pages/especificos/pontafelix/movimentos/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 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");
/* harmony import */ var app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_1__ = __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 _requisicao_descarga_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../requisicao-descarga.constants */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga.constants.ts");
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
    function verb(n) { return function (v) { return step([n, v]); }; }
    function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (_) try {
            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
            if (y = 0, t) op = [op[0] & 2, t.value];
            switch (op[0]) {
                case 0: case 1: t = op; break;
                case 4: _.label++; return { value: op[1], done: false };
                case 5: _.label++; y = op[1]; op = [0]; continue;
                case 7: op = _.ops.pop(); _.trys.pop(); continue;
                default:
                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                    if (t[2]) _.ops.pop();
                    _.trys.pop(); continue;
            }
            op = body.call(thisArg, _);
        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
    }
};
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};



var RequisicaoDescargaAlterarDatasValidation = /** @class */ (function () {
    function RequisicaoDescargaAlterarDatasValidation(message, configuracao, service) {
        var _this = this;
        this.message = message;
        this.configuracao = configuracao;
        this.service = service;
        this.constantes = new _requisicao_descarga_constants__WEBPACK_IMPORTED_MODULE_2__["RequisicaoDescargaConstants"]();
        this.rs = [];
        this.configuracao.getConfig(this.constantes.listaParam, function () { return _this.loadConfig(); });
    }
    RequisicaoDescargaAlterarDatasValidation.prototype.loadConfig = function () {
        if (this.configuracao.isLoadConfig()) {
            this.permissaoDatasOCD = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_1__["BooleanUtilsStaticService"].toBoolean(this.configuracao.lerConfig("BAL", "PermissaoDatasOCD"));
        }
    };
    RequisicaoDescargaAlterarDatasValidation.prototype.getValidations = function (data, disabledQuebra, disabledAtraso) {
        this.rs = [];
        if (data.dtTriagem && data.dtChegada)
            this.test(this.dtChegadaDeveSerMaiorDtTriagem({ dtChegada: data.dtChegada, dtTriagem: data.dtTriagem }));
        if (this.permissaoDatasOCD)
            this.test(this.dtTriagemObrigatoria(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 }));
        if (data.dtAutorizacao)
            this.test(this.dtAutorizacaoNaoPodeSerMenorDtDocto(data));
        if (!disabledQuebra)
            this.test(this.motivoQuebraIdObrigatorio({ motivoQuebraId: data.motivoQuebraId }));
        if (!disabledAtraso)
            this.test(this.motivoAtrasoIdObrigatorio({ motivoAtrasoId: data.motivoAtrasoId }));
        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.validaDtTriagem = function (dtTriagem, showError, callBack) {
        if (this.permissaoDatasOCD) {
            var r = this.dtTriagemObrigatoria(dtTriagem, showError);
            if (callBack && (!!r && r.isValid)) {
                callBack();
            }
        }
    };
    RequisicaoDescargaAlterarDatasValidation.prototype.dtTriagemObrigatoria = function (dtTriagem, showError) {
        if (showError === void 0) { showError = false; }
        var r = { "isValid": true, "message": "" };
        if (!dtTriagem || !app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["DateTimeUtilsStaticService"].isDate(dtTriagem)) {
            r.isValid = false;
            r.message = "messages.atencaoDtTriagemNaoInformadaOuInvalida";
        }
        if (!r.isValid && showError) {
            this.message.warning("titles.requisicaoDescarga", r.message);
        }
        return r;
    };
    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 (app_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 (app_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 (app_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 (data, showError) {
        if (showError === void 0) { showError = false; }
        return __awaiter(this, void 0, void 0, function () {
            var r, resultItem;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        r = { "isValid": true, "message": "" };
                        return [4 /*yield*/, this.service.getRequisicaoDescargaItem(+data.requisicaoDescargaId).toPromise()];
                    case 1:
                        resultItem = _a.sent();
                        resultItem.forEach(function (item) {
                            if (app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["DateTimeUtilsStaticService"].maiorOuIgualA(item.dtDocto, data.dtAutorizacao, ['H', 'M', 'S'])) {
                                r.isValid = false;
                                r.message = "messages.dtAutorizacaoNaoPodeSerMenordtDocto";
                            }
                        });
                        if (!r.isValid && showError) {
                            this.message.warning("titles.requisicaoDescarga", r.message);
                        }
                        return [2 /*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 (app_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 (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;
    };
    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 (app_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 (app_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;
    };
    RequisicaoDescargaAlterarDatasValidation.prototype.motivoQuebraIdObrigatorio = function (params, showError) {
        if (showError === void 0) { showError = false; }
        var r = { "isValid": true, "message": "" };
        if (!params.motivoQuebraId) {
            r.isValid = false;
            r.message = "messages.necessarioInfJustQuebra";
        }
        if (!r.isValid && showError) {
            this.message.warning("titles.requisicaoDescarga", r.message);
        }
        return r;
    };
    RequisicaoDescargaAlterarDatasValidation.prototype.motivoAtrasoIdObrigatorio = function (params, showError) {
        if (showError === void 0) { showError = false; }
        var r = { "isValid": true, "message": "" };
        if (!params.motivoAtrasoId) {
            r.isValid = false;
            r.message = "messages.necessarioInfJustAtraso";
        }
        if (!r.isValid && showError) {
            this.message.warning("titles.requisicaoDescarga", r.message);
        }
        return r;
    };
    return RequisicaoDescargaAlterarDatasValidation;
}());



/***/ }),

/***/ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-filter/requisicao-descarga-filter.component.ts":
/*!************************************************************************************************************************************************!*\
  !*** ./src/app/pages/especificos/pontafelix/movimentos/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 app_shared_services_funcoes_modal_utils_modal_utils_static_service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! app/shared/services/funcoes/modal-utils/modal-utils.static.service */ "./src/app/shared/services/funcoes/modal-utils/modal-utils.static.service.ts");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _requisicao_descarga_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../requisicao-descarga.service */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga.service.ts");
/* harmony import */ var app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! app/shared/services/event-emitter/event-emitter.service */ "./src/app/shared/services/event-emitter/event-emitter.service.ts");
/* harmony import */ var app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! app/shared/services/funcoes/date-time-utils/date-time-utils.static.service */ "./src/app/shared/services/funcoes/date-time-utils/date-time-utils.static.service.ts");
/* harmony import */ var app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! app/shared/services/message/message.service */ "./src/app/shared/services/message/message.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, messageService) {
        this.service = service;
        this.messageService = messageService;
        this.outFilter = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["EventEmitter"]();
    }
    RequisicaoDescargaFilterComponent.prototype.onSubmit = function (form) {
        app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_3__["EventEmitterService"].get("formError").emit(null);
        if (form.invalid) {
            return;
        }
        if (!this.validaDatas())
            return;
        if (!this.trataSituacao(this.service.filtro.sitReg))
            return;
        app_shared_services_funcoes_modal_utils_modal_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["ModalUtilsStaticService"].closeModal("rd-filter-dialog");
        this.outFilter.emit(true);
    };
    RequisicaoDescargaFilterComponent.prototype.trataSituacao = function (situacoes) {
        this.service.filtro.sitReg = situacoes;
        if (!situacoes) {
            var message = this.messageService.translate("messages.campoObrigatorio", { name: this.messageService.translate('labels.situacao') });
            this.messageService.warning("titles.requisicaoDescarga", message);
            return false;
        }
        return true;
    };
    RequisicaoDescargaFilterComponent.prototype.validaDatas = function () {
        if (app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_4__["DateTimeUtilsStaticService"].menorA(this.service.filtro.dataF, this.service.filtro.dataI, ['H', 'M'])) {
            this.messageService.warning("titles.requisicaoDescarga", "messages.periodoDeMaiorQueAte");
            return false;
        }
        return true;
    };
    RequisicaoDescargaFilterComponent.ctorParameters = function () { return [
        { type: _requisicao_descarga_service__WEBPACK_IMPORTED_MODULE_2__["RequisicaoDescargaService"] },
        { type: app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_5__["MessageService"] }
    ]; };
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Output"])(),
        __metadata("design:type", Object)
    ], RequisicaoDescargaFilterComponent.prototype, "outFilter", void 0);
    RequisicaoDescargaFilterComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["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/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-filter/requisicao-descarga-filter.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [_requisicao_descarga_service__WEBPACK_IMPORTED_MODULE_2__["RequisicaoDescargaService"],
            app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_5__["MessageService"]])
    ], RequisicaoDescargaFilterComponent);
    return RequisicaoDescargaFilterComponent;
}());



/***/ }),

/***/ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-filter/requisicao-descarga-filter.model.ts":
/*!********************************************************************************************************************************************!*\
  !*** ./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-filter/requisicao-descarga-filter.model.ts ***!
  \********************************************************************************************************************************************/
/*! exports provided: RequisicaoDescargaFilter */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RequisicaoDescargaFilter", function() { return RequisicaoDescargaFilter; });
/* 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 RequisicaoDescargaFilter = /** @class */ (function () {
    function RequisicaoDescargaFilter() {
        this.dataI = app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["DateTimeUtilsStaticService"].addDays(new Date(), -30);
        this.dataF = new Date();
        this.destinatarioIdCliente = 0;
        this.requisicaoDescargaId = 0;
        this.localOperacaoId = "";
        this.materialId = "";
        this.cadastroPlacaId = "";
        this.outras = "N";
        this.sitReg = "A,P,S,F";
    }
    return RequisicaoDescargaFilter;
}());



/***/ }),

/***/ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-form/requisicao-descarga-form.component.ts":
/*!********************************************************************************************************************************************!*\
  !*** ./src/app/pages/especificos/pontafelix/movimentos/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 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");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/fesm5/router.js");
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/* harmony import */ var _requisicao_descarga_item_requisicao_descarga_item_model__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../requisicao-descarga-item/requisicao-descarga-item.model */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-item/requisicao-descarga-item.model.ts");
/* harmony import */ var _requisicao_descarga_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../requisicao-descarga.constants */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga.constants.ts");
/* harmony import */ var _requisicao_descarga_model__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../requisicao-descarga.model */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga.model.ts");
/* harmony import */ var _requisicao_descarga_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./../requisicao-descarga.service */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga.service.ts");
/* harmony import */ var _requisicao_descarga_form_validation__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./requisicao-descarga-form.validation */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-form/requisicao-descarga-form.validation.ts");
/* harmony import */ var app_config_enumerables__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! app/config/enumerables */ "./src/app/config/enumerables.ts");
/* harmony import */ var app_shared_components_pesquisa_pesquisa_check_list_pesquisa_check_list_model__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! app/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 app_shared_components_pesquisa_pesquisa_check_list_pesquisa_check_list_component__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! app/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 app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! app/shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! app/pages/login/login.service */ "./src/app/pages/login/login.service.ts");
/* harmony import */ var app_shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! app/shared/services/funcoes/permissoes-utils/permissoes-utils.service */ "./src/app/shared/services/funcoes/permissoes-utils/permissoes-utils.service.ts");
/* harmony import */ var app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! app/shared/services/funcoes/configuracao/configuracao.facade */ "./src/app/shared/services/funcoes/configuracao/configuracao.facade.ts");
/* harmony import */ var app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! app/shared/services/funcoes/funcoes.service */ "./src/app/shared/services/funcoes/funcoes.service.ts");
/* harmony import */ var app_pages_cadastro_material_material_service__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! app/pages/cadastro/material/material.service */ "./src/app/pages/cadastro/material/material.service.ts");
/* harmony import */ var app_pages_cadastro_motorista_motorista_service__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! app/pages/cadastro/motorista/motorista.service */ "./src/app/pages/cadastro/motorista/motorista.service.ts");
/* harmony import */ var app_pages_cadastro_destinatario_destinatario_service__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! app/pages/cadastro/destinatario/destinatario.service */ "./src/app/pages/cadastro/destinatario/destinatario.service.ts");
/* harmony import */ var app_shared_services_funcoes_object_utils_object_utils_static_service__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! app/shared/services/funcoes/object-utils/object-utils.static.service */ "./src/app/shared/services/funcoes/object-utils/object-utils.static.service.ts");
/* harmony import */ var app_shared_services_funcoes_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");
/* harmony import */ var app_pages_cadastro_material_material_model__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! app/pages/cadastro/material/material.model */ "./src/app/pages/cadastro/material/material.model.ts");
/* harmony import */ var app_pages_cadastro_motorista_motorista_model__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! app/pages/cadastro/motorista/motorista.model */ "./src/app/pages/cadastro/motorista/motorista.model.ts");
/* harmony import */ var app_pages_cadastro_destinatario_destinatario_model__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! app/pages/cadastro/destinatario/destinatario.model */ "./src/app/pages/cadastro/destinatario/destinatario.model.ts");
/* harmony import */ var app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! app/shared/services/funcoes/array-utils/array-utils.static.service */ "./src/app/shared/services/funcoes/array-utils/array-utils.static.service.ts");
/* harmony import */ var app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! app/shared/services/funcoes/boolean-utils/boolean-utils.static.service */ "./src/app/shared/services/funcoes/boolean-utils/boolean-utils.static.service.ts");
/* harmony import */ var app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! app/shared/services/event-emitter/event-emitter.service */ "./src/app/shared/services/event-emitter/event-emitter.service.ts");
/* harmony import */ var app_shared_components_corporate_base_base_permissoes__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! app/shared/components/corporate/base/base.permissoes */ "./src/app/shared/components/corporate/base/base.permissoes.ts");
/* harmony import */ var app_pages_veiculo_check_list_check_list_service__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! app/pages/veiculo/check-list/check-list.service */ "./src/app/pages/veiculo/check-list/check-list.service.ts");
/* harmony import */ var app_pages_veiculo_check_list_check_list_model__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! app/pages/veiculo/check-list/check-list.model */ "./src/app/pages/veiculo/check-list/check-list.model.ts");
/* harmony import */ var _requisicao_descarga_print_etiquetas_modal_requisicao_descarga_print_etiquetas_modal_component__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ../requisicao-descarga-print-etiquetas-modal/requisicao-descarga-print-etiquetas-modal.component */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-print-etiquetas-modal/requisicao-descarga-print-etiquetas-modal.component.ts");
/* harmony import */ var app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_32__ = __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 RequisicaoDescargaFormComponent = /** @class */ (function (_super) {
    __extends(RequisicaoDescargaFormComponent, _super);
    function RequisicaoDescargaFormComponent(router, message, activatedRoute, service, loginService, permissoesUtils, configuracao, funcoesService, materialService, motoristaService, destinatarioService, checkListService) {
        var _this = _super.call(this, new _requisicao_descarga_constants__WEBPACK_IMPORTED_MODULE_5__["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.checkListService = checkListService;
        _this.data = new _requisicao_descarga_model__WEBPACK_IMPORTED_MODULE_6__["RequisicaoDescarga"]();
        _this.dataOcrPesagem = new _requisicao_descarga_model__WEBPACK_IMPORTED_MODULE_6__["RequisicaoDescargaOcrPesagemDto"]();
        _this.mensagens = [];
        _this.constantes = new _requisicao_descarga_constants__WEBPACK_IMPORTED_MODULE_5__["RequisicaoDescargaConstants"]();
        _this.mascaras = new app_config_enumerables__WEBPACK_IMPORTED_MODULE_9__["Mascaras"]();
        _this.isOutrasDescarga = false;
        _this.filtroTipoDetransporte = 'R';
        _this.mascara = new app_config_enumerables__WEBPACK_IMPORTED_MODULE_9__["Mascaras"]();
        _this.filtroCheckList = new app_shared_components_pesquisa_pesquisa_check_list_pesquisa_check_list_model__WEBPACK_IMPORTED_MODULE_10__["SelecionaCheckListFiltro"];
        _this.desabilitaNAltDepositoLibVeic = false;
        _this.desabilitaNPermiteAltDados20 = false;
        _this.disabledCamposCheckList = false;
        _this.target = _this.funcoesService.getTargetLocation();
        _this.pageRoute = "/especificos/pontafelix/movimentos/requisicaoDescarga";
        _this.alterarDados = function () {
            if (!_this.data.cliPontaRequisicaoDescargaId)
                return;
            _this.permissoesUtils.validRotina(_this.constantes.sisFormularioId, 9, function () {
                if (_this.service.abaAtual === "D") {
                    _this.router.navigate(["" + _this.target + _this.pageRoute + "/alterarDados/form/" + _this.data.cliPontaRequisicaoDescargaId]);
                }
                else {
                    _this.router.navigate(["" + _this.target + _this.pageRoute + "/alterarDadosItem/" + _this.data.cliPontaRequisicaoDescargaId]);
                }
            });
        };
        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_8__["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_4__["RequisicaoDescargaItem"]();
        this.getConfig();
        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");
                        this.service.abaAtual = "D";
                        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);
                        return [4 /*yield*/, this.service.requisicaoDescargaTmpGrava({
                                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: return [2 /*return*/];
                }
            });
        }); }, function () {
            _this.permissoesUtils.back();
        });
        _super.prototype.addFuncoes.call(this, [
            { action: 'alterarDados', func: function () { return _this.alterarDados; } }
        ]);
    };
    RequisicaoDescargaFormComponent.prototype.getConfig = function () {
        var _this = this;
        this.constantes.listaParam.map(function (c) {
            if (c.sistema === 'BAL') {
                c.parametros.push("RtsLibOD" + _this.configuracao.macAddress);
            }
        });
        this.configuracao.getConfig(this.constantes.listaParam, function () { return _this.loadConfig(); });
    };
    RequisicaoDescargaFormComponent.prototype.loadConfig = function () {
        if (this.configuracao.isLoadConfig()) {
            this.constantes.configBal.pesagemAutomatica = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_26__["BooleanUtilsStaticService"].toBoolean(this.configuracao.lerConfig("BAL", "PesagemAutomatica"));
            this.constantes.configBal.permiteAltShipment = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_26__["BooleanUtilsStaticService"].toBoolean(this.configuracao.lerConfig("BAL", "PermiteAltShipment"));
            this.constantes.configBal.codBalCheckList = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_26__["BooleanUtilsStaticService"].toBoolean(this.configuracao.lerConfig("BAL", "CodBalCheckList"));
            this.constantes.configBal.obrVisualizarDocMoto = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_26__["BooleanUtilsStaticService"].toBoolean(this.configuracao.lerConfig("BAL", "ObrVisualizarDocMoto"));
            this.constantes.configBal.ocrPesagem = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_26__["BooleanUtilsStaticService"].toBoolean(this.configuracao.lerConfig("BAL", "OcrPesagem"));
            this.constantes.configBal.apresConfOcrEnt = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_26__["BooleanUtilsStaticService"].toBoolean(this.configuracao.lerConfig("BAL", "ApresConfOcrEnt"));
            this.constantes.configBal.validaPesagem = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_26__["BooleanUtilsStaticService"].toBoolean(this.configuracao.lerConfig("BAL", "ValidaPesagem"));
            this.constantes.configBal.rtsFlag = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_26__["BooleanUtilsStaticService"].toBoolean(this.configuracao.lerConfig("BAL", "RtsFlag"));
            this.constantes.configBal.rtsLibOD = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_26__["BooleanUtilsStaticService"].toBoolean(this.configuracao.lerConfig("BAL", "RtsLibOD" + this.configuracao.macAddress));
            this.constantes.configBal.geoFlag = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_26__["BooleanUtilsStaticService"].toBoolean(this.configuracao.lerConfig("BAL", "GeoFlag"));
            this.constantes.configBal.geoCancela = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_26__["BooleanUtilsStaticService"].toBoolean(this.configuracao.lerConfig("BAL", "GeoCancela"));
            this.constantes.configBal.easyAtivo = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_26__["BooleanUtilsStaticService"].toBoolean(this.configuracao.lerConfig("BAL", "EasyAtivo"));
            this.constantes.configBal.intCtaVersao = this.configuracao.number("BAL", "IntCtaVersao");
            this.constantes.configBal.intCta = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_26__["BooleanUtilsStaticService"].toBoolean(this.configuracao.lerConfig("BAL", "IntCta"));
            this.constantes.configBal.seaFlag = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_26__["BooleanUtilsStaticService"].toBoolean(this.configuracao.lerConfig("BAL", "SeaFlag"));
            this.constantes.configBal.primeAtivo = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_26__["BooleanUtilsStaticService"].toBoolean(this.configuracao.lerConfig("BAL", "PrimeAtivo"));
            this.constantes.configCtv.observPortal = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_26__["BooleanUtilsStaticService"].toBoolean(this.configuracao.lerConfig("CTV", "ObservPortal"));
            this.constantes.configCtv.habCampoShipment = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_26__["BooleanUtilsStaticService"].toBoolean(this.configuracao.lerConfig("CTV", "HabCampoShipment"));
            this.constantes.configCtv.checkListPesa = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_26__["BooleanUtilsStaticService"].toBoolean(this.configuracao.lerConfig("CTV", "CheckListPesa"));
            this.constantes.configCtr.dtSeguro = app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["DateTimeUtilsStaticService"].convertDateSqlToDate(this.configuracao.lerConfig("CTR", "DtSeguro"));
            this.constantes.configSto.intGuardian = this.configuracao.lerConfig("STO", "IntGuardian");
            this.constantes.configWeb.cWebModRequisicaoD = this.configuracao.lerConfig("WEB", "CWebModRequisicaoD");
            this.constantes.configCtr.tpEmissaoEtiqueta = this.configuracao.lerConfig("CTR", "TpEmissaoEtiqueta");
            this.constantes.configWeb.prefixoRelEspecifico = this.configuracao.lerConfig("WEB", "PrefixoRelEspecifico");
        }
    };
    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.service.visualizouDoctosMotorista = false;
                        this.statusBalanca();
                        this.data = app_shared_services_funcoes_object_utils_object_utils_static_service__WEBPACK_IMPORTED_MODULE_20__["ObjectUtilsStaticService"].clone(data);
                        if (this.funcoesService.isEdit(this.actionForm)) {
                            if (!this.validation.podeAlterar(this.data)) {
                                this.back(false);
                                return [2 /*return*/];
                            }
                            if (!!this.data.materialId) {
                                this.materialService.getById(this.data.materialId).subscribe(function (resp) {
                                    _this.data.material = resp;
                                });
                            }
                            if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_21__["NumberUtilsStaticService"].isPositive(this.data.pesoTara)) {
                                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.avancaEdicao();
                                            return [2 /*return*/];
                                        });
                                    }); });
                                }
                                else {
                                    this.avancaEdicao();
                                }
                            }
                            else {
                                this.avancaEdicao();
                            }
                        }
                        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(false);
                            return [2 /*return*/];
                        }
                        this.validaPesagemCheckList();
                        return [4 /*yield*/, Object(rxjs__WEBPACK_IMPORTED_MODULE_3__["forkJoin"])([
                                this.materialService.getById(data.material),
                                this.motoristaService.getById(app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_21__["NumberUtilsStaticService"].toNumber(data.motorista)),
                                this.destinatarioService.getById(app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_21__["NumberUtilsStaticService"].toNumber(data.transportadora)),
                            ]).toPromise()];
                    case 1:
                        results = _a.sent();
                        this.data.material = new app_pages_cadastro_material_material_model__WEBPACK_IMPORTED_MODULE_22__["Material"]();
                        this.data.motorista = new app_pages_cadastro_motorista_motorista_model__WEBPACK_IMPORTED_MODULE_23__["Motorista"]();
                        this.data.transportadora = new app_pages_cadastro_destinatario_destinatario_model__WEBPACK_IMPORTED_MODULE_24__["Destinatario"]();
                        if (app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_25__["ArrayUtilsStaticService"].any(results)) {
                            this.data.material = !!results[0] ? results[0] : new app_pages_cadastro_material_material_model__WEBPACK_IMPORTED_MODULE_22__["Material"]();
                            this.data.motorista = !!results[1] ? results[1] : new app_pages_cadastro_motorista_motorista_model__WEBPACK_IMPORTED_MODULE_23__["Motorista"]();
                            this.data.transportadora = !!results[2] ? results[2] : new app_pages_cadastro_destinatario_destinatario_model__WEBPACK_IMPORTED_MODULE_24__["Destinatario"]();
                        }
                        this.data.materialId = data.material;
                        this.data.motoristaId = data.motorista;
                        this.data.destinatarioIdTransportadora = data.transportadora;
                        this.data.tiposDeTransporteId = 'R';
                        this.data.cliPontaRequisicaoDescargaId = data.regRequisicao;
                        this.data.checkListId = data.codCheckList;
                        this.data.checkListItemId = data.itemCheckList;
                        this.data.dtRequisicao = new Date(data.dtRequisicao);
                        this.data.placaCavalo = data.placaCavalo;
                        this.data.estadoIdCavalo = data.estado;
                        this.data.placaCarreta1 = data.placaCarreta1;
                        this.data.placaCarreta2 = 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;
                        if (!this.checkedIntegracoes()) {
                            this.cancelar();
                            return [2 /*return*/];
                        }
                        _a.label = 2;
                    case 2: return [2 /*return*/];
                }
            });
        });
    };
    RequisicaoDescargaFormComponent.prototype.validaPesagemCheckList = function () {
        var _this = this;
        if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_21__["NumberUtilsStaticService"].isNotPositive(this.data.checkListId))
            return;
        this.checkListService.getById(this.data.checkListId).subscribe(function (resp) {
            if (resp) {
                _this.data.checkList = resp;
                if (_this.constantes.configCtv.checkListPesa && !app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_26__["BooleanUtilsStaticService"].toBoolean(_this.data.checkList.flagPesa)) {
                    _this.data.pesoBru = 0;
                }
            }
            else {
                _this.data.checkList = new app_pages_veiculo_check_list_check_list_model__WEBPACK_IMPORTED_MODULE_30__["CheckList"]();
            }
        });
    };
    RequisicaoDescargaFormComponent.prototype.statusBalanca = function () {
        if (this.constantes.configBal.codBalCheckList) {
            this.service.balancaOK = (this.data.balancaId >= 1 && this.data.balancaId <= 6);
        }
    };
    RequisicaoDescargaFormComponent.prototype.avancaEdicao = function () {
        return __awaiter(this, void 0, void 0, function () {
            var validationResult, mensagens, result;
            var _this = this;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.service.validaSePodeAlterar({ requisicaoDescargaId: this.data.cliPontaRequisicaoDescargaId }).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); });
                            this.back(false);
                            return [2 /*return*/];
                        }
                        return [4 /*yield*/, this.service.requisicaoDescargaTmpGrava({
                                requisicaoDescargaId: this.data.cliPontaRequisicaoDescargaId,
                                sitRotina: this.sitRotina,
                                checkListId: this.data.checkListId
                            }).toPromise()];
                    case 2:
                        result = _a.sent();
                        this.mensagens = this.message.validationResult(result.validationResult);
                        if (result && !result.validationResult.isValid) {
                            this.message.warning("titles.requisicaoDescarga", this.mensagens[0]);
                            this.back(false);
                            return [2 /*return*/];
                        }
                        else {
                            this.data = result;
                            this.regTmp = result.retRegTmp;
                            this.data.cliPontaRequisicaoDescargaId = result.regTmp;
                            this.data.regTmp = result.retRegTmp;
                            this.trataDadosTemp();
                            this.validaPesagemCheckList();
                        }
                        return [2 /*return*/];
                }
            });
        });
    };
    RequisicaoDescargaFormComponent.prototype.trataDadosTemp = function () {
        return __awaiter(this, void 0, void 0, function () {
            var results;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, Object(rxjs__WEBPACK_IMPORTED_MODULE_3__["forkJoin"])([
                            this.motoristaService.getById(app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_21__["NumberUtilsStaticService"].toNumber(this.data.motoristaId)),
                            this.destinatarioService.getById(app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_21__["NumberUtilsStaticService"].toNumber(this.data.destinatarioIdTransportadora))
                        ]).toPromise()];
                    case 1:
                        results = _a.sent();
                        if (app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_25__["ArrayUtilsStaticService"].any(results)) {
                            this.data.motorista = !!results[0] ? results[0] : new app_pages_cadastro_motorista_motorista_model__WEBPACK_IMPORTED_MODULE_23__["Motorista"]();
                            this.data.transportadora = !!results[1] ? results[1] : new app_pages_cadastro_destinatario_destinatario_model__WEBPACK_IMPORTED_MODULE_24__["Destinatario"]();
                        }
                        return [2 /*return*/];
                }
            });
        });
    };
    RequisicaoDescargaFormComponent.prototype.checkedIntegracoes = function () {
        this.dataOcrPesagem = new _requisicao_descarga_model__WEBPACK_IMPORTED_MODULE_6__["RequisicaoDescargaOcrPesagemDto"]();
        if (this.constantes.configBal.ocrPesagem) {
            this.dataOcrPesagem.placaDig1 = this.data.placaCavalo;
            this.dataOcrPesagem.placaDig2 = this.data.placaCarreta1;
            this.dataOcrPesagem.placaDig3 = this.data.placaCarreta2;
            this.dataOcrPesagem.vPlaca1 = this.data.placaCavalo;
            this.dataOcrPesagem.vPlaca2 = this.data.placaCarreta1;
            this.dataOcrPesagem.vPlaca3 = this.data.placaCarreta2;
            //Nesse momento é chamado a automação, que não será desenvolvida nesse momento
            this.dataOcrPesagem.iErro = 1;
            var message = this.message.getTranslates("messages", "ocorreuErroAbaixoNaIntegracaoComOCR");
            var erroOcorrido = this.message.getTranslates("messages", "interfaceNaoImplementada"); //retornado pela integração
            if (this.dataOcrPesagem.iErro === 1) {
                this.message.warning("titles.requisicaoDescarga", message + '<br>Erro: ' + erroOcorrido);
                return false;
            }
            if (this.constantes.configBal.apresConfOcrEnt) {
                this.visualizarFotoOCR();
            }
        }
        return false;
    };
    RequisicaoDescargaFormComponent.prototype.visualizarFotoOCR = function () {
        var _this = this;
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 10, function () { return __awaiter(_this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                if (!this.data.cliPontaRequisicaoDescargaId)
                    return [2 /*return*/];
                app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_27__["EventEmitterService"].get('emiFotoOcr').emit({
                    registro: this.data.cliPontaRequisicaoDescargaId,
                    tipo: 'R'
                });
                return [2 /*return*/];
            });
        }); });
    };
    RequisicaoDescargaFormComponent.prototype.cancelar = function () {
        this.confirmMudancaRota = false;
        this.limparTmp();
        this.router.navigate(["" + this.target + this.pageRoute]);
    };
    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'
            };
        },
        enumerable: true,
        configurable: true
    });
    RequisicaoDescargaFormComponent.prototype.selectedItem = function (event) {
        this.item = event;
    };
    RequisicaoDescargaFormComponent.prototype.abaClicada = function (aba) {
        this.service.abaAtual = aba;
    };
    RequisicaoDescargaFormComponent.prototype.verificaAlteracao = function (obj) {
        var _this = this;
        var promise = new Promise(function (resolve, reject) {
            _this.service.validaSePodeAlterar(obj).subscribe(function (result) {
                resolve(result);
                reject(result);
            });
        });
        return promise;
    };
    RequisicaoDescargaFormComponent.prototype.trataMotorista = function (motorista) {
        this.data.motorista = motorista;
    };
    RequisicaoDescargaFormComponent.prototype.trataButtonDocMoto = function (visualizouDocMoto) {
        this.service.visualizouDoctosMotorista = visualizouDocMoto;
    };
    RequisicaoDescargaFormComponent.prototype.opnModal = function () {
        app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_27__["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.onSubmit = function (form) {
        return __awaiter(this, void 0, void 0, function () {
            var validations;
            var _this = this;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_27__["EventEmitterService"].get("formError").emit(form);
                        if (form.invalid) {
                            this.funcoesService.backToTop();
                            return [2 /*return*/];
                        }
                        return [4 /*yield*/, this.validation.getValidations(this.data)];
                    case 1:
                        validations = _a.sent();
                        if (validations && validations.length > 0) {
                            this.mensagens = this.message.validationsForm(validations);
                            app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_27__["EventEmitterService"].get("backError").emit(this.mensagens);
                            this.funcoesService.backToTop();
                            return [2 /*return*/];
                        }
                        if (this.sitRotina === "A") {
                            this.data.regTmp = this.regTmp;
                        }
                        else {
                            this.data.cliPontaRequisicaoDescargaId = 0;
                            this.data.regTmp = this.regTmp;
                        }
                        if (this.constantes.configBal.validaPesagem && !this.constantes.configBal.pesagemAutomatica) {
                            this.message.confirm("titles.requisicaoDescarga", "messages.confirmaPesagemManual", null, function () { return _this.executeSalvar(); });
                        }
                        else {
                            this.executeSalvar();
                        }
                        return [2 /*return*/];
                }
            });
        });
    };
    RequisicaoDescargaFormComponent.prototype.executeSalvar = function () {
        var _this = this;
        this.service
            .save(this.data, this.data.cliPontaRequisicaoDescargaId > 0)
            .subscribe(function (result) {
            _this.mensagens = _this.message.validationResult(result.validationResult);
            if (!result.validationResult.isValid) {
                app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_27__["EventEmitterService"].get("backError").emit(_this.mensagens);
            }
            else {
                _this.message.saveSuccess("titles.requisicaoDescarga");
                if (_this.funcoesService.isCreate(_this.actionForm)) {
                    _this._print(result);
                    _this.acionaCancelas();
                }
                else {
                    _this.back(false);
                }
            }
        });
    };
    RequisicaoDescargaFormComponent.prototype._print = function (data) {
        var _this = this;
        if (app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_26__["BooleanUtilsStaticService"].toBoolean(data.validationResult.message)) {
            this.service.getMovimentoOperacionalLog(+data.cliPontaRequisicaoDescargaId).subscribe(function (resp) {
                if (resp && resp.length > 0) {
                    _this.printAutorizacaoDescargaOperacional(data);
                }
            });
        }
        if (this.constantes.configCtr.tpEmissaoEtiqueta === 'D') {
            this.printEtiquetaLote(data);
        }
        else {
            this.printAutorizacao();
        }
    };
    RequisicaoDescargaFormComponent.prototype.printAutorizacaoDescargaOperacional = function (data) {
        var modRel = "PON0010";
        var reportTitulo = { titulo: 'Autorização de Descarga Operacional', subTitulo: '' };
        this.funcoesService.reportInvoc.invocaRelatorioEspecificos(modRel, reportTitulo, {
            filialId: this.loginService.getLogin().filialId,
            autorizacao: app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_21__["NumberUtilsStaticService"].toNumber(data.cliPontaRequisicaoDescargaId),
            tipoDeCarga: 2
        });
    };
    RequisicaoDescargaFormComponent.prototype.printEtiquetaLote = function (data) {
        return __awaiter(this, void 0, void 0, function () {
            var _i, _a, item, resp, message, userConfirmed;
            return __generator(this, function (_b) {
                switch (_b.label) {
                    case 0:
                        if (!(data.requisicaoDescargaItens.length > 0)) return [3 /*break*/, 6];
                        _i = 0, _a = data.requisicaoDescargaItens;
                        _b.label = 1;
                    case 1:
                        if (!(_i < _a.length)) return [3 /*break*/, 6];
                        item = _a[_i];
                        item.cliPontaRequisicaoDescargaId = data.cliPontaRequisicaoDescargaId;
                        return [4 /*yield*/, this.service.getLoteEtiqueta(item).toPromise()];
                    case 2:
                        resp = _b.sent();
                        if (!resp) return [3 /*break*/, 5];
                        message = this.message.translate("messages.confirmaImpressaoDasEtiquetasParaItemSelecionado", { item: item.cliPontaRequisicaoDescargaItemId });
                        return [4 /*yield*/, this.showConfirmationDialog("titles.requisicaoDescarga", message)];
                    case 3:
                        userConfirmed = _b.sent();
                        if (!userConfirmed) return [3 /*break*/, 5];
                        return [4 /*yield*/, this.showPrintEtiquetasModal(item)];
                    case 4:
                        _b.sent();
                        _b.label = 5;
                    case 5:
                        _i++;
                        return [3 /*break*/, 1];
                    case 6:
                        this.printAutorizacao();
                        return [2 /*return*/];
                }
            });
        });
    };
    RequisicaoDescargaFormComponent.prototype.showPrintEtiquetasModal = function (item) {
        var _this = this;
        return new Promise(function (resolve) {
            _this.modalPromiseResolver = resolve;
            _this.childPrintEtiquetasModalComponent.objectSelect(item);
        });
    };
    RequisicaoDescargaFormComponent.prototype.showConfirmationDialog = function (title, message) {
        var _this = this;
        return new Promise(function (resolve) {
            _this.message.confirm(title, message, null, function () { return resolve(true); }, false, function () { return resolve(false); });
        });
    };
    RequisicaoDescargaFormComponent.prototype.retPrintEtiquetas = function () {
        if (this.modalPromiseResolver) {
            this.modalPromiseResolver();
            this.modalPromiseResolver = null;
        }
    };
    RequisicaoDescargaFormComponent.prototype.printAutorizacao = function () {
        var modRel = this.constantes.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_32__["StringUtilsStaticService"].isNotEmpty(this.constantes.configWeb.prefixoRelEspecifico) && modRel.indexOf(this.constantes.configWeb.prefixoRelEspecifico) == 0) {
            this.funcoesService.reportInvoc.invocaRelatorioEspecificos(modRel, reportTitulo, {
                filialId: this.loginService.getLogin().filialId,
                autorizacao: this.data.cliPontaRequisicaoDescargaId
            });
        }
        else {
            this.funcoesService.reportInvoc.invocaRelatorio(modRel, reportTitulo, {
                filialId: this.loginService.getLogin().filialId,
                autorizacao: this.data.cliPontaRequisicaoDescargaId
            });
        }
        this.back(false);
    };
    RequisicaoDescargaFormComponent.prototype.acionaCancelas = function () {
        //(Automação, não será desenvolvido neste momento)
        if (this.constantes.configBal.rtsFlag && this.constantes.configBal.rtsLibOD) {
            //Executar a rotina 18.3. RTS – Libera Gate (uaLiberaGate)
        }
        else if (this.constantes.configSto.intGuardian === "P") {
            //Executar a rotina 10.8. Guardian – Processo Aciona Cancela 
        }
        else if (this.constantes.configBal.geoFlag && this.constantes.configBal.geoCancela) {
            //Executar a rotina  19.1. GeoVision – Aciona Porta (uaOcrGeoAcionaPorta)
        }
        else if (this.constantes.configBal.easyAtivo) {
            //Executar a rotina 16.1. EasyGate – Aciona Cancela (uaOcrEasyGateAcionaCancela)
        }
        else if (this.constantes.configBal.intCta && this.constantes.configBal.intCtaVersao === 2) {
            //Executar a rotina 4.5. CTA – Aciona Cancela (uaCtaAcionaCancela)
        }
        else if (this.constantes.configBal.seaFlag) {
            //Executar a rotina 20.1. SeaBox – Aciona Cancela (uaOcrSeaAcionaCancela)
        }
        else if (this.constantes.configBal.primeAtivo) {
            //Executar a rotina 21.1. Prime – Aciona Cancela (uaOcrPrimeAcionaCancela)
        }
        this.enviaCorrecaoOCR();
    };
    RequisicaoDescargaFormComponent.prototype.enviaCorrecaoOCR = function () {
        //Executar a rotina 20.1. SeaBox – Aciona Cancela (uaOcrSeaAcionaCancela)
    };
    RequisicaoDescargaFormComponent.prototype.edit = function () {
        this.router.navigate(["" + this.target + this.pageRoute + "/edit/" + this.data.cliPontaRequisicaoDescargaId]);
    };
    RequisicaoDescargaFormComponent.prototype.back = function (messageConfirmLimpar) {
        if (messageConfirmLimpar === void 0) { messageConfirmLimpar = true; }
        this.funcoesService.desabilitarFiltro();
        this.confirmMudancaRota = false;
        if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_21__["NumberUtilsStaticService"].isPositive(this.regTmp) && messageConfirmLimpar) {
            this.limparTmp(true);
        }
        else {
            this.router.navigate(["" + this.target + this.pageRoute]);
        }
    };
    RequisicaoDescargaFormComponent.prototype.refreshItens = function (itens) {
        var _this = this;
        this.data.requisicaoDescargaItens = itens;
        this.data.kilos = 0;
        this.data.requisicaoDescargaItens.forEach(function (e) {
            _this.data.kilos = +_this.data.kilos + +e.pesoDoc;
        });
    };
    RequisicaoDescargaFormComponent.prototype.getPeso = function (resp) {
        this.data.flagManual = resp.manual ? "S" : "N";
        if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_21__["NumberUtilsStaticService"].isNotPositive(resp.peso))
            this.data.pesoBru = undefined;
    };
    RequisicaoDescargaFormComponent.prototype.trataTanque = function (data) {
        this.data.tanque = data;
    };
    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.limparTmp = function (confirm) {
        var _this = this;
        if (confirm === void 0) { confirm = false; }
        if (confirm) {
            this.message.confirm("titles.requisicaoDescarga", "messages.desejaCancelarAlteracoes", null, function () {
                _this.executeCancelarTmp();
            });
        }
        else {
            this.executeCancelarTmp();
        }
    };
    RequisicaoDescargaFormComponent.prototype.executeCancelarTmp = function () {
        var _this = this;
        if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_21__["NumberUtilsStaticService"].isPositive(this.regTmp)) {
            this.service.cancelarTmp({ regTmp: this.regTmp }).subscribe(function (result) {
                if (!result.isValid) {
                    var mensagens = _this.message.validationResult(result);
                    mensagens.forEach(function (m) { return _this.message.danger('titles.requisicaoDescarga', m); });
                }
                else {
                    _this.funcoesService.desabilitarFiltro();
                    _this.router.navigate(["" + _this.target + _this.pageRoute]);
                    if (_this.service.balancaOK && _this.constantes.configBal.codBalCheckList) {
                        _this.service.balancaOK = false;
                    }
                }
            });
        }
    };
    Object.defineProperty(RequisicaoDescargaFormComponent.prototype, "enableShipment", {
        get: function () {
            return this.constantes.configBal.permiteAltShipment;
        },
        enumerable: true,
        configurable: true
    });
    RequisicaoDescargaFormComponent.prototype.validaDtRequisicao = function () {
        if (app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["DateTimeUtilsStaticService"].menorA(this.data.dtRequisicao, this.constantes.configCtr.dtSeguro, ['H', 'M', 'S'])) {
            this.message.warning("titles.requisicaoDescarga", "messages.dtRequisicaoDeveSerMaiorDataSeguro");
            return;
        }
        if (app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["DateTimeUtilsStaticService"].maiorAHoje(this.data.dtRequisicao, ['H', 'M', 'S'])) {
            this.message.warning("titles.requisicaoDescarga", "messages.dtRequisicaoDeveSerMenorDataAtual");
            return;
        }
    };
    RequisicaoDescargaFormComponent.prototype.trataBalanca = function (event) {
        if (event) {
            if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_21__["NumberUtilsStaticService"].isPositive(+event.chave)) {
                this.data.pesoBru = 0;
            }
            if (!(+event.chave >= 1) && (+event.chave <= 99)) {
                this.message.error("titles.requisicaoDescarga", "messages.balancaIdDeveEstarEntre1E99");
                return;
            }
        }
    };
    Object.defineProperty(RequisicaoDescargaFormComponent.prototype, "balancaRequired", {
        get: function () {
            return this.constantes.configBal.codBalCheckList;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(RequisicaoDescargaFormComponent.prototype, "btnPesagemVisivel", {
        get: function () {
            return (this.constantes.configBal.pesagemAutomatica && this.constantes.configSto.intGuardian !== 'P');
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(RequisicaoDescargaFormComponent.prototype, "habilitaBtnDocMoto", {
        get: function () {
            if (this.constantes.configBal.obrVisualizarDocMoto && this.actionForm === app_config_enumerables__WEBPACK_IMPORTED_MODULE_9__["ActionForm"].edit && app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_21__["NumberUtilsStaticService"].isPositive(this.data.motoristaId))
                return true;
            return false;
        },
        enumerable: true,
        configurable: true
    });
    RequisicaoDescargaFormComponent.ctorParameters = function () { return [
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_2__["Router"] },
        { type: app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_12__["MessageService"] },
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_2__["ActivatedRoute"] },
        { type: _requisicao_descarga_service__WEBPACK_IMPORTED_MODULE_7__["RequisicaoDescargaService"] },
        { type: app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_13__["LoginService"] },
        { type: app_shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_14__["PermissoesUtilsService"] },
        { type: app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_15__["ConfiguracaoFacade"] },
        { type: app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_16__["FuncoesService"] },
        { type: app_pages_cadastro_material_material_service__WEBPACK_IMPORTED_MODULE_17__["MaterialService"] },
        { type: app_pages_cadastro_motorista_motorista_service__WEBPACK_IMPORTED_MODULE_18__["MotoristaService"] },
        { type: app_pages_cadastro_destinatario_destinatario_service__WEBPACK_IMPORTED_MODULE_19__["DestinatarioService"] },
        { type: app_pages_veiculo_check_list_check_list_service__WEBPACK_IMPORTED_MODULE_29__["CheckListService"] }
    ]; };
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewChild"])(app_shared_components_pesquisa_pesquisa_check_list_pesquisa_check_list_component__WEBPACK_IMPORTED_MODULE_11__["PesquisaChecklistComponent"], { static: false }),
        __metadata("design:type", app_shared_components_pesquisa_pesquisa_check_list_pesquisa_check_list_component__WEBPACK_IMPORTED_MODULE_11__["PesquisaChecklistComponent"])
    ], RequisicaoDescargaFormComponent.prototype, "childPesquisaChecklistComponent", void 0);
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewChild"])(_requisicao_descarga_print_etiquetas_modal_requisicao_descarga_print_etiquetas_modal_component__WEBPACK_IMPORTED_MODULE_31__["RequisicaoDescargaPrintEtiquetasModalComponent"], { static: false }),
        __metadata("design:type", _requisicao_descarga_print_etiquetas_modal_requisicao_descarga_print_etiquetas_modal_component__WEBPACK_IMPORTED_MODULE_31__["RequisicaoDescargaPrintEtiquetasModalComponent"])
    ], RequisicaoDescargaFormComponent.prototype, "childPrintEtiquetasModalComponent", void 0);
    RequisicaoDescargaFormComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["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/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-form/requisicao-descarga-form.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [_angular_router__WEBPACK_IMPORTED_MODULE_2__["Router"],
            app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_12__["MessageService"],
            _angular_router__WEBPACK_IMPORTED_MODULE_2__["ActivatedRoute"],
            _requisicao_descarga_service__WEBPACK_IMPORTED_MODULE_7__["RequisicaoDescargaService"],
            app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_13__["LoginService"],
            app_shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_14__["PermissoesUtilsService"],
            app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_15__["ConfiguracaoFacade"],
            app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_16__["FuncoesService"],
            app_pages_cadastro_material_material_service__WEBPACK_IMPORTED_MODULE_17__["MaterialService"],
            app_pages_cadastro_motorista_motorista_service__WEBPACK_IMPORTED_MODULE_18__["MotoristaService"],
            app_pages_cadastro_destinatario_destinatario_service__WEBPACK_IMPORTED_MODULE_19__["DestinatarioService"],
            app_pages_veiculo_check_list_check_list_service__WEBPACK_IMPORTED_MODULE_29__["CheckListService"]])
    ], RequisicaoDescargaFormComponent);
    return RequisicaoDescargaFormComponent;
}(app_shared_components_corporate_base_base_permissoes__WEBPACK_IMPORTED_MODULE_28__["BasePermissoes"]));



/***/ }),

/***/ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-form/requisicao-descarga-form.validation.ts":
/*!*********************************************************************************************************************************************!*\
  !*** ./src/app/pages/especificos/pontafelix/movimentos/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; });
/* harmony import */ var app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! app/shared/services/funcoes/number-utils/number-utils.static.service */ "./src/app/shared/services/funcoes/number-utils/number-utils.static.service.ts");
/* harmony import */ var app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! app/shared/services/funcoes/date-time-utils/date-time-utils.static.service */ "./src/app/shared/services/funcoes/date-time-utils/date-time-utils.static.service.ts");
/* harmony import */ var _requisicao_descarga_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../requisicao-descarga.constants */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga.constants.ts");
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
    function verb(n) { return function (v) { return step([n, v]); }; }
    function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (_) try {
            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
            if (y = 0, t) op = [op[0] & 2, t.value];
            switch (op[0]) {
                case 0: case 1: t = op; break;
                case 4: _.label++; return { value: op[1], done: false };
                case 5: _.label++; y = op[1]; op = [0]; continue;
                case 7: op = _.ops.pop(); _.trys.pop(); continue;
                default:
                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                    if (t[2]) _.ops.pop();
                    _.trys.pop(); continue;
            }
            op = body.call(thisArg, _);
        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
    }
};
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};



var RequisicaoDescargaFormValidation = /** @class */ (function () {
    function RequisicaoDescargaFormValidation(message, configuracao, funcoes, service) {
        this.message = message;
        this.configuracao = configuracao;
        this.funcoes = funcoes;
        this.service = service;
        this.constantes = new _requisicao_descarga_constants__WEBPACK_IMPORTED_MODULE_2__["RequisicaoDescargaConstants"]();
        this.getConfig();
    }
    RequisicaoDescargaFormValidation.prototype.getConfig = function () {
        var _this = this;
        this.constantes.listaParam.map(function (c) {
            if (c.sistema === 'BAL') {
                c.parametros.push("RtsLibOD" + _this.configuracao.macAddress);
            }
        });
        this.configuracao.getConfig(this.constantes.listaParam, function () { return _this.loadConfig(); });
    };
    RequisicaoDescargaFormValidation.prototype.loadConfig = function () {
        if (this.configuracao.isLoadConfig()) {
            this.constantes.configBal.obrVisualizarDocMoto = this.configuracao.boolean("BAL", "ObrVisualizarDocMoto");
            this.constantes.configBal.balValLocalOper = this.configuracao.boolean("BAL", "BalValLocalOper");
        }
    };
    RequisicaoDescargaFormValidation.prototype.getValidations = function (data) {
        return __awaiter(this, void 0, void 0, function () {
            var r, _a, _b;
            return __generator(this, function (_c) {
                switch (_c.label) {
                    case 0:
                        r = [];
                        r.push(this.dtRequisicaoNaoPodeSerMaiorDataAtual({ "dtRequisicao": data.dtRequisicao }));
                        r.push(this.dtRequisicaoNaoPodeSerMenorDataSeguro({ "dtRequisicao": data.dtRequisicao }));
                        r.push(this.existemItensCadastrados({ "requisicaoDescargaItems": data.requisicaoDescargaItens }));
                        r.push(this.verifIntervaloBalancaId({ "balancaId": data.balancaId }));
                        r.push(this.validaPesoBruto({ "pesoBruto": data.pesoBru }));
                        if (this.constantes.configBal.obrVisualizarDocMoto)
                            r.push(this.validaObrVisualizarDocMoto({ "visualizouDocMoto": this.service.visualizouDoctosMotorista }));
                        if (!this.constantes.configBal.balValLocalOper) return [3 /*break*/, 2];
                        _b = (_a = r).push;
                        return [4 /*yield*/, this.validaLocalDeOperacao(data)];
                    case 1:
                        _b.apply(_a, [_c.sent()]);
                        _c.label = 2;
                    case 2: return [2 /*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.configuracao.lerConfig("CTR", "dtSeguro"))) {
            r.isValid = false;
            r.message = "messages.dtRequisicaoDeveSerMaiorDataSeguro";
        }
        if (!r.isValid && showError) {
            this.message.warning("titles.requisicaoDescarga", r.message);
        }
        return r;
    };
    RequisicaoDescargaFormValidation.prototype.verifIntervaloBalancaId = function (params, showError) {
        if (showError === void 0) { showError = false; }
        var r = { "isValid": true, "message": "" };
        if (!(+params.balancaId >= 1) && (+params.balancaId <= 99)) {
            r.isValid = false;
            r.message = "messages.balancaIdDeveEstarEntre1E99";
        }
        if (!r.isValid && showError) {
            this.message.warning("titles.requisicaoDescarga", r.message);
        }
        return r;
    };
    RequisicaoDescargaFormValidation.prototype.validaPesoBruto = function (params, showError) {
        if (showError === void 0) { showError = false; }
        var r = { "isValid": true, "message": "" };
        if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["NumberUtilsStaticService"].isNotPositive(+params.pesoBruto)) {
            r.isValid = false;
            r.message = this.message.translate("messages.campoObrigatorio", { name: this.message.translate('labels.pesoBru') });
        }
        if (!r.isValid && showError) {
            this.message.warning("titles.requisicaoDescarga", r.message);
        }
        return r;
    };
    RequisicaoDescargaFormValidation.prototype.validaObrVisualizarDocMoto = function (params, showError) {
        if (showError === void 0) { showError = false; }
        var r = { "isValid": true, "message": "" };
        if (!params.visualizouDocMoto) {
            r.isValid = false;
            r.message = "messages.visualizacaoDocsMotoristaObrigatoria";
        }
        if (!r.isValid && showError) {
            this.message.warning("titles.requisicaoDescarga", r.message);
        }
        return r;
    };
    RequisicaoDescargaFormValidation.prototype.podeAlterar = function (data) {
        var dtSeguro = this.funcoes.dateTimeUtils.convertDateSqlToDate(this.configuracao.lerConfig("CTR", "dtSeguro"));
        if (app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_1__["DateTimeUtilsStaticService"].menorOuIgualA(data.dtOper2Pes, dtSeguro, ['H', 'M', 'S'])) {
            this.message.warning("titles.requisicaoDescarga", "messages.dataMenorGeracaoSeguroAlteracaoNaoPermitida");
            return false;
        }
        return true;
    };
    RequisicaoDescargaFormValidation.prototype.validaLocalDeOperacao = function (data) {
        return __awaiter(this, void 0, void 0, function () {
            var r, validationResult, mensagens;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        r = { "isValid": true, "message": "" };
                        return [4 /*yield*/, this.service.validaLocalDeOperacao(data).toPromise()];
                    case 1:
                        validationResult = _a.sent();
                        if (!validationResult.isValid) {
                            mensagens = this.message.validationResult(validationResult);
                            r.isValid = false;
                            r.message = mensagens[0];
                        }
                        return [2 /*return*/, r];
                }
            });
        });
    };
    return RequisicaoDescargaFormValidation;
}());



/***/ }),

/***/ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-index/requisicao-descarga-index.component.ts":
/*!**********************************************************************************************************************************************!*\
  !*** ./src/app/pages/especificos/pontafelix/movimentos/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 app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! app/pages/login/login.service */ "./src/app/pages/login/login.service.ts");
/* harmony import */ var app_pages_veiculo_entrada_veiculo_entrada_veiculo_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! app/pages/veiculo/entrada-veiculo/entrada-veiculo.service */ "./src/app/pages/veiculo/entrada-veiculo/entrada-veiculo.service.ts");
/* harmony import */ var app_shared_components_corporate_base_base_permissoes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! app/shared/components/corporate/base/base.permissoes */ "./src/app/shared/components/corporate/base/base.permissoes.ts");
/* harmony import */ var app_shared_components_pesquisa_pesquisa_check_list_pesquisa_check_list_model__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! app/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 app_shared_services_datatables_datatables_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! app/shared/services/datatables/datatables.service */ "./src/app/shared/services/datatables/datatables.service.ts");
/* harmony import */ var app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! app/shared/services/event-emitter/event-emitter.service */ "./src/app/shared/services/event-emitter/event-emitter.service.ts");
/* harmony import */ var app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! app/shared/services/funcoes/boolean-utils/boolean-utils.static.service */ "./src/app/shared/services/funcoes/boolean-utils/boolean-utils.static.service.ts");
/* harmony import */ var app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! app/shared/services/funcoes/configuracao/configuracao.facade */ "./src/app/shared/services/funcoes/configuracao/configuracao.facade.ts");
/* harmony import */ var app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! app/shared/services/funcoes/funcoes.service */ "./src/app/shared/services/funcoes/funcoes.service.ts");
/* harmony import */ var app_shared_services_funcoes_modal_utils_modal_utils_static_service__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! app/shared/services/funcoes/modal-utils/modal-utils.static.service */ "./src/app/shared/services/funcoes/modal-utils/modal-utils.static.service.ts");
/* harmony import */ var app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! app/shared/services/funcoes/number-utils/number-utils.static.service */ "./src/app/shared/services/funcoes/number-utils/number-utils.static.service.ts");
/* harmony import */ var app_shared_services_funcoes_object_utils_object_utils_static_service__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! app/shared/services/funcoes/object-utils/object-utils.static.service */ "./src/app/shared/services/funcoes/object-utils/object-utils.static.service.ts");
/* harmony import */ var app_shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! app/shared/services/funcoes/permissoes-utils/permissoes-utils.service */ "./src/app/shared/services/funcoes/permissoes-utils/permissoes-utils.service.ts");
/* harmony import */ var app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! app/shared/services/funcoes/string-utils/string-utils.static.service */ "./src/app/shared/services/funcoes/string-utils/string-utils.static.service.ts");
/* harmony import */ var app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! app/shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var _requisicao_descarga_filter_requisicao_descarga_filter_model__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../requisicao-descarga-filter/requisicao-descarga-filter.model */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-filter/requisicao-descarga-filter.model.ts");
/* harmony import */ var _requisicao_descarga_pesagem_veiculo_desmembrado_requisicao_descarga_pesagem_veiculo_desmembrado_component__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../requisicao-descarga-pesagem-veiculo-desmembrado/requisicao-descarga-pesagem-veiculo-desmembrado.component */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-pesagem-veiculo-desmembrado/requisicao-descarga-pesagem-veiculo-desmembrado.component.ts");
/* harmony import */ var _requisicao_descarga_model__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../requisicao-descarga.model */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga.model.ts");
/* harmony import */ var _requisicao_descarga_constants__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./../requisicao-descarga.constants */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga.constants.ts");
/* harmony import */ var _requisicao_descarga_service__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./../requisicao-descarga.service */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga.service.ts");
/* harmony import */ var _requisicao_descarga_index_model__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./requisicao-descarga-index.model */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-index/requisicao-descarga-index.model.ts");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (undefined && undefined.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
    function verb(n) { return function (v) { return step([n, v]); }; }
    function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (_) try {
            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
            if (y = 0, t) op = [op[0] & 2, t.value];
            switch (op[0]) {
                case 0: case 1: t = op; break;
                case 4: _.label++; return { value: op[1], done: false };
                case 5: _.label++; y = op[1]; op = [0]; continue;
                case 7: op = _.ops.pop(); _.trys.pop(); continue;
                default:
                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                    if (t[2]) _.ops.pop();
                    _.trys.pop(); continue;
            }
            op = body.call(thisArg, _);
        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
    }
};
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};























var 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_20__["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.data = new _requisicao_descarga_index_model__WEBPACK_IMPORTED_MODULE_22__["RequisicaoDescargaIndex"]();
        _this.dataPesagemVeicDesmembrado = new _requisicao_descarga_model__WEBPACK_IMPORTED_MODULE_19__["RequisicaoDescargaPesagemVeicDesmembradoDto"]();
        _this.filtroReport = new _requisicao_descarga_model__WEBPACK_IMPORTED_MODULE_19__["RequisicaoDescargaFilterReport"]();
        _this.constantes = new _requisicao_descarga_constants__WEBPACK_IMPORTED_MODULE_20__["RequisicaoDescargaConstants"]();
        _this.labelBtnSegundaPesagem = "2Pesagem";
        _this.statusPesagem = "2Pes";
        _this.titleDescricaoMotivoModal = "";
        _this.target = _this.funcoesService.getTargetLocation();
        _this.pageRoute = "/especificos/pontafelix/movimentos/requisicaoDescarga";
        _this.callPosCarregamento = function () {
            if (!_this.configuracao.isLoadConfig())
                return;
            _this.constantes.configUni.solMotCancEVePesagem = _this.configuracao.boolean("UNI", "SolMotCancEVePesagem");
            _this.constantes.configBal.validaMobile2Pes = _this.configuracao.boolean("BAL", "validaMobile2Pes");
            _this.constantes.configUni.nAltDepositoLibVeic = _this.configuracao.boolean("CTV", "NAltDepositoLibVeic");
            _this.constantes.configWeb.cWebModTicketD = _this.configuracao.lerConfig("WEB", "CWebModTicketD");
            _this.constantes.configWeb.cWebModRequisicaoD = _this.configuracao.lerConfig("WEB", "CWebModRequisicaoD");
            _this.constantes.configWeb.prefixoRelEspecifico = _this.configuracao.lerConfig("WEB", "PrefixoRelEspecifico");
            _this.constantes.configCtv.guaCancela2Pes = _this.configuracao.boolean("CTV", "GuaCancela2Pes");
            _this.constantes.configBal.solMotivoExcReq = _this.configuracao.boolean("BAL", "SolMotivoExcReq");
        };
        _this.visualizarFotoOCR = function () {
            _this.permissoesUtils.verificaRotina(_this.constantes.sisFormularioId, 10, function () { return __awaiter(_this, void 0, void 0, function () {
                return __generator(this, function (_a) {
                    if (!this.itemSelecionado())
                        return [2 /*return*/];
                    app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_7__["EventEmitterService"].get('emiFotoOcr').emit({
                        registro: this.data.cliPontaRequisicaoDescargaId,
                        tipo: 'R'
                    });
                    return [2 /*return*/];
                });
            }); });
        };
        _this.alterarDatas = function () {
            if (!_this.itemSelecionado())
                return;
            _this.permissoesUtils.verificaRotina(_this.constantes.sisFormularioId, 8, function () {
                if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_12__["NumberUtilsStaticService"].toNumber(_this.data.situacaoVeiculoId) <= 1015) {
                    _this.message.warning("titles.requisicaoDescarga", "messages.requisicaoNaoLiberada");
                    return;
                }
                _this.router.navigate(["" + _this.target + _this.pageRoute + "/alterarDatas/" + _this.data.cliPontaRequisicaoDescargaId]);
            });
        };
        _this.alterarDados = function () {
            if (!_this.itemSelecionado())
                return;
            _this.permissoesUtils.validRotina(_this.constantes.sisFormularioId, 9, function () {
                if (_this.data.flagIntegracao === 'I') {
                    _this.message.warning("titles.requisicaoDescarga", "messages.ticketJaIntegradoAlteracaoNaoPermitida");
                    return;
                }
                _this.router.navigate(["" + _this.target + _this.pageRoute + "/alterarDados/index/" + _this.data.cliPontaRequisicaoDescargaId]);
            });
        };
        _this.cancelPesagem = function () {
            if (!_this.itemSelecionado())
                return;
            _this.permissoesUtils.verificaRotina(_this.constantes.sisFormularioId, 7, 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.data.cliPontaRequisicaoDescargaId }).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.message.confirm("titles.requisicaoDescarga", "messages.confirmaCancelamentoPesagem", null, function () { return __awaiter(_this, void 0, void 0, function () {
                                var validationResult_1, mensagens;
                                var _this = this;
                                return __generator(this, function (_a) {
                                    switch (_a.label) {
                                        case 0:
                                            if (!this.constantes.configCtv.guaCancela2Pes) return [3 /*break*/, 2];
                                            return [4 /*yield*/, this.service.verifSeExisteProcessoPendente({ checkListId: this.data.codCheckList }).toPromise()];
                                        case 1:
                                            validationResult_1 = _a.sent();
                                            if (!validationResult_1.isValid) {
                                                mensagens = this.message.validationResult(validationResult_1);
                                                mensagens.forEach(function (m) { return _this.message.warning("titles.requisicaoDescarga", m); });
                                                return [2 /*return*/];
                                            }
                                            _a.label = 2;
                                        case 2:
                                            if (this.constantes.configUni.solMotCancEVePesagem) {
                                                this.titleDescricaoMotivoModal = "cancelSegundaPesagemD";
                                                app_shared_services_funcoes_modal_utils_modal_utils_static_service__WEBPACK_IMPORTED_MODULE_11__["ModalUtilsStaticService"].openModal("descricao-motivo-dialog");
                                            }
                                            else {
                                                this.executeCancelPesagem();
                                            }
                                            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_17__["RequisicaoDescargaFilter"]();
                        app_shared_services_funcoes_modal_utils_modal_utils_static_service__WEBPACK_IMPORTED_MODULE_11__["ModalUtilsStaticService"].openModal("rd-filter-dialog");
                    }
                    else {
                        this.refresh();
                    }
                }
                return [2 /*return*/];
            });
        }); }, function () { return _this.permissoesUtils.back(); });
    };
    RequisicaoDescargaIndexComponent.prototype.init = function () {
        var _this = this;
        this.filtroCheckList = new app_shared_components_pesquisa_pesquisa_check_list_pesquisa_check_list_model__WEBPACK_IMPORTED_MODULE_5__["SelecionaCheckListFiltro"]();
        this.filtroCheckList.tipoOper = 'D';
        this.filtroCheckList.tipoTransporteId = 'R';
        this.filtroCheckList.descargaDireta = '';
        this.filtroCheckList.pesagemTerceiros = 'N';
        this.filtroCheckList.codSitVeiculo = 1013;
        this.configuracao.getConfig(this.constantes.listaParam, this.callPosCarregamento);
        _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; } },
            { action: 'visualizarFotoOCR', func: function () { return _this.visualizarFotoOCR; } }
        ]);
    };
    RequisicaoDescargaIndexComponent.prototype.executaFiltrar = function (event) {
        if (event)
            this.refresh();
    };
    RequisicaoDescargaIndexComponent.prototype.filtrar = function () {
        app_shared_services_funcoes_modal_utils_modal_utils_static_service__WEBPACK_IMPORTED_MODULE_11__["ModalUtilsStaticService"].openModal("rd-filter-dialog");
    };
    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.getByFilter(this.service.filtro).toPromise()];
                    case 1:
                        _a.dados = _b.sent();
                        this.initDefaultValues();
                        columns = [
                            this.datatables.getDataStringAlignRight("cliPontaRequisicaoDescargaId", "registro", "10%"),
                            this.datatables.getDataString("placaCavalo", "placaCavalo"),
                            this.datatables.getDataDateTime("dtRequisicao", "emissao", "DD/MM/YYYY HH:mm:ss", "15%"),
                            this.datatables.getDataString("nomeTra", "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.data = aData;
                            _this.trataBotoes();
                        });
                        return [2 /*return*/];
                }
            });
        });
    };
    RequisicaoDescargaIndexComponent.prototype.outConsulta = function (event) {
        if (event) {
            this.refresh();
        }
    };
    RequisicaoDescargaIndexComponent.prototype.trataBotoes = function () {
        this.trataBotaoSegundaPesagem();
        this.buttonDisabled('listaIndex', 'cancelPesagem', (!this.data.cliPontaRequisicaoDescargaId || this.data.sitReg === "P"));
    };
    RequisicaoDescargaIndexComponent.prototype.initDefaultValues = function () {
        this.data = new _requisicao_descarga_index_model__WEBPACK_IMPORTED_MODULE_22__["RequisicaoDescargaIndex"]();
        this.labelBtnSegundaPesagem = "2Pesagem";
    };
    Object.defineProperty(RequisicaoDescargaIndexComponent.prototype, "isDesmembrado", {
        get: function () {
            if (!this.data)
                return false;
            return app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_8__["BooleanUtilsStaticService"].toBoolean(this.data.flagDesmembrado);
        },
        enumerable: true,
        configurable: true
    });
    RequisicaoDescargaIndexComponent.prototype.trataBotaoSegundaPesagem = function () {
        var _this = this;
        if (app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_8__["BooleanUtilsStaticService"].toBoolean(this.data.flagDesmembrado)) {
            this.service.getStatusPesagem(this.data.cliPontaRequisicaoDescargaId).subscribe(function (result) {
                if (!!result && !!result.status) {
                    _this.statusPesagem = result.status;
                    _this.trataLabelBotaoSegundaPesagem(result.status);
                }
            });
        }
    };
    RequisicaoDescargaIndexComponent.prototype.trataLabelBotaoSegundaPesagem = function (status) {
        if (status === '1Pes') {
            this.labelBtnSegundaPesagem = 'primeiraPesagemDesmembramento';
        }
        else if (status === 'Vei') {
            this.labelBtnSegundaPesagem = 'aguardVeiculoDesmembramento';
        }
        else {
            this.labelBtnSegundaPesagem = 'segundaPesagemDesmembramento';
        }
    };
    RequisicaoDescargaIndexComponent.prototype.print = function () {
        if (this.funcoes.isPositive(this.data.cliPontaRequisicaoDescargaId)) {
            this.filtroReport.requisicaoDescargaId = this.data.cliPontaRequisicaoDescargaId;
            app_shared_services_funcoes_modal_utils_modal_utils_static_service__WEBPACK_IMPORTED_MODULE_11__["ModalUtilsStaticService"].openModal("modalPrint");
        }
        else {
            this.message.warning("titles.requisicaoDescarga", "messages.selecioneUmRegistro");
            return;
        }
    };
    RequisicaoDescargaIndexComponent.prototype.create = function () {
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 1, function () {
            app_shared_services_funcoes_modal_utils_modal_utils_static_service__WEBPACK_IMPORTED_MODULE_11__["ModalUtilsStaticService"].openModal("pesquisa-check-list-dialog");
        });
    };
    RequisicaoDescargaIndexComponent.prototype.createRequisicao = function (data) {
        return __awaiter(this, void 0, void 0, function () {
            var validationResult, mensagens, mensagens;
            var _this = this;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.service.verifyCheckListId(data.codChecklist).toPromise()];
                    case 1:
                        validationResult = _a.sent();
                        if (!validationResult.isValid && !!validationResult.message) {
                            mensagens = this.message.validationResult(validationResult);
                            mensagens.forEach(function (m) { return _this.message.warning("titles.requisicaoDescarga", m, { requisicao: validationResult.message }); });
                            return [2 /*return*/];
                        }
                        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 + this.pageRoute + "/create/", app_shared_services_funcoes_object_utils_object_utils_static_service__WEBPACK_IMPORTED_MODULE_13__["ObjectUtilsStaticService"].objToB64({
                                codChecklist: data.codChecklist,
                                item: data.item,
                                regControle: data.regControle
                            })]);
                        return [2 /*return*/];
                }
            });
        });
    };
    RequisicaoDescargaIndexComponent.prototype.itemSelecionado = function () {
        if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_12__["NumberUtilsStaticService"].isNotPositive(this.data.cliPontaRequisicaoDescargaId)) {
            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, entradaVeiculo;
            var _this = this;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        if (!this.itemSelecionado())
                            return [2 /*return*/];
                        return [4 /*yield*/, this.service.validaSePodeAlterar({ requisicaoDescargaId: this.data.cliPontaRequisicaoDescargaId }).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 (!app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_12__["NumberUtilsStaticService"].isPositive(this.data.entradaVeiculoId)) return [3 /*break*/, 3];
                        return [4 /*yield*/, this.entradaVeiculoService.getById(this.data.entradaVeiculoId).toPromise()];
                    case 2:
                        entradaVeiculo = _a.sent();
                        if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_12__["NumberUtilsStaticService"].toNumber(entradaVeiculo.situacaoVeiculoId) !== app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_12__["NumberUtilsStaticService"].toNumber(this.data.situacaoVeiculoId)
                            && app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_12__["NumberUtilsStaticService"].toNumber(entradaVeiculo.situacaoVeiculoId) === 1090) {
                            this.message.warning("titles.requisicaoDescarga", "messages.sitVeiculoDesatualizadaAtualizeORegistro");
                            return [2 /*return*/];
                        }
                        _a.label = 3;
                    case 3:
                        this.router.navigate(["" + this.target + this.pageRoute + "/edit/" + this.data.cliPontaRequisicaoDescargaId]);
                        return [2 /*return*/];
                }
            });
        });
    };
    RequisicaoDescargaIndexComponent.prototype.detail = function () {
        if (!this.itemSelecionado())
            return;
        this.router.navigate(["" + this.target + this.pageRoute + "/detail/" + this.data.cliPontaRequisicaoDescargaId]);
    };
    RequisicaoDescargaIndexComponent.prototype.remove = function () {
        var _this = this;
        if (!this.itemSelecionado())
            return;
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 3, 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.validaSePodeExcluir({ requisicaoDescargaId: this.data.cliPontaRequisicaoDescargaId }).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 (["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.avancaExclusao();
                                    return [2 /*return*/];
                                });
                            }); });
                        }
                        else {
                            this.avancaExclusao();
                        }
                        return [2 /*return*/];
                }
            });
        }); });
    };
    RequisicaoDescargaIndexComponent.prototype.avancaExclusao = function () {
        var _this = this;
        this.message.removeConfirm(function () {
            if (_this.constantes.configBal.solMotivoExcReq) {
                _this.titleDescricaoMotivoModal = "motivoExclusaoRD";
                app_shared_services_funcoes_modal_utils_modal_utils_static_service__WEBPACK_IMPORTED_MODULE_11__["ModalUtilsStaticService"].openModal("descricao-motivo-dialog");
            }
            else {
                _this.executeExclusao();
            }
        });
    };
    RequisicaoDescargaIndexComponent.prototype.executeExclusao = 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.requisicaoDescargaExclui({ requisicaoDescargaId: this.data.cliPontaRequisicaoDescargaId, 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.datatables.remove("dtRequisicaoDescarga");
                            }
                        }
                        return [2 /*return*/];
                }
            });
        });
    };
    RequisicaoDescargaIndexComponent.prototype.permissoes = function () {
        var _this = this;
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 14, 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.data);
        });
    };
    RequisicaoDescargaIndexComponent.prototype.liberacaoEmLote = function () {
        this.funcoes.openWindow('controle/liberacaoLote');
    };
    RequisicaoDescargaIndexComponent.prototype.segundaPesagem = function () {
        return __awaiter(this, void 0, void 0, function () {
            var resp, validaMobile;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        if (!this.itemSelecionado())
                            return [2 /*return*/];
                        if (this.statusPesagem === 'Vei') {
                            this.message.warning("titles.requisicaoDescarga", "messages.pesagemNaoPermitidarealizeSegundaEntradaVeiculoRealizarOperacao");
                            return [2 /*return*/];
                        }
                        if (!(app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_8__["BooleanUtilsStaticService"].toBoolean(this.data.flagDesmembrado) && this.statusPesagem === '1Pes')) return [3 /*break*/, 2];
                        return [4 /*yield*/, this.service.getRequisicaoDescargaPesa(this.data.cliPontaRequisicaoDescargaId).toPromise()];
                    case 1:
                        resp = _a.sent();
                        if (!!resp) {
                            this.dataPesagemVeicDesmembrado.checkListId = this.data.codCheckList;
                            this.dataPesagemVeicDesmembrado.entradaVeiculoId = this.data.entradaVeiculoId;
                            this.dataPesagemVeicDesmembrado.placa = resp.placaCavalo;
                            this.dataPesagemVeicDesmembrado.placaCarreta = resp.placaCarreta;
                            this.dataPesagemVeicDesmembrado.pesoBruto = resp.pesoBru;
                            this.dataPesagemVeicDesmembrado.pesoTara = resp.pesoTara;
                            this.dataPesagemVeicDesmembrado.tipoVeiculoId = this.data.tipoOperacaoVeiculoId;
                            this.childReqDescargaPesagemVeiculoDesmembrado.objectSelect(this.dataPesagemVeicDesmembrado);
                            app_shared_services_funcoes_modal_utils_modal_utils_static_service__WEBPACK_IMPORTED_MODULE_11__["ModalUtilsStaticService"].openModal("requisicao-descarga-pesagem-veiculo-desmembrado-dialog");
                        }
                        _a.label = 2;
                    case 2:
                        if (!this.constantes.configBal.validaMobile2Pes) return [3 /*break*/, 4];
                        return [4 /*yield*/, this.validaMobile()];
                    case 3:
                        validaMobile = _a.sent();
                        if (!validaMobile)
                            return [2 /*return*/];
                        _a.label = 4;
                    case 4:
                        this.router.navigate(["" + this.target + this.pageRoute + "/segundaPesagem/" + this.data.cliPontaRequisicaoDescargaId]);
                        return [2 /*return*/];
                }
            });
        });
    };
    RequisicaoDescargaIndexComponent.prototype.retPesagemVeiculoDesmembrado = function (ret) {
        if (ret) {
            this.router.navigate(["" + this.target + this.pageRoute + "/segundaPesagem/" + this.data.cliPontaRequisicaoDescargaId]);
        }
    };
    RequisicaoDescargaIndexComponent.prototype.executeExclusaoOuCancelPesagem = function (motivo) {
        if (motivo === void 0) { motivo = ""; }
        if (this.titleDescricaoMotivoModal === "motivoExclusaoRD") {
            this.executeExclusao(motivo);
        }
        else {
            this.executeCancelPesagem(motivo);
        }
    };
    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.data.cliPontaRequisicaoDescargaId, 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.message.success("titles.requisicaoDescarga", "messages.cancelamentoRealizadoComSucesso");
                                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.data.cliPontaRequisicaoDescargaId }).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;
            default:
                break;
        }
    };
    RequisicaoDescargaIndexComponent.prototype.printAutorizacao = function () {
        // NAO PODE INCLUIR CHAMADAS ESPECIFICAS
        if (this.funcoes.getValue(this.data.cliPontaRequisicaoDescargaId, "I") > 0) {
            var modRel = this.constantes.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_15__["StringUtilsStaticService"].isNotEmpty(this.constantes.configWeb.prefixoRelEspecifico) && modRel.indexOf(this.constantes.configWeb.prefixoRelEspecifico) == 0) {
                this.funcoes.reportInvoc.invocaRelatorioEspecificos(modRel, reportTitulo, {
                    filialId: this.loginService.getLogin().filialId,
                    autorizacao: this.data.cliPontaRequisicaoDescargaId,
                    origem: 1
                });
            }
            else {
                this.funcoes.reportInvoc.invocaRelatorio(modRel, reportTitulo, {
                    filialId: this.loginService.getLogin().filialId,
                    autorizacao: this.data.cliPontaRequisicaoDescargaId
                });
            }
        }
        else {
            this.message.warning("titles.requisicaoDescarga", "messages.selecioneUmRegistro");
        }
    };
    RequisicaoDescargaIndexComponent.prototype.printTicket = function () {
        // NAO PODE INCLUIR CHAMADAS ESPECIFICAS
        if (this.funcoes.getValue(this.data.cliPontaRequisicaoDescargaId, "I") > 0) {
            var modRel = this.constantes.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_15__["StringUtilsStaticService"].isNotEmpty(this.constantes.configWeb.prefixoRelEspecifico) && modRel.indexOf(this.constantes.configWeb.prefixoRelEspecifico) == 0) {
                this.funcoes.reportInvoc.invocaRelatorioEspecificos(modRel, reportTitulo, {
                    filialId: this.loginService.getLogin().filialId,
                    autorizacao: this.data.cliPontaRequisicaoDescargaId,
                    tipoOCD: "R",
                    origem: 1
                });
            }
            else {
                this.funcoes.reportInvoc.invocaRelatorio(modRel, reportTitulo, {
                    filialId: this.loginService.getLogin().filialId,
                    autorizacao: this.data.cliPontaRequisicaoDescargaId,
                    tipoOCD: "R"
                });
            }
        }
        else {
            this.message.warning("titles.requisicaoDescarga", "messages.selecioneUmRegistro");
        }
    };
    Object.defineProperty(RequisicaoDescargaIndexComponent.prototype, "disabledBtn2Pesagem", {
        get: function () {
            return !app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_12__["NumberUtilsStaticService"].isPositive(this.data.cliPontaRequisicaoDescargaId) || this.data.sitReg !== 'P';
        },
        enumerable: true,
        configurable: true
    });
    RequisicaoDescargaIndexComponent.ctorParameters = function () { return [
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"] },
        { type: _requisicao_descarga_service__WEBPACK_IMPORTED_MODULE_21__["RequisicaoDescargaService"] },
        { type: app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_9__["ConfiguracaoFacade"] },
        { type: app_shared_services_datatables_datatables_service__WEBPACK_IMPORTED_MODULE_6__["DatatablesService"] },
        { type: app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_16__["MessageService"] },
        { type: app_shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_14__["PermissoesUtilsService"] },
        { type: app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_10__["FuncoesService"] },
        { type: app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_2__["LoginService"] },
        { type: app_pages_veiculo_entrada_veiculo_entrada_veiculo_service__WEBPACK_IMPORTED_MODULE_3__["EntradaVeiculoService"] }
    ]; };
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewChild"])(_requisicao_descarga_pesagem_veiculo_desmembrado_requisicao_descarga_pesagem_veiculo_desmembrado_component__WEBPACK_IMPORTED_MODULE_18__["RequisicaoDescargaPesagemVeiculoDesmembradoComponent"], { static: false }),
        __metadata("design:type", _requisicao_descarga_pesagem_veiculo_desmembrado_requisicao_descarga_pesagem_veiculo_desmembrado_component__WEBPACK_IMPORTED_MODULE_18__["RequisicaoDescargaPesagemVeiculoDesmembradoComponent"])
    ], RequisicaoDescargaIndexComponent.prototype, "childReqDescargaPesagemVeiculoDesmembrado", void 0);
    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/especificos/pontafelix/movimentos/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_21__["RequisicaoDescargaService"],
            app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_9__["ConfiguracaoFacade"],
            app_shared_services_datatables_datatables_service__WEBPACK_IMPORTED_MODULE_6__["DatatablesService"],
            app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_16__["MessageService"],
            app_shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_14__["PermissoesUtilsService"],
            app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_10__["FuncoesService"],
            app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_2__["LoginService"],
            app_pages_veiculo_entrada_veiculo_entrada_veiculo_service__WEBPACK_IMPORTED_MODULE_3__["EntradaVeiculoService"]])
    ], RequisicaoDescargaIndexComponent);
    return RequisicaoDescargaIndexComponent;
}(app_shared_components_corporate_base_base_permissoes__WEBPACK_IMPORTED_MODULE_4__["BasePermissoes"]));



/***/ }),

/***/ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-index/requisicao-descarga-index.model.ts":
/*!******************************************************************************************************************************************!*\
  !*** ./src/app/pages/especificos/pontafelix/movimentos/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 app_shared_services_base_base_model__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! app/shared/services/base/base.model */ "./src/app/shared/services/base/base.model.ts");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};

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



/***/ }),

/***/ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-item/requisicao-descarga-item.component.ts":
/*!********************************************************************************************************************************************!*\
  !*** ./src/app/pages/especificos/pontafelix/movimentos/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 app_shared_services_funcoes_object_utils_object_utils_static_service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! app/shared/services/funcoes/object-utils/object-utils.static.service */ "./src/app/shared/services/funcoes/object-utils/object-utils.static.service.ts");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var app_pages_cadastro_tanque_tanque_model__WEBPACK_IMPORTED_MODULE_2__ = __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_3__ = __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_4__ = __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_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_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./../requisicao-descarga.constants */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga.constants.ts");
/* harmony import */ var _requisicao_descarga_model__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./../requisicao-descarga.model */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga.model.ts");
/* harmony import */ var _requisicao_descarga_service__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./../requisicao-descarga.service */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga.service.ts");
/* harmony import */ var _requisicao_descarga_item_model__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./requisicao-descarga-item.model */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-item/requisicao-descarga-item.model.ts");
/* harmony import */ var _requisicao_descarga_item_validation__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./requisicao-descarga-item.validation */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-item/requisicao-descarga-item.validation.ts");
/* harmony import */ var app_config_enumerables__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! app/config/enumerables */ "./src/app/config/enumerables.ts");
/* harmony import */ var app_pages_cadastro_lote_lote_model__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! app/pages/cadastro/lote/lote.model */ "./src/app/pages/cadastro/lote/lote.model.ts");
/* harmony import */ var app_pages_cadastro_lote_lote_service__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! app/pages/cadastro/lote/lote.service */ "./src/app/pages/cadastro/lote/lote.service.ts");
/* harmony import */ var app_pages_cadastro_tanque_tanque_service__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! app/pages/cadastro/tanque/tanque.service */ "./src/app/pages/cadastro/tanque/tanque.service.ts");
/* harmony import */ var app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! app/pages/login/login.service */ "./src/app/pages/login/login.service.ts");
/* harmony import */ var app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! app/shared/services/event-emitter/event-emitter.service */ "./src/app/shared/services/event-emitter/event-emitter.service.ts");
/* harmony import */ var app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! app/shared/services/funcoes/configuracao/configuracao.facade */ "./src/app/shared/services/funcoes/configuracao/configuracao.facade.ts");
/* harmony import */ var app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! app/shared/services/funcoes/funcoes.service */ "./src/app/shared/services/funcoes/funcoes.service.ts");
/* harmony import */ var app_shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! app/shared/services/funcoes/permissoes-utils/permissoes-utils.service */ "./src/app/shared/services/funcoes/permissoes-utils/permissoes-utils.service.ts");
/* harmony import */ var app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! app/shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var app_pages_cadastro_material_material_service__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! app/pages/cadastro/material/material.service */ "./src/app/pages/cadastro/material/material.service.ts");
/* harmony import */ var app_pages_cadastro_material_material_model__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! app/pages/cadastro/material/material.model */ "./src/app/pages/cadastro/material/material.model.ts");
/* harmony import */ var app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! app/shared/services/funcoes/number-utils/number-utils.static.service */ "./src/app/shared/services/funcoes/number-utils/number-utils.static.service.ts");
/* harmony import */ var app_shared_components_modais_lacre_lacre_model__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! app/shared/components/modais/lacre/lacre.model */ "./src/app/shared/components/modais/lacre/lacre.model.ts");
/* harmony import */ var app_shared_components_modais_lacre_lacre_service__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! app/shared/components/modais/lacre/lacre.service */ "./src/app/shared/components/modais/lacre/lacre.service.ts");
/* harmony import */ var app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! app/shared/services/funcoes/array-utils/array-utils.static.service */ "./src/app/shared/services/funcoes/array-utils/array-utils.static.service.ts");
/* harmony import */ var app_pages_cadastro_cadastro_placa_cadastro_placa_service__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! app/pages/cadastro/cadastro-placa/cadastro-placa.service */ "./src/app/pages/cadastro/cadastro-placa/cadastro-placa.service.ts");
var __assign = (undefined && undefined.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
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, materialService, tipoDocumentoTranspService, lacreService, cadastroPlacaService) {
        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.materialService = materialService;
        this.tipoDocumentoTranspService = tipoDocumentoTranspService;
        this.lacreService = lacreService;
        this.cadastroPlacaService = cadastroPlacaService;
        this.dataResult = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["EventEmitter"]();
        this.selectedItem = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["EventEmitter"]();
        this.mascara = new app_config_enumerables__WEBPACK_IMPORTED_MODULE_12__["Mascaras"]();
        this.data = new _requisicao_descarga_item_model__WEBPACK_IMPORTED_MODULE_10__["RequisicaoDescargaItem"]();
        this.dataAux = new _requisicao_descarga_item_model__WEBPACK_IMPORTED_MODULE_10__["RequisicaoDescargaItem"]();
        this.constants = new _requisicao_descarga_constants__WEBPACK_IMPORTED_MODULE_7__["RequisicaoDescargaConstants"]();
        this.showAdd = false;
        this.actionForm = 0;
        this.mensagens = [];
        this.paramsLacre = new app_shared_components_modais_lacre_lacre_model__WEBPACK_IMPORTED_MODULE_25__["ParamsLacre"]();
        this.vldNF = true;
        this.dataItemOld = new _requisicao_descarga_item_model__WEBPACK_IMPORTED_MODULE_10__["RequisicaoDescargaItem"]();
    }
    RequisicaoDescargaItemComponent.prototype.ngOnInit = function () {
        var _this = this;
        this._index = 0;
        this.dadosOld = app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_27__["ArrayUtilsStaticService"].clone(this.dados);
        this.configuracao.getConfig(this.constants.listaParam, function () { return _this.loadConfig(); });
    };
    RequisicaoDescargaItemComponent.prototype.loadConfig = function () {
        if (this.configuracao.isLoadConfig()) {
            this.constants.configUni.obrChaveNFeEnt = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_5__["BooleanUtilsStaticService"].toBoolean(this.configuracao.lerConfig("UNI", "ObrChaveNFeEnt"));
            this.constants.configBal.calculaTotalNF = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_5__["BooleanUtilsStaticService"].toBoolean(this.configuracao.lerConfig("BAL", "CalculaTotalNF"));
            this.constants.configBal.infPesoFob = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_5__["BooleanUtilsStaticService"].toBoolean(this.configuracao.lerConfig("BAL", "InfPesoFob"));
            this.constants.configBal.naoPermiteAlterarChkLst = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_5__["BooleanUtilsStaticService"].toBoolean(this.configuracao.lerConfig("BAL", "NaoPermiteAlterarChkLst"));
            this.constants.configBal.planejTanque = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_5__["BooleanUtilsStaticService"].toBoolean(this.configuracao.lerConfig("BAL", "PlanejTanque"));
            this.constants.configBal.vrfNfExisteDesc = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_5__["BooleanUtilsStaticService"].toBoolean(this.configuracao.lerConfig("BAL", "VrfNfExisteDesc"));
            this.constants.configBal.nAltDepositoLibVeic = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_5__["BooleanUtilsStaticService"].toBoolean(this.configuracao.lerConfig("BAL", "NAltDepositoLibVeic"));
            this.constants.configCtv.importaDANFE = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_5__["BooleanUtilsStaticService"].toBoolean(this.configuracao.lerConfig("CTV", "ImportaDANFE"));
            this.constants.configCtv.itemNoCheckList = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_5__["BooleanUtilsStaticService"].toBoolean(this.configuracao.lerConfig("CTV", "itemNoCheckList"));
            this.constants.configCtv.naoPermiteAlterarChkLst = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_5__["BooleanUtilsStaticService"].toBoolean(this.configuracao.lerConfig("CTV", "naoPermiteAlterarChkLst"));
            this.constants.configCtv.intProLock = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_5__["BooleanUtilsStaticService"].toBoolean(this.configuracao.lerConfig("CTV", "IntProLock"));
            this.constants.configCtv.solicitaPlanejEv = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_5__["BooleanUtilsStaticService"].toBoolean(this.configuracao.lerConfig("CTV", "SolicitaPlanejEv"));
            this.constants.configCtr.valDepositoOSG = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_5__["BooleanUtilsStaticService"].toBoolean(this.configuracao.lerConfig("CTR", "valDepositoOSG"));
        }
    };
    RequisicaoDescargaItemComponent.prototype.create = function () {
        if (!this.validation.podeIncluir(this.requisicaoDescarga, this.item))
            return;
        this.showAdd = true;
        this.actionForm = app_config_enumerables__WEBPACK_IMPORTED_MODULE_12__["ActionForm"].create;
        this.data = new _requisicao_descarga_item_model__WEBPACK_IMPORTED_MODULE_10__["RequisicaoDescargaItem"]();
    };
    RequisicaoDescargaItemComponent.prototype.edit = function () {
        if (!this.validation.podeAlterar(this.item))
            return;
        this.showAdd = true;
        this.actionForm = app_config_enumerables__WEBPACK_IMPORTED_MODULE_12__["ActionForm"].edit;
        this.data = this.dataAux;
        this.trataData();
    };
    RequisicaoDescargaItemComponent.prototype.detail = function () {
        this.showAdd = true;
        this.actionForm = app_config_enumerables__WEBPACK_IMPORTED_MODULE_12__["ActionForm"].detail;
        this.data = this.dataAux;
        this.trataData();
    };
    RequisicaoDescargaItemComponent.prototype.trataData = function () {
        var _this = this;
        this.data.lote = new app_pages_cadastro_lote_lote_model__WEBPACK_IMPORTED_MODULE_13__["Lote"]();
        this.requisicaoDescarga.tanque = new app_pages_cadastro_tanque_tanque_model__WEBPACK_IMPORTED_MODULE_2__["Tanque"]();
        this.data.tipoDocumentoTransp = new app_pages_cadastro_tipo_documento_transp_tipo_documento_transp_model__WEBPACK_IMPORTED_MODULE_3__["TipoDocumentoTransp"]();
        Object(rxjs__WEBPACK_IMPORTED_MODULE_6__["forkJoin"])([
            this.loteService.getByLoteId(this.data.loteId),
            this.tanqueService.getById(btoa(this.data.tanqueId)),
            this.materialService.getById(this.data.materialId),
            this.tipoDocumentoTranspService.getById(this.data.tipoDocumentoTranspId),
        ]).subscribe(function (resp) {
            if (resp[0])
                !!resp[0] ? _this.data.lote = resp[0] : new app_pages_cadastro_lote_lote_model__WEBPACK_IMPORTED_MODULE_13__["Lote"]();
            if (resp[1])
                !!resp[1] ? _this.data.tanque = resp[1] : new app_pages_cadastro_tanque_tanque_model__WEBPACK_IMPORTED_MODULE_2__["Tanque"]();
            if (resp[2])
                !!resp[2] ? _this.data.material = resp[2] : new app_pages_cadastro_material_material_model__WEBPACK_IMPORTED_MODULE_23__["Material"]();
            if (resp[3])
                !!resp[3] ? _this.data.tipoDocumentoTransp = resp[3] : new app_pages_cadastro_tipo_documento_transp_tipo_documento_transp_model__WEBPACK_IMPORTED_MODULE_3__["TipoDocumentoTransp"]();
        });
        this.moveParamsLacre();
        this.ajustaTipoDocTransporte(true);
        if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_24__["NumberUtilsStaticService"].isPositive(this.requisicaoDescarga.entradaVeiculo.planejCargaId) && this.constants.configCtv.solicitaPlanejEv) {
            this.data.tanqueId = this.requisicaoDescarga.planejamentoCarga.tanqueId;
            this.data.loteId = this.requisicaoDescarga.planejamentoCarga.loteId;
        }
    };
    RequisicaoDescargaItemComponent.prototype.selected = function (item) {
        this.dataAux = item;
        this.validation = new _requisicao_descarga_item_validation__WEBPACK_IMPORTED_MODULE_11__["RequisicaoDescargaItemValidation"](this.messageService, this.configuracao, this.funcoesService);
        this.dataItemOld = app_shared_services_funcoes_object_utils_object_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["ObjectUtilsStaticService"].clone(this.dataAux);
        this.selectedItem.emit(this.dataAux);
    };
    Object.defineProperty(RequisicaoDescargaItemComponent.prototype, "isEnabledQuantid", {
        get: function () {
            return (app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_5__["BooleanUtilsStaticService"].toBoolean(this.data.material.obrEtiqueta) && app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_5__["BooleanUtilsStaticService"].toBoolean(this.data.tanque.movQuantid) && this.data.lote.unidadeId === 'UN');
        },
        enumerable: true,
        configurable: true
    });
    RequisicaoDescargaItemComponent.prototype.back = function () {
        var _this = this;
        if (!this.funcoesService.isDetail(this.actionForm)) {
            this.messageService.confirm("titles.requisicaoDescarga", "messages.desejaCancelarAlteracoes", null, function () {
                var idxItem = _this.dadosOld.findIndex(function (c) { return c.cliPontaRequisicaoDescargaItemId == _this.data.cliPontaRequisicaoDescargaItemId; });
                if (idxItem >= 0) {
                    _this.dados[idxItem] = __assign({}, _this.dadosOld[idxItem]);
                }
                _this.showAdd = false;
                _this.actionForm = app_config_enumerables__WEBPACK_IMPORTED_MODULE_12__["ActionForm"].index;
            });
        }
        else {
            this.showAdd = false;
            this.actionForm = app_config_enumerables__WEBPACK_IMPORTED_MODULE_12__["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 = {
                    regTmp: _this.requisicaoDescarga.regTmp,
                    item: _this.data.cliPontaRequisicaoDescargaItemId,
                };
                _this.service.requisicaoDescargaItemExclui(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;
                    }
                    else {
                        var i = _this.dados.findIndex(function (x) { return x.cliPontaRequisicaoDescargaItemId === _this.data.cliPontaRequisicaoDescargaItemId; });
                        _this.data["sitReg"] = "E";
                        _this.dados[i] = _this.data;
                        _this.messageService.removeSuccess();
                    }
                });
            });
        });
    };
    RequisicaoDescargaItemComponent.prototype.onSubmit = function (form) {
        return __awaiter(this, void 0, void 0, function () {
            var paramsBooleans, validations, result, i;
            var _this = this;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_17__["EventEmitterService"].get("formError").emit(form);
                        if (form.invalid) {
                            this.funcoesService.backToTop();
                            return [2 /*return*/];
                        }
                        paramsBooleans = {
                            isEnabledQuantid: this.isEnabledQuantid,
                            vldNF: this.vldNF,
                            quantidDoc: this.disabledQuantidDocEPesoDocEVlNota
                        };
                        return [4 /*yield*/, this.validation.getValidations(this.requisicaoDescarga, this.data, paramsBooleans)];
                    case 1:
                        validations = _a.sent();
                        if (validations && validations.length > 0) {
                            this.mensagens = this.messageService.validationsForm(validations);
                            app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_17__["EventEmitterService"].get("backError").emit(this.mensagens);
                            this.funcoesService.backToTop();
                            return [2 /*return*/];
                        }
                        if (!this.validaVlNota())
                            return [2 /*return*/];
                        return [4 /*yield*/, this.trataNumeroDoc()];
                    case 2:
                        if (!(_a.sent()))
                            return [2 /*return*/];
                        return [4 /*yield*/, this.validarNotaCadastradaItem()];
                    case 3:
                        if (!(_a.sent()))
                            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*/];
                                }
                            }
                        }
                        if (this.data.cliPontaRequisicaoDescargaItemId && this.data.cliPontaRequisicaoDescargaItemId > 0) {
                            i = this.dados.findIndex(function (x) { return x.cliPontaRequisicaoDescargaItemId === _this.data.cliPontaRequisicaoDescargaItemId; });
                            this.dados[i] = this.data;
                        }
                        else {
                            this.data.cliPontaRequisicaoDescargaItemId = this.dados.length + 1;
                            this.dados.push(this.data);
                        }
                        this.data = new _requisicao_descarga_item_model__WEBPACK_IMPORTED_MODULE_10__["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 () {
            return __generator(this, function (_a) {
                if (this.funcoesService.stringUtils.isNotEmpty(event.lote)) {
                    this.data.lote = event.lote;
                    this.ajustaTipoDocTransporte(true);
                }
                return [2 /*return*/];
            });
        });
    };
    Object.defineProperty(RequisicaoDescargaItemComponent.prototype, "getLabelQuantidDoc", {
        get: function () {
            if (!!this.data.lote.unidadeId) {
                return this.messageService.translate("labels.quantidDoc") + ' (' + this.data.lote.unidadeId + ')';
            }
            else {
                return "labels.quantidDoc";
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(RequisicaoDescargaItemComponent.prototype, "getLabelQuantid", {
        get: function () {
            if (this.data.tanque.movQuantid === 'S') {
                return "labels.qtdeDepositos";
            }
            else {
                return "labels.quantidade";
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(RequisicaoDescargaItemComponent.prototype, "saldoLoteOptions", {
        get: function () {
            return {
                destinatarioIdCliente: this.data.destinatarioIdCliente,
                destinatarioIdEmitente: this.data.destinatarioIdEmitente,
                materialId: this.requisicaoDescarga.materialId,
                tanqueId: this.data.tanqueId,
                loteId: this.data.loteId,
                sitLote: 'A',
                modo: 7,
                tipoSaldo: 7,
                dataMovimento: new Date(),
                localOperacaoId: this.data.lote.localOperacaoId,
                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_5__["BooleanUtilsStaticService"].toBoolean(this.data.tipoDocumentoTransp.flagSolDadosEnt))
                return true;
            return false;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(RequisicaoDescargaItemComponent.prototype, "disableDocTranspNumero", {
        get: function () {
            if (this.funcoesService.isDetail(this.actionForm))
                return true;
            if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_24__["NumberUtilsStaticService"].isPositive(this.data.tipoDocumentoTranspId) && app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_5__["BooleanUtilsStaticService"].toBoolean(this.data.tipoDocumentoTransp.flagSolDadosEnt))
                return false;
            return false;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(RequisicaoDescargaItemComponent.prototype, "disableDeposito", {
        get: function () {
            if (this.funcoesService.isDetail(this.actionForm))
                return true;
            if (!this.data.materialId)
                return true;
            if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_24__["NumberUtilsStaticService"].isPositive(this.requisicaoDescarga.entradaVeiculo.planejCargaId) && this.constants.configCtv.solicitaPlanejEv)
                return false;
            if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_24__["NumberUtilsStaticService"].toNumber(this.requisicaoDescarga.entradaVeiculo.situacaoVeiculoId) > 1015 && this.constants.configCtv.intProLock && this.constants.configBal.nAltDepositoLibVeic)
                return true;
            return false;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(RequisicaoDescargaItemComponent.prototype, "disableLote", {
        get: function () {
            if (this.funcoesService.isDetail(this.actionForm))
                return true;
            if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_24__["NumberUtilsStaticService"].isPositive(this.requisicaoDescarga.entradaVeiculo.planejCargaId) && this.constants.configCtv.solicitaPlanejEv)
                return false;
            if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_24__["NumberUtilsStaticService"].toNumber(this.requisicaoDescarga.entradaVeiculo.situacaoVeiculoId) > 1015 && this.constants.configCtv.intProLock && this.constants.configBal.nAltDepositoLibVeic)
                return true;
            return false;
        },
        enumerable: true,
        configurable: true
    });
    RequisicaoDescargaItemComponent.prototype.trataTipoDocumentoTransp = function (data) {
        this.data.tipoDocumentoTransp = data;
    };
    RequisicaoDescargaItemComponent.prototype.trataDtDocto = function () {
        if (app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_5__["BooleanUtilsStaticService"].toBoolean(this.data.tipoDocumentoTransp.flagSolDadosEnt)) {
            this.data.dtDocto = this.data.docTranspEmissao;
        }
    };
    RequisicaoDescargaItemComponent.prototype.ajustaTipoDocTransporte = function (preencheTipoDocTransp) {
        if (preencheTipoDocTransp === void 0) { preencheTipoDocTransp = false; }
        return __awaiter(this, void 0, void 0, function () {
            var lote, tipoDocumentoTransp;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        if (!preencheTipoDocTransp) return [3 /*break*/, 2];
                        return [4 /*yield*/, this.loteService.getByLoteId(this.data.loteId).toPromise()];
                    case 1:
                        lote = _a.sent();
                        if (!!lote) {
                            this.data.lote = lote;
                            this.data.modeloNotaId = this.data.lote.modeloNotaId;
                        }
                        if (!!this.data.loteId && app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_24__["NumberUtilsStaticService"].isPositive(this.data.lote.tipoDocumentoTranspIdEntrada)) {
                            this.data.tipoDocumentoTranspId = this.data.lote.tipoDocumentoTranspIdEntrada;
                        }
                        _a.label = 2;
                    case 2: return [4 /*yield*/, this.tipoDocumentoTranspService.getById(this.data.tipoDocumentoTranspId).toPromise()];
                    case 3:
                        tipoDocumentoTransp = _a.sent();
                        if (!!tipoDocumentoTransp) {
                            this.data.tipoDocumentoTransp = tipoDocumentoTransp;
                            if (app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_5__["BooleanUtilsStaticService"].toBoolean(tipoDocumentoTransp.flagSolDadosEnt)) {
                                this.data.maskDocTransNumero = tipoDocumentoTransp.mascara;
                            }
                        }
                        if ([app_config_enumerables__WEBPACK_IMPORTED_MODULE_12__["ActionForm"].create, app_config_enumerables__WEBPACK_IMPORTED_MODULE_12__["ActionForm"].edit].includes(this.actionForm)) {
                            this.data.maskDocTransNumero = "";
                            this.data.docTranspNumero = "";
                            this.data.docTranspEmissao = null;
                        }
                        return [2 /*return*/];
                }
            });
        });
    };
    RequisicaoDescargaItemComponent.prototype.trataModeloNota = function (data) {
        this.data.modeloNota = data;
        if (this.data.modeloNotaId !== "55") {
            this.data.chaveNFE = undefined;
        }
        if (this.data.modeloNotaId !== "55" && this.data.nfeAuto === 'S') {
            this.data.nfeAuto = 'N';
        }
        if (this.data.modeloNotaId === '55' && (this.actionForm !== app_config_enumerables__WEBPACK_IMPORTED_MODULE_12__["ActionForm"].detail)) {
            this.data.nfeAuto = 'S';
        }
    };
    RequisicaoDescargaItemComponent.prototype.importarDanfe = function (chave) {
        var _this = this;
        if (this.funcoesService.isUndefinedOrNull(chave) || chave === '') {
            this.messageService.info('labels.chaveNFE', 'messages.chaveNfeDeveSerInformada');
            return;
        }
        this.funcoesService.nfeHelper.importaDanfe({ chave: chave })
            .subscribe(function (result) {
            _this.mensagens = _this.messageService.validationResult(result.validationResult);
            if (!result.validationResult.isValid) {
                app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_17__["EventEmitterService"].get("backError").emit(_this.mensagens);
                _this.funcoesService.backToTop();
                return;
            }
            _this.data.nfeAuto = 'S';
            _this.data.serieNotaId = result.serie;
            _this.data.pesoDoc = result.peso;
            _this.data.docto = result.numero;
            _this.data.dtDocto = result.dtEmissao;
            _this.data.quantidDoc = result.qtde;
            _this.data.naturezaId = result.cfop;
            _this.data.vlNota = result.vlNota;
        });
    };
    Object.defineProperty(RequisicaoDescargaItemComponent.prototype, "disabledtipoDocumentoTransp", {
        get: function () {
            return (!!this.data.loteId && app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_24__["NumberUtilsStaticService"].isPositive(this.data.lote.tipoDocumentoTranspIdEntrada));
        },
        enumerable: true,
        configurable: true
    });
    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)) {
            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.constants.configUni.obrChaveNFeEnt;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(RequisicaoDescargaItemComponent.prototype, "obrigaImportacaoDeDanfe", {
        get: function () {
            if (this.constants.configCtv.importaDANFE &&
                app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_5__["BooleanUtilsStaticService"].toBoolean(this.data.lote.importaDanfe === "S") &&
                app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_5__["BooleanUtilsStaticService"].toBoolean(this.data.lote.modeloNotaId === "55"))
                return true;
            return false;
        },
        enumerable: true,
        configurable: true
    });
    RequisicaoDescargaItemComponent.prototype.validarNotaCadastradaItem = function () {
        return __awaiter(this, void 0, void 0, function () {
            var validation, mensagens, isExisteNaTabelaFinal, message, userConfirmed;
            var _this = this;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        if (!this.constants.configBal.vrfNfExisteDesc) return [3 /*break*/, 5];
                        return [4 /*yield*/, this.service.verificaSeDocumentoJaExisteNaTmp(this.data).toPromise()];
                    case 1:
                        validation = _a.sent();
                        if (!validation.isValid) {
                            mensagens = this.messageService.validationResult(validation);
                            mensagens.forEach(function (m) { return _this.messageService.warning("titles.requisicaoDescarga", m); });
                            return [2 /*return*/, false];
                        }
                        this.data.cliPontaRequisicaoDescargaId = this.requisicaoDescarga.cliPontaRequisicaoDescargaId;
                        return [4 /*yield*/, this.service.verificaSeDocumentoJaExisteNaTabelaFinal(this.data).toPromise()];
                    case 2:
                        isExisteNaTabelaFinal = _a.sent();
                        if (!isExisteNaTabelaFinal) return [3 /*break*/, 4];
                        message = this.messageService.getTranslates("messages", "documentoJaCadastradoNaRequisicaoDeDescarga");
                        return [4 /*yield*/, this.confirmDialogItem("titles.requisicaoDescarga", message + ": " + this.requisicaoDescarga.cliPontaRequisicaoDescargaId + " Continuar?")];
                    case 3:
                        userConfirmed = _a.sent();
                        if (!userConfirmed) {
                            return [2 /*return*/, false];
                        }
                        _a.label = 4;
                    case 4: return [2 /*return*/, true];
                    case 5: return [2 /*return*/, true];
                }
            });
        });
    };
    RequisicaoDescargaItemComponent.prototype.confirmDialogItem = function (title, message) {
        var _this = this;
        return new Promise(function (resolve) {
            _this.messageService.confirm(title, message, null, function () {
                resolve(true);
            }, false, function () {
                resolve(false);
            });
        });
    };
    RequisicaoDescargaItemComponent.prototype.trataNumeroDoc = 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:
                        if (!!this.constants.configBal.vrfNfExisteDesc) return [3 /*break*/, 3];
                        if (!(this.data.tipoDocumentoTransp.siglaTipoDocto === 'NF' && (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_24__["NumberUtilsStaticService"].toNumber(this.data.lote.operacaoIdEntrada) !== app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_24__["NumberUtilsStaticService"].toNumber(this.data.tipoDocumentoTransp.tipoDocumentoTranspId)) && app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_24__["NumberUtilsStaticService"].isPositive(this.data.docto) && this.dataItemOld.docto !== this.data.docto)) return [3 /*break*/, 2];
                        return [4 /*yield*/, this.service.verificaSeNotaJaCadastrada({
                                docto: this.data.docto,
                                destinatarioIdEmitente: this.data.destinatarioIdEmitente,
                                cliPontaRequisicaoDescargaId: this.requisicaoDescarga.cliPontaRequisicaoDescargaId
                            }).toPromise()];
                    case 1:
                        validation = _a.sent();
                        if (!validation.isValid) {
                            mensagens = this.messageService.validationResult(validation);
                            mensagens.forEach(function (m) { return _this.messageService.warning("titles.requisicaoDescarga", m); });
                            return [2 /*return*/, false];
                        }
                        _a.label = 2;
                    case 2: return [2 /*return*/, true];
                    case 3: return [2 /*return*/, 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_5__["BooleanUtilsStaticService"].toBoolean(this.data.tipoDocumentoTransp.flagSolDadosEnt))
                return true;
            if (app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_5__["BooleanUtilsStaticService"].toBoolean(this.data.nfeAuto))
                return true;
            if (this.constants.configCtv.importaDANFE && this.data.lote.importaDanfe && app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_5__["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_5__["BooleanUtilsStaticService"].toBoolean(this.data.nfeAuto))
                return true;
            if (this.constants.configCtv.importaDANFE && this.data.lote.importaDanfe && app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_5__["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();
        }
        this.trataVldNF();
    };
    RequisicaoDescargaItemComponent.prototype.trataVldNF = function () {
        if (this.data.tipoDocumentoTransp.siglaTipoDocto === 'DTA' && (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_24__["NumberUtilsStaticService"].toNumber(this.data.lote.operacaoIdEntrada) === app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_24__["NumberUtilsStaticService"].toNumber(this.data.tipoDocumentoTransp.tipoDocumentoTranspId))) {
            this.vldNF = false;
        }
    };
    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.constants.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.validaVlNota = function () {
        var total = this.funcoesService.numberUtils.round(this.data.quantidDoc * this.data.lote.precoArmazenado, 2);
        if (Math.abs(total - this.data.vlNota) > 0) {
            this.messageService.warning("titles.requisicaoDescarga", "messages.valorNfOuLoteIncorreto");
            this.data.vlNota = 0;
            return false;
        }
        return true;
    };
    Object.defineProperty(RequisicaoDescargaItemComponent.prototype, "saldoDepositoOptions", {
        get: function () {
            return {
                destinatarioIdCliente: this.data.destinatarioIdCliente,
                destinatarioIdEmitente: this.data.destinatarioIdEmitente,
                materialId: this.data.materialId,
                tanqueId: this.data.tanqueId,
                modo: 7,
                tipoSaldo: 7,
                osgId: this.constants.configCtr.valDepositoOSG ? this.data.lote.osgId : 0,
                dataMovimento: this.requisicaoDescarga.dtRequisicao,
                localOperacaoId: this.requisicaoDescarga.localOperacaoId,
                tipoAgrupa: 'D',
                geraArquivo: 'N',
                planejTanque: this.constants.configBal.planejTanque
            };
        },
        enumerable: true,
        configurable: true
    });
    RequisicaoDescargaItemComponent.prototype.trataDeposito = function (tanque) {
        if (tanque) {
            this.data.tanque = tanque;
        }
        else {
            this.messageService.error("titles.requisicaoDescarga", "messages.depositoInformadoNaoLocalizado");
        }
    };
    RequisicaoDescargaItemComponent.prototype.moveParamsLacre = function () {
        return __awaiter(this, void 0, void 0, function () {
            var total;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        total = 0;
                        return [4 /*yield*/, this.cadastroPlacaService.getQuantidLacre({
                                cadastroPlacaIdCavalo: this.requisicaoDescarga.placaCavalo,
                                cadastroPlacaIdCarreta1: this.requisicaoDescarga.placaCarreta1,
                                cadastroPlacaIdCarreta2: this.requisicaoDescarga.placaCarreta2
                            }).toPromise()];
                    case 1:
                        total = _a.sent();
                        this.paramsLacre.codDest = this.data.destinatarioIdCliente;
                        this.paramsLacre.autorizacao = this.data.opDescargaId;
                        this.paramsLacre.tipoMov = "D";
                        this.paramsLacre.tipoLacre = "A";
                        this.paramsLacre.quantidLacres = total;
                        return [4 /*yield*/, Object(rxjs__WEBPACK_IMPORTED_MODULE_6__["forkJoin"])([this.lacreService.geraTmp(this.paramsLacre)]).toPromise()];
                    case 2:
                        _a.sent();
                        return [2 /*return*/];
                }
            });
        });
    };
    RequisicaoDescargaItemComponent.prototype.validaCFOP = function (cfop) {
        if (!!cfop && !!cfop.naturezaId) {
            if (this.vldNF) {
                if (!app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_5__["BooleanUtilsStaticService"].toBoolean(cfop.flagVeiculo)) {
                    this.messageService.warning("titles.requisicaoDescarga", "messages.cfopInvalidoParaRecepcaoDeVeiculos");
                    this.data.naturezaId = "";
                    return;
                }
            }
        }
    };
    RequisicaoDescargaItemComponent.ctorParameters = function () { return [
        { type: app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_19__["FuncoesService"] },
        { type: app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_21__["MessageService"] },
        { type: app_pages_cadastro_lote_lote_service__WEBPACK_IMPORTED_MODULE_14__["LoteService"] },
        { type: app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_16__["LoginService"] },
        { type: _requisicao_descarga_service__WEBPACK_IMPORTED_MODULE_9__["RequisicaoDescargaService"] },
        { type: app_shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_20__["PermissoesUtilsService"] },
        { type: app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_18__["ConfiguracaoFacade"] },
        { type: app_pages_cadastro_tanque_tanque_service__WEBPACK_IMPORTED_MODULE_15__["TanqueService"] },
        { type: app_pages_cadastro_material_material_service__WEBPACK_IMPORTED_MODULE_22__["MaterialService"] },
        { type: app_pages_cadastro_tipo_documento_transp_tipo_documento_transp_service__WEBPACK_IMPORTED_MODULE_4__["TipoDocumentoTranspService"] },
        { type: app_shared_components_modais_lacre_lacre_service__WEBPACK_IMPORTED_MODULE_26__["LacreService"] },
        { type: app_pages_cadastro_cadastro_placa_cadastro_placa_service__WEBPACK_IMPORTED_MODULE_28__["CadastroPlacaService"] }
    ]; };
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])(),
        __metadata("design:type", _requisicao_descarga_model__WEBPACK_IMPORTED_MODULE_8__["RequisicaoDescarga"])
    ], RequisicaoDescargaItemComponent.prototype, "requisicaoDescarga", void 0);
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])(),
        __metadata("design:type", Array)
    ], RequisicaoDescargaItemComponent.prototype, "dados", void 0);
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])(),
        __metadata("design:type", Object)
    ], RequisicaoDescargaItemComponent.prototype, "disabled", void 0);
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Output"])(),
        __metadata("design:type", Object)
    ], RequisicaoDescargaItemComponent.prototype, "dataResult", void 0);
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])(),
        __metadata("design:type", _requisicao_descarga_item_model__WEBPACK_IMPORTED_MODULE_10__["RequisicaoDescargaItem"])
    ], RequisicaoDescargaItemComponent.prototype, "item", void 0);
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Output"])(),
        __metadata("design:type", Object)
    ], RequisicaoDescargaItemComponent.prototype, "selectedItem", void 0);
    RequisicaoDescargaItemComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["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/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-item/requisicao-descarga-item.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_19__["FuncoesService"],
            app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_21__["MessageService"],
            app_pages_cadastro_lote_lote_service__WEBPACK_IMPORTED_MODULE_14__["LoteService"],
            app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_16__["LoginService"],
            _requisicao_descarga_service__WEBPACK_IMPORTED_MODULE_9__["RequisicaoDescargaService"],
            app_shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_20__["PermissoesUtilsService"],
            app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_18__["ConfiguracaoFacade"],
            app_pages_cadastro_tanque_tanque_service__WEBPACK_IMPORTED_MODULE_15__["TanqueService"],
            app_pages_cadastro_material_material_service__WEBPACK_IMPORTED_MODULE_22__["MaterialService"],
            app_pages_cadastro_tipo_documento_transp_tipo_documento_transp_service__WEBPACK_IMPORTED_MODULE_4__["TipoDocumentoTranspService"],
            app_shared_components_modais_lacre_lacre_service__WEBPACK_IMPORTED_MODULE_26__["LacreService"],
            app_pages_cadastro_cadastro_placa_cadastro_placa_service__WEBPACK_IMPORTED_MODULE_28__["CadastroPlacaService"]])
    ], RequisicaoDescargaItemComponent);
    return RequisicaoDescargaItemComponent;
}());



/***/ }),

/***/ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-item/requisicao-descarga-item.model.ts":
/*!****************************************************************************************************************************************!*\
  !*** ./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-item/requisicao-descarga-item.model.ts ***!
  \****************************************************************************************************************************************/
/*! exports provided: RequisicaoDescargaItem */
/***/ (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 import */ var app_pages_cadastro_lote_lote_model__WEBPACK_IMPORTED_MODULE_0__ = __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_1__ = __webpack_require__(/*! app/pages/cadastro/material/material.model */ "./src/app/pages/cadastro/material/material.model.ts");
/* harmony import */ var app_pages_cadastro_tanque_tanque_model__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! app/pages/cadastro/tanque/tanque.model */ "./src/app/pages/cadastro/tanque/tanque.model.ts");
/* harmony import */ var app_shared_services_base_base_model__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! app/shared/services/base/base.model */ "./src/app/shared/services/base/base.model.ts");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};




var RequisicaoDescargaItem = /** @class */ (function (_super) {
    __extends(RequisicaoDescargaItem, _super);
    function RequisicaoDescargaItem(cliPontaRequisicaoDescargaId) {
        if (cliPontaRequisicaoDescargaId === void 0) { cliPontaRequisicaoDescargaId = 0; }
        var _this = _super.call(this) || this;
        _this.cliPontaRequisicaoDescargaId = cliPontaRequisicaoDescargaId;
        _this.lote = new app_pages_cadastro_lote_lote_model__WEBPACK_IMPORTED_MODULE_0__["Lote"]();
        _this.material = new app_pages_cadastro_material_material_model__WEBPACK_IMPORTED_MODULE_1__["Material"]();
        _this.tanque = new app_pages_cadastro_tanque_tanque_model__WEBPACK_IMPORTED_MODULE_2__["Tanque"]();
        return _this;
    }
    return RequisicaoDescargaItem;
}(app_shared_services_base_base_model__WEBPACK_IMPORTED_MODULE_3__["BaseModel"]));



/***/ }),

/***/ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-item/requisicao-descarga-item.validation.ts":
/*!*********************************************************************************************************************************************!*\
  !*** ./src/app/pages/especificos/pontafelix/movimentos/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 app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! app/shared/services/funcoes/number-utils/number-utils.static.service */ "./src/app/shared/services/funcoes/number-utils/number-utils.static.service.ts");
/* harmony import */ var app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_1__ = __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 _requisicao_descarga_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../requisicao-descarga.constants */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga.constants.ts");
/* harmony import */ var app_shared_services_funcoes_nfe_utils_nfe_utils_static_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! app/shared/services/funcoes/nfe-utils/nfe-utils.static.service */ "./src/app/shared/services/funcoes/nfe-utils/nfe-utils.static.service.ts");
/* harmony import */ var app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! app/shared/services/funcoes/date-time-utils/date-time-utils.static.service */ "./src/app/shared/services/funcoes/date-time-utils/date-time-utils.static.service.ts");
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};





var RequisicaoDescargaItemValidation = /** @class */ (function () {
    function RequisicaoDescargaItemValidation(message, configuracao, funcoes) {
        var _this = this;
        this.message = message;
        this.configuracao = configuracao;
        this.funcoes = funcoes;
        this.constantes = new _requisicao_descarga_constants__WEBPACK_IMPORTED_MODULE_2__["RequisicaoDescargaConstants"]();
        this.configuracao.getConfig(this.constantes.listaParam, function () { return _this.loadConfig(); });
    }
    RequisicaoDescargaItemValidation.prototype.loadConfig = function () {
        if (this.configuracao.isLoadConfig()) {
            this.constantes.configUni.obrChaveNFeEnt = this.configuracao.boolean("UNI", "ObrChaveNFeEnt");
        }
    };
    RequisicaoDescargaItemValidation.prototype.getValidations = function (requisicaoDescarga, data, paramsBooleans) {
        var r = [];
        r.push(this.dtDoctoNaoPodeSerMaiorDtRequisicao({ "dtRequisicao": requisicaoDescarga.dtRequisicao, "dtDocto": data.dtDocto }));
        r.push(this.dtDoctoNaoPodeSerMaiorDtAtual({ "dtDocto": data.dtDocto }));
        r.push(this.vlNotaNaoPermitido({ "vlNota": data.vlNota, "quantidDoc": data.quantidDoc, "lote": data.lote }));
        if (paramsBooleans.vldNF)
            r.push(this.validaNF(data));
        if (paramsBooleans.isEnabledQuantid)
            r.push(this.validaQuantid({ "quantid": data.quantid, "movQuantid": data.tanque.movQuantid }));
        return r.filter(function (v) { return v["isValid"] === false; });
    };
    RequisicaoDescargaItemValidation.prototype.validaNF = function (data, showError) {
        if (showError === void 0) { showError = false; }
        var r = { "isValid": true, "message": "" };
        if (data.modeloNotaId === "55") {
            if (this.constantes.configUni.obrChaveNFeEnt) {
                if (!data.chaveNFE) {
                    r.isValid = false;
                    r.message = "messages.chaveNfeDeveSerInformada";
                }
                else {
                    var result = app_shared_services_funcoes_nfe_utils_nfe_utils_static_service__WEBPACK_IMPORTED_MODULE_3__["NfeUtilsStaticService"].validaChaveNFe(data.chaveNFE, data.emitente, +data.docto, data.serieNotaId);
                    if (!result) {
                        r.isValid = false;
                        r.message = "messages.chaveNfeInvalida";
                    }
                }
            }
        }
        if (!r.isValid && showError) {
            this.message.warning("titles.requisicaoDescarga", r.message);
        }
        return r;
    };
    RequisicaoDescargaItemValidation.prototype.validaQuantid = function (params, showError) {
        if (showError === void 0) { showError = false; }
        var r = { "isValid": true, "message": "" };
        if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["NumberUtilsStaticService"].isNotPositive(params.quantid)) {
            r.isValid = false;
            if (app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_1__["BooleanUtilsStaticService"].toBoolean(params.movQuantid)) {
                r.message = "messages.qtdeDepositoNaoInformado";
            }
            else {
                r.message = this.message.translate("messages.campoObrigatorio", { name: this.message.translate('labels.quantidade') });
            }
        }
        if (!r.isValid && showError) {
            this.message.warning("titles.requisicaoDescarga", r.message);
        }
        return r;
    };
    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.dtDoctoNaoPodeSerMaiorDtAtual = function (params, showError) {
        if (showError === void 0) { showError = false; }
        var r = { "isValid": true, "message": "" };
        if (app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_4__["DateTimeUtilsStaticService"].maiorAHoje(params.dtDocto)) {
            r.isValid = false;
            r.message = "messages.dataEmissaoNaoPodeSerMaiorQueDataAtual";
        }
        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;
    };
    RequisicaoDescargaItemValidation.prototype.podeIncluir = function (data, item) {
        if (data.entradaVeiculo.flagDesmembrado === 'I') {
            this.message.warning("titles.requisicaoDescarga", "messages.ticketJaIntegradoAltNaoPermitida");
            return false;
        }
        return true;
    };
    RequisicaoDescargaItemValidation.prototype.podeAlterar = function (item) {
        return true;
    };
    return RequisicaoDescargaItemValidation;
}());



/***/ }),

/***/ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-pesagem-anterior/requisicao-descarga-pesagem-anterior.component.ts":
/*!********************************************************************************************************************************************************************!*\
  !*** ./src/app/pages/especificos/pontafelix/movimentos/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 _requisicao_descarga_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../requisicao-descarga.service */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga.service.ts");
/* harmony import */ var app_config_enumerables__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! app/config/enumerables */ "./src/app/config/enumerables.ts");
/* harmony import */ var app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! app/pages/login/login.service */ "./src/app/pages/login/login.service.ts");
/* harmony import */ var app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! app/shared/services/funcoes/funcoes.service */ "./src/app/shared/services/funcoes/funcoes.service.ts");
/* harmony import */ var app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! app/shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
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 app_config_enumerables__WEBPACK_IMPORTED_MODULE_2__["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.cliPontaRequisicaoDescargaId }).subscribe(function (resp) {
            if (resp) {
                _this.balPesoTaraDto = resp;
            }
        });
    };
    RequisicaoDescargaPesagemAnteriorComponent.ctorParameters = function () { return [
        { type: app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_4__["FuncoesService"] },
        { type: app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_5__["MessageService"] },
        { type: _requisicao_descarga_service__WEBPACK_IMPORTED_MODULE_1__["RequisicaoDescargaService"] },
        { type: app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_3__["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/especificos/pontafelix/movimentos/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", [app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_4__["FuncoesService"],
            app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_5__["MessageService"],
            _requisicao_descarga_service__WEBPACK_IMPORTED_MODULE_1__["RequisicaoDescargaService"],
            app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_3__["LoginService"]])
    ], RequisicaoDescargaPesagemAnteriorComponent);
    return RequisicaoDescargaPesagemAnteriorComponent;
}());



/***/ }),

/***/ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-pesagem-veiculo-desmembrado/requisicao-descarga-pesagem-veiculo-desmembrado.component.ts":
/*!******************************************************************************************************************************************************************************************!*\
  !*** ./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-pesagem-veiculo-desmembrado/requisicao-descarga-pesagem-veiculo-desmembrado.component.ts ***!
  \******************************************************************************************************************************************************************************************/
/*! exports provided: RequisicaoDescargaPesagemVeiculoDesmembradoComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RequisicaoDescargaPesagemVeiculoDesmembradoComponent", function() { return RequisicaoDescargaPesagemVeiculoDesmembradoComponent; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _requisicao_descarga_model__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../requisicao-descarga.model */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga.model.ts");
/* harmony import */ var _requisicao_descarga_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../requisicao-descarga.service */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga.service.ts");
/* harmony import */ var app_config_enumerables__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! app/config/enumerables */ "./src/app/config/enumerables.ts");
/* harmony import */ var app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! app/pages/login/login.service */ "./src/app/pages/login/login.service.ts");
/* harmony import */ var app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! app/shared/services/funcoes/funcoes.service */ "./src/app/shared/services/funcoes/funcoes.service.ts");
/* harmony import */ var app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! app/shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var app_shared_services_funcoes_modal_utils_modal_utils_static_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! app/shared/services/funcoes/modal-utils/modal-utils.static.service */ "./src/app/shared/services/funcoes/modal-utils/modal-utils.static.service.ts");
/* harmony import */ var app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! app/shared/services/funcoes/number-utils/number-utils.static.service */ "./src/app/shared/services/funcoes/number-utils/number-utils.static.service.ts");
/* harmony import */ var app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! app/shared/services/funcoes/configuracao/configuracao.facade */ "./src/app/shared/services/funcoes/configuracao/configuracao.facade.ts");
/* harmony import */ var _requisicao_descarga_constants__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../requisicao-descarga.constants */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga.constants.ts");
/* harmony import */ var app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! app/shared/services/funcoes/boolean-utils/boolean-utils.static.service */ "./src/app/shared/services/funcoes/boolean-utils/boolean-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 RequisicaoDescargaPesagemVeiculoDesmembradoComponent = /** @class */ (function () {
    function RequisicaoDescargaPesagemVeiculoDesmembradoComponent(funcoesService, messageService, service, configuracao, loginService) {
        var _this = this;
        this.funcoesService = funcoesService;
        this.messageService = messageService;
        this.service = service;
        this.configuracao = configuracao;
        this.loginService = loginService;
        this.outConfirma = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
        this.data = new _requisicao_descarga_model__WEBPACK_IMPORTED_MODULE_1__["RequisicaoDescargaPesagemVeicDesmembradoDto"]();
        this.constantes = new _requisicao_descarga_constants__WEBPACK_IMPORTED_MODULE_10__["RequisicaoDescargaConstants"]();
        this.mascara = new app_config_enumerables__WEBPACK_IMPORTED_MODULE_3__["Mascaras"]();
        this.mensagens = [];
        this.loadConfig = function () { return __awaiter(_this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                if (this.configuracao.isLoadConfig()) {
                    this.constantes.configBal.intCta = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_11__["BooleanUtilsStaticService"].toBoolean(this.configuracao.lerConfig("BAL", "IntCta"));
                    this.constantes.configBal.intCtaTipo = this.configuracao.lerConfig("BAL", "IntCtaTipo");
                    this.constantes.configBal.intCtaVersao = this.configuracao.number("BAL", "IntCtaVersao");
                    this.constantes.configSto.intGuardian = this.configuracao.lerConfig("STO", "IntGuardian");
                    this.constantes.configBal.pesagemAutomatica = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_11__["BooleanUtilsStaticService"].toBoolean(this.configuracao.lerConfig("BAL", "PesagemAutomatica"));
                    this.constantes.configBal.ocrPesagem = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_11__["BooleanUtilsStaticService"].toBoolean(this.configuracao.lerConfig("BAL", "OcrPesagem"));
                    this.constantes.configBal.digFlag = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_11__["BooleanUtilsStaticService"].toBoolean(this.configuracao.lerConfig("BAL", "DigFlag"));
                    this.constantes.configBal.digChkLib = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_11__["BooleanUtilsStaticService"].toBoolean(this.configuracao.lerConfig("BAL", "DigChkLib"));
                    this.constantes.configBal.iProNetAtivo = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_11__["BooleanUtilsStaticService"].toBoolean(this.configuracao.lerConfig("BAL", "IProNetAtivo"));
                    this.constantes.configBal.easyAtivo = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_11__["BooleanUtilsStaticService"].toBoolean(this.configuracao.lerConfig("BAL", "EasyAtivo"));
                    this.constantes.configBal.geoFlag = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_11__["BooleanUtilsStaticService"].toBoolean(this.configuracao.lerConfig("BAL", "GeoFlag"));
                    this.constantes.configBal.seaFlag = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_11__["BooleanUtilsStaticService"].toBoolean(this.configuracao.lerConfig("BAL", "SeaFlag"));
                    this.constantes.configBal.gipOcr = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_11__["BooleanUtilsStaticService"].toBoolean(this.configuracao.lerConfig("BAL", "GipOcr"));
                    this.constantes.configBal.rtsFlag = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_11__["BooleanUtilsStaticService"].toBoolean(this.configuracao.lerConfig("BAL", "RtsFlag"));
                    this.constantes.configBal.rtsOCRLib = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_11__["BooleanUtilsStaticService"].toBoolean(this.configuracao.lerConfig("BAL", "RtsOCRLib"));
                    this.constantes.configBal.spheAtivo = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_11__["BooleanUtilsStaticService"].toBoolean(this.configuracao.lerConfig("BAL", "SpheAtivo"));
                    this.constantes.configBal.primeAtivo = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_11__["BooleanUtilsStaticService"].toBoolean(this.configuracao.lerConfig("BAL", "PrimeAtivo"));
                    this.constantes.configBal.waccessAtivo = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_11__["BooleanUtilsStaticService"].toBoolean(this.configuracao.lerConfig("BAL", "WaccessAtivo"));
                    this.constantes.configBal.foccosAtivo = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_11__["BooleanUtilsStaticService"].toBoolean(this.configuracao.lerConfig("BAL", "FoccosAtivo"));
                    this.constantes.configBal.balCodig = this.configuracao.number("BAL", "BalCodig" + this.configuracao.macAddress);
                    this.constantes.configBal.bl2Codig = this.configuracao.number("BAL", "Bl2Codig" + this.configuracao.macAddress);
                    this.constantes.configBal.bl3Codig = this.configuracao.number("BAL", "Bl3Codig" + this.configuracao.macAddress);
                    this.constantes.configBal.spheEq = this.configuracao.lerConfig("BAL", "SpheEq" + this.configuracao.macAddress);
                    this.constantes.configBal.waccessE = this.configuracao.lerConfig("BAL", "WaccessE" + this.configuracao.macAddress);
                }
                return [2 /*return*/];
            });
        }); };
    }
    RequisicaoDescargaPesagemVeiculoDesmembradoComponent.prototype.ngOnInit = function () {
        var _this = this;
        this.configuracao.getConfig(this.constantes.listaParam, function () { return _this.getConfig(); });
    };
    RequisicaoDescargaPesagemVeiculoDesmembradoComponent.prototype.getConfig = function () {
        var _this = this;
        this.constantes.listaParam.map(function (c) {
            if (c.sistema === 'BAL') {
                c.parametros.push("BalCodig" + _this.configuracao.macAddress);
                c.parametros.push("Bl2Codig" + _this.configuracao.macAddress);
                c.parametros.push("Bl3Codig" + _this.configuracao.macAddress);
                c.parametros.push("SpheEq" + _this.configuracao.macAddress);
                c.parametros.push("WaccessE" + _this.configuracao.macAddress);
            }
        });
        this.configuracao.getConfig({ codRotina: this.constantes.sisFormularioId, configs: this.constantes.listaParam }, this.loadConfig);
    };
    RequisicaoDescargaPesagemVeiculoDesmembradoComponent.prototype.onSubmit = function (form) {
        //Executar a rotina 4.6. CTA – Consulta Último Acesso 
        //Depende da automação a ser implementada posteriormente(passando false por default)
        this.outConfirma.emit(false);
        app_shared_services_funcoes_modal_utils_modal_utils_static_service__WEBPACK_IMPORTED_MODULE_7__["ModalUtilsStaticService"].closeModal("requisicao-descarga-pesagem-veiculo-desmembrado-dialog");
    };
    RequisicaoDescargaPesagemVeiculoDesmembradoComponent.prototype.objectSelect = function (current) {
        this.data = current;
        this.trataData();
    };
    RequisicaoDescargaPesagemVeiculoDesmembradoComponent.prototype.trataData = function () {
        var entradaSaida = this.data.pesoBruto > 0 ? "S" : "E";
        this.ocrLiberacao = this.returnOcrLiberacao();
        this.trataPeso();
        this.trataBalanca(entradaSaida);
    };
    RequisicaoDescargaPesagemVeiculoDesmembradoComponent.prototype.trataPeso = function () {
        var entradaSaida = this.data.pesoBruto > 0 ? "S" : "E";
        this.data.pesoBruto = entradaSaida !== "E" ? this.data.pesoBruto : this.data.pesoTara;
        this.data.pesoLiquido = entradaSaida === "E" ? 0 : (this.data.pesoBruto - this.data.pesoTara);
        this.data.pesoTara = entradaSaida !== "E" ? this.data.pesoTara : this.data.pesoBruto;
    };
    RequisicaoDescargaPesagemVeiculoDesmembradoComponent.prototype.trataBalanca = function (entradaSaida) {
        switch (entradaSaida) {
            case "E":
                this.data.balancaId = this.constantes.configBal.balCodig;
                break;
            case "3":
                this.data.balancaId = this.constantes.configBal.bl3Codig;
                break;
            default:
                this.data.balancaId = this.constantes.configBal.bl2Codig;
                break;
        }
    };
    RequisicaoDescargaPesagemVeiculoDesmembradoComponent.prototype.returnOcrLiberacao = function () {
        return this.constantes.configBal.ocrPesagem && ((this.constantes.configBal.digFlag && this.constantes.configBal.digChkLib) ||
            this.constantes.configBal.iProNetAtivo ||
            this.constantes.configBal.easyAtivo ||
            this.constantes.configBal.geoFlag ||
            this.constantes.configBal.seaFlag ||
            this.constantes.configBal.gipOcr ||
            (this.constantes.configBal.rtsFlag && this.constantes.configBal.rtsOCRLib) ||
            (this.constantes.configBal.spheEq !== 'D' ? this.constantes.configBal.spheAtivo : false) ||
            this.constantes.configBal.primeAtivo ||
            (this.constantes.configBal.waccessE !== 'D' ? this.constantes.configBal.waccessAtivo : false) ||
            this.constantes.configBal.foccosAtivo);
    };
    RequisicaoDescargaPesagemVeiculoDesmembradoComponent.prototype.getPeso = function (resp) {
        if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_8__["NumberUtilsStaticService"].isNotPositive(resp.peso))
            this.data.pesoBruto = 0;
        this.trataPeso();
    };
    Object.defineProperty(RequisicaoDescargaPesagemVeiculoDesmembradoComponent.prototype, "btnPesagemVisivel", {
        get: function () {
            return (this.constantes.configBal.pesagemAutomatica && this.constantes.configSto.intGuardian !== 'P');
        },
        enumerable: true,
        configurable: true
    });
    RequisicaoDescargaPesagemVeiculoDesmembradoComponent.prototype.cancelar = function () {
        this.outConfirma.emit(false);
        app_shared_services_funcoes_modal_utils_modal_utils_static_service__WEBPACK_IMPORTED_MODULE_7__["ModalUtilsStaticService"].closeModal("requisicao-descarga-pesagem-veiculo-desmembrado-dialog");
    };
    RequisicaoDescargaPesagemVeiculoDesmembradoComponent.ctorParameters = function () { return [
        { type: app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_5__["FuncoesService"] },
        { type: app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_6__["MessageService"] },
        { type: _requisicao_descarga_service__WEBPACK_IMPORTED_MODULE_2__["RequisicaoDescargaService"] },
        { type: app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_9__["ConfiguracaoFacade"] },
        { type: app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_4__["LoginService"] }
    ]; };
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"])(),
        __metadata("design:type", Object)
    ], RequisicaoDescargaPesagemVeiculoDesmembradoComponent.prototype, "outConfirma", void 0);
    RequisicaoDescargaPesagemVeiculoDesmembradoComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
            selector: "app-requisicao-descarga-pesagem-veiculo-desmembrado",
            template: __importDefault(__webpack_require__(/*! raw-loader!./requisicao-descarga-pesagem-veiculo-desmembrado.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-pesagem-veiculo-desmembrado/requisicao-descarga-pesagem-veiculo-desmembrado.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_5__["FuncoesService"],
            app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_6__["MessageService"],
            _requisicao_descarga_service__WEBPACK_IMPORTED_MODULE_2__["RequisicaoDescargaService"],
            app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_9__["ConfiguracaoFacade"],
            app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_4__["LoginService"]])
    ], RequisicaoDescargaPesagemVeiculoDesmembradoComponent);
    return RequisicaoDescargaPesagemVeiculoDesmembradoComponent;
}());



/***/ }),

/***/ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-print-etiquetas-modal/requisicao-descarga-print-etiquetas-modal.component.ts":
/*!******************************************************************************************************************************************************************************!*\
  !*** ./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-print-etiquetas-modal/requisicao-descarga-print-etiquetas-modal.component.ts ***!
  \******************************************************************************************************************************************************************************/
/*! exports provided: RequisicaoDescargaPrintEtiquetasModalComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RequisicaoDescargaPrintEtiquetasModalComponent", function() { return RequisicaoDescargaPrintEtiquetasModalComponent; });
/* harmony import */ var _shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../../../../../../shared/services/funcoes/number-utils/number-utils.static.service */ "./src/app/shared/services/funcoes/number-utils/number-utils.static.service.ts");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _requisicao_descarga_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../requisicao-descarga.service */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga.service.ts");
/* harmony import */ var app_config_enumerables__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! app/config/enumerables */ "./src/app/config/enumerables.ts");
/* harmony import */ var app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! app/pages/login/login.service */ "./src/app/pages/login/login.service.ts");
/* harmony import */ var app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! app/shared/services/funcoes/funcoes.service */ "./src/app/shared/services/funcoes/funcoes.service.ts");
/* harmony import */ var app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! app/shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var app_shared_services_funcoes_modal_utils_modal_utils_static_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! app/shared/services/funcoes/modal-utils/modal-utils.static.service */ "./src/app/shared/services/funcoes/modal-utils/modal-utils.static.service.ts");
/* harmony import */ var _requisicao_descarga_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../requisicao-descarga.constants */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga.constants.ts");
/* harmony import */ var _requisicao_descarga_model__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../requisicao-descarga.model */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga.model.ts");
/* harmony import */ var app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! app/shared/services/event-emitter/event-emitter.service */ "./src/app/shared/services/event-emitter/event-emitter.service.ts");
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 RequisicaoDescargaPrintEtiquetasModalComponent = /** @class */ (function () {
    function RequisicaoDescargaPrintEtiquetasModalComponent(funcoesService, messageService, service, loginService) {
        this.funcoesService = funcoesService;
        this.messageService = messageService;
        this.service = service;
        this.loginService = loginService;
        this.outConfirma = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["EventEmitter"]();
        this.filtro = new _requisicao_descarga_model__WEBPACK_IMPORTED_MODULE_9__["RequisicaoDescargaRelImpressaoEtiquetaFilter"]();
        this.constantes = new _requisicao_descarga_constants__WEBPACK_IMPORTED_MODULE_8__["RequisicaoDescargaConstants"]();
        this.mascara = new app_config_enumerables__WEBPACK_IMPORTED_MODULE_3__["Mascaras"]();
        this.mensagens = [];
        this.retornoArquivoGerado = new _requisicao_descarga_model__WEBPACK_IMPORTED_MODULE_9__["ReqDescargaImpressaoEtiquetaArquivoGerado"]();
    }
    RequisicaoDescargaPrintEtiquetasModalComponent.prototype.ngOnInit = function () {
    };
    RequisicaoDescargaPrintEtiquetasModalComponent.prototype.onSubmit = function (form) {
        var _this = this;
        app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_10__["EventEmitterService"].get("formError").emit(form);
        if (form.invalid) {
            return;
        }
        if (!this.validaNumEtiquetas(true)) {
            return;
        }
        this.service.relImpressaoEtiqueta(this.filtro).subscribe(function (result) {
            if (_this.funcoesService.isNotUndefinedOrNull(result.validationResult)) {
                _this.mensagens = _this.messageService.validationResult(result.validationResult);
                if (result && !result.validationResult.isValid) {
                    _this.messageService.warning("titles.requisicaoDescarga", _this.mensagens[0]);
                    return;
                }
            }
            _this.retornoArquivoGerado = result;
            _this.messageService.success("Sucesso", _this.retornoArquivoGerado.mensagem);
            _this.outConfirma.emit();
            app_shared_services_funcoes_modal_utils_modal_utils_static_service__WEBPACK_IMPORTED_MODULE_7__["ModalUtilsStaticService"].closeModal("requisicao-descarga-print-etiquetas-modal-dialog");
            _this.download();
        });
    };
    RequisicaoDescargaPrintEtiquetasModalComponent.prototype.download = function () {
        if (this.funcoesService.isUndefinedOrNull(this.retornoArquivoGerado)) {
            return;
        }
        var b64 = this.retornoArquivoGerado.arquivoGerado;
        var byteCharacters = atob(b64);
        var byteArrays = [];
        for (var offset = 0; offset < byteCharacters.length; offset += 512) {
            var slice = byteCharacters.slice(offset, offset + 512);
            var byteNumbers = new Array(slice.length);
            for (var i = 0; i < slice.length; i++) {
                byteNumbers[i] = slice.charCodeAt(i);
            }
            var byteArray = new Uint8Array(byteNumbers);
            byteArrays.push(byteArray);
        }
        var tipo = this.retornoArquivoGerado.tipoArquivo.replace(',', '');
        var blobData = new Blob(byteArrays, { type: tipo });
        var win = window;
        if (win.navigator && win.navigator.msSaveOrOpenBlob) { // IE
            win.navigator.msSaveOrOpenBlob(blobData, this.retornoArquivoGerado.nomeArquivo);
        }
        else { // chrome
            var blob = new Blob([blobData], { type: tipo });
            var url = window.URL.createObjectURL(blob);
            var link = document.createElement('a');
            link.href = url;
            link.download = this.retornoArquivoGerado.nomeArquivo;
            link.click();
        }
    };
    RequisicaoDescargaPrintEtiquetasModalComponent.prototype.objectSelect = function (item) {
        this.filtro.loteId = item.loteId;
        this.filtro.requisicaoItemId = item.cliPontaRequisicaoDescargaItemId;
        app_shared_services_funcoes_modal_utils_modal_utils_static_service__WEBPACK_IMPORTED_MODULE_7__["ModalUtilsStaticService"].openModal("requisicao-descarga-print-etiquetas-modal-dialog");
    };
    RequisicaoDescargaPrintEtiquetasModalComponent.prototype.cancelar = function () {
        this.outConfirma.emit();
        app_shared_services_funcoes_modal_utils_modal_utils_static_service__WEBPACK_IMPORTED_MODULE_7__["ModalUtilsStaticService"].closeModal("requisicao-descarga-print-etiquetas-modal-dialog");
    };
    RequisicaoDescargaPrintEtiquetasModalComponent.prototype.validaNumEtiquetas = function (validaObrigatorio) {
        if (validaObrigatorio === void 0) { validaObrigatorio = false; }
        if (validaObrigatorio) {
            if (_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["NumberUtilsStaticService"].isNotPositive(this.filtro.etiquetaInicialId)) {
                this.messageService.warning("titles.requisicaoDescarga", "messages.etiquetaInicialInvalida");
                return false;
            }
            if (_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["NumberUtilsStaticService"].isNotPositive(this.filtro.etiquetaFinalId)) {
                this.messageService.warning("titles.requisicaoDescarga", "messages.etiquetaFinalInvalida");
                return false;
            }
        }
        if (this.filtro.etiquetaInicialId > this.filtro.etiquetaFinalId) {
            this.messageService.warning("titles.requisicaoDescarga", "messages.etiquetaFinalDeveSerMaiorOuIgualInicial");
            return false;
        }
        return true;
    };
    RequisicaoDescargaPrintEtiquetasModalComponent.ctorParameters = function () { return [
        { type: app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_5__["FuncoesService"] },
        { type: app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_6__["MessageService"] },
        { type: _requisicao_descarga_service__WEBPACK_IMPORTED_MODULE_2__["RequisicaoDescargaService"] },
        { type: app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_4__["LoginService"] }
    ]; };
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Output"])(),
        __metadata("design:type", Object)
    ], RequisicaoDescargaPrintEtiquetasModalComponent.prototype, "outConfirma", void 0);
    RequisicaoDescargaPrintEtiquetasModalComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"])({
            selector: "app-requisicao-descarga-print-etiquetas-modal",
            template: __importDefault(__webpack_require__(/*! raw-loader!./requisicao-descarga-print-etiquetas-modal.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-print-etiquetas-modal/requisicao-descarga-print-etiquetas-modal.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_5__["FuncoesService"],
            app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_6__["MessageService"],
            _requisicao_descarga_service__WEBPACK_IMPORTED_MODULE_2__["RequisicaoDescargaService"],
            app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_4__["LoginService"]])
    ], RequisicaoDescargaPrintEtiquetasModalComponent);
    return RequisicaoDescargaPrintEtiquetasModalComponent;
}());



/***/ }),

/***/ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-report/requisicao-descarga-report.component.ts":
/*!************************************************************************************************************************************************!*\
  !*** ./src/app/pages/especificos/pontafelix/movimentos/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" }
        ];
    };
    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/especificos/pontafelix/movimentos/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/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-segunda-pesagem/requisicao-descarga-segunda-pesagem.component.ts":
/*!******************************************************************************************************************************************************************!*\
  !*** ./src/app/pages/especificos/pontafelix/movimentos/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_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_0__ = __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 _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/fesm5/router.js");
/* harmony import */ var _requisicao_descarga_pesagem_anterior_requisicao_descarga_pesagem_anterior_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../requisicao-descarga-pesagem-anterior/requisicao-descarga-pesagem-anterior.component */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-pesagem-anterior/requisicao-descarga-pesagem-anterior.component.ts");
/* harmony import */ var _requisicao_descarga_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../requisicao-descarga.constants */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga.constants.ts");
/* harmony import */ var _requisicao_descarga_permissoes__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../requisicao-descarga.permissoes */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga.permissoes.ts");
/* harmony import */ var _requisicao_descarga_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../requisicao-descarga.service */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga.service.ts");
/* harmony import */ var _requisicao_descarga_segunda_pesagem_model__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./requisicao-descarga-segunda-pesagem.model */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-segunda-pesagem/requisicao-descarga-segunda-pesagem.model.ts");
/* harmony import */ var _requisicao_descarga_segunda_pesagem_validation__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./requisicao-descarga-segunda-pesagem.validation */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-segunda-pesagem/requisicao-descarga-segunda-pesagem.validation.ts");
/* harmony import */ var app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! app/pages/login/login.service */ "./src/app/pages/login/login.service.ts");
/* harmony import */ var app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! app/shared/services/event-emitter/event-emitter.service */ "./src/app/shared/services/event-emitter/event-emitter.service.ts");
/* harmony import */ var app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! app/shared/services/funcoes/array-utils/array-utils.static.service */ "./src/app/shared/services/funcoes/array-utils/array-utils.static.service.ts");
/* harmony import */ var app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! app/shared/services/funcoes/configuracao/configuracao.facade */ "./src/app/shared/services/funcoes/configuracao/configuracao.facade.ts");
/* harmony import */ var app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! app/shared/services/funcoes/date-time-utils/date-time-utils.static.service */ "./src/app/shared/services/funcoes/date-time-utils/date-time-utils.static.service.ts");
/* harmony import */ var app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! app/shared/services/funcoes/funcoes.service */ "./src/app/shared/services/funcoes/funcoes.service.ts");
/* harmony import */ var app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! app/shared/services/funcoes/number-utils/number-utils.static.service */ "./src/app/shared/services/funcoes/number-utils/number-utils.static.service.ts");
/* harmony import */ var app_shared_services_funcoes_object_utils_object_utils_static_service__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! app/shared/services/funcoes/object-utils/object-utils.static.service */ "./src/app/shared/services/funcoes/object-utils/object-utils.static.service.ts");
/* harmony import */ var app_shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! app/shared/services/funcoes/permissoes-utils/permissoes-utils.service */ "./src/app/shared/services/funcoes/permissoes-utils/permissoes-utils.service.ts");
/* harmony import */ var app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! app/shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_19__ = __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_4__["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_7__["RequisicaoDescargaSegundaPesagem"]();
        _this.oldData = new _requisicao_descarga_segunda_pesagem_model__WEBPACK_IMPORTED_MODULE_7__["RequisicaoDescargaSegundaPesagem"]();
        _this.constantes = new _requisicao_descarga_constants__WEBPACK_IMPORTED_MODULE_4__["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.pTara = 0;
        _this.target = _this.funcoes.getTargetLocation();
        _this.pageRoute = "/especificos/pontafelix/movimentos/requisicaoDescarga";
        _this.loadConfig = function () {
            _this.constantes.configBal.obrigaHrOperacao = _this.configuracao.boolean("BAL", "ObrigaHrOperacao");
            _this.constantes.configBal.justAtraso = _this.configuracao.boolean("BAL", "JustAtraso");
            _this.constantes.configBal.codBalCheckList = _this.configuracao.boolean("BAL", "CodBalCheckList");
            _this.constantes.configBal.pesagemAutomatica = _this.configuracao.boolean("BAL", "PesagemAutomatica");
            _this.constantes.configBal.obrTernoDesc = _this.configuracao.boolean("BAL", "ObrTernoDesc");
            _this.constantes.configBal.sPerDesComis = _this.configuracao.boolean("BAL", "SPerDesComis");
            _this.constantes.configCtv.checkListPesa = _this.configuracao.boolean("CTV", "CheckListPesa");
            _this.constantes.configBal.validaPesagem = _this.configuracao.boolean("BAL", "ValidaPesagem");
            _this.constantes.configBal.justDescarga = _this.configuracao.boolean("BAL", "JustDescarga");
            _this.constantes.configBal.ptJustDescargaR = _this.configuracao.number("BAL", "PtJustDescargaR");
            _this.constantes.configBal.ptJustDescargaF = _this.configuracao.number("BAL", "PtJustDescargaF");
            _this.constantes.configBal.ptJustDescargaRSb = _this.configuracao.number("BAL", "PtJustDescargaRSb");
            _this.constantes.configBal.ptJustDescargaFSb = _this.configuracao.number("BAL", "PtJustDescargaFSb");
            _this.constantes.configBal.permAfePesoTara = _this.configuracao.boolean("BAL", "PermAfePesoTara");
            _this.constantes.configBal.tolTara = _this.configuracao.number("BAL", "TolTara");
            _this.constantes.configBal.boletimOcorrencia = _this.configuracao.boolean("BAL", "BoletimOcorrencia");
            _this.constantes.configBal.pesoMaxFerBO = _this.configuracao.number("BAL", "PesoMaxFerBO");
            _this.constantes.configBal.impTickAposLib = _this.configuracao.boolean("BAL", "ImpTickAposLib");
            _this.constantes.configBal.justDescargaSb = _this.configuracao.boolean("BAL", "JustDescargaSb");
            _this.constantes.configWeb.cWebModRequisicaoD = _this.configuracao.lerConfig("WEB", "CWebModRequisicaoD");
            _this.constantes.configWeb.cWebModTicketD = _this.configuracao.lerConfig("WEB", "CWebModTicketD");
            _this.constantes.configWeb.cWebModBOReqDescarga = _this.configuracao.lerConfig("WEB", "CWebModBOReqDescarga");
            _this.constantes.configBal.dtOperIgualPes = _this.configuracao.boolean("BAL", "DtOperIgualPes");
            _this.constantes.configWeb.prefixoRelEspecifico = _this.configuracao.lerConfig("WEB", "PrefixoRelEspecifico");
            _this.posConfig();
        };
        _this.validation = new _requisicao_descarga_segunda_pesagem_validation__WEBPACK_IMPORTED_MODULE_8__["RequisicaoDescargaSegundaPesagemValidation"](message, configuracao);
        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, 6, 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");
                        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.configuracao.getConfig(this.constantes.listaParam, this.loadConfig);
        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 = app_shared_services_funcoes_object_utils_object_utils_static_service__WEBPACK_IMPORTED_MODULE_16__["ObjectUtilsStaticService"].clone(this.data);
        this.validation.oldData = this.oldData;
    };
    RequisicaoDescargaSegundaPesagemComponent.prototype.posConfig = function () {
        this.data.flagManual = this.constantes.configBal.pesagemAutomatica ? "S" : "N";
        this.data.dtIniOper = this.constantes.configBal.dtOperIgualPes ? this.data.dtIniOper : this.now;
        this.trataJustAtraso();
        this.trataJustQuebra();
        this.trataJustificativaPTara();
    };
    Object.defineProperty(RequisicaoDescargaSegundaPesagemComponent.prototype, "disabledPesoLiq", {
        get: function () {
            return !this.constantes.configCtv.checkListPesa || _shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["BooleanUtilsStaticService"].toBoolean(this.data.flagPesa);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(RequisicaoDescargaSegundaPesagemComponent.prototype, "operadorObrigatorio", {
        get: function () {
            return this.constantes.configBal.obrigaHrOperacao;
        },
        enumerable: true,
        configurable: true
    });
    RequisicaoDescargaSegundaPesagemComponent.prototype.trataBalanca = function (event) {
        if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_15__["NumberUtilsStaticService"].isPositive(+event.chave)) {
            this.data.pesoTara = 0;
        }
        this.validation.trataBalanca({ balancaId: +event.chave });
    };
    RequisicaoDescargaSegundaPesagemComponent.prototype.calcPesoLiq = function () {
        if (this.disabledPesoLiq)
            this.data.pesoLiq = app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_15__["NumberUtilsStaticService"].toNumber(this.data.pesoBru) - app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_15__["NumberUtilsStaticService"].toNumber(this.data.pesoTara);
        else
            this.data.pesoTara = app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_15__["NumberUtilsStaticService"].toNumber(this.data.pesoBru) - app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_15__["NumberUtilsStaticService"].toNumber(this.data.pesoLiq);
        this.trataJustQuebra();
        this.trataJustificativaPTara();
    };
    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 (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_15__["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;
        if (temQuebraOuSobra) {
            this.message.confirm("titles.segundaPesagem", this.message.translate("messages.diferencaMaiorQuePermitido", {
                ptDif: app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_15__["NumberUtilsStaticService"].round(ptDif, 2)
            }), null, function () {
                _this.disabledQuebra = false;
                _this.data.diferenca = diferenca;
                _this.statusQuebraOuSobraPt = app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_15__["NumberUtilsStaticService"].round(ptDif, 2) + " %";
                if (peso > _this.data.kilos)
                    return _this.statusQuebraOuSobra = "Sobra";
                else if (peso < _this.data.kilos)
                    _this.statusQuebraOuSobra = "Quebra";
                else
                    _this.statusQuebraOuSobra = "";
            }, false, function () {
                _this.disabledQuebra = true;
                _this.data.pesoLiq = 0;
                _this.data.pesoTara = 0;
                _this.data.diferenca = 0;
            });
        }
    };
    RequisicaoDescargaSegundaPesagemComponent.prototype.validaSobra = function (peso) {
        var diferenca = peso - this.data.kilos;
        if (diferenca <= 0)
            return true;
        if (this.constantes.configBal.justDescargaSb) {
            var percDifMax = 0;
            if (this.data.tipoTransp === 'R')
                percDifMax = this.constantes.configBal.ptJustDescargaRSb;
            else
                percDifMax = this.constantes.configBal.ptJustDescargaFSb;
            var ptDif = 0;
            if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_15__["NumberUtilsStaticService"].isNotPositive(this.data.kilos))
                ptDif = 100;
            else
                ptDif = app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_15__["NumberUtilsStaticService"].round(Math.abs((1 - (peso / this.data.kilos)) * 100), 5);
            return ptDif > percDifMax;
        }
        return true;
    };
    RequisicaoDescargaSegundaPesagemComponent.prototype.validaQuebra = function (peso) {
        if (this.constantes.configBal.justDescarga) {
            var percDifMax = 0;
            if (this.data.tipoTransp === 'R')
                percDifMax = this.constantes.configBal.ptJustDescargaR;
            else
                percDifMax = this.constantes.configBal.ptJustDescargaF;
            var ptDif = 0;
            if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_15__["NumberUtilsStaticService"].isNotPositive(this.data.kilos))
                ptDif = 100;
            else
                ptDif = app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_15__["NumberUtilsStaticService"].round(Math.abs((1 - (peso / this.data.kilos)) * 100), 5);
            return percDifMax > ptDif;
        }
        return true;
    };
    RequisicaoDescargaSegundaPesagemComponent.prototype.trataDtFimOper = function (event) {
        this.validation.validaDtFimOper({ dtFimOper: event, dtIniOper: this.data.dtIniOper });
        this.trataJustAtraso();
    };
    RequisicaoDescargaSegundaPesagemComponent.prototype.trataJustAtraso = function () {
        this.disabledAtraso = true;
        if (this.constantes.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 = app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_13__["DateTimeUtilsStaticService"].getMinutes(dtInicio, this.now);
            this.disabledAtraso = (this.data.tempoOperacao <= 0) && (minutos < this.data.tempoOperacao);
            if (!this.disabledAtraso)
                this.minutos = minutos;
        }
    };
    RequisicaoDescargaSegundaPesagemComponent.prototype.trataJustificativaPTara = function () {
        return __awaiter(this, void 0, void 0, function () {
            var pTara, pesTara, mediaPTara, resultQtdePTara;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        pTara = 0;
                        pesTara = 0;
                        mediaPTara = 0;
                        return [4 /*yield*/, this.service.getTratarJustificativaPTara(this.data.requisicaoDescargaId).toPromise()];
                    case 1:
                        resultQtdePTara = _a.sent();
                        if (!!resultQtdePTara && resultQtdePTara.length > 0) {
                            pesTara = resultQtdePTara.reduce(function (a, b) { return a + b; }, 0);
                            mediaPTara = (pesTara / resultQtdePTara.length);
                        }
                        if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_15__["NumberUtilsStaticService"].toNumber(this.data.pesoTara) > mediaPTara)
                            pTara = app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_15__["NumberUtilsStaticService"].toNumber(this.data.pesoTara) - mediaPTara;
                        else
                            pTara = mediaPTara - app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_15__["NumberUtilsStaticService"].toNumber(this.data.pesoTara);
                        if (pTara > 0 && app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_15__["NumberUtilsStaticService"].isPositive(this.data.pesoTara)) {
                            pTara = (pTara * 100) / app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_15__["NumberUtilsStaticService"].toNumber(this.data.pesoTara);
                        }
                        this.pTara = app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_15__["NumberUtilsStaticService"].round(pTara, 2);
                        return [2 /*return*/];
                }
            });
        });
    };
    Object.defineProperty(RequisicaoDescargaSegundaPesagemComponent.prototype, "habilitaJustificativaPTara", {
        get: function () {
            return this.pTara !== this.constantes.configBal.tolTara;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(RequisicaoDescargaSegundaPesagemComponent.prototype, "lblTara", {
        get: function () {
            if (this.habilitaJustificativaPTara && app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_15__["NumberUtilsStaticService"].isPositive(this.data.pesoTara))
                return app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_15__["NumberUtilsStaticService"].round(this.pTara, 2) + " %";
            return "";
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(RequisicaoDescargaSegundaPesagemComponent.prototype, "justifAtrasoRequired", {
        get: function () {
            return !this.disabledAtraso && app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_15__["NumberUtilsStaticService"].isPositive(this.data.kilos);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(RequisicaoDescargaSegundaPesagemComponent.prototype, "atraso", {
        get: function () {
            if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_15__["NumberUtilsStaticService"].isNotPositive(this.minutos))
                return "";
            return this.minutos + " min";
        },
        enumerable: true,
        configurable: true
    });
    RequisicaoDescargaSegundaPesagemComponent.prototype.onSubmit = function (form) {
        var _this = this;
        app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_10__["EventEmitterService"].get("formError").emit(form);
        if (form.invalid) {
            this.funcoes.backToTop();
            return;
        }
        //Método depende de automação, será implementado posteriormente, por isso, forcei parar aqui com a mensagem abaixo
        var automacaoIndisponivel = true;
        if (automacaoIndisponivel) {
            this.message.warning("titles.segundaPesagem", "messages.situacaoDaAutomacaoNaoPermitida", { 'situacao': 'Automação Indisponível' });
            return;
        }
        var validations = this.validation.getValidations(this.data, this.disabledQuebra);
        if (app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_11__["ArrayUtilsStaticService"].any(validations)) {
            app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_10__["EventEmitterService"].get("backError").emit(validations.map(function (c) { return c.message; }));
            this.funcoes.backToTop();
            return;
        }
        ;
        if (this.constantes.configBal.validaPesagem && !_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["BooleanUtilsStaticService"].toBoolean(this.data.flagManual)) {
            this.message.confirm("titles.segundaPesagem", "messages.confirmaPesagemManual", null, function () { return _this.executeSegundaPesagem(); });
        }
        else {
            this.executeSegundaPesagem();
        }
    };
    RequisicaoDescargaSegundaPesagemComponent.prototype.executeSegundaPesagem = 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);
                            app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_10__["EventEmitterService"].get("backError").emit(mensagens);
                            this.funcoes.backToTop();
                        }
                        if (!!result && result.validationResult.isValid) {
                            this.message.saveSuccess("titles.requisicaoDescarga");
                            if (this.constantes.configBal.boletimOcorrencia && (this.constantes.configBal.pesoMaxFerBO > 0) && (this.data.diferenca > this.constantes.configBal.pesoMaxFerBO)) {
                                this.printBoletimOcorrencia();
                            }
                            else if (!this.constantes.configBal.impTickAposLib) {
                                this.printAutorizacao();
                            }
                            else if (this.constantes.configBal.impTickAposLib) {
                                this.printTicket();
                            }
                        }
                        return [2 /*return*/];
                }
            });
        });
    };
    RequisicaoDescargaSegundaPesagemComponent.prototype.printAutorizacao = function () {
        var modRel = this.constantes.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_19__["StringUtilsStaticService"].isNotEmpty(this.constantes.configWeb.prefixoRelEspecifico) && modRel.indexOf(this.constantes.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.constantes.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_19__["StringUtilsStaticService"].isNotEmpty(this.constantes.configWeb.prefixoRelEspecifico) && modRel.indexOf(this.constantes.configWeb.prefixoRelEspecifico) == 0) {
            this.funcoes.reportInvoc.invocaRelatorioEspecificos(modRel, reportTitulo, {
                filialId: this.loginService.getLogin().filialId,
                autorizacao: this.requisicaoDescargaId,
                tipoOCD: "D"
            });
        }
        else {
            this.funcoes.reportInvoc.invocaRelatorio(modRel, reportTitulo, {
                filialId: this.loginService.getLogin().filialId,
                autorizacao: this.requisicaoDescargaId,
                tipoOCD: "D"
            });
        }
        this.back();
    };
    RequisicaoDescargaSegundaPesagemComponent.prototype.printBoletimOcorrencia = function () {
        var modRel = this.constantes.configWeb.cWebModBOReqDescarga;
        if (!modRel) {
            this.message.warning("titles.requisicaoDescarga", "messages.modRelNaoConfigurado");
            return;
        }
        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_19__["StringUtilsStaticService"].isNotEmpty(this.constantes.configWeb.prefixoRelEspecifico) && modRel.indexOf(this.constantes.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.funcoes.desabilitarFiltro();
        this.router.navigate(["" + this.target + this.pageRoute]);
    };
    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();
    };
    RequisicaoDescargaSegundaPesagemComponent.prototype.checarIntegracoes = function () {
        //Depende de automação, será implementada posteriormente
    };
    Object.defineProperty(RequisicaoDescargaSegundaPesagemComponent.prototype, "saldoDepositoOptions", {
        get: function () {
            return {
                destinatarioIdCliente: this.data.destinatarioIdCliente,
                materialId: this.data.materialId,
                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_2__["Router"] },
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_2__["ActivatedRoute"] },
        { type: app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_14__["FuncoesService"] },
        { type: app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_18__["MessageService"] },
        { type: app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_12__["ConfiguracaoFacade"] },
        { type: _requisicao_descarga_service__WEBPACK_IMPORTED_MODULE_6__["RequisicaoDescargaService"] },
        { type: app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_9__["LoginService"] },
        { type: app_shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_17__["PermissoesUtilsService"] }
    ]; };
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewChild"])(_requisicao_descarga_pesagem_anterior_requisicao_descarga_pesagem_anterior_component__WEBPACK_IMPORTED_MODULE_3__["RequisicaoDescargaPesagemAnteriorComponent"], { static: false }),
        __metadata("design:type", _requisicao_descarga_pesagem_anterior_requisicao_descarga_pesagem_anterior_component__WEBPACK_IMPORTED_MODULE_3__["RequisicaoDescargaPesagemAnteriorComponent"])
    ], RequisicaoDescargaSegundaPesagemComponent.prototype, "childRequisicaoDescargaPesagemAnteriorComponent", void 0);
    RequisicaoDescargaSegundaPesagemComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["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/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-segunda-pesagem/requisicao-descarga-segunda-pesagem.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [_angular_router__WEBPACK_IMPORTED_MODULE_2__["Router"],
            _angular_router__WEBPACK_IMPORTED_MODULE_2__["ActivatedRoute"],
            app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_14__["FuncoesService"],
            app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_18__["MessageService"],
            app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_12__["ConfiguracaoFacade"],
            _requisicao_descarga_service__WEBPACK_IMPORTED_MODULE_6__["RequisicaoDescargaService"],
            app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_9__["LoginService"],
            app_shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_17__["PermissoesUtilsService"]])
    ], RequisicaoDescargaSegundaPesagemComponent);
    return RequisicaoDescargaSegundaPesagemComponent;
}(_requisicao_descarga_permissoes__WEBPACK_IMPORTED_MODULE_5__["RequisicaoDescargaPermissoes"]));



/***/ }),

/***/ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-segunda-pesagem/requisicao-descarga-segunda-pesagem.model.ts":
/*!**************************************************************************************************************************************************************!*\
  !*** ./src/app/pages/especificos/pontafelix/movimentos/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 app_shared_services_base_base_model__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! app/shared/services/base/base.model */ "./src/app/shared/services/base/base.model.ts");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};

var 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;
}(app_shared_services_base_base_model__WEBPACK_IMPORTED_MODULE_0__["BaseModel"]));



/***/ }),

/***/ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-segunda-pesagem/requisicao-descarga-segunda-pesagem.validation.ts":
/*!*******************************************************************************************************************************************************************!*\
  !*** ./src/app/pages/especificos/pontafelix/movimentos/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");
/* harmony import */ var app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! app/shared/services/funcoes/string-utils/string-utils.static.service */ "./src/app/shared/services/funcoes/string-utils/string-utils.static.service.ts");
/* harmony import */ var app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! app/shared/services/funcoes/number-utils/number-utils.static.service */ "./src/app/shared/services/funcoes/number-utils/number-utils.static.service.ts");
/* harmony import */ var _requisicao_descarga_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../requisicao-descarga.constants */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga.constants.ts");
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};




var RequisicaoDescargaSegundaPesagemValidation = /** @class */ (function () {
    function RequisicaoDescargaSegundaPesagemValidation(message, configuracao) {
        var _this = this;
        this.message = message;
        this.configuracao = configuracao;
        this.constantes = new _requisicao_descarga_constants__WEBPACK_IMPORTED_MODULE_3__["RequisicaoDescargaConstants"]();
        this.rs = [];
        this.configuracao.getConfig(this.constantes.listaParam, function () { return _this.loadConfig(); });
    }
    RequisicaoDescargaSegundaPesagemValidation.prototype.loadConfig = function () {
        if (this.configuracao.isLoadConfig()) {
            this.constantes.configUni.obrigaHrOperacao = this.configuracao.boolean("BAL", "ObrigaHrOperacao");
            this.constantes.configUni.codBalCheckList = this.configuracao.boolean("BAL", "CodBalCheckList");
            this.constantes.configUni.obrTernoDesc = this.configuracao.boolean("BAL", "ObrTernoDesc");
            this.constantes.configUni.sPerDesComis = this.configuracao.boolean("BAL", "SPerDesComis");
        }
    };
    RequisicaoDescargaSegundaPesagemValidation.prototype.getValidations = function (data, disabledQuebra) {
        this.rs = [];
        if (this.constantes.configUni.obrigaHrOperacao)
            this.test(this.operadorObrigatorio({ "operador": data.oper2Pes }));
        this.test(this.dtIniOperObrigatoria({ "dtIniOper": data.dtIniOper, "dtFimOper": data.dtFimOper }));
        this.test(this.dtFimOperObrigatoria({ "dtFimOper": data.dtFimOper }));
        if (this.constantes.configUni.codBalCheckList)
            this.test(this.validaBalanca({ "balancaId": data.balancaId }));
        if (this.constantes.configUni.obrTernoDesc)
            this.test(this.ternoIdObrigatorio({ "ternoId": data.ternoId }));
        this.test(this.validaPesoBruto({ "pesoBruto": data.pesoBru }));
        this.test(this.validaPesoTara({ "pesoTara": data.pesoTara, "pesoBruto": data.pesoBru }));
        this.test(this.pesoTaraObrigatorio({ "pesoTara": data.pesoTara }));
        if (this.constantes.configUni.sPerDesComis)
            this.test(this.percDescargaComissionadaObrigatoria({ "percDescargaComissionada": data.percDescargaComissionada }));
        if (!disabledQuebra)
            this.test(this.motivoQuebraIdObrigatorio({ "motivoQuebraId": data.motivoQuebraId }));
        return this.rs.filter(function (v) { return v["isValid"] === false; });
    };
    RequisicaoDescargaSegundaPesagemValidation.prototype.test = function (f) {
        if (!!f)
            this.rs.push(f);
    };
    RequisicaoDescargaSegundaPesagemValidation.prototype.validaPesoBruto = function (params, showError) {
        if (showError === void 0) { showError = false; }
        var r = { "isValid": true, "message": "" };
        if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_2__["NumberUtilsStaticService"].isNotPositive(+params.pesoBruto)) {
            r.isValid = false;
            r.message = "messages.pesoInvalido";
        }
        if (!r.isValid && showError) {
            this.message.warning("titles.requisicaoDescarga", r.message);
        }
        return r;
    };
    RequisicaoDescargaSegundaPesagemValidation.prototype.validaPesoTara = function (params, showError) {
        if (showError === void 0) { showError = false; }
        var r = { "isValid": true, "message": "" };
        if (+params.pesoBru > +params.pesoTara) {
            r.isValid = false;
            r.message = "messages.pesoTaraDeveSerMenorPesoBruto";
        }
        if (!r.isValid && showError) {
            this.message.warning("titles.requisicaoDescarga", r.message);
        }
        return r;
    };
    RequisicaoDescargaSegundaPesagemValidation.prototype.operadorObrigatorio = function (params, showError) {
        if (showError === void 0) { showError = false; }
        var r = { "isValid": true, "message": "" };
        if (app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_1__["StringUtilsStaticService"].isEmpty(params.operador)) {
            r.isValid = false;
            r.message = "messages.operadorNaoInformado";
        }
        if (!r.isValid && showError) {
            this.message.warning("titles.requisicaoDescarga", r.message);
        }
        return r;
    };
    RequisicaoDescargaSegundaPesagemValidation.prototype.trataBalanca = function (params, callBack) {
        var r = this.validaBalanca(params, true);
        if (callBack && (!!r && r.isValid)) {
            callBack();
            return;
        }
    };
    RequisicaoDescargaSegundaPesagemValidation.prototype.validaBalanca = function (params, showError) {
        if (showError === void 0) { showError = false; }
        var r = { "isValid": true, "message": "" };
        if (!(params.balancaId >= 1) && (params.balancaId <= 99)) {
            r.isValid = false;
            r.message = "messages.balancaIdDeveEstarEntre1E99";
        }
        if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_2__["NumberUtilsStaticService"].isNotPositive(params.balancaId)) {
            r.isValid = false;
            r.message = this.message.translate("messages.campoObrigatorio", { name: this.message.translate('labels.balanca') });
        }
        if (!r.isValid && showError) {
            this.message.warning("titles.requisicaoDescarga", r.message);
        }
        return r;
    };
    RequisicaoDescargaSegundaPesagemValidation.prototype.ternoIdObrigatorio = function (params, showError) {
        if (showError === void 0) { showError = false; }
        var r = { "isValid": true, "message": "" };
        if (!app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_2__["NumberUtilsStaticService"].isPositive(params.ternoId)) {
            r.isValid = false;
            r.message = this.message.translate("messages.campoObrigatorio", { name: this.message.translate('labels.terno') });
        }
        if (!r.isValid && showError) {
            this.message.warning("titles.requisicaoDescarga", r.message);
        }
        return r;
    };
    RequisicaoDescargaSegundaPesagemValidation.prototype.pesoTaraObrigatorio = function (params, showError) {
        if (showError === void 0) { showError = false; }
        var r = { "isValid": true, "message": "" };
        if (!app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_2__["NumberUtilsStaticService"].isPositive(params.pesoTara)) {
            r.isValid = false;
            r.message = this.message.translate("messages.campoObrigatorio", { name: this.message.translate('labels.pesoTara') });
        }
        if (!r.isValid && showError) {
            this.message.warning("titles.requisicaoDescarga", r.message);
        }
        return r;
    };
    RequisicaoDescargaSegundaPesagemValidation.prototype.percDescargaComissionadaObrigatoria = function (params, showError) {
        if (showError === void 0) { showError = false; }
        var r = { "isValid": true, "message": "" };
        if (app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_1__["StringUtilsStaticService"].isEmpty(params.percDescargaComissionada)) {
            r.isValid = false;
            r.message = this.message.translate("messages.campoObrigatorio", { name: this.message.translate('labels.percDescargaComissionada') });
        }
        if (!r.isValid && showError) {
            this.message.warning("titles.requisicaoDescarga", r.message);
        }
        return r;
    };
    RequisicaoDescargaSegundaPesagemValidation.prototype.motivoQuebraIdObrigatorio = function (params, showError) {
        if (showError === void 0) { showError = false; }
        var r = { "isValid": true, "message": "" };
        if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_2__["NumberUtilsStaticService"].isNotPositive(params.motivoQuebraId)) {
            r.isValid = false;
            r.message = this.message.translate("messages.campoObrigatorio", { name: this.message.translate('labels.justificativaQuebra') });
        }
        if (!r.isValid && showError) {
            this.message.warning("titles.requisicaoDescarga", r.message);
        }
        return r;
    };
    RequisicaoDescargaSegundaPesagemValidation.prototype.dtIniOperObrigatoria = function (params, showError) {
        if (showError === void 0) { showError = false; }
        var r = { "isValid": true, "message": "" };
        if (!params.dtIniOper || !app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["DateTimeUtilsStaticService"].isDate(params.dtIniOper)) {
            r.isValid = false;
            r.message = this.message.translate("messages.campoObrigatorioOuInvalido", { name: this.message.translate('labels.dtIniOper') });
        }
        if (r.isValid && !!params.dtIniOper && !!params.dtFimOper) {
            var r1 = this.dtFimOperDeveSerMaiorDtIniOper(params, false);
            if (!r1.isValid) {
                r.isValid = false;
                r.message = r1.message;
            }
        }
        if (!r.isValid && showError) {
            this.message.warning("titles.requisicaoDescarga", r.message);
        }
        return r;
    };
    RequisicaoDescargaSegundaPesagemValidation.prototype.dtFimOperObrigatoria = function (params, showError) {
        if (showError === void 0) { showError = false; }
        var r = { "isValid": true, "message": "" };
        if (!params.dtFimOper || !app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["DateTimeUtilsStaticService"].isDate(params.dtFimOper)) {
            r.isValid = false;
            r.message = this.message.translate("messages.campoObrigatorioOuInvalido", { name: this.message.translate('labels.dtFimOper') });
        }
        if (r.isValid && !!params.dtFimOper) {
            var r1 = this.dtFimOperDeveSerMenorDataAtual(params, false);
            if (!r1.isValid) {
                r.isValid = false;
                r.message = r1.message;
            }
        }
        if (!r.isValid && showError) {
            this.message.warning("titles.requisicaoDescarga", r.message);
        }
        return r;
    };
    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 r;
        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/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga.constants.ts":
/*!**************************************************************************************************************!*\
  !*** ./src/app/pages/especificos/pontafelix/movimentos/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 = 375143;
        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.2Pesagem" },
            { sisFormularioId: this.sisFormularioId, libRotina: 7, acao: "labels.cancelarPesagem" },
            { sisFormularioId: this.sisFormularioId, libRotina: 8, acao: "labels.alterarDatas" },
            { sisFormularioId: this.sisFormularioId, libRotina: 9, acao: "labels.alterarDados" },
            { sisFormularioId: this.sisFormularioId, libRotina: 10, acao: "labels.visualizarFotoOCR" },
            { sisFormularioId: this.sisFormularioId, libRotina: 11, acao: "labels.todosCampos" },
            { sisFormularioId: this.sisFormularioId, libRotina: 12, acao: "labels.inicioOperacao" },
            { sisFormularioId: this.sisFormularioId, libRotina: 13, acao: "labels.fimOperacao" },
            { sisFormularioId: this.sisFormularioId, libRotina: 14, acao: "labels.permissoes" }
        ];
        this.sisSistemaId = "BAL";
        this.nomeForm = "titles.requisicaoDescarga";
        this.reportId = "PON0000";
        this.reportTitulo = { "titulo": "Requisição Descarga", "subTitulo": "" };
        this.configUni = {
            solMotCancEVePesagem: false,
            obrChaveNFeEnt: false
        };
        this.configBal = {
            codBalCheckList: false,
            ctrSaldoContabil: "N",
            pesagemAutomatica: false,
            balCodig: 0,
            bl2Codig: 0,
            bl3Codig: 0,
            validaMobile2Pes: false,
            calculaTotalNF: false,
            infPesoFob: false,
            sPerDesComis: false,
            permissaoDatasOCD: false,
            justAtraso: false,
            tolTara: 0,
            justDescarga: false,
            ptJustDescargaR: 0,
            ptJustDescargaF: 0,
            justDescargaSb: false,
            impTickAposLib: false,
            boletimOcorrencia: false,
            dtOperIgualPes: false,
            validaPesagem: false,
            permiteAltShipment: false,
            obrVisualizarDocMoto: false,
            planejTanque: false,
            vrfNfExisteDesc: false,
            ocrPesagem: false,
            apresConfOcrEnt: false,
            difMaxNFDtAtual: 0,
            obrigaHrOperacao: false,
            obrTernoDesc: false,
            permAfePesoTara: false,
            pesoMaxFerBO: 0,
            solMotivoExcReq: false,
            balValLocalOper: false,
            nAltDepositoLibVeic: false,
            intCta: false,
            intCtaTipo: "",
            intCtaVersao: 0,
            digFlag: false,
            iProNetAtivo: false,
            easyAtivo: false,
            geoFlag: false,
            seaFlag: false,
            gipOcr: false,
            rtsFlag: false,
            rtsOCRLib: false,
            spheAtivo: false,
            primeAtivo: false,
            waccessAtivo: false,
            foccosAtivo: false,
            spheEq: "",
            waccessE: "",
            digChkLib: false,
            rtsLibOD: false,
            geoCancela: false
        };
        this.configWeb = {
            cWebModBOReqDescarga: "",
            cWebModTicketD: "",
            cWebModRequisicaoD: "",
            prefixoRelEspecifico: ""
        };
        this.configCtr = {
            dtSeguro: null,
            valDepositoOSG: false,
            tpEmissaoEtiqueta: ""
        };
        this.configSto = {
            intGuardian: ""
        };
        this.configCtv = {
            observPortal: false,
            naoPermiteAlterarChkLst: false,
            importaDANFE: false,
            itemNoCheckList: false,
            solicitaPlanejEv: false,
            checkListPesa: false,
            habCampoShipment: false,
            guaCancela2Pes: false,
            intProLock: false
        };
        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",
                    "PermiteAltShipment",
                    "ObrVisualizarDocMoto",
                    "PlanejTanque",
                    "VrfNfExisteDesc",
                    "OcrPesagem",
                    "ApresConfOcrEnt",
                    "DifMaxNFDtAtual",
                    "ObrigaHrOperacao",
                    "ObrTernoDesc",
                    "ValidaPesagem",
                    "PesoMaxFerBO",
                    "SolMotivoExcReq",
                    "BalValLocalOper",
                    "NAltDepositoLibVeic",
                    "IntCta",
                    "IntCtaTipo",
                    "IntCtaVersao",
                    "DigFlag",
                    "IProNetAtivo",
                    "EasyAtivo",
                    "GeoFlag",
                    "SeaFlag",
                    "GipOcr",
                    "RtsFlag",
                    "RtsOCRLib",
                    "SpheAtivo",
                    "PrimeAtivo",
                    "WaccessAtivo",
                    "FoccosAtivo",
                    "DigChkLib",
                    "GeoCancela"
                ]
            },
            { 'sistema': 'CTV', 'parametros': ["ObservPortal", "ImportaDANFE", "CheckListPesa", "SolicitaPlanejEv", "HabCampoShipment", "GuaCancela2Pes", "IntProLock"] },
            { 'sistema': 'UNI', 'parametros': ["ObrChaveNFeEnt", "solMotCancEVePesagem"] },
            { 'sistema': 'WEB', 'parametros': ["CWebModRequisicaoD", "CWebModTicketD", "PrefixoRelEspecifico"] },
            { 'sistema': 'CTR', 'parametros': ["DtSeguro", "ValDepositoOSG", "TpEmissaoEtiqueta"] },
            { 'sistema': 'STO', 'parametros': ["IntGuardian"] }
        ];
        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', disabled: true },
            { 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' },
            { title: 'visualizarFotoOCR', action: 'visualizarFotoOCR', icon: "fa fa-camera", exibeButton: true, eximeMenu: true, menuName: 'Movimento' }
        ];
        this.listaForm = [
            { title: 'Editar', action: 'edit', icon: "icon-pencil", exibeButton: true, eximeMenu: true, menuName: 'Arquivo' },
            { title: 'Voltar', action: 'back', icon: "icon-arrow-left", exibeButton: true, eximeMenu: true, menuName: 'Arquivo' },
            { title: 'AlterarDados', action: 'alterarDados', icon: "icon-server", 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' },
        ];
        this.listaAlterarDadosItens = [
            { title: 'Voltar', action: 'back', icon: "icon-arrow-left", exibeButton: true, eximeMenu: true, menuName: 'Arquivo' },
        ];
    }
    return RequisicaoDescargaConstants;
}());



/***/ }),

/***/ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga.deactivate.guard.ts":
/*!*********************************************************************************************************************!*\
  !*** ./src/app/pages/especificos/pontafelix/movimentos/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/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga.model.ts":
/*!**********************************************************************************************************!*\
  !*** ./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga.model.ts ***!
  \**********************************************************************************************************/
/*! exports provided: RequisicaoDescarga, EntradaVeiculo, PlanejamentoCarga, RequisicaoDescargaFilterReport, BalPesoTaraDto, RequisicaoDescargaPesaDto, RequisicaoDescargaOcrPesagemDto, RequisicaoDescargaPesagemVeicDesmembradoDto, RequisicaoDescargaMovimentoOperacionalLog, RequisicaoDescargaRelImpressaoEtiquetaFilter, ReqDescargaImpressaoEtiquetaArquivoGerado */
/***/ (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__, "EntradaVeiculo", function() { return EntradaVeiculo; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PlanejamentoCarga", function() { return PlanejamentoCarga; });
/* 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 export (binding) */ __webpack_require__.d(__webpack_exports__, "RequisicaoDescargaOcrPesagemDto", function() { return RequisicaoDescargaOcrPesagemDto; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RequisicaoDescargaPesagemVeicDesmembradoDto", function() { return RequisicaoDescargaPesagemVeicDesmembradoDto; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RequisicaoDescargaMovimentoOperacionalLog", function() { return RequisicaoDescargaMovimentoOperacionalLog; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RequisicaoDescargaRelImpressaoEtiquetaFilter", function() { return RequisicaoDescargaRelImpressaoEtiquetaFilter; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ReqDescargaImpressaoEtiquetaArquivoGerado", function() { return ReqDescargaImpressaoEtiquetaArquivoGerado; });
/* harmony import */ var app_shared_services_base_base_model__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! app/shared/services/base/base.model */ "./src/app/shared/services/base/base.model.ts");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};

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

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

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

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;
}());

var RequisicaoDescargaOcrPesagemDto = /** @class */ (function () {
    function RequisicaoDescargaOcrPesagemDto() {
        this.iErro = 0;
        this.iOcr = 0;
        this.ocrRtsGate = 0;
        this.ocrRtsSessao = 0;
        this.placaDig1 = "";
        this.placaDig2 = "";
        this.placaDig3 = "";
        this.vPlaca1 = "";
        this.vPlaca2 = "";
        this.vPlaca3 = "";
        this.vPlaca4 = "";
        this.vPlaca5 = "";
        this.vPlaca6 = "";
    }
    return RequisicaoDescargaOcrPesagemDto;
}());

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

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

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

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



/***/ }),

/***/ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga.module.ts":
/*!***********************************************************************************************************!*\
  !*** ./src/app/pages/especificos/pontafelix/movimentos/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 _requisicao_descarga_alterar_dados_requisicao_descarga_alterar_dados_component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./requisicao-descarga-alterar-dados/requisicao-descarga-alterar-dados.component */ "./src/app/pages/especificos/pontafelix/movimentos/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_2__ = __webpack_require__(/*! ./requisicao-descarga-alterar-datas/requisicao-descarga-alterar-datas.component */ "./src/app/pages/especificos/pontafelix/movimentos/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_3__ = __webpack_require__(/*! ./requisicao-descarga-filter/requisicao-descarga-filter.component */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-filter/requisicao-descarga-filter.component.ts");
/* harmony import */ var _requisicao_descarga_form_requisicao_descarga_form_component__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./requisicao-descarga-form/requisicao-descarga-form.component */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-form/requisicao-descarga-form.component.ts");
/* harmony import */ var _requisicao_descarga_index_requisicao_descarga_index_component__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./requisicao-descarga-index/requisicao-descarga-index.component */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-index/requisicao-descarga-index.component.ts");
/* harmony import */ var _requisicao_descarga_item_requisicao_descarga_item_component__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./requisicao-descarga-item/requisicao-descarga-item.component */ "./src/app/pages/especificos/pontafelix/movimentos/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_7__ = __webpack_require__(/*! ./requisicao-descarga-pesagem-anterior/requisicao-descarga-pesagem-anterior.component */ "./src/app/pages/especificos/pontafelix/movimentos/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_8__ = __webpack_require__(/*! ./requisicao-descarga-report/requisicao-descarga-report.component */ "./src/app/pages/especificos/pontafelix/movimentos/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_9__ = __webpack_require__(/*! ./requisicao-descarga-segunda-pesagem/requisicao-descarga-segunda-pesagem.component */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-segunda-pesagem/requisicao-descarga-segunda-pesagem.component.ts");
/* harmony import */ var _requisicao_descarga_deactivate_guard__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./requisicao-descarga.deactivate.guard */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga.deactivate.guard.ts");
/* harmony import */ var _requisicao_descarga_routing_module__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./requisicao-descarga.routing.module */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga.routing.module.ts");
/* harmony import */ var app_shared_shared_module__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! app/shared/shared.module */ "./src/app/shared/shared.module.ts");
/* harmony import */ var _requisicao_descarga_alterar_dados_itens_requisicao_descarga_alterar_dados_itens_component__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./requisicao-descarga-alterar-dados-itens/requisicao-descarga-alterar-dados-itens.component */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-alterar-dados-itens/requisicao-descarga-alterar-dados-itens.component.ts");
/* harmony import */ var _requisicao_descarga_pesagem_veiculo_desmembrado_requisicao_descarga_pesagem_veiculo_desmembrado_component__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./requisicao-descarga-pesagem-veiculo-desmembrado/requisicao-descarga-pesagem-veiculo-desmembrado.component */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-pesagem-veiculo-desmembrado/requisicao-descarga-pesagem-veiculo-desmembrado.component.ts");
/* harmony import */ var _requisicao_descarga_print_etiquetas_modal_requisicao_descarga_print_etiquetas_modal_component__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./requisicao-descarga-print-etiquetas-modal/requisicao-descarga-print-etiquetas-modal.component */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-print-etiquetas-modal/requisicao-descarga-print-etiquetas-modal.component.ts");
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};
















var RequisicaoDescargaModule = /** @class */ (function () {
    function RequisicaoDescargaModule() {
    }
    RequisicaoDescargaModule = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"])({
            imports: [
                app_shared_shared_module__WEBPACK_IMPORTED_MODULE_12__["SharedModule"],
                _requisicao_descarga_routing_module__WEBPACK_IMPORTED_MODULE_11__["RequisicaoDescargaRoutingModule"]
            ],
            declarations: [
                _requisicao_descarga_index_requisicao_descarga_index_component__WEBPACK_IMPORTED_MODULE_5__["RequisicaoDescargaIndexComponent"],
                _requisicao_descarga_form_requisicao_descarga_form_component__WEBPACK_IMPORTED_MODULE_4__["RequisicaoDescargaFormComponent"],
                _requisicao_descarga_filter_requisicao_descarga_filter_component__WEBPACK_IMPORTED_MODULE_3__["RequisicaoDescargaFilterComponent"],
                _requisicao_descarga_item_requisicao_descarga_item_component__WEBPACK_IMPORTED_MODULE_6__["RequisicaoDescargaItemComponent"],
                _requisicao_descarga_segunda_pesagem_requisicao_descarga_segunda_pesagem_component__WEBPACK_IMPORTED_MODULE_9__["RequisicaoDescargaSegundaPesagemComponent"],
                _requisicao_descarga_alterar_dados_requisicao_descarga_alterar_dados_component__WEBPACK_IMPORTED_MODULE_1__["RequisicaoDescargaAlterarDadosComponent"],
                _requisicao_descarga_alterar_datas_requisicao_descarga_alterar_datas_component__WEBPACK_IMPORTED_MODULE_2__["RequisicaoDescargaAlterarDatasComponent"],
                _requisicao_descarga_report_requisicao_descarga_report_component__WEBPACK_IMPORTED_MODULE_8__["RequisicaoDescargaReportComponent"],
                _requisicao_descarga_pesagem_anterior_requisicao_descarga_pesagem_anterior_component__WEBPACK_IMPORTED_MODULE_7__["RequisicaoDescargaPesagemAnteriorComponent"],
                _requisicao_descarga_alterar_dados_itens_requisicao_descarga_alterar_dados_itens_component__WEBPACK_IMPORTED_MODULE_13__["RequisicaoDescargaAlterarDadosItensComponent"],
                _requisicao_descarga_pesagem_veiculo_desmembrado_requisicao_descarga_pesagem_veiculo_desmembrado_component__WEBPACK_IMPORTED_MODULE_14__["RequisicaoDescargaPesagemVeiculoDesmembradoComponent"],
                _requisicao_descarga_print_etiquetas_modal_requisicao_descarga_print_etiquetas_modal_component__WEBPACK_IMPORTED_MODULE_15__["RequisicaoDescargaPrintEtiquetasModalComponent"]
            ],
            exports: [
                _requisicao_descarga_index_requisicao_descarga_index_component__WEBPACK_IMPORTED_MODULE_5__["RequisicaoDescargaIndexComponent"],
                _requisicao_descarga_form_requisicao_descarga_form_component__WEBPACK_IMPORTED_MODULE_4__["RequisicaoDescargaFormComponent"],
                _requisicao_descarga_filter_requisicao_descarga_filter_component__WEBPACK_IMPORTED_MODULE_3__["RequisicaoDescargaFilterComponent"],
                _requisicao_descarga_item_requisicao_descarga_item_component__WEBPACK_IMPORTED_MODULE_6__["RequisicaoDescargaItemComponent"],
                _requisicao_descarga_segunda_pesagem_requisicao_descarga_segunda_pesagem_component__WEBPACK_IMPORTED_MODULE_9__["RequisicaoDescargaSegundaPesagemComponent"],
                _requisicao_descarga_alterar_dados_requisicao_descarga_alterar_dados_component__WEBPACK_IMPORTED_MODULE_1__["RequisicaoDescargaAlterarDadosComponent"],
                _requisicao_descarga_alterar_datas_requisicao_descarga_alterar_datas_component__WEBPACK_IMPORTED_MODULE_2__["RequisicaoDescargaAlterarDatasComponent"],
                _requisicao_descarga_report_requisicao_descarga_report_component__WEBPACK_IMPORTED_MODULE_8__["RequisicaoDescargaReportComponent"],
                _requisicao_descarga_pesagem_anterior_requisicao_descarga_pesagem_anterior_component__WEBPACK_IMPORTED_MODULE_7__["RequisicaoDescargaPesagemAnteriorComponent"],
                _requisicao_descarga_alterar_dados_itens_requisicao_descarga_alterar_dados_itens_component__WEBPACK_IMPORTED_MODULE_13__["RequisicaoDescargaAlterarDadosItensComponent"],
                _requisicao_descarga_pesagem_veiculo_desmembrado_requisicao_descarga_pesagem_veiculo_desmembrado_component__WEBPACK_IMPORTED_MODULE_14__["RequisicaoDescargaPesagemVeiculoDesmembradoComponent"],
                _requisicao_descarga_print_etiquetas_modal_requisicao_descarga_print_etiquetas_modal_component__WEBPACK_IMPORTED_MODULE_15__["RequisicaoDescargaPrintEtiquetasModalComponent"]
            ],
            providers: [_requisicao_descarga_deactivate_guard__WEBPACK_IMPORTED_MODULE_10__["RequisicaoDescargaFormCandeactivateGuard"]]
        })
    ], RequisicaoDescargaModule);
    return RequisicaoDescargaModule;
}());



/***/ }),

/***/ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga.permissoes.ts":
/*!***************************************************************************************************************!*\
  !*** ./src/app/pages/especificos/pontafelix/movimentos/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 app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! app/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 = app_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 "alterarDadosItens": {
                    _this.alterarDadosItens();
                    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");
        app_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.alterarDadosItens = 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?');
    };
    RequisicaoDescargaPermissoes.prototype.buttonDisabled = function (lista, action, disabled) {
        var i = this.constantes[lista].findIndex(function (c) { return c.action === action; });
        this.constantes[lista][i]['disabled'] = disabled;
    };
    return RequisicaoDescargaPermissoes;
}());



/***/ }),

/***/ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga.routing.module.ts":
/*!*******************************************************************************************************************!*\
  !*** ./src/app/pages/especificos/pontafelix/movimentos/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/especificos/pontafelix/movimentos/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/especificos/pontafelix/movimentos/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/especificos/pontafelix/movimentos/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/especificos/pontafelix/movimentos/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/especificos/pontafelix/movimentos/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/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga.deactivate.guard.ts");
/* harmony import */ var _requisicao_descarga_alterar_dados_itens_requisicao_descarga_alterar_dados_itens_component__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./requisicao-descarga-alterar-dados-itens/requisicao-descarga-alterar-dados-itens.component */ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-alterar-dados-itens/requisicao-descarga-alterar-dados-itens.component.ts");
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};










var MRoutes = [
    {
        path: "",
        component: _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/:origem/: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 }
        }
    },
    {
        path: "alterarDadosItem/:id",
        component: _requisicao_descarga_alterar_dados_itens_requisicao_descarga_alterar_dados_itens_component__WEBPACK_IMPORTED_MODULE_9__["RequisicaoDescargaAlterarDadosItensComponent"],
        data: {
            breadcrumb: "RequisicaoDescarga",
            breadcrumbSub: "AlterarDadosItem",
            formParams: { action: app_config_enumerables__WEBPACK_IMPORTED_MODULE_2__["ActionForm"].index }
        }
    }
];
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;
}());



/***/ }),

/***/ "./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga.service.ts":
/*!************************************************************************************************************!*\
  !*** ./src/app/pages/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga.service.ts ***!
  \************************************************************************************************************/
/*! exports provided: RequisicaoDescargaService */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RequisicaoDescargaService", function() { return RequisicaoDescargaService; });
/* harmony import */ var _angular_common_http__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/common/http */ "./node_modules/@angular/common/fesm5/http.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm5/operators/index.js");
/* 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/especificos/pontafelix/movimentos/requisicao-descarga/requisicao-descarga-filter/requisicao-descarga-filter.model.ts");
/* harmony import */ var environments_environment__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! environments/environment */ "./src/environments/environment.ts");
/* harmony import */ var app_app_error_handler__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! app/app.error-handler */ "./src/app/app.error-handler.ts");
/* harmony import */ var app_shared_services_base_specifics_base_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! app/shared/services/base/specifics.base.service */ "./src/app/shared/services/base/specifics.base.service.ts");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (undefined && undefined.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};







var RequisicaoDescargaService = /** @class */ (function (_super) {
    __extends(RequisicaoDescargaService, _super);
    function RequisicaoDescargaService(http) {
        var _this = _super.call(this, http, "pontafelix/requisicaoDescarga") || this;
        _this.http = http;
        _this.filtro = new _requisicao_descarga_filter_requisicao_descarga_filter_model__WEBPACK_IMPORTED_MODULE_3__["RequisicaoDescargaFilter"]();
        _this.dados = [];
        _this.visualizouDoctosMotorista = false;
        _this.abaAtual = "D";
        _this.balancaOK = false;
        return _this;
    }
    RequisicaoDescargaService.prototype.getByFilter = function (filtro) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_4__["environment"].specifics_service_url + "/api/v1/pontafelix/requisicaoDescarga/getByFilter", filtro)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_5__["ErrorHandler"].handleError));
    };
    RequisicaoDescargaService.prototype.segundaPesagem = function (data) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_4__["environment"].specifics_service_url + "/api/v1/pontafelix/requisicaoDescarga/segundaPesagem", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_5__["ErrorHandler"].handleError));
    };
    RequisicaoDescargaService.prototype.requisicaoDescargaTmpGrava = function (filter) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_4__["environment"].specifics_service_url + "/api/v1/pontafelix/requisicaoDescarga/requisicaoDescargaTmpGrava", filter)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_5__["ErrorHandler"].handleError));
    };
    RequisicaoDescargaService.prototype.corpWebStoContratoBloqueado = function (data) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_4__["environment"].service_url + "/api/v1/balanca/requisicaoDescarga/corpWebStoContratoBloqueado", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_5__["ErrorHandler"].handleError));
    };
    RequisicaoDescargaService.prototype.validaSePodeAlterar = function (filter) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_4__["environment"].specifics_service_url + "/api/v1/pontafelix/requisicaoDescarga/validaSePodeAlterar", filter)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_5__["ErrorHandler"].handleError));
    };
    RequisicaoDescargaService.prototype.validaLocalDeOperacao = function (filter) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_4__["environment"].specifics_service_url + "/api/v1/pontafelix/requisicaoDescarga/validaLocalDeOperacao", filter)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_5__["ErrorHandler"].handleError));
    };
    RequisicaoDescargaService.prototype.validaSePodeExcluir = function (filter) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_4__["environment"].specifics_service_url + "/api/v1/pontafelix/requisicaoDescarga/validaSePodeExcluir", filter)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_5__["ErrorHandler"].handleError));
    };
    RequisicaoDescargaService.prototype.requisicaoDescargaItemExclui = function (filter) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_4__["environment"].specifics_service_url + "/api/v1/pontafelix/requisicaoDescarga/requisicaoDescargaItemExclui", filter)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_5__["ErrorHandler"].handleError));
    };
    RequisicaoDescargaService.prototype.requisicaoDescargaExclui = function (filter) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_4__["environment"].specifics_service_url + "/api/v1/pontafelix/requisicaoDescarga/requisicaoDescargaExclui", filter)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_5__["ErrorHandler"].handleError));
    };
    RequisicaoDescargaService.prototype.verifyCheckListId = function (codChecklist) {
        return this.http
            .get(environments_environment__WEBPACK_IMPORTED_MODULE_4__["environment"].specifics_service_url + "/api/v1/pontafelix/requisicaoDescarga/verifyCheckListId/" + codChecklist)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_5__["ErrorHandler"].handleError));
    };
    RequisicaoDescargaService.prototype.balPesoTara = function (filter) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_4__["environment"].specifics_service_url + "/api/v1/pontafelix/requisicaoDescarga/balPesoTara", filter)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_5__["ErrorHandler"].handleError));
    };
    RequisicaoDescargaService.prototype.getRequisicaoDescargaPesa = function (regRequisicao) {
        return this.http
            .get(environments_environment__WEBPACK_IMPORTED_MODULE_4__["environment"].specifics_service_url + "/api/v1/pontafelix/requisicaoDescarga/getRequisicaoDescargaPesa/" + regRequisicao)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_5__["ErrorHandler"].handleError));
    };
    RequisicaoDescargaService.prototype.stoVrfValidacaoMobile = function (filter) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_4__["environment"].service_url + "/api/v1/balanca/requisicaoDescarga/stoVrfValidacaoMobile", filter)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_5__["ErrorHandler"].handleError));
    };
    RequisicaoDescargaService.prototype.podeCancelar = function (filter) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_4__["environment"].specifics_service_url + "/api/v1/pontafelix/requisicaoDescarga/podeCancelar", filter)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_5__["ErrorHandler"].handleError));
    };
    RequisicaoDescargaService.prototype.verifSeExisteProcessoPendente = function (filter) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_4__["environment"].specifics_service_url + "/api/v1/pontafelix/requisicaoDescarga/verifSeExisteProcessoPendente", filter)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_5__["ErrorHandler"].handleError));
    };
    RequisicaoDescargaService.prototype.cancelaPesagem = function (filter) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_4__["environment"].specifics_service_url + "/api/v1/pontafelix/requisicaoDescarga/cancelaPesagem", filter)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_5__["ErrorHandler"].handleError));
    };
    RequisicaoDescargaService.prototype.consultaAlteraDatas = function (requisicaoDescargaId) {
        return this.http
            .get(environments_environment__WEBPACK_IMPORTED_MODULE_4__["environment"].specifics_service_url + "/api/v1/pontafelix/requisicaoDescarga/alterarDatas/" + requisicaoDescargaId)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_5__["ErrorHandler"].handleError));
    };
    RequisicaoDescargaService.prototype.alterarDatas = function (filter) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_4__["environment"].specifics_service_url + "/api/v1/pontafelix/requisicaoDescarga/alterarDatas", filter)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_5__["ErrorHandler"].handleError));
    };
    RequisicaoDescargaService.prototype.consultaAlteraDados = function (requisicaoDescargaId) {
        return this.http
            .get(environments_environment__WEBPACK_IMPORTED_MODULE_4__["environment"].specifics_service_url + "/api/v1/pontafelix/requisicaoDescarga/alterarDados/" + requisicaoDescargaId)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_5__["ErrorHandler"].handleError));
    };
    RequisicaoDescargaService.prototype.alterarDados = function (filter) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_4__["environment"].specifics_service_url + "/api/v1/pontafelix/requisicaoDescarga/alterarDados", filter)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_5__["ErrorHandler"].handleError));
    };
    RequisicaoDescargaService.prototype.consultaAlteraDadosItens = function (requisicaoDescargaId) {
        return this.http
            .get(environments_environment__WEBPACK_IMPORTED_MODULE_4__["environment"].specifics_service_url + "/api/v1/pontafelix/requisicaoDescarga/alterarDadosItens/" + requisicaoDescargaId)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_5__["ErrorHandler"].handleError));
    };
    RequisicaoDescargaService.prototype.alterarDadosItens = function (dados) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_4__["environment"].specifics_service_url + "/api/v1/pontafelix/requisicaoDescarga/alterarDadosItens", dados)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_5__["ErrorHandler"].handleError));
    };
    RequisicaoDescargaService.prototype.consultaASegundaPesagem = function (requisicaoDescargaId) {
        return this.http
            .get(environments_environment__WEBPACK_IMPORTED_MODULE_4__["environment"].specifics_service_url + "/api/v1/pontafelix/requisicaoDescarga/segundaPesagem/" + requisicaoDescargaId)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_5__["ErrorHandler"].handleError));
    };
    RequisicaoDescargaService.prototype.verificaSeDocumentoJaExisteNaTmp = function (data) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_4__["environment"].specifics_service_url + "/api/v1/pontafelix/requisicaoDescarga/verificaSeDocumentoJaExisteNaTmp", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_5__["ErrorHandler"].handleError));
    };
    RequisicaoDescargaService.prototype.verificaSeDocumentoJaExisteNaTabelaFinal = function (data) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_4__["environment"].specifics_service_url + "/api/v1/pontafelix/requisicaoDescarga/verificaSeDocumentoJaExisteNaTabelaFinal", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_5__["ErrorHandler"].handleError));
    };
    RequisicaoDescargaService.prototype.verificaSeNotaJaCadastrada = function (data) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_4__["environment"].specifics_service_url + "/api/v1/pontafelix/requisicaoDescarga/verificaSeNotaJaCadastrada", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_5__["ErrorHandler"].handleError));
    };
    RequisicaoDescargaService.prototype.getStatusPesagem = function (requisicaoDescargaId) {
        return this.http
            .get(environments_environment__WEBPACK_IMPORTED_MODULE_4__["environment"].specifics_service_url + "/api/v1/pontafelix/requisicaoDescarga/getStatusPesagem/" + requisicaoDescargaId)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_5__["ErrorHandler"].handleError));
    };
    RequisicaoDescargaService.prototype.getRequisicaoDescargaItem = function (requisicaoDescargaId) {
        return this.http
            .get(environments_environment__WEBPACK_IMPORTED_MODULE_4__["environment"].service_url + "/api/v1/balanca/requisicaoDescargaItem/" + requisicaoDescargaId)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_5__["ErrorHandler"].handleError));
    };
    RequisicaoDescargaService.prototype.cancelarTmp = function (filter) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_4__["environment"].specifics_service_url + "/api/v1/pontafelix/requisicaoDescarga/cancelarTmp", filter)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_5__["ErrorHandler"].handleError));
    };
    RequisicaoDescargaService.prototype.getTratarJustificativaPTara = function (requisicaoDescargaId) {
        return this.http
            .get(environments_environment__WEBPACK_IMPORTED_MODULE_4__["environment"].specifics_service_url + "/api/v1/pontafelix/requisicaoDescarga/getTratarJustificativaPTara/" + requisicaoDescargaId)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_5__["ErrorHandler"].handleError));
    };
    RequisicaoDescargaService.prototype.getMovimentoOperacionalLog = function (requisicaoDescargaId) {
        return this.http
            .get(environments_environment__WEBPACK_IMPORTED_MODULE_4__["environment"].specifics_service_url + "/api/v1/pontafelix/requisicaoDescarga/getMovimentoOperacionalLog/" + requisicaoDescargaId)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_5__["ErrorHandler"].handleError));
    };
    RequisicaoDescargaService.prototype.getLoteEtiqueta = function (item) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_4__["environment"].specifics_service_url + "/api/v1/pontafelix/requisicaoDescarga/getLoteEtiqueta", item)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_5__["ErrorHandler"].handleError));
    };
    RequisicaoDescargaService.prototype.relImpressaoEtiqueta = function (filter) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_4__["environment"].specifics_service_url + "/api/v1/pontafelix/requisicaoDescarga/relImpressaoEtiqueta", filter)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_5__["ErrorHandler"].handleError));
    };
    RequisicaoDescargaService.ctorParameters = function () { return [
        { type: _angular_common_http__WEBPACK_IMPORTED_MODULE_0__["HttpClient"] }
    ]; };
    RequisicaoDescargaService = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"])({
            providedIn: "root"
        }),
        __metadata("design:paramtypes", [_angular_common_http__WEBPACK_IMPORTED_MODULE_0__["HttpClient"]])
    ], RequisicaoDescargaService);
    return RequisicaoDescargaService;
}(app_shared_services_base_specifics_base_service__WEBPACK_IMPORTED_MODULE_6__["SpecificsBaseService"]));



/***/ })

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