(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["app-pages-comercial-aprovacao-pedidos-aprovacao-pedidos-module"],{

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/comercial/aprovacao-pedidos/aprovacao-pedidos-form/aprovacao-pedidos-form.component.html":
/*!******************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/comercial/aprovacao-pedidos/aprovacao-pedidos-form/aprovacao-pedidos-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"] = ("<table class=\"table table-striped table-hover\">\n    <tr>\n        <th>\n            {{ \"labels.servico\" | translate }}\n        </th>\n        <th>\n            {{ \"labels.unidade\" | translate }}\n        </th>\n        <th style=\"text-align: right\">\n            {{ \"labels.preco\" | translate }}\n        </th>\n        <th style=\"text-align: right\">\n            {{ \"labels.quantidade\" | translate }}\n        </th>\n        <th style=\"text-align: right\">\n            {{ \"labels.total\" | translate }}\n        </th>\n        <th>\n            {{ \"labels.especificacao\" | translate }}\n        </th>\n    </tr>\n    <tbody>\n    <tr *ngFor=\"let val of data.itens | removeExcluidos;let i = index\"\n        (click)=\"selected(val, i)\"\n        [ngClass]=\"{'info':i === _index && item.item === val.item }\">\n        <td>\n            {{ val.descrMater }}\n        </td>\n        <td>\n            {{ val.unidade }}\n        </td>\n        <td style=\"text-align: right;\">\n            {{ val.preco | formatCurrency: 2 }}\n        </td>\n        <td style=\"text-align: right;\">\n            {{ val.quantidSto | formatCurrency: 0 }}\n        </td>\n        <td style=\"text-align: right;\">\n            {{ val.totItem | formatCurrency: 2 }}\n        </td>\n        <td>\n            {{ val.especificacao + val.especificacao2 }}\n        </td>\n    </tr>\n    <tr *ngIf=\"!data.itens || data.itens.length === 0\">\n        <th colspan=\"6\">\n            {{'messages.nenhumRegistroEncontrado' | translate }}\n        </th>\n    </tr>\n    </tbody>\n</table>\n\n<div class=\"row\">\n    <div class=\"col-lg-6 col-md-12\">\n        <div class=\"row\">\n            <div class=\"col-lg-3 col-md-4 col-sm-4 col-4 pr-0\">\n                <div class=\"form-group form-group-sm\">\n                    <label for=\"materialId\">{{'labels.produto' | translate}}</label>\n                    <input type=\"text\" id=\"materialId\"\n                           name=\"materialId\"\n                           class=\"form-control form-control-sm\"\n                           value=\"{{ item?.material }}\"\n                           disabled>\n                </div>\n            </div>\n            <div class=\"col-lg-8 col-md-8 col-sm-8 col-8 pl-0\">\n                <div class=\"form-group form-group-sm\">\n                    <label for=\"descrMater\">&nbsp;</label>\n                    <input type=\"text\" id=\"descrMater\"\n                           name=\"descrMater\"\n                           class=\"form-control form-control-sm\"\n                           value=\"{{ item.descrMater }}\"\n                           disabled>\n                </div>\n            </div>\n        </div>\n    </div>\n</div>\n<div class=\"row\">\n    <div class=\"col-lg-6 col-md-6\">\n        <div class=\"form-group form-group-sm\">\n            <label for=\"especificacao\">{{'labels.descricao' | translate}}</label>\n            <textarea id=\"especificacao\" rows=\"3\"\n                      disabled\n                      name=\"especificacao\" class=\"form-control\">{{ item.especificacao }} {{ item.especificacao2 }}</textarea>\n        </div>\n    </div>\n</div>\n<div class=\"row\">\n    <div class=\"col-lg-3 col-md-6\">\n        <div class=\"form-group form-group-sm\">\n            <label for=\"unidade\">{{'labels.unidade' | translate}}</label>\n            <input id=\"unidade\"\n                   name=\"unidade\"\n                   type=\"text\"\n                   [(ngModel)]=\"item.unidade\"\n                   maxlength=\"4\"\n                   disabled\n                   class=\"form-control form-control-sm\">\n        </div>\n    </div>\n</div>\n<div class=\"row\">\n    <div class=\"col-lg-4 col-md-6\">\n        <div class=\"form-group form-group-sm\">\n            <label for=\"quantidSto\">{{'labels.quantidade' | translate}}</label>\n            <input id=\"quantidSto\"\n                   name=\"quantidSto\"\n                   type=\"text\"\n                   currencyMask\n                   [options]=\"{ prefix: '', thousands: '.', decimal: ',', precision: 0 }\"\n                   [(ngModel)]=\"item.quantidSto\"\n                   maxlength=\"15\"\n                   disabled\n                   class=\"form-control form-control-sm\">\n        </div>\n    </div>\n</div>\n<div class=\"row\">\n    <div class=\"col-lg-4 col-md-6\">\n        <div class=\"form-group form-group-sm\">\n            <label for=\"preco\">{{'labels.preco' | translate}}</label>\n            <input id=\"preco\"\n                   name=\"preco\"\n                   type=\"text\"\n                   disabled\n                   currencyMask\n                   [options]=\"{ prefix: '', thousands: '.', decimal: ',', precision: 2 }\"\n                   [(ngModel)]=\"item.preco\"\n                   maxlength=\"16\"\n                   class=\"form-control form-control-sm\">\n        </div>\n    </div>\n    <div class=\"col-lg-4 col-md-6\">\n        <div class=\"form-group form-group-sm\">\n            <label for=\"totItem\">{{'labels.total' | translate}}</label>\n            <input id=\"totItem\"\n                   name=\"totItem\"\n                   type=\"text\"\n                   currencyMask\n                   [options]=\"{ prefix: '', thousands: '.', decimal: ',', precision: 2 }\"\n                   [(ngModel)]=\"item.totItem\"\n                   maxlength=\"16\"\n                   disabled\n                   class=\"form-control form-control-sm\">\n        </div>\n    </div>\n</div>\n");

/***/ }),

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/comercial/aprovacao-pedidos/aprovacao-pedidos-index/aprovacao-pedidos-index.component.html":
/*!********************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/comercial/aprovacao-pedidos/aprovacao-pedidos-index/aprovacao-pedidos-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\"\n                      [formAction]=\"actionForm\"\n                      [itemData]=\"data.regPedido\"\n                      [sisFormularioId]=\"constantes.sisFormularioId\">\n</app-menu-command-bar>\n\n<div class=\"section-comand-bar\">\n\n</div>\n\n<div class=\"row\">\n    <div class=\"col-lg-12\">\n        <div class=\"section-comand-bar\">\n            <div class=\"tab-content top\">\n                <div class=\"tab-pane active show\" id=\"ge\">\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\"\n                                   href=\"#navegacao\">{{\"labels.navegacao\" | translate}}</a>\n                            </li>\n                            <li class=\"nav-item\">\n                                <a class=\"nav-link\" data-toggle=\"tab\"\n                                   href=\"#dados\">{{\"labels.dados\" | translate}}</a>\n                            </li>\n                        </ul>\n                    </div>\n                    <div class=\"tab-content top\">\n                        <div class=\"tab-pane active show pl-0 pr-0\" id=\"navegacao\">\n                            <table id=\"dtAprovacaoPedidos\"\n                                   class=\"table table-striped table-bordered table-hover nowrap table-sm\"></table>\n                        </div>\n                        <div class=\"tab-pane\" id=\"dados\">\n                            <app-aprovacao-pedidos-form [data]=\"data\" [item]=\"item\"></app-aprovacao-pedidos-form>\n                        </div>\n                    </div>\n                </div>\n            </div>\n        </div>\n    </div>\n</div>\n\n<app-propriedades></app-propriedades>\n<app-liberar-acesso-supervisor></app-liberar-acesso-supervisor>\n<app-permissoes-rotina [constantes]=\"constantes\"></app-permissoes-rotina>\n");

/***/ }),

