1 line
3.0 KiB
JavaScript
1 line
3.0 KiB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([[14],{408:function(t,e,o){var content=o(506);"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,o(30).default)("10870322",content,!0,{sourceMap:!1})},416:function(t,e,o){"use strict";o.r(e);o(16);var n={data:function(){return{isFullPage:!0,file:"",idServicio:""}},methods:{"validarTamaño":function(){this.file.size>2e7&&(this.toast(),this.file="")},toast:function(){this.$buefy.toast.open({message:"El archivo excede el tamaño permitido",type:"is-danger"})},Enviar:function(){var t=this,e=this.$buefy.loading.open({container:this.isFullPage?null:this.$refs.element.$el}),data={idServicio:this.idServicio},o=new FormData;o.append("data",JSON.stringify(data)),o.append("cartaAceptacion",this.file),console.log(o),axios.put("".concat("https://venus.acatlan.unam.mx/ss-pruebas","/servicio/carta_aceptacion"),o,{headers:{"Content-Type":"multipart/form-data"}}).then((function(o){console.log(o.data),e.close(),t.$buefy.dialog.alert({title:"Success",message:"Se enviaron los datos correctamente",type:"is-success",hasIcon:!0,icon:"checkbox-marked-circle",iconPack:"mdi",ariaRole:"alertdialog",ariaModal:!0})})).catch((function(o){e.close(),t.$buefy.dialog.alert({title:"Error",message:o.response.data.message,type:"is-danger",hasIcon:!0,icon:"alert-circle",iconPack:"mdi",ariaRole:"alertdialog",ariaModal:!0})})).finally((function(){t.$router.push("/responsable")}))},getIdLocal:function(){this.idServicio=localStorage.getItem("idServicio")}},watch:{file:function(t,e){this.validarTamaño()}},created:function(){this.getIdLocal()}},c=(o(505),o(8)),component=Object(c.a)(n,(function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"container"},[o("h3",{staticClass:"title is-4 mt-6"},[t._v("\n Carta de aceptación (en formato .PDF. No se aceptan fotos).\n ")]),t._v(" "),o("b-field",[o("b-upload",{attrs:{"drag-drop":"",type:"is-black",expanded:"",accept:"application/pdf"},model:{value:t.file,callback:function(e){t.file=e},expression:"file"}},[o("section",{staticClass:"section"},[o("div",{staticClass:"content has-text-centered"},[o("p",[o("b-icon",{attrs:{icon:"upload",size:"is-large"}})],1),t._v(" "),o("p",[t._v("\n "+t._s(t.file.name||"Arrastra aquí tu archivo o da click para buscar")+"\n ")]),t._v(" "),o("p",[t._v("Tamaño máximo para el archivo: 20MB")])])])])],1),t._v(" "),o("b-field",{staticClass:"centro"},[o("b-button",{staticClass:"border-info my-5",attrs:{disabled:""==t.file,type:"is-info"}},[t._v("Enviar")])],1)],1)}),[],!1,null,null,null);e.default=component.exports},505:function(t,e,o){"use strict";o(408)},506:function(t,e,o){(e=o(29)(!1)).push([t.i,".centro{text-align:center}",""]),t.exports=e},520:function(t,e,o){"use strict";o.r(e);var n={components:{CartaAceptacion:o(416).default}},c=o(8),component=Object(c.a)(n,(function(){var t=this.$createElement,e=this._self._c||t;return e("section",[e("CartaAceptacion")],1)}),[],!1,null,null,null);e.default=component.exports;installComponents(component,{CartaAceptacion:o(416).default})}}]); |