(window.webpackJsonp=window.webpackJsonp||[]).push([[451],{1494:function(e,o,t){"use strict";t.r(o);t(15),t(4),t(31),t(32),t(398),t(165),t(25),t(50);var n={props:{cancelModal:{type:Function,default:function(){},required:!0}},data:function(){return{payload:{descricao:""}}},mounted:function(){},methods:{save:function(){},cancelHistoricosModal:function(){this.$bvModal.hide("editHistoricoModal")},uploadAnexoProjeto:function(){this.$bvModal.hide("modalAnexos")},uploadFile:function(){this.anexo=this.$refs.file.files[0]},deleteAnexoProjeto:function(){var e=this;"_projeto"!==this.$route.params.projeto?this.$projetosService.deleteAnexoProjeto(this.empresa.sigla,this.$route.params.projeto,this.anexo.id.sequencia).then((function(){e.anexo=void 0,e.$notify({title:"Exclusão",text:"Ficha excluída com sucesso.",type:"success"})})).catch((function(o){e.$notify({title:"Erro",text:o.response?o.response.data.message:o,type:"error"})})):this.anexo=""},hasArquivo:function(){return!!this.anexo},download:function(){if(this.anexo)if(this.anexo.anexo){var a=document.createElement("a"),e="".concat("/api","/downloads/").concat(this.empresa.sigla,"/anexos/LAB/").concat(this.anexo.anexo.uuid);a.setAttribute("target","_blank"),a.setAttribute("href",e),a.setAttribute("download",this.anexo.anexo.nome),console.log(a.attributes),a.click(),window.URL.revokeObjectURL(e),a.remove()}else{(new FileReader).readAsDataURL(this.anexo);var link=document.createElement("a");link.href=URL.createObjectURL(new Blob([this.anexo],{type:this.anexo.types})),link.download=this.anexo.name,document.body.append(link),link.click(),link.remove(),setTimeout((function(){return URL.revokeObjectURL(link.href)}),6e3)}}}},r=t(42),component=Object(r.a)(n,(function(){var e=this,o=e.$createElement,t=e._self._c||o;return t("b-modal",{attrs:{id:"editHistoricoModal",title:"Históricos - Adicionar",size:"lg",centered:"","hide-header-close":"","hide-footer":""}},[t("b-form",[t("b-row",[t("b-col",{attrs:{sm:"6"}},[t("b-form-group",{attrs:{label:"Data:"}},[t("b-form-input",{attrs:{type:"date"}})],1)],1),e._v(" "),t("b-col",{attrs:{sm:"6"}},[t("b-form-group",{attrs:{label:"Responsável:"}},[t("b-form-input")],1)],1),e._v(" "),t("b-col",{attrs:{sm:"6"}},[t("b-form-group",{attrs:{label:"Acesso:"}},[t("b-form-select")],1)],1),e._v(" "),t("b-col",{attrs:{sm:"6"}},[t("b-form-group",{attrs:{label:"Tipo de Anexo:"}},[t("b-form-select")],1)],1),e._v(" "),t("b-col",{attrs:{cols:"12"}},[t("b-form-group",{attrs:{label:e.anexo?"Download":"Upload anexo:"}},[e.hasArquivo()?e._e():t("b-form-file",{ref:"file",attrs:{id:"file",accept:".xlsx, .xls, .pdf, or .docx",size:"sm","browse-text":"Adicionar",placeholder:"Upload do Projeto - Anexo",readonly:e.hasArquivo()},on:{change:e.uploadFile},model:{value:e.anexo,callback:function(o){e.anexo=o},expression:"anexo"}}),e._v(" "),e.hasArquivo()?t("div",{staticClass:"\n              d-flex\n              justify-content-between\n              align-items-center\n              border\n              pointer\n            ",class:{"d-none":!e.hasArquivo()}},[t("span",{staticClass:"p-0 m-0",on:{click:function(o){return e.download()}}},[e._v(e._s(e.anexo?e.anexo.anexo?e.anexo.anexo.nome:"Anexo Incluído":"Nenhum Anexo"))]),e._v(" "),t("b-button",{directives:[{name:"b-popover",rawName:"v-b-popover.hover.top",value:"Excluir Anexo",expression:"'Excluir Anexo'",modifiers:{hover:!0,top:!0}}],staticClass:"my-2 ml-2 rounded",attrs:{size:"sm",variant:"outline-danger"},on:{click:function(o){return e.deleteAnexoProjeto()}}},[t("fa-icon",{attrs:{icon:"trash-alt"}})],1)],1):e._e()],1)],1),e._v(" "),t("b-col",{attrs:{sm:"12"}},[t("b-form-group",{attrs:{label:"Observação:"}},[t("b-form-textarea",{attrs:{size:"lg",placeholder:"Digite a observação..."}})],1)],1)],1),e._v(" "),t("b-row",[t("b-col",[t("b-btn",{staticClass:"my-2 ml-2 rounded",attrs:{size:"sm",variant:"primary",type:"submit"}},[t("fa-icon",{attrs:{icon:"save"}}),e._v(" "),t("span",{staticClass:"ml-1"},[e._v("Salvar")])],1),e._v(" "),t("b-btn",{staticClass:"my-2 ml-2 rounded",attrs:{size:"sm",variant:"outline-secondary"},on:{click:e.cancelModal}},[t("fa-icon",{attrs:{icon:"times"}}),e._v(" "),t("span",{staticClass:"ml-1"},[e._v("Cancelar")])],1)],1)],1)],1)],1)}),[],!1,null,null,null);o.default=component.exports}}]);
//# sourceMappingURL=5555590-1.2.11.js.map