(window.webpackJsonp=window.webpackJsonp||[]).push([[411],{1902:function(t,e,n){"use strict";n.r(e);n(5),n(7),n(4),n(12),n(8),n(13),n(23),n(40),n(31),n(17),n(41),n(43),n(32);var o=n(2),r=(n(6),n(50),n(25),n(78)),l=n(207),c=n.n(l);function f(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return d(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return d(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,o=function(){};return{s:o,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,l=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return l=t.done,t},e:function(t){c=!0,r=t},f:function(){try{l||null==n.return||n.return()}finally{if(c)throw r}}}}function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function v(object,t){var e=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(object,t).enumerable}))),e.push.apply(e,n)}return e}function m(t){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?v(Object(source),!0).forEach((function(e){Object(o.a)(t,e,source[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(source)):v(Object(source)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(source,e))}))}return t}var h={name:"DepositoModalAnexo",props:{anexos:{type:Array,default:function(){return[]}},findAnexos:{type:Function,default:function(){return{}}},busyAnexo:{type:Boolean,default:function(){return!1}}},data:function(){return{anexo:{},validations:[]}},computed:m(m({},Object(r.c)({empresa:"empresa/empresaAtual"})),{},{busy:{get:function(){return this.busyAnexo},set:function(t){this.$emit("update:busyAnexo",t)}}}),mounted:function(){var t=this;this.$root.$on("bv::modal::show",(function(e,n){"modalAnexoOficio"===n&&(t.anexo={})}))},methods:{cancelModalAnexo:function(){this.anexo={},this.$bvModal.hide("modalAnexoOficio")},saveAnexo:function(){var t=this,e={};void 0===this.anexo.arquivo&&this.$notify({title:"Erro",text:'Preencha o campo "Anexo"',type:"error"}),null!=this.anexo.arquivo&&void 0!==this.anexo.arquivo&&""!==this.anexo.arquivo||(e.arquivo="dirty");var n=Object.keys(e);if(console.log("validations==>",n),!(n.length>0)){this.busy=!0;var o=[],r="",l=new FileReader;l.onload=function(t){o.push(t.target.result);var e,n=f(o);try{for(n.s();!(e=n.n()).done;){var l=e.value;r=l}}catch(t){n.e(t)}finally{n.f()}},l.readAsDataURL(this.anexo.arquivo);var d=this.anexos;setTimeout((function(){d.push({id:t.anexos.length+1,name:t.anexo.arquivo.name,file:t.anexo.arquivo,uuid:void 0,url:r,datHorUpload:c()()}),t.busy=!1}),3e3),console.log("All Anexos=>",d),this.$emit("input",d),this.$bvModal.hide("modalAnexoOficio")}},getValidationState:function(t){return null!==this.anexo[t]&&void 0!==this.anexo[t]&&""!==this.anexo[t]&&null}}},y=n(42),component=Object(y.a)(h,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("b-modal",{attrs:{id:"modalAnexoOficio",centered:"","hide-header-close":"","hide-footer":""},scopedSlots:t._u([{key:"modal-title",fn:function(){return[t._v("Adicionar anexo")]},proxy:!0}])},[t._v(" "),n("b-form",{on:{submit:function(e){return e.stopPropagation(),e.preventDefault(),t.saveAnexo.apply(null,arguments)}}},[n("b-row",[n("b-col",{attrs:{md:"12",xl:"12"}},[n("b-form-group",{attrs:{label:"Anexo"}},[n("b-form-file",{attrs:{name:"anexo",placeholder:"Escolha um arquivo ou solte-o aqui...","drop-placeholder":"Solte o arquivo aqui...","browse-text":"Escolher",state:t.getValidationState("anexo")},model:{value:t.anexo.arquivo,callback:function(e){t.$set(t.anexo,"arquivo",e)},expression:"anexo.arquivo"}})],1)],1),t._v(" "),n("b-col",{staticClass:"pl-2",attrs:{md:"12"}},[n("b-button",{staticClass:"my-2 ml-2 rounded",attrs:{size:"sm",variant:"success",type:"submit"}},[n("fa-icon",{attrs:{icon:"save"}}),t._v(" "),n("span",{staticClass:"ml-1"},[t._v("Salvar")])],1),t._v(" "),n("b-button",{staticClass:"my-2 ml-2 rounded",attrs:{size:"sm",variant:"outline-secondary"},on:{click:function(e){return t.cancelModalAnexo()}}},[n("fa-icon",{attrs:{icon:"times"}}),t._v(" "),n("span",{staticClass:"ml-1"},[t._v("Cancelar")])],1)],1)],1)],1)],1)}),[],!1,null,null,null);e.default=component.exports}}]);
//# sourceMappingURL=3f419f7-1.2.11.js.map