(window.webpackJsonp=window.webpackJsonp||[]).push([[346],{1153:function(e,t,r){"use strict";r.r(t);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,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(object);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,r)}return t}var l={data:function(){return{exportFile:null,optionsExport:[{value:"CSV",text:"CSV"},{value:"XLS",text:"XLS"}]}},computed:function(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?c(Object(source),!0).forEach((function(t){Object(o.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):c(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}({},Object(n.c)({empresa:"empresa/empresaAtual"})),methods:{exportObra:function(){var e=this;this.exportFile?this.$obraService.exportCSVOrXLS(this.exportFile,this.empresa.sigla).then((function(t){var link=document.createElement("a");"CSV"===e.exportFile?(link.href=URL.createObjectURL(new Blob([t.data],{type:"text/csv"})),link.download="relatorio.csv"):(link.href=URL.createObjectURL(new Blob([t.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(t){e.exportFile=null,e.$notify({title:"Erro",text:t.response?t.response.data.message:t,type:"error"})})):this.$notify({title:"Erro",text:"Selecione o tipo de exportação",type:"error"})}}},f=l,d=r(42),component=Object(d.a)(f,(function(){var e=this,t=e.$createElement,r=e._self._c||t;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:e.optionsExport},scopedSlots:e._u([{key:"first",fn:function(){return[r("b-form-select-option",{attrs:{disabled:"",value:null}},[e._v("\n              Selecione...\n            ")])]},proxy:!0}]),model:{value:e.exportFile,callback:function(t){e.exportFile=t},expression:"exportFile"}})],1)],1),e._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(t){return e.exportObra()}}},[r("fa-icon",{attrs:{icon:"file-csv"}}),e._v("   Exportar\n        ")],1)],1)])],1)],1)}),[],!1,null,null,null);t.default=component.exports}}]);
//# sourceMappingURL=e62e9e8-1.2.11.js.map