(window.webpackJsonp=window.webpackJsonp||[]).push([[343,342],{1153:function(t,e,r){"use strict";r.r(e);r(6),r(5),r(7),r(12),r(8),r(13);var o=r(2),n=(r(4),r(31),r(32),r(398),r(165),r(50),r(78));function c(object,t){var e=Object.keys(object);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(object);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(object,t).enumerable}))),e.push.apply(e,r)}return e}var l={data:function(){return{exportFile:null,optionsExport:[{value:"CSV",text:"CSV"},{value:"XLS",text:"XLS"}]}},computed:function(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(o.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}({},Object(n.c)({empresa:"empresa/empresaAtual"})),methods:{exportObra:function(){var t=this;this.exportFile?this.$obraService.exportCSVOrXLS(this.exportFile,this.empresa.sigla).then((function(e){var link=document.createElement("a");"CSV"===t.exportFile?(link.href=URL.createObjectURL(new Blob([e.data],{type:"text/csv"})),link.download="relatorio.csv"):(link.href=URL.createObjectURL(new Blob([e.data],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"})),link.download="relatorio.xls"),document.body.append(link),link.click(),link.remove(),setTimeout((function(){return URL.revokeObjectURL(link.href)}),5e3)})).catch((function(e){t.exportFile=null,t.$notify({title:"Erro",text:e.response?e.response.data.message:e,type:"error"})})):this.$notify({title:"Erro",text:"Selecione o tipo de exportação",type:"error"})}}},d=l,f=r(42),component=Object(f.a)(d,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("b-modal",{attrs:{id:"exportObrasModal",title:"Selecione o tipo de arquivo",size:"sm",centered:"","hide-footer":""}},[r("b-row",[r("b-col",{attrs:{sm:"12",md:"12",xl:"12"}},[r("b-form-group",[r("b-form-select",{attrs:{options:t.optionsExport},scopedSlots:t._u([{key:"first",fn:function(){return[r("b-form-select-option",{attrs:{disabled:"",value:null}},[t._v("\n              Selecione...\n            ")])]},proxy:!0}]),model:{value:t.exportFile,callback:function(e){t.exportFile=e},expression:"exportFile"}})],1)],1),t._v(" "),r("b-col",[r("div",{staticClass:"d-flex justify-content-end"},[r("b-button",{staticClass:"rounded",attrs:{size:"sm",variant:"primary"},on:{click:function(e){return t.exportObra()}}},[r("fa-icon",{attrs:{icon:"file-csv"}}),t._v("   Exportar\n        ")],1)],1)])],1)],1)}),[],!1,null,null,null);e.default=component.exports},1339:function(t,e,r){"use strict";r.r(e);var o={components:{ExportObrasModal:r(1153).default},props:{title:{type:String,default:function(){return""},required:!0},add:{type:Function,default:function(){return!1},required:!1},search:{type:Function,default:function(){return!1},required:!1}},data:function(){return{searchText:""}}},n=r(42),component=Object(n.a)(o,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("b-row",[r("b-col",{attrs:{cols:"12"}},[r("b-card",[r("div",{staticClass:"mt-4 mx-2",attrs:{slot:"header"},slot:"header"},[r("b-row",[r("b-col",{attrs:{cols:"10"}},[r("h2",{staticClass:"primary"},[t._v(t._s(t.title))])]),t._v(" "),r("b-col",{attrs:{cols:"2"}},[r("div",{staticClass:"d-flex justify-content-end"},[r("b-button",{staticClass:"rounded",attrs:{id:"btnAdicionar",size:"sm",variant:"primary"},on:{click:t.add}},[r("FaIcon",{staticClass:"mr-1",attrs:{icon:"plus"}}),t._v(" "),r("span",[t._v("Adicionar")])],1)],1)])],1)],1),t._v(" "),r("b-row",[r("b-col",[r("b-form",{on:{submit:function(e){return e.preventDefault(),t.search(t.searchText)}}},[r("b-row",[r("b-col",{attrs:{cols:"6"}},[r("b-form-group",{attrs:{label:"Localizar:"}},[r("b-form-input",{attrs:{id:"pesquisa",placeholder:"Digite sua pesquisa...",autofocus:"","aria-autocomplete":"true"},model:{value:t.searchText,callback:function(e){t.searchText=e},expression:"searchText"}})],1)],1)],1),t._v(" "),r("b-row",[r("b-col",[r("b-button",{staticClass:"mt-4 rounded",attrs:{id:"btnPesquisar",variant:"primary",size:"sm"},on:{click:function(e){return t.search(t.searchText)}}},[r("FaIcon",{staticClass:"mr-1",attrs:{icon:"search"}}),t._v(" "),r("span",[t._v("Pesquisar")])],1),t._v(" "),r("b-button",{directives:[{name:"b-modal",rawName:"v-b-modal.exportObrasModal",modifiers:{exportObrasModal:!0}}],staticClass:"mt-4 rounded",attrs:{id:"exportObrasModal",size:"sm",variant:"outline-primary"}},[r("FaIcon",{staticClass:"mr-1",attrs:{icon:"file-csv"}}),t._v(" "),r("span",[t._v("Exportar")])],1)],1)],1)],1)],1)],1),t._v(" "),r("div"),t._v(" "),r("ExportObrasModal")],1)],1)],1)}),[],!1,null,null,null);e.default=component.exports}}]);
//# sourceMappingURL=ace51ac-1.2.11.js.map