(window.webpackJsonp=window.webpackJsonp||[]).push([[848],{2737:function(o,t,e){"use strict";e.r(t);e(6),e(5),e(7),e(4),e(12),e(8),e(13);var r=e(2),l=(e(50),e(166),e(78)),c=e(2507),n=e(1122);function d(object,o){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(object);o&&(e=e.filter((function(o){return Object.getOwnPropertyDescriptor(object,o).enumerable}))),t.push.apply(t,e)}return t}function f(o){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?d(Object(source),!0).forEach((function(t){Object(r.a)(o,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(source)):d(Object(source)).forEach((function(t){Object.defineProperty(o,t,Object.getOwnPropertyDescriptor(source,t))}))}return o}var v={name:"FluxosAprovacao",components:{modalFluxoAprovacao:c.default,TablePaginated:n.default},data:function(){return{searchFluxoAprovacao:null,currentPage:1,perPage:5,fluxos:[],pageOptions:[5,25,50,75,100],fieldsFluxoAprovacao:[{key:"descricao",label:"Descrição",sortable:!0},{key:"tipo",label:"Tipo",sortable:!0}],selectMode:"single",busy:!1,sortDesc:!1,idFluxo:null}},computed:f(f({},Object(l.c)({empresa:"empresa/empresaAtual"})),{},{rows:function(){return this.fluxos.length}}),mounted:function(){this.findFluxosAprovacao(),this.idFluxo=null},methods:{openModalFluxo:function(){var o=this;this.idFluxo=null,setTimeout((function(){o.$bvModal.show("modalFluxo")}),1e3)},editFluxoAprovacao:function(o){var t=this;this.idFluxo=null,this.idFluxo=o.id,setTimeout((function(){t.$bvModal.show("modalFluxo")}),1e3)},findFluxosAprovacao:function(){var o=this;this.busy=!0,this.fluxos=[],this.$fluxoAprovacaoService.findFluxoAprovacao(this.empresa.sigla).then((function(t){o.fluxos=t.data.sort((function(a,b){return b.id-a.id})),o.busy=!1})).catch((function(t){o.fluxos=[],o.busy=!1,o.$notifyApiError(t,"Erro")}))}}},x=e(42),component=Object(x.a)(v,(function(){var o=this,t=o.$createElement,e=o._self._c||t;return e("div",{staticClass:"animated fadeIn"},[e("b-row",[e("b-col",{attrs:{cols:"12"}},[e("b-card",{staticClass:"wrapper"},[e("form",[e("div",{attrs:{slot:"header"},slot:"header"},[e("b-row",[e("b-col",{attrs:{cols:"10"}},[e("h2",{staticClass:"primary"},[o._v("Fluxos de Aprovação")])]),o._v(" "),e("b-col",{attrs:{cols:"2"}},[e("div",{staticClass:"d-flex justify-content-end"},[e("b-button",{staticClass:"rounded",attrs:{size:"sm",variant:"success"},on:{click:o.openModalFluxo}},[e("fa-icon",{attrs:{icon:"file"}}),e("span",{staticClass:"ml-2"},[o._v("Adicionar")])],1)],1)])],1)],1),o._v(" "),e("b-row",{staticClass:"mt-4"},[e("b-col",{attrs:{md:"12"}},[e("b-row",[e("b-col",{attrs:{md:"6"}},[e("b-form-group",{attrs:{label:"Descrição"}},[e("b-form-input",{attrs:{type:"text",autofocus:""},model:{value:o.searchFluxoAprovacao,callback:function(t){o.searchFluxoAprovacao=t},expression:"searchFluxoAprovacao"}})],1)],1),o._v(" "),e("b-col",{attrs:{md:"6"}},[e("b-button",{staticClass:"rounded mt-4",attrs:{size:"sm",variant:"outline-success"},on:{click:function(t){return o.findFluxosAprovacao()}}},[e("fa-icon",{attrs:{icon:"search"}}),o._v(" Pesquisar\n                  ")],1)],1)],1)],1)],1),o._v(" "),e("TablePaginated",{attrs:{striped:"","empty-text":"Não há fluxos de aprovação definidos.",items:o.fluxos,fields:o.fieldsFluxoAprovacao,"sort-desc":!1,"items-per-page-multiplier":5,busy:o.busy},on:{"row-clicked":o.editFluxoAprovacao}})],1)])],1)],1),o._v(" "),e("modal-fluxo-aprovacao",{attrs:{"find-fluxos-aprovacao":o.findFluxosAprovacao,"id-fluxo":o.idFluxo},on:{"update:idFluxo":function(t){o.idFluxo=o.$emit}}})],1)}),[],!1,null,null,null);t.default=component.exports}}]);
//# sourceMappingURL=70d970a-1.2.11.js.map