/***/ "./src/app/pages/comercial/aprovacao-pedidos/aprovacao-pedidos-form/aprovacao-pedidos-form.component.ts":
/*!**************************************************************************************************************!*\
  !*** ./src/app/pages/comercial/aprovacao-pedidos/aprovacao-pedidos-form/aprovacao-pedidos-form.component.ts ***!
  \**************************************************************************************************************/
/*! exports provided: AprovacaoPedidosFormComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

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


var AprovacaoPedidosFormComponent = /** @class */ (function () {
    function AprovacaoPedidosFormComponent() {
        this.data = new _aprovacao_pedidos_model__WEBPACK_IMPORTED_MODULE_1__["AprovacaoPedidos"]();
        this.item = new _aprovacao_pedidos_model__WEBPACK_IMPORTED_MODULE_1__["ItensDePedidoDto"]();
    }
    AprovacaoPedidosFormComponent.prototype.ngOnInit = function () {
        this._index = 0;
    };
    AprovacaoPedidosFormComponent.prototype.selected = function (val, index) {
        this._index = index;
        this.item = val;
    };
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"])(),
        __metadata("design:type", _aprovacao_pedidos_model__WEBPACK_IMPORTED_MODULE_1__["AprovacaoPedidos"])
    ], AprovacaoPedidosFormComponent.prototype, "data", void 0);
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"])(),
        __metadata("design:type", _aprovacao_pedidos_model__WEBPACK_IMPORTED_MODULE_1__["ItensDePedidoDto"])
    ], AprovacaoPedidosFormComponent.prototype, "item", void 0);
    AprovacaoPedidosFormComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
            selector: 'app-aprovacao-pedidos-form',
            template: __importDefault(__webpack_require__(/*! raw-loader!./aprovacao-pedidos-form.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/comercial/aprovacao-pedidos/aprovacao-pedidos-form/aprovacao-pedidos-form.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [])
    ], AprovacaoPedidosFormComponent);
    return AprovacaoPedidosFormComponent;
}());



/***/ }),

