(window.webpackJsonp=window.webpackJsonp||[]).push([[53,80],{296:function(t,e,r){"use strict";r.r(e);var n={name:"SummaryKpiCards",props:{cards:{type:Array,default:()=>[]}}},l=(r(657),r(1)),component=Object(l.a)(n,function(){var t=this,e=t._self._c;return e("v-row",{staticClass:"mb-2",attrs:{dense:""}},t._l(t.cards,function(r){return e("v-col",{key:r.key,attrs:{cols:"12",sm:"6",lg:"3"}},[e("v-card",{staticClass:"summary-card",attrs:{outlined:""}},[e("v-card-text",[e("div",{staticClass:"summary-label"},[t._v("\n "+t._s(r.label)+"\n ")]),t._v(" "),e("div",{staticClass:"summary-value",class:r.valueClass},[t._v("\n "+t._s(r.value)+"\n ")]),t._v(" "),e("div",{staticClass:"summary-caption"},[t._v("\n "+t._s(r.caption)+"\n ")])])],1)],1)}),1)},[],!1,null,"44d547e0",null);e.default=component.exports},432:function(t,e,r){"use strict";r.r(e);var n=r(2),l=r(0),o=(r(302),r(8),r(303),r(10),r(711)),c=r.n(o);function d(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}var v={components:{SummaryKpiCards:r(296).default,Draggable:c.a},asyncData:t=>Object(l.a)(function*(){var{$axios:e}=t;try{var{data:r}=yield e.get("/admin/products/price-list-order");return{items:r}}catch(t){}})(),data:t=>({items:[],lists:[],drag:!1,chunkSize:8,dragging:!1,form:t.$vform.make({items:[]})}),computed:{summaryCards(){var t=this.lists.flat().length,e=this.lists.length?Math.round(t/this.lists.length):0;return[{key:"total",label:"Productos visibles",value:this.number(t),caption:"Catálogo cargado para lista de precios"},{key:"columns",label:"Columnas activas",value:this.number(this.lists.length),valueClass:"indigo--text text--darken-2",caption:"Promedio ".concat(this.number(e)," por columna")},{key:"chunk",label:"Tamaño objetivo",value:this.number(this.chunkSize),valueClass:"teal--text text--darken-2",caption:"Capacidad esperada por bloque"},{key:"state",label:"Estado edición",value:this.form.busy?"Guardando...":"Listo",valueClass:this.form.busy?"orange--text text--darken-2":"green--text text--darken-2",caption:"Reordenamiento en curso"}]}},created(){this.setLists()},methods:{submit(){var t=this;return Object(l.a)(function*(){try{t.setLists(!0),t.form.items=t.lists.flat().map(t=>({id:t.id,pos:t.pos})),yield t.form.put("/admin/products/price-list-order"),t.$notify("Guardado con éxito!"),t.items=t.lists.flat()}catch(t){}})()},setLists(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=[],r=this.items.map(t=>function(t){for(var e=1;e{e[i].pos=i+1}),r.splice(0,r.length,...l)}for(var i=0;inew Intl.NumberFormat("es-CL").format(Number(t||0))}},m=v,f=(r(848),r(1)),component=Object(f.a)(m,function(){var t=this,e=t._self._c;return e("div",{staticClass:"products-price-list-order-page"},[e("summary-kpi-cards",{attrs:{cards:t.summaryCards}}),t._v(" "),e("v-card",{staticClass:"order-shell",attrs:{outlined:""}},[e("v-card-title",{staticClass:"d-flex flex-wrap align-center"},[e("div",[e("div",{staticClass:"text-h6 font-weight-bold"},[t._v("\n Ordenar productos en lista de precios\n ")]),t._v(" "),e("div",{staticClass:"text-caption blue-grey--text text--darken-1"},[t._v("\n Reorganiza el orden comercial específico de la lista de precios.\n ")])])]),t._v(" "),e("v-card-text",[e("v-row",t._l(t.lists,function(r,i){return e("v-col",{key:i,attrs:{cols:"12",sm:"6",md:"4"}},[e("v-card",{staticClass:"list-shell",attrs:{outlined:""}},[e("v-card-title",{staticClass:"py-2 d-flex align-center"},[e("span",{staticClass:"text-subtitle-2 font-weight-bold"},[t._v("\n Lista "+t._s(i+1)+"\n ")]),t._v(" "),e("v-spacer"),t._v(" "),e("v-chip",{attrs:{"x-small":"",outlined:"",color:"indigo"}},[t._v("\n "+t._s(t.number(r.length))+"\n ")])],1),t._v(" "),e("v-divider"),t._v(" "),e("v-list",{attrs:{dense:""}},[e("v-list-item-group",{attrs:{color:"primary"}},[e("draggable",{staticClass:"list-group",attrs:{group:"products",sort:!0,list:r,animation:200,"ghost-class":"ghost",disabled:t.form.busy},on:{end:function(e){t.drag=!1},start:function(e){t.drag=!0},change:t.handleChange}},[e("transition-group",{attrs:{type:"transition",name:t.drag?null:"flip-list"}},t._l(r,function(r){return e("v-list-item",{key:r.nombre,staticClass:"list-group-item",attrs:{link:""}},[e("v-list-item-content",[e("v-list-item-title",[t._v(t._s(r.nombre))])],1),t._v(" "),e("v-list-item-action",[e("v-chip",{attrs:{"x-small":"",outlined:"",color:"blue-grey"}},[t._v("\n "+t._s(r.pos)+"\n ")])],1)],1)}),1)],1)],1)],1)],1)],1)}),1)],1),t._v(" "),e("v-card-actions",[e("v-spacer"),t._v(" "),e("v-btn",{attrs:{dark:"",small:"",color:"red darken-1",disabled:t.form.busy},on:{click:function(e){return t.setLists(!1)}}},[t._v("\n Cancelar\n ")]),t._v(" "),e("v-btn",{attrs:{dark:"",small:"",color:"green",loading:t.form.busy},on:{click:t.submit}},[t._v("\n Guardar\n ")])],1)],1)],1)},[],!1,null,"a3405c54",null);e.default=component.exports},653:function(t,e,r){t.exports={}},657:function(t,e,r){"use strict";r(653)},787:function(t,e,r){t.exports={}},848:function(t,e,r){"use strict";r(787)}}]);