(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["app-pages-especificos-cli-configuracoes-comercial-comercial-module"],{

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/cli/configuracoes/comercial/comercial-form/comercial-form.component.html":
/*!**************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/cli/configuracoes/comercial/comercial-form/comercial-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\" [itemData]=\"data.filialId\"\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            <app-form-legenda></app-form-legenda>\n            <div class=\"card-body widget-body\">\n                <form class=\"form\" #f=\"ngForm\" (ngSubmit)=\"_onSubmit(f)\">\n                    <app-validacoes></app-validacoes>\n                    <div class=\"row\">\n                        <div class=\"col-lg-6 col-md-6\">\n                            <div class=\"form-group form-group-sm\">\n                                <app-pesquisa-destinatario id=\"clienteRumo\" name=\"clienteRumo\" modalTitle=\"clienteRumo\"\n                                    label=\"clienteRumo\" [(ngModel)]=\"data.codDestRumo\" showInscricao=\"false\"\n                                    showCgcCpf=\"false\" [inSelected]=\"data.cliente\">\n                                </app-pesquisa-destinatario>\n                            </div>\n                        </div>\n                    </div>\n                    <div class=\"clearfix\">&nbsp;</div>\n                    <div class=\"row\">\n                        <div class=\"col-lg-12\">\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<app-permissoes-rotina [constantes]=\"constantes\"></app-permissoes-rotina>\n<app-liberar-acesso-supervisor></app-liberar-acesso-supervisor>");

/***/ }),

/***/ "./src/app/pages/especificos/cli/configuracoes/comercial/comercial-form/comercial-form.component.ts":
/*!**********************************************************************************************************!*\
  !*** ./src/app/pages/especificos/cli/configuracoes/comercial/comercial-form/comercial-form.component.ts ***!
  \**********************************************************************************************************/