/***/ "./src/app/pages/comercial/aprovacao-pedidos/aprovacao-pedidos-index/aprovacao-pedidos-index.component.ts":
/*!****************************************************************************************************************!*\
  !*** ./src/app/pages/comercial/aprovacao-pedidos/aprovacao-pedidos-index/aprovacao-pedidos-index.component.ts ***!
  \****************************************************************************************************************/
/*! exports provided: AprovacaoPedidosIndexComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AprovacaoPedidosIndexComponent", function() { return AprovacaoPedidosIndexComponent; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _aprovacao_contrato_aprovacao_contrato_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../aprovacao-contrato/aprovacao-contrato.constants */ "./src/app/pages/comercial/aprovacao-contrato/aprovacao-contrato.constants.ts");
/* harmony import */ var _aprovacao_pedidos_model__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../aprovacao-pedidos.model */ "./src/app/pages/comercial/aprovacao-pedidos/aprovacao-pedidos.model.ts");
/* harmony import */ var _shared_components_corporate_base_base_permissoes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../shared/components/corporate/base/base.permissoes */ "./src/app/shared/components/corporate/base/base.permissoes.ts");
/* harmony import */ var _aprovacao_pedidos_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../aprovacao-pedidos.constants */ "./src/app/pages/comercial/aprovacao-pedidos/aprovacao-pedidos.constants.ts");
/* harmony import */ var _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../../shared/services/funcoes/funcoes.service */ "./src/app/shared/services/funcoes/funcoes.service.ts");
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/fesm5/router.js");
/* harmony import */ var _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../../shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var _login_login_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../login/login.service */ "./src/app/pages/login/login.service.ts");
/* harmony import */ var _shared_services_datatables_datatables_service__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../../shared/services/datatables/datatables.service */ "./src/app/shared/services/datatables/datatables.service.ts");
/* harmony import */ var _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../../shared/services/funcoes/permissoes-utils/permissoes-utils.service */ "./src/app/shared/services/funcoes/permissoes-utils/permissoes-utils.service.ts");
/* harmony import */ var _cadastro_material_material_service__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../cadastro/material/material.service */ "./src/app/pages/cadastro/material/material.service.ts");
/* harmony import */ var _aprovacao_pedidos_service__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../aprovacao-pedidos.service */ "./src/app/pages/comercial/aprovacao-pedidos/aprovacao-pedidos.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 AprovacaoPedidosIndexComponent = /** @class */ (function (_super) {
    __extends(AprovacaoPedidosIndexComponent, _super);
    function AprovacaoPedidosIndexComponent(service, funcoes, router, messageService, loginService, funcoesService, datatablesService, permissoesUtils, serviceMaterial) {
        var _this = _super.call(this, new _aprovacao_contrato_aprovacao_contrato_constants__WEBPACK_IMPORTED_MODULE_1__["AprovacaoContratoConstants"](), funcoesService) || this;
        _this.service = service;
        _this.funcoes = funcoes;
        _this.router = router;
        _this.messageService = messageService;
        _this.loginService = loginService;
        _this.funcoesService = funcoesService;
        _this.datatablesService = datatablesService;
        _this.permissoesUtils = permissoesUtils;
        _this.serviceMaterial = serviceMaterial;
        _this.data = new _aprovacao_pedidos_model__WEBPACK_IMPORTED_MODULE_2__["AprovacaoPedidos"]();
        _this.dados = [];
        _this.item = new _aprovacao_pedidos_model__WEBPACK_IMPORTED_MODULE_2__["ItensDePedidoDto"]();
        _this.constantes = new _aprovacao_pedidos_constants__WEBPACK_IMPORTED_MODULE_4__["AprovacaoPedidosConstants"]();
        _this.toAccept = function () {
            _this.messageService.confirm("titles.confirmacao", "messages.confirmaAprovacao", "", function () { return _this.action({ regPedido: _this.data.regPedido, aprovar: "S" }); }, false);
        };
        _this.toFail = function () {
            _this.messageService.confirm("titles.confirmacao", "messages.confirmaReprovacao", "", function () { return _this.action({ regPedido: _this.data.regPedido, aprovar: "R" }); }, false);
        };
        router.events.subscribe(function (event) {
            var params = _this.funcoesService.formParams.getParams(router, event);
            if (params) {
                _this.actionForm = params.action;
            }
        });
        return _this;
    }
    AprovacaoPedidosIndexComponent.prototype.ngOnInit = function () {
        var _this = this;
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 1, function () { return __awaiter(_this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                this.refresh();
                return [2 /*return*/];
            });
        }); }, function () {
            _this.permissoesUtils.back();
        }, true);
        _super.prototype.addFuncoes.call(this, [
            { action: '_toAccept', func: function () { return _this.toAccept; } },
            { action: '_toFail', func: function () { return _this.toFail; } }
        ]);
    };
    AprovacaoPedidosIndexComponent.prototype.refresh = function () {
        var _this = this;
        this.service.get().subscribe(function (data) {
            var columns = [
                _this.datatablesService.getDataString("pedido", "pedido"),
                _this.datatablesService.getDataString("numContrato", "contrato"),
                _this.datatablesService.getDataString("fantasia", "cliente"),
                _this.datatablesService.getDataDateTime("dtPedido", "emissao", "DD/MM/YYYY"),
                _this.datatablesService.getDataDouble("totalPed", "total", 2),
                _this.datatablesService.getDataString("servicos", "servicos"),
            ];
            _this.dados = data.filter(function (val) {
                val.itens = [];
                return val;
            });
            _this.datatablesService.toDataTable({ tableId: "dtAprovacaoPedidos", columns: columns, data: data }, function (aData) { return __awaiter(_this, void 0, void 0, function () {
                return __generator(this, function (_a) {
                    switch (_a.label) {
                        case 0:
                            this.data = aData;
                            this.item = new _aprovacao_pedidos_model__WEBPACK_IMPORTED_MODULE_2__["ItensDePedidoDto"]();
                            return [4 /*yield*/, this.getByRegPedido()];
                        case 1:
                            _a.sent();
                            return [2 /*return*/];
                    }
                });
            }); });
        });
    };
    AprovacaoPedidosIndexComponent.prototype.getByRegPedido = function () {
        var _this = this;
        var promise = new Promise((function (resolve) {
            _this.service.getById(_this.data.regPedido).subscribe(function (resp) {
                _this.data.itens = resp.filter(function (val) {
                    if (val.especificacao === null) {
                        val.especificacao = "";
                    }
                    if (val.especificacao2 === null) {
                        val.especificacao2 = "";
                    }
                    return val;
                });
                if (_this.data.itens && _this.data.itens.length > 0) {
                    _this.item = _this.data.itens[0];
                }
                resolve(resp);
            });
        }));
        return promise;
    };
    AprovacaoPedidosIndexComponent.prototype.permissoes = function () {
        var _this = this;
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 2, function () {
            _super.prototype.permissoes.call(_this, _this.constantes);
        });
    };
    AprovacaoPedidosIndexComponent.prototype.action = function (object) {
        var _this = this;
        var libRotina = object.aprovar === "S" ? 9 : 10;
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, libRotina, function () {
            _this.service.corpWebCmlPedidoAprovaGrava(object).subscribe(function (resp) {
                if (resp.isValid === false) {
                    if (!resp.erros || (resp.erros && resp.erros.length === 0)) {
                        return;
                    }
                    _this.messageService.warning("titles.aprovacaoPedidos", resp.erros[0].message);
                    return;
                }
                if (libRotina === 9) {
                    _this.messageService.success("titles.aprovacaoPedidos", "messages.aprovadoComSucesso");
                }
                else {
                    _this.messageService.success("titles.aprovacaoPedidos", "messages.reprovadoComSucesso");
                }
                _this.refresh();
            });
        });
    };
    AprovacaoPedidosIndexComponent.ctorParameters = function () { return [
        { type: _aprovacao_pedidos_service__WEBPACK_IMPORTED_MODULE_12__["AprovacaoPedidosService"] },
        { type: _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_5__["FuncoesService"] },
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_6__["Router"] },
        { type: _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_7__["MessageService"] },
        { type: _login_login_service__WEBPACK_IMPORTED_MODULE_8__["LoginService"] },
        { type: _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_5__["FuncoesService"] },
        { type: _shared_services_datatables_datatables_service__WEBPACK_IMPORTED_MODULE_9__["DatatablesService"] },
        { type: _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_10__["PermissoesUtilsService"] },
        { type: _cadastro_material_material_service__WEBPACK_IMPORTED_MODULE_11__["MaterialService"] }
    ]; };
    AprovacaoPedidosIndexComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
            selector: 'app-aprovacao-pedidos-index',
            template: __importDefault(__webpack_require__(/*! raw-loader!./aprovacao-pedidos-index.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/comercial/aprovacao-pedidos/aprovacao-pedidos-index/aprovacao-pedidos-index.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [_aprovacao_pedidos_service__WEBPACK_IMPORTED_MODULE_12__["AprovacaoPedidosService"],
            _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_5__["FuncoesService"],
            _angular_router__WEBPACK_IMPORTED_MODULE_6__["Router"],
            _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_7__["MessageService"],
            _login_login_service__WEBPACK_IMPORTED_MODULE_8__["LoginService"],
            _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_5__["FuncoesService"],
            _shared_services_datatables_datatables_service__WEBPACK_IMPORTED_MODULE_9__["DatatablesService"],
            _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_10__["PermissoesUtilsService"],
            _cadastro_material_material_service__WEBPACK_IMPORTED_MODULE_11__["MaterialService"]])
    ], AprovacaoPedidosIndexComponent);
    return AprovacaoPedidosIndexComponent;
}(_shared_components_corporate_base_base_permissoes__WEBPACK_IMPORTED_MODULE_3__["BasePermissoes"]));



/***/ }),

