(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0de334"],{8545:function(e,t,a){"use strict";a.r(t);var n=a("62ad"),i=a("a523"),r=a("8fea"),o=a("132d"),s=a("adda"),c=a("da13"),l=a("5d23"),u=a("0fd9"),p=a("8654"),y=a("71d9"),d=a("3a2f"),f=function(){var e=this,t=e._self._c;return t(i["a"],{attrs:{fluid:""}},[t(c["a"],{attrs:{"three-line":""}},[t(l["g"],[t("p",{staticClass:"display-1 text--primary"},[e._v(" "+e._s(e.$t("menu.storage_device_type"))+" ")])])],1),t(r["a"],{staticClass:"agTable",attrs:{headers:e.headers,items:e.storagesTypesByCompany,loading:e.loading,"sort-by":e.sortBy,search:e.search,"sort-desc":e.sortDesc,"no-results-text":e.$t("general.ui.not_search_found"),"no-data-text":e.$t("general.ui.not_data_found"),"loading-text":e.$t("general.notification.loadData"),"footer-props":{itemsPerPageText:e.$t("general.table.itemsPerPageText"),pageText:"{0}-{1} "+e.$t("general.table.pageText")+" {2}"}},on:{"update:sortBy":function(t){e.sortBy=t},"update:sort-by":function(t){e.sortBy=t},"update:sortDesc":function(t){e.sortDesc=t},"update:sort-desc":function(t){e.sortDesc=t}},scopedSlots:e._u([{key:"top",fn:function(){return[t(y["a"],{attrs:{flat:"",color:"white"}},[t(u["a"],{staticClass:"d-flex justify-space-between align-baseline"},[t(n["a"],{staticClass:"pl-0",attrs:{lg:"4",md:"4",sm:"6",xl:"4",cols:"6"}},[t(p["a"],{attrs:{onkeypress:"return (event.charCode != 34)",dense:"",filled:"",rounded:"",color:"primary","append-icon":"mdi-magnify",label:e.$t("general.titles.filter"),clearable:!0,"single-line":"","hide-details":""},on:{keyup:[function(t){return t.type.indexOf("key")||86===t.keyCode?e.replace.apply(null,arguments):null},function(t){return(t.type.indexOf("key")||86===t.keyCode)&&t.ctrlKey?e.replace.apply(null,arguments):null}]},model:{value:e.search,callback:function(t){e.search=t},expression:"search"}})],1)],1)],1)]},proxy:!0},{key:"item.isActive",fn:function(a){var n=a.item;return[t(d["a"],{attrs:{bottom:""},scopedSlots:e._u([{key:"activator",fn:function(a){var i=a.on;return[n.isActive?t(o["a"],e._g({staticClass:"mr-4",attrs:{small:"",color:"success"},on:{click:function(t){return e.activeDeactivate(n)}}},i),[e._v(" mdi-checkbox-marked-circle-outline ")]):e._e()]}}],null,!0)},[t("span",[e._v(" "+e._s(e.$t("general.buttons.press_for")+" "+e.$t("general.buttons.desactivate"))+" "),t("span",{staticStyle:{"font-size":"12px",color:"#AAAAAA"}},[e._v(" "+e._s(e.$t("menu.storage_device_type"))+" ")])])]),t(d["a"],{attrs:{bottom:""},scopedSlots:e._u([{key:"activator",fn:function(a){var i=a.on;return[n.isActive?e._e():t(o["a"],e._g({staticClass:"mr-4",attrs:{small:"",color:"disabled"},on:{click:function(t){return e.activeDeactivate(n)}}},i),[e._v(" mdi-checkbox-marked-circle-outline ")])]}}],null,!0)},[t("span",[e._v(" "+e._s(e.$t("general.buttons.press_for")+" "+e.$t("general.buttons.activate"))+" "),t("span",{staticStyle:{"font-size":"12px",color:"#AAAAAA"}},[e._v(" "+e._s(e.$t("menu.storage_device_type"))+" ")])])])]}},{key:"item.icon",fn:function(e){var a=e.item;return[t(s["a"],{staticClass:"mb-1 mr-1",attrs:{src:a.iconBase64,"max-height":"30","min-height":"30","max-width":"30","min-width":"30",eager:""}})]}}])})],1)},g=[],m=a("fe0b"),v=(a("b6e6"),a("2f62")),h=a("aa47"),b=a("2ef0"),_=a.n(b);function x(e){return x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},x(e)}function S(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function O(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?S(Object(a),!0).forEach((function(t){T(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):S(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function T(e,t,a){return(t=A(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function A(e){var t=k(e,"string");return"symbol"==x(t)?t:t+""}function k(e,t){if("object"!=x(e)||!e)return e;var a=e[Symbol.toPrimitive];if(void 0!==a){var n=a.call(e,t||"default");if("object"!=x(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var j={data:function(){return{profile:null,editedIndex:-1,search:"",sortBy:"disposition",sortDesc:!1,editedItem:{storage_type_name:"",language_key:"",isActive:!1,company_name_key:[],icon:"mdi-alert-circle"},defaultItem:{icon:"mdi-alert-circle",isActive:!1}}},computed:O(O({},Object(v["c"])({storagesTypesByCompany:"storage_type/storagesTypesByCompany",loading:"storage_type/loading"})),{},{headers:function(){return[{text:"",value:"icon",width:60},{text:m["a"].t("storageType.fields.name"),value:"storage_type_name"},{text:m["a"].t("storageType.fields.active"),value:"isActive",align:"end"}]},formTitle:function(){return(-1===this.editedIndex?m["a"].t("general.titles.new"):m["a"].t("general.titles.edit"))+" "+m["a"].t("menu.storage_device_type")}}),created:function(){this.initialize()},mounted:function(){var e=document.querySelector(".v-data-table tbody"),t=this;h["a"].create(e,{onEnd:function(e){var a=e.newIndex,n=e.oldIndex,i=Object.assign([],_.a.orderBy(t.storagesTypesByCompany,"disposition")),r=i.splice(n,1)[0];i.splice(a,0,r),i=_.a.map(i,(function(e,t){return O(O({},e),{},{disposition:t+1})}));var o={sdtList:i};t.changePosition(o)}})},methods:O(O({},Object(v["b"])({fetchStorageTypesByCompany:"storage_type/fetchAllStorageTypesByCompany",fetchStorageTypesActiveByCompany:"storage_type/fetchStorageTypesActiveByCompany",changePositions:"storage_type/changePositions",activateDeactivateStorageTypes:"storage_type/activateDeactivateStorageTypes",languajeKeys:"general/getLanguajeKeys"})),{},{initialize:function(){this.profile=JSON.parse(localStorage.getItem("profile"))},getItem:function(e){this.editedIndex=this.storagesTypesByCompany.indexOf(e),this.editedItem=Object.assign({},e)},activeDeactivate:function(e){this.getItem(e),this.editedItem.isActive=!this.editedItem.isActive,this.save()},close:function(){this.editedItem=Object.assign({},this.defaultItem),this.editedIndex=-1},changePosition:function(e){var t=this;this.changePositions([e,this.$toast]).finally((function(){t.fetchStorageTypesByCompany([t.profile.company_id,t.$toast]),t.fetchStorageTypesActiveByCompany([t.$toast])}))},save:function(){var e=this,t=Object.assign({},this.editedItem);t.language_key=t.id?t.language_key:t.storage_type_name.replace(/ /g,"_").toLowerCase(),t.company_id=this.profile.company_id,this.activateDeactivateStorageTypes([t,this.editedIndex,this.$toast]).finally((function(){e.fetchStorageTypesByCompany([e.profile.company_id,e.$toast]),e.fetchStorageTypesActiveByCompany([e.$toast])}))},replace:function(e){e.currentTarget.value=e.currentTarget.value.toString().replaceAll('"',""),this.search=e.currentTarget.value.toString().replaceAll('"',"")}})},C=j,w=a("2877"),B=Object(w["a"])(C,f,g,!1,null,"d75486f4",null);t["default"]=B.exports}}]);
//# sourceMappingURL=chunk-2d0de334.52c51900.js.map