(window.webpackJsonp=window.webpackJsonp||[]).push([[243],{1450:function(t,o,e){"use strict";e.r(o);e(6),e(5),e(7),e(4),e(12),e(8),e(13);var n=e(2),r=e(78),d=e(307);function c(object,t){var o=Object.keys(object);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(object);t&&(e=e.filter((function(t){return Object.getOwnPropertyDescriptor(object,t).enumerable}))),o.push.apply(o,e)}return o}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(o){Object(n.a)(t,o,source[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(source)):c(Object(source)).forEach((function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(source,o))}))}return t}var f={name:"ModalCondicionantes",components:{ValidationProvider:d.ValidationProvider,ValidationObserver:d.ValidationObserver},props:{dados:{type:Object,default:function(){return{}}},findStatusCondicionante:{type:Function,default:function(){return[]}}},data:function(){return{}},computed:l(l({},Object(r.c)({empresa:"empresa/empresaAtual"})),{},{dadosComputados:{get:function(){return this.dados},set:function(t){this.$emit("update:dados",t)}}}),mounted:function(){var t=this;this.$root.$on("bv::modal::show",(function(o,e){"editCondicionantes"===e&&void 0===t.dadosComputados.id&&(t.dadosComputados={})}))},methods:{save:function(){var t=this;this.$licencaService.saveStatusCondicionante(this.dadosComputados).then((function(){void 0!==t.dadosComputados.id?t.$notify({title:"Confirmação",text:"Status de Condicionantes alterada com sucesso.",type:"success"}):t.$notify({title:"Confirmação",text:"Status de Condicionantes incluída com sucesso.",type:"success"}),t.$bvModal.hide("editCondicionantes"),t.findStatusCondicionante()})).catch((function(o){t.$notifyApiError(o,"Erro ao salvar condicionantes")}))},closeModal:function(){this.$bvModal.hide("editCondicionantes")},deleteStatusCondicionante:function(){var t=this;this.$licencaService.deleteStatusCondicionante(this.dadosComputados.id).then((function(){t.$bvModal.hide("editCondicionantes"),t.findStatusCondicionante(),t.$notify({title:"Confirmação",text:"Status de Condicionantes excluído com sucesso.",type:"success"})})).catch((function(o){t.$notifyApiError(o,"Erro ao excluir condicionantes")}))},getValidationState:function(t){var o=t.dirty,e=t.validated,n=t.valid;return o||e?n:null}}},m=e(42),component=Object(m.a)(f,(function(){var t=this,o=t.$createElement,e=t._self._c||o;return e("b-modal",{attrs:{id:"editCondicionantes",size:"md",centered:"","hide-header-close":"","hide-footer":""},scopedSlots:t._u([{key:"modal-header",fn:function(){return[e("h4",[t._v("\n      "+t._s(null==t.dadosComputados.id?"Adicionar Status das Condicionantes":"Editar Status das Condicionantes")+"\n    ")])]},proxy:!0}])},[t._v(" "),e("validation-observer",{ref:"observer",scopedSlots:t._u([{key:"default",fn:function(o){var n=o.handleSubmit;return[e("b-form",{on:{submit:function(o){return o.stopPropagation(),o.preventDefault(),n(t.save)}}},[e("b-row",[e("b-col",{attrs:{sm:"12"}},[e("validation-provider",{attrs:{name:"descricao",rules:{required:!0}},scopedSlots:t._u([{key:"default",fn:function(o){return[e("b-form-group",{attrs:{label:"Descrição:"}},[e("b-form-input",{attrs:{state:t.getValidationState(o)},model:{value:t.dadosComputados.descricao,callback:function(o){t.$set(t.dadosComputados,"descricao",o)},expression:"dadosComputados.descricao"}})],1)]}}],null,!0)})],1)],1),t._v(" "),e("b-row",{staticClass:"border-top"},[e("b-col",{staticClass:"pl-2",attrs:{md:"8"}},[e("b-button",{staticClass:"my-2 ml-2 rounded",attrs:{size:"sm",variant:"primary",type:"submit"}},[e("fa-icon",{attrs:{icon:"save"}}),t._v(" "),e("span",{staticClass:"ml-1"},[t._v("Salvar")])],1),t._v(" "),e("b-button",{staticClass:"my-2 ml-2 rounded",attrs:{size:"sm",variant:"outline-secondary"},on:{click:t.closeModal}},[e("fa-icon",{attrs:{icon:"times"}}),t._v(" "),e("span",{staticClass:"ml-1"},[t._v("Cancelar")])],1)],1),t._v(" "),e("b-col",{staticClass:"d-flex justify-content-end",attrs:{md:"4"}},[void 0!==t.dadosComputados.id?e("b-button",{staticClass:"my-2 ml-2 rounded",attrs:{size:"sm",variant:"outline-danger"},on:{click:function(o){return t.deleteStatusCondicionante()}}},[e("fa-icon",{attrs:{icon:"trash-alt"}}),t._v(" "),e("span",{staticClass:"ml-1"},[t._v("Excluir")])],1):t._e()],1)],1)],1)]}}])})],1)}),[],!1,null,null,null);o.default=component.exports}}]);
//# sourceMappingURL=54c149d-1.2.11.js.map