PageSourceSearch

https://smartkintai.ai/assets/Subscription-lPzWiOYP.js

js smartkintai.ai collected 2026-10-05 15:06:30 UTC 9,464 bytes, 1 lines download raw bytes

1import{A as me,a as fe}from"./AdminHeader-CxaYCU54.js";import{d as q,e as f,g as n,w as t,i as r,s as l,aj as ve,r as _,c as I,o as ge,n as i,W as w,f as c,P as Y,j as m,a3 as ye,t as u,A as d,u as k,b0 as be,aR as he,af as we,F as Z,k as ke,b6 as Se,Z as Pe,ab as xe,a9 as Ce}from"./index-C6DB0I7I.js";import{_ as G}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{g as Me,a as Ae,c as Ee,b as ze,r as Le}from"./subscription-BJmfEDEa.js";import"./client-CRttDGue.js";import"./index-D5lHaTRS.js";import"./authApi-gU8Bzwv7.js";import"./employeeClient-DfmVny7z.js";const Be={class:"admin-layout"},Ne=q({__name:"AdminLayout",props:{title:{}},setup(U){return(v,P)=>{const s=r("el-header"),p=r("el-main"),g=r("el-container");return l(),f("div",Be,[n(g,null,{default:t(()=>[n(me),n(g,null,{default:t(()=>[n(s,null,{default:t(()=>[n(fe,{title:U.title},null,8,["title"])]),_:1}),n(p,null,{default:t(()=>[ve(v.$slots,"default",{},void 0,!0)]),_:3})]),_:3})]),_:3})])}}}),je=G(Ne,[["__scopeId","data-v-e330834d"]]),Te={class:"subscription-page"},De={key:0,style:{"min-height":"400px"}},Fe={class:"card-header"},Ie={class:"plan-details"},Ue={class:"plan-name"},Ve={class:"plan-description"},$e={key:0,class:"plan-price"},Je={class:"price-amount"},We={key:0,class:"action-buttons"},He={class:"feature-item"},Oe={key:1},Re=q({__name:"Subscription",setup(U){const v=_(!0),P=_(""),s=_(null),p=I(()=>{var e;return s.value&&(((e=s.value.subscription)==null?void 0:e.plan)||s.value.plan)||null}),g=I(()=>{var e;return!!((e=s.value)!=null&&e.subscription)}),Q=["timeTracking","leaveManagement","overtimeCalculation","approvalWorkflow","reports","apiAccess","customBranding","prioritySupport","dataExport"],X=I(()=>{var a;if(!((a=p.value)!=null&&a.features))return{};const e=p.value.features;return Object.fromEntries(Object.entries(e).filter(([y])=>Q.includes(y)))}),V=_([]),M=_(!1),A=_(1),E=_(10),z=_({total:0,page:1,limit:10,totalPages:0}),L=_(!1),B=async()=>{var e,a;try{v.value=!0,s.value=await Me()}catch(y){P.value=((a=(e=y.response)==null?void 0:e.data)==null?void 0:a.message)||"サブスクリプション情報の取得に失敗しました"}finally{v.value=!1}},N=async()=>{try{M.value=!0;const e=await Ae({page:A.value,limit:E.value});V.value=e.payments,z.value=e.pagination}catch{w.error("支払い履歴の取得に失敗しました")}finally{M.value=!1}},ee=async()=>
1{try{L.value=!0;const e=await Ee();window.location.href=e}catch{w.error("ポータルセッションの作成に失敗しました"),L.value=!1}},te=async()=>{try{await Ce.confirm("サブスクリプションをキャンセルすると、現在の課金期間終了時にサービスを利用できなくなります。本当にキャンセルしますか?","確認",{confirmButtonText:"キャンセルする",cancelButtonText:"戻る",type:"warning"}),await ze(),w.success("サブスクリプションをキャンセルしました"),await B()}catch(e){e!=="cancel"&&w.error("サブスクリプションのキャンセルに失敗しました")}},ae=async()=>{try{await Le(),w.success("サブスクリプションを再開しました"),await B()}catch{w.error("サブスクリプションの再開に失敗しました")}},ne=e=>{window.open(e,"_blank")},le=e=>({active:"success",trialing:"info",past_due:"warning",suspended:"danger",canceled:"info"})[e]||"",oe=e=>({active:"アクティブ",trialing:"トライアル中",past_due:"支払い期限切れ",suspended:"停止中",canceled:"キャンセル済み"})[e]||e,se=e=>({succeeded:"success",failed:"danger",pending:"warning",refunded:"info"})[e]||"",re=e=>({succeeded:"成功",failed:"失敗",pending:"保留中",refunded:"返金済み"})[e]||e,ie=e=>({timeTracking:"勤怠管理",leaveManagement:"休暇管理",overtimeCalculation:"残業計算",approvalWorkflow:"承認ワークフロー",reports:"レポート",apiAccess:"API アクセス",customBranding:"カスタムブランディング",prioritySupport:"優先サポート",dataExport:"データエクスポート"})[e]||e,$=e=>new Intl.NumberFormat("ja-JP").format(e),x=e=>new Date(e).toLocaleDateString("ja-JP");return ge(()=>{B(),N()}),(e,a)=>{const y=r("el-alert"),j=r("el-tag"),T=r("el-col"),D=r("el-descriptions-item"),ce=r("el-descriptions"),J=r("el-row"),ue=r("el-divider"),C=r("el-button"),F=r("el-card"),W=r("el-icon"),b=r("el-table-column"),de=r("el-tooltip"),pe=r("el-table"),_e=r("el-pagination"),H=ye("loading");return l(),i(je,{title:"サブスクリプション管理"},{default:t(()=>{var O;return[c("div",Te,[a[10]||(a[10]=c("div",{class:"page-header"},[c("h1",null,"サブスクリプション管理"),c("p",null,"プランの確認、支払い履歴の閲覧、サブスクリプションの管理ができます")],-1)),v.value?Y((l(),f("div",De,null,512)),[[H,v.value]]):P.value?(l(),i(y,{key:1,type:"error",title:P.value,"show-icon":"",closable:!1,style:{"margin-bottom":"24px"}},null,8,["title"])):s.value?(l(),f(Z,{key:2},[n(F,{class:"plan-card",shadow:"hover"},{header:t(()=>[c("div",Fe,[a[2]||(a[2]=c("h2",null,"現在のプラン",-1)),n(j,{type:le(s.value.tenant.subscriptionStatus),size:"large"},{default:t(()=>[d(u(oe(s.value.tenant.subscriptionStatus)),1)]),_:1},8,["type"])])]),default:t(()=>{var o,h;return[n(J,{gutter:24},{default:t(()=>[n(T,{xs:24,md:12},{default:t(()=>{var S,R,K;return[c("div",Ie,[c("h3",Ue,u(((S=p.value)==null?void 0:S.displayName)||"未設定"),1),c("p",Ve,u(((R=p.value)==null?void 0:R.description)||""),1),p.value?(l(),f("div",$e,[c("span",Je,u(((K=p.value.currency)==null?void 0:K.toUpperCase())||"JPY")+" "+u($(p.value.monthlyPrice||0)),1),a[3]||(a[3]=c("span",{class:"price-period"},"/ 月",-1))])):m("",!0)])]}),_:1}),n(T,{xs:24,md:12},{default:t(()=>[n(ce,{column:1,border:""},{default:t(()=>{var S;return[s.value.tenant.currentPeriodStart?(l(),i(D,{key:0,label:"課金期間開始"},{default:t(()=>[d(u(x(s.value.tenant.currentPeriodStart)),1)]),_:1})):m("",!0),s.value.tenant.currentPeriodEnd?(l(),i(D,{key:1,label:"課金期間終了"},{default:t(()=>[d(u(x(s.value.tenant.currentPeriodEnd)),1)]),_:1})):m("",!0),g.value&&((S=s.value.subscription)!=null&&S.cancelAtPeriodEnd)?(l(),i(D,{key:2,label:"キャンセル予定"},{default:t(()=>[n(j,{type:"danger"},{default:t(()=>[...a[4]||(a[4]=[d("期間終了時に停止予定",-1)])]),_:1})]),_:1})):m("",!0)]}),_:1})]),_:1})]),_:1}),n(ue),g.value?(l(),f("div",We,[n(C,{type:"primary",icon:k(be),onClick:ee,loading:L.value},{default:t(()=>[...a[5]||(a[5]=[d(" 支払い方法を変更 ",-1)])]),_:1},8,["icon","loading"]),(o=s.value.subscription)!=null&&o.cancelAtPeriodEnd?(l(),i(C,{key:1,type:"success",icon:k(we),onClick:ae},{default:t(()=>[...a[7]||(a[7]=[d(" キャンセルを取り消し ",-1)])]),_:1}
1,8,["icon"])):(l(),i(C,{key:0,type:"danger",icon:k(he),onClick:te},{default:t(()=>[...a[6]||(a[6]=[d(" サブスクリプションをキャンセル ",-1)])]),_:1},8,["icon"]))])):m("",!0),g.value&&((h=s.value.subscription)!=null&&h.cancelAtPeriodEnd)?(l(),i(y,{key:1,type:"warning",closable:!1,style:{"margin-top":"16px"}},{title:t(()=>[d(" サブスクリプションはキャンセル予定です。 "+u(x(s.value.tenant.currentPeriodEnd))+" 以降、サービスをご利用いただけなくなります。 ",1)]),_:1})):m("",!0)]}),_:1}),(O=p.value)!=null&&O.features?(l(),i(F,{key:0,class:"features-card",shadow:"hover",style:{"margin-top":"24px"}},{header:t(()=>[...a[8]||(a[8]=[c("h2",null,"プラン機能",-1)])]),default:t(()=>[n(J,{gutter:16},{default:t(()=>[(l(!0),f(Z,null,ke(X.value,(o,h)=>(l(),i(T,{key:h,xs:24,sm:12,md:8},{default:t(()=>[c("div",He,[o?(l(),i(W,{key:0,color:"#67c23a",size:20},{default:t(()=>[n(k(Se))]),_:1})):(l(),i(W,{key:1,color:"#909399",size:20},{default:t(()=>[n(k(Pe))]),_:1})),c("span",null,u(ie(String(h))),1)])]),_:2},1024))),128))]),_:1})]),_:1})):m("",!0),n(F,{class:"payment-card",shadow:"hover",style:{"margin-top":"24px"}},{header:t(()=>[...a[9]||(a[9]=[c("h2",null,"支払い履歴",-1)])]),default:t(()=>[Y((l(),i(pe,{data:V.value,stripe:"",style:{width:"100%"}},{default:t(()=>[n(b,{label:"請求日",width:"120"},{default:t(({row:o})=>[d(u(x(o.createdAt)),1)]),_:1}),n(b,{prop:"subscription.plan.displayName",label:"プラン",width:"150"}),n(b,{label:"金額",width:"120"},{default:t(({row:o})=>[d(u(o.currency.toUpperCase())+" "+u($(o.amount)),1)]),_:1}),n(b,{label:"ステータス",width:"100"},{default:t(({row:o})=>[n(j,{type:se(o.status),size:"small"},{default:t(()=>[d(u(re(o.status)),1)]),_:2},1032,["type"])]),_:1}),n(b,{prop:"failureMessage",label:"エラーメッセージ","min-width":"200","show-overflow-tooltip":""}),n(b,{label:"操作",width:"60",fixed:"right",align:"center"},{default:t(({row:o})=>[o.invoicePdfUrl?(l(),i(de,{key:0,content:"請求書",placement:"top"},{default:t(()=>[n(C,{size:"small",circle:"",type:"primary",icon:k(xe),onClick:h=>ne(o.invoicePdfUrl)},null,8,["icon","onClick"])]),_:2},1024)):(l(),f("span",Oe,"-"))]),_:1})]),_:1},8,["data"])),[[H,M.value]]),z.value.total>0?(l(),i(_e,{key:0,"current-page":A.value,"onUpdate:currentPage":a[0]||(a[0]=o=>A.value=o),"page-size":E.value,"onUpdate:pageSize":a[1]||(a[1]=o=>E.value=o),total:z.value.total,"page-sizes":[10,20,50],layout:"total, sizes, prev, pager, next",style:{"margin-top":"16px","justify-content":"center"},onCurrentChange:N,onSizeChange:N},null,8,["current-page","page-size","total"])):m("",!0)]),_:1})],64)):m("",!0)])]}),_:1})}}}),tt=G(Re,[["__scopeId","data-v-5fd25590"]]);export{tt 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.