(window.webpackJsonp=window.webpackJsonp||[]).push([[817],{889:function(t,e,o){"use strict";o.r(e);o(6),o(5),o(7),o(4),o(12),o(8),o(13);var r=o(2),n=(o(50),o(78));function c(object,t){var e=Object.keys(object);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(object);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(object,t).enumerable}))),e.push.apply(e,o)}return e}function l(t){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?c(Object(source),!0).forEach((function(e){Object(r.a)(t,e,source[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(source)):c(Object(source)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(source,e))}))}return t}var d={name:"PlanoAcao",props:{monitoracao:{type:Object,default:function(){return null}},blocked:{type:Boolean,default:function(){return!1}}},data:function(){return{planoAcoes:[],busy:!1,fieldsPlanoAcao:[{key:"descricao",label:"Descrição",thStyle:{width:"65% !important"}},{key:"prazo",label:"Prazo",thStyle:{width:"35% !important"}}]}},computed:l(l({},Object(n.c)({empresa:"empresa/empresaAtual",isExterno:"usuario/isExterno"})),{},{monitoracaoData:{get:function(){return this.monitoracao},set:function(t){this.$emit("update:monitoracao",t)}},isBlockedEditAux:{get:function(){return this.blocked},set:function(t){this.$emit("update:blocked",t)}}}),mounted:function(){var t=this;setTimeout((function(){void 0!==t.monitoracaoData.id.idMonitoracao&&t.findPlanoAcao()}),2e3)},methods:{findPlanoAcao:function(){var t=this;this.busy=!0,this.$planoAcaoService.findPlanosAcao(this.empresa.sigla,this.monitoracaoData.tipoAtivo,this.monitoracaoData.idFaseMonitoracao,this.monitoracaoData.idElemento).then((function(e){t.planoAcoes=e.data,t.busy=!1})).catch((function(e){t.busy=!1,t.$notify({title:"Erro",text:e.response?e.response.data.message:e,type:"error"})}))},lockedEdit:function(){return!1!==this.isExterno||!0!==this.isBlockedEditAux}}},f=o(42),component=Object(f.a)(d,(function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("b-card",{staticClass:"mt-3"},[o("div",{staticClass:"mt-3",attrs:{slot:"header"},slot:"header"},[o("h4",[t._v("Plano de Ação")])]),t._v(" "),o("b-row",[o("b-col",{attrs:{md:"12"}},[0===t.planoAcoes.length?o("div",[o("b-alert",{attrs:{show:"",variant:"info"}},[t._v("Não existe plano de ação para essa monitoração.")])],1):t._e()])],1),t._v(" "),1===t.planoAcoes.length?o("div",[o("b-row",[o("b-col",{attrs:{md:"10"}},[o("b-form-group",{attrs:{label:"Descrição:"}},[o("b-form-textarea",{attrs:{disabled:t.lockedEdit(),rows:"3","max-rows":"6",maxlength:"30",placeholder:"Informe a descrição do plano de ação desta monitoração."},model:{value:t.planoAcoes[0].descricao,callback:function(e){t.$set(t.planoAcoes[0],"descricao",e)},expression:"planoAcoes[0].descricao"}})],1)],1),t._v(" "),o("b-col",{attrs:{md:"2"}},[o("b-form-group",{attrs:{label:"Prazo:"}},[o("b-form-input",{attrs:{id:"datCriacao",value:t.planoAcoes[0].prazo,placeholder:"Informe o prazo",disabled:t.lockedEdit()}})],1)],1)],1)],1):t._e(),t._v(" "),t.planoAcoes.length>1?o("div",[o("b-row",[o("b-col",{attrs:{md:"12"}},[o("b-table",{ref:"selectableTable",staticClass:"mt-3",attrs:{striped:"",stacked:"md",hover:"",items:t.planoAcoes,fields:t.fieldsPlanoAcao,responsive:"sm",busy:t.busy},scopedSlots:t._u([{key:"table-busy",fn:function(){return[o("div",{staticClass:"text-center text-info my-2"},[o("b-spinner",{staticClass:"align-middle"}),t._v(" "),o("strong",[t._v("Carregando...")])],1)]},proxy:!0}],null,!1,3077067912)})],1)],1)],1):t._e()],1)}),[],!1,null,null,null);e.default=component.exports}}]);
//# sourceMappingURL=c41e4c4-1.2.11.js.map