import{_ as h,u as w,O as x,a6 as k,r as m,o as C,b as r,c,j as L,d as a,t as l,T as z,n as i,F as B,k as O,g as b,f as E,l as N,L as P}from"./main.37e79106.js";import{g as S,a as $}from"./OrdenLavanderiaRepository.ed098771.js";const D={class:"layout-px-spacing"},M={class:"navbar-nav flex-row"},R={class:"page-header"},T={class:"breadcrumb-one","aria-label":"breadcrumb"},V={class:"breadcrumb"},j={class:"breadcrumb-item active","aria-current":"page"},q={class:"row layout-top-spacing"},A={class:"col-xl-12 col-lg-12 col-sm-12 layout-spacing"},F={class:"panel p-3 text-center"},I={class:"mb-3"},U={class:"btn-group mb-3",role:"group"},G={class:"row g-3"},H=["onClick"],J={class:"fw-bold"},K={class:"small"},Q={class:"small text-muted"},W={key:0,class:"small text-warning mt-1 text-truncate"},X={key:0,class:"col-12"},Y={__name:"operador",setup(Z){w({title:"Operador Lavander\xEDa"});const f=x(),g=k(),o=m(f.params.area||"lavado"),d=m([]),n=m(!1),_=s=>({lavado:"Lavado",secado:"Secado",planchado:"Planchado"})[s]||s,u=(s="",e="success")=>{window.Swal.mixin({toast:!0,position:"top-end",showConfirmButton:!1,timer:2500,timerProgressBar:!0}).fire({icon:e,title:s})},p=async()=>{n.value=!0;try{const e=(await S()).data||[];d.value=e.filter(t=>t.current_step===o.value)}catch(s){console.error(s),u("Error al cargar \xF3rdenes","error")}finally{n.value=!1}},v=async s=>{o.value=s,await g.replace({name:"lavanderia-operador-router",params:{area:s}}),await p()},y=async s=>{try{n.value=!0,await $(s.id),u("Orden actualizada","success"),await p()}catch(e){console.error(e),u("Error al avanzar la orden","error")}finally{n.value=!1}};return C(async()=>{await p()}),(s,e)=>(r(),c("div",D,[(r(),L(z,{to:"#breadcrumb"},[a("ul",M,[a("li",null,[a("div",R,[a("nav",T,[a("ol",V,[e[4]||(e[4]=a("li",{class:"breadcrumb-item"},[a("a",{href:"javascript:;"},"Lavander\xEDa")],-1)),a("li",j,[a("span",null,"Panel de Operador - "+l(_(o.value)),1)])])])])])])])),a("div",q,[a("div",A,[a("div",F,[a("h4",I," \xD3rdenes pendientes de "+l(_(o.value)),1),e[6]||(e[6]=a("p",{class:"text-muted mb-4"}," Interfaz simplificada para tablets o celulares. Toque una orden para avanzar a la siguiente etapa. ",-1)),a("div",U,[a("button",{type:"button",class:i(["btn",o.value==="lavado"?"btn-primary":"btn-outline-primary"]),onClick:e[0]||(e[0]=t=>v("lavado"))}," Lavado ",2),a("button",{type:"button",class:i(["btn",o.value==="secado"?"btn-primary":"btn-outline-primary"]),onClick:e[1]||(e[1]=t=>v("secado"))}," Secado ",2),a("button",{type:"button",class:i(["btn",o.value==="planchado"?"btn-primary":"btn-outline-primary"]),onClick:e[2]||(e[2]=t=>v("planchado"))}," Planchado ",2)]),a("div",G,[(r(!0),c(B,null,O(d.value,t=>(r(),c("div",{key:t.id,class:"col-xl-3 col-lg-4 col-md-6 col-sm-12"},[a("button",{class:i(["btn btn-lg w-100 operador-btn",{"btn-outline-success":t.minutos_en_etapa<=30,"btn-outline-danger":t.minutos_en_etapa>30}]),onClick:aa=>y(t)},[a("div",J,l(t.folio_unico),1),a("div",K,l(t.cliente_nombre),1),a("div",Q,l(t.minutos_en_etapa)+" min en etapa ",1),t.instrucciones?(r(),c("div",W,l(t.instrucciones),1)):b("",!0)],10,H)]))),128)),!d.value.length&&!n.value?(r(),c("div",X,[...e[5]||(e[5]=[a("div",{class:"alert alert-info mb-0"}," No hay \xF3rdenes pendientes en esta \xE1rea. ",-1)])])):b("",!0)])])])]),E(N(P),{active:n.value,"onUpdate:active":e[3]||(e[3]=t=>n.value=t),"can-cancel":!1,"is-full-page":!0},null,8,["active"])]))}},sa=h(Y,[["__scopeId","data-v-f3d0fb1b"]]);export{sa as default};
