PageSourceSearch

https://lidomatrip.com/_next/static/chunks/pages/admin/payments-1051d34cbf54151c.js

js lidomatrip.com collected 2026-09-25 07:11:03 UTC 13,218 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3613],{14831:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/payments",function(){return t(11083)}])},11083:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return g}});var a=t(47568),r=t(10253),s=t(70655),l=t(85893),c=t(67294),i=t(41664),o=t.n(i),u=t(44389),d=t(49759),x=t(84858),m=t(32474),h=t(70707),p="/api/admin/payment-methods/claims",f=[{key:"PENDING",label:"در انتظار بررسی"},{key:"APPROVED",label:"تأییدشده"},{key:"REJECTED",label:"ردشده"},{key:"ALL",label:"همه"}],j={PENDING:{tone:"yellow",label:"در انتظار بررسی"},APPROVED:{tone:"green",label:"تأیید شد"},REJECTED:{tone:"red",label:"رد شد"}},b=["واریزی با این مشخصات در حساب پیدا نشد","مبلغ واریزی با مبلغ اعلام‌شده مغایرت دارد","۴ رقم آخر کارت با واریزی مطابقت ندارد"];function g(){var e=(0,r.Z)((0,c.useState)("PENDING"),2),n=e[0],t=e[1],a=(0,r.Z)((0,c.useState)(""),2),s=a[0],i=a[1],h=(0,r.Z)((0,c.useState)(50),2),j=h[0],b=h[1],g=(0,r.Z)((0,c.useState)(null),2),k=g[0],w=g[1],C=(0,r.Z)((0,c.useState)(null),2),_=C[0],E=C[1],D=(0,r.Z)((0,c.useState)(null),2),S=D[0],A=D[1],Z="".concat(p,"?status=").concat(n,"&take=").concat(j).concat(s?"&context=".concat(s):""),F=(0,u.u)(Z,function(e){return(0,x.SC)(e)},{refreshInterval:6e4}),P=F.data,B=F.isLoading,I=F.mutate,O=function(e){w(null),E(null),A(e),I()};return(0,l.jsxs)(d.Z,{title:"بررسی پرداخت‌ها",breadcrumb:(0,l.jsx)(o(),{href:"/admin",children:"داشبورد"}),toolbar:(0,l.jsxs)(m.Zb,{className:"px-8 py-6 flex items-center gap-x-4 overflow-x-auto",children:[f.map(function(e){return(0,l.jsxs)("button",{onClick:function(){t(e.key),b(50)},"aria-pressed":n===e.key,className:"px-14 py-8 rounded-10 text-13 leading-20 font-m whitespace-nowrap transition inline-flex items-center gap-x-6 ".concat(n===e.key?"bg-primary-main text-white":"text-gray-6C6A7D hover:bg-gray-F0F0F0"),children:[e.label,"ALL"!==e.key&&!!P&&(0,l.jsx)("span",{className:"text-11 ".concat(n===e.key?"opacity-90":"text-gray-9B9BAA"),children:(0,m.N)(P.counts[e.key])})]},e.key)}),(0,l.jsx)("span",{className:"mr-auto"}),(0,l.jsxs)("select",{value:s,onChange:function(e){return i(e.target.value)},className:"px-12 py-8 rounded-10 border border-gray-E5E5E6 text-13 bg-white outline-none",children:[(0,l.jsx)("option",{value:"",children:"همه‌ی پرداخت‌ها"}),(0,l.jsx)("option",{value:"reservation",children:"پرداخت رزرو"}),(0,l.jsx)("option",{value:"wallet",children:"افزایش اعتبار کیف پول"})]})]}),children:[!!S&&(0,l.jsxs)("div",{className:"mb-16 rounded-12 bg-[#03D6BB14] text-[#015046] px-16 py-10 text-13 leading-22 flex items-center justify-between",children:[(0,l.jsx)("span",{children:S}),(0,l.jsx)("button",{onClick:function(){return A(null)},"aria-label":"بستن",className:"text-16",children:"✕"})]}),B||!P?(0,l.jsx)(m.Od,{className:"h-[360px]"}):0===P.items.length?(0,l.jsx)(m.Zb,{children:(0,l.jsx)(m.ub,{text:"PENDING"===n?"رسیدی در انتظار بررسی نیست ✓":"موردی نیست"})}):(0,l.jsxs)("div",{className:"flex flex-col gap-y-12",children:[P.items.map(function(e){return(0,l.jsx)(v,{claim:e,onApprove:function(){return w(e)},onReject:function(){return E(e)}},e.id)}),P.has_more&&(0,l.jsx)("div",{className:"flex justify-center",children:(0,l.jsx)(m.zx,{variant:"secondary",onClick:function(){return b(function(e){return e+50})},children:"نمایش بیشتر"})})]}),!!k&&(0,l.jsx)(N,{claim:k,onClose:function(){return w(null)},onDone:O}),!!_&&(0,l.jsx)(y,{claim:_,onClose:function(){return E(null)},onDone:O})]})}function v(e){var n,t,a,s,c,i=e.claim,u=e.onApprove,d=e.onReject,x=(0,r.Z)((0,m.A1)(i.created_at),2),h=x[0],p=x[1],f=null!==(t=null===(n=i.reservation)||void 0===n?void 0:n.remaining_amount)&&void 0!==t?t:null,b="PENDING"===i.status&&null!=f&&f>0&&Math.round(f)!==Math.round(i.amount);return(0,l.jsx)(m.Zb,{className:"p-16",children:(0,l.jsxs)("div",{className:"flex flex-col md:flex-row md:items-center gap-16",children:[(0,l.jsxs)("div",{className:"flex items-start gap-x-12 flex-1 min-w-0",children:[(0,l.jsx)("span",{className:"w-44 h-44 rounded-12 flex items-center justify-center shrink-0 ".concat("wallet"===i.context?"bg-[#F1EAFE] text-[#5B32B0]":"bg-[#E8F1FF] text-[#1B4F9C]"),children:(0,l.jsx)("i",{className:"".concat("wallet"===i.context?"icon-Wallet":"icon-Reserve"," text-22")})}),(0,l.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-8 mb-4",children:[(0,l.jsx)("span",{className:"text-18 leading-28 font-m text-black",children:(0,m.ND)(i.amount)}),(0,l.jsx)(m.Ct,{tone:j[i.status].tone,children:j[i.status].label}),(0,l.jsx)(m.Ct,{tone:"wallet"===i.context?"purple":"blue",children:"wallet"===i.context?"افزایش اعتبار":"پرداخت رزرو"}),b&&(0,l.jsxs)(m.Ct,{tone:"red",children:["مانده‌ی رزرو ",(0,m.ND)(f)]})]}),(0,l.jsxs)("p",{className:"text-13 leading-22 text-gray-6C6A7D",children:[(0,l.jsx)(o(),{href:"/admin/users/".concat(i.user.id),className:"text-black hover:text-primary-dark",children:i.user.n
1ame||"بدون نام"}),!!i.user.phone&&(0,l.jsx)("span",{dir:"ltr",className:"mr-6",children:i.user.phone}),!!i.reservation&&(0,l.jsxs)(l.Fragment,{children:[" \xb7 رزرو ",(0,l.jsx)(o(),{href:"/admin/reservations/".concat(i.reservation.id),className:"text-primary-dark font-m",children:i.reservation.reference}),i.reservation.residence_title?" \xb7 ".concat(i.reservation.residence_title):""]})]}),(0,l.jsxs)("div",{className:"mt-8 flex flex-wrap gap-x-16 gap-y-4 text-12 leading-20 text-gray-6C6A7D",children:[(0,l.jsxs)("span",{children:["کارت واریزکننده: ",(0,l.jsxs)("b",{dir:"ltr",className:"font-m text-black",children:["••",null!==(a=i.card_last4)&&void 0!==a?a:"—"]})]}),(0,l.jsxs)("span",{children:["به حساب: ",(0,l.jsx)("b",{className:"font-m text-black",children:null!==(s=i.card_label)&&void 0!==s?s:"—"})]}),!!i.reference&&(0,l.jsxs)("span",{children:["پیگیری: ",(0,l.jsx)("b",{dir:"ltr",className:"font-m text-black",children:i.reference})]}),(0,l.jsxs)("span",{children:["ثبت: ",h," ساعت ",p]})]}),"PENDING"!==i.status&&(0,l.jsxs)("p",{className:"mt-6 text-12 leading-20 text-gray-9B9BAA",children:["APPROVED"===i.status?"تأیید ".concat((0,m.ND)(null!==(c=i.approved_amount)&&void 0!==c?c:i.amount)):"دلیل رد: ".concat(i.reject_reason),i.reviewed_by?" \xb7 ".concat(i.reviewed_by):"",i.reviewed_at?" \xb7 ".concat((0,m.A1)(i.reviewed_at).join(" ")):"",i.review_note?" \xb7 ".concat(i.review_note):""]})]})]}),"PENDING"===i.status&&(0,l.jsxs)("div",{className:"flex items-center gap-x-8 shrink-0",children:[(0,l.jsx)(m.zx,{variant:"secondary",onClick:d,children:"رد"}),(0,l.jsxs)(m.zx,{onClick:u,children:[(0,l.jsx)("i",{className:"icon-Tick text-16"})," تأیید"]})]})]})})}function N(e){var n,t,i,o=e.claim,u=e.onClose,d=e.onDone,f=(0,r.Z)((0,c.useState)(String(Math.round(o.amount))),2),j=f[0],b=f[1],g=(0,r.Z)((0,c.useState)(""),2),v=g[0],N=g[1],y=(0,r.Z)((0,c.useState)(!0),2),k=y[0],w=y[1],C=(0,r.Z)((0,c.useState)(!1),2),_=C[0],E=C[1],D=(0,r.Z)((0,c.useState)(null),2),S=D[0],A=D[1],Z=Number(j)||0,F=null!==(t=null===(n=o.reservation)||void 0===n?void 0:n.remaining_amount)&&void 0!==t?t:null;function P(){return(P=(0,a.Z)(function(e){var n,t,a,r;return(0,s.__generator)(this,function(s){switch(s.label){case 0:if(e.preventDefault(),!(Z>0))return[2];E(!0),A(null),s.label=1;case 1:return s.trys.push([1,3,4,5]),[4,(0,x.SC)("".concat(p,"/").concat(o.id,"/approve"),{method:"POST",body:JSON.stringify({amount:Z,note:v.trim()||null,advance:k})})];case 2:return t=s.sent(),d("wallet"===o.context?"".concat((0,m.ND)(Z)," به کیف پول ").concat(o.user.name||"کاربر"," اضافه شد."):t.advanced?"پرداخت ثبت شد و رزرو ".concat(null===(n=o.reservation)||void 0===n?void 0:n.reference," قطعی شد."):"پرداخت ثبت شد. ".concat(null!==(a=t.advance_note)&&void 0!==a?a:"")),[3,5];case 3:return A((r=s.sent())instanceof Error?r.message:"تأیید انجام نشد"),[3,5];case 4:return E(!1),[7];case 5:return[2]}})})).apply(this,arguments)}return(0,l.jsx)(m.u_,{open:!0,onClose:u,title:"تأیید رسید #".concat((0,m.N)(o.id)),children:(0,l.jsxs)("form",{onSubmit:function(e){return P.apply(this,arguments)},className:"flex flex-col gap-y-12",children:[(0,l.jsxs)("div",{className:"rounded-12 bg-gray-F0F0F0 px-14 py-10 text-12 leading-22 text-gray-6C6A7D",children:["واریز از کارت ",(0,l.jsxs)("b",{dir:"ltr",children:["••",o.card_last4]})," به ",null!==(i=o.card_label)&&void 0!==i?i:"حساب سایت",o.reference?(0,l.jsxs)(l.Fragment,{children:[" ","\xb7 پیگیری ",(0,l.jsx)("b",{dir:"ltr",children:o.reference})]}):null,". قبل از تأیید، واریز را در حساب بانکی پیدا کنید."]}),(0,l.jsx)(m.gN,{label:"مبلغ دریافت‌شده (تومان)",hint:null!=F?"مانده‌ی رزرو: ".concat((0,m.ND)(F)," — اعلام‌شده توسط مهمان: ").concat((0,m.ND)(o.amount)):"اعلام‌شده توسط کاربر: ".concat((0,m.ND)(o.amount)),children:(0,l.jsx)(m.II,{dir:"ltr",inputMode:"numeric",value:Z?Z.toLocaleStr
1ing("en-US"):"",onChange:function(e){return b((0,h.cQ)(e.target.value).replace(/\D/g,"").slice(0,10))}})}),"reservation"===o.context&&(0,l.jsxs)("label",{className:"flex items-start gap-x-8 text-13 leading-22 text-black cursor-pointer",children:[(0,l.jsx)("input",{type:"checkbox",checked:k,onChange:function(e){return w(e.target.checked)},className:"mt-4"}),(0,l.jsxs)("span",{children:["قطعی کردن رزرو پس از ثبت پرداخت",(0,l.jsx)("span",{className:"block text-11 leading-18 text-gray-9B9BAA",children:null!=F&&Z>=Math.round(F)?"این مبلغ مانده را تسویه می‌کند؛ رزرو قطعی، درآمد میزبان ثبت و به مهمان و میزبان اطلاع داده می‌شود.":"این مبلغ کمتر از مانده است؛ فقط پرداخت ثبت می‌شود و رزرو در انتظار پرداخت می‌ماند."})]})]}),(0,l.jsx)(m.gN,{label:"یادداشت داخلی (اختیاری)",children:(0,l.jsx)(m.II,{value:v,onChange:function(e){return N(e.target.value)},placeholder:"مثلاً: واریز ساعت ۱۴:۲۰ ملت"})}),!!S&&(0,l.jsx)("p",{className:"text-13 text-[#C62828]",children:S}),(0,l.jsxs)("div",{className:"flex items-center justify-end gap-x-10",children:[(0,l.jsx)(m.zx,{type:"button",variant:"secondary",onClick:u,children:"انصراف"}),(0,l.jsx)(m.zx,{type:"submit",disabled:_||!(Z>0),children:_?"در حال ثبت...":"wallet"===o.context?"تأیید و افزایش اعتبار":"تأیید و ثبت پرداخت"})]})]})})}function y(e){var n=e.claim,t=e.onClose,i=e.onDone,o=(0,r.Z)((0,c.useState)(""),2),u=o[0],d=o[1],h=(0,r.Z)((0,c.useState)(!1),2),f=h[0],j=h[1],g=(0,r.Z)((0,c.useState)(null),2),v=g[0],N=g[1];function y(){return(y=(0,a.Z)(function(e){var t;return(0,s.__generator)(this,function(a){switch(a.label){case 0:e.preventDefault(),j(!0),N(null),a.label=1;case 1:return a.trys.push([1,3,4,5]),[4,(0,x.SC)("".concat(p,"/").concat(n.id,"/reject"),{method:"POST",body:JSON.stringify({reason:u.trim()})})];case 2:return a.sent(),i("رسید #".concat((0,m.N)(n.id)," رد شد و به کاربر اطلاع داده شد.")),[3,5];case 3:return N((t=a.sent())instanceof Error?t.message:"رد انجام نشد"),[3,5];case 4:return j(!1),[7];case 5:return[2]}})})).apply(this,arguments)}return(0,l.jsx)(m.u_,{open:!0,onClose:t,title:"رد رسید #".concat((0,m.N)(n.id)),children:(0,l.jsxs)("form",{onSubmit:function(e){return y.apply(this,arguments)},className:"flex flex-col gap-y-12",children:[(0,l.jsx)(m.gN,{label:"دلیل رد (به کاربر نمایش داده می‌شود)",children:(0,l.jsx)("textarea",{rows:3,value:u,onChange:function(e){return d(e.target.value)},className:"w-full px-14 py-10 rounded-10 border border-gray-E5E5E6 text-14 leading-24 outline-none focus:border-primary-main transition resize-y",required:!0})}),(0,l.jsx)("div",{className:"flex flex-wrap gap-6",children:b.map(function(e){return(0,l.jsx)("button",{type:"button",onClick:function(){return d(e)},className:"rounded-8 bg-gray-F0F0F0 px-8 py-4 text-11 leading-18 text-gray-6C6A7D hover:bg-gray-E5E5E6",children:e},e)})}),"reservation"===n.context&&(0,l.jsx)("p",{className:"text-11 leading-18 text-gray-9B9BAA",children:"مهلت پرداخت رزرو دوباره تمدید می‌شود تا مهمان بتواند رسید درست را ثبت کند."}),!!v&&(0,l.jsx)("p",{className:"text-13 text-[#C62828]",children:v}),(0,l.jsxs)("div",{className:"flex items-center justify-end gap-x-10",children:[(0,l.jsx)(m.zx,{type:"button",variant:"secondary",onClick:t,children:"انصراف"}),(0,l.jsx)(m.zx,{type:"submit",variant:"danger",disabled:f||u.trim().length<3,children:f?"در حال ثبت...":"رد رسید"})]})]})})}}},function(e){e.O(0,[9791,9759,9774,2888,179],function(){return e(e.s=14831)}),_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.