/*! exports provided: ComercialFormComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ComercialFormComponent", function() { return ComercialFormComponent; });
/* 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_components_corporate_base_base_permissoes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! app/shared/components/corporate/base/base.permissoes */ "./src/app/shared/components/corporate/base/base.permissoes.ts");
/* harmony import */ var app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! app/shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_3__ = __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_4__ = __webpack_require__(/*! app/shared/services/funcoes/funcoes.service */ "./src/app/shared/services/funcoes/funcoes.service.ts");
/* harmony import */ var app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_5__ = __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_6__ = __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_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_configuracao_configuracao_model__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! app/shared/services/funcoes/configuracao/configuracao.model */ "./src/app/shared/services/funcoes/configuracao/configuracao.model.ts");
/* harmony import */ var _comercial_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../comercial.constants */ "./src/app/pages/especificos/cli/configuracoes/comercial/comercial.constants.ts");
/* harmony import */ var _comercial_model__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../comercial.model */ "./src/app/pages/especificos/cli/configuracoes/comercial/comercial.model.ts");
/* harmony import */ var app_pages_cadastro_destinatario_destinatario_service__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! app/pages/cadastro/destinatario/destinatario.service */ "./src/app/pages/cadastro/destinatario/destinatario.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 ComercialFormComponent = /** @class */ (function (_super) {
    __extends(ComercialFormComponent, _super);
    function ComercialFormComponent(messageService, configuracao, funcoesService, loginService, permissoesUtils, funcoes, destinatarioService) {
        var _this = _super.call(this, new _comercial_constants__WEBPACK_IMPORTED_MODULE_9__["ComercialConstants"](), funcoesService) || this;
        _this.messageService = messageService;
        _this.configuracao = configuracao;
        _this.funcoesService = funcoesService;
        _this.loginService = loginService;
        _this.permissoesUtils = permissoesUtils;
        _this.funcoes = funcoes;
        _this.destinatarioService = destinatarioService;
        _this.data = new _comercial_model__WEBPACK_IMPORTED_MODULE_10__["Comercial"]();
        _this.mensagens = [];
        _this.constantes = new _comercial_constants__WEBPACK_IMPORTED_MODULE_9__["ComercialConstants"]();
        _this.loadConfig = function () {
            if (_this.configuracao.isLoadConfig()) {
                _this.data.filialId = _this.loginService.getLogin().filialId;
                _this.data.codDestRumo = _this.configuracao.number("REL", "CodDestRumo");
                _this.trataDest();
            }
        };
        return _this;
    }
    ComercialFormComponent.prototype.ngOnInit = function () {
        var _this = this;
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 1, function () {
            _this.configuracao.getConfig({
                codRotina: _this.constantes.sisFormularioId,
                configs: _this.constantes.configuracoes
            }, _this.loadConfig);
        }, function () { return _this.permissoesUtils.back(); }, true);
    };
    ComercialFormComponent.prototype._onSubmit = function (form) {
        var _this = this;
        app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_7__["EventEmitterService"].get("formError").emit(form);
        if (form.invalid)
            return;
        this.messageService.confirm('titles.comercial', 'messages.updateConfigConfirm', null, function () { return _this.onSubmit(); });
    };
    ComercialFormComponent.prototype.executaOnSubmit = function () {
        var _this = this;
        this.messageService.confirm('titles.comercial', 'messages.updateConfigConfirm', null, function () { return _this.onSubmit(); });
    };
    ComercialFormComponent.prototype.onSubmit = function () {
        var _this = this;
        var object = new app_shared_services_funcoes_configuracao_configuracao_model__WEBPACK_IMPORTED_MODULE_8__["Config"](this.constantes.sisFormularioId);
        object.setConfig(this.data.filialId, 'REL', 'CodDestRumo', this.data.codDestRumo, 'I');
        this.configuracao
            .save(object)
            .subscribe(function (result) {
            if (result.validationResult != null && !result.validationResult.isValid) {
                _this.mensagens = _this.messageService.validationResult(result.validationResult);
                app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_7__["EventEmitterService"].get("backError").emit(_this.mensagens);
            }
            else {
                _this.messageService.saveSuccess("titles.comercial", "messages.configuracaoDe");
            }
        });
    };
    ComercialFormComponent.prototype.permissoes = function () {
        var _this = this;
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 2, function () {
            _super.prototype.permissoes.call(_this, _this.constantes);
        });
    };
    ComercialFormComponent.prototype.trataDest = function () {
        var _this = this;
        this.destinatarioService.getById(this.data.codDestRumo).subscribe(function (result) {
            _this.data.cliente = result;
        });
    };
    ComercialFormComponent.ctorParameters = function () { return [
        { type: app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_2__["MessageService"] },
        { type: app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_3__["ConfiguracaoFacade"] },
        { type: app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_4__["FuncoesService"] },
        { type: app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_5__["LoginService"] },
        { type: app_shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_6__["PermissoesUtilsService"] },
        { type: app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_4__["FuncoesService"] },
        { type: app_pages_cadastro_destinatario_destinatario_service__WEBPACK_IMPORTED_MODULE_11__["DestinatarioService"] }
    ]; };
    ComercialFormComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
            selector: 'app-comercial-form',
            template: __importDefault(__webpack_require__(/*! raw-loader!./comercial-form.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/cli/configuracoes/comercial/comercial-form/comercial-form.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_2__["MessageService"],
            app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_3__["ConfiguracaoFacade"],
            app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_4__["FuncoesService"],
            app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_5__["LoginService"],
            app_shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_6__["PermissoesUtilsService"],
            app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_4__["FuncoesService"],
            app_pages_cadastro_destinatario_destinatario_service__WEBPACK_IMPORTED_MODULE_11__["DestinatarioService"]])
    ], ComercialFormComponent);
    return ComercialFormComponent;
}(app_shared_components_corporate_base_base_permissoes__WEBPACK_IMPORTED_MODULE_1__["BasePermissoes"]));



/***/ }),

/***/ "./src/app/pages/especificos/cli/configuracoes/comercial/comercial.constants.ts":
/*!**************************************************************************************!*\
  !*** ./src/app/pages/especificos/cli/configuracoes/comercial/comercial.constants.ts ***!
  \**************************************************************************************/
