PageSourceSearch

https://repuestos-d6c3d.firebaseapp.com/_nuxt/BHHr7dSf.js

js repuestos-d6c3d.firebaseapp.com collected 2026-10-03 08:14:32 UTC 10,852 bytes, 1 lines download raw bytes

1import{u as F,r as x,l as v,q as N,c as d,b as e,e as f,f as y,v as V,m as n,y as w,z as C,d as H,F as k,x as P,a as B,h as q,t as a,_ as R,o as u,i,p as $,n as j}from"#entry";import"./BsqTxom4.js";const z={class:"bg-white rounded-xl shadow-lg p-6 mb-8"},A={class:"grid grid-cols-1 md:grid-cols-4 gap-4"},O={class:"space-y-6"},U={class:"flex justify-between items-start mb-4"},G={class:"flex-1"},I={class:"flex items-center space-x-3 mb-2"},Y={class:"text-lg font-semibold text-gray-900"},J={class:"flex items-center space-x-4 text-sm text-gray-500"},X={class:"text-right"},K={class:"text-lg font-semibold text-gray-900"},Q={class:"text-sm text-gray-500"},W={class:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-4"},Z={class:"space-y-1 text-sm text-gray-600"},ee={class:"space-y-1 text-sm text-gray-600"},te={class:"space-y-1 text-sm text-gray-600"},oe={key:0,class:"border-t pt-4"},se={class:"flex items-center space-x-2 mb-2"},ae={class:"flex items-center"},le={class:"text-sm text-gray-600"},ne={class:"text-sm text-gray-600"},ie={class:"flex justify-between items-center pt-4 border-t"},re={class:"flex space-x-3"},de=["onClick"],ue=["onClick"],me=["onClick"],ce={key:0,class:"text-center py-12"},pe={key:0,class:"mt-8 bg-white rounded-xl shadow-lg p-6"},ge={class:"grid grid-cols-1 md:grid-cols-4 gap-6"},xe={class:"text-center"},ve={class:"text-2xl font-bold text-gray-900"},fe={class:"text-center"},be={class:"text-2xl font-bold text-gray-900"},ye={class:"text-center"},we={class:"text-2xl font-bold text-gray-900"},he={class:"text-center"},Ce={class:"text-2xl font-bold text-gray-900"},Te={__name:"historial",setup(ke){F({title:"Historial - AutoVentas360",meta:[{name:"robots",content:"noindex, nofollow"}]});const h=x([]),m=x(""),c=x(""),p=x(""),r=v(()=>{let s=h.value;if(m.value){const t=m.value.toLowerCase();s=s.filter(l=>l.descripcion.toLowerCase().includes(t)||l.numeroPedido.toLowerCase().includes(t))}if(c.value&&(s=s.filter(t=>t.marca===c.value)),p.value){const t=new Date;switch(p.value){case"ultimo_mes":t.setMonth(t.getMonth()-1);break;case"ultimos_3_meses":t.setMonth(t.getMonth()-3);break;case"ultimo_ano":t.setFullYear(t.getFullYear()-1);break}s=s.filter(l=>new Date(l.fechaEntrega)>=t)}return s.sort((t,l)=>new Date(l.fechaEntrega)-new Date(t.fechaEntrega))}),_=v(()=>r.value.reduce((s,t)=>s+t.precio,0)),T=v(()=>{if(r.value.length===0)return 0;const s=r.value.reduce((t,l)=>t+l.tiempoTotal,0);return Math.round(s/r.value.length)}),M=v(()=>{const s=r.value.filter(l=>l.review);return s.length===0?0:(s.reduce((l,o)=>l+o.review.calificacion,0)/s.length).toFixed(1)}),b=s=>s?new Intl.DateTimeFormat("es-CL",{year:"numeric",month:"short",day:"numeric"}).format(new Date(s)):"No disponible",D=()=>{m.value="",c.value="",p.value=""},S=s=>{console.log("Mostrar review para:",s.id)},E=s=>{j("/cliente/pedidos",{query:{repeticion:s.id,descripcion:s.descripcion,marca:s.marca,modelo:s.modelo,ano:s.ano}})},L=s=>{console.log("Descargar factura para:",s.id)};return N(()=>{h.value=[{id:"1",numeroPedido:"PED-001234",descripcion:"Filtro de aceite para Toyota Corolla 2015, motor 1.8L",marca:"Toyota",modelo:"Corolla",ano:"2015",precio:125e3,fechaSolicitud:new Date("2024-01-05"),fechaProcesamiento:new Date("2024-01-06"),fechaEntrega:new Date("2024-01-12"),tiempoTotal:7,origen:"Japón",proveedor:"Toyota Motor Corporation",codigoProducto:"TMC-FO-15-18L",transportista:"Chilexpress",numeroSeguimiento:"CX123456789CL",direccionEntrega:"Av. Principal 123, Santiago",review:{calificacion:5,comentario:"Excelente servicio, el producto llegó en perfecto estado y antes de lo esperado."}},{id:"2",numeroPedido:"PED-001235",descripcion:"Pastillas de freno delanteras para Honda Civic 2018",marca:"Honda",modelo:"Civic",ano:"2018",precio:85e3,fechaSolicitud:new Date("2024-01-08"),fechaProcesamiento:new Date("2024-01-09"),fechaEntrega:new Date("2024-01-16"),tiempoTotal:8,origen:"Tailandia",proveedor:"Honda Manufacturing",codigoProducto:"HON-PB-18-F",transportista:"Starken",numeroSeguimiento:"ST987654321CL",direccionEntrega:"Calle Secundaria 456, Valparaíso",review:{calificacion:4,comentario:"Muy buen producto, solo tardó un día más de lo esperado pero todo correcto."}}]}),(s,t)=>{const l=R;return u(),d("div",null,[t[34]||(t[34]=e("div",{class:"mb-8"},[e("h1",{class:"text-3xl font-bold text-gray-900"},"Historial"),e("p",{class:"text-gray-600 mt-2"},"Todos tus repuestos entregados exitosamente")],-1)),e("div",z,[e("div",A,[e("div",null,[t[3]||(t[3]=e("label",{class:"block text-sm font-medium text-gray-700 mb-2"},"Buscar",-1)),y(e("input",{"onUpdate:modelValue":t[0]||(t[0]=o=>w(m)?m.value=o:null),type:"text",placeholder:"Buscar por descripción o número...",class:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"},null,512),[[V,n(m)]])]),e("div",null,[t[5]||(t[5]=e("label",{class:"block text-sm font-medium text-gray-700 mb-2"},"Marca",-1)),y(e("select",{"onUpdate:modelValue":t[1]||(t[1]=o=>w(c)?c.value=o:null),class:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"},[...t[4]||(t[4]=[H('<option value="">Todas las marcas</option><option value="Toyota">Toyota</option><option value="Honda">Honda</option><option value="Ford">Ford</option><option value="Nissan">Nissan</option><option value="Chevrolet">Chevrolet</option>',6)])],512),[[C,n(c)]])]),e("div",null,[t[7]||(t[7]=e("label",{class:"block text-sm font-medium text-gray-700 mb-2"},"Período",-1)),y(e("select",{"onUpdate:modelValue":t[2]||(t[2]=o=>w(p)?p.value=o:null),class:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"},[...t[6]||(t[6]=[e("option",{value:""},"Todos los períodos",-1),e("option",{value:"ultimo_mes"},"Último mes",-1),e("option",{value:"ultimos_3_meses"},"Últimos 3 meses",-1),e("option",{value:"ultimo_ano"},"Último año",-1)])],512),[[C,n(p)]])]),e("div",{class:"flex items-end"},[e("button",{onClick:D,class:"w-full px-4 py-2 border border-gray-300 text-gray-700 rounded-lg hover:bg-gray-50 transition-colors"}," Limpiar Filtros ")])])]),e("div",O,[(u(!0),d(k,null,P(n(r),o=>(u(),d("div",{key:o.id,class:"bg-white rounded-xl shadow-lg p-6 border border-gray-100"},[e("div",U,[e("div",G,[e("div",I,[e("h3",Y,a(o.descripcion),1),t[8]||(t[8]=e("span",{class:"inline-flex px-2 py-1 text-xs font-medium bg-green-100 text-green-800 rounded-full"}," Entregado ",-1))]),e("div",J,[e("span",null,"Pedido #"+a(o.numeroPedido),1),t[9]||(t[9]=e("span",null,"•",-1)),e("span",null,a(o.marca)+" "+a(o.modelo),1),t[10]||(t[10]=e("span",null,"•",-1)),e("span",null,"Añ
1o "+a(o.ano),1)])]),e("div",X,[e("p",K,"$"+a(o.precio.toLocaleString()),1),e("p",Q,"Entregado el "+a(b(o.fechaEntrega)),1)])]),e("div",W,[e("div",null,[t[14]||(t[14]=e("h4",{class:"text-sm font-medium text-gray-700 mb-2"},"Información del Pedido",-1)),e("div",Z,[e("p",null,[t[11]||(t[11]=e("span",{class:"font-medium"},"Solicitado:",-1)),i(" "+a(b(o.fechaSolicitud)),1)]),e("p",null,[t[12]||(t[12]=e("span",{class:"font-medium"},"Procesado:",-1)),i(" "+a(b(o.fechaProcesamiento)),1)]),e("p",null,[t[13]||(t[13]=e("span",{class:"font-medium"},"Tiempo total:",-1)),i(" "+a(o.tiempoTotal)+" días",1)])])]),e("div",null,[t[18]||(t[18]=e("h4",{class:"text-sm font-medium text-gray-700 mb-2"},"Origen",-1)),e("div",ee,[e("p",null,[t[15]||(t[15]=e("span",{class:"font-medium"},"País:",-1)),i(" "+a(o.origen),1)]),e("p",null,[t[16]||(t[16]=e("span",{class:"font-medium"},"Proveedor:",-1)),i(" "+a(o.proveedor),1)]),e("p",null,[t[17]||(t[17]=e("span",{class:"font-medium"},"Código:",-1)),i(" "+a(o.codigoProducto),1)])])]),e("div",null,[t[22]||(t[22]=e("h4",{class:"text-sm font-medium text-gray-700 mb-2"},"Entrega",-1)),e("div",te,[e("p",null,[t[19]||(t[19]=e("span",{class:"font-medium"},"Transportista:",-1)),i(" "+a(o.transportista),1)]),e("p",null,[t[20]||(t[20]=e("span",{class:"font-medium"},"N° Seguimiento:",-1)),i(" "+a(o.numeroSeguimiento),1)]),e("p",null,[t[21]||(t[21]=e("span",{class:"font-medium"},"Dirección:",-1)),i(" "+a(o.direccionEntrega),1)])])])]),o.review?(u(),d("div",oe,[t[24]||(t[24]=e("h4",{class:"text-sm font-medium text-gray-700 mb-2"},"Tu Reseña",-1)),e("div",se,[e("div",ae,[(u(),d(k,null,P(5,g=>e("svg",{key:g,class:$(["w-4 h-4",g<=o.review.calificacion?"text-yellow-400":"text-gray-300"]),fill:"currentColor",viewBox:"0 0 20 20"},[...t[23]||(t[23]=[e("path",{d:"M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"},null,-1)])],2)),64))]),e("span",le,a(o.review.calificacion)+"/5",1)]),e("p",ne,a(o.review.comentario),1)])):f("",!0),e("div",ie,[e("div",re,[o.review?f("",!0):(u(),d("button",{key:0,onClick:g=>S(o),class:"px-4 py-2 bg-purple-600 text-white text-sm rounded-lg hover:bg-purple-700 transition-colors"}," Calificar Servicio ",8,de)),e("button",{onClick:g=>E(o),class:"px-4 py-2 border border-gray-300 text-gray-700 text-sm rounded-lg hover:bg-gray-50 transition-colors"}," Solicitar Nuevamente ",8,ue)]),e("button",{onClick:g=>L(o),class:"px-4 py-2 text-blue-600 text-sm rounded-lg hover:bg-blue-50 transition-colors"}," Descargar Factura ",8,me)])]))),128)),n(r).length===0?(u(),d("div",ce,[t[26]||(t[26]=e("svg",{class:"w-16 h-16 text-gray-400 mx-auto mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4"})],-1)),t[27]||(t[27]=e("h3",{class:"text-lg font-medium text-gray-900 mb-2"},"No hay productos en tu historial",-1)),t[28]||(t[28]=e("p",{class:"text-gray-500 mb-4"},"Los productos entregados aparecerán aquí",-1)),B(l,{to:"/cliente/pedidos",class:"px-6 py-3 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors font-medium"},{default:q(()=>[...t[25]||(t[25]=[i(" Ver Mis Pedidos ",-1)])]),_:1})])):f("",!0)]),n(r).length>0?(u(),d("div",pe,[t[33]||(t[33]=e("h2",{class:"text-xl font-semibold text-gray-900 mb-4"},"Resumen del Historial",-1)),e("div",ge,[e("div",xe,[e("p",ve,a(n(r).length),1),t[29]||(t[29]=e("p",{class:"text-sm text-gray-600"},"Productos Entregados",-1))]),e("div",fe,[e("p",be,"$"+a(n(_).toLocaleString()),1),t[30]||(t[30]=e("p",{class:"text-sm text-gray-600"},"Total Gastado",-1))]),e("div",ye,[e("p",we,a(n(T)),1),t[31]||(t[31]=e("p",{class:"text-sm text-gray-600"},"Promedio de Entrega (días)",-1))]),e("div",he,[e("p",Ce,a(n(M)),1),t[32]||(t[32]=e("p",{class:"text-sm text-gray-600"},"Calificación Promedio",-1))])])])):f("",!0)])}}};export{Te as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.