(window.webpackJsonp=window.webpackJsonp||[]).push([[475],{1195: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),n=e(307),c=e(78);function l(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 d(o){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?l(Object(source),!0).forEach((function(t){Object(r.a)(o,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(source)):l(Object(source)).forEach((function(t){Object.defineProperty(o,t,Object.getOwnPropertyDescriptor(source,t))}))}return o}var m={components:{ValidationProvider:n.ValidationProvider,ValidationObserver:n.ValidationObserver},props:{racomPlanoAcao:{type:Array,default:function(){return[]}},findPlanoByRacom:{type:Function,default:function(){return!1}}},data:function(){return{planoAcao:{},nomeUsuario:""}},computed:d(d({},Object(c.c)({empresa:"empresa/empresaAtual",idRacom:"racom/idRacom",usuario:"usuario/usuario"})),{},{racomCausasAux:{get:function(){return this.racomPlanoAcao},set:function(o){this.$emit("update:racomPlanoAcao",o)}}}),mounted:function(){var o=this;this.$root.$on("bv::modal::show",(function(t,e){"modalPlanoAcao"===e&&(o.planoAcao={},o.nomeUsuario=o.usuario.nomeUsuario)}))},methods:{cancelModalPlanoAcao:function(){this.$bvModal.hide("modalPlanoAcao"),this.planoAcao={},this.nomeUsuario=""},savePlanoAcao:function(){var o=this;if(this.planoAcao.idResponsavel=this.usuario.refId,this.idRacom){var t={descricao:this.planoAcao.descricao,idResponsavel:this.planoAcao.idResponsavel,prazo:this.planoAcao.prazo};this.$racomService.savePlanoAcao(this.empresa.sigla,this.idRacom,t).then((function(){o.$notify({title:"Confirmação",text:"Plano de Ação adicionado com sucesso.",type:"success"}),o.findPlanoByRacom(),o.$bvModal.hide("modalPlanoAcao")})).catch((function(t){o.$notify({title:"Erro",text:t.response?t.response.data.message:t,type:"error"})}))}else{var e=this.racomPlanoAcao,r={descricao:this.planoAcao.descricao,idResponsavel:this.planoAcao.idResponsavel,prazo:this.planoAcao.prazo,responsavel:{nome:this.usuario.nomeUsuario}};e.push(r),this.$emit("input",e),this.$bvModal.hide("modalPlanoAcao")}},getValidationState:function(o){var t=o.dirty,e=o.validated,r=o.valid;return t||e?void 0===r?null:r:null}}},f=e(42),component=Object(f.a)(m,(function(){var o=this,t=o.$createElement,e=o._self._c||t;return e("b-modal",{attrs:{id:"modalPlanoAcao",title:"Adicionar Plano de Ação",centered:"","hide-header-close":"","hide-footer":""}},[e("validation-observer",{ref:"observer",scopedSlots:o._u([{key:"default",fn:function(t){var r=t.handleSubmit;return[e("b-form",{on:{submit:function(t){return t.stopPropagation(),t.preventDefault(),r(o.savePlanoAcao)}}},[e("b-row",[e("b-col",{attrs:{md:"8"}},[e("b-form-group",{attrs:{label:"Responsável"}},[e("b-form-input",{staticClass:"my-2",attrs:{type:"text",disabled:""},model:{value:o.nomeUsuario,callback:function(t){o.nomeUsuario=t},expression:"nomeUsuario"}})],1)],1),o._v(" "),e("b-col",{attrs:{md:"4"}},[e("validation-provider",{attrs:{name:"prazo",rules:{required:!0}},scopedSlots:o._u([{key:"default",fn:function(t){return[e("b-form-group",{attrs:{label:"Prazo"}},[e("b-form-input",{staticClass:"my-2",attrs:{type:"number",state:o.getValidationState(t)},model:{value:o.planoAcao.prazo,callback:function(t){o.$set(o.planoAcao,"prazo",t)},expression:"planoAcao.prazo"}})],1)]}}],null,!0)})],1),o._v(" "),e("b-col",{attrs:{md:"12"}},[e("validation-provider",{attrs:{name:"descricao",rules:{required:!0}},scopedSlots:o._u([{key:"default",fn:function(t){return[e("b-form-group",{attrs:{label:"Descrição"}},[e("b-form-textarea",{staticClass:"my-2",attrs:{state:o.getValidationState(t),name:"descricao",rows:"3"},model:{value:o.planoAcao.descricao,callback:function(t){o.$set(o.planoAcao,"descricao",t)},expression:"planoAcao.descricao"}})],1)]}}],null,!0)})],1),o._v(" "),e("b-col",{staticClass:"mt-3 pl-2",attrs:{md:"8"}},[e("b-button",{staticClass:"my-2 ml-2 rounded",attrs:{size:"sm",variant:"success",type:"submit"}},[e("fa-icon",{attrs:{icon:"save"}}),o._v(" "),e("span",{staticClass:"ml-1"},[o._v("Salvar")])],1),o._v(" "),e("b-button",{staticClass:"my-2 ml-2 rounded",attrs:{size:"sm",variant:"outline-secondary"},on:{click:function(t){return o.cancelModalPlanoAcao()}}},[e("fa-icon",{attrs:{icon:"times"}}),o._v(" "),e("span",{staticClass:"ml-1"},[o._v("Cancelar")])],1)],1)],1)],1)]}}])})],1)}),[],!1,null,null,null);t.default=component.exports}}]);
//# sourceMappingURL=cd32842-1.2.11.js.map