/***/ "./src/app/pages/comercial/aprovacao-pedidos/aprovacao-pedidos.constants.ts":
/*!**********************************************************************************!*\
  !*** ./src/app/pages/comercial/aprovacao-pedidos/aprovacao-pedidos.constants.ts ***!
  \**********************************************************************************/
/*! exports provided: AprovacaoPedidosConstants */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AprovacaoPedidosConstants", function() { return AprovacaoPedidosConstants; });
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};
var AprovacaoPedidosConstants = /** @class */ (function () {
    function AprovacaoPedidosConstants() {
        this.sisFormularioId = 130091;
        this.permissoes = [
            { sisFormularioId: this.sisFormularioId, libRotina: 1, acao: "labels.consulta" },
            { sisFormularioId: this.sisFormularioId, libRotina: 2, acao: "labels.permissoes" },
            { sisFormularioId: this.sisFormularioId, libRotina: 3, acao: "labels.aprovar" },
            { sisFormularioId: this.sisFormularioId, libRotina: 4, acao: "labels.reprovar" }
        ];
        this.sisSistemaId = "CAD";
        this.configs = [];
        this.nomeForm = "titles.aprovacaoPedidos";
        this.reportId = "";
        this.tabela = "";
        this.listaIndex = [
            { title: 'Aprovar', action: '_toAccept', icon: "fa fa-check", exibeButton: true, eximeMenu: true, menuName: 'Movimento' },
            { title: 'Reprovar', action: '_toFail', icon: "fa fa-window-close", exibeButton: true, eximeMenu: true, menuName: 'Movimento' },
            { title: 'Atualizar', action: 'refresh', icon: "icon-reload", exibeButton: true, eximeMenu: true, menuName: 'Arquivo' },
            { title: 'Permissao', action: 'permissoes', icon: "icon-unlock", exibeButton: true, eximeMenu: true, menuName: 'Movimento' }
        ];
        this.configs = [
        /**/
        ];
    }
    return AprovacaoPedidosConstants;
}());



