(window.webpackJsonp=window.webpackJsonp||[]).push([[275],{2200:function(e,t,n){"use strict";n.r(t);n(6),n(5),n(7),n(4),n(12),n(8),n(13);var o=n(2),r=(n(15),n(78));function c(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,n)}return t}var l={props:{findPlanosAcao:{type:Function,default:function(){return[]}},licenca:{type:Object,default:function(){},required:!0},planos:{type:Array,default:function(){return[]}}},data:function(){var e=this;return{fieldsPlanos:[{key:"descricaoAcao",label:"Descrição"},{key:"area.descricao",label:"Área"},{key:"idArea",label:"Responsável",formatter:function(t,n,o){return e.procuraResponsaveis(t)}},{key:"descricaoEvidencia",label:"Evidência"}],areas:[],busyCondicionante:!1,currentPage:1,perPage:5}},computed:function(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?c(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):c(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}({},Object(r.c)({empresa:"empresa/empresaAtual",empresas:"empresa/empresas"})),mounted:function(){this.findAreas()},methods:{openPlanoAcao:function(){this.$nuxt.$options.router.push({path:"/ambiental/licencas/".concat(this.$route.params.licenca,"/").concat(this.$route.params.condicionante,"/planoAcao")})},findAreas:function(){var e=this;this.$empresaService.findAreas(this.empresa.sigla).then((function(t){e.areas=t.data})).catch((function(t){e.$notifyApiError(t,"Erro")}))},procuraResponsaveis:function(e){for(var t in this.areas)if(e===this.areas[t].id)return this.areas[t].responsavel.nome},edit:function(e){var t,n=null==e||null===(t=e.id)||void 0===t?void 0:t.idPlanoAcao;n?this.$nuxt.$options.router.push({path:"/ambiental/licencas/".concat(this.$route.params.licenca,"/").concat(this.$route.params.condicionante,"/").concat(n)}):console.error("Erro: idPlanoAcao não encontrado no item clicado.",e)}}},d=l,f=n(42),component=Object(f.a)(d,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("b-card",{staticClass:"mt-3"},[n("div",{staticClass:"mt-4",attrs:{slot:"header"},slot:"header"},[n("b-row",[n("b-col",{staticClass:"d-flex justify-content-start"},[n("fa-icon",{staticStyle:{"font-size":"1.3rem"},attrs:{icon:"route"}}),e._v(" "),n("h3",{staticClass:"ml-3"},[e._v("Plano de Ação")])],1),e._v(" "),n("b-col",{staticClass:"d-flex justify-content-end"},[n("b-button",{directives:[{name:"b-popover",rawName:"v-b-popover.hover.top",value:"Adicionar plano de ação",expression:"'Adicionar plano de ação'",modifiers:{hover:!0,top:!0}}],staticClass:"my-2 ml-2 rounded",attrs:{variant:"primary",size:"sm"},on:{click:function(t){return e.openPlanoAcao()}}},[n("fa-icon",{attrs:{icon:"plus"}})],1)],1)],1)],1),e._v(" "),n("b-table",{ref:"planoAcao",attrs:{striped:"",stacked:"md",hover:"",selectable:"",items:e.planos,fields:e.fieldsPlanos,responsive:"sm",busy:e.busyCondicionante,"busy-empty":!0,"empty-text":"Nenhum plano de ação foi encontrado.","show-empty":""},on:{"row-clicked":e.edit},scopedSlots:e._u([{key:"table-busy",fn:function(){return[n("div",{staticClass:"text-center text-info my-2"},[n("b-spinner",{staticClass:"align-middle"}),e._v(" "),n("strong",[e._v("Carregando...")])],1)]},proxy:!0}])}),e._v(" "),n("b-col",{attrs:{"align-self":"end"}},[n("div",{staticClass:"text-right"},[n("b",[e._v("Itens:")]),e._v(" "+e._s(e.planos.length))])])],1)}),[],!1,null,null,null);t.default=component.exports}}]);
//# sourceMappingURL=8648754-1.2.11.js.map