You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
3.7 KiB

import{n as e}from"./axios-CiYFffbI.js";import{I as t,N as n,V as r,Y as i,_ as a,d as o,it as s,kt as c,nt as l,ut as u,v as d,y as f}from"./runtime-core.esm-bundler-CnFWH3R5.js";import{n as p}from"./index-BvpdbDif.js";import{n as m,t as h}from"./datetime-3T8f3S0H.js";import{t as g}from"./listTable-Dphyh0Bn.js";import{t as _}from"./bookingType-CGtYk0HZ.js";import{t as v}from"./reservationStatus-DfEgE0qr.js";var y=f({__name:`TicketGrabRegistrations`,setup(f){let y=s(!1),b=s(`all`),x=s(``),S=s([]),C=l({current:1,pageSize:10,total:0}),w=s([]);async function T(){y.value=!0;try{let{data:e}=await p.get(`/activity-registrations`,{params:{reservation_kind:`ticket_grab`,status:b.value,keyword:x.value||void 0,start_date:S.value?.[0]||void 0,end_date:S.value?.[1]||void 0,page:C.current,page_size:C.pageSize}});w.value=e.data,C.total=e.total}catch(t){e.error(t?.response?.data?.message??`加载失败`)}finally{y.value=!1}}function E(e){C.current=e,T()}function D(e){C.pageSize=e,C.current=1,T()}return n(T),(e,n)=>{let s=r(`a-radio`),l=r(`a-radio-group`),f=r(`a-input`),p=r(`a-range-picker`),O=r(`a-button`),k=r(`a-space`),A=r(`a-table-column`),j=r(`a-tag`),M=r(`a-table`),N=r(`a-card`);return t(),o(N,{title:`抢票管理 / 抢票报名`,bordered:!1},{default:i(()=>[d(k,{direction:`vertical`,fill:``},{default:i(()=>[d(k,{wrap:``,size:12},{default:i(()=>[d(l,{modelValue:b.value,"onUpdate:modelValue":n[0]||=e=>b.value=e,type:`button`,size:`small`,onChange:T},{default:i(()=>[d(s,{value:`all`},{default:i(()=>[...n[5]||=[a(`全部`,-1)]]),_:1}),d(s,{value:`pending`},{default:i(()=>[...n[6]||=[a(`待核销`,-1)]]),_:1}),d(s,{value:`verified`},{default:i(()=>[...n[7]||=[a(`已核销`,-1)]]),_:1}),d(s,{value:`cancelled`},{default:i(()=>[...n[8]||=[a(`已取消`,-1)]]),_:1}),d(s,{value:`expired`},{default:i(()=>[...n[9]||=[a(`已过期`,-1)]]),_:1})]),_:1},8,[`modelValue`]),d(f,{modelValue:x.value,"onUpdate:modelValue":n[1]||=e=>x.value=e,placeholder:`姓名 / 身份证 / token`,"allow-clear":``,style:{width:`220px`}},null,8,[`modelValue`]),d(p,{modelValue:S.value,"onUpdate:modelValue":n[2]||=e=>S.value=e,style:{width:`260px`}},null,8,[`modelValue`]),d(O,{type:`primary`,onClick:n[3]||=()=>{C.current=1,T()}},{default:i(()=>[...n[10]||=[a(` 查询 `,-1)]]),_:1}),d(O,{onClick:n[4]||=()=>{b.value=`all`,x.value=``,S.value=[],C.current=1,T()}},{default:i(()=>[...n[11]||=[a(` 重置 `,-1)]]),_:1}),d(O,{onClick:T},{default:i(()=>[...n[12]||=[a(`刷新`,-1)]]),_:1})]),_:1}),d(M,{scroll:{x:u(g)},data:w.value,loading:y.value,"row-key":`id`,pagination:{current:C.current,pageSize:C.pageSize,total:C.total,showTotal:!0,onChange:E,onPageSizeChange:D}},{columns:i(()=>[d(A,{title:`ID`,"data-index":`id`,width:80}),d(A,{title:`抢票活动`,width:200,ellipsis:!0,tooltip:!0},{cell:i(({record:e})=>[a(c(e.ticket_grab_event?.title??`-`),1)]),_:1}),d(A,{title:`场馆`,width:160,ellipsis:!0,tooltip:!0},{cell:i(({record:e})=>[a(c(e.venue?.name??`-`),1)]),_:1}),d(A,{title:`姓名`,"data-index":`visitor_name`,width:100}),d(A,{title:`身份证`,"data-index":`id_card`,width:180,ellipsis:!0,tooltip:!0}),d(A,{title:`入馆日`,width:120},{cell:i(({record:e})=>[a(c(e.entry_date?u(m)(String(e.entry_date)):`-`),1)]),_:1}),d(A,{title:`预约类型`,width:100},{cell:i(({record:e})=>[a(c(u(_)(e.booking_type,e.ticket_count)),1)]),_:1}),d(A,{title:`票数`,width:80},{cell:i(({record:e})=>[a(c(e.ticket_count??1),1)]),_:1}),d(A,{title:`状态`,width:100},{cell:i(({record:e})=>[d(j,{color:e.status===`verified`?`green`:e.status===`pending`?`arcoblue`:`gray`},{default:i(()=>[a(c(u(v)(e.status)),1)]),_:2},1032,[`color`])]),_:1}),d(A,{title:`下单时间`,width:170},{cell:i(({record:e})=>[a(c(u(h)(e.created_at)),1)]),_:1})]),_:1},8,[`scroll`,`data`,`loading`,`pagination`])]),_:1})]),_:1})}}});export{y as default};