/***/ }),

/***/ "./src/app/pages/comercial/aprovacao-pedidos/aprovacao-pedidos.model.ts":
/*!******************************************************************************!*\
  !*** ./src/app/pages/comercial/aprovacao-pedidos/aprovacao-pedidos.model.ts ***!
  \******************************************************************************/
/*! exports provided: AprovacaoPedidos, ItensDePedidoDto */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

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

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



/***/ }),

/***/ "./src/app/pages/comercial/aprovacao-pedidos/aprovacao-pedidos.module.ts":
/*!*******************************************************************************!*\
  !*** ./src/app/pages/comercial/aprovacao-pedidos/aprovacao-pedidos.module.ts ***!
  \*******************************************************************************/
/*! exports provided: AprovacaoPedidosModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AprovacaoPedidosModule", function() { return AprovacaoPedidosModule; });
/* 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 _aprovacao_pedidos_index_aprovacao_pedidos_index_component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./aprovacao-pedidos-index/aprovacao-pedidos-index.component */ "./src/app/pages/comercial/aprovacao-pedidos/aprovacao-pedidos-index/aprovacao-pedidos-index.component.ts");
/* harmony import */ var _aprovacao_pedidos_form_aprovacao_pedidos_form_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./aprovacao-pedidos-form/aprovacao-pedidos-form.component */ "./src/app/pages/comercial/aprovacao-pedidos/aprovacao-pedidos-form/aprovacao-pedidos-form.component.ts");
/* harmony import */ var _shared_shared_module__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../shared/shared.module */ "./src/app/shared/shared.module.ts");
/* harmony import */ var _aprovacao_pedidos_routing_module__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./aprovacao-pedidos.routing.module */ "./src/app/pages/comercial/aprovacao-pedidos/aprovacao-pedidos.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 AprovacaoPedidosModule = /** @class */ (function () {
    function AprovacaoPedidosModule() {
    }
    AprovacaoPedidosModule = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"])({
            declarations: [_aprovacao_pedidos_index_aprovacao_pedidos_index_component__WEBPACK_IMPORTED_MODULE_2__["AprovacaoPedidosIndexComponent"], _aprovacao_pedidos_form_aprovacao_pedidos_form_component__WEBPACK_IMPORTED_MODULE_3__["AprovacaoPedidosFormComponent"]],
            imports: [
                _angular_common__WEBPACK_IMPORTED_MODULE_1__["CommonModule"],
                _shared_shared_module__WEBPACK_IMPORTED_MODULE_4__["SharedModule"],
                _aprovacao_pedidos_routing_module__WEBPACK_IMPORTED_MODULE_5__["AprovacaoPedidosRoutingModule"]
            ]
        })
    ], AprovacaoPedidosModule);
    return AprovacaoPedidosModule;
}());