/*! exports provided: ComercialConstants */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ComercialConstants", function() { return ComercialConstants; });
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};
var ComercialConstants = /** @class */ (function () {
    function ComercialConstants() {
        this.sisFormularioId = 375283;
        this.permissoes = [
            { sisFormularioId: this.sisFormularioId, libRotina: 1, acao: "labels.alteracao" },
            { sisFormularioId: this.sisFormularioId, libRotina: 2, acao: "labels.pemissoes" },
        ];
        this.configuracoes = [];
        this.nomeForm = "titles.comercial";
        this.listaForm = [
            { title: 'Permissao', action: 'permissoes', icon: "icon-unlock", exibeButton: true, eximeMenu: true, menuName: 'Movimento' },
        ];
        this.configuracoes = [
            {
                sistema: "REL",
                parametros: [
                    "CodDestRumo"
                ]
            }
        ];
    }
    return ComercialConstants;
}());



/***/ }),

/***/ "./src/app/pages/especificos/cli/configuracoes/comercial/comercial.model.ts":
/*!**********************************************************************************!*\
  !*** ./src/app/pages/especificos/cli/configuracoes/comercial/comercial.model.ts ***!
  \**********************************************************************************/
/*! exports provided: Comercial */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

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



/***/ }),

/***/ "./src/app/pages/especificos/cli/configuracoes/comercial/comercial.module.ts":
/*!***********************************************************************************!*\
  !*** ./src/app/pages/especificos/cli/configuracoes/comercial/comercial.module.ts ***!
  \***********************************************************************************/
/*! exports provided: ComercialModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ComercialModule", function() { return ComercialModule; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/fesm5/common.js");
/* harmony import */ var app_shared_shared_module__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! app/shared/shared.module */ "./src/app/shared/shared.module.ts");
/* harmony import */ var _comercial_form_comercial_form_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./comercial-form/comercial-form.component */ "./src/app/pages/especificos/cli/configuracoes/comercial/comercial-form/comercial-form.component.ts");
/* harmony import */ var _comercial_routing_module__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./comercial.routing.module */ "./src/app/pages/especificos/cli/configuracoes/comercial/comercial.routing.module.ts");
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};





var ComercialModule = /** @class */ (function () {
    function ComercialModule() {
    }
    ComercialModule = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"])({
            declarations: [_comercial_form_comercial_form_component__WEBPACK_IMPORTED_MODULE_3__["ComercialFormComponent"]],
            imports: [
                _angular_common__WEBPACK_IMPORTED_MODULE_1__["CommonModule"],
                app_shared_shared_module__WEBPACK_IMPORTED_MODULE_2__["SharedModule"],
                _comercial_routing_module__WEBPACK_IMPORTED_MODULE_4__["ComercialRoutingModule"]
            ]
        })
    ], ComercialModule);
    return ComercialModule;
}());



/***/ }),

/***/ "./src/app/pages/especificos/cli/configuracoes/comercial/comercial.routing.module.ts":
/*!*******************************************************************************************!*\
  !*** ./src/app/pages/especificos/cli/configuracoes/comercial/comercial.routing.module.ts ***!
  \*******************************************************************************************/
/*! exports provided: ComercialRoutingModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

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




var MRoutes = [
    {
        path: "",
        component: _comercial_form_comercial_form_component__WEBPACK_IMPORTED_MODULE_3__["ComercialFormComponent"],
        data: { breadcrumb: "configuracoes", breadcrumbSub: "comercial", formParams: { action: app_config_enumerables__WEBPACK_IMPORTED_MODULE_2__["ActionForm"].create } }
    }
];
var ComercialRoutingModule = /** @class */ (function () {
    function ComercialRoutingModule() {
    }
    ComercialRoutingModule = __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"]]
        })
    ], ComercialRoutingModule);
    return ComercialRoutingModule;
}());



/***/ })

}]);
//# sourceMappingURL=app-pages-especificos-cli-configuracoes-comercial-comercial-module.js.map