(window.webpackJsonp=window.webpackJsonp||[]).push([[470],{1194:function(e,o,r){"use strict";r.r(o);r(6),r(5),r(7),r(4),r(12),r(8),r(13);var t=r(2),c=(r(136),r(307)),n=r(78),l=r(207),d=r.n(l);function m(object,e){var o=Object.keys(object);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(object);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),o.push.apply(o,r)}return o}function f(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?m(Object(source),!0).forEach((function(o){Object(t.a)(e,o,source[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):m(Object(source)).forEach((function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(source,o))}))}return e}var v={components:{ValidationProvider:c.ValidationProvider,ValidationObserver:c.ValidationObserver},props:{correcao:{type:Object,default:function(){return{}}},correcoes:{type:Array,default:function(){return[]}},solucoesEscolhidas:{type:Array,default:function(){return[]}},idRac:{type:Number,default:function(){return null}}},data:function(){return{correcaoLocal:null}},computed:f(f({},Object(n.c)({usuario:"usuario/usuario",empresa:"empresa/empresaAtual",empresas:"empresa/empresas",idRacom:"racom/idRacom"})),{},{correcoesComputadas:{get:function(){return this.correcoes},set:function(e){this.$emit("update:correcoes",e)}}}),mounted:function(){var e=this;this.$root.$on("bv::modal::show",(function(o,r){"modalCorrecoes"===r&&(e.correcaoLocal=null,console.log(e.solucoesEscolhidas))}))},methods:{cancelModalCorrecoes:function(){this.$bvModal.hide("modalCorrecoes")},saveCorrecoes:function(){var e=this,o={descricao:this.correcaoLocal,id:{},responsavel:{nome:this.usuario.nomeUsuario},idResponsavel:this.usuario.refId,datHorCadastro:d()()};if(this.idRacom)o.id.idRacom=this.idRacom,this.$racService.saveCorrecoesRac(o,this.empresa.sigla,this.idRacom).then((function(){e.$bvModal.hide("modalCorrecoes"),e.$notify({title:"Confirmação",text:"Correção incluída com sucesso.",type:"success"}),e.findCorrecoes()})).catch((function(o){e.$bvModal.hide("modalCorrecoes"),e.$bvModal.hide("racDetail"),e.$notify({title:"Erro",text:o.response?o.response.data.message:o,type:"error"})}));else{var r=this.correcoesComputadas;r.push(o),this.$emit("input",r),this.$bvModal.hide("modalCorrecoes")}},getValidationState:function(e){var o=e.dirty,r=e.validated,t=e.valid;return o||r?void 0===t?null:t:null}}},h=r(42),component=Object(h.a)(v,(function(){var e=this,o=e.$createElement,r=e._self._c||o;return r("b-modal",{attrs:{id:"modalCorrecoes",title:"Adicionar Correção",centered:"","hide-header-close":"","hide-footer":""}},[r("validation-observer",{ref:"observer",scopedSlots:e._u([{key:"default",fn:function(o){var t=o.handleSubmit;return[r("b-form",{on:{submit:function(o){return o.stopPropagation(),o.preventDefault(),t(e.saveCorrecoes)}}},[r("b-row",[r("b-col",{attrs:{sm:"12",md:"12",xl:"12"}},[r("validation-provider",{attrs:{name:"correcao",rules:{required:!0}},scopedSlots:e._u([{key:"default",fn:function(o){return[r("b-form-group",{attrs:{label:"Correção"}},[r("b-form-textarea",{staticClass:"my-2",attrs:{state:e.getValidationState(o),name:"correcao",autofocus:"",rows:"3"},model:{value:e.correcaoLocal,callback:function(o){e.correcaoLocal=o},expression:"correcaoLocal"}})],1)]}}],null,!0)})],1),e._v(" "),r("b-col",{staticClass:"pl-2",attrs:{md:"8"}},[r("b-button",{staticClass:"my-2 ml-2 rounded",attrs:{size:"sm",variant:"success",type:"submit"}},[r("fa-icon",{attrs:{icon:"save"}}),e._v(" "),r("span",{staticClass:"ml-1"},[e._v("Salvar")])],1),e._v(" "),r("b-button",{staticClass:"my-2 ml-2 rounded",attrs:{size:"sm",variant:"outline-secondary"},on:{click:function(o){return e.cancelModalCorrecoes()}}},[r("fa-icon",{attrs:{icon:"times"}}),e._v(" "),r("span",{staticClass:"ml-1"},[e._v("Cancelar")])],1)],1)],1)],1)]}}])})],1)}),[],!1,null,null,null);o.default=component.exports}}]);
//# sourceMappingURL=6fcbaef-1.2.11.js.map