/***/ }),

/***/ "./src/app/pages/comercial/aprovacao-pedidos/aprovacao-pedidos.routing.module.ts":
/*!***************************************************************************************!*\
  !*** ./src/app/pages/comercial/aprovacao-pedidos/aprovacao-pedidos.routing.module.ts ***!
  \***************************************************************************************/
/*! exports provided: AprovacaoPedidosRoutingModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AprovacaoPedidosRoutingModule", function() { return AprovacaoPedidosRoutingModule; });
/* 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 _aprovacao_pedidos_index_aprovacao_pedidos_index_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./aprovacao-pedidos-index/aprovacao-pedidos-index.component */ "./src/app/pages/comercial/aprovacao-pedidos/aprovacao-pedidos-index/aprovacao-pedidos-index.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: _aprovacao_pedidos_index_aprovacao_pedidos_index_component__WEBPACK_IMPORTED_MODULE_3__["AprovacaoPedidosIndexComponent"],
        data: {
            breadcrumb: "aprovacaoPedidos",
            formParams: { action: app_config_enumerables__WEBPACK_IMPORTED_MODULE_2__["ActionForm"].index }
        }
    }
];
var AprovacaoPedidosRoutingModule = /** @class */ (function () {
    function AprovacaoPedidosRoutingModule() {
    }
    AprovacaoPedidosRoutingModule = __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"]]
        })
    ], AprovacaoPedidosRoutingModule);
    return AprovacaoPedidosRoutingModule;
}());



