PageSourceSearch

https://lidomatrip.com/_next/static/chunks/pages/admin/reservations-237629cff2e01e7a.js

js lidomatrip.com collected 2026-10-02 20:25:58 UTC 8,081 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6796],{87083:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/reservations",function(){return a(56156)}])},56156:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return b}});var s=a(85893),l=a(67294),n=a(41664),r=a.n(n),i=a(44389),o=a(49759),c=a(84858),d=a(35157),p=a(15822),x=a(37515),m=a(57635),h=a(20646),y=a(32474);let u=[{key:"HOST_APPROVAL",label:"در انتظار تایید میزبان",tone:"yellow"},{key:"SECOND_PAYMENT",label:"در انتظار پرداخت نهایی",tone:"yellow"},{key:"DONE",label:"تکمیل شده",tone:"green"},{key:"CANCEL",label:"لغو شده",tone:"red"},{key:"EXPIRED",label:"منقضی شده",tone:"gray"}],g=Object.fromEntries(u.map(e=>[e.key,e])),j="HOST_APPROVAL,SECOND_PAYMENT,DONE",N=[{key:j,label:"جاری"},...u.map(e=>({key:e.key,label:e.label})),{key:"all",label:"همه"}],w=[{key:"today",label:"امروز"},{key:"yesterday",label:"دیروز"},{key:"all",label:"همه تاریخ‌ها"}];function f(e){let{name:t,phone:a}=e;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"text-14 leading-20 text-black",children:t||"بدون نام"}),(0,s.jsx)("div",{className:"text-12 leading-18 text-gray-6C6A7D",dir:"ltr",children:a})]})}function b(){let{router:e,getString:t,getNumber:a,update:n}=(0,p.o)(),[u,b]=(0,l.useState)(!1),v=a("page",1),A=t("state",j),k=t("date","today"),C=t("q"),S=(0,x.ik)(e.query.filters),R=t("sortBy"),P=R?{key:R,dir:t("sortDir","asc")}:null;function D(e){let t=(0,y.dx)(P,e);n({sortBy:null==t?void 0:t.key,sortDir:null==t?void 0:t.dir,page:void 0})}let E=new URLSearchParams({page:String(v),pageSize:String(20),...A&&"all"!==A?{state:A}:{},...k&&"all"!==k?{date:k}:{},...C?{q:C}:{},...S.length?{filters:(0,x.IU)(S)}:{},...P?{sortBy:P.key,sortDir:P.dir}:{}}),{data:_,isLoading:O,mutate:F}=(0,i.u)(e.isReady?`/api/admin/reservations?${E.toString()}`:null,e=>(0,c.Px)(e)),{data:K}=(0,i.u)("/api/admin/reservations/filter-fields",e=>(0,c.SC)(e)),B=!!K&&Object.values(K).some(e=>"multiselect"===e.type),{data:I}=(0,i.u)(B?"/api/admin/amenities":null,e=>(0,c.SC)(e));return(0,l.useEffect)(()=>{_&&(0,d.g)("reservations",_.items.map(e=>e.id),e.asPath)},[_,e.asPath]),(0,s.jsxs)(o.Z,{title:"رزروها",breadcrumb:(0,s.jsx)(r(),{href:"/admin",children:"داشبورد"}),actions:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(y.Qm,{tabs:w,value:k,onChange:function(e){n({date:e,page:void 0})}}),(0,s.jsx)(y.Qm,{tabs:N,value:A,onChange:function(e){n({state:e,page:void 0})}})]}),toolbar:(0,s.jsxs)(y.o8,{children:[(0,s.jsxs)("div",{className:"flex items-center gap-x-10 flex-1 min-w-[240px]",children:[(0,s.jsx)(m.R,{value:C,onChange:e=>n({q:e,page:void 0}),onPick:function(e,t){n({q:void 0,filters:(0,x.IU)([...S,{field:e,operator:"equals",value:t}]),page:void 0},"push")},suggestionsUrl:"/api/admin/reservations/search-suggestions",placeholder:"کد رزرو، نام یا موبایل مهمان و میزبان..."}),(0,s.jsx)(y.hA,{icon:"icon-Filters",label:"فیلتر پیشرفته",active:u||S.length>0,onClick:()=>b(e=>!e)}),(0,s.jsx)("span",{className:"text-13 leading-20 text-gray-6C6A7D whitespace-nowrap",children:_?`${(0,y.N)(_.meta.total)} رزرو`:"…"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-x-8",children:[(0,s.jsx)(y.rP,{icon:"icon-Refresh",label:"بارگذاری مجدد",onClick:()=>F()}),_&&(0,s.jsx)(y.p0,{page:v,pageSize:20,total:_.meta.total,pageCount:_.meta.pageCount,onPage:e=>n({page:e})})]})]}),children:[(0,s.jsxs)("div",{className:"flex flex-col gap-y-16 mb-16",children:[(0,s.jsx)(h.R,{open:u,onClose:()=>b(!1),fields:K,amenities:I,rows:S,onApply:e=>{n({filters:(0,x.IU)(e),page:void 0},"push"),b(!1)}}),(0,s.jsx)(h.V,{rows:S,fields:K,amenities:I,onRemove:function(e){n({filters:(0,x.IU)(S.filter((t,a)=>a!==e)),page:void 0})}})]}),O&&(0,s.jsx)("div",{className:"grid gap-12",children:Array.from({length:8}).map((e,t)=>(0,s.jsx)(y.Od,{className:"h-[56px]"},t))}),_&&0===_.items.length&&(0,s.jsx)(y.Zb,{children:(0,s.jsx)(y.ub,{text:"رزروی با این فیلتر پیدا نشد"})}),_&&_.items.length>0&&(0,s.jsx)(y.Zb,{className:"overflow-x-auto",children:(0,s.jsxs)("table",{className:"w-full min-w-[1360px] text-right border-collapse",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{className:"bg-gray-F5F5F7 text-12 leading-18 text-gray-6C6A7D",children:[(0,s.jsx)("th",{className:"px-12 py-12 font-m whitespace-nowrap",children:"ردیف"}),(0,s.jsx)(y.Re,{label:"کد رزرو",sortKey:"reference",sort:P,onSort:D,className:"font-m whitespace-nowrap"}),(0,s.jsx)(y.Re,{label:"ثبت رزرو",sortKey:"createdAt",sort:P,onSort:D,className:"font-m whitespace-nowrap"}),(0,s.jsx)(y.Re,{label:"شروع اقامت",sortKey:"startDate",sort:P,onSort:D,className:"font-m whitespace-nowrap"}),(0,s.jsx)(y.Re,{label:"مهمان",sortKey:"guest",sort:P,onSort:D,className:"font-m whitespace-nowrap"}),(0,s.jsx)(y.Re,{label:"میزبان",sortKey:"host",sort:P,onSort:D,className:"font-m whitespace-nowrap"}
1),(0,s.jsx)(y.Re,{label:"شب",sortKey:"daysCount",sort:P,onSort:D,className:"font-m whitespace-nowrap"}),(0,s.jsx)(y.Re,{label:"مبلغ کل (تومان)",sortKey:"totalAmount",sort:P,onSort:D,className:"font-m whitespace-nowrap"}),(0,s.jsx)(y.Re,{label:"پرداختی (تومان)",sortKey:"paidAmount",sort:P,onSort:D,className:"font-m whitespace-nowrap"}),(0,s.jsx)(y.Re,{label:"سهم لیدوما (تومان)",sortKey:"websiteShare",sort:P,onSort:D,className:"font-m whitespace-nowrap"}),(0,s.jsx)("th",{className:"px-12 py-12 font-m whitespace-nowrap",children:"شهر"}),(0,s.jsx)(y.Re,{label:"وضعیت",sortKey:"state",sort:P,onSort:D,className:"font-m whitespace-nowrap"}),(0,s.jsx)("th",{className:"px-12 py-12 font-m whitespace-nowrap",children:"رزرو قبلی مهمان"})]})}),(0,s.jsx)("tbody",{className:"divide-y divide-gray-F0F0F0",children:_.items.map((e,t)=>{let[a,l]=(0,y.A1)(e.createdAt),n=g[e.state];return(0,s.jsxs)("tr",{className:"hover:bg-gray-F5F5F7 transition",children:[(0,s.jsx)("td",{className:"px-12 py-12 text-13 text-gray-6C6A7D",children:(0,y.N)((v-1)*20+t+1)}),(0,s.jsx)("td",{className:"px-12 py-12 whitespace-nowrap",children:(0,s.jsx)(r(),{href:`/admin/reservations/${e.id}`,className:"text-14 font-m text-primary-dark",title:e.residence.name,children:e.reference})}),(0,s.jsxs)("td",{className:"px-12 py-12 whitespace-nowrap",children:[(0,s.jsx)("div",{className:"text-13 leading-20 text-black",children:a}),(0,s.jsx)("div",{className:"text-12 leading-18 text-gray-6C6A7D",children:l})]}),(0,s.jsx)("td",{className:"px-12 py-12 text-13 whitespace-nowrap",children:(0,y.IY)(e.startDate)}),(0,s.jsx)("td",{className:"px-12 py-12",children:(0,s.jsx)(f,{...e.guest})}),(0,s.jsx)("td",{className:"px-12 py-12",children:(0,s.jsx)(f,{...e.host})}),(0,s.jsx)("td",{className:"px-12 py-12 text-14",children:(0,y.N)(e.daysCount)}),(0,s.jsx)("td",{className:"px-12 py-12 text-14 font-m whitespace-nowrap",children:(0,y.N)(e.totalAmount)}),(0,s.jsxs)("td",{className:"px-12 py-12 text-14 whitespace-nowrap",children:[(0,y.N)(e.paidAmount),e.paidAmount<e.totalAmount&&(0,s.jsxs)("div",{className:"text-11 leading-16 text-gray-6C6A7D",children:["مانده ",(0,y.N)(e.totalAmount-e.paidAmount)]})]}),(0,s.jsx)("td",{className:"px-12 py-12 text-14 whitespace-nowrap",children:null==e.websiteShare?(0,s.jsx)("span",{className:"text-gray-9B9BAA",children:"—"}):(0,y.N)(e.websiteShare)}),(0,s.jsx)("td",{className:"px-12 py-12 text-13 whitespace-nowrap",children:e.city||(0,s.jsx)("span",{className:"text-gray-9B9BAA",children:"—"})}),(0,s.jsx)("td",{className:"px-12 py-12 whitespace-nowrap",children:(0,s.jsx)(y.Ct,{tone:(null==n?void 0:n.tone)??"gray",children:(null==n?void 0:n.label)??e.state})}),(0,s.jsx)("td",{className:"px-12 py-12 text-14",children:e.guestPreviousCount>0?(0,y.N)(e.guestPreviousCount):(0,s.jsx)("span",{className:"text-gray-9B9BAA",children:"۰"})})]},e.id)})})]})})]})}}},function(e){e.O(0,[4389,9759,8907,9774,2888,179],function(){return e(e.s=87083)}),_N_E=e.O()}]);

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.