/***/ }),

/***/ "./src/app/pages/comercial/aprovacao-pedidos/aprovacao-pedidos.service.ts":
/*!********************************************************************************!*\
  !*** ./src/app/pages/comercial/aprovacao-pedidos/aprovacao-pedidos.service.ts ***!
  \********************************************************************************/
/*! exports provided: AprovacaoPedidosService */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AprovacaoPedidosService", function() { return AprovacaoPedidosService; });
/* harmony import */ var app_shared_services_base_base_service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! app/shared/services/base/base.service */ "./src/app/shared/services/base/base.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_common_http__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/common/http */ "./node_modules/@angular/common/fesm5/http.js");
/* harmony import */ var _environments_environment__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../environments/environment */ "./src/environments/environment.ts");
/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm5/operators/index.js");
/* harmony import */ var _app_error_handler__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../app.error-handler */ "./src/app/app.error-handler.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 AprovacaoPedidosService = /** @class */ (function (_super) {
    __extends(AprovacaoPedidosService, _super);
    function AprovacaoPedidosService(http) {
        return _super.call(this, http, "comercial/aprovacaoPedidos") || this;
    }
    AprovacaoPedidosService.prototype.corpWebCmlPedidoAprovaGrava = function (data) {
        return this.http
            .post(_environments_environment__WEBPACK_IMPORTED_MODULE_3__["environment"].service_url + "/api/v1/comercial/aprovacaoPedidos/corpWebCmlPedidoAprovaGrava", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__["catchError"])(_app_error_handler__WEBPACK_IMPORTED_MODULE_5__["ErrorHandler"].handleError));
    };
    AprovacaoPedidosService.ctorParameters = function () { return [
        { type: _angular_common_http__WEBPACK_IMPORTED_MODULE_2__["HttpClient"] }
    ]; };
    AprovacaoPedidosService = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"])({
            providedIn: "root"
        }),
        __metadata("design:paramtypes", [_angular_common_http__WEBPACK_IMPORTED_MODULE_2__["HttpClient"]])
    ], AprovacaoPedidosService);
    return AprovacaoPedidosService;
}(app_shared_services_base_base_service__WEBPACK_IMPORTED_MODULE_0__["BaseService"]));



/***/ })

}]);
//# sourceMappingURL=app-pages-comercial-aprovacao-pedidos-aprovacao-pedidos-module.js.map